fxfactorial / opam-ios

OCaml cross-compiler for iOS
http://hyegar.com
78 stars 2 forks source link

Installing ocamlfind fails on OSX #1

Open sgrove opened 8 years ago

sgrove commented 8 years ago

Trying to build out the workflow to something I'm used to (merlin, etc.). Not clear that this is an opam-ios issue, but it does seem to work on other switches:

Confirming on the right switch:

$ opam switch
--     -- 3.07    Official 3.07 release
--     -- 3.08.0  Official 3.08.0 release
--     -- 3.08.1  Official 3.08.1 release
--     -- 3.08.2  Official 3.08.2 release
--     -- 3.08.3  Official 3.08.3 release
--     -- 3.08.4  Official 3.08.4 release
--     -- 3.09.0  Official 3.09.0 release
--     -- 3.09.1  Official 3.09.1 release
--     -- 3.09.2  Official 3.09.2 release
--     -- 3.09.3  Official 3.09.3 release
--     -- 3.10.0  Official 3.10.0 release
--     -- 3.10.1  Official 3.10.1 release
--     -- 3.10.2  Official 3.10.2 release
--     -- 3.11.0  Official 3.11.0 release
--     -- 3.11.1  Official 3.11.1 release
--     -- 3.11.2  Official 3.11.2 release
--     -- 3.12.0  Official 3.12.0 release
--     -- 3.12.1  Official 3.12.1 release
--     -- 4.00.0  Official 4.00.0 release
--     -- 4.00.1  Official 4.00.1 release
4.01.0  I 4.01.0  Official 4.01.0 release
--     -- 4.02.0  Official 4.02.0 release
--     -- 4.02.1  Official 4.02.1 release
--     -- 4.02.2  Official 4.02.2 release
upd     I 4.02.3  Official 4.02.3 release
ios     C 4.02.3  Official 4.02.3 release
4.02.3  I 4.02.3  Official 4.02.3 release
system  I system  System compiler (4.02.3)
#123 more patched or experimental compilers, use '--all' to show

Installing ocamlfind:

$ opam install ocamlfind
The following actions will be performed:
  ∗  install conf-pkg-config 1.0              [required by conf-ncurses]
  ∗  install conf-m4         1                [required by ocamlfind]
  ∗  install conf-ncurses    1                [required by ocamlfind]
  ∗  install ocamlfind       1.6.1
===== ∗  4 =====
Do you want to continue ? [Y/n] y

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫
[default] https://opam.ocaml.org/archives/ocamlfind.1.6.1+opam.tar.gz downloaded

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫
∗  installed conf-m4.1
∗  installed conf-pkg-config.1.0
∗  installed conf-ncurses.1
[ERROR] The compilation of ocamlfind failed at "./configure -bindir /Users/s/.opam/ios/bin -sitelib /Users/s/.opam/ios/lib -mandir /Users/s/.opam/ios/man -config /Users/s/.opam/ios/lib/findlib.conf".
Processing  4/4: [ocamlfind: make uninstall]
#=== ERROR while installing ocamlfind.1.6.1 ===================================#
# opam-version 1.2.2
# os           darwin
# command      ./configure -bindir /Users/s/.opam/ios/bin -sitelib /Users/s/.opam/ios/lib -mandir /Users/s/.opam/ios/man -config /Users/s/.opam/ios/lib/findlib.conf
# path         /Users/s/.opam/ios/build/ocamlfind.1.6.1
# compiler     4.02.3
# exit-code    1
# env-file     /Users/s/.opam/ios/build/ocamlfind.1.6.1/ocamlfind-35151-d2d111.env
# stdout-file  /Users/s/.opam/ios/build/ocamlfind.1.6.1/ocamlfind-35151-d2d111.out
# stderr-file  /Users/s/.opam/ios/build/ocamlfind.1.6.1/ocamlfind-35151-d2d111.err
### stdout ###
# [...]
# Configuration for str written to site-lib-src/str/META
# Configuration for threads written to site-lib-src/threads/META
# Configuration for unix written to site-lib-src/unix/META
# Configuration for stdlib written to site-lib-src/stdlib/META
# Configuration for bigarray written to site-lib-src/bigarray/META
# Configuration for camlp4 written to site-lib-src/camlp4/META
# Configuration for ocamlbuild written to site-lib-src/ocamlbuild/META
# Configuration for compiler-libs written to site-lib-src/compiler-libs/META
# Configuration for bytes written to site-lib-src/bytes/META
# Detecting compiler arguments: (extractor built) FAILED (see the file ocargs.log for details)
### stderr ###
# Cannot load required shared library dllunix.
# Reason: /Users/s/.opam/ios/lib/ocaml/stublibs/dllunix.so: dynamic loading not supported on this platform.

=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫
The following actions failed
  ∗  install ocamlfind 1.6.1
The following changes have been performed
  ∗  install conf-m4         1
  ∗  install conf-ncurses    1
  ∗  install conf-pkg-config 1.0

The former state can be restored with:
    opam switch import "~/.opam/ios/backup/state-20160206170253.export"

retrying manually....

$ cd /Users/s/.opam/ios/build/ocamlfind.1.6.1
$ ./configure -bindir /Users/s/.opam/ios/bin -sitelib /Users/s/.opam/ios/lib -mandir /Users/s/.opam/ios/man -config /Users/s/.opam/ios/lib/findlib.conf
Welcome to findlib version 1.6.1
Configuring core...
Checking for #remove_directory...
Testing threading model...
systhread_supported: true
Testing DLLs...
Cannot load required shared library dllunix.
Reason: /Users/s/.opam/ios/lib/ocaml/stublibs/dllunix.so: dynamic loading not supported on this platform.
Testing whether ppxopt can be supported...
Configuring libraries...
native dynlink: found
labltk: not present
ocamlbuild: found
camlp4: using safe_camlp4, style 310
compiler-libs: found
dbm: not present (normal since OCaml-4.00)
bytes: found, installing fake library
Configuration for dynlink written to site-lib-src/dynlink/META
Configuration for graphics written to site-lib-src/graphics/META
Configuration for num written to site-lib-src/num/META
Configuration for num-top written to site-lib-src/num-top/META
Configuration for str written to site-lib-src/str/META
Configuration for threads written to site-lib-src/threads/META
Configuration for unix written to site-lib-src/unix/META
Configuration for stdlib written to site-lib-src/stdlib/META
Configuration for bigarray written to site-lib-src/bigarray/META
Configuration for camlp4 written to site-lib-src/camlp4/META
Configuration for ocamlbuild written to site-lib-src/ocamlbuild/META
Configuration for compiler-libs written to site-lib-src/compiler-libs/META
Configuration for bytes written to site-lib-src/bytes/META
Detecting compiler arguments: (extractor built) FAILED (see the file ocargs.log for details)

$ cat ocargs.log
make: Nothing to be done for `all'.
./configure: line 562: tools/extract_args/extract_args: Bad CPU type in executable

Is this expected right now?

fxfactorial commented 8 years ago

Expected since somethings will have to be compiled specially, aka this opam repository needs to provide a custom definition of ocamlfind...which of course would be high value and probably the first thing that needs to be done.

fxfactorial commented 8 years ago

I think I tried doing this in the beginning but for WHATEVER reason ocamlfind wants to use ncurses, so need to disable that or get around it.