[cig-commits] r5218 - in long/3D/Gale/trunk: . python/BuildSystem/config/packages src/StGermain src/StGermain/Base src/StGermain/Base/Foundation src/StGermain/Base/Foundation/tests src/StGermain/libStGermain/dynamic

walter at geodynamics.org walter at geodynamics.org
Thu Nov 9 16:43:22 PST 2006


Author: walter
Date: 2006-11-09 16:43:22 -0800 (Thu, 09 Nov 2006)
New Revision: 5218

Added:
   long/3D/Gale/trunk/configure_vars.in
   long/3D/Gale/trunk/src/StGermain/Base/Foundation/tests/SConscript
Removed:
   long/3D/Gale/trunk/SConstruct.in
Modified:
   long/3D/Gale/trunk/
   long/3D/Gale/trunk/configure.py
   long/3D/Gale/trunk/python/BuildSystem/config/packages/MPI.py
   long/3D/Gale/trunk/src/StGermain/Base/Foundation/SConscript
   long/3D/Gale/trunk/src/StGermain/Base/SConscript
   long/3D/Gale/trunk/src/StGermain/SConscript
   long/3D/Gale/trunk/src/StGermain/libStGermain/dynamic/SConscript
Log:
 r1041 at earth:  boo | 2006-11-07 13:17:12 -0800
 Hacked up version to build one test.  Probably everything is broken ;)



Property changes on: long/3D/Gale/trunk
___________________________________________________________________
Name: svk:merge
   - 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:1037
   + 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:1041

Deleted: long/3D/Gale/trunk/SConstruct.in
===================================================================
--- long/3D/Gale/trunk/SConstruct.in	2006-11-09 23:51:25 UTC (rev 5217)
+++ long/3D/Gale/trunk/SConstruct.in	2006-11-10 00:43:22 UTC (rev 5218)
@@ -1,255 +0,0 @@
-# Builds everything for StGermain
-
-# Note that SConstruct is created by running configure.py over
-# SConstruct.in
-
-# Copyright (C) 2006 California Institute of Technology
-
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License as
-# published by the Free Software Foundation; either version 2.1 of the
-# License, 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 Lesser 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
-
-import os
-import sys
-
-env=Environment(CC='@CC@',LINK='@CC@')
-
-if '@CFLAGS@':
-    env.Append(CCFLAGS=Split('@CFLAGS@'))
-if '@C99_DEFINES@':
-    env.Append(CPPFLAGS=Split('@C99_DEFINES@'))
-
-env.Append(CPPPATH=['#/build/include'])
-env.Append(CPPPATH=['#/build/include/StGermain'])
-env.Append(CPPFLAGS=['-DVERSION=\\"CIG\\"'])
-env.Append(SHLINKFLAGS=Split('@SHARED_LIBRARY_FLAG@'))
-# Only use shared libraries if so configured.
-with_shared=True
-if not '@WITH_SHARED@':
-    with_shared=False
-    env.Append(CPPFLAGS=['-DNOSHARED'])
-Export('with_shared')
-
-# Add in the MPI paths
-for path in Split('@MPI_CPPPATH@'):
-    env.Append(CPPPATH=['#/'+path])
-env.Append(LIBS=Split('@MPI_LIBS@'))
-for path in Split('@MPI_LIBPATH@'):
-    env.Append(LIBPATH=['#/'+path])
-if with_shared:
-    env.Append(RPATH=Split('@MPI_LIBPATH@'))
-
-# Add in the libxml2 paths
-for path in Split('@LIBXML2_CPPPATH@'):
-    env.Append(CPPPATH=['#/'+path])
-env.Append(LIBS=Split('@LIBXML2_LIBS@'))
-for path in Split('@LIBXML2_LIBPATH@'):
-    env.Append(LIBPATH=['#/'+path])
-if with_shared:
-    env.Append(RPATH=Split('@LIBXML2_LIBPATH@'))
-
-# Add in the petsc paths
-for path in Split('@PETSC_CPPPATH@'):
-    env.Append(CPPPATH=['#/'+path])
-env.Append(LIBS=Split('@PETSC_LIBS@'))
-for path in Split('@PETSC_LIBPATH@'):
-    env.Append(LIBPATH=['#/'+path])
-if with_shared:
-    env.Append(RPATH=Split('@PETSC_LIBPATH@'))
-env.ParseConfig('echo "@PETSC_DEPS@"')
-
-# Set up stuff for a static build
-
-env.Append(FRAMEWORKS=["vecLib"])
-
-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'])
-
-cppflags='@CPPFLAGS@'
-if len(cppflags)!=0:
-    env.Append(CPPFLAGS=Split('@CPPFLAGS@'))
-ldflags='@LDFLAGS@'
-if len(ldflags)!=0:
-    env.Append(LINKFLAGS=Split('@LDFLAGS@'))
-
-# Store the signatures in a single file, because otherwise the install
-# target will install the .sconsign file
-SConsignFile()
-
-## ## We have to use these signatures to prevent spurious rebuilds
-## TargetSignatures('content')
-## SourceSignatures('MD5')
-
-extra_libs="@LIBS@"
-Export('extra_libs')
-
-## Figure out where everything is going to be put once it is built.
-
-import re
-
-outer_environ=os.environ
-
-if outer_environ.has_key('prefix'):
-    prefix=outer_environ['prefix']
-else:
-    prefix="@prefix@"
-exec_prefix="@exec_prefix@"
-bin_dir="@bindir@"
-lib_dir="@libdir@"
-include_dir="@includedir@"
-
-if outer_environ.has_key('mandir'):
-    man_dir=outer_environ['mandir']+"/man1"
-else:
-    man_dir="@mandir@"+"/man1"
-
-exec_prefix=re.sub(r"\$\{prefix\}",prefix,exec_prefix)
-bin_dir=re.sub(r"\$\{exec_prefix\}",exec_prefix,bin_dir)
-lib_dir=re.sub(r"\$\{exec_prefix\}",exec_prefix,lib_dir)
-man_dir=re.sub(r"\$\{exec_prefix\}",exec_prefix,man_dir)
-include_dir=re.sub(r"\$\{exec_prefix\}",exec_prefix,include_dir)
-
-env["prefix"]=prefix
-env["exec_prefix"]=exec_prefix
-env["bin_dir"]=bin_dir
-env["lib_dir"]=lib_dir
-env["man_dir"]=man_dir
-env["include_dir"]=include_dir
-
-header_groups={}
-bin_objects=[]
-shared_lib_objects=[]
-static_lib_objects=[]
-
-Export('header_groups')
-Export('bin_objects')
-Export('shared_lib_objects')
-Export('static_lib_objects')
-
-def libs(shared_lib_objects,static_lib_objects):
-    if '@WITH_SHARED@':
-        return shared_lib_objects
-    return static_lib_objects
-Export('libs')
-
-# Create a new Builder to handle creating the -meta files.
-
-def create_meta(target, source, env):
-    output_file = file(str(target[0]),'wb')
-    output_file.write("#define XML_METADATA \"")
-    xml_file = file(str(source[0]))
-    xml_lines = xml_file.readlines()
-    for l in xml_lines:
-        output_file.write(l.replace('\"','\\\"')[:-1])
-    output_file.write("\"\n#define COMPONENT_NAME ")
-    for l in xml_lines:
-        start=l.find('<param name="Name">')
-        if start!=-1:
-            end=l.find('<',start+19)
-            if end==-1:
-                raise RunTimeError('Malformed XML file.  The file '
-                                   + str(source[0])
-                                   + ' does not close off <param name="Name"> on the same line.')
-            output_file.write(l[start+19:end])
-            output_file.write("\n")
-            break
-    template_file=file("meta-template.c")
-    output_file.write(template_file.read())
-
-def gen_suffix(env, sources):
-    return "-meta.c"
-
-env['BUILDERS']['Meta']=Builder(action=create_meta,src_suffix="meta",
-                                suffix=gen_suffix,single_source=True)
-
-Export('env')
-BuildDir('build','src',duplicate=0)
-SConscript('build/SConscript')
-
-# We have to do a fake install of the headers, because otherwise the
-# libraries won't build.  We have to do a fake install of the
-# libraries, because otherwise the binaries won't build.
-
-header_install=[]
-fake_header_install=[]
-for partial_dir, headers in header_groups.iteritems():
-    for h in headers:
-        # The petsc compatibility header is found in a different kind
-        # of place.
-
-        if(partial_dir=='StGermain/compatibility'):
-            source="StGermain/compatibility/libpetsc/"
-
-        # This is a hack because the top foo.h header files do
-        # not obey the usual naming construction.  They are in the
-        # libfoo directory.
-
-        elif(partial_dir=='StGermain'):
-            source="StGermain/libStGermain/src/"
-        elif(partial_dir=='StgFEM'):
-            source="StgFEM/libStG_FEM/src/"
-        elif(partial_dir=='PICellerator'):
-            source="PICellerator/libPICellerator/src/"
-        elif(partial_dir=='Underworld'):
-            source="Underworld/libUnderworld/src/"
-        elif(partial_dir=='Gale'):
-            source="Gale/libGale/src/"
-        else:
-            source=partial_dir + '/src/'
-
-        target=partial_dir
-
-        # Flatten the hierarchy of where plugins header files are
-        # found.
-        plugin_start=target.find('/plugins/')
-        if(plugin_start!=-1):
-            target=target[:plugin_start] + target[target.rfind('/'):]
-            # The directory for plugins does not have a "src/"
-            # component.
-            source=partial_dir + '/';
-
-
-        header_install+=[env.InstallAs(include_dir + '/' + target + '/' + h,
-                                       'src/' + source + h)]
-        fake_header_install+=[env.InstallAs('build/include/' + target
-                                            + '/' + h,
-                                            'src/' + source + h)]
-
-Depends(shared_lib_objects,fake_header_install)
-Depends(static_lib_objects,fake_header_install)
-
-if with_shared:
-    fake_lib_install=env.Install('build/lib',shared_lib_objects)
-    Depends(bin_objects,fake_lib_install)
-    lib_install=env.Install(lib_dir,shared_lib_objects)
-else:
-    lib_install=env.Install(lib_dir,static_lib_objects)
-
-bin_install=env.Install(bin_dir,bin_objects)
-
-env.Alias('install',bin_install)
-env.Alias('install',lib_install)
-env.Alias('install',header_install)
-
-
-Default(None)
-Default(bin_objects)

Modified: long/3D/Gale/trunk/configure.py
===================================================================
--- long/3D/Gale/trunk/configure.py	2006-11-09 23:51:25 UTC (rev 5217)
+++ long/3D/Gale/trunk/configure.py	2006-11-10 00:43:22 UTC (rev 5218)
@@ -75,7 +75,7 @@
 
     framework.addSubstitution("PYTHON_BIN",sys.executable)
 
-    framework.addSubstitutionFile("SConstruct")
+    framework.addSubstitutionFile("configure_vars")
     framework.addSubstitutionFile("Makefile")
     framework.substitute()
 

Added: long/3D/Gale/trunk/configure_vars.in
===================================================================
--- long/3D/Gale/trunk/configure_vars.in	2006-11-09 23:51:25 UTC (rev 5217)
+++ long/3D/Gale/trunk/configure_vars.in	2006-11-10 00:43:22 UTC (rev 5218)
@@ -0,0 +1,122 @@
+# Set all of the configuration specific variables here.
+
+# Copyright (C) 2006 California Institute of Technology
+
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of the
+# License, 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 Lesser 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
+
+import os
+import sys
+
+Import('env')
+
+env['CC']='@CC@'
+env['LINK']='@CC@'
+
+
+if '@CFLAGS@':
+    env.Append(CCFLAGS=Split('@CFLAGS@'))
+if '@C99_DEFINES@':
+    env.Append(CPPFLAGS=Split('@C99_DEFINES@'))
+
+env.Append(SHLINKFLAGS=Split('@SHARED_LIBRARY_FLAG@'))
+
+with_shared=true
+if not '@WITH_SHARED@':
+    with_shared=False
+
+
+# Add in the MPI paths
+for path in Split('@MPI_CPPPATH@'):
+    env.Append(CPPPATH=['#/'+path])
+env.Append(LIBS=Split('@MPI_LIBS@'))
+for path in Split('@MPI_LIBPATH@'):
+    env.Append(LIBPATH=['#/'+path])
+if with_shared:
+    env.Append(RPATH=Split('@MPI_LIBPATH@'))
+mpirun='@MPI_RUN@'
+
+
+# Add in the libxml2 paths
+for path in Split('@LIBXML2_CPPPATH@'):
+    env.Append(CPPPATH=['#/'+path])
+env.Append(LIBS=Split('@LIBXML2_LIBS@'))
+for path in Split('@LIBXML2_LIBPATH@'):
+    env.Append(LIBPATH=['#/'+path])
+if with_shared:
+    env.Append(RPATH=Split('@LIBXML2_LIBPATH@'))
+
+# Add in the petsc paths
+for path in Split('@PETSC_CPPPATH@'):
+    env.Append(CPPPATH=['#/'+path])
+env.Append(LIBS=Split('@PETSC_LIBS@'))
+for path in Split('@PETSC_LIBPATH@'):
+    env.Append(LIBPATH=['#/'+path])
+if with_shared:
+    env.Append(RPATH=Split('@PETSC_LIBPATH@'))
+env.ParseConfig('echo "@PETSC_DEPS@"')
+
+# CPP and linker flags
+
+cppflags='@CPPFLAGS@'
+if len(cppflags)!=0:
+    env.Append(CPPFLAGS=Split('@CPPFLAGS@'))
+ldflags='@LDFLAGS@'
+if len(ldflags)!=0:
+    env.Append(LINKFLAGS=Split('@LDFLAGS@'))
+
+extra_libs="@LIBS@"
+
+## Figure out where everything is going to be put once it is built.
+
+import re
+
+outer_environ=os.environ
+
+if outer_environ.has_key('prefix'):
+    prefix=outer_environ['prefix']
+else:
+    prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+bin_dir="@bindir@"
+lib_dir="@libdir@"
+include_dir="@includedir@"
+
+if outer_environ.has_key('mandir'):
+    man_dir=outer_environ['mandir']+"/man1"
+else:
+    man_dir="@mandir@"+"/man1"
+
+exec_prefix=re.sub(r"\$\{prefix\}",prefix,exec_prefix)
+bin_dir=re.sub(r"\$\{exec_prefix\}",exec_prefix,bin_dir)
+lib_dir=re.sub(r"\$\{exec_prefix\}",exec_prefix,lib_dir)
+man_dir=re.sub(r"\$\{exec_prefix\}",exec_prefix,man_dir)
+include_dir=re.sub(r"\$\{exec_prefix\}",exec_prefix,include_dir)
+
+env["prefix"]=prefix
+env["exec_prefix"]=exec_prefix
+env["bin_dir"]=bin_dir
+env["lib_dir"]=lib_dir
+env["man_dir"]=man_dir
+env["include_dir"]=include_dir
+
+# Select static or shared objects
+
+def libs(shared_lib_objects,static_lib_objects):
+    if '@WITH_SHARED@':
+        return shared_lib_objects
+    return static_lib_objects
+
+Export('env','with_shared','mpirun','extra_libs','libs')

Modified: long/3D/Gale/trunk/python/BuildSystem/config/packages/MPI.py
===================================================================
--- long/3D/Gale/trunk/python/BuildSystem/config/packages/MPI.py	2006-11-09 23:51:25 UTC (rev 5217)
+++ long/3D/Gale/trunk/python/BuildSystem/config/packages/MPI.py	2006-11-10 00:43:22 UTC (rev 5218)
@@ -512,6 +512,9 @@
 
     # Substitutions added by Walter Landry
 
+    self.executeTest(self.configureMPIRUN)
+    self.addSubstitution('MPIRUN',self.mpirun.replace(' -np 1',''))
+
     cpppath=''
     if not isinstance(self.include,list):
       self.include = [self.include]

Modified: long/3D/Gale/trunk/src/StGermain/Base/Foundation/SConscript
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Base/Foundation/SConscript	2006-11-09 23:51:25 UTC (rev 5217)
+++ long/3D/Gale/trunk/src/StGermain/Base/Foundation/SConscript	2006-11-10 00:43:22 UTC (rev 5218)
@@ -15,5 +15,10 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 # USA
 
-SConscript('src/SConscript')
+Import('make_test_deps')
 
+if not make_test_deps:
+    SConscript('src/SConscript')
+else:
+    SConscript('tests/SConscript')
+

Added: long/3D/Gale/trunk/src/StGermain/Base/Foundation/tests/SConscript
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Base/Foundation/tests/SConscript	2006-11-09 23:51:25 UTC (rev 5217)
+++ long/3D/Gale/trunk/src/StGermain/Base/Foundation/tests/SConscript	2006-11-10 00:43:22 UTC (rev 5218)
@@ -0,0 +1,51 @@
+# Copyright 2006 California Institute of Technology
+
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of the
+# License, 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 Lesser 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
+
+Import('env','tests','Regressor_static_objects','StGermain_static_library')
+
+local_env=env.Copy()
+local_env.Append(CPPPATH=["#/build/include/StGermain"])
+
+test_files=Split("""testCommonRoutines.c
+testMemMonitor.c
+testMemory0.c
+testMemory1.c
+testMemory2.c
+testMemory2DArrayAs1D.c
+testMemory2DArray.c
+testMemory2DComplex.c
+testMemory3DArrayAs1D.c
+testMemory3DArray.c
+testMemory3DComplex.c
+testMemory4DArrayAs1D.c
+testMemory4DArray.c
+testMemoryRealloc.c
+testNamedObject_Register.c
+testObjectList.c
+testPrimitiveObject.c
+testStg_asprintf.c
+testTimeMonitor.c""")
+
+local_objects=local_env.StaticObject(Split("""BTreeWrappers.c
+JournalWrappers.c
+PtrMapWrappers.c"""))
+
+
+tests+=[local_env.GeneralTest([local_env.Program('testCommonRoutines',['testCommonRoutines.c',local_objects,StGermain_static_library]),'testCommonRoutines.0of1.expected'])]
+#tests+=[local_env.Test(test_files)]
+#tests+=[local_env.Test('testMemMonitor.c',MPIPROCS='2')]
+        

Modified: long/3D/Gale/trunk/src/StGermain/Base/SConscript
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Base/SConscript	2006-11-09 23:51:25 UTC (rev 5217)
+++ long/3D/Gale/trunk/src/StGermain/Base/SConscript	2006-11-10 00:43:22 UTC (rev 5218)
@@ -16,12 +16,12 @@
 # USA
 
 SConscript('src/SConscript')
-SConscript('Foundation/SConscript')
 SConscript('IO/SConscript')
+SConscript('Context/SConscript')
+SConscript('Extensibility/SConscript')
 SConscript('Automation/SConscript')
-SConscript('Context/SConscript')
 SConscript('Container/SConscript')
-SConscript('Extensibility/SConscript')
+SConscript('Foundation/SConscript')
 
 SConscript('FlattenXML/SConscript')
 SConscript('ListPlugins/SConscript')

Modified: long/3D/Gale/trunk/src/StGermain/SConscript
===================================================================
--- long/3D/Gale/trunk/src/StGermain/SConscript	2006-11-09 23:51:25 UTC (rev 5217)
+++ long/3D/Gale/trunk/src/StGermain/SConscript	2006-11-10 00:43:22 UTC (rev 5218)
@@ -18,6 +18,10 @@
 StGermain_static_objects=[]
 Export('StGermain_static_objects')
 
+StGermain_static_library=[]
+Export('StGermain_static_library')
+
+SConscript('Regresstor/SConscript')
 SConscript('Base/SConscript')
 SConscript('Discretisation/SConscript')
 SConscript('FD/SConscript')

Modified: long/3D/Gale/trunk/src/StGermain/libStGermain/dynamic/SConscript
===================================================================
--- long/3D/Gale/trunk/src/StGermain/libStGermain/dynamic/SConscript	2006-11-09 23:51:25 UTC (rev 5217)
+++ long/3D/Gale/trunk/src/StGermain/libStGermain/dynamic/SConscript	2006-11-10 00:43:22 UTC (rev 5218)
@@ -16,7 +16,8 @@
 # USA
 
 Import('env','shared_lib_objects','static_lib_objects',
-       'StGermain_static_objects','libStGermain_shared_objects','with_shared')
+       'StGermain_static_objects','libStGermain_shared_objects','with_shared',
+       'StGermain_static_library')
 
 local_env=env.Copy()
 
@@ -24,5 +25,7 @@
 if with_shared:
     shared_lib_objects+=[local_env.SharedLibrary('StGermain',c_shared_files)]
 
-static_lib_objects=[local_env.StaticLibrary('StGermain',StGermain_static_objects)]+static_lib_objects
-Export('static_lib_objects')
+StGermain_static_library=local_env.StaticLibrary('StGermain',
+                                                 StGermain_static_objects)
+static_lib_objects=[StGermain_static_library]+static_lib_objects
+Export('static_lib_objects','StGermain_static_library')



More information about the cig-commits mailing list