Installation of sage-4.8 failed in ubuntu 10.04

59 views
Skip to first unread message

AD

unread,
Mar 22, 2012, 2:49:36 PM3/22/12
to sage-...@googlegroups.com
I was trying to install sage-4.8 from source in ubuntu 10.04. I had downloaded the sage-4.8.tar archive, created the sage-4.8 directory and then used the command "make". After nearly two hours, I got the report (only relevant part is shown below):

*************************************************
Traceback (most recent call last):
  File "setup.py", line 830, in <module>
    execute_list_of_commands(queue)
  File "setup.py", line 287, in execute_list_of_commands
    execute_list_of_commands_in_parallel(command_list, nthreads)
  File "setup.py", line 238, in execute_list_of_commands_in_parallel
    p = Pool(nthreads)
  File "/home/myname/sage-4.8/local/lib/python/multiprocessing/__init__.py", line 227, in Pool
    return Pool(processes, initializer, initargs)
  File "/home/myname/sage-4.8/local/lib/python/multiprocessing/pool.py", line 84, in __init__
    self._setup_queues()
  File "/home/myname/sage-4.8/local/lib/python/multiprocessing/pool.py", line 131, in _setup_queues
    self._inqueue = SimpleQueue()
  File "/home/myname/sage-4.8/local/lib/python/multiprocessing/queues.py", line 328, in __init__
    self._rlock = Lock()
  File "/home/myname/sage-4.8/local/lib/python/multiprocessing/synchronize.py", line 117, in __init__
    SemLock.__init__(self, SEMAPHORE, 1, 1)
  File "/home/myname/sage-4.8/local/lib/python/multiprocessing/synchronize.py", line 49, in __init__
    sl = self._semlock = _multiprocessing.SemLock(kind, value, maxvalue)

"OSError: [Errno 30] Read-only file system
sage: There was an error installing modified sage library code.
ERROR installing Sage
make[1]: *** [installed/sage-4.8] Error 1
make[1]: Leaving directory `/home/myname/sage-4.8/spkg'

real    126m42.538s
user    121m51.361s
sys    12m44.712s
Error building Sage.
make: *** [build] Error 1"
*********************************************************
My guess is that I should have used "sudo make" command instead of just "make". The result of uname -a is: Linux myname-desktop 2.6.32-39-generic #86-Ubuntu SMP Mon Feb 13 21:47:32 UTC 2012 i686 GNU/Linux

Please suggest what I should do now. Will it be proper to use the "sudo make" command at this stage or should I do something about the already created sage-files and directories (in the failed installation process)?

AD

unread,
Mar 22, 2012, 3:01:58 PM3/22/12
to sage-...@googlegroups.com
I am sorry for asking at the wrong forum. I am going to ask this in the sage-support section. I request the administrator of this forum to delete this question. Thanks.

leif

unread,
Mar 22, 2012, 6:51:09 PM3/22/12
to sage-devel
No, this is in principle the correct list (or discussion group),
likewise the Google group sage-release.



Try running the following Python script:

http://trac.sagemath.org/sage_trac/raw-attachment/ticket/5965/sage-check-ptys-semaphore.py

(I.e., download the file and then do 'python /path/to/sage-check-ptys-
semaphore.py'.)

In your case, most probably /dev/shm has wrong permissions; it should
look like this:

$ ls -ld /dev/shm/
drwxrwxrwt 2 root root 220 Mar 22 23:31 /dev/shm/

(This is the shared memory "device" which is also used to synchronize
threads.)



You don't have to be root to build Sage, and you shouldn't be logged
in as root when you build Sage (as for most if not all software
packages; only the install step usually requires root privileges in
case you want to install a package system-wide.)


-leif

AD

unread,
Mar 23, 2012, 7:37:37 AM3/23/12
to sage-...@googlegroups.com
Thanks a lot for your attention. I have tried to follow your suggestion but again there are problems.

1. The result of ls -ld /dev/shm/  is:

drwxrwxrwt 2 root root 40 2012-03-23 16:57 /dev/shm/

2. I ran the python script (as ordinary user, not superuser) you suggested; the response was:

Error creating semaphores.
On Linux, make sure /dev/shm is mounted and user-writable.

What do I do now? Also please tell me what is expected if the python script runs without any problem and then how do I solve my original problem? Will my problem be automatically solved by running the python script?

Thanks.
AD

leif

unread,
Mar 23, 2012, 9:27:14 AM3/23/12
to sage-devel
On 23 Mrz., 12:37, AD <adphy2...@gmail.com> wrote:
> 1. The result of ls -ld /dev/shm/  is:
>
> drwxrwxrwt 2 root root 40 2012-03-23 16:57 /dev/shm/

That's strange, as the error message in your first post suggests it
wasn't writable (by ordinary users).

What does

$ mount | grep shm

give?

In case it is mounted read-only ("ro"), you may try to remount /dev/
shm read-write ("rw"):

$ sudo mount -v -o remount,rw /dev/shm


> 2. I ran the python script (as ordinary user, not superuser) you suggested;
> the response was:
>
> Error creating semaphores.
> On Linux, make sure /dev/shm is mounted and user-writable.

So at least your pseudo ttys work... :-)

(The script doesn't give any output in case everything's fine; and it
only checks whether things work, it doesn't cure anything.)


> What do I do now? Also please tell me what is expected if the python script
> runs without any problem and then how do I solve my original problem? Will
> my problem be automatically solved by running the python script?

(See above.) If the Python script exits without any message, you
should be able to build and run Sage without any problems (at least
not ones related to this).

As long as the script gives the message above, you won't be able to
build the Sage library [in parallel], and would probably run into
trouble when /running/ Sage.

The second check, which tests whether pseudo ttys (/dev/pts) are
functional, is only relevant for /running/ Sage, since these are used
by the PExpect interfaces, which are used to run stand-alone programs
like GAP, Maxima, the PARI/GP interpreter and Singular etc., from
within Sage.

If you somehow manage to fix /dev/shm (maybe by rebooting your
machine? :-) ) such that semaphores work, it should be sufficient to
resume the build of Sage by simply typing 'make' again. (Don't forget
to again set environment variables in advance in case you did so
before you attempted the first build; this will e.g. be necessary if
you rebooted your machine or switched to another terminal.)


You *might* also be able to build the Sage library sequentially,
without using multiple threads (and hence without the need for
semaphores) by typing

$ SAGE_NUM_THREADS=1 make

but I haven't tested this; and as mentioned before, without a working /
dev/shm you'll probably run into problems later, when running Sage.


Hope that helps,

-leif

AD

unread,
Mar 23, 2012, 11:16:33 AM3/23/12
to sage-...@googlegroups.com

 Thanks for your detailed answer. However my problem is not yet solved. I noticed that by using the command
sudo mount -v -o remount,rw /dev/shm
I got the desired result (so that response of "mount | grep shm" is "tmpfs on /dev/shm type tmpfs (rw)"); unfortunately this modification goes away on reboot. After reboot I tried to build sage by make command and again got the same error as in my first post. I repeated sudo mount command as you suggested and without reboot, tried "make" command. This time some error message was there with suggestion that I use command ./sage -ba  which I did. The command worked apparently without problem and the last three lines reported were:
****************************************************************************************************************************
byte-compiling /home/myname/sage-4.8/local/lib/python2.6/site-packages/sage/__init__.py to __init__.pyc

running install_egg_info

Writing /home/myname/sage-4.8/local/lib/python2.6/site-packages/sage-0.0.0-py2.6.egg-info
****************************************************************************************************************************

I thought that sage was installed without problem but when tried the command ./sage the response was:

******************************************************************************
Setting permissions of DOT_SAGE directory so only you can read and write it.
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (80, 0))

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
/home/myname/sage-4.8/local/lib/python2.6/site-packages/IPython/ipmaker.pyc in force_import(modname, force_reload)
     61         reload(sys.modules[modname])
     62     else:
---> 63         __import__(modname)
     64        
     65

/home/myname/sage-4.8/local/bin/ipy_profile_sage.py in <module>()
      5     preparser(True)
      6    
----> 7     import sage.all_cmdline
      8     sage.all_cmdline._init_cmdline(globals())
      9    

/home/myname/sage-4.8/local/lib/python2.6/site-packages/sage/all_cmdline.py in <module>()
     12 try:
     13
---> 14     from sage.all import *
     15     from sage.calculus.predefined import x
     16     preparser(on=True)
    
    ************************(there were many such remarks and finally)***************************************

     /home/myname/sage-4.8/local/lib/python2.6/site-packages/sage/interfaces/gap.py in _start(self)
    913                 self._session_number = n
    914                 return
--> 915             raise RuntimeError, msg
    916        
    917         if self.__use_workspace_cache and self.__make_workspace:

RuntimeError: Unable to start gap because the command 'gap -r -b -p -T -o 3900m /home/anupam/sage-4.8/data//extcode/gap/sage.g' failed.

Error importing ipy_profile_sage - perhaps you should run %upgrade?
WARNING: Loading of ipy_profile_sage failed.
*******************************************************************************************************************

I have not done anything after this. What would you suggest me to do?

Thanks
AD


Julien Puydt

unread,
Mar 23, 2012, 11:25:33 AM3/23/12
to sage-...@googlegroups.com
Le vendredi 23 mars, AD a écrit:

>
> Thanks for your detailed answer. However my problem is not yet
> solved. I noticed that by using the command
> sudo mount -v -o remount,rw /dev/shm
> I got the desired result (so that response of "mount | grep shm" is
> "tmpfs on /dev/shm type tmpfs (rw)"); unfortunately this modification
> goes away on reboot.

What about asking on ubuntu forums about that?

This is a system setting ; if there's something wrong with it, that's a
system problem, not a sage problem...

Snark on #sagemath

AD

unread,
Mar 23, 2012, 11:41:15 AM3/23/12
to sage-...@googlegroups.com
I have posted this question in ubuntu forum also and waiting for reply.
AD

leif

unread,
Mar 23, 2012, 12:22:07 PM3/23/12
to sage-devel
On 23 Mrz., 16:16, AD <adphy2...@gmail.com> wrote:
> RuntimeError: Unable to start gap because the command 'gap -r -b -p -T -o
> 3900m /home/anupam/sage-4.8/data//extcode/gap/sage.g' failed.

This is one of the errors you get if the PExpect interfaces don't
work, i.e., /dev/pts is not (or improperly) mounted.

(Running the Python script I pointed to should show this.)


-leif

leif

unread,
Mar 23, 2012, 1:38:09 PM3/23/12
to sage-devel
FWIW, your mounts should look like this (or very similar):

$ mount | egrep "pts|shm"
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)

Likewise:

$ cat /etc/mtab | egrep "pts|shm"
none /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
none /dev/shm tmpfs rw,nosuid,nodev 0 0

(You could copy the above two entries into your /etc/fstab, or modify
the ones there accordingly in case they already exist.)


-leif

AD

unread,
Mar 24, 2012, 8:47:48 AM3/24/12
to sage-...@googlegroups.com

Thanks. However, before I proceed with your suggestion, here are the results of the commands (which actually vary from what you mentioned).


$ mount | egrep "pts|shm"
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /dev/shm type tmpfs (ro)


$ cat /etc/mtab |egrep "pts|shm"
none /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
tmpfs /dev/shm tmpfs ro 0 0

The /dev/shm is different from what you expect and is also showing "ro" but if I use remount as you wrote, it becomes "rw" for that session. The /etc/fstab  has the entries (only relevant part shown):
**************************************************************************************

<file system>    <mount point>   <type>    <options>       <dump>     <pass>

proc            /proc           proc    nodev,noexec,nosuid 0       0

# / was on /dev/sda1 during installation

UUID=2a270867-509b-4267-85b6-75e8233fc511 /               ext4    errors=remount-ro 0       1

# swap was on /dev/sda5 during installation

UUID=57c1acc5-2d96-4ed5-867a-962e7b7bc588 none            swap    sw              0       0

tmpfs    /dev/shm    tmpfs    defaults,ro    0    0   
*****************************************************************************************
I guess you suggest me to delete the last line above and copy the part "/dev/shm type tmpfs (rw,nosuid,nodev)" there. But what about the word "none"? What should be there at <filesystem>? "none" or a blank-space?

Similarly, in the /etc/mtab there is an entry "tmpfs /dev/shm tmpfs rw 0 0". Here also should I replace "tmpfs" with "none" or with a space?

Third, will it work if I write the following in the /etc/fstab (with tmpfs replaced by what you suggest)

tmpfs     /dev/shm     tmpfs     defaults,noexec,nosuid     0     0
This also mounts /dev/shm writable but probably better from security point of view.


Frankly, I do not fully understand mounting issues and I am trying to understand, so I am asking such questions here. I hope you will bear with me.


Thanks,
AD


leif

unread,
Mar 24, 2012, 9:44:52 AM3/24/12
to sage-devel
The lines output by `cat /etc/mtab` are in exactly the same format as /
etc/fstab is, i.e., you could copy just those lines I've shown into
the latter (of course removing other entries for the same mount point
in case such exist).

The most important thing is that /dev/shm (likewise, /dev/pts) is
*not* mounted read-only, so you should at least replace "ro" with
"rw", unless you want to 'sudo mount -o remount,rw /dev/shm' after
each reboot.

> Frankly, I do not fully understand mounting issues and I am trying to
> understand, so I am asking such questions here. I hope you will bear with
> me.

If all else fails:

$ man mount

;-)


-leif

AD

unread,
Mar 25, 2012, 10:19:52 AM3/25/12
to sage-...@googlegroups.com

Finally, I have been able to install sage-4.8 following your instructions and right now busy learning the basics. This would have not been possible without your guidance. I wish to thank you along with the  sage-developers members for your generous help.

AD

Reply all
Reply to author
Forward
0 new messages