操作
機能 #16
完了NetCDF 4.3.2をCentOS 6でRPM化
開始日:
2014/08/08
期日:
進捗率:
100%
予定工数:
ファイル
高橋 徹 さんがほぼ11年前に更新
- ファイル netcdf.spec netcdf.spec を追加
netcdf-4.3.2のRPMビルド用SPECファイルを作成したので添付
- 今回はサブパッケージは作らず(netcdfとnetcdf-develのような)、1つですべてを含むパッケージとしました
- configureのオプションは指定なし
高橋 徹 さんがほぼ11年前に更新
NetCDFサイトの次の文書の"Building with NetCDF-4 and the Remote Data Client"から要点を整理
http://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html
- HDF5、zlib、curl
- オプションでszlib
- それぞれバージョンは、HDF5 1.8.8+、zlib 1.2.5+、curl 7.18.0+、szip 2.0+
- HDF5 1.8.5 (epelより)
- zlib 1.2.3 (CentOS 6標準)
- curl 7.19.7
ビルドは、configure, make, make test, make install
CMakeにも対応
- リモートデータアクセス(OPeNDAPプロトコル)を使わないなら
--disable-dap
高橋 徹 さんがほぼ11年前に更新
netcdf-4.3.2のビルド時にmake checkを行うと、テストを実施します。
結果
# TOTAL: 39 # PASS: 37 # SKIP: 0 # XFAIL: 0 # FAIL: 2 # XPASS: 0 # ERROR: 0
FAILしたテストは次
FAIL: tst_h_scalar FAIL: tst_h_scalar.sh
エラー詳細は
FAIL: tst_h_scalar ================== HDF5-DIAG: Error detected in HDF5 (1.8.5-patch1) thread 0: #000: ../../src/H5T.c line 1597 in H5Tcreate(): unable to create type major: Datatype minor: Unable to initialize object #001: ../../src/H5T.c line 2985 in H5T_create(): type class is not appropriate - use H5Tcopy() :(略)
unidata.ncar.eduのメーリングリストアーカイブに同じ問題がありました。
http://www.unidata.ucar.edu/support/help/MailArchives/netcdf/msg12368.html
- 結論「もっと最新のHDF5を使う必要がある」
高橋 徹 さんがほぼ11年前に更新
- ファイル netcdf.spec netcdf.spec を追加
#17 のチケットで入手したhdf5-1.8.13のRPMをインストールして、その上で再度NetCDFのRPMを作成します。
hdf5のパッケージ名が変わったので、SPECファイルを修正します。
--- netcdf-4.3.2-1.spec 2014-08-09 08:29:25.208612000 +0900
+++ netcdf.spec 2014-08-09 09:56:26.133704800 +0900
@@ -8,11 +8,11 @@
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-BuildRequires: hdf5-devel >= 1.8.4
+BuildRequires: hdf5 >= 1.8.8
BuildRequires: libcurl-devel
BuildRequires: zlib-devel
-Requires: hdf5
+Requires: hdf5 >= 1.8.8
Requires: libcurl
Requires: zlib
高橋 徹 さんがほぼ11年前に更新
- ファイル netcdf-4.3.2-1.el6.x86_64.rpm netcdf-4.3.2-1.el6.x86_64.rpm を追加
- ステータス を 進行中 から 解決 に変更
- 進捗率 を 50 から 80 に変更
作業完了とする。
高橋 徹 さんがほぼ11年前に更新
- ファイル netcdf.spec netcdf.spec を追加
- ステータス を 解決 から 進行中 に変更
- 進捗率 を 80 から 50 に変更
epelリポジトリのhdf5、netcdfと共存をできるようにするには、このパッケージを/usr以外の場所にインストールできるようリロケータブルに作成する必要があります。
現状では、
$ sudo rpm -ihv --prefix=/opt/local netcdf-4.3.2-1.el6.x86_64.rpm エラー: パッケージ netcdf は再配置できません。
となってしまうので、SPECファイルを修正してrpmbuildし直します。
--- netcdf.spec.1 2014-08-13 04:01:44.531900600 +0900
+++ netcdf.spec 2014-08-13 04:02:11.454937900 +0900
@@ -1,12 +1,13 @@
Summary: Libraries for the Unidata network Common Data Form
Name: netcdf
Version: 4.3.2
-Release: 1%{?dist}
+Release: 2%{?dist}
License: NetCDF
Group: Applications/Engineering
URL: http://www.unidata.ucar.edu/software/netcdf/
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+Prefix: /usr
BuildRequires: hdf5 >= 1.8.8
BuildRequires: libcurl-devel
- 備考)rpmコマンドのオプションで強制的に再配置することができました。
$ sudo rpm -ihv --relocate /usr=/opt/local --badreloc netcdf-4.3.2-1.el6.x86_64.rpm
操作