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

20 views
Skip to first unread message

kkumer

unread,
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.

First:


------------------------------------------------------------------------
LD_LIBRARY_PATH=[...] ./python -E ./setup.py install \
--prefix=/home/kkumer/sage/sage-4.7/local \
--install-scripts=/home/kkumer/sage/sage-4.7/local/bin \
--install-platlib=/home/kkumer/sage/sage-4.7/local/lib/
python2.6/lib-dynload \
--root=/
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 ..

Second:


------------------------------------------------------------------------
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 "setup.py", line 160, in <module>
ri_ext = getRinterface_ext(RHOME, r_packversion)
File "setup.py", line 121, in getRinterface_ext
include_dirs = get_rconfig(RHOME, '--cppflags')[0].split()
File "setup.py", 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
--cppflags
returned

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}/
Renviron"`

because pattern matching here is not robust enough. After setting
PAGER=less,
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
environment
variable or some such.

Best,
K.


Reply all
Reply to author
Forward
0 new messages