Software Development Platforms
Obtaining, compiling and installing software development tools on various systems.
Development on OS-X
[edit]Lists of what you actually need to install
[edit]For writing Python scripts that use vtkski
[edit]For this purpose, you need only the bonelab Libraries binaries, which you can get from mike.kin . Everything thing else is already a standard part of OS-X.
Note: For now this is wishful thinking, as I haven't actually built binaries of the bonelab libraries that wrap up and install the VTK libraries as well. Therefore, for the time being, you probably need everything from the next section so you can build vtkski yourself.
For modifying vtkski and other bonelab libraries, as well as applications written in C++
[edit]You'll need:
As well, you may need ITK and/or Qt , depending on which libraries/applications you want to build.
For building ParaView extensions
[edit]You'll need everything in the above section, plus Paraview . Actually you won't need to get and build VTK separately - it is included in the ParaView source code tree. That internal version of VTK must be used for building ParaView plugins and extensions, and any libraries that they may use.
For modifying faim
[edit]For modifying the source code of faim, you'll need boost , plus a fortran complier, usually #gcc including gfortan .
Unless you want to build faim without tests (not recommended), you will also need gtest .
A Discussion of Directories
[edit]It's generally not a good idea to mess with the directories that "belong" to OS-X. This includes /usr . Installing stuff to /usr is generally a very bad idea, since you might clobber system files.
Instead, it is conventional to install unix-style software into /usr/local . Thus for example, the binaries get installed into /usr/local/bin, the libraries into /usr/local/lib, and so on. This is acceptable, but has some drawbacks. The biggest one is that typically it is impossible to install multiple versions of the same sotware simultaneously. Another is that it can be hard to uninstall particular software, since the files get spread around all the subdirectories of /usr/local .
An alternative to using /usr/local for everything is to install particular packages into their own dedicated directores. Conventionally, these are subdirectories of /opt . So for example, we could install VTK 5.6.1 into /opt/vtk-5.6.1 . Then the binaries would end up in /opt/vtk-5.6.1/bin, and the libraries in /opt/vtk-5.6.1/lib, and so on. Now we can have multiple versions, and uninstallation is easy - just delete the directory. One drawback is that, unlike /usr/local/bin and /usr/local/lib, these won't be on your paths by default, so they can't be found. Generally we need to do something like this:
export PATH=/opt/vtk-5.6.1/bin:"$PATH" export DYLD_LIBRARY_PATH=/opt/vtk-5.6.1/lib:"$DYLD_LIBRARY_PATH"
These lines can go in .bash_profile for a permanent change, or, you can put them into another file, say setvars.sh, and just do this to run it and import the environment variables:
source setvars.sh
One tip is that you can create links in opt to your favorite versions, like this:
cd /opt ln -s vtk-5.6.1 vtk
Then you don't have to change your .bash_profile or setvars.sh file when you want to switch to a different version. You simply change the symbolic links in /opt . The export lines become simply
export PATH=/opt/vtk/bin:"$PATH" export DYLD_LIBRARY_PATH=/opt/vtk/lib:"$DYLD_LIBRARY_PATH"
I will generally assume that this has been done.
There is one additional "standard" directory, and that is /opt/local . It belongs to macports, so it's best not to mess with it.
Scripts to Set Environment Variables
[edit]If you want to use different versions of installed software, or not have everything on your path all the time, it is convenient to use scripts to modify the environment variables. For convenience, here is a script that provides some useful functions for modifying paths. I name it setenv_functions.sh and put it in /usr/local/bin.
<source lang=bash>
- !/bin/bash
- setenv_functions.sh
- Eric Nodwell, January 2011
- Provides functions useful for modifying system paths.
- You call this from other bach scripts like this:
- source /usr/local/bin/setenv_functions.sh
- Then you can make use of the functions defined below.
- Example usage: add_path PATH /usr/my/path
function add_path {
echo -e "Adding to ${1}: \033[1;34m${2}\033[0m"
eval "OLDLIST=\"\$$1\""
if [ -n "${OLDLIST}" ] ; then
eval "$1=\"$2:\$$1\""
else
eval "$1=\"$2\""
fi
eval "export $1"
}
- Example usage: remove_path PATH /usr/my/path
- The second argument can be a regular expression for pattern matching.
function remove_path {
eval "OLDLIST=\"\$$1\""
REMOVALLIST=$( echo ${OLDLIST} | tr -s ":" "\n" | grep -wE "${2}" | tr -s "\n" ":" | sed "s/:$//" )
if [ -n "${REMOVALLIST}" ] ; then
echo -e "Removing from ${1}: \033[1;31m${REMOVALLIST}\033[0m"
NEWLIST=$( echo ${OLDLIST} | tr -s ":" "\n" | grep -vwE "${2}" | tr -s "\n" ":" | sed "s/:$//" )
eval "$1=\"$NEWLIST\""
eval "export $1"
fi
}
- Example usage: check_path PATH /usr/my/path
- The second argument can be a regular expression for pattern matching.
function check_path {
eval "OLDLIST=\"\$$1\""
CHECKLIST=$( echo ${OLDLIST} | tr -s ":" "\n" | grep -wE "${2}" | tr -s "\n" ":" | sed "s/:$//" )
test -n "${CHECKLIST}"
return $?
}
- Example usage: add_path PATH /usr/my/path
function add_path {
echo -e "Adding to ${1}: \033[1;34m${2}\033[0m"
eval "OLDLIST=\"\$$1\""
if [ -n "${OLDLIST}" ] ; then
eval "$1=\"$2:\$$1\""
else
eval "$1=\"$2\""
fi
eval "export $1"
}
- Example usage: remove_path PATH /usr/my/path
- The second argument can be a regular expression for pattern matching.
function remove_path {
eval "OLDLIST=\"\$$1\""
REMOVALLIST=$( echo ${OLDLIST} | tr -s ":" "\n" | grep -wE "${2}" | tr -s "\n" ":" | sed "s/:$//" )
if [ -n "${REMOVALLIST}" ] ; then
echo -e "Removing from ${1}: \033[1;31m${REMOVALLIST}\033[0m"
NEWLIST=$( echo ${OLDLIST} | tr -s ":" "\n" | grep -vwE "${2}" | tr -s "\n" ":" | sed "s/:$//" )
eval "$1=\"$NEWLIST\""
eval "export $1"
fi
}
- Example usage: check_path PATH /usr/my/path
- The second argument can be a regular expression for pattern matching.
function check_path {
eval "OLDLIST=\"\$$1\""
CHECKLIST=$( echo ${OLDLIST} | tr -s ":" "\n" | grep -wE "${2}" | tr -s "\n" ":" | sed "s/:$//" )
test -n "${CHECKLIST}"
return $?
} </source>
There will be several examples below making use of this script. See for example asciidoc , where a script /opt/asciidoc-8.6.3/setenv.sh is created . You use it like this:
source /opt/asciidoc-8.6.3/setenv.sh
The output will look something like:
Adding to DYLD_LIBRARY_PATH: /opt/boost-1.45.0/lib Adding to PATH: /opt/source-highlight-3.1.4/bin Adding to DYLD_LIBRARY_PATH: /opt/source-highlight-3.1.4/lib Adding to PATH: /opt/dblatex-0.3/bin Adding to PYTHONPATH: /opt/dblatex-0.3/lib/python2.7/site-packages Adding to PATH: /opt/asciidoc-8.6.3/bin
Quick CMake Tutorial
[edit]A lot of software that we use uses cmake as a build system. Rather than repeat generic instructions over and over, I will present generic usage here.
Creating a build directory
[edit]CMake can build the software into any directory. Usually the most sensible thing to do is to create a build directory in the source tree and run cmake from there.
cd some_project_source mkdir build cd build
Now you need to generate a configuration to build. There are two standard options: a command line interface and a graphical client.
Configuration with ccmake
[edit]Start it with
ccmake ..
Hit C for configure. A table of variables will appear alter them as described for the particular project. Some variables are marked as Advanced and will only be visible after you hit T for toggle advanced. Keep hitting C, and modifying variables as required, until the Generate options appears. Then hit G for generate and ccmake will exit.
Configuration with the CMake Graphical Client
[edit]Start it by double-clicking on the icon, or with the command
cmake-gui
Need to finish this...
Building
[edit]Once you've generated the configuration, you can just build the project like this:
make
If it's a big project, you may want add -j 8 to that. That will use 8 parallel threads for compilation.
To install the software, you now run
sudo make install
MacPorts
[edit]Macports is a package management tool for OS-X. It will automatically resolve dependencies, down source code, apply patches, and compile.
This sounds wonderful, however it has some drawbacks. For one, you don't have any choice in version of the software installed, and sometimes the available ports are somewhat outdated. Also, it tends to pull in more dependencies than are strictly required, and to duplicate unnecessarily many OS-X system files.
I therefore tend to use macports only for very simple software, or for software that would otherwise be quite difficult to install.
I recommend not installing macports at all if you can avoid it without too much trouble.
Installation
[edit]See http://www.macports.org/ .
Configuring Macports
[edit]I like to add this line to /opt/local/etc/macports/variants.conf:
+no_x11 +quartz
This way, x11 functionality won't be built where possible. These can lead to a huge reduction in the number of required dependencies.
macports by default uses single-process building. Since many ports take a long time to compile, it is useful to speed things up by enabling multi-process building. Do to this, edit /opt/local/etc/macports/macports.conf and set buildmakejobs to 0. This will cause it to use a number of build jobs equal to the number of processors in the system.
Installing Development Tools
[edit]Python
[edit]OS-X actually includes python. However, it tends to be an slightly outdated version of python. So, the best thing to do is to get the official python distribution from http://python.org/download/ . There are a couple of versions there, you want to make sure that you get the one labelled something like. Python 2.7.1 Mac OS X 64-bit/32-bit x86-64/i386 Installer (for Mac OS X 10.6) The advantage of this version is that it is 64-bit.
Make sure that this new version of python is on your path, so when you run python, you get this version and not the system default one.
You should have lines like the following at the bottom of your .bash_profile . The python installation normally does this, but you should check to make sure:
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
numpy
[edit]numpy is also included as a standard part of OS-X. However, if you install a new version of python, you need need to install a corresponding version of numpy . You can get it from http://sourceforge.net/projects/numpy/files/NumPy/1.5.1/ . Make sure that it is named something like numpy-1.5.1-py2.7-python.org-macosx10.5.dmg ; The version that works with macosx10.3 is 32 bit only.
scipy
[edit]scipy is currently required for the faim functional tests. You can get it from http://sourceforge.net/projects/scipy/files/ . You need at least version 0.9 (earlier versions are 32 only). Make sure you get a version compiled for python 2.7 .
XCode
[edit]XCode includes the gcc compiler, which you will need if you want to compile and C or C++ code. If however you want to compile fortran code, you will need a different version of gcc. See #gcc including gfortran .
You can get XCode from the Apple App store. It's free.
boost
[edit]Boost is a high-quality collection of C++ libraries (additions to the C++ standard typically go through Boost).
Download the boost source code from http://www.boost.org . Unpack it with a command like:
tar xvjf boost_1_50_0.tar.bz2 cd boost_1_50_0
First you need to build bjam, which is boost's native build tool.
./bootstrap.sh
These is the command. Note that it does not get installed - it is most convenient to just use it from the build directory (at least for static libraries).
./bjam link=static -j 4 stage
Here is the setenv.sh script to put into the directory after installing.
<source lang=bash>
- !/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export BOOST_ROOT="${SCRIPT_DIR}" </source>
cmake
[edit]Grab the binary installer from the website: http://www.cmake.org/cmake/resources/software.html
Note that when upgrading CMake there are links in /usr/bin need to be manually deleted before the new version of CMake is installed:
- /usr/bin/ccmake -> /Applications/CMake 2.8-11.app/Contents/bin/ccmake
- /usr/bin/cmake -> /Applications/CMake 2.8-11.app/Contents/bin/cmake
- /usr/bin/cmake-gui -> /Applications/CMake 2.8-11.app/Contents/bin/cmake-gui
- /usr/bin/cmakexbuild -> /Applications/CMake 2.8-11.app/Contents/bin/cmakexbuild
- /usr/bin/cpack -> /Applications/CMake 2.8-11.app/Contents/bin/cpack
- /usr/bin/ctest -> /Applications/CMake 2.8-11.app/Contents/bin/ctest
- $ sudo rm -rf /usr/bin/ctest /usr/bin/cpack /usr/bin/ccmake /usr/bin/cmake /usr/bin/cmake-gui /usr/bin/cmakexbuild
swig
[edit]Get it from http://www.swig.org/download.html .
tar xvzf swig-2.0.7.tar.gz cd swig-2.0.7
Now you'll need the pcre source code, which you can get from http://www.pcre.org/ . Put it in the swig source code directory, then run
Tools/pcre-build.sh
Now continue with building swig:
./configure --prefix=/opt/swig-2.0.7 make sudo make install
gdcm
[edit]You can get gdcm from http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=Downloads .
tar xvzf gdcm-2.2.0.tar.gz mkdir gdcm-2.2.0-build cd gdcm-2.2.0-build source /opt/vtk-5.10.0/setenv.sh ccmake ../gdcm-2.2.0
CMake variables of note are:
| option | Setting |
|---|---|
| CMAKE_BUILD_TYPE | Release |
| CMAKE_INSTALL_PREFIX | /opt/gdcm-1.3.2 |
| GDCM_BUILD_SHARED_LIBS | ON |
| GDCM_USE_VTK | ON |
| GDCM_WRAP_PYTHON | ON |
| PYTHON_DIR | /lib/python2.7 |
| SWIG_EXECUTABLE | /opt/swig-2.0.7/bin/swig |
Also if you installed a newer version of python than the system default (which you should have), then you'll need to make sure that CMake is finding that, and not the system default python. Check the following CMake variables.
| option | Setting |
|---|---|
| PYTHON_INCLUDE_DIR | /Library/Frameworks/Python.framework/Versions/2.7/Headers |
| PYTHON_LIBRARY | /Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib |
make
I got an error "i686-apple-darwin11-llvm-g++-4.2: -compatibility_version only allowed with -dynamiclib". To fix this, run "make VERBOSE=1", then repeat the last command (including the preceeding cd command), replacing -bundle with -dynamiclib. Once you do that, you have to also create the links (after dc'ing back to the root build directory):
cd bin ln -s libvtkgdcmPython.2.2.0.so libvtkgdcmPython.2.2.so ln -s libvtkgdcmPython.2.2.so libvtkgdcmPython.so cd ..
sudo make install
After installation there will be a file /opt/gdcm-2.2.0/lib/vtkgdcm.py . This has a lot of pointless (for our installation) stuff in it, and generates an irrelevant error message. So just replace the entire contents of that file with this:
from libvtkgdcmPython import *
Here is the setenv.sh script:
<source lang=bash>
- !/bin/bash
source /opt/vtk-5.10.0/setenv.sh
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export GDCM_ROOT="${SCRIPT_DIR}" export GDCM_DIR="${SCRIPT_DIR}" remove_path PATH '/.+/gdcm(-[^/]+)?/bin/?$' add_path PATH "${GDCM_ROOT}/bin" remove_path DYLD_LIBRARY_PATH '/.+/gdcm(-[^/]+)?/lib/?' add_path DYLD_LIBRARY_PATH "${GDCM_ROOT}/lib" remove_path PYTHONPATH '/.+/gdcm(-[^/]+)?/lib/?' add_path PYTHONPATH "${GDCM_ROOT}/lib" </source>
Qt
[edit]Note that you do NOT need to install Qt separately to build ParaView. If you use the ParaView Superbuild, it will download and configure and build Qt internally exactly as it needs it.
Recommended: Using a binary installer
[edit]You can get a binary installer from http://download.qt-project.org/archive/qt/ . Make sure that you download the Cocoa version, because the Carbon version won't work with any 64 bit code.
If you ever need to remove Qt as installed with the binary installer, you can do it with
sudo /Developer/Tools/uninstall-qt.py
from source
[edit]Get the source from http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.4.tar.gz .
./configure -cocoa -arch x86_64 -release -framework -prefix /opt/qt-4.6.4 make -j 8 sudo make install
VTK
[edit]Get the software from http://www.vtk.org/VTK/resources/software.html .
Unpack the source code (this can be in any convenient directory, usually somewhere in your home directory):
tar xvzf vtk-5.10.0.tar.gz
This will make a directory called VTK, but I like to rename it with the version
mv VTK vtk-5.10.0
VTK is built with cmake, so refer to #Quick_CMake_Tutorial Here are the cmake options that I typically choose that are different than the defaults:
| option | Setting |
|---|---|
| BUILD_EXAMPLES | ON |
| BUILD_SHARED_LIBS | ON |
| CMAKE_BUILD_TYPE | Release |
| CMAKE_INSTALL_PREFIX | /opt/vtk-5.10.0 |
| VTK_USE_QT | OFF |
| VTK_WRAP_PYTHON | ON |
Also if you installed a newer version of python than the system default (which you should have), then you'll need to make sure that CMake is finding that, and not the system default python. Check the following CMake variables.
| option | Setting |
|---|---|
| PYTHON_EXECUTABLE | /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 |
| PYTHON_INCLUDE_DIR | /Library/Frameworks/Python.framework/Versions/2.7/Headers |
| PYTHON_LIBRARY | /Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib |
| TK_INTERNAL_PATH | /System/Library/Frameworks/Tk.framework/PrivateHeaders |
You can use it from the build directory. (In fact this is necessary if you want to build vtkn88.) In this case, you can use this setenv.sh :
<source lang=bash>
- !/bin/bash
source /usr/local/bin/setenv_functions.sh
- Conflicts with VTK from faim, so remove that.
export NUMERICS88_ROOT unset NUMERICS88_ROOT remove_path PATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/bin/?$' remove_path DYLD_LIBRARY_PATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/lib/?$' remove_path DYLD_LIBRARY_PATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/bin/?$' remove_path PYTHONPATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/lib' remove_path PYTHONPATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/bin/?$' remove_path PATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/bin/?$' remove_path DYLD_LIBRARY_PATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/lib/?$' remove_path DYLD_LIBRARY_PATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/bin/?$' remove_path PYTHONPATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/lib' remove_path PYTHONPATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/bin/?$'
remove_path PATH '/.+/vtk(-[^/]+)?/bin/?$' remove_path PATH '/.+/vtk(-[^/]+)?/.+/bin/?$' remove_path DYLD_LIBRARY_PATH '/.+/vtk(-[^/]+)?/lib/vtk(-[^/]+)?/?' remove_path DYLD_LIBRARY_PATH '/.+/vtk(-[^/]+)?/.+/bin/?$' remove_path PYTHONPATH '/.+/vtk(-[^/]+)?/lib/python([^/]+)?/site-packages' remove_path PYTHONPATH '/.+/vtk(-[^/]+)?/.+/bin/?$'
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" VTK_DIR="${SCRIPT_DIR}" add_path PATH "${VTK_DIR}/bin" add_path DYLD_LIBRARY_PATH "${VTK_DIR}/bin" add_path PYTHONPATH "${VTK_DIR}/bin" </source>
Alternatively, if you install it to /opt/vtk-5.10.0, here is the setenv.sh script to put into /opt/vtk-5.10.0 after installing.
<source lang=bash>
- !/bin/bash
source /usr/local/bin/setenv_functions.sh
- Conflicts with VTK from faim, so remove that.
export NUMERICS88_ROOT unset NUMERICS88_ROOT remove_path PATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/bin/?$' remove_path DYLD_LIBRARY_PATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/lib/?$' remove_path DYLD_LIBRARY_PATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/bin/?$' remove_path PYTHONPATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/lib' remove_path PYTHONPATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/bin/?$' remove_path PATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/bin/?$' remove_path DYLD_LIBRARY_PATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/lib/?$' remove_path DYLD_LIBRARY_PATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/bin/?$' remove_path PYTHONPATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/lib' remove_path PYTHONPATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/bin/?$'
remove_path PATH '/.+/vtk(-[^/]+)?/bin/?$' remove_path PATH '/.+/vtk(-[^/]+)?/.+/bin/?$' remove_path DYLD_LIBRARY_PATH '/.+/vtk(-[^/]+)?/lib/vtk(-[^/]+)?/?' remove_path DYLD_LIBRARY_PATH '/.+/vtk(-[^/]+)?/.+/bin/?$' remove_path PYTHONPATH '/.+/vtk(-[^/]+)?/lib/python([^/]+)?/site-packages' remove_path PYTHONPATH '/.+/vtk(-[^/]+)?/.+/bin/?$'
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
VTK_ROOT="${SCRIPT_DIR}" add_path PATH "${VTK_ROOT}/bin" add_path DYLD_LIBRARY_PATH "${VTK_ROOT}/lib/vtk-5.10" add_path PYTHONPATH "${VTK_ROOT}/lib/python2.7/site-packages" </source>
ITK
[edit]Get the software from http://itk.org/ITK/resources/software.html .
Unpack the source code (this can be in any convenient directory, usually somewhere in your home directory):
tar xvzf InsightToolkit-3.20.1.tar.gz
ITK is built with cmake, so refer to #Quick_CMake_Tutorial Here are the cmake options that I typically choose that are different than the defaults:
| option | Setting |
|---|---|
| BUILD_EXAMPLES | ON |
| BUILD_SHARED_LIBS | ON |
| CMAKE_BUILD_TYPE | Release |
| CMAKE_INSTALL_PREFIX | /opt/itk-3.20.1 |
ITK does not install the VTK to ITK filters, and there seems to be no cmake option to request this, although the necessary files are in the source code tree. Fortunately, they are just header and template files, so you can just copy them into place afterwards. Something like this:
sudo cp Wrapping/WrapITK/ExternalProjects/ItkVtkGlue/src/*.h /opt/itk-3.20.1/include/InsightToolkit sudo cp Wrapping/WrapITK/ExternalProjects/ItkVtkGlue/src/*.txx /opt/itk-3.20.1/include/InsightToolkit
Here is the setenv.sh script.
<source lang=bash>
- !/bin/bash
source /usr/local/bin/setenv_functions.sh
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export ITK_ROOT="${SCRIPT_DIR}" export ITK_DIR="${ITK_ROOT}/lib/InsightToolkit" remove_path PATH '/opt/itk(-[^/]+)?/bin/?' add_path PATH "${ITK_ROOT}/bin" remove_path DYLD_LIBRARY_PATH '/opt/itk(-[^/]+)?/lib' add_path DYLD_LIBRARY_PATH "${ITK_DIR}" </source>
gcc including gfortran
[edit]gcc is included in XCode, however gfortran is not included, so we have to obtain gcc another way.
binary installer
[edit]Get from http://hpc.sourceforge.net . This is now the recommended method.
from source
[edit]I really don't recommend installing gcc from source, since it is non-trivial to do so. Install it with macports if at all possible. However, if for some reason you are unable to build gcc with macports, these instructions may be useful.
We require the 4.3 or newer gcc series, since it supports some Fortran 2003 features that we need (for cross-language building). Also, the auto-vectorization of 4.3 is superior to earlier versions.
Installing and building gcc from source is not trivial, but it can be done as follows. I recommend having a dedicated source-code build directory in your home direectory:
mkdir -p Documents/source cd Documents/source
- Install GMP
wget ftp://ftp.gnu.org/gnu/gmp/gmp-4.2.4.tar.bz2 tar xvjf gmp-4.2.4.tar.bz2 cd gmp-4.2.4 ./configure ABI=32 make -j 8 make check sudo make install cd ..
NOTE: The -j 8 flag tells make to launch up to 8 building threads when possible. This is to maximize the use of the 8 cores on the MacPro.
- Install MPFR
wget http://www.mpfr.org/mpfr-current/mpfr-2.3.2.tar.bz2 tar xvjf mpfr-2.3.2.tar.bz2 cd mpfr-2.3.2 ./configure --with-gmp-build=../source/gmp-4.2.4 make -j 8 make check sudo make install cd ..
- Install gcc
wget http://gcc-ca.internet.bs/releases/gcc-4.3.2/gcc-4.3.2.tar.bz2 tar xvjf gcc-4.3.2.tar.bz2 mkdir build-gcc-4.3.2 cd build-gcc-4.3.2 ../gcc-4.3.2/configure --prefix=/opt/gcc-4.3.2 --enable-languages=c,c++,fortran --with-mpfr=../mpfr-2.3.2 --build=i686-apple-darwin9 --host=i686-apple-darwin9 --target=i686-apple-darwin9 make -j 8 # Now go have coffee, maybe lunch :) sudo make install
Note on using custom-built gcc
[edit]Generally, to use a custom-built gcc, you just have to specify the complete path to the compiler, like this:
/opt/gcc-4.3.2/bin/gcc myprogram.c
Most build-systems will respect the environment variables CC, CXX and FC, so to set the default compilers, this will generally work:
export CC=/opt/gcc-4.3.2/bin/gcc export CXX=/opt/gcc-4.3.2/bin/g++ export FC=/opt/gcc-4.3.2/bin/gfortran
In addition, similarly-named variables exist by default for make files, so you can generally also do this:
make CC=/opt/gcc-4.3.2/bin/gcc CXX=/opt/gcc-4.3.2/bin/g++ FC=/opt/gcc-4.3.2/bin/gfortran
o specify the complete path to the compiler, like this:
/opt/gcc-4.3.2/bin/gcc myprogram.c
Most build-systems will respect the environment variables CC, CXX and FC, so to set the default compilers, this will generally work:
export CC=/opt/gcc-4.3.2/bin/gcc export CXX=/opt/gcc-4.3.2/bin/g++ export FC=/opt/gcc-4.3.2/bin/gfortran
In addition, similarly-named variables exist by default for make files, so you can generally also do this:
make CC=/opt/gcc-4.3.2/bin/gcc CXX=/opt/gcc-4.3.2/bin/g++ FC=/opt/gcc-4.3.2/bin/gfortran
gtest
[edit]gtest is google's testing framework. Some unit tests are written with it. Generally, it is not absolutely required, as you can typically build projects without testing support. However, this is not recommended, as the tests verify proper operation.
You can get gtest from here: http://code.google.com/p/googletest/ .
Unpack it in the usual way
unzip gtest-1.6.0.zip cd gtest-1.6.0
Build it it:
./configure make
We're not going to actually install it; that is not recommended.
Here is the setenv.sh script to put into /Users/eric/source/gtest-1.6.0 after installing.
<source lang=bash>
- !/bin/bash
source /usr/local/bin/setenv_functions.sh
export GTEST_ROOT=/Users/eric/source/gtest-1.6.0 </source>
LaTeX
[edit]The easiest is to get http://www.tug.org/mactex/ .
Put /usr/texbin on your PATH.
dblatex
[edit]dblatex is a tool for generating PDF output using LaTeX from docbook sources. It is necessary for producing PDF output from asciidoc .
dblatex requires LaTeX, so install that first.
Get the source code from http://dblatex.sourceforge.net/ .
tar xvjf dblatex-0.3.2.tar.bz2 cd dblatex-0.3.2 sudo python2.7 ./setup.py install --prefix=/opt/dblatex-0.3.2
Note: I use python2.7 instead of python just to be sure to get the python I installed, instead of the system python.
To use dblatex, you will need to set some environment variables:
export PATH=/opt/dblatex-0.3.2:"$PATH" export PYTHONPATH=/opt/dblatex-0.3.2/lib/python2.7/site-packages:$PYTHONPATH"
Alternatively, here is the setenv.sh script.
<source lang=bash>
- !/bin/bash
source /usr/local/bin/setenv_functions.sh
remove_path PATH '/.*/dblatex(-[^/]+)?/bin/?' remove_path PYTHONPATH '/.*/dblatex(-[^/]+)?/lib'
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export DBLATEX_DIR="${SCRIPT_DIR}" add_path PATH "${DBLATEX_DIR}/bin" add_path PYTHONPATH "${DBLATEX_DIR}/lib/python2.7/site-packages" </source>
source-highlight
[edit]source-highlight is used by asciidoc.
Another dependency, if source highlighting is used (and we do use it), is source-highlight. You can get the source code from ftp://ftp.gnu.org/gnu/src-highlite/ .
tar xvzf source-highlight-3.1.7.tar.gz cd source-highlight-3.1.7 ./configure --prefix=/opt/source-highlight-3.1.7 --with-boost=/opt/boost-1.50.0 make sudo make install
Here is the setenv.sh script.
<source lang=bash>
- !/bin/bash
source /usr/local/bin/setenv_functions.sh
remove_path PATH '/opt/source-highlight(-[^/]+)?/bin/?' remove_path DYLD_LIBRARY_PATH '/opt/source-highlight(-[^/]+)?/lib/?'
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export SOURCEHIGHLIGHT_DIR="${SCRIPT_DIR}" add_path PATH "${SOURCEHIGHLIGHT_DIR}/bin" add_path DYLD_LIBRARY_PATH "${SOURCEHIGHLIGHT_DIR}/lib" </source>
asciidoc
[edit]asciidoc is used for the faim manual.
The source code can be obtained from
http://sourceforge.net/projects/asciidoc/
It can be installed with
tar xvzf asciidoc-8.6.8.tar.gz cd asciidoc-8.6.8 ./configure --prefix=/opt/asciidoc-8.6.8 make sudo make install
You'll need some docbook style sheets. Download Docbook XML 4.5 from http://www.docbook.org/xml/4.5/ and unpack it inside /usr/local/share/xml/docbook/4.5. Download the latest Docbook XSL version from http://sourceforge.net/projects/docbook/files/docbook-xsl/ and unpack it. The name should be of the form docbook-xsl-1.nn.n.tar.bz2. Put the results in /usr/local/share/xsl/docbook, thus effectively removing the version number from the directory name (for simplicity).
Now you'll need to create the file /etc/xml/catalog and populate it like this:
<source lang=xml> <?xml version="1.0"?> <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<delegatePublic
publicIdStartString="-//OASIS//DTD DocBook XML"
catalog="/usr/local/share/xml/docbook/4.5/catalog.xml"/>
<delegateSystem
systemIdStartString="http://www.oasis-open.org/docbook/xml/4"
catalog="/usr/local/share/xml/docbook/4.5/catalog.xml"/>
<delegateURI
uriStartString="http://docbook.sourceforge.net/release/xsl/"
catalog="/usr/local/share/xsl/docbook/catalog.xml"/>
<delegateURI
uriStartString="http://docbook.sf.net/release/xsl/"
catalog="/usr/local/share/xsl/docbook/catalog.xml"/>
</catalog>
</source>
Here is the setenv.sh script.
<source lang=bash>
- !/bin/bash
source /Users/Shared/install/dblatex-0.3.2/setenv.sh source /Users/Shared/install/source-highlight-3.1.7/setenv.sh
remove_path PATH '/.*/asciidoc(-[^/]+)?/bin/?'
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export ASCIIDOC_DIR="${SCRIPT_DIR}" add_path PATH "${ASCIIDOC_DIR}/bin" </source>
I like to make one change, which is to change the indexterm macro so that secondary and tertiary entries are not automatically also promoted to primary index terms. To do this, edit the file etc/asciidoc/docbook45.conf , find the section on indexterm, and comment out the lines that do that.
GLE Graphics
[edit]GLE is required to build the figures in the FAIM manual.
Install the binary following the instructions at http://www.gle-graphics.org/tut/mac.html . (All you need is the Binary Installation instructions - just ignore the additional instructions related to compiling from source.)
You will need to put /Applications/QGLE.app/Contents/bin on your PATH:
export PATH=/Applications/QGLE.app/Contents/bin:"$PATH"
FFTW
[edit]Get it from http://www.fftw.org/download.html .
Build the double-precision version:
./configure --enable-float --enable-sse2 --prefix=/opt/fftw-3.3 make sudo make install
Then build the single-precision version:
./configure --enable-float --enable-sse2 --prefix=/opt/fftw-3.3 make sudo make install
This builds only static libraries, which is typically what I want.
Graphviz
[edit]Required by doxygen if you want charts. Then,
tar xvzf graphviz-2.28.0.tar.gz cd graphviz-2.28.0 export CPPFLAGS=-I/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers ./configure --prefix /opt/graphviz-2.28.0 make -j 4
Here is the setenv.sh script:
<source lang=bash>
- !/bin/bash
source /usr/local/bin/setenv_functions.sh
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
remove_path PATH '/opt/graphviz(-[^/]+)?/bin/?' remove_path DYLD_LIBRARY_PATH '/opt/graphviz(-[^/]+)?/lib/?'
export GRAPHVIZ_DIR="${SCRIPT_DIR}" add_path PATH "${GRAPHVIZ_DIR}/bin" add_path DYLD_LIBRARY_PATH "${GRAPHVIZ_DIR}/lib" </source>
gnuplot
[edit]Required for graphs in doxygen.
tar xvzf gnuplot-4.6.0.tar.gz cd gnuplot-4.6.0 ./configure --prefix /opt/gnuplot-4.6.0 make -j 4 sudo make install
Here is the setenv.sh script:
<source lang=bash>
- !/bin/bash
source /usr/local/bin/setenv_functions.sh
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
remove_path PATH '/opt/gnuplot(-[^/]+)?/bin/?'
export GNUPLOT_DIR="${SCRIPT_DIR}" add_path PATH "${GNUPLOT_DIR}/bin" </source>
Doxygen
[edit]source /opt/graphviz-2.28.0/setenv.sh source /opt/gnuplot-4.6.0/setenv.sh ./configure --prefix /opt/doxygen-1.8.2 make -j 4 sudo make install
Here is the setenv.sh script:
<source lang=bash>
- !/bin/bash
source /usr/local/bin/setenv_functions.sh
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
remove_path PATH '/opt/doxygen(-[^/]+)?/bin/?'
export DOXYGEN_DIR=${SCRIPT_DIR}" add_path PATH "${DOXYGEN_DIR}/bin" </source>
HDF5 and netCDF
[edit]Get HDF5 from http://www.hdfgroup.org/downloads/index.html .
I used the CMake build for HDF5, instead of the automake build. Note that for version 1.8.9 you have to apply a patch (or edit by hand one file) as described here: http://www.hdfgroup.org/ftp/HDF5/current/src/ .
Here are some interesting cmake options:
| option | Setting |
|---|---|
| BUILD_SHARED_LIBS | ON |
| CMAKE_BUILD_TYPE | Release |
| CMAKE_INSTALL_PREFIX | /opt/hdf5-1.8.9 |
| HDF5_BUILD_CPP_LIB | OFF |
| HDF5_BUILD_FORTRAN | OFF |
| HDF5_BUILD_HL_LIB | ON |
| HDF5_BUILD_TOOLS | ON |
| HDF5_ENABLE_Z_LIB_SUPPORT | ON |
Build in the usual way for CMake.
Note that the automake build has all the defaults as above anyway, so it is just
./configure --prefix=/Users/Shared/install/hdf5-1.8.9
Here's a setenv script for setting environment variables:
<source lang=bash>
- !/bin/bash
source /usr/local/bin/setenv_functions.sh
remove_path PATH '/.*/hdf5(-[^/]+)?/bin/?' remove_path DYLD_LIBRARY_PATH '/.*/hdf5(-[^/]+)?/lib/?'
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export HDF5_DIR="${SCRIPT_DIR}" export HDF5_ROOT="${HDF5_DIR}" add_path PATH "${HDF5_DIR}/bin" add_path DYLD_LIBRARY_PATH "${HDF5_DIR}/lib" </source>
Now for netCDF, which you can get from ftp://ftp.unidata.ucar.edu/pub/netcdf . The standard package builds only the C interface:
tar xvzf netcdf-4.2.1.tar.g cd netcdf-4.2.1 source /opt/hdf5-1.8.9/setenv.sh export CPPFLAGS="-I$HDF5_DIR/include" export LDFLAGS="-L$HDF5_DIR/lib" ./configure --prefix=/opt/netcdf-4.2.1 --disable-dap --disable-doxygen make -j 4 make check sudo make install
Here is a setenv.sh script:
<source lang=bash>
- !/bin/bash
source /opt/hdf5-1.8.9/setenv.sh
remove_path PATH '/.*/netcdf(-[^/]+)?/bin/?' remove_path DYLD_LIBRARY_PATH '/.*/netcdf(-[^/]+)?/lib/?' remove_path PYTHONPATH '/.*/netcdf(-[^/]+)?/lib/?'
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export NETCDF4_DIR="${SCRIPT_DIR}" add_path PATH "${NETCDF4_DIR}/bin" add_path DYLD_LIBRARY_PATH "${NETCDF4_DIR}/lib" add_path PYTHONPATH "${NETCDF4_DIR}/lib/python2.7/site-packages" </source>
Now for the fortran interface:
tar xvzf netcdf-fortran-4.2.tar.gz cd netcdf-fortran-4.2 source /opt/netcdf-4.2.1/setenv.sh export FC=/opt/local/bin/gfortran-mp-4.4 export CPPFLAGS="-I$NETCDF4_DIR/include -I$HDF5_DIR/include -DgFortran"
Note that the -DgFortran part is to ensure correct name mangling in Fortran. See http://www.unidata.ucar.edu/support/help/MailArchives/netcdf/msg09206.html . A future version may not require this.
export LDFLAGS="-L$NETCDF4_DIR/lib -L$HDF5_DIR/lib" ./configure --prefix=/opt/netcdf-4.2.1 make -j 4 make check sudo make install
For the python module netcdf4-python from http://code.google.com/p/netcdf4-python/ , I needed to make a link gcc-4.2 as follows (OS-X 10.7 only):
cd /usr/bin sudo ln -s gcc-4.2 llvm-gcc-4.2
Then some usual stuff:
tar xvzf netCDF4-1.0fix1.tar.gz mv netCDF4-1.0 netCDF4-python-1.0 # Rename to something more informative cd netCDF4-python-1.0 source /opt/netcdf-4.2.1/setenv.sh
Now it turns out that with HDF 1.8.9 and python netCDF 1.0 we need to fix up the setup.py script a bit:
<source lang=diff>
- setup.py.old 2012-07-11 09:40:08.603064046 -0700
--- setup.py 2012-07-11 09:40:17.566869824 -0700
- 21,26 ****
--- 21,28 ----
for line in f:
if line.startswith('#define H5_VERSION'):
hdf5_version = line.split()[2]
+ elif line.startswith('#define VERSION'): + hdf5_version = line.split()[2]
return hdf5_version def check_ifnetcdf4(netcdf4_includedir):
</source>
The build continues:
python setup.py build sudo bash source /opt/netcdf-4.2.1/setenv.sh python setup.py install --prefix=/opt/netcdf-4.2.1 exit
Tips
[edit]A trash command for OS-X
[edit]OS-X doesn't seem to have a standard easy way to delete things from the command line such that they get moved to the trash (rm removes things permanently). This little script will do the trick: Media:trash.sh. Rename this file simply trash and put it somewhere on your path (such as /usr/local/bin or ~/bin).
You use it just like this:
trash some_file some_other_file folders_too
It will expand wildcards, so stuff like this works:
trash ~/Documents/blue*
For wildcards, the option -v is useful to see what actually does get trashed.
Working with Objects and Libaries
[edit]See the corresponding section Development for Linux#Working with Objects and Libaries
otool -L is useful for finding out what dynamic libraries are required.
install_name_tool is useful for changing the name or rpath of libraries. Refer to the man page.
Trouble Shooting
[edit]dyld: Symbol not found: __cg_jpeg_resync_to_restart
[edit]If you get this error message from cmake, it is due to a conflict between macport's jpeg library and the OS-X jpeg library. You can generally fix by deactivating jpeg in macports, forcing the use of the system jpeg:
sudo port deactivate jpeg tiff libpng
Return to Contents or Return to Main Page
Development on Linux
[edit]Linux Distributions
[edit]The instructions here are for Ubuntu Linux, version 10.04. The linux computers in the lab, at the time of writing, are all Ubuntu. Ubuntu is a Debian-based linux distribution, and the instructions will be pretty much identical for another Debian-based distro. If you have a linux distribution that uses a different package management system (such as Red Hat), then you won't be using apt-get, but the concepts are similar.
Lists of what you actually need to install
[edit]For writing Python scripts that use vtkski
[edit]You'll need:
Note: For now this is wishful thinking, as I haven't actually built binaries of the bonelab libraries that wrap up and install the VTK libraries as well. Therefore, for the time being, you probably need everything from the next section so you can build vtkski yourself.
For modifying vtkski and other bonelab libraries, as well as applications written in C++
[edit]You'll need:
As well, you may need ITK and/or Qt , depending on which libraries/applications you want to build.
For building ParaView extensions
[edit]You'll need everything in the above section, plus Paraview . Actually you won't need to get and build VTK separately - it is included in the ParaView source code tree. That internal version of VTK must be used for building ParaView plugins and extensions, and any libraries that they may use.
For modifying faim
[edit]For modifying the source code of faim, you'll need:
Scripts to Set Environment Variables
[edit]If you want to use different versions of installed software, or not have everything on your path all the time, it is convenient to use scripts to modify the environment variables. For convenience, here is a script that provides some useful functions for modifying paths. I name it setenv_functions.sh and put it in /usr/local/bin.
<source lang=bash>
- !/bin/bash
- setenv_functions.sh
- Eric Nodwell, January 2011
- Provides functions useful for modifying system paths.
- You call this from other bach scripts like this:
- source /usr/local/bin/setenv_functions.sh
- Then you can make use of the functions defined below.
- Example usage: add_path PATH /usr/my/path
function add_path {
echo -e "Adding to ${1}: \033[1;34m${2}\033[0m"
eval "OLDLIST=\"\$$1\""
if [ -n "${OLDLIST}" ] ; then
eval "$1=\"$2:\$$1\""
else
eval "$1=\"$2\""
fi
eval "export $1"
}
- Example usage: remove_path PATH /usr/my/path
- The second argument can be a regular expression for pattern matching.
function remove_path {
eval "OLDLIST=\"\$$1\""
REMOVALLIST=$( echo ${OLDLIST} | tr -s ":" "\n" | grep -wE "${2}" | tr -s "\n" ":" | sed "s/:$//" )
if [ -n "${REMOVALLIST}" ] ; then
echo -e "Removing from ${1}: \033[1;31m${REMOVALLIST}\033[0m"
NEWLIST=$( echo ${OLDLIST} | tr -s ":" "\n" | grep -vwE "${2}" | tr -s "\n" ":" | sed "s/:$//" )
eval "$1=\"$NEWLIST\""
eval "export $1"
fi
}
- Example usage: check_path PATH /usr/my/path
- The second argument can be a regular expression for pattern matching.
function check_path {
eval "OLDLIST=\"\$$1\""
CHECKLIST=$( echo ${OLDLIST} | tr -s ":" "\n" | grep -wE "${2}" | tr -s "\n" ":" | sed "s/:$//" )
test -n "${CHECKLIST}"
return $?
}
- Example usage: add_path PATH /usr/my/path
function add_path {
echo -e "Adding to ${1}: \033[1;34m${2}\033[0m"
eval "OLDLIST=\"\$$1\""
if [ -n "${OLDLIST}" ] ; then
eval "$1=\"$2:\$$1\""
else
eval "$1=\"$2\""
fi
eval "export $1"
}
- Example usage: remove_path PATH /usr/my/path
- The second argument can be a regular expression for pattern matching.
function remove_path {
eval "OLDLIST=\"\$$1\""
REMOVALLIST=$( echo ${OLDLIST} | tr -s ":" "\n" | grep -wE "${2}" | tr -s "\n" ":" | sed "s/:$//" )
if [ -n "${REMOVALLIST}" ] ; then
echo -e "Removing from ${1}: \033[1;31m${REMOVALLIST}\033[0m"
NEWLIST=$( echo ${OLDLIST} | tr -s ":" "\n" | grep -vwE "${2}" | tr -s "\n" ":" | sed "s/:$//" )
eval "$1=\"$NEWLIST\""
eval "export $1"
fi
}
- Example usage: check_path PATH /usr/my/path
- The second argument can be a regular expression for pattern matching.
function check_path {
eval "OLDLIST=\"\$$1\""
CHECKLIST=$( echo ${OLDLIST} | tr -s ":" "\n" | grep -wE "${2}" | tr -s "\n" ":" | sed "s/:$//" )
test -n "${CHECKLIST}"
return $?
} </source>
There will be several examples below making use of this script. See for example asciidoc , where a script /opt/asciidoc-8.6.3/setenv.sh is created . You use it like this:
source /opt/asciidoc-8.6.3/setenv.sh
The output will look something like:
Adding to LD_LIBRARY_PATH: /opt/boost-1.45.0/lib Adding to PATH: /opt/source-highlight-3.1.4/bin Adding to LD_LIBRARY_PATH: /opt/source-highlight-3.1.4/lib Adding to PATH: /opt/dblatex-0.3/bin Adding to PYTHONPATH: /opt/dblatex-0.3/lib/python2.7/site-packages Adding to PATH: /opt/asciidoc-8.6.3/bin
Installing Development Tools
[edit]Standard development packages
[edit]The default Ubuntu installation doesn't come with many development tools or libraries. The following command should pull in compilers and a bunch of standard libraries that are often required.
sudo apt-get install build-essential libstdc++6 ia32-libs libc6-dev-i386 libglu1-mesa-dev freeglut3-dev python-dev gfortran
boost
[edit]Using apt-get
[edit]sudo apt-get install libboost-all-dev libboost-doc
It looks like Ubuntu 10.04 gets boost-1.40, I think we need at least boost 1.43, so you need to install from source.
From source
[edit]Download the boost source code from http://www.boost.org . Unpack it with a command like:
tar xvjf boost_1_50_0.tar.bz2
First you need to build bjam, which is boost's native build tool.
./bootstrap.sh
These are the commands that I used to build and install a version of boost:
./b2 --build-dir=build --prefix=/opt/boost-1.50.0 -j 4 link=static cflags=-fPIC cxxflags=-fPIC sudo ./b2 install --build-dir=build --prefix=/opt/boost-1.50.0 link=static cflags=-fPIC cxxflags=-fPIC
On 64 bit Linux, we need to use the -fPIC flag to avoid linker problems when trying to link boost statically.
Here is the setenv.sh script to put into /opt/boost-1.50.0 after installing.
<source lang=bash>
- !/bin/bash
source /usr/local/bin/setenv_functions.sh
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export BOOST_ROOT="${SCRIPT_DIR}" </source>
Qt
[edit]using apt-get
[edit]sudo apt-get install libqt4-dev qt4-dev-tools
And optionally, depending on what you're compiling:
sudo apt-get install qt3-dev-tools qt3-designer qt3-assistant
(Version 3s and 4 can co-exist.)
from source
[edit]You only need to install Qt from source to build a distribuatble version of FAIM and ParaView. (i.e. one that will include the Qt libraries because you can't assume that the user's system will.)
You will need version 4.6.3 to build paraview 3.10 .
Get the source from http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.3.tar.gz .
./configure --no-qt3support --release --fast --prefix=/opt/qt-4.6.3 make -j 8 sudo make install
Here is the setenv.sh script to put into /opt/qt-4.6.3 after installing.
<source lang=bash>
- !/bin/bash
source /usr/local/bin/setenv_functions.sh
export QTDIR=/opt/qt-4.6.3 remove_path PATH '/opt/qt(-[^/]+)?/bin/?' add_path PATH "${QTDIR}/bin" remove_path LD_LIBRARY_PATH '/opt/qt(-[^/]+)?/lib/?' add_path LD_LIBRARY_PATH "${QTDIR}/lib" </source>
numpy and scipy
[edit]sudo apt-get install python-scipy python-numpy-doc
VTK
[edit]Warning: ParaView includes an internal version of VTK. This must be used to build ParaView extensions and plugins, and any libraries that they depend on. I do not however recommend using this ParaView-internal version of VTK for anything that will not the used inside of ParaView.
using apt-get
[edit]sudo apt-get install vtk6 vtk6-doc vtk6-examples libvtk6-dev python-vtk6
from source
[edit]To make sure you have all the required build dependencies, first do this
sudo apt-get install tk8.4-dev tk8.4
Get the source code for VTK from http://vtk.org/ and unpack it somewhere.
tar xvzf vtk-5.10.0.tar.gz mv VTK vtk-5.10.0 # Because I like to have the version number on the directory cd vtk-5.10.0
Then make a build directory and configure VTK with cmake in the usual way.
mkdir build cd build
Before proceeding further, if you use Qt (at the moment I'm not) and you want to use the version of Qt that you installed, you should add it to the PATH:
export QTDIR=/opt/qt-4.6.3 export PATH="$QTDIR/bin:$PATH"
Now configure cmake:
ccmake ..
Now select the cmake options in the usual way, and generate. Here are the cmake options that I typically set:
| option | Setting |
|---|---|
| BUILD_EXAMPLES | ON |
| BUILD_SHARED_LIBS | ON |
| CMAKE_INSTALL_PREFIX | /opt/vtk-5.10.0 |
| VTK_USE_QT | OFF |
| VTK_WRAP_PYTHON | ON |
Once you've configured and generated cmake, build with
make -j 4
You can use it from the build directory. (In fact this is necessary if you want to build vtkn88.) In this case, you can use this setenv.sh :
<source lang=bash>
- !/bin/bash
source /usr/local/bin/setenv_functions.sh
- Conflicts with VTK from faim, so remove that.
export NUMERICS88_ROOT unset NUMERICS88_ROOT remove_path PATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/bin/?$' remove_path LD_LIBRARY_PATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/lib/?$' remove_path LD_LIBRARY_PATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/bin/?$' remove_path PYTHONPATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/lib' remove_path PYTHONPATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/bin/?$' remove_path PATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/bin/?$' remove_path LD_LIBRARY_PATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/lib/?$' remove_path LD_LIBRARY_PATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/bin/?$' remove_path PYTHONPATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/lib' remove_path PYTHONPATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/bin/?$'
remove_path PATH '/.+/vtk(-[^/]+)?/bin/?$' remove_path PATH '/.+/vtk(-[^/]+)?/.+/bin/?$' remove_path LD_LIBRARY_PATH '/.+/vtk(-[^/]+)?/lib/vtk(-[^/]+)?/?' remove_path LD_LIBRARY_PATH '/.+/vtk(-[^/]+)?/.+/bin/?$' remove_path PYTHONPATH '/.+/vtk(-[^/]+)?/lib/python([^/]+)?/site-packages' remove_path PYTHONPATH '/.+/vtk(-[^/]+)?/.+/bin/?$'
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" VTK_DIR="${SCRIPT_DIR}" add_path PATH "${VTK_DIR}/bin" add_path LD_LIBRARY_PATH "${VTK_DIR}/bin" add_path PYTHONPATH "${VTK_DIR}/bin" </source>
Alternatively, if you install it to /opt/vtk-5.10.0, here is the setenv.sh script to put into /opt/vtk-5.10.0 after installing.
<source lang=bash>
- !/bin/bash
source /usr/local/bin/setenv_functions.sh
- Conflicts with VTK from faim, so remove that.
export NUMERICS88_ROOT unset NUMERICS88_ROOT remove_path PATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/bin/?$' remove_path LD_LIBRARY_PATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/lib/?$' remove_path LD_LIBRARY_PATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/bin/?$' remove_path PYTHONPATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/lib' remove_path PYTHONPATH '/.+/[Nn]umerics88(-[^/]+)?(/.+)?/bin/?$' remove_path PATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/bin/?$' remove_path LD_LIBRARY_PATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/lib/?$' remove_path LD_LIBRARY_PATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/bin/?$' remove_path PYTHONPATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/lib' remove_path PYTHONPATH '/.+/[Ff][Aa][Ii][Mm](-[^/]+)?(/.+)?/bin/?$'
remove_path PATH '/.+/vtk(-[^/]+)?/bin/?$' remove_path PATH '/.+/vtk(-[^/]+)?/.+/bin/?$' remove_path LD_LIBRARY_PATH '/.+/vtk(-[^/]+)?/lib/vtk(-[^/]+)?/?' remove_path LD_LIBRARY_PATH '/.+/vtk(-[^/]+)?/.+/bin/?$' remove_path PYTHONPATH '/.+/vtk(-[^/]+)?/lib/python([^/]+)?/site-packages' remove_path PYTHONPATH '/.+/vtk(-[^/]+)?/.+/bin/?$'
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
VTK_ROOT="${SCRIPT_DIR}" add_path PATH "${VTK_ROOT}/bin" add_path LD_LIBRARY_PATH "${VTK_ROOT}/lib/vtk-5.10" add_path PYTHONPATH "${VTK_ROOT}/lib/python2.7/site-packages" </source>
ITK
[edit]using apt-get
[edit]sudo apt-get install libinsighttoolkit3-dev python-insighttoolkit3 insighttoolkit3-examples libopenjpeg2 libopenjpeg-dev
You should also install GDCM, which won't be automatically installed by apt-get, but its absence can cause some compilation errors of ITK programs.
Note, be aware of this issue: Bone lab libraries#Finding itkImageToVTKImageFilter.h .
from source
[edit]First make sure we have packages that are likely to be required for building ITK:
sudo apt-get build-dep libinsighttoolkit3-dev
Download the current version from itk.org (InsightToolkit-3.18.0.tar.gz) and untar in your development directory.
cd InsightToolkit-3.18.0 mkdir build cd build ccmake ..
Now select the cmake options in the usual way, and generate. Here are the cmake options that I typically set:
| option | Setting |
|---|---|
| CMAKE_INSTALL_PREFIX | /opt/itk-3.18.0 |
| CMAKE_CXX_FLAGS (Advanced setting) | -fPIC |
| CMAKE_C_FLAGS (Advanced setting) | -fPIC |
Note that the -fPIC flags are not necessary if you build a shared library, but the default for BUILD_SHARED_LIBS was NO, and I just left it at that. ITK itself will build regardless of the -fPIC flags, but you may get linker errors trying to link statically to it without them.
When happy with your cmake options, built it like this
make sudo make install
ITK does not install the VTK to ITK filters, and there seems to be no cmake option to request this, although the necessary files are in the source code tree. Fortunately, they are just 4 header and template files, so you can just copy them into place afterwards. Something like this:
cp InsightToolkit-3.16.0/Wrapping/WrapITK/ExternalProjects/ItkVtkGlue/src/*.h /opt/itk-3.18.0/include/InsightToolkit cp InsightToolkit-3.16.0/Wrapping/WrapITK/ExternalProjects/ItkVtkGlue/src/*.txx /opt/itk-3.18.0/include/InsightToolkit
GDCM
[edit]GDCM is a library for reading DICOM files. Sometimes ITK requires it, even if you don't think you're using it. (And sometimes, it's useful :)
using apt-get
[edit]sudo apt-get install libgdcm2.0 libgdcm2-dev libgdcm-tools libgdcm-ci
FLTK
[edit]using apt-get
[edit]sudo apt-get install libfltk1.1 libfltk1.1-dbg libfltk1.1-dev fltk1.1-doc fluid
from source
[edit]Download a stable compatible version from fltk.org, I use fltk-1.1.10 and untar in your development directory.
cd fltk-1.1.10 mkdir build cd build ccmake .. make sudo make install
Install directory was set to /opt/fltk-1.1.10
When using gcc 4.4.1 you have to use
./configure --enable-shared --enable-threads --prefix=/opt/fltk-1.1.10
instead of cmake as it will not compile.
Paraview
[edit]Currently we are using ParaView 3.8.0 . Ubuntu 10.04 provides paraview 3.4.0, so we will usually build paraview from source.
First make sure that you have all the required packages for building paraview:
sudo apt-get build-dep paraview
The source code can be downloaded from http://paraview.org/paraview/resources/software.html .
Unpack ParaView:
tar xvzf Paraview-3.8.0.tar.gz cd ParaView-3.8.0 mkdir build cd build cmake-gui .. # or else 'ccmake ..'
Now you can configure the build. The exact configuration depends on the purpose for which you are building ParaView. See ParaView_Extensions#Building_ParaView_Extensions .
Here are the cmake options that might be typical for Linux and that are different than the default:
| option | Setting |
|---|---|
| BUILD_SHARED_LIBS | ON |
| CMAKE_INSTALL_PREFIX | /opt/paraview-3.8.0 |
| PARAVIEW_BUILD_QT_GUI | ON |
| PARAVIEW_ENABLE_PYTHON | ON |
| PARAVIEW_USE_MPI | ON |
If you want to build using MPI (MPI is a library for parallel processing), you'll have to install OpenMPI first. See http://bonewiki.ucalgary.ca/index.php/Development_for_Linux#MPI .
When happy with your options (see the notes below), press 'C' for configure and then 'G' for generate. Then proceed with
make -j 4 # -j 4 means use 4 parallel processes for compiling sudo make install
blas, lapack and atlas
[edit]lapack is required to build faim. All these math libraries can be installed as follows:
sudo apt-get install libatlas-base-dev libatlas-headers libatlas-doc libblas-doc liblapack-doc liblapack-dev
gtest
[edit]gtest is google's testing framework. Some unit tests are written with it. Generally, it is not absolutely required, as you can typically build projects without testing support. However, this is not recommended, as the tests verify proper operation.
using apt-get
[edit]sudo apt-get install libgtest-dev
from source
[edit]You can get gtest from here: http://code.google.com/p/googletest/ .
Unpack it in the usual way
tar xvjf gtest-1.5.0.tar.bz2 cd gtest-1.5.0
Install it:
./configure --prefix=/opt/gtest-1.5.0 make sudo make install
Here is the setenv.sh script to put into /opt/gtest-1.5.0 after installing.
<source lang=bash>
- !/bin/bash
source /usr/local/bin/setenv_functions.sh
export GTEST_ROOT=/opt/gtest-1.5.0 remove_path LD_LIBRARY_PATH '/opt/gtest(-[^/]+)?/lib/?' add_path LD_LIBRARY_PATH "${GTEST_ROOT}/lib" </source>
asciidoc
[edit]Asciidoc is used for generating documentation (for example the FAIM manual).
You can install its dependencies with
sudo apt-get install docbook-utils xmlto dblatex libxml2-utils source-highlight
It's best to install asciidoc itself from source however, in order to get the newest version.
The source code can be obtained from
http://sourceforge.net/projects/asciidoc/
It can be installed with
tar xvzf asciidoc-8.6.3.tar.gz cd asciidoc-8.6.3 ./configure --prefix=/opt/asciidoc-8.6.3 make sudo make install
Here is the setenv.sh script.
<source lang=bash>
- !/bin/bash
- /opt/asciidoc-8.6.3/setenv.sh
source /opt/source-highlight-3.1.4/setenv.sh source /opt/dblatex-0.3/setenv.sh
export ASCIIDOC_ROOT=/opt/asciidoc-8.6.3 remove_path PATH '/opt/asciidoc(-[^/]+)?/bin/?' add_path PATH "${ASCIIDOC_ROOT}/bin" </source>
GLE Graphics
[edit]The GLE graphics engine is used to generate figures for the FAIM manual.
sudo apt-get install gle-graphics
DOxygen
[edit]sudo apt-get install doxygen graphviz
HDF5 and netCDF
[edit]To simplify linking, we'll build HDF5 statically linked to zlib. So first we need to build zlib, from http://www.zlib.net/ .
tar xvzf zlib-1.2.6.tar.gz cd zlib-1.2.6 export CPPFLAGS=-fPIC unset LIBS unset LDFLAGS ./configure --prefix=/opt/zlib-1.2.6 --static make
There is no need to actually install it.
Get HDF5 from http://www.hdfgroup.org/downloads/index.html .
I used the CMake build for HDF5, instead of the automake build. Note that for version 1.8.9 you have to apply a patch (or edit by hand one file) as described here: http://www.hdfgroup.org/ftp/HDF5/current/src/ .
Here are some interesting cmake options:
| option | Setting | |
|---|---|---|
| BUILD_SHARED_LIBS | ON | |
| CMAKE_BUILD_TYPE | Release | |
| CMAKE_INSTALL_PREFIX | /opt/hdf5-1.8.9 | |
| HDF5_BUILD_CPP_LIB | OFF | |
| HDF5_BUILD_FORTRAN | ON | |
| HDF5_BUILD_HL_LIB | ON | |
| HDF5_BUILD_TOOLS | OFF | |
| HDF5_ENABLE_Z_LIB_SUPPORT | ON | |
| ZLIB_INCLUDE_DIR | /home/eric/source/zlib-1.2.7 | This is an advanced setting. |
| ZLIB_LIBRARY | /home/eric/source/zlib-1.2.7/libz.a | This is an advanced setting. |
Build in the usual way for CMake.
Here's a setenv script for setting environment variables:
<source lang=bash>
- !/bin/bash
- /opt/hdf5-1.8.9/setenv.sh
source /usr/local/bin/setenv_functions.sh
export HDF5_DIR=/opt/hdf5-1.8.9 export HDF5_ROOT="${HDF5_DIR}" remove_path PATH '/opt/hdf5(-[^/]+)?/bin/?' add_path PATH "${HDF5_DIR}/bin" remove_path LD_LIBRARY_PATH '/opt/hdf5(-[^/]+)?/lib/?' add_path LD_LIBRARY_PATH "${HDF5_DIR}/lib" </source>
Now for netCDF, which you can get from ftp://ftp.unidata.ucar.edu/pub/netcdf . As of 4.2, the standard package builds only the C interface:
tar xvzf netcdf-4.2.0.tar.gz cd netcdf-4.2 sudo apt-get install doxygen source /opt/hdf5-1.8.9/setenv.sh export CPPFLAGS="-I$HDF5_DIR/include" export LDFLAGS="-L$HDF5_DIR/lib" unset LIBS ./configure --prefix=/opt/netcdf-4.2 --disable-dap make sudo make install
Here is a setenv.sh script:
<source lang=bash>
- !/bin/bash
source /opt/hdf5-1.8.9/setenv.sh
export NETCDF4_DIR=/opt/netcdf-4.2 remove_path PATH '/opt/netcdf(-[^/]+)?/bin/?' add_path PATH "${NETCDF4_DIR}/bin" remove_path LD_LIBRARY_PATH '/opt/netcdf(-[^/]+)?/lib/?' add_path LD_LIBRARY_PATH "${NETCDF4_DIR}/lib" remove_path PYTHONPATH '/opt/netcdf(-[^/]+)?/lib/?' add_path PYTHONPATH "${NETCDF4_DIR}/lib/python2.7/site-packages" </source>
Now for the fortran interface:
tar xvzf netcdf-fortran-4.2.tar.gz cd netcdf-fortran-4.2 source /opt/netcdf-4.2/setenv.sh export CPPFLAGS="-I$NETCDF4_DIR/include -I$HDF5_DIR/include -DgFortran" unset LIBS
Note that the -DgFortran part is to ensure correct name mangling in Fortran. See http://www.unidata.ucar.edu/support/help/MailArchives/netcdf/msg09206.html . A future version may not require this.
export LDFLAGS="-L$NETCDF4_DIR/lib -L$HDF5_DIR/lib" ./configure --prefix=/opt/netcdf-4.2 make sudo make install
For the python module netcdf4-python from http://code.google.com/p/netcdf4-python/ , some usual stuff:
tar xvzf netCDF4-1.0fix1.tar.gz mv netCDF4-1.0 netCDF4-python-1.0 # Rename to something more informative cd netCDF4-python-1.0 unset CPPFLAGS unset LIBS source /opt/netcdf-4.2/setenv.sh
Now it turns out that on Linux, with HDF 1.8.9 and python netCDF 1.0, we need to fix up the setup.py script a bit:
<source lang=diff>
- setup.py.old 2012-07-11 09:40:08.603064046 -0700
--- setup.py 2012-07-11 09:40:17.566869824 -0700
- 21,26 ****
--- 21,28 ----
for line in f:
if line.startswith('#define H5_VERSION'):
hdf5_version = line.split()[2]
+ elif line.startswith('#define VERSION'): + hdf5_version = line.split()[2]
return hdf5_version def check_ifnetcdf4(netcdf4_includedir):
</source>
Continuing with the build:
python setup.py build sudo bash source /opt/netcdf-4.2/setenv.sh python setup.py install --prefix=/opt/netcdf-4.2 exit
CUDA
[edit]CUDA is nVidia's language for GPU programming. The only project in the lab that uses CUDA at the moment is faim.
Basically, you need to get the document CUDA_C_Getting_Started_Linux.pdf from the nVidia CUDA website and follow the instructions.
Install the Driver
[edit]Download the driver.
Stop the GUI by hitting CTRL-ALT-1 to switch to the first (text only) virtual console. Log in and run:
sudo service gdm stop
Run the driver installer package:
chmod +x nVIDA-Linux-x86_64-xxx.xx.xx.run sudo ./nVIDA-Linux-x86_64-xxx.xx.xx.run
Restart gdm:
sudo service gdm start
Installing the CUDA toolkit
[edit]Again from the nVidia website, download the CUDA toolkit package. Install it.
chmod +x cudatoolkit_4.2.9_linux_64_ubuntu11.04.run sudo ./cudatoolkit_4.2.9_linux_64_ubuntu11.04.run
After we need to update the library and executable paths. For the former, you can do this system-wide by adding the following line to /etc/ld.so.conf. After editing this file you need to run sudo ldconfig.
# Add this line to /etc/ld.so.conf /usr/local/cuda/lib64
For the path, you can update your own PATH by adding this command to your .bashrc file
# Add this line to your .bashrc file export PATH="/usr/local/cuda/bin:$PATH"
Installing the CUDA SDK
[edit]Again from the nVidia website, download the CUDA SDK package. Install it.
chmod +x gpucomputingsdk_x.x.xx_linux.run ./gpucomputingsdk_x.x.xx_linux.run
Notice that we don't need sudo this time, because root privileges are not required: the SDK will live in your own home directory somewhere.
To compile the examples, just cd to the SDK directory and run make. My favorite example program is fluidsGL.
One complication however is that some SDK programs can only be built with gcc 4.4 and earlier, and the NVIDIA SDK doesn't respect the environment variables CC and CXX. So, we're going to set up the Debian alternatives system to be able to switch at will, like this:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 50 --slave /usr/bin/g++ g++ /usr/bin/g++-4.4
To switch, run this command and make your choice:
sudo update-alternatives --config gcc
In addition, to build all the programs you will need these libraries:
sudo apt-get install libxmu-dev libxi-dev
The linker fails to find libcuda as installed by Ubunutu, which can be fixed by running it like this:
make LINKFLAGS=-L/usr/lib/nvidia-current
For trouble-shooting, run make with
make verbose=1
Tips
[edit]Accessing Sodor disk
[edit]From Konqueror in KDE, use a path like:
smb://HPL-NT\sboyd@hal/Sodor
Working with Objects and Libaries
[edit]Here are some useful commands that generally work on Linux or OS-X.
To check what type a certain file is, use the file command. For example
$ file libvtkmyUnsorted.so libvtkmyUnsorted.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
Notice that we get a lot of information about this object. On systems with both 32 bit and 64 bit objects (such as OS-X) this can be particularly useful to see how this was compiled.
To list the symbols in an .o or .so or .a file, use nm. This can be useful to see if a particular function is available in a particular object or library. There can be a lot of output from this command, so typically you might dump the output into a file and then search that file using your preferred text editor.
To find out which shared libraries an executable or library will want to load at run time, use ldd. (On OS-X, a similar tool is otool -L.) For example
$ ldd faim_d linux-vdso.so.1 => (0x00007fff077aa000) libcgiter.so => not found liblapack.so.3gf => /usr/lib/atlas/liblapack.so.3gf (0x00007f4b7a295000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007f4b7a079000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f4b79d6c000) libgfortran.so.3 => /usr/lib/libgfortran.so.3 (0x00007f4b79a90000) libm.so.6 => /lib/libm.so.6 (0x00007f4b7980b000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f4b795f3000) libc.so.6 => /lib/libc.so.6 (0x00007f4b79281000) libblas.so.3gf => /usr/lib/atlas/libblas.so.3gf (0x00007f4b788c4000) /lib64/ld-linux-x86-64.so.2 (0x00007f4b7ad80000)
Notice that in this example it is telling us that faim_d will need to load libcgiter.so, but that it can't be found. We can fix this by adding the path to libcgiter.so to LD_LIBRARY_PATH (or on OS-X, to DYLD_LIBRARY_PATH).
Return to Contents or Return to Main Page
Development on Windows
[edit]Installing Development Tools
[edit]Compilers
[edit]Microsoft Visual Studio
[edit]Visual Studio is Microsoft's standard compiler and IDE. The Express version is free. Just search for "Microsoft Visual Studio Express" to find the correct download site.
Make sure you get Visual C++ 2008 and not the beta for the 2010 version, which fails to compile ParaView.
Note that the default installation of Visual Studio does not include the 64 bit compiler and tools, so you will definitely want to modify this.
Update: Visual Studio C++ 2008 is broken for reading/writing files larger than 4GB. Visual Studio 2010 must be used. The Express version does not include 64 bit support however. You must install the Windows SDK from http://msdn.microsoft.com/en-us/windows/bb980924 . I installed this alongside Visual Studio Express and it didn't seem to confuse CMake.
MinGW
[edit]MinGW is a port of gcc to windows.
Installation is somewhat intensive. Follow the instructions at http://www.mingw.org/wiki/Getting_Started .
NOTE: If you want to build anything with Qt, and you have downloaded a binary version of Qt, then you must use MinGW instead of Visual Studio. This is because the binary version of Qt are built with MinGW and C++ compilers and not cross-compatible on Windows. I actually recommend using Visual Studio and building Qt from source, but either route will work.
ConEmu
[edit]Not required, but makes working in a terminal in Windows much nicer.
http://code.google.com/p/conemu-maximus5/
CMake
[edit]You can obtain a Windows installer for CMake from http://www.cmake.org/ .
Subversion (SVN)
[edit]You can obtain a Windows installer for SVN from http://subversion.apache.org/ . Graphical windows clients (such as TortoiseSVN) are also available from there.
See *Subversion (SVN) .
git
[edit]Get from http://git-scm.com .
Python
[edit]You can get python from http://www.python.org/ .
Perl
[edit]You'll need Perl to compile OpenSSL. You can get Perl from http://www.activestate.com/activeperl . The Community edition is free. Get the x64 version (assuming you want 64 bit).
zlib
[edit]Get the zip file from http://www.zlib.net/ . Unzip it. Start a Visual Studio Command Prompt (64 bit).
nmake -f win32/Makefile.msc
OpenSSL
[edit]Ignore the stuff below, and just install the version from http://www.slproweb.com/products/Win32OpenSSL.html .
Download the source code from http://www.openssl.org .
You'll need to have Perl installed to compile SSL.
Follow the instructions in the file INSTALL.W64 . It looks more or less like this. Start a Visual Studio 2008 x86 Command prompt. Note that nt.mak makes static libraries. They will be put into the out32 directory.
perl Configure VC-WIN64A ms\do_win64a nmake -f ms\nt.mak cd out32 ..\ms\test
numpy and scipy
[edit]There aren't any official binaries for numpy and scipy for 64 bit Windows yet. If you want 64 bit versions, you can get them from http://www.lfd.uci.edu/~gohlke/pythonlibs/ .
Qt
[edit]You will have to build from source, because Nokia only supplies 32 bit builds at the current time.
Get the file qt-everywhere-opensource-src-4.6.3.zip from http://get.qt.nokia.com/qt/source/ . Unpack it.
Go to Visual Studio 2005->Visual Studio tools in the start menu and click on Visual Studio 2005 x64 Win64 Command Prompt.
In the Command Prompt, go to the 64-bit Qt directory you just extracted.
Once you are in the directory, type:
configure.exe -qt-gif -qt-libpng -qt-libmng -qt-libtiff -qt-libjpeg
Now to start the compilation, run nmake by typing:
nmake
Once the compilation is complete, then type:
nmake install
boost
[edit]Get it from http://boost.org .
Unzip boost_1_52_0.zip .
Open a Visual Studio 2008 64 bit Command Prompt.
cd boost_1_45_0 bootstrap bjam --build-dir=build address-model=64 architecture=x86 link=static -j 4 stage
For the Intel compilers, open an Intel Compilers 64 bit Command Prompt and do this use this:
bjam --build-dir=build_intel toolset=intel-13.0 address-model=64 architecture=x86 link=static -j 4 stage
TK
[edit]Is required by VTK.
Get from http://www.activestate.com/activetcl
VTK
[edit]Get the zipped source code from http://vtk.org .
Unpack it.
mkdir build cd build cmake-gui ..
Then click the solution file to build it.
HDF5 and netCDF
[edit]Get HDF5 from http://www.hdfgroup.org/downloads/index.html .
Turns out we need to build HDF5 statically to link to netCDF on Windows. Don't know why.
Here are some interesting cmake options:
| option | Setting |
|---|---|
| BUILD_SHARED_LIBS | OFF |
| CMAKE_BUILD_TYPE | Release |
| CMAKE_INSTALL_PREFIX | C:/Users/eric/Programs/HDF5-1.8.10-static |
| ENABLE_DAP | OFF |
| HDF5_BUILD_CPP_LIB | OFF |
| HDF5_BUILD_FORTRAN | OFF |
| HDF5_BUILD_HL_LIB | ON |
| HDF5_BUILD_TOOLS | ON |
| HDF5_ENABLE_Z_LIB_SUPPORT | ON |
| ZLIB_INCLUDE_DIR | C:/Users/eric/source/zlib-1.2.7 |
| ZLIB_LIBRARY | C:/Users/eric/source/zlib-1.2.7/zlib.lib |
Build in the usual way for CMake.
Currently, 64 bit Windows build of netcdf can only be built with CMake. However, netCDF 4.2.1.1 doesn't provide cmake, so get release candidate of 4.3 from http://www.unidata.ucar.edu/downloads/netcdf/netcdf-rc/index.jsp .
Configure with cmake and point it to the static HDF5 libraries.
| option | Setting |
|---|---|
| BUILD_SHARED_LIBS | ON |
| CMAKE_BUILD_TYPE | RELEASE |
| CMAKE_INSTALL_PREFIX | C:/Users/eric/Programs/netCDF-4.3.0-rc2 |
| HDF5_HL_LIB | C:/Users/eric/Programs/hdf5-1.8.10-patch1-static/lib/hdf5_hl.lib |
| HDF5_INCLUDE_DIR | C:/Users/eric/Programs/hdf5-1.8.10-patch1-static/include |
| HDF5_INCLUDE_DIRS | C:/Users/eric/Programs/hdf5-1.8.10-patch1-static/include |
| HDF5_LIB | C:/Users/eric/Programs/hdf5-1.8.10-patch1-static/lib/hdf5.lib |
| ZLIB_INCLUDE_DIR | C:/Users/eric/source/zlib-1.2.7 |
| ZLIB_LIBRARY | C:/Users/eric/source/zlib-1.2.7/zlib.lib |
| ENABLE_XGETOPT | ON |
The files XGetopt.h and XGetopt.c are missing. They need to go into 3 directories.
Start up the Visual Studio project, but then change the compiler to Intel C++ compilers (not sure why it fails with the Microsoft compiler).
Get the python module netcdf4-python from http://code.google.com/p/netcdf4-python/ . Use some other operating system to unpack the tar file, copy it to Windows. I like to rename the directory name to have python in it (e.g. python-netCDF4-1.0.2).
The setup.py script needs to be seriously modified:
This line:
if line.startswith('#define H5_VERSION'):
hdf5_version = line.split()[2]
Should be changed to:
if line.startswith('#define H5_VERSION'):
hdf5_version = line.split()[2]
elif line.startswith('#define VERSION'):
hdf5_version = line.split()[2]
This line:
libs = ['netcdf','hdf5_hl','hdf5','z']
should be changed to:
libs = ['netcdf']
This line:
extensions = [Extension("netCDF4",["netCDF4.c"],libraries=libs,library_dirs=lib_dirs,include_dirs=inc_dirs,runtime_library_dirs=lib_dirs)]
Should be changed to
extensions = [Extension("netCDF4",["netCDF4.c"],libraries=libs,library_dirs=lib_dirs,include_dirs=inc_dirs)]
Start a Visual Studio 64 bit command prompt.
set HDF5_INCDIR=C:\Users\eric\Programs\HDF5-1.8.10-patch1-static\include set HDF5_LIBDIR=C:\Users\eric\Programs\HDF5-1.8.10-patch1-static\lib set NETCDF4_INCDIR=C:\Users\eric\Programs\netCDF-4.3.0-rc2\include set NETCDF4_LIBDIR=C:\Users\eric\Programs\netCDF-4.3.0-rc2\lib
If using something other than Visual Studio 2008, you will also need something like this:
set VS90COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\
See http://stackoverflow.com/questions/2667069/cannot-find-vcvarsall-bat-when-running-a-python-script .
python setup.py build
python setup.py install --prefix C:\Users\eric\Programs\python-netcdf
NSIS
[edit]NSIS is a Windows installer that is required if you want to create package installers for CMake projects. This includes ParaView.
Get it from http://nsis.sourceforge.net/ .
ParaView
[edit]We are going to do an install from source because that is necessary if we want to build plugins.
Build instructions are at http://paraview.org/Wiki/ParaView . I basically follow those.
Download paraview-3.10.1.zip from http://www.paraview.org/paraview/resources/software.html . Unzip it to some place that you want to use for building. Also create a folder for building. I usually make a folder "build" as a sub-folder in the source tree of paraview (e.g. C:\Documents and Settings\eric\My Documents\source\paraview-3.10.1\build).
Start CMake. Set the source code and build binaries directories. Click configure. Select your compiler.
Here are the cmake options that I typically choose:
| option | Setting |
|---|---|
| BUILD_SHARED_LIBS | ON |
| CMAKE_INSTALL_PREFIX | C:/Program Files/paraview-3.10.1 |
| PARAVIEW_BUILD_QT_GUI | ON |
| PARAVIEW_ENABLE_PYTHON | ON |
| PARAVIEW_USE_MPI | OFF |
| QT_QMAKE_EXECUTABLE | C:/Qt/4.6.3/qt/bin/qmake.exe |
Once you've Configured and Generated with CMake, start up Visual Studio by double-clicking on the ParaView.sln in the build directory. In Visual Studio, select the ALL_BUILD project, make sure the type of release to be built is Release and not Debug (that is on the toolbar), then select Build -> Build ALL_BUILD.
gtest
[edit]Get the zipped code from http://code.google.com/p/googletest/ .
Unpack it.
mkdir build cd build cmake-gui ..
Then click the solution file to build it.
Tips
[edit]Working with objects and libraries
[edit]To find out what kind of library a particular file is, use
dumpbin /headers
The machine type is almost the first line you'll get.
It will be 14c for x86 and 8664 for x64.
To list the exports of a library, use
dumpbin /EXPORTS foo.lib
Return to Contents or Return to Main Page
Development on OpenVMS
[edit]"Hello, world!"
[edit]A simple "Hello, world!" application
[edit]In C:
Write the following program in your favorite text editor (e.g. eve) and save it as hello.c:
#include <stdio.h>
int main(void)
{
printf("Hello, world!\n");
return(0);
}
Compile and link using the following lines:
CC /OBJECT=hello.obj hello.c LINK hello.obj /EXECUTABLE=hello.exe
Run it:
$ run hello Hello, world! $
In C++:
Write the following program in your favorite text editor (e.g. eve) and save it as hello.cxx:
#include <iostream>
int main()
{
cout << "Hello, world!" << endl;
return 0;
}
Compile and link using the following lines:
CXX /OBJECT=hello.obj hello.cxx CXXLINK hello.obj /EXECUTABLE=hello.exe
Run it:
$ run hello Hello, world! $
A "Hello, world!" application with parameters
[edit]Write the following program in your favorite text editor (e.g. eve) and save it as say_hello.c:
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
if (argc < 2)
{
printf("Usage: hello <name>\n");
exit(0);
}
printf("Hello, %s!\n", argv[1]);
return(0);
}
Compile and link using the following lines:
CC /OBJECT=say_hello.obj say_hello.c LINK say_hello.obj /EXECUTABLE=say_hello.exe
Now you need to define a symbol for your executable:
hello :== $DISK1:[DEVEL.FABIO.EXAMPLES.HELLO]SAY_HELLO.EXE
This allows you to run your program by simply calling "hello". You can give it parameters too, Unix style. The mechanism is known in VMS as "defining a foreign command".
Run it:
$ hello Usage: hello <name> $ hello Steve Hello, steve! $ hello "Steve" Hello, Steve! $
Writing a (Unix) Makefile for the say_hello application
[edit]Once the application described above is written, type the following into a file named "Makefile"
all: say_hello.exe
clean:
delete say_hello.exe;*
delete say_hello.obj;*
say_hello.exe: say_hello.obj
LINK say_hello.obj /EXECUTABLE=say_hello.exe
say_hello.obj: say_hello.c
CC /OBJECT=say_hello.obj say_hello.c
IMPORTANT: the space before the commands in the Makefile (i.e. the space before "delete ...", "LINK ...", etc) is a single TAB character.
You can now compile your program by calling "gmake"
$ gmake
I am assuming, of course, that gmake is installed in your system. In the bone lab, gmake is installed in duck.kin.ucalgary.ca.
Developing new IPL commands in C
[edit]A short manual on how to develop new IPL commands in C: Download .doc file
Advanced topics
[edit]A list of nice things to add to this short tutorial:
- Status of cmake in VMS
Getting started
[edit]Editor:
$! Define the editor $ eve == "spawn/nowait edit/display=decwindows/tpu" $ eve filename.txt
Compiler:
$! Define the compiler
$ C64 :== CC/POINTER_SIZE=64/check=pointer=all/optimize=(tune=ev6,level=5)
$! Compile the program 'ipl_scanco_c' and link it to existing libraries
$ c64 ipl:ipl_scanco_c
$!
$ link /exe=ipl:ipl_SCANCO_c -
ipl:ipl_scanco_c, -
ipl:ipl_scanco_c_ident/opt, -
ipl:ipl_proc/lib, -
ipl:ipl/lib, -
mu:scanco_ext/lib, -
dsrc:d3p_scanco/lib, -
scanco_lib/lib
SCEVA3 (Itanium)
[edit]sceva3.ucalgary.ca
Login devel with bone5Rus.
Note that scp is configured to use ssh2 and scp2. Linux (openssh) uses scp1:
http://www.snailbook.com/faq/scp-ossh-to-ssh2.auto.html
Whereas ssh and sftp work out of the box, successfully using scp requires a scp2 client.
SCTHIN (DS10L)
[edit]duck.kin.ucalgary.ca has been assigned IP address 136.159.130.33 netmask 255.255.255.0 default router 136.159.130.34 DNS servers 136.159.130.130, 136.159.130.3
Login microct or devel with bone5rus.
To boot into the cluster
>>>boot ewa0
To boot out of the cluster, unplug the ethernet cable and
>>>boot
To get to boot prompt, type shutdown on the login screen. Or, after powerdown, hit ctrl-P repeatedly.
There are two accounts:
- microct
- devel
Installing packages on VMS
[edit]Contacts: Piet Schuermans Mark Blanchard
Freeware source
[edit]http://h71000.www7.hp.com/freeware/freeware80/
Instructions for unpacking .tar.gz files on VMS
- 1. Rename the file to file.tgz
- 2. gunzip file.tgz (creates a file.tar)
- 3. vmstar file.tar
VMSTAR
[edit]A tar program for VMS.
Either install from the source (build it), or apparently the binary can be downloaded from
http://h71000.www7.hp.com/freeware/freeware50/vmstar/alpha/
where you will find VMSTAR.EXE
When extracting files that contain "unix" filenames (e.g., config.h.in), make sure to extract the files with
$ cvstar xof file.tar ! Option 'o' extracts ODS5 files with ODS2 format
CVS
[edit]The sources can be retrieved from http://ftp.gnu.org/non-gnu/cvs/source/stable/
You will need a C compiler on OpenVMS. There are several versions of CVS available, but all of them need some tweaking before they can be successfully built.
- cvs-1.11.18 (see build instructions at http://lists.gnu.org/archive/html/bug-cvs/2005-01/msg00280.html)
- cvs-1.11.21 (do not use)
- cvs-1.11.22 (latest version as of May 26, 2007 -- may be built, but follow instructions as per v.18 above)
Download the .tar.gz file, rename it to .tgz once on vms system, use gunzip then vmstar:
$ rename cvs-1.11.22.tar.gz cvs-1.11.22.tgz $ gunzip cvs-1.11.22.tgz $ vmstar xof cvs-1.11.22.tar ! option 'o' allows ODS2 naming.
For all versions, make the following changes before starting:
- 1. Before you attempt to compile 1.11.22 or later you will need make a copy of [.LIB]FNMATCH_H.IN as [.LIB]FNMATCH.H
- 2. Correct typo in [.SRC]BUILD_SRC.COM change "libz" to "zlib"
Note: The directory names would have been cvs-1.11.21.dir on Linux. However VMS doesn't allow more than 1 . in the name. If you enter
$ set process/parse=extended
in a terminal you'll be able to access these files. You rename them (i.e. cvs-1_11_21.dir).
NOTE Piet Schuermans (mailps@mac.com) sent me a binary version of CVS on May 25, 2007 that I am currently using.
USAGE
Note that I have a "getting started on cvs for vms" document that can help.
OpenVMS is case sensitive for passing parameters. So put the parameters between " "
$ cvs -d ":pserver:anonymous@public.kitware.com:/cvsroot/VTK" login $ cvs -d ":pserver:anonymous@public.kitware.com:/cvsroot/VTK" co "vtknew/CMake"
If your using this repository location frequently then
$ define cvsroot ":pserver:anonymous@public.kitware.com:/cvsroot/VTK"
after this you can skip the -d ...... parameter
$ cvs login vtk
This will create .cvspass file in your home directory so your only need to use the cvs login once
$ cvs co "vtknew"
public.kitware.com has ip address 66.194.253.19
Update VMS licenses
[edit]As user system:
$ lic list/full
and check which licenses are currently from 'MONTAGAR' and expire on Aug 31.
I recommend to only then replace those licenses with the new ones, and not load the whole license text file that you get from HP. Make a 'shortlist' of the licenses you need, then FTP them to the VMS system and copy and paste.
Layered Products (any licence, but NOT the openvms-Alpha itself!)
$ lic del OPENVMS-ALPHA-USER $ LICENSE REGISTER OPENVMS-ALPHA-USER - /ACTIVITY=CONSTANT=100 - /AUTHORIZATION=EDU-711643-12345 - /DATE=31-AUG-2007 - /ISSUER=MONTAGAR - /PRODUCER=DEC - /TERMINATION=31-AUG-2007 - /UNITS=0 - /CHECKSUM=1-BBME-NKAP-EAFK-CNCA $ lic load OPENVMS-ALPHA-USER $ lic del vmscluster $ LICENSE REGISTER VMSCLUSTER - /ACTIVITY=CONSTANT=100 - /AUTHORIZATION=EDU-711643-12345 - /DATE=31-AUG-2007 - /ISSUER=MONTAGAR - /PRODUCER=DEC - /TERMINATION=31-AUG-2007 - /UNITS=0 - /CHECKSUM=1-GOOP-ALPF-PGKG-OBND $ lic load vmscluster
Then, on SCTHIN, for the basic 'openvms-alpha' license itself. In a cluster, this license must be limited to one computer only, so first, to delete the correct of the multiple openvms-alpha licenses only. If I ever wanted SCTHIN to be the server in a cluster, I should do the following (very unlikely!):
$ lic list openvms-alpha/ful $ lic delete openvms-alpha/auth=xxxxxx ! after first looking up the authori. of that montagar license. $ LICENSE REGISTER OPENVMS-ALPHA - /ISSUER=MONTAGAR - /AUTHORIZATION=EDU-742405-743161 - /PRODUCER=DEC - /UNITS=0 - /TERMINATION_DATE=31-AUG-2008 - /ACTIVITY=A - /OPTIONS=(NO_SHARE) - /CHECKSUM=2-JMOA-GOFL-AKID-DHCJ $ lic modify openvms-alpha/auth=EDU-742405-743161/include=scthin ! to make it available to scthin only.
MMS: VMS 'make' tool
[edit]To start:
$ mms
An example from Bruno Koller of descrip.mms:
.IGNORE
FFLAGS = /FAST/OPT=(LEVEL=5,TUNE=EV68,INL=ALL)/OBJECT=$(MMS$TARGET_NAME).OBJ
FGENER = /ALIGN=(NATURAL,SEQUENCE)/ASSUME=NOACCURACY/OPT=(LEVEL=5,TUNE=GENERIC,INL=ALL)/OBJECT=$(MMS$TARGET_NAME).OBJ_G
.FOR.OBJ
$(FORT)$(FFLAGS) UD:$(MMS$TARGET_NAME).FOR
$(FORT)$(FGENER) UD:$(MMS$TARGET_NAME).FOR
.FOR.INC
$(FORT)$(FFLAGS) UD:$(MMS$TARGET_NAME).FOR
$(FORT)$(FGENER) UD:$(MMS$TARGET_NAME).FOR
all :: uct_reconstruction.exe, uct_reconstruction.exe_generic
write sys$output "UCT_RECONSTRUCTION.EXE generated"
uct_reconstruction.exe :: -
recoident.opt, -
uct_reconstruction.obj, -
scli:uct_reco_constants.inc, -
calc_fan_beam_angles.obj, -
rebinning.obj, -
raw_to_rpro.obj, -
conereco.obj
link/exe=uct_reconstruction.exe -
recoident/opt, -
uct_reconstruction.obj, -
calc_fan_beam_angles, -
rebinning, -
raw_to_rpro, -
conereco, -
scanco_lib/lib
uct_reconstruction.exe_generic :: -
recoident.opt_g, -
uct_reconstruction.obj_g, -
scli:uct_reco_constants.inc, -
calc_fan_beam_angles.obj_g, -
raw_to_rpro.obj_g, -
rebinning.obj_g, -
conereco.obj_g
link/exe=uct_reconstruction.exe_generic -
recoident/opt, -
uct_reconstruction.obj_g, -
calc_fan_beam_angles.obj_g, -
raw_to_rpro.obj_g, -
rebinning.obj_g, -
conereco.obj_g, -
scanco_lib/lib
uct_reconstruction.obj :: ud:uct_reconstruction.for, -
scli:uct_reco_constants.inc
calc_fan_beam_angles.obj :: ud:calc_fan_beam_angles.for, -
scli:uct_reco_constants.inc
raw_to_rpro.obj :: ud:raw_to_rpro.for, -
scli:uct_reco_constants.inc
rebinning.obj :: ud:rebinning.for, -
scli:uct_reco_constants.inc, -
scli:ctdata_header_structure.inc
conereco.obj :: ud:conereco.for, -
scli:uct_reco_constants.inc
Some notes:
- UD is a logical for user disk search list over different disks, so I can compile on both alpha and vax with just having one source.
- No need to put "ud:" at your site. Also, a few lines may have been wrapped which should be on one line (/fflag...) by the mail program.
- Let me know if you want the mms installation file, you will need the hp campus mms license herefore (which you may already have)
Alternative to MMS: MMK
[edit]A free MMS replacement is called Madgoat MMK (http://www.madgoat.com/mmk.html).
Alternative to EVE: NEDIT
[edit]NEDIT is also available for VMS and offers a nicer editor, in my opinion (Mark Blanchard).
Online VMS discussion lists
[edit]info-vax (comp.os.vms)
SCP hangs and is not working
[edit]The problem occured when setting up sceva3 for development. SCP (secure copy) can be used as follows (Linux terminal, untested):
scp Readme.txt devel@sceva3.ucalgary.ca:[.Scratch]
Troubleshooting:
- 1. Check that all the scripts called from
[DEVEL]login.comare present on the machine (alternatively, remove these calls from login.com, but logicals and symbols will not be setup properly, e.g. eve). Errors in the login script will cause scp to hang.
- 2. If you get:
scp1 compatibility mode is not supported.this means that scp on VMS is using ssh2 and scp2 and the client uses scp1 ( http://www.snailbook.com/faq/scp-ossh-to-ssh2.auto.html ). VMS could be configured for scp1, but the better option (Mark Blanchard, Scanco) is to use an scp2 client (is there one for MacosX/Linux? and Windows?).
Developing on Duck
[edit]Installing GNV (GNU is not VMS)
[edit]Downloading GNV
[edit]First, download GNV version 1.9 for VMS 7.3-2
http://h71000.www7.hp.com/opensource/gnv.html
Unzip the file on your workstation. FTP the two .pcsi to duck using the "binary" mode (i.e. type bin before you use get. Make sure that all letters in the file name are uppercase, so, for example, if you got the following after unzipping:
dec-axpvms-gnv-v0109-000-1.pcsi$compressed;1 dec-axpvms-gnv-v0109-000-1.pcsi$compressed_esw;1
rename them to
DEC-AXPVMS-GNV-V0109-000-1.PCSI$COMPRESSED;1 DEC-AXPVMS-GNV-V0109-000-1.PCSI$COMPRESSED_ESW;1
Installing GNV
[edit]Login as user system to do the installation.
Follow the installation instructions on http://openvms.compaq.com/OpenSource/gnvreadme_first.html, section 6.
$PRODUCT INSTALL GNV /SOURCE=device:[dir.where.pcsi.are]
Setting up GNV
[edit]Follow the installation instructions on http://openvms.compaq.com/OpenSource/gnvreadme_first.html, section 7.
The following modifications were made to configuration files on duck:
1. File SYS$MANAGER:SYSTARTUP_VMS.COM: the following line was added
$ @SYS$STARTUP:GNV$STARTUP.COM
2. File LOGIN.COM at the devel account: added the line below
$ @GNU:[LIB]GNV_SETUP.COM
3. As mentioned in http://openvms.compaq.com/OpenSource/gnvreadme_first.html, section 9.3, long file names are enabled on an ODS-5 disk by adding the follwowing line devel's LOGIN.COM file:
$ SET PROCESS/PARSE_STYLE=EXTENDED
Note that you could also make the terminal case sensitive, but this did not work well, so I did not include this command.
Running GNV
[edit]Just start bash:
$ ssh -l devel duck.kin.ucalgary.ca devel@duck.kin.ucalgary.ca's password: Welcome to OpenVMS (TM) Alpha Operating System, Version V7.3-2 DISK1:[DEVEL] $ bash bash$
See the list of commands available at http://h71000.www7.hp.com/opensource/gnvreadme_first.html, section 5.