Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit ad70e64

Browse files
author
Release Manager
committed
Trac #31409: Make it possible to disable build of r, rpy2 using ./configure --disable-r
Prompted by a build failure of `r` on `cygwin-standard` in https://github.com/mkoeppe/sage/runs/1915093157 {{{ [r-3.6.3] blas.o: in function `dsymm_': [r-3.6.3] /opt/sage-1e693c9ae51a53dad0fe099efc41439dc898f02f/var/tmp /sage/build/r-3.6.3/src/src/extra/blas/blas.f:2986:(.text+0x4352): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `xerbla_' }}} we make it possible to disable R using a configure options so that one can get a working Sage installation in this way. (The original build failure has hopefully resolved been resolved by #29537.) Previous tickets and discussions: - #29486 - #29441 - #29170 - ​https://groups.google.com/g/sage-devel/c/IX3niEdmCEM/m/LovmF6gmIwAJ - https://wiki.sagemath.org/ReleaseTours/sage-9.2#rpy2_and_R - https://groups.google.com/g/sage-devel/c/alkG4veIsBk/m/432cxzpYAQAJ URL: https://trac.sagemath.org/31409 Reported by: mkoeppe Ticket author(s): Matthias Koeppe Reviewer(s): François Bissey, John Palmieri
2 parents 7b44d1c + f04c134 commit ad70e64

File tree

10 files changed

+328
-318
lines changed

10 files changed

+328
-318
lines changed

configure.ac

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,14 @@ AC_ARG_ENABLE([notebook],
424424
done
425425
])
426426

427+
AC_ARG_ENABLE([r],
428+
AS_HELP_STRING([--disable-r],
429+
[disable build of the R package and related packages]), [
430+
for pkg in r rpy2 r_jupyter; do
431+
AS_VAR_SET([SAGE_ENABLE_$pkg], [$enableval])
432+
done
433+
])
434+
427435
SAGE_SPKG_COLLECT()
428436

429437
dnl AC_CONFIG_HEADERS([config.h])

src/doc/en/prep/Quickstarts/Statistics-and-Distributions.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,13 @@ the examples in ``r.kruskal_test?`` in the notebook.
146146

147147
::
148148

149-
sage: x=r([2.9, 3.0, 2.5, 2.6, 3.2]) # normal subjects
150-
sage: y=r([3.8, 2.7, 4.0, 2.4]) # with obstructive airway disease
151-
sage: z=r([2.8, 3.4, 3.7, 2.2, 2.0]) # with asbestosis
152-
sage: a = r([x,y,z]) # make a long R vector of all the data
153-
sage: b = r.factor(5*[1]+4*[2]+5*[3]) # create something for R to tell which subjects are which
154-
sage: a; b # show them
149+
sage: x=r([2.9, 3.0, 2.5, 2.6, 3.2]) # normal subjects # optional - rpy2
150+
sage: y=r([3.8, 2.7, 4.0, 2.4]) # with obstructive airway disease # optional - rpy2
151+
sage: z=r([2.8, 3.4, 3.7, 2.2, 2.0]) # with asbestosis # optional - rpy2
152+
sage: a = r([x,y,z]) # make a long R vector of all the data # optional - rpy2
153+
sage: b = r.factor(5*[1]+4*[2]+5*[3]) # create something for R to tell # optional - rpy2
154+
....: # which subjects are which
155+
sage: a; b # show them # optional - rpy2
155156
[1] 2.9 3.0 2.5 2.6 3.2 3.8 2.7 4.0 2.4 2.8 3.4 3.7 2.2 2.0
156157
[1] 1 1 1 1 1 2 2 2 2 3 3 3 3 3
157158
Levels: 1 2 3
@@ -160,7 +161,7 @@ the examples in ``r.kruskal_test?`` in the notebook.
160161
161162
::
162163

163-
sage: r.kruskal_test(a,b) # do the KW test!
164+
sage: r.kruskal_test(a,b) # do the KW test! # optional - rpy2
164165
Kruskal-Wallis rank sum test
165166

166167
data: sage17 and sage33
@@ -178,7 +179,7 @@ Notice that R also uses the ``#`` symbol to indicate comments.
178179
179180
::
180181

181-
sage: %r
182+
sage: %r # optional - rpy2
182183
....: x = c(18,23,25,35,65,54,34,56,72,19,23,42,18,39,37) # ages of individuals
183184
....: y = c(202,186,187,180,156,169,174,172,153,199,193,174,198,183,178) # maximum heart rate of each one
184185
....: png() # turn on plotting

src/sage/interfaces/interface.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -798,9 +798,9 @@ def __reduce__(self):
798798
"abc"
799799
sage: loads(dumps(pari([1,2,3])))
800800
[1, 2, 3]
801-
sage: loads(dumps(r('"abc"')))
801+
sage: loads(dumps(r('"abc"'))) # optional - rpy2
802802
[1] "abc"
803-
sage: loads(dumps(r([1,2,3])))
803+
sage: loads(dumps(r([1,2,3]))) # optional - rpy2
804804
[1] 1 2 3
805805
sage: loads(dumps(maxima([1,2,3])))
806806
[1,2,3]
@@ -851,10 +851,11 @@ def _reduce(self):
851851
by the doctests because the original identifier was reused. This test makes sure
852852
that does not happen again:
853853
854-
sage: a = r("'abc'")
855-
sage: b = dumps(a)
856-
sage: r.set(a.name(), 0) # make identifier reuse doesn't accidentally lead to success
857-
sage: loads(b)
854+
sage: a = r("'abc'") # optional - rpy2
855+
sage: b = dumps(a) # optional - rpy2
856+
sage: r.set(a.name(), 0) # make sure that identifier reuse # optional - rpy2
857+
....: # does not accidentally lead to success
858+
sage: loads(b) # optional - rpy2
858859
[1] "abc"
859860
860861
"""
@@ -1376,13 +1377,13 @@ def name(self, new_name=None):
13761377
13771378
EXAMPLES::
13781379
1379-
sage: x = r([1,2,3]); x
1380+
sage: x = r([1,2,3]); x # optional - rpy2
13801381
[1] 1 2 3
1381-
sage: x.name()
1382+
sage: x.name() # optional - rpy2
13821383
'sage...'
1383-
sage: x = r([1,2,3]).name('x'); x
1384+
sage: x = r([1,2,3]).name('x'); x # optional - rpy2
13841385
[1] 1 2 3
1385-
sage: x.name()
1386+
sage: x.name() # optional - rpy2
13861387
'x'
13871388
13881389
::

0 commit comments

Comments
 (0)