[cig-commits] r4204 - long/3D/Gale/trunk
walter at geodynamics.org
walter at geodynamics.org
Wed Aug 2 14:48:32 PDT 2006
Author: walter
Date: 2006-08-02 14:48:31 -0700 (Wed, 02 Aug 2006)
New Revision: 4204
Added:
long/3D/Gale/trunk/INSTALL.STATIC
Modified:
long/3D/Gale/trunk/
long/3D/Gale/trunk/SConstruct.in
Log:
r570 at earth: boo | 2006-08-02 14:46:56 -0700
Fully automate static builds on linux
Property changes on: long/3D/Gale/trunk
___________________________________________________________________
Name: svk:merge
- 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:569
+ 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:570
Added: long/3D/Gale/trunk/INSTALL.STATIC
===================================================================
--- long/3D/Gale/trunk/INSTALL.STATIC 2006-08-02 21:48:28 UTC (rev 4203)
+++ long/3D/Gale/trunk/INSTALL.STATIC 2006-08-02 21:48:31 UTC (rev 4204)
@@ -0,0 +1,18 @@
+If you want to make a static build (i.e. a single, monolithic
+executable that you can just copy to another machine), then do not
+configure --with-shared. Also, when building, you must set the
+STATIC_BUILD environment variable. As in
+
+ $ STATIC_BUILD=1 make install
+
+The SConstruct.in file is set up for static builds on my laptop. The
+reference lapack and blas libraries both define xerbla_, which causes
+static links to fail, so I have petsc use Atlas' lapack and blas.
+Also, when I configured PETSc, I did not include X. Including X
+requires lots of other things that complicate the process. In
+summary, I configure PETSC with the line
+
+ $ ./config/configure.py --prefix=/home/boo/cig/petsc --with-x=0 --with-blas-lib=/usr/lib/libblas-3.a --with-lapack-lib=/usr/lib/liblapack-3.a
+
+To make static builds on your machine, you may have to edit
+SConstruct.in to set appropriate library paths and extra libraries.
Modified: long/3D/Gale/trunk/SConstruct.in
===================================================================
--- long/3D/Gale/trunk/SConstruct.in 2006-08-02 21:48:28 UTC (rev 4203)
+++ long/3D/Gale/trunk/SConstruct.in 2006-08-02 21:48:31 UTC (rev 4204)
@@ -64,6 +64,15 @@
env.Append(RPATH=Split('@PETSC_LIBPATH@'))
env.ParseConfig('echo "@PETSC_DEPS@"')
+# Set up stuff for a static build
+
+if os.getenv("STATIC_BUILD"):
+ if with_shared:
+ print "Can not make a static build if you configured using --with-shared"
+ sys.exit(1)
+ env.Append(LINKFLAGS=Split("-static -shared-libgcc"))
+ env.Append(LIBS=Split('z g2c'))
+
# Add the local "lib" directory to the linker path
env.Append(LIBPATH=['#/build/lib'])
More information about the cig-commits
mailing list