This is a record of Roger Mason's experience building ASCEND on a Gentoo Linux box.
gcc (Gentoo 4.3.4 p1.0, pie–10.1.5) 4.3.4 Python 2.6.2 SCons script: v1.2.0.r3842, engine: v1.2.0.r3842
See the list of pre-requisites.
I wanted ipopt and sundials, which are not available in portage.
These instructions are based on a document by Andreas Waechter that you can obtain here:
- cd ~/Software/IPOPT
- svn co https://projects.coin-or.org/svn/Ipopt/releases/3.9.1 .
- cd ThirdParty/Blas/
- cd ../Lapack/
- cd ../Mumps
- The last command also applied a patch (successfully) and there were no error messages.
- download HSL ma27ad.f and ma19ad.f from HSL. (http://www.hsl.rl.ac.uk/). (There are restrictions and you’ll need a username and password).
- HSL site says ma27ad needs FD05,ID05 & ZAO2 but ipopt says neither ma27 nor ma19 need dependencies.
- ipopt configure fails saying that ma27 is not threadsafe and that you need the newer, threadsafe version. However, there is no indication of where to get it.
- Download ma57 instead and make a file called ma57ad.f in the HSL subdirectory of IPOPT by extracting ma57d.f and renaming that file to ma57ad.f. Then download tarballs with the dependencies (fd15d.f, mc21d.f, mc34d.f, mc47d.f, mc59d.f, mc64d.f, mc71ad.f), extract and concatenate them into ma57ad.f.
- cd ../Metis
- cd ../.. (to ~/Software/IPOPT)
- mkdir -p build
- ../configure. The default install directory is the build directory. The libraries will be in build/coin and build/coin/ThirdParty. I kept the default on a first build. You can specify a different install directory using —prefix=/path/to/install/dir.
- configure should end with 'Main configuration of Ipopt successful'.
- make test. Some tests are compiled and run. The tests all passed on my system. If Mumps is not included, then ipopt tries to use hsl routines, if they are not present, then tests fail.
- make install. You need to be root if you don’t have write access to the installation directory.</ol>
- Download from https://computation.llnl.gov/casc/sundials/main.html
- F77=gfortran ./configure. The configure script may not find your fortran compiler unless you specify it as shown.
- make; su; make install. The default install directory is /usr/local.</ol>
- Check out the sources: cd ~/Software svn co svn://ascend.cheme.cmu.edu/ascend/code/trunk ascend
- cd ascend
- In the top level SConstruct file change 'default_ipopt_libs' to read: default_ipopt_libs = ['$F2C_LIB','blas','lapack','pthread','ipopt','coinhsl','dl', 'coinmumps','coinmetis']
- Make sure the coin* libraries in the previous step are somewhere that gcc can find them, symlink if necessary.
- If there is an options.cache, remove it.
- scons —config=force IPOPT_LIBPATH=~/Software/IPOPT/build/lib/coin IPOPT_CPPPATH=~/Software/IPOPT/build/include
- I used symlinks from ~/Software/IPOPT/build/lib/coin to ~/Software/IPOPT/build/lib/coin/ThirdParty for the coin* libraries.
- In sundials.py change ‘None’ on line 62 to ’-llapack’ otherwise various symbols won’t be found and sundials won’t be used. I could not find a cleaner way to accomplish this.
- Make sure that configure found all the libraries you want ascend to use.</ol>
Once the configuration and build are to your liking the ASCEND can be installed.
- I tried installing ASCEND as an ordinary user in $HOME, but the install command tries to change a file in /usr/lib/python2.6/site-packages, so it fails.
- perform final installation of Ipopt if necessary.
- su; cd ~/Software/IOPOT/build
- ../configure --prefix=/usr/local
- make (should be nothing to do)
- make install -> libraries will be in /usr/local/lib/coin and /usr/local/lib/coin/ThirdParty
- symlink everything in /usr/local/lib/coin/ThirdParty from /usr/local/lib/coin
- cd ~/Software/ascend
- scons install INSTALL_PREFIX=/usr/local IPOPT_LIBPATH=/usr/local/lib/coin IPOPT_CPPPATH=/usr/local/include
- If you have problems at this stage with failures during the build, they are probably caused by a difference in the root PATH compared with that of your ordinary user. I worked round it by echoing my user PATH then appending it to root's path with export PATH=$PATH:... The change to root's path will disappear when you exit the su session.
- Once the PATH is changed, re-run the 'scons install' command.
- exit (su)
- You may need to adjust LD_LIBRARY_PATH in order for shared libraries to be found.