#31365 closed enhancement (fixed)

Add NTL to cython_aliases and sage.misc.cython library search dirs

Reported by: mkoeppe Owned by:
Priority: major Milestone: sage-9.3
Component: build: configure Keywords:
Cc: gh-zlscherr, dimpase, mjo, vdelecroix, gh-kliem, jhpalmieri, fbissey Merged in:
Authors: Matthias Koeppe Reviewers: Jonathan Kliem
Report Upstream: N/A Work issues:
Branch: dbcbf79 (Commits, GitHub, GitLab) Commit: dbcbf792927c4aa92fb2a60c528c830a2920c175
Dependencies: #30770, #31344 Stopgaps:

Status badges

Description (last modified by mkoeppe)

(from #31348)

... using SAGE_NTL_PREFIX via sage_conf.

This is for macOS with configurations in which Python extensions no longer have access to /usr/local due to the use of -isysroot in the compiler configuration from sysconfig.

In particular, we add handling for ntl to the .homebrew-build-env script -- so that after brew install ntl; brew unlink ntl, our ./configure still finds NTL.

Change History (24)

comment:1 Changed 16 months ago by mkoeppe

  • Dependencies set to #30770

comment:2 Changed 16 months ago by mkoeppe

  • Authors set to Matthias Koeppe
  • Dependencies changed from #30770 to #30770, #31344

comment:3 Changed 16 months ago by mkoeppe

  • Summary changed from Add NTL to cython_aliases to Add NTL to cython_aliases and sage.misc.cython library search dirs

comment:4 Changed 16 months ago by mkoeppe

  • Branch set to u/mkoeppe/add_ntl_to_cython_aliases

comment:5 Changed 16 months ago by git

  • Commit set to 32576b43a0415a9e15d1cbe6beac2dd4c300a745

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

32576b4sage.misc.cython: Add NTL aliases, cache result of cython_aliases

comment:6 Changed 16 months ago by mkoeppe

Actually spkg-configure.m4 needs some work too - need to use AX_ABSOLUTE_HEADER to set SAGE_NTL_PREFIX

comment:7 Changed 15 months ago by git

  • Commit changed from 32576b43a0415a9e15d1cbe6beac2dd4c300a745 to 7b1e27b96e143d6d44b448692ba266050e667399

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

6e30e3aUse variables NTL_INCDIR, NTL_LIBDIR in sage_conf, separate from NTL_PREFIX used in sage-build-env-config; set -std=c++11 in NTL_CFLAGS
7b1e27bMerge distutils directives for Cython files using ntl

comment:8 Changed 15 months ago by mkoeppe

  • Description modified (diff)
  • Status changed from new to needs_review

comment:9 Changed 15 months ago by mkoeppe

  • Status changed from needs_review to needs_work

NTL_INCDIR, NTL_LIBDIR needs more work.

NTL_INCDIR = ".
.
///usr/include/NTL"

comment:10 Changed 15 months ago by git

  • Commit changed from 7b1e27b96e143d6d44b448692ba266050e667399 to 993c35c931f9c9f2b459e66619cac7d587a4a08f

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

4d2828dSwitch Cython files that use NTL to language = c++
993c35cbuild/pkgs/ntl/spkg-configure.m4: Fix up

comment:11 Changed 15 months ago by mkoeppe

  • Status changed from needs_work to needs_review

comment:12 Changed 15 months ago by mkoeppe

  • Cc vdelecroix gh-kliem added

comment:13 Changed 15 months ago by git

  • Commit changed from 993c35c931f9c9f2b459e66619cac7d587a4a08f to dbcbf792927c4aa92fb2a60c528c830a2920c175

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

dbcbf79.homebrew-build-env: Add ntl dirs

comment:14 Changed 15 months ago by mkoeppe

  • Cc jhpalmieri added
  • Description modified (diff)

comment:15 Changed 15 months ago by mkoeppe

  • Cc fbissey added

comment:16 follow-up: Changed 15 months ago by gh-kliem

You changed src/sage/rings/rational.pyx and src/sage/matrix/matrix_rational_dense.pyx to language c++. Is there a reason for this?

comment:17 follow-up: Changed 15 months ago by gh-kliem

I'm a bit confused:

In src/sage/misc/cython.py we add NTL_LIBDIR to standard_libdirs and likewise we add NTL_INCDIR to standard_incdirs. Why do we need to add this to every file again that uses ntl?

comment:18 Changed 15 months ago by gh-kliem

  • Reviewers set to Jonathan Kliem

comment:19 in reply to: ↑ 16 ; follow-up: Changed 15 months ago by gh-kliem

Replying to gh-kliem:

You changed src/sage/rings/rational.pyx and src/sage/matrix/matrix_rational_dense.pyx to language c++. Is there a reason for this?

Ok, I see:

[sagelib-9.3.beta7] cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C
[sagelib-9.3.beta7] cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C

Which raises a bit the question, why its called NTL_CFLAGS and not NTL_CXXFLAGS.

comment:20 in reply to: ↑ 17 Changed 15 months ago by mkoeppe

Replying to gh-kliem:

In src/sage/misc/cython.py we add NTL_LIBDIR to standard_libdirs and likewise we add NTL_INCDIR to standard_incdirs. Why do we need to add this to every file again that uses ntl?

sage.misc.cython is only for runtime use of Cython; it is not used by the sagelib build system.

comment:21 in reply to: ↑ 19 Changed 15 months ago by mkoeppe

Replying to gh-kliem:

Which raises a bit the question, why its called NTL_CFLAGS and not NTL_CXXFLAGS.

The names follow the conventions of pkg-config - which does not make this distinction.

comment:22 Changed 15 months ago by gh-kliem

  • Status changed from needs_review to positive_review

Ok. LGTM.

comment:23 Changed 15 months ago by mkoeppe

Thank you!

comment:24 Changed 15 months ago by vbraun

  • Branch changed from u/mkoeppe/add_ntl_to_cython_aliases to dbcbf792927c4aa92fb2a60c528c830a2920c175
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.