Project

General

Profile

Installing OpenBlas on Windows » History » Revision 6

Revision 5 (John Cary, 04/27/2019 09:30 AM) → Revision 6/7 (John Cary, 04/27/2019 09:55 AM)

# Installing OpenBlas on Windows 

 These instructions largely derive from [Installing "Installing OpenBLAS using Conda](https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio#1-native-msvc-abi). Conda":https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio#1-native-msvc-abi. 

 Install 64bit Miniconda3 with Python-2.7. It should be easily found in your preferred search engine's results.    The current link is https://docs.conda.io/en/latest/miniconda.html.    Install options:  

 * All users. 
 * Do not add Anaconda to the system path variable. 
 * Do not register Python as the system Python 2.7. 

 Open the "Anaconda Command Prompt", which should be available in the start menu, with administrative privileges.    Execute 

 ~~~ 
 conda update -n base conda 
 conda config --add channels conda-forge 
 conda install -y cmake flang clangdev perl libflang 
 conda install -y -c isuruf kitware-ninja 
 ~~~ 

 Activate the 64-bit build environment with Visual Studio.    E.g.,  

 ~~~ 
 "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" 
 ~~~ 

 In a cygwin window, untar openblas into /winsame/builds-vs2017, and create the build directory 

 ~~~ 
 mkdir -p /winsame/builds-vs2017/openblas 
 cd /winsame/builds-vs2017/openblas 
 tar xf ~/svnpkgs/openblas-0.3.4.tar.xz 
 ~~~ 

 Back in the Anaconda prompt, move to the openblas area, create the build subdirectory, and set needed environment variables.    E.g., 

 ~~~ 
 D: 
 cd \winsame\builds-vs2017openblas\openblas-0.3.4 
 mkdir build 
 cd build 
 set "LIB=%CONDA_INSTALL_LOCN%\Library\lib;%LIB%" 
 set "CPATH=%CONDA_INSTALL_LOCN%\Library\include;%CPATH% 
 ~~~ 

 Configure, build, install shared openblas for installation into your contrib dir.    E.g., 

 ~~~ 
 cmake .. -G "Ninja" -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_Fortran_COMPILER=flang -DBUILD_WITHOUT_LAPACK=no -DNOFORTRAN=0 -DDYNAMIC_ARCH=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=D:/winsame/contrib-vs2017/openblas-0.3.4-sersh 
 ninja clean 
 cmake --build . --config Release 
 ninja install 
 ~~~ 

 Configure, build, install static openblas without autolinking of the shared runtime libraries for installation into your contrib dir.    E.g., 

 ~~~ 
 cmake .. -G "Ninja" -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_Fortran_COMPILER=flang -DBUILD_WITHOUT_LAPACK=no -DNOFORTRAN=0 -DDYNAMIC_ARCH=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=FALSE -DCMAKE_C_FLAGS_RELEASE:STRING="/O2 /Ob2 /D NDEBUG" -DCMAKE_CXX_FLAGS_RELEASE:STRING="/O2 /Ob2 /D NDEBUG" -DCMAKE_INSTALL_PREFIX:PATH=D:/winsame/contrib-vs2017/openblas-0.3.4-ser 
 ninja clean 
 cmake --build . --config Release 
 ninja install 
 ~~~