Commit ec36f0fa authored by jolien's avatar jolien
Browse files

Made MPI support create a new library, liblalmpi, so that MPI routines are

never in liblal.
Original: 3f374bf8679a6f19eea3040fd22ddd4ca47d38da
parent e9a4fd26
......@@ -109,7 +109,7 @@ echo ">>> 00boot: checking versions of aclocal, automake, autoheader and autocon
if test -z "$AUTOMAKE" ; then
for AUTOMAKE in automake automake-1.8 automake-1.5 automake ; do
for AUTOMAKE in automake-1.8 automake-1.5 automake ; do
case "`$AUTOMAKE --version 2>/dev/null`" in
*\ 1.8*) break;;
*\ 1.5*) break;;
......@@ -120,7 +120,7 @@ if test -z "$AUTOMAKE" ; then
fi
if test -z "$ACLOCAL" ; then
for ACLOCAL in aclocal aclocal-1.8 aclocal-1.5 aclocal ; do
for ACLOCAL in aclocal-1.8 aclocal-1.5 aclocal ; do
case "`$ACLOCAL --version 2>/dev/null`" in
*\ 1.8*) break;;
*\ 1.5*) break;;
......@@ -392,11 +392,17 @@ dnl Checks for optional MPI libraries and header files.
if test "${mpi}" = "true"; then
AC_CHECK_PROGS(MPICC, mpicc hcc, $CC)
LAL_CHECK_MPI_FLAGS
lal_pre_mpi_LIBS="$LIBS"
lal_pre_mpi_CPPFLAGS="$CPPFLAGS"
lal_pre_mpi_CFLAGS="$CFLAGS"
LIBS="$LIBS $MPI_LDFLAGS"
CPPFLAGS="$CPPFLAGS $MPI_CPPFLAGS"
CFLAGS="$CFLAGS $MPI_CFLAGS"
AC_SEARCH_LIBS(MPI_Init, mpi, , [AC_MSG_ERROR([can't find MPI library])])
AC_CHECK_HEADERS(mpi.h, , [AC_MSG_ERROR([can't find mpi.h header])])
LIBS="$lal_pre_mpi_LIBS"
CPPFLAGS="$lal_pre_mpi_CPPFLAGS"
CFLAGS="$lal_pre_mpi_CFLAGS"
else
MPI_CFLAGS=
MPI_CPPFLAGS=
......@@ -532,9 +538,12 @@ $prefixstring
[frameenabled="`test x${frame} = xtrue && echo "ENABLED " || echo "DISABLED"`"]
[metaioenabled="`test x${metaio} = xtrue && echo "ENABLED " || echo "DISABLED"`"]
[mpienabled="`test x${mpi} = xtrue && echo "ENABLED " || echo "DISABLED"`"]
[prefixstring="`printf '* %61s *' "$prefix"`"]
[prefixstring="`printf '* %-47s *' "$prefix"`"]
)
AC_CONFIG_FILES([lal.pc])
AC_CONFIG_FILES([lalframe.pc])
AC_CONFIG_FILES([lalmetaio.pc])
AC_CONFIG_FILES([lalmpi.pc])
AC_CONFIG_FILES([lalsupport.pc])
AC_CONFIG_FILES([lal-config])
AC_CONFIG_FILES([Makefile])
......
......@@ -2,14 +2,31 @@
SUBDIRS = misc include packages doc lib
MAINTAINERCLEANFILES = README.install
EXTRA_DIST = README.bugs README.contrib README.install \
lal-config.in lal.pc.in lalsupport.pc.in acinclude.m4 aclocal.m4 \
lal.pc.in lalsupport.pc.in lalframe.pc.in lalmetaio.pc.in lalmpi.pc.in \
lal-config.in acinclude.m4 aclocal.m4 \
misc/doc.mk misc/dvi.mk misc/include.mk misc/main.tex.in \
misc/lal.m4 misc/lallibtool.m4 misc/lalam15patch.m4 \
misc/acconfig.h
BUILT_SOURCES = README.install
bin_SCRIPTS = lal-config
if FRAME
LALFRAMEPC = lalframe.pc
else
LALFRAMEPC =
endif
if METAIO
LALMETAIOPC = lalmetaio.pc
else
LALMETAIOPC =
endif
if MPI
LALMPIPC = lalmpi.pc
else
LALMPIPC =
endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = lal.pc lalsupport.pc
pkgconfig_DATA = lal.pc lalsupport.pc $(LALFRAMEPC) $(LALMETAIOPC) $(LALMPIPC)
# cvs-clean: more than maintainer-clean, this cleans
# everything not in the cvs archive.
......
#! /bin/sh
# Wrapper for compilers which do not understand `-c -o'.
scriptversion=2003-11-09.00
# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand `-c -o'.
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file `INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit 0
;;
-v | --v*)
echo "compile $scriptversion"
exit 0
;;
esac
prog=$1
shift
ofile=
cfile=
args=
while test $# -gt 0; do
case "$1" in
-o)
# configure might choose to run compile as `compile cc -o foo foo.c'.
# So we do something ugly here.
ofile=$2
shift
case "$ofile" in
*.o | *.obj)
;;
*)
args="$args -o $ofile"
ofile=
;;
esac
;;
*.c)
cfile=$1
args="$args $1"
;;
*)
args="$args $1"
;;
esac
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no `-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# `.c' file was seen then we are probably linking. That is also
# ok.
exec "$prog" $args
fi
# Name of file we expect compiler to create.
cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
# Create the lock directory.
# Note: use `[/.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d
while true; do
if mkdir $lockdir > /dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir $lockdir; exit 1" 1 2 15
# Run the compile.
"$prog" $args
status=$?
if test -f "$cofile"; then
mv "$cofile" "$ofile"
fi
rmdir $lockdir
exit $status
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
......@@ -7,5 +7,5 @@ Name: LAL
Description: LSC Algorithm Library
Version: @VERSION@
Requires: fftw3 fftw3f gsl
Libs: -L${libdir} @MPI_LDFLAGS@
Cflags: -I${includedir} @MPI_CFLAGS@ @MPI_CPPFLAGS@
Libs: -L${libdir}
Cflags: -I${includedir}
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: LALFrame
Description: LAL Frame Library Support
Version: @VERSION@
Requires: lal libframe
Libs: -L${libdir} -llalframe
Cflags: -I${includedir}
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: LALMetaIo
Description: LAL MetaIo Library Support
Version: @VERSION@
Requires: lal libmetaio
Libs: -L${libdir} -llalmetaio
Cflags: -I${includedir}
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: LALMPI
Description: LAL MPI Support
Version: @VERSION@
Requires: lal
Libs: -L${libdir} -llalmpi @MPI_LDFLAGS@
Cflags: -I${includedir} @MPI_CFLAGS@ @MPI_CPPFLAGS@
......@@ -5,8 +5,8 @@ lib_LTLIBRARIES = liblal.la
liblal_la_SOURCES = LALEmpty.c
nodist_liblal_la_SOURCES = LALBuildDate.c
#BUILT_SOURCES = LALBuildDate.c
liblal_la_LIBADD = @LIBLISTBASE@ @LIBLISTMPI@ @LIBLISTMPIFRAME@ @LALLIBADD@
liblal_la_DEPENDENCIES = @LIBLISTBASE@ @LIBLISTMPI@ @LIBLISTMPIFRAME@
liblal_la_LIBADD = @LIBLISTBASE@ @LALLIBADD@
liblal_la_DEPENDENCIES = @LIBLISTBASE@
bin_PROGRAMS = lal-version
lal_version_SOURCES = lal-version.c
lal_version_LDADD = $(top_builddir)/lib/liblal.la
......
......@@ -2,8 +2,11 @@
COMMSOURCES = SendRecv.c Exchange.c
if MPI
noinst_LTLIBRARIES = libcomm.la
libcomm_la_SOURCES = $(COMMSOURCES)
lib_LTLIBRARIES = liblalmpi.la
liblalmpi_la_SOURCES = $(COMMSOURCES)
liblalmpi_la_CPPFLAGS = $(MPI_CPPFLAGS)
liblalmpi_la_CFLAGS = $(MPI_CFLAGS)
liblalmpi_la_LIBADD = $(MPI_LDFLAGS)
EXTRA_TEXSOURCES =
else
EXTRA_TEXSOURCES = $(COMMSOURCES)
......
## Process this file with automake to produce Makefile.in
if MPI
check_PROGRAMS = SendRecvTest ExchangeTest
TESTS = CommTest@MPITYPE@
TESTS = CommTest@MPI_TYPE@
else
check_PROGRAMS =
TESTS = NoTest
......@@ -10,9 +10,18 @@ endif
EXTRA_DIST = NoTest CommTestMPICH CommTestLAM SendRecvTest.c ExchangeTest.c
SendRecvTest_SOURCES = SendRecvTest.c
SendRecvTest_LDADD = $(top_builddir)/packages/support/src/liblalsupport.la $(top_builddir)/lib/liblal.la
SendRecvTest_LDADD = $(top_builddir)/packages/comm/src/liblalmpi.la $(top_builddir)/packages/support/src/liblalsupport.la $(top_builddir)/lib/liblal.la
SendRecvTest_CPPFLAGS = $(MPI_CPPFLAGS)
SendRecvTest_CFLAGS = $(MPI_CFLAGS)
SendRecvTest_LDFLAGS = $(MPI_LDFLAGS)
ExchangeTest_SOURCES = ExchangeTest.c
ExchangeTest_LDADD = $(top_builddir)/packages/support/src/liblalsupport.la $(top_builddir)/lib/liblal.la
ExchangeTest_LDADD = $(top_builddir)/packages/comm/src/liblalmpi.la $(top_builddir)/packages/support/src/liblalsupport.la $(top_builddir)/lib/liblal.la
ExchangeTest_CPPFLAGS = $(MPI_CPPFLAGS)
ExchangeTest_CFLAGS = $(MPI_CFLAGS)
ExchangeTest_LDFLAGS = $(MPI_LDFLAGS)
INCLUDES = -I$(top_builddir)/include -I$(srcdir)/../include
MOSTLYCLEANFILES = .dvi-dep PI* Slave*.out Slave*.err machines killscript lamhosts CommTestSchema
CLEANFILES = SendRecvTest ExchangeTest
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment