@@ -604,6 +604,21 @@ done
604604AC_SUBST ( OPENMP_CXXFLAGS ,"$OPENMP_CXXFLAGS" )
605605AC_SUBST ( OPENMP_LIBS ,"$OPENMP_LIBS" )
606606
607+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358
608+ AC_MSG_CHECKING ( [ whether we need to link with -latomic] )
609+ AC_LANG ( [ C++] )
610+ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [
611+ #include <atomic>
612+ ] , [ std::atomic<int64_t> x; x++] ) ] ,
613+ [ AC_MSG_RESULT ( [ no] ) ] ,
614+ [ LIBS="$LIBS -latomic"
615+ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [
616+ #include <atomic>
617+ ] , [ std::atomic<int64_t> x; x++] ) ] ,
618+ [ AC_MSG_RESULT ( [ yes] ) ] ,
619+ [ AC_MSG_RESULT ( [ error] )
620+ AC_MSG_ERROR ( [ unable to handle 64-bit atomics] ) ] ) ] )
621+
607622# ############################################################################
608623AC_SUBST ( BUILTLIBS )
609624# The list BUILTLIBS is the list of link options for the libraries we have decided to build,
@@ -1850,21 +1865,6 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([int main() {}])],
18501865rm -f conftest.mapfile
18511866LDFLAGS=$SAVE
18521867
1853- # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358
1854- AC_MSG_CHECKING ( [ whether we need to link with -latomic] )
1855- AC_LANG ( [ C++] )
1856- AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [
1857- #include <atomic>
1858- ] , [ std::atomic<int64_t> x; x++] ) ] ,
1859- [ AC_MSG_RESULT ( [ no] ) ] ,
1860- [ LIBS="$LIBS -latomic"
1861- AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [
1862- #include <atomic>
1863- ] , [ std::atomic<int64_t> x; x++] ) ] ,
1864- [ AC_MSG_RESULT ( [ yes] ) ] ,
1865- [ AC_MSG_RESULT ( [ error] )
1866- AC_MSG_ERROR ( [ unable to handle 64-bit atomics] ) ] ) ] )
1867-
18681868AC_SUBST ( DUMPDATAFILE ,Macaulay2-$ARCH-data )
18691869
18701870test "$MEMDEBUG" = yes && M2_CPPFLAGS="$M2_CPPFLAGS -DMEMDEBUG"
0 commit comments