Commit 05535edb authored by jolien's avatar jolien
Browse files

support for pkg-config and updated install documentation.

Original: a22fdb55b4bfb119dfee2159893cdb559407e6dc
parent 0a53041b
This diff is collapsed.
......@@ -2,14 +2,14 @@
SUBDIRS = misc include packages doc lib
MAINTAINERCLEANFILES = README.install
EXTRA_DIST = README.bugs README.contrib README.install \
lal-config.in lal.pc.in acinclude.m4 aclocal.m4 \
lal-config.in lal.pc.in lalsupport.pc.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
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = lal.pc
pkgconfig_DATA = lal.pc lalsupport.pc
# cvs-clean: more than maintainer-clean, this cleans
# everything not in the cvs archive.
......
......@@ -31,8 +31,81 @@ Or just follow the instructions below.
PRE-INSTALLATION
Building LAL requires some software to be pre-installed. This section
describes how to download and install this software if it is missing from
your system. If you wish to install pre-compiled RPMs you can skip to that
section. The next section describes how to build the required software from
source.
Building Required Software from Source:
include(@@lal-preinstall.txt@@)
Installing Required Software from RPMs:
The commands listed below are appropriate for a Bourne-shell (e.g., bash);
they will need to be modified appropriately for C-shells (e.g., tcsh).
This is where to get sources:
LALRPMURL=http://www.lsc-group.phys.uwm.edu/lal/sources/rpms
get required autoconf, automake, fftw3, gsl, libframe, and libmetaio
you can use "lynx -dump" or "wget -O-" instead of "curl"
curl $LALRPMURL/autoconf-2.59-3.noarch.rpm > autoconf-2.59-3.noarch.rpm
curl $LALRPMURL/automake-1.8.4-1.i386.rpm > automake-1.8.4-1.i386.rpm
curl $LALRPMURL/fftw3-3.0.1-5.i386.rpm > fftw-3.0.1-5.i386.rpm
curl $LALRPMURL/gsl-1.5-1.i386.rpm > gsl-1.5-1.i386.rpm
curl $LALRPMURL/gsl-devel-1.5-1.i386.rpm > gsl-devel-1.5-1.i386.rpm
curl $LALRPMURL/libframe-6.13-1.i386.rpm > libframe-6.13-1.i386.rpm
curl $LALRPMURL/libframe-devel-6.13-1.i386.rpm > libframe-devel-6.13-1.i386.rpm
curl $LALRPMURL/libframe-utils-6.13-1.i386.rpm > libframe-utils-6.13-1.i386.rpm
curl $LALRPMURL/libmetaio-5.4-3.i386.rpm > libmetaio-5.4-3.i386.rpm
curl $LALRPMURL/libmetaio-debuginfo-5.4-3.i386.rpm > libmetaio-debuginfo-5.4-3.i386.rpm
curl $LALRPMURL/libmetaio-devel-5.4-3.i386.rpm > libmetaio-devel-5.4-3.i386.rpm
now login as root and install the RPMs
rpm -Uvh autoconf-2.59-3.noarch.rpm
rpm -Uvh automake-1.8.4-1.i386.rpm
rpm -Uvh fftw-3.0.1-5.i386.rpm
rpm -Uvh gsl-1.5-1.i386.rpm
rpm -Uvh gsl-devel-1.5-1.i386.rpm
rpm -Uvh libframe-6.13-1.i386.rpm
rpm -Uvh libframe-devel-6.13-1.i386.rpm
rpm -Uvh libframe-utils-6.13-1.i386.rpm
rpm -Uvh libmetaio-5.4-3.i386.rpm
rpm -Uvh libmetaio-debuginfo-5.4-3.i386.rpm
rpm -Uvh libmetaio-devel-5.4-3.i386.rpm
if you cannot use these binary RPMs and you wish to build from source RPMs,
first download the source RPMs
curl $LALRPMURL/autoconf-2.59-3.src.rpm > autoconf-2.59-3.src.rpm
curl $LALRPMURL/automake-1.8.4-1.src.rpm > automake-1.8.4-1.src.rpm
curl $LALRPMURL/fftw3-3.0.1-5.src.rpm > fftw3-3.0.1-5.src.rpm
curl $LALRPMURL/gsl-1.5-1.src.rpm > gsl-1.5-1.src.rpm
curl $LALRPMURL/libframe-6.13-1.src.rpm > libframe-6.13-1.src.rpm
curl $LALRPMURL/libmetaio-5.4-3.src.rpm > libmetaio-5.4-3.src.rpm
now login as root and install the source RPMs
rpm -Uvh autoconf-2.59-3.src.rpm
rpm -Uvh automake-1.8.4-1.src.rpm
rpm -Uvh fftw3-3.0.1-5.src.rpm
rpm -Uvh gsl-1.5-1.src.rpm
rpm -Uvh libframe-6.13-1.src.rpm
rpm -Uvh libmetaio-5.4-3.src.rpm
next go to the directory containing the spec files and build the sources
cd /usr/src/redhat/SPECS
TODO: instructions on building the sources
finally install the new binary RPMs
TODO: instructions on installing binary RPMs
INSTALLING LAL
include(@@lal-install.txt@@)
......
......@@ -3,11 +3,13 @@
## Perform the installation of LAL and LALApps. The following commands
## will download, build, and install LAL and LALApps. This requires
## the software installed in the pre-install to have been built and installed.
## The location of this software is given by the environment variable
## "LSCSOFT_LOCATION" which must be set before these commands are
## executed.
## If the software was not installed in a standard location, such as
## "/usr" or "/usr/local", then the location of the software must be specified.
## To do so, the location of this software is given by the environment variable
## "LSCSOFT_LOCATION" which must be set before these commands are executed.
# "LSCSOFT_LOCATION" must be set --- make sure this software is available:
# set "LSCSOFT_LOCATION" to the location where the required software
# (described in the pre-install instructions) has been installed
#ignore
if test -z "$LSCSOFT_LOCATION"; then
echo "ERROR: environment variable LSCSOFT_LOCATION not defined" 1>&2
......@@ -17,10 +19,8 @@ fi
#verbatim
PATH=$LSCSOFT_LOCATION/bin:$PATH
LD_LIBRARY_PATH=$LSCSOFT_LOCATION/lib:$LD_LIBRARY_PATH
export PATH LD_LIBRARY_PATH
LSCSOFT_INCDIR=$LSCSOFT_LOCATION/include
LSCSOFT_LIBDIR=$LSCSOFT_LOCATION/lib
PKG_CONFIG_PATH=$LSCSOFT_LOCATION/lib:$PKG_CONFIG_PATH
export PATH LD_LIBRARY_PATH PKG_CONFIG_PATH
#/verbatim
# set "LAL_PREFIX" to the location where you wish to install lal and lalapps
......@@ -35,10 +35,6 @@ LAL_PREFIX=$LSCSOFT_LOCATION/devel
#ignore
fi
#/ignore
#verbatim
LAL_INCDIR=$LAL_PREFIX/include
LAL_LIBDIR=$LAL_PREFIX/lib
#/verbatim
### the rest of this script should not need to be edited
......@@ -52,17 +48,15 @@ fail() {
}
#/ignore
# build and install LAL
# build and install LAL (the "--with-gcc-flags" tells gcc to use flags
# that will produce warnings about possibly non-portable code)
#ignore
if test -x 00boot ; then # distribution from CVS
./00boot || fail
fi
#/ignore
#verbatim
./configure --prefix=$LAL_PREFIX \
--with-extra-cppflags=-I$LSCSOFT_INCDIR \
--with-extra-libs=-L$LSCSOFT_LIBDIR \
--with-gcc-flags --enable-frame --enable-metaio || fail
./configure --prefix=$LAL_PREFIX --with-gcc-flags || fail
make || fail
make install || fail
#/verbatim
......
......@@ -7,10 +7,16 @@
## autoconf-2.59
## automake-1.8.5
## fftw-3.0.1
## frame-6.13
## gsl-1.5
## metaio-5.4
## libframe-6.13 (optional but recommended)
## libmetaio-5.4 (optional but recommended)
##/verse
## If this software is already on your system, you can use the existing
## software. If some of the software is missing, you can use the appropriate
## part of these instructions to install that component. Pre-compiled versions
## of the software are also available for installation. See the RPMs
## section for instructions on obtaining these.
##
## The software is installed in the directory "LSCSOFT_PREFIX".
## If this variable is not set, it will be installed in "$HOME/opt/lscsoft"
## by default. To install in some other location, set "LSCSOFT_PREFIX"
......@@ -80,9 +86,9 @@ mkdir -p $LSCSOFT_TMPDIR || fail
curl $LALSRCURL/autoconf-2.59.tar.gz > $LSCSOFT_TMPDIR/autoconf-2.59.tar.gz || fail
curl $LALSRCURL/automake-1.8.5.tar.gz > $LSCSOFT_TMPDIR/automake-1.8.5.tar.gz || fail
curl $LALSRCURL/fftw-3.0.1.tar.gz > $LSCSOFT_TMPDIR/fftw-3.0.1.tar.gz || fail
curl $LALSRCURL/frame-6.13.tar.gz > $LSCSOFT_TMPDIR/frame-6.13.tar.gz || fail
curl $LALSRCURL/gsl-1.5.tar.gz > $LSCSOFT_TMPDIR/gsl-1.5.tar.gz || fail
curl $LALSRCURL/metaio-5.4.tar.gz > $LSCSOFT_TMPDIR/metaio-5.4.tar.gz || fail
curl $LALSRCURL/libframe-6.13.tar.gz > $LSCSOFT_TMPDIR/libframe-6.13.tar.gz || fail
curl $LALSRCURL/libmetaio-5.4.tar.gz > $LSCSOFT_TMPDIR/libmetaio-5.4.tar.gz || fail
#/verbatim
# unpack these archives in "LSCSOFT_SRCDIR"
......@@ -91,10 +97,9 @@ cd $LSCSOFT_SRCDIR || fail
tar -zxvf $LSCSOFT_TMPDIR/autoconf-2.59.tar.gz || fail
tar -zxvf $LSCSOFT_TMPDIR/automake-1.8.5.tar.gz || fail
tar -zxvf $LSCSOFT_TMPDIR/fftw-3.0.1.tar.gz || fail
tar -zxvf $LSCSOFT_TMPDIR/frame-6.13.tar.gz || fail
mv v6r13 frame-6.13 || fail
tar -zxvf $LSCSOFT_TMPDIR/gsl-1.5.tar.gz || fail
tar -zxvf $LSCSOFT_TMPDIR/metaio-5.4.tar.gz || fail
tar -zxvf $LSCSOFT_TMPDIR/libframe-6.13.tar.gz || fail
tar -zxvf $LSCSOFT_TMPDIR/libmetaio-5.4.tar.gz || fail
#/verbatim
# build and install autoconf
......@@ -125,60 +130,25 @@ make # note: ignore fail
make install # note: ignore fail
#/verbatim
# build and install frame ---
#ignore
if test "`uname`" = "Darwin" ; then
#/ignore
# if you are using Darwin, use the following commands:
#verbatim
cd $LSCSOFT_SRCDIR/frame-6.13/mgr || fail
./makeMacOS || fail
cp -f $LSCSOFT_SRCDIR/frame-6.13/Darwin/libFrame.a $LSCSOFT_LIBDIR || fail
cp -f $LSCSOFT_SRCDIR/frame-6.13/Darwin/libFrame.dynlib $LSCSOFT_LIBDIR || fail
cp -f $LSCSOFT_SRCDIR/frame-6.13/Darwin/FrCheck $LSCSOFT_BINDIR || fail
cp -f $LSCSOFT_SRCDIR/frame-6.13/Darwin/FrCopy $LSCSOFT_BINDIR || fail
cp -f $LSCSOFT_SRCDIR/frame-6.13/Darwin/FrDump $LSCSOFT_BINDIR || fail
#/verbatim
#ignore
else
if test "`uname`" = "Linux" ; then
FRBUILD=`uname`-`uname -m`
else
FRBUILD=`uname`
fi
#/ignore
# otherwise set "FRBUILD=`uname`" or "FRBUILD=Linux-`uname -i`" for Linux
# and use these commands:
#verbatim
cd $LSCSOFT_SRCDIR/frame-6.13/mgr || fail
./makegcc || fail
cp -f $LSCSOFT_SRCDIR/frame-6.13/$FRBUILD/libFrame.a $LSCSOFT_LIBDIR || fail
cp -f $LSCSOFT_SRCDIR/frame-6.13/$FRBUILD/libFrame.so $LSCSOFT_LIBDIR || fail
cp -f $LSCSOFT_SRCDIR/frame-6.13/$FRBUILD/FrCheck $LSCSOFT_BINDIR || fail
cp -f $LSCSOFT_SRCDIR/frame-6.13/$FRBUILD/FrCopy $LSCSOFT_BINDIR || fail
cp -f $LSCSOFT_SRCDIR/frame-6.13/$FRBUILD/FrDump $LSCSOFT_BINDIR || fail
#/verbatim
#ignore
fi
#/ignore
# then install the header files
# build and install gsl
#verbatim
cp -f $LSCSOFT_SRCDIR/frame-6.13/src/FrIO.h $LSCSOFT_INCDIR || fail
cp -f $LSCSOFT_SRCDIR/frame-6.13/src/FrVect.h $LSCSOFT_INCDIR || fail
cp -f $LSCSOFT_SRCDIR/frame-6.13/src/FrameL.h $LSCSOFT_INCDIR || fail
cd $LSCSOFT_SRCDIR/gsl-1.5 || fail
./configure --prefix=$LSCSOFT_PREFIX || fail
make || fail
make install || fail
#/verbatim
# build and install gsl
# build and install libframe
#verbatim
cd $LSCSOFT_SRCDIR/gsl-1.5 || fail
cd $LSCSOFT_SRCDIR/libframe-6.13 || fail
./configure --prefix=$LSCSOFT_PREFIX || fail
make || fail
make install || fail
#/verbatim
# build and install metaio
# build and install libmetaio
#verbatim
cd $LSCSOFT_SRCDIR/metaio-5.4 || fail
cd $LSCSOFT_SRCDIR/libmetaio-5.4 || fail
./configure --prefix=$LSCSOFT_PREFIX || fail
make || fail
make install || fail
......
......@@ -6,5 +6,6 @@ includedir=@includedir@
Name: LAL
Description: LSC Algorithm Library
Version: @VERSION@
Libs: @LAL_LIBS@
Cflags: @LAL_CFLAGS@
Requires: fftw3 fftw3f gsl
Libs: -L${libdir} @MPI_LDFLAGS@
Cflags: -I${includedir} @MPI_CFLAGS@ @MPI_CPPFLAGS@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: LALSupport
Description: LSC Algorithm Support Library (useful but non-conforming routines)
Version: @VERSION@
Requires: lal
Libs: -L${libdir} -llalsupport
Cflags: -I${includedir}
......@@ -14,3 +14,20 @@ MOSTLYCLEANFILES = LALBuildDate.c
TESTS = lal-version
LALBuildDate.c: $(liblal_la_DEPENDENCIES)
echo 'const char *lalBuildDate = "'`date +"%Y-%m-%dT%H:%M:%S%z"`'";' >$@
all: all-am
@echo "";\
echo "*****************************************************************";\
echo "* *";\
echo "* LAL has now been successfully built. *";\
echo "* Now run 'make install' to install LAL. *";\
echo "* *";\
echo "*****************************************************************"
install: install-am
@echo "";\
echo "*****************************************************************";\
echo "* *";\
echo "* LAL has now been successfully installed. *";\
echo "* *";\
echo "*****************************************************************"
......@@ -19,12 +19,17 @@ if ( ! ${?MANPATH} ) then
setenv MANPATH ''
endif
if ( ! ${?PKG_CONFIG_PATH} ) then
setenv PKG_CONFIG_PATH ''
endif
if ( ${?LAL_PREFIX} ) then
if ( "${LAL_PREFIX}" != "" ) then
setenv PATH `echo "${PATH}" | sed -e "s%:${LAL_PREFIX}[^:]*%%g" -e "s%^${LAL_PREFIX}[^:]*:\{0,1\}%%"`
setenv LD_LIBRARY_PATH `echo "${LD_LIBRARY_PATH}" | sed -e "s%:${LAL_PREFIX}[^:]*%%g" -e "s%^${LAL_PREFIX}[^:]*:\{0,1\}%%"`
setenv MANPATH `echo "${MANPATH}" | sed -e "s%:${LAL_PREFIX}[^:]*%%g" -e "s%^${LAL_PREFIX}[^:]*:\{0,1\}%%"`
setenv PKG_CONFIG_PATH `echo "${PKG_CONFIG_PATH}" | sed -e "s%:${LAL_PREFIX}[^:]*%%g" -e "s%^${LAL_PREFIX}[^:]*:\{0,1\}%%"`
endif
endif
......@@ -34,7 +39,9 @@ if ( "${LAL_PREFIX}" != "" ) then
setenv PATH `echo "${PATH}" | sed -e "s%:${LAL_PREFIX}[^:]*%%g" -e "s%^${LAL_PREFIX}[^:]*:\{0,1\}%%"`
setenv LD_LIBRARY_PATH `echo "${LD_LIBRARY_PATH}" | sed -e "s%:${LAL_PREFIX}[^:]*%%g" -e "s%^${LAL_PREFIX}[^:]*:\{0,1\}%%"`
setenv MANPATH `echo "${MANPATH}" | sed -e "s%:${LAL_PREFIX}[^:]*%%g" -e "s%^${LAL_PREFIX}[^:]*:\{0,1\}%%"`
setenv PKG_CONFIG_PATH `echo "${PKG_CONFIG_PATH}" | sed -e "s%:${LAL_PREFIX}[^:]*%%g" -e "s%^${LAL_PREFIX}[^:]*:\{0,1\}%%"`
setenv PATH ${LAL_LOCATION}/bin:${PATH}
setenv LD_LIBRARY_PATH ${LAL_LOCATION}/lib:${LD_LIBRARY_PATH}
setenv MANPATH ${LAL_LOCATION}/man:${MANPATH}
setenv PKG_CONFIG_PATH ${LAL_LOCATION}/pkgconfig:${MANPATH}
endif
......@@ -15,7 +15,8 @@ if [ -n "${LAL_PREFIX}" ]; then
PATH=`echo "${PATH}" | sed -e "s%:${LAL_PREFIX}[^:]*%%g" -e "s%^${LAL_PREFIX}[^:]*:\{0,1\}%%"`
LD_LIBRARY_PATH=`echo "${LD_LIBRARY_PATH}" | sed -e "s%:${LAL_PREFIX}[^:]*%%g" -e "s%^${LAL_PREFIX}[^:]*:\{0,1\}%%"`
MANPATH=`echo "${MANPATH}" | sed -e "s%:${LAL_PREFIX}[^:]*%%g" -e "s%^${LAL_PREFIX}[^:]*:\{0,1\}%%"`
export PATH MANPATH LD_LIBRARY_PATH
PKG_CONFIG_PATH=`echo "${PKG_CONFIG_PATH}" | sed -e "s%:${LAL_PREFIX}[^:]*%%g" -e "s%^${LAL_PREFIX}[^:]*:\{0,1\}%%"`
export PATH MANPATH LD_LIBRARY_PATH PKG_CONFIG_PATH
fi
LAL_PREFIX=${LAL_LOCATION}
......@@ -25,8 +26,10 @@ if [ -n "${LAL_PREFIX}" ]; then
PATH=`echo "${PATH}" | sed -e "s%:${LAL_PREFIX}[^:]*%%g" -e "s%^${LAL_PREFIX}[^:]*:\{0,1\}%%"`
LD_LIBRARY_PATH=`echo "${LD_LIBRARY_PATH}" | sed -e "s%:${LAL_PREFIX}[^:]*%%g" -e "s%^${LAL_PREFIX}[^:]*:\{0,1\}%%"`
MANPATH=`echo "${MANPATH}" | sed -e "s%:${LAL_PREFIX}[^:]*%%g" -e "s%^${LAL_PREFIX}[^:]*:\{0,1\}%%"`
PKG_CONFIG_PATH=`echo "${PKG_CONFIG_PATH}" | sed -e "s%:${LAL_PREFIX}[^:]*%%g" -e "s%^${LAL_PREFIX}[^:]*:\{0,1\}%%"`
PATH=${LAL_LOCATION}/bin:${PATH}
LD_LIBRARY_PATH=${LAL_LOCATION}/lib:${LD_LIBRARY_PATH}
MANPATH=${LAL_LOCATION}/man:${MANPATH}
export PATH MANPATH LD_LIBRARY_PATH
PKG_CONFIG_PATH=${LAL_LOCATION}/lib/pkgconfig:${MANPATH}
export PATH MANPATH LD_LIBRARY_PATH PKG_CONFIG_PATH
fi
......@@ -91,28 +91,17 @@ AC_DEFUN([LAL_WITH_CC],
],)
])
AC_DEFUN([LAL_ENABLE_FFTW3],
[AC_ARG_ENABLE(
[fftw3],
[ --enable-fftw3 use fftw3 [default=no] ],
[ case "${enableval}" in
yes) fftw3=true;;
no) fftw3=false;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-fftw3) ;;
esac
], [ fftw3=true ] )
])
AC_DEFUN([LAL_ENABLE_FRAME],
[AC_ARG_ENABLE(
[frame],
[ --enable-frame compile code that requires Frame library [default=no] ],
[ --enable-frame compile code that requires Frame library [default=yes] ],
[ case "${enableval}" in
yes) frame=true;;
no) frame=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-frame) ;;
esac
], [ frame=false ] )
], [ frame=true ] )
])
AC_DEFUN([LAL_ENABLE_MPI],
......@@ -127,26 +116,16 @@ AC_DEFUN([LAL_ENABLE_MPI],
], [ mpi=false ] )
])
AC_DEFUN([LAL_ENABLE_DATAFLOW],
AC_DEFUN([LAL_ENABLE_METAIO],
[AC_ARG_ENABLE(
[dataflow],
[ --enable-dataflow compile code that requires metaio/dataflow library [default=no] ],
[ case "${enableval}" in
yes) dataflow=true;;
no) dataflow=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-frame) ;;
esac
], [ dataflow=false ] )
AC_ARG_ENABLE(
[metaio],
[ --enable-metaio compile code that requires metaio/dataflow library [default=no] ],
[ --enable-metaio compile code that requires metaio/dataflow library [default=yes] ],
[ case "${enableval}" in
yes) metaio=true;;
no) metaio=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-frame) ;;
esac
], [ metaio=false ] )
if test "x$metaio" = "xtrue" ; then dataflow=true ; fi
], [ metaio=true ] )
])
AC_DEFUN([LAL_ENABLE_INTELFFT],
......@@ -238,124 +217,33 @@ AC_MSG_ERROR([Intel FFT must use either static or shared libraries])
])
AC_DEFUN([LAL_FFTW_MSG_ERROR],
[echo "**************************************************************"
echo "* You must install FFTW (v >= 2.0) on your system. *"
echo "* FFTW is avaliable from http://www.fftw.org *"
echo "* FFTW must be configured with the --enable-float argument. *"
echo "* Install FFTW on your system using the commands: *"
echo "* *"
echo "* ./configure --enable-float *"
echo "* make *"
echo "* make install *"
echo "* *"
echo "* Remove the file config.cache before re-running configure. *"
echo "* *"
echo "* Please see the instructions in the file INSTALL. *"
echo "**************************************************************"
AC_MSG_ERROR([single precision FFTW must be properly installed.])
])
AC_DEFUN([LAL_SFFTW_WORKS],
[AC_MSG_CHECKING([whether single precison FFTW works])
AC_TRY_RUN([
#include <stdio.h>
#ifdef HAVE_SFFTW_H
#include <sfftw.h>
#elif HAVE_FFTW_H
#include <fftw.h>
#else
#error "don't have either sfftw.h or fftw.h"
#endif
int main() { return (sizeof(fftw_real)!=4 || fftw_sizeof_fftw_real()!=4); }
],
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
[
echo "**************************************************************"
echo "* FFTW does not seem to be working. *"
echo "* Possible problems: *"
echo "* - FFTW version < 2.0 *"
echo "* - Could not find header sfftw.h, fftw.h, or fftw3.h *"
echo "* - FFTW was not configured with the --enable-float option *"
echo "* Consult file config.log for details *"
]
LAL_FFTW_MSG_ERROR,
AC_MSG_RESULT([unknown]) ) ] )
AC_DEFUN([LAL_SRFFTW_WORKS],
[AC_MSG_CHECKING([whether single precison real FFTW works])
AC_TRY_RUN([
#include <stdio.h>
#ifdef HAVE_SRFFTW_H
#include <srfftw.h>
#elif HAVE_RFFTW_H
#include <rfftw.h>
#else
#error "don't have either srfftw.h or rfftw.h"
#endif
int main() { return sizeof(fftw_real) - 4; }
],
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
[
echo "**************************************************************"
echo "* FFTW does not seem to be working. *"
echo "* Possible problems: *"
echo "* - FFTW version < 2.0 *"
echo "* - Could not find header srfftw.h, rfftw.h, or fftw3.h *"
echo "* - FFTW was not configured with the --enable-float option *"
echo "* Consult file config.log for details *"
echo "**************************************************************"
]
LAL_FFTW_MSG_ERROR,
AC_MSG_RESULT([unknown]) ) ] )
AC_DEFUN([LAL_CHECK_FRAMELIB],
[ if test "${frame}" = "true"; then
lal_check_framelib_save_LIBS="$LIBS"
AC_CHECK_LIB(Frame, FrLibIni, ,
[AC_MSG_ERROR([couldn't find Frame library for --enable-frame])] )
AC_MSG_CHECKING([whether Frame library version >= 6.00])
AC_TRY_RUN([#include "FrameL.h"
int main() { return FRAMELIB_VERSION < 6.00 ? 1 : 0 ; }],
AC_MSG_RESULT([yes]),
[AC_MSG_RESULT([no])
AC_MSG_ERROR([FrameL.h not found or FRAMELIB_VERSION < 6.00])],
AC_MSG_RESULT([unknown]))
LIBS="$lal_check_framelib_save_LIBS"
fi
])
AC_DEFUN([LAL_CHECK_MPI],
[ AC_CHECK_PROGS(MPICC, mpicc hcc, $CC)
AC_MSG_CHECKING([for mpicc flags])
AC_DEFUN([LAL_CHECK_MPI_FLAGS],
[ AC_MSG_CHECKING([for mpicc flags])
SHOWARG=""
MPICPPFLAGS=""
MPICFLAGS=""
MPILDFLAGS=""
MPITYPE=NONE
MPI_CPPFLAGS=""
MPI_CFLAGS=""
MPI_LDFLAGS=""
MPI_TYPE=NONE
if (($MPICC -compile_info 1>/dev/null 2>/dev/null) && ($MPICC -link_info 1>/dev/null 2>/dev/null)) ; then
MPITYPE=mpich
MPI_TYPE=MPICH
for mpiarg in `$MPICC -compile_info` ; do
case $mpiarg in
-D*) MPICPPFLAGS="$MPICPPFLAGS $mpiarg" ;;
-I*) MPICPPFLAGS="$MPICPPFLAGS $mpiarg" ;;
-D*) MPI_CPPFLAGS="$MPI_CPPFLAGS $mpiarg" ;;
-I*) MPI_CPPFLAGS="$MPI_CPPFLAGS $mpiarg" ;;
esac
done
for mpiarg in `$MPICC -link_info` ; do
case $mpiarg in
-L*) MPILDFLAGS="$MPILDFLAGS $mpiarg" ;;
-l*) MPILDFLAGS="$MPILDFLAGS $mpiarg" ;;
-L*) MPI_LDFLAGS="$MPI_LDFLAGS $mpiarg" ;;
-l*) MPI_LDFLAGS="$MPI_LDFLAGS $mpiarg" ;;
esac
done
else
if ($MPICC -show 1>/dev/null 2>/dev/null) ; then
MPITYPE=MPICH
MPI_TYPE=MPICH
SHOWARG="-show"
elif ($MPICC -showme 1>/dev/null 2>/dev/null) ; then
MPITYPE=LAM
MPI_TYPE=LAM
SHOWARG="-showme"
else
AC_MSG_WARN([couldn't determine mpi compile flags])
......@@ -363,53 +251,18 @@ AC_DEFUN([LAL_CHECK_MPI],
if test -n "$SHOWARG" ; then
for mpiarg in `$MPICC $SHOWARG` ; do
case $mpiarg in
-D*) MPICPPFLAGS="$MPICPPFLAGS $mpiarg" ;;
-I*) MPICPPFLAGS="$MPICPPFLAGS $mpiarg" ;;
-L*) MPILDFLAGS="$MPILDFLAGS $mpiarg" ;;
-l*) MPILDFLAGS="$MPILDFLAGS $mpiarg" ;;
-pthread) MPILDFLAGS="$MPILDFLAGS -lpthread" ;;
-Wl*) MPICFLAGS="$MPICFLAGS $mpiarg" ;;
-D*) MPI_CPPFLAGS="$MPI_CPPFLAGS $mpiarg" ;;
-I*) MPI_CPPFLAGS="$MPI_CPPFLAGS $mpiarg" ;;
-L*) MPI_LDFLAGS="$MPI_LDFLAGS $mpiarg" ;;
-l*) MPI_LDFLAGS="$MPI_LDFLAGS $mpiarg" ;;
-pthread) MPI_LDFLAGS="$MPI_LDFLAGS -lpthread" ;;
-Wl*) MPI_CFLAGS="$MPI_CFLAGS $mpiarg" ;;
esac
done
fi
fi
AC_MSG_RESULT([$MPICPPFLAGS $MPICFLAGS $MPILDFLAGS])
LIBS="$LIBS $MPILDFLAGS"
CPPFLAGS="$CPPFLAGS $MPICPPFLAGS"
CFLAGS="$CFLAGS $MPICFLAGS"
AC_CHECK_HEADER(mpi.h, ,AC_MSG_ERROR([can't find mpi.h]))
AC_MSG_CHECKING([whether mpi works])
AC_TRY_LINK([#include <mpi.h>
], MPI_Finalize();,
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
AC_MSG_ERROR([mpi does not work]))
AC_MSG_CHECKING([mpi type])
AC_TRY_COMPILE([
#include <mpi.h>
#ifndef LAM_MPI
#error "not LAM"
#endif], , [ MPITYPE=LAM
AC_MSG_RESULT([lam])],
AC_TRY_COMPILE([
#include <mpi.h>
#ifndef MPICH_NAME
#erro "not MPICH"
#endif], , [ MPITYPE=MPICH
AC_MSG_RESULT([mpich])],
[
if test $MPITYPE = MPICH ; then
AC_MSG_RESULT([couldn't determine... guessing mpich])
elif test $MPITYPE = LAM ; then
AC_MSG_RESULT([couldn't determine... assuming lam])
else
AC_MSG_RESULT([couldn't determine.])
AC_MSG_ERROR([mpi must be either lam or mpich])
fi
]
)
)
AC_SUBST(MPITYPE)dnl
AC_MSG_RESULT([$MPI_CPPFLAGS $MPI_CFLAGS $MPI_LDFLAGS])
AC_SUBST(MPI_TYPE)dnl
])
......@@ -438,4 +291,3 @@ AC_DEFINE_UNQUOTED(LAL_TYPE_NAME, $LAL_CV_NAME)
undefine([LAL_TYPE_NAME])dnl
undefine([LAL_CV_NAME])dnl
])
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#