Difference between revisions of "How to build"

From Medusa: Coordinate Free Mehless Method implementation
Jump to: navigation, search
m (Intel)
(Intel)
Line 61: Line 61:
  
 
In order to use Intel's compiler you have to first set the <syntaxhighlight lang="bash" inline>CXX</syntaxhighlight>
 
In order to use Intel's compiler you have to first set the <syntaxhighlight lang="bash" inline>CXX</syntaxhighlight>
and <syntaxhighlight lang="bash" inline>CC</syntaxhighlight> bash variables.  
+
and <syntaxhighlight lang="bash" inline>CC</syntaxhighlight> bash variables. Before calling
 +
<syntaxhighlight lang="bash" inline> cmake </syntaxhighlight> for the first time you have to export the following:
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
export CXX="icpc"
 
export CXX="icpc"
 
export CC="icc"
 
export CC="icc"
mkdir -p build
 
cd build
 
cmake ..
 
make
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
To compile code for Intel Phi architecture you have to enable -mmic compile flag, which you can do with
+
You can also compile it directly for Intel® Xeon Phi™ Coprocessor. You do this by adding <syntaxhighlight lang="bash" inline>-Dmmic=ON</syntaxhighlight>
 +
flag to the <syntaxhighlight lang="bash" inline>cmake</syntaxhighlight> command:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
cmake .. -Dmmic=ON
 
cmake .. -Dmmic=ON
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
<b>Note:</b> All features that depend on system third-party libraries are not available on MIC (Many Integrated Core).
 +
This includes:
 +
 +
* [http://www-e6.ijs.si/ParallelAndDistributedSystems/MeshlessMachine/technical_docs/html/classmm_1_1HDF5IO.html HDF5IO] class in <syntaxhighlight lang="bash" inline>io.hpp</syntaxhighlight>
 +
* [http://www-e6.ijs.si/ParallelAndDistributedSystems/MeshlessMachine/technical_docs/html/classmm_1_1Monitor.html Monitor] class in <syntaxhighlight lang="bash" inline>util.hpp</syntaxhighlight>
 +
* all of [http://www-e6.ijs.si/ParallelAndDistributedSystems/MeshlessMachine/technical_docs/html/util_8hpp_source.html  <syntaxhighlight lang="bash" inline>draw.hpp</syntaxhighlight>]

Revision as of 13:27, 28 December 2016

Installation

To make this work from plain Ubuntu installation, run

sudo apt-get install cmake doxygen graphviz libboost-dev libsfml-dev libhdf5-serial-dev
git clone https://gitlab.com/e62Lab/e62numcodes.git
cd e62numcodes
./run_tests.sh

which installs dependancies, clones the repository, goes into the root folder of the repository and runs tests. This will check the configuration, notify you of potentially missing dependencies, build and run all tests, check code style and docs. If this works, you are ready to go! Otherwise install any missing packages and if it still fails, raise an issue!

Building

List of dependencies:

Out of source builds are preferred. Run

mkdir -p build
cd build
cmake ..
make

Note that you only have to run cmake once, after that only make is sufficient.

Binaries are placed into bin folder. Test can be run all at once via make run_all_tests or individually via eg. make basisfunc_run_tests.

Linear Algebra

We use Eigen as our matrix library. See here for use reference and documentation. For a quick transition from Matlab see here.

Drawing

Some tests include drawing. We are using SMFL library, which can be installed on most linux systems easly as sudo apt-get install libsfml-dev or sudo pacman -S sfml. After the installation uncomment a test case in domain_draw_test.cpp and run make test_domain_draw to see the visual effect.

Binaries using SFML require additional linker flags -lsfml-graphics -lsfml-window -lsfml-system, but the makefile should take care of that for you.

HDF5

In order to use IO you need hdf5 library. You can install it easily using the command sudo apt-get install libhdf5- dev or sudo pacman -S hdf5-cpp-fortran.

Ubuntu places hdf5 libs in a werid folder /usr/lib/x86_64-linux-gnu/hdf5/serial/. If you get error similar to -lhdf5 not found and you have hdf5 installed, you might have to link the libraries into a discoverable place, like /usr/lib/ or add the above directory to the linker path. If using cmake, you can add the following line to your CMakeLists.txt

 link_directories(/usr/lib/x86_64-linux-gnu/hdf5/serial/)

Intel

In order to use Intel's compiler you have to first set the CXX and CC bash variables. Before calling cmake for the first time you have to export the following:

export CXX="icpc"
export CC="icc"

You can also compile it directly for Intel® Xeon Phi™ Coprocessor. You do this by adding -Dmmic=ON flag to the cmake command:

cmake .. -Dmmic=ON

Note: All features that depend on system third-party libraries are not available on MIC (Many Integrated Core). This includes: