Installing OpenMX on Ubuntu 18.04.5 LTS

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

Installing OpenMX on Ubuntu 18.04.5 LTS
Apache2 on Ubuntu20.04 LTS
Building WebGIS on Ubuntu20.04 LTS
Record video on ubuntu18.04 LTS
Install raspi-config on Ubuntu 20.04 (LTS)
Install WordPress 5.5 on Ubuntu 20.04 LTS
Installing Ruby + Rails on Ubuntu 18.04 (rbenv)
Wake on Lan settings on Ubuntu 20.04.1 LTS
Installing and using Ansible on Ubuntu 16.04
Pit pits when installing dotnet on Ubuntu 18.04 LTS + WINE + winetricks
tmux on Ubuntu
Disk expansion on Ubuntu 20.04.1 LTS on GCP Compute Engine
How to install multiple JDKs on Ubuntu 18.04 LTS
Screen recording on Ubuntu 20.04
Web Bluetooth on Ubuntu20.04
Try DisplayLink on Ubuntu 20.04
Reinstall Kubernetes on Ubuntu 19.10
Use Flutter on Ubuntu
Install pyqt5 on ubuntu
Install Ruby on Ubuntu 20.04
Setting JAVA_HOME on Ubuntu
Install Autoware on Ubuntu 18.04.5
Put JetBrains on Ubuntu
Use mkdir on ubuntu
Use cpplapack on ubuntu
ubuntu on wsl part 10
Install Homebrew on Ubuntu 20.04
Run tiscamera on Ubuntu 18.04
Ubuntu 18.04.05 About LTS setup
Build Zabbix on Ubuntu 20.04
Build Ubuntu 20.04 LTS desktop environment on Raspberry Pi 4 (+ Japanese)
What I stumbled upon when installing Ruby on Ubuntu
Using Flutter on Ubuntu (Part 2)
Create SSL certificate on Ubuntu 18.04
Install Ubuntu MATE 20.04 LTS on older MacBook Early 2008 (MB402 * / A, MB403 * / A, MB404 * / A)
Install OpenJDK7 (JAVA) on ubuntu 14.04
Put Ubuntu 20.04.1 on Raspberry Pi 4
Build VNC Server on Ubuntu 20.04
Install Cybozu Office 10 on Ubuntu 20.4
Extend swap area on Ubuntu 18.04
Install Docker on Ubuntu Server 20.04
Ubuntu on Windows Community Preview
Japanese input on Ubuntu20.04 Desktop
Oracle Java 8 on Docker Ubuntu
Install zabbix agent (5.0) on Ubuntu 18.04
Install MAV Proxy on Ubuntu 18.04
How to Install Elixir and Phoenix Framework on Ubuntu 20.04 LTS
Install Arudino IDE on Ubuntu 20
Introduced knowledge (wiki) on Ubuntu
Install Java on WSL Ubuntu 18.04
Ruby installation on WSL2 + Ubuntu 20.04
Install Ubuntu Desktop 20.10 on RaspberryPi4
Run chromium-mir-kiosk on Ubuntu Core
Install Arduino IDE on Ubuntu 20.04
Ubuntu on Windows build speed
Run java applet on ubuntu
Build mate desktop environment on ec2 with terraform (Ubuntu 20.04LTS)
How to install java9 on elementaryOS Freya or Ubuntu 14.04 LTS
Set up a MineCraft Paper server on Ubuntu 20.04.1 LTS ② Update
Run Eclipse CDT on Ubuntu
Set up ansible-playbook on Ubuntu 20.04