-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Micromamba installation check
- Loading branch information
Showing
8 changed files
with
230 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,30 @@ | ||
# Properly configure the shell to use 'conda activate'. | ||
CONDA_BASE=$(conda info --base) | ||
source $CONDA_BASE/etc/profile.d/conda.sh | ||
#!/bin/bash -l | ||
|
||
# Check for package manager | ||
if command -v mamba 2>/dev/null; then | ||
# Check if Micromamba is installed | ||
if [ -x "$(command -v micromamba)" ]; then | ||
echo "Micromamba is installed." | ||
COMMAND_PKG=micromamba | ||
# Check if Mamba is installed | ||
elif [ -x "$(command -v mamba)" ]; then | ||
echo "Mamba is installed." | ||
COMMAND_PKG=mamba | ||
elif command -v conda >/dev/null 2>&1; then | ||
# Check if Conda is installed | ||
elif [ -x "$(command -v conda)" ]; then | ||
echo "Conda is installed." | ||
COMMAND_PKG=conda | ||
else | ||
echo "Error: mamba or conda is not installed. Please download and install mamba or conda - we strongly recommend mamba" | ||
echo "Micromamba, Mamba, and Conda are not installed. Please download and install one of them - we strongly recommend Micromamba or Mamba." | ||
exit 1 | ||
fi | ||
|
||
$COMMAND_PKG clean -a -y | ||
$COMMAND_PKG env create -n ob_env conda-forge::openbabel | ||
conda activate ob_env | ||
# Activate the environment | ||
if [ "$COMMAND_PKG" == "micromamba" ]; then | ||
micromamba activate ob_env | ||
else | ||
conda activate ob_env | ||
fi | ||
|
||
$COMMAND_PKG install -c conda-forge pyyaml | ||
conda deactivate | ||
$COMMAND_PKG deactivate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,65 @@ | ||
# Properly configure the shell to use 'conda activate'. | ||
CONDA_BASE=$(conda info --base) | ||
source $CONDA_BASE/etc/profile.d/conda.sh | ||
#!/bin/bash -l | ||
|
||
# Check if mamba or conda is installed | ||
if command -v mamba > /dev/null; then | ||
COMMAND_PKG=mamba | ||
elif command -v conda > /dev/null; then | ||
COMMAND_PKG=conda | ||
# Check if Micromamba is installed | ||
if [ -x "$(command -v micromamba)" ]; then | ||
echo "Micromamba is installed." | ||
COMMAND_PKG=micromamba | ||
# Check if Mamba is installed | ||
elif [ -x "$(command -v mamba)" ]; then | ||
echo "Mamba is installed." | ||
COMMAND_PKG=mamba | ||
# Check if Conda is installed | ||
elif [ -x "$(command -v conda)" ]; then | ||
echo "Conda is installed." | ||
COMMAND_PKG=conda | ||
else | ||
echo "mamba and conda are not installed. Please download and install mamba or conda - we strongly recommend mamba" | ||
exit 1 | ||
echo "Micromamba, Mamba, and Conda are not installed. Please download and install one of them - we strongly recommend Micromamba or Mamba." | ||
exit 1 | ||
fi | ||
|
||
# Set up Conda/Micromamba environment | ||
if [ "$COMMAND_PKG" == "micromamba" ]; then | ||
eval "$(micromamba shell hook --shell=bash)" | ||
micromamba activate base | ||
BASE=$MAMBA_ROOT_PREFIX | ||
# shellcheck source=/dev/null | ||
source "$BASE/etc/profile.d/micromamba.sh" | ||
else | ||
BASE=$(conda info --base) | ||
# shellcheck source=/dev/null | ||
source "$BASE/etc/profile.d/conda.sh" | ||
fi | ||
|
||
# clone the repo in the parent directory | ||
echo "Creating the Sella environment..." | ||
source ~/.bashrc | ||
$COMMAND_PKG create -n sella_env python=3.7 -y | ||
conda activate sella_env | ||
$COMMAND_PKG create -n sella_env python=3.7 -c conda-forge -y | ||
# Activate the environment | ||
if [ "$COMMAND_PKG" == "micromamba" ]; then | ||
micromamba activate sella_env | ||
else | ||
conda activate sella_env | ||
fi | ||
|
||
$COMMAND_PKG install -c conda-forge xtb-python -y | ||
$COMMAND_PKG install -c conda-forge pyyaml -y | ||
$COMMAND_PKG install -c anaconda pandas -y | ||
$COMMAND_PKG install -c conda-forge ase -y | ||
$COMMAND_PKG install -c conda-forge ncurses | ||
$COMMAND_PKG install -c anaconda pip -y | ||
$CONDA_BASE/envs/sella_env/bin/pip install sella | ||
$BASE/envs/sella_env/bin/pip install sella | ||
|
||
cd $CONDA_BASE/envs/sella_env | ||
cd $BASE/envs/sella_env || exit | ||
mkdir -p ./etc/conda/activate.d | ||
mkdir -p ./etc/conda/deactivate.d | ||
touch ./etc/conda/activate.d/env_vars.sh | ||
touch ./etc/conda/deactivate.d/env_vars.sh | ||
|
||
#This sets up the LD_LIBRARY_PATH to include Sella_Env, but only when the environment is active | ||
echo 'export OLD_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}' >> $CONDA_BASE/envs/sella_env/etc/conda/activate.d/env_vars.sh | ||
echo 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:'"$CONDA_BASE"'/envs/sella_env/lib' >> $CONDA_BASE/envs/sella_env/etc/conda/activate.d/env_vars.sh | ||
echo 'export OLD_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}' >> $BASE/envs/sella_env/etc/conda/activate.d/env_vars.sh | ||
echo 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:'"$BASE"'/envs/sella_env/lib' >> $BASE/envs/sella_env/etc/conda/activate.d/env_vars.sh | ||
#This will reset the LD_LIBRARY_PATH back to the original LD_LIBRARY_PATH when the environment is deactivated | ||
echo 'export LD_LIBRARY_PATH=${OLD_LD_LIBRARY_PATH}' >> $CONDA_BASE/envs/sella_env/etc/conda/deactivate.d/env_vars.sh | ||
echo 'unset OLD_LD_LIBRARY_PATH' >> $CONDA_BASE/envs/sella_env/etc/conda/deactivate.d/env_vars.sh | ||
echo 'export LD_LIBRARY_PATH=${OLD_LD_LIBRARY_PATH}' >> $BASE/envs/sella_env/etc/conda/deactivate.d/env_vars.sh | ||
echo 'unset OLD_LD_LIBRARY_PATH' >> $BASE/envs/sella_env/etc/conda/deactivate.d/env_vars.sh | ||
|
||
source ~/.bashrc | ||
echo "Done installing Sella." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,35 @@ | ||
# Properly configure the shell to use 'conda activate'. | ||
CONDA_BASE=$(conda info --base) | ||
source $CONDA_BASE/etc/profile.d/conda.sh | ||
#!/bin/bash -l | ||
|
||
# Check for package manager | ||
if command -v mamba 2>/dev/null; then | ||
# Check if Micromamba is installed | ||
if [ -x "$(command -v micromamba)" ]; then | ||
echo "Micromamba is installed." | ||
COMMAND_PKG=micromamba | ||
# Check if Mamba is installed | ||
elif [ -x "$(command -v mamba)" ]; then | ||
echo "Mamba is installed." | ||
COMMAND_PKG=mamba | ||
elif command -v conda >/dev/null 2>&1; then | ||
# Check if Conda is installed | ||
elif [ -x "$(command -v conda)" ]; then | ||
echo "Conda is installed." | ||
COMMAND_PKG=conda | ||
else | ||
echo "Error: mamba or conda is not installed. Please download and install mamba or conda - we strongly recommend mamba" | ||
echo "Micromamba, Mamba, and Conda are not installed. Please download and install one of them - we strongly recommend Micromamba or Mamba." | ||
exit 1 | ||
fi | ||
|
||
# Set up Conda/Micromamba environment | ||
if [ "$COMMAND_PKG" == "micromamba" ]; then | ||
eval "$(micromamba shell hook --shell=bash)" | ||
micromamba activate base | ||
BASE=$MAMBA_ROOT_PREFIX | ||
# shellcheck source=/dev/null | ||
source "$BASE/etc/profile.d/micromamba.sh" | ||
else | ||
CONDA_BASE=$(conda info --base) | ||
# shellcheck source=/dev/null | ||
source "$CONDA_BASE/etc/profile.d/conda.sh" | ||
fi | ||
|
||
$COMMAND_PKG clean -a -y | ||
echo creating tani_env | ||
$COMMAND_PKG env create -f devtools/tani.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,43 @@ | ||
# Properly configure the shell to use 'conda activate'. | ||
CONDA_BASE=$(conda info --base) | ||
source $CONDA_BASE/etc/profile.d/conda.sh | ||
#!/bin/bash -l | ||
|
||
# Check if mamba or conda is installed | ||
if command -v mamba > /dev/null; then | ||
COMMAND_PKG=mamba | ||
elif command -v conda > /dev/null; then | ||
COMMAND_PKG=conda | ||
# Check if Micromamba is installed | ||
if [ -x "$(command -v micromamba)" ]; then | ||
echo "Micromamba is installed." | ||
COMMAND_PKG=micromamba | ||
# Check if Mamba is installed | ||
elif [ -x "$(command -v mamba)" ]; then | ||
echo "Mamba is installed." | ||
COMMAND_PKG=mamba | ||
# Check if Conda is installed | ||
elif [ -x "$(command -v conda)" ]; then | ||
echo "Conda is installed." | ||
COMMAND_PKG=conda | ||
else | ||
echo "mamba and conda are not installed. Please download and install mamba or conda - we strongly recommend mamba" | ||
exit 1 | ||
echo "Micromamba, Mamba, and Conda are not installed. Please download and install one of them - we strongly recommend Micromamba or Mamba." | ||
exit 1 | ||
fi | ||
|
||
# Set up Conda/Micromamba environment | ||
if [ "$COMMAND_PKG" == "micromamba" ]; then | ||
eval "$(micromamba shell hook --shell=bash)" | ||
micromamba activate base | ||
BASE=$MAMBA_ROOT_PREFIX | ||
# shellcheck source=/dev/null | ||
source "$BASE/etc/profile.d/micromamba.sh" | ||
else | ||
CONDA_BASE=$(conda info --base) | ||
# shellcheck source=/dev/null | ||
source "$CONDA_BASE/etc/profile.d/conda.sh" | ||
fi | ||
|
||
$COMMAND_PKG create -n xtb_env python=3.7 -c conda-forge -y | ||
# Activate the environment | ||
if [ "$COMMAND_PKG" == "micromamba" ]; then | ||
micromamba activate xtb_env | ||
else | ||
conda activate xtb_env | ||
fi | ||
|
||
$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 | ||
conda deactivate | ||
$COMMAND_PKG activate base |
Oops, something went wrong.