Commit 35653337 authored by Laurent Belcour's avatar Laurent Belcour

Updating the compilation

parent d6e0125c
......@@ -15,7 +15,8 @@ if not os.path.exists(configFile):
#end
vars = Variables(configFile)
vars.Add('CC', 'Compiler')
vars.Add('CXX', 'Compiler')
vars.Add('CCFLAGS', 'Compiler\'s flags')
vars.Add('OPENEXR_INC', 'OpenEXR include directory')
vars.Add('OPENEXR_DIR', 'OpenEXR libraries directory')
vars.Add('OPENEXR_LIBS', 'OpenEXR libraries')
......@@ -23,6 +24,10 @@ vars.Add('CERES_INC', 'CERES include directory')
vars.Add('CERES_DIR', 'CERES libraries directory')
vars.Add('CERES_LIBS', 'CERES libraries')
vars.Add('CERES_OPT_LIBS', 'CERES optional libraries')
vars.Add('NLOPT_INC', 'NLOPT include directory')
vars.Add('NLOPT_DIR', 'NLOPT libraries directory')
vars.Add('NLOPT_LIBS', 'NLOPT libraries')
vars.Add('NLOPT_OPT_LIBS', 'NLOPT optional libraries')
env = Environment(variables = vars)
......
......@@ -9,8 +9,8 @@ import os, sys
## Compilators build flags
##
CC = 'g++'
CC_FLAGS = ['-O3', '-Wall']
CXX = 'g++'
CCFLAGS = ['-O3', '-g', '-Wall', '-m64']
## OpenMP flags
......@@ -35,3 +35,14 @@ CERES_INC = ['#external/build/include']
CERES_DIR = ['#external/build/lib']
CERES_LIBS = ['ceres', 'glog']
CERES_OPT_LIBS = ['gomp', 'lapack', 'blas']
## NlOpt library
##
## You have to specify both the directory of the NlOpt library
## and the glog library
##
NLOPT_INC = ['#external/build/include']
NLOPT_DIR = ['#external/build/lib']
NLOPT_LIBS = ['nlopt']
NLOPT_OPT_LIBS = []
env = Environment()
import os
import sys
## Import configuration from a config file
##
AddOption('--cfg', help='Specify a configuration file (see config.example')
configFile = GetOption('cfg')
if configFile == None:
configFile = '../config.example'
#end
if not os.path.exists(configFile):
print '<<ERROR>> the config file you specified does not exists'
Exit(1)
#end
vars = Variables(configFile)
vars.Add('CXX', 'Compiler')
vars.Add('CCFLAGS', 'Compiler\'s flags')
vars.Add('OPENEXR_INC', 'OpenEXR include directory')
vars.Add('OPENEXR_DIR', 'OpenEXR libraries directory')
vars.Add('OPENEXR_LIBS', 'OpenEXR libraries')
vars.Add('CERES_INC', 'CERES include directory')
vars.Add('CERES_DIR', 'CERES libraries directory')
vars.Add('CERES_LIBS', 'CERES libraries')
vars.Add('CERES_OPT_LIBS', 'CERES optional libraries')
vars.Add('NLOPT_INC', 'NLOPT include directory')
vars.Add('NLOPT_DIR', 'NLOPT libraries directory')
vars.Add('NLOPT_LIBS', 'NLOPT libraries')
vars.Add('NLOPT_OPT_LIBS', 'NLOPT optional libraries')
env = Environment(variables = vars)
## PLATFORM dependant section
##
if sys.platform == 'darwin':
# Adding the /usr/local/lib directory used to store libraries of
# MacPorts or Brew.
env.AppendUnique(LIBPATH = ['/usr/local/lib'])
env.AppendUnique(CPPPATH = ['/usr/local/include'])
env.AppendUnique(LIBPATH = ['/opt/local/lib/'])
env.AppendUnique(CPPPATH = ['/opt/local/include/'])
#end
## COMPILER dependant section
##
if env['CC'] in ['gcc', 'clang'] or env['CXX'] in ['g++', 'clang']:
print '<<INFO>> add -fPIC option to the compiler'
env.AppendUnique(CCFLAGS = '-fPIC')
#end
## Load the configuration file if it exists. The configuration file
## is a python script that updates the env variable with different
## paths.
##
env.AppendUnique(LIBPATH = ['#../external/build/lib'])
env.AppendUnique(LIBPATH = ['#./build'])
env.AppendUnique(CPPPATH = ['#../external/build/include'])
env.AppendUnique(CPPPATH = ['#./'])
## Launch the compilations
##
Export('env')
env.SConscript('SConscript')
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