From d562af2f45a1cb61b58a4e27cb1f359e1a649d7c Mon Sep 17 00:00:00 2001 From: Werner Kramer Date: Tue, 16 Jul 2019 13:48:11 +0200 Subject: [PATCH] OPENDADIR is now root dir instead of bin\ --- core/bin_external/oda_run_batch.bat | 5 +++-- core/bin_external/oda_run_gui.bat | 9 ++++----- core/bin_external/setup_openda.bat | 31 +++++++++++++++++++---------- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/core/bin_external/oda_run_batch.bat b/core/bin_external/oda_run_batch.bat index 1ab8b7763..5a2f5f034 100644 --- a/core/bin_external/oda_run_batch.bat +++ b/core/bin_external/oda_run_batch.bat @@ -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 @@ -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 === diff --git a/core/bin_external/oda_run_gui.bat b/core/bin_external/oda_run_gui.bat index 39c13edfe..dc351db46 100644 --- a/core/bin_external/oda_run_gui.bat +++ b/core/bin_external/oda_run_gui.bat @@ -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 @@ -45,13 +44,13 @@ 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 === @@ -59,7 +58,7 @@ 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 diff --git a/core/bin_external/setup_openda.bat b/core/bin_external/setup_openda.bat index bbeed9e6c..fa02e23da 100644 --- a/core/bin_external/setup_openda.bat +++ b/core/bin_external/setup_openda.bat @@ -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