There is a first-principles calculation software called OpenMX. First-principles calculation is a framework for calculating electronic states from the position information of solids. According to the density functional theory, many-body electronic states can be obtained in principle. However, in actual calculations, various approximations are applied, so some people may not call it first-principles calculation (especially those in the field of chemistry). Anyway, I will call it first-principles calculation software here.
http://www.openmx-square.org/openmx_man3.9jp/index.html
When I tried to install this software on Ubuntu 18.04.5 LTS, I was surprised, so I would like to write it here to share the solution. First of all, please note that the makefile example in the Japanese manual is incorrect for gfortran.
[Note] It fell when I made two parallels with mpirun, so it may still be wrong. If anyone knows, we would appreciate it if you could cooperate.
I'll prepare VirtualBox and keep a record of my work when I installed OpenMX on a clean Ubuntu 18.04.5 LTS. The following is the command executed in the terminal.
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
sudo sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list'
sudo apt-get update
sudo apt-get install intel-mkl-2020.0-088
sudo apt install gfortran
sudo apt install emacs
sudo apt install openmpi-doc openmpi-bin libopenmpi-dev
echo "source /opt/intel/mkl/bin/mklvars.sh intel64" | cat >> ~/.bashrc
sudo apt install libfftw3-3 libfftw3-dev libfftw3-doc
wget http://t-ozaki.issp.u-tokyo.ac.jp/openmx3.9.tar.gz
wget http://www.openmx-square.org/bugfixed/20Feb11/patch3.9.2.tar.gz
tar -xvf openmx3.9.tar.gz
cp ./patch3.9.2.tar.gz openmx3.9/source/
cd openmx3.9/source
tar zxvf patch3.9.2.tar.gz
mv kpoint.in ../work/
What did you do?
--Installing MKL --Install gfortran --Install emacs --Installing openmpi --Installing FFTW3 --Download OpenMX --Patch OpenMX
is. Next, play with the Makefile.
emacs makefile &
makefile
MKLROOT = /opt/intel/mkl
CC = mpicc -O3 -fopenmp
FC = mpif90 -O3 -fopenmp
LIB = -lgfortran -lmpi_mpifh -L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_scalapack_lp64 -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lmkl_blacs_intelmpi_lp64 -lgomp -lpthread -lm -ldl -lfftw3
It's OK if you do it. Since make is not installed at this point,
sudo apt install make
To do. And
make all
To do. With this make, something interesting happens that is unique to Ubuntu. In the middle,
`sqrt'An undefined reference to
It throws an error like this and falls. Looking at where it fell,
mpicc -O3 -fopenmp -I./elpa-2018.05.001 -g gcube2oned.c -o gcube2oned
It is. The error that sqrt is not defined occurs when the math library is not linked. So, you can add the -lm option, but in the case of Ubuntu, for some reason you will get the same error if you do not add -lm at the end. Therefore,
mpicc -O3 -fopenmp -I./elpa-2018.05.001 -g gcube2oned.c -o gcube2oned -lm
make all
Let's say. Now you can compile this part properly with -lm and continue with make all.
Finally,
make install
To do.
To check the operation
cd ../work
mpirun -np 1 openmx Methane.dat -nt 1 > met.std
cat met.std
And
The calculation was normally finished.
It will be okay if there is.
Recommended Posts