## #7485 closed defect (fixed)

# make fortran a prerequisite on all platforms except OS X. Remove g95 binaries from Sage

Reported by: | William Stein | Owned by: | William Stein |
---|---|---|---|

Priority: | critical | Milestone: | sage-4.3.1 |

Component: | build | Keywords: | |

Cc: | Merged in: | sage-4.3.1.rc2 | |

Authors: | William Stein | Reviewers: | Minh Van Nguyen |

Report Upstream: | N/A | Work issues: | |

Branch: | Commit: | ||

Dependencies: | Stopgaps: |

### Description (last modified by )

The package fortran-20071120.p9 has Fortran compilers for various systems. William Stein said:

http://groups.google.com/group/sage-devel/msg/b4cf0f10ed040d5d

"I think in sage-4.3 on, we should *only* include fortran compilers for OS X, and *nothing* else."

### Change History (10)

### comment:1 Changed 13 years ago by

Description: | modified (diff) |
---|---|

Report Upstream: | → N/A |

### comment:2 Changed 13 years ago by

Status: | new → needs_review |
---|

### comment:3 Changed 13 years ago by

The new Fortran spkg cuts about 7 MB. The Fortran spkg in Sage 4.3.1.rc0 is about 40MB:

mvngu@mod standard]$ du -hs fortran-20071120.p9.spkg 40M fortran-20071120.p9.spkg

while the new spkg is about 33 MB:

[mvngu@mod fortran]$ du -hs fortran-20100117.spkg 33M fortran-20100117.spkg

That should be good news for mirroring and downloading the source distribution. Just a trivial nit-pick. The file `spkg-install`

has changes that are not yet checked in:

[mvngu@mod fortran-20100117]$ hg st M spkg-install

Since the Linux Fortran binaries have been removed from the Fortran spkg, do you still want to keep the following conditional in the file `spkg-install`

? Between lines 75--81:

elif OS == 'linux': if arch == 'x86_64': print "Installing Linux x86-64 g95 compiler" file = 'g95_linux_64.tar.bz2' elif arch == 'i686' or arch == 'i586' or arch == 'i486' or arch == 'i386': print "Installing Linux i686 g95 compiler" file = 'g95_linux_32.tar.bz2'

### comment:4 Changed 13 years ago by

Since the Linux Fortran binaries have been removed from the

Fortran spkg, do you still want to keep the following conditional in the file spkg-install?

I do. I want to make minimal changes to the spkg so that it works. I'm not keen on breaking anything, and there is arbitrarily much that can go wrong.

Note that in future we should be able to get rid of the rest of the g95 binaries, shrinking the size of the spkg another 10MB or so.

The new spkg is here:

http://wstein.org/home/wstein/patches/fortran-20100118.spkg

It just checks in the changes.

### comment:5 Changed 13 years ago by

Authors: | → William Stein |
---|---|

Reviewers: | → Minh Van Nguyen |

Status: | needs_review → positive_review |

Looks good. On Linux and Solaris machines (mod.math, rosemary.math, t2.math), only the script `sage_fortran`

is installed under `SAGE_LOCAL/bin`

. This is in contrast to the previous behaviour, which was to install Linux Fortran binaries regardless of whether the Linux system already had a system-wide Fortran compiler. On OS X machine (bsd.math), `sage_fortran`

and OS X specific Fortran binaries are installed under `SAGE_LOCAL/bin`

as expected. I tested fortran-20100118.spkg with Sage 4.3.1.rc1 on mod.math, rosemary.math, and bsd.math. Doctesting resulted in the following known failure as reported on sage-devel:

[mvngu@boxen sage-4.3.1.rc1]$ ./sage -t -long devel/sage-main/sage/misc/sagedoc.py sage -t -long "devel/sage-main/sage/misc/sagedoc.py" ********************************************************************** File "/dev/shm/mvngu/sage-4.3.1.rc1/devel/sage-main/sage/misc/sagedoc.py", line 365: sage: 'abvar/homology' in _search_src_or_doc('doc', 'homology', 'variety', interact=False) Expected: True Got: False ********************************************************************** 1 items had failures: 1 of 7 in __main__.example_5 ***Test Failed*** 1 failures. For whitespace errors, see the file /dev/shm/mvngu/dot_sage/tmp/.doctest_sagedoc.py [20.8 s] exit code: 1024

The changes in this updated Fortran spkg are minimal. Linux specific Fortran binaries have been removed. The install script `spkg-install`

is essentially as it was previously, with the added test that if the current system is Linux, then test to see if that system has a Fortran compiler.

### comment:6 Changed 13 years ago by

Merged in: | → sage-4.3.1.rc2 |
---|---|

Resolution: | → fixed |

Status: | positive_review → closed |

### comment:7 Changed 13 years ago by

### comment:8 Changed 13 years ago by

See #7484 for a follow-up to update README.txt to require Fortran as a pre-requisite under Linux.

### comment:9 Changed 13 years ago by

See #8024 for an update to 'prereq' to check a Fortran compiler exists on platforms other than OS X.

### comment:10 Changed 13 years ago by

Why not include it for Linux? I think having a good fortran compiler is essential for library dependencies such as BLAS

**Note:**See TracTickets for help on using tickets.

Here is the spkg:

Note, after first trying to do something very complicated, involving changing the gfortran OS X binary to really use its quadcore stuff, etc., etc., I realized that could cause endless trouble, so can be put off. So the point of this spkg is just a very simple and humble goal -- no more g95 binaries when building Sage on linux. That is it.

Oh, regarding SAGE_FORTRAN_LIB, one shouldn't need to set that unless one's setup is weird, in which case one sets SAGE_FORTAN and SAGE_FORTRAN_LIB anyways. So in the attached spkg, I only set SAGE_FORTRAN, not SAGE_FORTRAN_LIB.

NOTE: On Linux, this spkg change makes Sage depend on having gfortran installed. So it would be a good idea to update prereq accordingly, but that should not be part of this ticket.