리눅스

LINUX : netCDF - fortran 설치하기

이석사 중 2023. 6. 13. 02:27
728x90

다음은 netCDF - fortran입니다


cd $HOME/WRF/Downloads
tar -xvzf netcdf-fortran-4.6.0.tar.gz
cd netcdf-fortran-4.6.0/
export LD_LIBRARY_PATH=$DIR/lib:$LD_LIBRARY_PATH
export CPPFLAGS=-I$DIR/include 
export LDFLAGS=-L$DIR/lib
export LIBS="-lnetcdf -lhdf5_hl -lhdf5 -lz" 
./configure --prefix=$DIR --disable-shared
make check
make install

역시 압축해제부터 사직합니다

netcdf-fortran-4.6.0/libsrc/
netcdf-fortran-4.6.0/libsrc/Makefile.am
netcdf-fortran-4.6.0/libsrc/CMakeLists.txt
netcdf-fortran-4.6.0/libsrc/Makefile.in
netcdf-fortran-4.6.0/missing
netcdf-fortran-4.6.0/config.guess
(base) lsh@DESKTOP-8N2HJ5V:~/WRF/Downloads$

 

그리고 환경 변수 선언부터 해주시면 됩니다

export LD_LIBRARY_PATH=$DIR/lib:$LD_LIBRARY_PATH
export CPPFLAGS=-I$DIR/include 
export LDFLAGS=-L$DIR/lib
export LIBS="-lnetcdf -lhdf5_hl -lhdf5 -lz"

그리고 ./configure를 해주시면 됩니다

 

./configure를 진행하면 앞에와 비슷하게 summary가 나옵니다

# NetCDF Fortran Configuration Summary
==============================

# General
-------
Library Version:                4.6.0
Configured On:                  Tue Jun 13 02:23:57 KST 2023
Host System:                    x86_64-pc-linux-gnu
Build Directory:                /home/lsh/WRF/Downloads/netcdf-fortran-4.6.0
Install Prefix:                 /home/lsh/WRF/Library

# Compiling Options
-----------------
Fortran Compiler:               /usr/bin/gfortran
FFLAGS:                         -g -O2 -fallow-argument-mismatch
LDFLAGS:                        -L/home/lsh/WRF/Library/lib
C Compiler:                     gcc
CPPFLAGS:                       -I/home/lsh/WRF/Library/include
CFLAGS:                         -g -O2 -DLONGLONG_IS_LONG
Shared Library:                 no
Static Library:                 yes
Extra libraries:                -lm -lnetcdf -lhdf5_hl -lhdf5 -lz

# Features
--------
F03:                            yes
Dap Support:                    no
Logging Support:                yes
NetCDF-2 API:                   yes
NetCDF-4 API:                   yes
CDF5 Support:                   yes
Parallel IO:                    no
NetCDF4 Parallel IO:            no
PnetCDF Parallel IO:            no
SZIP Write Support:             no
Zstandard Support:              no
Quantize:                       yes
(base) lsh@DESKTOP-8N2HJ5V:~/WRF/Downloads/netcdf-fortran-4.6.0$

이렇게 출력이 되면 됩니다

 

 

make check를 해주시면 앞에와는 다르게 2개 중에 2개가 다 성공했다고 나옵니다

============================================================================
Testsuite summary for netCDF-Fortran 4.6.0
============================================================================
# TOTAL: 2
# PASS:  2
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make[5]: Leaving directory '/home/lsh/WRF/Downloads/netcdf-fortran-4.6.0/examples/F90'
make[4]: Leaving directory '/home/lsh/WRF/Downloads/netcdf-fortran-4.6.0/examples/F90'
make[3]: Leaving directory '/home/lsh/WRF/Downloads/netcdf-fortran-4.6.0/examples/F90'
make[2]: Leaving directory '/home/lsh/WRF/Downloads/netcdf-fortran-4.6.0/examples/F90'
make[2]: Entering directory '/home/lsh/WRF/Downloads/netcdf-fortran-4.6.0/examples'
make[2]: Nothing to be done for 'check-am'.
make[2]: Leaving directory '/home/lsh/WRF/Downloads/netcdf-fortran-4.6.0/examples'
make[1]: Leaving directory '/home/lsh/WRF/Downloads/netcdf-fortran-4.6.0/examples'
Making check in CMakeExtras
make[1]: Entering directory '/home/lsh/WRF/Downloads/netcdf-fortran-4.6.0/CMakeExtras'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/lsh/WRF/Downloads/netcdf-fortran-4.6.0/CMakeExtras'
make[1]: Entering directory '/home/lsh/WRF/Downloads/netcdf-fortran-4.6.0'
make[1]: Nothing to be done for 'check-am'.
make[1]: Leaving directory '/home/lsh/WRF/Downloads/netcdf-fortran-4.6.0'
(base) lsh@DESKTOP-8N2HJ5V:~/WRF/Downloads/netcdf-fortran-4.6.0$

 

 

그리고 마지막으로 make instasll을 진행해주시면 됩니다

+-------------------------------------------------------------+
| Congratulations! You have successfully installed the netCDF |
| Fortran libraries.                                          |
|                                                             |
| You can use script "nf-config" to find out the relevant     |
| compiler options to build your application. Enter           |
|                                                             |
|     nf-config --help                                        |
|                                                             |
| for additional information.                                 |
|                                                             |
| CAUTION:                                                    |
|                                                             |
| If you have not already run "make check", then we strongly  |
| recommend you do so. It does not take very long.            |
|                                                             |
| Before using netCDF to store important data, test your      |
| build with "make check".                                    |
|                                                             |
| NetCDF is tested nightly on many platforms at Unidata       |
| but your platform is probably different in some ways.       |
|                                                             |
| If any tests fail, please see the netCDF web site:          |
| https://www.unidata.ucar.edu/software/netcdf/                |
|                                                             |
| NetCDF is developed and maintained at the Unidata Program   |
| Center. Unidata provides a broad array of data and software |
| tools for use in geoscience education and research.         |
| https://www.unidata.ucar.edu                                 |
+-------------------------------------------------------------+

make[3]: Leaving directory '/home/lsh/WRF/Downloads/netcdf-fortran-4.6.0'
make[2]: Leaving directory '/home/lsh/WRF/Downloads/netcdf-fortran-4.6.0'
make[1]: Leaving directory '/home/lsh/WRF/Downloads/netcdf-fortran-4.6.0'
(base) lsh@DESKTOP-8N2HJ5V:~/WRF/Downloads/netcdf-fortran-4.6.0$

똑같이 이 화면까지 보시면 설치가 완료된겁니다

728x90

'리눅스' 카테고리의 다른 글

LINUX : libpng 설치하기  (0) 2023.06.13
LINUX : MPICH 설치하기  (0) 2023.06.13
LINUX : netCDF - C 설치하기  (0) 2023.06.13
LINUX : HDF5 설치하기  (0) 2023.06.12
LINUX : zlib 설치하기  (0) 2023.06.12