lloyd / yajl

A fast streaming JSON parsing library in C.
http://lloyd.github.com/yajl
ISC License
2.15k stars 435 forks source link

Trouble using/installing 'yajl' on Ubuntu 14.04 #190

Closed jigyasa-grover closed 8 years ago

jigyasa-grover commented 8 years ago

Hey @lloyd @pykler

I have been trying to install yajl on my Ubuntu 14.04 system for implementing a Streaming API.

git clone https://github.com/lloyd/yajl
cd yajl/
sudo ./configure 
sudo make install 
  File "/usr/local/lib/python3.4/dist-packages/jsonstreamer/yajl/parse.py", line 29, in load_lib
    raise OSError('Yajl cannot be found.')
OSError: Yajl cannot be found.

Reference to the code-snippet which raises the OSError : github.com/kashifrazzaqui/json-streamer/jsonstreamer/yajl/parse.py#L18-L29

jigyasa@spin:~$ gcc -lyajl
....
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
jigyasa@spin:~$ sudo ldconfig -p | grep yajl
    libyajl.so.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libyajl.so.2

Any pointers on this one ?

pykler commented 8 years ago

I think you are mixing two things together. Jsonstreamer is a python package that uses yajl, what you added to the LD Library Path is the path to Yajl-py's egg-info folder, which is first yet a different python package and also doesn't contain the yajl.so ... you need to add the proper path to the LD Path, which if I recall correctly your install steps would do that automatically.

The error you got from gcc is fine, it just means that your code has no main function ... so its not complaining that it can't find yajl. Which is what you see from ldconfig command.

I suggest you check with the jsonstreamer folk (https://github.com/kashifrazzaqui/json-streamer), there is a chance their code is looking for yajl 1 and not yajl 2. Or perhaps something else.

jigyasa-grover commented 8 years ago

@pykler So I remove the path added hereexport LD_LIBRARY_PATH="/usr/local/lib/python3.4/dist-packages/yajl-0.3.5.egg-info" ?

And that means yajl is correctly installed, it's the issue with the json-streamer library ?

pykler commented 8 years ago

Yes I believe the jsonstreamer is not able to load yajl for some reason. Most probably they rely on yajl.so.1 not yajl.so.2 but I maybe wrong. It would be best to check with them. Hatem Nassrat

On Wed, Jul 27, 2016 3:20 PM, Jigyasa Grover notifications@github.com wrote: @pykler So I remove the path added here export LD_LIBRARY_PATH="/usr/local/lib/python3.4/dist-packages/yajl-0.3.5.egg-info" ?

And that means yajl is correctly installed, it's the issue with the json-streamer library ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub , or mute the thread .

jigyasa-grover commented 8 years ago

@pykler Thanks for your quick and helpful responses.

Looked into the code and actually found the compatibility issue in jsonstreamer to be correct.

Sending a quick-fix to them for the same.

Here is the follow up: https://github.com/kashifrazzaqui/json-streamer/issues/5