问题
I am working on Windows 10 64-bit using MSYS2 with the 64-bit toolchain. In the MSYS2 terminal I found and installed the following packages after searching for them with pacman -Ss
,
mingw64/mingw-w64-x86_64-openblas 0.2.20-2
mingw64/mingw-w64-x86_64-lapack 3.6.1-1
mingw64/mingw-w64-x86_64-arpack 3.5.0-1
I took an example fortran source file from the Intel MKL library examples; I copied the dgelsx.f
file to a folder in my msys home directory. I compile (in the mingw64
terminal) with
gfortran dgelsx.f -o dgelsx -llapack -lblas
it compiles without any complaint, but when I attempt to run it, I get the error
C:/msys64/home/k_chu/lapacktext/dgelsx.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
Why is this happening? I haven't attempted to deal with an arpack
example yet until I get this working. Also if I do get all of this working, will it be possible to use the arpack
libraries in Microsoft Visual Studio with the Intel ifort
compiler? I tried copying the .dll
files in /msys64/mingw64/bin
into my MSV project folder but no luck, same with the .a
and .dll.a
files in the /msys64/mingw64/lib
.
回答1:
Please use dependency walker (http://www.dependencywalker.com) to locate the .dll, which the program cannot find on the path. Or compile with -static-libgcc
or -static-libstdc++
to avoid dependencies at runtime.
来源:https://stackoverflow.com/questions/49783733/using-blas-lapack-and-arpack-with-msys2