Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiled failed on centos 7 #32

Closed
Winging opened this issue Jun 10, 2021 · 8 comments
Closed

Compiled failed on centos 7 #32

Winging opened this issue Jun 10, 2021 · 8 comments

Comments

@Winging
Copy link
Contributor

Winging commented Jun 10, 2021

gcc 9.3
centos :CentOS Linux release 7.9.2009 (Core)
GNU ld version 2.27-44.base.el7
Copyright (C) 2016 Free Software Foundation, **Inc.**
 29%] Linking CXX shared library ../lib/libnebula_graph_client.so
collect2: fatal error: ld terminated with signal 11 [Segmentation fault]
compilation terminated.

不确定是不是需要升级ld ?

@Winging
Copy link
Contributor Author

Winging commented Jun 10, 2021

Compiling works well on Release mode.
It seems that it only fails when build in debug mode "cmake .. -DCMAKE_BUILD_TYPE=Debug".

@wey-gu
Copy link

wey-gu commented Jun 11, 2021

Have you tried update ld and see what happens on Debug Build?

@Winging
Copy link
Contributor Author

Winging commented Jun 11, 2021

Not yet, I did not figure out how to upgrade it. I am considering use client as a static library instead of a dynamic one.

@laura-ding
Copy link
Contributor

Compiling works well on Release mode.
It seems that it only fails when build in debug mode "cmake .. -DCMAKE_BUILD_TYPE=Debug".

Could you provide how do you install the gcc?

@laura-ding
Copy link
Contributor

Not yet, I did not figure out how to upgrade it. I am considering use client as a static library instead of a dynamic one.

You only can use the dynamic lib.

@Winging
Copy link
Contributor Author

Winging commented Jun 11, 2021

Compiling works well on Release mode.
It seems that it only fails when build in debug mode "cmake .. -DCMAKE_BUILD_TYPE=Debug".

Could you provide how do you install the gcc?

We compile and installed gcc 9.3 like below

cd /tmp \
	&& wget https://gcc.gnu.org/pub/gcc/releases/gcc-9.3.0/gcc-9.3.0.tar.gz \
	&& wget ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.1.0.tar.bz2 \
	&& wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.0.3.tar.gz \
	&& wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2 \
	&& mkdir -p /opt/gcc-9.3 \
	&& mkdir -p /opt/gmp \
	&& mkdir -p /opt/mpfr \
	&& mkdir -p /opt/mpc \
	&& cd /tmp;tar -xf gmp-6.1.0.tar.bz2 && cd gmp-6.1.0 && ./configure --prefix=/opt/gmp && make -j8 && make install \
	&& cd /tmp;tar -xf mpfr-3.1.4.tar.bz2 && cd mpfr-3.1.4 && ./configure --prefix=/opt/mpfr --with-gmp=/opt/gmp && make -j8 && make install \
	&& cd /tmp;tar -xf mpc-1.0.3.tar.gz && cd mpc-1.0.3 && ./configure --prefix=/opt/mpc --with-gmp=/opt/gmp --with-mpfr=/opt/mpfr && make -j8 && make install \
	&& cd /tmp;tar -xf gcc-9.3.0.tar.gz && cd gcc-9.3.0 && ./configure --prefix=/opt/gcc-9.3 \
		--enable-languages=c,c++ \
		--disable-multilib \
		--with-gmp=/opt/gmp \
		--with-mpfr=/opt/mpfr \
		--with-mpc=/opt/mpc \
	&& make -j32 && make install \
	&& rm -rf /tmp/gcc-9.3.0* \
	&& rm -rf /tmp/gmp-6.1.0* \
	&& rm -rf /tmp/mpfr-3.1.4* \
	&& rm -rf /tmp/mpc-1.0.3* 

@laura-ding
Copy link
Contributor

Compiling works well on Release mode.
It seems that it only fails when build in debug mode "cmake .. -DCMAKE_BUILD_TYPE=Debug".

Could you provide how do you install the gcc?

We compile and installed gcc 9.3 like below

cd /tmp \
	&& wget https://gcc.gnu.org/pub/gcc/releases/gcc-9.3.0/gcc-9.3.0.tar.gz \
	&& wget ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.1.0.tar.bz2 \
	&& wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.0.3.tar.gz \
	&& wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2 \
	&& mkdir -p /opt/gcc-9.3 \
	&& mkdir -p /opt/gmp \
	&& mkdir -p /opt/mpfr \
	&& mkdir -p /opt/mpc \
	&& cd /tmp;tar -xf gmp-6.1.0.tar.bz2 && cd gmp-6.1.0 && ./configure --prefix=/opt/gmp && make -j8 && make install \
	&& cd /tmp;tar -xf mpfr-3.1.4.tar.bz2 && cd mpfr-3.1.4 && ./configure --prefix=/opt/mpfr --with-gmp=/opt/gmp && make -j8 && make install \
	&& cd /tmp;tar -xf mpc-1.0.3.tar.gz && cd mpc-1.0.3 && ./configure --prefix=/opt/mpc --with-gmp=/opt/gmp --with-mpfr=/opt/mpfr && make -j8 && make install \
	&& cd /tmp;tar -xf gcc-9.3.0.tar.gz && cd gcc-9.3.0 && ./configure --prefix=/opt/gcc-9.3 \
		--enable-languages=c,c++ \
		--disable-multilib \
		--with-gmp=/opt/gmp \
		--with-mpfr=/opt/mpfr \
		--with-mpc=/opt/mpc \
	&& make -j32 && make install \
	&& rm -rf /tmp/gcc-9.3.0* \
	&& rm -rf /tmp/gmp-6.1.0* \
	&& rm -rf /tmp/mpfr-3.1.4* \
	&& rm -rf /tmp/mpc-1.0.3* 

You can install GCC try to this

sudo yum -y install centos-release-scl
sudo yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
sudo scl enable devtoolset-9 bash

@wey-gu
Copy link

wey-gu commented Jul 16, 2021

Will close it as it's been inactive for days. Feel free to reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants