Compilation error with GULP 6.2 and "old" gfortran

I am trying to compile GULP 6.2 on a Linux machine with gcc 8.5.0. Despite having success with GULP 6.1.2, I am getting an error when compiling GULP 6.2.

Running ./mkgulp_old_fortran yields the following:

 ../../Utils/pGFNFF/Src//libpGFNFF.a -o gulp
linpack.o: In function `zhidi_':
linpack.F90:(.text+0x168f): undefined reference to `zdotc_'
linpack.F90:(.text+0x174e): undefined reference to `zdotc_'
linpack.F90:(.text+0x17b6): undefined reference to `zdotc_'
linpack.F90:(.text+0x186c): undefined reference to `zdotc_'
linpack.F90:(.text+0x1915): undefined reference to `zdotc_'
linpack.o:linpack.F90:(.text+0x1dc4): more undefined references to `zdotc_' follow
collect2: error: ld returned 1 exit status

I did a diffcheck on the makefiles for GULP 6.1.2 and 6.2 and see that zdotc.o was added in several places, so presumably it is related to this change, but I am not familiar enough with the libraries here to debug further.

Do you have any suggestions on how to proceed?

Can I check whether 6.2 was downloaded recently since it should already be set up to compile and link against zdotc by default? What matters is that the MLIB variable in mkgulp has this specified (or that you provide lapack and blas via an optimised maths library on your machine via this).
If you can’t make this work, then the simple fix is to include zdotc.F90 into your lapack.F90 file (assuming this is being compiled)

@julian: Thanks for the reply. I tried downloading 6.2 again today and ran the following as-is on my cluster:

module purge
module load intel/2021.1.2
module load openmpi/intel-2021.1/4.1.0
cp Src/mkgulp_old_gfortran
cd Src
./mkgulp_old_gfortran -j 8

The same error appears:

 ../../Utils/pGFNFF/Src//libpGFNFF.a -o gulp
linpack.o: In function `zhidi_':
linpack.F90:(.text+0x168f): undefined reference to `zdotc_'
linpack.F90:(.text+0x174e): undefined reference to `zdotc_'
linpack.F90:(.text+0x17b6): undefined reference to `zdotc_'
linpack.F90:(.text+0x186c): undefined reference to `zdotc_'
linpack.F90:(.text+0x1915): undefined reference to `zdotc_'
linpack.o:linpack.F90:(.text+0x1dc4): more undefined references to `zdotc_' follow
collect2: error: ld returned 1 exit status

I’ll play around with the libraries when I get a chance, but if you find any other info out, please let me know. Thanks!

From your info above I can see that you’re loading Intel compilers and MPI, but compiling with a mkgulp that seems to be modified and the name implies it’s for gfortran. If you use a modified mkgulp with a new version of 6.2 then the problem will stay the same, so I don’t know if that’s an issue. Ultimately if you are going to use Intel and MPI then you’ll need to modify mkgulp to link scalapack, lapack, blas and blacs appropriate to your machine, which would solve this problem. The best thing for Intel is to use MKL which would provide zdotc.

@julian: Thanks! That’s a good suggestion and a good point about the Intel vs. gfortran. I’ll note that the mkgulp_old_gfortran ships with GULP 6.2 :slight_smile:

Opps - I should have remembered about the mkgulp_old_gfortran - guess I haven’t used it in a long time! :slight_smile: