Commit 3eb82600 authored by Laurent Belcour's avatar Laurent Belcour

Updating the SConscripts a bit. Updating the documentation.

parent 3f7437c1
......@@ -91,10 +91,10 @@ env.AppendUnique(CPPPATH = ['#sources'])
##
Export('env')
if not env.GetOption('help'):
external = env.SConscript('external/SConscript')
external = env.SConscript('external/SConscript')
sources = env.SConscript('sources/SConscript')
#env.Depends(sources, external)
#end
core = env.SConscript('sources/core/SConscript')
plugins = env.SConscript('sources/plugins/SConscript')
softs = env.SConscript('sources/softs/SConscript')
#sources = env.SConscript('sources/SConscript')
#env.Depends(sources, external)
......@@ -101,7 +101,7 @@ Using scons, the compilation of ALTA is straightforward:
\verbatim
$ cd $ALTA
$ scons --cfg [filename] -i
$ scons --cfg=[filename]
\endverbatim
You need to provide a system dependant configuration file. You will find
......
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('LINKFLAGS', 'Linker\'s flags')
vars.Add('OPENEXR_INC', 'OpenEXR include directory')
vars.Add('OPENEXR_DIR', 'OpenEXR libraries directory')
vars.Add('OPENEXR_LIBS', 'OpenEXR libraries')
vars.Add('OPENMP_FLAGS', 'OpenMP required flags')
vars.Add('OPENMP_LIBS', 'OpenMP libraries')
vars.Add('QUADPROG_INC', 'QUADPROG include directory')
vars.Add('QUADPROG_DIR', 'QUADPROG libraries directory')
vars.Add('QUADPROG_LIBS', 'QUADPROG 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')
vars.Add('MATLAB_INC', 'MATLAB include directory')
vars.Add('MATLAB_DIR', 'MATLAB directory')
vars.Add('MATLAB_LIBS', 'MATLAB 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')
......@@ -2,6 +2,7 @@ import os
import sys
Import('env')
env = env.Clone()
# Library sources
sources = ['common.cpp',
......@@ -11,18 +12,16 @@ sources = ['common.cpp',
'rational_function.cpp',
'vertical_segment.cpp']
libs = []
if(os.name == 'posix'):
libs = ['rt', 'dl']
env.AppendUnique(LIBS = ['rt', 'dl'])
#end
## Known compilation issue. If the core is not compiled with -fvisibility-hidden
## on OSX, the shared libraries and the softwares cannot share vtables. This
## impact the use of dynamic_cast in shared libraries.
##
ccflags = []
if sys.platform == 'darwin':
ccflags = ['-fvisibility=hidden']
env.AppendUnique(CCFLAGS = '-fvisibility=hidden')
#end
env.StaticLibrary('../build/core', sources, LIBS=libs, CCFLAGS=ccflags)
env.StaticLibrary('../build/core', sources)
\ No newline at end of file
......@@ -3,7 +3,7 @@ SConscript('data_merl/SConscript')
SConscript('data_brdf_slice/SConscript')
SConscript('data_interpolant/SConscript')
# Building nonlinear fitters
# # Building nonlinear fitters
SConscript('nonlinear_fitter_ceres/SConscript')
SConscript('nonlinear_fitter_nlopt/SConscript')
SConscript('nonlinear_fitter_ipopt/SConscript')
......
env = Environment()
env.Append(CPPPATH = ['../../../external/build/include', '../../'])
env.Append(LIBPATH = ['../../../external/build/lib', '../../build'])
Import('env')
env = env.Clone()
sources = ['function.cpp']
libs = ['core']
......
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