NUMCXX  0.13.20181108
Numerical library for small projects and teaching purposes
NUMCXX Installation

The library has been tested under Linux, MacOSX, Win10/Cygwin

Prerequisites

Installation of the python components is currently not necessary.

Linux

The following packages should be installed using the Linux package manager (from system to system, they have different names)

1 gcc
2 g++
3 cmake
4 blas
5 lapack
6 suitesparse
7 python
8 python-devel
9 python-numpy
10 python-matplotlib
11 swig

Mac

We need the same packages as on Linux.

1 $ gcc
1 $ xcode-select -p /Library/Developer/CommandLineTools

Cygwin

Thanks to the autor of this post for showing the way for matplotlib.

1 gcc-g++
2 wget
3 curl
4 openblas
5 cmake
6 lapack
7 libumfpack-devel
8 
9 python
10 python-numpy
11 python-devel
12 swig
1 libfreetype-devel
2 python-pyqt4
3 xorg-server
4 xinit
1 $ wget https://bootstrap.pypa.io/get-pip.py
2 $ python get-pip.py
1 $ pip install matplotlib
1 $ startxwin
2 $ export DISPLAY=:0.0
1 $ export MPLBACKEND=qt4agg

Installation of numcxx

TU Berlin UNIX Pool

Here, the current version of numcxx, without the examples, is installed in the directory /net/wir The example subdirectories can be copied separately as a whole.

Virtual Machine

The debian-numcxx virtual machine can be downloaded from the course home page. Load this machine into VirtualBox and start it. Vtk, numcxx and vtkfig and codeblocks are installed on this machine. Examples can be run with the numcxx-build utility.

Build on your own system

Go to the numcxx root directory and set up the cmake project:

1 $ mkdir .build
2 $ cd .build
3 $ CXXFLAGS=-std=c++11 cmake ..
4 $ cmake --build .

This should compile the library and make it findeable by depending projects via an entry im the user CMake project registry found under .cmake in your home directory.

Working with the examples

First, copy an example directory to your working directory

1 $ cp -r <numcxx>/examples/whatever .
2 $ cd whatever

Each of the example subdirectories has its own CMakeLists.txt which looks for an installed numcxx during the setup phase.

Plain unix

Set up a build subdirectory and compile the project:

1 $ mkdir .build
2 $ cd .build
3 $ CXXFLAGS=-std=c++11 cmake ..
4 $ cmake --build .
5 $ ./<whatever example>

Code::Blocks

Set up a build subdirectory for codeblocks:

1 $ mkdir .build
2 $ cd .build
3 $ CXXFLAGS=-std=c++11 cmake -G"CodeBlocks - Unix Makefiles" ..
4 $ codeblocks <whatver the project name is>.cbp

In codeblocks, select a target under "Build/Select Target". In the management pane (left), select the corresponding source file. Now you can build and run via the correspondin menu items of codeblocks.

Other IDEs

Many of them should work. Like with code blocks, find out the name of the generator via cmake -G. If you don't find your IDE name there, there might be some chance that your IDE supports cmake directly (as e.g. QTCreator does).