From 17d2c907fc894122390a915a77aee4e870815427 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Mon, 16 Jan 2006 04:00:44 +0000 Subject: [PATCH] Some changes to better support cross-compiling OMPI: - fall back to compile test for windows paffinity component when cross compiling - fall back to platform guess when checking for threads having different pids with pthreads (yes on linux, no elsewhere) - pass the proper host, target, and build flags to the ROMIO configure script With these changes, cross-compiling should be possible with the exception of the Fortran 77 and Fortran 90 bindings. Fortran 77 can be cross- compiled if cache values are provided for type sizes and alignment. This commit was SVN r8702. --- config/ompi_check_pthread_pids.m4 | 15 ++++++++++++-- ompi/mca/io/romio/configure.m4 | 10 +++++++-- opal/mca/paffinity/windows/configure.m4 | 27 ++++++++++++++++--------- 3 files changed, 39 insertions(+), 13 deletions(-) diff --git a/config/ompi_check_pthread_pids.m4 b/config/ompi_check_pthread_pids.m4 index bf921a9645..0fca238278 100644 --- a/config/ompi_check_pthread_pids.m4 +++ b/config/ompi_check_pthread_pids.m4 @@ -1,5 +1,5 @@ dnl -dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana +dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana dnl University Research and Technology dnl Corporation. All rights reserved. dnl Copyright (c) 2004-2005 The University of Tennessee and The University @@ -62,7 +62,18 @@ void *checkpid(void *arg) { pthread_exit((void *) ret); }], [MSG=no OMPI_THREADS_HAVE_DIFFERENT_PIDS=0], -[MSG=yes OMPI_THREADS_HAVE_DIFFERENT_PIDS=1]) +[MSG=yes OMPI_THREADS_HAVE_DIFFERENT_PIDS=1], +[case $host in + *-linux*) + MSG="cross compiling - assuming yes" + OMPI_THREADS_HAVE_DIFFERENT_PIDS=1 + ;; + *) + MSG="cross compiling - assuming no" + OMPI_THREADS_HAVE_DIFFERENT_PIDS=0 + ;; + esac +]) CPPFLAGS="$CPPFLAGS_save" LDFLAGS="$LDFLAGS_save" diff --git a/ompi/mca/io/romio/configure.m4 b/ompi/mca/io/romio/configure.m4 index 6228529fd4..ec924a3a4d 100644 --- a/ompi/mca/io/romio/configure.m4 +++ b/ompi/mca/io/romio/configure.m4 @@ -1,6 +1,6 @@ # -*- shell-script -*- # -# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana +# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana # University Research and Technology # Corporation. All rights reserved. # Copyright (c) 2004-2005 The University of Tennessee and The University @@ -58,7 +58,13 @@ AC_DEFUN([MCA_io_romio_CONFIG],[ AS_IF([test -n "$prefix" -a "$prefix" != "NONE"], [io_romio_prefix_arg="--prefix=$prefix"], [io_romio_prefix_arg=]) - io_romio_flags="CFLAGS="'"'"$CFLAGS"'"'" CPPFLAGS="'"'"$CPPFLAGS"'"'" FFLAGS="'"'"$FFLAGS"'"'" LDFLAGS="'"'"$LSFLAGS"'"'" --$io_romio_shared-shared --$io_romio_static-static $io_romio_flags $io_romio_prefix_arg --with-mpi=open_mpi" + + io_romio_flags= + AS_IF([test "$cross_compiling" = "yes"], + [AS_IF([test ! -z $build], [io_romio_flags="$io_romio_flags --build=$build"]) + AS_IF([test ! -z $host], [io_romio_flags="$io_romio_flags --host=$host"]) + AS_IF([test ! -z $target], [io_romio_flags="$io_romio_flags --target=$target"])]) + io_romio_flags="$io_romio_flags CFLAGS="'"'"$CFLAGS"'"'" CPPFLAGS="'"'"$CPPFLAGS"'"'" FFLAGS="'"'"$FFLAGS"'"'" LDFLAGS="'"'"$LSFLAGS"'"'" --$io_romio_shared-shared --$io_romio_static-static $io_romio_flags $io_romio_prefix_arg --with-mpi=open_mpi" ompi_show_subtitle "Configuring ROMIO distribution" OMPI_CONFIG_SUBDIR([ompi/mca/io/romio/romio], diff --git a/opal/mca/paffinity/windows/configure.m4 b/opal/mca/paffinity/windows/configure.m4 index 4ddcdc599f..9abaa16bb5 100644 --- a/opal/mca/paffinity/windows/configure.m4 +++ b/opal/mca/paffinity/windows/configure.m4 @@ -1,6 +1,6 @@ # -*- shell-script -*- # -# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana +# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana # University Research and Technology # Corporation. All rights reserved. # Copyright (c) 2004-2005 The University of Tennessee and The University @@ -25,12 +25,21 @@ AC_DEFUN([MCA_paffinity_windows_CONFIG],[ # and then check for it's presence in the kernel32 library. AC_MSG_CHECKING(for working GetProcessAffinityMask) AC_TRY_RUN( [#include - int main( int argc, char** argv ) { - DWORD aff, mask; - GetProcessAffinityMask( NULL, &aff, &mask ); - return 0; }], - [AC_MSG_RESULT(yes) - $1], - [AC_MSG_RESULT(yes) - $2]) +int main( int argc, char** argv ) { + DWORD aff, mask; + GetProcessAffinityMask( NULL, &aff, &mask ); + return 0; }], + [AC_MSG_RESULT([yes]) + $1], + [AC_MSG_RESULT([no]) + $2], + [AC_COMPILE_IFELSE([#include +int main( int argc, char** argv ) { + DWORD aff, mask; + GetProcessAffinityMask( NULL, &aff, &mask ); + return 0; }], + [AC_MSG_RESULT([yes]) + $1], + [AC_MSG_RESULT([no]) + $2])]) ])dnl