linux升级gfortran,gfortran编译cp2k4.1

linux升级gfortran,gfortran编译cp2k4.1大部分安装包可以在 https www cp2k org static downloads 找到 其它的可以去官网自行下载 https www cndba cn shuye100 article 1723 操作系统版本 RedHatEnterp 3 Maipo root cp2kLinux x86 64 gfortran gc

大部分安装包可以在https://www.cp2k.org/static/downloads/找到,其它的可以去官网自行下载。https://www.cndba.cn/shuye100/article/1723

操作系统版本:Red Hat Enterprise Linux Server release 7.3 (Maipo)

[root@cp2k Linux-x86-64-gfortran]# gcc -v

Using built-in specs.

COLLECT_GCC=gcc

COLLECT_LTO_WRAPPER=/opt/gcc/libexec/gcc/x86_64-pc-linux-gnu/6.3.0/lto-wrapper

Target: x86_64-pc-linux-gnu

Configured with: ./configure –prefix=/opt/gcc –enable-languages=c,c++,fortran –disable-multilib

Thread model: posix

gcc version 6.3.0 (GCC)

安装gcc

./contrib/download_prerequisites

./configure –prefix=/opt/gcc –enable-languages=c,c++,fortran –disable-multilib

https://www.cndba.cn/shuye100/article/1723

需要把对应的文件做成软连接,建议把之前的重命名一下,如下:

ln -s /opt/gcc/bin/gfortran /bin/gfortran

安装libint

./configure –prefix=/opt/libint –with-ar=ar FC=gfortran F77=gfortran F90=gfortran CC=gcc

安装acml5.3.1

http://developer.amd.com/tools-and-sdks/archive/compute/amd-core-math-library-acml/acml-downloads-resources/#download

解压后执行如下脚本:

./install-acml-5-3-1-gfortran-64bit.sh

安装fftw

https://www.cndba.cn/shuye100/article/1723

./configure –prefix=/opt/fftw CC=gcc FC=gfortran F77=gfortran –enable-threads –enable-shared=yes

安装libxc

./configure –prefix=/opt/libxc/ AR=ar FC=gfortran F77=gfortran F90=gfortran CC=gcc

安装lapack

cp make.inc.example make.inc

make blaslib

make lapacklib

vi make.inc

# LAPACK make include file. #

# LAPACK, Version 3.5.0 #

# November 2013 #

#

SHELL = /bin/sh

#

# Modify the FORTRAN and OPTS definitions to refer to the

# compiler and desired compiler options for your machine. NOOPT

# refers to the compiler options desired when NO OPTIMIZATION is

# selected. Define LOADER and LOADOPTS to refer to the loader and

# desired load options for your machine.

#

FORTRAN = gfortran

OPTS = -O2 -frecursive

DRVOPTS = $(OPTS)

NOOPT = -O0 -frecursive

LOADER = gfortran

LOADOPTS =

#

# Timer for the SECOND and DSECND routines

#

# Default : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME

#TIMER = EXT_ETIME

# For RS6K : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME_

# TIMER = EXT_ETIME_

# For gfortran compiler: SECOND and DSECND will use a call to the INTERNAL FUNCTION ETIME

TIMER = INT_ETIME

# If your Fortran compiler does not provide etime (like Nag Fortran Compiler, etc…)

# SECOND and DSECND will use a call to the INTERNAL FUNCTION CPU_TIME

# TIMER = INT_CPU_TIME

# If neither of this works…you can use the NONE value… In that case, SECOND and DSECND will always return 0

# TIMER = NONE

#

# Configuration LAPACKE: Native C interface to LAPACK

# To generate LAPACKE library: type ‘make lapackelib’

# Configuration file: turned off (default)

# Complex types: C99 (default)

# Name pattern: mixed case (default)

# (64-bit) Data model: LP64 (default)

#

# CC is the C compiler, normally invoked with options CFLAGS.

#

CC = gcc

CFLAGS = -O3

#

# The archiver and the flag(s) to use when building archive (library)

# If you system has no ranlib, set RANLIB = echo.

#

ARCH = ar

ARCHFLAGS= cr

RANLIB = ranlib

#

# Location of the extended-precision BLAS (XBLAS) Fortran library

# used for building and testing extended-precision routines. The

# relevant routines will be compiled and XBLAS will be linked only if

# USEXBLAS is defined.

#

# USEXBLAS = Yes

XBLASLIB =

# XBLASLIB = -lxblas

#

# The location of the libraries to which you will link. (The

# machine-specific, optimized BLAS library should be used whenever

# possible.)

#

BLASLIB = ../../librefblas.a

LAPACKLIB = liblapack.a

TMGLIB = libtmglib.a

LAPACKELIB = liblapacke.a

会生成librefblas.a liblapack.a

安装scalapack

cp SLmake.inc.example SLmake.inc

makevi SLmake.inc

#

#

# Program: ScaLAPACK

#

# Module: SLmake.inc

#

# Purpose: Top-level Definitions

#

# Creation date: February 15, 2000

#

# Modified: October 13, 2011

#

# Send bug reports, comments or suggestions to

#

#

#

# C preprocessor definitions: set CDEFS to one of the following:

#

# -DNoChange (fortran subprogram names are lower case without any suffix)

# -DUpCase (fortran subprogram names are upper case without any suffix)

# -DAdd_ (fortran subprogram names are lower case with “_” appended)

CDEFS = -DAdd_

#

# The fortran and C compilers, loaders, and their flags

#

FC = mpif90

CC = mpicc

NOOPT = -O0

FCFLAGS = -O3

CCFLAGS = -O3

FCLOADER = $(FC)

CCLOADER = $(CC)

FCLOADFLAGS = $(FCFLAGS)

CCLOADFLAGS = $(CCFLAGS)

#

# The archiver and the flag(s) to use when building archive (library)

# Also the ranlib routine. If your system has no ranlib, set RANLIB = echo

#

ARCH = ar

ARCHFLAGS = cr

RANLIB = ranlib

#

# The name of the ScaLAPACK library to be created

#

SCALAPACKLIB = libscalapack.a

#

# BLAS, LAPACK (and possibly other) libraries needed for linking test programs

#

BLASLIB = /opt/lapack/librefblas.a

LAPACKLIB = /opt/lapack/liblapack.a

LIBS = $(LAPACKLIB) $(BLASLIB)

安装openmpi

./configure –prefix=/opt/openmpi CC=gcc FC=gfortran F77=gfortran

安装mpich3

./configure –prefix=/opt/mpich3 –enable-cxx F77=gfortran FC=gfortran FCFLAGS=”-O2 -xHost” FFLAGS=”-O2 -xHost” CC=gcc CXX=g++ CFLAGS=”-O2 –xHost” CXXFLAGS=”-O2 -xHost” –enable-threads=multiple –enable-fast=all –enable-mpit-pvars=all

编辑环境变量/etc/profile

export PATH=$PATH:/opt/mpich3/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ mpich3/lib

https://www.cndba.cn/shuye100/article/1723

https://www.cndba.cn/shuye100/article/1723

source /etc/profile

安装cp2k41

vi *.ssmp

4d6230b9a8d70da4f4109678fca1348b.png

https://www.cndba.cn/shuye100/article/1723

make -j 8 ARCH=Linux-x86-64-gfortran VERSION=psmp

6e367aeb677a4a4351f58d6a1e46c109.png

最后会在~/cp2k-4.1/exe/Linux-x86-64-gfortran/目录下面生成N多个psmp文件包含cp2k.psmp

刚刚开始写博客,也得不清楚或有问题的地方还请多多指正,:

版权声明:本文为博主原创文章,未经博主允许不得转载。

hpc cp2k

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/217692.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月18日 上午8:59
下一篇 2026年3月18日 上午8:59


相关推荐

  • 安卓手机上超好用的4款C语言IDE(附下载地址)

    安卓手机上超好用的4款C语言IDE(附下载地址)**如果找不到这几款编译器的可以联系我,我发给你QQ:1873564884**电脑有时太麻烦,不方便随时运行测试结果,手机上有不少编译器,子曰:“工欲善其事,必先利其器”。拥有一款好的编译器也是成功的一部分。话不多说让我们来看看。1:C4droid汉化版这款相信大家一定听说过,毕竟我原来也用过,感觉很菜,点击编译后没反应,上网查找说要安装gcc插件,而且要自己要自己找安装目…

    2022年5月6日
    155
  • 月之暗面Kimi推出Kimi-Researcher深度研究Agent 并开启内测

    月之暗面Kimi推出Kimi-Researcher深度研究Agent 并开启内测

    2026年3月12日
    4
  • 两数之和c语言实现[通俗易懂]

    两数之和c语言实现[通俗易懂]int*twoSum(int*nums,intnumsSize,inttarget,int*returnSize){inti=0,j=0;*returnSize=2;int*a=(int*)malloc(sizeof(int)*2);for(i=0;i<numsSize;i++)…

    2022年6月13日
    33
  • 【低功耗蓝牙】⑤ 蓝牙HID协议

    【低功耗蓝牙】⑤ 蓝牙HID协议摘要本文章主要介绍了蓝牙 HID 协议的实现方法 基于 ESP32 平台实现了蓝牙键盘 蓝牙鼠标 蓝牙自拍杆和蓝牙游戏手柄等设备 是初学者学习 BLEHID 协议很好的参考文章 HID 设备 HID HumanInterfa 人体学接口设备 是生活中常见的输入设备 比如键盘鼠标游戏手柄等等 早期的 HID 是设备大部分都是通过 USB 接口来实现 蓝牙技术出现后 通过蓝牙作为传输层 实现了无线 HID 设备 通过低功耗蓝牙实现的 HID 功能一般简称为 HOGP HIDoverGattP

    2026年3月17日
    2
  • 解决keil注册机在win10无法打开问题[通俗易懂]

    解决keil注册机在win10无法打开问题[通俗易懂]解决keil注册机在win10无法打开问题刚开始笔者先以管理员模式打开,无效,弹出一个弹窗说为病毒文件以下提供一种解决办法,亲测有效就是安全模式里打开注册机详细做法如下:首先在设置——》恢复——》高级启动——》立即重新启动重启后,选择疑难解答——》高级选项——》启动设置——》重启——》选择4启动安全模式启动后在此模式就可以打开注册机,然后操作注册机后…

    2022年6月9日
    81
  • 文心一言为什么叫ERNIEBOT?揭秘百度AI背后的命名逻辑!

    文心一言为什么叫ERNIEBOT?揭秘百度AI背后的命名逻辑!

    2026年3月12日
    2

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号