Skip to content

Commit

Permalink
Updated the installation of ARC use the Makefile (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinp0 authored Feb 6, 2023
1 parent 036f929 commit 32e128d
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions devtools/install_all.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash
CONDA_BASE=$(conda info --base)
source $CONDA_BASE/etc/profile.d/conda.sh

# shellcheck source=/dev/null
source "$CONDA_BASE/etc/profile.d/conda.sh"

###Check if Mamba is installed####
#Check if mamba/conda is installed
if [ -x "$(command -v mamba)" ]; then
Expand All @@ -17,26 +21,29 @@ pushd .
cd ..

if [ -d "./RMG-database" ]; then
cd RMG-database
cd RMG-database || exit
git pull https://github.com/ReactionMechanismGenerator/RMG-database
cd ..
else
git clone https://github.com/ReactionMechanismGenerator/RMG-database
fi;

if [ -d "./RMG-Py" ]; then
cd RMG-Py
cd RMG-Py || exit
git pull https://github.com/ReactionMechanismGenerator/RMG-Py
else
git clone https://github.com/ReactionMechanismGenerator/RMG-Py
cd RMG-Py
cd RMG-Py || exit
fi;


echo "export PYTHONPATH=$PYTHONPATH:$(pwd)" >> ~/.bashrc
echo "export PATH=$PATH:$(pwd)" >> ~/.bashrc
export PYTHONPATH=$PYTHONPATH:$(pwd)
export PATH=$PATH:$(pwd)
PYTHONPATH=$PYTHONPATH:$(pwd)
export PYTHONPATH
PATH=$PATH:$(pwd)
export PATH
# shellcheck source=~/.bashrc
source ~/.bashrc

#Creating rmg_env environment (or updating if it already exists)
Expand All @@ -50,10 +57,10 @@ fi;
#Prior to activation of the environment, the LD_LIBRARY_PATH needs to be set as an environmnet variable when rmg_env is activated.
#This exporting and unsetting will solve the RMS installation during the Julia compile and also when the environment is deactivated
#the original LD_LIBRARY_PATH is set.
echo "export OLD_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $CONDA_BASE/envs/rmg_env/etc/conda/activate.d/env_vars.sh
echo "export LD_LIBRARY_PATH=$CONDA_BASE/envs/rmg_env/lib:$LD_LIBRARY_PATH" >> $CONDA_BASE/envs/rmg_env/etc/conda/activate.d/env_vars.sh
echo "export LD_LIBRARY_PATH=${OLD_LD_LIBRARY_PATH}" >> $CONDA_BASE/envs/rmg_env/etc/conda/deactivate.d/env_vars.sh
echo "unset OLD_LD_LIBRARY_PATH" >> $CONDA_BASE/envs/rmg_env/etc/conda/deactivate.d/env_vars.sh
echo "export OLD_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> "$CONDA_BASE/envs/rmg_env/etc/conda/activate.d/env_vars.sh"
echo "export LD_LIBRARY_PATH=$CONDA_BASE/envs/rmg_env/lib:$LD_LIBRARY_PATH" >> "$CONDA_BASE/envs/rmg_env/etc/conda/activate.d/env_vars.sh"
echo "export LD_LIBRARY_PATH=${OLD_LD_LIBRARY_PATH}" >> "$CONDA_BASE/envs/rmg_env/etc/conda/deactivate.d/env_vars.sh"
echo "unset OLD_LD_LIBRARY_PATH" >> "$CONDA_BASE/envs/rmg_env/etc/conda/deactivate.d/env_vars.sh"


#Active rmg_env environment
Expand All @@ -74,10 +81,6 @@ conda activate rmg_env
python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"
julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main"));using ReactionMechanismSimulator'





conda activate t3_env
# check that Python and Julia are being accessed from the t3_env
echo checking which python...
Expand All @@ -87,32 +90,27 @@ which julia
echo linking python-jl to python...
ln -sfn $(which python-jl) $(which python)



cd ..
if [ -d "./ARC" ]; then
cd ARC
cd ARC || exit
git pull https://github.com/ReactionMechanismGenerator/ARC
else
git clone https://github.com/ReactionMechanismGenerator/ARC
cd ARC
cd ARC || exit
fi;

export PYTHONPATH=$PYTHONPATH:$(pwd)
PYTHONPATH=$PYTHONPATH:$(pwd)
export PYTHONPATH
echo "export PYTHONPATH=$PYTHONPATH:$(pwd)" >> ~/.bashrc
if { conda env list | grep 'arc_env'; } >/dev/null 2>&1; then
$COMMAND_PKG env update -n arc_env -f environment.yml
else
$COMMAND_PKG env create -f environment.yml
fi;

conda activate arc_env
#make install-all
###Temp### To be used until ARC repo install is properly updated
$COMMAND_PKG create -n xtb_env python=3.7 -y
conda activate xtb_env
$COMMAND_PKG install -c conda-forge xtb -y
$COMMAND_PKG install -c anaconda pyyaml -y
##########
make install-all


conda deactivate

Expand Down

0 comments on commit 32e128d

Please sign in to comment.