From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Mike Gran Newsgroups: gmane.lisp.guile.user Subject: Re: Adjusting Load Path from C/C++? Date: Wed, 15 Apr 2020 22:25:12 -0700 Message-ID: <20200416052512.GA1102960@spikycactus.com> References: <546899605.742163.1586923688566.ref@mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="94056"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "guile-user@gnu.org" To: Jaft Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu Apr 16 07:25:48 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jOx23-000OMH-6p for guile-user@m.gmane-mx.org; Thu, 16 Apr 2020 07:25:47 +0200 Original-Received: from localhost ([::1]:57998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jOx21-0000ml-Kg for guile-user@m.gmane-mx.org; Thu, 16 Apr 2020 01:25:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54677) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jOx1i-0000mX-Qh for guile-user@gnu.org; Thu, 16 Apr 2020 01:25:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jOx1h-0000Jm-RE for guile-user@gnu.org; Thu, 16 Apr 2020 01:25:26 -0400 Original-Received: from sonic301-30.consmr.mail.ne1.yahoo.com ([66.163.184.199]:35900) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jOx1h-0000Dv-Gu for guile-user@gnu.org; Thu, 16 Apr 2020 01:25:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1587014723; bh=qZlvlaEHNNrdbdcQgi+IgaRk9ZRhfxp5d/2T2uQ6YyI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=MZOAH5k9C2dxjcGze3/LcEwVu0Yf07bVWpU5ZjtG32Dr3U4fttxTIX5jRI8zKH4GedyXBicYY9gIySzVkbIzIKzpkIJC1jjvfNMAg/6YD+/7UCEiqlxIG7BqWYpbqJF1e9mCReRQI7wMHOZE64Ygqcl7K1PX/gGxwcBvtaZ50jv3h0GykBoJxINjrUhKHA5SQPmEawOLx5xNxEY3gTMd4oAeOsfM3sdKxb8W0GZTdlxcyaMUprb3L26mGJ23VdGoUODWazT5gv3mAzprHzT9oOCLNbvH+rAp2HcmoggNmQYweOySesnpOP0UMS0ebwnH91+rN6nhHXXzOVaxdXPDFQ== X-YMail-OSG: k6oEnuYVM1kNY4FxYDrhq9CVi0H5wnn1tLqSlMyHpwOTaFPjcXBIIZrTPPUqtk_ UBaf9gSuFKtYBAaHz0Apmqkml2g6hBYG8yyKz55tEvEZAJi3iW6_vjTbfTs84fIxyGQaFoGcRDtp 5.UUA_m_fE8IyfOKLk6Bzi48aAUw7.YklI2pJRQnEg2RPddSNfuinJbU6OHp0lflNBlc8mPm6ut6 KwbX.AGq8spBv7TBf_d6odmScg76OzmXz3uC.0a641vPUf6dO6CX.CH_EuzbxmoahBJwPwbFvIMZ xYiTaV1_yH.UzQuGcCqmDymav8Wsbz8Cxe.Gk4.snIuVh31qITx_a5og4gjFj3MwsHRP_3STDJvP YDX84UkOTtUVGaCfOC3.K3eoE8_YWzJwDWZsAyZyexE7xrDGOaTyDDL4lROqN_24KJrSxcKNFGfg B2iBtXae..MmIRRAW3uRIye9SVX1WF6pWMv3Zqv1McPtv3DN9pegxoTTqyhpF4ZXfwNtyWch5w8H WpOiqvOSH8IQiGZTPvylegN8hjwAtm2uvHDoWNFVwaTjs8yPe6P.t1f5xfhnUCJCj09WOvnloayc YYkrzRGhBYKgU1fsCoBSxwfIZGwL2nBBKb7D8yqPwQ4.BVDSnCqR3PZ6HBGiyRFt_hPwbmPlwuoE K5KD1OrkytLrW6tfm1bwZjsEd.2oJyzh70gT1qz.M4X54gYlstoFCXkxMYuNmwZKkV4_zj3YLmkZ JV08dU.ok6Dv1VDvRi9H8rcLFhUB7bTju1dGJ4EZnQUYWL6ye2UAH7.PAT2Jm3VfbdkD29pnJV9q n38KbQQ81vVjN3xu1jXeYRxWlRIeyAGFojyuiIdkIV Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ne1.yahoo.com with HTTP; Thu, 16 Apr 2020 05:25:23 +0000 Original-Received: by smtp409.mail.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 8b604d86eff1502b21e5b7258c14ca12; Thu, 16 Apr 2020 05:25:18 +0000 (UTC) Content-Disposition: inline In-Reply-To: X-Mailer: WebService/1.1.15651 hermes Apache-HttpAsyncClient/4.1.4 (Java/11.0.6) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 66.163.184.199 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16394 Archived-At: On Wed, Apr 15, 2020 at 04:08:08AM +0000, Jaft wrote: > Hello. I'm attempting to use Guile, from C, in a project. I've > managed, I believe, to properly hook up the dependencies and can > #include but running scm_init_guile() results in the error > > Throw without catch before boot: > Throw to key misc-error with args ("primitive-load-path" "Unable to find file ~S in load path" ("ice-9/boot-9") #f)Aborting. > You definitely need to be able to find ice-9/boot-9 at the very beginning of booting up guile. You won't have access to any Guile functionality if it can't find it. This means that you can't use Guile procedures to set the load path, since it needs the load path set to have Guile procedures. > Definitely someone correct me if I'm mistaken but I'm guessing it's > occurring because it's not finding the .scm files that typically (I > think? Leastwise, where I've always seen them) reside in a "share" > directory somewhere on the root path tree? > So this project allows moving libraries into where it's deployed but > all other files are containerized in the app's designated directory. > I believe there's a way to set the load path on build of Guile > (though, now that I think about it, the project may not share what > the eventual app. directory is/will-be during the build process so > that may not even be feasible???) but I was wondering if there was a > way to set (or add to) the build path from C? > I was thinking something like add-to-load-path but I didn't see a > corresponding C function in the documentation. If you know where you want to install your guile files, it is better to set the proper paths using options like "--prefix" when running "configure" for Guile. When it comes to setting the search paths from C, the easiest, if you don't have a problem with it, is to call setenv to set environment variables such as GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH before your first call to scm_init_guile or scm_boot_guile. > If I had a way, I figured I could just, then, have the necessary > modules moved to the app.'s directory on build, add the current > directory to the load path, and then call scm_init_guile(). > I dunno if there is a solve but thanks to anyone for any help! > Jonathan