borglab/gtsam

Cannot build target gtsam on Windows 10 and CLion with bundled MinGW64 and CMake

Opened this issue · 0 comments

Description

When build gtsam target with CLion and bundled MinGW64 on Windows 10 it failed.

Steps to reproduce

  • Install Boost and compil it with MinGW 64 (you can do it with the bundled MinGW in CLion or install it with scoop)
  • Open CLion on gtsam root, and verify your toolchain is the bundled MinGW
  • (optional) In CMake configuration, Deactivate TBB
  • In HandleBoost.cmake Line 21 add
if(MSVC)
...
elseif(MINGW)
    message("found MINGW")

    set(Boost_ARCHITECTURE -x64)

    set(BOOST_ROOT "C:/Program Files/boost/boost_1_82_0")
endif()
  • In GtsamTesting.cmake Line 182 add
    if(NOT MSVC AND NOT MINGW AND NOT XCODE_VERSION)
  • Tools > CMake > Reset Cache and Reload Project

A little CMake error

Problems were encountered while collecting compiler information:
	cc1.exe: fatal error: /w: No such file or directory
  • Select the gtsam target and start building it
  • You normaly obtain errors like bellow
    image

Another thing
sys/system.h not exist on Windows 10
image

Expected behavior

Compilation success

Environment

Windows 10 and CLion with bundled MinGW64 and CMake