The current Makefile script for Wannier90 needs to be run twice to compile.
See the following for the testing results on Ubuntu 20.04.3 LTS:
$ git log -1
commit cef5ed5d8b11151359573114fb86ae605dc6f777 (HEAD -> develop, origin/develop, origin/HEAD)
Merge: 17037f761 3af5268c8
Author: giannozz <paolo.giannozzi@uniud.it>
Date: Fri Jan 21 15:03:47 2022 +0000
Merge branch 'pw-mp-latgen' into 'develop'
Make MP correction work with ibrav=0 and cubic cell
See merge request QEF/q-e!1720
$ module load mkl mpi compiler
$ ./configure --with-scalapack=intel MPIF90=mpiifort
$ make -j44 w90
test -d bin || mkdir bin
cd install ; make -f extlibs_makefile liblapack
make[1]: Entering directory '/home/werner/q-e/install'
make[1]: Nothing to be done for 'liblapack'.
make[1]: Leaving directory '/home/werner/q-e/install'
( cd install ; make -f plugins_makefile w90 || exit 1 )
make[1]: Entering directory '/home/werner/q-e/install'
cd ../W90 ; \
if (test -e ../install/make_wannier90.inc) || (test -d ../W90); then \
(cp ../install/make_wannier90.inc ../W90/make.inc); fi
/bin/sh: 1: cd: can't cd to ../W90
cp: cannot create regular file '../W90/make.inc': No such file or directory
make[1]: *** [plugins_makefile:98: configure-w90] Error 1
make[1]: *** Waiting for unfinished jobs....
if test ! -e ../W90; then (gzip -dc ../archive/`echo "https://codeload.github.com/wannier-developers/wannier90/tar.gz/v3.1.0" | sed 's/.*\///;s/.*=//'` | (cd ../ ; tar -xvf - ) ) ; if test "`echo $?`" -ne "0" ; then echo "*** Unable to download https://codeload.github.com/wannier-developers/wannier90/tar.gz/v3.1.0." ; echo "*** Verify that the url is correct." ; exit 1 ; else (cd ../ ; ln -s wannier90-3.1.0 W90) ; fi ; fi
[...]
touch uncompress-w90
make[1]: Leaving directory '/home/werner/q-e/install'
make: *** [Makefile:239: w90] Error 1
$ make -j44 w90
test -d bin || mkdir bin
cd install ; make -f extlibs_makefile liblapack
make[1]: Entering directory '/home/werner/q-e/install'
make[1]: Nothing to be done for 'liblapack'.
make[1]: Leaving directory '/home/werner/q-e/install'
( cd install ; make -f plugins_makefile w90 || exit 1 )
make[1]: Entering directory '/home/werner/q-e/install'
cd ../W90 ; \
if (test -e ../install/make_wannier90.inc) || (test -d ../W90); then \
(cp ../install/make_wannier90.inc ../W90/make.inc); fi
touch ./configure-w90
if test -d ../W90; then \
cd ../W90; make || exit 1; cd ../bin; ln -fs ../W90/wannier90.x . ; fi
make[2]: Entering directory '/home/werner/q-e/wannier90-3.1.0'
(cd ./src/obj && make -f ../Makefile.2 serialobjs)
(cd ./src/objp && make -f ../Makefile.2 post)
make[3]: Entering directory '/home/werner/q-e/wannier90-3.1.0/src/obj'
mpiifort -nomodule -c ../constants.F90
make[3]: Entering directory '/home/werner/q-e/wannier90-3.1.0/src/objp'
mpiifort -nomodule -c ../constants.F90
mpiifort -nomodule -c ../io.F90
mpiifort -nomodule -c ../io.F90
mpiifort -nomodule -c ../utility.F90
mpiifort -nomodule -c ../comms.F90
mpiifort -nomodule -c ../utility.F90
mpiifort -nomodule -c ../comms.F90
mpiifort -nomodule -c ../parameters.F90
mpiifort -nomodule -c ../parameters.F90
mpiifort -nomodule -c ../ws_distance.F90
mpiifort -nomodule -c ../kmesh.F90
mpiifort -nomodule -c ../ws_distance.F90
mpiifort -nomodule -c ../sitesym.F90
mpiifort -nomodule -c ../kmesh.F90
mpiifort -nomodule -c ../postw90/postw90_common.F90
mpiifort -nomodule -c ../hamiltonian.F90
mpiifort -nomodule -c ../overlap.F90
mpiifort -nomodule -c ../disentangle.F90
mpiifort -nomodule -c ../wannierise.F90
mpiifort -nomodule -c ../plot.F90
mpiifort -nomodule -c ../transport.F90
mpiifort -nomodule -c ../postw90/get_oper.F90
mpiifort -nomodule -c ../postw90/wan_ham.F90
mpiifort -nomodule -c ../postw90/spin.F90
mpiifort -nomodule -c ../postw90/geninterp.F90
mpiifort -nomodule -c ../postw90/dos.F90
mpiifort -nomodule -c ../postw90/berry.F90
mpiifort -nomodule -c ../postw90/boltzwann.F90
make[3]: Leaving directory '/home/werner/q-e/wannier90-3.1.0/src/obj'
(cd ./src/obj && make -f ../Makefile.2 wannier)
make[3]: Entering directory '/home/werner/q-e/wannier90-3.1.0/src/obj'
mpiifort ../wannier_prog.F90 constants.o io.o utility.o parameters.o hamiltonian.o overlap.o kmesh.o disentangle.o ws_distance.o wannierise.o plot.o transport.o sitesym.o comms.o -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -o ../../wannier90.x
make[3]: Leaving directory '/home/werner/q-e/wannier90-3.1.0/src/obj'
mpiifort -nomodule -c ../postw90/gyrotropic.F90
mpiifort -nomodule -c ../postw90/kpath.F90
mpiifort -nomodule -c ../postw90/kslice.F90
mpiifort ../postw90/postw90.F90 ws_distance.o parameters.o kmesh.o io.o comms.o utility.o get_oper.o constants.o postw90_common.o wan_ham.o spin.o dos.o berry.o gyrotropic.o kpath.o kslice.o boltzwann.o geninterp.o -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -o ../../postw90.x
make[3]: Leaving directory '/home/werner/q-e/wannier90-3.1.0/src/objp'
make[2]: Leaving directory '/home/werner/q-e/wannier90-3.1.0'
(cd ../bin; ln -fs ../W90/wannier90.x .)
touch make-w90
make[1]: Leaving directory '/home/werner/q-e/install'
Side remark: The following is a follow-up note to my flawed MR: !1724 (merged).
With the help of experts in different fields [1-3], I have finally figured out a revised/enhanced version of install/install_utils
which works exactly the same as the original one with the additional capability of checking the integrity of the downloaded archive, as shown below:
# Copyright (C) 2001-2022 Quantum ESPRESSO group
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License. See the file `License' in the root directory
# of the present distribution.
#
# Utilities
###########################################################
# Template function
# $(1) = package name
# $(2) = package URL
# $(3) = directory name
# $(4) = plugin/code name
###########################################################
define download_and_unpack
package='$(1)'; \
package_URL='$(2)'; \
package_directory='$(3)'; \
package_code='$(4)'; \
package_archive=../archive/`echo "$${package}" | sed 's/.*\///;s/.*=//'`; \
(if ! gzip -t $${package_archive} > /dev/null 2>&1; then \
rm -fr $${package_archive} ; \
wget -O $${package_archive} $${package_URL} > /dev/null 2>&1; \
if [ $$? -ne 0 ]; then \
curl -o $${package_archive} $${package_URL} > /dev/null 2>&1; \
if [ $$? -ne 0 ]; then \
echo "*** Unable to download $${package_code}. Test whether curl or wget is installed and working," ; \
echo "*** if you have direct access to internet. If not, copy into archive/ the file" ; \
echo "*** located here $${package_URL}" ; \
exit 1 ; \
fi; \
fi; \
fi \
); \
if [ $$? -eq 0 -a ! -e ../$${package_directory} ]; then \
(gzip -dc $${package_archive} | \
(cd ../ ; tar -xvf - )) ; \
if [ $$? -ne 0 ]; then \
echo "*** Unable to download $${package_URL}." ; \
echo "*** Verify that the url is correct." ; \
exit 1 ; \
else \
(cd ../ ; ln -s $${package} $${package_directory}); \
fi; \
fi
endef
But I prefer to achieve more readability/maintainability using pure shell script or git submodule
based solution as an alternative.
[1] https://lists.gnu.org/archive/html/help-make/2022-01/msg00052.html
[2] https://lists.gnu.org/archive/html/help-make/2022-01/msg00043.html
[3] https://groups.google.com/g/comp.unix.shell/c/Th2slAFWZIo
Regards, HZ