Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Compile CGAL with clang++-3.8 and libc++

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Compile CGAL with clang++-3.8 and libc++


Chronological Thread 
  • From: Marc Glisse <>
  • To:
  • Subject: Re: [cgal-discuss] Compile CGAL with clang++-3.8 and libc++
  • Date: Tue, 31 Jan 2017 16:31:35 +0100 (CET)

On Tue, 31 Jan 2017, Oren Shpigel wrote:

Hi again,
I tried compiling everything again with the correct flags, and I still get
this error when linking my code to CGAL:

# clang++-3.8 -o build/release/my_output_file -stdlib=libc++
-lc++ my_code_stuff -lCGAL -lCGAL_Core -lprofiler -ltcmalloc -lgtest

Better put -lc++ much later in the command line, but clang already adds one anyway.

-lpthread -lboost_date_time -lboost_filesystem -lcurl -ljson -lz
-lboost_system -lprotobuf -lglog -lgflags -lblas -llapack
//usr/local/lib/libCGAL.so: undefined reference to
`std::__1::basic_istream<char, std::__1::char_traits<char>
::operator>>(std::__1::basic_istream<char, std::__1::char_traits<char> >&
(*)(std::__1::basic_istream<char, std::__1::char_traits<char> >&))'
//usr/local/lib/libCGAL.so: undefined reference to
`std::__1::basic_istream<char, std::__1::char_traits<char>
::operator>>(std::__1::basic_istream<char, std::__1::char_traits<char> >&
(*)(std::__1::basic_istream<char, std::__1::char_traits<char> >&))'

When checking my CGAL's dependencies it looks good, no libstdc++ anywhere:
# ldd -r /usr/local/lib/libCGAL.so
linux-vdso.so.1 => (0x00007fff3f2ae000)
libmpfr.so.4 => /usr/local/lib/libmpfr.so.4 (0x00007f77e491f000)
libgmp.so.10 => /usr/local/lib/libgmp.so.10 (0x00007f77e46a9000)
libboost_thread.so.1.55.0 => /usr/local/lib/libboost_thread.so.1.55.0
(0x00007f77e448f000)
libboost_system.so.1.55.0 => /usr/local/lib/libboost_system.so.1.55.0
(0x00007f77e428b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f77e406d000)
libc++.so.1 => /usr/lib/libc++.so.1 (0x00007f77e3d15000)
libc++abi.so.1 => /usr/lib/libc++abi.so.1 (0x00007f77e3aa0000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f77e379a000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f77e3584000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f77e31bf000)
/lib64/ld-linux-x86-64.so.2 (0x00007f77e4da6000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f77e2fb7000)
undefined symbol:
_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E
(/usr/local/lib/libCGAL.so)

But again, also ldd says this same undefined symbol:
# c++filt _ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E
std::__1::basic_istream<char, std::__1::char_traits<char>
::operator>>(std::__1::basic_istream<char, std::__1::char_traits<char> >&
(*)(std::__1::basic_istream<char, std::__1::char_traits<char> >&))

nm -D /usr/lib/x86_64-linux-gnu/libc++.so.1|grep
_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E
000000000009f784 W
_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E

This symbol is provided by libc++ here...

Anyone has any idea about why it's missing? Or what is using it?
Has anyone ever compiled CGAL 4.8 with clang 3.8 and libc++?

Just tried CGAL-4.9 with CXX='clang++-3.8 -stdlib=libc++' and it is working fine. I expect the issue is with your installation of clang or libc++, not with CGAL.

--
Marc Glisse



Archive powered by MHonArc 2.6.18.

Top of Page