diff --git a/README.md b/README.md index 836dc49..d32a76a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Steps: 4) Run synthetic diagnostic models and record output -## Installation +## Building julia environment for SD4SOLPS ### Cloning using ssh @@ -19,6 +19,27 @@ It is recommended to setup github access for your account using a ssh key. Pleas github intstructions for [connecting to github with ssh](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account). The make file below and other steps uses ssh clone url and would fail unless you have access to github setup using ssh key. If you prefer to use password for login, correct clone urls accordingly. +After cloning this repo, check the make menu: +``` +SD4SOLPS.jl % make help +Help Menu + +make env_with_cloned_repo (or make r): Creates a Julia environment with the cloned repositories +make env_with_git_url (or make u): Creates a Julia environment with the git urls without creating local clones +make clean: Deletes Project.toml and Manifest.toml for a fresh start +``` + +### make r +This option creates local copies of required private repositories at the same level as current repository and uses them in develop mode to create a Manifest.toml + +### make u +This option uses url of required private repositories to create a static Manifest.toml attached to current master branches of these repositories. + +### make clean +Deletes Manifest.toml so that environment can be recreated, to update or change the last used method. + +## Example environment with all repositories + ### Using make file This option only works on and has been tested on macOS and unix. If you have windows, please use the [manual instructions](https://github.com/ProjectTorreyPines/SD4SOLPS.jl/wiki) instead. diff --git a/makefile b/makefile new file mode 100644 index 0000000..6656c4a --- /dev/null +++ b/makefile @@ -0,0 +1,26 @@ +SHELL := /bin/zsh +help: + @echo "Help Menu" + @echo + @echo "make env_with_cloned_repo (or make r): Creates a Julia environment with the cloned repositories" + @echo "make env_with_git_url (or make u): Creates a Julia environment with the git urls without creating local clones" + @echo "make clean: Deletes Project.toml and Manifest.toml for a fresh start" + @echo + +env_with_cloned_repo r: + @echo "Creating Julia environment by creating local clones of dependent repositories" + @echo "Cloning the repositories" + -cd ..; git clone "git@github.com:ProjectTorreyPines/OMAS.jl.git" + -cd ..; git clone "git@github.com:ProjectTorreyPines/GGDUtils.jl.git" + -cd ..; git clone "git@github.com:ProjectTorreyPines/SOLPS2IMAS.jl.git" + @echo "Generating Project.toml and Manifest.toml" + julia --project=. -e 'using Pkg; Pkg.rm(["OMAS", "GGDUtils", "SOLPS2IMAS", "EFIT"]); Pkg.develop(path="../OMAS.jl"); Pkg.develop(path="../GGDUtils.jl"); Pkg.develop(path="../SOLPS2IMAS.jl"); Pkg.add(url="git@github.com:JuliaFusion/EFIT.jl.git", rev="master"); Pkg.instantiate()' + +env_with_git_url u: + @echo "Creating Julia environment with the git urls without creating local clones" + @echo "Generating Project.toml and Manifest.toml" + julia --project=. -e 'using Pkg; Pkg.rm(["OMAS", "GGDUtils", "SOLPS2IMAS", "EFIT"]); Pkg.add(url="git@github.com:ProjectTorreyPines/OMAS.jl.git", rev="master"); Pkg.add(url="git@github.com:ProjectTorreyPines/GGDUtils.jl.git", rev="master"); Pkg.add(url="git@github.com:ProjectTorreyPines/SOLPS2IMAS.jl.git", rev="master"); Pkg.add(url="git@github.com:JuliaFusion/EFIT.jl.git", rev="master"); Pkg.instantiate()' + +clean: + @echo "Deleting Manifest.toml" + - rm Manifest.toml