我要评分
获取效率
正确性
完整性
易理解

Installing HDF

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Obtain the source package.
    wget https://download-ib01.fedoraproject.org/pub/epel/8/Everything/SRPMS/Packages/h/hdf-4.2.14-5.el8.src.rpm
  3. Install the source package.
    rpm -ivh hdf-4.2.14-5.el8.src.rpm
  4. Go to the directory of the executable file.
    cd /root/rpmbuild/SPECS/
  5. Modify the hdf.spec file.
    1. Open the hdf.spec file.
      vi hdf.spec
    2. Press i to enter the edit mode.

      Add the following content to line 4:

      %define debug_package %{nil}

      Add -fPIC to line 133.

      After performing 5.a, press Esc, type :set nu, and press Enter to display the line number.

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  6. Modify the compilation configuration file in the source package in the SOURCES directory.
    1. Open the compilation configuration file.
      cd /root/rpmbuild/SOURCES/
      tar -xvf hdf-4.2.14.tar.bz2
      vim hdf-4.2.14/config/linux-gnu
    2. Press i to enter the edit mode and modify the content in lines 24, 25, 29, and 30.

      After performing 6.a, press Esc, type :set nu, and press Enter to display the line number.

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  7. Compress the source package again.
    rm -rf hdf-4.2.14.tar.bz2
    tar -zcvf hdf-4.2.14.tar.bz2 hdf-4.2.14
    rm -rf hdf-4.2.14
  8. Go to the SPECS directory.
    cd /root/rpmbuild/SPECS/
  9. Package the file.
    rpmbuild -ba hdf.spec

    If an error is reported in this step, the dependency RPM package is missing when building the HDF package. If the required RPM package has been installed, this error does not occur and please ignore 9 and 10. If the required RPM package has not been installed, install it by performing 9 and 10. The required dependency packages may vary depending on the environment. Perform 9 based on the site requirements.

  10. Install the dependencies using the yum command.
    yum install hamcrest javapackages-tools junit libaec-devel libjpeg-devel libtirpc-devel slf4j
  11. Install the RPM package of the specified Java version.

    Install the Java package of the version specified in 10. If the version is too late, a compatibility problem may occur.

    yum install java-1.8.0-openjdk-devel
  12. Compile and package the file.
    rpmbuild -ba hdf.spec
  13. Go to the installation package directory.
    cd /root/rpmbuild/RPMS/aarch64
  14. Install HDF.
    yum install hdf-4.2.14-5.aarch64.rpm hdf-devel-4.2.14-5.aarch64.rpm hdf-static-4.2.14-5.aarch64.rpm java-hdf-4.2.14-5.aarch64.rpm