MiguelMonteiro / permutohedral_lattice

Permutohedral Lattice C++/CUDA implementation + TensorFlow Op (CPU/GPU)
83 stars 18 forks source link

Error after compilation #17

Closed jgsimard closed 5 years ago

jgsimard commented 5 years ago

Hi, I have an issue that make me unable to use the code. the error comes up during the build. If if compile with CXX_COMPILER=/usr/bin/g++-4.8, I get this error message

-- The CXX compiler identification is GNU 4.8.5
-- The CUDA compiler identification is NVIDIA 10.0.130
-- Check for working CXX compiler: /usr/bin/g++-4.8
-- Check for working CXX compiler: /usr/bin/g++-4.8 -- broken
CMake Error at /usr/local/share/cmake-3.13/Modules/CMakeTestCXXCompiler.cmake:45 (message):
 The C++ compiler

    "/usr/bin/g++-4.8"

  is not able to compile a simple test program.

  It fails with the following output:

Change Dir: /home/path/CRFasRNNLayer/permutohedral_lattice/build_dir/CMakeFiles/CMakeTmp
    Run Build Command:"/usr/bin/make" "cmTC_756dd/fast"
    /usr/bin/make -f CMakeFiles/cmTC_756dd.dir/build.make CMakeFiles/cmTC_756dd.dir/build
    make[1]: Entering directory '/home/path/CRFasRNNLayer/permutohedral_lattice/build_dir/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_756dd.dir/testCXXCompiler.cxx.o
    /usr/bin/g++-4.8    -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe    -o CMakeFiles/cmTC_756dd.dir/testCXXCompiler.cxx.o -c /home/path/CRFasRNNLayer/permutohedral_lattice/build_dir/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    g++-4.8: error: unrecognized command line option ‘-std=c++17’
    g++-4.8: error: unrecognized command line option ‘-fstack-protector-strong’
    g++-4.8: error: unrecognized command line option ‘-fno-plt’
    CMakeFiles/cmTC_756dd.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_756dd.dir/testCXXCompiler.cxx.o' failed
    make[1]: *** [CMakeFiles/cmTC_756dd.dir/testCXXCompiler.cxx.o] Error 1
    make[1]: Leaving directory '/home/path/CRFasRNNLayer/permutohedral_lattice/build_dir/CMakeFiles/CMakeTmp'
    Makefile:121: recipe for target 'cmTC_756dd/fast' failed
    make: *** [cmTC_756dd/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)

-- Configuring incomplete, errors occurred!

But if I use g++-7, I can compile but I get this error message when I run the test.

Traceback (most recent call last):
  File "Tests/greyscale_test.py", line 8, in <module>
    import lattice_filter_op_loader
  File "/home/path/CRFasRNNLayer/permutohedral_lattice/lattice_filter_op_loader.py", line 29, in <module>
    module = tf.load_op_library(path.join(path.dirname(path.abspath(__file__)), 'lattice_filter.so'))
  File "/home/me/anaconda3/envs/test/lib/python3.7/site-packages/tensorflow/python/framework/load_library.py", line 61, in load_op_library
    lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.NotFoundError: /home/path/CRFasRNNLayer/permutohedral_lattice/lattice_filter.so: undefined symbol: _ZN10tensorflow12OpDefBuilder4AttrESs

I am on Ubuntu 18, python 3.7. Thanks in advance!

MiguelMonteiro commented 5 years ago

There seems to an issue with your g++ compiler. This is unrelated to this repo. I would try reinstalling the compiler or installing a newer version.

Best,

Miguel

Lvhhhh commented 3 years ago

There seems to an issue with your g++ compiler. This is unrelated to this repo. I would try reinstalling the compiler or installing a newer version.

Best,

Miguel

my gcc is g++-5 have the same problem. should i change g++-4.8?

Lvhhhh commented 3 years ago

change g++-5 to g++-4.8 ,have the same problem