Ticket #15571 (new enhancement)
request - uniform Portfile standard to handle the different possibilities of Fortran compilers
| Reported by: | davidh@… | Owned by: | macports-tickets@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | 1.6.0 |
| Keywords: | fortran portgroup | Cc: | davidh@…, mcalhoun@…, ram@… |
| Port: |
Description
I don't write code in Fortran, but some of the ports I use require Fortran.
Different Portfiles depend on different Fortran compilers. Contrast fftw-3(g95, gfortran/gcc4.2, gfortan/gcc4.3) pgplot(g77 on PPC, gfortran/gcc4.2 on i386) and cfitsio(gfortran/gcc42). There are at least 4 compilers to choose from.
My request: formulate a standard to allow any of the compilers to be selected with a variant. The fftw-3 Portfile comes closest with variants to select any one of 3 compilers. If possible, I'd like to see g77 deprecated.
Change History
comment:2 Changed 5 years ago by raimue@…
- Keywords fortran portgroup added
- Owner changed from markd@… to macports-tickets@…
- Component changed from guide to ports
- Milestone set to Port Enhancements
I think it would be nice to have some fortran PortGroup which just adds different variants selecting the appropriate compiler. So we can avoid the code duplication needed in each port.
comment:5 Changed 4 years ago by mcalhoun@…
I agree with the points here.
pgplot now uses g95 by default and the user can choose gfortran 4.2 or 4.3 through variants.
It seems to me, however, that these types of changes must be done on a port by port basis.
I am not sure how a PortGroup could be constructed to be general enough for all the ports which use Fortran.
Unless someone has a better idea, I humbly suggest that this ticket be closed as "wontfix."
comment:6 follow-up: ↓ 7 Changed 4 years ago by blb@…
Automatically setting the variants as appropriate via a port group could consist of taking a few arguments in a setup proc (like perl5 and haskell groups), one being a list of which ports are supported for fortran (eg, g95, gcc42, gcc43), the second being what to add to configure.args, and the third what to delete from it. Then the group would manipulate configure.args as appropriate and set configure.{f77|fc}, all in each variant as needed.
comment:7 in reply to: ↑ 6 Changed 4 years ago by mcalhoun@…
Replying to blb@…:
Automatically setting the variants as appropriate via a port group could consist of taking a few arguments in a setup proc (like perl5 and haskell groups), one being a list of which ports are supported for fortran (eg, g95, gcc42, gcc43), the second being what to add to configure.args, and the third what to delete from it. Then the group would manipulate configure.args as appropriate and set configure.{f77|fc}, all in each variant as needed.
It seems like most of the operations mentioned require as many lines of code with a PortGroup framework as without one.
The exceptions being configure.{f77|fc|f90}, which, I will admit, is somewhat of an annoyance to set for g95, gcc42, and gcc43.
Other than that, I am not quite sure I see what a PortGroup buys.


Cc Me!