A similar problem has been reported here with no solution:https://www.centos.org/modules/newbb/print.php?form=1&topic_id=42696&forum=56&order=ASC&start=0

I've added and upgraded gcc to centos

cd /etc/yum.repos.d
wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo 
yum --enablerepo=testing-1.1-devtools-6 install devtoolset-1.1-gcc devtoolset-1.1-gcc-c++
scl enable devtoolset-1.1 bash

The result is this for my gcc

[root@hhvm-build-centos cmake-]# gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/opt/centos/devtoolset-1.1/root/usr --mandir=/opt/centos/devtoolset-1.1/root/usr/share/man --infodir=/opt/centos/devtoolset-1.1/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --disable-build-with-cxx --disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,fortran,lto --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-ppl --with-cloog --with-mpc=/home/centos/rpm/BUILD/gcc-4.7.2-20121015/obj-x86_64-redhat-linux/mpc-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.7.2 20121015 (Red Hat 4.7.2-5) (GCC) 

And I tried to then install cmake through http://www.cmake.org/cmake/resources/software.html#latest

But I keep running into this error:

Linking CXX executable ../bin/ccmake
/opt/centos/devtoolset-1.1/root/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/ld: CMakeFiles/ccmake.dir/CursesDialog/cmCursesMainForm.cxx.o: undefined reference to symbol 'keypad'
/opt/centos/devtoolset-1.1/root/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/ld: note: 'keypad' is defined in DSO /lib64/libtinfo.so.5 so try adding it to the linker command line
/lib64/libtinfo.so.5: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
gmake[2]: *** [bin/ccmake] Error 1
gmake[1]: *** [Source/CMakeFiles/ccmake.dir/all] Error 2
gmake: *** [all] Error 2

The problem seems to come from the new gcc installed because it works with the default install. Is there a solution to this problem?


I think the problem is with the more recent versions of binutils. I tried to compile OpenFOAM with gcc-4.7.2 using binutils 2.23.2 and got the same error with cmake. I tried versions 2.8.3, 2.8.4 and the most recent - all without success (same keypad error). However I later succeeded in compiling cmake-2.8.3 (using gcc 4.7.3 but I think 4.7.2 will work as well) but using binutils 2.23 (not my idea I would add). You can follow the discussion in posts 18-21 http://www.cfd-online.com/Forums/openfoam-installation/121996-error-installing-openfoam-2-2-0-centos-6-4-a.html


in folder OpenFOAM/ThirdParty-2.3.1/cmake- in file CMakeLists.txt add the following line

target_link_libraries(ccmake tinfo)

(just below other target_link_libraries commands)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy