EGSnrc icon indicating copy to clipboard operation
EGSnrc copied to clipboard

Installation issue for modern gcc versions

Open peterg1t opened this issue 4 years ago • 14 comments

I had to do a clean reinstall on my system. On install I got the following error:

Compiling pegs4 ...                               Failed
See configure.log for the output of make

In file configure.log the following info is shown:

Compiling pegs4_linux.f with flags '-fPIC -O2 -mtune=native'
pegs4_linux.f:3855:16:

 3855 |       QD=DCADRE(F,ADUM,BDUM,1.E-16,1.E-5,ERRDUM,IER)
      |                1
Error: Interface mismatch in dummy procedure ‘f’ at (1): 'f' is not a function
pegs4_linux.f:1723:49:

 1723 |         IF((QFIT(NJ,XL,XU,XR,EP,ZTHR,ZEP,REM,NIP,XFUN,XFI, AX,BX,NALM,NF
      |                                                 1
Error: Interface mismatch in dummy procedure ‘xfun’ at (1): 'xfun' is not a function
pegs4_linux.f:1740:50:

 1740 |         IF ((QFIT(NJ,XL,XU,XR,EP,ZTHR,ZEP,REM,NIP,XFUN,XFI, AX,BX,NALM,N
      |                                                  1
Error: Interface mismatch in dummy procedure ‘xfun’ at (1): 'xfun' is not a function
pegs4_linux.f:1750:52:

 1750 |       IF((.NOT.QFIT(NI,XL,XU,XR,EP,ZTHR,ZEP,REM,NIP,XFUN,XFI, AX,BX,NALM
      |                                                    1
Error: Interface mismatch in dummy procedure ‘xfun’ at (1): 'xfun' is not a function
pegs4_linux.f:288:57:

  288 |       CALL PWLF1(NGL,NALG,AP,UP,RMT2,EPG,ZTHRG,ZEPG,NIPG,ALOG,EXP, AXG,B
      |                                                         1
Error: Interface mismatch in dummy procedure ‘xfun’ at (1): 'alog' is not a subroutine
gmake: *** [Makefile:39: /home/peter/Apps/EGSnrc/HEN_HOUSE/bin/linux/pegs4.exe] Error 1
Failed program was gmake -j12 EGS_CONFIG=/home/peter/Apps/EGSnrc/HEN_HOUSE/specs/linux.conf

Performing a make on /pegs4 forlder yields the following info:

(base) [peter@localhost pegs4]$ make
Compiling pegs4_linux64.f with flags '-fPIC -O2 -mtune=native'
pegs4_linux64.f:3855:16:

 3855 |       QD=DCADRE(F,ADUM,BDUM,1.E-16,1.E-5,ERRDUM,IER)
      |                1
Error: Interface mismatch in dummy procedure ‘f’ at (1): 'f' is not a function
pegs4_linux64.f:1723:49:

 1723 |         IF((QFIT(NJ,XL,XU,XR,EP,ZTHR,ZEP,REM,NIP,XFUN,XFI, AX,BX,NALM,NF
      |                                                 1
Error: Interface mismatch in dummy procedure ‘xfun’ at (1): 'xfun' is not a function
pegs4_linux64.f:1740:50:

 1740 |         IF ((QFIT(NJ,XL,XU,XR,EP,ZTHR,ZEP,REM,NIP,XFUN,XFI, AX,BX,NALM,N
      |                                                  1
Error: Interface mismatch in dummy procedure ‘xfun’ at (1): 'xfun' is not a function
pegs4_linux64.f:1750:52:

 1750 |       IF((.NOT.QFIT(NI,XL,XU,XR,EP,ZTHR,ZEP,REM,NIP,XFUN,XFI, AX,BX,NALM
      |                                                    1
Error: Interface mismatch in dummy procedure ‘xfun’ at (1): 'xfun' is not a function
pegs4_linux64.f:288:57:

  288 |       CALL PWLF1(NGL,NALG,AP,UP,RMT2,EPG,ZTHRG,ZEPG,NIPG,ALOG,EXP, AXG,B
      |                                                         1
Error: Interface mismatch in dummy procedure ‘xfun’ at (1): 'alog' is not a subroutine
make: *** [Makefile:39: /home/peter/Apps/EGSnrc/HEN_HOUSE/bin/linux64/pegs4.exe] Error 1

Any help is appreciated.

Thanks, Pedro

peterg1t avatar Jun 18 '20 05:06 peterg1t

Could you post the complete installation log? It's ok if it's long!

rtownson avatar Jun 18 '20 16:06 rtownson

Hi Reid, Thanks for your promptly reply. Here is the configure.log file. Let me know if you need any other specific file configure.log

peterg1t avatar Jun 18 '20 17:06 peterg1t

I think these errors might be related to having a newer fortran version that has removed some backwards compatibility. Can you try an older version of gcc?

rtownson avatar Jun 18 '20 17:06 rtownson

Hi Reid, I have 10.1.1 installed but I tried in a virtual machine with ubuntu and gcc 7.5 and worked fine! Thanks for your help.

peterg1t avatar Jun 19 '20 01:06 peterg1t

Thanks for letting us know what worked. I'm going to re-open this issue to serve as a reminder to us that new gcc versions result in installation problems.

rtownson avatar Jun 19 '20 13:06 rtownson

Ubuntu and other Debian/Redhat distributions do have methods for installing multiple gcc versions. I have used this in the past to work with multiple parallel versions for testing (config file script needed some work a while back to accommodate this)

For gfortran 10+ there's the option for -std=legacy that should be added to the gfortran standard compiler options

crcrewso avatar Jun 19 '20 16:06 crcrewso

Thanks @crcrewso, I didn't know about the legacy option! That's a satisfactory fix for now.

rtownson avatar Jun 19 '20 16:06 rtownson

It'll work for now but it does start the final clock on getting rid of mortran. I doubt that option will continue to work for more than 5-6 years.

crcrewso avatar Jun 19 '20 16:06 crcrewso

When using the -std=legacy option the configure script runs but there are a few failed compilations gcc-10-fedora-configure-linux-peter.log In contrast when using the ubuntu system with the older version of gcc gcc-7-ubuntu-configure-linux-peter.log Everything runs smoothly. I don't know if this helps but maybe I'm missing something. Cheers, Pedro

peterg1t avatar Jun 19 '20 18:06 peterg1t

@peterg1t I saw none of those issues with my install of Fedora 32. Do you have tcl-devel, tk-devel, libgfortran (and devel) libstd-c++ (and -devel) and qt (and qt-x11)

crcrewso avatar Jun 19 '20 18:06 crcrewso

Most of those except for libgfortran-devel which I can't find sudo dnf install libgfortran-devel prints Error: Unable to find a match: libgfortran-devel image

peterg1t avatar Jun 19 '20 18:06 peterg1t

Yup, i misspoke there is no libgfortran-devel configure-linux.log configure-linux-crcrewso.log

crcrewso avatar Jun 19 '20 18:06 crcrewso

@crcrewso while I agree with you that we should move everything away from ancient Mortran, I don't think the issue here is Mortran/Fortran per se. Fortran will be around for longer than 5-6 years in my opinion. The issue is that newer builds of gfortran will force us to update deprecated parts of the Mortran code (while the full rewrite happens). Sometimes I've seen on Windows broken MinGW builds. I haven't looked at the offending lines in pegs4.mortran, but maybe we could try to figure out if there is a small patch required that will keep the ol' boat sailing ... 😉

mainegra avatar Jun 19 '20 21:06 mainegra

Where are we on this issue? Was it resolved pull request #648 merged recently?

ftessier avatar Apr 21 '21 21:04 ftessier