obtain_ipopt.py 1.17 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
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