Discussion:
[Bug-apl] Cannot find libemacs on older mac
Alexey Veretennikov
2017-11-30 19:39:07 UTC
Permalink
Hi,

I've built GNU APL with the following parameters on my old (OSX 10.6.8)
macbook:

./configure --prefix=/Users/alexey/Applications/gnu-apl
make install

So nothing special(I did a small change though since strndup is not yet
supported on this OS). I'm using gcc 7.2.0.
However when I try to run apl from emacs, I get the following error:

Could not find shared library 'libemacs'
The following directories and file names were tried:
file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.so (No such
file or directory)
file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib ( flat
namespace
in /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib )
file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs (No such file
or directory)
directory /usr/lib/apl
directory /usr/local/lib/apl
file ./libemacs.so (No such file or directory)
file ./libemacs.dylib (No such file or directory)
file ./libemacs (No such file or directory)
directory ./native
directory ./emacs_mode


The file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib exists.

Br,
/Alexey
Juergen Sauermann
2017-12-03 10:58:13 UTC
Permalink
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Helvetica, Arial, sans-serif">Hi Alexey,<br>
<br>
I am not really familiar with emacs or OS X, so Elias is probably
better informed than me.<br>
<br>
Unfotunately shared libraries are rather platform dependent and so
are the error messages that<br>
they produce. From the output below it seems that the file </font><font
face="Helvetica, Arial, sans-serif"><b>libemacs.dylib</b><b> </b>exists
and was found,<br>
but could not be opened with <b>dlopen()</b>. It might be that
your platform needs additional linker flags<br>
for dynamic libraries to work, but I have no idea which ones.<br>
</font><br>
<font face="Helvetica, Arial, sans-serif"><font face="Helvetica,
Arial, sans-serif">See also:<br>
<br>
</font><a moz-do-not-send="true"
href="https://github.com/tmux/tmux/issues/547">https://github.com/tmux/tmux/issues/547</a>
or<br>
<br>
<a moz-do-not-send="true"
href="https://developer.apple.com/library/content/documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html">https://developer.apple.com/library/content/documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html</a><br>
<br>
Best Regards,<br>
/// Jürgen<br>
<br>
<br>
</font>
<div class="moz-cite-prefix">On 11/30/2017 08:39 PM, Alexey
Veretennikov wrote:<br>
</div>
<blockquote type="cite"
cite="mid:***@mail.gmail.com">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>Hi,<br>
<br>
</div>
I've built GNU APL with the following parameters on my
old  (OSX 10.6.8) macbook:<br>
</div>
<br>
./configure --prefix=/Users/alexey/Applications/gnu-apl<br>
make install<br>
</div>
<br>
So nothing special(I did a small change though since
strndup is not yet supported on this OS). I'm using gcc
7.2.0.<br>
</div>
However when I try to run apl from emacs, I get the
following error:<br>
<br>
Could not find shared library 'libemacs'<br>
The following directories and file names were tried:<br>
    file
/Users/alexey/Applications/gnu-apl/lib/apl/libemacs.so (No
such file or directory)<br>
    file
/Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib (
flat namespace<br>
 in
/Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib )<br>
    file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs
(No such file or directory)<br>
    directory /usr/lib/apl<br>
    directory /usr/local/lib/apl<br>
    file ./libemacs.so                       (No such file
or directory)<br>
    file ./libemacs.dylib                    (No such file
or directory)<br>
    file ./libemacs                          (No such file
or directory)<br>
    directory ./native<br>
    directory ./emacs_mode<br>
<br>
<br>
</div>
The file
/Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib
exists.<br>
<br>
</div>
<div>Br,<br>
</div>
<div>/Alexey<br>
</div>
</div>
</blockquote>
<br>
</body>
</html>
Elias Mårtenson
2017-12-03 11:02:03 UTC
Permalink
10.6.8 is indeed very old. I thought my Macbook was old and it's running
10.10.

I have to admit that I haven't tried the Emacs mode on OSX in a while since
I don't use Macs anymore. That said, last time I did try, it worked fine.

JÃŒrgen, could there be an issue with the way the libraries are built? Did
anything change in the last couple of years?

Regards,
Elias

On 3 December 2017 at 18:58, Juergen Sauermann <
Post by Juergen Sauermann
Hi Alexey,
I am not really familiar with emacs or OS X, so Elias is probably better
informed than me.
Unfotunately shared libraries are rather platform dependent and so are the
error messages that
they produce. From the output below it seems that the file
*libemacs.dylib* exists and was found,
but could not be opened with *dlopen()*. It might be that your platform
needs additional linker flags
for dynamic libraries to work, but I have no idea which ones.
https://github.com/tmux/tmux/issues/547 or
https://developer.apple.com/library/content/documentation/
Porting/Conceptual/PortingUnix/compiling/compiling.html
Best Regards,
/// JÃŒrgen
Hi,
I've built GNU APL with the following parameters on my old (OSX 10.6.8)
./configure --prefix=/Users/alexey/Applications/gnu-apl
make install
So nothing special(I did a small change though since strndup is not yet
supported on this OS). I'm using gcc 7.2.0.
Could not find shared library 'libemacs'
file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.so (No such
file or directory)
file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib ( flat
namespace
in /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib )
file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs (No such
file or directory)
directory /usr/lib/apl
directory /usr/local/lib/apl
file ./libemacs.so (No such file or directory)
file ./libemacs.dylib (No such file or directory)
file ./libemacs (No such file or directory)
directory ./native
directory ./emacs_mode
The file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib exists.
Br,
/Alexey
Juergen Sauermann
2017-12-03 17:56:35 UTC
Permalink
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Helvetica, Arial, sans-serif">Hi,<br>
<br>
I haven't changed anything in that area. One poster in one of the
links below mentioned that an OS-X upgrade<br>
had fixed a similar problem that the poster had, so my impression
is that this is a problem than cannot be fixed<br>
inside GNU APL.<br>
</font><br>
Best Regards,<br>
/// Jürgen<br>
<br>
<br>
<div class="moz-cite-prefix">On 12/03/2017 12:02 PM, Elias Mårtenson
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CADtN0WLw10qqpT3EqB3T_m9C2wrb=Tg575-TLM=GyjnZ0s+***@mail.gmail.com">
<div dir="ltr">10.6.8 is indeed very old. I thought my Macbook was
old and it's running 10.10.
<div><br>
</div>
<div>I have to admit that I haven't tried the Emacs mode on OSX
in a while since I don't use Macs anymore. That said, last
time I did try, it worked fine.</div>
<div><br>
</div>
<div>Jürgen, could there be an issue with the way the libraries
are built? Did anything change in the last couple of years?</div>
<div><br>
</div>
<div>Regards,</div>
<div>Elias</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 3 December 2017 at 18:58, Juergen
Sauermann <span dir="ltr">&lt;<a
href="mailto:***@t-online.de"
target="_blank" moz-do-not-send="true">***@t-online.de</a>&gt;</span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> <font
face="Helvetica, Arial, sans-serif">Hi Alexey,<br>
<br>
I am not really familiar with emacs or OS X, so Elias is
probably better informed than me.<br>
<br>
Unfotunately shared libraries are rather platform
dependent and so are the error messages that<br>
they produce. From the output below it seems that the
file </font><font face="Helvetica, Arial, sans-serif"><b>libemacs.dylib</b><b>
</b>exists and was found,<br>
but could not be opened with <b>dlopen()</b>. It might
be that your platform needs additional linker flags<br>
for dynamic libraries to work, but I have no idea which
ones.<br>
</font><br>
<font face="Helvetica, Arial, sans-serif"><font
face="Helvetica, Arial, sans-serif">See also:<br>
<br>
</font><a href="https://github.com/tmux/tmux/issues/547"
target="_blank" moz-do-not-send="true">https://github.com/tmux/tmux/<wbr>issues/547</a>
or<br>
<br>
<a
href="https://developer.apple.com/library/content/documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html"
target="_blank" moz-do-not-send="true">https://developer.apple.com/<wbr>library/content/documentation/<wbr>Porting/Conceptual/<wbr>PortingUnix/compiling/<wbr>compiling.html</a><br>
<br>
Best Regards,<br>
/// Jürgen<br>
<br>
<br>
</font>
<div>
<div class="h5">
<div class="m_2032272456363789370moz-cite-prefix">On
11/30/2017 08:39 PM, Alexey Veretennikov wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>Hi,<br>
<br>
</div>
I've built GNU APL with the following
parameters on my old  (OSX 10.6.8)
macbook:<br>
</div>
<br>
./configure --prefix=/Users/alexey/<wbr>Applications/gnu-apl<br>
make install<br>
</div>
<br>
So nothing special(I did a small change
though since strndup is not yet supported on
this OS). I'm using gcc 7.2.0.<br>
</div>
However when I try to run apl from emacs, I
get the following error:<br>
<br>
Could not find shared library 'libemacs'<br>
The following directories and file names were
tried:<br>
    file /Users/alexey/Applications/<wbr>gnu-apl/lib/apl/libemacs.so
(No such file or directory)<br>
    file /Users/alexey/Applications/<wbr>gnu-apl/lib/apl/libemacs.dylib
( flat namespace<br>
 in /Users/alexey/Applications/<wbr>gnu-apl/lib/apl/libemacs.dylib
)<br>
    file /Users/alexey/Applications/<wbr>gnu-apl/lib/apl/libemacs
(No such file or directory)<br>
    directory /usr/lib/apl<br>
    directory /usr/local/lib/apl<br>
    file ./libemacs.so                 <wbr>     
(No such file or directory)<br>
    file ./libemacs.dylib              <wbr>     
(No such file or directory)<br>
    file ./libemacs                    <wbr>     
(No such file or directory)<br>
    directory ./native<br>
    directory ./emacs_mode<br>
<br>
<br>
</div>
The file /Users/alexey/Applications/<wbr>gnu-apl/lib/apl/libemacs.dylib
exists.<br>
<br>
</div>
<div>Br,<br>
</div>
<div>/Alexey<br>
</div>
</div>
</blockquote>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>
Elias Mårtenson
2017-12-04 03:06:03 UTC
Permalink
Perhaps adding the path to the dylib file in DYLIB_LIBRARY_PATH will help?
Don't forget to exprt the variable before starting apl.

Regards,
Elias

On 4 December 2017 at 01:56, Juergen Sauermann <
Hi,
I haven't changed anything in that area. One poster in one of the links
below mentioned that an OS-X upgrade
had fixed a similar problem that the poster had, so my impression is that
this is a problem than cannot be fixed
inside GNU APL.
Best Regards,
/// JÃŒrgen
10.6.8 is indeed very old. I thought my Macbook was old and it's running
10.10.
I have to admit that I haven't tried the Emacs mode on OSX in a while
since I don't use Macs anymore. That said, last time I did try, it worked
fine.
JÃŒrgen, could there be an issue with the way the libraries are built? Did
anything change in the last couple of years?
Regards,
Elias
On 3 December 2017 at 18:58, Juergen Sauermann <
Post by Juergen Sauermann
Hi Alexey,
I am not really familiar with emacs or OS X, so Elias is probably better
informed than me.
Unfotunately shared libraries are rather platform dependent and so are
the error messages that
they produce. From the output below it seems that the file
*libemacs.dylib* exists and was found,
but could not be opened with *dlopen()*. It might be that your platform
needs additional linker flags
for dynamic libraries to work, but I have no idea which ones.
https://github.com/tmux/tmux/issues/547 or
https://developer.apple.com/library/content/documentation/Po
rting/Conceptual/PortingUnix/compiling/compiling.html
Best Regards,
/// JÃŒrgen
Hi,
I've built GNU APL with the following parameters on my old (OSX 10.6.8)
./configure --prefix=/Users/alexey/Applications/gnu-apl
make install
So nothing special(I did a small change though since strndup is not yet
supported on this OS). I'm using gcc 7.2.0.
Could not find shared library 'libemacs'
file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.so (No such
file or directory)
file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib (
flat namespace
in /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib )
file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs (No such
file or directory)
directory /usr/lib/apl
directory /usr/local/lib/apl
file ./libemacs.so (No such file or directory)
file ./libemacs.dylib (No such file or directory)
file ./libemacs (No such file or directory)
directory ./native
directory ./emacs_mode
The file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib exists.
Br,
/Alexey
Juergen Sauermann
2017-12-04 16:33:19 UTC
Permalink
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Helvetica, Arial, sans-serif">Hi,<br>
<br>
from the GNU APL printout it looks like the file was found, but
something is wrong with the file:<br>
</font><br>
<font face="Helvetica, Arial, sans-serif"> <font face="Courier New,
Courier, monospace"><b>   file /Users/alexey/Applications/gnu</b></font><wbr><font
face="Courier New, Courier, monospace"><b>-apl/lib/apl/libemacs.dylib
( flat namespace</b><b><br>
</b><b>  in /Users/alexey/Applications/gnu</b><b>-apl/lib/apl/libemacs.dylib
)</b></font><br>
<br>
So GNU APL was able to open the file (using <b>dlopen()</b>) but
then gets the "flat namespace" error at some point.<br>
<br>
The second link below says:<br>
</font><br>
<div class="timeline-comment-header clearfix">
<h3 class="timeline-comment-header-text f5 text-normal"> <strong>
<a href="https://github.com/amandogra" class="author
text-inherit">amandogra</a> </strong> commented <a
href="https://github.com/tmux/tmux/issues/547#issuecomment-250954758"
class="timestamp">on Oct 2, 2016</a> </h3>
</div>
<div class="edit-comment-hide">
<table class="d-block">
<tbody class="d-block">
<tr class="d-block">
<td class="d-block comment-body markdown-body
js-comment-body">
<p>It got solved by OS upgrade.<br>
For someone who comes to this...<br>
I was on Mac OSX El Capitan, but I upgraded to macOS
Sierra.<br>
Then, I executed the following command</p>
<pre><code>brew unlink libevent &amp;&amp; brew link libevent
</code></pre>
<p>This fixed my issue.</p>
</td>
</tr>
</tbody>
</table>
</div>
<font face="Helvetica, Arial, sans-serif"><br>
The posting was related to a different library but the (rest of
the) error message looks very similar (considering<br>
that GNU APL cuts off the start the error message text until the
last : in it). The full error message was most likely:</font><br>
<pre><code>Expected in: flat namespace</code></pre>
<font face="Helvetica, Arial, sans-serif">Maybe <b>"nm</b><b> -D" </b>on
the dylib file reveals some more information.<br>
<br>
Best Regards,<br>
/// Jürgen<br>
<br>
<br>
<wbr></font>
<div class="moz-cite-prefix">On 12/04/2017 04:06 AM, Elias Mårtenson
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CADtN0WJj3v3TO-xZzpMngCDbBGroM2wWKKJ+z0T1TWwauzPt-***@mail.gmail.com">
<div dir="ltr">Perhaps adding the path to the dylib file in
DYLIB_LIBRARY_PATH will help? Don't forget to exprt the variable
before starting apl.
<div><br>
</div>
<div>Regards,</div>
<div>Elias</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 4 December 2017 at 01:56, Juergen
Sauermann <span dir="ltr">&lt;<a
href="mailto:***@t-online.de"
target="_blank" moz-do-not-send="true">***@t-online.de</a>&gt;</span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> <font
face="Helvetica, Arial, sans-serif">Hi,<br>
<br>
I haven't changed anything in that area. One poster in
one of the links below mentioned that an OS-X upgrade<br>
had fixed a similar problem that the poster had, so my
impression is that this is a problem than cannot be
fixed<br>
inside GNU APL.<br>
</font><br>
Best Regards,<br>
/// Jürgen
<div>
<div class="h5"><br>
<br>
<br>
<div class="m_-2180885449486840444moz-cite-prefix">On
12/03/2017 12:02 PM, Elias Mårtenson wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">10.6.8 is indeed very old. I thought
my Macbook was old and it's running 10.10.
<div><br>
</div>
<div>I have to admit that I haven't tried the
Emacs mode on OSX in a while since I don't use
Macs anymore. That said, last time I did try, it
worked fine.</div>
<div><br>
</div>
<div>Jürgen, could there be an issue with the way
the libraries are built? Did anything change in
the last couple of years?</div>
<div><br>
</div>
<div>Regards,</div>
<div>Elias</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 3 December 2017 at
18:58, Juergen Sauermann <span dir="ltr">&lt;<a
href="mailto:***@t-online.de"
target="_blank" moz-do-not-send="true">***@t-online.de</a><wbr>&gt;</span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0
0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> <font
face="Helvetica, Arial, sans-serif">Hi
Alexey,<br>
<br>
I am not really familiar with emacs or OS
X, so Elias is probably better informed
than me.<br>
<br>
Unfotunately shared libraries are rather
platform dependent and so are the error
messages that<br>
they produce. From the output below it
seems that the file </font><font
face="Helvetica, Arial, sans-serif"><b>libemacs.dylib</b><b>
</b>exists and was found,<br>
but could not be opened with <b>dlopen()</b>.
It might be that your platform needs
additional linker flags<br>
for dynamic libraries to work, but I have
no idea which ones.<br>
</font><br>
<font face="Helvetica, Arial, sans-serif"><font
face="Helvetica, Arial, sans-serif">See
also:<br>
<br>
</font><a
href="https://github.com/tmux/tmux/issues/547"
target="_blank" moz-do-not-send="true">https://github.com/tmux/tmux/i<wbr>ssues/547</a>
or<br>
<br>
<a
href="https://developer.apple.com/library/content/documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html"
target="_blank" moz-do-not-send="true">https://developer.apple.com/li<wbr>brary/content/documentation/Po<wbr>rting/Conceptual/PortingUnix/<wbr>compiling/compiling.html</a><br>
<br>
Best Regards,<br>
/// Jürgen<br>
<br>
<br>
</font>
<div>
<div class="m_-2180885449486840444h5">
<div
class="m_-2180885449486840444m_2032272456363789370moz-cite-prefix">On
11/30/2017 08:39 PM, Alexey
Veretennikov wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>Hi,<br>
<br>
</div>
I've built GNU APL with
the following parameters
on my old  (OSX 10.6.8)
macbook:<br>
</div>
<br>
./configure
--prefix=/Users/alexey/Applica<wbr>tions/gnu-apl<br>
make install<br>
</div>
<br>
So nothing special(I did a
small change though since
strndup is not yet supported
on this OS). I'm using gcc
7.2.0.<br>
</div>
However when I try to run apl
from emacs, I get the following
error:<br>
<br>
Could not find shared library
'libemacs'<br>
The following directories and
file names were tried:<br>
    file
/Users/alexey/Applications/gnu<wbr>-apl/lib/apl/libemacs.so
(No such file or directory)<br>
    file
/Users/alexey/Applications/gnu<wbr>-apl/lib/apl/libemacs.dylib
( flat namespace<br>
 in
/Users/alexey/Applications/gnu<wbr>-apl/lib/apl/libemacs.dylib
)<br>
    file
/Users/alexey/Applications/gnu<wbr>-apl/lib/apl/libemacs
(No such file or directory)<br>
    directory /usr/lib/apl<br>
    directory /usr/local/lib/apl<br>
    file
./libemacs.so                 <wbr>     
(No such file or directory)<br>
    file
./libemacs.dylib              <wbr>     
(No such file or directory)<br>
    file
./libemacs                    <wbr>     
(No such file or directory)<br>
    directory ./native<br>
    directory ./emacs_mode<br>
<br>
<br>
</div>
The file
/Users/alexey/Applications/gnu<wbr>-apl/lib/apl/libemacs.dylib
exists.<br>
<br>
</div>
<div>Br,<br>
</div>
<div>/Alexey<br>
</div>
</div>
</blockquote>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>
Alexey Veretennikov
2017-12-06 19:18:56 UTC
Permalink
It is really strange but reporting with otool shows two level:

otool -hV /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib
/Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib:
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
MH_MAGIC_64 X86_64 ALL 0x00 DYLIB 14 2272
NOUNDEFS DYLDLINK TWOLEVEL WEAK_DEFINES BINDS_TO_WEAK NO_REEXPORTED_DYLIBS

For flat libraries there should be no TWOLEVEL flag.

Br,
/Alexey
Hi,
from the GNU APL printout it looks like the file was found, but something
* file /Users/alexey/Applications/gnu**-apl/lib/apl/libemacs.dylib (
flat namespace*
* in /Users/alexey/Applications/gnu**-apl/lib/apl/libemacs.dylib )*
So GNU APL was able to open the file (using *dlopen()*) but then gets the
"flat namespace" error at some point.
* amandogra <https://github.com/amandogra> * commented on Oct 2, 2016
<https://github.com/tmux/tmux/issues/547#issuecomment-250954758>
It got solved by OS upgrade.
For someone who comes to this...
I was on Mac OSX El Capitan, but I upgraded to macOS Sierra.
Then, I executed the following command
brew unlink libevent && brew link libevent
This fixed my issue.
The posting was related to a different library but the (rest of the) error
message looks very similar (considering
that GNU APL cuts off the start the error message text until the last : in
Expected in: flat namespace
Maybe *"nm** -D" *on the dylib file reveals some more information.
Best Regards,
/// JÃŒrgen
Perhaps adding the path to the dylib file in DYLIB_LIBRARY_PATH will help?
Don't forget to exprt the variable before starting apl.
Regards,
Elias
On 4 December 2017 at 01:56, Juergen Sauermann <
Hi,
I haven't changed anything in that area. One poster in one of the links
below mentioned that an OS-X upgrade
had fixed a similar problem that the poster had, so my impression is that
this is a problem than cannot be fixed
inside GNU APL.
Best Regards,
/// JÃŒrgen
10.6.8 is indeed very old. I thought my Macbook was old and it's running
10.10.
I have to admit that I haven't tried the Emacs mode on OSX in a while
since I don't use Macs anymore. That said, last time I did try, it worked
fine.
JÃŒrgen, could there be an issue with the way the libraries are built? Did
anything change in the last couple of years?
Regards,
Elias
On 3 December 2017 at 18:58, Juergen Sauermann <
Post by Juergen Sauermann
Hi Alexey,
I am not really familiar with emacs or OS X, so Elias is probably better
informed than me.
Unfotunately shared libraries are rather platform dependent and so are
the error messages that
they produce. From the output below it seems that the file
*libemacs.dylib* exists and was found,
but could not be opened with *dlopen()*. It might be that your platform
needs additional linker flags
for dynamic libraries to work, but I have no idea which ones.
https://github.com/tmux/tmux/issues/547 or
https://developer.apple.com/library/content/documentation/Po
rting/Conceptual/PortingUnix/compiling/compiling.html
Best Regards,
/// JÃŒrgen
Hi,
I've built GNU APL with the following parameters on my old (OSX 10.6.8)
./configure --prefix=/Users/alexey/Applications/gnu-apl
make install
So nothing special(I did a small change though since strndup is not yet
supported on this OS). I'm using gcc 7.2.0.
Could not find shared library 'libemacs'
file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.so (No
such file or directory)
file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib (
flat namespace
in /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib )
file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs (No such
file or directory)
directory /usr/lib/apl
directory /usr/local/lib/apl
file ./libemacs.so (No such file or directory)
file ./libemacs.dylib (No such file or directory)
file ./libemacs (No such file or directory)
directory ./native
directory ./emacs_mode
The file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib exists.
Br,
/Alexey
Juergen Sauermann
2017-12-11 15:19:56 UTC
Permalink
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Helvetica, Arial, sans-serif">Hi Alexey,<br>
<br>
I suppose that you need some platform specific linker flags when
building </font><font face="Helvetica, Arial, sans-serif"><b>libemacs.dylib</b>.<br>
Since I do not have access to a Mac OS-X machine, I can't tell you
which ones.<br>
<br>
Best Regards,<br>
/// Jürgen<br>
<br>
<br>
</font>
<div class="moz-cite-prefix">On 12/06/2017 08:18 PM, Alexey
Veretennikov wrote:<br>
</div>
<blockquote type="cite"
cite="mid:***@mail.gmail.com">
<div dir="ltr">
<div>
<div>
<div>It is really strange but reporting with otool shows two
level:<br>
<br>
otool -hV
/Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib<br>
/Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib:<br>
Mach header<br>
      magic cputype cpusubtype  caps    filetype ncmds
sizeofcmds      flags<br>
MH_MAGIC_64  X86_64        ALL  0x00       DYLIB   
14       2272   NOUNDEFS DYLDLINK TWOLEVEL WEAK_DEFINES
BINDS_TO_WEAK NO_REEXPORTED_DYLIBS<br>
<br>
</div>
For flat libraries there should be no TWOLEVEL flag.<br>
<br>
</div>
Br,<br>
</div>
/Alexey<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2017-12-04 17:33 GMT+01:00 Juergen
Sauermann <span dir="ltr">&lt;<a
href="mailto:***@t-online.de"
target="_blank" moz-do-not-send="true">***@t-online.de</a>&gt;</span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> <font
face="Helvetica, Arial, sans-serif">Hi,<br>
<br>
from the GNU APL printout it looks like the file was
found, but something is wrong with the file:<br>
</font><br>
<font face="Helvetica, Arial, sans-serif"><span class=""> <font
face="Courier New, Courier, monospace"><b>   file
/Users/alexey/Applications/gnu</b></font><font
face="Courier New, Courier, monospace"><b><wbr>-apl/lib/apl/libemacs.dylib
( flat namespace</b><b><br>
</b><b>  in /Users/alexey/Applications/gnu</b><b><wbr>-apl/lib/apl/libemacs.dylib
)</b></font><br>
<br>
</span> So GNU APL was able to open the file (using <b>dlopen()</b>)
but then gets the "flat namespace" error at some point.<br>
<br>
The second link below says:<br>
</font><br>
<div class="m_9090577801925878262timeline-comment-header
m_9090577801925878262clearfix">
<h3
class="m_9090577801925878262timeline-comment-header-text
m_9090577801925878262f5
m_9090577801925878262text-normal"> <strong> <a
href="https://github.com/amandogra"
class="m_9090577801925878262author
m_9090577801925878262text-inherit" target="_blank"
moz-do-not-send="true">amandogra</a> </strong>
commented <a
href="https://github.com/tmux/tmux/issues/547#issuecomment-250954758"
class="m_9090577801925878262timestamp"
target="_blank" moz-do-not-send="true">on Oct 2,
2016</a> </h3>
</div>
<div class="m_9090577801925878262edit-comment-hide">
<table class="m_9090577801925878262d-block">
<tbody class="m_9090577801925878262d-block">
<tr class="m_9090577801925878262d-block">
<td class="m_9090577801925878262d-block
m_9090577801925878262comment-body
m_9090577801925878262markdown-body
m_9090577801925878262js-comment-body">
<p>It got solved by OS upgrade.<br>
For someone who comes to this...<br>
I was on Mac OSX El Capitan, but I upgraded to
macOS Sierra.<br>
Then, I executed the following command</p>
<pre><code>brew unlink libevent &amp;&amp; brew link libevent
</code></pre>
<p>This fixed my issue.</p>
</td>
</tr>
</tbody>
</table>
</div>
<font face="Helvetica, Arial, sans-serif"><br>
The posting was related to a different library but the
(rest of the) error message looks very similar
(considering<br>
that GNU APL cuts off the start the error message text
until the last : in it). The full error message was most
likely:</font><br>
<pre><code>Expected in: flat namespace</code></pre>
<font face="Helvetica, Arial, sans-serif">Maybe <b>"nm</b><b>
-D" </b>on the dylib file reveals some more
information.<br>
<br>
Best Regards,<br>
/// Jürgen<br>
<br>
<br>
</font>
<div>
<div class="h5">
<div class="m_9090577801925878262moz-cite-prefix">On
12/04/2017 04:06 AM, Elias Mårtenson wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Perhaps adding the path to the dylib
file in DYLIB_LIBRARY_PATH will help? Don't forget
to exprt the variable before starting apl.
<div><br>
</div>
<div>Regards,</div>
<div>Elias</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 4 December 2017 at
01:56, Juergen Sauermann <span dir="ltr">&lt;<a
href="mailto:***@t-online.de"
target="_blank" moz-do-not-send="true">***@t-online.de</a><wbr>&gt;</span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0
0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> <font
face="Helvetica, Arial, sans-serif">Hi,<br>
<br>
I haven't changed anything in that area.
One poster in one of the links below
mentioned that an OS-X upgrade<br>
had fixed a similar problem that the
poster had, so my impression is that this
is a problem than cannot be fixed<br>
inside GNU APL.<br>
</font><br>
Best Regards,<br>
/// Jürgen
<div>
<div class="m_9090577801925878262h5"><br>
<br>
<br>
<div
class="m_9090577801925878262m_-2180885449486840444moz-cite-prefix">On
12/03/2017 12:02 PM, Elias Mårtenson
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">10.6.8 is indeed very
old. I thought my Macbook was old
and it's running 10.10.
<div><br>
</div>
<div>I have to admit that I haven't
tried the Emacs mode on OSX in a
while since I don't use Macs
anymore. That said, last time I
did try, it worked fine.</div>
<div><br>
</div>
<div>Jürgen, could there be an issue
with the way the libraries are
built? Did anything change in the
last couple of years?</div>
<div><br>
</div>
<div>Regards,</div>
<div>Elias</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 3
December 2017 at 18:58, Juergen
Sauermann <span dir="ltr">&lt;<a
href="mailto:***@t-online.de" target="_blank"
moz-do-not-send="true">***@t-online.de</a><wbr>&gt;</span>
wrote:<br>
<blockquote class="gmail_quote"
style="margin:0 0 0
.8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div text="#000000"
bgcolor="#FFFFFF"> <font
face="Helvetica, Arial,
sans-serif">Hi Alexey,<br>
<br>
I am not really familiar
with emacs or OS X, so Elias
is probably better informed
than me.<br>
<br>
Unfotunately shared
libraries are rather
platform dependent and so
are the error messages that<br>
they produce. From the
output below it seems that
the file </font><font
face="Helvetica, Arial,
sans-serif"><b>libemacs.dylib</b><b>
</b>exists and was found,<br>
but could not be opened with
<b>dlopen()</b>. It might be
that your platform needs
additional linker flags<br>
for dynamic libraries to
work, but I have no idea
which ones.<br>
</font><br>
<font face="Helvetica, Arial,
sans-serif"><font
face="Helvetica, Arial,
sans-serif">See also:<br>
<br>
</font><a
href="https://github.com/tmux/tmux/issues/547"
target="_blank"
moz-do-not-send="true">https://github.com/tmux/tmux/i<wbr>ssues/547</a>
or<br>
<br>
<a
href="https://developer.apple.com/library/content/documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html"
target="_blank"
moz-do-not-send="true">https://developer.apple.com/li<wbr>brary/content/documentation/Po<wbr>rting/Conceptual/PortingUnix/c<wbr>ompiling/compiling.html</a><br>
<br>
Best Regards,<br>
/// Jürgen<br>
<br>
<br>
</font>
<div>
<div
class="m_9090577801925878262m_-2180885449486840444h5">
<div
class="m_9090577801925878262m_-2180885449486840444m_2032272456363789370moz-cite-prefix">On
11/30/2017 08:39 PM,
Alexey Veretennikov
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>Hi,<br>
<br>
</div>
I've built GNU
APL with the
following
parameters on
my old  (OSX
10.6.8)
macbook:<br>
</div>
<br>
./configure
--prefix=/Users/alexey/Applica<wbr>tions/gnu-apl<br>
make install<br>
</div>
<br>
So nothing
special(I did a
small change
though since
strndup is not
yet supported on
this OS). I'm
using gcc 7.2.0.<br>
</div>
However when I try
to run apl from
emacs, I get the
following error:<br>
<br>
Could not find
shared library
'libemacs'<br>
The following
directories and
file names were
tried:<br>
    file
/Users/alexey/Applications/gnu<wbr>-apl/lib/apl/libemacs.so
(No such file or
directory)<br>
    file
/Users/alexey/Applications/gnu<wbr>-apl/lib/apl/libemacs.dylib
( flat namespace<br>
 in
/Users/alexey/Applications/gnu<wbr>-apl/lib/apl/libemacs.dylib
)<br>
    file
/Users/alexey/Applications/gnu<wbr>-apl/lib/apl/libemacs
(No such file or
directory)<br>
    directory
/usr/lib/apl<br>
    directory
/usr/local/lib/apl<br>
    file
./libemacs.so                 <wbr>     
(No such file or
directory)<br>
    file
./libemacs.dylib              <wbr>     
(No such file or
directory)<br>
    file
./libemacs                    <wbr>     
(No such file or
directory)<br>
    directory
./native<br>
    directory
./emacs_mode<br>
<br>
<br>
</div>
The file
/Users/alexey/Applications/gnu<wbr>-apl/lib/apl/libemacs.dylib
exists.<br>
<br>
</div>
<div>Br,<br>
</div>
<div>/Alexey<br>
</div>
</div>
</blockquote>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>
Alexey Veretennikov
2017-12-12 11:27:37 UTC
Permalink
Hi,

Could you please hint me how to specify these flags so I can experiment
myself?

Br,
/Alexey
Post by Juergen Sauermann
Hi Alexey,
I suppose that you need some platform specific linker flags when building
*libemacs.dylib*.
Since I do not have access to a Mac OS-X machine, I can't tell you which
ones.
Best Regards,
/// JÃŒrgen
otool -hV /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds
flags
MH_MAGIC_64 X86_64 ALL 0x00 DYLIB 14 2272
NOUNDEFS DYLDLINK TWOLEVEL WEAK_DEFINES BINDS_TO_WEAK NO_REEXPORTED_DYLIBS
For flat libraries there should be no TWOLEVEL flag.
Br,
/Alexey
2017-12-04 17:33 GMT+01:00 Juergen Sauermann <
Hi,
from the GNU APL printout it looks like the file was found, but something
* file /Users/alexey/Applications/gnu**-apl/lib/apl/libemacs.dylib (
flat namespace*
* in /Users/alexey/Applications/gnu**-apl/lib/apl/libemacs.dylib )*
So GNU APL was able to open the file (using *dlopen()*) but then gets
the "flat namespace" error at some point.
* amandogra <https://github.com/amandogra> * commented on Oct 2, 2016
<https://github.com/tmux/tmux/issues/547#issuecomment-250954758>
It got solved by OS upgrade.
For someone who comes to this...
I was on Mac OSX El Capitan, but I upgraded to macOS Sierra.
Then, I executed the following command
brew unlink libevent && brew link libevent
This fixed my issue.
The posting was related to a different library but the (rest of the)
error message looks very similar (considering
Expected in: flat namespace
Maybe *"nm** -D" *on the dylib file reveals some more information.
Best Regards,
/// JÃŒrgen
Perhaps adding the path to the dylib file in DYLIB_LIBRARY_PATH will
help? Don't forget to exprt the variable before starting apl.
Regards,
Elias
On 4 December 2017 at 01:56, Juergen Sauermann <
Hi,
I haven't changed anything in that area. One poster in one of the links
below mentioned that an OS-X upgrade
had fixed a similar problem that the poster had, so my impression is
that this is a problem than cannot be fixed
inside GNU APL.
Best Regards,
/// JÃŒrgen
10.6.8 is indeed very old. I thought my Macbook was old and it's running
10.10.
I have to admit that I haven't tried the Emacs mode on OSX in a while
since I don't use Macs anymore. That said, last time I did try, it worked
fine.
JÃŒrgen, could there be an issue with the way the libraries are built?
Did anything change in the last couple of years?
Regards,
Elias
On 3 December 2017 at 18:58, Juergen Sauermann <
Post by Juergen Sauermann
Hi Alexey,
I am not really familiar with emacs or OS X, so Elias is probably
better informed than me.
Unfotunately shared libraries are rather platform dependent and so are
the error messages that
they produce. From the output below it seems that the file
*libemacs.dylib* exists and was found,
but could not be opened with *dlopen()*. It might be that your
platform needs additional linker flags
for dynamic libraries to work, but I have no idea which ones.
https://github.com/tmux/tmux/issues/547 or
https://developer.apple.com/library/content/documentation/Po
rting/Conceptual/PortingUnix/compiling/compiling.html
Best Regards,
/// JÃŒrgen
Hi,
I've built GNU APL with the following parameters on my old (OSX
./configure --prefix=/Users/alexey/Applications/gnu-apl
make install
So nothing special(I did a small change though since strndup is not yet
supported on this OS). I'm using gcc 7.2.0.
Could not find shared library 'libemacs'
file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.so (No
such file or directory)
file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib (
flat namespace
in /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib )
file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs (No such
file or directory)
directory /usr/lib/apl
directory /usr/local/lib/apl
file ./libemacs.so (No such file or directory)
file ./libemacs.dylib (No such file or directory)
file ./libemacs (No such file or directory)
directory ./native
directory ./emacs_mode
The file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib exists.
Br,
/Alexey
Juergen Sauermann
2017-12-12 19:05:58 UTC
Permalink
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Alexey,<br>
<br>
GNU APL uses the C functions <b>dlopen()</b> to open the library
and <b>dlsym() </b>to locate functions inside<br>
the library.<br>
<br>
From the printout we see that GNU APL finds the library file but the
<b>dlopen()</b> of the existing file fails.<br>
<br>
Although the <b>dlopen()</b> and <b>dlsym()</b> functions are
quite standard among different platforms, the way<br>
in which the dynamic library files are linked from the compiled
object files differs considerably between<br>
platforms.<br>
<br>
In this particular case there could be 2 reasons for <b>dlopen()</b>
to fail:<br>
<br>
1. a bug in the platform as one of the posts below suggests.
Somebody who had the same problem (although<br>
with a different library) has reported that after an OS-X update his
problem disappeared.<br>
<br>
2. The library must be constructed in a specific way. On GNU/Linux
this is often properly handled by libtool,<br>
but I do not know if libtool even exists on OS-X and if it works
properly. On GNU/Linux there is another<br>
tool called <b>libtoolize</b> which prepares autoconf projects that
do not use <b>libtoolize</b> into projects that do.<br>
<b>libtoolize</b> does some magic to make shared library work and
you may need to do something similar on<br>
your box.<br>
<br>
My proposal would be:<br>
<br>
1. upgrade your OS-X as proposed in the post below.<br>
<br>
2. If that does not fix the problem then learn from your platform
documentation how shared libraries<br>
for use with  dlopen() shall be built. And what namespaces are (they
do not exist on GNU/Linux).<br>
<br>
Good Luck!<br>
/// Jürgen<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">On 12/12/2017 12:27 PM, Alexey
Veretennikov wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAKE5LL6H7nu+***@mail.gmail.com">
<div dir="ltr">
<div>
<div>
<div>Hi,<br>
<br>
</div>
Could you please hint me how to specify these flags so I can
experiment myself?<br>
<br>
</div>
Br,<br>
</div>
/Alexey<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2017-12-11 16:19 GMT+01:00 Juergen
Sauermann <span dir="ltr">&lt;<a
href="mailto:***@t-online.de"
target="_blank" moz-do-not-send="true">***@t-online.de</a>&gt;</span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> <font
face="Helvetica, Arial, sans-serif">Hi Alexey,<br>
<br>
I suppose that you need some platform specific linker
flags when building </font><font face="Helvetica,
Arial, sans-serif"><b>libemacs.dylib</b>.<br>
Since I do not have access to a Mac OS-X machine, I
can't tell you which ones.<br>
<br>
Best Regards,<br>
/// Jürgen<br>
<br>
<br>
</font>
<div>
<div class="h5">
<div class="m_-4955542798000717810moz-cite-prefix">On
12/06/2017 08:18 PM, Alexey Veretennikov wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>It is really strange but reporting with
otool shows two level:<br>
<br>
otool -hV /Users/alexey/Applications/<wbr>gnu-apl/lib/apl/libemacs.dylib<br>
/Users/alexey/Applications/<wbr>gnu-apl/lib/apl/libemacs.<wbr>dylib:<br>
Mach header<br>
      magic cputype cpusubtype  caps   
filetype ncmds sizeofcmds      flags<br>
MH_MAGIC_64  X86_64        ALL  0x00      
DYLIB    14       2272   NOUNDEFS DYLDLINK
TWOLEVEL WEAK_DEFINES BINDS_TO_WEAK
NO_REEXPORTED_DYLIBS<br>
<br>
</div>
For flat libraries there should be no TWOLEVEL
flag.<br>
<br>
</div>
Br,<br>
</div>
/Alexey<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2017-12-04 17:33
GMT+01:00 Juergen Sauermann <span dir="ltr">&lt;<a
href="mailto:***@t-online.de"
target="_blank" moz-do-not-send="true">***@t-online.de</a><wbr>&gt;</span>:<br>
<blockquote class="gmail_quote" style="margin:0
0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> <font
face="Helvetica, Arial, sans-serif">Hi,<br>
<br>
from the GNU APL printout it looks like
the file was found, but something is wrong
with the file:<br>
</font><br>
<font face="Helvetica, Arial, sans-serif"><span> <font
face="Courier New, Courier, monospace"><b>  
file /Users/alexey/Applications/gnu</b></font><font
face="Courier New, Courier, monospace"><b><wbr>-apl/lib/apl/libemacs.dylib
( flat namespace</b><b><br>
</b><b>  in
/Users/alexey/Applications/gnu</b><b><wbr>-apl/lib/apl/libemacs.dylib
)</b></font><br>
<br>
</span> So GNU APL was able to open the
file (using <b>dlopen()</b>) but then
gets the "flat namespace" error at some
point.<br>
<br>
The second link below says:<br>
</font><br>
<div
class="m_-4955542798000717810m_9090577801925878262timeline-comment-header
m_-4955542798000717810m_9090577801925878262clearfix">
<h3
class="m_-4955542798000717810m_9090577801925878262timeline-comment-header-text
m_-4955542798000717810m_9090577801925878262f5
m_-4955542798000717810m_9090577801925878262text-normal">
<strong> <a
href="https://github.com/amandogra"
class="m_-4955542798000717810m_9090577801925878262author
m_-4955542798000717810m_9090577801925878262text-inherit"
target="_blank"
moz-do-not-send="true">amandogra</a>
</strong> commented <a
href="https://github.com/tmux/tmux/issues/547#issuecomment-250954758"
class="m_-4955542798000717810m_9090577801925878262timestamp"
target="_blank" moz-do-not-send="true">on
Oct 2, 2016</a> </h3>
</div>
<div
class="m_-4955542798000717810m_9090577801925878262edit-comment-hide">
<table
class="m_-4955542798000717810m_9090577801925878262d-block">
<tbody
class="m_-4955542798000717810m_9090577801925878262d-block">
<tr
class="m_-4955542798000717810m_9090577801925878262d-block">
<td
class="m_-4955542798000717810m_9090577801925878262d-block
m_-4955542798000717810m_9090577801925878262comment-body
m_-4955542798000717810m_9090577801925878262markdown-body
m_-4955542798000717810m_9090577801925878262js-comment-body">
<p>It got solved by OS upgrade.<br>
For someone who comes to this...<br>
I was on Mac OSX El Capitan, but
I upgraded to macOS Sierra.<br>
Then, I executed the following
command</p>
<pre><code>brew unlink libevent &amp;&amp; brew link libevent
</code></pre>
<p>This fixed my issue.</p>
</td>
</tr>
</tbody>
</table>
</div>
<font face="Helvetica, Arial, sans-serif"><br>
The posting was related to a different
library but the (rest of the) error
message looks very similar (considering<br>
that GNU APL cuts off the start the error
message text until the last : in it). The
full error message was most likely:</font><br>
<pre><code>Expected in: flat namespace</code></pre>
<font face="Helvetica, Arial, sans-serif">Maybe
<b>"nm</b><b> -D" </b>on the dylib file
reveals some more information.<br>
<br>
Best Regards,<br>
/// Jürgen<br>
<br>
<br>
</font>
<div>
<div class="m_-4955542798000717810h5">
<div
class="m_-4955542798000717810m_9090577801925878262moz-cite-prefix">On
12/04/2017 04:06 AM, Elias Mårtenson
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Perhaps adding the path
to the dylib file in
DYLIB_LIBRARY_PATH will help? Don't
forget to exprt the variable before
starting apl.
<div><br>
</div>
<div>Regards,</div>
<div>Elias</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 4
December 2017 at 01:56, Juergen
Sauermann <span dir="ltr">&lt;<a
href="mailto:***@t-online.de" target="_blank"
moz-do-not-send="true">***@t-online.de</a><wbr>&gt;</span>
wrote:<br>
<blockquote class="gmail_quote"
style="margin:0 0 0
.8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div text="#000000"
bgcolor="#FFFFFF"> <font
face="Helvetica, Arial,
sans-serif">Hi,<br>
<br>
I haven't changed anything
in that area. One poster in
one of the links below
mentioned that an OS-X
upgrade<br>
had fixed a similar problem
that the poster had, so my
impression is that this is a
problem than cannot be fixed<br>
inside GNU APL.<br>
</font><br>
Best Regards,<br>
/// Jürgen
<div>
<div
class="m_-4955542798000717810m_9090577801925878262h5"><br>
<br>
<br>
<div
class="m_-4955542798000717810m_9090577801925878262m_-2180885449486840444moz-cite-prefix">On
12/03/2017 12:02 PM,
Elias Mårtenson wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">10.6.8 is
indeed very old. I
thought my Macbook was
old and it's running
10.10.
<div><br>
</div>
<div>I have to admit
that I haven't tried
the Emacs mode on
OSX in a while since
I don't use Macs
anymore. That said,
last time I did try,
it worked fine.</div>
<div><br>
</div>
<div>Jürgen, could
there be an issue
with the way the
libraries are built?
Did anything change
in the last couple
of years?</div>
<div><br>
</div>
<div>Regards,</div>
<div>Elias</div>
</div>
<div class="gmail_extra"><br>
<div
class="gmail_quote">On
3 December 2017 at
18:58, Juergen
Sauermann <span
dir="ltr">&lt;<a
href="mailto:***@t-online.de"
target="_blank"
moz-do-not-send="true">***@t-online.de</a><wbr>&gt;</span>
wrote:<br>
<blockquote
class="gmail_quote"
style="margin:0 0
0
.8ex;border-left:1px
#ccc
solid;padding-left:1ex">
<div
text="#000000"
bgcolor="#FFFFFF">
<font
face="Helvetica,
Arial,
sans-serif">Hi
Alexey,<br>
<br>
I am not
really
familiar with
emacs or OS X,
so Elias is
probably
better
informed than
me.<br>
<br>
Unfotunately
shared
libraries are
rather
platform
dependent and
so are the
error messages
that<br>
they produce.
From the
output below
it seems that
the file </font><font
face="Helvetica, Arial, sans-serif"><b>libemacs.dylib</b><b> </b>exists
and was found,<br>
but could not
be opened with
<b>dlopen()</b>.
It might be
that your
platform needs
additional
linker flags<br>
for dynamic
libraries to
work, but I
have no idea
which ones.<br>
</font><br>
<font
face="Helvetica,
Arial,
sans-serif"><font
face="Helvetica, Arial, sans-serif">See also:<br>
<br>
</font><a
href="https://github.com/tmux/tmux/issues/547"
target="_blank" moz-do-not-send="true">https://github.com/tmux/tmux/i<wbr>ssues/547</a>
or<br>
<br>
<a
href="https://developer.apple.com/library/content/documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html"
target="_blank" moz-do-not-send="true">https://developer.apple.com/li<wbr>brary/content/documentation/Po<wbr>rting/Conceptual/PortingUnix/c<wbr>ompiling/compiling.html</a><br>
<br>
Best Regards,<br>
/// Jürgen<br>
<br>
<br>
</font>
<div>
<div
class="m_-4955542798000717810m_9090577801925878262m_-2180885449486840444h5">
<div
class="m_-4955542798000717810m_9090577801925878262m_-2180885449486840444m_2032272456363789370moz-cite-prefix">On
11/30/2017
08:39 PM,
Alexey
Veretennikov
wrote:<br>
</div>
<blockquote
type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>Hi,<br>
<br>
</div>
I've built GNU
APL with the
following
parameters on
my old  (OSX
10.6.8)
macbook:<br>
</div>
<br>
./configure
--prefix=/Users/alexey/Applica<wbr>tions/gnu-apl<br>
make install<br>
</div>
<br>
So nothing
special(I did
a small change
though since
strndup is not
yet supported
on this OS).
I'm using gcc
7.2.0.<br>
</div>
However when I
try to run apl
from emacs, I
get the
following
error:<br>
<br>
Could not find
shared library
'libemacs'<br>
The following
directories
and file names
were tried:<br>
    file
/Users/alexey/Applications/gnu<wbr>-apl/lib/apl/libemacs.so
(No such file
or directory)<br>
    file
/Users/alexey/Applications/gnu<wbr>-apl/lib/apl/libemacs.dylib
( flat
namespace<br>
 in
/Users/alexey/Applications/gnu<wbr>-apl/lib/apl/libemacs.dylib
)<br>
    file
/Users/alexey/Applications/gnu<wbr>-apl/lib/apl/libemacs
(No such file
or directory)<br>
    directory
/usr/lib/apl<br>
    directory
/usr/local/lib/apl<br>
    file
./libemacs.so                 <wbr>     
(No such file
or directory)<br>
    file
./libemacs.dylib              <wbr>     
(No such file
or directory)<br>
    file
./libemacs                    <wbr>     
(No such file
or directory)<br>
    directory
./native<br>
    directory
./emacs_mode<br>
<br>
<br>
</div>
The file
/Users/alexey/Applications/gnu<wbr>-apl/lib/apl/libemacs.dylib
exists.<br>
<br>
</div>
<div>Br,<br>
</div>
<div>/Alexey<br>
</div>
</div>
</blockquote>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>
Alexey Veretennikov
2018-01-03 16:33:35 UTC
Permalink
Hi,

Just to inform what I successfully resolved the issue by running
aclocal, automake and autoconf and reconfiguring && building again.

Br,
/Alexey
Post by Juergen Sauermann
Hi Alexey,
GNU APL uses the C functions dlopen() to open the library and dlsym() to locate functions
inside
the library.
From the printout we see that GNU APL finds the library file but the dlopen() of the existing file
fails.
Although the dlopen() and dlsym() functions are quite standard among different platforms, the
way
in which the dynamic library files are linked from the compiled object files differs considerably
between
platforms.
1. a bug in the platform as one of the posts below suggests. Somebody who had the same
problem (although
with a different library) has reported that after an OS-X update his problem disappeared.
2. The library must be constructed in a specific way. On GNU/Linux this is often properly handled
by libtool,
but I do not know if libtool even exists on OS-X and if it works properly. On GNU/Linux there is
another
tool called libtoolize which prepares autoconf projects that do not use libtoolize into projects
that do.
libtoolize does some magic to make shared library work and you may need to do something
similar on
your box.
1. upgrade your OS-X as proposed in the post below.
2. If that does not fix the problem then learn from your platform documentation how shared
libraries
for use with dlopen() shall be built. And what namespaces are (they do not exist on GNU/Linux).
Good Luck!
/// Jürgen
Hi,
Could you please hint me how to specify these flags so I can experiment myself?
Br,
/Alexey
Hi Alexey,
I suppose that you need some platform specific linker flags when building
libemacs.dylib.
Since I do not have access to a Mac OS-X machine, I can't tell you which ones.
Best Regards,
/// Jürgen
otool -hV /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
MH_MAGIC_64 X86_64 ALL 0x00 DYLIB 14 2272 NOUNDEFS DYLDLINK
TWOLEVEL WEAK_DEFINES BINDS_TO_WEAK NO_REEXPORTED_DYLIBS
For flat libraries there should be no TWOLEVEL flag.
Br,
/Alexey
2017-12-04 17:33 GMT+01:00 Juergen Sauermann
Hi,
from the GNU APL printout it looks like the file was found, but something is
file /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib ( flat
namespace
in /Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib )
So GNU APL was able to open the file (using dlopen()) but then gets the
"flat namespace" error at some point.
amandogra commented on Oct 2, 2016
It got solved by OS upgrade.
For someone who comes to this...
I was on Mac OSX El Capitan, but I upgraded to macOS Sierra.
Then, I executed the following command
brew unlink libevent && brew link libevent
This fixed my issue.
The posting was related to a different library but the (rest of the) error
message looks very similar (considering
that GNU APL cuts off the start the error message text until the last : in it).
Expected in: flat namespace
Maybe "nm -D" on the dylib file reveals some more information.
Best Regards,
/// Jürgen
Perhaps adding the path to the dylib file in DYLIB_LIBRARY_PATH will
help? Don't forget to exprt the variable before starting apl.
Regards,
Elias
On 4 December 2017 at 01:56, Juergen Sauermann
Hi,
I haven't changed anything in that area. One poster in one of the
links below mentioned that an OS-X upgrade
had fixed a similar problem that the poster had, so my impression
is that this is a problem than cannot be fixed
inside GNU APL.
Best Regards,
/// Jürgen
10.6.8 is indeed very old. I thought my Macbook was old and
it's running 10.10.
I have to admit that I haven't tried the Emacs mode on OSX in
a while since I don't use Macs anymore. That said, last time I
did try, it worked fine.
Jürgen, could there be an issue with the way the libraries are
built? Did anything change in the last couple of years?
Regards,
Elias
On 3 December 2017 at 18:58, Juergen Sauermann
Hi Alexey,
I am not really familiar with emacs or OS X, so Elias is
probably better informed than me.
Unfotunately shared libraries are rather platform
dependent and so are the error messages that
they produce. From the output below it seems that the
file libemacs.dylib exists and was found,
but could not be opened with dlopen(). It might be that
your platform needs additional linker flags
for dynamic libraries to work, but I have no idea which
ones.
https://github.com/tmux/tmux/issues/547 or
https://developer.apple.com/library/content/documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html
Best Regards,
/// Jürgen
Hi,
I've built GNU APL with the following parameters on
./configure
--prefix=/Users/alexey/Applications/gnu-apl
make install
So nothing special(I did a small change though
since strndup is not yet supported on this OS). I'm
using gcc 7.2.0.
However when I try to run apl from emacs, I get the
Could not find shared library 'libemacs'
file
/Users/alexey/Applications/gnu-apl/lib/apl/libemacs.so
(No such file or directory)
file
/Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib
( flat namespace
in
/Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib
)
file
/Users/alexey/Applications/gnu-apl/lib/apl/libemacs
(No such file or directory)
directory /usr/lib/apl
directory /usr/local/lib/apl
file ./libemacs.so (No such file or directory)
file ./libemacs.dylib (No such file or directory)
file ./libemacs (No such file or directory)
directory ./native
directory ./emacs_mode
The file
/Users/alexey/Applications/gnu-apl/lib/apl/libemacs.dylib
exists.
Br,
/Alexey
--
Br,
/Alexey
Loading...