Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fjonasALICE opened this issue Jul 9, 2021 · 0 comments

Comments

@fjonasALICE
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant