unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Adjusting Load Path from C/C++?
       [not found] <546899605.742163.1586923688566.ref@mail.yahoo.com>
@ 2020-04-15  4:08 ` Jaft
  2020-04-16  5:25   ` Mike Gran
  0 siblings, 1 reply; 2+ messages in thread
From: Jaft @ 2020-04-15  4:08 UTC (permalink / raw)
  To: guile-user@gnu.org

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.

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 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Adjusting Load Path from C/C++?
  2020-04-15  4:08 ` Adjusting Load Path from C/C++? Jaft
@ 2020-04-16  5:25   ` Mike Gran
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Gran @ 2020-04-16  5:25 UTC (permalink / raw)
  To: Jaft; +Cc: guile-user@gnu.org

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-16  5:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <546899605.742163.1586923688566.ref@mail.yahoo.com>
2020-04-15  4:08 ` Adjusting Load Path from C/C++? Jaft
2020-04-16  5:25   ` Mike Gran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).