Commit 2ab5d52b authored by Willi Rath's avatar Willi Rath

Add setup for MacOSX

parent 619e7983
Pipeline #462 passed with stage
in 20 minutes and 41 seconds
......@@ -63,7 +63,7 @@ for details.
## Installing the environments on an own machine
### Complete setup
### Complete setup on Linux
There is a setup script doing a full setup:
[setup_anaconda.sh](https://git.geomar.de/python/conda_environments/tree/master/setup_anaconda.sh)
......@@ -81,6 +81,24 @@ cd conda_environments
Then, follow the steps above to activate the respective enviroment.
### Complete setup on MacOSX
There is a setup script doing a full setup:
[setup_anaconda_MacOSX.sh](https://git.geomar.de/python/conda_environments/tree/master/setup_anaconda_MacOSX.sh)
Run it without arguments to get a help message.
To install all environments defined in
[env_files/](https://git.geomar.de/python/conda_environments/tree/master/env_files)
to a path `<target_dir>`, run:
```bash
git clone git@git.geomar.de:python/conda_environments.git
cd conda_environments
./setup_anaconda_MacOSX.sh <target dir>
```
Then, follow the steps above to activate the respective enviroment.
### Adding an environment to an existing setup
If you have an own instance of `miniconda`, you can first activate its `root`
......
#!/bin/bash
# how to use?
echo "Usage:" $0 "<target dir> [env1] [env2] ..."
echo ""
echo "<target dir> : full path to miniconda installation."
echo " Should include time stamp or similar."
echo ""
echo "[env*] : env files (incl. path)"
echo ""
[ $# -eq 0 ] && exit
# get target directory
target_dir=$1
echo "... installing in " ${target_dir}
# download miniconda
time_stamp=`date +%s%N`
installer=/tmp/${time_stamp}_miniconda3.sh
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O ${installer}
# install miniconda and clean up
bash ${installer} -b -p ${target_dir}
rm -f ${installer}
# activate root environment of installation
source ${target_dir}/bin/activate root || exit 1
# if no envs were specified, install all given in env_files/
if [ $# -eq 1 ]; then
echo "Installing all envs from env_files/"
for f in env_files/*.yml; do
conda env create -q -f $f || exit 1
done
fi
# ifenvs were specified, install all of them
if [ $# -gt 1 ]; then
# only install given envs
echo "installing env files:"
echo "${@:2}"
for f in "${@:2}"; do
conda env create -q -f $f || exit 1
done
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment