executing gcc9 on macOS 10.14

Hans Goedbloed J.P.Goedbloed at differ.nl
Tue Oct 22 16:41:19 UTC 2019


I have been using g95 for my fortran codes for many years, but it did not work anymore after upgrading to macOS 10.14 Mojave. I was advised to install gccc9 from MacPorts instead. This I did through "sudo port selfupdate" and "sudo port install gcc9".

This appeared to give all the required tools. When I then tried to compile and execute the simplest fortran  program test.f (the usual just writing of the message "Hello") by first compiling

/opt/local/bin/gfortran-mp-9 -v -c test.f

giving the required object file test.o, and then loading:

/opt/local/bin/ld -v test.o

this resulted in the messages



@(#)PROGRAM:ld PROJECT:ld64-512.4

BUILD 05:06:53 Aug 16 2019

configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em

Library search paths:

          /usr/lib

Framework search paths:

          /Library/Frameworks/

          /System/Library/Frameworks/

Undefined symbols for architecture x86_64:

 "__gfortran_set_args", referenced from:

      _main in test.o

 "__gfortran_set_options", referenced from:

      _main in test.o

 "__gfortran_st_write", referenced from:

      _MAIN__ in test.o

 "__gfortran_st_write_done", referenced from:

      _MAIN__ in test.o

ld: symbol(s) not found for architecture x86_64



I thought installation of gcc9 would include everything. How should I fix this??


Hans

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20191022/683916f6/attachment.html>


More information about the macports-users mailing list