@@ -596,6 +596,21 @@ done
596596AC_SUBST ( OPENMP_CXXFLAGS ,"$OPENMP_CXXFLAGS" )
597597AC_SUBST ( OPENMP_LIBS ,"$OPENMP_LIBS" )
598598
599+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358
600+ AC_MSG_CHECKING ( [ whether we need to link with -latomic] )
601+ AC_LANG ( [ C++] )
602+ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [
603+ #include <atomic>
604+ ] , [ std::atomic<int64_t> x; x++] ) ] ,
605+ [ AC_MSG_RESULT ( [ no] ) ] ,
606+ [ LIBS="$LIBS -latomic"
607+ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [
608+ #include <atomic>
609+ ] , [ std::atomic<int64_t> x; x++] ) ] ,
610+ [ AC_MSG_RESULT ( [ yes] ) ] ,
611+ [ AC_MSG_RESULT ( [ error] )
612+ AC_MSG_ERROR ( [ unable to handle 64-bit atomics] ) ] ) ] )
613+
599614# ############################################################################
600615AC_SUBST ( BUILTLIBS )
601616# The list BUILTLIBS is the list of link options for the libraries we have decided to build,
@@ -1845,21 +1860,6 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([int main() {}])],
18451860rm -f conftest.mapfile
18461861LDFLAGS=$SAVE
18471862
1848- # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358
1849- AC_MSG_CHECKING ( [ whether we need to link with -latomic] )
1850- AC_LANG ( [ C++] )
1851- AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [
1852- #include <atomic>
1853- ] , [ std::atomic<int64_t> x; x++] ) ] ,
1854- [ AC_MSG_RESULT ( [ no] ) ] ,
1855- [ LIBS="$LIBS -latomic"
1856- AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [
1857- #include <atomic>
1858- ] , [ std::atomic<int64_t> x; x++] ) ] ,
1859- [ AC_MSG_RESULT ( [ yes] ) ] ,
1860- [ AC_MSG_RESULT ( [ error] )
1861- AC_MSG_ERROR ( [ unable to handle 64-bit atomics] ) ] ) ] )
1862-
18631863AC_SUBST ( DUMPDATAFILE ,Macaulay2-$ARCH-data )
18641864
18651865test "$MEMDEBUG" = yes && M2_CPPFLAGS="$M2_CPPFLAGS -DMEMDEBUG"
0 commit comments