William did mention a while ago that he is interested in a native
MacOSX application. I played around a couple hours and I now have
somewhat of a prototype.
To build
- get http://fsmath.mathematik.uni-dortmund.de/~mabshoff/sage/Sage-2.4.2.app.tar.gz
- build sage
- create a binary release with sage -bdist 2.4.2
- Untar Sage-2.4.2.app.tar.gz
- cd Sage-2.4.2.app/Contents/MacOSX
- tar xzf /path/to/sage/dist/sage-2.4.2-PowerMacintosh-Darwin.tar.gz -
C .
and you are done. I can upload a dmg once I will be in the office (~7
hours from now, much better bandwith) if anybody is interested.
Problems/know issues:
- the sage interpreter is not terminated when you leave the notebook -
one workaround is to to a "killall python" in a shell, but that can't
be done in the script itseld. This will obviously kill all python
instances you are running, if you are root it will kill everybody's
python instances, so be careful.
- I only tried this with Safari, but if Safari is already running
"sage -notebook" will fail.
- if you are on MacIntel you need to adapt the script Sage-2.4.2,
obviously you need to do the same for other version numbers
Overall this is obviously far from optimal. I will look into Platypus
(see http://mac.softpedia.com/get/System-Utilities/Platypus.shtml ) to
get something better. If anybody would like to take it from here feel
free to do so.
I did take a superficial look at the dist target and in my tarball
there are ~40 static libs totalling about 35MB - these can probably be
dropped for a binary release, i.e. that release will not be able to
rebuld itself. Overall there seems to be some room for improvement by
getting rid of lots of other files, but that should be discussed in
another thread.
Cheers,
Michael
PS: Any new estimate for 2.5? I am anxious to build an msi installer
for cygwin and as long as maxima doesn't work correctly on cygwin my
hands are tied :(
AWESOME! Many many many thanks!
> To build
>
> - get http://fsmath.mathematik.uni-dortmund.de/~mabshoff/sage/Sage-2.4.2.app.tar.gz
> - build sage
> - create a binary release with sage -bdist 2.4.2
> - Untar Sage-2.4.2.app.tar.gz
> - cd Sage-2.4.2.app/Contents/MacOSX
> - tar xzf /path/to/sage/dist/sage-2.4.2-PowerMacintosh-Darwin.tar.gz -
> C .
>
> and you are done. I can upload a dmg once I will be in the office (~7
> hours from now, much better bandwith) if anybody is interested.
>
> Problems/know issues:
> - the sage interpreter is not terminated when you leave the notebook -
> one workaround is to to a "killall python" in a shell, but that can't
> be done in the script itseld. This will obviously kill all python
> instances you are running, if you are root it will kill everybody's
> python instances, so be careful.
That's not a good solution. Best would be for me to add an option
to the server so it automatically dies after some number of seconds
with no activity. Then in your startup script you just pass in that
option. What do you think?
> - I only tried this with Safari, but if Safari is already running
> "sage -notebook" will fail.
?? I think "sage -notebook" should now, by default, pop up your
default OS X browser, depending on which you've chosen in OS X.
> - if you are on MacIntel you need to adapt the script Sage-2.4.2,
> obviously you need to do the same for other version numbers
What's different about MacIntel?
> Overall this is obviously far from optimal. I will look into Platypus
> (see http://mac.softpedia.com/get/System-Utilities/Platypus.shtml ) to
> get something better. If anybody would like to take it from here feel
> free to do so.
What is it that mainly makes it non-optimal?
> I did take a superficial look at the dist target and in my tarball
> there are ~40 static libs totalling about 35MB - these can probably be
> dropped for a binary release, i.e. that release will not be able to
> rebuld itself. Overall there seems to be some room for improvement by
> getting rid of lots of other files, but that should be discussed in
> another thread.
I'm not too worried about such optimization at this point. It's
always good to house clean like that every once in a while though.
A few days ago I installed TexShop + tex processor on my office macpro;
the compressed download was over 700MB! It's amazing how big software
is these days. But honestly it was very nice because the TexShop (+ tex)
install was almost trivial and really does seem to include everything and
every package I'm likely to want for doing tex. SAGE aims to be something
similar.
> PS: Any new estimate for 2.5? I am anxious to build an msi installer
> for cygwin and as long as maxima doesn't work correctly on cygwin my
> hands are tied :(
I'm working on it right now. It's really difficult work, but going steadily.
--
William Stein
Associate Professor of Mathematics
University of Washington
http://www.williamstein.org
One exists to please ;) - and working on this kind of stuff is always
fun. It's 2:15 am local time a the moment and I should go to bed to
catch some sleep, but once I get going ...
>
> > To build
>
> > - gethttp://fsmath.mathematik.uni-dortmund.de/~mabshoff/sage/Sage-2.4.2.ap...
> > - build sage
> > - create a binary release with sage -bdist 2.4.2
> > - Untar Sage-2.4.2.app.tar.gz
> > - cd Sage-2.4.2.app/Contents/MacOSX
> > - tar xzf /path/to/sage/dist/sage-2.4.2-PowerMacintosh-Darwin.tar.gz -
> > C .
>
> > and you are done. I can upload a dmg once I will be in the office (~7
> > hours from now, much better bandwith) if anybody is interested.
>
The compressed dmg is ~137MB, I will post a link once I am at the
office.
> > Problems/know issues:
> > - the sage interpreter is not terminated when you leave the notebook -
> > one workaround is to to a "killall python" in a shell, but that can't
> > be done in the script itseld. This will obviously kill all python
> > instances you are running, if you are root it will kill everybody's
> > python instances, so be careful.
>
> That's not a good solution. Best would be for me to add an option
> to the server so it automatically dies after some number of seconds
> with no activity. Then in your startup script you just pass in that
> option. What do you think?
>
Sounds good - I am trying to figure out if there is a way that the
notebook can tell the server to terminate itself. Currently when I
quit the notebook sage keeps running and even a "forced quit" of the
sage.app via dock does not terminate sage itself.
> > - I only tried this with Safari, but if Safari is already running
> > "sage -notebook" will fail.
>
> ?? I think "sage -notebook" should now, by default, pop up your
> default OS X browser, depending on which you've chosen in OS X.
>
It does open the default browser, I reinstalled OSX two days ago and
haven't installed firefox yet.
> > - if you are on MacIntel you need to adapt the script Sage-2.4.2,
> > obviously you need to do the same for other version numbers
>
> What's different about MacIntel?
>
The $platform should be different, hence the directory that the script
Sage-2.4.2 changes to to execute sage is different. The creation of
the app bundle can and will be automated with no need to edit any
scripts. This is as stated above just a quick and dirty hack - but it
is a start ;)
> > Overall this is obviously far from optimal. I will look into Platypus
> > (seehttp://mac.softpedia.com/get/System-Utilities/Platypus.shtml) to
> > get something better. If anybody would like to take it from here feel
> > free to do so.
>
> What is it that mainly makes it non-optimal?
>
The need to kill the python interpreted by hand.
> > I did take a superficial look at the dist target and in my tarball
> > there are ~40 static libs totalling about 35MB - these can probably be
> > dropped for a binary release, i.e. that release will not be able to
> > rebuld itself. Overall there seems to be some room for improvement by
> > getting rid of lots of other files, but that should be discussed in
> > another thread.
>
> I'm not too worried about such optimization at this point. It's
> always good to house clean like that every once in a while though.
>
Ok.
> A few days ago I installed TexShop + tex processor on my office macpro;
> the compressed download was over 700MB! It's amazing how big software
> is these days. But honestly it was very nice because the TexShop (+ tex)
> install was almost trivial and really does seem to include everything and
> every package I'm likely to want for doing tex. SAGE aims to be something
> similar.
>
I agree, but I don't know the number of downloads of sage at the
moment, but if we were to save 25% bandwith per download this wouldn't
be a bad thing.
> > PS: Any new estimate for 2.5? I am anxious to build an msi installer
> > for cygwin and as long as maxima doesn't work correctly on cygwin my
> > hands are tied :(
>
> I'm working on it right now. It's really difficult work, but going steadily.
>
Great, please let me know as soon as you are getting ready - that
would give me some time to build a msi installer close to the official
release of 2.5.
There is also an issue at the moment with clock() wrapping every 35
minutes only on cygwin - see http://groups.google.com/group/sage-devel/browse_thread/thread/288c2152da6670a9
- has anybody volunteered to take a close look?
> --
> William Stein
> Associate Professor of Mathematics
> University of Washingtonhttp://www.williamstein.org
Cheers,
Michael
That's reasonable.
> Sounds good - I am trying to figure out if there is a way that the
> notebook can tell the server to terminate itself. Currently when I
> quit the notebook sage keeps running and even a "forced quit" of the
> sage.app via dock does not terminate sage itself.
We could definitely have a way for the notebook to turn off the server.
But I think the best way is to just have it keep running and timeout.
That way people can just quit their web browser. This is house some
software I installed from HP for my office printer works, by the way.
> > > - if you are on MacIntel you need to adapt the script Sage-2.4.2,
> > > obviously you need to do the same for other version numbers
> >
> > What's different about MacIntel?
> >
>
> The $platform should be different, hence the directory that the script
> Sage-2.4.2 changes to to execute sage is different. The creation of
> the app bundle can and will be automated with no need to edit any
> scripts. This is as stated above just a quick and dirty hack - but it
> is a start ;)
Thanks for explanation.
> > > Overall this is obviously far from optimal. I will look into Platypus
> > > (seehttp://mac.softpedia.com/get/System-Utilities/Platypus.shtml) to
> > > get something better. If anybody would like to take it from here feel
> > > free to do so.
> >
> > What is it that mainly makes it non-optimal?
> >
>
> The need to kill the python interpreted by hand.
Understood.
> Great, please let me know as soon as you are getting ready - that
> would give me some time to build a msi installer close to the official
> release of 2.5.
OK. I'll hopefully have a pre-release tonight and a real official release
soon.
> There is also an issue at the moment with clock() wrapping every 35
> minutes only on cygwin - see http://groups.google.com/group/sage-devel/browse_thread/thread/288c2152da6670a9
> - has anybody volunteered to take a close look?
I forgot to mention on sage-devel that the message you posted about this
is very likely enough for me to easily fix the problem.
William
On Apr 23, 4:29 am, "William Stein" <wst...@gmail.com> wrote:
>
> > The compressed dmg is ~137MB, I will post a link once I am at the
> > office.
>
> That's reasonable.
Ok, you can find a copy at http://fsmath.mathematik.uni-dortmund.de/~mabshoff/sage/
- it is PPC only at the moment.
>
> > Sounds good - I am trying to figure out if there is a way that the
> > notebook can tell the server to terminate itself. Currently when I
> > quit the notebook sage keeps running and even a "forced quit" of the
> > sage.app via dock does not terminate sage itself.
>
> We could definitely have a way for the notebook to turn off the server.
> But I think the best way is to just have it keep running and timeout.
> That way people can just quit their web browser. This is house some
> software I installed from HP for my office printer works, by the way.
>
Ok, any pointers or suggestions on how to do this?
> > Great, please let me know as soon as you are getting ready - that
> > would give me some time to build a msi installer close to the official
> > release of 2.5.
>
> OK. I'll hopefully have a pre-release tonight and a real official release
> soon.
>
Yep. just saw it. Once the upload is finished I will give building it
a shot.
> > There is also an issue at the moment with clock() wrapping every 35
> > minutes only on cygwin - seehttp://groups.google.com/group/sage-devel/browse_thread/thread/288c21...
> > - has anybody volunteered to take a close look?
>
> I forgot to mention on sage-devel that the message you posted about this
> is very likely enough for me to easily fix the problem.
>
Ok.
> William
Cheers,
Michael
I'll have to think about it. It's a somewhat tricky problem, possibly involving
threads or improving the cleaner process.
> > > Great, please let me know as soon as you are getting ready - that
> > > would give me some time to build a msi installer close to the official
> > > release of 2.5.
> >
> > OK. I'll hopefully have a pre-release tonight and a real official release
> > soon.
> >
>
> Yep. just saw it. Once the upload is finished I will give building it
> a shot.
Please try to build on cygwin too. Note that I have *not* tested this
version at all on cygwin yet, so it will be interesting to see what happens.
> > > There is also an issue at the moment with clock() wrapping every 35
> > > minutes only on cygwin - seehttp://groups.google.com/group/sage-devel/browse_thread/thread/288c21...
> > > - has anybody volunteered to take a close look?
> >
> > I forgot to mention on sage-devel that the message you posted about this
> > is very likely enough for me to easily fix the problem.
> >
>
> Ok.
I put the fix in the 2.5 alpha that I released.
-- William
> On 4/23/07, mabshoff <Michael...@fsmath.mathematik.uni-
> dortmund.de> wrote:
>> Ok, you can find a copy at http://fsmath.mathematik.uni-
>> dortmund.de/~mabshoff/sage/
>> - it is PPC only at the moment.
>>
>>>
>>>> Sounds good - I am trying to figure out if there is a way that the
>>>> notebook can tell the server to terminate itself. Currently when I
>>>> quit the notebook sage keeps running and even a "forced quit" of
>>>> the
>>>> sage.app via dock does not terminate sage itself.
>>>
>>> We could definitely have a way for the notebook to turn off the
>>> server.
>>> But I think the best way is to just have it keep running and
>>> timeout.
>>> That way people can just quit their web browser. This is house some
>>> software I installed from HP for my office printer works, by the
>>> way.
>>>
>>
>> Ok, any pointers or suggestions on how to do this?
>
> I'll have to think about it. It's a somewhat tricky problem,
> possibly involving
> threads or improving the cleaner process.
I think it might be handy to have some kind of a timeout parameter on
the cleanup processes (though I'm not sure how one would communicate
"inactivity", touch a file whenever you're doing something).
Alternatively, put something in the "main" loop (or using timed
callback functions) in the sage notebook server. An idle notebook--ie
one that's open but not doing any calculations could poll the server
at some interval shorter than the timeout interval so that the server
remains up as long as the webpage does, but not long after.
- Robert
Yes, I like that -- it would be very handy. Measuring inactivity is
the tricky part.
I like your file idea -- with the notebook, every so often it saves its
state to a file -- it would be very easy to add something so that it also
touches a certain file in a tmp directory. If that file doesn't get touched
for 10 minutes, say, then the notebook server is killed. This works very
nicely, since, e.g., if the notebook crashes or gets into some weird
horrible loop, after 10 minutes it gets automatically killed by the cleaner.
(I'm imagining a frustrated deranged user who bangs on SAGE via the
notebook, somehow puts SAGE into a resource hogging infinite loop,
then crashes their poor web browser, and is happy when SAGE automatically
cleans up the mess within 2-3 minutes with no further work on their part.
> Alternatively, put something in the "main" loop (or using timed
> callback functions) in the sage notebook server. An idle notebook--ie
> one that's open but not doing any calculations could poll the server
> at some interval shorter than the timeout interval so that the server
> remains up as long as the webpage does, but not long after.
I considered this but I don't really have access to the current "main" loop;
it's owned by the SimpleHTTPServer right now. Also, this doesn't work
if the notebook crashes or gets into a weird state -- we want the thing
to stop after 10 minutes (say), no matter what. Using a separate cleaner
process seems much better from this point of view. And the result will
likely be very widely useful.
Thanks for your ideas.
William