@@ -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#
@@ -667,6 +675,14 @@ AM_CONDITIONAL(OSHMEM_BUILD_FORTRAN_BINDINGS,
667675AC_CACHE_SAVE
668676
669677
678+ # #################################
679+ # Wrapper compilers.
680+ #
681+ # Must be called before MCA system
682+ # #################################
683+ OPAL_SETUP_WRAPPER_INIT
684+
685+
670686# #################################
671687# Header files
672688# #################################
@@ -920,7 +936,7 @@ OPAL_SEARCH_LIBS_CORE([ceil], [m])
920936# -lrt might be needed for clock_gettime
921937OPAL_SEARCH_LIBS_CORE([clock_gettime], [rt])
922938
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])
939+ 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 ])
924940
925941# Sanity check: ensure that we got at least one of statfs or statvfs.
926942if test $ac_cv_func_statfs = no && test $ac_cv_func_statvfs = no; then
@@ -979,6 +995,9 @@ AC_CACHE_SAVE
979995
980996opal_show_title " System-specific tests"
981997
998+ OPAL_CHECK_CUDA
999+ OPAL_CHECK_OS_FLAVORS
1000+
9821001# Do we have _SC_NPROCESSORS_ONLN? (only going to pass if we also have
9831002# <unistd.h> and sysconf(), which is ok) OS X 10.4 has <unistd.h> and
9841003# sysconf(), but does not have _SC_NPROCESSORS_ONLN. Doh!
0 commit comments