Problem with availability and specification of compilers

Issues related to applications and software problems
Post Reply
peregilcillo
Posts: 1
Joined: 2020/03/02 04:38:02
Location: Beijing, China

Problem with availability and specification of compilers

Post by peregilcillo » 2020/03/02 06:21:28

Hi all,

My name is Felipe. I am new to this forum :)

I am installing software on a cluster with CentOS Linux release 7.7.1908.

My software installation fails with ‘unknown language compiler’. Specifically:

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
No CMAKE_C_COMPILER could be found.

Tell CMake where to find the compiler by setting either the environment variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

..and then the same for CXX
##########################################################

But, in any terminal command line, I can check this:

[Felipe@mu01]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
####################################################
and similarly for g++ -v

I also have cmake
[Felipe@mu01]$ cmake -version
cmake version 3.16.0-rc3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
######################################################
And I also have mpich, which seems to handle mpicc, mpicxx, mpif90, mpif77.
For example:
mpicc -v
mpicc for MPICH version 3.1.4
##########################################################

I tried editing my ~/.bash_profile , but it did not help. Maybe I did not do it right.

I am rather lost on this. :(

1) Do my gcc, cmake and mpich suffice for all these purposes?
2) Where and how should I set those environment variables to be properly accepted by my software installer? /.bashrc ? .bash_profile? /etc/profile?

I appreciate your help,
Felipe

User avatar
TrevorH
Forum Moderator
Posts: 29171
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Problem with availability and specification of compilers

Post by TrevorH » 2020/03/02 09:57:56

Perhaps the problem is in cmake. You're using a version that we do not ship. The standard one from the CentOS repos is 2.8.12.2-2.el7 but EPEL has a set of cmake3 packages which are 3.14.6-2.el7 - try uninstalling your 3.16 version and replacing it with the EPEL cmake3 package. Otherwise you need to read the logs that are generated and work out what it's running to try to ascertain the compiler version and then work out why it's not succeeding.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

sml
Posts: 114
Joined: 2020/01/17 09:01:44

Re: Problem with availability and specification of compilers

Post by sml » 2020/03/02 19:30:23

Changing into your build directory and running

Code: Select all

cmake --system-information | grep ^CMAKE_C_COMPILER | uniq
from there may give you some clues.

Also, locate the file CMakeOutput.log and/or CMakeError.log and inspect their contents. By convention, those files are usually created in the CMakeFiles directory.

Post Reply

Return to “CentOS 7 - Software Support”