arpack-ng icon indicating copy to clipboard operation
arpack-ng copied to clipboard

Document how to compile arpack-ng on Windows from C

Open Eugene523 opened this issue 5 years ago • 3 comments

I know it's not an issue, but can you present a more detailed documentation on how to compile it on Windows to use in c projects, especially for a person who is far away from Linux-related software and Fortran? By the way, visual studio project in VISUAL_STUDIO catalog is not opening in VS2015 on my computer.

Eugene523 avatar Aug 12 '20 10:08 Eugene523

No idea. I'd say :

  • get LAPACK and BLAS here https://icl.cs.utk.edu/lapack-for-windows/lapack ? And then, add BLAS/LAPACK libs in the linker GUI of visual studio ?
  • use Unix ! :D MinGW or "Bash (Ubuntu) for Windows" and build / compile the unix way

If you get this done, feel free to PR how you did it in the doc (README.md)

fghoussen avatar Aug 12 '20 17:08 fghoussen

possible alternative : #303

fghoussen avatar Mar 27 '21 18:03 fghoussen

I successfully built arpack on Win10 with VS2019 (16.10) and Intel MKL 2021.1.1 as static library.

To properly set all the environmental variables I highly recommend to use the Intel oneApi command prompt for Intel x64 for Visual Studio; from here call cmake-gui and follow the usual procedure.

Please mind to uncheck BUILD_SHARED_LIBS. From a quick look it seems that Fortran routines are missing the ATTRIBUTES DLLEXPORT that would be needed by exporting the function symbols into an import library. So you will end up building a .dll without any symbol exported and without its complementary import library (the .lib that usually comes with the .dll in Windows).

Then there is an additional issue on complex number declaration. In Windows the float _Complex declaration does not work, so you have to manually change all this references:

  • float _Complex to _Fcomplex
  • double _Complex to _Dcomplex

I'm now able to run all the tests including icb_arpack_cpp, but not icb_arpack_c since there are some wrong (in my opnion) array initialization.

dariomangoni avatar Jun 15 '21 22:06 dariomangoni

Documentation has been provided here: https://github.com/opencollab/arpack-ng#windows-support

fghoussen avatar May 27 '23 20:05 fghoussen