Installation problem with custom gcc

Dear experts,

I try to install root6.08 on a farm cluster and the version of gcc on this farm is too old (4.1.2). I don’t have the root permission of this farm so I have to update gcc by source code. The gcc version is 6.0.2 now. However, I come across a problem same with Cmake error to install - undefined reference to__cxa_throw_bad_array_new_length’

I write a short code to test the linker problem:

// bad_array_new1.cpp
#include <new>

void * f(int i)
{
  return new int[i];
}

int main()
{
      f(-1);
}

then

g++ bad_array_new1.cpp -o bad_array_new1.o

and I get

 nm ./bad_array_new1.o | grep cxa_throw_bad_array_new_length
 U __cxa_throw_bad_array_new_length@@CXXABI_1.3.8

It seems that the compiler is normal in this simple situation.

It is difficult to say what is going wrong, but there is probably a mismatch between the system libraries and your custom built compiler, or LLVM that is built for the interpreter of ROOT. If it’s an ABI issue, you may be able to specify the ABI with something like -fabi-version=0. Does this farm have CVMFS available?

@amadio Thank you for reply. This farm doesn’t have CVMFS. I tried add -fabi-version=0 but it doesn’t work. I notice that on this farm /usr/libstdc++.so.6 is old and doesn’t have __cxa_throw_bad_array_new_length, perhaps the it was directed this file? How can I force it to my custom built compiler? I have added my version to LD_LIBRARY_PATH.

I also ldd bin/root.exe after the failed make, find that the libstdc++.so.6 is pointed to the right position.

Finally, I add the path of my libstdc++.so.6 to $build_dir/hist/hbook/CMakeFiles/Hbook.dir/link.txt
(also main/CMakeFiles/h2root.dir/link.txt, the same issue) and the problem was solved.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.