Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Failed to compile with GCC 11 #20347

Closed
Neutron3529 opened this issue Jun 13, 2021 · 5 comments
Closed

Failed to compile with GCC 11 #20347

Neutron3529 opened this issue Jun 13, 2021 · 5 comments

Comments

@Neutron3529
Copy link
Contributor

Description

It might be a bug with oneDNN, but which affect mxnet in a surprising way:
since std::thread::id does no have a != operator in GCC 11, oneDNN failed to compile, when try to solving such problem by switch the gcc version to 10, another error occurs:

FAILED: im2rec
: && /opt/cuda/bin/g++ -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -Wall -Wno-unknown-pragmas -Wno-sign-compare -O3 -std=c++11 -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now CMakeFiles/im2rec.dir/tools/im2rec.cc.o -o im2rec -L/opt/cuda/lib64   -L/opt/cuda/targets/x86_64-linux/lib/stubs   -L/opt/cuda/targets/x86_64-linux/lib -Wl,-rpath,/opt/cuda/lib64/stubs:/opt/cuda/lib64:/home/gnaggnoyil-wsl/.cache/yay/mxnet/src/mxnet-cuda/build/3rdparty/openmp/runtime/src  -Wl,--whole-archive  libmxnet.a  -Wl,--no-whole-archive  -lcblas  -fopenmp  /usr/lib/librt.so  3rdparty/openmp/runtime/src/libomp.so  -lpthread  -llapack
  /usr/lib/libcudnn.so  -lcuda  /lib/libnccl.so  /usr/lib/libopencv_highgui.so.4.5.2  3rdparty/dmlc-core/libdmlc.a  /usr/lib/libopencv_videoio.so.4.5.2  /usr/lib/libopencv_imgcodecs.so.4.5.2  /usr/lib/libopencv_imgproc.so.4.5.2  /usr/lib/libopencv_core.so.4.5.2  -lpthread  /opt/cuda/lib64/libcudart.so  /opt/cuda/lib64/stubs/libcufft.so  /opt/cuda/lib64/stubs/libcublas.so  /opt/cuda/lib64/stubs/libcusolver.so  /opt/cuda/lib64/stubs/libcusparse.so  /opt/cuda/lib64/stubs/libcurand.so  /opt/cuda/lib64/stubs/libnvrtc.so  /opt/cuda/lib64/stubs/libcuda.so  /opt/cuda/lib64/libnvToolsExt.so  -ldl  -lrt  -lcudadevrt  -lcudart_static  -lrt  -lpthread  -ldl && :
/usr/sbin/ld: /usr/lib/libopencv_core.so.4.5.2: undefined reference to `std::__exception_ptr::exception_ptr::_M_release()@CXXABI_1.3.13'
/usr/sbin/ld: /usr/lib/libopencv_imgcodecs.so.4.5.2: undefined reference to `std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
/usr/sbin/ld: /usr/lib/libopencv_core.so.4.5.2: undefined reference to `std::__exception_ptr::exception_ptr::_M_addref()@CXXABI_1.3.13'

I have submitted a PR about the miscompile of oneDNN, this issue is only intend to tell mxnet team to update the oneDNN's version.

@hubutui
Copy link

hubutui commented Jun 14, 2021

this opencv error might related to the gcc version you used to compile opencv and mxnet.
ArchLinux uses the latest gcc by default, so the pkg opencv is compiled with gcc 11, but you compile mxnet with gcc 10. Maybe compiling opencv and mxnet with the same gcc version might fix it. Or you could disable USE_OPENCV.

@anko-intel
Copy link
Contributor

@mxnet-label-bot MKLDNN

@mozga-intel
Copy link
Contributor

@mxnet-label-bot add [MKLDNN]

1 similar comment
@anko-intel
Copy link
Contributor

@mxnet-label-bot add [MKLDNN]

@Neutron3529
Copy link
Contributor Author

This problem was fixed by upgrade oneDNN to v2.2.3 (PR #20345)
Thus, no more things to do.

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

No branches or pull requests

4 participants