From 10560b87921ea0d58f1a837f82daff4defc86c06 Mon Sep 17 00:00:00 2001 From: Laurent Belcour Date: Mon, 9 Jun 2014 08:34:27 -0400 Subject: [PATCH] Got all the library to compile under MacOS. The vtable issue still remains. --- SConstruct | 10 +-- config.example | 76 ------------------- configs/scons/config-macos-clang.py | 6 +- sources/core/ptr.h | 7 ++ .../nonlinear_fresnel_retroschlick/SConscript | 5 +- .../plugins/rational_fitter_eigen/SConscript | 4 +- .../rational_fitter_leastsquare/SConscript | 5 +- 7 files changed, 23 insertions(+), 90 deletions(-) delete mode 100644 config.example diff --git a/SConstruct b/SConstruct index 8ac775d..c27577c 100644 --- a/SConstruct +++ b/SConstruct @@ -97,10 +97,10 @@ env.AppendUnique(CPPPATH = ['#sources']) ##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') -env.SConscript(dirs=['sources/core', 'sources/softs', 'sources/plugins']) +#external = env.SConscript('external/SConscript') +core = env.SConscript('sources/core/SConscript') +plugins = env.SConscript('sources/plugins/SConscript') +softs = env.SConscript('sources/softs/SConscript') +#env.SConscript(dirs=['sources/core', 'sources/softs', 'sources/plugins']) #env.NoClean(external) diff --git a/config.example b/config.example deleted file mode 100644 index 0b4b48e..0000000 --- a/config.example +++ /dev/null @@ -1,76 +0,0 @@ -import os, sys - -##----------------------------------------------------------------## -## This file describes required and optional arguments to ALTA ## -## compilation. If you want to manualy tune the use of an already ## -## present library, uncomment the according lines. ## -##----------------------------------------------------------------## - - -## Compilators build flags -## -CXX = 'g++' -CCFLAGS = ['-O3', '-Wall', '-m64'] -LINKFLAGS = [] - - -## OpenMP flags -## -OPENMP_FLAGS = ['-fopenmp'] -OPENMP_LIBS = ['gomp'] - - -## OpenEXR library -## -#OPENEXR_INC = ['/usr/include/OpenEXR'] -#OPENEXR_DIR = ['/usr/lib'] -#OPENEXR_LIB = ['Half', 'IlmImf', 'IlmThread'] - - -## QUADPROG library -## -## You have to specify the directory of the QuadProg library -## -QUADPROG_INC = ['#external/quadprog++'] -QUADPROG_DIR = ['#external/build/lib'] -QUADPROG_LIBS = ['quadprog++'] - - -## CERES library -## -## You have to specify both the directory of the CERES library -## and the glog library -## -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 the directory of the NlOpt library -## -NLOPT_INC = ['#external/build/include'] -NLOPT_DIR = ['#external/build/lib'] -NLOPT_LIBS = ['nlopt'] -NLOPT_OPT_LIBS = [] - - -## coin IpOpt library -## -## You have to specify the directory of the IpOpt library -## -IPOPT_INC = ['#external/build/include'] -IPOPT_DIR = ['#external/build/lib'] -IPOPT_LIBS = ['ipopt'] -IPOPT_OPT_LIBS = [] - - -## MATLAB library and Engine -## - -# EXAMPLE FOR MAC -#MATLAB_INC = [' /Applications/MATLAB_R2014a.app/extern/include/'] -#MATLAB_DIR = [ '/Applications/MATLAB_R2014a.app/bin/maci64/'] -#MATLAB_LIBS = ['eng', 'mex','mat'] diff --git a/configs/scons/config-macos-clang.py b/configs/scons/config-macos-clang.py index b5fb57d..dfcced1 100644 --- a/configs/scons/config-macos-clang.py +++ b/configs/scons/config-macos-clang.py @@ -14,15 +14,15 @@ import os, sys ## Compilators build flags ## CXX = 'clang' -CCFLAGS = ['-O3', '-Wall', '-m64'] -LINKFLAGS = [] +CCFLAGS = ['-O3', '-Wall', '-Xarch_x86_64', '-mmacosx-version-min=10.9'] +LINKFLAGS = ['-headerpad_max_install_names', '-Xarch_x86_64', '-mmacosx-version-min=10.9'] ## ALTA internal flags ## CORE_LIB = ['dl', 'stdc++'] SOFT_LIB = ['core', 'dl', 'stdc++'] -PLUGIN_LIB = ['core'] +PLUGIN_LIB = ['core', 'stdc++'] ## OpenMP flags diff --git a/sources/core/ptr.h b/sources/core/ptr.h index b9b71fb..75026fa 100644 --- a/sources/core/ptr.h +++ b/sources/core/ptr.h @@ -50,6 +50,11 @@ struct ptr_counter unsigned int _count; }; +template class ptr; + +template +ptr dynamic_pointer_cast(const ptr& ptr_t); + template class ptr { public: @@ -125,4 +130,6 @@ template class ptr }; + + #endif diff --git a/sources/plugins/nonlinear_fresnel_retroschlick/SConscript b/sources/plugins/nonlinear_fresnel_retroschlick/SConscript index 3667ee3..7243455 100644 --- a/sources/plugins/nonlinear_fresnel_retroschlick/SConscript +++ b/sources/plugins/nonlinear_fresnel_retroschlick/SConscript @@ -1,6 +1,7 @@ Import('env') env = env.Clone() +env.AppendUnique(LIBS = env['PLUGIN_LIB']) + sources = ['function.cpp'] -libs = ['core'] -env.SharedLibrary('../../build/nonlinear_fresnel_retroschlick', sources, LIBS=libs) +env.SharedLibrary('../../build/nonlinear_fresnel_retroschlick', sources) diff --git a/sources/plugins/rational_fitter_eigen/SConscript b/sources/plugins/rational_fitter_eigen/SConscript index ec28736..6d7d824 100644 --- a/sources/plugins/rational_fitter_eigen/SConscript +++ b/sources/plugins/rational_fitter_eigen/SConscript @@ -1,7 +1,7 @@ Import('env') env = env.Clone() +env.AppendUnique(LIBS = env['PLUGIN_LIB']) sources = ['rational_fitter.cpp'] -libs = ['core'] -env.SharedLibrary('../../build/rational_fitter_eigen', sources, LIBS=libs) +env.SharedLibrary('../../build/rational_fitter_eigen', sources) diff --git a/sources/plugins/rational_fitter_leastsquare/SConscript b/sources/plugins/rational_fitter_leastsquare/SConscript index 5a7275f..0828644 100644 --- a/sources/plugins/rational_fitter_leastsquare/SConscript +++ b/sources/plugins/rational_fitter_leastsquare/SConscript @@ -1,7 +1,8 @@ Import('env') env = env.Clone() +env.AppendUnique(LIBS = env['PLUGIN_LIB']) + sources = ['rational_fitter.cpp'] -libs = ['core'] -env.SharedLibrary('../../build/rational_fitter_leastsquare', sources, LIBS=libs) +env.SharedLibrary('../../build/rational_fitter_leastsquare', sources) -- GitLab