Closed mia0x75 closed 6 years ago
+1 got the same issue on aws linux ec2
The error is here:
In file included from /src/github.com/fluent-project/fluent/build/requests.pb.cc:4:
/src/github.com/fluent-project/fluent/build/requests.pb.h:7:10: fatal error: 'string' file not found
#include <string>
^~~~~~~~
My hunch based on some quick Googling is that this is happening because the C compiler is being identified as gcc
(GNU 8.1.1), whereas the CXX compiler is finding clang
. When we configure Ubuntu instances, we set the default C and CXX compilers to both point to the same version of clang. I'll verify this later today.
Similar problem on centos7. It could be solved by
sudo yum install libcxx
sudo yum install libcxx-devel.x86_64
But I got another problem then.
-- Check for working CXX compiler: /usr/bin/clang++ -- broken
CMake Error at /usr/local/share/cmake-3.12/Modules/CMakeTestCXXCompiler.cmake:45 (message):
The C++ compiler
"/usr/bin/clang++"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/web_server/hunter/fluent/build/vendor/yamlcpp/src/yamlcpp/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/gmake" "cmTC_ad3a5/fast"
gmake[3]: Entering directory `/home/web_server/hunter/fluent/build/vendor/yamlcpp/src/yamlcpp/CMakeFiles/CMakeTmp'
/usr/bin/gmake -f CMakeFiles/cmTC_ad3a5.dir/build.make CMakeFiles/cmTC_ad3a5.dir/build
gmake[4]: Entering directory `/home/web_server/hunter/fluent/build/vendor/yamlcpp/src/yamlcpp/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_ad3a5.dir/testCXXCompiler.cxx.o
/usr/bin/clang++ -stdlib=libc++ -o CMakeFiles/cmTC_ad3a5.dir/testCXXCompiler.cxx.o -c /home/web_server/hunter/fluent/build/vendor/yamlcpp/src/yamlcpp/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_ad3a5
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ad3a5.dir/link.txt --verbose=1
/usr/bin/clang++ -stdlib=libc++ -rdynamic CMakeFiles/cmTC_ad3a5.dir/testCXXCompiler.cxx.o -o cmTC_ad3a5
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc++.so: undefined reference to `__cxa_end_catch'
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc++.so: undefined reference to `__cxa_allocate_exception'
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc++.so: undefined reference to `__cxa_guard_release'
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc++.so: undefined reference to `__cxa_pure_virtual'
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc++.so: undefined reference to `__gxx_personality_v0'
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc++.so: undefined reference to `__cxa_begin_catch'
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc++.so: undefined reference to `__cxa_rethrow'
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc++.so: undefined reference to `__cxa_throw'
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc++.so: undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc++.so: undefined reference to `__cxa_guard_abort'
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc++.so: undefined reference to `vtable for __cxxabiv1::__class_type_info'
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc++.so: undefined reference to `vtable for __cxxabiv1::__vmi_class_type_info'
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc++.so: undefined reference to `__cxa_free_exception'
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc++.so: undefined reference to `__cxa_guard_acquire'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[4]: *** [cmTC_ad3a5] Error 1
gmake[4]: Leaving directory `/home/web_server/hunter/fluent/build/vendor/yamlcpp/src/yamlcpp/CMakeFiles/CMakeTmp'
gmake[3]: *** [cmTC_ad3a5/fast] Error 2
gmake[3]: Leaving directory `/home/web_server/hunter/fluent/build/vendor/yamlcpp/src/yamlcpp/CMakeFiles/CMakeTmp'
Hope you can add more supports of different systems.
On an Amazon Linux instance, I got the following to work:
/usr/bin/clang
.update-alternatives
to link /usr/bin/clang++
to /usr/bin/clang/bin/clang++
.sudo yum groupinstall "Development Tools"
to install gcc, g++, etc. libcxx
as suggested by @qinhunter above. (Thanks!) This fixed most of the issues, but there were a few remaining hacks:
/usr/lib64
to the LIBRARY_PATH
variable.libtinfo.so
, so I had to run sudo yum install -y ncurses-devel-5.7-4.20090207.14.amzn1.x86_64
and then symlink /usr/lib64/libtinfo.so.6
to /usr/lib64/libtinfo.
.crtbegin.o
and crtend.o
from the /usr/lib/gcc/x86_64-amazon-linux/4.8.5/
directory into /usr/lib/
.This enabled CMake and clang to run properly, but when I attempt to build and install protobuf, the configuration step fails because it believes there's no sched_yield
on the system. I did some quick Googling, but I wasn't able to find any solutions. I'm running into the limits of my Fedora knowledge, and I'm sure it has sched_yield
, so I assume this is another issue with some system library configuration.
I'll try to come back to this soon, but if anyone else is more familiar with these issues, I'd love some help.
Another update: It looks like the reason that the protobuf installation is failing is because ./configure
script is invoking a libcxxabi
function call that depends on version 2.18 of glibc
, the default version on Amazon Linux is 2.17. I tried to install a new version, but that broke... basically everything. :-) As I said earlier, I don't know if this generalizes to other Fedora distributions, but if anyone has any input, we'd love your help.
In the meantime, the software definitely works on Ubuntu, and there is a Dockerfile that you can use to run the software. We'll have a pre-built image hosted on Dockerhub soon (see #18).
Hi all, this should be fixed now. As of #23, we can now compile Fluent with GNU g++. I tested this on an Amazon Linux instance, and it compiles fine. There are some compile warning, but the processes all start fine. Please let me know if you run into anymore issues.
Im running Fedora 28 x86-64.