[cig-commits] r4381 - in long/3D/Gale/trunk: .
python/BuildSystem/config python/BuildSystem/config/packages
walter at geodynamics.org
walter at geodynamics.org
Thu Aug 17 17:37:48 PDT 2006
Author: walter
Date: 2006-08-17 17:37:48 -0700 (Thu, 17 Aug 2006)
New Revision: 4381
Modified:
long/3D/Gale/trunk/
long/3D/Gale/trunk/python/BuildSystem/config/headers.py
long/3D/Gale/trunk/python/BuildSystem/config/libraries.py
long/3D/Gale/trunk/python/BuildSystem/config/package.py
long/3D/Gale/trunk/python/BuildSystem/config/packages/MPI.py
Log:
r608 at earth: boo | 2006-08-17 15:59:42 -0700
Add back in the MPI substitutions
Property changes on: long/3D/Gale/trunk
___________________________________________________________________
Name: svk:merge
- 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:607
+ 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:608
Modified: long/3D/Gale/trunk/python/BuildSystem/config/headers.py
===================================================================
--- long/3D/Gale/trunk/python/BuildSystem/config/headers.py 2006-08-18 00:37:43 UTC (rev 4380)
+++ long/3D/Gale/trunk/python/BuildSystem/config/headers.py 2006-08-18 00:37:48 UTC (rev 4381)
@@ -25,6 +25,17 @@
return include
return '-I'+include
+ # getCPPPATHArgument added by Walter Landry
+
+ def getCPPPATHArgument(self, include):
+ '''Return the proper CPPPATH argument for the given filename
+ - If starts with -I then strip it off
+ - Otherwise, return it unchanged'''
+ if include.startswith('-I'):
+ return include[2:]
+ return include
+
+
def toString(self,includes):
'''Converts a list of includes to a string suitable for a compiler'''
return ' '.join([self.getIncludeArgument(include) for include in includes])
Modified: long/3D/Gale/trunk/python/BuildSystem/config/libraries.py
===================================================================
--- long/3D/Gale/trunk/python/BuildSystem/config/libraries.py 2006-08-18 00:37:43 UTC (rev 4380)
+++ long/3D/Gale/trunk/python/BuildSystem/config/libraries.py 2006-08-18 00:37:48 UTC (rev 4381)
@@ -24,6 +24,42 @@
self.headers = framework.require('config.headers', self)
return
+ # getLIBPATHArgument and getLIBSArgument added by Walter Landry
+
+ def getLIBPATHArgument(self, library):
+ '''Return the path, if any, to add to the list of paths for the
+ linker to search for. This is used when outputing the list of
+ libraries to SCons.
+ - If the path is empty, starts with -l, or is "lib"<name>, return nothing.
+ - If it is -L<path>, return <path>
+ - If it is an absolute path, return the parent directory
+ - Otherwise, return nothing
+ '''
+ if not library or library.startswith('-l') or library.startswith('lib'):
+ return ''
+ if library.startswith('-L'):
+ return library[2:]
+ if os.path.isabs(library):
+ return os.path.dirname(library)
+ return ''
+
+ def getLIBSArgument(self, library):
+ '''Return the library, if any, to add to the list of libraries for the
+ linker to search for. This is used when outputing the list of
+ libraries to SCons.
+ - If the path is empty or starts with -L return nothing.
+ - If it is -l<name>, return <name>
+ - If it is "lib"<name> or an absolute path, return getLibName(library)
+ - Otherwise, return nothing
+ '''
+ if not library or library.startswith('-L'):
+ return ''
+ if library.startswith('-l'):
+ return library[2:]
+ if library.startswith('lib') or os.path.isabs(library):
+ return self.getLibName(library)
+ return ''
+
def getLibArgument(self, library):
'''Return the proper link line argument for the given filename library
- If the path is empty, return it unchanged
Modified: long/3D/Gale/trunk/python/BuildSystem/config/package.py
===================================================================
--- long/3D/Gale/trunk/python/BuildSystem/config/package.py 2006-08-18 00:37:43 UTC (rev 4380)
+++ long/3D/Gale/trunk/python/BuildSystem/config/package.py 2006-08-18 00:37:48 UTC (rev 4381)
@@ -6,8 +6,8 @@
class Package(config.base.Configure):
def __init__(self, framework):
config.base.Configure.__init__(self, framework)
- self.headerPrefix = 'PETSC'
- self.substPrefix = 'PETSC'
+ self.headerPrefix = ''
+ self.substPrefix = ''
self.arch = None # The architecture identifier
self.externalPackagesDir = os.path.abspath('externalpackages')
# These are derived by the configure tests
Modified: long/3D/Gale/trunk/python/BuildSystem/config/packages/MPI.py
===================================================================
--- long/3D/Gale/trunk/python/BuildSystem/config/packages/MPI.py 2006-08-18 00:37:43 UTC (rev 4380)
+++ long/3D/Gale/trunk/python/BuildSystem/config/packages/MPI.py 2006-08-18 00:37:48 UTC (rev 4381)
@@ -510,6 +510,27 @@
if self.libraries.check(self.dlib, "MPI_Alltoallw"):
self.addDefine('HAVE_MPI_ALLTOALLW',1)
+ # Substitutions added by Walter Landry
+
+ cpppath=''
+ if not isinstance(self.include,list):
+ self.include = [self.include]
+ for inc in self.include:
+ cpppath+=' ' + self.headers.getCPPPATHArgument(inc)
+
+ self.addSubstitution('MPI_CPPPATH', cpppath)
+
+ libpath=''
+ libs=''
+ if not isinstance(self.lib,list):
+ self.lib = [self.lib]
+ for l in self.lib:
+ libpath+=' ' + self.libraries.getLIBPATHArgument(l)
+ libs+=' ' + self.libraries.getLIBSArgument(l)
+
+ self.addSubstitution('MPI_LIBPATH', libpath)
+ self.addSubstitution('MPI_LIBS', libs)
+
if __name__ == '__main__':
import config.framework
import sys
More information about the cig-commits
mailing list