From f7a0636f290c474612a29e96997b1b40d0132fac Mon Sep 17 00:00:00 2001 From: Christoph Knote Date: Thu, 10 Mar 2022 18:00:30 +0100 Subject: [PATCH] Remove boxmox_path for now --- .gitignore | 4 ++++ Makefile.am_BLUEPRINT | 10 ++++++++-- configure.ac | 1 + scripts/list_BOXMOX_mechanisms | 19 ++++++++++--------- scripts/new_BOXMOX_experiment | 6 ++---- scripts/new_BOXMOX_experiment_from_example | 6 ++---- scripts/prepare_BOXMOX_mechanism | 4 +--- scripts/validate_BOXMOX_installation | 8 +++----- 8 files changed, 31 insertions(+), 27 deletions(-) diff --git a/.gitignore b/.gitignore index 4da6f69..6546e1b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,10 @@ doc/boxmox*aux doc/boxmox*log doc/boxmox*pdf +src/bison.c +src/bison.h +src/yacc.c + **~ # bc we create this automatically using build_dist.sh diff --git a/Makefile.am_BLUEPRINT b/Makefile.am_BLUEPRINT index acfde1c..84f8965 100644 --- a/Makefile.am_BLUEPRINT +++ b/Makefile.am_BLUEPRINT @@ -39,6 +39,12 @@ dist_bin_SCRIPTS = scripts/list_BOXMOX_mechanisms \ scripts/prepare_BOXMOX_mechanism \ scripts/validate_BOXMOX_installation +install-data-local: + $(MKDIR_P) $(DESTDIR)$(pkgdatadir)/compiled_mechs + +uninstall-local: + rmdir $(DESTDIR)$(pkgdatadir)/compiled_mechs 2>/dev/null || : + all-local: @echo " " @echo " --- YOU ARE GOOD TO GO ---" @@ -47,7 +53,7 @@ all-local: @echo "your .bashrc, .profile (a hidden file in your home directory)" @echo "or similar, so they are executed upon login:" @echo " " - @echo "export KPP_HOME=${prefix}" - @echo "export PATH=\$$KPP_HOME/bin:\$$KPP_HOME/boxmox/bin:\$$PATH" + @echo "export KPP_HOME=${prefix}/share/boxmox" + @echo "export PATH=${prefix}/bin:\$$PATH" @echo " " diff --git a/configure.ac b/configure.ac index f48d209..923b8c1 100644 --- a/configure.ac +++ b/configure.ac @@ -8,6 +8,7 @@ AM_INIT_AUTOMAKE([-Wall foreign tar-pax]) AC_PROG_CC AC_PROG_LEX(noyywrap) AC_PROG_YACC +AC_PROG_MKDIR_P AC_CONFIG_FILES([ Makefile src/Makefile diff --git a/scripts/list_BOXMOX_mechanisms b/scripts/list_BOXMOX_mechanisms index b5278d7..28ada22 100755 --- a/scripts/list_BOXMOX_mechanisms +++ b/scripts/list_BOXMOX_mechanisms @@ -14,8 +14,6 @@ done shift $(($OPTIND - 1)) -BOXMOX_PATH=${KPP_HOME}/boxmox - # sanity checks if $help then @@ -28,16 +26,20 @@ fi # check if BOXMOX is correctly set up validate_BOXMOX_installation || { echo "Validating BOXMOX installation failed"; exit 1; } -BOXMOX_MECH_PATH=${BOXMOX_PATH}/compiled_mechs +BOXMOX_MECH_PATH=${KPP_HOME}/compiled_mechs -for mech in $(ls -1 -d ${BOXMOX_MECH_PATH}/*) -do - mechList+=($(basename $mech)) -done +if [ -z $(ls -A ${BOXMOX_MECH_PATH}) ]; then + echo No mechanisms compiled yet. +else + for mech in $(find ${BOXMOX_MECH_PATH}/*) + do + mechList+=($(basename $mech)) + done +fi if $all then - for mech in $(ls -1 ${BOXMOX_PATH}/models/*.eqn) + for mech in $(find ${KPP_HOME}/models/*.eqn) do mechi=$(basename $mech) mechList+=(${mechi/.eqn/}) @@ -46,4 +48,3 @@ fi echo $( for i in "${mechList[@]}"; do echo $i; done | sort -u ) - diff --git a/scripts/new_BOXMOX_experiment b/scripts/new_BOXMOX_experiment index 41aa16c..e6a4f90 100755 --- a/scripts/new_BOXMOX_experiment +++ b/scripts/new_BOXMOX_experiment @@ -12,8 +12,6 @@ done shift $(($OPTIND - 1)) -BOXMOX_PATH=${KPP_HOME}/boxmox - # sanity checks if [[ $# -lt 1 ]] || [[ $# -gt 2 ]] then @@ -29,9 +27,9 @@ mech_req=$1 # check if BOXMOX is correctly set up validate_BOXMOX_installation || { echo "Validating BOXMOX installation failed"; exit 1; } -BOXMOX_MECH_PATH=${BOXMOX_PATH}/compiled_mechs +BOXMOX_MECH_PATH=${KPP_HOME}/compiled_mechs -default_nml=${BOXMOX_PATH}/examples/BOXMOX.nml +default_nml=${KPP_HOME}/case_studies/BOXMOX.nml mech_path=${BOXMOX_MECH_PATH}/${mech_req} mech_exe=${mech_path}/${mech_req}.exe diff --git a/scripts/new_BOXMOX_experiment_from_example b/scripts/new_BOXMOX_experiment_from_example index 5854cdb..1b00e05 100755 --- a/scripts/new_BOXMOX_experiment_from_example +++ b/scripts/new_BOXMOX_experiment_from_example @@ -12,15 +12,13 @@ done shift $(($OPTIND - 1)) -BOXMOX_PATH=${KPP_HOME}/boxmox - # sanity checks if [[ $# -lt 1 ]] || [[ $# -gt 2 ]] then echo "Call with ()." echo "If you omit , a subfolder with the name will be used." echo "Use -f to force removal of existing experiment folder." - echo "Examples available: "$(find ${BOXMOX_PATH}/examples/* -maxdepth 1 -type d -exec basename {} \;) + echo "Examples available: "$(find ${KPP_HOME}/examples/* -maxdepth 1 -type d -exec basename {} \;) exit 1 fi @@ -30,7 +28,7 @@ example_req=$1 # check if BOXMOX is correctly set up validate_BOXMOX_installation || { echo "Validating BOXMOX installation failed"; exit 1; } -example_dir=${BOXMOX_PATH}/examples/${example_req} +example_dir=${KPP_HOME}/examples/${example_req} # check if example exists if [ ! -d ${example_dir} ] diff --git a/scripts/prepare_BOXMOX_mechanism b/scripts/prepare_BOXMOX_mechanism index fbf4c8b..606a834 100755 --- a/scripts/prepare_BOXMOX_mechanism +++ b/scripts/prepare_BOXMOX_mechanism @@ -14,8 +14,6 @@ done shift $(($OPTIND - 1)) -BOXMOX_PATH=${KPP_HOME}/boxmox - # sanity checks if [ $# -ne 1 ] then @@ -32,7 +30,7 @@ mech_req=$1 # check if BOXMOX is correctly set up validate_BOXMOX_installation || { echo "Validating BOXMOX installation failed."; exit 1; } -BOXMOX_MECH_PATH=${BOXMOX_PATH}/compiled_mechs +BOXMOX_MECH_PATH=${KPP_HOME}/compiled_mechs work_path=${KPP_HOME}/tmp_${mech_req}_${RANDOM}_BOXMOX diff --git a/scripts/validate_BOXMOX_installation b/scripts/validate_BOXMOX_installation index 493dffe..6afc953 100755 --- a/scripts/validate_BOXMOX_installation +++ b/scripts/validate_BOXMOX_installation @@ -7,17 +7,15 @@ echo "Set it with" echo "" echo "export KPP_HOME= (bash)" - echo "setenv KPP_HOME (*csh)" + echo "setenv KPP_HOME (*csh)" echo "" exit 1 } -BOXMOX_PATH=${KPP_HOME}/boxmox - -[ ! -d ${BOXMOX_PATH} ] && { +[ ! -d ${KPP_HOME} ] && { echo "" - echo "No BOXMOX found at ${BOXMOX_PATH}." + echo "No BOXMOX found at ${KPP_HOME}." echo "" echo "Please reinstall or correctly set the \$KPP_HOME environment variable." echo "" -- GitLab