Build breaks due to user's distutils config and complicated environment variable

Skip to first unread message


Jul 19, 2011, 5:57:25 PM7/19/11
to sage-devel

Hi to all!

Today I tried to build sage 4.7 (4.6.* has same problems). This was my
first build
from source and it broke at two places. I solved both problems but I
am posting
here because at least one is really obscure, and I believe that it is
good to
document this somewhere.


LD_LIBRARY_PATH=[...] ./python -E ./ install \
--prefix=/home/kkumer/sage/sage-4.7/local \
--install-scripts=/home/kkumer/sage/sage-4.7/local/bin \
python2.6/lib-dynload \
running install
error: must supply either home or prefix/exec-prefix -- not both
make[2]: [sharedinstall] Error 1 (ignored)
[...] ( ... ignored but it eventually leads to: )
Sleeping for three seconds before testing python
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named math
math module failed to import
sage: An error occurred while installing python-2.6.4.p10


I found out that this was due to me having $HOME/.pydistutils.cfg with
'home' defined inside which clashed with command-line --prefix above.
Removing .pydistutils.cfg solved this, and led then to ..


Extracting package /home/kkumer/sage/sage-4.7/spkg/build/r-2.10.1.p4/
rpy2-2.0.8.spkg ...
[...] (16 lines)
export: 35: -c: bad variable name
Traceback (most recent call last):
File "", line 160, in <module>
ri_ext = getRinterface_ext(RHOME, r_packversion)
File "", line 121, in getRinterface_ext
include_dirs = get_rconfig(RHOME, '--cppflags')[0].split()
File "", line 85, in get_rconfig
raise Exception(cmd + '\nreturned\n' + rconfig)
Exception: "/home/kkumer/sage/sage-4.7/local/lib/R/bin/R" CMD config

Error building RPY -- Python interface to R.
sage: An error occurred while installing rpy2-2.0.8


This turned out to be due to my complicated environment variable

PAGER="/bin/sh -c \"unset PAGER;col -b -x | \
vim -R -c 'set ft=man nomod nolist' -c 'map q :q<CR>' \
-c 'map <SPACE> <C-D>' -c 'map b <C-U>' \
-c 'nmap K :Man <C-R>=expand(\\\"<cword>\\\")<CR><CR>' -\""
(This makes vim nice pager for man pages etc.)

While building R, this (together with other env vars) gets written
to SAGE_ROOT/local/lib/R/etc/Renviron and then breaks compilation at
the following
line in SAGE_ROOT/local/lib/R/bin/Rcmd

export `sed 's/^ *#.*//; s/^\(.*\)=.*/\1/' "${R_HOME}/etc${R_ARCH}/

because pattern matching here is not robust enough. After setting
sage compiles successfully. (Debian Linux on amd64.)

Now, I am not sure if these should be called bugs, but I somehow
expected sage
compilation not to depend on my own private python environment (since
it is using its own python anyway), and on the value of PAGER
variable or some such.


Reply all
Reply to author
0 new messages