ocaml-cross / opam-cross-android

An OCaml cross-toolchain for Android and several useful libraries
105 stars 15 forks source link

building on MacOS #12

Closed markghayden closed 9 years ago

markghayden commented 9 years ago

I am building on up-to-date MacOS system. Trying to build 4.02.3 stop on the error below, apparently in building ocamldoc. Undoing part of the recent change to enable OCAMLDOC (in Makefile.in) seems to be a work-around.

best, Mark

WITH_DEBUGGER=ocamldebugger
#WITH_OCAMLDOC=ocamldoc
WITH_OCAMLBUILD=

The following actions will be performed:
  - install ocaml-android32 4.02.3                      [required by ocaml-android]
  - install ocaml-android   4.02.3
===== 2 to install =====
Do you want to continue ? [Y/n] y

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ocaml-android32.4.02.3] http://caml.inria.fr/pub/distrib/ocaml-4.02/ocaml-4.02.3.tar.gz downloaded

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ERROR] The compilation of ocaml-android32 failed at "make world opt install".
Processing  1/2: [ocaml-android32: ./remove.sh]
#=== ERROR while installing ocaml-android32.4.02.3 ============================#
# opam-version 1.2.2
# os           darwin
# command      make world opt install
# path         /Users/mhayden/.opam/4.02.3+32bit/build/ocaml-android32.4.02.3
# compiler     4.02.3+32bit
# exit-code    2
# env-file     /Users/mhayden/.opam/4.02.3+32bit/build/ocaml-android32.4.02.3/ocaml-android32-43747-c743ac.env
# stdout-file  /Users/mhayden/.opam/4.02.3+32bit/build/ocaml-android32.4.02.3/ocaml-android32-43747-c743ac.out
# stderr-file  /Users/mhayden/.opam/4.02.3+32bit/build/ocaml-android32.4.02.3/ocaml-android32-43747-c743ac.err
### stdout ###
# [...]
# ../stdlib/*.mli ../parsing/*.mli ../otherlibs/unix/unix.mli ../otherlibs/str/str.mli ../otherlibs/bigarray/bigarray.mli ../otherlibs/num/num.mli
# Makefile:313: recipe for target 'stdlib_man/Pervasives.3o' failed
# make[4]: Leaving directory '/Users/mhayden/.opam/4.02.3+32bit/build/ocaml-android32.4.02.3/ocamldoc'
# Makefile:158: recipe for target 'all' failed
# make[3]: Leaving directory '/Users/mhayden/.opam/4.02.3+32bit/build/ocaml-android32.4.02.3/ocamldoc'
# Makefile:738: recipe for target 'ocamldoc' failed
# make[2]: Leaving directory '/Users/mhayden/.opam/4.02.3+32bit/build/ocaml-android32.4.02.3'
# Makefile:129: recipe for target 'all' failed
# make[1]: Leaving directory '/Users/mhayden/.opam/4.02.3+32bit/build/ocaml-android32.4.02.3'
# Makefile:137: recipe for target 'world' failed
### stderr ###
# md5.c:215:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
# [...]
#      ^
#5 shift/reduce conflicts.
whitequark commented 9 years ago

Could you post the complete stdout file?

markghayden commented 9 years ago

—Mark

On Oct 3, 2015, at 2:28 PM, whitequark notifications@github.com wrote:

Could you post the complete stdout file?

— Reply to this email directly or view it on GitHub https://github.com/whitequark/opam-android/issues/12#issuecomment-145280866.

whitequark commented 9 years ago

There's nothing in your comment besides signature.

whitequark commented 9 years ago

In the log you sent me, the build system runs sh ./runocamldoc, but the patch removes all traces of that.

markghayden commented 9 years ago

To be honest, I don’t understand how the internals of this cross compilation environment with opam works. I didn’t make any changes that I’m aware of. I just ran the commands in the instructions. Are there some files I can provide that would explain this?

—Mark

On Oct 3, 2015, at 4:49 PM, whitequark notifications@github.com wrote:

In the log you sent me, the build system runs sh ./runocamldoc, but the patch https://github.com/whitequark/opam-android/blob/master/packages/ocaml-android32.4.02.3/files/patches/ocamldoc.patch removes all traces of that.

— Reply to this email directly or view it on GitHub https://github.com/whitequark/opam-android/issues/12#issuecomment-145293263.

whitequark commented 9 years ago

The full output of opam update android && opam install ocaml-android32 -v. The patch isn't being applied for some strange reason.

markghayden commented 9 years ago

I’m also seeing strange behavior with OCaml .a files, such as libasmrun.a and libunix.a. The files in the archive all seem to end in ‘/‘

Do you have access to a MacOS development machine? I could set up a login on one of ours.

—Mark

From 'ar t libasmrun.a'

/ startup.o/ main.o/ fail.o/ roots.o/ globroots.o/ signals.o/ signals_asm.o/ misc.o/ freelist.o/ major_gc.o/ minor_gc.o/ memory.o/ alloc.o/ compare.o/ ints.o/ floats.o/ str.o/ array.o/ io.o/ extern.o/ intern.o/ hash.o/ sys.o/ parsing.o/ gc_ctrl.o/ terminfo.o/ md5.o/ obj.o/ lexing.o/ printexc.o/ callback.o/ weak.o/ compact.o/ finalise.o/ custom.o/ unix.o/ backtrace.o/ natdynlink.o/ debugger.o/ meta.o/ dynlink.o/ arm.o/

On Oct 3, 2015, at 5:07 PM, whitequark notifications@github.com wrote:

The full output of opam update android && opam install ocaml-android32 -v. The patch isn't being applied for some strange reason.

— Reply to this email directly or view it on GitHub https://github.com/whitequark/opam-android/issues/12#issuecomment-145293930.

whitequark commented 9 years ago

Yes, but I'm busy for the time being.

markghayden commented 9 years ago

—Mark

On Oct 3, 2015, at 5:07 PM, whitequark notifications@github.com wrote:

The full output of opam update android && opam install ocaml-android32 -v. The patch isn't being applied for some strange reason.

— Reply to this email directly or view it on GitHub https://github.com/whitequark/opam-android/issues/12#issuecomment-145293930.

% opam update android && opam install ocaml-android32 -v

=-=- Updating package repositories =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [android] git://github.com/whitequark/opam-android already up-to-date

Updates available for 4.02.3+32bit, apply them with 'opam upgrade': ===== 1 to recompile ===== [NOTE] Package ocaml-android32 is already installed (current version is 4.02.3). sakhalin% opam remove ocaml-android32 The following actions will be performed:

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -> removed ocaml-android32.4.02.3 Done. sakhalin% opam update android && opam install ocaml-android32 -v

=-=- Updating package repositories =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [android] git://github.com/whitequark/opam-android already up-to-date The following actions will be performed:

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [ocaml-android32.4.02.3] http://caml.inria.fr/pub/distrib/ocaml-4.02/ocaml-4.02.3.tar.gz downloaded

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= [ocaml-android32: sed] Command started

markghayden commented 9 years ago

Well, I certainly appreciate your help. I’ll switch back to my Linux host for doing Android builds for the time being. —M

On Oct 3, 2015, at 5:40 PM, whitequark notifications@github.com wrote:

Yes, but I'm busy for the time being.

— Reply to this email directly or view it on GitHub https://github.com/whitequark/opam-android/issues/12#issuecomment-145295773.

whitequark commented 9 years ago

The log above confirms my suspicion: the patch isn't being applied. I have no idea why; maybe ask on #opam on irc.freenode.net?

markghayden commented 9 years ago

I removed .opam/repo/android, synced and rebuilt from scratch, including 4.02.3+32bit. Got the same result.

I switched back to 64-bit debian and appear to be running into the same strict-aliasing problem there, with the same warning/error in md5.c for ocamldoc. Same work-around fixes it.

I guess there could be a bug in opam affecting debian and macos...

I’ve been using opam-android with 4.02.1 for some time (with great success) and was hoping to upgrade toolchain to 4.02.3.

It sounds like you are busy but if you want to see my SEAiq app running on Android, you can download a free copy here: http:/doc.seaiq.com/dist . Pilots are already using it on River Seine for commercial vessels… Thanks again for your help.

—Mark

On Oct 3, 2015, at 5:50 PM, whitequark notifications@github.com wrote:

The log above confirms my suspicion: the patch isn't being applied. I have no idea why; maybe ask on #opam on irc.freenode.net?

— Reply to this email directly or view it on GitHub https://github.com/whitequark/opam-android/issues/12#issuecomment-145296073.

whitequark commented 9 years ago

Oh, you're the SEAiq person! I remember, yes.

The problem is not with md5.c... that's just a warning. Look at the line in stderr which says "sh ./runocamldoc" and then promptly fails to execute the (wrong) camlrun binary. That's the actual culprit.

I'll take a look into it when I have time.

markghayden commented 9 years ago

Thanks for looking into this. With the minor change I mentioned, I did get 64-bit debian upgraded to 4.02.3 and it appears to be working fine.

—Mark

On Oct 3, 2015, at 8:03 PM, whitequark notifications@github.com wrote:

Oh, you're the SEAiq person! I remember, yes.

The problem is not with md5.c... that's just a warning. Look at the line in stderr which says "sh ./runocamldoc" and then promptly fails to execute the (wrong) camlrun binary. That's the actual culprit.

I'll take a look into it when I have time.

— Reply to this email directly or view it on GitHub https://github.com/whitequark/opam-android/issues/12#issuecomment-145303862.