Permalink
Browse files

Added support for shared libraries.

  • Loading branch information...
justusc committed Jul 12, 2015
1 parent eeb1129 commit e9820854641724fa61a40b6d89b498b2b5316306
View
@@ -41,3 +41,9 @@ depcomp
install-sh
missing
/Default/
lt~obsolete.m4
ltversion.m4
ltsugar.m4
ltoptions.m4
ltmain.sh
libtool.m4
View
@@ -1,5 +1,5 @@
# This must match definition of AC_CONFIG_MACRO_DIR in configure.ac
ACLOCAL_AMFLAGS = -I ./config
ACLOCAL_AMFLAGS = -I config
SUBDIRS = src config doc
View
@@ -5,4 +5,9 @@ set -e
aclocal -I ./config
autoconf
autoheader
if hash glibtoolize 2>/dev/null; then
glibtoolize
else
libtoolize
fi
automake --add-missing
View
@@ -20,7 +20,7 @@ export LD_LIBRARY_PATH=/usr/lib/lapack:/usr/lib/openblas-base:$LD_LIBRARY_PATH
# Configure and build MADNESS
./autogen.sh
./configure \
--enable-debugging --disable-optimization --enable-warning --disable-optimal \
--enable-debugging --disable-optimization --enable-warning --disable-optimal --disable-static \
--with-google-test \
--enable-never-spin \
LIBS="-L/usr/lib/lapack -L/usr/lib/libblas -llapack -lblas -lpthread"
View
@@ -11,15 +11,15 @@ LIBCHEMDIR=$(top_builddir)/src/apps/chem
LIBTINYXMLDIR=$(top_builddir)/src/madness/external/tinyxml
LIBMUPARSERDIR=$(top_builddir)/src/madness/external/muParser
LIBGTEST=$(LIBGTESTDIR)/libMADgtest.a
LIBWORLD=$(LIBWORLDDIR)/libMADworld.a
LIBTENSOR=$(LIBTENSORDIR)/libMADtensor.a
LIBLINALG=$(LIBTENSORDIR)/libMADlinalg.a
LIBMISC=$(LIBMISCDIR)/libMADmisc.a
LIBMRA=$(LIBMRADIR)/libMADmra.a
LIBCHEM=$(LIBCHEMDIR)/libMADchem.a
LIBTINYXML=$(LIBTINYXMLDIR)/libMADtinyxml.a
LIBMUPARSER=$(LIBMUPARSERDIR)/libMADmuparser.a
LIBGTEST=$(LIBGTESTDIR)/libMADgtest.la
LIBWORLD=$(LIBWORLDDIR)/libMADworld.la
LIBTENSOR=$(LIBTENSORDIR)/libMADtensor.la
LIBLINALG=$(LIBTENSORDIR)/libMADlinalg.la
LIBMISC=$(LIBMISCDIR)/libMADmisc.la
LIBMRA=$(LIBMRADIR)/libMADmra.la
LIBCHEM=$(LIBCHEMDIR)/libMADchem.la
LIBTINYXML=$(LIBTINYXMLDIR)/libMADtinyxml.la
LIBMUPARSER=$(LIBMUPARSERDIR)/libMADmuparser.la
# Most scientific/numeric applications will link against these libraries
MRALIBS=$(LIBMRA) $(LIBLINALG) $(LIBTENSOR) $(LIBMISC) $(LIBMUPARSER) $(LIBTINYXML) $(LIBWORLD)
@@ -30,31 +30,31 @@ LIBGTEST_LIBS = $(GTEST_LDFLAGS) $(GTEST_LIBS)
# External library targets
$(LIBGTEST):
make -C $(LIBGTESTDIR) libMADgtest.a
make -C $(LIBGTESTDIR) libMADgtest.la
$(LIBTINYXML):
make -C $(LIBTINYXMLDIR) libMADtinyxml.a
make -C $(LIBTINYXMLDIR) libMADtinyxml.la
$(LIBMUPARSER):
make -C $(LIBMUPARSERDIR) libMADmuparser.a
make -C $(LIBMUPARSERDIR) libMADmuparser.la
# MADNESS library targets
$(LIBWORLD):
make -C $(LIBWORLDDIR) libMADworld.a
make -C $(LIBWORLDDIR) libMADworld.la
$(LIBMISC): $(LIBWORLD)
make -C $(LIBMISCDIR) libMADmisc.a
make -C $(LIBMISCDIR) libMADmisc.la
$(LIBTENSOR): $(LIBMISC)
make -C $(LIBTENSORDIR) libMADtensor.a
make -C $(LIBTENSORDIR) libMADtensor.la
$(LIBLINALG): $(LIBTENSOR)
make -C $(LIBTENSORDIR) libMADlinalg.a
make -C $(LIBTENSORDIR) libMADlinalg.la
$(LIBMRA): $(LIBLINALG)
make -C $(LIBMRADIR) libMADmra.a
make -C $(LIBMRADIR) libMADmra.la
$(LIBCHEM): $(LIBMRA)
make -C $(LIBCHEMDIR) libMADchem.a
make -C $(LIBCHEMDIR) libMADchem.la
@@ -9,7 +9,9 @@
# Madness_F77_INTEGER_SIZE - The default F77 integer size used for BLAS calls
# Compute paths
set(Madness_INCLUDE_DIRS @abs_top_srcdir@/src @abs_top_builddir@/src)
set(Madness_SOURCE_DIR @abs_top_srcdir@)
set(Madness_BUILD_DIR @abs_top_builddir@)
set(Madness_INCLUDE_DIRS ${Madness_SOURCE_DIR}/src ${Madness_BUILD_DIR}/src)
# Set package version
set(Madness_VERSION "@PACKAGE_VERSION@")
@@ -20,28 +22,64 @@ string(STRIP "${Madness_COMPILE_FLAGS}" Madness_COMPILE_FLAGS)
string(REGEX REPLACE "-(O[0-9s]|g[0-9]?)([ ]+|$)" "" Madness_LINKER_FLAGS "@CXXFLAGS@ @LDFLAGS@")
string(STRIP "${Madness_LINKER_FLAGS}" Madness_LINKER_FLAGS)
# Set the library variables
set(Madness_MADworld_LIBRARY
@abs_top_builddir@/src/madness/world/${CMAKE_STATIC_LIBRARY_PREFIX}MADworld${CMAKE_STATIC_LIBRARY_SUFFIX})
set(Madness_MADmisc_LIBRARY
@abs_top_builddir@/src/madness/misc/${CMAKE_STATIC_LIBRARY_PREFIX}MADmisc${CMAKE_STATIC_LIBRARY_SUFFIX})
set(Madness_MADtensor_LIBRARY
@abs_top_builddir@/src/madness/tensor/${CMAKE_STATIC_LIBRARY_PREFIX}MADtensor${CMAKE_STATIC_LIBRARY_SUFFIX})
set(Madness_MADlinalg_LIBRARY
@abs_top_builddir@/src/madness/tensor/${CMAKE_STATIC_LIBRARY_PREFIX}MADlinalg${CMAKE_STATIC_LIBRARY_SUFFIX})
set(Madness_MADmra_LIBRARY
@abs_top_builddir@/src/madness/mra/${CMAKE_STATIC_LIBRARY_PREFIX}MADmra${CMAKE_STATIC_LIBRARY_SUFFIX})
set(Madness_MADmuparser_LIBRARY
@abs_top_builddir@/src/madness/external/muparser/${CMAKE_STATIC_LIBRARY_PREFIX}MADmuparser${CMAKE_STATIC_LIBRARY_SUFFIX})
set(Madness_MADtinyxml_LIBRARY
@abs_top_builddir@/src/madness/external/tinyxml/${CMAKE_STATIC_LIBRARY_PREFIX}MADtinyxml${CMAKE_STATIC_LIBRARY_SUFFIX})
set(Madness_MADchem_LIBRARY
@abs_top_builddir@/src/apps/chem/${CMAKE_STATIC_LIBRARY_PREFIX}MADchem${CMAKE_STATIC_LIBRARY_SUFFIX})
set(Madness_LIBRARIES
${Madness_MADchem_LIBRARY} ${Madness_MADmra_LIBRARY}
${Madness_MADtinyxml_LIBRARY} ${Madness_MADmuparser_LIBRARY}
${Madness_MADlinalg_LIBRARY} ${Madness_MADtensor_LIBRARY}
${Madness_MADmisc_LIBRARY} ${Madness_MADworld_LIBRARY} "@LIBS@")
set(Madness_BUILD_SHARED @enable_shared@)
set(Madness_BUILD_STATIC @enable_static@)
# Set variables for shared library paths
if(MAD_BUILD_SHARED)
set(Madness_MADworld_SHARED_LIBRARY
${Madness_BUILD_DIR}/src/madness/world/.libs/${CMAKE_SHARED_LIBRARY_PREFIX}MADworld${CMAKE_SHARED_LIBRARY_SUFFIX})
set(Madness_MADmisc_SHARED_LIBRARY
${Madness_BUILD_DIR}/src/madness/misc/.libs/${CMAKE_SHARED_LIBRARY_PREFIX}MADmisc${CMAKE_SHARED_LIBRARY_SUFFIX})
set(Madness_MADtensor_SHARED_LIBRARY
${Madness_BUILD_DIR}/src/madness/tensor/.libs/${CMAKE_SHARED_LIBRARY_PREFIX}MADtensor${CMAKE_SHARED_LIBRARY_SUFFIX})
set(Madness_MADlinalg_SHARED_LIBRARY
${Madness_BUILD_DIR}/src/madness/tensor/.libs/${CMAKE_SHARED_LIBRARY_PREFIX}MADlinalg${CMAKE_SHARED_LIBRARY_SUFFIX})
set(Madness_MADmra_SHARED_LIBRARY
${Madness_BUILD_DIR}/src/madness/mra/.libs/${CMAKE_SHARED_LIBRARY_PREFIX}MADmra${CMAKE_SHARED_LIBRARY_SUFFIX})
set(Madness_MADmuparser_SHARED_LIBRARY
${Madness_BUILD_DIR}/src/madness/external/muparser/.libs/${CMAKE_SHARED_LIBRARY_PREFIX}MADmuparser${CMAKE_SHARED_LIBRARY_SUFFIX})
set(Madness_MADtinyxml_SHARED_LIBRARY
${Madness_BUILD_DIR}/src/madness/external/tinyxml/.libs/${CMAKE_SHARED_LIBRARY_PREFIX}MADtinyxml${CMAKE_SHARED_LIBRARY_SUFFIX})
set(Madness_MADchem_SHARED_LIBRARY
${Madness_BUILD_DIR}/src/apps/chem/.libs/${CMAKE_SHARED_LIBRARY_PREFIX}MADchem${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
# Set variables for static library paths
if(Madness_BUILD_STATIC)
set(Madness_MADworld_STATIC_LIBRARY
${Madness_BUILD_DIR}/src/madness/world/.libs/${CMAKE_STATIC_LIBRARY_PREFIX}MADworld${CMAKE_STATIC_LIBRARY_SUFFIX})
set(Madness_MADmisc_STATIC_LIBRARY
${Madness_BUILD_DIR}/src/madness/misc/.libs/${CMAKE_STATIC_LIBRARY_PREFIX}MADmisc${CMAKE_STATIC_LIBRARY_SUFFIX})
set(Madness_MADtensor_STATIC_LIBRARY
${Madness_BUILD_DIR}/src/madness/tensor/.libs/${CMAKE_STATIC_LIBRARY_PREFIX}MADtensor${CMAKE_STATIC_LIBRARY_SUFFIX})
set(Madness_MADlinalg_STATIC_LIBRARY
${Madness_BUILD_DIR}/src/madness/tensor/.libs/${CMAKE_STATIC_LIBRARY_PREFIX}MADlinalg${CMAKE_STATIC_LIBRARY_SUFFIX})
set(Madness_MADmra_STATIC_LIBRARY
${Madness_BUILD_DIR}/src/madness/mra/.libs/${CMAKE_STATIC_LIBRARY_PREFIX}MADmra${CMAKE_STATIC_LIBRARY_SUFFIX})
set(Madness_MADmuparser_STATIC_LIBRARY
${Madness_BUILD_DIR}/src/madness/external/muparser/.libs/${CMAKE_STATIC_LIBRARY_PREFIX}MADmuparser${CMAKE_STATIC_LIBRARY_SUFFIX})
set(Madness_MADtinyxml_STATIC_LIBRARY
${Madness_BUILD_DIR}/src/madness/external/tinyxml/.libs/${CMAKE_STATIC_LIBRARY_PREFIX}MADtinyxml${CMAKE_STATIC_LIBRARY_SUFFIX})
set(Madness_MADchem_STATIC_LIBRARY
${Madness_BUILD_DIR}/src/apps/chem/.libs/${CMAKE_STATIC_LIBRARY_PREFIX}MADchem${CMAKE_STATIC_LIBRARY_SUFFIX})
endif()
# Set default libraries
foreach(_lib MADchem MADmra MADtinyxml MADmuparser MADlinalg MADtensor MADmisc MADworld)
if(MAD_BUILD_SHARED)
set(Madness_${_lib}_LIBRARY ${Madness_${_lib}_SHARED_LIBRARY})
else()
set(Madness_${_lib}_LIBRARY ${Madness_${_lib}_STATIC_LIBRARY})
endif()
list(APPEND Madness_LIBRARIES ${Madness_${_lib}_LIBRARY})
endforeach()
list(APPEND Madness_LIBRARIES "@LIBS@")
# Set Fortran 77 integer size used by MADNESS
set(Madness_F77_INTEGER_SIZE @MADNESS_FORTRAN_DEFAULT_INTEGER_SIZE@)
unset(MAD_LIBRARY_PREFIX)
unset(MAD_LIBRARY_SUFFIX)
View
@@ -15,6 +15,10 @@ AM_INIT_AUTOMAKE([-Wall -Werror nostdinc foreign])
m4_pattern_allow([AM_PROG_AR])
AM_PROG_AR
# Initialize Libtools (for shared libraries)
LT_INIT
LT_LANG([C++])
# We want #defines output into a header file
AC_CONFIG_HEADERS([src/madness/config.h])
@@ -124,7 +128,6 @@ ACX_ENABLE_GENTENSOR
ACX_ENABLE_TASK_PROFILER
# Check for basic build functionality
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
@@ -357,6 +360,9 @@ AC_MSG_NOTICE([CFLAGS = $CFLAGS])
AC_MSG_NOTICE([CXXFLAGS = $CXXFLAGS])
AC_MSG_NOTICE([LDFLAGS = $LDFLAGS])
AC_MSG_NOTICE([LIBS = $LIBS])
AC_MSG_NOTICE([build shared libraries: $enable_shared])
AC_MSG_NOTICE([build static libraries: $enable_static])
# These are the files that must be generated/preprocessed ... as you add files
# please maintain the directory tree file order and indenting.
View
@@ -5,7 +5,8 @@ AM_CPPFLAGS += -DMRA_CHEMDATA_DIR=\"$(abs_srcdir)\"
noinst_PROGRAMS = testxc plotxc test_SCFOperators
lib_LIBRARIES = libMADchem.a
lib_LTLIBRARIES = libMADchem.la
noinst_LTLIBRARIES = libxcfunctional_ldaonly.la
data_DATA = sto-3g sto-6g 6-31g coredata/mcp coredata/mcp2 coredata/mcp_guess
dist_data_DATA = $(data_DATA)
@@ -20,32 +21,37 @@ thisinclude_HEADERS = correlationfactor.h molecule.h molecularbasis.h \
molecular_optimizer.h projector.h TDA.h TDA_XC.h \
TDA_guess.h TDA_exops.h SCFOperators.h CCOperators.h
testxc_SOURCES = testxc.cc xcfunctional.h xcfunctional_ldaonly.cc lda.cc
testxc_LDADD = libMADchem.a $(LIBMRA) $(LIBWORLD)
testxc_SOURCES = testxc.cc xcfunctional.h
testxc_LDADD = libMADchem.la $(LIBMRA) $(LIBWORLD)
test_SCFOperators_SOURCES = test_SCFOperators.cc
test_SCFOperators_LDADD = libMADchem.a $(MRALIBS)
test_SCFOperators_LDADD = libMADchem.la $(MRALIBS)
plotxc_SOURCES = plotxc.cc xcfunctional.h xcfunctional_ldaonly.cc lda.cc
plotxc_LDADD = libMADchem.a $(LIBMRA) $(LIBWORLD)
plotxc_SOURCES = plotxc.cc xcfunctional.h
plotxc_LDADD = libMADchem.la $(LIBMRA) $(LIBWORLD)
libMADchem_a_SOURCES = correlationfactor.cc molecule.cc molecularbasis.cc \
libMADchem_la_SOURCES = correlationfactor.cc molecule.cc molecularbasis.cc \
corepotential.cc atomutil.cc lda.cc \
distpm.cc SCF.cc gth_pseudopotential.cc nemo.cc mp2.cc\
SCFOperators.cc $(thisinclude_HEADERS)
libMADchem_la_LDFLAGS = -version-info 0:0:0
libxcfunctional_ldaonly_la_SOURCES = xcfunctional_ldaonly.cc
if MADNESS_HAS_LIBXC
libMADchem_a_SOURCES += xcfunctional_libxc.cc
testxc_LDADD += libxcfunctional_ldaonly.la
plotxc_LDADD += libxcfunctional_ldaonly.la
libMADchem_la_SOURCES += xcfunctional_libxc.cc
else
libMADchem_a_SOURCES += xcfunctional_ldaonly.cc
libMADchem_la_LIBADD = libxcfunctional_ldaonly.la
endif
libraries: $(lib_LIBRARIES)
libraries: $(lib_LTLIBRARIES)
for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir $@ ; done
install-libraries: install-libLIBRARIES install-thisincludeHEADERS
install-libraries: install-libLTLIBRARIES install-thisincludeHEADERS
for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir $@ ; done
View
@@ -2,9 +2,10 @@ include $(top_srcdir)/config/MakeGlobal.am
#bin_PROGRAMS = test_hf test_lattice test_coulomb test_hydro test_he test_be test_comm testconv esolver
#bin_PROGRAMS = test_he esolver test_xc
#lib_LIBRARIES = libHartreeFock.a
#lib_LTLIBRARIES = libHartreeFock.la
#libHartreeFock_a_SOURCES = eigsolver.cc dft.cc dft.h eigsolver.h poperator.h util.h lda.h electronicstructureparams.h
#libHartreeFock_la_SOURCES = eigsolver.cc dft.cc dft.h eigsolver.h poperator.h util.h lda.h electronicstructureparams.h
#libHartreeFock_la_LDFLAGS = -version-info 0:0:0
#test_hf_SOURCES = test_hf.cc
@@ -26,5 +27,5 @@ include $(top_srcdir)/config/MakeGlobal.am
#esolver_SOURCES = solver_driver.cc mentity.cc mentity.h electronicstructureapp.h solver.h
#LDADD = libHartreeFock.a libxc.a $(MRALIBS)
#LDADD = libHartreeFock.la libxc.a $(MRALIBS)
View
@@ -1,10 +1,17 @@
include $(top_srcdir)/config/MakeGlobal.am
SUBDIRS = external world misc tensor mra
thisincludedir = $(includedir)/madness
thisinclude_HEADERS = constants.h fortran_ctypes.h madness_config.h config.h
libraries:
lib_LTLIBRARIES = libmadness.la
libmadness_la_LIBADD = $(MRALIBS)
# Add a dummy source file so the linker behaves properly.
libmadness_la_SOURCES = madness.cc
libraries: $(lib_LTLIBRARIES)
for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir libraries ; done
install-libraries: install-thisincludeHEADERS
install-libraries: install-libLTLIBRARIES install-thisincludeHEADERS
for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir install-libraries ; done
@@ -3,11 +3,11 @@ include $(top_srcdir)/config/MakeGlobal.am
if MADNESS_HAS_GOOGLE_TEST
##AUTOMAKE_OPTIONS = --warnings=no-override
noinst_LIBRARIES = libMADgtest.a
noinst_LTLIBRARIES = libMADgtest.la
libMADgtest_a_SOURCES = gtest-all.cc
libMADgtest_a_CPPFLAGS = $(LIBGTEST_CPPFLAGS) -I$(srcdir)
libMADgtest_a_CXXFLAGS = $(LIBGTEST_CXXFLAGS)
libMADgtest_a_LIBADD = $(LIBGTEST_LIBS)
libMADgtest_la_SOURCES = gtest-all.cc
libMADgtest_la_CPPFLAGS = $(LIBGTEST_CPPFLAGS) -I$(srcdir)
libMADgtest_la_CXXFLAGS = $(LIBGTEST_CXXFLAGS)
libMADgtest_la_LIBADD = $(LIBGTEST_LIBS)
endif
@@ -1,6 +1,6 @@
include $(top_srcdir)/config/MakeGlobal.am
lib_LIBRARIES = libMADmuparser.a
lib_LTLIBRARIES = libMADmuparser.la
thisincludedir = $(includedir)/madness/external/muParser
thisinclude_HEADERS = muParserBase.h muParserBytecode.h muParserCallback.h \
@@ -10,17 +10,18 @@ thisinclude_HEADERS = muParserBase.h muParserBytecode.h muParserCallback.h \
muParserTokenReader.h
libMADmuparser_a_SOURCES = muParserBase.cpp muParserBytecode.cpp \
libMADmuparser_la_SOURCES = muParserBase.cpp muParserBytecode.cpp \
muParserCallback.cpp \
muParser.cpp muParserError.cpp muParserTokenReader.cpp \
muParserBase.h muParserBytecode.h muParserCallback.h \
muParserDef.h muParserDLL.h muParserError.h \
muParserFixes.h muParser.h muParserInt.h \
muParserStack.h muParserTest.h muParserToken.h \
muParserTokenReader.h
libMADmuparser_la_LDFLAGS = -version-info 0:0:0
libraries: $(lib_LIBRARIES)
libraries: $(lib_LTLIBRARIES)
for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir $@ ; done
install-libraries: install-libLIBRARIES install-thisincludeHEADERS
install-libraries: install-libLTLIBRARIES install-thisincludeHEADERS
for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir $@ ; done
@@ -1,15 +1,16 @@
include $(top_srcdir)/config/MakeGlobal.am
lib_LIBRARIES = libMADtinyxml.a
lib_LTLIBRARIES = libMADtinyxml.la
thisincludedir = $(includedir)/madness/external/tinyxml
thisinclude_HEADERS = tinystr.h tinyxml.h
libMADtinyxml_a_SOURCES = tinystr.cc tinyxml.cc tinyxmlerror.cc tinyxmlparser.cc \
libMADtinyxml_la_SOURCES = tinystr.cc tinyxml.cc tinyxmlerror.cc tinyxmlparser.cc \
tinystr.h tinyxml.h
libMADtinyxml_la_LDFLAGS = -version-info 0:0:0
AM_CPPFLAGS += -I.
libraries: $(lib_LIBRARIES)
libraries: $(lib_LTLIBRARIES)
install-libraries: install-libLIBRARIES install-thisincludeHEADERS
install-libraries: install-libLTLIBRARIES install-thisincludeHEADERS
View
No changes.
Oops, something went wrong.

0 comments on commit e982085

Please sign in to comment.