ocuptus 安装

 

define  <basedir>   你自己的安装路径。

1.BLAS

  • Download the package from the netlib site: http://www.netlib.org/blas/blas.tgz
  • Extract the package and enter into the newly created BLAS directory.
  • Edit the make.inc file and modify the definition of the fortran compiler that now should be:
FORTRAN  = gfortran
OPTS     = -O3 -ffree-line-length-none
DRVOPTS  = $(OPTS)
NOOPT    =
LOADER   = gfortran
LOADOPTS =
  • Now type make to compile, this will take a while.
  • One compilation is finished, create the directory <basedir>/lib
mkdir <basedir>/lib

and copy the file blas_LINUX.a to <basedir>/lib/libblas.a

cp blas_LINUX.a <basedir>/lib/libblas.a

2.

LAPACK

We will use the open source reference implementation of Lapack.

cp make.inc.example make.inc
  • Edit make.inc to indicate the compiler the will be used. The relevant part of the file should look like:
FORTRAN  =  gfortran
OPTS     =  -O3 -ffree-line-length-none
DRVOPTS  = $(OPTS)
NOOPT    =
LOADER   = gfortran
LOADOPTS =
  • Now build the library with
make lib
  • Copy the newly created library lapack_LINUX.a to <basedir>/lib/liblapack.a .
  • 3.

GSL

./configure CC="gcc" --prefix=basedir --disable-shared --enable-static
  • Compile and install:
make
make install

 

4.

FFTW 3

./configure  --prefix=basedir  CC="gcc" CFLAGS="-O3" F77="gfortran" F77FLAGS="-O3 -ffree-line-length-none"

  • Compile and install:
make
make install

LibXC

tar -xvzf libxc-2.2.0.tar.gz
cd libxc-2.2.0
  • Configure:
 ./configure --prefix=basedir CC="gcc" CFLAGS="-O3" FC="gfortran" FCFLAGS="-O3 -ffree-line-length-none"

  • Compile and install:
make
make install

5.

Compilation of Octopus

After compiling the libraries, now we are ready to compile Octopus. These are the steps you have to follow:

export LIBS_BLAS=<basedir>/lib/libblas.a
export LIBS_LAPACK=<basedir>/lib/liblapack.a
export LIBS_FFT=<basedir>/lib/libfftw3.a
  • Now call the configure script:
./configure CC="<cc>" CFLAGS="<cflags>" FC="<fc>" FCFLAGS="<fcflags>" --prefix=<basedir> --with-gsl-prefix=<basedir> --with-libxc-prefix=<basedir>
  • Compile and install
make
make install

7.

Octopus应该会成功安装在你一开始设定的 basedir 文件夹内,可执行文件放在 basedir/bin/ 文件夹内,接下来将其路径添加到环境变量里,以便你可以只输入 octopus 就可运行, 而非 每次都要输入 basedir/bin/octopus 才行。

export PATH=$PATH:basedir/bin/octopus

 8.简单例子运行测试
新建一空文件夹并进入,建立一个文件,命名为 inp ,并将其内容编辑为:

CalculationMode = gs

%Coordinates
 'H' | 0 | 0 | 0
%
1
2
3
4
5
注:文件只能命名为 inp, octopus 只识别这个输入文件名
接下来试运行:

octopus &> output
1
即可运行octopus并将输出结果重定向到新建的 output 文件中。
若只运行:

octopus
1
则输出会在屏幕上实时显示。
————————————————
 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值