Opened 7 years ago

Closed 3 years ago

#52891 closed defect (worksforme)

gcc5 @5.3.0_1: gfortran-mp-5 fails to compile a simple code

Reported by: clemreal Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc:
Port: gcc5

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Hello,

I am a beginner in fortran but I suspect a problem while compiling a very simple code.

  1. The code I try to compile, written in hello.f90
program hello
  print *, "Hello World!"
end program hello
  1. Compilation

I use the command:

gfortran-mp-5 -o hello hello.f90
  1. Error printed in the terminal
<built-in>: internal compiler error: Illegal instruction: 4

<built-in>: internal compiler error: Abort trap: 6
gfortran-mp-5: internal compiler error: Abort trap: 6 (program f951)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://trac.macports.org/newticket> for instructions.
  1. Comments

The command to compile the code works on my personal computer with a version of gfortran 5.1.0. I need to compile this code on my professionnal computer (Mac OS 10.11.6) without the admin rigths.

The command gfortran-mp-5 --version returns:

GNU Fortran (MacPorts gcc5 5.3.0_1) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

Thank you for your help

Change History (5)

comment:1 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Keywords: gfortran gfortran-mp-5 removed
Owner: changed from macports-tickets@… to mww@…
Port: 5.3.0_1 removed
Status: newassigned
Summary: gfortran-mp-5 fails to compile a simple codegcc5 @5.3.0_1: gfortran-mp-5 fails to compile a simple code

I don't know anything about Fortran so I probably can't help you debug this further, but it might be useful to know if you see the same problem with gcc6 or gcc7.

comment:2 Changed 7 years ago by clemreal

The solution is to force uninstall and rebuild from source code the GMP and MPFR math libraries:

port uninstall -f gmp mpfr
port install -s gmp mpfr

After doing this, the gfortran-mp-5 runs just fine. Problem solved!

comment:3 Changed 7 years ago by ken-cunningham-webuse

I know less about fortran than Ryan, but your test program builds and runs fine on MacOSX10.6 with gcc6, FWIW.

also, the current version of gcc5 is 5.40, and you're on 5.30, so you're a bit out of date there, FYI.

glad you fixed it.

comment:4 Changed 7 years ago by kurthindenburg (Kurt Hindenburg)

Owner: changed from mww@… to macports-tickets@…

comment:5 Changed 3 years ago by kencu (Ken)

Resolution: worksforme
Status: assignedclosed
Note: See TracTickets for help on using tickets.