Description
WannierTools v2.7.2 fails to compile with Intel Fortran Compiler due to two issues:
- Syntax error in
module.f90 (missing comma)
- Missing
orbital_hall.o in Makefile.intel-mpi-with-ARPACK
Environment
- WannierTools version: v2.7.2
- Compiler: Intel Fortran Compiler Classic (ifort) with OneAPI 2024.2.0
- System: Linux
- MPI: Intel MPI
- ARPACK: arpack-ng/master-oneapi.2024.2.0
- BLAS/LAPACK: Intel MKL
Error Messages
Error 1: Syntax Error
module.f90(497): error #5082: Syntax error, found IDENTIFIER 'LINEAR_OPTIC_CALC' when expecting one of: , <END-OF-STATEMENT> ; /
linear_optic_calc, BPVE_calc, Intra_orbital_hall_calc
--------------------------^
Error 2: Linking Error
ld: main.o: in function `MAIN__':
main.f90:(.text+0x4043): undefined reference to `intra_orbital_hall_conductivity_'
make: *** [Makefile.intel-mpi-with-ARPACK:41: main] Error 1
Root Cause
- Line 496 in
src/module.f90: Missing comma after BdG_phase_calc
Makefile.intel-mpi-with-ARPACK: Missing orbital_hall.o in the OBJ list, even though orbital_hall.f90 exists and contains the required subroutine Intra_Orbital_hall_conductivity
Steps to Reproduce
- Clone WannierTools repository
git checkout v2.7.2
cd src
$ module load oneapi/2024.2.0
$ module load arpack-ng/master-oneapi.2024.2.0
$ echo $ARPACK_NG_ROOT
/home/werner/Public/repo/github.com/opencollab/arpack-ng/master-oneapi.2024.2.0
$ ls $ARPACK_NG_ROOT
include lib
$ make clean -f Makefile.intel-mpi-with-ARPACK
$ make ARPACK="-L${ARPACK_NG_ROOT}/lib -larpack" F90="mpiifort -fpp -DMPI -fpe3 -O3 -DARPACK -DINTELMKL" CC="mpiicc -cpp -O3 -DINTELMKL" -f Makefile.intel-mpi-with-ARPACK
Solution
Apply the following two fixes:
Fix 1: Add missing comma in module.f90
sed -i 's/BdG_phase_calc &/BdG_phase_calc, \&/' src/module.f90
or manually edit line 496:
# Before (incorrect):
valley_projection_calc, Matrix_Element_calc, BdGChern_calc, SlabBdG_calc, BdG_phase_calc &
# After (correct):
valley_projection_calc, Matrix_Element_calc, BdGChern_calc, SlabBdG_calc, BdG_phase_calc, &
Fix 2: Add orbital_hall.o to Makefile
sed -i 's/2D_TSC\.o optic\.o\\/2D_TSC.o optic.o orbital_hall.o \\/' src/Makefile.intel-mpi-with-ARPACK
or manually edit the OBJ line in Makefile.intel-mpi-with-ARPACK:
# Before:
2D_TSC.o optic.o\
# After:
2D_TSC.o optic.o orbital_hall.o \
Verification
After applying both fixes, compilation completes successfully:
$ make clean -f Makefile.intel-mpi-with-ARPACK
$ make ARPACK="-L${ARPACK_NG_ROOT}/lib -larpack" F90="mpiifort -fpp -DMPI -fpe3 -O3 -DARPACK -DINTELMKL" CC="mpiicc -cpp -O3 -DINTELMKL" -f Makefile.intel-mpi-with-ARPACK
Suggested Action
Please apply these fixes to the v2.7.2 release or create a patch release v2.7.3 with these corrections.
Additional Notes
- The function
Intra_Orbital_hall_conductivity exists in orbital_hall.f90 but was not being compiled due to missing makefile entry
- This issue likely affects all users trying to compile v2.7.2 with Intel compilers
- The syntax error suggests the code may not have been tested with strict Fortran compilers before release
Regards,
Zhao
Description
WannierTools v2.7.2 fails to compile with Intel Fortran Compiler due to two issues:
module.f90(missing comma)orbital_hall.oinMakefile.intel-mpi-with-ARPACKEnvironment
Error Messages
Error 1: Syntax Error
Error 2: Linking Error
Root Cause
src/module.f90: Missing comma afterBdG_phase_calcMakefile.intel-mpi-with-ARPACK: Missingorbital_hall.oin the OBJ list, even thoughorbital_hall.f90exists and contains the required subroutineIntra_Orbital_hall_conductivitySteps to Reproduce
git checkout v2.7.2cd srcSolution
Apply the following two fixes:
Fix 1: Add missing comma in module.f90
sed -i 's/BdG_phase_calc &/BdG_phase_calc, \&/' src/module.f90or manually edit line 496:
Fix 2: Add orbital_hall.o to Makefile
sed -i 's/2D_TSC\.o optic\.o\\/2D_TSC.o optic.o orbital_hall.o \\/' src/Makefile.intel-mpi-with-ARPACKor manually edit the OBJ line in
Makefile.intel-mpi-with-ARPACK:Verification
After applying both fixes, compilation completes successfully:
Suggested Action
Please apply these fixes to the v2.7.2 release or create a patch release v2.7.3 with these corrections.
Additional Notes
Intra_Orbital_hall_conductivityexists inorbital_hall.f90but was not being compiled due to missing makefile entryRegards,
Zhao