Commit 94cc63b8 authored by Marc Betoule's avatar Marc Betoule
Browse files

switching to waf to build nilc

parent 9a3dc517
# -*- mode: python -*-
def build( bld ):
sources = bld.path.ant_glob('*.cpp', bld=False)
lib = bld.stlib( name = 'spherelib',
source = sources,
target = 'spherelib',
includes = '.',
export_includes = '.',
use = ['HEALPIX'],
vnum = '1.0' )
......@@ -7,8 +7,6 @@ SPHEREINC = '../include'
HEALPIXLIB = '../healpix/spherelib/lib'
HEALPIXINC = '../healpix/spherelib/include'
HEALPIXDATA = '\\\"../healpix/data\\\"'
CFITSIOLIB = '/usr/local/lib'
CFITSIOINC = '/usr/local/include'
CXX = 'g++'
CXXFLAGS = '-w -O3 -fPIC -ffast-math -fopenmp -g0 -s'
......@@ -27,7 +25,7 @@ AddOption('--prefix',
default='/usr/local',
help='installation prefix')
opt = Environment(PREFIX = GetOption('prefix'), CXXFLAGS = CXXFLAGS,LIBS=LIBS, CXX=CXX,CPPDEFINES={'HEALPIXDATA': HEALPIXDATA}, CPPPATH = [SPHERELIB, SPHEREINC, HEALPIXINC,CFITSIOINC],LINKFLAGS=CXXFLAGS, LIBPATH=[SPHERELIB,HEALPIXLIB,CFITSIOLIB,"."] )
opt = Environment(PREFIX = GetOption('prefix'), CXXFLAGS = CXXFLAGS,LIBS=LIBS, CXX=CXX,CPPDEFINES={'HEALPIXDATA': HEALPIXDATA}, CPPPATH = [SPHERELIB, SPHEREINC, HEALPIXINC],LINKFLAGS=CXXFLAGS, LIBPATH=[SPHERELIB,HEALPIXLIB,"."] )
## Build healpix
print('building healpix (this may take a while)')
......
# -*- mode: python -*-
def build( bld ):
sources = bld.path.ant_glob('*.cc')+bld.path.ant_glob('*.cpp')
prog = bld.program(source = sources,
target = "nilc",
includes = [ '.', '../include', '../lib'],
use = 'HEALPIX spherelib GSL',
vnum = '1.0' )
# -*- mode: python; -*-
APPNAME='spherelib'
VERSION='1.0'
......
File added
# -*- mode: python; -*-
import os
import os.path as op
import sys
APPNAME = 'spherelib'
VERSION = '1.0'
top = '.'
out = 'build'
def options( ctx ):
ctx.load('compiler_c')
ctx.load('compiler_cxx')
ctx.add_option('--with-healpix', action='store', help='Path to an existing healpix installation',default=False)
def configure( conf ):
# c compiler
conf.load( 'compiler_c' )
# TODO: why is -fPIC -DPIC not specified by default for gcc ?
# is there a SharedObject() method like in scons ?
conf.env['CCFLAGS'] = [ '-fPIC', '-DPIC', '-g', '-fopenmp' ]
# c++ compiler
conf.load( 'compiler_cxx' )
conf.env.append_value( 'CXXFLAGS', ['-fPIC', '-DPIC', '-g', '-fopenmp'] )
conf.env.append_value( 'LINKFLAGS', ['-fopenmp'] )
# healpix
hp_base_dir = op.abspath(conf.options.with_healpix)
conf.env.INCLUDES_HEALPIX = [op.join(hp_base_dir,'include')]
conf.env.LIBPATH_HEALPIX = [op.join(hp_base_dir,'lib')]
conf.env.LIB_HEALPIX = ['cfitsio']
conf.env.STLIB_HEALPIX = ['healpix_cxx', 'cxxsupport', 'psht', 'c_utils', 'fftpack']
conf.env.DEFINES_HEALPIX = ['HEALPIXDATA="'+op.join(hp_base_dir,'../data"')]
conf.check_cxx(stlib='healpix_cxx', use='HEALPIX')
conf.check_cxx(stlib='cxxsupport', use='HEALPIX')
conf.check_cxx(stlib='psht', use='HEALPIX')
conf.check_cxx(stlib='c_utils', use='HEALPIX')
conf.check_cxx(stlib='fftpack', use='HEALPIX')
# gsl
if conf.find_program( 'gsl-config' ):
conf.check_cfg(path='gsl-config', args='--libs --cflags', uselib_store='GSL',package='')
def build( bld ):
bld.add_subdirs( [ "lib/src",
"nilc",
] )
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