Fixed some installation issues with samples and the Python module
This commit is contained in:
parent
fc1b2f16f0
commit
8239c18091
6 changed files with 39 additions and 41 deletions
35
SConstruct
35
SConstruct
|
|
@ -644,6 +644,7 @@ if env['python_package'] in ('full','default'):
|
|||
warnNoPython = True
|
||||
env['python_package'] = 'minimal'
|
||||
else:
|
||||
warnNoPython = False
|
||||
env['python_array_include'] = ''
|
||||
|
||||
|
||||
|
|
@ -692,9 +693,7 @@ env['ct_bindir'] = pjoin(env['prefix'], 'bin')
|
|||
env['ct_incdir'] = pjoin(env['prefix'], 'include', 'cantera')
|
||||
env['ct_incroot'] = pjoin(env['prefix'], 'include')
|
||||
env['ct_datadir'] = pjoin(env['prefix'], 'data')
|
||||
env['ct_demodir'] = pjoin(env['prefix'], 'demos')
|
||||
env['ct_templdir'] = pjoin(env['prefix'], 'templates')
|
||||
env['ct_tutdir'] = pjoin(env['prefix'], 'tutorials')
|
||||
env['ct_sampledir'] = pjoin(env['prefix'], 'samples')
|
||||
env['ct_mandir'] = pjoin(env['prefix'], 'man1')
|
||||
env['ct_matlab_dir'] = pjoin(env['prefix'], 'matlab', 'toolbox')
|
||||
|
||||
|
|
@ -709,8 +708,15 @@ else:
|
|||
# Directories where things will be staged for package creation. These
|
||||
# variables should always be used by the Install(...) targets
|
||||
if env['stage_dir']:
|
||||
instRoot = pjoin(os.getcwd(), env['stage_dir'], stripDrive(env['prefix']).strip('/\\'))
|
||||
env['python_prefix'] = pjoin(os.getcwd(), env['stage_dir'], stripDrive(env['python_prefix']).strip('/\\'))
|
||||
pp = env['python_prefix']
|
||||
instRoot = pjoin(os.getcwd(), env['stage_dir'],
|
||||
stripDrive(env['prefix']).strip('/\\'))
|
||||
if env['python_prefix']:
|
||||
env['python_prefix'] = pjoin(os.getcwd(), env['stage_dir'],
|
||||
stripDrive(env['python_prefix']).strip('/\\'))
|
||||
else:
|
||||
env['python_prefix'] = pjoin(os.getcwd(), env['stage_dir'])
|
||||
|
||||
else:
|
||||
instRoot = env['prefix']
|
||||
|
||||
|
|
@ -719,9 +725,7 @@ env['inst_bindir'] = pjoin(instRoot, 'bin')
|
|||
env['inst_incdir'] = pjoin(instRoot, 'include', 'cantera')
|
||||
env['inst_incroot'] = pjoin(instRoot, 'include')
|
||||
env['inst_datadir'] = pjoin(instRoot, 'data')
|
||||
env['inst_demodir'] = pjoin(instRoot, 'demos')
|
||||
env['inst_templdir'] = pjoin(instRoot, 'templates')
|
||||
env['inst_tutdir'] = pjoin(instRoot, 'tutorials')
|
||||
env['inst_sampledir'] = pjoin(instRoot, 'samples')
|
||||
env['inst_mandir'] = pjoin(instRoot, 'man1')
|
||||
env['inst_matlab_dir'] = pjoin(instRoot, 'matlab', 'toolbox')
|
||||
|
||||
|
|
@ -839,6 +843,10 @@ headerBase = 'include/cantera'
|
|||
inst = env.RecursiveInstall('$inst_incdir', 'include/cantera')
|
||||
installTargets.extend(inst)
|
||||
|
||||
# Install C++ samples
|
||||
inst = env.RecursiveInstall(pjoin('$inst_sampledir', 'cxx'),
|
||||
'samples/cxx')
|
||||
installTargets.extend(inst)
|
||||
|
||||
### List of libraries needed to link to Cantera ###
|
||||
linkLibs = ['oneD','zeroD','equil','kinetics','transport',
|
||||
|
|
@ -911,7 +919,7 @@ File locations:
|
|||
applications %(ct_bindir)s
|
||||
library files %(ct_libdir)s
|
||||
C++ headers %(ct_incdir)s
|
||||
demos %(ct_demodir)s
|
||||
samples %(ct_sampledir)s
|
||||
data files %(ct_datadir)s""" % env
|
||||
|
||||
if env['python_package'] == 'full':
|
||||
|
|
@ -927,14 +935,15 @@ File locations:
|
|||
if env['matlab_toolbox'] == 'y':
|
||||
print """
|
||||
Matlab toolbox %(ct_matlab_dir)s
|
||||
Matlab demos %(ct_demodir)s/matlab
|
||||
Matlab tutorials %(ct_tutdir)s/matlab
|
||||
Matlab samples %(ct_sampledir)s/matlab
|
||||
|
||||
An m-file to set the correct matlab path for Cantera is at:
|
||||
|
||||
%(prefix)s/matlab/ctpath.m""" % env
|
||||
%(prefix)s/matlab/ctpath.m
|
||||
""" % env
|
||||
|
||||
print """
|
||||
if os.name != 'nt':
|
||||
print """
|
||||
setup script %(ct_bindir)s/setup_cantera
|
||||
|
||||
The setup script configures the environment for Cantera. It is
|
||||
|
|
|
|||
|
|
@ -18,9 +18,3 @@ for subdir, name, extensions in demos:
|
|||
mglob(localenv, pjoin('demos',subdir), *extensions),
|
||||
LIBS=env['cantera_libs'])
|
||||
demoTargets.extend(prog)
|
||||
|
||||
inst = localenv.Install(pjoin('$inst_demodir', 'cxx', subdir),
|
||||
mglob(localenv, pjoin('demos', subdir),
|
||||
'csv','txt','cpp','h','^runtest'))
|
||||
|
||||
installTargets.extend(inst)
|
||||
|
|
|
|||
|
|
@ -114,10 +114,10 @@ class WxsGenerator(object):
|
|||
Description='Header files and static libraries needed to develop applications that use Cantera.',
|
||||
Display='expand',
|
||||
AllowAdvertise='no'))
|
||||
extras = et.SubElement(product, 'Feature',
|
||||
dict(Id='Extras', Level='1',
|
||||
Title='Extras',
|
||||
Description='Demos, tutorials and templates which show you some ways of using Cantera.',
|
||||
samples = et.SubElement(product, 'Feature',
|
||||
dict(Id='Samples', Level='1',
|
||||
Title='Samples',
|
||||
Description='Samples which show you some ways of using Cantera.',
|
||||
Display='expand',
|
||||
AllowAdvertise='no'))
|
||||
|
||||
|
|
@ -134,9 +134,7 @@ class WxsGenerator(object):
|
|||
binaries = self.addDirectoryContents('bin', instdir, core)
|
||||
lib_dir = self.addDirectoryContents('lib', instdir, devel)
|
||||
data_dir = self.addDirectoryContents('data', instdir, core)
|
||||
demos_dir = self.addDirectoryContents('demos', instdir, extras)
|
||||
templates_dir = self.addDirectoryContents('templates', instdir, extras)
|
||||
tutorials_dir = self.addDirectoryContents('tutorials', instdir, extras)
|
||||
sample_dir = self.addDirectoryContents('samples', instdir, samples)
|
||||
if self.includeMatlab:
|
||||
matlab_dir = self.addDirectoryContents('matlab', instdir, matlab)
|
||||
|
||||
|
|
|
|||
|
|
@ -38,8 +38,10 @@ for subdir, name, extensions in demos:
|
|||
LINK='$F77')
|
||||
demoTargets.extend(prog)
|
||||
|
||||
inst = localenv.Install(pjoin('$inst_demodir', 'f77'),
|
||||
mglob(localenv, 'f77demos',
|
||||
'csv','txt','cpp','f','^runtest'))
|
||||
|
||||
inst = localenv.RecursiveInstall(pjoin('$inst_sampledir', 'f77'),
|
||||
'#samples/f77')
|
||||
installTargets.extend(inst)
|
||||
|
||||
inst = localenv.RecursiveInstall(pjoin('$inst_sampledir', 'f77'),
|
||||
'#samples/f90')
|
||||
installTargets.extend(inst)
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ installTargets.extend(inst)
|
|||
inst = localenv.RecursiveInstall('$inst_matlab_dir', '#interfaces/matlab/toolbox')
|
||||
installTargets.extend(inst)
|
||||
|
||||
inst = localenv.RecursiveInstall(pjoin('$inst_demodir', 'matlab'), '#samples/matlab')
|
||||
inst = localenv.RecursiveInstall(pjoin('$inst_sampledir', 'matlab'), '#samples/matlab')
|
||||
installTargets.extend(inst)
|
||||
|
||||
if os.name == 'nt':
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@ if localenv['python_package'] == 'full':
|
|||
libs.extend(env['cantera_libs'])
|
||||
localenv.Append(CPPPATH=['#src', '#include'])
|
||||
|
||||
pymodule = localenv.SharedLibrary('Cantera/_cantera', ['pycantera.cpp'],
|
||||
pymodule = localenv.SharedLibrary('#interfaces/python/Cantera/_cantera',
|
||||
['pycantera.cpp'],
|
||||
LIBS=libs,
|
||||
SHLIBPREFIX='',
|
||||
SHLIBSUFFIX=gcv('SO'))
|
||||
|
|
@ -39,6 +40,7 @@ if localenv['python_package'] == 'full':
|
|||
dest = pjoin('interfaces', 'python', 'Cantera', file.name)
|
||||
localenv.AddPreAction(pymodule,Copy(dest, file))
|
||||
|
||||
|
||||
elif localenv['python_package'] == 'minimal':
|
||||
pymodule = make_setup
|
||||
|
||||
|
|
@ -67,13 +69,6 @@ elif localenv['PYTHON_INSTALLER'] == 'binary':
|
|||
installTargets.extend(inst)
|
||||
|
||||
if localenv['python_package'] == 'full':
|
||||
# Copy tutorials
|
||||
inst = localenv.Install('$inst_tutdir', mglob(localenv, 'tutorial', 'py'))
|
||||
inst = localenv.RecursiveInstall(pjoin('$inst_sampledir', 'python'),
|
||||
'#samples/python')
|
||||
installTargets.extend(inst)
|
||||
|
||||
# Copy examples
|
||||
exampleFiles = sum([localenv.Glob(pjoin('examples', '*', '*', name))
|
||||
for name in ['runtest', 'cleanup', '*.txt', '*.py', '*.csv']], [])
|
||||
for f in exampleFiles:
|
||||
subdir1, subdir2 = psplit(f.path)[3:5]
|
||||
installTargets.extend(localenv.Install(pjoin('$inst_demodir','python',subdir1,subdir2), f))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue