librelist archives

« back to archive

Creating universal binaries in Homebrew?

Creating universal binaries in Homebrew?

From:
Malcolm Reynolds
Date:
2010-03-23 @ 17:07
Hi

First off thanks to everyone who has created Homebrew, I installed
about half an hour ago and already it's 200% less headaches than
Macports. I just have one issue so far - how can I go about making
universal binaries? For example, I want to install GSL (the GNU
Scientific Library) as a universal binary as I need to link the dylib
into a number of 32-bit only programs. I see from "grep -ir universal
*" in Library/Formula that a few formulae seem to have custom support
for universal binaries. Does this mean there is no system-wide support
for it?

Cheers,

Malcolm

Re: [homebrew] Creating universal binaries in Homebrew?

From:
Max Howell
Date:
2010-03-25 @ 08:06
Hey Malcolm,

Indeed, there are, it turns out, quite a number of times when
universal binaries are useful. For your own personal usage you can try
to get a universal binary by calling:

ENV.universal

in that formula's install function. That may work, but you might also
have to examine the formula's configure arguments too.

Really we should have a command line switch that activates that.

Max

> Hi
>
> First off thanks to everyone who has created Homebrew, I installed
> about half an hour ago and already it's 200% less headaches than
> Macports. I just have one issue so far - how can I go about making
> universal binaries? For example, I want to install GSL (the GNU
> Scientific Library) as a universal binary as I need to link the dylib
> into a number of 32-bit only programs. I see from "grep -ir universal
> *" in Library/Formula that a few formulae seem to have custom support
> for universal binaries. Does this mean there is no system-wide support
> for it?
>
> Cheers,
>
> Malcolm
>

Re: [homebrew] Creating universal binaries in Homebrew?

From:
Mike Arthur
Date:
2010-03-23 @ 17:18
On 23 Mar 2010, at 17:07, Malcolm Reynolds wrote:

> First off thanks to everyone who has created Homebrew, I installed
> about half an hour ago and already it's 200% less headaches than
> Macports. I just have one issue so far - how can I go about making
> universal binaries? For example, I want to install GSL (the GNU
> Scientific Library) as a universal binary as I need to link the dylib
> into a number of 32-bit only programs. I see from "grep -ir universal
> *" in Library/Formula that a few formulae seem to have custom support
> for universal binaries. Does this mean there is no system-wide support
> for it?

Correct, for the moment at least.

In some ways, universal binaries are against the spirit of Homebrew. 
Homebrew is about optimising installation for your particular version of 
OSX and your particular machine. This doesn't really sit well with 
universal binaries.

In this case what you want is not actually a universal binary anyway but a
32-bit version of the library. I'd recommend in that case you just compile
it manually. 

Out of interest, are these 32-bit only programs open-source or proprietary?

--
Cheers,
Mike Arthur
http://mikearthur.co.uk

Re: [homebrew] Creating universal binaries in Homebrew?

From:
Malcolm Reynolds
Date:
2010-03-23 @ 17:29
> Correct, for the moment at least.
>
> In some ways, universal binaries are against the spirit of Homebrew. 
Homebrew is about optimising installation for your particular version of 
OSX and your particular machine. This doesn't really sit well with 
universal binaries.
>

Fair enough, I figured this was probably an on-purpose thing.

> In this case what you want is not actually a universal binary anyway but
a 32-bit version of the library. I'd recommend in that case you just 
compile it manually.

I'll do this, thanks. My only problem is I might want the 64 bit
library at some point as well..

> Out of interest, are these 32-bit only programs open-source or proprietary?

One of them is matlab (proprietary), the student version is 32-bit
only. I know there are a bunch of free alternatives (python + numpy,
octave, sage, etc etc) but I've concluded from brief evaluations that
none of them are quite as good for fast prototyping, which is all
matlab is good for anyway. I also work in a field (Machine Learning /
Computer Vision) where matlab is completely ubiquitous (researchers
release their code in a matlab version only, usually) so ditching it
is simply not an option. Yet.

Another is Steel Bank Common Lisp, which is free (BSD licensed). I run
that 32-bit because more of the self tests pass compared to 64-bit,
although to be fair there is lots of active development on getting the
OS X version as stable as the Linux version is, so I may not be
running the 32 bit version for that much longer.

Anyway, thanks for your advice.

Malcolm

Re: [homebrew] Creating universal binaries in Homebrew?

From:
Mike Arthur
Date:
2010-03-23 @ 17:36
On 23 Mar 2010, at 17:29, Malcolm Reynolds wrote:

> I'll do this, thanks. My only problem is I might want the 64 bit
> library at some point as well..

In that case I'd recommend managing the 64-bit library in Homebrew and the
32-bit manually.

> One of them is matlab (proprietary), the student version is 32-bit
> only. I know there are a bunch of free alternatives (python + numpy,
> octave, sage, etc etc) but I've concluded from brief evaluations that
> none of them are quite as good for fast prototyping, which is all
> matlab is good for anyway. I also work in a field (Machine Learning /
> Computer Vision) where matlab is completely ubiquitous (researchers
> release their code in a matlab version only, usually) so ditching it
> is simply not an option. Yet.

Don't worry, this isn't Linux and we're not a bunch of open-source zealots
that will tell you to dump your proprietary software. It's just sometimes 
with open-source 32-bit-only software, either they can be included in 
Homebrew (e.g. Wine) or they can be patched.

> Another is Steel Bank Common Lisp, which is free (BSD licensed). I run
> that 32-bit because more of the self tests pass compared to 64-bit,
> although to be fair there is lots of active development on getting the
> OS X version as stable as the Linux version is, so I may not be
> running the 32 bit version for that much longer.

Good news that there is progress on this front.

> Anyway, thanks for your advice.

A pleasure. Thanks for your educated and reasonable questions. Have a great day!

--
Cheers,
Mike Arthur
http://mikearthur.co.uk