Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Can't compile in ubunu 18.10, gcc 8.2, cmake 3.12.1 #150

Open
emdio opened this issue Mar 2, 2019 · 1 comment
Open

Can't compile in ubunu 18.10, gcc 8.2, cmake 3.12.1 #150

emdio opened this issue Mar 2, 2019 · 1 comment

Comments

@emdio
Copy link

emdio commented Mar 2, 2019

After following the instructions and launching the make command from the project root I get this error messages:

$ make
CMake Warning (dev) at CMakeLists.txt:17 (find_package):
Policy CMP0074 is not set: find_package uses _ROOT variables.
Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

CMake variable TBB_ROOT is set to:

~soft/git/ELF/third_party/tbb/

For compatibility, CMake is ignoring the variable.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning at CMakeLists.txt:61 (add_executable):
Cannot generate a safe runtime search path for target
test_cpp_elfgames_go_sgf_sgf_test because files in some directories may
conflict with libraries in implicit directories:

runtime library [libzmq.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
~anaconda3/lib

Some of these libraries may not be found correctly.
Call Stack (most recent call first):
src_cpp/elfgames/go/CMakeLists.txt:86 (add_cpp_tests)

CMake Warning at CMakeLists.txt:61 (add_executable):
Cannot generate a safe runtime search path for target
test_cpp_elfgames_go_base_test_symmetry_test because files in some
directories may conflict with libraries in implicit directories:

runtime library [libzmq.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
~anaconda3/lib

Some of these libraries may not be found correctly.
Call Stack (most recent call first):
src_cpp/elfgames/go/CMakeLists.txt:86 (add_cpp_tests)

CMake Warning at CMakeLists.txt:61 (add_executable):
Cannot generate a safe runtime search path for target
test_cpp_elfgames_go_base_test_go_test because files in some directories
may conflict with libraries in implicit directories:

runtime library [libzmq.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
~anaconda3/lib

Some of these libraries may not be found correctly.
Call Stack (most recent call first):
src_cpp/elfgames/go/CMakeLists.txt:86 (add_cpp_tests)

CMake Warning at third_party/pybind11/tools/pybind11Tools.cmake:131 (add_library):
Cannot generate a safe runtime search path for target _elfgames_go because
files in some directories may conflict with libraries in implicit
directories:

runtime library [libzmq.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
~anaconda3/lib

Some of these libraries may not be found correctly.
Call Stack (most recent call first):
src_cpp/elfgames/go/CMakeLists.txt:61 (pybind11_add_module)

CMake Warning at CMakeLists.txt:61 (add_executable):
Cannot generate a safe runtime search path for target
test_cpp_elfgames_go_base_test_board_feature_test because files in some
directories may conflict with libraries in implicit directories:

runtime library [libzmq.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
~anaconda3/lib

Some of these libraries may not be found correctly.
Call Stack (most recent call first):
src_cpp/elfgames/go/CMakeLists.txt:86 (add_cpp_tests)

CMake Warning at CMakeLists.txt:61 (add_executable):
Cannot generate a safe runtime search path for target
test_cpp_elfgames_go_base_test_coord_test because files in some directories
may conflict with libraries in implicit directories:

runtime library [libzmq.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
~anaconda3/lib

Some of these libraries may not be found correctly.
Call Stack (most recent call first):
src_cpp/elfgames/go/CMakeLists.txt:86 (add_cpp_tests)

In file included from ~soft/git/ELF/third_party/pybind11/include/pybind11/stl.h:12,
from ~soft/git/ELF/src_cpp/elf/options/Pybind.cc:9:
~soft/git/ELF/third_party/pybind11/include/pybind11/pybind11.h: In member function ‘void pybind11::cpp_function::initialize_generic(pybind11::detail::function_record*, const char*, const std::type_info* const*, pybind11::size_t)’:
~soft/git/ELF/third_party/pybind11/include/pybind11/pybind11.h:309:74: error: cast between incompatible function types from ‘PyObject* ()(PyObject, PyObject*, PyObject*)’ {aka ‘_object* ()(_object, _object*, _object*)’} to ‘PyCFunction’ {aka ‘_object* ()(_object, _object*)’} [-Werror=cast-function-type]
rec->def->ml_meth = reinterpret_cast(dispatcher);
^
In file included from ~soft/git/ELF/third_party/pybind11/include/pybind11/stl.h:12,
from ~soft/git/ELF/src_cpp/elf/logging/Levels.cc:9:
~soft/git/ELF/third_party/pybind11/include/pybind11/pybind11.h: In member function ‘void pybind11::cpp_function::initialize_generic(pybind11::detail::function_record
, const char*, const std::type_info* const*, pybind11::size_t)’:
~soft/git/ELF/third_party/pybind11/include/pybind11/pybind11.h:309:74: error: cast between incompatible function types from ‘PyObject* ()(PyObject, PyObject*, PyObject*)’ {aka ‘_object* ()(_object, _object*, _object*)’} to ‘PyCFunction’ {aka ‘_object* ()(_object, _object*)’} [-Werror=cast-function-type]
rec->def->ml_meth = reinterpret_cast(dispatcher);
^
In file included from ~soft/git/ELF/third_party/pybind11/include/pybind11/functional.h:12,
from ~soft/git/ELF/src_cpp/elf/logging/IndexedLoggerFactory.cc:9:
~soft/git/ELF/third_party/pybind11/include/pybind11/pybind11.h: In member function ‘void pybind11::cpp_function::initialize_generic(pybind11::detail::function_record
, const char*, const std::type_info* const*, pybind11::size_t)’:
~soft/git/ELF/third_party/pybind11/include/pybind11/pybind11.h:309:74: error: cast between incompatible function types from ‘PyObject* ()(PyObject, PyObject*, PyObject*)’ {aka ‘_object* ()(_object, _object*, _object*)’} to ‘PyCFunction’ {aka ‘_object* ()(_object, _object*)’} [-Werror=cast-function-type]
rec->def->ml_meth = reinterpret_cast(dispatcher);
^
In file included from ~soft/git/ELF/src_cpp/elf/Pybind.cc:9:
~soft/git/ELF/third_party/pybind11/include/pybind11/pybind11.h: In member function ‘void pybind11::cpp_function::initialize_generic(pybind11::detail::function_record
, const char*, const std::type_info* const*, pybind11::size_t)’:
~soft/git/ELF/third_party/pybind11/include/pybind11/pybind11.h:309:74: error: cast between incompatible function types from ‘PyObject* ()(PyObject, PyObject*, PyObject*)’ {aka ‘_object* ()(_object, _object*, _object*)’} to ‘PyCFunction’ {aka ‘_object* ()(_object, _object*)’} [-Werror=cast-function-type]
rec->def->ml_meth = reinterpret_cast(dispatcher);
^
In file included from ~soft/git/ELF/third_party/pybind11/include/pybind11/stl.h:12,
from ~soft/git/ELF/src_cpp/elf/logging/Pybind.cc:9:
~soft/git/ELF/third_party/pybind11/include/pybind11/pybind11.h: In member function ‘void pybind11::cpp_function::initialize_generic(pybind11::detail::function_record
, const char*, const std::type_info* const*, pybind11::size_t)’:
~soft/git/ELF/third_party/pybind11/include/pybind11/pybind11.h:309:74: error: cast between incompatible function types from ‘PyObject* ()(PyObject, PyObject*, PyObject*)’ {aka ‘_object* ()(_object, _object*, _object*)’} to ‘PyCFunction’ {aka ‘_object* ()(_object, _object*)’} [-Werror=cast-function-type]
rec->def->ml_meth = reinterpret_cast(dispatcher);
^
In file included from ~soft/git/ELF/third_party/pybind11/include/pybind11/stl.h:12,
from ~soft/git/ELF/src_cpp/elf/options/OptionSpec.cc:9:
~soft/git/ELF/third_party/pybind11/include/pybind11/pybind11.h: In member function ‘void pybind11::cpp_function::initialize_generic(pybind11::detail::function_record
, const char*, const std::type_info* const*, pybind11::size_t)’:
~soft/git/ELF/third_party/pybind11/include/pybind11/pybind11.h:309:74: error: cast between incompatible function types from ‘PyObject* ()(PyObject, PyObject*, PyObject*)’ {aka ‘_object* ()(_object, _object*, _object*)’} to ‘PyCFunction’ {aka ‘_object* ()(_object, _object*)’} [-Werror=cast-function-type]
rec->def->ml_meth = reinterpret_cast(dispatcher);
^
In file included from ~soft/git/ELF/third_party/pybind11/include/pybind11/stl.h:12,
from ~soft/git/ELF/src_cpp/elf/options/OptionMap.cc:9:
~soft/git/ELF/third_party/pybind11/include/pybind11/pybind11.h: In member function ‘void pybind11::cpp_function::initialize_generic(pybind11::detail::function_record
, const char*, const std::type_info* const*, pybind11::size_t)’:
~soft/git/ELF/third_party/pybind11/include/pybind11/pybind11.h:309:74: error: cast between incompatible function types from ‘PyObject* ()(PyObject, PyObject*, PyObject*)’ {aka ‘_object* ()(_object, _object*, _object*)’} to ‘PyCFunction’ {aka ‘_object* ()(_object, _object*)’} [-Werror=cast-function-type]
rec->def->ml_meth = reinterpret_cast(*dispatcher);
^
cc1plus: all warnings being treated as errors
make[3]: *** [elf/CMakeFiles/elf.dir/build.make:154: elf/CMakeFiles/elf.dir/options/Pybind.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
cc1plus: all warnings being treated as errors
make[3]: *** [elf/CMakeFiles/elf.dir/build.make:128: elf/CMakeFiles/elf.dir/options/OptionMap.cc.o] Error 1
cc1plus: all warnings being treated as errors
make[3]: *** [elf/CMakeFiles/elf.dir/build.make:102: elf/CMakeFiles/elf.dir/logging/Levels.cc.o] Error 1
cc1plus: all warnings being treated as errors
make[3]: *** [elf/CMakeFiles/elf.dir/build.make:89: elf/CMakeFiles/elf.dir/logging/IndexedLoggerFactory.cc.o] Error 1
cc1plus: all warnings being treated as errors
make[3]: *** [elf/CMakeFiles/elf.dir/build.make:115: elf/CMakeFiles/elf.dir/logging/Pybind.cc.o] Error 1
cc1plus: all warnings being treated as errors
make[3]: *** [elf/CMakeFiles/elf.dir/build.make:141: elf/CMakeFiles/elf.dir/options/OptionSpec.cc.o] Error 1
cc1plus: all warnings being treated as errors
make[3]: *** [elf/CMakeFiles/elf.dir/build.make:63: elf/CMakeFiles/elf.dir/Pybind.cc.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:3052: elf/CMakeFiles/elf.dir/all] Error 2
make[1]: *** [Makefile:130: all] Error 2
make: *** [Makefile:20: elf] Error 2

@mkreisel
Copy link

mkreisel commented Apr 24, 2020

I was able to compile with GCC 8 and 9 after adding -Wno-cast-function-type -Wno-deprecated-copy to the C and CXX flags in CMakeLists.txt:

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-cast-function-type -Wno-deprecated-copy")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wno-cast-function-type -Wno-deprecated-copy -Wextra -Wno-register -Wno-deprecated-declarations -fPIC -march=native")

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

No branches or pull requests

2 participants