/[escript]/branches/4.1deb/site_scons/dependencies.py
ViewVC logotype

Contents of /branches/4.1deb/site_scons/dependencies.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5836 - (show annotations)
Fri Nov 27 00:03:56 2015 UTC (3 years, 6 months ago) by jfenwick
File MIME type: text/x-python
File size: 22085 byte(s)
backporting debianising fixes from after 4.1 --- do not merge back into trunk

1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2015 by The University of Queensland
5 # http://www.uq.edu.au
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Open Software License version 3.0
9 # http://www.opensource.org/licenses/osl-3.0.php
10 #
11 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 # Development 2012-2013 by School of Earth Sciences
13 # Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 #
15 ##############################################################################
16
17 from __future__ import print_function, division
18
19 __copyright__="""Copyright (c) 2003-2015 by The University of Queensland
20 http://www.uq.edu.au
21 Primary Business: Queensland, Australia"""
22 __license__="""Licensed under the Open Software License version 3.0
23 http://www.opensource.org/licenses/osl-3.0.php"""
24 __url__="https://launchpad.net/escript-finley"
25
26 import os, re, sys
27 from distutils import sysconfig
28 from subprocess import PIPE, Popen
29 from SCons.Script.SConscript import Configure
30 from site_init import findLibWithHeader, detectModule
31
32 REQUIRED_BOOST = (1, 46)
33
34 def checkCompiler(env):
35 conf = Configure(env.Clone())
36 if 'CheckCXX' in dir(conf): # exists since scons 1.1.0
37 if not conf.CheckCXX():
38 print("Cannot run C++ compiler '%s' (check config.log)" % (env['CXX']))
39 env.Exit(1)
40 else:
41 if not conf.CheckFunc('printf', language='c++'):
42 print("Cannot run C++ compiler '%s' (check config.log)" % (env['CXX']))
43 env.Exit(1)
44
45 conf.env['buildvars']['cxx']=conf.env['CXX']
46
47 if conf.CheckFunc('gethostname', language='c++'):
48 conf.env.Append(CPPDEFINES = ['HAVE_GETHOSTNAME'])
49
50 if conf.CheckCXXHeader('byteswap.h'):
51 checkhdr="""#include <byteswap.h>
52 #define SCbswap32() {int x=0;bswap_32(x);}"""
53 if conf.CheckFunc('SCbswap32', header=checkhdr, language='c++'):
54 conf.env.Append(CPPDEFINES = ['HAVE_BYTESWAP_H'])
55 if conf.CheckCXXHeader('sys/endian.h'):
56 conf.env.Append(CPPDEFINES = ['HAVE_SYS_ENDIAN_H'])
57 if conf.CheckCXXHeader('libkern/OSByteOrder.h'):
58 conf.env.Append(CPPDEFINES = ['HAVE_OSBYTEORDER_H'])
59
60 return conf.Finish()
61
62 def checkPython(env):
63 # First we check to see if the config file has specified
64 # where to find the file. Ideally, this should be automatic
65 # but we need to deal with the case where python is not in its INSTALL
66 # directory.
67 # Use the python scons is running
68 if env['pythoncmd']=='python':
69 python_inc_path=sysconfig.get_python_inc()
70 if env['IS_WINDOWS']:
71 python_lib_path=os.path.join(sysconfig.get_config_var('prefix'), 'libs')
72 elif env['PLATFORM']=='darwin':
73 python_lib_path=sysconfig.get_config_var('LIBPL')
74 else:
75 python_lib_path=sysconfig.get_config_var('LIBDIR')
76
77 #python_libs=[sysconfig.get_config_var('LDLIBRARY')] # only on linux
78 if env['IS_WINDOWS']:
79 python_libs=['python%s%s'%(sys.version_info[0], sys.version_info[1])]
80 else:
81 python_libs=['python'+sysconfig.get_python_version()]
82
83 env['buildvars']['python']=sys.executable
84 env['buildvars']['python_version']=str(sys.version_info[0])+"."+str(sys.version_info[1])+"."+str(sys.version_info[2])
85
86 #if we want to use a python other than the one scons is running
87 else:
88 initstring='from __future__ import print_function;from distutils import sysconfig;'
89 if env['pythonlibname']!='':
90 python_libs=env['pythonlibname']
91 else: # work it out by calling python
92 if ['IS_WINDOWS']:
93 cmd='print("python%s%s"%(sys.version_info[0], sys.version_info[1]))'
94 else:
95 cmd='print("python"+sysconfig.get_python_version())'
96 p=Popen([env['pythoncmd'], '-c', initstring+cmd], stdout=PIPE)
97 python_libs=p.stdout.readline()
98 if env['usepython3']: # This is to convert unicode str into py2 string
99 python_libs=python_libs.encode() # If scons runs on py3 then this must be rethought
100 p.wait()
101 python_libs=python_libs.strip()
102
103 # Now we know whether we are using python3 or not
104 p=Popen([env['pythoncmd'], '-c', initstring+'print(sysconfig.get_python_inc())'], stdout=PIPE)
105 python_inc_path=p.stdout.readline()
106 if env['usepython3']:
107 python_inc_path=python_inc_path.encode()
108 p.wait()
109 python_inc_path=python_inc_path.strip()
110 if env['IS_WINDOWS']:
111 cmd="import os;os.path.join(sysconfig.get_config_var('prefix'), 'libs')"
112 elif env['PLATFORM']=='darwin':
113 cmd="sysconfig.get_config_var(\"LIBPL\")"
114 else:
115 cmd="sysconfig.get_config_var(\"LIBDIR\")"
116
117 p=Popen([env['pythoncmd'], '-c', initstring+'print('+cmd+')'], stdout=PIPE)
118 python_lib_path=p.stdout.readline()
119 if env['usepython3']:
120 python_lib_path=python_lib_path.decode()
121 p.wait()
122 python_lib_path=python_lib_path.strip()
123
124 env['buildvars']['python']=env['pythoncmd']
125 p=Popen([env['pythoncmd'], '-c', 'from __future__ import print_function;import sys;print(str(sys.version_info[0])+"."+str(sys.version_info[1])+"."+str(sys.version_info[2]))'], stdout=PIPE)
126 verstring=p.stdout.readline().strip()
127 p.wait()
128 env['buildvars']['python_version']=verstring
129
130 # Check for an override from the config file.
131 # Ideally, this should be automatic but we need to deal with the case
132 # where python is not in its INSTALL directory
133 if env['pythonlibpath']!='':
134 python_lib_path=env['pythonlibpath']
135
136 if env['pythonincpath']!='':
137 python_inc_path=env['pythonincpath']
138
139 conf = Configure(env.Clone())
140
141 if env['sysheaderopt'] == '':
142 conf.env.AppendUnique(CPPPATH = [python_inc_path])
143 else:
144 conf.env.Append(CCFLAGS = [env['sysheaderopt'], python_inc_path])
145
146 conf.env.AppendUnique(LIBPATH = [python_lib_path])
147 conf.env.AppendUnique(LIBS = python_libs)
148 # The wrapper script needs to find the libs
149 conf.env.PrependENVPath(env['LD_LIBRARY_PATH_KEY'], python_lib_path)
150
151 if not conf.CheckCXXHeader('Python.h'):
152 print("Cannot find python include files (tried 'Python.h' in directory %s)" % (python_inc_path))
153 env.Exit(1)
154 if not conf.CheckFunc('Py_Exit', language='c++'):
155 print("Cannot find python library method Py_Main (tried %s in directory %s)" % (python_libs, python_lib_path))
156 env.Exit(1)
157
158 return conf.Finish()
159
160 def checkCudaVersion(env):
161 # NVCC availability is already checked in the Tool file
162 p=Popen([env['NVCC'], '-V'], stdout=PIPE)
163 out=p.stdout.readlines()
164 env['nvcc_version']='(unknown version)'
165 p.wait()
166 for line in out:
167 if 'release' in line:
168 version=line[line.find('release'):].strip()
169 env['nvcc_version']=version
170 break
171 env['buildvars']['nvcc']=env['NVCC']
172 return env
173
174 def checkBoost(env):
175 boost_inc_path,boost_lib_path=findLibWithHeader(env, env['boost_libs'], 'boost/python.hpp', env['boost_prefix'], lang='c++')
176 if env['sysheaderopt'] == '':
177 env.AppendUnique(CPPPATH = [boost_inc_path])
178 else:
179 # This is required because we can't -isystem /usr/include since it
180 # breaks std includes
181 if os.path.normpath(boost_inc_path) == '/usr/include':
182 env.Append(CCFLAGS=[env['sysheaderopt'], os.path.join(boost_inc_path,'boost')])
183 else:
184 env.Append(CCFLAGS=[env['sysheaderopt'], boost_inc_path])
185
186 env.AppendUnique(LIBPATH = [boost_lib_path])
187 env.AppendUnique(LIBS = env['boost_libs'])
188 env.PrependENVPath(env['LD_LIBRARY_PATH_KEY'], boost_lib_path)
189
190 # Try to extract the boost version from version.hpp
191 boosthpp=open(os.path.join(boost_inc_path, 'boost', 'version.hpp'))
192 boostversion='unknown'
193 for line in boosthpp:
194 ver=re.match(r'#define BOOST_VERSION (\d+)',line)
195 if ver:
196 boostversion=ver.group(1)
197 boostversion = int(boostversion)
198 maj = boostversion/100000
199 minor = (boostversion/100)%1000
200 sub = boostversion % 100
201 env['boost_version'] = "%d.%d.%d"%(maj,minor,sub)
202 if maj <= REQUIRED_BOOST[0] and minor < REQUIRED_BOOST[1]:
203 print("The boost version referenced must be at least version %d.%d "%REQUIRED_BOOST + "(have %d.%d.%d)"%(maj,minor,sub))
204 env.Exit(1)
205 boosthpp.close()
206 env['buildvars']['boost_inc_path']=boost_inc_path
207 env['buildvars']['boost_lib_path']=boost_lib_path
208 env['buildvars']['boostversion']=boostversion
209 return env
210
211 def checkNumpy(env):
212 if not detectModule(env, 'numpy'):
213 print("Cannot import numpy. If it is installed try setting your PYTHONPATH and probably %s"%env['LD_LIBRARY_PATH_KEY'])
214 env.Exit(1)
215
216 ## check for numpy header (optional)
217 conf = Configure(env.Clone())
218 if env['usepython3']:
219 # FIXME: This is until we can work out how to make the checks in python 3
220 conf.env['numpy_h']=False
221 else:
222 if conf.CheckCXXHeader(['Python.h','numpy/ndarrayobject.h']):
223 conf.env.Append(CPPDEFINES = ['HAVE_NUMPY_H'])
224 conf.env['numpy_h']=True
225 else:
226 conf.env['numpy_h']=False
227
228 return conf.Finish()
229
230 def checkCUDA(env):
231 try:
232 cuda_inc_path,cuda_lib_path=findLibWithHeader(env, 'cudart', 'thrust/version.h', env['cuda_prefix'], lang='c++')
233 env.AppendUnique(CPPPATH = [cuda_inc_path])
234 env.AppendUnique(LIBPATH = [cuda_lib_path])
235 env.PrependENVPath(env['LD_LIBRARY_PATH_KEY'], cuda_lib_path)
236 env['cuda']=True
237 except:
238 env['cuda']=False
239 return env
240
241 def checkCppUnit(env):
242 try:
243 cppunit_inc_path,cppunit_lib_path=findLibWithHeader(env, env['cppunit_libs'], 'cppunit/TestFixture.h', env['cppunit_prefix'], lang='c++')
244 env.AppendUnique(CPPPATH = [cppunit_inc_path])
245 env.AppendUnique(LIBPATH = [cppunit_lib_path])
246 env.PrependENVPath(env['LD_LIBRARY_PATH_KEY'], cppunit_lib_path)
247 env['cppunit']=True
248 except:
249 env['cppunit']=False
250 return env
251
252 def checkOptionalModules(env):
253 ######## scipy
254 if not detectModule(env, 'scipy'):
255 env['warnings'].append("Cannot import scipy. NetCDF sources will not be available for inversions.")
256
257 ######## pyproj
258 if not detectModule(env, 'pyproj'):
259 env['warnings'].append("Cannot import pyproj. Inversions may not work.")
260
261 ######## gdal
262 if not detectModule(env, 'gdal'):
263 env['warnings'].append("Cannot import gdal. Inversions will not honour WKT coordinate system information.")
264
265 ######## sympy
266 if not detectModule(env, 'sympy'):
267 env['warnings'].append("Cannot import sympy. Symbolic toolbox and nonlinear PDEs will not be available.")
268 else:
269 import sympy as sp
270 spVer=sp.__version__
271 spl=spVer.split('.')
272 if int(spl[0]) == 0 and int(spl[1]) < 7:
273 env['sympy']=False
274 env['warnings'].append("sympy version too old. Symbolic toolbox and nonlinear PDEs will not be available.")
275
276 ######## gmshpy
277 env['gmshpy'] = detectModule(env, 'gmshpy')
278
279 return env
280
281 def checkOptionalLibraries(env):
282 ######## netCDF
283 netcdf_inc_path=''
284 netcdf_lib_path=''
285 if env['netcdf']:
286 netcdf_inc_path,netcdf_lib_path=findLibWithHeader(env, env['netcdf_libs'], 'netcdf.h', env['netcdf_prefix'], lang='c++')
287 env.AppendUnique(CPPPATH = [netcdf_inc_path])
288 env.AppendUnique(LIBPATH = [netcdf_lib_path])
289 env.AppendUnique(LIBS = env['netcdf_libs'])
290 env.PrependENVPath(env['LD_LIBRARY_PATH_KEY'], netcdf_lib_path)
291 env.Append(CPPDEFINES = ['USE_NETCDF'])
292 env['buildvars']['netcdf_inc_path']=netcdf_inc_path
293 env['buildvars']['netcdf_lib_path']=netcdf_lib_path
294 env['buildvars']['netcdf']=int(env['netcdf'])
295
296 ######## PAPI
297 papi_inc_path=''
298 papi_lib_path=''
299 if env['papi']:
300 papi_inc_path,papi_lib_path=findLibWithHeader(env, env['papi_libs'], 'papi.h', env['papi_prefix'], lang='c++')
301 env.AppendUnique(CPPPATH = [papi_inc_path])
302 env.AppendUnique(LIBPATH = [papi_lib_path])
303 env.AppendUnique(LIBS = env['papi_libs'])
304 env.PrependENVPath(env['LD_LIBRARY_PATH_KEY'], papi_lib_path)
305 env.Append(CPPDEFINES = ['PAPI'])
306 env['buildvars']['papi_inc_path']=papi_inc_path
307 env['buildvars']['papi_lib_path']=papi_lib_path
308 env['buildvars']['papi']=int(env['papi'])
309
310 ######## MKL
311 mkl_inc_path=''
312 mkl_lib_path=''
313 if env['mkl']:
314 mkl_inc_path,mkl_lib_path=findLibWithHeader(env, env['mkl_libs'], 'mkl_solver.h', env['mkl_prefix'], lang='c++')
315 env.AppendUnique(CPPPATH = [mkl_inc_path])
316 env.AppendUnique(LIBPATH = [mkl_lib_path])
317 env.AppendUnique(LIBS = env['mkl_libs'])
318 env.PrependENVPath(env['LD_LIBRARY_PATH_KEY'], mkl_lib_path)
319 env.Append(CPPDEFINES = ['MKL'])
320 env['buildvars']['mkl_inc_path']=mkl_inc_path
321 env['buildvars']['mkl_lib_path']=mkl_lib_path
322 env['buildvars']['mkl']=int(env['mkl'])
323
324 ######## UMFPACK
325 umfpack_inc_path=''
326 umfpack_lib_path=''
327 if env['umfpack']:
328 umfpack_inc_path,umfpack_lib_path=findLibWithHeader(env, env['umfpack_libs'], 'umfpack.h', env['umfpack_prefix'], lang='c++')
329 env.AppendUnique(CPPPATH = [umfpack_inc_path])
330 env.AppendUnique(LIBPATH = [umfpack_lib_path])
331 env.AppendUnique(LIBS = env['umfpack_libs'])
332 env.PrependENVPath(env['LD_LIBRARY_PATH_KEY'], umfpack_lib_path)
333 env.Append(CPPDEFINES = ['USE_UMFPACK'])
334 env['buildvars']['umfpack_inc_path']=umfpack_inc_path
335 env['buildvars']['umfpack_lib_path']=umfpack_lib_path
336 env['buildvars']['umfpack']=int(env['umfpack'])
337
338 ######## LAPACK
339 if env['lapack']=='mkl' and not env['mkl']:
340 print("mkl_lapack requires MKL!")
341 env.Exit(1)
342
343 env['uselapack'] = env['lapack']!='none'
344 lapack_inc_path=''
345 lapack_lib_path=''
346 if env['uselapack']:
347 if env['longindices']:
348 print("Sorry, cannot use LAPACK with 64-bit index types. Set longindices to False or disable LAPACK.")
349 env.Exit(1)
350 header='clapack.h'
351 if env['lapack']=='mkl':
352 env.AppendUnique(CPPDEFINES = ['MKL_LAPACK'])
353 header='mkl_lapack.h'
354 lapack_inc_path,lapack_lib_path=findLibWithHeader(env, env['lapack_libs'], header, env['lapack_prefix'], lang='c++')
355 env.AppendUnique(CPPPATH = [lapack_inc_path])
356 env.AppendUnique(LIBPATH = [lapack_lib_path])
357 env.AppendUnique(LIBS = env['lapack_libs'])
358 env.Append(CPPDEFINES = ['USE_LAPACK'])
359 env['buildvars']['lapack_inc_path']=lapack_inc_path
360 env['buildvars']['lapack_lib_path']=lapack_lib_path
361 env['buildvars']['lapack']=env['lapack']
362
363 ######## Silo
364 silo_inc_path=''
365 silo_lib_path=''
366 if env['silo']:
367 silo_inc_path,silo_lib_path=findLibWithHeader(env, env['silo_libs'], 'silo.h', env['silo_prefix'], lang='c++')
368 env.AppendUnique(CPPPATH = [silo_inc_path])
369 env.AppendUnique(LIBPATH = [silo_lib_path])
370 # Note that we do not add the libs since they are only needed for the
371 # weipa library and tools.
372 #env.AppendUnique(LIBS = [env['silo_libs']])
373 env['buildvars']['silo_inc_path']=silo_inc_path
374 env['buildvars']['silo_lib_path']=silo_lib_path
375 env['buildvars']['silo']=int(env['silo'])
376
377 ######## VisIt
378 visit_inc_path=''
379 visit_lib_path=''
380 if env['visit']:
381 visit_inc_path,visit_lib_path=findLibWithHeader(env, env['visit_libs'], 'VisItControlInterface_V2.h', env['visit_prefix'], lang='c++')
382 env.AppendUnique(CPPPATH = [visit_inc_path])
383 env.AppendUnique(LIBPATH = [visit_lib_path])
384 env['buildvars']['visit_inc_path']=visit_inc_path
385 env['buildvars']['visit_lib_path']=visit_lib_path
386 env['buildvars']['visit']=int(env['visit'])
387
388 ######## MPI
389 if env['mpi']=='no':
390 env['mpi']='none'
391
392 env['usempi'] = env['mpi']!='none'
393 mpi_inc_path=''
394 mpi_lib_path=''
395 if env['usempi']:
396 mpi_inc_path,mpi_lib_path=findLibWithHeader(env, env['mpi_libs'], 'mpi.h', env['mpi_prefix'], lang='c++')
397 env.AppendUnique(CPPPATH = [mpi_inc_path])
398 env.AppendUnique(LIBPATH = [mpi_lib_path])
399 env.AppendUnique(LIBS = env['mpi_libs'])
400 env.PrependENVPath(env['LD_LIBRARY_PATH_KEY'], mpi_lib_path)
401 env.Append(CPPDEFINES = ['ESYS_MPI', 'MPI_NO_CPPBIND', 'MPICH_IGNORE_CXX_SEEK'])
402 # NetCDF 4.1 defines MPI_Comm et al. if MPI_INCLUDED is not defined!
403 # On the other hand MPT and OpenMPI don't define the latter so we have
404 # to do that here
405 if env['netcdf'] and env['mpi'] in ['MPT','OPENMPI']:
406 env.Append(CPPDEFINES = ['MPI_INCLUDED'])
407 env['buildvars']['mpi_inc_path']=mpi_inc_path
408 env['buildvars']['mpi_lib_path']=mpi_lib_path
409 env['buildvars']['mpi']=env['mpi']
410
411 ######## BOOMERAMG
412 if env['mpi'] == 'none': env['boomeramg'] = False
413 boomeramg_inc_path=''
414 boomeramg_lib_path=''
415 if env['boomeramg']:
416 boomeramg_inc_path,boomeramg_lib_path=findLibWithHeader(env, env['boomeramg_libs'], 'HYPRE.h', env['boomeramg_prefix'], lang='c++')
417 env.AppendUnique(CPPPATH = [boomeramg_inc_path])
418 env.AppendUnique(LIBPATH = [boomeramg_lib_path])
419 env.AppendUnique(LIBS = env['boomeramg_libs'])
420 env.PrependENVPath(env['LD_LIBRARY_PATH_KEY'], boomeramg_lib_path)
421 env.Append(CPPDEFINES = ['BOOMERAMG'])
422 env['buildvars']['boomeramg_inc_path']=boomeramg_inc_path
423 env['buildvars']['boomeramg_lib_path']=boomeramg_lib_path
424 env['buildvars']['boomeramg']=int(env['boomeramg'])
425
426 ######## ParMETIS
427 if not env['usempi']: env['parmetis'] = False
428 parmetis_inc_path=''
429 parmetis_lib_path=''
430 if env['parmetis']:
431 parmetis_inc_path,parmetis_lib_path=findLibWithHeader(env, env['parmetis_libs'], 'parmetis.h', env['parmetis_prefix'], lang='c++')
432 env.AppendUnique(CPPPATH = [parmetis_inc_path])
433 env.AppendUnique(LIBPATH = [parmetis_lib_path])
434 env.AppendUnique(LIBS = env['parmetis_libs'])
435 env.PrependENVPath(env['LD_LIBRARY_PATH_KEY'], parmetis_lib_path)
436
437 # Try to extract the parmetis version from parmetis.h
438 header=open(os.path.join(parmetis_inc_path, 'parmetis.h')).readlines()
439 major,minor,sub = None,None,None
440 for line in header:
441 ver=re.match(r'#define PARMETIS_MAJOR_VERSION\s*(\d+)',line)
442 if ver:
443 major = int(ver.group(1))
444 continue
445 ver=re.match(r'#define PARMETIS_MINOR_VERSION\s*(\d+)',line)
446 if ver:
447 minor = int(ver.group(1))
448 continue
449 ver=re.match(r'#define PARMETIS_SUBMINOR_VERSION\s*(\d+)',line)
450 if ver:
451 sub = int(ver.group(1))
452 continue
453 if major is not None:
454 env['parmetis_version'] = "%d.%d.%d"%(major,minor,0 if sub is None else sub)
455 if env['longindices']:
456 # ParMETIS version 3.x does not support 64-bit indices
457 if major < 4:
458 print("Sorry, cannot use ParMETIS version < 4.0 with 64-bit index types. Set longindices to False or disable ParMETIS.")
459 env.Exit(1)
460 else:
461 # check if ParMETIS was built with 64-bit indices
462 conf = Configure(env.Clone())
463 idxsize=conf.CheckTypeSize('idx_t', '#include <parmetis.h>', 'C++')
464 if idxsize != 8:
465 print("Sorry, ParMETIS was not compiled with 64-bit indices. Set longindices to False or disable/rebuild ParMETIS.")
466 env.Exit(1)
467 else:
468 env['parmetis_version'] = "unknown"
469
470 env.Append(CPPDEFINES = ['USE_PARMETIS'])
471 env['buildvars']['parmetis_inc_path']=parmetis_inc_path
472 env['buildvars']['parmetis_lib_path']=parmetis_lib_path
473 env['buildvars']['parmetis']=int(env['parmetis'])
474
475 ######## gmsh (for tests)
476 env['gmsh'] = False
477 if env['IS_WINDOWS']:
478 try:
479 p=Popen(['gmsh', '-info'], stderr=PIPE)
480 _,e=p.communicate()
481 if e.split().count("MPI"):
482 env['gmsh']='m'
483 else:
484 env['gmsh']='s'
485 p.wait()
486 except OSError:
487 pass
488 else:
489 which = Popen(['which', 'gmsh'], stdout=PIPE)
490 path,_ = which.communicate()
491 if which.wait() == 0:
492 cmd = ['ldd', path[:-1]]
493 if env['IS_OSX']:
494 cmd = ['otool','-L', path[:-1]]
495 try:
496 p=Popen(cmd, stdout=PIPE)
497 gmshlibs,_ = p.communicate()
498 ret = p.wait()
499 if ret == 0 and 'libmpi' in gmshlibs:
500 env['gmsh'] = 'm'
501 else:
502 env['gmsh'] = 's'
503 except OSError:
504 pass
505
506 ######## boost::iostreams
507 if env['compressed_files']:
508 try:
509 boost_inc_path, boost_lib_path = findLibWithHeader(env, env['compression_libs'], 'boost/iostreams/filter/gzip.hpp', env['boost_prefix'], lang='c++')
510 env.Append(CPPDEFINES = ['USE_BOOSTIO'])
511 env.AppendUnique(LIBS = env['compression_libs'])
512 except RuntimeError as e:
513 env['compressed_files'] = False
514 env['buildvars']['compressed_files']=int(env['compressed_files'])
515
516 return env
517
518 def checkPDFLatex(env):
519 if 'PDF' in dir(env) and '.tex' in env.PDF.builder.src_suffixes(env):
520 env['pdflatex']=True
521 else:
522 env['pdflatex']=False
523 return env
524
525

  ViewVC Help
Powered by ViewVC 1.1.26