unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Readline support in Cygwin
@ 2013-01-09  3:10 Akop Pogosian
  2013-01-09 21:57 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Akop Pogosian @ 2013-01-09  3:10 UTC (permalink / raw)
  To: guile-user

Should this be reported as a Guile bug?

I have built Guile 2.0.7 in a recent version of Cygwin environment
under Windows 7. Readline support doesn't work. E.g.:

# $ guile --version
# guile (GNU Guile) 2.0.7
# ...

# $ guile -c "(use-modules (ice-9 readline))"

This gives a long trace output ending in:

# 2797: 3 [#<procedure 801d4690 at ice-9/boot-9.scm:2787:17 ()>]
# In unknown file:
#  ?: 2 [primitive-load-path "ice-9/readline" #f]
# In ice-9/readline.scm:
#  43: 1 [#<procedure 801d0000 ()>]
#In unknown file:
#   ?: 0 [load-extension "libguilereadline-v-18" "scm_init_readline"]
#
# ERROR: In procedure load-extension:
# ERROR: In procedure dynamic-link: file: "libguilereadline-v-18",
message: "The specified module could not be found."

There appear to be readline header files and library on my PC:

# $ ls /usr/lib/libreadline.* /usr/include/readline/*
# /usr/include/readline/chardefs.h  /usr/include/readline/rlstdc.h
# /usr/include/readline/history.h   /usr/include/readline/rltypedefs.h
# /usr/include/readline/keymaps.h   /usr/include/readline/tilde.h
# /usr/include/readline/readline.h  /usr/lib/libreadline.a
# /usr/include/readline/rlconf.h    /usr/lib/libreadline.dll.a


As well as the readline module in the Guile package directory:

# $ ls software/packages/guile-2.0.7/lib/
# guile           libguile-2.0.la          libguilereadline-v-18.la
# libguile-2.0.a  libguilereadline-v-18.a  pkgconfig

# $ ls software/packages/guile-2.0.7/share/guile/2.0/ice-9/readline.scm
# software/packages/guile-2.0.7/share/guile/2.0/ice-9/readline.scm


Guile was built with the following commands:

# LIBFFI_CFLAGS=-I/usr/lib/gcc/i686-pc-cygwin/4.5.3/include
LIBFFI_LIBS="-lffi -L/usr/lib/gcc/i686-pc-cygwin/4.5.3" ./configure
--prefix=$HOME/software/packages/guile-2.0.7
# make
# make install

During the configure stage, there was an indication that readline
library is found:

# checking how to link with libreadline... -lreadline
# ...
# checking for rl_getc_function pointer in readline... yes
# ...
# config.status: creating guile-readline/Makefile

However, during the "make" stage, the following messages were seen:

Making all in guile-readline
make[2]: Entering directory
`/home/akopps/software/src/guile-2.0.7/guile-readline'
  SNARF  readline.x
make  all-am
make[3]: Entering directory
`/home/akopps/software/src/guile-2.0.7/guile-readline'
  CC       readline.lo
  CCLD     libguilereadline-v-18.la

*** Warning: This system can not link to static lib archive
../libguile/libguile-2.0.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

*** Warning: linker path does not have real file for library -lreadline.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libreadline but no candidates were found. (...for file magic test)



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

* Re: Readline support in Cygwin
  2013-01-09  3:10 Readline support in Cygwin Akop Pogosian
@ 2013-01-09 21:57 ` Ludovic Courtès
  2013-01-12  4:41   ` Akop Pogosian
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2013-01-09 21:57 UTC (permalink / raw)
  To: Akop Pogosian; +Cc: guile-user

Hi!

Akop Pogosian <apogosian@gmail.com> skribis:

> # ERROR: In procedure load-extension:
> # ERROR: In procedure dynamic-link: file: "libguilereadline-v-18",
> message: "The specified module could not be found."

[...]

> # $ ls software/packages/guile-2.0.7/lib/
> # guile           libguile-2.0.la          libguilereadline-v-18.la
> # libguile-2.0.a  libguilereadline-v-18.a  pkgconfig

As you can see, you only have a static version of libguilereadline,
which is why ‘dynamic-link’ fails.

>   CCLD     libguilereadline-v-18.la
>
> *** Warning: This system can not link to static lib archive
> ../libguile/libguile-2.0.la.
> *** I have the capability to make that library automatically link in when
> *** you link to this library.  But I can only do this if you have a
> *** shared version of the library, which you do not appear to have.
>
> *** Warning: linker path does not have real file for library -lreadline.
> *** I have the capability to make that library automatically link in when
> *** you link to this library.  But I can only do this if you have a
> *** shared version of the library, which you do not appear to have
> *** because I did check the linker path looking for a file starting
> *** with libreadline but no candidates were found. (...for file magic test)

You would need to look for other such warnings previously in the build
process that would explain while no shared version of libguile was
produced either.

One way to investigate is first to check the output of:

  grep -A1 shared /path/to/guile/config.log

Another is to check whether all of Guile’s dependencies (libunistring,
libiconv, libffi, libgc, etc.) have a shared version.  If one is
lacking, libtool won’t create libguile-2.0.dll.

HTH,
Ludo’;.



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

* Re: Readline support in Cygwin
  2013-01-09 21:57 ` Ludovic Courtès
@ 2013-01-12  4:41   ` Akop Pogosian
  2013-01-12  8:48     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Akop Pogosian @ 2013-01-12  4:41 UTC (permalink / raw)
  To: guile-user

On Wed, Jan 9, 2013 at 3:57 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> Hi!
>
> Akop Pogosian <apogosian@gmail.com> skribis:
>
>> # ERROR: In procedure load-extension:
>> # ERROR: In procedure dynamic-link: file: "libguilereadline-v-18",
>> message: "The specified module could not be found."
>
> [...]
>
>> # $ ls software/packages/guile-2.0.7/lib/
>> # guile           libguile-2.0.la          libguilereadline-v-18.la
>> # libguile-2.0.a  libguilereadline-v-18.a  pkgconfig
>
> As you can see, you only have a static version of libguilereadline,
> which is why ‘dynamic-link’ fails.

Indeed. I am really confused about why there are no shared libraries
in /usr/lib under cygwin. However, they are installed in /usr/bin
under strange names such as /usr/bin/cygreadline6.dll

Is guile build system supposed to pick up shared libraries in those
locations or do I need to do something special?



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

* Re: Readline support in Cygwin
  2013-01-12  4:41   ` Akop Pogosian
@ 2013-01-12  8:48     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2013-01-12  8:48 UTC (permalink / raw)
  To: Akop Pogosian; +Cc: guile-user

> Date: Fri, 11 Jan 2013 22:41:25 -0600
> From: Akop Pogosian <apogosian@gmail.com>
> 
> On Wed, Jan 9, 2013 at 3:57 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> > Hi!
> >
> > Akop Pogosian <apogosian@gmail.com> skribis:
> >
> >> # ERROR: In procedure load-extension:
> >> # ERROR: In procedure dynamic-link: file: "libguilereadline-v-18",
> >> message: "The specified module could not be found."
> >
> > [...]
> >
> >> # $ ls software/packages/guile-2.0.7/lib/
> >> # guile           libguile-2.0.la          libguilereadline-v-18.la
> >> # libguile-2.0.a  libguilereadline-v-18.a  pkgconfig
> >
> > As you can see, you only have a static version of libguilereadline,
> > which is why ‘dynamic-link’ fails.
> 
> Indeed. I am really confused about why there are no shared libraries
> in /usr/lib under cygwin. However, they are installed in /usr/bin
> under strange names such as /usr/bin/cygreadline6.dll

Windows isn't Posix.  A Windows incarnation of a shared library is a
DLL file that should be in a directory on PATH, because that's where
the Windows dynamic link procedure looks for them.

As for the "cyg" prefix, I believe this is to distinguish the
Cygwin-compiled DLLs from native Windows DLL, whose names should be
libreadline6.dll (that's what I have here, having built Readline with
MinGW).  Since native and Cygwin DLLs are incompatible, keeping the
names different helps avoiding weird crashes when both MinGW and
Cygwin tools are installed on the same system.

> Is guile build system supposed to pick up shared libraries in those
> locations

It should.  If it doesn't, that's a bug, IMO.




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

end of thread, other threads:[~2013-01-12  8:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-09  3:10 Readline support in Cygwin Akop Pogosian
2013-01-09 21:57 ` Ludovic Courtès
2013-01-12  4:41   ` Akop Pogosian
2013-01-12  8:48     ` Eli Zaretskii

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