aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@5c1b1641-b641-47ec-b3d9-0f93d4c445ee>2009-12-01 04:57:52 +0000
committerschnetter <schnetter@5c1b1641-b641-47ec-b3d9-0f93d4c445ee>2009-12-01 04:57:52 +0000
commitdcae4ec74aafcc450beb47d82c5ee55b4af63a0b (patch)
tree4ba9dcb8435335d1803af20151b213d0991062cb
parent0973a99607f9934137b3efe152c7cd9817a45cae (diff)
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
-rw-r--r--LORENE.sh39
-rw-r--r--dist/LORENE.tar.gzbin2277938 -> 0 bytes
-rw-r--r--dist/README17
-rw-r--r--dist/darwin.patch30
-rw-r--r--dist/des.patch121
-rw-r--r--dist/fortran.patch12
-rw-r--r--dist/pgplot.patch12
-rw-r--r--dist/spheroid.patch40
8 files changed, 227 insertions, 44 deletions
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 <<EOF
CXX = ${CXX}
-CXXFLAGS ${CXXFLAGS}
+CXXFLAGS = ${CXXFLAGS}
CXXFLAGS_G = ${CXXFLAGS}
F77 = ${F77}
-F77FLAGS = ${F77FLAGS}
-F77FLAGS_G = ${F77FLAGS}
-INC = -I\$(HOME_LORENE)/C++/Include -I\$(HOME_LORENE)/C++/Include_extra
+F77FLAGS = ${F77FLAGS} $($(echo ${F77} | grep -i xlf > /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
--- a/dist/LORENE.tar.gz
+++ /dev/null
Binary files 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 <math.h>
- #define __infinity INFINITY
- #else
-+#ifdef __x86_64__
-+#include <math.h>
-+#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<niter; mer++) {
+
+
+- des_meridian(psi_j, 1, 10., "psi", 0) ;
+- des_meridian(nn_j, 1, 10., "nn", 1) ;
+- des_meridian(theta_j, 1, 10., "Theta", 2) ;
+- des_meridian(chi_j, 1, 10., "chi", 3) ;
++ //des_meridian(psi_j, 1, 10., "psi", 0) ;
++ //des_meridian(nn_j, 1, 10., "nn", 1) ;
++ //des_meridian(theta_j, 1, 10., "Theta", 2) ;
++ //des_meridian(chi_j, 1, 10., "chi", 3) ;
+ arrete() ;
+
+
+@@ -1409,8 +1409,8 @@
+ // Iteration in theta/chi
+ for (int i=0 ; i<niter ; i++) {
+
+- des_meridian(theta_i, 1, 10., "Theta", 2) ;
+- des_meridian(chi_i, 1, 10., "chi", 3) ;
++ //des_meridian(theta_i, 1, 10., "Theta", 2) ;
++ //des_meridian(chi_i, 1, 10., "chi", 3) ;
+ arrete() ;
+
+
+Index: Lorene/C++/Source/Time_slice/tslice_conf_init.C
+===================================================================
+RCS file: /cvsroot/Lorene/C++/Source/Time_slice/tslice_conf_init.C,v
+retrieving revision 1.10
+diff -u -r1.10 tslice_conf_init.C
+--- Lorene/C++/Source/Time_slice/tslice_conf_init.C 4 Dec 2008 18:22:49 -0000 1.10
++++ Lorene/C++/Source/Time_slice/tslice_conf_init.C 30 Nov 2009 03:47:23 -0000
+@@ -223,7 +223,7 @@
+ maxabs(psi_jp1.laplacian() - source_psi,
+ "Absolute error in the resolution of the equation for Psi") ;
+
+- des_meridian(psi_jp1, 0., ray_des, "Psi", ngraph0, graph_device) ;
++ //des_meridian(psi_jp1, 0., ray_des, "Psi", ngraph0, graph_device) ;
+
+ // Resolution of the Poisson equation for the lapse
+ // ------------------------------------------------
+@@ -236,7 +236,7 @@
+ maxabs(nn_jp1.laplacian() - source_nn,
+ "Absolute error in the resolution of the equation for N") ;
+
+- des_meridian(nn_jp1, 0., ray_des, "N", ngraph0+1, graph_device) ;
++ //des_meridian(nn_jp1, 0., ray_des, "N", ngraph0+1, graph_device) ;
+
+ // Resolution of the vector Poisson equation for the shift
+ //---------------------------------------------------------
+@@ -244,12 +244,14 @@
+ Vector beta_jp1 = source_beta.poisson(0.3333333333333333, ff,
+ method_poisson_vect) ;
+
++ /*
+ des_meridian(beta_jp1(1), 0., ray_des, "\\gb\\ur\\d", ngraph0+2,
+ graph_device) ;
+ des_meridian(beta_jp1(2), 0., ray_des, "\\gb\\u\\gh\\d", ngraph0+3,
+ graph_device) ;
+ des_meridian(beta_jp1(3), 0., ray_des, "\\gb\\u\\gf\\d", ngraph0+4,
+ graph_device) ;
++ */
+
+ // Test:
+ Vector test_beta = (beta_jp1.derive_con(ff)).divergence(ff)
+Index: Lorene/C++/Source/Time_slice/tslice_dirac_max_evolve.C
+===================================================================
+RCS file: /cvsroot/Lorene/C++/Source/Time_slice/tslice_dirac_max_evolve.C,v
+retrieving revision 1.16
+diff -u -r1.16 tslice_dirac_max_evolve.C
+--- Lorene/C++/Source/Time_slice/tslice_dirac_max_evolve.C 4 Dec 2008 18:22:49 -0000 1.16
++++ Lorene/C++/Source/Time_slice/tslice_dirac_max_evolve.C 30 Nov 2009 03:47:23 -0000
+@@ -673,6 +673,7 @@
+ beta_evol.update(beta_new, jtime, ttime) ;
+ }
+
++ /*
+ des_meridian(beta()(1), 0., ray_des, "\\gb\\ur\\d", ngraph0+6,
+ graph_device) ;
+ des_meridian(beta()(2), 0., ray_des, "\\gb\\u\\gh\\d", ngraph0+7,
+@@ -695,6 +696,7 @@
+ graph_device) ;
+
+ arrete(nopause) ;
++ */
+
+ }
+
diff --git a/dist/fortran.patch b/dist/fortran.patch
new file mode 100644
index 0000000..874c7a9
--- /dev/null
+++ b/dist/fortran.patch
@@ -0,0 +1,12 @@
+diff -ru Lorene.orig/F77/Source/Poisson2d/fcer3s.f Lorene/F77/Source/Poisson2d/fcer3s.f
+--- Lorene.orig/F77/Source/Poisson2d/fcer3s.f 2001-11-20 09:19:30.000000000 -0600
++++ Lorene/F77/Source/Poisson2d/fcer3s.f 2009-11-25 21:48:21.000000000 -0600
+@@ -206,7 +206,7 @@
+ C
+ C INITIALISATION.
+ C
+- IF (NCY.EQ.NY1.AND.NCZ.EQ.NZ1.AND.NCR.EQ.NR1.AND.NEQ.EQ.NNN64) GO TO 800
++ IF (NCY.EQ.NY1.AND.NCZ.EQ.NZ1.AND.NCR.EQ.NR1.AND.NEQ.EQ.NNN64) GOTO 800
+ C
+ NCR=NR1
+ NCY=NY1
diff --git a/dist/pgplot.patch b/dist/pgplot.patch
new file mode 100644
index 0000000..d6ec096
--- /dev/null
+++ b/dist/pgplot.patch
@@ -0,0 +1,12 @@
+diff -ru Lorene.orig/C++/Makefile Lorene/C++/Makefile
+--- Lorene.orig/C++/Makefile 2009-09-02 12:44:52.000000000 -0500
++++ Lorene/C++/Makefile 2009-11-30 19:50:04.000000000 -0600
+@@ -39,7 +39,7 @@
+ cd Source/Mtbl_cf; $(MAKE)
+ cd Source/Non_class_members/Coef; $(MAKE)
+ cd Source/Non_class_members/Coef/$(FFT_DIR); $(MAKE)
+- cd Source/Non_class_members/Graphics; $(MAKE)
++# cd Source/Non_class_members/Graphics; $(MAKE)
+ cd Source/Non_class_members/Operators; $(MAKE)
+ cd Source/Non_class_members/PDE; $(MAKE)
+ cd Source/Non_class_members/Utilities; $(MAKE)
diff --git a/dist/spheroid.patch b/dist/spheroid.patch
new file mode 100644
index 0000000..0824b61
--- /dev/null
+++ b/dist/spheroid.patch
@@ -0,0 +1,40 @@
+Index: Lorene/C++/Source/App_hor/spheroid.C
+===================================================================
+RCS file: /cvsroot/Lorene/C++/Source/App_hor/spheroid.C,v
+retrieving revision 1.15
+diff -u -r1.15 spheroid.C
+--- Lorene/C++/Source/App_hor/spheroid.C 10 Dec 2008 13:55:55 -0000 1.15
++++ Lorene/C++/Source/App_hor/spheroid.C 30 Nov 2009 04:24:02 -0000
+@@ -704,6 +704,32 @@
+ set_der_0x0() ;
+
+ }
++
++// Assignment to another Spheroid
++void Spheroid::operator=(const Spheroid& sph_in)
++{
++
++ h_surf = sph_in.h_surf ;
++ jac2d = sph_in.jac2d ;
++ proj = sph_in.proj ;
++ qq = sph_in.qq ;
++ ss = sph_in.ss ;
++ ephi = sph_in.ephi ;
++ qab = sph_in.qab ;
++ ricci = sph_in.ricci ;
++ hh = sph_in.hh ;
++ trk = sph_in.trk ;
++ ll = sph_in.ll ;
++ jj = sph_in.jj ;
++ fff = sph_in.fff ;
++ ggg = sph_in.ggg ;
++ zeta = sph_in.zeta ;
++ issphere = sph_in.issphere ;
++
++ del_deriv() ; // Deletes all derived quantities
++
++}
++
+ //------------//
+ //Destructor //
+ //-----------//