Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit 555ba3c2 authored by Laurent Belcour's avatar Laurent Belcour
Browse files

Updating the configuration files and main SCons scripts

parent 85bd3f57
......@@ -11,7 +11,7 @@ AddOption('--cfg', help='Specify a configuration file (see config.example')
configFile = GetOption('cfg')
if configFile == None:
print '<<ERROR>> You need to specify a configuration file using:'
print '<<ERROR>> scons --cfg [filename]'
print '<<ERROR>> scons --cfg=[filename]'
print '<<ERROR>> Please find example of configuration files in ${ALTA}/configs/scons/'
Exit(1)
#end
......@@ -25,29 +25,35 @@ vars = Variables(configFile)
vars.Add('CXX', 'Compiler')
vars.Add('CCFLAGS', 'Compiler\'s flags')
vars.Add('LINKFLAGS', 'Linker\'s flags')
vars.Add('CORE_LIB', 'Special links for ALTA core')
vars.Add('SOFT_LIB', 'Special links for ALTA soft')
vars.Add('PLUGIN_LIB', 'Special links for ALTA plugin')
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('OPENEXR_LIB', 'OpenEXR libraries')
vars.Add('FLANN_INC', 'FLANN include directory')
vars.Add('FLANN_DIR', 'FLANN libraries directory')
vars.Add('FLANN_LIB', 'FLANN libraries')
vars.Add('OPENMP_FLAG', 'OpenMP required flags')
vars.Add('OPENMP_LIB', 'OpenMP libraries')
vars.Add('QUADPROG_INC', 'QUADPROG include directory')
vars.Add('QUADPROG_DIR', 'QUADPROG libraries directory')
vars.Add('QUADPROG_LIBS', 'QUADPROG libraries')
vars.Add('QUADPROG_LIB', '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('CERES_LIB', 'CERES libraries')
vars.Add('CERES_OPT_LIB', '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('NLOPT_LIB', 'NLOPT libraries')
vars.Add('NLOPT_OPT_LIB', 'NLOPT optional libraries')
vars.Add('IPOPT_INC', 'IPOPT include directory')
vars.Add('IPOPT_DIR', 'IPOPT libraries directory')
vars.Add('IPOPT_LIBS', 'IPOPT libraries')
vars.Add('IPOPT_OPT_LIBS', 'IPOPT optional libraries')
vars.Add('IPOPT_LIB', 'IPOPT libraries')
vars.Add('IPOPT_OPT_LIB', 'IPOPT optional libraries')
vars.Add('MATLAB_INC', 'MATLAB include directory')
vars.Add('MATLAB_DIR', 'MATLAB directory')
vars.Add('MATLAB_LIBS', 'MATLAB libraries')
vars.Add('MATLAB_LIB', 'MATLAB libraries')
env = Environment(variables = vars)
......@@ -71,7 +77,6 @@ if sys.platform == 'darwin':
## 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
......@@ -83,18 +88,18 @@ if env['CC'] in ['gcc', 'clang'] or env['CXX'] in ['g++', 'clang']:
env.AppendUnique(LIBPATH = ['#external/build/lib'])
env.AppendUnique(LIBPATH = ['#sources/build'])
env.AppendUnique(CPPPATH = ['#external/build/include'])
env.AppendUnique(CPPPATH = ['#external/build/include/Eigen'])
env.AppendUnique(CPPPATH = ['#sources'])
## Launch the compilations
##
##l
Export('env')
external = env.SConscript('external/SConscript')
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)
#env.Depends(sources, external)
\ No newline at end of file
......@@ -10,30 +10,44 @@ import os, sys
## Compilators build flags
##
CXX = 'g++'
CCFLAGS = ['-O3', '-Wall', '-m64']
CCFLAGS = ['-g', '-Wall', '-m64']
LINKFLAGS = []
## ALTA internal flags
##
CORE_LIB = ['rt', 'dl']
SOFT_LIB = ['core', 'rt', 'dl']
PLUGIN_LIB = ['core']
## OpenMP flags
##
OPENMP_FLAGS = ['-fopenmp']
OPENMP_LIBS = ['gomp']
OPENMP_FLAG = ['-fopenmp']
OPENMP_LIB = ['gomp']
## OpenEXR library
##
OPENEXR_INC = ['/usr/include/OpenEXR']
OPENEXR_DIR = ['/usr/lib']
OPENEXR_DIR = ['/usr/lib/x86_64_linux-gnu']
OPENEXR_LIB = ['Half', 'IlmImf', 'IlmThread']
## FLANN library
##
FLANN_INC = ['/usr/include/flann']
FLANN_DIR = ['/usr/lib/x86_64_linux-gnu']
FLANN_LIB = ['flann']
## QUADPROG library
##
## You have to specify the directory of the QuadProg library
##
QUADPROG_INC = ['#external/quadprog++']
QUADPROG_DIR = ['#external/build/lib']
QUADPROG_LIBS = ['quadprog++']
QUADPROG_LIB = ['quadprog++']
## CERES library
......@@ -43,8 +57,8 @@ QUADPROG_LIBS = ['quadprog++']
##
CERES_INC = ['#external/build/include']
CERES_DIR = ['#external/build/lib']
CERES_LIBS = ['ceres', 'glog']
CERES_OPT_LIBS = ['gomp', 'lapack', 'blas']
CERES_LIB = ['ceres', 'glog']
CERES_OPT_LIB = ['gomp', 'lapack', 'blas']
## NlOpt library
......@@ -53,8 +67,8 @@ CERES_OPT_LIBS = ['gomp', 'lapack', 'blas']
##
NLOPT_INC = ['#external/build/include']
NLOPT_DIR = ['#external/build/lib']
NLOPT_LIBS = ['nlopt']
NLOPT_OPT_LIBS = []
NLOPT_LIB = ['nlopt']
NLOPT_OPT_LIB = []
## coin IpOpt library
......@@ -63,12 +77,12 @@ NLOPT_OPT_LIBS = []
##
IPOPT_INC = ['#external/build/include']
IPOPT_DIR = ['#external/build/lib']
IPOPT_LIBS = ['ipopt']
IPOPT_OPT_LIBS = []
IPOPT_LIB = ['ipopt']
IPOPT_OPT_LIB = []
## MATLAB library and Engine
##
#MATLAB_INC = ['/Applications/MATLAB_R2014a.app/extern/include/']
#MATLAB_DIR = ['/Applications/MATLAB_R2014a.app/bin/maci64/']
#MATLAB_LIBS = ['eng', 'mex','mat']
MATLAB_INC = ['/Applications/MATLAB_R2014a.app/extern/include/']
MATLAB_DIR = ['/Applications/MATLAB_R2014a.app/bin/maci64/']
MATLAB_LIB = ['eng', 'mex','mat']
......@@ -14,17 +14,31 @@ CCFLAGS = ['-O3', '-Wall', '-m64']
LINKFLAGS = []
## ALTA internal flags
##
CORE_LIB = ['dl']
SOFT_LIB = ['core', 'dl']
PLUGINS_LIB = ['core']
## OpenMP flags
##
OPENMP_FLAGS = []
OPENMP_LIBS = []
OPENMP_FLAG = []
OPENMP_LIB = []
## OpenEXR library
##
#OPENEXR_INC = ['/usr/include/OpenEXR']
#OPENEXR_DIR = ['/usr/lib']
#OPENEXR_LIB = ['Half', 'IlmImf', 'IlmThread']
OPENEXR_INC = ['/usr/include/OpenEXR']
OPENEXR_DIR = ['/usr/lib']
OPENEXR_LIB = ['Half', 'IlmImf', 'IlmThread']
## FLANN library
##
FLANN_INC = ['/usr/include/flann']
FLANN_DIR = ['/usr/lib/x86_64_linux-gnu']
FLANN_LIB = ['flann']
## QUADPROG library
......@@ -33,7 +47,7 @@ OPENMP_LIBS = []
##
QUADPROG_INC = ['#external/quadprog++']
QUADPROG_DIR = ['#external/build/lib']
QUADPROG_LIBS = ['quadprog++']
QUADPROG_LIB = ['quadprog++']
## CERES library
......@@ -43,8 +57,8 @@ QUADPROG_LIBS = ['quadprog++']
##
CERES_INC = ['#external/build/include']
CERES_DIR = ['#external/build/lib']
CERES_LIBS = ['ceres', 'glog']
CERES_OPT_LIBS = ['gomp', 'lapack', 'blas']
CERES_LIB = ['ceres', 'glog']
CERES_OPT_LIB = ['gomp', 'lapack', 'blas']
## NlOpt library
......@@ -53,8 +67,8 @@ CERES_OPT_LIBS = ['gomp', 'lapack', 'blas']
##
NLOPT_INC = ['#external/build/include']
NLOPT_DIR = ['#external/build/lib']
NLOPT_LIBS = ['nlopt']
NLOPT_OPT_LIBS = []
NLOPT_LIB = ['nlopt']
NLOPT_OPT_LIB = []
## coin IpOpt library
......@@ -63,12 +77,12 @@ NLOPT_OPT_LIBS = []
##
IPOPT_INC = ['#external/build/include']
IPOPT_DIR = ['#external/build/lib']
IPOPT_LIBS = ['ipopt']
IPOPT_OPT_LIBS = []
IPOPT_LIB = ['ipopt']
IPOPT_OPT_LIB = []
## MATLAB library and Engine
##
MATLAB_INC = ['/Applications/MATLAB_R2014a.app/extern/include/']
MATLAB_DIR = ['/Applications/MATLAB_R2014a.app/bin/maci64/']
MATLAB_LIBS = ['eng', 'mex','mat']
MATLAB_LIB = ['eng', 'mex','mat']
......@@ -14,17 +14,31 @@ CCFLAGS = ['-O3', '-Wall', '-m64']
LINKFLAGS = []
## ALTA internal flags
##
CORE_LIBS = ['dl']
SOFT_LIBS = ['core', 'dl']
PLUGINS_LIB = ['core']
## OpenMP flags
##
OPENMP_FLAGS = ['-fopenmp']
OPENMP_LIBS = ['gomp']
OPENMP_FLAG = ['-fopenmp']
OPENMP_LIB = ['gomp']
## OpenEXR library
##
#OPENEXR_INC = ['/usr/include/OpenEXR']
#OPENEXR_DIR = ['/usr/lib']
#OPENEXR_LIB = ['Half', 'IlmImf', 'IlmThread']
OPENEXR_INC = ['/usr/include/OpenEXR']
OPENEXR_DIR = ['/usr/lib']
OPENEXR_LIB = ['Half', 'IlmImf', 'IlmThread']
## FLANN library
##
FLANN_INC = ['/usr/include/flann']
FLANN_DIR = ['/usr/lib/x86_64_linux-gnu']
FLANN_LIB = ['flann']
## QUADPROG library
......@@ -33,7 +47,7 @@ OPENMP_LIBS = ['gomp']
##
QUADPROG_INC = ['#external/quadprog++']
QUADPROG_DIR = ['#external/build/lib']
QUADPROG_LIBS = ['quadprog++']
QUADPROG_LIB = ['quadprog++']
## CERES library
......@@ -43,8 +57,8 @@ QUADPROG_LIBS = ['quadprog++']
##
CERES_INC = ['#external/build/include']
CERES_DIR = ['#external/build/lib']
CERES_LIBS = ['ceres', 'glog']
CERES_OPT_LIBS = ['gomp', 'lapack', 'blas']
CERES_LIB = ['ceres', 'glog']
CERES_OPT_LIB = ['gomp', 'lapack', 'blas']
## NlOpt library
......@@ -53,8 +67,8 @@ CERES_OPT_LIBS = ['gomp', 'lapack', 'blas']
##
NLOPT_INC = ['#external/build/include']
NLOPT_DIR = ['#external/build/lib']
NLOPT_LIBS = ['nlopt']
NLOPT_OPT_LIBS = []
NLOPT_LIB = ['nlopt']
NLOPT_OPT_LIB = []
## coin IpOpt library
......@@ -63,12 +77,12 @@ NLOPT_OPT_LIBS = []
##
IPOPT_INC = ['#external/build/include']
IPOPT_DIR = ['#external/build/lib']
IPOPT_LIBS = ['ipopt']
IPOPT_OPT_LIBS = []
IPOPT_LIB = ['ipopt']
IPOPT_OPT_LIB = []
## MATLAB library and Engine
##
MATLAB_INC = ['/Applications/MATLAB_R2014a.app/extern/include/']
MATLAB_DIR = ['/Applications/MATLAB_R2014a.app/bin/maci64/']
MATLAB_LIBS = ['eng', 'mex','mat']
MATLAB_LIB = ['eng', 'mex','mat']
......@@ -12,9 +12,8 @@ sources = ['common.cpp',
'rational_function.cpp',
'vertical_segment.cpp']
if(os.name == 'posix'):
env.AppendUnique(LIBS = ['rt', 'dl'])
#end
# Special linking flags, defined in the OS dependant configuration file
env.AppendUnique(env['CORE_LIB'])
## Known compilation issue. If the core is not compiled with -fvisibility-hidden
## on OSX, the shared libraries and the softwares cannot share vtables. This
......
# Building datas
# Building data plugins
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', '../../', '/usr/include/OpenEXR/'])
env.Append(LIBPATH = ['../../build'])
Import('env')
env = env.Clone()
conf = Configure(env)
if conf.CheckLib('IlmImf') and conf.CheckLib('IlmThread'):
if conf.CheckLib(env['OPENEXR_LIB']):
env.AppendUnique(LIBS = env['PLUGIN_LIB'])
env.AppendUnique(LIBS = env['OPENEXR_LIB'])
env.AppendUnique(LIBPATH = env['OPENEXR_DIR'])
env.AppendUnique(CPPPATH = env['OPENEXR_INC'])
sources = ['data.cpp']
libs = ['core', 'Half', 'IlmImf', 'IlmThread']
env.SharedLibrary('../../build/data_brdf_slice', sources, LIBS=libs)
env.SharedLibrary('../../build/data_brdf_slice', sources)
#end
env = conf.Finish()
env = Environment()
env.Append(CPPPATH = ['../../../external/build/include', '../../'])
env.Append(LIBPATH = ['../../build'])
Import('env')
env = env.Clone()
conf = Configure(env)
if conf.CheckLib('flann'):
if conf.CheckLib(env['FLANN_LIB']):
env.AppendUnique(LIBS = env['PLUGIN_LIB'])
env.AppendUnique(LIBS = env['FLANN_LIB'])
env.AppendUnique(LIBPATH = env['FLANN_DIR'])
env.AppendUnique(CPPPATH = env['FLANN_INC'])
sources = ['data.cpp']
libs = ['flann', 'core']
env.SharedLibrary('../../build/data_interpolant', sources, LIBS=libs)
env.SharedLibrary('../../build/data_interpolant', sources)
#end
env = conf.Finish()
env = Environment()
env.Append(CPPPATH = ['../../../external/build/include', '../../'])
env.Append(LIBPATH = ['../../build'])
Import('env')
env = env.Clone()
# Special linking flags, defined in the OS dependant configuration file
env.AppendUnique(LIBS = env['PLUGIN_LIB'])
sources = ['data.cpp']
libs = ['core']
env.SharedLibrary('../../build/data_merl', sources, LIBS=libs)
env.SharedLibrary('../../build/data_merl', sources)
\ No newline at end of file
Import('env')
env = env.Clone()
#env.AppendUnique(CPPPATH = ['../../../external/build/include', '../../'])
#env.AppendUnique(LIBPATH = ['../../../external/build/lib', '../../build'])
sources = ['fitter.cpp']
libs = ['ceres', 'glog', 'core']
conf = Configure(env)
# Main dependencies of the CERES plugins: CEREs and GLOG
# GOMP, LAPACK and BLAS are also tested and added if found. If not
# CERES might not have been compiled with those dependencies.
if conf.CheckLib('ceres') and conf.CheckLib('glog'):
if conf.CheckLib('gomp'):
libs.append('gomp')
#end
if conf.CheckLib('lapack'):
libs.append('lapack')
#end
if conf.CheckLib('blas'):
libs.append('blas')
#end
if conf.CheckLib('cxsparse'):
libs.append('cxsparse')
#end
if conf.CheckLib(env['CERES_LIB']):
if conf.CheckLib('cholmod'):
libs.append('cholmod')
env.AppendUnique(LIBS = env['PLUGIN_LIB'])
env.AppendUnique(LIBS = env['CERES_LIB'])
env.AppendUnique(LIBPATH = env['CERES_DIR'])
env.AppendUnique(CPPPATH = env['CERES_INC'])
if conf.CheckLib(env['CERES_OPT_LIB']):
env.AppendUnique(LIBS = env['CERES_OPT_LIB'])
#end
if conf.CheckLib('amd'):
libs.append('amd')
#end
if conf.CheckLib('camd'):
libs.append('camd')
#end
if conf.CheckLib('colamd'):
libs.append('colamd')
#end
if conf.CheckLib('ccolamd'):
libs.append('ccolamd')
#end
if conf.CheckLib('ldl'):
libs.append('ldl')
#end
env.SharedLibrary('../../build/nonlinear_fitter_ceres', sources, LIBS=libs)
sources = ['fitter.cpp']
env.SharedLibrary('../../build/nonlinear_fitter_ceres', sources)
#end
env = conf.Finish()
env = conf.Finish()
\ No newline at end of file
env = Environment()
env.Append(CPPPATH = ['../../../external/build/include', '../../../external/build/include/Eigen', '../../'])
env.Append(LIBPATH = ['../../build'])
Import('env')
env = env.Clone()
env.AppendUnique(LIBS = env['PLUGIN_LIB'])
sources = ['fitter.cpp']
libs = ['core']
env.SharedLibrary('../../build/nonlinear_fitter_eigen', sources, LIBS=libs)
env.SharedLibrary('../../build/nonlinear_fitter_eigen', sources)
\ No newline at end of file
Import('env')
env = env.Clone()
sources = ['fitter.cpp']
libs = ['core'] + env['IPOPT_LIBS']
env.AppendUnique(CPPPATH = env['IPOPT_INC'])
env.AppendUnique(LIBPATH = env['IPOPT_DIR'])
conf = Configure(env)
# Main dependencies of the CERES plugins: CEREs and GLOG
# GOMP, LAPACK and BLAS are also tested and added if found. If not
# CERES might not have been compiled with those dependencies.
if conf.CheckLib(env['IPOPT_LIBS']):
if len(env['IPOPT_OPT_LIBS']) > 0 and conf.CheckLib(env['IPOPT_OPT_LIBS']):
libs.append(env['IPOPT_OPT_LIBS'])
if conf.CheckLib(env['IPOPT_LIB']):
env.AppendUnique(LIBS = env['PLUGIN_LIB'])
env.AppendUnique(LIBS = env['IPOPT_LIB'])
env.AppendUnique(LIBPATH = env['IPOPT_DIR'])
env.AppendUnique(CPPPATH = env['IPOPT_INC'])
if conf.CheckLib(env['IPOPT_OPT_LIB']):
env.AppendUnique(LIBS = env['IPOPT_OPT_LIB'])
#end
env.SharedLibrary('../../build/nonlinear_fitter_ipopt', sources, LIBS=libs)
sources = ['fitter.cpp']
env.SharedLibrary('../../build/nonlinear_fitter_ipopt', sources)
#end
env = conf.Finish()
env = conf.Finish()
\ No newline at end of file
Import('env')
env = env.Clone()
env.AppendUnique(CPPPATH = ['../../../external/build/include', '../../'])
env.AppendUnique(LIBPATH = ['../../../external/build/lib', '../../build'])
conf = Configure(env)
sources = ['fitter.cpp']
libs = ['nlopt', 'core']
if conf.CheckLib(env['NLOPT_LIB']):
conf = Configure(env)
if conf.CheckLib('nlopt'):
env.AppendUnique(LIBS = env['PLUGIN_LIB'])
env.AppendUnique(LIBS = env['NLOPT_LIB'])
env.AppendUnique(LIBPATH = env['NLOPT_DIR'])
env.AppendUnique(CPPPATH = env['NLOPT_INC'])
if conf.CheckLib(env['NLOPT_OPT_LIB']):
env.AppendUnique(LIBS = env['NLOPT_OPT_LIB'])
#end
sources = ['fitter.cpp']
env.SharedLibrary('../../build/nonlinear_fitter_nlopt', sources)
env.SharedLibrary('../../build/nonlinear_fitter_nlopt', sources, LIBS=libs)
#end
env = conf.Finish()
env = conf.Finish()
\ No newline at end of file
Import('env')
env = env.Clone()
env.AppendUnique(CPPPATH = env['MATLAB_INC'])
env.AppendUnique(LIBPATH = env['MATLAB_DIR'])
env.AppendUnique(LIBS = env['MATLAB_LIBS'])
env.AppendUnique(LIBS = ['core'])
conf = Configure(env)
sources = ['rational_fitter.cpp']
if conf.CheckLib(env['MATLAB_LIB']):
env.AppendUnique(CPPPATH = env['MATLAB_INC'])
env.AppendUnique(LIBPATH = env['MATLAB_DIR'])
env.AppendUnique(LIBS = env['MATLAB_LIB'])
env.AppendUnique(LIBS = env['PLUGIN_LIB'])
if conf.CheckLib(env['MATLAB_LIBS']):
sources = ['rational_fitter.cpp']
env.SharedLibrary('../../build/rational_fitter_matlab', sources)
#end
conf.Finish()