📄 configure.in
字号:
AC_DEFINE( HAVE_CRAY_FCD_STRING, 1, [Define if CRAY's FCD string is found] ) else AC_MSG_RESULT(no) fi fi ;;esacdnl snprintf may have been missing in headerfile,dnl e.g. gcc -ansi remove gethostname's prototypeAC_CHECK_FUNCS(gethostname)if test "$ac_cv_func_gethostname" = "yes" ; then PAC_FUNC_NEEDS_DECL([#include <unistd.h>],gethostname)fidnl snprintf may have been missing in headerfile,dnl e.g. gcc -ansi remove snprintf's prototypeAC_CHECK_FUNCS(snprintf)if test "$ac_cv_func_snprintf" = "yes" ; then PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)fidnl mkstemp() is a better replacement for mktemp()AC_HAVE_FUNCS(mkstemp)if test "$ac_cv_func_mkstemp" = "yes" ; then PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],mkstemp)fidnl srand48 may have been missing in headerfile,dnl e.g. gcc -ansi remove srand48's prototypeAC_CHECK_FUNCS(srand48)if test "$ac_cv_func_srand48" = "yes" ; then PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],srand48)fidnl lrand48 may have been missing in headerfile,dnl e.g. gcc -ansi remove lrand48's prototypeAC_CHECK_FUNCS(lrand48)if test "$ac_cv_func_lrand48" = "yes" ; then PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],lrand48)fidnl check if uuid_generate existsdnl AC_CHECK_HEADERS( uuid/uuid.h,dnl AC_MSG_CHECKING( [for uuid_generate] )dnl AC_TRY_COMPILE( [dnl #include <uuid/uuid.h>dnl ], [dnl uuid_t new_uuid;dnl uuid_generate( new_uuid );dnl ],dnl AC_DEFINE( HAVE_UUID_GENERATE, 1,dnl [Define if uuid_generate() exists.] )dnl AC_MSG_RESULT(yes),dnl AC_MSG_RESULT(no)dnl )dnl )dnl check if Large File support is available for 32-bit OSdnl AC_CHECK_HEADERS( unistd.h,dnl AC_MSG_CHECKING( [for large file support in 32-bit OS] )dnl AC_TRY_COMPILE( [dnl #define _LARGEFILE64_SOURCE 1dnl #include <unistd.h>dnl ], [dnl #ifndef _LFS64_LARGEFILEdnl #error no largefile supportdnl #endifdnl ],dnl AC_DEFINE( _LARGEFILE64_SOURCE, 1,dnl [Define if 64-bit file address support in 32-bit OS.] )dnl AC_DEFINE( _FILE_OFFSET_BITS, 64,dnl [Define if 64-bit file address support in 32-bit OS.] )dnl AC_MSG_RESULT(yes),dnl AC_MSG_RESULT(none)dnl )dnl )AC_SYS_LARGEFILEif test "$enable_largefile" != no ; then AC_MSG_CHECKING( [for O_LARGEFILE for open()] ) AC_COMPILE_IFELSE( AC_LANG_PROGRAM( [#if defined( HAVE_SYS_TYPES_H )#include <sys/types.h>#endif#if defined( HAVE_SYS_STAT_H )#include <sys/stat.h>#endif#if defined( HAVE_FCNTL_H )#include <fcntl.h>#endif ], [ int fd; fd = open( "tmpfile", O_CREAT | O_LARGEFILE, 0644 ); ] ), [ AC_DEFINE( HAVE_O_LARGEFILE, 1, [Define to 1 if O_LARGEFILE flag for open() exists.] ) AC_MSG_RESULT(yes) ], [ AC_COMPILE_IFELSE( AC_LANG_PROGRAM( [#define _LARGEFILE64_SOURCE#if defined( HAVE_SYS_TYPES_H )#include <sys/types.h>#endif#if defined( HAVE_SYS_STAT_H )#include <sys/stat.h>#endif#if defined( HAVE_FCNTL_H )#include <fcntl.h>#endif ], [ int fd; fd = open( "tmpfile", O_CREAT | O_LARGEFILE, 0644 ); ] ), [ AC_DEFINE( HAVE_O_LARGEFILE, 1, [Define to 1 if O_LARGEFILE flag for open() exists.] ) AC_DEFINE( _LARGEFILE64_SOURCE, 1, [Define if 64-bit file address support in 32-bit OS.] ) AC_MSG_RESULT( [needs _LARGEFILE64_SOURCE] ) ], [ AC_MSG_RESULT(no) ] ) ] )fi dnl end of AC_COMPILE_IFELSE with O_LARGEFILE dnl end of AC_COMPILE_IFELSE with O_LARGEFILE and _LARGEFILE64_SOURCEAC_MSG_CHECKING( [for O_BINARY for open()] )AC_LINK_IFELSE( AC_LANG_PROGRAM( [#if defined( HAVE_FCNTL_H )#include <fcntl.h>#endif ], [ int fd; fd = open( "tmpfile", O_CREAT | O_BINARY, 0644 ); ] ), [ AC_DEFINE( HAVE_O_BINARY, 1, [Define to 1 if O_BINARY flag for open() exists.] ) AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no)] )dnl Determine if PMPI_Comm_create_keyval existsif test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then AC_MSG_CHECKING( [for PMPI_Comm_create_keyval()] ) PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , [ int comm_keyval ], [ PMPI_Comm_create_keyval( MPI_COMM_NULL_COPY_FN, MPI_COMM_NULL_DELETE_FN, &comm_keyval, NULL ) ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] ) AC_MSG_RESULT($mpe_link_ok)else# only MPICH2 has PMPI_Comm_{create|free}_keyval, PMPI_Comm_{set|get}_attr if test "$MPI_IMPL" = "MPICH2" ; then mpe_link_ok=yes else mpe_link_ok=no fifiif test "$mpe_link_ok" = "yes" ; then AC_DEFINE( HAVE_PMPI_COMM_CREATE_KEYVAL, 1, [Define if PMPI_Comm_Create_keyval() available] )fidnl Determine if PMPI_Comm_free_keyval existsif test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then AC_MSG_CHECKING( [for PMPI_Comm_free_keyval()] ) PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , [ int comm_keyval ], [ PMPI_Comm_free_keyval( &comm_keyval ) ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] ) AC_MSG_RESULT($mpe_link_ok)else# only MPICH2 has PMPI_Comm_{create|free}_keyval, PMPI_Comm_{set|get}_attr if test "$MPI_IMPL" = "MPICH2" ; then mpe_link_ok=yes else mpe_link_ok=no fifiif test "$mpe_link_ok" = "yes" ; then AC_DEFINE( HAVE_PMPI_COMM_FREE_KEYVAL, 1, [Define if PMPI_Comm_free_keyval() available] )fidnl Determine if PMPI_Comm_set_attr existsif test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then AC_MSG_CHECKING( [for PMPI_Comm_set_attr()] ) PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , [ int comm_keyval ], [ PMPI_Comm_set_attr( MPI_COMM_WORLD, comm_keyval, (void *)5 ) ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] ) AC_MSG_RESULT($mpe_link_ok)else# only MPICH2 has PMPI_Comm_{create|free}_keyval, PMPI_Comm_{set|get}_attr if test "$MPI_IMPL" = "MPICH2" ; then mpe_link_ok=yes else mpe_link_ok=no fifiif test "$mpe_link_ok" = "yes" ; then AC_DEFINE( HAVE_PMPI_COMM_SET_ATTR, 1, [Define if PMPI_Comm_set_attr() available] )fidnl Determine if PMPI_Comm_get_attr existsif test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then AC_MSG_CHECKING( [for PMPI_Comm_get_attr()] ) PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , [ int comm_keyval, comm_val, istatus ], [ PMPI_Comm_get_attr( MPI_COMM_WORLD, comm_keyval, &comm_val, &istatus ) ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] ) AC_MSG_RESULT($mpe_link_ok)else# only MPICH2 has PMPI_Comm_{create|free}_keyval, PMPI_Comm_{set|get}_attr if test "$MPI_IMPL" = "MPICH2" ; then mpe_link_ok=yes else mpe_link_ok=no fifiif test "$mpe_link_ok" = "yes" ; then AC_DEFINE( HAVE_PMPI_COMM_GET_ATTR, 1, [Define if PMPI_Comm_get_attr() available] )fidnl Check if pthread existsif test "$enable_threadlogging" = "yes" ; then AC_CHECK_HEADERS( pthread.h, [ AC_CHECK_LIB( pthread, [pthread_mutex_lock], [ have_pthread_in_cc=yes ], [ have_pthread_in_cc=no ] ) ] ) if test "$have_pthread_in_cc" = "yes" ; then AC_DEFINE( HAVE_LIBPTHREAD, 1, [Define if libpthread.a(so) is defined] ) fifidnl Assume there is no thread support, by default.PTHREAD_IN_MPI_DEF="#undef HAVE_PTHREAD_IN_MPI"THREAD_LOG_LIBS=""if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then if test "$have_pthread_in_cc" = "yes" \ -a "$enable_threadlogging" = "yes" ; then AC_MSG_CHECKING( [for pthread_mutex_lock/unlock in MPI] )dnl Check MPI_CC/MPI_LIBS without -lpthread can resolve pthread symbols,dnl no need to add -lpthread during linking. PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], [$MPI_LIBS], [#include <pthread.h>], [ pthread_mutex_t pthd_mutex ], [ pthread_mutex_lock(&pthd_mutex); pthread_mutex_unlock(&pthd_mutex); ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] ) if test "$mpe_link_ok" = "yes" ; then AC_MSG_RESULT(yes) PTHREAD_IN_MPI_DEF="#define HAVE_PTHREAD_IN_MPI 1" THREAD_LOG_LIBS="" elsednl Check MPI_CC/MPI_LIBS with -lpthread can resolve pthread symbols,dnl If so, add -lpthread during linking. PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], [$MPI_LIBS -lpthread], [#include <pthread.h>], [ pthread_mutex_t pthd_mutex ], [ pthread_mutex_lock(&pthd_mutex); pthread_mutex_unlock(&pthd_mutex); ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] ) if test "$mpe_link_ok" = "yes" ; then AC_MSG_RESULT(yes) PTHREAD_IN_MPI_DEF="#define HAVE_PTHREAD_IN_MPI 1" THREAD_LOG_LIBS="-lpthread" else AC_MSG_RESULT(no) fi fi fielsednl MPICH1 has no MPI_Init_thread(), set HAVE_PTHREAD_IN_MPI to Null. if test "$MPI_IMPL" = "MPICH2" ; then if test "$enable_threadlogging" = "yes" ; then if test "$MPICH_THREAD_LEVEL" = "MPI_THREAD_MULTIPLE" \ -a "$MPICH2_THREAD_PACKAGE" = "pthreads" ; then PTHREAD_IN_MPI_DEF="#define HAVE_PTHREAD_IN_MPI 1" THREAD_LOGGING_LIBS="-lpthread" fi fi fifiAC_SUBST(PTHREAD_IN_MPI_DEF)AC_SUBST(THREAD_LOG_LIBS)AC_SUBST(MPE_BUILD_FORTRAN2C)AC_SUBST(CC)AC_SUBST(CLINKER)AC_SUBST(CFLAGS)AC_SUBST(MPI_CC)AC_SUBST(MPI_CFLAGS)AC_SUBST(MPI_LIBS)AC_SUBST(PROF_LIBNAME)AC_OUTPUT( Makefile src/Makefile \ include/clog_inttypes.h include/mpi_null.h include/mpe_log_thread.h \ etc/mpe_log.conf etc/mpe_nolog.conf etc/mpe_log_postlib.conf )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -