I've been trying to build the openmpi 1.2 branch with the Intel and Portland Fortran compilers and was having trouble using their -i-static/-Bstatic_pgi options.

First off, it seems the only way to get these options to appear in the necessary link lines is to add them to the compiler variable itself, e.g.:

FC="ifort -i-static"

However, this causes problems with some configure checks in setting the OMPI_F90_ABSOLUTE and similar variables, because "which" complains about the extra arguments. I ended up making the following change:

--- openmpi-1.2-20061010/config/ompi_setup_f77.m4.which 2006-10-12 09:29:04.534724449 -0600 +++ openmpi-1.2-20061010/config/ompi_setup_f77.m4 2006-10-12 09:29:36.840254496 -0600
@@ -59,7 +59,7 @@
 else
     OMPI_F77="$F77"
     BASEF77="`basename $OMPI_F77`"
-    OMPI_F77_ABSOLUTE="`which $F77`"
+    OMPI_F77_ABSOLUTE="`which $BASEF77`"

     if test "$OMPI_WANT_F77_BINDINGS" = "0" ; then
         AC_MSG_WARN([*** Fortran 77 bindings disabled by user])
--- openmpi-1.2-20061010/config/ompi_setup_f90.m4.which 2006-10-12 09:29:11.059841268 -0600 +++ openmpi-1.2-20061010/config/ompi_setup_f90.m4 2006-10-12 09:29:49.770468395 -0600
@@ -88,7 +88,7 @@
         OMPI_WANT_F90_BINDINGS=1
         OMPI_F90="$FC"
         BASEF90="`basename $FC`"
-        OMPI_F90_ABSOLUTE="`which $FC`"
+        OMPI_F90_ABSOLUTE="`which $BASEF90`"
     fi
 fi
 # make sure the compiler actually works, if not cross-compiling

which works for a single extra argument because basename doesn't complain. However, basename does complain if you give it more arguments. Something more general might be:

BASEF90=`echo $FC | sed 's/ .*//'`
BASEF90="`basename $BASEF90`"
OMPI_F90_ABSOLUTE="`which $BASEF90`"

I'm not sure what the most cross platform way to return only the first argument is.

Of course, if there was a way to get these passed to the appropriate link stages, we could avoid this. But it looks like libtool strips the -i-static argument and doesn't pass it on to the link command, not sure about the -Bstatic_pgi argument.

--
Orion Poplawski
System Administrator                  303-415-9701 x222
NWRA/CoRA Division                    FAX: 303-415-9702
3380 Mitchell Lane                  or...@cora.nwra.com
Boulder, CO 80301              http://www.cora.nwra.com

Reply via email to