-
Notifications
You must be signed in to change notification settings - Fork 8
/
ilastik.bat.in
70 lines (54 loc) · 2.5 KB
/
ilastik.bat.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
@echo OFF
SETLOCAL
rem find CPLEX in the original PATH. FIXME: do we need to be more specific, e.g. cplex125.dll ?
where /Q cplex
if NOT ERRORLEVEL 1 for /f "delims=" %%a in ('where cplex') do @set CPLEX_PATH=%%~dpa
rem find Gurobi in the original PATH. FIXME: do we need to be more specific, e.g. gurobi55.dll ?
where /Q gurobi
if NOT ERRORLEVEL 1 for /f "delims=" %%a in ('where gurobi') do @set GUROBI_PATH=%%~dpa
rem overwrite PATH with only what ilastik needs
set INSTALL_DIR=%~dp0
set PATH=%INSTALL_DIR%bin;%INSTALL_DIR%Qt4\bin;%INSTALL_DIR%python
rem re-insert CPLEX and Gurobi into the PATH if they were found
rem (note: we cannot use 'if () else ()' here, because it conflicts with parentheses in the %PATH%)
if DEFINED CPLEX_PATH set PATH=%PATH%;%CPLEX_PATH%
if DEFINED GUROBI_PATH set PATH=%PATH%;%GUROBI_PATH%
rem otherwise, issue a warning when ilastik was compiled with chaingraph support
if NOT DEFINED CPLEX_PATH if EXIST "%INSTALL_DIR%python\Lib\site-packages\pgmlink.pyd" echo WARNING: CPLEX is not in the PATH -- chaingraph tracking will be unavailable.
rem set more paths
set QTDIR=%INSTALL_DIR%Qt4
IF ["%ILASTIK_DIR%"] EQU [""] set ILASTIK_DIR=%INSTALL_DIR%ilastik
set PYTHONPATH=%ILASTIK_DIR%\lazyflow;%ILASTIK_DIR%\volumina;%ILASTIK_DIR%\ilastik
rem check if this script was called as 'lastik test'
if /I "%1" EQU "test" goto :testing
rem if not, start ilastik normally
echo Loading ilastik from "%ILASTIK_DIR%"
"%INSTALL_DIR%python\python" "%ILASTIK_DIR%\ilastik\ilastik.py" %*
goto :end
:testing
rem run selected tests
set failed=0
echo ----------------------------
echo Running volumina tests...
cd "%ILASTIK_DIR%\volumina\tests"
"%INSTALL_DIR%python\python" -c "import nose; nose.run()"
if %errorlevel% neq 0 set failed=1
echo ----------------------------
echo Running lazyflow tests...
cd "%ILASTIK_DIR%\lazyflow\tests"
"%INSTALL_DIR%python\python" -c "import nose; nose.run()"
if %errorlevel% neq 0 set failed=1
echo ----------------------------
echo Running ilastik headless tests...
cd "%ILASTIK_DIR%\ilastik\tests"
"%INSTALL_DIR%python\python" -c "import nose; nose.run()"
if %errorlevel% neq 0 set failed=1
rem Do not run all GUI tests, but run just one to verify there are no major problems with app startup.
echo ----------------------------
echo Running basic pixel classification GUI test...
cd "%ILASTIK_DIR%\ilastik\tests"
"%INSTALL_DIR%python\python" test_applets\pixelClassification\testPixelClassificationGui.py
if %errorlevel% neq 0 set failed=1
if %failed% NEQ 0 ENDLOCAL & exit /b 1
:end
ENDLOCAL