Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
cd218003
Commit
cd218003
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Check whether feenableexcept() exists before using it.
parent
77cb85ee
No related branches found
No related tags found
1 merge request
!442
Support for OSX
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
configure.ac
+5
-1
5 additions, 1 deletion
configure.ac
examples/main.c
+6
-0
6 additions, 0 deletions
examples/main.c
with
11 additions
and
1 deletion
configure.ac
+
5
−
1
View file @
cd218003
...
...
@@ -381,7 +381,7 @@ AX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
AC_CHECK_LIB(pthread, pthread_barrier_init,
AC_DEFINE([HAVE_PTHREAD_BARRIERS], [1], [The posix library implements barriers]),
AC_MSG_WARN(POSIX implementation does not have barriers. SWIFT will use home-made ones.))
AC_MSG_WARN(POSIX implementation does not have barriers. SWIFT will use home-made ones.))
# Check for metis. Note AX_LIB_METIS exists, but cannot be configured
# to be default off (i.e. given no option it tries to locate METIS), so we
...
...
@@ -551,6 +551,10 @@ if test "$with_hdf5" = "yes"; then
fi
AM_CONDITIONAL([HAVEPARALLELHDF5],[test "$have_parallel_hdf5" = "yes"])
# Check for floating-point execeptions
AC_CHECK_FUNC(feenableexcept, AC_DEFINE([HAVE_FE_ENABLE_EXCEPT],[1],
[Defined if the floating-point exception can be enabled using non-standard GNU functions.]))
# Check for setaffinity.
AC_CHECK_FUNC(pthread_setaffinity_np, AC_DEFINE([HAVE_SETAFFINITY],[1],
[Defined if pthread_setaffinity_np exists.]) )
...
...
This diff is collapsed.
Click to expand it.
examples/main.c
+
6
−
0
View file @
cd218003
...
...
@@ -203,7 +203,11 @@ int main(int argc, char *argv[]) {
with_drift_all
=
1
;
break
;
case
'e'
:
#ifdef HAVE_FE_ENABLE_EXCEPT
with_fp_exceptions
=
1
;
#else
error
(
"Need support for floating point exception on this platform"
);
#endif
break
;
case
'f'
:
if
(
sscanf
(
optarg
,
"%llu"
,
&
cpufreq
)
!=
1
)
{
...
...
@@ -379,7 +383,9 @@ int main(int argc, char *argv[]) {
/* Do we choke on FP-exceptions ? */
if
(
with_fp_exceptions
)
{
#ifdef HAVE_FE_ENABLE_EXCEPT
feenableexcept
(
FE_DIVBYZERO
|
FE_INVALID
|
FE_OVERFLOW
);
#endif
if
(
myrank
==
0
)
message
(
"WARNING: Floating point exceptions will be reported."
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment