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

Merge branch 'darwin/macos_config' into 'master'

Improve ./configure script to fix macOS function detection issues

See merge request !2102
parents 243068cf c000b124
No related branches found
No related tags found
1 merge request!2102Improve ./configure script to fix macOS function detection issues
......@@ -1871,14 +1871,12 @@ if test "$have_armv7apmccntr"x = "yes"x; then
fi
# 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.
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.])])
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],[__exp10f], [AC_DEFINE([HAVE___EXP10F],1,[The __exp10f function is present.])])
fi
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.])])
# 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
......@@ -1889,7 +1887,15 @@ if test "$ax_cv_c_compiler_vendor" = "clang"; then
AC_CHECK_LIB([m],[__sincos], [AC_DEFINE([HAVE___SINCOS],1,[The __sincos function is present.])])
AC_CHECK_LIB([m],[__sincosf], [AC_DEFINE([HAVE___SINCOSF],1,[The __sincosf function is present.])])
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
# 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
......
......@@ -19,6 +19,7 @@
/* local headers */
#include "initial_mass_function.h"
#include "exp10.h"
#include "hdf5_functions.h"
#include "stellar_evolution_struct.h"
......
......@@ -28,6 +28,7 @@
#include "stellar_evolution_struct.h"
#include "supernovae_ia.h"
#include "supernovae_ii.h"
#include "exp10.h"
#include <math.h>
#include <stddef.h>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment