@@ -93,15 +93,6 @@ AS_IF([test "$host" != "$target"],
9393 AC_MSG_WARN([Cross-compiling is only partially supported])
9494 AC_MSG_WARN([Proceed at your own risk! ])])
9595
96- # AC_USE_SYSTEM_EXTENSIONS alters CFLAGS (e.g., adds -g -O2)
97- OPAL_VAR_SCOPE_PUSH([CFLAGS_save])
98- CFLAGS_save=$CFLAGS
99- AC_USE_SYSTEM_EXTENSIONS
100- # AC_USE_SYSTEM_EXTENSIONS will modify CFLAGS if nothing was in there
101- # beforehand. We don't want that. So if there was nothing in
102- # CFLAGS, put nothing back in there.
103- AS_IF([test -z " $CFLAGS_save " ], [CFLAGS= ])
104- OPAL_VAR_SCOPE_POP
10596
10697#
10798# Init automake
@@ -290,8 +281,6 @@ m4_ifdef([project_oshmem],
290281# ###########################################################################
291282
292283OPAL_CONFIGURE_OPTIONS
293- OPAL_CHECK_OS_FLAVORS
294- OPAL_CHECK_CUDA
295284
296285m4_ifdef([project_ompi], [OMPI_CONFIGURE_OPTIONS])
297286m4_ifdef([project_oshmem], [OSHMEM_CONFIGURE_OPTIONS])
@@ -346,10 +335,6 @@ m4_ifdef([project_ompi],
346335AC_ENABLE_SHARED
347336AC_DISABLE_STATIC
348337
349- # Must be called before OPAL_SETUP_CC to get the value of CC
350- # before it is modified by the C99/C11 checks.
351- OPAL_SETUP_WRAPPER_INIT
352-
353338# #################################
354339# Check for known incompatibility
355340# #################################
@@ -550,6 +535,29 @@ OPAL_C_GET_ALIGNMENT(size_t, OPAL_ALIGNMENT_SIZE_T)
550535
551536OPAL_CHECK_ALT_SHORT_FLOAT
552537
538+ # Check system alignment requirements
539+ if test " $opal_want_heterogeneous " = 1; then
540+ ompi_cv_c_word_size_align=yes
541+ else
542+ AC_CACHE_CHECK([if word-sized integers must be word-size aligned],
543+ [ompi_cv_c_word_size_align],
544+ [AC_LANG_PUSH(C)
545+ AC_RUN_IFELSE([AC_LANG_PROGRAM([dnl
546+ # include <stdlib.h>], [[ long data[2] = {0, 0};
547+ long * lp;
548+ int * ip;
549+ ip = (int* ) data;
550+ ip++;
551+ lp = (long* ) ip;
552+ return lp[0]; ]])],
553+ [ompi_cv_c_word_size_align= no],
554+ [ompi_cv_c_word_size_align= yes],
555+ [ompi_cv_c_word_size_align= yes])])
556+ fi
557+ AS_IF([test $ompi_cv_c_word_size_align = yes], [results= 1], [results= 0])
558+ AC_DEFINE_UNQUOTED([OPAL_ALIGN_WORD_SIZE_INTEGERS], [$results ],
559+ [set to 1 if word-size integers must be aligned to word-size padding to prevent bus errors])
560+
553561#
554562# Check for other compiler characteristics
555563#
@@ -651,6 +659,14 @@ AM_CONDITIONAL(OSHMEM_BUILD_FORTRAN_BINDINGS,
651659AC_CACHE_SAVE
652660
653661
662+ # #################################
663+ # Wrapper compilers.
664+ #
665+ # Must be called before MCA system
666+ # #################################
667+ OPAL_SETUP_WRAPPER_INIT
668+
669+
654670# #################################
655671# Header files
656672# #################################
@@ -904,7 +920,7 @@ OPAL_SEARCH_LIBS_CORE([ceil], [m])
904920# -lrt might be needed for clock_gettime
905921OPAL_SEARCH_LIBS_CORE([clock_gettime], [rt])
906922
907- AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf openpty isatty getpwuid fork waitpid execve pipe ptsname setsid mmap tcgetpgrp posix_memalign strsignal sysconf syslog vsyslog regcmp regexec regfree _NSGetEnviron socketpair usleep mkfifo dbopen dbm_open statfs statvfs setpgid setenv __malloc_initialize_hook __clear_cache])
923+ AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf openpty isatty getpwuid fork waitpid execve pipe ptsname setsid mmap tcgetpgrp posix_memalign strsignal sysconf syslog vsyslog regcmp regexec regfree _NSGetEnviron socketpair usleep mkfifo dbopen dbm_open statfs statvfs setpgid setenv __malloc_initialize_hook __clear_cache on_exit ])
908924
909925# Sanity check: ensure that we got at least one of statfs or statvfs.
910926if test $ac_cv_func_statfs = no && test $ac_cv_func_statvfs = no; then
@@ -963,6 +979,9 @@ AC_CACHE_SAVE
963979
964980opal_show_title " System-specific tests"
965981
982+ OPAL_CHECK_CUDA
983+ OPAL_CHECK_OS_FLAVORS
984+
966985# Do we have _SC_NPROCESSORS_ONLN? (only going to pass if we also have
967986# <unistd.h> and sysconf(), which is ok) OS X 10.4 has <unistd.h> and
968987# sysconf(), but does not have _SC_NPROCESSORS_ONLN. Doh!
0 commit comments