Commit d9690305 authored by Maude Martin's avatar Maude Martin
Browse files

install planck

parent 7fdea49a
CC= gcc
CCFLAGS_NO_C= -W -Wall -I$(INCDIR) -O2 -g0 -fno-strict-aliasing -fomit-frame-pointer -ffast-math
CCFLAGS= $(CCFLAGS_NO_C) -c
CCFLAGS_NO_C= -W -Wall -I$(INCDIR) -O2 -g0 -fno-strict-aliasing -fomit-frame-pointer -ffast-math -fPIC
CCFLAGS= $(CCFLAGS_NO_C) -c -fPIC
CXX= g++
CXXL= g++
CXXWARNFLAGS= -W -Wall -Wshadow -Wwrite-strings -Wredundant-decls -Woverloaded-virtual -Wcast-qual -Wcast-align -Wpointer-arith -Wconversion -Wold-style-cast -Wno-unknown-pragmas
CXXCFLAGS_NO_C= $(CXXWARNFLAGS) -ansi -I$(INCDIR) -O2 -g0 -ffast-math -fomit-frame-pointer
CXXCFLAGS= $(CXXCFLAGS_NO_C) -c
CXXLFLAGS= -L. -L$(LIBDIR) -ffast-math
CXXCFLAGS_NO_C= $(CXXWARNFLAGS) -ansi -I$(INCDIR) -O2 -g0 -ffast-math -fomit-frame-pointer -fPIC
CXXCFLAGS= $(CXXCFLAGS_NO_C) -c -fPIC
CXXLFLAGS= -L. -L$(LIBDIR) -ffast-math -fPIC
ifeq ($(shell uname),SunOS)
CXX_EXTRALIBS= -lnsl -lsocket
endif
......
......@@ -30,3 +30,4 @@ from bin import *
from alm import *
from utils import *
from cov import *
import myIO
......@@ -28,22 +28,13 @@ def mask2mll(mask, lmax):
----------
mask: array-like, healpix map
lmax: integer, maximum order of analysis
Returns
-------
square matrix (lmax+1, lmax+1).
"""
mll = zeros((lmax+1, lmax+1))
spherelib_map._mask2mll (mask, mll)
# for i in range(lmax+1):
# for j in range(0,i):
# mll[i,j] = mll[j,i]
# for i in range(lmax+1):
# for j in range(lmax+1):
# mll[i,j] = mll[i,j] * (2.0 * j +1.0)
return mll
......@@ -4,9 +4,12 @@ VERSION='1.0'
top = '.'
out = 'build'
def set_options(ctx):
ctx.add_option('--omp', action='store', default=False, help='Openmp compilation')
ctx.add_option('--healpix_target', action='store', default='generic_gcc', help='healpix configuration')
ctx.add_option('--with_gsl', action='store', default='', help='location of gsl')
ctx.add_option('--with_numpy_core', action='store', default='', help='location of numpy core headers')
ctx.tool_options('compiler_cxx')
ctx.tool_options('python')
......@@ -19,6 +22,8 @@ def configure(ctx):
print('→ healpix_target is ' + str(Options.options.healpix_target))
ctx.env['HEALPIX_TARGET'] = str(Options.options.healpix_target)
ctx.env['CXXFLAGS'] = ['-O2']
ctx.env['CXXFLAGS'].append("-I"+str(Options.options.with_gsl)+"/include")
ctx.env['CXXFLAGS'].append("-I"+str(Options.options.with_numpy_core)+"/include")
if Options.options.omp:
ctx.env['CXXFLAGS'].append('-fPIC')
ctx.env['CXXFLAGS'].append('-fopenmp')
......@@ -28,6 +33,10 @@ def configure(ctx):
ctx.check_python_headers()
ctx.check_tool('swig')
ctx.check_tool('compiler_cxx')
ctx.check(header_name=['gsl/gsl_rng.h', 'gsl/gsl_sort_double.h'],compile_mode='cxx', mandatory=True)
ctx.check_cxx(lib=['gsl', 'gslcblas'], libpath=str(Options.options.with_gsl)+"/lib", uselib_store='gsl', mandatory=True)
#ctx.find_file('numpy/arrayobject.h', mandatory=True)
def get_version():
return VERSION
......@@ -52,10 +61,10 @@ def build(bld):
libs = ['gsl', 'gslcblas']
import Options
import os
if bld.env["HEALPIX_TARGET"]=="gcc_omp":
libs.append('gomp')
target=bld.env["HEALPIX_TARGET"]
abspath = bld.root.abspath()
cxx_spherelib = bld(
features = ['cxx', 'cshlib'],
......@@ -66,35 +75,37 @@ def build(bld):
defines = ['HEALPIXDATA=\''+bld.root.abspath()+'../healpix/data/\''],
ccflags = bld.env['CXXFLAGS'],
lib = libs,
staticlib = ['cxxsupport', 'cfitsio', 'fftpack', 'healpix_cxx'],
staticlibpath = ['../healpix/'+target+'lib'],
uselib = libs,
libpath = [os.path.abspath('../healpix/'+target+'/lib')],
staticlib = [ 'cxxsupport', 'cfitsio', 'fftpack', 'healpix_cxx'],
name = 'spherelib'
)
cxx_spherelib.install_path = '${PREFIX}/lib'
swig_spherelib_map = bld(
features = 'cxx cshlib pyext',
includes = ['spherelib', '../include', '../lib/src'],
includes = ['../lib/src', '../healpix/'+target+'/include','spherelib',
'../include', '../lib/src'],
source = ['spherelib/spherelib_map.i','spherelib/spherelib_map.cpp'],
defines = ['HEALPIXDATA=\''+bld.root.abspath()+'../healpix/data/\''],
target = '_spherelib_map',
#defines = ['HEALPIXDATA=\"'+abspath+'../healpix/data/\"'],
defines = ['HEALPIXDATA=\"/home/lejeune/Soft/Healpix_2.14a/data/\"'],
swig_flags = '-c++ -python -Wall',
lib = libs,
libpath = [os.path.abspath('../healpix/'+target+'/lib')],
staticlib = ['cxxsupport', 'cfitsio', 'fftpack', 'healpix_cxx'],
staticlibpath = ['../healpix/'+target+'lib'],
uselib_local = 'spherelib')
swig_spherelib_alm = bld(
features = 'cxx cshlib pyext',
includes = ['spherelib', '../include', '../lib/src'],
includes = ['../lib/src', '../healpix/'+target+'/include','spherelib',
'../include', '../lib/src'],
source = ['spherelib/spherelib_alm.i','spherelib/spherelib_alm.cpp'],
target = '_spherelib_alm',
defines = ['HEALPIXDATA=\''+bld.root.abspath()+'../healpix/data/\''],
swig_flags = '-c++ -python -Wall',
lib = libs,
libpath = [os.path.abspath('../healpix/'+target+'/lib')],
staticlib = ['cxxsupport', 'cfitsio', 'fftpack', 'healpix_cxx'],
staticlibpath = ['../healpix/'+target+'lib'],
uselib_local = 'spherelib')
swig_spherelib_map.install_path = '${PYTHONDIR}/spherelib'
......
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