Ticket #9177 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

cddlib has hard-coded gmp path

Reported by: vbraun Owned by: tbd
Priority: major Milestone: sage-4.5
Component: packages: standard Keywords:
Cc: dimpase, drkirkby Work issues:
Report Upstream: Not yet reported upstream; Will do shortly. Reviewers: David Kirkby, Mike Hansen
Authors: Volker Braun Merged in: sage-4.5.alpha0
Dependencies: Stopgaps:

Description

Cddlib's ./configure script should support --with=gmp=<path>. This ticket is a followup to #8730, where a stopgap measure was implemented instead. This ticket will provide rewritten autotools sources (configure.ac and Makefile.am's) to achieve this.

Change History

comment:1 Changed 3 years ago by vbraun

  • Cc dimpase, drkirkby added
  • Status changed from new to needs_review

Here is the updated spkg. It works for me on F12 x86_64 but would be great if somebody can test it on SPARC.

 http://www.stp.dias.ie/~vbraun/Sage/spkg/cddlib-094f.p7.spkg

There is now a script at patches/refresh_autogenerated.sh that should explain how to rerun autotools and update patches/autogenerated.

comment:2 Changed 3 years ago by drkirkby

  • Status changed from needs_review to needs_work

The package installs in 32-bit Solaris SPARC and on 64-bit OpenSolaris x64. However, the refresh_autogenerated.sh script has a GNUism:

pushd autogenerated
for i in `find -type f` ; do cp -a $BUILDDIR/$i $i ; done
popd

-a is not an POSIX option to 'cp' so will fail:

kirkby@t2:[~/sage-4.4.3/spkg/optional/cddlib-094f.p7/patches] $ cp -a src-Makefile.am x
cp: illegal option -- a
Usage: cp [-f] [-i] [-p] [-@] f1 f2
       cp [-f] [-i] [-p] [-@] f1 ... fn d1
       cp -r|-R [-H|-L|-P] [-f] [-i] [-p] [-@] d1 ... dn-1 dn

See:

 http://www.opengroup.org/onlinepubs/009695399/utilities/cp.html

for a list of acceptable options for 'cp'.

Also, other errors I managed to induce:

Copying autogenerated files from autogenerated
./refresh_autogenerated.sh: pushd: not found
find: illegal option -- t
find: [-H | -L] path-list predicate-list
./refresh_autogenerated.sh: popd: not found

See  http://www.opengroup.org/onlinepubs/009695399/utilities/find.html for POSIX options to 'find'

pushd and popd are not supported in the /bin/sh on Solaris, though the usual

#!/usr/bin/env bash

will invoke bash, which will support such options.

A couple of minor points.

  • It is usual to provide a diff between the files written and those in the source code, though I must admit I feel they are of very limited use, as I could create one if I wanted.
  • It would be wise to stick the minimum versions of autoconf/automake needed - there are macros for that. I noticed configure.ac has no such entry.

Dave

comment:3 follow-up: ↓ 6 Changed 3 years ago by vbraun

  • Status changed from needs_work to needs_review

I updated the  http://www.stp.dias.ie/~vbraun/Sage/spkg/cddlib-094f.p7.spkg to

  • only use portable cp options
  • only use portable find options
  • removed use of pushd/popd
  • fixed all autoscan warnings, including the missing AC_PREREQ

There is no patch file for the autotools sources since they are all in patches/ and not in the corresponding directory structure under src/. Patches would also not be very useful since the new autotools sources are essentially a complete rewrite.

comment:4 Changed 3 years ago by mhansen

  • Status changed from needs_review to needs_work

The new spkg fails on Cygwin with the following issues

libtool: link: gcc -g -O2 -o .libs/scdd_gmp.exe simplecdd.o  -L/home/wstein/sage-4.4.3/local/lib /home/wstein/sage-4.4.3/local/lib/libgmp.dll.a ../lib-src-gmp/.libs/libcddgmp.a -L/home/wstein/sage-4.4.3/local/lib
../lib-src-gmp/.libs/libcddgmp.a(cddlib.o): In function `dd_InitialDataSetup':
/home/wstein/sage-4.4.3/spkg/build/cddlib-094f.p7/src/lib-src-gmp/cddlib.c:153: undefined reference to `__imp____gmpq_init'
/home/wstein/sage-4.4.3/spkg/build/cddlib-094f.p7/src/lib-src-gmp/cddlib.c:162: undefined reference to `__imp____gmpq_init'
/home/wstein/sage-4.4.3/spkg/build/cddlib-094f.p7/src/lib-src-gmp/cddlib.c:180: undefined reference to `__imp____gmpq_set'
...

comment:5 Changed 3 years ago by vbraun

I've updated the spkg at  http://www.stp.dias.ie/~vbraun/Sage/spkg/cddlib-094f.p7.spkg to include -lgmp when linking in lib-src-gmp/, that should resolve the issue. Please let me know if it works...

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

Replying to vbraun:

I updated the  http://www.stp.dias.ie/~vbraun/Sage/spkg/cddlib-094f.p7.spkg to

  • only use portable cp options
  • only use portable find options
  • removed use of pushd/popd
  • fixed all autoscan warnings, including the missing AC_PREREQ

Thank you.

There is no patch file for the autotools sources since they are all in patches/ and not in the corresponding directory structure under src/. Patches would also not be very useful since the new autotools sources are essentially a complete rewrite.

Fair enough.

The other point I made is that I believe you should use macros that stops people using an old version of autoconf or automake to rebuild the files, since I doubt you can be sure your code will work on old versions. See

 http://www.gnu.org/software/autoconf/manual/autoconf.html#Versioning

 http://www.gnu.org/software/automake/manual/automake.html#API-Versioning

so I would put something like:

AC_PREREQ([x.y])
AC_INIT
AM_INIT_AUTOMAKE([a.b.c]) 

where x.y is the version of autoconf you use and a.b.c is your version of automake. Then nobody with older versions can remake the files. Unless you can be sure all your code will work with the very first releases of autoconf and automake, then I'd add that.

It looks like there are issues on Cygwin, so perhaps while you are making the other changes, you can add something to stop people remaking the files with old versions of autoconf or automake.

Dave

comment:7 Changed 3 years ago by mhansen

  • Status changed from needs_work to needs_review

The newest spkg works correctly on Cygwin. Thanks!

comment:8 Changed 3 years ago by vbraun

I added the AC_PREREQ already in #comment:3

Passing options to AM_INIT_AUTOMAKE is deprecated, and they should be passed to AC_INIT. The version number here is interpreted as the version number of the package (cddlib), not the automake version number. I don't know if there is any macro to enforce a certain automake version. We could write a autogen.sh script, but thats probably too much of an overkill. If the required autoconf version (2.63) is installed then automake is probably modern enough, too.

comment:9 Changed 3 years ago by vbraun

Nevermind, I finally saw the API-versioning link in your comment :-)

I added AM_INIT_AUTOMAKE([1.11]) to the spkg, and the updated version is at the usual place  http://www.stp.dias.ie/~vbraun/Sage/spkg/cddlib-094f.p7.spkg

comment:10 Changed 3 years ago by drkirkby

  • Status changed from needs_review to positive_review

Sorry, I overlooked the fact you had commented on this.

This looks good. I've tested it on Linux (64-bit build), OpenSolaris x64 (64-bit build ) and Solaris 10 SPARC (32-bit build). I exported "SAGE_CHECK=yes", so the test suite is run.

There's an amazing difference in the speed to compile this on my old Sun Blade 1000 (2 minutes, 38 seconds) and my much newer Sun Ultra 27 (11.5 seconds)! Almost 14:1, though I guess the new machine did cost me more than 14x as much as the old one.

On OpenSolaris 06/2009 (64-bit build) on a Sun Ultra 27 quad core Xeon.

make[2]: Entering directory `/export/home/drkirkby/sage-4.4.4.alpha1/spkg/build/cddlib-094f.p6/src'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/export/home/drkirkby/sage-4.4.4.alpha1/spkg/build/cddlib-094f.p6/src'
make[1]: Leaving directory `/export/home/drkirkby/sage-4.4.4.alpha1/spkg/build/cddlib-094f.p6/src'

real	0m11.521s
user	0m6.859s
sys	0m3.814s
Successfully installed cddlib-094f.p6
Running the test suite.
size = 8 x 4
Number Type = rational
Now cleaning up tmp files.
rm: Cannot remove any directory in the path of the current working directory
/export/home/drkirkby/sage-4.4.4.alpha1/spkg/build/cddlib-094f.p6
Making Sage/Python scripts relocatable...
Making script relocatable
Finished installing cddlib-094f.p6.spkg

Using Solaris 10 SPARC (32-bit build) on a Sun Blade 1000, 2 x 900 MHz UltraSPARC III+

make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/export/home/drkirkby/sage-4.4.4.alpha1/spkg/build/cddlib-094f.p7/src'
make[1]: Leaving directory `/export/home/drkirkby/sage-4.4.4.alpha1/spkg/build/cddlib-094f.p7/src'

real    2m37.957s
user    2m2.904s
sys     0m29.713s
Successfully installed cddlib-094f.p7
Running the test suite.
size = 8 x 4
Number Type = rational
Now cleaning up tmp files.
rm: Cannot remove any directory in the path of the current working directory
/export/home/drkirkby/sage-4.4.4.alpha1/spkg/build/cddlib-094f.p7
Making Sage/Python scripts relocatable...
Making script relocatable
Finished installing cddlib-094f.p7.spkg

Using Linux (64-bit build) on sage.math

make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/kirkby/sage-4.4.3/spkg/build/cddlib-094f.p7/src'
make[1]: Leaving directory `/home/kirkby/sage-4.4.3/spkg/build/cddlib-094f.p7/src'

real	0m31.422s
user	0m21.380s
sys	0m6.770s
Successfully installed cddlib-094f.p7
Running the test suite.
size = 8 x 4
Number Type = rational
Now cleaning up tmp files.
Making Sage/Python scripts relocatable...
Making script relocatable
Finished installing cddlib-094f.p7.spkg

Dave

comment:11 Changed 3 years ago by drkirkby

  • Reviewers set to David Kirkby, Mike Hansen
  • Authors set to Volker Braun

comment:12 Changed 3 years ago by rlm

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