@@ -622,6 +622,9 @@ MPILIBS
622622MPI_CLIBS
623623MPI_CFLAGS
624624MPICC
625+ FOUND_SAPPORO2
626+ SAPPORO2_LIBS
627+ SAPPORO2_CFLAGS
625628FOUND_SAPPORO_LIGHT
626629SAPPORO_LIGHT_LIBS
627630SAPPORO_LIGHT_CFLAGS
@@ -720,6 +723,8 @@ STOPCOND_CFLAGS
720723STOPCOND_LIBS
721724SAPPORO_LIGHT_CFLAGS
722725SAPPORO_LIGHT_LIBS
726+ SAPPORO2_CFLAGS
727+ SAPPORO2_LIBS
723728MPICC
724729MPICXX'
725730
@@ -1364,6 +1369,10 @@ Some influential environment variables:
13641369 C compiler flags for SAPPORO_LIGHT, overriding pkg-config
13651370 SAPPORO_LIGHT_LIBS
13661371 linker flags for SAPPORO_LIGHT, overriding pkg-config
1372+ SAPPORO2_CFLAGS
1373+ C compiler flags for SAPPORO2, overriding pkg-config
1374+ SAPPORO2_LIBS
1375+ linker flags for SAPPORO2, overriding pkg-config
13671376 MPICC MPI C compiler command
13681377 MPICXX MPI C++ compiler command
13691378
@@ -5256,6 +5265,211 @@ fi
52565265
52575266
52585267
5268+ amuse_save_LIBS=" $LIBS "
5269+ amuse_save_LIB_CFLAGS=" $SAPPORO2_CFLAGS "
5270+ amuse_save_LIB_LIBS=" $SAPPORO2_LIBS "
5271+ amuse_save_PKG_CONFIG_PATH=" $PKG_CONFIG_PATH "
5272+
5273+ # If we have an active virtualenv, make sure pkg-config searches it
5274+ if test " a${VIRTUAL_ENV} " ! = " a"
5275+ then
5276+ PKG_CONFIG_PATH=" ${VIRTUAL_ENV} /lib/pkgconfig:${PKG_CONFIG_PATH} "
5277+ fi
5278+
5279+ # All AMUSE libs export C symbols
5280+ ac_ext=c
5281+ ac_cpp=' $CPP $CPPFLAGS'
5282+ ac_compile=' $CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5283+ ac_link=' $CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5284+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
5285+
5286+
5287+ # Search for the library, first directly then fall back to pkg-config
5288+ { printf " %s\n" " $as_me :${as_lineno-$LINENO } : checking for library containing numberOfGPUUsedBySapporo" >&5
5289+ printf %s " checking for library containing numberOfGPUUsedBySapporo... " >&6 ; }
5290+ if test ${ac_cv_search_numberOfGPUUsedBySapporo+y}
5291+ then :
5292+ printf %s " (cached) " >&6
5293+ else $as_nop
5294+ ac_func_search_save_LIBS=$LIBS
5295+ cat confdefs.h - << _ACEOF >conftest.$ac_ext
5296+ /* end confdefs.h. */
5297+
5298+ /* Override any GCC internal prototype to avoid an error.
5299+ Use char because int might match the return type of a GCC
5300+ builtin and then its argument prototype would still apply. */
5301+ char numberOfGPUUsedBySapporo ();
5302+ int
5303+ main (void)
5304+ {
5305+ return numberOfGPUUsedBySapporo ();
5306+ ;
5307+ return 0;
5308+ }
5309+ _ACEOF
5310+ for ac_lib in ' ' sapporo2
5311+ do
5312+ if test -z " $ac_lib " ; then
5313+ ac_res=" none required"
5314+ else
5315+ ac_res=-l$ac_lib
5316+ LIBS=" -l$ac_lib $ac_func_search_save_LIBS "
5317+ fi
5318+ if ac_fn_c_try_link " $LINENO "
5319+ then :
5320+ ac_cv_search_numberOfGPUUsedBySapporo=$ac_res
5321+ fi
5322+ rm -f core conftest.err conftest.$ac_objext conftest.beam \
5323+ conftest$ac_exeext
5324+ if test ${ac_cv_search_numberOfGPUUsedBySapporo+y}
5325+ then :
5326+ break
5327+ fi
5328+ done
5329+ if test ${ac_cv_search_numberOfGPUUsedBySapporo+y}
5330+ then :
5331+
5332+ else $as_nop
5333+ ac_cv_search_numberOfGPUUsedBySapporo=no
5334+ fi
5335+ rm conftest.$ac_ext
5336+ LIBS=$ac_func_search_save_LIBS
5337+ fi
5338+ { printf " %s\n" " $as_me :${as_lineno-$LINENO } : result: $ac_cv_search_numberOfGPUUsedBySapporo " >&5
5339+ printf " %s\n" " $ac_cv_search_numberOfGPUUsedBySapporo " >&6 ; }
5340+ ac_res=$ac_cv_search_numberOfGPUUsedBySapporo
5341+ if test " $ac_res " ! = no
5342+ then :
5343+ test " $ac_res " = " none required" || LIBS=" $ac_res $LIBS "
5344+
5345+ FOUND_SAPPORO2=" yes"
5346+ SAPPORO2_LIBS=" $LIBS "
5347+ SAPPORO2_CFLAGS=" "
5348+
5349+ else $as_nop
5350+
5351+
5352+ pkg_failed=no
5353+ { printf " %s\n" " $as_me :${as_lineno-$LINENO } : checking for SAPPORO2" >&5
5354+ printf %s " checking for SAPPORO2... " >&6 ; }
5355+
5356+ if test -n " $SAPPORO2_CFLAGS " ; then
5357+ pkg_cv_SAPPORO2_CFLAGS=" $SAPPORO2_CFLAGS "
5358+ elif test -n " $PKG_CONFIG " ; then
5359+ if test -n " $PKG_CONFIG " && \
5360+ { { printf " %s\n" " $as_me :${as_lineno-$LINENO } : \$ PKG_CONFIG --exists --print-errors \" sapporo2\" " ; } >&5
5361+ ($PKG_CONFIG --exists --print-errors " sapporo2" ) 2>&5
5362+ ac_status=$?
5363+ printf " %s\n" " $as_me :${as_lineno-$LINENO } : \$ ? = $ac_status " >&5
5364+ test $ac_status = 0; }; then
5365+ pkg_cv_SAPPORO2_CFLAGS=` $PKG_CONFIG --cflags " sapporo2" 2> /dev/null`
5366+ test " x$? " ! = " x0" && pkg_failed=yes
5367+ else
5368+ pkg_failed=yes
5369+ fi
5370+ else
5371+ pkg_failed=untried
5372+ fi
5373+ if test -n " $SAPPORO2_LIBS " ; then
5374+ pkg_cv_SAPPORO2_LIBS=" $SAPPORO2_LIBS "
5375+ elif test -n " $PKG_CONFIG " ; then
5376+ if test -n " $PKG_CONFIG " && \
5377+ { { printf " %s\n" " $as_me :${as_lineno-$LINENO } : \$ PKG_CONFIG --exists --print-errors \" sapporo2\" " ; } >&5
5378+ ($PKG_CONFIG --exists --print-errors " sapporo2" ) 2>&5
5379+ ac_status=$?
5380+ printf " %s\n" " $as_me :${as_lineno-$LINENO } : \$ ? = $ac_status " >&5
5381+ test $ac_status = 0; }; then
5382+ pkg_cv_SAPPORO2_LIBS=` $PKG_CONFIG --libs " sapporo2" 2> /dev/null`
5383+ test " x$? " ! = " x0" && pkg_failed=yes
5384+ else
5385+ pkg_failed=yes
5386+ fi
5387+ else
5388+ pkg_failed=untried
5389+ fi
5390+
5391+
5392+
5393+ if test $pkg_failed = yes; then
5394+ { printf " %s\n" " $as_me :${as_lineno-$LINENO } : result: no" >&5
5395+ printf " %s\n" " no" >&6 ; }
5396+
5397+ if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5398+ _pkg_short_errors_supported=yes
5399+ else
5400+ _pkg_short_errors_supported=no
5401+ fi
5402+ if test $_pkg_short_errors_supported = yes; then
5403+ SAPPORO2_PKG_ERRORS=` $PKG_CONFIG --short-errors --print-errors --cflags --libs " sapporo2" 2>&1 `
5404+ else
5405+ SAPPORO2_PKG_ERRORS=` $PKG_CONFIG --print-errors --cflags --libs " sapporo2" 2>&1 `
5406+ fi
5407+ # Put the nasty error message in config.log where it belongs
5408+ echo " $SAPPORO2_PKG_ERRORS " >&5
5409+
5410+
5411+ FOUND_SAPPORO2=" no"
5412+
5413+ elif test $pkg_failed = untried; then
5414+ { printf " %s\n" " $as_me :${as_lineno-$LINENO } : result: no" >&5
5415+ printf " %s\n" " no" >&6 ; }
5416+
5417+ FOUND_SAPPORO2=" no"
5418+
5419+ else
5420+ SAPPORO2_CFLAGS=$pkg_cv_SAPPORO2_CFLAGS
5421+ SAPPORO2_LIBS=$pkg_cv_SAPPORO2_LIBS
5422+ { printf " %s\n" " $as_me :${as_lineno-$LINENO } : result: yes" >&5
5423+ printf " %s\n" " yes" >&6 ; }
5424+
5425+ FOUND_SAPPORO2=" yes"
5426+
5427+ fi
5428+
5429+ fi
5430+
5431+
5432+ ac_ext=c
5433+ ac_cpp=' $CPP $CPPFLAGS'
5434+ ac_compile=' $CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5435+ ac_link=' $CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5436+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
5437+
5438+
5439+ PKG_CONFIG_PATH=" $amuse_save_PKG_CONFIG_PATH "
5440+ LIBS=" $amuse_save_LIBS "
5441+
5442+ # If we have an active CONDA environment, assume that the lib is coming from
5443+ # there and add an additional flag so that .mod files can be found. Only really
5444+ # needed for stopcond and forsockets, and hopefully conda-forge will give us a
5445+ # better solution soon.
5446+ if test " ${FOUND_SAPPORO2} " == " yes" -a " x$CONDA_PREFIX " ! = " x"
5447+ then
5448+ SAPPORO2_CFLAGS=" ${SAPPORO2_CFLAGS} -I${CONDA_PREFIX} /include"
5449+ fi
5450+
5451+ # If the user overrode the variables, go with what they set instead of
5452+ # what we just detected.
5453+ if test " x$amuse_save_LIB_CFLAGS " ! = " x"
5454+ then :
5455+
5456+ SAPPORO2_CFLAGS=" $amuse_save_LIB_CFLAGS "
5457+
5458+ fi
5459+ if test " x$amuse_save_LIB_LIBS " ! = " x"
5460+ then :
5461+
5462+ SAPPORO2_LIBS=" $amuse_save_LIB_LIBS "
5463+
5464+ fi
5465+
5466+
5467+
5468+
5469+
5470+
5471+
5472+
52595473# Find external dependencies
52605474ac_ext=c
52615475ac_cpp=' $CPP $CPPFLAGS'
0 commit comments