gvvaughan / lyaml

LibYAML binding for Lua.
gvvaughan.github.io/lyaml
Other
208 stars 34 forks source link

required symbol yaml_document_initialize not found in any of libc, libyaml #30

Closed duybinh0208 closed 4 years ago

duybinh0208 commented 5 years ago

Hi, could you help to check this issue?

I have installed the latest version of libYAML at: https://pyyaml.org/wiki/LibYAML

After that, I try to install lyaml by using luarocks: luarocks install lyaml YAML_DIR=$LOCAL_SOFTWARE/libyaml

But the error was thrown as below:


Installing https://luarocks.org/lyaml-6.2.3-1.src.rock

/home/bcpe/software/openresty/luajit/bin/luajit build-aux/luke package="lyaml" version="6.2.3" \
    PREFIX="/home/bcpe/software/luarocks/lib/luarocks/rocks/lyaml/6.2.3-1" \
    CFLAGS="-O2 -fPIC" LIBFLAG="-shared" LIB_EXTENSION="so" OBJ_EXTENSION="o" \
    LUA="/home/bcpe/software/openresty/luajit/bin/luajit" \
    LUA_DIR="/home/bcpe/software/luarocks/lib/luarocks/rocks/lyaml/6.2.3-1/lua" \
    LUA_INCDIR="/home/bcpe/software/openresty/luajit/include/luajit-2.1" \
    YAML_DIR="/home/bcpe/software/libyaml" \
    YAML_INCDIR="/home/bcpe/software/libyaml/include" \
    YAML_LIBDIR="/home/bcpe/software/libyaml/lib"

luke: fatal: required symbol 'yaml_document_initialize' not found in any of libc, libyaml

Error: Build error: Failed building.```
duybinh0208 commented 5 years ago

It seems like there's no any problems with 6.0-1 version: luarocks install lyaml 6.0-1 YAML_DIR=$LOCAL_SOFTWARE/libyaml

However, the higher versions than 6.0-1 always produce the issue yaml_document_initialize not found.

Please help to fix.

Thanks

jagregory commented 5 years ago

Same issue here.

Seems to only be an issue on my machine where I have Homebrew in a non-standard directory.

dunty commented 5 years ago

Same issue here.

Seems luke of 6.2.3 can not propagate LUA_DIR, YAML_INCDIR and YAML_LIBDIR correctly. But that is solved at 6.1.2 as described in NEWS.txt?

I changed the lukefile to solve this issue temporarily:

--[[ external_dependencies = { YAML = { library = {checksymbol='yaml_document_initialize', library='yaml'}, }, } ]]

incdirs = { 'ext/include', '$LUA_INCDIR', '$YAML_INCDIR', }

libdirs = { '$YAML_LIBDIR', }

heckur commented 5 years ago

Same issue here.

Seems luke of 6.2.3 can not propagate LUA_DIR, YAML_INCDIR and YAML_LIBDIR correctly. But that is solved at 6.1.2 as described in NEWS.txt?

I changed the lukefile to solve this issue temporarily:

--[[ external_dependencies = { YAML = { library = {checksymbol='yaml_document_initialize', library='yaml'}, }, } ]]

incdirs = { 'ext/include', '$LUA_INCDIR', '$YAML_INCDIR', }

libdirs = { '$YAML_LIBDIR', }

How would I go about adding another symbol that is not found? Now I am getting this error when trying to start a program that uses lyaml (Kong):

.../luarocks/lib/lua/5.1/yaml.so: undefined symbol: yaml_sequence_start_event_initialize

thg303 commented 5 years ago

this is version 6.2.4 and the problem still exists! the temporary solution did not helped :(

thg303 commented 5 years ago

I simply changed the line library = {checksymbol='yaml_document_initialize', library='yaml'}, to library = {library='yaml'}, and build and installed it with: luarocks make

you may confirm existence of that symbol in the library file manually with: objdump -t /usr/local/lib/libyaml.so | grep yaml_document_initialize

nehaljwani commented 4 years ago

I wasn't in a situation to edit the source itself, so I ended up doing (which also worked):

export CFLAGS="${CFLAGS:-} -I${YAML_DIR}/include"
export LDFLAGS="${LDFLAGS:-} -L${YAML_DIR}/lib -Wl,-rpath,${YAML_DIR}/lib"