Commit c61e666e authored by Laurent Belcour's avatar Laurent Belcour
Browse files

Configuration scripts for scons are working under OSX AFAIK.

parent 10560b87
...@@ -97,7 +97,7 @@ env.AppendUnique(CPPPATH = ['#sources']) ...@@ -97,7 +97,7 @@ env.AppendUnique(CPPPATH = ['#sources'])
##l ##l
Export('env') Export('env')
#external = env.SConscript('external/SConscript') external = env.SConscript('external/SConscript')
core = env.SConscript('sources/core/SConscript') core = env.SConscript('sources/core/SConscript')
plugins = env.SConscript('sources/plugins/SConscript') plugins = env.SConscript('sources/plugins/SConscript')
softs = env.SConscript('sources/softs/SConscript') softs = env.SConscript('sources/softs/SConscript')
......
...@@ -19,8 +19,8 @@ env.AppendUnique(env['CORE_LIB']) ...@@ -19,8 +19,8 @@ env.AppendUnique(env['CORE_LIB'])
## on OSX, the shared libraries and the softwares cannot share vtables. This ## on OSX, the shared libraries and the softwares cannot share vtables. This
## impact the use of dynamic_cast in shared libraries. ## impact the use of dynamic_cast in shared libraries.
## ##
#if sys.platform == 'darwin': if sys.platform == 'darwin':
# env.AppendUnique(CCFLAGS = '-fvisibility=hidden') env.AppendUnique(CCFLAGS = '-fvisibility=hidden')
#end #end
env.StaticLibrary('../build/core', sources) env.StaticLibrary('../build/core', sources)
# Building data plugins # # Building data plugins
SConscript('data_merl/SConscript') SConscript('data_merl/SConscript')
SConscript('data_brdf_slice/SConscript') SConscript('data_brdf_slice/SConscript')
SConscript('data_interpolant/SConscript') SConscript('data_interpolant/SConscript')
# Building nonlinear fitters # # Building nonlinear fitters
SConscript('nonlinear_fitter_ceres/SConscript') SConscript('nonlinear_fitter_ceres/SConscript')
SConscript('nonlinear_fitter_nlopt/SConscript') SConscript('nonlinear_fitter_nlopt/SConscript')
SConscript('nonlinear_fitter_ipopt/SConscript') SConscript('nonlinear_fitter_ipopt/SConscript')
...@@ -19,7 +19,7 @@ SConscript('nonlinear_function_isotropic_lafortune/SConscript') ...@@ -19,7 +19,7 @@ SConscript('nonlinear_function_isotropic_lafortune/SConscript')
# Building nonlinear masking functions # Building nonlinear masking functions
SConscript('nonlinear_shadowing_smith/SConscript') SConscript('nonlinear_shadowing_smith/SConscript')
# Building rational fitters # # Building rational fitters
SConscript('rational_fitter_eigen/SConscript') SConscript('rational_fitter_eigen/SConscript')
SConscript('rational_fitter_leastsquare/SConscript') SConscript('rational_fitter_leastsquare/SConscript')
SConscript('rational_fitter_quadprog/SConscript') SConscript('rational_fitter_quadprog/SConscript')
...@@ -27,7 +27,7 @@ SConscript('rational_fitter_parallel/SConscript') ...@@ -27,7 +27,7 @@ SConscript('rational_fitter_parallel/SConscript')
SConscript('rational_fitter_matlab/SConscript') SConscript('rational_fitter_matlab/SConscript')
# Building rational functions # # Building rational functions
SConscript('rational_function_legendre/SConscript') SConscript('rational_function_legendre/SConscript')
SConscript('rational_function_chebychev/SConscript') SConscript('rational_function_chebychev/SConscript')
SConscript('rational_function_chebychev_opt/SConscript') SConscript('rational_function_chebychev_opt/SConscript')
......
Import('env') Import('env')
env = env.Clone() env = env.Clone()
env.AppendUnique(LIBS = env['PLUGIN_LIB'])
env.AppendUnique(LIBS = env['OPENEXR_LIB'])
env.AppendUnique(LIBPATH = env['OPENEXR_DIR'])
env.AppendUnique(CPPPATH = env['OPENEXR_INC'])
build_lib = False
conf = Configure(env) conf = Configure(env)
if conf.CheckLib(env['OPENEXR_LIB']): if conf.CheckLib(env['OPENEXR_LIB']):
env.AppendUnique(LIBS = env['PLUGIN_LIB']) build_lib = True
env.AppendUnique(LIBS = env['OPENEXR_LIB'])
env.AppendUnique(LIBPATH = env['OPENEXR_DIR'])
env.AppendUnique(CPPPATH = env['OPENEXR_INC'])
sources = ['data.cpp']
env.SharedLibrary('../../build/data_brdf_slice', sources)
#end #end
env = conf.Finish() env = conf.Finish()
sources = ['data.cpp']
env.SharedLibrary('../../build/data_brdf_slice', sources)
Import('env') Import('env')
env = env.Clone() env = env.Clone()
env.AppendUnique(LIBS = env['PLUGIN_LIB'])
env.AppendUnique(LIBS = env['FLANN_LIB'])
env.AppendUnique(LIBPATH = env['FLANN_DIR'])
env.AppendUnique(CPPPATH = env['FLANN_INC'])
build_lib = False
conf = Configure(env) conf = Configure(env)
if conf.CheckLibWithHeader(env['FLANN_LIB'], 'flann/flann.hpp', 'CXX'): if conf.CheckLibWithHeader(env['FLANN_LIB'], 'flann/flann.hpp', 'CXX'):
env.AppendUnique(LIBS = env['PLUGIN_LIB']) build_lib = True
env.AppendUnique(LIBS = env['FLANN_LIB'])
env.AppendUnique(LIBPATH = env['FLANN_DIR'])
env.AppendUnique(CPPPATH = env['FLANN_INC'])
#end
env = conf.Finish()
if build_lib:
sources = ['data.cpp'] sources = ['data.cpp']
env.SharedLibrary('../../build/data_interpolant', sources) env.SharedLibrary('../../build/data_interpolant', sources)
#end #end
\ No newline at end of file
env = conf.Finish()
...@@ -6,6 +6,8 @@ env.AppendUnique(LIBS = env['CERES_LIB']) ...@@ -6,6 +6,8 @@ env.AppendUnique(LIBS = env['CERES_LIB'])
env.AppendUnique(LIBPATH = env['CERES_DIR']) env.AppendUnique(LIBPATH = env['CERES_DIR'])
env.AppendUnique(CPPPATH = env['CERES_INC']) env.AppendUnique(CPPPATH = env['CERES_INC'])
build_lib = False
conf = Configure(env) conf = Configure(env)
if conf.CheckLibWithHeader(env['CERES_LIB'], 'ceres/ceres.h', 'c++'): if conf.CheckLibWithHeader(env['CERES_LIB'], 'ceres/ceres.h', 'c++'):
...@@ -14,9 +16,12 @@ if conf.CheckLibWithHeader(env['CERES_LIB'], 'ceres/ceres.h', 'c++'): ...@@ -14,9 +16,12 @@ if conf.CheckLibWithHeader(env['CERES_LIB'], 'ceres/ceres.h', 'c++'):
env.AppendUnique(LIBS = env['CERES_OPT_LIB']) env.AppendUnique(LIBS = env['CERES_OPT_LIB'])
#end #end
sources = ['fitter.cpp'] build_lib = True
env.SharedLibrary('../../build/nonlinear_fitter_ceres', sources)
#end #end
env = conf.Finish() env = conf.Finish()
if build_lib:
sources = ['fitter.cpp']
env.SharedLibrary('../../build/nonlinear_fitter_ceres', sources)
#end
\ No newline at end of file
...@@ -3,13 +3,18 @@ env = env.Clone() ...@@ -3,13 +3,18 @@ env = env.Clone()
env.AppendUnique(LIBS = env['PLUGIN_LIB']) env.AppendUnique(LIBS = env['PLUGIN_LIB'])
build_lib = False
conf = Configure(env) conf = Configure(env)
if conf.CheckCXXHeader('unsupported/Eigen/LevenbergMarquardt'): if conf.CheckCXXHeader('unsupported/Eigen/LevenbergMarquardt'):
sources = ['fitter.cpp'] build_lib = True
env.SharedLibrary('../../build/nonlinear_fitter_eigen', sources)
#end #end
env = conf.Finish() env = conf.Finish()
if build_lib:
sources = ['fitter.cpp']
env.SharedLibrary('../../build/nonlinear_fitter_eigen', sources)
#end
\ No newline at end of file
Import('env') Import('env')
env = env.Clone() env = env.Clone()
env.AppendUnique(LIBS = env['PLUGIN_LIB'])
env.AppendUnique(LIBS = env['IPOPT_LIB'])
env.AppendUnique(LIBPATH = env['IPOPT_DIR'])
env.AppendUnique(CPPPATH = env['IPOPT_INC'])
build_lib = False
conf = Configure(env) conf = Configure(env)
if conf.CheckLib(env['IPOPT_LIB']): 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']): if conf.CheckLib(env['IPOPT_OPT_LIB']):
env.AppendUnique(LIBS = env['IPOPT_OPT_LIB']) env.AppendUnique(LIBS = env['IPOPT_OPT_LIB'])
#end #end
sources = ['fitter.cpp'] build_lib = True
env.SharedLibrary('../../build/nonlinear_fitter_ipopt', sources)
#end #end
env = conf.Finish() env = conf.Finish()
if build_lib:
sources = ['fitter.cpp']
env.SharedLibrary('../../build/nonlinear_fitter_ipopt', sources)
#end
\ No newline at end of file
Import('env') Import('env')
env = env.Clone() env = env.Clone()
env.AppendUnique(LIBS = env['PLUGIN_LIB'])
env.AppendUnique(LIBS = env['NLOPT_LIB'])
env.AppendUnique(LIBPATH = env['NLOPT_DIR'])
env.AppendUnique(CPPPATH = env['NLOPT_INC'])
build_lib = False
conf = Configure(env) conf = Configure(env)
if conf.CheckLib(env['NLOPT_LIB']): if conf.CheckLib(env['NLOPT_LIB']):
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']): if conf.CheckLib(env['NLOPT_OPT_LIB']):
env.AppendUnique(LIBS = env['NLOPT_OPT_LIB']) env.AppendUnique(LIBS = env['NLOPT_OPT_LIB'])
#end #end
sources = ['fitter.cpp'] build_lib = True
env.SharedLibrary('../../build/nonlinear_fitter_nlopt', sources)
#end #end
env = conf.Finish() env = conf.Finish()
if build_lib:
sources = ['fitter.cpp']
env.SharedLibrary('../../build/nonlinear_fitter_nlopt', sources)
#end
\ No newline at end of file
Import('env') Import('env')
env = env.Clone() env = env.Clone()
env.AppendUnique(CPPPATH = env['MATLAB_INC'])
env.AppendUnique(LIBPATH = env['MATLAB_DIR'])
env.AppendUnique(LIBS = env['MATLAB_LIB'])
env.AppendUnique(LIBS = env['PLUGIN_LIB'])
build_lib = False
conf = Configure(env) conf = Configure(env)
if conf.CheckLib(env['MATLAB_LIB']): if conf.CheckLib(env['MATLAB_LIB']):
env.AppendUnique(CPPPATH = env['MATLAB_INC']) build_lib = True
env.AppendUnique(LIBPATH = env['MATLAB_DIR'])
env.AppendUnique(LIBS = env['MATLAB_LIB']) #end
env.AppendUnique(LIBS = env['PLUGIN_LIB']) conf.Finish()
if build_lib:
sources = ['rational_fitter.cpp'] sources = ['rational_fitter.cpp']
env.SharedLibrary('../../build/rational_fitter_matlab', sources) env.SharedLibrary('../../build/rational_fitter_matlab', sources)
#end #end
\ No newline at end of file
conf.Finish()
Import('env') Import('env')
env = env.Clone() env = env.Clone()
env.AppendUnique(CPPPATH = env['QUADPROG_INC'])
env.AppendUnique(LIBPATH = env['QUADPROG_DIR'])
env.AppendUnique(LIBS = env['QUADPROG_LIB'])
env.AppendUnique(LIBS = env['PLUGIN_LIB'])
conf = Configure(env) conf = Configure(env)
if conf.CheckLib(env['QUADPROG_LIB']): build_lib = False
env.AppendUnique(CPPPATH = env['QUADPROG_INC']) if conf.CheckLib(env['QUADPROG_LIB']):
env.AppendUnique(LIBPATH = env['QUADPROG_DIR'])
env.AppendUnique(LIBS = env['QUADPROG_LIB'])
env.AppendUnique(LIBS = env['PLUGIN_LIB'])
env.AppendUnique(CCFLAGS = env['OPENMP_FLAG']) env.AppendUnique(CCFLAGS = env['OPENMP_FLAG'])
if conf.CheckLib(env['OPENMP_LIB']): if conf.CheckLib(env['OPENMP_LIB']):
env.AppendUnique(LIBS = env['OPENMP_LIB']) env.AppendUnique(LIBS = env['OPENMP_LIB'])
#end #end
sources = ['rational_fitter.cpp'] build_lib = True
env.SharedLibrary('../../build/rational_fitter_parallel', sources)
#end #end
conf.Finish() conf.Finish()
if build_lib:
sources = ['rational_fitter.cpp']
env.SharedLibrary('../../build/rational_fitter_parallel', sources)
\ No newline at end of file
Import('env') Import('env')
env = env.Clone() env = env.Clone()
env.AppendUnique(CPPPATH = env['QUADPROG_INC'])
env.AppendUnique(LIBPATH = env['QUADPROG_DIR'])
env.AppendUnique(LIBS = env['QUADPROG_LIB'])
env.AppendUnique(LIBS = env['PLUGIN_LIB'])
build_lib = False
conf = Configure(env) conf = Configure(env)
if conf.CheckLib(env['QUADPROG_LIB']): if conf.CheckLib(env['QUADPROG_LIB']):
env.AppendUnique(CPPPATH = env['QUADPROG_INC']) build_lib = True
env.AppendUnique(LIBPATH = env['QUADPROG_DIR'])
env.AppendUnique(LIBS = env['QUADPROG_LIB'])
env.AppendUnique(LIBS = env['PLUGIN_LIB'])
#end
conf.Finish()
if build_lib:
sources = ['rational_fitter.cpp'] sources = ['rational_fitter.cpp']
env.SharedLibrary('../../build/rational_fitter_quadprog', sources) env.SharedLibrary('../../build/rational_fitter_quadprog', sources)
#end #end
\ No newline at end of file
conf.Finish()
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