-
Notifications
You must be signed in to change notification settings - Fork 0
SmallapackCompilingWindowsDLL
While lapack and blas are easily found on MacOSX and Linux distributions, it’s not always the case on Windows.
Therefore, here is an indication for compiling those DLL.
I will indicate what I did on my own machine, exclusively with free and when possible open source solutions.
These instructions were tested for Lapack 3.6.0.
Recent versions of Lapack come with Cmake configuration files. The most reasonable thing is to use them.
So go to Cmake site https://cmake.org and install a recent enough version.
You will need a FORTRAN compiler, and optionally a C compiler for building CBLAS and LAPACKE. The best free solution is using MinGW, so goto MinGW site and download appropriate 32 or 64 bits solution (depending if your Smalltalk dialect is going to support 32 or 64bits DLL). For me, it was MinGW-32 because Dolphin is currently for 32 bits.
Then download the lapack tarball from netlib site http://www.netlib.org/lapack/ , for me the target was:
c:\library\lapack-3.6.0.tgz
Then extract the tarball to a directory of your choice. Presumably 7Zip can do it for you. Personnally, I installed Msys along with MinGW-32, and performed in a MSYS shell:
tar xvf lapack-3.6.0.tgz
Then edit xerbla to avoid spurious STOP which would exit smalltalk in case of error like explained at SmallapackPrerequisites. I did it with the vi of MSYS:
vi lapack-3-6-0/BLAS/SRC/xerbla.f
Then, open a cmd.exe, change directory where you extracted the Lapack tarball, for me it was:
cd c:\library\lapack-3.6.0.
Make sure you have Cmake and Mingw on you PATH, for me it was:
set PATH=%PATH%;c:\MinGW\bin
Then run cmake with appropriate options, for me:
cmake -G "MinGW Makefiles" -DCBLAS=ON -DBUILD_DEPRECATED=ON -DLAPACKE=ON -DBUILD_SHARED_LIBS=ON
Then build the solution, for me:
mingw32-make
This should leave the DLL in the bin subdirectory. For Dolphin, I copied these DLL to the Dolphin repository, along with MinGW DLL - which is not necessary if MinGW is on you PATH variable. For me:
xcopy bin\*.dll c:\dolphin
copy c:\MinGW\bin\libgcc_s_dw2-1.dll c:\dolphin
copy c:\MinGW\bin\libgfortran-3.dll c:\dolphin
copy c:\MinGW\bin\libquadmath-0.dll c:\dolphin
Of course, if you have an intel compiler, then I recommend using it, or even better use Intel Math Kernel Library (MKL) which is much more optimized than reference BLAS from netlib.