1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
#!/usr/bin/env bash
export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-$(python3 -c "import os;print(os.cpu_count())")}
# rapid-build script for mcstas-kernel dev:
git pull
# Ensure our 3rd party modules are in place and updated
THIRDPARTY=`ls 3rdparty | grep -v patches`
./3rdparty/sync.sh
WORK=`pwd`
export MCINSTALL_PREFIX=$HOME/McXtrace
export CONDALOCATION=$MCINSTALL_PREFIX/mcxtrace/3.x-dev/miniconda3
export CC=gcc
export CXX=c++
export FC=gfortran
if [[ -d $HOME/McXtrace/mcxtrace/3.x-dev ]]
then
cd $HOME/McXtrace/mcxtrace/3.x-dev
ls | grep -v miniconda3 | xargs -n1 rm -rf
cd -
fi
if [ ! -f Miniforge3-$(uname)-$(uname -m).sh ]; then
# Download and embed a miniconda
echo
echo "*********************************************************"
echo "* Downloading a miniconda3 for your app *"
echo "*********************************************************"
echo
sleep 3
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
fi
if [[ ! -d $CONDALOCATION ]]; then
echo "*********************************************************"
echo "* Embedding miniconda3 in your app *"
echo "*********************************************************"
chmod a+x Miniforge3-$(uname)-$(uname -m).sh
./Miniforge3-$(uname)-$(uname -m).sh -b -p $CONDALOCATION
# Run conda to install the dependencies
echo
echo "*********************************************************"
echo "* Downloading python dependencies to embedded miniconda *"
echo "*********************************************************"
echo
export PATH=$CONDALOCATION/bin:$PATH
mamba update mamba -y
mamba install cmake compilers flex bison nodejs gsl pyaml ply matplotlib numpy tornado scipy pillow pyqtgraph pyqt nomkl qscintilla2 nexusformat nexpy hdf5 nexus mcpl xraylib -y
mamba clean --all -y
fi
./mkdist mcxtrace 3.x-dev "" "" deb64 "" -- justinst
./mkdist mcxtrace-comps 3.x-dev "" "" deb64 "" -- justinst
./mkdist mcxtrace-tools-python-mxgui 3.x-dev tools/Python/mcgui/ "" deb64 "" -- justinst
./mkdist mcxtrace-tools-python-mxrun 3.x-dev tools/Python/mcrun/ "" deb64 "" -- justinst
./mkdist mcxtrace-tools-python-mxdoc 3.x-dev tools/Python/mcdoc/ "" deb64 "" -- justinst
./mkdist mcxtrace-tools-python-mxtest 3.x-dev tools/Python/mctest/ "" deb64 "" -- justinst
./mkdist mcxtrace-tools-python-mccodelib 3.x-dev tools/Python/mccodelib/ "" deb64 "" -- justinst
./mkdist mcxtrace-tools-python-mxdisplay-pyqtgraph 3.x-dev tools/Python/mcdisplay/pyqtgraph/ "" deb64 "" -- justinst
./mkdist mcxtrace-tools-python-mxplot-pyqtgraph 3.x-dev tools/Python/mcplot/pyqtgraph/ "" deb64 "" -- justinst
./mkdist mcxtrace-tools-python-mxplot-html 3.x-dev tools/Python/mcplot/html/ "" deb64 "" -- justinst
./mkdist mcxtrace-tools-python-mxplot-matplotlib 3.x-dev tools/Python/mcplot/matplotlib/ "" deb64 "" -- justinst
cp tools/other/mcsplit/mcsplit.py $HOME/McXtrace/mcxtrace/3.x-dev/bin/
# Ensure we are configured for 10 node MPI runs
sed -i s/\'4\'/\'10\'/g $HOME/McXtrace/mcxtrace/3.x-dev/tools/Python/mccodelib/mccode_config.py
$HOME/McXtrace/mcxtrace/3.x-dev/bin/mxdoc -i
|