erlgtk config + new erl_interface = pthread-related errors?

Kent Boortz kent@REDACTED
Tue Aug 26 10:11:32 CEST 2003

Chris Pressey <cpressey@REDACTED> writes:
> I've successfully installed the erlang-r9c0,1 port on FreeBSD -STABLE,
> and I'm trying to re-install erlgtk-0.9.6 on top of it.
> But I'm seeing a new error in the configure stage that seems to have
> something to do with the changes in erl_interface w.r.t. pthreads.  The
> relevant output of 'make configure' follows:
> checking fun erl_interface...
> /usr/local/lib/erlang/lib/erl_interface-3.4/lib/libei.a(ei_pthreads.o):
> In function `ei_m_create':
> ei_pthreads.o(.text+0x2e): undefined reference to `pthread_mutex_init'
> Any idea what could be causing this?  My hunch is it's something either
> in the port or in my local configuration, rather than in the R9C dist
> itself, but I guess it could be just about anything.  The pth-2.0.0 port
> is installed, even though the erlang port doesn't seem to mention it
> as a dependency.

It is a change in erl_interface. In earlier versions the library for
linking with threaded and non threaded code was the same.  A compiler
and linker "feature" was used to make sure that the right functions
was used for threaded and non threaded code (pragma weak + erl_init()
as a macro expanding to different init functions that forced specific
.o files out of the .a library that defined the same functions).

In R9C we use separate libraries for threaded and non threaded
code. One of the reason was that we can't be sure that the only change
made in C header files when _REENTRANT is defined is "errno" that was
specially handled in erl_interface if threads where used.

If you change erlgtk to link using "-lerl_interface_st" and "-lei_st"
you link with the single threaded library and the link errors will go
away. This is documented,


More information about the erlang-questions mailing list