Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better OS X builds #185

Closed
koadman opened this issue Nov 12, 2011 · 3 comments
Closed

Better OS X builds #185

koadman opened this issue Nov 12, 2011 · 3 comments

Comments

@koadman
Copy link

koadman commented Nov 12, 2011

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 \

  •      libmlgsl.$(A) dllmlgsl.$(D) gsl.cma gsl.cmxa gsl.$(A) $(CMI) $(MLOPTOBJ) 
    
  •      libmlgsl.$(A) gsl.cma gsl.cmxa gsl.$(A) $(CMI) $(MLOPTOBJ) 
    

    ocamlgsl.odoc : $(MLOBJ) $(CMI)
    $(OCAMLDOC) -v -dump $@ $(filter-out gsl_misc.%, $(filter %.mli, $(SRC)))

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
Copy link
Contributor

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
Copy link
Author

koadman commented Nov 16, 2011

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:
#185 (comment)

@habnabit
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants