[Q-e-developers] compilation error with gfortran 4.6 (Mac OSX) + Makefile glitch

Riccardo Di Meo dimeo at democritos.it
Mon Apr 11 19:57:41 CEST 2011


Dear all,

while compiling pw (SVN version) on Leopard I stumbled in the following 
error:

gfortran -O3 -g -x f95-cpp-input -D__GFORTRAN -D__STD_F95 -D__FFTW -I../include -I../iotk/src -I../Modules -I. -c sum_band.f90
sum_band.f90:177.28:

   CALL sym_rho ( nspin_mag, rho%of_g(1,1) )
                             1
Error: Element of assumed-shaped or pointer array passed to array dummy argument 'rhog' at (1)
sum_band.f90:187.48:

      IF (.NOT. gamma_only) CALL sym_rho( nspin, rho%kin_g(1,1) )
                                                 1
Error: Element of assumed-shaped or pointer array passed to array dummy argument 'rhog' at (1)


where the compiler used is:

$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin10.7.0/4.6.0/lto-wrapper
Target: x86_64-apple-darwin10.7.0
Configured with: ../gcc-4.6.0/configure --enable-languages=fortran,c++
Thread model: posix
gcc version 4.6.0 (GCC)

I have solved the problem on my own by replacing rho%of_g(1,1) and 
rho%kin_g(1,1) with rho%of_g and rho%kin_g, respectively (however, due 
to my low proficiency with Fortran and despite I tested the binary, I'm 
not entirely sure they actually do the same thing :D).

I have also noticed that there is a rule in the PW Makefile that breaks 
the parallel compilation:

generate_vdW_kernel_table.x : generate_vdW_kernel_table.o
         $(LD) $(LDFLAGS) -o $@ \
                 generate_vdW_kernel_table.o $(QEMODS) libpw.a 
$(LIBOBJS) $(LIBS)
         - ( cd ../bin; ln -fs ../PW/$@ . )


should be

generate_vdW_kernel_table.x : generate_vdW_kernel_table.o /libpw.a/
         $(LD) $(LDFLAGS) -o $@ \
                 generate_vdW_kernel_table.o $(QEMODS) libpw.a 
$(LIBOBJS) $(LIBS)
         - ( cd ../bin; ln -fs ../PW/$@ . )

with a dependency from libpw.a

hope this helps,
Cheers,
Riccardo Di Meo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/developers/attachments/20110411/ceeb08be/attachment.html>


More information about the developers mailing list