|
|
We will make a local copy of the OpenSimRoot repository (this is called "cloning") and 'build' it (we create an executable that we can run). First create an account on gitlab.com and make sure you have access to the OpenSimRoot repository.
|
|
|
|
|
|
First, check if Git is installed. Do this by entering:
|
|
|
`git --version`
|
|
|
|
|
|
Your output should be of the form
|
|
|
`git version 1.8.3.1`
|
|
|
|
|
|
If Git is not installed, see: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
|
|
|
|
|
|
Now we will add the user name and email. We do this by entering the commands:
|
|
|
```
|
|
|
git config --global user.name USERNAME
|
|
|
git config --global user.email EMAIL ADDRESS
|
|
|
```
|
|
|
|
|
|
You can check if they were entered correctly by entering:
|
|
|
`git config --global --list`
|
|
|
|
|
|
Now we need an SSH key. Check if there is an existing key by entering:
|
|
|
`cat ~/.ssh/id_rsa.pub`
|
|
|
If there is no key, make one by entering:
|
|
|
`ssh-keygen -t rsa -C "EMAIL ADDRESS"`(the quotes are important)
|
|
|
|
|
|
Next you will be asked to enter a filename in which the key will be saved. Leave it blank to use the default name (recommended). After this you will be asked to enter a passphrase. It is recommended that you do this but you can leave it empty to make a key without passphrase.
|
|
|
|
|
|
Now you should see a message stating the key has been saved, a key fingerprint and a randomart image. Type in the following command to see the key:
|
|
|
`cat ~/.ssh/id_rsa.pub`
|
|
|
|
|
|
If you saved the key in a different directory, change `~` accordingly. If you changed the filename, change `id_rsa.pub` accordingly. The key should start with:
|
|
|
`ssh-rsa`
|
|
|
and end with your email address. Copy all of it and enter it in the appropriate text box on: https://gitlab.com/profile/keys
|
|
|
Choose a name for the key and save it.
|
|
|
|
|
|
Now go to: https://gitlab.com/rootmodels/OpenSimRoot and copy the SSH address to your clipboard. In your terminal, go to the directory you want to create your local copy of OpenSimRoot in and enter:
|
|
|
`git clone THE SSH ADDRESS YOU COPIED` At the time of writing the command is: `git clone git@gitlab.com:rootmodels/OpenSimRoot.git`
|
|
|
|
|
|
You might get a message stating that `The authenticity of host 'gitlab.com (104.210.2.228)' can't be established. `Enter `yes` to continue. Now the files will be copied and you will see:
|
|
|
```
|
|
|
remote: Counting objects: 1345, done.
|
|
|
remote: Compressing objects: 100% (418/418), done.
|
|
|
remote: Total 1345 (delta 863), reused 1328 (delta 855)
|
|
|
Receiving objects: 100% (1345/1345), 2.00 MiB | 2.54 MiB/s, done.
|
|
|
Resolving deltas: 100% (863/863), done.
|
|
|
Checking out files: 100% (310/310), done.
|
|
|
```
|
|
|
Now there should be a new directory called OpenSimRoot with all the files in it. We will build SimRoot with gcc, which is a compiler. To see if gcc is installed, enter the commands stated below and see if the output is similar.
|
|
|
```
|
|
|
[pmxeds@kazbek ~]$ whereis gcc
|
|
|
gcc: /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz
|
|
|
[pmxeds@kazbek ~]$ which gcc
|
|
|
/usr/bin/gcc
|
|
|
[pmxeds@kazbek ~]$ gcc --version
|
|
|
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
|
|
|
Copyright (C) 2015 Free Software Foundation, Inc.
|
|
|
This is free software; see the source for copying conditions. There is NO
|
|
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
```
|
|
|
|
|
|
For more on gcc, see: http://www.cyberciti.biz/faq/howto-compile-and-run-c-cplusplus-code-in-linux/. Now change directory to OpenSimRoot/OpenSimRoot/StaticBuild by using `cd`
|
|
|
```
|
|
|
[pmxeds@kazbek ~]$ cd OpenSimRoot/OpenSimRoot/StaticBuild
|
|
|
[pmxeds@kazbek StaticBuild]$ ls
|
|
|
makefile objects.mk readme.txt sources.mk src StaticBuild
|
|
|
```
|
|
|
|
|
|
Now execute `make`. Gcc will now build opensimroot. After a while you will see `Finished building target: OpenSimRoot`. Execute `./OpenSimRoot -h` to check if everything is correct. You will get the output:
|
|
|
```
|
|
|
[pmxeds@kazbek StaticBuild]$ ./OpenSimRoot -h
|
|
|
Usage: OpenSimRoot [OPTIONS] [FILE]
|
|
|
OpenSimRoot simulates a model defined in FILE
|
|
|
|
|
|
-f, --file specify simulation file, default last argument
|
|
|
-h, --help or /? print this help message
|
|
|
-v be verbose with warnings
|
|
|
-q be quite with warnings
|
|
|
-l, --list print list of registered functions
|
|
|
-V, --verify Experimental function for verifying input files
|
|
|
|
|
|
Examples:
|
|
|
OpenSimRoot -h Prints this message
|
|
|
OpenSimRoot runModel.xml Runs the SimRoot model
|
|
|
|
|
|
Support at j.postma@fz-juelich.de
|
|
|
Licensed to you under the GPLv3 license.
|
|
|
|
|
|
There are no warnings.
|
|
|
Simulation took (hours:minutes:seconds): 0:0:0
|
|
|
```
|
|
|
|
|
|
For a more comprehensive guide on some of the steps involved see: https://gitlab.com/help/gitlab-basics/README.md |