How to install an external package to /usr/local without troubling Homebrew? - macos

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

Related

How to install eclim with brew or other package manager?

I am trying to install eclim to my system for code completion in vim. But as far as the eclim website has mentioned, the only installation method seems to be downloading the bin or source code to your system and executing the installation command manually. But I really hate installing stuff in this way as it pollutes your system directories. I tried to use brew but there doesn't seem to be a formula named "eclim". So is there really no way for me to install eclim with a package manager on mac?
I tried to use brew but there doesn't seem to be a formula named "eclim". So is there really no way for me to install eclim with a package manager on mac?
Write the missing formula.

Errors installing OMake on OSX 10.10.5

I'm trying to install OMake so I can install Teyjus so I can start writing a bit of Lambda Prolog but I'm getting I'm getting a bunch of errors on OS X 10.10.5. The most current one, that I can't figure out, is:
*** omake: 497/1193 targets are up to date
*** omake: failed (5.99 sec, 124/124 scans, 81/94 rules, 258/1153 digests)
*** omake: targets were not rebuilt because of errors:
src/libmojave/lm_printf.cmx
src/libmojave/lm_printf.o
Has anyone run into this? Does anyone know of a fix? Would love to be able to get started.
Inspired by your posts (here and on /r/prolog) I decided to try and build Teyjus as well, and installed OCaml and OMake along the way. The following describes the steps I took to successfully install OCaml and OMake:
Installing OCaml
OCaml.org said the best way to install OCaml was to go through OPAM. However,
since I chose to install OPAM with homebrew, and OCaml was a prereq, I ended up
with the latest version of OCaml set up after the first two of the following steps:
Install opam via homebrew:
Following instructions from https://opam.ocaml.org/doc/Install.html
$ brew update
$ brew upgrade
$ brew install opam
Initialize opam
Following the instructions provided by the homebrew results, I ran
$ opam init # then `y` to allow alterations to the shell profile and another init file
$ eval `opam config env`
Installing standard libraries
If I'm going to have OCaml installed any how, I might as well get it set up
for proper use, cause eventually I'll want to play around with OCaml itself
again too. Thus, I took the advice of the OCaml installation instructions and
ran
$ opam install batteries core
Installing OMake
The OMake download page scared me. I thought, "hey, I've just installed
the robust OCaml package manager, OPAM, and OMake is written in OCaml – so maybe
I can find an OMake package on OPAM and dodge all those deadly bullet-points".
Thus I ran
$ opam show omake
And saw that omake 0.9.8.6-0 was on offer, which appears to be the most recent
one. So I installed it
$ opam update # just to be sure ;) But all was up to date
$ opam install omake
That should be it! I was able to build Teyjus from source subsequently (I'll post the whole record of my steps on the reddit thread).
As an FYI, adding information that answers a question you didn't ask, it looks like Teyjus binaries are also available for OSX: https://github.com/teyjus/teyjus/releases

How can I install pcre-light on OS X without root access?

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.

Error installing Vim with Homebrew (checking for tgetent()... configure: error: NOT FOUND!)

After running brew install vim, I get this error:
checking for tgetent()... configure: error: NOT FOUND!
You need to install a terminal library; for example ncurses.
Or specify the name of the library with --with-tlib.
Not sure how to go about fixing this.
You need to install developer tools from Xcode before. Or set up your env handly but you might have other binaries missing later. So I recommend you to install Xcode. And then developer tools. And finally get Vim ;). I even think that Vim is installed by default with developer tools.
Get it here :
https://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12
I ran into this problem as well. When running brew doctor, I found an ncurses5-config in the path, which seemed to be confusing homebrew. I uninstalled the chefdk, installed the latest xcode, run brew doctor to ensure the library is gone, and then run brew install vim.
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
/opt/chefdk/embedded/bin/finstyle-config
/opt/chefdk/embedded/bin/ncurses5-config
/opt/chefdk/embedded/bin/ncursesw5-config
/opt/chefdk/embedded/bin/pkg-config
/opt/chefdk/embedded/bin/xml2-config
/opt/chefdk/embedded/bin/xslt-config
This worked for me on Mac 10.11.4
brew install vim --with-tlib
You might also want to use --with-override-system-vi flag as well

how to install libX11 on OSx 10.9?

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

Resources