Raw File
INSTALL
*****STEPS FOR INSTALLATION*****

Please see TROUBLESHOOTING below if you encounter errors

The code can be compiled and run on a Mac or Linux OS. If you are using a Windows OS, you will need a Unix-like environment to run the code, such as Cygwin: https://www.cygwin.com/

*****LINUX INSTRUCTIONS******

1) Go to http://www.hsl.rl.ac.uk/archive/hslarchive.html and download the MA27 library. 

2) Extract the MA27 folder and run

./configure
make

inside to make the library libma27.a

3) Extract OOQP tar file

4) Place libma27.a into top directory in OOQP folder. You can place it elsewhere, but will need to modify the Makefile inside OOQP

5) Run

./configure
make

Inside OOQP folder. This will require LAPACK and BLAS libraries, so you may need to install these if you don't have them. (See the INSTALL file inside the OOQP directory for more details)

6) Go back to top directory (StoichiometricBalance) and add proper library tags to the Makefile. If you don't know the proper library tags, look at GNUMakefile inside the OOQP directory and copy them from there. Copy into the FLIBSLIN tag.

7) Run

make

To compile stoich_balance.exe



*****MAC INSTRUCTIONS******

1) Go to http://www.hsl.rl.ac.uk/archive/hslarchive.html and download the MA27 library. 

2) Extract the MA27 folder and run

./configure
make

inside to make the library libma27.a

3) Extract OOQP tar file

4) Place libma27.a into top directory in OOQP folder. You can place it elsewhere, but will need to modify the Makefile inside OOQP

5) Run

./configure

Inside the OOQP folder. Do not run "make" just yet.

6) Add -lstdc++ to FLIBS variable inside GNUMakefile 

7) Open src/Readers/hash.C and comment out "using namespace std". Then change all three instances of "cerr" to "std::cerr". If you don't do this, you may get an 'Ambiguous definition of "hash"' error. This is because C++ has its own defintion of the "hash" function.

8) Run

make

Inside OOQP folder. This will require LAPACK and BLAS libraries, so you may need to install these if you don't have them. (See the INSTALL file inside the OOQP directory for more details)

9) Go back to top directory (StoichiometricBalance). Edit this Makefile to update the FLIBSMAC. Copy in the FLIBS line from OOQPfolder/GNUMakefile. Then add the flags: -framework accelerate
to that line, to link in the blas and lapack. 

10) Run

make

To compile stoich_balance.exe

*****TROUBLESHOOTING****

Make sure the prerequisite libraries (BLAS, LAPACK, and MA27 are available)


Error 1: "Fortran compiler cannot make executables"

Your gfortran compiler may be out of date. Upgrade it. You can find binaries here:

MacOS
https://gcc.gnu.org/wiki/GFortranBinaries#MacOS 
Linux
https://gcc.gnu.org/wiki/GFortranBinaries#GNU.2BAC8-Linux

Error 2: "In file included from EXES/stoich_balance.cpp:69:
include/qp_solvers.h:6:10: fatal error: 'QpGenData.h' file not found
#include "QpGenData.h"  "
         ^~~~~~~~~~~~~

This means that it does not have the path to the OOQP directory specified.
Solution 1: Inside the Makefile on line 1, set "OOQP=path_to_OOQP" e.g. OOQP=./OOQP-0.99.26
Solution 2: Set an environment variable to define OOQP at the terminal prompt or in the .bashrc file: export OOQP="/Users/maggie/OOQP-0.99.26"



back to top