Library `Coroutines' not found in list of llvm libraries - cmake

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.

Related

LTO compilation question when linking X86/marshal file

Envs: Ubuntu 18.04, Miniconda3, python=3.7(GCC=7.3.0), GCC -v (7.4.0)
The error occurs when I run the following command:
scons build/X86/gem5.opt -j8
The error is as follow:
[ LINK] -> X86/marshal
lto1: internal compiler error: in lto_tag_to_tree_code, at lto-streamer.h:1005
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
lto-wrapper: fatal error: g++ returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
scons: *** [build/X86/marshal] Error 1
scons: building terminated because of errors.
And I am wondering how to fix it.

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.

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})

when i make && make install the glibc-2.27 failed with Error 1 and Error2

/opt/odoo/glibc-2.27/elf/../sysdeps/posix/dl-fileid.h:37: undefined reference to `__GI___fxstat64'
/usr/bin/ld: /opt/odoo/glibc-2.27/build/elf/librtld.os: relocation R_X86_64_PC32 against undefined symbol `__GI___fxstat64' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:478: recipe for target '/opt/odoo/glibc-2.27/build/elf/ld.so' failed
make[2]: *** [/opt/odoo/glibc-2.27/build/elf/ld.so] Error 1
make[2]: Leaving directory '/opt/odoo/glibc-2.27/elf'
Makefile:215: recipe for target 'elf/subdir_lib' failed
make[1]: *** [elf/subdir_lib] Error 2
make[1]: Leaving directory '/opt/odoo/glibc-2.27'
Makefile:9: recipe for target 'all' failed
make: *** [all] Error 2
how i can solut the problem, the unix is Debain. The proble i can't make the glic-2.27

How to fix cmGLobalNInjaGenerator.cxx.o" error of 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