From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id AE9C97FC86 for ; Thu, 19 Mar 2015 20:01:56 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of jdimino@janestreet.com) identity=pra; client-ip=38.105.200.112; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jdimino@janestreet.com"; x-sender="jdimino@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of jdimino@janestreet.com designates 38.105.200.112 as permitted sender) identity=mailfrom; client-ip=38.105.200.112; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jdimino@janestreet.com"; x-sender="jdimino@janestreet.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mxout1.mail.janestreet.com) identity=helo; client-ip=38.105.200.112; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jdimino@janestreet.com"; x-sender="postmaster@mxout1.mail.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BuAADFHAtVnHDIaSZcg1haBIMJwxqFfQKBRAdMAQEBAQEBEQEBAQEBBhYJQoQPAQEBAwESER0BATcBBAsLCw0CAiYCAiEBEgEFARwGEwgah3kDCQgDpg4+MYpBcIRiAQWRZg2FKQEBAQEBAQQBAQEBAQEBARQGCoEXiXaCRIItB4JogUWUP4QzgUyBGzqLYUyEXBIjgRWEEG+CQwEBAQ X-IPAS-Result: A0BuAADFHAtVnHDIaSZcg1haBIMJwxqFfQKBRAdMAQEBAQEBEQEBAQEBBhYJQoQPAQEBAwESER0BATcBBAsLCw0CAiYCAiEBEgEFARwGEwgah3kDCQgDpg4+MYpBcIRiAQWRZg2FKQEBAQEBAQQBAQEBAQEBARQGCoEXiXaCRIItB4JogUWUP4QzgUyBGzqLYUyEXBIjgRWEEG+CQwEBAQ X-IronPort-AV: E=Sophos;i="5.11,431,1422918000"; d="scan'208";a="126813552" Received: from mxout1.mail.janestreet.com ([38.105.200.112]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Mar 2015 20:01:55 +0100 Received: from tot-qpr-mailcore1.delacy.com ([172.27.56.68] helo=tot-qpr-mailcore1) by mxout1.mail.janestreet.com with smtp (Exim 4.82) (envelope-from ) id 1YYfha-0006xu-Oi for caml-list@inria.fr; Thu, 19 Mar 2015 15:01:54 -0400 X-JS-Flow: external Received: by tot-qpr-mailcore1 with JS-mailcore (0.1) (envelope-from ) id BVCx0i-AAAD3y-Xi; 2015-03-19 15:01:54.753823-04:00 Received: from mail-ie0-f169.google.com ([209.85.223.169]) by mxgoog1.mail.janestreet.com with esmtps (UNKNOWN:AES128-GCM-SHA256:128) (Exim 4.72) (envelope-from ) id 1YYfha-0004sf-Ju for caml-list@inria.fr; Thu, 19 Mar 2015 15:01:54 -0400 Received: by iedm5 with SMTP id m5so10658510ied.3 for ; Thu, 19 Mar 2015 12:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=aVo29JKSit47SZUPWbccR3lyaxPtTDxYCUoeVPShSRQ=; b=YuweETngKSqs/0BGR1IDwnQqU8rQgE7Iow1tFq/aawQ+ttEpGeLWhdZCM9ht4wtkYH yeF9r7FRV0DPJZ7X8C5lddnRti63viqpT25XT8NhWF96cdm/KMkFb/c/y/6ckCeBEVsv +1JPMOIzqvw4zy3POs5IvBFB4VIzzlhLChJzo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=aVo29JKSit47SZUPWbccR3lyaxPtTDxYCUoeVPShSRQ=; b=hPg1nxwye7X5QGweHSbjWCnrbpX9QkJPCraOiZ4ROYMi6bSvjFruKWHsESuOvwcW/K NhFgEZ7lo+IYc9binYo/n3g+NP8AgFGPvCoDenje6ErZSk3BVS58qlvaXq1y6lqpC7l3 LXV7ec9nVicLvrR/C4FgjJtWcVsw0axBZ51qNC0NgUCxgWa3SdRrSpYkFA7Nkso4w2a6 gLn2Izv0ynZe3hOVibSlrRRQdUwlvnFh5VRrvtLeIA0W4Jdj8u22J8l7weuqSJGfKIDP E3W8NSf4lDws8e0rvrXgV+pMRHNpdG+tHozOYVCx+FaE1hBlOTM5W89tiYyz0Vj2qz3/ UG3A== X-Gm-Message-State: ALoCoQnRwxtOefNHK4cRODgCNGDUcOSKZH5xaiG/kdDV48x+uL3TXzeLaIxR1OMYXcC4GnFBZD66v7l64EpIfPO/QOp6gWZkAx9N0TYRJXK6gkMytgx7GPHnw2Tq3o0XOUNA6oylVcms X-Received: by 10.43.64.203 with SMTP id xj11mr13711032icb.54.1426791714291; Thu, 19 Mar 2015 12:01:54 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.43.64.203 with SMTP id xj11mr13711016icb.54.1426791714183; Thu, 19 Mar 2015 12:01:54 -0700 (PDT) Received: by 10.50.252.20 with HTTP; Thu, 19 Mar 2015 12:01:54 -0700 (PDT) In-Reply-To: References: Date: Thu, 19 Mar 2015 19:01:54 +0000 Message-ID: From:Jeremie Dimino To:Kenneth Adam Miller Cc:caml users Content-Type: text/plain; charset=UTF-8 X-JS-Processed-by: mailcore Subject: Re: [Caml-list] Utop Difficulties with C callbacks I have to run, but think the problem is that piqilib is not building a shared library for its C stubs: if you want to be able to load a library with C stubs in the toplevel, the stubs must be packed into a shared library. You normally do this with ocamlmklib and pass a -dllib option when building the .cma. oasis does all that automatically. This other option is to build the bytecode executable with -custom, which will link the C libraries, the ocamlrun executable and the bytecode into a single native executable. So simply adding -custom when building a custom utop should work. But the proper fix is to update piqilib to build a .so for its C stubs. On Thu, Mar 19, 2015 at 6:19 PM, Kenneth Adam Miller wrote: > So, I've been working for a while with a library and I've made a good > iteration. My code compiles and is nice, it does what is expected, but it > depends on a library, Piqi, that doesn't want to play nice in the > interpreter. I want to be a good citizen and do my homework and due > diligence, but nothing I do seems to make utop want to play nice with piqi. > > Here goes: > > When I execute utop -require mypackage repository with the newly built > package mypackage, but I get this error: > > File "_none_", line 1: > Error: The external function `camlidl_piqi_c_piqi_strtoull' is not available > > I checked out piqi locally, and pinned the package to my local build, where > I tried to ensure that the appropriate .c file is getting compiled and > linked into the cma and cmxa. They are without a shadow of a doubt. I then > thought maybe I would add an include directive to utop to tell it to pick up > the mli where the the external func : type = "name" is. Nope. > > I've done everything I can, from adding all combinations of additional > piqirun/piqilib/piqirun.pb/piqirun.ext combinations to the _oasis file that > specifies the serialization to trying to build my own utop to adding > additional require statements and include statements in the utop script. So > after trying to add the dependency to BuildDepends for myouterlib, I had > backed off to just adding the mylibrary to the specific binary that consumes > it, which is where my changes are (in that binary). > > I even went so far as to just try and get the changes compiled into a custom > utop. Nope. I got errors and errors; I built it with: > ocamlbuild -use-ocamlfind -pkg threads -pkg utop -pkg myouterlib -pkg camlp4 > -pkg core_kernel customtop.top > > (At the time I ran this, I had bap package's _oasis updated with the > appropriate compile BuildDepends so that it would link mylibrary too) > > and I had the let () = Utop_main.main ();; in "utopmain.ml" and customary > customtop.mltop containing just "Utopmain". I got: > > (Unbound value is specified in -pkg!>) > > I don't know what else to do besides ship code that is watered down without > an interactive component. :/ -- Jeremie