gccmingwgnu-makemsys2casadi

Installing solver library with MSYS2 - HSL compiling and linking


I am trying to install Coin-HSL (https://licences.stfc.ac.uk/product/coin-hsl) to use with CasADi in Matlab on Windows. I did the following:

export PATH=/c/msys64/mingw64:$PATH
export PATH=/c/msys64/mingw64/bin:$PATH

wget https://karypis.github.io/glaros/files/sw/metis/metis-5.1.0.tar.gz
tar -xvf metis-5.1.0.tar.gz

cd coinhsl-2021.05.05

mv ../metis-5.1.0 .

Then I created a new folder where I want to install the solver. To install the solver I call:

./configure --prefix="Install_Path"
make
make install

The configure script still executed without problems, but when I call make, I get the following errors:

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export ma27as_: symbol not defined 

for the different type of solvers. When I search for example for ma27as_, I cannot find it anywhere in the folder coinhsl-2021.05.05. So there may be an issue?

Furthermore I get the following type of error:

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: common/.libs/deps90.o:deps90.f90:(.text+0x52a7b): undefined reference to `metis_nodend_'

also for different kinds of solvers.

In my attempts to resolve the problem, there were suggestions, that there is a linking issue. I tried adding the libhsl.dll from the coinhsl library to my PATH as suggested in https://groups.google.com/g/casadi-users/c/uJygStQULeI. But the problem persisted

Can someone spot an issue or give a hint what could be going wrong?

I'm still new to installation with MSYS2, so any help is much appreciated!


Solution

  • I managed to install the library using the 2023 version of coinhsl which is installed using meson.build. The README suggests to install meson from their website. I found, that it works to install meson within MSYS2 via pacman -S mingw-w64-x86_64-meson.