Using HPX on Windows

HPX is a C++ Standard Library for Parallelism and Concurrency. Building and using it on Windows just got much less involved. We have now integrated HPX into the VcPkg VC++ Packaging Tool. This tool is design to help you getting C and C++ libraries built and installed on Windows without hassle. It manages all package dependencies for you, such that — once HPX has been built — no additional settings have to be supplied to your build environment.

In order to use this tool for building HPX you need to follow the instructions as outlined on the tool’s repository site. Essentially that involves the following steps:

Required prerequisites:

  • Visual Studio 2015 Update 3 or Visual Studio 2017
  • CMake 3.8.0 or higher (note: downloaded automatically if not found)
  • git.exe available in your path

Clone the vcpkg repository, then run:

C:\src\vcpkg> .\bootstrap-vcpkg.bat

Then, to hook up user-wide integration with Visual Studio, run (note: requires admin on first use):

C:\src\vcpkg> .\vcpkg integrate install

All what’s left is to build and install HPX with:

C:\src\vcpkg> .\vcpkg install hpx:x64-windows

which will download and build HPX V1.0 and all necessary prerequisites (note: you can also build hpx:x86-windows for 32-bit applications).

Finally, create a New Project (or open an existing one) in Visual Studio 2015 or Visual Studio 2017. You can now #include <hpx/hpx.hpp> and use the library’s functionality¬†as needed.

Happy coding!

Leave a Reply

Your email address will not be published. Required fields are marked *