How to fix cmGLobalNInjaGenerator.cxx.o" error of cmake? - cmake

I am installing a newer version of cmake which is cmake 3.10.1 and the make command is giving me error while building CXX object source.
I have installed the ninja 1.5.1 but still getting the same error.
used this to install the cmake:
wget <link of the cmake3.10.1>
./configure
make # (at this stage getting error)
The error is:
[ 83%] Building CXX object Source/CMakeFiles/CMakeLib.dir/cmGlobalNinjaGenerator.cxx.o
/media/nadia/967E9B477E9B1F55/data/cmake-3.10.1/Source/cmGlobalNinjaGenerator.cxx: In member function ‘void cmGlobalNinjaGenerator::AppendTargetDependsClosure(const cmGeneratorTarget*, cmNinjaOuts&, bool)’:
/media/nadia/967E9B477E9B1F55/data/cmake-3.10.1/Source/cmGlobalNinjaGenerator.cxx:1077:40: error: ‘class std::map<const cmGeneratorTarget*, std::set<std::basic_string<char> > >’ has no member named ‘emplace_hint’
Source/CMakeFiles/CMakeLib.dir/build.make:5942: recipe for target 'Source/CMakeFiles/CMakeLib.dir/cmGlobalNinjaGenerator.cxx.o' failed
make[2]: *** [Source/CMakeFiles/CMakeLib.dir/cmGlobalNinjaGenerator.cxx.o] Error 1
CMakeFiles/Makefile2:2355: recipe for target 'Source/CMakeFiles/CMakeLib.dir/all' failed
make[1]: *** [Source/CMakeFiles/CMakeLib.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

Related

Cannot cmake box86 on arm cpu, unrecognized option '-marm'

I'm trying to install box86 with cmake in a script, the error I get in console is:
Scanning dependencies of target WRAPPERS
Scanning dependencies of target dynarec_arm
[ 0%] Built target PRINTER
[ 0%] Generating ../src/wrapped/generated/functions_list.txt
[ 0%] Building C object CMakeFiles/dynarec_arm.dir/src/dynarec/dynablock.c.o
[ 1%] Building C object CMakeFiles/dynarec_arm.dir/src/dynarec/dynarec_arm.c.o
cc: error: unrecognized command line option '-marm'; did you mean '-fasm'?
make[2]: *** [CMakeFiles/dynarec_arm.dir/build.make:76: CMakeFiles/dynarec_arm.dir/src/dynarec/dynarec_arm.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cc: error: unrecognized command line option '-marm'; did you mean '-fasm'?
make[2]: *** [CMakeFiles/dynarec_arm.dir/build.make:63: CMakeFiles/dynarec_arm.dir/src/dynarec/dynablock.c.o] Error 1
[ 1%] Building C object CMakeFiles/dynarec_arm.dir/src/dynarec/dynarec_arm_functions.c.o
cc: error: unrecognized command line option '-marm'; did you mean '-fasm'?
make[2]: *** [CMakeFiles/dynarec_arm.dir/build.make:89: CMakeFiles/dynarec_arm.dir/src/dynarec/dynarec_arm_functions.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/dynarec_arm.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Detected same build as last run, skipping
[ 1%] Built target WRAPPERS
make: *** [Makefile:163: all] Error 2
My script for this installation is:
git clone https://github.com/ptitSeb/box86
cd box86
echo 'cd box86'
mkdir build; cd build; cmake .. -DARM_DYNAREC=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo; make -j$(nproc)
exit
I'm not sure what this error means since I never specified -marm as an option... where is this coming from?

DPDK-19.11 linking stating for pdump application results in error

DPDK version: 19-11
Environment: VM
OS: 4.14.81.bm.15-amd64
Gcc: 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) Application error: PDUMP
note: build for same in host machine works fine.
CMD: make install
Logs:
== Build app/pdump
CC main.o
LD dpdk-pdump
collect2: error: ld returned 1 exit status
/root/dpdk-19.11/mk/rte.app.mk:433: recipe for target 'dpdk-pdump' failed
make[5]: *** [dpdk-pdump] Error 1
/root/dpdk-19.11/mk/rte.subdir.mk:35: recipe for target 'pdump' failed
make[4]: *** [pdump] Error 2
/root/dpdk-19.11/mk/rte.sdkbuild.mk:46: recipe for target 'app' failed
make[3]: *** [app] Error 2
/root/dpdk-19.11/mk/rte.sdkroot.mk:98: recipe for target 'all' failed
make[2]: *** [all] Error 2
/root/dpdk-19.11/mk/rte.sdkinstall.mk:60: recipe for target 'pre_install' failed
make[1]: *** [pre_install] Error 2
/root/dpdk-19.11/mk/rte.sdkroot.mk:77: recipe for target 'install' failed
make: *** [install] Error 2
as per the current update from Meinhard, the issue was the VM was having less memory to finish the linking. Increasing the memory the build is successful.

Error in building CGAL example Triangulation_2

I installed CGAL and tried to follow manual, but I failed to build example Triangulation_2. I used terminal in mac and run the code.
[ 50%] Building CXX object CMakeFiles/draw_triangulation_2.dir/draw_triangulation_2.cpp.o
In file included from /Users/janeh/Downloads/CGAL-5.0.2/examples/Triangulation_2/draw_triangulation_2.cpp:3:
/usr/local/include/CGAL/draw_triangulation_2.h:16:10: fatal error:
'CGAL/Qt/Basic_viewer_qt.h' file not found
#include <CGAL/Qt/Basic_viewer_qt.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/draw_triangulation_2.dir/draw_triangulation_2.cpp.o] Error 1
make[1]: *** [CMakeFiles/draw_triangulation_2.dir/all] Error 2
I checked Basic_viewer_qt.h and it is at the right location
/Users/janeh/Downloads/CGAL-5.0.2/include/CGAL/Qt/Basic_viewer_qt.h
But somehow draw_triangulation_2.h can't include it. Is there any reason why this happens?

Clion, cmake DSO missing when building simple2d

I have started with a project that are using the simple2d library (https://github.com/simple2d/simple2d). But when I try to build my small example project I get a DSO missing error. I think a have manage to link the dependencies for simple2d, but apparently I'm still some thing.
Here is the output:
> ====================[ Build | c_game | Debug ]==================================
/home/fredrik/.local/share/JetBrains/Toolbox/apps/CLion/ch-0/192.5728.100/bin/cmake/linux/bin/cmake --build /home/fredrik/Repos/c_game/cmake-build-debug --target c_game -- -j 2 -m
[ 50%] Linking C executable c_game
/usr/bin/ld: /usr/local/lib/libsimple2d.a(gl.o): undefined reference to symbol 'fmin##GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/c_game.dir/build.make:85: recipe for target 'c_game' failed
make[3]: *** [c_game] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/c_game.dir/all' failed
make[2]: *** [CMakeFiles/c_game.dir/all] Error 2
CMakeFiles/Makefile2:84: recipe for target 'CMakeFiles/c_game.dir/rule' failed
make[1]: *** [CMakeFiles/c_game.dir/rule] Error 2
Makefile:118: recipe for target 'c_game' failed
make: *** [c_game] Error 2
And here is my CMakeList.txt, I hope someone can help me.
cmake_minimum_required(VERSION 3.14)
project(c_game C)
set(CMAKE_C_STANDARD 11)
find_package(SDL2 REQUIRED)
find_package(GLEW REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS})
add_executable(c_game main.c)
find_library(SIMPLE2D_LIB libsimple2d.a /usr/local/lib)
message(${SIMPLE2D_LIB})
message(${SDL2_INCLUDE_DIRS})
message(${GLEW_INCLUDE_DIRS})
target_include_directories(c_game PUBLIC ${SDL2_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS})
target_link_libraries(c_game ${SIMPLE2D_LIB} ${SDL2_LIBRARIES} ${GLEW_LIBRARIES})

Library `Coroutines' not found in list of llvm libraries

I'm trying to setup LLVM release version 3.5 on my ubuntu 16.04 LTS 64-bit machine, and have been facing errors related to CMake.
How to solve: Library `Coroutines' not found in list of llvm libraries ?
I followed instructions given here, to the T.
I got the following error log on executing cmake -G "Unix Makefiles" ../llvm
/home/.../llvm_dir/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:27: fatal error: malloc/malloc.h: No such file or directory
compilation terminated.
CMakeFiles/cmTC_23510.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_23510.dir/CheckIncludeFile.c.o' failed
make1: *** [CMakeFiles/cmTC_23510.dir/CheckIncludeFile.c.o] Error 1
...
/home/.../llvm_dir/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:18: fatal error: ndir.h: No such file or directory
compilation terminated.
CMakeFiles/cmTC_a8c89.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_a8c89.dir/CheckIncludeFile.c.o' failed
make1: *** [CMakeFiles/cmTC_a8c89.dir/CheckIncludeFile.c.o] Error 1
...
/home/.../llvm_dir/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:22: fatal error: sys/ndir.h: No such file or directory
compilation terminated.
CMakeFiles/cmTC_9297d.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_9297d.dir/CheckIncludeFile.c.o' failed
make1: *** [CMakeFiles/cmTC_9297d.dir/CheckIncludeFile.c.o] Error 1
...
/home/.../llvm_dir/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:31: fatal error: valgrind/valgrind.h: No such file or directory
compilation terminated.
CMakeFiles/cmTC_14b5f.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_14b5f.dir/CheckIncludeFile.c.o' failed
make1: *** [CMakeFiles/cmTC_14b5f.dir/CheckIncludeFile.c.o] Error 1
...
/home/.../llvm_dir/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:18: fatal error: zlib.h: No such file or directory
compilation terminated.
CMakeFiles/cmTC_a4254.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_a4254.dir/CheckIncludeFile.c.o' failed
make1: *** [CMakeFiles/cmTC_a4254.dir/CheckIncludeFile.c.o] Error 1
...
/home/.../llvm_dir/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:23: fatal error: mach/mach.h: No such file or directory
compilation terminated.
CMakeFiles/cmTC_43c90.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_43c90.dir/CheckIncludeFile.c.o' failed
make1: *** [CMakeFiles/cmTC_43c90.dir/CheckIncludeFile.c.o] Error 1
...
/home/.../llvm_dir/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:25: fatal error: mach-o/dyld.h: No such file or directory
compilation terminated.
CMakeFiles/cmTC_92df8.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_92df8.dir/CheckIncludeFile.c.o' failed
make1: *** [CMakeFiles/cmTC_92df8.dir/CheckIncludeFile.c.o] Error 1
...
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=compress2 CMakeFiles/cmTC_45dee.dir/CheckFunctionExists.c.o -o cmTC_45dee -rdynamic -lz -lm
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_45dee.dir/build.make:97: recipe for target 'cmTC_45dee' failed
make1: *** [cmTC_45dee] Error 1
...
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=el_init CMakeFiles/cmTC_678de.dir/CheckFunctionExists.c.o -o cmTC_678de -rdynamic -ledit -lm
/usr/bin/ld: cannot find -ledit
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_678de.dir/build.make:97: recipe for target 'cmTC_678de' failed
make1: *** [cmTC_678de] Error 1
...
/usr/bin/ld: cannot find -ltinfo
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_b7cfe.dir/build.make:97: recipe for target 'cmTC_b7cfe' failed
make1: *** [cmTC_b7cfe] Error 1
...
/usr/bin/ld: cannot find -lterminfo
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_58a1c.dir/build.make:97: recipe for target 'cmTC_58a1c' failed
make1: *** [cmTC_58a1c] Error 1
...
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=setupterm CMakeFiles/cmTC_adafa.dir/CheckFunctionExists.c.o -o cmTC_adafa -rdynamic -lcurses -lm
/usr/bin/ld: cannot find -lcurses
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_adafa.dir/build.make:97: recipe for target 'cmTC_adafa' failed
make1: *** [cmTC_adafa] Error 1
...
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=setupterm CMakeFiles/cmTC_e466b.dir/CheckFunctionExists.c.o -o cmTC_e466b -rdynamic -lncurses -lm
/usr/bin/ld: cannot find -lncurses
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_e466b.dir/build.make:97: recipe for target 'cmTC_e466b' failed
make1: *** [cmTC_e466b] Error 1
...
/usr/bin/ld: cannot find -lncursesw
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_8dc06.dir/build.make:97: recipe for target 'cmTC_8dc06' failed
make1: *** [cmTC_8dc06] Error 1
...
/home/.../llvm_dir/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8:19: error: ‘arc4random’ undeclared (first use in this function)
return ((int*)(&arc4random))[argc];
^
/home/.../llvm_dir/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8:19: note: each undeclared identifier is reported only once for each function it appears in
CMakeFiles/cmTC_75c3b.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_75c3b.dir/CheckSymbolExists.c.o' failed
make1: *** [CMakeFiles/cmTC_75c3b.dir/CheckSymbolExists.c.o] Error 1
...
/home/.../llvm_dir/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:2:17: fatal error: cmath: No such file or directory
compilation terminated.
CMakeFiles/cmTC_53670.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_53670.dir/CheckSymbolExists.c.o' failed
make1: *** [CMakeFiles/cmTC_53670.dir/CheckSymbolExists.c.o] Error 1
...
/home/.../llvm_dir/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:2:20: fatal error: ieeefp.h: No such file or directory
compilation terminated.
CMakeFiles/cmTC_e4e6e.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_e4e6e.dir/CheckSymbolExists.c.o' failed
make1: *** [CMakeFiles/cmTC_e4e6e.dir/CheckSymbolExists.c.o] Error 1
...
/home/.../llvm_dir/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:2:17: fatal error: cmath: No such file or directory
compilation terminated.
CMakeFiles/cmTC_b8170.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_b8170.dir/CheckSymbolExists.c.o' failed
make1: *** [CMakeFiles/cmTC_b8170.dir/CheckSymbolExists.c.o] Error 1
...
/home/.../llvm_dir/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8:19: error: ‘exp10’ undeclared (first use in this function)
return ((int*)(&exp10))[argc];
^
/home/.../llvm_dir/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8:19: note: each undeclared identifier is reported only once for each function it appears in
CMakeFiles/cmTC_392cf.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_392cf.dir/CheckSymbolExists.c.o' failed
make1: *** [CMakeFiles/cmTC_392cf.dir/CheckSymbolExists.c.o] Error 1
...
/home/.../llvm_dir/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:2:27: fatal error: malloc/malloc.h: No such file or directory
compilation terminated.
CMakeFiles/cmTC_ff0fe.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_ff0fe.dir/CheckSymbolExists.c.o' failed
make1: *** [CMakeFiles/cmTC_ff0fe.dir/CheckSymbolExists.c.o] Error 1
...
/home/.../llvm_dir/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8:19: error: ‘strerror_s’ undeclared (first use in this function)
return ((int*)(&strerror_s))[argc];
^
/home/.../llvm_dir/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8:19: note: each undeclared identifier is reported only once for each function it appears in
CMakeFiles/cmTC_97097.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_97097.dir/CheckSymbolExists.c.o' failed
make1: *** [CMakeFiles/cmTC_97097.dir/CheckSymbolExists.c.o] Error 1
...
A similar error was faced before and posted here. But since my Python version was of 2.7x series, this didn't help.
So going by the log above, I started with the simpler one, installing Valgrind.
After re-trying the command cmake -G "Unix Makefiles" ../llvm
to see if it's solving errors: I've been getting the Library Coroutines error ever since, and I am stuck.
Can you help me?
Solved with a workaround.
Installed clang-3.5 and llvm-3.5 using the sudo apt install method.