Opened 11 years ago

Closed 10 years ago

#9978 closed enhancement (fixed)

Add a test for the maths library in the 'prereq' script.

Reported by: drkirkby Owned by: drkirkby
Priority: minor Milestone: sage-4.7
Component: build Keywords:
Cc: jhpalmieri, nthiery Merged in: sage-4.7.alpha4
Authors: David Kirkby Reviewers: Nicolas M. Thiéry
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by drkirkby)

The 'prereq' script in $SAGE_ROOT/spkg/base is currently version 0.7. This does not check that the maths library libm exists. I thought that was pretty much a formality, but it is not on AIX, where the shared maths library /usr/lib/libm.a does not get installed by default. This may also be the case on other operating systems, including perhaps some cut-down Linux distributions, though I'm not aware of any system other than AIX where the maths library does not get installed on a basic installation of the operating system.

-bash-4.1$ ls /usr/lib/libm*
/usr/lib/libmbx.a

The maths library is part of the bos.adt fileset. Hence a test for the maths library should be added. After installing bos.adt, so the maths library exists:

-bash-4.1$ ls /usr/lib/libm*
/usr/lib/libm.a       /usr/lib/libmbx.a     /usr/lib/libm_r.a     /usr/lib/libmsaa.a    /usr/lib/libmsaa_r.a

Notes for reviewers

You will need to copy the prereq-0.8.tar from this ticket and the prereq-0.8-install script from #11070 to $SAGE_ROOT/spkg/base For the purposes of reviewing this ticket, you only need to look at the changes to configure.ac.

Notes for the release manager

This ticket must be merged with #11070, which also has positive review. Each depends on the other. Some notes about the upgrade process are given on #11070

Dave

Attachments (2)

9978-Changes-to-configure.ac.diff (1.5 KB) - added by drkirkby 10 years ago.
Changes to the configure.ac file which check that sqrt exists in the maths library.
prereq-0.8.tar (1.3 MB) - added by drkirkby 10 years ago.
New tar file. This does not need reviewing. Changes from prereq-0.7.tar are due to changes in the configure.ac file, which is in the tar file

Download all attachments as: .zip

Change History (13)

comment:1 Changed 10 years ago by drkirkby

  • Authors set to David Kirkby
  • Cc jhpalmieri added
  • Component changed from AIX or HP-UX ports to build
  • Description modified (diff)
  • Milestone changed from sage-wishlist to sage-4.7
  • Status changed from new to needs_review
  • Type changed from defect to enhancement

comment:2 follow-up: Changed 10 years ago by malb

I read the patch and it looks good. I haven't tested it, though.

comment:3 in reply to: ↑ 2 Changed 10 years ago by drkirkby

Replying to malb:

I read the patch and it looks good. I haven't tested it, though.

Thank you.

comment:4 Changed 10 years ago by drkirkby

Here is some results when installed on my IBM RS/6000, which runs AIX 5.3.

-bash-4.1$ uname
AIX

Here's the output after running "make" on the AIX system, which has the maths library installed, since the bos.adt fileset was installed.

-bash-4.1$ uname 
AIX
-bash-4.1$ make

<snip irrelevant output>

Starting prerequisite check.
Machine: AIX aixbox 3 5 000245984C00
prereq-0.8/
prereq-0.8/install-sh
prereq-0.8/aclocal.m4

<snip out irrelevant output>

checking for sqrt in -lm... yes
checking for sqrtl in -lm... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands

Then I removed the maths library, /usr/lib/libm.a.

-bash-4.1$ su
root's Password:
# mv /usr/lib/libm.a /usr/lib/foo
# exit

Then after running make, we see that the 'prereq' script exits with an error.

checking for sqrt in -lm... no
configure: This system has no maths library installed.
configure: On AIX, this is in the bos.adt.libm fileset.
configure: Actually, we recommend to install the complete bos.adt fileset.
configure: This needs to be performed by a system administrator.
configure: error: Exiting, since a maths library was not found.
 ERROR: You do not have all of the prerequisites needed
 to build Sage from source.  See the errors above.
make[1]: *** [installed/prereq-0.8] Error 1
make[1]: Leaving directory `/home/users/drkirkby/sage-4.7.alpha1/spkg'

real    0m54.880s
user    0m29.577s
sys     0m10.611s
Error building Sage.
make: *** [build] Error 1

Finally, I did manage to remember to restore my maths library!

-bash-4.1$ su
root's Password:
# mv /usr/lib/foo /usr/lib/libm.a
# exit
-bash-4.1$ 

comment:5 Changed 10 years ago by drkirkby

  • Cc jhpalmieri. nthiery added; jhpalmieri removed

Nicolas M. Thiéry wrote on sage-devel

I did not actually run the code, especially on AIX, but trust you did
(both with and without libm installed). Reading it sounds very
reasonable; I am thus ready to give it a positive review.

Quick variant:

    # On AIX libm is not installed by default - strange as that might seem -
    # While we are it, bos.adt is likely to contain other useful things for Sage
    if test "x`uname`" = 'xAIX'
    then
       AC_MSG_NOTICE([On AIX, libm is contained in the bos.adt.libm fileset.]) 
       AC_MSG_NOTICE([Actually, we recommend to install the complete bos.adt fileset.]) 

Cheers,
				Nicolas

The patch has been changed to include Nicolas's revised wording on the error message that is generated.

comment:6 Changed 10 years ago by drkirkby

  • Cc jhpalmieri added; jhpalmieri. removed

Somehow I managed to remove John. I've put him back!

Changed 10 years ago by drkirkby

Changes to the configure.ac file which check that sqrt exists in the maths library.

Changed 10 years ago by drkirkby

New tar file. This does not need reviewing. Changes from prereq-0.7.tar are due to changes in the configure.ac file, which is in the tar file

comment:7 Changed 10 years ago by drkirkby

I realised that I had not used Nicolas's exact wording for one of the messages, which was better than my own. Hence I have rebuilt the tar file. I checked again on AIX, and this is what it produced when I temporarily removed the maths library /usr/lib/libm.a

checking for sqrt in -lm... no
configure: This system has no maths library installed.
configure: On AIX, libm is contained in the bos.adt.libm fileset.
configure: Actually, we recommend to install the complete bos.adt fileset.
configure: This needs to be performed by a system administrator.
configure: error: Exiting, since a maths library was not found.
 ERROR: You do not have all of the prerequisites needed
 to build Sage from source.  See the errors above.
make[1]: *** [installed/prereq-0.8] Error 1
make[1]: Leaving directory `/home/users/drkirkby/sage-4.7.alpha1/spkg'

real    0m55.207s
user    0m29.541s
sys     0m10.628s
Error building Sage.
make: *** [build] Error 1

comment:8 Changed 10 years ago by nthiery

  • Status changed from needs_review to positive_review

comment:9 Changed 10 years ago by drkirkby

  • Description modified (diff)

comment:10 Changed 10 years ago by jdemeyer

  • Reviewers set to Nicolas M. Thiéry

comment:11 Changed 10 years ago by jdemeyer

  • Merged in set to sage-4.7.alpha4
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.