alternative for g95 on macOS Mojave
I have been using g95 for many years on my iMac to perform fortran 77 calculations, but upgrading to macOS10.14 (Mojave) I found that "building g95 is not supported with Xcode 9 or greater". Which package should I use instead?? Hans?
executing gcc9 on macOS 10.14
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
Re: executing gcc9 on macOS 10.14
I updated the ports. looked allright (reply was "nothing to upgrade"), but the same problem: "ld: library not found for -lSystem" I also checked for the ld64 port and the reply was: "The following ports are currently installed: ld64 @3_1+ld64_xcode (active)" Any other suggestions? Hans From: macports-users on behalf of Chris Jones Sent: Wednesday, October 23, 2019 10:27 AM To: macports-users@lists.macports.org Subject: Re: executing gcc9 on macOS 10.14 Hi, One other comment. What version of the ld64 port do you have installed ? If it is not using the xcode variant, then please reinstall in using that > port installed ld64 The following ports are currently installed: ld64 @3_1+ld64_xcode (active) if you do not get the above, run > sudo port -f uninstall ld64 > sudo port install ld64 Chris On 23/10/2019 9:21 am, Chris Jones wrote: > Hi, > > ( Please always reply to the list ) > > The error below looks like one we addressed recently. Have you updated > your ports ? Please run > > > sudo port sync > > sudo port upgrade outdated > > then try again. > > Chris > > > On 23/10/2019 9:17 am, Hans Goedbloed wrote: >> Thanks Chris, >> >> Looks like what I hoped for: no other tools than gcc9 needed. >> However, when I do precisely what you said, I still get >> >> hanss-imac:resabs hansgoedbloed$ gfortran-mp-9 -o test.exe ./test.f >> ld: library not found for -lSystem >> collect2: error: ld returned 1 exit status >> >> All the libraries listed from your otool command are there, except >> /usr/lib/libSystem.B.dylib. >> Could that be the problem? >> >> Hans >> >> >> From: macports-users on >> behalf of Chris Jones >> Sent: Tuesday, October 22, 2019 7:09 PM >> To: macports-users@lists.macports.org >> Subject: Re: executing gcc9 on macOS 10.14 >> >> Hi, >> >> Your ld command is incomplete. You aren't passing any of the runtime >> libraries needed to link the .o file into an executable. >> >> The simplest approach is to let gcc do the full job. >> >> Titan ~/Documents/Code > cat test.f >> program hello >> print *, "Hello World!" >> end program hello >> Titan ~/Documents/Code > gfortran-mp-9 -o test.exe ./test.f >> Titan ~/Documents/Code > ./test.exe >>Hello World! >> >> Titan ~/Documents/Code > otool -L ./test.exe >> ./test.exe: >> /opt/local/lib/libgcc/libgfortran.5.dylib (compatibility >> version 6.0.0, >> current version 6.0.0) >> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current >> version 1252.200.5) >> /opt/local/lib/libgcc/libgcc_s.1.dylib (compatibility version >> 1.0.0, >> current version 1.0.0) >> /opt/local/lib/libgcc/libquadmath.0.dylib (compatibility >> version 1.0.0, >> current version 1.0.0) >> >> Chris >> >> On 22/10/2019 5:41 pm, Hans Goedbloed wrote: >>> 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 >>> >>>
Re: executing gcc9 on macOS 10.14
Thanks!, I now know what to expect and how to fix it. Hans From: macports-users on behalf of Chris Jones Sent: Wednesday, October 23, 2019 11:30 AM To: macports-users@lists.macports.org Subject: Re: executing gcc9 on macOS 10.14 On 23/10/2019 10:23 am, Hans Goedbloed wrote: > The xcrun did work, I do have turn around now! > Thanks for the help, Chris. > > I do have macOs 10.14.4 with Xcode 11.0 installed though, Should I change > Xcode right now or can I wait for the next SDK issue to turn up? That is up to you. It is just it is known that using Xcode 11 on macOS 10.14 does lead to these sort of SDK issues. They are being ironed out, slowly, but if you want to just avoid them its best to still to Xcode 10 on 10.14.. > > Hans > > > From: macports-users on behalf of > Chris Jones > Sent: Wednesday, October 23, 2019 10:46 AM > To: macports-users@lists.macports.org > Subject: Re: executing gcc9 on macOS 10.14 > > Another idea. > > What Xcode version are you running on mac OS 10.14 ? > > If Xcode 11, this is not recommended as it does lead to a lot of SDK > related issues, due to the fact Xcode 11 only has the 10.15 SDK (yes, > even on macOS 10.14). > > It is recommended to use Xcode 10 on macOS 10.14. > > Chris > > On 23/10/2019 9:37 am, Hans Goedbloed wrote: >> I updated the ports. looked allright (reply was "nothing to upgrade"), but >> the same problem: >> "ld: library not found for -lSystem" >> >> I also checked for the ld64 port and the reply was: >> "The following ports are currently installed: >> ld64 @3_1+ld64_xcode (active)" >> >> Any other suggestions? >> >> Hans >> >> From: macports-users on behalf >> of Chris Jones >> Sent: Wednesday, October 23, 2019 10:27 AM >> To: macports-users@lists.macports.org >> Subject: Re: executing gcc9 on macOS 10.14 >> >> Hi, >> >> One other comment. What version of the ld64 port do you have installed ? >> If it is not using the xcode variant, then please reinstall in using that >> >> > port installed ld64 >> The following ports are currently installed: >> ld64 @3_1+ld64_xcode (active) >> >> if you do not get the above, run >> >>> sudo port -f uninstall ld64 >>> sudo port install ld64 >> >> Chris >> >> On 23/10/2019 9:21 am, Chris Jones wrote: >>> Hi, >>> >>> ( Please always reply to the list ) >>> >>> The error below looks like one we addressed recently. Have you updated >>> your ports ? Please run >>> >>>> sudo port sync >>>> sudo port upgrade outdated >>> >>> then try again. >>> >>> Chris >>> >>> >>> On 23/10/2019 9:17 am, Hans Goedbloed wrote: >>>> Thanks Chris, >>>> >>>> Looks like what I hoped for: no other tools than gcc9 needed. >>>> However, when I do precisely what you said, I still get >>>> >>>> hanss-imac:resabs hansgoedbloed$ gfortran-mp-9 -o test.exe ./test.f >>>> ld: library not found for -lSystem >>>> collect2: error: ld returned 1 exit status >>>> >>>> All the libraries listed from your otool command are there, except >>>> /usr/lib/libSystem.B.dylib. >>>> Could that be the problem? >>>> >>>> Hans >>>> >>>> >>>> From: macports-users on >>>> behalf of Chris Jones >>>> Sent: Tuesday, October 22, 2019 7:09 PM >>>> To: macports-users@lists.macports.org >>>> Subject: Re: executing gcc9 on macOS 10.14 >>>> >>>> Hi, >>>> >>>> Your ld command is incomplete. You aren't passing any of the runtime >>>> libraries needed to link the .o file into an executable. >>>> >>>> The simplest approach is to let gcc do the full job. >>>> >>>> Titan ~/Documents/Code > cat test.f >>>> program hello >>>> print *, "Hello World!" >>>> end program hello >>>> Titan ~/Documents/Code > gfortran-mp-9 -o test.exe ./test.f >>>> Titan ~/Documents/Code > ./test.exe >>>> Hello World! >>>> >>>> Titan ~/Documents/Code > otool -L ./test.exe >>>> ./test.exe: >>>>/opt/
failure to get gcc9 running
Hi, I have upgraded my mid 2014 MacBook Pro to macOS 10.14 (Mojave) and installed macports and, next, tried to install gcc9. This resulted in an endless series of failures to activate ports, one after the other. At last, I took the recent advise to Ryan Schmidt (Nov. 2) of a similar problem to clean all ports:"sudo port clean all". This looked to bring me somewhat further, up the point that the procedure appeared to hang and the Mac fan made an enormous noise, and again it resulted in errors: -- [/Users/hansgoedbloed]$sudo port install gcc9 Password: ---> Computing dependencies for gcc9 ---> Cleaning gcc9 ---> Updating database of binaries ---> Scanning binaries for linking errors ---> Found 9 broken files, matching files to ports ---> Found 4 broken ports, determining rebuild order You can always run 'port rev-upgrade' again to fix errors. The following ports will be rebuilt: cmake @3.15.5 readline @8.0.000 gdbm @1.18.1 llvm-8.0 @8.0.1 Continue? [Y/n]: y ---> Computing dependencies for cmake ---> Cleaning cmake ---> Computing dependencies for readline ---> Cleaning readline ---> Computing dependencies for gdbm ---> Cleaning gdbm Warning: No port perl5.8 found in the index. ---> Computing dependencies for llvm-8.0 ---> Cleaning llvm-8.0 ---> Scanning binaries for linking errors ---> Found 9 broken files, matching files to ports ---> Found 4 broken ports, determining rebuild order ---> Rebuilding in order cmake @3.15.5 readline @8.0.000 gdbm @1.18.1 llvm-8.0 @8.0.1 Warning: The macOS 10.14 SDK does not appear to be installed. Ports may not build correctly. Warning: You can install it as part of the Xcode Command Line Tools package by running `xcode-select --install'. ---> Computing dependencies for cmake ---> Fetching distfiles for cmake ---> Attempting to fetch cmake-3.15.5.tar.gz from https://distfiles.macports.org/cmake ---> Verifying checksums for cmake ---> Extracting cmake ---> Applying patches to cmake ---> Configuring cmake ---> Building cmake ---> Staging cmake into destroot ---> Deactivating cmake @3.15.5_0 ---> Cleaning cmake ---> Uninstalling cmake @3.15.5_0 ---> Cleaning cmake Warning: The macOS 10.14 SDK does not appear to be installed. Ports may not build correctly. Warning: You can install it as part of the Xcode Command Line Tools package by running `xcode-select --install'. ---> Computing dependencies for cmake ---> Installing cmake @3.15.5_0 ---> Activating cmake @3.15.5_0 ---> Cleaning cmake Warning: The macOS 10.14 SDK does not appear to be installed. Ports may not build correctly. Warning: You can install it as part of the Xcode Command Line Tools package by running `xcode-select --install'. ---> Computing dependencies for readline ---> Fetching distfiles for readline ---> Attempting to fetch readline-8.0.tar.gz from https://distfiles.macports.org/readline ---> Verifying checksums for readline ---> Extracting readline ---> Applying patches to readline ---> Configuring readline ---> Building readline ---> Staging readline into destroot ---> Unable to uninstall readline @8.0.000_0, the following ports depend on it: ---> gdbm @1.18.1_1 Warning: Uninstall forced. Proceeding despite dependencies. ---> Deactivating readline @8.0.000_0 ---> Cleaning readline ---> Uninstalling readline @8.0.000_0 ---> Cleaning readline Warning: The macOS 10.14 SDK does not appear to be installed. Ports may not build correctly. Warning: You can install it as part of the Xcode Command Line Tools package by running `xcode-select --install'. ---> Computing dependencies for readline ---> Installing readline @8.0.000_0 ---> Activating readline @8.0.000_0 ---> Cleaning readline Warning: The macOS 10.14 SDK does not appear to be installed. Ports may not build correctly. Warning: You can install it as part of the Xcode Command Line Tools package by running `xcode-select --install'. ---> Computing dependencies for gdbm ---> Fetching distfiles for gdbm ---> Attempting to fetch gdbm-1.18.1.tar.gz from https://distfiles.macports.org/gdbm ---> Verifying checksums for gdbm ---> Extracting gdbm ---> Applying patches to gdbm ---> Configuring gdbm Error: Failed to configure gdbm, consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_databases_gdbm/gdbm/work/gdbm-1.18.1/config.log Error: Failed to configure gdbm: configure failure: command execution failed Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_databases_gdbm/gdbm/main.log for details. Error: rev-upgrade failed: Error rebuilding gdbm Error: Follow https://guide.macports.org/#project.tickets to report a bug. -- Then I took the advise to "install SDK as part o
Re: failure to get gcc9 running
Hi Peter, Ryan and Chris Thanks for your help. Reply to Chris Jones: -- I am not sure that I removed all ports, how can I find out? -- How do I create an empty vanilla MacPorts installation? By 'port -u uninstall'? To Ryan Schmidt: -- (1) Attached is "1a. output of upgrade" and "1b. plist". I can not make anything of it. -- (2) I see some perl file dating from 2010 in /opt/local/bin (see attached "2. old perl files").How to update "libpreludedb's +perl variant"? -- (3) Attached is the list of the "3. old local portfiles". In fact, they date from 2014, but they also have a copy labeled ".default". Should I just delete all of them? -- (4) Attached are the two gdbm Error logfiles ("4a. gdbm error main logfile" and "4b. gdbm error config logfile" and). Frankly, I am not able to distill a procedure to follow from them. To Peter Homann: -- Good warning on what might be in store when I update again to Catalina! -- To start afresh, should I juste do 'sudo port uninstall gcc9' and then 'sudo port install gcc9'? I am inclined to just start afresh, but I am very interested in all of your suggestions, since I have another iMac to go (from 2014), that has been upgraded to macOS 10.14 with the old port files on it (I never upgraded ports since all was working fine, until the recent upgrde to 10.14). Thanks in advance, Hans ____ From: Ryan Schmidt Sent: Monday, November 4, 2019 7:49 PM To: Hans Goedbloed Cc: MacPorts Users Subject: Re: failure to get gcc9 running On Nov 4, 2019, at 10:12, Hans Goedbloed wrote: > [/Users/hansgoedbloed]$sudo port install gcc9 > Password: > ---> Computing dependencies for gcc9 > ---> Cleaning gcc9 First things first: this shows that gcc9 was already successfully installed before you ran this command. > ---> Updating database of binaries > ---> Scanning binaries for linking errors > ---> Found 9 broken files, matching files to ports > ---> Found 4 broken ports, determining rebuild order > You can always run 'port rev-upgrade' again to fix errors. > The following ports will be rebuilt: > cmake @3.15.5 > readline @8.0.000 > gdbm @1.18.1 > llvm-8.0 @8.0.1 > Continue? [Y/n]: y After any port install or upgrade, MacPorts checks all installed ports for linking errors. It found some on your system. We would need to see the output of "sudo port -d rev-upgrade" to know specifically what problems were found with those ports. > Warning: No port perl5.8 found in the index. perl5.8 was removed a long time ago. The current version is perl5.30. Nothing in MacPorts should be referencing perl5.8 anymore. (I found one port that was; I filed a ticket: https://trac.macports.org/ticket/59600) Do you perhaps have any local Portfiles (check your /opt/local/etc/macports/sources.conf file) that might be very old and out of date? > Warning: The macOS 10.14 SDK does not appear to be installed. Ports may not > build correctly. > Warning: You can install it as part of the Xcode Command Line Tools package > by running `xcode-select --install'. I see below that you did run this command. Good. > ---> Computing dependencies for cmake > ---> Fetching distfiles for cmake > ---> Attempting to fetch cmake-3.15.5.tar.gz from > https://distfiles.macports.org/cmake > ---> Verifying checksums for cmake > ---> Extracting cmake > ---> Applying patches to cmake > ---> Configuring cmake > ---> Building cmake > ---> Staging cmake into destroot > ---> Deactivating cmake @3.15.5_0 > ---> Cleaning cmake > ---> Uninstalling cmake @3.15.5_0 > ---> Cleaning cmake > Warning: The macOS 10.14 SDK does not appear to be installed. Ports may not > build correctly. > Warning: You can install it as part of the Xcode Command Line Tools package > by running `xcode-select --install'. > ---> Computing dependencies for cmake > ---> Installing cmake @3.15.5_0 > ---> Activating cmake @3.15.5_0 > ---> Cleaning cmake > Warning: The macOS 10.14 SDK does not appear to be installed. Ports may not > build correctly. > Warning: You can install it as part of the Xcode Command Line Tools package > by running `xcode-select --install'. > ---> Computing dependencies for readline > ---> Fetching distfiles for readline > ---> Attempting to fetch readline-8.0.tar.gz from > https://distfiles.macports.org/readline > ---> Verifying checksums for readline > ---> Extracting readline > ---> Applying patches to readline > ---> Configuring readline > ---> Building readline > ---> Staging readline into destroot > ---> Unable to uninstall readline @8.0.000_0, the f
Re: failure to get gcc9 running
l @0.21_0 (active) platform='darwin 18' archs='x86_64' date='2019-11-09T12:09:18+0100' ld64 @3_1+ld64_xcode (active) platform='darwin 18' archs='x86_64' date='2019-11-09T12:09:18+0100' ld64-xcode @2_1 (active) platform='darwin 18' archs='x86_64' date='2019-11-09T12:09:18+0100' libcxx @5.0.1_4 (active) platform='darwin 18' archs='noarch' date='2019-11-09T12:08:38+0100' libedit @20191025-3.1_0 (active) platform='darwin 18' archs='x86_64' date='2019-11-09T12:08:41+0100' libffi @3.2.1_0 (active) platform='darwin 18' archs='x86_64' date='2019-11-09T12:08:42+0100' libiconv @1.16_0 (active) platform='darwin 18' archs='x86_64' date='2019-11-09T12:08:48+0100' libxml2 @2.9.9_3 (active) platform='darwin 18' archs='x86_64' date='2019-11-09T12:08:52+0100' llvm-8.0 @8.0.1_0 (active) platform='darwin 18' archs='x86_64' date='2019-11-09T12:09:10+0100' llvm_select @2_0 (active) platform='darwin 18' archs='noarch' date='2019-11-09T12:08:42+0100' ncurses @6.1_0 (active) platform='darwin 18' archs='x86_64' date='2019-11-09T12:08:38+0100' openssl @1.1.1d_0 (active) platform='darwin 18' archs='x86_64' date='2019-11-09T12:08:53+0100' xar @1.6.1_4 (active) platform='darwin 18' archs='x86_64' date='2019-11-09T12:09:05+0100' xz @5.2.4_0 (active) platform='darwin 18' archs='x86_64' date='2019-11-09T12:08:51+0100' zlib @1.2.11_0 (active) platform='darwin 18' archs='x86_64' date='2019-11-09T12:08:51+0100' A number of ports are there, but not the essential ones pertaining to gcc9. No clou on how to proceed! --- Attached: Failed installation gcc9 - (1) Terminal Saved Output 9-11-2019 Failure report man.log - (2) Terminal Saved Output 9-11-2019 From: Chris Jones Sent: Tuesday, November 5, 2019 2:47 PM To: Hans Goedbloed; Ryan Schmidt; trainma...@gmail.com Cc: MacPorts Users Subject: Re: failure to get gcc9 running On 05/11/2019 12:28 pm, Hans Goedbloed wrote: > > Hi Peter, Ryan and Chris > > Thanks for your help. > > Reply to Chris Jones: > -- I am not sure that I removed all ports, how can I find out? > -- How do I create an empty vanilla MacPorts installation? > By 'port -u uninstall'? > > > To Ryan Schmidt: > -- (1) Attached is "1a. output of upgrade" and "1b. plist". I can not make > anything of it. You mis-typed the command... Its > sudo port -d rev-upgrade not > sudo port -d rev -upgrade i.e. rev-upgrade is one word. I have no idea what the plist file you sent is for ? > -- (2) I see some perl file dating from 2010 in /opt/local/bin (see attached > "2. old perl files").How to update "libpreludedb's +perl variant"? > sudo port sync > sudo port upgrade outdated > -- (3) Attached is the list of the "3. old local portfiles". In fact, they > date from 2014, but they also have a copy labeled ".default". Should I just > delete all of them? That is not what Ryan asked for. He asked if you had configured your local installation to use a custom local Portfiles. i.e. have you *changed* /opt/local/etc/macports/sources.conf ?? ( At this point though, given all the problems you have its going to be very hard I would say for anyway to understand what you have, and have not done to your system, as part of the upgrade process, so probably the simplest approach is to wipe out the macports installation and start afresh. Just my view, others might disagree. ) Chris Failed installation gcc9 - (1) Terminal Saved Output 9-11-2019 Description: Failed installation gcc9 - (1) Terminal Saved Output 9-11-2019 Failure report main.log - (2) Terminal Saved Output 9-11-2019 Description: Failure report main.log - (2) Terminal Saved Output 9-11-2019
Re: failure to get gcc9 running
? Thanks a lot Ryan! Macports and the gfortran compiler now work on all my nachines. Cheers, Hans From: Ryan Schmidt Sent: Saturday, November 9, 2019 5:53 PM To: Hans Goedbloed Cc: Chris Jones; trainma...@gmail.com; MacPorts Users Subject: Re: failure to get gcc9 running On Nov 9, 2019, at 08:48, Hans Goedbloed wrote: (Since there are numerous complaints on Xcode 11.2 and Catalina, I downloaded Xcode 10.0.) It's true that using Xcode 11.x on Mojave with MacPorts can be problematic right now and we recommend using Xcode 10.x on Mojave. But you should use the latest version of Xcode 10.x, which is 10.3. Install the Xcode 10.3 version of the command line tools too. ---> Installing libgcc9 @9.2.0_1 Error: Failed to install libgcc9: no destroot found at: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc9/libgcc9/work/destroot See: https://trac.macports.org/wiki/ProblemHotlist#nodestrootfound