当前位置: 首页 > 工具软件 > Starman > 使用案例 >

CentOS安装netcdf —— Starman

周翰池
2023-12-01

Starman为董博编写,专注于HPC的使用,带来更优的环境搭建体验。

  • 安装Starman前需要提前安装Ruby 与 lbzip2 (sudo yum install lbzip2
  • 需要提前安装gcc(yum install gcc)、g++(yum install gcc-c++ )、gfortran(yum install gcc-gfortran)编译器(安装很简单,最终使用which gccwhich g++which gfortran均能找到路径即可)
  • 建议您和我一样,切换至root用户完成下列操作。
  1. 获取Starman, Starman可以安装在任何位置
# git clone https://github.com/dongli/starman
  1. 把starman/setup/bashrc文件夹添加至环境变量(root用户添加至 /etc/profile, 普通用户添加至~/.bash_profile)
    source <path_to_starman_setup_bashrc_file>
    如:source ~/starman/setup/bashrc

  2. 运行setup命令启动starman

# starman setup --install-root <where_you_want_to_put_installed_software> \
--rc-root <where_store_config_and_db_files> \
--cache-root <where_store_packages_and_temporary_files>
  1. 配置starman
# starman config
  • gcc --version看一下gcc,g++,gfortran的版本,如果不是4.8.5,则需要修改下面的版本号
  • 把下面这段拷贝进去
  • 最上面的三个横线要保留,install_rootcache_root应该是提前有的
---
install_root: /opt/software
cache_root: /tmp/starman
defaults:
  compiler_set: gcc_4.8.5
compiler_sets:
  gcc_4.8.5:
    c: /usr/bin/gcc
    cxx: /usr/bin/g++
    fortran: /usr/bin/gfortran
  1. 安装netcdf
# starman install netcdf
  • 我在阿里云中提示缺少lbzip2,安装完lbzip2后成功。
  • 我在我的个人电脑里提示curl(33),使用shadowsocks修改网络环境后成功。
  1. 加载包

在环境变量里(/etc/profile)添加

starman load netcdf@4.6.0

重载环境(/etc/profile

  1. 检验
# which ncdump

成功找到目录即成功

  1. 删除
starman uninstall netcdf
 类似资料: