Changeset 4998
- Timestamp:
- 07/20/09 11:35:52 (4 months ago)
- Location:
- mpich2/trunk
- Files:
-
- 2 modified
-
confdb/aclocal_subcfg.m4 (modified) (3 diffs)
-
configure.in (modified) (29 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mpich2/trunk/confdb/aclocal_subcfg.m4
r4763 r4998 1 dnl2 1 dnl PAC_MPICH2_INIT - Initialization routine for top-level mpich2 configure.in. 3 2 dnl Call before invocation of mpich2's subpackage configure 4 dnl5 3 AC_DEFUN([PAC_MPICH2_INIT],[ 6 4 # Exporting the MPICH2_INTERNAL_xFLAGS with modified xFLAGS 7 5 # before calling subconfigure. 8 # Check if the env variable MPICH2_UNIQ_XFLAGS is set to no.9 # MPICH2_UNIQ_XFLAGS is default to yes. It is a way to check10 # if uniq'ed MPICH2_EXTRA_xFLAGS messes up xFLAGS.11 pac_replace=${MPICH2_UNIQ_XFLAGS:-yes}12 # Use user-supplied flags, WRAPPER_xFLAGS, and uniq'ed MPICH2_EXTRA_xFLAGS.13 if test "$pac_replace" = "yes" ; then14 CFLAGS="$WRAPPER_CFLAGS $MPICH2_EXTRA_CFLAGS"15 CXXFLAGS="$WRAPPER_CXXFLAGS $MPICH2_EXTRA_CXXFLAGS"16 FFLAGS="$WRAPPER_FFLAGS $MPICH2_EXTRA_FFLAGS"17 F90FLAGS="$WRAPPER_F90FLAGS $MPICH2_EXTRA_F90FLAGS"18 fi19 6 MPICH2_INTERNAL_CFLAGS="$CFLAGS" 20 7 MPICH2_INTERNAL_CXXFLAGS="$CXXFLAGS" … … 26 13 export MPICH2_INTERNAL_F90FLAGS 27 14 # Not sure if we need AC_SUBST(MPICH2_INTERNAL_xFLAGS) 28 ]) dnl29 dnl 30 dnl 15 ]) 16 17 31 18 dnl PAC_SUBCONFIG_INIT - Initialization routine for subpackge configure.in 32 19 dnl Called after AC_INIT before any of xFLAGS is accessed. 33 dnl34 20 AC_DEFUN([PAC_SUBCONFIG_INIT],[ 35 21 # Initialize xFLAGS with MPICH2_INTERNAL_xFLAGS. … … 40 26 F90FLAGS="$MPICH2_INTERNAL_F90FLAGS" 41 27 fi 42 ])dnl 43 dnl 44 dnl Do we need PAC_SUBCONFIG_FINALIZE or PAC_MPICH2_FINALIZE ? 45 dnl 28 ]) 29 30 46 31 AC_DEFUN([PAC_SUBCONFIG_FINALIZE],[ 47 ])dnl 32 ]) 33 48 34 AC_DEFUN([PAC_MPICH2_FINALIZE],[ 49 ]) dnl35 ]) -
mpich2/trunk/configure.in
r4993 r4998 280 280 handle - Trace handle operations 281 281 handlealloc - Trace hancle allocations 282 dbg - Add compiler flag, -g, to CFLAGS, CXXFLAGS FFLAGS and F90FLAGS. 282 dbg - Add compiler flag, -g, to all internal 283 compiler flags, i.e. MPICH2LIB_CFLAGS, MPICH2LIB_CXXFLAGS, 284 MPICH2LIB_FFLAGS, and MPICH2LIB_F90FLAGS. 283 285 debug - Synonym for dbg 284 286 log - Enable debug event logging … … 318 320 nochkmsg - No error checking, i.e. --disable-error-checking 319 321 notiming - No timing collection, i.e. --disable-timing. 320 ndebug - Appends -DNDEBUG to internal CFLAGS, i.e.MPICH2LIB_CFLAGS.322 ndebug - Appends -DNDEBUG to MPICH2LIB_CFLAGS. 321 323 all|yes - "defopt", "nochkmsg", "notiming" and "ndebug" are enabled 322 324 when --enable-fast is specified without any option. … … 532 534 WRAPPER_FFLAGS=$FFLAGS 533 535 WRAPPER_F90FLAGS=$F90FLAGS 534 WRAPPER_LDFLAGS=$LDFLAGS535 536 export WRAPPER_CFLAGS 536 537 export WRAPPER_CXXFLAGS 537 538 export WRAPPER_FFLAGS 538 539 export WRAPPER_F90FLAGS 539 export WRAPPER_LDFLAGS540 540 541 541 # ----------------------------------------------------------------------------- … … 1218 1218 IFS="$save_IFS" 1219 1219 1220 # MPICH2_EXTRA_xFLAGS contains MPICH2LIB_xFLAGS and1221 # all the extra compiler flags added by MPICH2.1222 # Initial all MPICH2_EXTRA_xFLAGS to empty string.1223 MPICH2_EXTRA_CFLAGS=""1224 MPICH2_EXTRA_CXXFLAGS=""1225 MPICH2_EXTRA_FFLAGS=""1226 MPICH2_EXTRA_F90FLAGS=""1227 1228 1220 if test "$enable_append_g" = "yes" ; then 1229 1221 CFLAGS="$CFLAGS -g" … … 1231 1223 FFLAGS="$FFLAGS -g" 1232 1224 F90FLAGS="$F90FLAGS -g" 1233 MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS -g"1234 MPICH2_EXTRA_CXXFLAGS="$MPICH2_EXTRA_CXXFLAGS -g"1235 MPICH2_EXTRA_FFLAGS="$MPICH2_EXTRA_FFLAGS -g"1236 MPICH2_EXTRA_F90FLAGS="$MPICH2_EXTRA_F90FLAGS -g"1237 1225 fi 1238 1226 if test "$enable_append_ndebug" = "yes" ; then … … 1241 1229 FFLAGS="$FFLAGS -DNDEBUG" 1242 1230 F90FLAGS="$F90FLAGS -DNDEBUG" 1243 MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS -DNDEBUG"1244 MPICH2_EXTRA_CXXFLAGS="$MPICH2_EXTRA_CXXFLAGS -DNDEBUG"1245 MPICH2_EXTRA_FFLAGS="$MPICH2_EXTRA_FFLAGS -DNDEBUG"1246 MPICH2_EXTRA_F90FLAGS="$MPICH2_EXTRA_F90FLAGS -DNDEBUG"1247 1231 fi 1248 1232 if test -n "$perform_meminit" ; then … … 1634 1618 PAC_CC_STRICT($enable_strict) 1635 1619 if test -n "$pac_cc_strict_flags" ; then 1636 MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS $pac_cc_strict_flags"1620 CFLAGS="$CFLAGS $pac_cc_strict_flags" 1637 1621 fi 1638 1622 # Check for whether the compiler defines a symbol that contains the … … 1651 1635 PAC_C_CHECK_COMPILER_OPTION( [$MPI_DEFAULT_COPTS], [ 1652 1636 CFLAGS="$CFLAGS $MPI_DEFAULT_COPTS" 1653 MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS $MPI_DEFAULT_COPTS"1654 1637 ] ) 1655 1638 else 1656 1639 CFLAGS="$CFLAGS $MPI_DEFAULT_COPTS" 1657 MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS $MPI_DEFAULT_COPTS"1658 fi1659 fi1660 # Up till here, MPICH2_EXTRA_CFLAGS contains only flags added by MPICH2.1661 # Check with "grep -n MPICH2_EXTRA_CFLAGS configure.in"1662 # Remove duplicated flags from MPICH2_EXTRA_CFLAGS.1663 PAC_MAKE_UNIQ_STRING([MPICH2_EXTRA_CFLAGS])1664 # Check if $MPICH2LIB_CFLAGS is valid with $CC1665 if test -n "$MPICH2LIB_CFLAGS" ; then1666 if test "$enable_check_compiler_flags" = "yes" ; then1667 PAC_C_CHECK_COMPILER_OPTION( [$MPICH2LIB_CFLAGS], [1668 CFLAGS="$CFLAGS $MPICH2LIB_CFLAGS"1669 MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS $MPICH2LIB_CFLAGS"1670 ] )1671 else1672 CFLAGS="$CFLAGS $MPICH2LIB_CFLAGS"1673 MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS $MPICH2LIB_CFLAGS"1674 1640 fi 1675 1641 fi … … 1762 1728 PAC_F77_CHECK_COMPILER_OPTION( [$MPI_DEFAULT_FOPTS], [ 1763 1729 FFLAGS="$FFLAGS $MPI_DEFAULT_FOPTS" 1764 MPICH2_EXTRA_FFLAGS="$MPICH2_EXTRA_FFLAGS $MPI_DEFAULT_FOPTS"1765 1730 ] ) 1766 1731 else 1767 1732 FFLAGS="$FFLAGS $MPI_DEFAULT_FOPTS" 1768 MPICH2_EXTRA_FFLAGS="$MPICH2_EXTRA_FFLAGS $MPI_DEFAULT_FOPTS"1769 fi1770 fi1771 # Up till here, MPICH2_EXTRA_FFLAGS contains only flags added by MPICH2.1772 # Check with "grep -n MPICH2_EXTRA_FFLAGS configure.in"1773 # Remove duplicated flags from MPICH2_EXTRA_FFLAGS.1774 PAC_MAKE_UNIQ_STRING([MPICH2_EXTRA_FFLAGS])1775 # Check if $MPICH2LIB_FFLAGS is valid with $F771776 if test -n "$MPICH2LIB_FFLAGS" ; then1777 if test "$enable_check_compiler_flags" = "yes" ; then1778 PAC_F77_CHECK_COMPILER_OPTION( [$MPICH2LIB_FFLAGS], [1779 FFLAGS="$FFLAGS $MPICH2LIB_FFLAGS"1780 MPICH2_EXTRA_FFLAGS="$MPICH2_EXTRA_FFLAGS $MPICH2LIB_FFLAGS"1781 ] )1782 else1783 FFLAGS="$FFLAGS $MPICH2LIB_FFLAGS"1784 MPICH2_EXTRA_FFLAGS="$MPICH2_EXTRA_FFLAGS $MPICH2LIB_FFLAGS"1785 1733 fi 1786 1734 fi … … 2263 2211 PAC_F90_CHECK_COMPILER_OPTION( [$MPI_DEFAULT_F90OPTS], [ 2264 2212 F90FLAGS="$F90FLAGS $MPI_DEFAULT_F90OPTS" 2265 MPICH2_EXTRA_F90FLAGS="$MPICH2_EXTRA_F90FLAGS $MPI_DEFAULT_F90OPTS"2266 2213 ] ) 2267 2214 else 2268 2215 F90FLAGS="$F90FLAGS $MPI_DEFAULT_F90OPTS" 2269 MPICH2_EXTRA_F90FLAGS="$MPICH2_EXTRA_F90FLAGS $MPI_DEFAULT_F90OPTS"2270 2216 fi 2271 2217 fi 2272 # Up till here, MPICH2_EXTRA_F90FLAGS contains only flags added by MPICH2. 2273 # Check with "grep -n MPICH2_EXTRA_F90FLAGS configure.in" 2274 # Remove duplicated flags from MPICH2_EXTRA_F90FLAGS. 2275 PAC_MAKE_UNIQ_STRING([MPICH2_EXTRA_F90FLAGS]) 2276 # Check if $MPICH2LIB_F90FLAGS works with $F90 2277 if test -n "$MPICH2LIB_F90FLAGS" ; then 2278 if test "$enable_check_compiler_flags" = "yes" ; then 2279 PAC_F90_CHECK_COMPILER_OPTION( [$MPICH2LIB_F90FLAGS], [ 2280 F90FLAGS="$F90FLAGS $MPICH2LIB_F90FLAGS" 2281 MPICH2_EXTRA_F90FLAGS="$MPICH2_EXTRA_F90FLAGS $MPICH2LIB_F90FLAGS" 2282 ] ) 2283 else 2284 F90FLAGS="$F90FLAGS $MPICH2LIB_F90FLAGS" 2285 MPICH2_EXTRA_F90FLAGS="$MPICH2_EXTRA_F90FLAGS $MPICH2LIB_F90FLAGS" 2286 fi 2287 fi 2288 2289 # 2218 2290 2219 # Most systems allow the Fortran compiler to process .F and .F90 files 2291 2220 # using the C preprocessor. However, some systems either do not … … 2696 2625 PAC_CXX_CHECK_COMPILER_OPTION( [$MPI_DEFAULT_CXXOPTS], [ 2697 2626 CXXFLAGS="$CXXFLAGS $MPI_DEFAULT_CXXOPTS" 2698 MPICH2_EXTRA_CXXFLAGS="$MPICH2_EXTRA_CXXFLAGS $MPI_DEFAULT_CXXOPTS"2699 2627 ] ) 2700 2628 else 2701 2629 CXXFLAGS="$CXXFLAGS $MPI_DEFAULT_CXXOPTS" 2702 MPICH2_EXTRA_CXXFLAGS="$MPICH2_EXTRA_CXXFLAGS $MPI_DEFAULT_CXXOPTS"2703 2630 fi 2704 2631 fi 2705 # Up till here, MPICH2_EXTRA_CXXFLAGS contains only flags added by MPICH2. 2706 # Check with "grep -n MPICH2_EXTRA_CXXFLAGS configure.in" 2707 # Remove duplicated flags from MPICH2_EXTRA_CXXFLAGS. 2708 PAC_MAKE_UNIQ_STRING([MPICH2_EXTRA_CXXFLAGS]) 2709 # Check if $MPICH2LIB_CXXFLAGS is valid with $CXX 2710 if test -n "$MPICH2LIB_CXXFLAGS" ; then 2711 if test "$enable_check_compiler_flags" = "yes" ; then 2712 PAC_CXX_CHECK_COMPILER_OPTION( [$MPICH2LIB_CXXFLAGS], [ 2713 CXXFLAGS="$CXXFLAGS $MPICH2LIB_CXXFLAGS" 2714 MPICH2_EXTRA_CXXFLAGS="$MPICH2_EXTRA_CXXFLAGS $MPICH2LIB_CXXFLAGS" 2715 ] ) 2716 else 2717 CXXFLAGS="$CXXFLAGS $MPICH2LIB_CXXFLAGS" 2718 MPICH2_EXTRA_CXXFLAGS="$MPICH2_EXTRA_CXXFLAGS $MPICH2LIB_CXXFLAGS" 2719 fi 2720 fi 2721 fi 2722 2723 export MPICH2_EXTRA_CFLAGS 2724 export MPICH2_EXTRA_CXXFLAGS 2725 export MPICH2_EXTRA_FFLAGS 2726 export MPICH2_EXTRA_F90FLAGS 2632 fi 2727 2633 2728 2634 # Copy the mpicxx.h file to the main include directory … … 3187 3093 PAC_C_VOLATILE 3188 3094 PAC_C_RESTRICT 3189 3190 saveCFLAGS=$CFLAGS3191 CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"3192 3095 AC_C_INLINE 3193 CFLAGS=$saveCFLAGS3194 3096 3195 3097 PAC_C_GNU_ATTRIBUTE … … 5017 4919 if test "$ac_cv_prog_gcc" = "yes" ; then 5018 4920 CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" 5019 MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS -fprofile-arcs -ftest-coverage"5020 4921 else 5021 4922 AC_MSG_WARN([--enable-coverage only supported for GCC]) … … 5024 4925 if test "$ac_cv_cxx_compiler_gnu" = "yes" ; then 5025 4926 CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage" 5026 MPICH2_EXTRA_CXXFLAGS="$MPICH2_EXTRA_CXXFLAGS -fprofile-arcs -ftest-coverage"5027 4927 else 5028 4928 AC_MSG_WARN([--enable-coverage only supported for GCC]) … … 5034 4934 if test "$ac_cv_f77_compiler_gnu" = "yes" ; then 5035 4935 FFLAGS="$FFLAGS -fprofile-arcs -ftest-coverage" 5036 MPICH2_EXTRA_FFLAGS="$MPICH2_EXTRA_FFLAGS -fprofile-arcs -ftest-coverage"5037 4936 else 5038 4937 AC_MSG_WARN([--enable-coverage only supported for G77/GFORTRAN]) … … 5042 4941 if test "$ac_cv_f90_compiler_gnu" = "yes" ; then 5043 4942 F90FLAGS="$F90FLAGS -fprofile-arcs -ftest-coverage" 5044 MPICH2_EXTRA_F90FLAGS="$MPICH2_EXTRA_F90FLAGS -fprofile-arcs -ftest-coverage"5045 4943 else 5046 4944 AC_MSG_WARN([--enable-coverage only supported for GFORTRAN]) … … 5118 5016 if test "$ac_cv_func_vsnprintf" = "yes" ; then 5119 5017 # vsnprintf may be declared in stdio.h and may need stdarg.h 5120 saveCFLAGS=$CFLAGS5121 CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"5122 5018 PAC_FUNC_NEEDS_DECL([#include <stdio.h> 5123 5019 #include <stdarg.h>],vsnprintf) 5124 CFLAGS=$saveCFLAGS5125 5020 fi 5126 5021 # We would like to use strerror in the file namepublisher; it is also used … … 5131 5026 AC_CHECK_FUNCS(snprintf) 5132 5027 if test "$ac_cv_func_snprintf" = "yes" ; then 5133 saveCFLAGS=$CFLAGS5134 CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"5135 5028 PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf) 5136 CFLAGS=$saveCFLAGS5137 5029 fi 5138 5030 # if we are using stdarg, we may need va_copy . Test to see if we have it … … 5143 5035 # test in confdb/aclocal_cc.m4). 5144 5036 AC_CACHE_CHECK([for va_copy],pac_cv_func_va_copy,[ 5145 saveCFLAGS=$CFLAGS5146 CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"5147 5037 AC_TRY_LINK([ 5148 5038 #include <stdarg.h> … … 5155 5045 } 5156 5046 ],[foo1("a test %d", 3);],pac_cv_func_va_copy=yes,pac_cv_func_va_copy=no)]) 5157 CFLAGS=$saveCFLAGS5158 5047 5159 5048 if test "$pac_cv_func_va_copy" = "yes" ; then … … 5161 5050 else 5162 5051 AC_CACHE_CHECK([for __va_copy],pac_cv_func___va_copy,[ 5163 saveCFLAGS=$CFLAGS5164 CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"5165 5052 AC_TRY_LINK([ 5166 5053 #include <stdarg.h> … … 5173 5060 } 5174 5061 ],[foo1("a test %d", 3);],pac_cv_func___va_copy=yes,pac_cv_func___va_copy=no)]) 5175 CFLAGS=$saveCFLAGS5176 5062 if test "$pac_cv_func___va_copy" = "yes" ; then 5177 5063 AC_DEFINE(HAVE___VA_COPY,1,[Define if we have __va_copy]) … … 5209 5095 if test "$ac_cv_func_strdup" = "yes" ; then 5210 5096 # Do we need to declare strdup? 5211 saveCFLAGS=$CFLAGS5212 CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"5213 5097 PAC_FUNC_NEEDS_DECL([#include <string.h>],strdup) 5214 CFLAGS=$saveCFLAGS5215 5098 fi 5216 5099 else … … 5243 5126 AC_HAVE_FUNCS(mkstemp) 5244 5127 if test "$ac_cv_func_mkstemp" = "yes" ; then 5245 saveCFLAGS=$CFLAGS5246 CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"5247 5128 PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],mkstemp) 5248 CFLAGS=$saveCFLAGS5249 5129 fi 5250 5130 # fdopen() converts from an fd to a FILE* 5251 5131 AC_HAVE_FUNCS(fdopen) 5252 5132 if test "$ac_cv_func_fdopen" = "yes" ; then 5253 saveCFLAGS=$CFLAGS5254 CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"5255 5133 PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],fdopen) 5256 CFLAGS=$saveCFLAGS5257 5134 fi 5258 5135 # putenv() sets environment variable 5259 5136 AC_HAVE_FUNCS(putenv) 5260 5137 if test "$ac_cv_func_putenv" = "yes" ; then 5261 saveCFLAGS=$CFLAGS5262 CFLAGS="$CFLAGS $MPICH2_EXTRA_CFLAGS"5263 5138 PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],putenv) 5264 CFLAGS=$saveCFLAGS5265 5139 fi 5266 5140 … … 5362 5236 clock_gettime) 5363 5237 missing_function=no 5364 # Solaris places clock_gettime in the rt library 5365 AC_CHECK_FUNC(clock_gettime,,[missing_function=yes]) 5238 # FIXME: We are blindly adding the flag into LDFLAGS without 5239 # checking if someone else added it as well, so there might be a 5240 # duplication. 5241 AC_CHECK_LIB(rt,clock_gettime,LDFLAGS="$LDFLAGS -lrt",missing_function=yes) 5366 5242 if test "$missing_function" = yes ; then 5367 AC_SEARCH_LIBS(clock_gettime,rt,missing_function=no) 5368 if test "$missing_function" = yes ; then 5369 AC_MSG_ERROR([Requested timer clock_gettime (POSIX) is not available]) 5370 fi 5243 AC_MSG_ERROR([Requested timer clock_gettime (POSIX) is not available]) 5371 5244 fi 5372 5245 AC_CHECK_FUNC(clock_getres,,[missing_function=yes]) … … 5756 5629 ${MPE_THREAD_DEFAULT}. If the option is specified, but a package 5757 5630 is not given, then the default is posix.] 5758 ,, 5759 with_thread_package=${MPE_THREAD_DEFAULT}) 5631 ,,with_thread_package=${MPE_THREAD_DEFAULT}) 5760 5632 5761 5633 if test "$with_thread_package" = "yes" ; then 5762 with_thread_package=posix5634 with_thread_package=posix 5763 5635 fi 5764 5636 … … 5769 5641 AC_CHECK_HEADERS(pthread.h) 5770 5642 AC_CHECK_FUNCS(pthread_yield) 5771 # OSF1 has __pthread_create but not pthread_create (because of 5772 # inconsistencies in the pthread spec). Thus, we look for pthread_key_create 5773 AC_SEARCH_LIBS(pthread_key_create,pthread,found=yes,found=no) 5774 if test "$found" != "yes" ; then 5775 AC_MSG_ERROR([unable to find pthreads library]) 5776 elif test "$ac_cv_search_pthread_key_create" = "none required" ; then 5777 # Solaris provides a pthread library that does't work 5778 # in libc; you must link with -lpthread to get correct 5779 # behavior. Here is a simple test, based on a failure that 5780 # we observed 5781 AC_MSG_CHECKING([whether pthread routines without explicit lib are broken]) 5782 AC_TRY_RUN([#include<pthread.h> 5783 int main() { 5784 pthread_t id = pthread_self(); 5785 int rc; 5786 rc = pthread_equal( id, id ); 5787 if (rc) return 0; 5788 return 1;} 5789 ],pac_cv_lib_pthread_broken=no,pac_cv_lib_pthread_broken=yes,pac_cv_lib_pthread_broken=unknown) 5790 AC_MSG_RESULT($pac_cv_lib_pthread_broken) 5791 if test "$pac_cv_lib_pthread_broken" = yes ; then 5792 # Try again with -lpthread 5793 AC_MSG_CHECKING([whether pthread routines with explicit lib are broken]) 5794 saveLIBS=$LIBS 5795 LIBS="$LIBS -lpthread" 5796 AC_TRY_RUN([#include<pthread.h> 5797 int main() { 5798 pthread_t id = pthread_self(); 5799 int rc; 5800 rc = pthread_equal( id, id ); 5801 if (rc) return 0; 5802 return 1;} 5803 ],pac_cv_lib_pthread_broken_explicit=no,pac_cv_lib_pthread_broken_explicit=yes,pac_cv_lib_pthread_broken_explicit=unknown) 5804 AC_MSG_RESULT($pac_cv_lib_pthread_broken_explicit) 5805 if test "$pac_cv_lib_pthread_broken_explicit" != no ; then 5806 LIBS=$saveLIBS 5807 fi 5808 fi 5809 fi 5643 5644 # If pthreads library is found, just include it. We don't try 5645 # to test if the compiler needs it or not, since though MPICH2 5646 # itself might not need it, other applications (e.g., those 5647 # compiled with the C++ or Fortran compilers) might. 5648 # FIXME: We are blindly adding the flag into LDFLAGS without 5649 # checking if someone else added it as well, so there might be 5650 # a duplication. 5651 AC_CHECK_LIB(pthread,pthread_key_create,LDFLAGS="$LDFLAGS -lpthread",) 5652 5810 5653 # Check for a routine that specify a routine to call on 5811 5654 # thread exit. We can use this to release memory that may … … 5873 5716 fi 5874 5717 5875 THR_LIBS="$THR_LIBS -lpthread"5876 5718 MPICH2_THREAD_PACKAGE=pthreads 5877 5719 ;; … … 6384 6226 # Unlike WRAPPER_CFLAGS, the linker flags will always be needed to ensure that 6385 6227 # all of the required libraries are present. 6386 WRAPPER_LDFLAGS="$WRAPPER_LDFLAGS $LDFLAGS $THR_LDFLAGS" 6228 WRAPPER_LDFLAGS="$LDFLAGS $THR_LDFLAGS" 6229 export WRAPPER_LDFLAGS 6387 6230 AC_SUBST(WRAPPER_CFLAGS) 6388 6231 AC_SUBST(WRAPPER_CXXFLAGS)
