This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

The C compiler identification is unknown

+2 votes

Hello guys,

I'm trying to install an old version of FEniCS in ubuntu 12.04. I'm using this old version because I have already develop a source code with the aid of it and newer versions of FEniCS are not compatible with my code. The problem that I face is during the installation of dolfin. More specifically the system does not recognise the C compiler and I receive the following error:

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: CMAKE_C_COMPILER-NOTFOUND
Build flags:
Id flags:

The output was:
No such file or directory

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: CMAKE_C_COMPILER-NOTFOUND
Build flags:
Id flags: -c

The output was:
No such file or directory

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: CMAKE_C_COMPILER-NOTFOUND
Build flags:
Id flags: -Aa

The output was:
No such file or directory

Does anyone has any idea how to overcome this problem.

Thank you!!

asked Mar 30, 2017 by paschal91 FEniCS Novice (240 points)

Can you give more information about your compiler? Is it GCC? Which version?

I'm having exactly the same problem here too.

In order to determine the version I tried the following commands:

>>g++ -v
built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.4-1ubuntu1~12.04' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.4 (Ubuntu/Linaro 4.6.4-1ubuntu1~12.04) 



>>gcc version 4.6.4
The program 'gcc' can be found in the following packages:
 * gcc
 * pentium-builder

Does that help you?

Moreover, when the FEniCS installes builds dolfin I also get the error:

Building dolfin
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:9 (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.


-- Configuring incomplete, errors occurred!
See also "/home/j-work/WorkDrsl_c/FEniCS/src/dolfin/dorsal_build_dir/CMakeFiles/CMakeOutput.log".
See also "/home/j-work/WorkDrsl_c/FEniCS/src/dolfin/dorsal_build_dir/CMakeFiles/CMakeError.log".
Failure with exit status: 1
Exit message: There was a problem configuring dolfin.

Thank you very much in advance!

First of all, you need at least GCC version 4.8.3 to build the latest version of DOLFIN. This is not available in the official Ubuntu 12.04 archive, but a more recent compiler can be installed by adding this PPA. This answer might also be useful. Note that both gcc and g++ packages must be installed.

The initial post was about installing an older version of FEniCS, but it did not say anything about which version. Version 1.0-1.5 is available for Ubuntu 12.04 in the PPA's listed here.

I hope your comment would solve our problem, if not I could post a new question just for my issue.

...