|
|
Build on Windows
|
|
|
================
|
|
|
|
|
|
Although Visual C++ is incompatible with the class structure of MatLib (diamond inheritance schemes, among others), it should be possible to build MatLib on Windows using other compilers. Using CodeBlocks with MinGW is one solution. |
|
|
\ No newline at end of file |
|
|
Although Visual C++ is incompatible with the class structure of MatLib (diamond inheritance schemes, among others), it should be possible to build MatLib on Windows using other compilers. Using CodeBlocks with MinGW is one solution.
|
|
|
|
|
|
## Install required software and libraries
|
|
|
1. Install [Cmake](https://cmake.org/download/) and add to `PATH` system variable (select option during installation)
|
|
|
2. Install [CodeBlocks with MinGW](http://www.codeblocks.org/downloads/binaries)
|
|
|
1. add MinGW to `PATH`
|
|
|
2. check that MinGW directory has been correctly added to system variable `PATH` (in file explorer: Computer/Properties, click Advanced system parameters/Environment variables, in System variables modify `PATH`)
|
|
|
3. check CodeBlocks compiler configuration (Settings/Compiler/Toolchain executable):
|
|
|
* Compiler's installation directory: `path\CodeBlocks\MinGW`
|
|
|
* C compiler: `gcc.exe`
|
|
|
* C++ compiler and Linker for dynamic libs: `g++.exe`
|
|
|
* Linker for staticlibs: `ar.exe`
|
|
|
* Debugger: `GDB/CDB debugger`
|
|
|
3. Install `swig` package with Anaconda navigator
|
|
|
4. Install [MSYS2](https://www.msys2.org/) and:
|
|
|
1. install `openblas` library (see website documentation/Package management)
|
|
|
2. add `libopenblas.dll` folder to `PATH`
|
|
|
|
|
|
## Build on Windows
|
|
|
1. Download the files(or clone the repository): in the following we will refer to the top directory as `MatLib` (although you can pick the name of your choice).
|
|
|
2. Create `build` and `install` directories (for example just under `MatLib`).
|
|
|
3. Open CMake and configure `build`:
|
|
|
1. specify source code directory (`CMakeLists.txt` directory i.e. `MatLib`)
|
|
|
2. specify output directory `build`
|
|
|
3. specify `CMAKE_INSTALL_PREFIX` as `install` (folder where to install MatLib, preferably local, no admin rights required)
|
|
|
4. configure with generator `CodeBlocks - MinGW Makefiles`
|
|
|
5. if NOTFOUND libraries or executables: enter path of `.dll` or `.exe` files manually in `value` field (for `BLAS` library, enter path only for `BLAS_openblas_LIBRARY` variable: other libraries are alternatives to openblas)
|
|
|
6. generate
|
|
|
4. Open Windows terminal:
|
|
|
1. go to `build` directory
|
|
|
2. run command: `cmake --build .`
|
|
|
5. Open `path\MatLib\build\MatLib.cbp` with CodeBlocks
|
|
|
1. build and check there is no error
|
|
|
2. click Build/Select target/install and build again
|
|
|
|
|
|
Your `install` folder should contain a `bin` with the MatLib executable and a `lib` with the library.
|
|
|
|