15 |
EnsureSConsVersion(0,96,91) |
EnsureSConsVersion(0,96,91) |
16 |
EnsurePythonVersion(2,3) |
EnsurePythonVersion(2,3) |
17 |
|
|
18 |
import sys, os, re, socket, platform |
import sys, os, re, socket, platform, stat |
19 |
|
|
20 |
# Add our extensions |
# Add our extensions |
21 |
if os.path.isdir('scons'): sys.path.append('scons') |
if os.path.isdir('scons'): sys.path.append('scons') |
189 |
#the long long warning occurs on the Mac |
#the long long warning occurs on the Mac |
190 |
cc_optim = "-O3" |
cc_optim = "-O3" |
191 |
cc_debug = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK" |
cc_debug = "-g -O0 -DDOASSERT -DDOPROF -DBOUNDS_CHECK" |
192 |
omp_optim = "" |
omp_optim = "-fopenmp" |
193 |
omp_debug = "" |
omp_debug = "-fopenmp" |
194 |
omp_libs = [] |
omp_libs = ['gomp'] |
195 |
pedantic = "-pedantic-errors -Wno-long-long" |
pedantic = "-pedantic-errors -Wno-long-long" |
196 |
fatalwarning = "-Werror" |
fatalwarning = "-Werror" |
197 |
sysheaderopt = "-isystem " |
sysheaderopt = "-isystem " |
572 |
conf.env.PrependENVPath('LD_LIBRARY_PATH', env['libinstall']) |
conf.env.PrependENVPath('LD_LIBRARY_PATH', env['libinstall']) |
573 |
|
|
574 |
if env_mpi['usempi'] and not conf.CheckCHeader('mpi.h'): env_mpi['usempi'] = 0 |
if env_mpi['usempi'] and not conf.CheckCHeader('mpi.h'): env_mpi['usempi'] = 0 |
575 |
if env_mpi['usempi'] and not conf.CheckFunc('MPI_Init'): env_mpi['usempi'] = 0 |
# if env_mpi['usempi'] and not conf.CheckFunc('MPI_Init'): env_mpi['usempi'] = 0 |
576 |
|
|
577 |
# Add MPI to environment env_mpi if it was found |
# Add MPI to environment env_mpi if it was found |
578 |
if env_mpi['usempi']: |
if env_mpi['usempi']: |
656 |
Execute(Delete(env['libinstall'] + "/Compiled.with.debug")) |
Execute(Delete(env['libinstall'] + "/Compiled.with.debug")) |
657 |
Execute(Delete(env['libinstall'] + "/Compiled.with.mpi")) |
Execute(Delete(env['libinstall'] + "/Compiled.with.mpi")) |
658 |
Execute(Delete(env['libinstall'] + "/Compiled.with.openmp")) |
Execute(Delete(env['libinstall'] + "/Compiled.with.openmp")) |
659 |
|
Execute(Delete(env['libinstall'] + "pyversion")) |
660 |
if not env['usempi']: Execute(Delete(env['libinstall'] + "/pythonMPI")) |
if not env['usempi']: Execute(Delete(env['libinstall'] + "/pythonMPI")) |
661 |
|
|
662 |
|
|
700 |
if env['usempi']: |
if env['usempi']: |
701 |
remember_list += env.Command(env['libinstall'] + "/Compiled.with.mpi", None, Touch('$TARGET')) |
remember_list += env.Command(env['libinstall'] + "/Compiled.with.mpi", None, Touch('$TARGET')) |
702 |
|
|
703 |
if env['omp_optim'] != '': |
if env['useopenmp']: |
704 |
remember_list += env.Command(env['libinstall'] + "/Compiled.with.openmp", None, Touch('$TARGET')) |
remember_list += env.Command(env['libinstall'] + "/Compiled.with.openmp", None, Touch('$TARGET')) |
705 |
|
|
706 |
env.Alias('remember_options', remember_list) |
env.Alias('remember_options', remember_list) |
710 |
|
|
711 |
if not IS_WINDOWS_PLATFORM: |
if not IS_WINDOWS_PLATFORM: |
712 |
versionstring="Python "+str(sys.version_info[0])+"."+str(sys.version_info[1])+"."+str(sys.version_info[2]) |
versionstring="Python "+str(sys.version_info[0])+"."+str(sys.version_info[1])+"."+str(sys.version_info[2]) |
713 |
os.system("echo "+versionstring+" > "+env['libinstall']+"/pyversion") |
os.system("echo "+versionstring+" > "+os.path.join(env['libinstall'],"pyversion")) |
714 |
|
|
715 |
|
############## Populate the buildvars file ##################### |
716 |
|
|
717 |
|
buildvars=open(os.path.join(env['libinstall'],'buildvars'),'w') |
718 |
|
buildvars.write('python='+str(sys.version_info[0])+"."+str(sys.version_info[1])+"."+str(sys.version_info[2])+'\n') |
719 |
|
|
720 |
|
# Find the boost version by extracting it from version.hpp |
721 |
|
boosthpp=open(os.path.join(env['boost_path'],'boost','version.hpp')) |
722 |
|
boostversion='unknown' |
723 |
|
try: |
724 |
|
for line in boosthpp: |
725 |
|
ver=re.match(r'#define BOOST_VERSION (\d+)',line) |
726 |
|
if ver: |
727 |
|
boostversion=ver.group(1) |
728 |
|
except StopIteration: |
729 |
|
pass |
730 |
|
buildvars.write("boost="+boostversion+"\n") |
731 |
|
buildvars.write("svn_revision="+str(global_revision)+"\n") |
732 |
|
out="usedebug=" |
733 |
|
if env['usedebug']: |
734 |
|
out+="y" |
735 |
|
else: |
736 |
|
out+="n" |
737 |
|
out+="\nusempi=" |
738 |
|
if env['usempi']: |
739 |
|
out+="y" |
740 |
|
else: |
741 |
|
out+="n" |
742 |
|
out+="\nuseopenmp=" |
743 |
|
if env['useopenmp']: |
744 |
|
out+="y" |
745 |
|
else: |
746 |
|
out+="n" |
747 |
|
buildvars.write(out+"\n") |
748 |
|
|
749 |
|
buildvars.close() |
750 |
|
|
751 |
|
|
752 |
############ Targets to build and install libraries ############ |
############ Targets to build and install libraries ############ |
753 |
|
|
818 |
for tests in TestGroups: |
for tests in TestGroups: |
819 |
utest.write(tests.makeString()) |
utest.write(tests.makeString()) |
820 |
utest.close() |
utest.close() |
821 |
|
os.chmod("utest.sh",stat.S_IRWXU|stat.S_IRGRP|stat.S_IXGRP|stat.S_IROTH|stat.S_IXOTH) |
822 |
print "utest.sh written" |
print "utest.sh written" |
823 |
except IOError: |
except IOError: |
824 |
print "Error attempting to write unittests file." |
print "Error attempting to write unittests file." |