5

I want to compile a C program. When I run cmake

 build]$ cmake ../ -- The C compiler identification is unknown -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- broken CMake Error at /usr/share/cmake-3.0/Modules/CMakeTestCCompiler.cmake:61 (message): The C compiler "/usr/bin/cc" is not able to compile a simple test program. 

It fails with the following output:

 Change Dir: /home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp Run Build Command:"/usr/bin/make" "cmTryCompileExec3431547622/fast" /usr/bin/make -f CMakeFiles/cmTryCompileExec3431547622.dir/build.make CMakeFiles/cmTryCompileExec3431547622.dir/build make[1]: Entering directory '/home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp' /usr/bin/cmake -E cmake_progress_report /home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp/CMakeFiles 1 Building C object CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o /usr/bin/cc -o CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o -c /home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp/testCCompiler.c /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/cc1: error while loading shared libraries: libisl.so.13: cannot open shared object file: No such file or directory CMakeFiles/cmTryCompileExec3431547622.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o' failed make[1]: *** [CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o] Error 1 make[1]: Leaving directory '/home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp' Makefile:118: recipe for target 'cmTryCompileExec3431547622/fast' failed make: *** [cmTryCompileExec3431547622/fast] Error 2 CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:2 (project) -- Configuring incomplete, errors occurred! See also "/home/vahid/dev/Indexer/build/CMakeFiles/CMakeOutput.log". See also "/home/vahid/dev/Indexer/build/CMakeFiles/CMakeError.log". 

why did this error occur? How can I fix it?

1
  • 2
    Try to compile simple file like int main() {}: /usr/bin/cc -c foo.c. What is the result? Commented Jul 4, 2014 at 2:04

1 Answer 1

9

why this error occured?

According to this error message:

/usr/bin/cc -o CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o -c /home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp/testCCompiler.c /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/cc1: error while loading shared libraries: libisl.so.13: cannot open shared object file: No such file or directory 

It looks like your compiler does not work.

how i can fix it?

Reinstall toolchain should be the simplest way to fix it.

How to do that depends on your operating system, if you are using Linux distribution like Debian, you can use something like apt-get install build-essential to install it; if you are using Fedora or CentOS, you could use yum group install c-development.

Sign up to request clarification or add additional context in comments.

4 Comments

@28 Then I believe pacman has a similar subcommand that can do the same thing.
What if I'm using a Mac, do I type something into the Terminal?
@Azurespot Mac OS X is totally different. How to install and reinstall toolchain on Mac OS X depends on which toolchain you are using. Google something like "how to install compiler on mac os" could give you more details.
apt-get install build-essential works for me! ubuntu 20

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.