2018년 5월 4일 금요일

ppc64le 환경에서 gcc7과 cmake3을 source로부터 build


제목 그대로입니다.  gcc7과 cmake3을 source code로부터 build하는 방법은 비교적 간단합니다.   여기서는 Redhat 7.4 ppc64le 환경입니다.

단, gcc를 build할 때 make 부분은 (CPU power가 약하다면) 시간이 매우 오래 걸린다는 점에 유의하세요. 

먼저 사전에 필요한 package 설치합니다.

[u0017649@sys-93214 ~]$ sudo yum install yum install gmp-devel mpfr-devel libmpc-devel

gcc 7.2 source code부터 download 합니다.

[u0017649@sys-93214 ~]$ wget https://ftp.gnu.org/gnu/gcc/gcc-7.2.0/gcc-7.2.0.tar.gz

[u0017649@sys-93214 ~]$ tar -zxvf gcc-7.2.0.tar.gz

[u0017649@sys-93214 ~]$ cd gcc-7.2.0

[u0017649@sys-93214 gcc-7.2.0]$ mkdir build && cd build

[u0017649@sys-93214 build]$ ../configure --enable-languages=c,c++,fortran

[u0017649@sys-93214 build]$ make -j 8

[u0017649@sys-93214 build]$ sudo make install

[u0017649@sys-93214 build]$ which gcc
/usr/local/bin/gcc

g++도 함께 설치됩니다.

[u0017649@sys-93214 build]$ which g++
/usr/local/bin/g++

다음으로 cmake 3.11 source code를 download 합니다.

[u0017649@sys-93214 ~]$ wget https://cmake.org/files/v3.11/cmake-3.11.1.tar.gz

[u0017649@sys-93214 ~]$ tar -zxvf cmake-3.11.1.tar.gz

[u0017649@sys-93214 ~]$ cd cmake-3.11.1

[u0017649@sys-93214 cmake-3.11.1]$ ./configure

[u0017649@sys-93214 cmake-3.11.1]$ make

[u0017649@sys-93214 cmake-3.11.1]$ sudo make install

[u0017649@sys-93214 cmake-3.11.1]$ which cmake
/usr/local/bin/cmake

[u0017649@sys-93214 cmake-3.11.1]$ cmake --version
cmake version 3.11.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).

댓글 없음:

댓글 쓰기