Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

cmake failures on Ubuntu 20.04 #29

Closed
gshimansky opened this issue Jul 23, 2020 · 0 comments · Fixed by #31
Closed

cmake failures on Ubuntu 20.04 #29

gshimansky opened this issue Jul 23, 2020 · 0 comments · Fixed by #31

Comments

@gshimansky
Copy link
Contributor

While executing cmake -DCMAKE_BUILD_TYPE=Release .. -DPYTHON_EXECUTABLE=/usr/bin/python3 on Ubuntu 20.04 I get the following errors:

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /usr/bin/python3 (found version "3.8.2")
-- detected CFLAGS for Python extensions: -fPIC
-- detected LDFLAGS for Python extensions: -Wl,-Bsymbolic-functions  -Wl,-z,relro -g -fwrapv -O2
-- libunwind needs lzma on this platform
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.8.so (found version "3.8.2")
-- Configuring done
CMake Error at /nfs/site/home/gashiman/work/pysamprof/common/CMakeLists.txt:33 (add_library):
  Target "pysamprof-common" links to item "-Wl,-Bsymbolic-functions
  -Wl,-z,relro -g -fwrapv -O2 " which has leading or trailing whitespace.
  This is now an error according to policy CMP0004.


CMake Error at /nfs/site/home/gashiman/work/pysamprof/common/CMakeLists.txt:33 (add_library):
  Target "pysamprof-common" links to item "-Wl,-Bsymbolic-functions
  -Wl,-z,relro -g -fwrapv -O2 " which has leading or trailing whitespace.
  This is now an error according to policy CMP0004.


CMake Error at /nfs/site/home/gashiman/work/pysamprof/common/CMakeLists.txt:33 (add_library):
  Target "pysamprof-common" links to item "-Wl,-Bsymbolic-functions
  -Wl,-z,relro -g -fwrapv -O2 " which has leading or trailing whitespace.
  This is now an error according to policy CMP0004.


CMake Error at /nfs/site/home/gashiman/work/pysamprof/common/CMakeLists.txt:33 (add_library):
  Target "pysamprof-common" links to item "-Wl,-Bsymbolic-functions
  -Wl,-z,relro -g -fwrapv -O2 " which has leading or trailing whitespace.
  This is now an error according to policy CMP0004.


CMake Error at /nfs/site/home/gashiman/work/pysamprof/common/CMakeLists.txt:33 (add_library):
  Target "pysamprof-common" links to item "-Wl,-Bsymbolic-functions
  -Wl,-z,relro -g -fwrapv -O2 " which has leading or trailing whitespace.
  This is now an error according to policy CMP0004.


CMake Error at /nfs/site/home/gashiman/work/pysamprof/common/CMakeLists.txt:33 (add_library):
  Target "pysamprof-common" links to item "-Wl,-Bsymbolic-functions
  -Wl,-z,relro -g -fwrapv -O2 " which has leading or trailing whitespace.
  This is now an error according to policy CMP0004.


-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

The problem is in Python configuration files so I ended up editing /usr/lib/python3.8/_sysconfigdata__x86_64-linux-gnu.py and removing all whitespace after -O2 where I found this flag (I am not sure exactly which lines goes into cmake config). But I don't think this is a correct way of handling this problem. Here is an answer to a similar problem https://stackoverflow.com/a/51367125/4584975 explaining how to strip whitespace from cmake config variables. I think it should be added to CMakeLists.txt.

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

Successfully merging a pull request may close this issue.

1 participant