Page 1 of 1

Warning during compilation on Ubuntu using GNU tools

Posted: Tue Jul 06, 2021 12:53 pm
by roman_malyshev
Using the guide at wiki/index.php/A_Ubuntu_based_installation_of_VASP, VASP compiles without issues on Ubuntu 18.04 LTS, but using the exact same procedure on Ubuntu 20.04 LTS produces a warning during compilation (for each binary and libdmy.a):

Code: Select all

gcc -E -P -C -w drdatab.F >drdatab.f90
mpif90 -O1 -ffree-form -ffree-line-length-none -c -o drdatab.o drdatab.f90
drdatab.f90:212:0:

  212 |          BUFLIN=BUFLIN(2:LMAX)
      | 
Warning: ‘__builtin_memmove’ reading 32767 bytes from a region of size 32766 [-Wstringop-overflow=]
This warning is reproducible on both Intel and AMD cpus. Intel's compiler and libraries work on Intel-based Ubuntu 20.04 systems without any issues. However, we are going to invest into a set of workstations equipped with AMD running Ubuntu 20, as they offer many more CPU cores at a lower price (and most of our researchers at the department do not perform VASP computations, or anything else that might perform better on an Intel-based system). Our initial tests show that VASP compiled on AMD using open-source libraries and gfortran runs about as fast as VASP compiled on a similar Intel CPU, using Intel's oneAPI suite (Intel fortran, Intel MKL, Intel MPI). The models even converged to very similar energies. However, the one compiled with open-source tools produced the following warning after each VASP run (only to console. Not to any VASP output file):

Code: Select all

Note: The following floating-point exceptions are signalling: IEEE_UNDERFLOW_FLAG IEEE_DENORMAL
I noticed that Ubuntu 18.04 comes with GNU Fortran (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, while Ubuntu 20.04 ships with GNU Fortran (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0. I tried installing gfortran 7.5 on Ubuntu 20 and the warning above, concerning source file drdatab.f90, vanished, but it opened up a whole new can of worms with a lot of other errors (not just warnings) that made the compilation stop.

Would it be possible for the support team to come up with an installation guide that works with Ubuntu 20.04 and open-source tools?

Re: Warning during compilation on Ubuntu using GNU tools

Posted: Tue Jul 06, 2021 4:09 pm
by henrique_miranda
I am not sure I completely understood the issue.

The wiki page provides a recipe to compile VASP on Ubuntu 18.04
You used this guide to compile for Ubuntu 20.04 LTS but you get a warning during compilation.
Does the compilation finish?

Then you say that the executable produces a warning at the end of the run due to floating-point exception.
Is this the executable that you compiled above?

Then you say that you would like an installation guide for Ubuntu 20.04 LTS.
Do you mean how to get rid of the warnings above? or did you get some additional error during the compilation and you were not able to produce a working executable?

I should also point out that while using the libraries shipped with the operating system package manager (APT) will work, the executable might not provide the best possible performance for your hardware.
To get the best performance I recommend you look into the libraries provided by your hardware manufacturer:
- For intel: https://software.intel.com/content/www/ ... neapi.html
- For AMD: https://developer.amd.com/amd-aocl/

Re: Warning during compilation on Ubuntu using GNU tools

Posted: Sat Jul 10, 2021 10:30 pm
by roman_malyshev
Yes, you understood correctly.

I compiled VASP 5.4.4 (and VASP 6.2.1) using the instructions for Ubuntu 18.04 on Ubuntu 20.04 and got that one warning during compilation. Apart from issuing the warning, the compilation finished. I then used these binaries for some test runs and got the warnings I included in the original post outputted to console after the calculation finished.

Thank you for the tip. I will try recompiling VASP using AMD-specific libraries on the AMD machines.

Re: Warning during compilation on Ubuntu using GNU tools

Posted: Sun Jul 11, 2021 5:22 pm
by henrique_miranda
Ok, while those warnings might sound scary they are harmless.
Also, you can deactivate them by compiling with the following gfortran option:

Code: Select all

-ffpe-summary=none
When running the test suite it's important to check whether all the tests of the test suite pass, if that is the case then it's a good indication that you have a well-working executable.