On Sun, Nov/23/2008 09:19:12AM, Ralf Wildenhues wrote:
> * Ethan Mallove wrote on Fri, Nov 21, 2008 at 09:01:56PM CET:
> > On Fri, Nov/21/2008 01:02:12PM, Ralf Wildenhues wrote:
> > > IMHO OpenMPI can use
> > > the solaris_use_stlport4=yes until such a functionality is in place.
> > 
> > Nice. This workaround works. I don't suppose there's a similar
> > workaround to unset "wl" in the FC libtool section? If not, I think we
> > still need the heinous post-configure workaround script. Otherwise,
> > since there won't be a stable Libtool that contains the Sun Fortran
> > fix for a while, I propose the attached patch.
> 
> While I suppose your patch works, I think in similar situations, OpenMPI
> has resorted to patching input files to configure (like aclocal.m4 or
> ltmain.sh).  Search autogen.sh for instances of 'patch'.
> 

I think I got it. I patch libtool.m4 in autogen.sh after libtoolize
creates libtool.m4. How is the patch now?

-Ethan


> (This is merely an observation; I am not an OpenMPI developer.)
> 
> Cheers,
> Ralf
> _______________________________________________
> devel mailing list
> de...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/devel
Index: configure.ac
===================================================================
--- configure.ac        (revision 19845)
+++ configure.ac        (working copy)
@@ -1071,6 +1076,12 @@

 ompi_show_subtitle "Libtool configuration"

+# Use the undocumented solaris_use_stlport4 libtool variable to turn off any
+# Cstd/stlport4 linkage. This allows Open MPI to be C++ STL agnostic.
+if test "x$ompi_cv_c_compiler_vendor" = "xsun"; then
+    solaris_use_stlport4="yes"
+fi
+
 dnl Not all versions of LT set the PACKAGE_VERSION
 m4_ifdef([LT_PACKAGE_VERSION], [], [m4_define([LT_PACKAGE_VERSION], [1.5.22])])

Index: autogen.sh
===================================================================
--- autogen.sh  (revision 19845)
+++ autogen.sh  (working copy)
@@ -541,6 +541,12 @@
             aclocal.m4 > aclocal.m4.new
         cp aclocal.m4.new aclocal.m4
         rm -f aclocal.m4.new
+
+        # This patch fixes a bug in Libtool's detection of the Sun Studio
+        # Fortran compiler. See the below e-mail thread for more details:
+        #   http://www.open-mpi.org/community/lists/devel/2008/11/4920.php
+        echo "   ++ patching for Sun Studio Fortran compilers"
+        patch -N -p0 < config/lt-sun-fortran.diff > /dev/null 2>&1
     fi

     run_and_check $ompi_autoconf
Index: config/lt-sun-fortran.diff
===================================================================
--- config/lt-sun-fortran.diff  (revision 0)
+++ config/lt-sun-fortran.diff  (revision 0)
@@ -0,0 +1,26 @@
+--- config/libtool.m4.orig
++++ config/libtool.m4
+@@ -3947,17 +3947,17 @@ m4_if([$1], [CXX], [
+       ;;
+       *)
+       case `$CC -V 2>&1 | sed 5q` in
+-      *Sun\ C*)
+-        # Sun C 5.9
++      *Sun\ F* | *Sun*Fortran*)
++        # Sun Fortran 8.3 passes all unrecognized flags to the linker
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++        _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+         ;;
+-      *Sun\ F*)
+-        # Sun Fortran 8.3 passes all unrecognized flags to the linker
++      *Sun\ C*)
++        # Sun C 5.9
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+-        _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
++        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         ;;
+       esac
+       ;;

Reply via email to