Thank you Marius, it did not help. I also reboot the machine. Now I am getting:
ld: library not found for -lm collect2: error: ld returned 1 exit status I am not sure whether the message from collect2 was there before running sudo port select gcc mp-gcc-devel. I am using bash, but in default zsh it behaves the same. pmm:work pet$ env SHELL=/bin/zsh XPC_FLAGS=0x0 TERM_PROGRAM_VERSION=440 __CFBundleIdentifier=com.apple.Terminal SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.SMYfudJeEJ/Listeners TERM_SESSION_ID=1AAB1E17-A7F0-4363-9F82-6F387012CAC1 PWD=/Users/pet/work LOGNAME=pet HOME=/Users/pet TMPDIR=/var/folders/tk/dp822xl925n937bzfkc1t6v00000gn/T/ TERM=xterm-256color USER=pet DISPLAY=/private/tmp/com.apple.launchd.EJPRpCSOgP/org.macports:0 SHLVL=1 XPC_SERVICE_NAME=0 LC_CTYPE=UTF-8 LC_COLLATE=C PATH=/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin OLDPWD=/Users/pet TERM_PROGRAM=Apple_Terminal _=/usr/bin/env Petr ______________________________________________________________ > Od: "Marius Schamschula" <[email protected]> > Komu: "Gerben Wierda via macports-users" <[email protected]> > Datum: 20.03.2021 15:24 > Předmět: Re: gfortran for M1? > >Petr, > >sudo port select gcc mp-gcc-devel > >will add links so that the binaries, includes and libraries can be found. > >> On Mar 20, 2021, at 8:59 AM, <[email protected]> <[email protected]> >> wrote: >> >> Thank you Chris, >> >> I found gfortran-mp-devel in /opt/local/bin. >> >> However trying to compile my source a got linker error: >> ld: library not found for -lm >> >> And I am lost again. I did not specified any linker options, >> just compiler options: >> -g -fbounds-check -ffpe-trap=invalid,zero,overflow >> -ffpe-summary=invalid,zero,overflow -fno-sign-zero -fno-automatic >> -Wuninitialized >> >> (Sorry for beginner question. Google did not help.) >> >> Petr >> >> ______________________________________________________________ >>> Od: "Chris Jones" <[email protected]> >>> Komu: [email protected] >>> Datum: 20.03.2021 14:04 >>> Předmět: Re: gfortran for M1? >>> >>> CC: <[email protected]> >>> Hi, >>> >>> Gcc-devel provides gfortran for M1 machines by default. >>> >>> Chris >>> >>>> On 20 Mar 2021, at 1:01 pm, [email protected] wrote: >>>> >>>> Is it already possible to install gfortran on M1? >>>> It seems that gcc-devel does not have +gfortran variant and and other gcc >>>> versions are not compatible. >>>> Thank you, >>>> Petr >>> >>> >>> > >Marius >-- >Marius Schamschula > > >
