6
2
I have a Haskell program that I want to run on my school's cluster, but their version of GHC is too old and they won't update it. I want to somehow package it with my source code, but by default it requires running an install script. Is there a way for me to get an up-to-date Haskell compiler executable that will still work if I send it to another machine?
I could just cross-compile my code locally and send the executable over, but I'd rather it be buildable on the cluster itself.
2Until recently, I had roughly ten GHCs installed on my system, most of them under my home directory. :] – camccann – 2012-09-28T00:28:33.827
Thank you! Ideally, I'd like for it to be possible for any user to compile my program through
make
in my source directory, but this is a step up! – Matthew Piziak – 2012-09-28T00:30:35.4072@MatthewPiziak if you make your local ghc install globally readable (and executable where appropriate), any user would be able to use it as long as they have the path. – None – 2012-09-28T01:44:08.523
Oh! How would I do that?
chmod
on the executable? – Matthew Piziak – 2012-09-28T02:23:09.8331Precisely, and also the libraries. Using the install directory from this answer, the quick-and-dirty solution is
chmod -R o+rX /home/user/bin/ghc-7.6.1
. Of course /home/user/bin also needs to be readable. You'll probably want to adjust your cabal preferences to install libraries to the global db by default as well, since the "global db" is actually local to each ghc install. Then when you install a package to your local ghc's global db, everyone else using your ghc will have access also. – None – 2012-09-28T04:42:24.143Oh, if you install libs after running chmod, you'll probably need to chmod again to make them readable also. You might want to use
setfacl
or similar to make/home/user/bin/ghc-7.6.1
default new subfolders and files to globally readable. Or not, depending on your personal privacy/security preferences. – None – 2012-09-28T04:46:43.093