📄 configure.in
字号:
AC_PREREQ(2.59)AC_INIT(configure.in)dnldnl Set the directory that contains support scripts such as install-sh anddnl config.guessdnlAC_CONFIG_AUX_DIR(../../../../../confdb)dnldnl Definitions will be placed in this file rather than in the DEFS variablednlAC_CONFIG_HEADER(include/mpidi_ch3i_shm_conf.h)echo "RUNNING CONFIGURE FOR THE SHARED MEMORY CHANNEL"dnldnl First check that we have a clean build if we are doing a VPATH buildif test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status ; then AC_MSG_ERROR([You cannot do a VPATH build if the source directory has been configured. Run "make distclean" in $srcdir first.])fiPAC_PROG_MAKE## Note: if we plan to use the sys/ipc.h header, we need to assert that# we're using sysv or xopen varities of unix# To check for this, we compile sys/ipc.h (if present) and check for# a warning about _SVID_SOURCE or _XOPEN_SOURCE. If either is found,# we set _XOPEN_SOURCE now, before we do much additional testingAC_MSG_CHECKING([whether we need to define _XOPEN_SOURCE for sys/ipc.h])pac_cv_ipc_h_needs_xopen_source=norm -f conftest*echo "#include <sys/ipc.h>" > conftest.cif $CC -c $CFLAGS $CPPFLAGS conftest.c 2>conftest.er1 1>/dev/null ; then if test -s conftest.er1 && \ grep _XOPEN_SOURCE conftest.er1 >/dev/null 2>&1 ; then if $CC -c $CFLAGS $CPPFLAGS -D_XOPEN_SOURCE=500 conftest.c \ 2>conftest.er1 1>/dev/null ; then pac_cv_ipc_h_needs_xopen_source=yes fi fifiAC_MSG_RESULT($pac_cv_ipc_h_needs_xopen_source)if test "$pac_cv_ipc_h_needs_xopen_source" = yes ; then AC_DEFINE(_XOPEN_SOURCE,500,[Define to access sys/ipc.h cleanly])firm -f conftest*dnl AC_DEFINE(USE_PROCESS_LOCKS,,[Define to use process locks])dnl AC_DEFINE(HAVE_SHARED_PROCESS_READ,,[Define to use /proc directory for shared process reads])dnl AC_DEFINE(MPIDI_CH3_CHANNEL_RNDV,,[Define to use rdma channel functions])dnl AC_DEFINE(USE_RDMA_GET,,[Define to use rdma get mechanisms])AC_CHECK_FUNCS( sysconf shmget shmat shmdt shmctl mmap )save_libs=$LIBSLIBS=AC_SEARCH_LIBS( shm_open, rt, have_shm_open=yes, have_shm_open=no)AC_SEARCH_LIBS( shm_unlink, rt, have_shm_unlink=yes, have_shm_unlink=no)if test $have_shm_open = "yes" -a $have_shm_unlink = "yes" ; then AC_MSG_CHECKING(that shm_open has been implemented) AC_TRY_RUN([#include <sys/types.h>#include <sys/mman.h>#include <fcntl.h>#include <errno.h>#include <unistd.h>int main(int argc, char ** argv){ int fd; fd = shm_open("/mpich2conf", O_RDWR | O_CREAT, 0666); if (fd == -1) { if (errno == ENOSYS) { return 1; } } else { shm_unlink("/mpich2conf"); close(fd); } return 0;}],shm_open_impl=yes,shm_open_impl=no,shm_open_impl=${CROSS_HAVE_SHM_OPEN:-no}) AC_MSG_RESULT($shm_open_impl) if test $shm_open_impl = "yes" ; then AC_DEFINE(HAVE_SHM_OPEN,,[Define if shm_open is available]) AC_DEFINE(HAVE_SHM_UNLINK,,[Define if shm_unlink is available]) else LIBS= fielse LIBS=fiSHM_LIBS=$LIBSLIBS=$save_libsAC_CHECK_HEADERS( \ assert.h \ errno.h \ fcntl.h \ stdlib.h \ sys/param.h \ sys/types.h \ unistd.h \ pthread.h \ sys/ipc.h sys/shm.h sys/param.h \ sys/socket.h netinet/in.h \ fcntl.h sys/mman.h \ sys/ptrace.h \)AC_MSG_CHECKING([for x86 mfence instruction])AC_TRY_RUN([int main(int argc, char *argv[]){ __asm__ __volatile__ ( ".byte 0x0f, 0xae, 0xf0" ::: "memory" ); exit(0);}],AC_MSG_RESULT(yes); lac_cv_have_gcc_asm_and_x86_mfence=yes,AC_MSG_RESULT(no); lac_cv_have_gcc_asm_and_x86_mfence=no,AC_MSG_RESULT(not checking when cross compiling), lac_cv_have_gcc_asm_and_x86_mfence=no)if test "$lac_cv_have_gcc_asm_and_x86_mfence" = "yes" ; then AC_DEFINE(HAVE_GCC_ASM_AND_X86_MFENCE, 1, [Define if using gcc on a x86 system with the mfence instruction])fiAC_MSG_CHECKING([for x86 sfence instruction])AC_TRY_RUN([int main(int argc, char *argv[]){ __asm__ __volatile__ ( ".byte 0x0f, 0xae, 0xf8" ::: "memory" ); exit(0);}],AC_MSG_RESULT(yes); lac_cv_have_gcc_asm_and_x86_sfence=yes,AC_MSG_RESULT(no); lac_cv_have_gcc_asm_and_x86_sfence=no,AC_MSG_RESULT(not checking when cross compiling), lac_cv_have_gcc_asm_and_x86_sfence=no)if test "$lac_cv_have_gcc_asm_and_x86_sfence" = "yes" ; then AC_DEFINE(HAVE_GCC_ASM_AND_X86_SFENCE, 1, [Define if using gcc on a x86 system with the sfence instruction])fiAC_MSG_CHECKING([for x86 lfence instruction])AC_TRY_RUN([int main(int argc, char *argv[]){ __asm__ __volatile__ ( ".byte 0x0f, 0xae, 0xe8" ::: "memory" ); exit(0);}],AC_MSG_RESULT(yes); lac_cv_have_gcc_asm_and_x86_lfence=yes,AC_MSG_RESULT(no); lac_cv_have_gcc_asm_and_x86_lfence=no,AC_MSG_RESULT(not checking when cross compiling), lac_cv_have_gcc_asm_and_x86_lfence=no)if test "$lac_cv_have_gcc_asm_and_x86_lfence" = "yes" ; then AC_DEFINE(HAVE_GCC_ASM_AND_X86_LFENCE, 1, [Define if using gcc on a x86 system with the lfence instruction])fiAC_SUBST(device_name)AC_SUBST(channel_name)if test -z "$ENABLE_SHLIB" ; then CC_SHL="$CC" ENABLE_SHLIB=nonefiAC_SUBST(SHM_LIBS)AC_SUBST(AR)AC_SUBST(RANLIB)AC_SUBST(MPILIBNAME)AC_SUBST(CC)AC_SUBST(CFLAGS)AC_SUBST(CPPFLAGS)PAC_CC_SUBDIR_SHLIBSAC_SUBST(master_top_srcdir)AC_SUBST(master_top_builddir)dnldnl Dependency handlingAC_SUBST(MAKE_DEPEND_C)AC_OUTPUT(Makefile src/Makefile localdefs)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -