Skip to content

Commit dbe7399

Browse files
authored
Merge pull request #154 from mpsonntag/batch
lgtm
2 parents a93139b + a9ef906 commit dbe7399

File tree

3 files changed

+124
-20
lines changed

3 files changed

+124
-20
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
About NIX-MX
22
-------------
33

4-
The *NIX-MX* project is an extension to [NIX] (https://github.com/G-Node/nix) and provides Matlab bindings for *NIX*.
4+
The *NIX-MX* project is an extension to [NIX](https://github.com/G-Node/nix) and provides Matlab bindings for *NIX*.
55

66

77
Development Status
@@ -15,8 +15,8 @@ Getting Started (Windows 32/64)
1515

1616
**Quick start packages, Beta-Release 1.1.0**
1717

18-
The [quick start packages] (https://github.com/G-Node/nix-mx/releases) are compiled under Windows 32/64 and contain all dlls, binary and Matlab files required to use NIX-MX with the respective Windows OS.
19-
The included *NIX* dll is a [stable release 1.3.2 build] (https://github.com/G-Node/nix/releases/tag/1.3.2) . To use the packages, unzip them into a folder of your choice and run the `startup.m` script from the root folder. Do not change the file/folder structure.
18+
The [quick start packages](https://github.com/G-Node/nix-mx/releases) are compiled under Windows 32/64 and contain all dlls, binary and Matlab files required to use NIX-MX with the respective Windows OS.
19+
The included *NIX* dll is a [stable release 1.3.2 build](https://github.com/G-Node/nix/releases/tag/1.3.2) . To use the packages, unzip them into a folder of your choice and run the `startup.m` script from the root folder. Do not change the file/folder structure.
2020

2121
The Windows 32 package contains:
2222
- HDF5 dlls (Release 1.8.14)

startuptests.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
addpath(genpath(pwd));
2+
RunTests;
3+
if (stats.errorCount > 0)
4+
exit(1);
5+
end
6+
exit(0);

win_build.bat

Lines changed: 115 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,63 @@
1+
@ECHO off
2+
SET MATLAB_BINARY=c:\work\MATLAB_R2011a\bin
3+
REM Latest dependencies at https://projects.g-node.org/nix/
14
SET NIX_DEP=c:\work\nix-dep
5+
REM clone nix source from https://github.com/G-Node/nix
26
SET NIX_ROOT=c:\work\nix
37
SET NIX_MX_ROOT=c:\work\nix-mx
4-
REM Use only build types "Release" or "Debug"
5-
SET BUILD_TYPE=Release
68

7-
IF NOT %BUILD_TYPE% == Release (IF NOT %BUILD_TYPE% == Debug (ECHO Please use only Release or Debug as BUILD_TYPE))
9+
IF NOT EXIST %NIX_DEP% (
10+
ECHO Please provide valid nix dependencies.
11+
EXIT /b
12+
)
13+
14+
IF NOT EXIST %NIX_ROOT% (
15+
ECHO Please provide valid nix root directory.
16+
EXIT /b
17+
)
18+
19+
IF NOT EXIST %NIX_MX_ROOT% (
20+
ECHO Please provide valid nix-mx root directory.
21+
EXIT /b
22+
)
23+
24+
ECHO Use only build types "Release" or "Debug"
25+
IF "%1" == "Debug" (SET BUILD_TYPE=Debug)
26+
IF "%BUILD_TYPE%" == "" (SET BUILD_TYPE=Release)
27+
28+
IF NOT %BUILD_TYPE% == Release (IF NOT %BUILD_TYPE% == Debug (ECHO Only Release or Debug are supported build types))
829
IF NOT %BUILD_TYPE% == Release (IF NOT %BUILD_TYPE% == Debug (EXIT /b))
9-
REM Set NIX_BUILD_DIR for nix-mx FindNIX.cmake
10-
SET NIX_BUILD_DIR=%NIX_ROOT%\build\%BUILD_TYPE%
1130

12-
IF %BUILD_TYPE% == Debug (CALL %NIX_DEP%\nixenv.bat Debug) ELSE (CALL %NIX_DEP%\nixenv.bat)
31+
ECHO --------------------------------------------------------------------------
32+
ECHO Setting up environment ...
33+
ECHO --------------------------------------------------------------------------
34+
35+
IF "%PLATFORM%" == "" (IF %PROCESSOR_ARCHITECTURE% == x86 (SET PLATFORM=x86) ELSE (SET PLATFORM=x64))
36+
ECHO Platform: %PLATFORM% (%BUILD_TYPE%)
37+
38+
SET BASE=%NIX_DEP%\%PLATFORM%\%BUILD_TYPE%
39+
40+
SET CPPUNIT_INCLUDE_DIR=%BASE%\cppunit-1.13.2\include
41+
SET PATH=%PATH%;%CPPUNIT_INCLUDE_DIR%
42+
43+
SET HDF5_BASE=%NIX_DEP%\%PLATFORM%\hdf5-1.8.14
44+
SET HDF5_DIR=%HDF5_BASE%\cmake\hdf5
45+
SET PATH=%PATH%;%HDF5_BASE%\bin
46+
47+
SET BOOST_ROOT=%BASE%\boost-1.57.0
48+
SET BOOST_INCLUDEDIR=%BOOST_ROOT%\include\boost-1_57
49+
50+
ECHO CPPUNIT_INCLUDE_DIR=%CPPUNIT_INCLUDE_DIR%
51+
IF EXIST %CPPUNIT_INCLUDE_DIR% (ECHO cppunit OK) ElSE (EXIT /b)
52+
ECHO HDF5_DIR=%HDF5_DIR%
53+
IF EXIST %HDF5_DIR% (ECHO hdf5 OK) ELSE (EXIT /b)
54+
ECHO BOOST_INCLUDEDIR=%BOOST_INCLUDEDIR%
55+
IF EXIST %BOOST_ROOT% (ECHO boost OK) ELSE (EXIT /b)
56+
57+
ECHO --------------------------------------------------------------------------
58+
ECHO Setting up nix build ...
59+
ECHO --------------------------------------------------------------------------
60+
SET NIX_BUILD_DIR=%NIX_ROOT%\build\%BUILD_TYPE%
1361

1462
IF NOT EXIST %NIX_ROOT%\build (MKDIR %NIX_ROOT%\build)
1563
CD %NIX_ROOT%\build
@@ -19,30 +67,80 @@ RD /S /Q "CMakeFiles" "Testing" "Debug" "Release" "nix-tool.dir" "x64" "TestRunn
1967

2068
IF %PROCESSOR_ARCHITECTURE% == x86 ( cmake .. -G "Visual Studio 12") ELSE (cmake .. -G "Visual Studio 12 Win64")
2169

22-
REM Start %NIX_ROOT%\build\nix.sln
23-
cmake --build . --config %CONFIGURATION% --target nix
70+
ECHO --------------------------------------------------------------------------
71+
ECHO Building nix via %NIX_ROOT%\build\nix.sln ...
72+
ECHO --------------------------------------------------------------------------
73+
cmake --build . --config %BUILD_TYPE% --target nix
74+
75+
IF %ERRORLEVEL% == 1 (EXIT /b)
76+
77+
ECHO --------------------------------------------------------------------------
78+
ECHO Building nix testrunner ...
79+
ECHO --------------------------------------------------------------------------
80+
cmake --build . --config %BUILD_TYPE% --target testrunner
81+
82+
IF %ERRORLEVEL% == 1 (EXIT /b)
2483

84+
ECHO --------------------------------------------------------------------------
85+
ECHO Testing nix ...
86+
ECHO --------------------------------------------------------------------------
2587
%NIX_BUILD_DIR%\TestRunner.exe
2688

89+
IF %ERRORLEVEL% == 1 (EXIT /b)
90+
91+
REM nix-mx requires nixversion file in ../nix/include/nix
92+
IF EXIST %NIX_ROOT%\build\include\nix\nixversion.hpp (
93+
COPY %NIX_ROOT%\build\include\nix\nixversion.hpp %NIX_ROOT%\include\nix\
94+
)
95+
96+
ECHO --------------------------------------------------------------------------
97+
ECHO Setting up nix-mx build ...
98+
ECHO --------------------------------------------------------------------------
2799
IF NOT EXIST %NIX_MX_ROOT%\build (MKDIR %NIX_MX_ROOT%\build)
28100
CD %NIX_MX_ROOT%\build
29101
REM Clean up build folder to ensure clean build.
30102
DEL * /S /Q
31103
RD /S /Q "CMakeFiles" "Debug" "nix_mx.dir" "Release" "Win32" "x64"
32104

33-
COPY %NIX_BUILD_DIR%\nix.dll %NIX_MX_ROOT%\build\ /Y
34-
COPY %HDF5_BASE%\bin\hdf5.dll %NIX_MX_ROOT%\build\ /Y
35-
COPY %HDF5_BASE%\bin\msvcp120.dll %NIX_MX_ROOT%\build\ /Y
36-
COPY %HDF5_BASE%\bin\msvcr120.dll %NIX_MX_ROOT%\build\ /Y
37-
COPY %HDF5_BASE%\bin\szip.dll %NIX_MX_ROOT%\build\ /Y
38-
COPY %HDF5_BASE%\bin\zlib.dll %NIX_MX_ROOT%\build\ /Y
105+
REM Copying required libraries to nix-mx root folder
106+
COPY %NIX_BUILD_DIR%\nix.dll %NIX_MX_ROOT%\ /Y
107+
COPY %HDF5_BASE%\bin\hdf5.dll %NIX_MX_ROOT%\ /Y
108+
COPY %HDF5_BASE%\bin\msvcp120.dll %NIX_MX_ROOT%\ /Y
109+
COPY %HDF5_BASE%\bin\msvcr120.dll %NIX_MX_ROOT%\ /Y
110+
COPY %HDF5_BASE%\bin\zlib.dll %NIX_MX_ROOT%\ /Y
111+
COPY %HDF5_BASE%\bin\szip.dll %NIX_MX_ROOT%\ /Y
39112

40113
IF %PROCESSOR_ARCHITECTURE% == x86 (cmake .. -G "Visual Studio 12") ELSE (cmake .. -G "Visual Studio 12 Win64")
41114

42-
cmake --build . --config %CONFIGURATION%
115+
ECHO --------------------------------------------------------------------------
116+
ECHO Building nix-mx via %NIX_MX_ROOT%\build\nix-mx.sln ...
117+
ECHO --------------------------------------------------------------------------
118+
cmake --build . --config %BUILD_TYPE%
119+
120+
IF %ERRORLEVEL% == 1 (EXIT /b)
43121

44-
COPY %NIX_MX_ROOT%\build\%BUILD_TYPE%\nix_mx.mexw* %NIX_MX_ROOT%\build\ /Y
122+
REM Copying required nix-mx.mex file to nix-mx root folder
123+
COPY %NIX_MX_ROOT%\build\%BUILD_TYPE%\nix_mx.mexw* %NIX_MX_ROOT%\ /Y
45124

46125
CD %NIX_MX_ROOT%
47126

48-
Start %NIX_MX_ROOT%\startup.m
127+
ECHO --------------------------------------------------------------------------
128+
ECHO Running nix-mx tests ...
129+
ECHO --------------------------------------------------------------------------
130+
SET PATH=%PATH%;%MATLAB_BINARY%
131+
SET TEST_LOG=nix-mx-build.log~
132+
matlab -wait -nodesktop -nosplash -logfile %TEST_LOG% -r startuptests
133+
134+
IF %ERRORLEVEL% == 1 (
135+
TYPE %TEST_LOG%
136+
ECHO --------------------------------------------------------------------------
137+
ECHO Matlab tests failed, check details above.
138+
ECHO --------------------------------------------------------------------------
139+
) ELSE (
140+
ECHO --------------------------------------------------------------------------
141+
ECHO Build complete, all tests passed!
142+
ECHO Use "startup.m" to start your nix-mx experience!
143+
ECHO --------------------------------------------------------------------------
144+
)
145+
146+
DEL %TEST_LOG%

0 commit comments

Comments
 (0)