1

I am attempting to compile IPOPT 3.13.3 in Windows using Cygwin. I have a copy of Intel Parallel Studio 2019 and am trying to use the Intel compilers as well as Intel MKL from this install. Here's my process:

  1. Start the Intel compiler 64-bit command prompt
  2. Run Cygwin.bat to start up the cygwin bash terminal. I can confirm then that ifort and icl are on the path and will run
  3. Navigate to the ipopt source folder and run ./configure --enable-mscv

From here it finds the compilers fine and it works until trying to get lapack from MKL:

checking for function dsyev_ in /cygdrive/c/Program Files (x86)/INTELS~1/COMPIL~1.144/windows/mkl/lib/INTEL6~1/mkl_intel_lp64_dll.lib /cygdrive/c/Program Files (x86)/INTELS~1/COMPIL~1.144/windows/mkl/lib/INTEL6~1/mkl_sequential_dll.lib /cygdrive/c/Program Files (x86)/INTELS~1/COMPIL~1.144/windows/mkl/lib/INTEL6~1/mkl_core_dll.lib ... no
checking for function dsyev in /cygdrive/c/Program Files (x86)/INTELS~1/COMPIL~1.144/windows/mkl/lib/INTEL6~1/mkl_intel_lp64_dll.lib /cygdrive/c/Program Files (x86)/INTELS~1/COMPIL~1.144/windows/mkl/lib/INTEL6~1/mkl_sequential_dll.lib /cygdrive/c/Program Files (x86)/INTELS~1/COMPIL~1.144/windows/mkl/lib/INTEL6~1/mkl_core_dll.lib ... no
checking for function DSYEV_ in /cygdrive/c/Program Files (x86)/INTELS~1/COMPIL~1.144/windows/mkl/lib/INTEL6~1/mkl_intel_lp64_dll.lib /cygdrive/c/Program Files (x86)/INTELS~1/COMPIL~1.144/windows/mkl/lib/INTEL6~1/mkl_sequential_dll.lib /cygdrive/c/Program Files (x86)/INTELS~1/COMPIL~1.144/windows/mkl/lib/INTEL6~1/mkl_core_dll.lib ... no
checking for function DSYEV in /cygdrive/c/Program Files (x86)/INTELS~1/COMPIL~1.144/windows/mkl/lib/INTEL6~1/mkl_intel_lp64_dll.lib /cygdrive/c/Program Files (x86)/INTELS~1/COMPIL~1.144/windows/mkl/lib/INTEL6~1/mkl_sequential_dll.lib /cygdrive/c/Program Files (x86)/INTELS~1/COMPIL~1.144/windows/mkl/lib/INTEL6~1/mkl_core_dll.lib ... no

It then proceeds to check the cygwin packages for blas/lapack (which I don't want to do anyway) but that fails too:

checking for lapack.pc and blas.pc... yes
checking for function dsyev_ in -llapack  ... no
checking for function dsyev in -llapack  ... no
checking for function DSYEV_ in -llapack  ... no
checking for function DSYEV in -llapack  ... no
configure: WARNING: lapack.pc and blas.pc present, but could not find dsyev when trying to link with it.
checking for function dsyev_ in -llapack -lblas ... no
checking for function dsyev in -llapack -lblas ... no
checking for function DSYEV_ in -llapack -lblas ... no
checking for function DSYEV in -llapack -lblas ... no
configure: error: Required package LAPACK not found.

I've tried adding various combinations of libraries manually with the --with-lapack flag, such as suggested here: Linking Ipopt with Intel MKL, but I generally get the same result. Here's another command I tried:

./configure --enable-msvc --with-lapack=" -L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -liomp5 -lpthread -lm -ldl"

And here's the output:

checking for function dsyev_ in  -LC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -liomp5 -lpthread -lm -ldl ... no
checking for function dsyev in  -LC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -liomp5 -lpthread -lm -ldl ... no
checking for function DSYEV_ in  -LC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -liomp5 -lpthread -lm -ldl ... no
checking for function DSYEV in  -LC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -liomp5 -lpthread -lm -ldl ... no
configure: error: Could not find dsyev in Lapack

It does concern me that there are spaces in the path to MKL (ugh, Windows!), but I tried copying the libraries to another path and linking against that and it didn't change the result.

I also removed the GNU link.exe from the cygwin directory so that running link --version confirms I'm using the Microsoft linker (per the recommendation here: Installing and using IPopt with Cygwin - or even better alternative?

My internet research is not yielding any more answers. If anyone has some suggestions on what to do here, thank you in advance!

Addison
  • 13
  • 2

1 Answers1

0

It should be --enable-msvc instead of --enable-mscv.

Best is to make sure that the MKL libs are found in the library search path. Then configure should just pick them up automatically. Otherwise, try to use DOS-style short paths without spaces for the linker flags (https://github.com/coin-or/Ipopt/issues/472#issuecomment-842446604).

Also if tests in configure fail, look at the config.log file for details.

There should be no need to remove link.exe. There is a workaround for this in the compile script that comes with Ipopt.

PS: I haven't tried cygwin. msys2 works for me.

stefan
  • 799
  • 4
  • 9