#!/bin/bash

install_version=${1:-"1.12.0"}
package_name="hdf5-${install_version}"

# Download
cd /tmp
rm -f ${package_name}.tar.gz
wget https://tools.mindspore.cn/tools/ci/hdf5/${package_name}/${package_name}.tar.gz
rm -rf ${package_name}
tar -zxf ${package_name}.tar.gz

# Install
cd /tmp/${package_name}
./configure --prefix=/usr/local
make -j16
make install
cd ..

# Delete package
rm -f /tmp/${package_name}.tar.gz
rm -rf /tmp/${package_name}
