Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spkg-configure.m4 for NTL #27265

Closed
dimpase opened this issue Feb 12, 2019 · 102 comments
Closed

spkg-configure.m4 for NTL #27265

dimpase opened this issue Feb 12, 2019 · 102 comments

Comments

@dimpase
Copy link
Member

dimpase commented Feb 12, 2019

implemented a direct version check using AC_RUN_IFELSE.
The rest is standard, as in #27212, basically.

to be merged as a part of #27822

Depends on #27212
Depends on #27641
Depends on #27751
Depends on #27259

CC: @embray @kiwifb @jdemeyer

Component: build: configure

Keywords: spkg-configure ntl

Author: Dima Pasechnik, Erik Bray

Branch/Commit: public/packages/ntlconf @ 892143a

Reviewer: Erik Bray, Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/27265

@dimpase dimpase added this to the sage-8.7 milestone Feb 12, 2019
@dimpase

This comment has been minimized.

@dimpase
Copy link
Member Author

dimpase commented Feb 23, 2019

Dependencies: #27212

@dimpase
Copy link
Member Author

dimpase commented Feb 26, 2019

Changed dependencies from #27212 to #27212, #27238

@dimpase
Copy link
Member Author

dimpase commented Mar 20, 2019

comment:4

here we might want to check that NTL is built with gf2x. However, it appears that it's only question of better performance, not an exta API, if it gf2x is linked.

@dimpase
Copy link
Member Author

dimpase commented Mar 20, 2019

Branch: u/dimpase/packages/ntlconf

@dimpase
Copy link
Member Author

dimpase commented Mar 20, 2019

Commit: af9ab90

@dimpase
Copy link
Member Author

dimpase commented Mar 20, 2019

Last 10 new commits:

b80bf72Reworked this a bit more
0ca3f56fix typo
06798caadded a bit more explanation
b592d77correct logic for SAGE_GMP_PREFIX etc
5057680add the AX_ABSOLUTE_HEADER macro
101537biml in particular is very picky about being given an absolute path to the
862ca6aMerge remote-tracking branch 'trac/develop' into HEAD
03dc987Merged trac #27215 in
c9873aeMerge remote-tracking branch 'trac/develop' into mpf
af9ab90deal with --with-ntl, proper version check

@dimpase
Copy link
Member Author

dimpase commented Mar 20, 2019

Author: Dima Pasechnik

@dimpase

This comment has been minimized.

@dimpase
Copy link
Member Author

dimpase commented Mar 21, 2019

Changed dependencies from #27212, #27238 to #27212

@dimpase
Copy link
Member Author

dimpase commented Mar 21, 2019

comment:7

nesting of AC_... tests is wrong.

@embray
Copy link
Contributor

embray commented Mar 25, 2019

comment:8

Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually)

@embray embray modified the milestones: sage-8.7, sage-8.8 Mar 25, 2019
@dimpase
Copy link
Member Author

dimpase commented Apr 6, 2019

comment:9

also needs

+++ b/build/pkgs/flint/spkg-install
@@ -17,7 +17,7 @@ echo "Configuring FLINT."
     --disable-static \
     --prefix="$SAGE_LOCAL" \
     $SAGE_CONFIGURE_GMP \
-    $SAGE_CONFIGURE_NTL \
+    --with-ntl="$SAGE_NTL_PREFIX" \
     $SAGE_CONFIGURE_MPFR \
     $FLINT_CONFIGURE || sdh_die "Error: Failed to configure FLINT."

as completely omitting --with-ntl results in no NTL linked into flint.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 18, 2019

Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:

299e367Replace various --with-gmp=$SAGE_LOCAL flags in spkg-installs with a
058d515Reworked this a bit more
7beadaafix typo
b930874added a bit more explanation
6d2b496correct logic for SAGE_GMP_PREFIX etc
43be546add the AX_ABSOLUTE_HEADER macro
e343418iml in particular is very picky about being given an absolute path to the
e735b4bconfigure version bump
cefb350deal with --with-ntl, proper version check
d4378cbflint needs --with-ntl= always

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 18, 2019

Changed commit from af9ab90 to d4378cb

@dimpase
Copy link
Member Author

dimpase commented Apr 18, 2019

comment:11

rebased over the latest #27212 and fixed comment:9 issue.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 18, 2019

Changed commit from d4378cb to 8fe9503

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 18, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

8fe9503check for deps of ntl

@dimpase
Copy link
Member Author

dimpase commented Apr 19, 2019

comment:13

This is ready for review now. Note that often external NTL packages are built without gf2x, but gf2x is merely an optimisation.

Perhaps, to be completely on the safe side, spkg-configure should check whether gf2x is in, and if it is, only use system's NTL if gf2x will come from the system, too.
(But I don't know how to check whether gf2x is used in NTL, at least not in an OS-independent way).

@kiwifb
Copy link
Member

kiwifb commented Apr 19, 2019

comment:15

Minor remark (it all looks ok) why keep --with-ntl="$SAGE_NTL_PREFIX" instead of using $SAGE_CONFIGURE_NTL like everywhere else in flint?

@dimpase
Copy link
Member Author

dimpase commented Apr 19, 2019

comment:16

Replying to @kiwifb:

Minor remark (it all looks ok) why keep --with-ntl="$SAGE_NTL_PREFIX" instead of using $SAGE_CONFIGURE_NTL like everywhere else in flint?

Because $SAGE_CONFIGURE_NTL is empty if NTL comes from the system, but flint must have --with-ntl to build NTL interface.

@kiwifb
Copy link
Member

kiwifb commented Apr 19, 2019

comment:17

Replying to @dimpase:

Replying to @kiwifb:

Minor remark (it all looks ok) why keep --with-ntl="$SAGE_NTL_PREFIX" instead of using $SAGE_CONFIGURE_NTL like everywhere else in flint?

Because $SAGE_CONFIGURE_NTL is empty if NTL comes from the system, but flint must have --with-ntl to build NTL interface.

Thank you for your answer. Once we get some bots reports I think we can move to a positive review.

@dimpase
Copy link
Member Author

dimpase commented Apr 19, 2019

comment:18

bots will need need a configure tarball. I'll add it.

@embray

This comment has been minimized.

@dimpase
Copy link
Member Author

dimpase commented May 18, 2019

comment:72

Missing quotes here:

--- a/build/pkgs/ntl/spkg-configure.m4
+++ b/build/pkgs/ntl/spkg-configure.m4
@@ -19,7 +19,7 @@ SAGE_SPKG_CONFIGURE([ntl], [
         AC_LINK_IFELSE([
             AC_LANG_PROGRAM([[#include <NTL/ZZ.h>]],
                             [[NTL::ZZ a;]]
-            )], [LIBS=$LIBS -lntl]
+            )], [LIBS="$LIBS -lntl"]
                 [AC_MSG_RESULT([yes])], [
             AC_MSG_RESULT([no]); sage_spkg_install_ntl=yes
         ])

so it works if LIBS was empty, but breaks if it's already not...

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 18, 2019

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

892143aadd missing quotes

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 18, 2019

Changed commit from 4b3caa7 to 892143a

@dimpase
Copy link
Member Author

dimpase commented May 18, 2019

comment:74

stumble upon this while trying this with more spkg-configs merged.

@vbraun
Copy link
Member

vbraun commented May 20, 2019

comment:75

Please only set this ticket to positive review after you have personally verified that a clean sage build works

@dimpase
Copy link
Member Author

dimpase commented May 20, 2019

comment:76

what makes you think I did not do this?

@dimpase
Copy link
Member Author

dimpase commented May 20, 2019

comment:77

A clean build worked great, it's a "dirty" build that revealed the problem of comment:72

@dimpase

This comment has been minimized.

@dimpase dimpase removed this from the sage-8.8 milestone May 20, 2019
@dimpase
Copy link
Member Author

dimpase commented Jun 11, 2019

comment:79

with clang on OSX, I just saw a failure to recognise NTL, due to c++ in the test called without -std=gnu++11.

Adding AC_REQUIRE([SAGE_SPKG_CONFIGURE_GCC]) just above AC_REQUIRE([SAGE_SPKG_CONFIGURE_GMP]) in NTL's spkg-configure.m4 fixes this.

But this seems to be a not very consistent way to do thing, as SAGE_SPKG_CONFIGURE_GCC ought to be called before the any other library tests. Do we have a way to force this?

@embray
Copy link
Contributor

embray commented Jun 11, 2019

comment:80

It might work to just manually call AC_REQUIRE([SAGE_SPKG_CONFIGURE_GCC]) right at the beginning of SAGE_SPKG_COLLECT.

@dimpase
Copy link
Member Author

dimpase commented Jun 12, 2019

comment:81

Replying to @embray:

It might work to just manually call AC_REQUIRE([SAGE_SPKG_CONFIGURE_GCC]) right at the beginning of SAGE_SPKG_COLLECT.

hmm, no, this does not work, as at this moment SAGE_SPKG_CONFIGURE_GCC is not defined.

I am thinking of putting it into SAGE_SPKG_CONFIGURE, but this means it's a recursive call, so the only way I can think of would be avoid the recursion:
to define essentially a copy of
SAGE_SPKG_CONFIGURE, without this call, and then define SAGE_SPKG_CONFIGURE_GCC using this copy. After this AC_REQUIRE(...) would not involve a recursion.

@dimpase
Copy link
Member Author

dimpase commented Jun 17, 2019

comment:82

Replying to @dimpase:

Replying to @embray:

It might work to just manually call AC_REQUIRE([SAGE_SPKG_CONFIGURE_GCC]) right at the beginning of SAGE_SPKG_COLLECT.

hmm, no, this does not work, as at this moment SAGE_SPKG_CONFIGURE_GCC is not defined.

I am thinking of putting it into SAGE_SPKG_CONFIGURE, but this means it's a recursive call, so the only way I can think of would be avoid the recursion:
to define essentially a copy of
SAGE_SPKG_CONFIGURE, without this call, and then define SAGE_SPKG_CONFIGURE_GCC using this copy. After this AC_REQUIRE(...) would not involve a recursion.

I have opened #28005 to deal with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants