プロジェクト

全般

プロフィール

機能 #16

完了

NetCDF 4.3.2をCentOS 6でRPM化

高橋 徹 さんがほぼ11年前に追加. ほぼ11年前に更新.

ステータス:
終了
優先度:
通常
担当者:
カテゴリ:
-
対象バージョン:
-
開始日:
2014/08/08
期日:
進捗率:

100%

予定工数:

説明

http://www.unidata.ucar.edu/downloads/netcdf/index.jsp
のNetCDF C言語用ライブラリをCentOS 6用にRPM化する。


ファイル

netcdf.spec (2.06 KB) netcdf.spec NetCDF 4.3.2のRPMスペックファイル 高橋 徹, 2014/08/09 08:30
netcdf.spec (2.07 KB) netcdf.spec HDF5 1.8.13に依存したNetCDF 4.3.2スペックファイル 高橋 徹, 2014/08/09 09:59
netcdf-4.3.2-1.el6.x86_64.rpm (792 KB) netcdf-4.3.2-1.el6.x86_64.rpm 高橋 徹, 2014/08/09 10:04
netcdf.spec (2.17 KB) netcdf.spec 再配置可能な設定を追記、バージョンを4.3.2-2に更新 高橋 徹, 2014/08/13 04:03

関連するチケット 1 (0件未完了1件完了)

関連している 機能 #17: HDF5 1.8.13をCentOS 6でRPM化終了高橋 徹2014/08/09

操作

高橋 徹 さんがほぼ11年前に更新

  • ステータス新規 から 進行中 に変更
  • 進捗率0 から 50 に変更

NetCDF 4は、HDF 5に依存している。
HDF 5は、szip、zlib、udunit2に依存している。

epelリポジトリから、hdf5-1.8.5patch1-7を入手可能。

$ sudo yum install hdf5-devel

高橋 徹 さんがほぼ11年前に更新

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

netCDFのビルドに必要なもの
  • HDF5、zlib、curl
    • オプションでszlib
    • それぞれバージョンは、HDF5 1.8.8+、zlib 1.2.5+、curl 7.18.0+、szip 2.0+
CentOS 6環境では、
  • 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 4.xのビルド参考記事

高橋 徹 さんがほぼ11年前に更新

  • 関連している 機能 #17: HDF5 1.8.13をCentOS 6でRPM化 を追加

高橋 徹 さんがほぼ11年前に更新

#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年前に更新

作業完了とする。

高橋 徹 さんがほぼ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
    

高橋 徹 さんがほぼ11年前に更新

  • ステータス進行中 から 終了 に変更
  • 進捗率50 から 100 に変更

他の形式にエクスポート: Atom PDF