Skip to content

-pedantic -Werror in cmakelist causes error when compiling on ubuntu18.04 #102

@fjonasALICE

Description

@fjonasALICE

I am building on Ubuntu 18.04.4 LTS with gcc Version 10.3.0. The following warning

2021-07-09@12:00:17:DEBUG:O2-full-system-test:DataDistribution:0: /software/flo/alice/sw/SOURCES/DataDistribution/heads-v1.0.0/0/src/common/base/DataDistLogger.h:377:11: warning: ignoring return value of 'int nice(int)' declared with attribute 'warn_unused_result' [-Wunused-result]
2021-07-09@12:00:17:DEBUG:O2-full-system-test:DataDistribution:0:   377 |       nice(+10);
2021-07-09@12:00:17:DEBUG:O2-full-system-test:DataDistribution:0:       |       ~~~~^~~~~

causes a crash on my system and I can only build succesfully when removing

if(NOT APPLE)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Werror")
endif()

from the cmakelist. Since I do not fully understand what was the original purpose using these specific compiler flags for none apple systems, I just open this issue and leave it up to the maintainers.

In addition the build failed on my system due to:

Undefined reference to 'dlsym'

which I could fix by adding

-Wl,--no-as-needed -ldl

to the cxx flags. However this might be an unrelated issue with my system, just wanted to leave this info here for future reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions