From dcae4ec74aafcc450beb47d82c5ee55b4af63a0b Mon Sep 17 00:00:00 2001 From: schnetter Date: Tue, 1 Dec 2009 04:57:52 +0000 Subject: Update LORENE, begin to make it build on AIX git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/LORENE/trunk@3 5c1b1641-b641-47ec-b3d9-0f93d4c445ee --- LORENE.sh | 39 ++++++++++++----- dist/LORENE.tar.gz | Bin 2277938 -> 0 bytes dist/README | 17 ++++++-- dist/darwin.patch | 30 ------------- dist/des.patch | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++ dist/fortran.patch | 12 ++++++ dist/pgplot.patch | 12 ++++++ dist/spheroid.patch | 40 +++++++++++++++++ 8 files changed, 227 insertions(+), 44 deletions(-) delete mode 100644 dist/LORENE.tar.gz delete mode 100644 dist/darwin.patch create mode 100644 dist/des.patch create mode 100644 dist/fortran.patch create mode 100644 dist/pgplot.patch create mode 100644 dist/spheroid.patch diff --git a/LORENE.sh b/LORENE.sh index 6afd6c3..08391f2 100644 --- a/LORENE.sh +++ b/LORENE.sh @@ -9,7 +9,7 @@ set -x # Output commands set -e # Abort on errors # Set locations -NAME=LORENE +NAME=Lorene SRCDIR=$(dirname $0) INSTALL_DIR=${SCRATCH_BUILD} LORENE_DIR=${INSTALL_DIR}/build-${NAME}/${NAME} @@ -34,28 +34,42 @@ unset MAKEFLAGS else echo "LORENE: Building enclosed LORENE library" + # Should we use gmake or make? + MAKE=$(gmake --help > /dev/null 2>&1 && echo gmake || echo make) + # Should we use gpatch or patch? + PATCH=$(gpatch -v > /dev/null 2>&1 && echo gpatch || echo patch) + # Should we use gtar or tar? + TAR=$(gtar --help > /dev/null 2>&1 && echo gtar || echo tar) + echo "LORENE: Unpacking archive..." rm -rf build-${NAME} mkdir build-${NAME} pushd build-${NAME} - # Should we use gtar or tar? - TAR=$(gtar --help > /dev/null 2> /dev/null && echo gtar || echo tar) ${TAR} xzf ${SRCDIR}/dist/${NAME}.tar.gz - patch -p0 < ${SRCDIR}/dist/darwin.patch + ${PATCH} -p0 < ${SRCDIR}/dist/des.patch + ${PATCH} -p0 < ${SRCDIR}/dist/fortran.patch + ${PATCH} -p0 < ${SRCDIR}/dist/pgplot.patch + ${PATCH} -p0 < ${SRCDIR}/dist/spheroid.patch + # Prevent overly long lines from CVS $Header$ comments + find ${NAME} -name '*.f' | + xargs perl -pi -e 's/\$Header.*\$/\$Header\$/g' popd echo "LORENE: Configuring..." pushd build-${NAME}/${NAME} cat > local_settings < /dev/null 2>&1) && echo '' -qfixed) +F77FLAGS_G = ${F77FLAGS} $($(echo ${F77} | grep -i xlf > /dev/null 2>&1) && echo '' -qfixed) +INC = -I\$(HOME_LORENE)/C++/Include -I\$(HOME_LORENE)/C++/Include_extra $(echo ${GSL_INC_DIRS} | xargs -n 1 -I @ echo -I@) +$($(echo '' ${ARFLAGS} | grep 64 > /dev/null 2>&1) && echo "export OBJECT_MODE=64") RANLIB = ${RANLIB} -MAKEDEPEND = ${CPP} \$(INC) -M >> \$(df).d \$< +# We don't need dependencies since we always build from scratch +#MAKEDEPEND = ${CXX_DEPEND} \$(INC) \$< ${CXX_DEPEND_OUT} && mv \$@ \$(df).d +MAKEDEPEND = : > \$(df).d DEPDIR = .deps FFT_DIR = FFT991 LIB_CXX = ${LIBS} @@ -70,7 +84,7 @@ EOF # "regular" version and a "debug" version. Both are identical # (since we specified identical build options above), and we # ignore the "debug" version. - make cpp fortran export + ${MAKE} cpp fortran export popd echo 'done' > done-${NAME} @@ -78,7 +92,10 @@ EOF fi ) -# TODO: check $? +if (( $? )); then + echo 'Error while building LORENE. Aborting.' + exit 1 +fi diff --git a/dist/LORENE.tar.gz b/dist/LORENE.tar.gz deleted file mode 100644 index ab27be6..0000000 Binary files a/dist/LORENE.tar.gz and /dev/null differ diff --git a/dist/README b/dist/README index bbb10bb..ce9eff9 100644 --- a/dist/README +++ b/dist/README @@ -1,10 +1,21 @@ This tarball LORENE.tar.gz is created in the following way: -1. Check out LORENE from CVS into a directory LORENE. +1. Check out LORENE from CVS: + + cvs -d :pserver:anonymous@octane.obspm.fr:/cvsroot checkout Lorene 2. Do not begin to build LORENE in this directory, as this would modify the source tree. (It would add additional files.) -3. Create the tarball from this source tree. +3. Create the tarball from this source tree: + + tar czf Lorene.tar.gz Lorene + +4. Test whether the patches apply cleanly. Do not add the patches to + the tarball: + + patch -p0 < [XXX].patch + +5. Remove the cvs source tree again: -4. Test whether the patches apply cleanly. + rm -rf Lorene diff --git a/dist/darwin.patch b/dist/darwin.patch deleted file mode 100644 index 66573ff..0000000 --- a/dist/darwin.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff -ru /Users/eschnett/src/LORENE/C++/Include/nbr_spx.h LORENE/C++/Include/nbr_spx.h ---- /Users/eschnett/src/LORENE/C++/Include/nbr_spx.h 2007-06-16 17:19:23.000000000 -0500 -+++ LORENE/C++/Include/nbr_spx.h 2009-11-21 17:46:49.000000000 -0600 -@@ -151,6 +151,10 @@ - #include - #define __infinity INFINITY - #else -+#ifdef __x86_64__ -+#include -+#define __infinity INFINITY -+#else - extern double __infinity ; - #endif - #endif -@@ -158,5 +162,6 @@ - #endif - #endif - #endif -+#endif - - #endif -diff -ru /Users/eschnett/src/LORENE/Makefile LORENE/Makefile ---- /Users/eschnett/src/LORENE/Makefile 2004-03-26 08:00:21.000000000 -0600 -+++ LORENE/Makefile 2009-11-21 17:43:37.000000000 -0600 -@@ -29,4 +29,4 @@ - test: - cd Test; $(MAKE) - -- -+.PHONY: all install doc cpp fortran export uninstall test diff --git a/dist/des.patch b/dist/des.patch new file mode 100644 index 0000000..2434daa --- /dev/null +++ b/dist/des.patch @@ -0,0 +1,121 @@ +Index: Lorene/C++/Source/Bin_hor/binhor_hh.C +=================================================================== +RCS file: /cvsroot/Lorene/C++/Source/Bin_hor/binhor_hh.C,v +retrieving revision 1.3 +diff -u -r1.3 binhor_hh.C +--- Lorene/C++/Source/Bin_hor/binhor_hh.C 9 Jan 2008 14:28:58 -0000 1.3 ++++ Lorene/C++/Source/Bin_hor/binhor_hh.C 30 Nov 2009 03:47:22 -0000 +@@ -892,7 +892,7 @@ + // des_profile(hh1(i,j), 0., 20., M_PI/2, M_PI) ; + //des_profile(hh1(i,j), 0., 20., M_PI/2, 0) ; + //des_profile(hh1(i,j), 0., 20., 0, M_PI) ; +- des_coupe_z (hh1(i,j), 0., 5) ; ++ //des_coupe_z (hh1(i,j), 0., 5) ; + } + + hh1.change_triad(hole1.mp.get_bvect_spher()) ; +@@ -908,7 +908,7 @@ + hole2.tgam = tgam_2 ; + + +- des_meridian(hh1, 0., 20., "hh1", 0) ; ++ //des_meridian(hh1, 0., 20., "hh1", 0) ; + + + } +Index: Lorene/C++/Source/Isol_hor/init_data.C +=================================================================== +RCS file: /cvsroot/Lorene/C++/Source/Isol_hor/init_data.C,v +retrieving revision 1.28 +diff -u -r1.28 init_data.C +--- Lorene/C++/Source/Isol_hor/init_data.C 19 Aug 2008 06:42:00 -0000 1.28 ++++ Lorene/C++/Source/Isol_hor/init_data.C 30 Nov 2009 03:47:22 -0000 +@@ -1262,10 +1262,10 @@ + for (int mer=0; mer