halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.88k stars 1.07k forks source link

Build Error : undefined reference to symbol 'dlopen@@GLIBC_2.2.5' #1605

Closed DrizztLei closed 4 years ago

DrizztLei commented 7 years ago

When I build the project on my Gentoo-Linux 4.8.2 with cmake , there was a build error when I wanna build the target lesson_l2_using_the_gpu.cpp.o :

" undefined reference to symbol 'dlopen@@GLIBC_2.2.5' " and then I have to track the build error,finally I found the link txt of cmake_build/tutorial/CMakeFiles/lesson_12_using_the_gpu.dir/link.txt here : /usr/bin/c++ CMakeFiles/lesson_12_using_the_gpu.dir/lesson_12_using_the_gpu.cpp.o -o ../bin/lesson_12_using_the_gpu -rdynamic ../lib/libHalide.so -lpng -lz -Wl,-rpath,/home/elvis/environment/Halide/github/Halide/cmake_build/lib

and now I change the build option , add the -ldl like that :

/usr/bin/c++ CMakeFiles/lesson_12_using_the_gpu.dir/lesson_12_using_the_gpu.cpp.o -o ../bin/lesson_12_using_the_gpu -rdynamic ../lib/libHalide.so -lpng -lz -ldl -Wl,-rpath,/home/elvis/environment/Halide/github/Halide/cmake_build/lib

which finally build completely. I don't know whether It was caused by my environment , because I consider my environment was customized by myself using the Gentoo's build script. And there is some of my build environment :

sys-devel/llvm Installed versions: 3.9.0-r1(0/3.9.0)(09:01:36 AM 11/06/2016)(clang libffi ncurses python sanitize static-analyzer -debug -default-compiler-rt -default-libcxx -doc -gold -libedit -lldb -multitarget -ocaml -test -xml ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="32 64 -x32" ELIBC="-musl" KERNEL="-Darwin -FreeBSD" LLVM_TARGETS="AArch64 ARM Hexagon Mips NVPTX PowerPC X86 -AMDGPU -BPF -MSP430 -Sparc -SystemZ -XCore" PYTHON_TARGETS="python2_7")

sys-devel/gcc Installed versions: 4.8.5(4.8.5)^s(07:31:30 PM 09/22/2016)(cxx fortran multilib nls nptl openmp sanitize -altivec -awt -debug -doc -fixed-point -gcj -go -graphite -hardened -libssp -mudflap -nopie -nossp -objc -objc++ -objc-gc -regression-test -vanilla)

sys-devel/clang Installed versions: 3.9.0-r100(0/3.9.0)(02:20:11 AM 11/06/2016)(python static-analyzer -debug -multitarget ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="32 64 -x32" LLVM_TARGETS="AArch64 ARM Hexagon Mips NVPTX PowerPC X86 -AMDGPU -BPF -MSP430 -Sparc -SystemZ -XCore"

I ever think that the error was caused by the version of my GCC version when I use the GCC-5.4.0 , and then I compile the world with GCC-4.8.5 , which wasted my lots of time , and now I have to compile the world with GCC-5.4.0 again . T_T .

alexreinking commented 4 years ago

Closing because the issue has gone stale and we no longer support LLVM3. Please open a new issue if you still can't build Halide.