Mu博分享 http://blog.sciencenet.cn/u/ywmucn https://blog.nanomat.top/

博文

用ifort编译gulp

已有 6131 次阅读 2012-12-10 12:59 |个人分类:gulp|系统分类:科研笔记

% tar -xvf gulp.4.0.source.tar.gz
%cd Src
% vi getmachine
打开getmachine文件,找到以下部分
# This is Linux with f90. cdabs.f contains the cdabs function
# which is missing in the f2c library
#
  Linux)   dir="${os}\${debug}"
  makedir
  if [ "\$debug" = "" ]
  then
# PG compiler
#       echo 'OPT=-fast' > makefile
#       echo 'OPT1=-O1' >> makefile
# Intel compiler
      echo 'OPT=-O3 -mp1 ' > makefile
      echo 'OPT1=-O1' >> makefile
      echo 'OPT2=-O3 -mp1 ' >> makefile
# Absoft compiler
#       echo 'OPT=-O' > makefile
#       echo 'OPT1=-O' >> makefile
#  g95
#       echo 'OPT=-O ' > makefile
#       echo 'OPT1=' >> makefile
#       echo 'OPT2=-ffloat-store' >> makefile
#       echo 'BAGGER=' >> makefile
  else
      echo 'OPT=' > makefile
#  g95
      echo 'OPT2=-ffloat-store' >> makefile
               echo 'BAGGER=-g -Wall' >> makefile
#               echo 'BAGGER=-g ' >> makefile
  fi
           target=\${1}_
# PG compiler
#     echo 'RUNF90=pgf90 -Bstatic' >> makefile
# Intel compiler
    echo 'RUNF90=ifort ' >> makefile
           echo 'RUNCC=icc ' >> makefile
# Absoft compiler
#           echo 'RUNF90=f90' >> makefile
# g95
#           echo 'RUNF90=g95 ' >> makefile
#           echo 'RUNCC=gcc ' >> makefile
# PG compiler
#   echo 'FFLAGS=-I.. ' >> makefile
#   echo 'LIBS=' >> makefile
# Intel compiler
  echo 'FFLAGS=-I.. ' >> makefile
  echo 'LIBS=' >> makefile
  echo 'CFLAGS=-I.. ' >> makefile
# Absoft compiler
#           echo 'FFLAGS=-I.. -B18 ' >> makefile
#           echo 'LIBS=-lblas -lU77' >> makefile
#  g95
#          echo 'FFLAGS=-I.. ' >> makefile
#
           echo 'CFLAGS=-ansi ' >> makefile
# PG compiler
#   echo 'LDFLAGS=-Bstatic' >> makefile
# Intel compiler
    echo 'LDFLAGS=-static' >> makefile
# g95
#   echo 'LDFLAGS=' >> makefile
#
# General options
#
           echo 'ETIME=' >> makefile
           echo 'BLAS=blas.o' >> makefile
# for chemshell use, we should have lapack so comment the following line out
           echo 'LAPACK=lapack.o' >> makefile
           echo 'GULPENV=' >> makefile
  echo 'CDABS=cdabs.o' >> makefile
# If PLUMED is needed then set -DPLUMED
#           echo 'DEFS=-DFLUSH -DPLUMED' >> makefile
           echo 'DEFS=-DFLUSH '  >> makefile
           echo 'PLUMEDDEFS=-DDL_POLY' >> makefile
           echo 'ARCHIVE = ar rcv' >> makefile
           echo 'RANLIB = ar ts' >> makefile
           ;;
#
-------------------------------------------------------------
上面是使用ifort编译器编译单线程gulp的的配置,就是将g95的相关选项注释掉(加#),将Intel编译器相关选项前面的#去掉.
若是要并行编译,将
1)echo 'RUNF90=ifort ' >> makefile 改为
  echo 'RUNF90=mpif90 ' >> makefile
2) echo 'LDFLAGS=-static' >> makefile  改为
   echo 'LDFLAGS=' >> makefile 
3)echo 'DEFS=-DFLUSH '  >> makefile 改为
   echo 'DEFS=-DFLUSH  -DMPI'  >> makefile 
-------------------------------------------------------
然后 make


https://blog.sciencenet.cn/blog-588243-641158.html

上一篇:晶体对称性的判断
下一篇:山西大学邮箱在android手机上收发设置
收藏 IP: 202.207.214.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-12-26 22:10

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部