"cma文件不是字节码目标文件". =>那是什么意思? [英] "The cma file is not a bytecode object file" => What does that mean?

查看:90
本文介绍了"cma文件不是字节码目标文件". =>那是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装ocaml-sqlite3绑定,以从o'caml程序访问sqlite数据库.

I'm trying to install the ocaml-sqlite3 bindings, to access a sqlite database from an o'caml program.

配置和make顺利进行,但安装失败.因为文件sqlite3.cma不是字节码目标文件(请参见下文).

The configure and make go smoothly, but the installation fails. Because the file sqlite3.cma is not a bytecode object file (see below).

    ~/Software/ocaml-sqlite3-release-1.5.6> sudo make install

[ -f *.so ] && SO_FILES=*.so; \
        ocamlfind install sqlite3 META sqlite3.cmi sqlite3.mli sqlite3.cma *.cmxa *.a *.cmx $SO_FILES
Installed /usr/lib64/ocaml/site-lib/sqlite3/dllsqlite3_stubs.so
Installed /usr/lib64/ocaml/site-lib/sqlite3/sqlite3.cmx
Installed /usr/lib64/ocaml/site-lib/sqlite3/sqlite3.a
Installed /usr/lib64/ocaml/site-lib/sqlite3/libsqlite3_stubs.a
Installed /usr/lib64/ocaml/site-lib/sqlite3/sqlite3.cmxa
Installed /usr/lib64/ocaml/site-lib/sqlite3/sqlite3.cma
Installed /usr/lib64/ocaml/site-lib/sqlite3/sqlite3.mli
Installed /usr/lib64/ocaml/site-lib/sqlite3/sqlite3.cmi
Installed /usr/lib64/ocaml/site-lib/sqlite3/META
Updated /usr/lib64/ocaml/ld.conf
ocamlfind ocamlmktop -o sqlite3top -package "sqlite3" sqlite3.cma
The file sqlite3.cma is not a bytecode object file
make: *** [install] Error 2

这样做的一般原因是什么,您对这个特定的lib有经验吗? 我正在运行从源代码编译的ocaml v 3.11.1.

What is the general reason for that and have you experienced that for this particular lib ? I'm running ocaml v 3.11.1 compiled from source.

看来该文件是由ocamlfind提供的,也许问题是由于我使用的是64环境?

It seems the file is provided by ocamlfind, maybe the problem is due to the fact that i'm using a 64 environment ?

推荐答案

所以问题似乎出在不同的方向:

So it seems the problem was coming from different directions:

首先,由ocamlfind使用的ocaml编译器不合适.我已经通过查看/usr/local/etc/findlib.conf解决了这一问题. ocamlc指向ocamlopt.opt,该版本为3.10.

First, the ocaml compiler used by ocamlfind was not the right. I've figured that out by looking at the /usr/local/etc/findlib.conf. The ocamlc was pointing towards ocamlopt.opt and that was version 3.10.

然后,我不得不重新编译findlib.但是有一个问题,因为我使用的是64位架构,但是找不到某些元素,因此我不得不重新配置findlib,主要是修改-bindir和-sitelib.

Then, I had to recompile findlib. But there was a problem because I'm on a 64 architectures and some elements were not found, so I had to reconfigure findlib modifying -bindir and -sitelib mainly.

我还用-cc"gcc -m64"重新编译了ocaml系统,但是我不确定它是否有作用.

I've also recompiled the ocaml system with -cc "gcc -m64" but I'm not sure it has any effect.

现在,它可以工作,但是我必须使用-I添加sqlite3.cma目录(/usr/lib64/ocaml/site-lib/sqlite3).

Now, it works but i've to use -I to add the directory of sqlite3.cma (/usr/lib64/ocaml/site-lib/sqlite3).

不确定是否可以帮助任何人:-).

Not sure that could help anybody though :-).

这篇关于"cma文件不是字节码目标文件". =>那是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆