Commit b25895b1 authored by Maude Le Jeune's avatar Maude Le Jeune
Browse files

working wscript after waf update

parent 7759e451
......@@ -5,7 +5,8 @@ top = '.'
out = 'build'
def set_options(ctx):
def options(ctx):
ctx.add_option('--cfitsio_prefix', action='store', default='/usr', help='cfitsio location')
ctx.add_option('--healpix_prefix', action='store', default='/usr/local', help='healpix location')
ctx.add_option('--with_gsl', action='store', default='/usr', help='location of gsl')
......@@ -16,7 +17,6 @@ def set_options(ctx):
def configure(ctx):
print('→ configuring spherelib')
import Options
ctx.env['CXXFLAGS'] = ['-O2']
......@@ -48,7 +48,7 @@ def configure(ctx):
ctx.env['CXXFLAGS'].append("-I"+str(Options.options.with_numpy_core)+"/include")
ctx.env['CXXFLAGS'].append('-fPIC')
ctx.env['CXXFLAGS'].append('-fopenmp')
ctx.env['CXXFLAGS'].append('-fpermissive')
#ctx.env['CXXFLAGS'].append('-fpermissive')
#ctx.check_fortran()
ctx.check(header_name=['gsl/gsl_rng.h', 'gsl/gsl_sort_double.h'],compile_mode='cxx', mandatory=True)
ctx.check(header_name=['fftw3.h'],compile_mode='cxx', mandatory=True)
......@@ -56,107 +56,111 @@ def configure(ctx):
ctx.check_cxx(lib=['fftw3'], libpath=str(Options.options.with_fftw3)+"/lib", uselib_store='fftw3', mandatory=True)
ctx.check_python_module('healpy')
ctx.env['STLIB_MARKER'] = ['-Wl,--start-group', '-Wl,-Bstatic']
ctx.env['SHLIB_MARKER'] = ['-Wl,--end-group', '-Wl,-Bdynamic']
def get_version():
return VERSION
def build(bld):
print('→ building spherelib')
hp_data = 'HEALPIXDATA="'+bld.env["HEALPIX_EXT_PREFIX"]+'/data"'
libs = ['cfitsio', 'gsl', 'gslcblas']
stlibs = ['cxxsupport', 'fftpack', 'healpix_cxx','sharp','c_utils']
import Options
import os
libs.append('gomp' )
libs.append('pthread')
print('→ building spherelib')
hp_data = 'HEALPIXDATA="'+bld.env["HEALPIX_EXT_PREFIX"]+'/data"'
libs = ['cfitsio', 'gsl', 'gslcblas']
import Options
import os
libs.append('gomp' )
libs.append('pthread')
target=bld.env["HEALPIX_TARGET"]
abspath = bld.root.abspath()
cxx_spherelib = bld(features = ['cxx', 'cshlib'],
target=bld.env["HEALPIX_TARGET"]
abspath = bld.root.abspath()
cxx_spherelib = bld(features = ['cxx', 'cshlib'],
source = ['../lib/src/MapExt.cpp', '../lib/src/AlmExt.cpp', '../lib/src/Bin.cpp', '../lib/src/PowSpecExt.cpp', '../lib/src/CovMat.cpp'],
target = 'spherelib',
vnum = get_version(),
includes = ['../lib/src', bld.env["HEALPIX_EXT_INC"]],
defines = [hp_data],
ccflags = bld.env['CXXFLAGS'],
cflags = bld.env['CXXFLAGS'],
linkflags = ['-shared'],
lib = libs,
uselib = libs,
libpath = [bld.env["HEALPIX_EXT_LIB"],bld.env["CFITSIO_EXT_LIB"]],
stlib = [ 'cxxsupport', 'fftpack', 'healpix_cxx','sharp','c_utils' ],
libpath = [bld.env["CFITSIO_EXT_LIB"]],
stlib = stlibs,
stlibpath =[bld.env["HEALPIX_EXT_LIB"]],
name = 'spherelib'
)
cxx_spherelib.install_path = '${PREFIX}/lib'
cxx_spherelib.install_path = '${PREFIX}/lib'
cxx_atlas = bld(features = ['cxx', 'cshlib'],
cxx_atlas = bld(features = ['cxx', 'cshlib'],
source = ['../lib/atlas/catalog.cpp', '../lib/atlas/profile.cpp', '../lib/atlas/tangentPlane.cpp', '../lib/atlas/maptools.cpp', '../lib/atlas/atlasmanager.cpp'],
target = 'libatlas',
vnum = get_version(),
includes = ['../lib/atlas', bld.env["HEALPIX_EXT_INC"]],
defines = [hp_data],
ccflags = bld.env['CXXFLAGS', '-fpermissive'],
cflags = bld.env['CXXFLAGS'],
linkflags = ['-shared'],
lib = libs+['fftw3', 'm'],
uselib = libs+['fftw3', 'm'],
libpath = [bld.env["HEALPIX_EXT_LIB"],bld.env["CFITSIO_EXT_LIB"]],
stlib = [ 'cxxsupport', 'fftpack', 'healpix_cxx','sharp','c_utils'],
libpath = [bld.env["CFITSIO_EXT_LIB"]],
stlib = stlibs,
stlibpath =[bld.env["HEALPIX_EXT_LIB"]],
name = 'libatlas'
)
cxx_atlas.install_path = '${PREFIX}/lib'
cxx_atlas.install_path = '${PREFIX}/lib'
swig_spherelib_map = bld(features = 'cxx cshlib pyext',
swig_spherelib_map = bld(features = 'cxx cshlib pyext',
includes = ['../lib/atlas','../lib/src',bld.env["HEALPIX_EXT_INC"],'spherelib',
'../include', '../lib/src', bld.env["CFITSIO_EXT_INC"] ],
source = ['spherelib/spherelib_map.i','spherelib/spherelib_map.cpp'],
target = '_spherelib_map',
swig_flags = '-c++ -python -Wall',
ccflags = bld.env['CXXFLAGS'],
cflags = bld.env['CXXFLAGS'],
linkflags = ['-shared'],
defines = [hp_data],
lib = libs,
libpath = [bld.env["HEALPIX_EXT_LIB"],bld.env["CFITSIO_EXT_LIB"]],
stlib = ['cxxsupport', 'fftpack', 'healpix_cxx','sharp','c_utils'],
libpath = [bld.env["CFITSIO_EXT_LIB"]],
stlib = stlibs,
stlibpath =[bld.env["HEALPIX_EXT_LIB"]],
uselib_local = ['spherelib', 'libatlas']
use = ['spherelib', 'libatlas']
)
swig_spherelib_alm = bld(features = 'cxx cshlib pyext',
swig_spherelib_alm = bld(features = 'cxx cshlib pyext',
includes = ['../lib/src', bld.env["HEALPIX_EXT_INC"],'spherelib',
'../include', '../lib/src' ],
source = ['spherelib/spherelib_alm.i','spherelib/spherelib_alm.cpp'],
target = '_spherelib_alm',
swig_flags = '-c++ -python -Wall',
ccflags = bld.env['CXXFLAGS'],
linkflags = ['-shared'],
cflags = bld.env['CXXFLAGS'],
linkflags = ['-shared'],
defines = [hp_data],
lib = libs,
libpath = [bld.env["HEALPIX_EXT_LIB"],bld.env["CFITSIO_EXT_LIB"]],
stlib = ['cxxsupport', 'fftpack', 'healpix_cxx','sharp','c_utils'],
libpath = [bld.env["CFITSIO_EXT_LIB"]],
stlib = stlibs,
stlibpath =[bld.env["HEALPIX_EXT_LIB"]],
uselib_local = 'spherelib')
use = ['spherelib'])
swig_spherelib_bin = bld(features = 'cxx cshlib pyext',
swig_spherelib_bin = bld(features = 'cxx cshlib pyext',
includes = ['../lib/src', bld.env["HEALPIX_EXT_INC"],'spherelib',
'../include', '../lib/src'],
source = ['spherelib/spherelib_bin.i','spherelib/spherelib_bin.cpp'],
target = '_spherelib_bin',
swig_flags = '-c++ -python -Wall',
ccflags = bld.env['CXXFLAGS'],
linkflags = ['-shared'],
cflags = bld.env['CXXFLAGS'],
linkflags = ['-shared'],
defines = [hp_data],
lib = libs,
libpath = [bld.env["HEALPIX_EXT_LIB"],bld.env["CFITSIO_EXT_LIB"]],
stlib = ['cxxsupport', 'fftpack', 'healpix_cxx','sharp','c_utils'],
libpath = [bld.env["CFITSIO_EXT_LIB"]],
stlib = stlibs,
stlibpath =[bld.env["HEALPIX_EXT_LIB"]],
uselib_local = 'spherelib')
swig_spherelib_map.install_path = '${PYTHONDIR}/spherelib'
swig_spherelib_alm.install_path = '${PYTHONDIR}/spherelib'
swig_spherelib_bin.install_path = '${PYTHONDIR}/spherelib'
source_files = bld.path.ant_glob('spherelib/*.py')
obj = bld(features = 'py', source=source_files)
obj.install_path = '${PYTHONDIR}/spherelib'
use = ['spherelib'])
swig_spherelib_map.install_path = '${PYTHONDIR}/spherelib'
swig_spherelib_alm.install_path = '${PYTHONDIR}/spherelib'
swig_spherelib_bin.install_path = '${PYTHONDIR}/spherelib'
source_files = bld.path.ant_glob('spherelib/*.py')
obj = bld(features = 'py', source=source_files)
obj.install_path = '${PYTHONDIR}/spherelib'
#print('→ building icosahedron')
#os.system("gfortran ../include/icosahedron.f -o "+'${PREFIX}'+"/bin/icosahedron")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment