kpeeters / cadabra2

A field-theory motivated approach to computer algebra.
https://cadabra.science/
GNU General Public License v3.0
216 stars 37 forks source link

cmake doesn't pass down an "install prefix" to some paths #125

Closed haraldschilly closed 4 years ago

haraldschilly commented 5 years ago

Setting an install prefix for cmake should change the location where the application is being installed. I.e. in particular, such that users can deploy this in their own ~/.local directory (hence binaries will be in ~/.local/bin etc.)

This is done by replacing cmake .. with cmake -DCMAKE_INSTALL_PREFIX:PATH=~/.local/ ..

Overall this works fine, and someone just has to add the ~/.local/bin dir to the PATH. However, make install fails right here, which indicates that there are some paths which aren't using the install prefix properly:

[...]
-- Installing: /home/user/.local/share/icons/hicolor/64x64/apps
-- Installing: /home/user/.local/share/icons/hicolor/256x256/apps
-- Installing: /home/user/.local/share/icons/hicolor/scalable/apps
-- Installing: /home/user/.local/share/cadabra2/images/cadabra2-gtk.png
-- Installing: /usr/share/icons/hicolor/64x64/apps/cadabra2-gtk.png
CMake Error at frontend/gtkmm/cmake_install.cmake:117 (file):
  file INSTALL cannot copy file
  "/home/user/cadabra2/images/64x64/cadabra2-gtk.png" to
  "/usr/share/icons/hicolor/64x64/apps/cadabra2-gtk.png".
Call Stack (most recent call first):
  frontend/cmake_install.cmake:214 (include)
  cmake_install.cmake:46 (include)

Makefile:73: recipe for target 'install' failed
make: *** [install] Error 1

Still, cadabra2 starts up and the tests pass. So, this is probably pretty much all that's missing here …

haraldschilly commented 5 years ago

well, I found a related ticket. This is a duplicate of https://github.com/kpeeters/cadabra2/issues/123

kpeeters commented 5 years ago

Since this keeps coming up, I have just pushed a change which always puts icons below CMAKE_INSTALL_PREFIX. Be aware that many window managers will not show you icons if you have them in anything but CMAKE_INSTALL_PREFIX=/usr. That's their bug of course.

kpeeters commented 5 years ago

That's commit b354300c95b5b9e41b2f6480f69c4f92c2c35a7b.

haraldschilly commented 5 years ago

Thank you for the quick fix. I was able to install this in a project on https://cocalc.com without any issues and all tests pass.

kpeeters commented 5 years ago

I have a feature/jupyter-kernel branch which has some preliminary code for a Cadabra Jupyter kernel. Very experimental at this stage, but that's probably the best way forward for integration with a service like cocalc.

kpeeters commented 5 years ago

Is that feature (installing custom software) only available for non-free cocalc accounts? Care to write down in a few lines how you did this?

haraldschilly commented 5 years ago

CoCalc is basically a remote linux environment and you're the user "user". You don't have admin rights and it's all confined in a container. Hence, the instructions for ubuntu work right out of the box, except for that prefix. CoCalc already puts ~/bin and ~/.local/bin into your PATH, too.

The only obstacle with free accounts is that there is no remote internet access and lower grade hosting. But you can email us at help@cocalc.com your project ID and we can upgrade it for free, such that you can properly test and work in a terminal. No problem.

Besides that, we'll install cadabra2 globally for everyone, which will be released in the next few days. Then, everything should just work out of the box.

That jupyter kernel sounds interesting. Maybe we should work out how to deploy this on cocalc and test it? It does sound like it isn't too hard to setup…?

I've also tested the GTK app: below is a screenshot from a test project, running a notebook in the X11 desktop:

kpeeters commented 5 years ago

Very nice, drop me a line when cadabra2 is available for everyone, then I'll announce on the cadabra front page as well (this is potentially very useful for a number of users). I'm very busy this coming week but I'll try to get something more structured to you about the jupyter kernel asap. I was toying with the idea of running a jupyterlab server myself but cocalc is probably a much, much better idea.

haraldschilly commented 5 years ago

This sounds exciting! Cadabra2 is available on CoCalc, see our software update notes!

kpeeters commented 5 years ago

Seems to work fine, I'll do an announcement on my end. Thanks!

kpeeters commented 5 years ago

There is now an experimental Jupyter kernel for Cadabra. See https://github.com/kpeeters/cadabra2/blob/master/JUPYTER.rst for build instructions. This lacks a few features, in particular proper error reporting, but any feedback on the build process at this stage is very welcome.

kpeeters commented 4 years ago

@haraldschilly I have been running the Jupyter kernel on a private VPS for some time now, and thing seem to work fine. Would you be willing to offer it on Cocalc as a Jupyter kernel as well?

haraldschilly commented 4 years ago

@kpeeters in general yes, but could you please point me to some docs?

I've also made https://github.com/sagemathinc/cocalc/issues/4185 to track this as part of the cocalc tickets...