Computer Setup
[Cygwin] hdf5 w/ gfortran 설치하기
astrodoo
2019. 4. 5. 02:15
우선 hdf5 소스파일을 다운받는다.
https://portal.hdfgroup.org/display/support/Downloads
압축을 풀고,
아래의 순서와 같이 설치하면 된다.
1)
> export FC=gfortran
> ./configure --enable-fortran --prefix=hdf_install_directory
2)
> make
> make check (optional)
3)
> make install
이때 --prefix 로 설정된 폴더에 hdf5 가 생성되고 그 안에는
lib
include
bin
share
서브폴더들이 설치된다.
4)
.bashrc 에서 path에 위의 bin 폴더를 추가한다.
ex) export PATH=hdf_install_directory/bin:$PATH
bin folder 안에는 h5fc 가 있는데, 이 명령어는 include 와 library 를 자동 연결해 주므로
편리하게 쓸 수 있다.
ex)
> h5fc test_hdf5.f90
이는 다음의 명령과 같다
> gfortran test_hdf5.f90 -I hdf_install_directory/include -L hdf_install_directory/lib -l:libhdf5_fortran.dll.a