From b071bead885fa95b7837e6b1e375d52a78354f0e Mon Sep 17 00:00:00 2001 From: erkn Date: Thu, 27 Apr 2023 22:10:31 +0200 Subject: [PATCH] homogenize and improve nuclear data logic --- Arch/nuclear_data-install.sh | 41 +++++++++++++++++++------------- Debian10/nuclear_data-install.sh | 20 +++++++++------- Debian11/nuclear_data-install.sh | 15 +++++++----- 3 files changed, 46 insertions(+), 30 deletions(-) diff --git a/Arch/nuclear_data-install.sh b/Arch/nuclear_data-install.sh index 368b76e..9e62f81 100755 --- a/Arch/nuclear_data-install.sh +++ b/Arch/nuclear_data-install.sh @@ -4,24 +4,33 @@ #!/bin/bash set -ex -echo "export OPENMC_CROSS_SECTIONS=$HOME/openmc/nuclear_data/endfb80_hdf5/cross_sections.xml" >> $HOME/.bashrc -source $HOME/.bashrc +if [ ! -e $0.done ]; then + if [ "x${OPENMC_CROSS_SECTIONS}"=="x" ]; then + echo "export OPENMC_CROSS_SECTIONS=$HOME/openmc/nuclear_data/mcnp_endfb71/cross_sections.xml" >> $HOME/.bashrc + fi -sudo pacman -Sy --noconfirm wget + #default libraries + endfb_VII="https://anl.box.com/shared/static/9igk353zpy8fn9ttvtrqgzvw1vtejoz6.xz" + endfb_VIII="https://anl.box.com/shared/static/uhbxlrx7hvxqw27psymfbhi7bx7s6u6a.xz" + jeff="https://anl.box.com/shared/static/4jwkvrr9pxlruuihcrgti75zde6g7bum.xz" -#defaul libraries -endfb_VII="https://anl.box.com/shared/static/9igk353zpy8fn9ttvtrqgzvw1vtejoz6.xz" -endfb_VIII="https://anl.box.com/shared/static/uhbxlrx7hvxqw27psymfbhi7bx7s6u6a.xz" -jeff="https://anl.box.com/shared/static/4jwkvrr9pxlruuihcrgti75zde6g7bum.xz" + mkdir -p $HOME/openmc/nuclear_data + cd $HOME/openmc/nuclear_data -cd /opt -sudo mkdir -p nuclear_data -cd nuclear_data + toget=$endfb_VIII -#see other default options above -sudo wget $endfb_VIII + if [ ! -e `basename $toget` ]; then + #see other default options above + wget $toget + + for entry in "$PWD"/*.xz + do + tar -xvf $entry + done + fi + touch ${0}.done +else + name=`basename $0` + echo nuclear data appears to already be installed \(lock file ${name}.done exists\) - skipping. +fi -for entry in "$PWD"/* -do - sudo tar -xvf $entry -done diff --git a/Debian10/nuclear_data-install.sh b/Debian10/nuclear_data-install.sh index d82196e..dc2cde8 100755 --- a/Debian10/nuclear_data-install.sh +++ b/Debian10/nuclear_data-install.sh @@ -5,22 +5,26 @@ set -ex if [ ! -e $0.done ]; then - echo "export OPENMC_CROSS_SECTIONS=$HOME/openmc/nuclear_data/mcnp_endfb71/cross_sections.xml" >> $HOME/.bashrc - source $HOME/.bashrc + if [ "x${OPENMC_CROSS_SECTIONS}"=="x" ]; then + echo "export OPENMC_CROSS_SECTIONS=$HOME/openmc/nuclear_data/mcnp_endfb71/cross_sections.xml" >> $HOME/.bashrc + fi + #default libraries - endfb_VII="https://anl.box.com/shared/static/d359skd2w6wrm86om2997a1bxgigc8pu.xz" - endfb_VIII="https://anl.box.com/shared/static/nd7p4jherolkx4b1rfaw5uqp58nxtstr.xz" - jeff="https://anl.box.com/shared/static/ddetxzp0gv1buk1ev67b8ynik7f268hw.xz" + endfb_VII="https://anl.box.com/shared/static/9igk353zpy8fn9ttvtrqgzvw1vtejoz6.xz" + endfb_VIII="https://anl.box.com/shared/static/uhbxlrx7hvxqw27psymfbhi7bx7s6u6a.xz" + jeff="https://anl.box.com/shared/static/4jwkvrr9pxlruuihcrgti75zde6g7bum.xz" mkdir -p $HOME/openmc/nuclear_data cd $HOME/openmc/nuclear_data - if [ ! -e `basename $endfb_VII` ]; then + toget=$endfb_VIII + + if [ ! -e `basename $toget` ]; then #see other default options above - wget $endfb_VII + wget $toget - for entry in "$PWD"/* + for entry in "$PWD"/*.xz do tar -xvf $entry done diff --git a/Debian11/nuclear_data-install.sh b/Debian11/nuclear_data-install.sh index 9327f93..dc2cde8 100755 --- a/Debian11/nuclear_data-install.sh +++ b/Debian11/nuclear_data-install.sh @@ -9,19 +9,22 @@ if [ ! -e $0.done ]; then echo "export OPENMC_CROSS_SECTIONS=$HOME/openmc/nuclear_data/mcnp_endfb71/cross_sections.xml" >> $HOME/.bashrc fi + #default libraries - endfb_VII="https://anl.box.com/shared/static/d359skd2w6wrm86om2997a1bxgigc8pu.xz" - endfb_VIII="https://anl.box.com/shared/static/nd7p4jherolkx4b1rfaw5uqp58nxtstr.xz" - jeff="https://anl.box.com/shared/static/ddetxzp0gv1buk1ev67b8ynik7f268hw.xz" + endfb_VII="https://anl.box.com/shared/static/9igk353zpy8fn9ttvtrqgzvw1vtejoz6.xz" + endfb_VIII="https://anl.box.com/shared/static/uhbxlrx7hvxqw27psymfbhi7bx7s6u6a.xz" + jeff="https://anl.box.com/shared/static/4jwkvrr9pxlruuihcrgti75zde6g7bum.xz" mkdir -p $HOME/openmc/nuclear_data cd $HOME/openmc/nuclear_data - if [ ! -e `basename $endfb_VII` ]; then + toget=$endfb_VIII + + if [ ! -e `basename $toget` ]; then #see other default options above - wget $endfb_VII + wget $toget - for entry in "$PWD"/* + for entry in "$PWD"/*.xz do tar -xvf $entry done