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