Skip to content
Snippets Groups Projects
Commit c000b124 authored by Darwin's avatar Darwin Committed by Matthieu Schaller
Browse files

Improve ./configure script to fix macOS function detection issues

parent fa5d752f
Branches
Tags
3 merge requests!2180Mhd canvas into MHD_FS,!2165Merge master,!2102Improve ./configure script to fix macOS function detection issues
...@@ -1839,14 +1839,12 @@ if test "$have_armv7apmccntr"x = "yes"x; then ...@@ -1839,14 +1839,12 @@ if test "$have_armv7apmccntr"x = "yes"x; then
fi fi
# Check if we have native exp10 and exp10f functions. If not fallback to our # Check if we have native exp10 and exp10f functions. If not fallback to our
# implementations. On Apple/CLANG we have __exp10, so also check for that # implementations. On Apple/CLANG/Homebrew gcc we have __exp10, so also check for that
# if the compiler is clang. # if the compiler is clang.
AC_CHECK_LIB([m],[exp10], [AC_DEFINE([HAVE_EXP10],1,[The exp10 function is present.])]) AC_CHECK_LIB([m],[exp10], [AC_DEFINE([HAVE_EXP10],1,[The exp10 function is present.])])
AC_CHECK_LIB([m],[exp10f], [AC_DEFINE([HAVE_EXP10F],1,[The exp10f function is present.])]) AC_CHECK_LIB([m],[exp10f], [AC_DEFINE([HAVE_EXP10F],1,[The exp10f function is present.])])
if test "$ax_cv_c_compiler_vendor" = "clang"; then
AC_CHECK_LIB([m],[__exp10], [AC_DEFINE([HAVE___EXP10],1,[The __exp10 function is present.])]) AC_CHECK_LIB([m],[__exp10], [AC_DEFINE([HAVE___EXP10],1,[The __exp10 function is present.])])
AC_CHECK_LIB([m],[__exp10f], [AC_DEFINE([HAVE___EXP10F],1,[The __exp10f function is present.])]) AC_CHECK_LIB([m],[__exp10f], [AC_DEFINE([HAVE___EXP10F],1,[The __exp10f function is present.])])
fi
# Check if we have native sincos and sincosf functions. If not fallback to our # Check if we have native sincos and sincosf functions. If not fallback to our
# implementations. On Apple/CLANG we have __sincos, so also check for that # implementations. On Apple/CLANG we have __sincos, so also check for that
...@@ -1858,6 +1856,14 @@ if test "$ax_cv_c_compiler_vendor" = "clang"; then ...@@ -1858,6 +1856,14 @@ if test "$ax_cv_c_compiler_vendor" = "clang"; then
AC_CHECK_LIB([m],[__sincosf], [AC_DEFINE([HAVE___SINCOSF],1,[The __sincosf function is present.])]) AC_CHECK_LIB([m],[__sincosf], [AC_DEFINE([HAVE___SINCOSF],1,[The __sincosf function is present.])])
fi fi
# On Apple (CLANG or Homebrew gcc), check for __sincos and __sincosf inline functions in the headers.
AC_CHECK_HEADERS([math.h], [
AC_CHECK_DECLS([__sincos, __sincosf], [
AC_DEFINE([HAVE___SINCOS], 1, [The __sincos function is present.])
AC_DEFINE([HAVE___SINCOSF], 1, [The __sincosf function is present.])
], [], [#include <math.h>])
])
# The aocc compiler has optimized maths libraries that we should use. Check # The aocc compiler has optimized maths libraries that we should use. Check
# any clang for this support. Note do this after the basic check for maths # any clang for this support. Note do this after the basic check for maths
# as we need to make sure -lm follows. Also note needs -Ofast or -ffast-math # as we need to make sure -lm follows. Also note needs -Ofast or -ffast-math
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
/* local headers */ /* local headers */
#include "initial_mass_function.h" #include "initial_mass_function.h"
#include "exp10.h"
#include "hdf5_functions.h" #include "hdf5_functions.h"
#include "stellar_evolution_struct.h" #include "stellar_evolution_struct.h"
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "stellar_evolution_struct.h" #include "stellar_evolution_struct.h"
#include "supernovae_ia.h" #include "supernovae_ia.h"
#include "supernovae_ii.h" #include "supernovae_ii.h"
#include "exp10.h"
#include <math.h> #include <math.h>
#include <stddef.h> #include <stddef.h>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment