cmake fails
Closed this issue · 4 comments
rednectar commented
I built a new Linux box (Mint 17.0) and pulled the dynamips repo as per the instructions:
git clone git://github.com/GNS3/dynamips.git cd dynamips mkdir build cd build cmake ..
but the cmake fails:
user@GNS3v1 ~/GNS3/Source/dynamips/build $ cmake .. -- CMAKE_MODULE_PATH=/home/user/GNS3/Source/dynamips/cmake -- The C compiler identification is GNU 4.8.2 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- broken CMake Error at /usr/share/cmake-2.8/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/user/GNS3/Source/dynamips/build/CMakeFiles/CMakeTmp Run Build Command:/usr/bin/make "cmTryCompileExec2932928433/fast" /usr/bin/make -f CMakeFiles/cmTryCompileExec2932928433.dir/build.make CMakeFiles/cmTryCompileExec2932928433.dir/build make[1]: Entering directory `/home/user/GNS3/Source/dynamips/build/CMakeFiles/CMakeTmp' /usr/bin/cmake -E cmake_progress_report /home/user/GNS3/Source/dynamips/build/CMakeFiles/CMakeTmp/CMakeFiles 1 Building C object CMakeFiles/cmTryCompileExec2932928433.dir/testCCompiler.c.o /usr/bin/cc -o CMakeFiles/cmTryCompileExec2932928433.dir/testCCompiler.c.o -c /home/user/GNS3/Source/dynamips/build/CMakeFiles/CMakeTmp/testCCompiler.c Linking C executable cmTryCompileExec2932928433 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2932928433.dir/link.txt --verbose=1 /usr/bin/cc CMakeFiles/cmTryCompileExec2932928433.dir/testCCompiler.c.o -o cmTryCompileExec2932928433 -rdynamic /usr/bin/ld: cannot find crt1.o: No such file or directory /usr/bin/ld: cannot find crti.o: No such file or directory /usr/bin/ld: cannot find -lc /usr/bin/ld: cannot find crtn.o: No such file or directory collect2: error: ld returned 1 exit status make[1]: Leaving directory `/home/user/GNS3/Source/dynamips/build/CMakeFiles/CMakeTmp' make[1]: *** [cmTryCompileExec2932928433] Error 1 make: *** [cmTryCompileExec2932928433/fast] Error 2 CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:27 (project) -- Configuring incomplete, errors occurred! See also "/home/user/GNS3/Source/dynamips/build/CMakeFiles/CMakeOutput.log". See also "/home/user/GNS3/Source/dynamips/build/CMakeFiles/CMakeError.log".
And the files mentioned above look like this:
user@GNS3v1 ~/GNS3/Source/dynamips/build $ cat /home/user/GNS3/Source/dynamips/build/CMakeFiles/CMakeOutput.log The system is: Linux - 3.13.0-24-generic - i686 Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. Compiler: /usr/bin/cc Build flags: Id flags: -c The output was: 0 Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o" The C compiler identification is GNU, found in "/home/user/GNS3/Source/dynamips/build/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.o"
And
user@GNS3v1 ~/GNS3/Source/dynamips/build $ cat /home/user/GNS3/Source/dynamips/build/CMakeFiles/CMakeError.log Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: /usr/bin/cc Build flags: Id flags: The output was: 1 /usr/bin/ld: cannot find crt1.o: No such file or directory /usr/bin/ld: cannot find crti.o: No such file or directory /usr/bin/ld: cannot find -lc /usr/bin/ld: cannot find crtn.o: No such file or directory collect2: error: ld returned 1 exit status Determining if the C compiler works failed with the following output: Change Dir: /home/user/GNS3/Source/dynamips/build/CMakeFiles/CMakeTmp Run Build Command:/usr/bin/make "cmTryCompileExec2932928433/fast" /usr/bin/make -f CMakeFiles/cmTryCompileExec2932928433.dir/build.make CMakeFiles/cmTryCompileExec2932928433.dir/build make[1]: Entering directory `/home/user/GNS3/Source/dynamips/build/CMakeFiles/CMakeTmp' /usr/bin/cmake -E cmake_progress_report /home/user/GNS3/Source/dynamips/build/CMakeFiles/CMakeTmp/CMakeFiles 1 Building C object CMakeFiles/cmTryCompileExec2932928433.dir/testCCompiler.c.o /usr/bin/cc -o CMakeFiles/cmTryCompileExec2932928433.dir/testCCompiler.c.o -c /home/user/GNS3/Source/dynamips/build/CMakeFiles/CMakeTmp/testCCompiler.c Linking C executable cmTryCompileExec2932928433 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2932928433.dir/link.txt --verbose=1 /usr/bin/cc CMakeFiles/cmTryCompileExec2932928433.dir/testCCompiler.c.o -o cmTryCompileExec2932928433 -rdynamic /usr/bin/ld: cannot find crt1.o: No such file or directory /usr/bin/ld: cannot find crti.o: No such file or directory /usr/bin/ld: cannot find -lc /usr/bin/ld: cannot find crtn.o: No such file or directory collect2: error: ld returned 1 exit status make[1]: Leaving directory `/home/user/GNS3/Source/dynamips/build/CMakeFiles/CMakeTmp' make[1]: *** [cmTryCompileExec2932928433] Error 1 make: *** [cmTryCompileExec2932928433/fast] Error 2
LocutusOfBorg commented
Hi, I didn't check carefully on my pc (I'm on mobile ATM), but seems that you lack of the classic build tools like g++, gcc, build-essential... please, apt install them and try again
rednectar commented
Rookie error. LocutusOfBorg is right (thanks) - I had a script that did all that for me but I had another error that meant that line got skipped. All good now
mohammadyakub06 commented
Can you please provide me elaborated answer for this
LocutusOfBorg commented
@mohammadyakub06 just run sudo apt-get install g++ gcc build-essential
and so on