[cig-commits] r7208 - cs/autoconf/trunk

leif at geodynamics.org leif at geodynamics.org
Wed Jun 13 11:08:51 PDT 2007


Author: leif
Date: 2007-06-13 11:08:51 -0700 (Wed, 13 Jun 2007)
New Revision: 7208

Modified:
   cs/autoconf/trunk/cit_python.m4
Log:
Fixed CIT_PYTHON_SYSCONFIG so that it no longer adds -L/usr/lib to the
link line.  This was problematic for LAM/MPI's 'mpicc' driver on a
system that also had an unrelated -lmpi installed under /usr/lib.


Modified: cs/autoconf/trunk/cit_python.m4
===================================================================
--- cs/autoconf/trunk/cit_python.m4	2007-06-13 18:04:13 UTC (rev 7207)
+++ cs/autoconf/trunk/cit_python.m4	2007-06-13 18:08:51 UTC (rev 7208)
@@ -69,9 +69,26 @@
         # "On systems without shared libraries, LDLIBRARY is the same as LIBRARY"
         vars['BLDLIBRARY'] = "-L%(LIBPL)s -lpython%(VERSION)s" % vars
     elif vars['BLDLIBRARY']:
-        # LIBDIR is usually enough... except on Cygwin, where libpython is
-        # nested inside Python's 'config' directory (Issue39).
-        vars['BLDLIBRARY'] = "-L%(LIBDIR)s -L%(LIBPL)s -lpython%(VERSION)s" % vars
+        #     The 'mpicc' wrapper for LAM/MPI isn't very smart about "-L"
+        # options.  Adding "-L/usr/lib" can cause "-lmpi" to be found in /usr/lib
+        # instead of LAM's 'lib' directory.  Of course, avoiding "-L/usr/lib"
+        # doesn't really fix the problem, but it does make it much less likely;
+        # and "-L/usr/lib" is redundant and potentially problematic anyway.
+        #     Python 2.4 and later puts a symlink to libpython.so in LIBPL
+        # (/usr/lib/python2.x/config), which makes adding "-L$LIBDIR"
+        # (in addition to "-L$LIBPL") completely redundant.
+        #     But we still support Python 2.3, and we prefer shared to static,
+        # so we still add "-L$LIBDIR" when Python is installed in a non-standard
+        # location.  Note that the linker will still prefer shared over static
+        # with only "-L/usr/lib/python2.3/config" on the link line.
+        libdir = ""
+        if vars['LIBDIR'] != "/usr/lib":
+            libdir = "-L%(LIBDIR)s "
+        # Important: on Cygwin, the import library for libpython.dll is
+        # nested inside Python's 'config' directory (see Issue39).  This means
+        # that the linker always needs help finding "-lpython2.x" (in the form
+        # of "-L$LIBPL"), even for the "system" Python installed under /usr.
+        vars['BLDLIBRARY'] = (libdir + "-L%(LIBPL)s -lpython%(VERSION)s") % vars
     else:
         # "On Mac OS X frameworks, BLDLIBRARY is blank"
         # See also Issue39.



More information about the cig-commits mailing list