DOLFIN Related Material
Some information regarding the DOLFIN package of the FeniCS project.
DOLFIN at CSCTo be able to use DOLFIN at CSC, just add the modules na-hacks and fenics by typing
>> module add na-hacks fenics
To compile and run programs, you must be using a Linux based system, i.e., NOT SOLARIS. The easiest and fastest way to compile and run programs is to use one of the following three servers carleman, fredholm, beurling.
Using Local and CSC based DOLFIN packages
Developing for DOLFIN at CSC means that you have to somehow separate two distinct DOLFIN packages. One DOLFIN package is the one which sits inside your home/<user>/ directory somewhere which is the DOLFIN that you work on and make changes to. Another DOLFIN package is inside the CSC file system and is the package you get access to by following the above steps in DOLFIN at CSC. Since we are given access to most of the FeniCS packages through CSC's file system, we only need local copies of DOLFIN and FFC.
Throughout the entire process which follows, it is advised that you should use a Linux based installation to carry out your work. In this how to, we will use one of the three linux servers available carleman, fredholm, buerling.
Installation of the Local DOLFIN and FFC packages
- Log on to one of the servers. As an example, we will use carleman as our server.
>> ssh carleman.nada.kth.seIf you are already somehow connected to the NADA network, you can save yourself a few key strokes by leaving out the .nada.kth.se.
>> module add na-hacks fenicsThis should give you access to Mercurial which is used to fetch the latest snapshots of the KTH distributions.
- Now we want to fetch both DOLFIN and FFC in to our local directory. Make sure that you are now in a directory that suits you for saving DOLFIN and FFC source files, e.g. ~/SourceFiles/FeniCS and type the following
>> hg clone http://www.nada.kth.se/cgi-bin/jjan/hgwebdir.cgi/dolfin-kth...wait a bit, and then type
>> hg clone http://www.nada.kth.se/cgi-bin/jjan/hgwebdir.cgi/ffc-kthWe should now have two additional directories dolfin-kth, ffc-kth
- When we now install DOLFIN and FFC, we must tell the installer/compiler that the resulting files should be saved locally. We do this by first creating another directory where we choose to keep all the locally stored binary files generated by the compiler. As an example, we could generate the directory ~/Library by typing
>> mkdir ~/LibraryThen go to your ffc-kth directory and type
>> python setup.py install --prefix=$HOME/Library
- Next we do the same for dolfin-kth. Go to your dolfin-kth directory and type
./configure --prefix=$HOME/Library --with-boost=/afs/nada.kth.se/dept/na/hacks/pkg/boost/1.33.1/ --enable-petsc --with-petsc-dir=/afs/nada.kth.se/dept/na/hacks/pkg/petsc/2.3.2/@sys --disable-pydolfinNote that we have disabled PyDOLFIN, feel free to enable it if you need to use it.
- All we have to do now is to compile the source files. While still in your dolfin-kth directory, type
>> make && make modules && make install && make modules_install && make demoIf all went well, you should now have a local copy of DOLFIN and FFC. The next section will tell you how to identify which installation you would like to use.
Identifying which (Local or CSC) DOLFIN installation to use
What tells the system which libraries and executables to use is governed by a set of environment variables. When we wish to compile a main.cpp file using the DOLFIN library, which DOLFIN installation will be used? The CSC installation, since this is the installation that the system is told to use by the environment variables. To change this, we have to create/edit an environment file which tells the system to use our local copy of DOLFIN.To do this, go to your home directory and type
>> emacs .environmentInsert the following text at the end:
if ( $?PATH ) then else setenv PATH "" endif if ( $?PYTHONPATH ) then else setenv PYTHONPATH "" endif if ( $?LD_LIBRARY_PATH ) then else setenv LD_LIBRARY_PATH "" endif if ( $?PKG_CONFIG_PATH ) then else setenv PKG_CONFIG_PATH "" endif setenv PATH "$HOME/Library/bin:$PATH" setenv PYTHONPATH "$HOME/Library/lib/python2.3/site-packages:$PYTHONPATH" setenv LD_LIBRARY_PATH "$HOME/Library/lib:$LD_LIBRARY_PATH" setenv PKG_CONFIG_PATH "$HOME/Library/lib/pkgconfig:$PKG_CONFIG_PATH"
When you want to use your local copy of DOLFIN, type
>> source ~/.environment
DOLFIN Automated Installer for Debian based Linux distributions
The target audience for this how to are people who wish to install DOLFIN on their home computers. If you would like to use DOLFIN at CSC, please consult the DOLFIN at CSC guide above. Note also that this is the KTH distribution of DOLFIN.
The installation of the DOLFIN C++ library can be somewhat cumbersome if one is not familiar with the Linux environment. There are many dependencies that have to be satisfied in order to be able to successfully use DOLFIN to create efficient programs. An automated installer was thus created with the single task of removing the job of satisfying dependencies from the user. This automated installer has been tested on Ubuntu Feisty Fawn and Dapper Drake. What follows is a step-by-step guide to using the installer script.
You are encouraged to inspect the script. Understanding the script will ultimately allow you to create a script which is more targeted to your specific needs. Right now, PyDOLFIN is disabled in the script and DOLFIN uses PETSc as the algebraic back-end.
- First, decide where you would like to store all the files associated with DOLFIN. I usually have the following folder structure /home/<user>/SourceFiles/FeniCS. Now, inside the FeniCS folder, place the file installer.sh, the installer script.
- Make the script executable
>> chmod +x installer.sh
- Finally, just execute the script.
>> ./installer.shIf a download fails or something goes wrong, the best thing to do is to delete all the generated directories and start fresh.
- You may also need to add the following (if the demos do not work) to your ~/.bashrc file:
And that is all. You should now have a working DOLFIN installation. --Stockli 17:38, 11 July 2007 (CEST)