I'm working on a shared system where I don't have root access, but where the admins have installed the Haskell Platform. Most Cabal packages install perfectly happily, but I need a library with a dependency on pcre-light, which of course depends on the C library pcre. Is there an easy way to install pcre under $HOME so that I can get on with my work?
As it happens, Homebrew works perfectly well from inside $HOME:
http://www.acloudtree.com/how-to-install-the-homebrew-package-management-utility-locally-on-mac-osx/
In short, you can install Homebrew simply by cloning the GitHub repo into $HOME, then adding $HOME/homebrew/bin to your $PATH. Then you can just say:
$ brew install pcre
Then tweak $HOME/.cabal/config like so:
extra-include-dirs: $HOME/homebrew/include
extra-lib-dirs: $HOME/homebrew/lib
(but use the actual directory instead of $HOME). Now cabal install pcre-light should work normally.
Related
I was wondering if there would be any issues with installing Nix and Homebrew on the same system?
I know Homebrew tends to install things all over different directories, but from what I have read, Nix is very clean. If I understand this correctly, Nix installs it's packages all within one single directory.
So if this is the case, could I try running them both side-by-side? I would be careful not to install too many of the same packages from both places in (ie. I wouldn't install grep, htop, or whatever else from both Homebrew and Nix and if I did I would take precautions).
Side-note: This would not be permanent. I am thinking about switching from Homebrew to Nix (just to mix things up a bit), and I wanted to try Nix on my main machine before taking the leap (if at all). I know I could just try Nix on a VM, but I would not get the same experience unless I tried it on my main system. So it would be nice to install it along Homebrew and give it a shot before going through the pains of removing Homebrew and replacing all my Homebrew packages with Nix packages.
Yes, you can install Nix along side Homebrew.
Nix will install all it's packages within /nix/store For example, on my NixOS system vim is currently installed in /nix/store/j6nrk9h1rpxrzmccm0yq520ik625gd1q-vim-8.1.0578
Your shell will choose whether to use a package from Nix or Homebrew, according to how $PATH is set up. For example, if it so happens that the Nix paths are first, then they will take precedence.
Note
A common source of confusion is that install means something different on Nix. When you install a package, such as Python, it becomes part of a Nix environment, and as such can be executed without specifying the full path; Just as you'd expect from any package manager.
However, if you install a package which has, say, Python, as a dependency, Python would get installed, but more likely than not it would not be included in the environment. Hence it can only be executed via the absolute path.
On a related note, due to a similar reason, if you install a library with Nix and then try to compile against it outside of Nix, it will not work; The build tools will not find the library.
I ran brew uninstall python but there's still the directory /usr/local/lib/python2.7.
Why brew didn't removed it? Is it still used? Can I remove it manually?
The folder /usr/local/lib/python2.7 is a directory shared with the system and it isn't owned by Homebrew: as you might now usr/local/Cellar is the proper Homebrew folder (along with several other spurious folders for taps and Cask).
It mainly contains packages (installed using pip).
I wouldn't touch such folder, since it is shared with the Python installation provided by OS X (through XCode Command Line Tools): if for any reasons (but I don't think so since you uninstalled python through Homebrew) you still have pip installed I would recommend to uninstall such packages through pip itself if you want to cleanup some space.
I'm trying to install a package called Geant4 by compiling from source (HomeBrew actually has the package but it's an old version and doesn't have support for Python which I need).
I want to put the Geant4 package in /usr/local/geant4 (perhaps this is not the proper place to put it in OSX?).
Now, the Homebrew FAQ has some instructions on how to install external stuff, but when I do brew diy, I get the error message:
Error: Couldn't determine build system
The command I should use to configure Geant4 is:
cd ~/my-build-directory
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/geant4 ~/Downloads/geant4.10.01.p01
brew diy makes a good effort to determine how to build a package, but it doesn't always get it right. In the case of custom packages, it's probably best to install them into $(brew --prefix)/Cellar/$package/$version, just as Homerew would -- that way, you can interact with the package using brew link, etc. You can also install it to /usr/local or anywhere you like, but mimicking Homebrew works really well.
In your case, you could probably install it with something like:
cd /my-build-directory
cmake -DCMAKE_INSTALL_PREFIX=$(brew --prefix)/Cellar/geant4/10.01.p01 ~/Downloads/geant4.10.01.p01
brew link geant4
I am trying to install ROOT (cern.root.ch). When I run ./configure , I get a message that libX11 is missing and must be installed.
I did some research and found that I need to install
) XQuartz (I already have the latest version.)
) Command line tools in Xcode.
I tried installing Command Line Tools from apple's developer website. The installation goes through smoothly but how do I know whether it has been installed? I still get libX11 missing error with root's configure command.
I also tried xcode-select --install and it once went through smoothly and then later again gives error saying this package is no longer maintained - or something of that sort.
I understand I may have multiple installations... But I am still facing the problem of not having libX11 and not being able to install ROOT.
Thanks,
Hershal.
This link and the one referenced in it suggests you use homebrew (brew) to install it
$ ruby <(curl -fsS https://raw.github.com/mxcl/homebrew/go)
$ brew doctor
Remember to add the Homebrew directory to your PATH by adding the directory (found with brew --prefix) to your .bashrc, .zshrc or whatever shell file you’re using (.bashrc is the OS X default). We’ll also add the XQuartz binaries to the PATH in case anything needs them in the future.
export PATH=/usr/local/bin:/opt/X11/bin:$PATH
Start a new Terminal session to pick up the changes.
Now that Homebrew is installed, we can use it to install the required dependencies. Each may take some time as Homebrew generally compiles from source.
$ brew install gfortran # Fortran compiler
$ brew install python # Python interpreter
$ brew install pcre # Regular Expressions library
$ brew install fftw # Fast Fourier Transforms
$ brew install cmake # Cross-platform make
install root
$ brew tap homebrew/science
$ brew install --with-cocoa root
You don't say whether you have installed XCode as well as the commandline tools but I think you will need it
I try to install scipy on my mac 10.6.8 but always have problem with it. I've installed ipython (sudo /usr/bin/easy_install-2.6 ipython) and numpy (python setup.py build/install), but when I installed scipy by the same way, I got always this error message:
RuntimeError: Running cythonize failed!
Could someone tell me how to solve this problem?
Have you tried using the binaries provided for OSX? That should ensure everything works.
EDIT
The easiest way I've found to keep package dependencies under control is to use MacPorts as much as possible because unlike Homebrew, the packages are designed to work together and dependencies are (almost always) automagically installed when you try to install something.
So, first, install MacPorts using the installer for Snow Leopard. Choose the option to install ports in a unique directory like /opt/local, so they don't conflict with whatever built-in versions the OS depends on. Also, ensure that /opt/local/bin and /opt/local/sbin are added to your $PATH before the system directories like /usr/bin, /bin, /sbin etc. so that when you run python from the command prompt you get the version you want. Your ~/.profile should have something like export PATH="/opt/local/bin:/opt/local/sbin:$PATH as its last line.
After MacPorts has been installed, you may want to restart just for fun to ensure that all of your environment variable are set up properly. Start Terminal.app (or your favorite replacement) and enter which port, which should return /opt/local/bin/port if everything worked correctly. Next, run sudo port selfupdate just to make sure everything is synced properly. Once that is done, we can install python and some modules. port allows you to pass a list of ports to be installed, so a command like sudo port install foo bar baz will install the latest versions of the foo, bar, and baz ports, along with any dependencies they may require, in the correct order. Some ports have binary distributions, and others are compiled as needed, so the first time you run it there may be a lot of dependencies to install. A nice feature of MacPorts is that you can have multiple versions of some packages installed at the same time, and you can switch between them if needed. Also, if port search is giving too many results, the online search engine can help you find what you're looking for.
To get a decent IPython-based Python 2 development environment going, you'll need the following:
python27
py27-ipython
py27-numpy
py27-scipy
py27-matplotlib (if you like drawing pretty pictures, but mainly so you can get pylab)
py27-pandas (DataFrames are your friend!)
and perhaps py27-pyqt4 if you run ipython via the qtconsole option
I'd also install py-pip and py27-distribute so you can install modules on your own if there is no MacPort version.
Finally, if you're a forward-looking person and want to use numpy et al. on Python 3, MacPorts has you covered! There are py32- and py33-based versions of all of the above packages except scipy, which is only py32 for now. However, I was able to install it just fine with pip, although I have a whole bunch of other devel tools on my machine, and I'm running 10.8.2, so YMMV.
Good luck!