|
| 1 | +How to build NIX-MX on Windows |
| 2 | +------------------------------ |
| 3 | + |
| 4 | +Follow these steps to set up the development environment for the NIX Matlab bindings under Windows32/64 for Matlab 32bit |
| 5 | + |
| 6 | +**Dependencies** |
| 7 | +- download and install Visual Studio 12 |
| 8 | +- make sure you have a fork of [NIX](https://github.com/G-Node/nix) and [NIX-MX](https://github.com/G-Node/nix-mx) |
| 9 | +- get the latest [NIX Windows dependencies](https://projects.g-node.org/nix/), extract to [your path]\nix-dep\ |
| 10 | + |
| 11 | +**Build process for DEBUG build** |
| 12 | +- start cmd (NOT powershell!), move to [your path]\nix; create "build" directory, move inside |
| 13 | +- to set up dependencies path variables for NIX cmake, run: |
| 14 | + `[your path]\nix-dep\nixenv.bat` |
| 15 | +- if working on a 32bit Windows, run: |
| 16 | + `cmake .. -G "Visual Studio 12"` |
| 17 | +- if working on a 64bit Windows, run: |
| 18 | + `set PLATFORM=x64` |
| 19 | + `cmake .. -G "Visual Studio 12 Win64"` |
| 20 | +- with Visual Studio open [your path]\nix\build\nix.sln |
| 21 | + |
| 22 | + NOTE! Visual Studio builds by default with configuration "Debug" and "32bit"! If some other build is required, set BUILD->ConfigurationManager->Active solution configuration! |
| 23 | +- Build "ALL_BUILD" |
| 24 | +- within the cmd shell move to [your path]\nix\build\Debug |
| 25 | +- run again |
| 26 | + `[your path]\nix-dep\nixenv.bat` |
| 27 | +- run |
| 28 | + `[your path]\nix\build\Debug\TestRunner.exe` |
| 29 | +- within the cmd shell move to [your path]\nix-mx, create and move into "build" folder |
| 30 | +- set the NIX root path; |
| 31 | + `set NIX_ROOT=[your path]/nix` |
| 32 | + |
| 33 | + IMPORTANT: |
| 34 | + - do not use quotes in cmd! |
| 35 | + - do not use backslashes, only slashes! e.g. c:/work/nix; c:\work\nix will not work! |
| 36 | + |
| 37 | +- run again |
| 38 | + `[your path]\nix-dep\nixenv.bat` |
| 39 | +- check, if the nix.dll library has been created in [your path]\nix\build\Debug |
| 40 | +- if yes, open [your path]\nix-mx\cmake\FindNIX.cmake |
| 41 | +- add "HINTS $ENV{NIX_ROOT}/build/Debug" to the "find_library(NIX_LIBRARY NAMES" statement |
| 42 | +- if working on Windows 32bit, run |
| 43 | + `cmake .. -G "Visual Studio 12"` |
| 44 | +- if working on Windows 64bit, run |
| 45 | + `cmake .. -G "Visual Studio 12 Win64"` |
| 46 | +- with Visual Studio open [your path]\nix-mx\build\nix-mx.sln |
| 47 | +- Build "ALL_BUILD" |
| 48 | +- copy all of the following files into the [your path]\nix-mx\build folder; simply providing the directories to MatLab using "addpath" does not work |
| 49 | + |
| 50 | + from [your path]\nix-dep\[x86/x64]\hdf5-1.8.14\bin (path dependent on the Windows 32/64 bit version) |
| 51 | + |
| 52 | + `hdf5.dll, msvcp120.dll, msvcr120.dll, szip.dll, zlib.dll` |
| 53 | + |
| 54 | + from [your path]\nix\build\Debug |
| 55 | + |
| 56 | + `nix.dll` |
| 57 | + |
| 58 | + from [your path]\nix-mx\build\Debug |
| 59 | + |
| 60 | + `nix_mx.mexw32 or nix_mx.mexw64` |
| 61 | + |
| 62 | +- get some NIX files from the [your path]\nix\build\ test folder and NIX away! |
| 63 | + |
| 64 | + |
| 65 | +**Alternate build process for RELEASE build** |
| 66 | + |
| 67 | +The build described above is for DEBUG which prevents the usage of msvcp120.dll and msvcr120.dll and requires the usage of msvcp120d.dll and msvcr120d.dll |
| 68 | + |
| 69 | +To use the correct dlls, nix and nix-mx have to be built in RELEASE mode! For this: |
| 70 | +- replace "Debug" with "Release" in the nixenv.bat, use this to setup environmental variables |
| 71 | +- run cmake |
| 72 | +- open sln, in Visual Studio set BUILD->ConfigurationManager->Active solution configuration to "Release" instead of "Debug" |
| 73 | +- re-run TestRunner.exe in folder "Release" instead of "Debug" |
| 74 | +- move to the [your path]\nix-mx\build folder |
| 75 | +- re-run the modified nixenv.bat |
| 76 | +- run |
| 77 | + |
| 78 | + `$env:NIX_ROOT="c:/work/nix"` |
| 79 | +- open [your path]\nix-mx\cmake\FindNIX.cmake and add |
| 80 | + |
| 81 | + "HINTS $ENV{NIX_ROOT}/build/Release" to the "find_library(NIX_LIBRARY NAMES" statement |
| 82 | +- run cmake |
| 83 | +- open sln, in Visual Studio set BUILD->ConfigurationManager->Active solution configuration to "Release" instead of "Debug" |
| 84 | +- setup the rest like in debug mode |
0 commit comments