Closed mryau closed 7 years ago
Should be picked up by opam automatically from the build dir, try OPAM_VERBOSE?
Here is output from opam install lwt-android --verbose --debug:
...
00:00.027 STATE Loaded /home/guest/.opam/state.cache in 0.024s
00:00.085 STATE ROOT : /home/guest/.opam
00:00.085 STATE SWITCH : 4.04.0+32bit
00:00.085 STATE COMPILER : 4.04.0+32bit
...
00:00.085 STATE REPOS : { android, default }
00:00.085 STATE PACKAGES : 6774 packages
00:00.085 STATE INSTALLED : { base-bigarray.base, base-threads.base, base-unix.base, conf-android.1, conf-m4.1, ocaml-android.4.04.0, ocaml-android32.4.04.0, ocamlbuild.dev, ocamlfind.1.7.2, re-android.1.7.1, result.1.2, result-android.1.2, topkg.0.9.0 }
00:00.085 STATE ROOTS : { base-bigarray.base, base-threads.base, base-unix.base, conf-android.1, ocaml-android.4.04.0, ocamlbuild.dev, re-android.1.7.1, topkg.0.9.0 }
00:00.085 STATE REINSTALL : {}
...
00:00.167 FILE(export) Wrote ~/.opam/4.04.0+32bit/backup/state-20170424033011.export in 0.000s
00:00.211 CLIENT INSTALL lwt-android
00:00.753 CLIENT Orphans: full {}, versions {}
00:00.820 SOLVER resolve request=install:(lwt-android) remove:() upgrade:()
...
=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
00:03.764 PARALLEL Iterate over 1 task(s) with 4 process(es)
00:03.764 PARALLEL Starting job 72462484 (worker 1/4): ∗ lwt-android.2.6.0
00:03.764 ACTION extract_package: lwt-android.2.6.0 from /home/guest/.opam/packages.dev/lwt-android.2.6.0/2.6.0.tar.gz
00:03.764 SYSTEM rmdir /home/guest/.opam/4.04.0+32bit/build/lwt-android.2.6.0
00:03.770 SYSTEM mkdir /tmp/opam-13739-42bb52
00:03.783 SYSTEM [log-13739-9b8556] (in 0.000s) tar xfz /home/guest/.opam/packages.dev/lwt-android.2.6.0/2.6.0.tar.gz -C /tmp/opam-13739-42bb52
00:03.794 SYSTEM [log-13739-5f1023] (in 0.004s) mv /tmp/opam-13739-42bb52/lwt-2.6.0 /home/guest/.opam/4.04.0+32bit/build/lwt-android.2.6.0
00:03.794 SYSTEM rmdir /tmp/opam-13739-42bb52
00:03.797 PARALLEL Next task in job 72462484: env OCAMLFIND_TOOLCHAIN=android ocaml setup.ml -configure --prefix /home/guest/.opam/4.04.0+32bit --disable-libev --disable-react --disable-ssl --enable-unix --enable-preemptive --enable-android-target
[lwt-android: env ocaml] Command started
Processing 1/1: [lwt-android: env ocaml]
+ env "OCAMLFIND_TOOLCHAIN=android" "ocaml" "setup.ml" "-configure" "--prefix" "/home/guest/.opam/4.04.0+32bit" "--disable-libev" "--disable-react" "--disable-ssl" "--enable-unix" "--enable-preemptive" "--enable-android-target" (CWD=/home/guest/.opam/4.04.0+32bit/build/lwt-android.2.6.0)
- not checking for pkg-config
- not checking for libev
- testing for pthread: ........................... unavailable
- not checking for glib
-
- Some required C libraries were not found. If a C library <lib> is installed in a
- non-standard location, set <LIB>_CFLAGS and <LIB>_LIBS accordingly. You may also
- try 'ocaml setup.ml -configure --disable-<lib>' to avoid compiling support for
- it. For example, in the case of libev missing:
- export LIBEV_CFLAGS=-I/opt/local/include
- export LIBEV_LIBS='-L/opt/local/lib -lev'
- (* or: *) ocaml setup.ml -configure --disable-libev
-
- Missing C libraries: pthread
- E: Failure("Command 'ocaml utils/discover.ml -ext-obj .o -exec-name a.out -use-libev false -os-type Unix -use-glib false -ccomp-type cc -use-pthread true -use-unix true -android-target true -libev_default true' terminated with error code 1")
00:05.114 PARALLEL Collected task for job 72462484 (ret:1)
[ERROR] The compilation of lwt-android failed at "env OCAMLFIND_TOOLCHAIN=android ocaml setup.ml
-configure --prefix /home/guest/.opam/4.04.0+32bit --disable-libev --disable-react
--disable-ssl --enable-unix --enable-preemptive --enable-android-target".
00:05.114 ACTION Removing lwt-android.2.6.0 (false)
00:05.115 PARALLEL Next task in job 72462484: ocamlfind -toolchain android remove lwt
00:00.085 STATE State switch-lock loaded in 0.084s
00:00.085 SYSTEM locking /home/guest/.opam/4.04.0+32bit/lock
00:00.085 STATE LOAD-STATE(install)
...
And the setup.data of lwt-android contains:
ocamlfind="/home/guest/.opam/4.04.0+32bit/bin/ocamlfind"
ocamlc="/home/guest/.opam/4.04.0+32bit/bin/ocamlc.opt"
ocamlopt="/home/guest/.opam/4.04.0+32bit/bin/ocamlopt.opt"
ocamlbuild="/home/guest/.opam/4.04.0+32bit/bin/ocamlbuild"
pkg_name="lwt"
pkg_version="2.6.0"
os_type="Unix"
system="linux_elf"
architecture="i386"
ccomp_type="cc"
ocaml_version="4.04.0"
standard_library_default="/home/guest/.opam/4.04.0+32bit/lib/ocaml"
standard_library="/home/guest/.opam/4.04.0+32bit/lib/ocaml"
standard_runtime="/home/guest/.opam/4.04.0+32bit/bin/ocamlrun"
bytecomp_c_compiler="gcc -m32 -std=gnu99 -O2 -fno-strict-aliasing -fwrapv -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -fPIC"
native_c_compiler="gcc -m32 -std=gnu99 -O2 -fno-strict-aliasing -fwrapv -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT"
...
pkg_bytes="/home/guest/.opam/4.04.0+32bit/android-sysroot/lib/bytes"
pkg_result="/home/guest/.opam/4.04.0+32bit/android-sysroot/lib/result"
pkg_unix="/home/guest/.opam/4.04.0+32bit/android-sysroot/lib/ocaml"
pkg_bigarray="/home/guest/.opam/4.04.0+32bit/android-sysroot/lib/ocaml"
pkg_compiler_libs_common="/home/guest/.opam/4.04.0+32bit/android-sysroot/lib/ocaml/compiler-libs"
pkg_threads="/home/guest/.opam/4.04.0+32bit/android-sysroot/lib/ocaml"
ocamldoc="/home/guest/.opam/4.04.0+32bit/bin/ocamldoc"
It seems lwt's setup.ml ignores as ocaml-android's default toolchain settings for C compiler as environment variables. In case I setup libffi-sys-android, it uses bitbake's toolchain, and it reacts if I override default settings by export new CC, LD, CFLAGS and LDFLAGS values too.
Is there way to say lwt's setup.ml what toolchain it should use?
As additional information:
OCAMLFIND_TOOLCHAIN=android ocaml utils/discover.ml -ext-obj .o -exec-name a.out -use-libev false -os-type Unix -use-glib false -ccomp-type cc -use-pthread true -use-unix true -libev_default true
all tests, including pthreads are passed, and they uses right cross compiler suite.
Hello, I'm trying to port your crosscompiler toolchain to yocto/bitbake based ARM distro. I have slightly modified conf-android's opam file:
pin it and successfully built ocaml-android for ARM:
Simple tests such as helloworld.ml and test_pcre.ml were crosscompiled nicely an work well on target machine. But when I tryed to install lwt-android I got:
I've tried to setup CC,LD,CPP,CFLAGS, LDFLAGS and PTHREAD_CFLAGS with PTHREAD_LIBS environment variables by hand but nothing changed. Of course, I can cross compile test for pthread from setup.ml by hands without any errors.
I suppose, after I install conf-android, I should see file conf-android.config somewhere in .opam as it written due build stage, but there is no such file. Isn't it root of my problems?