Skip to content

Latest commit

 

History

History
55 lines (31 loc) · 1.87 KB

File metadata and controls

55 lines (31 loc) · 1.87 KB

Setting up your environment for Pencil

Obtain the pencil code by git cloning into your home directory.

git clone https://github.com/pencil-code/pencil-code.git

Now let's check if your shell is bash.

echo $SHELL

If the shell is not bash, change it to bash.

bash

Next go to the pencil-code directory, and execute the sourceme.sh

cd ~/pencil-code
source sourceme.sh

Next add these lines to your ~/.bashrc (or ~/.bash_profile if bashrc does not exist)

export PENCIL_HOME=~/pencil-code
export PATH="$PENCIL_HOME/bin:$PENCIL_HOME/utils:$PATH"
export PYTHONPATH="$PENCIL_HOME/python:$PYTHONPATH"

And source it. If you downloaded the GNU compiler collection (gcc) yesterday, you should be ready to compile the code. Otherwise, download with your favorite package manager (ports, brew, yum, aptitude, etc).

Let's make sure that everything is ok by compiling a test serial run. Jump to

cd $PENCIL_HOME/samples/2d-tests/globaldisc/

We will run an pc_auto-test. Auto-test is a pencil command that checks if a run is giving the same results as a reference file. It is also useful to catch compilation errors. This pencil command resides in pencil-code/bin. You have this in your $PATH, so it should find it. Type

pc_auto-test -C .

(Do not forget the dot!)

The -C is for cleaning leftover files from previous compilations. The dot says that you want to auto-test the current directory.

You should see

[@ globaldisc]$ pc_auto-test -C . 

/mnt/home/me/pencil-code/samples/2d-tests/globaldisc:
    Compiling..                               ok      
    Starting..                                ok      
    Running..                                 ok      
    Validating results..                      ok      

----------------------------------------------------------------------
Test succeeded.

----------------------------------------------------------------------