Skip to content

Installing Nektar1D

Peter H Charlton edited this page Feb 23, 2022 · 8 revisions

Installing Nektar 1D

This page provides some of my additional notes on installing Nektar1D, and should be read in conjunction with the reference manual as described on this page. Indeed, many of the notes are based on this manual.

NB: Access approval is required from Jordi Alastruey-Arimon in order to install Nektar 1D.

Setting up a Virtual Box

You will need an installation of Linux with which to run Nektar1D. If you already using Linux as your operating system then you will not require a Virtual Box. However, if you (for instance) use Windows or a Mac without the option to boot in Linux, then it may be helpful to run Linux through a virtual box. This section provides a few hints on installing a virtual box.

Install a Virtual Box with Ubuntu

I used Oracle VM VirtualBox (which can be downloaded for free) to run Ubuntu.

Create a shared folder

It was necessary to create a shared folder to pass files between the virtual box and the host operating system. I installed a shared folder by following the instructions here. Firstly, a shared folder was created in Windows at:

C:\Documents\VM-share

It was named VM-share. After running the following commands in Ubuntu:

sudo mkdir /media/windows-share
sudo mount -t vboxsf VM-share /media/windows-share

it was accessible at:

/media/windows-share

Setting up Nektar 1D

The reference manual provides instructions for compiling Nektar1D in Linux. Here are a few abbreviated notes on this process.

Cloning the BitBucket repository

Mercurial was installed using:

sudo apt-get install mercurial

Following this, a clone of the code hosted at BitBucket was made, using login details. NB: This requires access approval from Jordi Alastruey-Arimon. The BitBucket repository was cloned to /home/<linux username>/nektar using the following commands:

cd ~/home
sudo hg clone https://<username>@bitbucket.org/JordiAlastruey/nektar

(where <username> was replaced with my BitBucket username).

Changing permissions for the Nektar Folder

I found that the Nektar folder was restricted to the root user, so changed the permissions to allow me to read and write to the folder. To do this I used the following commands:

sudo chown -R <linux username> ~/nektar

where <linux username> is replaced with the username used to log in to Linux.

Preparing to use Nektar 1D

I installed the Vim package to allow me to edit files using:

sudo apt-get install vim

I opened the configuration file of Mercurial using

vim ~/nektar/.hg/hgrc

I then edited the configuration file of Mercurial (by pressing i in Vim) by adding the following lines of text:

[paths]
default = https://<username>@bitbucket.org/JordiAlastruey/nektar
[ui]
username = <username> <<email address>>

Again, <username> and <email address> should be replaced with those associated with BitBucket. Note that the email address specified in this text is enclosed in <> brackets.

To save the changes I pressed Esc then entered: :wq.

Checking that various components are installed

To check whether the g++ and gfortran compilers were installed, I followed the instructions here, using the

dpkg --list | grep compiler

command. Finding that they weren't installed, I used these commands to install them:

sudo apt-get install g++
sudo apt-get install gfortran

I also checked whether the required symbolic links were there using the following commands:

ln -s ../Makefile Makefile in nektar/Hlib/Linux
ln -s ../MakeHybrid MakeHybrid in nektar/Hlib/Linux
ln -s GCC.inc Linux.inc in nektar/Flags

I installed the additional tools required using:

sudo apt-get install byacc
sudo apt-get install liblapack-dev

Compiling Nektar

I compiled Nektar using

cd nektar/Veclib
make
cd ../Hlib/Linux
make dbx
make opt
cd ../..
cp Veclib/libvec.a Hlib/Linux/.
make dbx in nektar/1DBio/Linux

The rest of the instructions in Section 2 of the reference manual were straightforward to follow.

Running an Input File

After playing around with the last step in Section 2 of the Reference Manual, it was possible to run oneDbio from any current directory in the terminal. This was achieved by opening the bashrc file,

vim ~/.bashrc

and adding the following to the file:

export PATH=$PATH:/home/<linux username>/nektar/1DBio/Linux

and then refreshing the environment variables using:

source ~/.bashrc

After this, I found that the following commands ran a simulation:

cd ~/nektar/examples/55art 
oneDbio 55art_elas.in
Clone this wiki locally