checkout NuTo?
svn co --username=USERNAME svn+ssh://USERNAME@svn.code.sf.net/p/nuto/code/ nuto
or update using
svn up
Build and Install external packages (optional)
a. Download individually from the relevant homepages and build static libraries (on 64-bit systems the -fPIC option is required during compilation) or build shared libraries -> recommended to get the newest versions
b. Download via ssh (login required) repository location has changed
svn co svn+ssh://parrot.bauing.uni-weimar.de/home/projects/NUTO/externals
Homepage: http://eigen.tuxfamily.org
cd eigen
mkdir eigen3
tar xzf 3.0.6.tar.gz --strip 1 -C eigen3
cd eigen3
mkdir objdir
cd objdir
cmake -DCMAKE_INSTALL_PREFIX=/opt/nuto ..
make
make install (eventually as root)
Homepage: http://www.boost.org/
cd boost
tar xzf boost_1_54_0.tar.gz
cd boost_1_54_0
./bootstrap.sh --prefix=/opt/nuto
./bjam --layout=versioned cxxflags="-fPIC -std=c++0x" --with-serialization --with-filesystem --with-python link=static
./bjam --layout=versioned cxxflags="-fPIC -std=c++0x" --with-serialization --with-filesystem --with-python link=static install (eventually as root)
In order not to use the standard compiler, do e.g.
./bjam --toolset=gcc-4.4 --layout=versioned cxxflags="-fPIC -std=c++0x" --with-serialization --with-filesystem --with-python link=static
In order to use debug version do
./bjam debug --layout=versioned cxxflags="-fPIC -std=c++0x" --with-serialization --with-filesystem --with-python link=static
Homepage: http://github.com/xianyi/OpenBLAS/archive/v0.2.14.tar.gz.
cd openblas
tar xzf OpenBLAS-0.2.14.tar.gz
cd OpenBLAS-0.2.14
make USE_OPENMP=1 (if openMP parallelization is used else just make)
make PREFIX=/opt/nuto/openblas install (eventually as root)
Homepage: http://www.pardiso-project.org/branch. Download the appropriate PARDISO library. "libpardiso500-GNU472-X86-64.so" means you are using at least gcc version 4.7.2.
cp libpardiso500-GNU<gcc_version>-X86-64.so /opt/nuto/lib/libpardiso.so (eventually as root)
Homepage: http://www.cs.umd.edu/~mount/ANN
Patches: ANN-cmake.patch
cd ann
tar xzf ann_1.1.2.tar.gz
cd ann_1.1.2
patch -p1 -i ../ANN-cmake.patch
mkdir objdir
cd objdir
cmake -DCMAKE_INSTALL_PREFIX=/opt/nuto ..
make
make install (eventually as root)
mkdir /opt/nuto/include/ANN (eventually as root)
mv /opt/nuto/include/ANN.h /opt/nuto/include/ANN (eventually as root)
Homepage: http://www.caam.rice.edu/software/ARPACK/
Patches: Arpack-cmake.patch
cd ARPACK
tar xzf arpack96.tar.gz
cd ARPACK
patch -p1 -i ../ARPACK-cmake.patch
mkdir objdir
cd objdir
cmake -DCMAKE_INSTALL_PREFIX=/opt/nuto ..
make
make install (eventually as root)
Build the Makefiles with cmake (check CMakeLists.txt for additional build options) An out-of-source is recommended
a. create a build directory (it is recommended that the build directory is not a subdirectory of the nuto source directory)
mkdir nuto_build
cd nuto_build
b. call cmake to create unix make files
cmake -DNUTO_EXTERNAL_LIBRARIES_ROOT=/opt/nuto -DBOOST_ROOT=/opt/nuto mysourcedirectory
here mysourcedirectory = 'home/username/develop/nuto'
or to create unix make files and an eclipse project for debugging and only python tests turned on
cmake -G"Eclipse CDT4 - Unix Makefiles" -DNUTO_EXTERNAL_LIBRARIES_ROOT=/opt/nuto -DBOOST_ROOT=/opt/nuto -DENABLE_DEBUG:BOOL=ON -DENABLE_C++_TESTS:BOOL=OFF -DENABLE_EXAMPLES:BOOL=OFF ../nuto
or to create unix make files and an eclipse project with optimization and python and c++ tests turned on
cmake -G"Eclipse CDT4 - Unix Makefiles" -DNUTO_EXTERNAL_LIBRARIES_ROOT=/opt/nuto -DBOOST_ROOT=/opt/nuto -DENABLE_DEBUG:BOOL=OFF -DENABLE_C++_TESTS:BOOL=ON ../nuto
cmake -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_ECLIPSE_VERSION=3.8 -DNUTO_EXTERNAL_LIBRARIES_ROOT=/opt/nuto -DBOOST_ROOT=/opt/nuto -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so -DENABLE_DEBUG:BOOL=ON -DENABLE_C++_TESTS:BOOL=OFF -DENABLE_EXAMPLES:BOOL=OFF ../nuto
this one allows you to specify the python version you are using (in case python2 and python3 are installed in parallel) and the eclipse version
call the build process (in your working directory)
make
set search path for python modules
export PYTHONPATH=$(pwd)/src:$PYTHONPATH
test the build process
make test
a single test file (e.g. Brick8N) can be executed
ctest -V -R Brick8N
build documentation
make doc
if you have problems with the Fortran-compiler, set the path to the Fortran-compiler by the environment variable FC or the cmake variable CMAKE_Fortran_COMPILER.
export PYTHONPATH=$PYTHONPATH:<path to>/mynuto/src
The NuTo sources contain a simple GUI (“NuToGUI”) to try out NuTo and view results.
It has the following additional requirements:
wxWidgets (http://www.wxwidgets.org/) is a cross-platform GUI toolkit, used to create the interface for the NuToGUI application.
For Linux, wxWidgets is usually available as a package in the distribution. For Windows, binaries are available.
A comprehensive overview of the different ways to acquire wxWidgets can be found on it's Wiki: http://wiki.wxwidgets.org/Guides_%26_Tutorials#Installing_wxWidgets_and_Setting_up_Your_IDE
When configuring NuTo for building you may have to tell CMake where to find wxWidgets. The CMake documentation lists the different variables that control how wxWidgets is found: http://cmake.org/cmake/help/cmake-2-8-docs.html#module:FindwxWidgets
VTK is a visualization toolkit and used for the results display.
VTK uses CMake for building; so building it is essentially just a matter of doing cmake <path to="" vtk_sources="">; make. (On Windows you should provide an appropriate generator options.) When building NuTo you need to specify where VTK can be found - this is done through the VTK_DIR variable, like cmake -DVTK_DIR=<path where="" vtk="" was="" built=""> <path to="" nuto="">.
</path></path></path>
On Linux, there are probably distribution packages available that contain Boost.Python.
If you built Boost yourself, Boost.Python should usually be built as a part of it, if the Python headers+libraries are available.
You need a NuTo python module set up, as described above. You can run the GUI application itself with ./nutogui from the build directory. (Without a correct NuTo environment you will get an error message along the lines of “could not initialize Python ... could not import module nuto”.)
Small walkthrough:
Instead of just calling cmake do
CC=/usr/bin/gcc-4.4 CXX=/usr/bin/g++-4.4 FC=/usr/bin/gfortran-4.4 cmake [...]