[ghemical-devel] automake and MPQC ; Makefile.include ok?

Michael Banck mbanck@gmx.net
Wed, 25 Aug 2004 17:15:09 +0200


On Wed, Aug 25, 2004 at 02:41:58PM +0300, Tommi Hassinen wrote:
> the automake stuff seems to work fine now in the normal case, but I had
> some trouble with the --enable-mpqc option of the configure script. I have
> a solution but tell me if you know it has any problems.

Hmm, I think the easiest and cleanest solution is to just add
SC_CPPFLAGS and SC_LIBS to CPPFLAGS and LIBS proper:

                AC_DEFINE_UNQUOTED([SC_MAJOR_VERSION],
[$SC_MAJOR_VERSION], [This is the major version of SC (MPQC's underlying
library) found by configure])
                AC_DEFINE_UNQUOTED([SC_MINOR_VERSION],
[$SC_MINOR_VERSION], [This is the minor version of SC (MPQC's underlying
library) found by configure])
                AC_DEFINE_UNQUOTED([SC_MICRO_VERSION],
[$SC_MICRO_VERSION], [This is the micro version of SC (MPQC's underlying
library) found by configure])
+               LIBS="$LIBS $SC_LIBS"
+               CPPFLAGS="$CPPFLAGS $SC_CPPFLAGS"
        else AC_MSG_ERROR([Cannot find proper SC version])
        fi
 fi
 
> Then, linking the final ghemical executable has some other issues. It
> appears that only the static library has the MPQC code added ; perhaps
> that is how the shared libs are inteded to work but now the executable
> linked into libghemical.so won't contain all of the MPQC code. 

I think that's because SC_LIBS did not get add to LDFLAGS. The above
patch fixes this as well, I now get:

nighthawk~/src/libghemical$ ldd src/.libs/libghemical.so.0.0.0 
                libSCoptions.so.6 => /usr/lib/libSCoptions.so.6 (0x4070d000)
        libSCpsi.so.6 => /usr/lib/libSCpsi.so.6 (0x40711000)
        libSCmbpt.so.6 => /usr/lib/libSCmbpt.so.6 (0x40735000)
        libSCdft.so.6 => /usr/lib/libSCdft.so.6 (0x40784000)
        libSCscf.so.6 => /usr/lib/libSCscf.so.6 (0x4082c000)
        libSCwfn.so.6 => /usr/lib/libSCwfn.so.6 (0x408c4000)
        libSCsolvent.so.6 => /usr/lib/libSCsolvent.so.6 (0x4090f000)
        libSCintv3.so.6 => /usr/lib/libSCintv3.so.6 (0x4091f000)
        libSCoint3.so.6 => /usr/lib/libSCoint3.so.6 (0x40975000)
        libSCbasis.so.6 => /usr/lib/libSCbasis.so.6 (0x40a4d000)
        libSCmolecule.so.6 => /usr/lib/libSCmolecule.so.6 (0x40aa6000)
        libSCisosurf.so.6 => /usr/lib/libSCisosurf.so.6 (0x40b5a000)
        libSCoptimize.so.6 => /usr/lib/libSCoptimize.so.6 (0x40bc2000)
        libSCscmat.so.6 => /usr/lib/libSCscmat.so.6 (0x40c09000)
        libSClinpackd.so.6 => /usr/lib/libSClinpackd.so.6 (0x40ceb000)
        libSCgroup.so.6 => /usr/lib/libSCgroup.so.6 (0x40cf0000)
        libSCsymmetry.so.6 => /usr/lib/libSCsymmetry.so.6 (0x40d2d000)
        libSCrender.so.6 => /usr/lib/libSCrender.so.6 (0x40d48000)
        libSCmisc.so.6 => /usr/lib/libSCmisc.so.6 (0x40d70000)
        libSCstate.so.6 => /usr/lib/libSCstate.so.6 (0x40d84000)
        libSCkeyval.so.6 => /usr/lib/libSCkeyval.so.6 (0x40da8000)
        libSCclass.so.6 => /usr/lib/libSCclass.so.6 (0x40dd8000)
        libSCcontainer.so.6 => /usr/lib/libSCcontainer.so.6 (0x40de4000)
        libSCref.so.6 => /usr/lib/libSCref.so.6 (0x40deb000)
        libdl.so.2 => /lib/tls/libdl.so.2 (0x40df0000)
        libpthread.so.0 => /lib/tls/libpthread.so.0 (0x40df4000)
        liblapack.so.2 => /usr/lib/atlas/liblapack.so.2 (0x40e03000)
        libblas.so.2 => /usr/lib/atlas/libblas.so.2 (0x41364000)
        libg2c.so.0 => /usr/lib/libg2c.so.0 (0x41642000)
        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x41660000)
        libm.so.6 => /lib/tls/libm.so.6 (0x4171a000)
        libc.so.6 => /lib/tls/libc.so.6 (0x4173e000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x41879000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

This also simplifies src/Makefile.am considerably:

Index: src/Makefile.am
===================================================================
RCS file: /cvsroot/libghemical/src/Makefile.am,v
retrieving revision 1.2
diff -u -r1.2 Makefile.am
--- src/Makefile.am     25 Aug 2004 11:13:43 -0000      1.2
+++ src/Makefile.am     25 Aug 2004 15:09:48 -0000
@@ -1,5 +1,3 @@
-include Makefile.include
-
 lib_LTLIBRARIES = libghemical.la
 
 libghemical_la_SOURCES = \
@@ -30,9 +28,4 @@
 ghemicalincludedir = $(includedir)/libghemical
 ghemicalinclude_HEADERS = ${libghemical_headers}
 
-libghemical_la_LDFLAGS = @LIBS@
-
-libghemical_INCLUDES = -I$(top_builddir)/src @SC_CPPFLAGS@
-##INCLUDES = @INCLUDES@ @SC_CPPFLAGS@
-
 EXTRA_DIST = Doxyfile

and obsoletes Makefile.include as well.


Michael