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 = '.' ...@@ -5,7 +5,8 @@ top = '.'
out = 'build' out = 'build'
def set_options(ctx):
def options(ctx):
ctx.add_option('--cfitsio_prefix', action='store', default='/usr', help='cfitsio location') 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('--healpix_prefix', action='store', default='/usr/local', help='healpix location')
ctx.add_option('--with_gsl', action='store', default='/usr', help='location of gsl') ctx.add_option('--with_gsl', action='store', default='/usr', help='location of gsl')
...@@ -16,7 +17,6 @@ def set_options(ctx): ...@@ -16,7 +17,6 @@ def set_options(ctx):
def configure(ctx): def configure(ctx):
print('→ configuring spherelib') print('→ configuring spherelib')
import Options import Options
ctx.env['CXXFLAGS'] = ['-O2'] ctx.env['CXXFLAGS'] = ['-O2']
...@@ -48,7 +48,7 @@ def configure(ctx): ...@@ -48,7 +48,7 @@ def configure(ctx):
ctx.env['CXXFLAGS'].append("-I"+str(Options.options.with_numpy_core)+"/include") ctx.env['CXXFLAGS'].append("-I"+str(Options.options.with_numpy_core)+"/include")
ctx.env['CXXFLAGS'].append('-fPIC') ctx.env['CXXFLAGS'].append('-fPIC')
ctx.env['CXXFLAGS'].append('-fopenmp') ctx.env['CXXFLAGS'].append('-fopenmp')
ctx.env['CXXFLAGS'].append('-fpermissive') #ctx.env['CXXFLAGS'].append('-fpermissive')
#ctx.check_fortran() #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=['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) ctx.check(header_name=['fftw3.h'],compile_mode='cxx', mandatory=True)
...@@ -56,15 +56,19 @@ def configure(ctx): ...@@ -56,15 +56,19 @@ def configure(ctx):
ctx.check_cxx(lib=['fftw3'], libpath=str(Options.options.with_fftw3)+"/lib", uselib_store='fftw3', mandatory=True) ctx.check_cxx(lib=['fftw3'], libpath=str(Options.options.with_fftw3)+"/lib", uselib_store='fftw3', mandatory=True)
ctx.check_python_module('healpy') 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(): def get_version():
return VERSION return VERSION
def build(bld):
def build(bld):
print('→ building spherelib') print('→ building spherelib')
hp_data = 'HEALPIXDATA="'+bld.env["HEALPIX_EXT_PREFIX"]+'/data"' hp_data = 'HEALPIXDATA="'+bld.env["HEALPIX_EXT_PREFIX"]+'/data"'
libs = ['cfitsio', 'gsl', 'gslcblas'] libs = ['cfitsio', 'gsl', 'gslcblas']
stlibs = ['cxxsupport', 'fftpack', 'healpix_cxx','sharp','c_utils']
import Options import Options
import os import os
libs.append('gomp' ) libs.append('gomp' )
...@@ -78,12 +82,11 @@ def build(bld): ...@@ -78,12 +82,11 @@ def build(bld):
vnum = get_version(), vnum = get_version(),
includes = ['../lib/src', bld.env["HEALPIX_EXT_INC"]], includes = ['../lib/src', bld.env["HEALPIX_EXT_INC"]],
defines = [hp_data], defines = [hp_data],
ccflags = bld.env['CXXFLAGS'], cflags = bld.env['CXXFLAGS'],
linkflags = ['-shared'], linkflags = ['-shared'],
lib = libs, lib = libs,
uselib = libs, libpath = [bld.env["CFITSIO_EXT_LIB"]],
libpath = [bld.env["HEALPIX_EXT_LIB"],bld.env["CFITSIO_EXT_LIB"]], stlib = stlibs,
stlib = [ 'cxxsupport', 'fftpack', 'healpix_cxx','sharp','c_utils' ],
stlibpath =[bld.env["HEALPIX_EXT_LIB"]], stlibpath =[bld.env["HEALPIX_EXT_LIB"]],
name = 'spherelib' name = 'spherelib'
) )
...@@ -95,12 +98,11 @@ def build(bld): ...@@ -95,12 +98,11 @@ def build(bld):
vnum = get_version(), vnum = get_version(),
includes = ['../lib/atlas', bld.env["HEALPIX_EXT_INC"]], includes = ['../lib/atlas', bld.env["HEALPIX_EXT_INC"]],
defines = [hp_data], defines = [hp_data],
ccflags = bld.env['CXXFLAGS', '-fpermissive'], cflags = bld.env['CXXFLAGS'],
linkflags = ['-shared'], linkflags = ['-shared'],
lib = libs+['fftw3', 'm'], lib = libs+['fftw3', 'm'],
uselib = libs+['fftw3', 'm'], libpath = [bld.env["CFITSIO_EXT_LIB"]],
libpath = [bld.env["HEALPIX_EXT_LIB"],bld.env["CFITSIO_EXT_LIB"]], stlib = stlibs,
stlib = [ 'cxxsupport', 'fftpack', 'healpix_cxx','sharp','c_utils'],
stlibpath =[bld.env["HEALPIX_EXT_LIB"]], stlibpath =[bld.env["HEALPIX_EXT_LIB"]],
name = 'libatlas' name = 'libatlas'
) )
...@@ -112,14 +114,14 @@ def build(bld): ...@@ -112,14 +114,14 @@ def build(bld):
source = ['spherelib/spherelib_map.i','spherelib/spherelib_map.cpp'], source = ['spherelib/spherelib_map.i','spherelib/spherelib_map.cpp'],
target = '_spherelib_map', target = '_spherelib_map',
swig_flags = '-c++ -python -Wall', swig_flags = '-c++ -python -Wall',
ccflags = bld.env['CXXFLAGS'], cflags = bld.env['CXXFLAGS'],
linkflags = ['-shared'], linkflags = ['-shared'],
defines = [hp_data], defines = [hp_data],
lib = libs, lib = libs,
libpath = [bld.env["HEALPIX_EXT_LIB"],bld.env["CFITSIO_EXT_LIB"]], libpath = [bld.env["CFITSIO_EXT_LIB"]],
stlib = ['cxxsupport', 'fftpack', 'healpix_cxx','sharp','c_utils'], stlib = stlibs,
stlibpath =[bld.env["HEALPIX_EXT_LIB"]], 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', includes = ['../lib/src', bld.env["HEALPIX_EXT_INC"],'spherelib',
...@@ -127,14 +129,14 @@ def build(bld): ...@@ -127,14 +129,14 @@ def build(bld):
source = ['spherelib/spherelib_alm.i','spherelib/spherelib_alm.cpp'], source = ['spherelib/spherelib_alm.i','spherelib/spherelib_alm.cpp'],
target = '_spherelib_alm', target = '_spherelib_alm',
swig_flags = '-c++ -python -Wall', swig_flags = '-c++ -python -Wall',
ccflags = bld.env['CXXFLAGS'], cflags = bld.env['CXXFLAGS'],
linkflags = ['-shared'], linkflags = ['-shared'],
defines = [hp_data], defines = [hp_data],
lib = libs, lib = libs,
libpath = [bld.env["HEALPIX_EXT_LIB"],bld.env["CFITSIO_EXT_LIB"]], libpath = [bld.env["CFITSIO_EXT_LIB"]],
stlib = ['cxxsupport', 'fftpack', 'healpix_cxx','sharp','c_utils'], stlib = stlibs,
stlibpath =[bld.env["HEALPIX_EXT_LIB"]], 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', includes = ['../lib/src', bld.env["HEALPIX_EXT_INC"],'spherelib',
...@@ -142,14 +144,14 @@ def build(bld): ...@@ -142,14 +144,14 @@ def build(bld):
source = ['spherelib/spherelib_bin.i','spherelib/spherelib_bin.cpp'], source = ['spherelib/spherelib_bin.i','spherelib/spherelib_bin.cpp'],
target = '_spherelib_bin', target = '_spherelib_bin',
swig_flags = '-c++ -python -Wall', swig_flags = '-c++ -python -Wall',
ccflags = bld.env['CXXFLAGS'], cflags = bld.env['CXXFLAGS'],
linkflags = ['-shared'], linkflags = ['-shared'],
defines = [hp_data], defines = [hp_data],
lib = libs, lib = libs,
libpath = [bld.env["HEALPIX_EXT_LIB"],bld.env["CFITSIO_EXT_LIB"]], libpath = [bld.env["CFITSIO_EXT_LIB"]],
stlib = ['cxxsupport', 'fftpack', 'healpix_cxx','sharp','c_utils'], stlib = stlibs,
stlibpath =[bld.env["HEALPIX_EXT_LIB"]], stlibpath =[bld.env["HEALPIX_EXT_LIB"]],
uselib_local = 'spherelib') use = ['spherelib'])
swig_spherelib_map.install_path = '${PYTHONDIR}/spherelib' swig_spherelib_map.install_path = '${PYTHONDIR}/spherelib'
swig_spherelib_alm.install_path = '${PYTHONDIR}/spherelib' swig_spherelib_alm.install_path = '${PYTHONDIR}/spherelib'
...@@ -160,3 +162,5 @@ def build(bld): ...@@ -160,3 +162,5 @@ def build(bld):
#print('→ building icosahedron') #print('→ building icosahedron')
#os.system("gfortran ../include/icosahedron.f -o "+'${PREFIX}'+"/bin/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