-
Notifications
You must be signed in to change notification settings - Fork 89
Compilation on Windows System
This guide will instruct the user how to compile BLASFEO on Windows using 3 compilers.
It is assumed that BLASFEO is on the folder (Either download / pull the master or download the latest release) <BLASFEOFolder>
.
The guide deals with targeting x86
(Actually x64
) code path only (Not ARM).
This instructions will compile BLASFEO using MSVC compiler.
- Open Command Line Terminal (CMD).
- Verify
CMAKE
is on the path (echo %PATH%
). - Go to
<BLASFEOFolder>
and create a folder calledBuild
and enter it. - Run
cmake -G"Visual Studio 15 2017 Win64" -DBUILD_SHARED_LIBS=OFF -DTARGET=GENERIC -DBLASFEO_TESTING=OFF -DBLASFEO_BENCHMARKS=OFF -DBLASFEO_EXAMPLES=OFF ..
. Wait for the build process to finish. - Run
cmake --build . --config Release
. Wait for the compilation to end. Once ended theBLASFEO
library will be available at<BLASFEOFolder>\Build\Release
.
The above will create a static library which is compiled against the Threaded Dynamic Library flavor of Microsoft Visual C Run Time Library (Known as \MD
in MSVC). In order to use the Static Run Time Library one could use -DCMAKE_C_FLAGS_RELEASE="${CMAKE_C_FLAGS_RELEASE} /MT"
.
In order to create Dynamic Library one should set -DBUILD_SHARED_LIBS=ON
.
The above doesn't compile the Examples, Benchmarks and Testing as they require libm
which isn't available in MSVC.
The MSVC compiler doesn't support AT&T
dialect of the Assembly used in BLASFEO. Hence only the GENERIC
target is supported.
The Clang-CL compiler on Windows allows compiling any target of BLASFEO. Hence the output will have much better performance.
This instructions will compile BLASFEO using Clang-CL Compiler with the Ninja Generator.
- Open Command Line Terminal (CMD).
- Verify that
CMAKE
,Ninja
andClang-Cl
are on the path (echo %PATH%
). - Go to
<BLASFEOFolder>
and create a folder calledBuild
and enter it. - Run
cmake -G"Ninja" -DCMAKE_C_COMPILER=clang-cl -DBUILD_SHARED_LIBS=OFF -DTARGET=X64_AUTOMATIC -DBLASFEO_TESTING=OFF -DBLASFEO_BENCHMARKS=OFF -DBLASFEO_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release ..
. Wait for the build process to finish. - Run
cmake --build . --config Release
. Wait for the compilation to end. Once ended theBLASFEO
library will be available at<BLASFEOFolder>\Build
.
In case one installed Clang-CL with the Visual Studio Plug In then one could use cmake -G"Visual Studio 15 2017 Win64" -T"<LLVM>" -DBUILD_SHARED_LIBS=OFF -DTARGET=GENERIC -DBLASFEO_TESTING=OFF -DBLASFEO_BENCHMARKS=OFF -DBLASFEO_EXAMPLES=OFF ..
where <LLVM>
is what's under the Platform Toolset
option under MSVC:
Then it is just as in the section about MSVC
.
This section shows how to compile using MinGW64
. The distribution used by me was MinGW Distro - nuwen.net.
- Open Command Line Terminal (CMD).
- Verify that
CMAKE
, andMinGW64
are on the path (echo %PATH%
). - Go to
<BLASFEOFolder>
and create a folder calledBuild
and enter it. - Run
cmake -G"MinGW Makefiles" -DCMAKE_C_COMPILER=clang-cl -DBUILD_SHARED_LIBS=OFF -DTARGET=X64_AUTOMATIC -DBLASFEO_TESTING=OFF -DBLASFEO_BENCHMARKS=OFF -DBLASFEO_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release ..
. Wait for the build process to finish. - Run
cmake --build . --config Release
. Wait for the compilation to end. Once ended theBLASFEO
library will be available at<BLASFEOFolder>\Build
.
Since MinGW64
has access to glibc
one could turn on the tests, benchmarks etc... as needed.