coin-or / Ipopt

COIN-OR Interior Point Optimizer IPOPT
https://coin-or.github.io/Ipopt
Other
1.43k stars 284 forks source link

Configure Ipopt with Pardiso #341

Closed shixuan-zhang closed 5 years ago

shixuan-zhang commented 5 years ago

Hi, I am trying to install Ipopt with Pardiso 6.0 (not the MKL version) as the linear solver. When following the instructions https://www.coin-or.org/Ipopt/documentation/node19.html and issuing the command ../configure --with-pardiso="-qsmp=omp $HOME/Pardiso/pardiso600-GNU720-X86-64.so" I saw the following configuration error: checking whether user-supplied Pardiso library "-qsmp=omp /home/zhangshixuanus/Pardiso/pardiso600-GNU720-X86-64.so" works... configure: error: Pardiso library -qsmp=omp /home/zhangshixuanus/Pardiso/pardiso600-GNU720-X86-64.so does not seem to work The log file is attached below for reference. Any help would be greatly appreciated. config.log

tkralphs commented 5 years ago

In config.log, you will find some clues by searching for "does not seem to work". To test the library, a simple Fortran program was compiled with the command line:

gfortran -o conftest -O3 -pipe    conftest.f -qsmp=omp /home/zhangshixuanus/Pardiso/pardiso600-GNU720-X86-64.so

This resulted in errors:

gfortran: error: /home/zhangshixuanus/Pardiso/pardiso600-GNU720-X86-64.so: No such file or directory
gfortran: error: /home/zhangshixuanus/CoinOR/Ipopt-3.12.13/build/ThirdParty/Lapack/libcoinlapack.la: No such file or directory
gfortran: error: /home/zhangshixuanus/CoinOR/Ipopt-3.12.13/build/ThirdParty/Blas/libcoinblas.la: No such file or directory
gfortran: error: /home/zhangshixuanus/CoinOR/Ipopt-3.12.13/build/ThirdParty/Blas/libcoinblas.la: No such file or directory
gfortran: error: unrecognized command line option '-qsmp=omp'

So it seems the library does not exist in the location you specified and qsmp=omp is not a valid option.

shixuan-zhang commented 5 years ago

Thank you very much for the reply. I apologize for the wrong name for the .so library file. Now I correct it and remove the unrecognized command line option '-qsmp=omp'. Still the middle three errors remain. I think it weird since I already ran the get scripts in the ThirdParty folders, following the installation instructions. So these two libraries should be found, right? config.log

svigerske commented 5 years ago

Yes and no. configure passes the .la files to gfortran, which gfortran does not know how to deal with. Maybe that's a bug or something.

Can you just let your Linux distribution install Blas and Lapack in your system and skip (remove) ThirdParty/{Blas,Lapack}? Then configure should pick these up instead.

shixuan-zhang commented 5 years ago

Thanks for the comment. There are Blas and Lapack installed in the system and thus I tried removing the folders ThirdParty/{Blas, Lapack}. Turns out that the error persists. I notice that the configure script is trying to find -lcoinblas -lcoinlapack instead of -lblas -llapck. Does this cause the problem? config.log

svigerske commented 5 years ago

It should only do this if it still tries to use the version from COIN-OR. But it seems that it does not find blas installed in your system:

configure:25359: checking whether -lblas has BLAS
configure:25475: gcc -o conftest -O3 -pipe -DNDEBUG -Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall -Wno-unknown-pragmas -Wno-long-long   -DIPOPT_BUILD   conftest.c -lblas  >&5
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: cannot find -lblas
shixuan-zhang commented 5 years ago

I see. Thank you very much. I made it work by adding the options --with-blas-lib="${BLAS}" and --with-lapack-lib="${LAPACK}", where the environment variables point to the path of the Blas and Lapack library files.