compilers PortGroup

Mark Brethen mark.brethen at gmail.com
Wed Jul 6 21:40:16 UTC 2022


The source is a combination of C and fortran, so a C-compiler with fortran is needed-preferably gcc. The gcc8 build is the only one that does not issue those warnings. But I have successfully run verification test cases packaged with the source against gcc8, gcc9, gcc11 and gfortran builds.  

The compilers PortGroup sets gfortran by default with these settings:

compilers.choose    fc cc
compilers.setup     require_fortran -g95 -clang

But it uses clang to compile the C-code. I tried blacklisting clang but then it wants to install clang-14. Choosing a gcc variant uses its associated mp-gfortan compiler.





Mark Brethen
mark.brethen at gmail.com



> On Jul 6, 2022, at 2:18 PM, Dave Allured - NOAA Affiliate via macports-dev <macports-dev at lists.macports.org> wrote:
> 
> Mark, those are specifically fortran issues, not C.  Both of those warnings refer to fortran constructs which were declared obsolescent in fortran 90.  That is a long time ago.  However, it looks like your modern gfortran version is still compiling these constructs correctly, but issuing compile time warnings.  This is most appropriate.  If possible, test functionality to ensure that part about "compiling correctly" is not a lie.
> 
> I suggest best practice is to /not/ cover up these warnings with some -std option or other sort of patch.  If the build works, then leave the warnings in place for future benefit.  For best results, request an upstream fix to replace these deleted constructs with more modern constructs, or submit your own upstream fix.  Both fixes are straightforward fortran.
> 
> 
> On Tue, Jul 5, 2022 at 9:22 PM Mark Brethen <mark.brethen at gmail.com <mailto:mark.brethen at gmail.com>> wrote:
> I have the compiler.setup so that gfortran is selected by default, however checking the build log I’m seeing these warning messages:
> 
> Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 215 at (1)
> 
> Warning: Fortran 2018 deleted feature: Arithmetic IF statement at (1)
> 
> Those messages are only warnings. But to side-step these issues, do I need to add the -std option to specify which version of the fortran standard to use when compiling?
> 
> E.g. compiler.c_standard   2008
> 
> Thanks
> Mark
> 
> 
> > On Jul 4, 2022, at 9:36 AM, Mark Brethen <mark.brethen at gmail.com <mailto:mark.brethen at gmail.com>> wrote:
> > 
> > Sorry for the confusion, 'sudo port build xyx'.
> > 
> > Mark Brethen
> > mark.brethen at gmail.com <mailto:mark.brethen at gmail.com>
> > 
> > 
> >> On Jul 4, 2022, at 9:07 AM, Joshua Root <jmr at macports.org <mailto:jmr at macports.org>> wrote:
> >> 
> >> On 2022-7-4 23:24 , Mark Brethen wrote:
> >>> Here’s what I’ve observed:
> >>> compilers.choose fc cc
> >>> compiler.setup  require_fortran -g95 -clang
> >>> If I issue sudo port xyz +gcc11, I get ${configure.cc} = /usr/bin/clang.
> >> 
> >> What is xyz? When are you reading the variable? If it's before the variants execute, you won't see the changes they make.
> >> 
> >> - Josh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20220706/5642fda4/attachment.htm>


More information about the macports-dev mailing list