HowTo build OpenBLAS with Native (MSVC) ABI

mathematics computation
Photo by Antoine Dautry / Unsplash


  1. Open you prefer commmand line prompt with Admin access(cmd, powershell...etc).

  2. Switch to your target build directory.

  3. Run command as below:

    $ 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
  4. Activate the MSVC environment for 64 bits with vcvarsall64.bat. Its default path would be:
    C:/Program Files(x86)/Microsoft/Visual Studio/2017/Community/VC/Auxiliary/Build/vcvars64.bat
    Type link to check the environment is active or not.

  5. Now configure the project with CMake. (You can replace %CONDA_INSTALL_LOCN% with your actual anaconda install path)

    $ set "LIB=%CONDA_INSTALL_LOCN%\Library\lib;%LIB%"
    $ set "CPATH=%CONDA_INSTALL_LOCN%\Library\include;%CPATH%
    $ mkdir build
    $ cd build
  6. Build the project.

    $ cmake --build . --config Release

Now you can enjoy your high-speed Linear Algebra calculation.
Remember to add the path into environment variable if needed.



Related Article