alamode安装
intel 环境
并且spglib的库已经安装在/usr/local/lib中
#修改系统环境变量
vim ~/.bashrc
主要是防止alamode安装后。运行时提示找不到spglib的库
软件下载地址
sourceforge: http://sourceforge.net/projects/alamode
github: https://github.com/ttadano/alamode
配套的eigen和boost下载地址
eigen: http://eigen.tuxfamily.org/index.php?title=Main_Page
boost: https://www.boost.org/
安装编译
#进入alamode文件夹并在里面创建一个etc文件夹
编译alm
进入alm文件夹
cp Makefile.linux Makefile
修改Makefile
.SUFFIXES: .h .cpp
#-----------------------------------------------
# Makefile for the program 'ALM'.
# Please modify the variables properly.
# We recommend to use Intel c++ compiler.
#-----------------------------------------------
CXX = icpc
CXXFLAGS = -O2 -xHOST -qopenmp -std=c++11
INCLUDE = -I../include -I$(HOME)/include -I/usr/local/include
CXXL = ${CXX}
LDFLAGS = -mkl -L/usr/local/lib -lsymspg
LAPACK =
LIBS = ${LAPACK}
#-----------------------------------------------
# General rules
#-----------------------------------------------
.cpp.o:
${CXX} ${CXXFLAGS} ${INCLUDE} -c $<
PROG = alm
CXXSRC= $(wildcard *.cpp)
OBJS= ${CXXSRC:.cpp=.o}
default: alm
all: ${PROG}
alm: ${OBJS}
${CXXL} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
clean:
rm -f ${OBJS}
.PHONY: clean
depend:
gcc -MM *.cpp > .depend
-include .depend
make
#生产alm
cd ..
mkdir bin
cp ./alm/alm ./bin/alm
编译anphon
进入anphon文件夹
cp Makefile.linux Makefile
修改Makefile
.SUFFIXES: .h .cpp
#-----------------------------------------------
# Makefile for the program 'ANPHON'.
# Please modify the variables properly.
# We recommend to use Intel c++ compiler.
#-----------------------------------------------
MPICXX = mpiicpc
CXXFLAGS = -O3 -xHOST -qopenmp -D_FE_BUBBLE -std=c++11
INCLUDE = -I../include -I/usr/local/include -I/opt/intel/compilers_and_libraries_2019.4.243/linux/mkl/include -I/usr/local/fftw/include
LINKER = ${MPICXX}
LDFLAGS = -mkl -L/usr/local/lib -lsymspg
LAPACK =
LIBS = ${LAPACK}
#----------------------------------------------
# General rules
#----------------------------------------------
.cpp.o:
${MPICXX} ${CXXFLAGS} ${INCLUDE} -c $<
PROG = anphon
CXXSRC = $(wildcard *.cpp)
OBJS= ${CXXSRC:.cpp=.o}
default: anphon
all: ${PROG}
anphon: ${OBJS}
${LINKER} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
clean:
rm -f ${OBJS}
.PHONY: clean
depend:
gcc -MM *.cpp > .depend
-include .depend
make
#生产alm
cd ..
cp ./anphon/anphon ./bin/alm
编译tools
cd tools
makefile如下
.SUFFIXES: .h .cpp
#-----------------------------------------------
# Makefile for 'tools' directory
# Please modify the variables properly.
# We recommend to use Intel c++ compiler.
#-----------------------------------------------
#Intel compiler
#CXX = icpc
# OSX (gcc)
CXX = g++
# OSX (clang)
#CXX = g++
CXXFLAGS = -O2 -std=c++11
# Add the directory containing boost header files here
INCLUDE = -I../include -I$(HOME)/include
#----------------------------------------------
# General rules
#----------------------------------------------
.cpp.o:
${CXX} ${CXXFLAGS} ${INCLUDE} -c $<
PROG = analyze_phonons qe2alm dfc2
CXXSRC = analyze_phonons.cpp qe2alm.cpp dfc2.cpp
OBJS= ${CXXSRC:.cpp=.o}
default: all
all: ${PROG}
analyze_phonons: analyze_phonons.o
${CXX} ${CXXFLAGS} -o $@ $<
qe2alm: qe2alm.o
${CXX} ${CXXFLAGS} -o $@ $<
dfc2: dfc2.o
${CXX} ${CXXFLAGS} -o $@ $<
clean:
rm -f ${OBJS}
.PHONY: clean
depend:
gcc -MM *.cpp > .depend
-include .depend
make
配置环境变量
export