47 |
############################### Build options ################################ |
############################### Build options ################################ |
48 |
|
|
49 |
default_prefix='/usr' |
default_prefix='/usr' |
50 |
mpi_flavours=('none', 'MPT', 'MPICH', 'MPICH2', 'OPENMPI', 'INTELMPI') |
mpi_flavours=('no', 'none', 'MPT', 'MPICH', 'MPICH2', 'OPENMPI', 'INTELMPI') |
51 |
lapack_flavours=('none', 'clapack', 'mkl') |
lapack_flavours=('none', 'clapack', 'mkl') |
52 |
|
|
53 |
vars = Variables(options_file, ARGUMENTS) |
vars = Variables(options_file, ARGUMENTS) |
122 |
EnumVariable('forcecollres', 'For testing use only - set the default value for force resolving collective ops', 'leave_alone', allowed_values=('leave_alone', 'on', 'off')), |
EnumVariable('forcecollres', 'For testing use only - set the default value for force resolving collective ops', 'leave_alone', allowed_values=('leave_alone', 'on', 'off')), |
123 |
# finer control over library building, intel aggressive global optimisation |
# finer control over library building, intel aggressive global optimisation |
124 |
# works with dynamic libraries on windows. |
# works with dynamic libraries on windows. |
125 |
('share_esysutils', 'Build a dynamic esysUtils library', False), |
('build_shared', 'Build dynamic libraries only', False), |
|
('share_paso', 'Build a dynamic paso library', False), |
|
126 |
('sys_libs', 'Extra libraries to link with', []), |
('sys_libs', 'Extra libraries to link with', []), |
127 |
('escript_opts_version', 'Version of options file (do not specify on command line)'), |
('escript_opts_version', 'Version of options file (do not specify on command line)'), |
128 |
|
('SVN_VERSION', 'Do not use from options file', -2), |
129 |
) |
) |
130 |
|
|
131 |
##################### Create environment and help text ####################### |
##################### Create environment and help text ####################### |
284 |
# add system libraries |
# add system libraries |
285 |
env.AppendUnique(LIBS = env['sys_libs']) |
env.AppendUnique(LIBS = env['sys_libs']) |
286 |
|
|
287 |
# Get the global Subversion revision number for the getVersion() method |
|
288 |
try: |
global_revision=ARGUMENTS.get('SVN_VERSION', None) |
289 |
|
if global_revision: |
290 |
|
global_revision = re.sub(':.*', '', global_revision) |
291 |
|
global_revision = re.sub('[^0-9]', '', global_revision) |
292 |
|
if global_revision == '': global_revision='-2' |
293 |
|
else: |
294 |
|
# Get the global Subversion revision number for the getVersion() method |
295 |
|
try: |
296 |
global_revision = os.popen('svnversion -n .').read() |
global_revision = os.popen('svnversion -n .').read() |
297 |
global_revision = re.sub(':.*', '', global_revision) |
global_revision = re.sub(':.*', '', global_revision) |
298 |
global_revision = re.sub('[^0-9]', '', global_revision) |
global_revision = re.sub('[^0-9]', '', global_revision) |
299 |
if global_revision == '': global_revision='-2' |
if global_revision == '': global_revision='-2' |
300 |
except: |
except: |
301 |
global_revision = '-1' |
global_revision = '-1' |
302 |
env['svn_revision']=global_revision |
env['svn_revision']=global_revision |
303 |
env.Append(CPPDEFINES=['SVN_VERSION='+global_revision]) |
env.Append(CPPDEFINES=['SVN_VERSION='+global_revision]) |
304 |
|
|
305 |
if IS_WINDOWS: |
if IS_WINDOWS: |
306 |
if not env['share_esysutils']: |
if not env['build_shared']: |
307 |
env.Append(CPPDEFINES = ['ESYSUTILS_STATIC_LIB']) |
env.Append(CPPDEFINES = ['ESYSUTILS_STATIC_LIB']) |
|
if not env['share_paso']: |
|
308 |
env.Append(CPPDEFINES = ['PASO_STATIC_LIB']) |
env.Append(CPPDEFINES = ['PASO_STATIC_LIB']) |
309 |
|
|
310 |
###################### Copy required environment vars ######################## |
###################### Copy required environment vars ######################## |
565 |
|
|
566 |
######## MPI (optional) |
######## MPI (optional) |
567 |
|
|
568 |
|
if env['mpi']=='no': |
569 |
|
env['mpi']='none' |
570 |
|
|
571 |
env['usempi'] = env['mpi']!='none' |
env['usempi'] = env['mpi']!='none' |
572 |
mpi_inc_path='' |
mpi_inc_path='' |
573 |
mpi_lib_path='' |
mpi_lib_path='' |
625 |
except OSError: |
except OSError: |
626 |
env['gmsh']=False |
env['gmsh']=False |
627 |
|
|
628 |
|
######## PDFLaTeX (for documentation) |
629 |
|
if 'PDF' in dir(env) and '.tex' in env.PDF.builder.src_suffixes(env): |
630 |
|
env['pdflatex']=True |
631 |
|
else: |
632 |
|
env['pdflatex']=False |
633 |
|
|
634 |
######################## Summarize our environment ########################### |
######################## Summarize our environment ########################### |
635 |
|
|
636 |
# keep some of our install paths first in the list for the unit tests |
# keep some of our install paths first in the list for the unit tests |
776 |
|
|
777 |
################### Targets to build and install libraries ################### |
################### Targets to build and install libraries ################### |
778 |
|
|
779 |
target_init = env.Command(env['pyinstall']+'/__init__.py', None, Touch('$TARGET')) |
target_init = env.Command(os.path.join(env['pyinstall'],'__init__.py'), None, Touch('$TARGET')) |
780 |
env.Alias('target_init', [target_init]) |
env.Alias('target_init', [target_init]) |
781 |
|
# delete buildvars upon cleanup |
782 |
|
env.Clean('target_init', os.path.join(env['libinstall'], 'buildvars')) |
783 |
|
|
784 |
# The headers have to be installed prior to build in order to satisfy |
# The headers have to be installed prior to build in order to satisfy |
785 |
# #include <paso/Common.h> |
# #include <paso/Common.h> |
865 |
print("Error attempting to write unittests file.") |
print("Error attempting to write unittests file.") |
866 |
Exit(1) |
Exit(1) |
867 |
|
|
868 |
|
# delete utest.sh upon cleanup |
869 |
|
env.Clean('target_init', 'utest.sh') |
870 |
|
|
871 |
# Make sure that the escript wrapper is in place |
# Make sure that the escript wrapper is in place |
872 |
if not os.path.isfile(os.path.join(env['bininstall'], 'run-escript')): |
if not os.path.isfile(os.path.join(env['bininstall'], 'run-escript')): |
873 |
print("Copying escript wrapper.") |
print("Copying escript wrapper.") |