Skip to content

Commit

Permalink
Merge pull request #42 from ProjectTorreyPines/make
Browse files Browse the repository at this point in the history
Adding makefile for building Julia environment
  • Loading branch information
anchal-physics authored Feb 16, 2024
2 parents e6bb21f + d4c1c7d commit ea7308f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,35 @@ Steps:
4) Run synthetic diagnostic models and record output


## Installation
## Building julia environment for SD4SOLPS

### Cloning using ssh

It is recommended to setup github access for your account using a ssh key. Please follow
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.
Expand Down
26 changes: 26 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ea7308f

Please sign in to comment.