[Opa] Problem with build on FreeBSD, unsure where to add -I +site-lib/cryptokit..

Jeremy Messenger mezz.freebsd at gmail.com
Tue Jan 3 22:18:45 UTC 2012


2012/1/3 Frédéric Perrin <frederic.perrin at resel.fr>:
> Hello Jeremy,
>
>
> On 03.01.2012 00:08, Jeremy Messenger wrote:
>>
>> I am having a problem with the build on FreeBSD.
>
>
> I'm the guy who did the port to FreeBSD, but I didn't follow up since,
> so I guess I'm to blame :)

I saw your port of it. Thanks for did it! Even no java patch too that
I am hoping that opa will get rid of it. We still need to port
libbase/memory.c (was rusage.c) to FreeBSD. Maybe use the
kvm_getprocs()? http://tinyurl.com/7f9qndr  I have found an example of
it:

---------------------------------
kvm_t *kv;
int cnt;

kv = kvm_open(NULL, "/dev/null", NULL, O_RDONLY, NULL);

if (kv != NULL) {
  struct kinfo_proc *kproc;
  kproc = kvm_getprocs(kv, KERN_PROC_PID, uwsgi.mypid, &cnt);
  if (kproc && cnt > 0)
    *rss = kproc->ki_rssize * uwsgi.page_size;
  kvm_close(kv);
}
---------------------------------

I am not skill with C, so I am not sure how to make it match with
MacOS X and Linux for "return -1" part and move the "*rss=[...]"
outside of that check.

>>                                                   I have no idea
>> where I can add "-I +site-lib/cryptokit" in some where because the
>> Makefile has been generated by bslregister.native. [...]
>>
>> I have went in the _build/crypto.opp and edited the Makefile by add
>> "-I +site-lib/cryptokit". It works.
>
>
> From a quick investigation: In build_rules.ml:opp_build, the function
> that adds the include dirs assumes that the modules are either in $PWD,
> or in /usr/local/lib/ocaml.

Thanks for point me to the right place. I see that in the 376 line has:

let lib_dir s = [A"--ml";A"-I";A"--ml";P (if Pathname.exists s then
".." / s else ("+"^s))] in

It needs to add a new check if there has any match of use_* in the
config.ml then use it. If it doesn't exist in config.ml then go ahead
add "+". Do I get a right idea?

> In _build/myocamlbuild.ml, we can see that the directory for cryptolib
> has been correctly detected. This looks like some work in the build
> system is duplicated :-(

I will check it.

> FWIW, Arch Linux dropped the lib/ocaml -- lib/ocaml/site-lib
> separation because « This mixture prevented some packages from working
> with others and fragmented OCaml development on Arch Linux. The use of
> /usr/lib/ocaml/site-lib has therefore been discontinued. » I am not
> well-versed into ocaml development and don't know whether this is a
> good or a stupid decision.

Me either about don't know ocaml development and I don't know ocaml
(seem that I can read it a bit okay so far). But I think that anyone
need to follow what upstream OCaml developers say over Arch Linux. If
follow Arch Linux's specific then it is not going to work with other
Linux or some system that has standard installation without tweak.

>> BTW: I had to edit in libbsl/bslregister.ml by change from 'make' to
>> 'gmake' for the build. It's only for FreeBSD and *BSDs though.
>
>
> This should be done automatically by `configure'. Is it not?
>
> https://github.com/MLstate/opalang/blob/master/configure#L662

I don't think it will work unless change from "make" to "makebinary"?
It has a hardcore of "make" in there:

https://github.com/MLstate/opalang/blob/master/libbsl/bslregister.ml#L918

Without patch it to replace to "gmake" and it will not build correct
unless I replace it.

Mezz


> --
> Fred


-- 
mezz.freebsd at gmail.com - mezz at FreeBSD.org
FreeBSD GNOME Team
http://www.FreeBSD.org/gnome/ - gnome at FreeBSD.org


More information about the Opa mailing list