read

In this blog post, we will provide more details on how to build your own HPX application using CMake. In the previous blog post we showcased how on compile and install HPX.

Building a HPX application

We assume that we have a CMakeLists.txt and the main.cpp in the same folder. Below the main CMakeLists.txt is listed

project(MyHPXApp LANGUAGES CXX)
cmake_minimum_required(VERSION 3.18)

# Find the HPX package
find_package(HPX REQUIRED)

# Compile a HPX application
add_hpx_executable(app SOURCES main.cpp)

Compiling a HPX application

To compile the HPX applicaiton, we generate a new folder build, and change the director, and call cmake. Note that $HPX_INSTALL_DIR is the path where you installed HPX.

$ mkdir build
$ cd build
$ cmake -DHPX_DIR=$HPX_INSTALL_DIR/hpx/lib64/cmake/HPX ..
$ make 
Blog Logo

The authors


Published