Skip to content
Gabriel Ferreira edited this page May 15, 2021 · 13 revisions

Common Issue

1. Running waf fails when built with CMake

CMake completely replaces waf, so don't use waf. You can navigate to the binaries in the build/bin directory and execute them directly. Make sure to include build/lib (for Linux/Mac .so/.dylib) and build/bin (for Windows *.dll's) in your PATH.

2. Broken headers during CMake configuration

Cotire headers won't be found by CLion and other IDEs and will cause warning messages, even though headers will be built along with the compilation targets (libraries and executables).

3. Running on WSLv1 causes int64x64 tests to fail when using set(INT64X64 "DOUBLE")

WSLv8 has a problem rounding numbers. Long double uses 80 bit floating-point in Linux while Windows uses 64 bit. https://github.com/microsoft/WSL/issues/830

4. Netanim refuses to run on WSLv1. Says it cannot open libqt5core.so

Known issue and they won't fix it either. It is due to an additional ABI tag that their parser doesn't decode (because it isn't part of the standard...)

The nuclear option is find /lib /usr/lib /usr/libexec -name 'libQt5Core.so' | xargs strip --remove-section=.note.ABI-tag

More info on: https://github.com/Microsoft/WSL/issues/3023

5. Can't use set(INT64X64 "INT128") on Windows

MSVC doesn't support 128 bit soft operations, which is weird since they support 128 bit numbers... Clang does support, but didn't expose them https://reviews.llvm.org/D41813

6. CLion refuses to redirect standard output and error output to files (> log.txt 2>&1)

CLion has not fixed this issue yet, and probably won't. You can workaround this by opening the terminal tab at the bottom of clion and running the program from there. https://youtrack.jetbrains.com/issue/CPP-3379

7. While using Microsoft or Apple tools, things end up in the wrong place even though CMAKE_LIBRARY_OUTPUT_DIRECTORY, CMAKE_RUNTIME_OUTPUT_DIRECTORY and CMAKE_HEADER_OUTPUT_DIRECTORY are properly configured

MSFT and AAPL tools are "special" and need some reassurance you really mean what you already explicitly configured for each and every possible build type.

#Is that so hard not to break people's CI, MSFT and AAPL?
#Why would you output the targets to a Debug/Release subfolder? Why?
foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
    string( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG )
    set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} )
    set( CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} )
    set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} )
endforeach()

8. Compilation crashes when NS3_LINK_TIME_OPTIMIZATION is enabled

LTO support depends on compiler, and only a few work correctly. It worked locally on Ubuntu 20.04 and MSYS2/MinGW GCC 10.3.0, but failed on the MinGW CI (theoretically has the same exact compiler).