|
From: <sv...@va...> - 2006-03-02 17:09:22
|
Author: sewardj
Date: 2006-03-02 17:09:16 +0000 (Thu, 02 Mar 2006)
New Revision: 5708
Log:
Detect/select 'mpicc' (from --with-mpicc=3D) and use that to build
libmpiwrap.so.
Modified:
trunk/auxprogs/Makefile.am
trunk/configure.in
Modified: trunk/auxprogs/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/auxprogs/Makefile.am 2006-03-02 13:48:21 UTC (rev 5707)
+++ trunk/auxprogs/Makefile.am 2006-03-02 17:09:16 UTC (rev 5708)
@@ -25,17 +25,30 @@
=20
#------------------------- mpi wrappers -----------------------
# Build libmpiwrap.so for the primary target only.
+#
+# This is really horrible.
+#
# Don't let automake install this, since it puts it in the
# wrong place. Instead install it ourselves in the right
# place using the install-exec-local target below.
#
+# Also, automake isn't good at supporting non-$(CC) compilers.
+# But we need to use $(MPI_CC) here. Hence the nasty hack of
+# directly saying how to build libmpiwrap.so, instead of
+# using automake's standard gunk.
+#
if BUILD_MPIWRAP
noinst_PROGRAMS =3D libmpiwrap.so
-libmpiwrap_so_SOURCES =3D mpiwrap.c
-libmpiwrap_so_CFLAGS =3D $(AM_FLAG_M3264_PRI) \
- -g -O -fpic -fno-omit-frame-pointer \
- -I../include -I@MPI_PREFIX@/include
-libmpiwrap_so_LDFLAGS =3D $(AM_FLAG_M3264_PRI) -g -shared
+#libmpiwrap_so_SOURCES =3D mpiwrap.c
+#libmpiwrap_so_CFLAGS =3D $(AM_FLAG_M3264_PRI) \
+# -g -O -fpic -fno-omit-frame-pointer \
+# -I../include -I@MPI_PREFIX@/include
+#libmpiwrap_so_LDFLAGS =3D $(AM_FLAG_M3264_PRI) -g -shared
+libmpiwrap.so: mpiwrap.c
+ $(MPI_CC) -g -O -fno-omit-frame-pointer -fpic -shared \
+ -I../include -I@MPI_PREFIX@/include \
+ $(AM_FLAG_M3264_PRI) \
+ -o libmpiwrap.so mpiwrap.c
=20
install-exec-local:
# convert (eg) X86_LINUX to x86-linux
Modified: trunk/configure.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/configure.in 2006-03-02 13:48:21 UTC (rev 5707)
+++ trunk/configure.in 2006-03-02 17:09:16 UTC (rev 5708)
@@ -597,7 +597,31 @@
AC_CHECK_FUNCS([floor memchr memset mkdir strchr strdup strpbrk strrchr =
strstr semtimedop])
=20
=20
+# Do we have a useable mpicc (MPI-ised C compiler) ?
+MPI_CC=3D"mpicc"
+AC_ARG_WITH(mpicc,
+ [ --with-mpicc=3D Specify name of MPI-ised C compiler],
+ MPI_CC=3D$withval
+)
+AC_MSG_CHECKING([for usable mpicc])
+saved_CC=3D$CC
+CC=3D$MPI_CC
+AC_TRY_COMPILE(, [
+int main ( ) { return 0; }
+],
+[
+ac_have_mpicc=3Dyes
+AC_MSG_RESULT([$MPI_CC])
+], [
+ac_have_mpicc=3Dno
+AC_MSG_RESULT([no])
+])
+CC=3D$saved_CC
+
+
# First consider --with-mpi=3D..., then check for mpi.h
+saved_CC=3D$CC
+CC=3D$MPI_CC
MPI_PREFIX=3D"/usr"
AC_ARG_WITH(mpi,
[ --with-mpi=3D/path/to/mpi/install Specify location of MPI],
@@ -618,6 +642,7 @@
ac_have_mpi_h=3Dno
AC_MSG_RESULT([no])
])
+CC=3D$saved_CC
=20
#if test x$ac_have_mpi_h =3D xyes ; then
# AC_DEFINE(HAVE_MPI_H, 1, [Define to 1 if mpi.h is available.])
@@ -625,6 +650,7 @@
=20
AM_CONDITIONAL(BUILD_MPIWRAP, test x$ac_have_mpi_h =3D xyes)
AC_SUBST(MPI_PREFIX)
+AC_SUBST(MPI_CC)
=20
=20
# -------------------- ok. We're done. --------------------
|