diff --git a/.gitignore b/.gitignore index 4da6f695a5a24bba1af62d692e041f8a5ca1af0b..6546e1b543d3b10de9cc74afb7308016790a9eb8 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 acfde1c73dc655e786e12b0c0b7c730f86eb1343..84f8965f59445e2b2193f959c4f62c0dc07d7b28 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 f48d209bddfbc2776acbb9d7c6ba736ee704d679..923b8c1c23c68ad047e19677f19ca282c00edf22 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 b5278d706cdd958420132ff9974b06bfca2de1fb..28ada224c878600534051b003f31a06f2845d0d5 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 41aa16cbbef58af3b73a8fa62c9ae60ab83f6d81..e6a4f901f40d165697b4456be5912ebff35c2b77 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 5854cdb5e9e524b2c6f9ac7d54a0ca9e9106b277..1b00e05086055d2ddc6bfee3853d7d6f2f478dc5 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 fbf4c8b15da7122b8d05985f6cc00511d2623d1a..606a83434cb427f2f2b5e129b391a91722785011 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 493dffe20c6bf98f3a2f337b14e2d2b7cf7b681f..6afc953582c01de55d8d72d8c16e96106858e50a 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 ""