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

use lib, permissive, swig version, prefix .py

parent b25895b1
......@@ -21,10 +21,13 @@ def configure(ctx):
import Options
ctx.env['CXXFLAGS'] = ['-O2']
ctx.find_program(['swig'], mandatory=True)
ctx.check_tool('g++ python')
ctx.check_tool( 'python' )
ctx.check_python_headers()
ctx.check_tool('swig')
if ctx.check_swig_version() < (1, 3, 40):
ctx.fatal('this swig version is too old')
ctx.check_tool('compiler_cxx')
print('→ find healpix from healpix_prefix')
......@@ -38,7 +41,7 @@ def configure(ctx):
print('→ find cfitsio from cfitsio_prefix')
ctx.env["CFITSIO_PREFIX"] = str(Options.options.cfitsio_prefix)
ctx.env["CFITSIO_EXT_LIB"] = ctx.env["CFITSIO_PREFIX"]+'/lib'
ctx.env["CFITSIO_EXT_INC"] = ctx.env["CFITSIO_PREFIX"]+'/include/cfitsio'
ctx.env["CFITSIO_EXT_INC"] = ctx.env["CFITSIO_PREFIX"]+'/include'#/cfitsio'
ctx.env['CXXFLAGS'].append("-I"+ctx.env["CFITSIO_EXT_INC"])
ctx.check(header_name=['fitsio.h'],compile_mode='cxx', mandatory=True)
ctx.check_cxx(lib=['cfitsio'], libpath=ctx.env["CFITSIO_EXT_LIB"], uselib_store='cfitsio', mandatory=True)
......@@ -48,7 +51,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)
......@@ -88,6 +91,7 @@ def build(bld):
libpath = [bld.env["CFITSIO_EXT_LIB"]],
stlib = stlibs,
stlibpath =[bld.env["HEALPIX_EXT_LIB"]],
uselib = ["gsl", "fftw3"],
name = 'spherelib'
)
cxx_spherelib.install_path = '${PREFIX}/lib'
......@@ -104,6 +108,7 @@ def build(bld):
libpath = [bld.env["CFITSIO_EXT_LIB"]],
stlib = stlibs,
stlibpath =[bld.env["HEALPIX_EXT_LIB"]],
uselib = ["gsl", "fftw3"],
name = 'libatlas'
)
cxx_atlas.install_path = '${PREFIX}/lib'
......@@ -121,7 +126,9 @@ def build(bld):
libpath = [bld.env["CFITSIO_EXT_LIB"]],
stlib = stlibs,
stlibpath =[bld.env["HEALPIX_EXT_LIB"]],
use = ['spherelib', 'libatlas']
use = ['spherelib', 'libatlas', "gsl", "fftw3"],
prefix = bld.env['PREFIX'],
exec_prefix = '${prefix}',
)
swig_spherelib_alm = bld(features = 'cxx cshlib pyext',
includes = ['../lib/src', bld.env["HEALPIX_EXT_INC"],'spherelib',
......@@ -159,6 +166,11 @@ def build(bld):
source_files = bld.path.ant_glob('spherelib/*.py')
obj = bld(features = 'py', source=source_files)
obj.install_path = '${PYTHONDIR}/spherelib'
## in case where swig generate .py files in the build directory
source_files = bld.path.ant_glob('build/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