Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions core/bin_external/oda_run_batch.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ rem or
rem Set openda_bindir right here below.
rem OPENDADIR added to PATH by setup_openda.bat
call %~dp0\setup_openda.bat
set OPENDA_BINDIR=%OPENDADIR%\bin

rem ==== check command line argumtents
if "%1"=="" goto Error2
Expand All @@ -25,12 +26,12 @@ goto Error4
:no_jre
rem ==== if not specified by the user,
rem check if jre is available as distributed with openda ====
set OPENDA_JRE="%OPENDA_BINDIR%..\jre"
set OPENDA_JRE="%OPENDADIR%\jre"
if exist "%OPENDA_JRE%\bin\java.exe" goto JAVA_OK

rem no openda jre is available, check if there is a default one
if "%JAVA_HOME%" == "" goto Error0
set OPENDA_JRE=%JAVA_HOME%
set OPENDA_JRE="%JAVA_HOME%"

:JAVA_OK
rem ==== check availability and arguments ===
Expand Down
9 changes: 4 additions & 5 deletions core/bin_external/oda_run_gui.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ rem or
rem Set openda_bindir right here below.
rem OPENDADIR added to PATH by setup_openda.bat
call %~dp0\setup_openda.bat

set OPENDA_BINDIR=%OPENDADIR%
set OPENDA_BINDIR=%OPENDADIR%\bin

rem ==== check command line argumtents
if "%1"=="" goto no_arguments
Expand Down Expand Up @@ -45,21 +44,21 @@ set odafile=
:no_jre
rem ==== if not specified by the user,
rem check if jre is available as distributed with openda ====
set OPENDA_JRE=%OPENDA_BINDIR%\..\jre
set OPENDA_JRE=%OPENDADIR%\jre

if exist "%OPENDA_JRE%\bin\java.exe" goto JAVA_OK
rem no openda jre is available, check if there is a default one
echo JAVA_HOME %JAVA_HOME%
if "%JAVA_HOME%" == "" goto Error0
set OPENDA_JRE=%JAVA_HOME%
set OPENDA_JRE="%JAVA_HOME%"

:JAVA_OK
rem ==== check availability and arguments ===
if not exist %OPENDA_BINDIR%\openda_core.jar goto Error1

rem ==== run ===
echo %odafile%
"%OPENDA_JRE%\bin\java" -Xms512m -Xmx8g -classpath %OPENDA_BINDIR%\* org.openda.application.OpenDaApplication -gui %odafile%
"%OPENDA_JRE%\bin\java" -Xms128m -Xmx1024m -classpath %OPENDA_BINDIR%\* org.openda.application.OpenDaApplication -gui %odafile%
if errorlevel 1 goto Error2
endlocal
goto End
Expand Down
31 changes: 20 additions & 11 deletions core/bin_external/setup_openda.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@

rem Setup bin. dir for openda.
rem Script has to be run from the dir. containing the script.
set ODASYSTEM=win64_ifort
set OPENDA_BINDIR=%~dp0
for %%a in (%OPENDA_BINDIR:~0,-1%) do set "OPENDADIR=%%~dpa"
set ODALIBDIR="%OPENDADIR%\bin\%ODASYSTEM%"
echo.
echo OPENDADIR set to %OPENDADIR%
echo System set to %ODASYSTEM%

set OPENDADIR=%~dp0
set PATH=%~dp0;%PATH%
@echo OPENDADIR set to %OPENDADIR%
rem Try if setup_openda.bat can be found in the Windows PATH
rem If not OPENDA_BINDIR should be added to the PATH
rem Do not run WHERE from the current directory as it might contain setup_openda.bat
pushd .
CD /D c:\
where /Q setup_openda.bat
set NOTFOUND=%errorlevel%
popd
if %NOTFOUND%==0 goto :End

rem system type: something like win64_gnu or win32_ifort
set ODASYSTEM=win32_ifort
echo "System set to %ODASYSTEM%"

set ODALIBDIR="%OPENDADIR%\%ODASYSTEM%"

rem set OPENDA_BINDIR to OPENDADIR for now to keep things working
set OPENDA_BINDIR=%OPENDADIR%
echo Include OpenDA bin\ dir to PATH
echo.
set PATH=%OPENDADIR%\bin;%PATH%
:End