티스토리 뷰

테스트 환경 

Redhat Linux 7.3 

HPC 환경 

 

OpenFORM 사용자가 gcc 4.8.5 와 gcc 9.1.0 을 필요에 따라 Load / unload 사용 환경 구성

 

사전 준비 

modules 4.4.1 설치 파일 

https://modules.readthedocs.io/en/latest/index.html

불러오는 중입니다...

gcc 9.1.0 설치 파일 

https://gcc.gnu.org/

 

GCC, the GNU Compiler Collection - GNU Project - Free Software Foundation (FSF)

GCC, the GNU Compiler Collection The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Ada, Go, and D, as well as libraries for these languages (libstdc++,...). GCC was originally written as the compiler for the GNU operating sy

gcc.gnu.org

 

$yum repolist  (yum으로 필요한 파일 설치 해야 하므로 구성 할 것) 

 

 

iso 이미지로 로컬 yum 환경 구성 

iso 이미지 서버 upload  (WinSCP 활용)

https://winscp.net/eng/download.php

 

WinSCP :: Official Site :: Download

WinSCP 5.17 Download WinSCP 5.17 is a major application update. New features and enhancements include: Improvements to sessions and workspace management, so that WinSCP can now easily restore tabs that were open when it was last closed. Hardware-accelerate

winscp.net

$mkdir /root/iso ( root 홈디렉토리에 iso 폴더 생성)

$mount -o loop,ro rhel-server-7.3-x86_64-dvd.iso /root/iso  (iso 이미지 만들어 둔 폴더에 마운트)

repository 설정

$vi /etc/yum.repo.d/local.repo  (local.repo 파일생성)

[Local_Repository]
baseurl=file:///root/iso/ 
enabled=1
gpgcheck=1

 

$yum repolist (명령어 입력 후 로컬 repo 상태 확인)

 

Environment Modules 설치

 

사전 설치 파일 

$yum install grep*

$yum install gcc

$yum install gcc-c++

$yum install tcl-devel

$yum install autoconf  (설치 되어 있는 경우가 대 부분)

$yum install automake (설치 되어 있는 경우가 대 부분)

$yum install autopoint (설치 되어 있는 경우가 대 부분)

$yum install pyhton  (설치 되어 있는 경우가 대 부분)

$yum install sphinx (설치 되어 있는 경우가 대 부분)

 

설치시 의존성 걸리는 

 

 

다운받은 modules 4.4.1 파일 위치로 이동

 

$mkdir /packages  (패키지 설치 폴더 생성)

$mkdir /modules (모듈러 설치 폴더 생성)

 

$tar xvf modules-4.4.1.tar.gz

$cd modules-4.4.1.tar.gz

$./configure --with-module-path=/modules/

$make 

$make install 

 

$source /usr/local/Modules/init/ksh  (module 는 콘쉘 사용)

$module avil 

------------ /usr/local/Modules/modulefiles ------------     <--- module 설정 파일 위치 

dot  module-git  module-info  modules  null  use.own

 

 

gcc 9.1.0 설치 

 

$mkdir /packages/gcc/9.1.0 (gcc 설치 폴더 생성)

$tar xvf gcc-9.1.0.rar.gz

$cd gcc-9.1.0

$./contrib/download_prerequisites  (설치에 필요한 파일 체크 및 다운로드)

2020-03-10 18:19:12 URL: ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.1.0.tar.bz2 [2383840] -> "./gmp-6.1.0.tar.bz2" [1]
2020-03-10 18:19:17 URL: ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2 [1279284] -> "./mpfr-3.1.4.tar.bz2" [1]
2020-03-10 18:19:20 URL: ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.0.3.tar.gz [669925] -> "./mpc-1.0.3.tar.gz" [1]
2020-03-10 18:19:25 URL: ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2 [1658291] -> "./isl-0.18.tar.bz2" [1]
gmp-6.1.0.tar.bz2: OK
mpfr-3.1.4.tar.bz2: OK
mpc-1.0.3.tar.gz: OK
isl-0.18.tar.bz2: OK
All prerequisites downloaded successfully.

 

$./configure --prefix=/packages/gcc/9.1.0 --disable-multilib -enable-check-release

$make

$make install 

 

Module 환경 설정

$cd /usr/local/Modules/modulefiles 

$vi 9.1.0  (gcc 9.1.0 로드 파일 생성)

#%Module3.2.10

proc ModulesHelp {} {

             gobal dotversion

 

             puts stderr "compilers/gcc-9.1 - sets the Enviroment for GCC 9.1 in my home dir"

}

 

module-whatis   "Sets the environment for using gcc-9.1 compilers (C, C++)"

 

set          topdir      /packages/gcc/9.1.0

set          version     9.1

set          sys          linux-x86_64

 

setenv                   CC                                     $topdir/bin/gcc

setenv                   GCC                                   $topdir/bin/gcc

prepend-path          PATH                                  $topdir/include      

prepend-path          PATH                                  $topdir/bin

prepend-path          PATH                                  $topdir/bin

prepend-path          MANPATH                            $topdir/man

prepend-path          LD_LIBRARY_PATH                  $topdir/lib

 

 

 

모듈러를 통한 gcc 버젼별 불러오기 

$module avil

----------- /usr/local/Modules/modulefiles ------------

9.1.0  dot  module-git  module-info  modules  null  use.own

 

$module load 9.1.0

$module list    (로드 된 모듈 확인)

1) 9.1.0 

 

$gcc --version  (로드된 gcc 버젼 확인)

gcc (GCC) 9.1.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 

$which gcc   (로드된 gcc 경로 확인)

/packages/gcc/9.1.0

 

 

 

$module unload 9.1.0 (로드된 gcc 버젼 언로드)

$module list

No Modulefiles Currently Loaded.

 

$gcc --version

gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 

기존 OS 에 설치된 4.8.5 가 로드 되어 사용됨.

 

 

 

이렇게 gcc 버젼을 여러 버젼을 사용하는 용도로 사용됨.

 

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함