Error during the build from source

2019-05-16 21:26发布

问题:

I have a 32bit architecture so I must build opa from source.

Configure works fine:

./configure -ocamlopt /opt/opa/bin/ocamlopt.opt -ocamlfind /opt/opa/bin/ocamlfind

Checking your OS... Linux
Checking your architecture... ix86
Checking ocamlopt... /opt/opa/bin/ocamlopt.opt
Checking ocamlbuild... /opt/opa/bin/ocamlbuild
Checking ocamldir... /opt/opa/lib/ocaml
Checking ocaml version... 3.12.0
Checking your ocaml setup... 3.12.0, Unix 32bit
Checking for camlp4... /opt/opa/bin/camlp4o
Checking for perl 5... found
Checking for camlidl... /opt/opa/bin/camlidl
Checking libnatpmp... /opt/opa/lib/ocaml/libnatpmp.a, OK
Checking miniupnpc... /opt/opa/lib/ocaml/libminiupnpc.a, OK
Checking for ocamlfind... /opt/opa/bin/ocamlfind
Checking for ssl... ocamlfind:/opt/opa/lib/ocaml/ssl, OK
Checking for cryptokit... +cryptokit, OK
Checking for camlzip... +camlzip, OK
Checking for graph... +ocamlgraph, OK
Checking for ulex... +ulex, OK

Congrats, you're all set. Installation will be done in:
/usr/local

Make returns:

make

Ocamlbuild plugin generation

_build/myocamlbuild -no-plugin -j 6 -tag debug pplib/ppml.native ocamlbase.top libbase/ocamlbase database/database_server.native jslang/jsstat.native database/database_tool.native opatop/opatop.native passlib/opatrack.sh qmlcompilers/qmljs_exe.native compilerlib/opadep.sh opabsl/opabslgen.bypass tools/odep.native libbase/testfilepos.native opabsl/serverLib.cmi tools/odeplink.native protocols/genproto.native libbase/bslServerLib.ml opalang/opa2opa.native protocols/mlidl.native tools/jschecker/compiler.jar tools/ofile.native protocols/wsdl2ml.native dissemination/spawn.sh opa/main.native bash_completion opadoc/opadoc.native pplib/ppopa.native pplib/ppjs.native libbase/gen_platform teerex/trx_ocaml.native teerex/trx_interpreter.native libbsl/bslregister.native libbsl/bslbrowser.native libbsl/bslbrowser passlib/passdesign.native opa-packages.stamp

+ /opt/opa/bin/ocamldep.opt -pp '/opt/opa/bin/camlp4o -I +ulex pa_ulex.cma pr_o.cmo'   -modules libbase/indexer.ml > libbase/indexer.ml.depends
Camlp4: Uncaught exception: DynLoader.Error ("pa_ulex.cma", "file not found in path")

Preprocessing error on file libbase/indexer.ml
Command exited with code 2.
Compilation unsuccessful after building 208 targets (204 cached) in 00:00:04.
make: *** [all] Erreur 10

回答1:

Sorry but OPA doesn't support 32 bit architecture for the moment. We are working on it.

You can read this article we posted on our blog, we answered to this question (and others): http://blog.opalang.org/2011/07/readers-questions-1.html

Q: Lack of 32-bit and Windows versions of the compiler

A: Yup, we're guilty here. We're working on the 32-bit version and hope to have it ready within a couple of weeks. Windows version is slightly more tricky but we did have a working Windows version and we will have it again without a doubt. We could use some help, by the way. Now that Opa is open-source. Any volunteers?

Keep in touch!



回答2:

I got Opa compiled for 32-bit Ubuntu 10.10. Had to install a bunch of pkgs from Debian 'Wheezy' (testing) before the build would complete. Packages required:

    camlp4_3.12.0-7_i386.deb
    camlp4-extra_3.12.0-7_i386.deb
    libcryptokit-ocaml_1.3-14+b2_i386.deb
    libcryptokit-ocaml-dev_1.3-14+b2_i386.deb
    libfindlib-ocaml_1.2.7+debian-1_i386.deb
    libfindlib-ocaml-dev_1.2.7+debian-1_i386.deb
    libocamlgraph-ocaml-dev_1.7-1+b2_i386.deb
    libssl-ocaml_0.4.5-1_i386.deb
    libssl-ocaml-dev_0.4.5-1_i386.deb
    libzip-ocaml_1.04-6+b2_i386.deb
    libzip-ocaml-dev_1.04-6+b2_i386.deb
    ocaml_3.12.0-7_i386.deb
    ocaml-base_3.12.0-7_i386.deb
    ocaml-base-nox_3.12.0-7_i386.deb
    ocaml-findlib_1.2.7+debian-1_i386.deb
    ocaml-interp_3.12.0-7_i386.deb
    ocaml-nox_3.12.0-7_i386.deb
    ocaml-ulex_1.1-2+b1_i386.deb

Put these all in a dir and from there run: dpkg --install --force-depends --auto-deconfigure *.deb

One should also run sudo apt-get purge ocaml ocaml-interp ocaml-nox-interp ocaml-nox (or something like that... from memory) .. to purge ocaml 3.11 from the system so 3.12 can be installed via the above .deb files.

NOTE: the compile of 'texttimer.opa' takes FOREVER (at least on my atom netbook).. I thought it was hung or something but after about 15 minutes it finished. Let it run.

I've only tried the hello_opa.opa so far but it looks promising!

[next morning] I installed the precompiled .deb for amd64 on my work machine just to compare -- recompiled the same hello Chat app, and it works just as on my 32-bit Ubuntu. However, BOTH apps don't display any of the image resources -- the tutorial mentions adding "opa-logo.png" and "user.png" to the resources directory, and the compile picks up on those but the resulting app shows no images. I'd suspected it was something to do with my 32-bit build, but apparently not.

Anyone know why the images aren't displayed by the chat app? The CSS does seem to reference those two PNGs. I just grabbed random PNGs from google images to use, but that shouldn't matter.