Add NTL to cython_aliases and sage.misc.cython library search dirs
mkoeppe opened this issue · 25 comments
(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.
Depends on #30770
Depends on #31344
CC: @zlscherr @dimpase @orlitzky @videlec @kliem @jhpalmieri @kiwifb
Component: build: configure
Author: Matthias Koeppe
Branch/Commit: dbcbf79
Reviewer: Jonathan Kliem
Issue created by migration from https://trac.sagemath.org/ticket/31365
Author: Matthias Koeppe
Branch pushed to git repo; I updated commit sha1. New commits:
32576b4 | sage.misc.cython: Add NTL aliases, cache result of cython_aliases |
Commit: 32576b4
Actually spkg-configure.m4 needs some work too - need to use AX_ABSOLUTE_HEADER to set SAGE_NTL_PREFIX
Description changed:
---
+++
@@ -2,4 +2,6 @@
... 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.
+NTL_INCDIR, NTL_LIBDIR needs more work.
NTL_INCDIR = ".
.
///usr/include/NTL"
Branch pushed to git repo; I updated commit sha1. New commits:
dbcbf79 | .homebrew-build-env: Add ntl dirs |
Description changed:
---
+++
@@ -4,4 +4,8 @@
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.
+
+
+You changed src/sage/rings/rational.pyx and src/sage/matrix/matrix_rational_dense.pyx to language c++. Is there a reason for this?
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?
Reviewer: Jonathan Kliem
Replying to @kliem:
You changed
src/sage/rings/rational.pyxandsrc/sage/matrix/matrix_rational_dense.pyxto languagec++. 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.
Replying to @kliem:
In
src/sage/misc/cython.pywe addNTL_LIBDIRtostandard_libdirsand likewise we addNTL_INCDIRtostandard_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.
Replying to @kliem:
Which raises a bit the question, why its called
NTL_CFLAGSand notNTL_CXXFLAGS.
The names follow the conventions of pkg-config - which does not make this distinction.
Ok. LGTM.
Thank you!
Changed branch from u/mkoeppe/add_ntl_to_cython_aliases to dbcbf79