hpx: HPX 1.9.0 does not compile with GCC on Windows

Expected Behavior

HPX 1.9.0 should compile with GCC 12.2.0

Actual Behavior

Steps to Reproduce the Problem

  1. Set up Boost 1.78.0 1. Download Boost 1.78.0 https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.7z 2. Unpack Boost 1.78.0 to c:/dev/cpplibs/boost_1_78_0 3. Run bootstrap.bat with gcc argument 4. Build Boost 1.78.0
.\b2.exe link=static,shared variant=release,debug architecture=x86 address-model=64 threading=multi --build-type=complete install
  1. Set up HWLOC 2.8.0 1. Download HWLOC 2.8.0 binaries https://download.open-mpi.org/release/hwloc/v2.8/hwloc-win64-build-2.8.0.zip 2. Unpack HWLOC 2.8.0 to c:/dev/cpplibs/hwloc-win64-build-2.8.0
  2. Set up HPX 1.9.0 in c:/dev/cpplibs/hpx directory
git clone https://github.com/STEllAR-GROUP/hpx.git
cd hpx
git checkout v1.9.0
cmake -S "c:/dev/cpplibs/hpx" -B "c:/dev/cpplibs/hpx_build" -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER_WORKS=ON -DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_INSTALL_PREFIX="c:/dev/cpplibs/hpx_bin" -DBOOST_ROOT="c:/Boost" -DHWLOC_ROOT="c:/dev/cpplibs/hwloc-win64-build-2.8.0" -DHPX_WITH_CXX_STANDARD=20 -DHPX_WITH_STATIC_LINKING=ON -DHPX_WITH_MALLOC=system -DHPX_WITH_FETCH_ASIO=ON -DHPX_WITH_PKGCONFIG=OFF -DHPX_DATASTRUCTURES_WITH_ADAPT_STD_TUPLE=ON -DHPX_DATASTRUCTURES_WITH_ADAPT_STD_VARIANT=ON -DHPX_WITH_DATAPAR=OFF -DHPX_WITH_DATAPAR_BACKEND=NONE -DHPX_WITH_DATAPAR_VC_NO_LIBRARY=ON
cmake --build "c:/dev/cpplibs/hpx_build" --target install --config Release -j16

The compilation of HPX 1.9.0 project fails at this last stage.

Specifications

  • HPX Version: 1.9.0
  • BOOST Version: 1.78.0
  • HWLOC Version: 2.8.0
  • Platform (compiler, OS): GCC 12.2.0, Windows 11 Pro 22H2

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 26 (14 by maintainers)

Most upvoted comments

After I fetched the latest commit, the CMake configuration stage fails with the following message:

--   Configuring libhpx modules:
CMake Error at cmake/HPX_Message.cmake:51 (message):
  ERROR: Dynamic hpx_main is not supported on Windows.
Call Stack (most recent call first):
  wrap/CMakeLists.txt:73 (hpx_error)


-- Configuring incomplete, errors occurred!

@vhandziuk would you mind trying to configure HPX with -DHPX_WITH_MODULES_AS_STATIC_LIBRARIES=Off added to the cmake command line? Let’s see if that changes anything.

@hkaiser I have tried that, unfortunately, the error looks the same (please see https://pastebin.com/PBnGd7pq)

I believe this is a different error, now it mostly complains about missing symbols from libatomic. Looks like progress, after all.

To verify, could you please also add -DCMAKE_SHARED_LINKER_FLAGS=-latomic to your cmake configuration command line?

Sure, here is the link to error output: https://pastebin.com/ZBDdxB56

@vhandziuk would you mind trying to configure HPX with -DHPX_WITH_MODULES_AS_STATIC_LIBRARIES=Off added to the cmake command line? Let’s see if that changes anything.

@hkaiser I have tried that, unfortunately, the error looks the same (please see https://pastebin.com/PBnGd7pq)

I believe this is a different error, now it mostly complains about missing symbols from libatomic. Looks like progress, after all.

@hkaiser Yes, it’s getting better! Here is the output for the next error. The output is too large to paste here. Here is the link: https://pastebin.com/GEfrdgdj

Uhh, I don’t know what’s causing these linker errors. I will have to set up a system that uses gcc on Windows. Could you give me pointers to how to install it? Is there some documentation I can follow?

Sure. I installed CMake and GCC using the chocolatey package manager

  1. Install chocolatey (https://chocolatey.org/install) It’s important to restart shell or cmd after the installation is completed
  2. Install GCC for Windows / MinGW (using PowerShell or cmd, Admin)
choco install mingw -y 
  1. Install CMake (using PowerShell or cmd, Admin)
choco install cmake -y
  1. Add MinGW and CMake paths to Windows environment Path variable (Start -> Edit the system environment variables -> Environment variables -> Path -> Edit) - add C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin - add C:\Program Files\CMake\bin - restart shell or cmd
  2. Install ninja (using PowerShell or cmd, Admin)
choco install ninja -y
  1. Set up Boost and HWLOC as described in the issue
  2. Build hpx with command line arguments as described in the issue

I don’t know if I can help with this issue as I am not an expert in platform-specific C++ build configurations and this is my first experience with the HPX project. If I can provide you with more information or logs that might be helpful to you, just let me know.

P.S.: HPX 1.9.0 builds with no issues on Ubuntu 22.04, GCC 11.3.0