반응형

     정보

    • 업무명     : 온라인/오프라인 리눅스 (Linux) 환경에 따른 NCL 설치 방법

    • 작성자     : 이상호

    • 작성일     : 2020-01-15

    • 설   명      :

    • 수정이력 :

     

     내용

    [개요]

    • 안녕하세요? 웹 개발 및 연구 개발을 담당하고 있는 해솔입니다.

    • NCL (NCAR Command Language)은 미국의 NCAR (National Center for Atmospheric Research)에서 개발된 언어로서 지구과학/대기과학 분야에서 특화되었습니다. 이는 다양한 분야에서 널리 사용되는 Matlab과 비교할 때 라이브러리를 통해 쉽게 계산할 수 있습니다.

    • 특히 예전에 자주 사용되는 소프트웨어인 GrADS는 간단한 인터페이스로 초보자도 빨리 익힐 수 있으나 소프트웨어의 유연성이 떨어집니다.

    • 따라서 이러한 NCL를 사용하기 앞서 온라인/오프라인 리눅스 환경에서 설치 방법을 소개드리고자 합니다.

     

     

    [특징]

    • NCL를 학습하기 위해서 리눅스 환경 구축이 요구되며 이 프로그램은 이러한 목적을 달성하기 위한 소프트웨어

     

    [기능]

    • NCL 설치

      • 온라인 환경

      • 오프라인 환경 

     

    [활용 자료]

    • 없음

     

    [자료 처리 방안 및 활용 분석 기법]

    • 없음

     

    [사용법]

    • 온라인 및 오프라인 환경 구축

    • 각 환경에 따른 다운로드 및 설치

    • 설치 결과 확인

     

    [사용 OS]

    • Linux (CentOS v7.0)

    • VMware Workstation Pro v15.5

     

    [사용 언어]

    • NCL v6.3.0

     

     설치

    [온라인 환경]

    • 리눅스 (Linux)에서 yum를 통해 "gcc, gcc-c++, gcc-gfortran, ncl"을 순차적으로 설치합니다.]

     

    yum -y install gcc
    yum -y install gcc-c++
    yum -y install gcc-gfortran
    yum -y install ncl

     

    • NCL 설치 경로 및 실행 결과 확인
    [root localhost@/SYSTEM/NCL]# which ncl
    /usr/bin/ncl
    [root localhost@/SYSTEM/NCL]# ncl
     Copyright (C) 1995-2015 - All Rights Reserved
     University Corporation for Atmospheric Research
     NCAR Command Language Version 6.3.0
     The use of this software is governed by a License Agreement.
     See http://www.ncl.ucar.edu/ for more details.
    ncl 0> 

     

    [오프라인 환경]

    • 온라인 (인터넷 가능)과 달리 직접  패키지 다운로드하여 컴파일 및 실행해야 합니다.

    • [1 단계] gcc 및 gfortran 설치 확인 

      • 따라서 리눅스 프롬프트 상에서 사전 설치되어 있는지 확인합니다.

        • which gcc

        • which gfortran

      • 사전 설치되어 있을 경우 설치 경로를 반환하고 그렇지 않으면 "no"라고 반환합니다.

      • 현재 서버에서 확인한 결과 gcc는 이미 /usr/bin/gcc 경로에 설치되었으나 gfortran은 "미 설치 상태"입니다.

     

    [root@linux220 ~]# which gcc
    /usr/bin/gcc
    [root@linux220 ~]# which gfrotran
    /usr/bin/which: no gfrotran in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)

     

    • [2 단계] gfortran 설치

      • "http://hpc.sourceforge.net"에서 "gfortran-9.2-bin.tar.gz"다운로드합니다.

      • "gfortran-9.2-bin.tar.gz""gfortran-9.2-bin.tar"로 압축 해제합니다.

      • "tar -xvf gfortran-5.0-bin.tar -C /"를 통해 압축 풀고 상위 디렉터리 이동합니다.

      • 설치 경로를 확인합니다.

     

     

    High Performance Computing for Mac OS X

    If you'd like to use your Apple Mac with OS X for some numerical computation, this site could be useful to you. Most of these packages have been compiled/tested on several version of OS X and XCode Tools. Feel free to contact me with questions or problems!

    hpc.sourceforge.net

     

    [root@linux220 Install]# gunzip gfortran-9.2-bin.tar.gz
    
    [root@linux220 Install]# tar -xvf gfortran-5.0-bin.tar -C /
    
    [root@linux220 Install]# gfortran -v
    Using built-in specs.
    COLLECT_GCC=gfortran
    COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
    Target: x86_64-redhat-linux
    Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
    Thread model: posix
    gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) 
    
    [root@linux220 Install]# gcc -v
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
    Target: x86_64-redhat-linux
    Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
    Thread model: posix
    gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)

     

    • [3 단계] NCL 설치

      • "http://www.ncl.ucar.edu/Download/list_of_binaries.shtml"에서 "ncl_ncarg-6.6.2"를 다운로드합니다.

      • "/usr/local/ncl-6.62" 디렉터리를 생성합니다.

      • "ncl_ncarg-6.6.2-CentOS7.6_64bit_gnu485.tar.gz" "/usr/local/ncl-6.6.2" 상위 디렉터리 이동합니다.

      • 현재 작업환경을 "/usr/local/ncl-6.6.2" 상위 디렉터리로 변경합니다.

      • "ncl_ncarg-6.6.2-CentOS7.6_64bit_gnu485.tar.gz"를 압축 해제합니다.

     

     

    List of binaries available for NCL version 6.6.2

    NCL > Download List of binaries available for NCL version 6.6.2 This is a full list of all the available precompiled binaries for NCL version 6.6.2 that are hosted on the Climate Data Gateway. If you don't see an appropriate binary for your system, then yo

    www.ncl.ucar.edu

     

    [root@linux220 ncl-6.6.2]# mkdir /usr/local/ncl-6.6.2
    
    [root@linux220 ncl-6.6.2]# mv ncl_ncarg-6.6.2-CentOS7.6_64bit_gnu485.tar.gz /usr/local/ncl-6.6.2
    
    [root@linux220 ncl-6.6.2]# cd /usr/local/ncl-6.6.2
    
    [root@linux220 ncl-6.6.2]# tar -zxf ncl_ncarg-6.6.2-CentOS7.6_64bit_gnu485.tar.gz

     

    • "Permission denied" 경고가 표시되면 sudo를 접두어로 추가하시면 됩니다.

     

    [root@linux220 ncl-6.6.2]# sudo mkdir /usr/local/ncl-6.6.2
    
    [root@linux220 ncl-6.6.2]# sudo mv ncl_ncarg-6.6.2-CentOS7.6_64bit_gnu485.tar.gz /usr/local/ncl-6.6.2
    
    [root@linux220 ncl-6.6.2]# sudo cd /usr/local/ncl-6.6.2
    
    [root@linux220 ncl-6.6.2]# sudo tar -zxf ncl_ncarg-6.6.2-CentOS7.6_64bit_gnu485.tar.gz

     

    • [4 단계] 환경 변수 설정

      • 프롬프트 상에서 "which ncl"을 입력해도 확인할 수 없습니다.

      • 이는 리눅스 환경에서 NCL 설치 폴더를 찾을 수 없기 때문입니다.

      • 따라서 "vi ~/.bash_profile"에서 "NCARG_ROOT""PATH" 환경 변수를 입력합니다.

      • "source ~/.bashrc"를 통해 재 실행합니다.

      • 환경 변수 및 NCL 설치 경로를 확인합니다.

     

    [root@linux220 ncl-6.6.2]# which ncl
    /usr/bin/which: no ncl in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)

     

    [root@linux220 ncl-6.6.2]# vi ~/.bashrc
    
    #==========================================
    #  Configure
    #==========================================
    export NCARG_ROOT=/usr/local/ncl-6.6.2
    export PATH=$NCARG_ROOT/bin:$PATH
    

     

    [root@linux220 ncl-6.6.2]# echo $NCARG_ROOT
    /usr/local/ncl-6.6.2
    
    [root@linux220 ncl-6.6.2]# which ncl
    /usr/local/ncl-6.6.2/bin/ncl
    
    [root@linux220 ncl-6.6.2]# ncl
     Copyright (C) 1995-2019 - All Rights Reserved
     University Corporation for Atmospheric Research
     NCAR Command Language Version 6.6.2
     The use of this software is governed by a License Agreement.
     See http://www.ncl.ucar.edu/ for more details.
    ncl 0> 
    

     

     참고 문헌

    [논문]

    • 없음

    [보고서]

    • 없음

    [URL]

    • 없음

     

     문의사항

    [기상학/프로그래밍 언어]

    • sangho.lee.1990@gmail.com

    [해양학/천문학/빅데이터]

    • saimang0804@gmail.com
    반응형
    • 네이버 블러그 공유하기
    • 네이버 밴드에 공유하기
    • 페이스북 공유하기
    • 카카오스토리 공유하기