This section discusses how to compile an application, when Feel++ is already installed on your system, through the packaging system notably.
If you want to build the examples from Feel++ tutorial:
# make a directory for the executables mkdir feelpp-tutorial cd feelpp-tutorial # build the tutorial cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_BUILD_TYPE=Release /usr/share/doc/feel++-doc/examples/ # Adapt the number of processors you want to use make -j 10
You can then launch the applications:
./feelpp_doc_myintegrals
Optionally retrieve data from the serveur (e.g. irma-atlas):
mkdir feel cd feel # To retrieve the data associated to application mymesh rsync -avz <login>@irma-atlas.u-strasbg.fr:/home/atlas_home/<login>/feel/mymesh ./
If you want to create your own application and compile it to use Feel++, you must first create a CMakeLists.txt file with the following content:
cmake_minimum_required(VERSION 2.8) find_path(FEELPP_CMAKE_MODULES FindFeel++.cmake PATHS /usr/share/feel/cmake/modules/ /usr/local/share/feel/cmake/modules/ ) if(FEELPP_CMAKE_MODULES) set(CMAKE_MODULE_PATH ${FEELPP_CMAKE_MODULES}) else() message(FATAL_ERROR "Feel++ does not seem to have been installed on this platform") endif() find_package(Feel++) feelpp_add_application(loadmesh SRCS loadmesh.cpp INCLUDE_IN_ALL)
Here is presented an application named loadmesh, built from the source file loadmesh.cpp. The file loadmesh.cpp is a sample C++ file that will allow to load a mesh:
#include <feel/feel.hpp> int main( int argc, char** argv ) { using namespace Feel; Environment env( _argc=argc, _argv=argv, _desc=feel_options(), _about=about(_name="loadmesh", _author="Christophe Prud'homme", _email="christophe.prudhomme@feelpp.org") ); auto mesh = loadMesh( _mesh = new Mesh<Simplex<2>> ); std::cout << "measure =" << std::endl << integrate( elements( mesh ), cst( 1. ) ).evaluate() << "\n"; std::cout << "surface =" << std::endl << integrate( boundaryfaces( mesh ), cst( 1. ) ).evaluate() << "\n"; }
Then configure your Feel++ application using this command and compile your application according to the resources available:
mkdir build; cd build cmake .. make -j 4
Note that .. indicates that the CMakeLists.txt is in the top directory.