matsen / pplacer

Phylogenetic placement and downstream analysis
http://matsen.fredhutch.org/pplacer/
GNU General Public License v3.0
74 stars 18 forks source link

Better OS X builds #185

Closed koadman closed 12 years ago

koadman commented 12 years ago

Right now the OS X builds are for 10.7, but lots of people have older versions of OS X and 10.7 builds may not work on them. Also, if gsl could be statically linked it would eliminate the need to install libgsl manually which can be confusing for novice users.

To achive static gsl linking, the ocaml gsl binding makefile can be modified with the following patch:

--- Makefile.orig 2011-11-12 09:53:57.000000000 -0800 +++ Makefile 2011-11-11 16:22:16.000000000 -0800 @@ -1,5 +1,5 @@

If you're compiling with cygwin, comment this out

-DYNAMIC_LINKING = true +# DYNAMIC_LINKING = true

OCAMLC := ocamlc OCAMLOPT := ocamlopt @@ -149,7 +149,7 @@

install : all $(OCAMLFIND) install gsl META \

otool -L pplacer can be used to check whether this worked.

In order to build binaries for older OS X, just add the compiler flag -mmacosx-version-min=10.4 -arch x86_64. I'm not sure what the best way to do make this work in ocaml would be, maybe export CC="gcc -mmacosx-version-min=10.4 -arch x86_64" ? Note that libgsl will also need to be built with these flags.

habnabit commented 12 years ago

The binaries are not 10.7-specific; the pplacer page is out-of-date and slightly misworded. When it refers to 10.7.0, that is the version of Darwin (which is 10.8.0 now in the latest 10.6) and not of OS X. All the binaries are built on a 10.6 machine and my own separate 10.6 machine can run them just fine. I don't have any older versions of OS X to test on for compatibility pre-10.6.

gsl was previously statically-linked into the final executable and I'm not sure what's changed in the build environment that would cause it to behave differently. I've already tried rebuilding an older version of pplacer with the same environment and still gotten dynamic linking, so it's not an issue with pplacer. I'm looking into it now.

koadman commented 12 years ago

Thanks for looking into this. Indeed, the binaries do seem to work on OS X 10.6, but on my OS X 10.5 machine I get the following error message:

dyld: unknown required load command 0x80000022

which a little googling suggests is due to a 10.6+ architecture requirement. Incidentally I do have gsl installed on the 10.5 machine & in my library path. If it's not too hard to add the compiler flags to enable 10.5 and 10.4 compatibility those of us with older macs would much appreciate it.

On Wed, 2011-11-16 at 10:19 -0800, Aaron Gallagher wrote:

The binaries are not 10.7-specific; the pplacer page is out-of-date and slightly misworded. When it refers to 10.7.0, that is the version of Darwin (which is 10.8.0 now in the latest 10.6) and not of OS X. All the binaries are built on a 10.6 machine and my own separate 10.6 machine can run them just fine. I don't have any older versions of OS X to test on for compatibility pre-10.6.

gsl was previously statically-linked into the final executable and I'm not sure what's changed in the build environment that would cause it to behave differently. I've already tried rebuilding an older version of pplacer with the same environment and still gotten dynamic linking, so it's not an issue with pplacer. I'm looking into it now.


Reply to this email directly or view it on GitHub: https://github.com/matsen/pplacer/issues/185#issuecomment-2765432

habnabit commented 12 years ago

Okay, the build environment for OS X binaries has been fixed and I've tried recompiling the entire toolchain against the 10.5 SDK. OCaml 3.12 appears to be broken with the 10.4u SDK. I still don't have any way of testing for 10.5 compatibility, so here's a test build:

http://matsen.fhcrc.org/pplacer/data/pplacer-v1.1.alpha10-1-gbe18299-Darwin-10.8.0.tar.gz

Anyway, this is unrelated to the pplacer codebase on github; we can communicate by e-mail if this doesn't resolve 10.5 compatibility.