<div dir="ltr"><div><div>Thanks Frank. Unfortunately it is just not true that "The OS does know how to load libs" as much as you and I would like, based on bug reports I've seen, patches, and my investigation of Quicklisp libraries.<br>

</div><div><br>Attempts to tell people to set their env or otherwise configure their OS/install their libraries correctly usually meets with indignant contentiousness. People load a system, get a failure on the foreign library load, locate the define-foreign-library form, then send a request/patch to add an absolute path for their OS. They don't want to be told to set their environment (they may not even know what that is), they want it to work, and they've found a way to make it work for them. My idea is to: (a) have all the libraries work out of the box, and (b) not have to tell people to fix their OS configuration, when it's not even well-defined how to do that (or, at least, I don't know how to do it for their OS -- it's not always LD_LIBRARY_PATH).<br>

<br></div>This takes care of both problems in many cases. <br><br></div>Liam<br><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Mar 30, 2014 at 12:21 PM, Frank Goenninger <span dir="ltr"><<a href="mailto:frgo@me.com" target="_blank">frgo@me.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Liam,<br>
<br>
as it does not hurt to have multiple directories in *foreign-library-directories* I personally don't care what the entries are ... One of the first things I do is set it to nil .. The OS does know how to load libs. If someone wants to add dirs then please do this via env vars!!<br>


<br>
Just my two cents.<br>
<br>
Cheers<br>
   Frank<br>
<br>
PS I don't understand all the discussion around this. Proper env var setting just about cures everything.<br>
<br>
Von meinem iPhone gesendet<br>
<br>
> Am 30.03.2014 um 15:41 schrieb Liam Healy <<a href="mailto:lnp@healy.washington.dc.us">lnp@healy.washington.dc.us</a>>:<br>
<div><div class="h5">><br>
> From time to time I have seen requests from users to include an absolute path (starting from "/") in systems that use load-foreign-library under a clause for their favorite OS. This makes me nervous, especially when it is a little-used OS, because I have the feeling the requester's configuration is not typical for that OS and I will later get a request to add a different path when the original requester has moved on.<br>


><br>
> Ideally, there would never have to be any absolute paths; dlopen would always know where to find libraries, because the OS is always configured in a standard way. However, a quick survey of this topic shows that reality falls far short of this ideal, and remedies are not clear. It is well beyond our capabilities to fix the entire world on this matter.<br>


><br>
> Between fixing the world and fixing every CFFI-using application one by one, there is the compromise of setting default search paths for each OS in CFFI itself, thereby opening all applications to proper functionality out of the box for most OSes. The variable cffi:*foreign-library-directories* seems like the right thing to set. I've looked through all Quicklisp libraries for absolute paths in uses of load-foreign-library, and found these:<br>


><br>
> Solaris: /lib/64, /usr/lib/amd64, /usr/lib<br>
> Darwin: /usr/lib, /opt/local/lib, /usr/local/lib<br>
> Unix: /usr/local/lib, /usr/lib<br>
><br>
> Therefore I propose to change the definition to:<br>
><br>
> (defvar *foreign-library-directories*<br>
>   '(#+(or unix darwin solaris) "/usr/lib"<br>
>     #+(or unix darwin) "/usr/local/lib"<br>
>     #+darwin "/opt/local/lib"<br>
>     #+solaris "/lib/64"<br>
>     #+solaris "/usr/lib/amd64")<br>
>   "List onto which user-defined library paths can be pushed.")<br>
><br>
> As requests come in to add an absolute path for an application, they can be referred to this mailing list to request the change here, if it is not an application-specific path. Then it is more likely to be properly vetted for general applicability for all users of that OS, and will be available for all libraries. Does this sound like a reasonable way to handle this problem?<br>


><br>
> Liam<br>
</div></div>> _______________________________________________<br>
> Cffi-devel mailing list<br>
> <a href="mailto:Cffi-devel@common-lisp.net">Cffi-devel@common-lisp.net</a><br>
> <a href="http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel" target="_blank">http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel</a><br>
</blockquote></div><br></div>