Commit 9051056e authored by Laurent Belcour's avatar Laurent Belcour
Browse files

Updating scripts to compile IpOpt. But you have to make the library accessible

in the path.
parent 9177c61c
...@@ -38,6 +38,10 @@ vars.Add('NLOPT_INC', 'NLOPT include directory') ...@@ -38,6 +38,10 @@ vars.Add('NLOPT_INC', 'NLOPT include directory')
vars.Add('NLOPT_DIR', 'NLOPT libraries directory') vars.Add('NLOPT_DIR', 'NLOPT libraries directory')
vars.Add('NLOPT_LIBS', 'NLOPT libraries') vars.Add('NLOPT_LIBS', 'NLOPT libraries')
vars.Add('NLOPT_OPT_LIBS', 'NLOPT optional libraries') vars.Add('NLOPT_OPT_LIBS', '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('MATLAB_INC', 'MATLAB include directory') vars.Add('MATLAB_INC', 'MATLAB include directory')
vars.Add('MATLAB_DIR', 'MATLAB directory') vars.Add('MATLAB_DIR', 'MATLAB directory')
vars.Add('MATLAB_LIBS', 'MATLAB libraries') vars.Add('MATLAB_LIBS', 'MATLAB libraries')
......
...@@ -56,6 +56,17 @@ NLOPT_DIR = ['#external/build/lib'] ...@@ -56,6 +56,17 @@ NLOPT_DIR = ['#external/build/lib']
NLOPT_LIBS = ['nlopt'] NLOPT_LIBS = ['nlopt']
NLOPT_OPT_LIBS = [] 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 ## MATLAB library and Engine
## ##
MATLAB_INC = ['/home/pac/MATLAB/R2013b/extern/include/'] MATLAB_INC = ['/home/pac/MATLAB/R2013b/extern/include/']
......
import obtain
import os
import sys
import shutil
import subprocess
# Download CERES
obtain.obtain('IpOpt v3.11.8', 'Ipopt-3.11.8', 'http://www.coin-or.org/download/source/Ipopt/Ipopt-3.11.8.tgz', 'Ipopt-3.11.8.tgz')
## Test for the presence of already compiled ceres version in
## the $ALTA/external/build directory. Then test for the
## presence of cmake.
compile_test = not os.path.exists('.' + os.sep + 'build' + os.sep + 'include' + os.sep + 'Ipopt')
if not os.path.exists('.' + os.sep + 'build' + os.sep + 'include' + os.sep + 'coin/IpIpoptNLP.hpp'):
if os.name == 'nt':
print '<<WARNING>> no automatic installation for this package'
else:
print '<<INSTALL>> configure and build Nlopt v2.4.1'
path = os.getcwd()
third = path + os.sep + 'Ipopt-3.11.8' + os.sep + 'ThirdParty' + os.sep
os.chdir(third + 'Blas')
ret = os.system('./get.Blas')
os.chdir(third + 'Lapack')
ret = os.system('./get.Lapack')
os.chdir(third + 'ASL')
ret = os.system('./get.ASL')
os.chdir(third + 'Mumps')
ret = os.system('./get.Mumps')
os.chdir(path)
obtain.configure_build('Ipopt-3.11.8', '--enable-dependency-linking')
#end
else:
print '<<INSTALL>> IpOpt already installed'
#end
...@@ -2,7 +2,6 @@ import os ...@@ -2,7 +2,6 @@ import os
import sys import sys
Import('env') Import('env')
env = env.Clone()
# Library sources # Library sources
sources = ['common.cpp', sources = ['common.cpp',
...@@ -21,8 +20,9 @@ if(os.name == 'posix'): ...@@ -21,8 +20,9 @@ if(os.name == 'posix'):
## 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.
## ##
ccflags = []
if sys.platform == 'darwin': if sys.platform == 'darwin':
env.AppendUnique(CCFLAGS = ['-fvisibility=hidden']) ccflags = ['-fvisibility=hidden']
#end #end
env.StaticLibrary('../build/core', sources, LIBS=libs) env.StaticLibrary('../build/core', sources, LIBS=libs, CCFLAGS=ccflags)
...@@ -6,6 +6,7 @@ SConscript('data_interpolant/SConscript') ...@@ -6,6 +6,7 @@ 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_eigen/SConscript') SConscript('nonlinear_fitter_eigen/SConscript')
# Building nonlinear functions # Building nonlinear functions
......
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'])
#end
env.SharedLibrary('../../build/nonlinear_fitter_ipopt', sources, LIBS=libs)
#end
env = conf.Finish()
...@@ -6,16 +6,16 @@ SUBDIRS = \ ...@@ -6,16 +6,16 @@ SUBDIRS = \
rational_fitter_parallel \ rational_fitter_parallel \
rational_fitter_eigen \ rational_fitter_eigen \
rational_fitter_leastsquare \ rational_fitter_leastsquare \
# rational_fitter_matlab \ rational_fitter_matlab \
# rational_fitter_dca \ rational_fitter_dca \
rational_function_chebychev \ rational_function_chebychev \
rational_function_chebychev_opt \ rational_function_chebychev_opt \
rational_function_legendre \ rational_function_legendre \
rational_function_cosine \ rational_function_cosine \
nonlinear_fitter_eigen \ nonlinear_fitter_eigen \
nonlinear_fitter_ceres \ nonlinear_fitter_ceres \
# nonlinear_fitter_ipopt \ nonlinear_fitter_ipopt \
# nonlinear_fitter_nlopt \ nonlinear_fitter_nlopt \
nonlinear_fresnel_schlick \ nonlinear_fresnel_schlick \
nonlinear_fresnel_normalized_schlick \ nonlinear_fresnel_normalized_schlick \
nonlinear_fresnel_retroschlick \ nonlinear_fresnel_retroschlick \
......
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