Giter Club home page Giter Club logo

Comments (30)

rayjs avatar rayjs commented on July 26, 2024 9

On Ubuntu 16, I had the same issue. Here is how it got fixed. Hope it helps
Step 1:
Install libjpeg-turbo8-dev
Step 2:
The libturbojpeg.so file was missing so I had to create a sym-link.
I ran sudo ln -s /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0 /usr/lib/x86_64-linux-gnu/libturbojpeg.so
Step 3:
Deleted the build directory and ran cmake again.

from libfreenect2.

xlz avatar xlz commented on July 26, 2024 3

I checked again. On Ubuntu 14.04, /usr/lib/x86_64-linux-gnu/libturbojpeg.a is provided by libjpeg-turbo8-dev, but /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0 is provided by libturbojpeg. If the users follow the documentation, they will only install libjpeg-turbo8-dev, and can not find libturbojpeg.so.0. The docs need fixing.

I was also confused by this in several previous comments.

from libfreenect2.

sketchc89 avatar sketchc89 commented on July 26, 2024 2

I've installed all dependencies and added the symbolic link with

sudo ln -s /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0.0.0 /usr/lib/x86_64-linux-gnu/libturbojpeg.so

but the make step still fails on Ubuntu 14.04

Linking CXX shared library lib/libfreenect2.so
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-turbojpeg.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libturbojpeg.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libfreenect2.so] Error 1
make[1]: *** [CMakeFiles/freenect2.dir/all] Error 2
make: *** [all] Error 2

from libfreenect2.

sketchc89 avatar sketchc89 commented on July 26, 2024 1

The workaround worked using the latest master (commit 42da6d8 ) and I have Protonect up and running.
I upgraded Kernel to 3.16 per the instructions using:
sudo apt-get install linux-image-generic-lts-utopic
Thanks for the great work guys.

from libfreenect2.

floe avatar floe commented on July 26, 2024

Note that this isn't a bug in libfreenect2, but I'm posting the issue/fix here for reference.

from libfreenect2.

rocha avatar rocha commented on July 26, 2024

Mmm, I made the symbolic link and still have the error. Any pointers? Thanks.

from libfreenect2.

floe avatar floe commented on July 26, 2024

Could you post the exact build error?

from libfreenect2.

fstafforini avatar fstafforini commented on July 26, 2024

This confirmed bug could be the culprit, apparently there is a symlink missing.

from libfreenect2.

xlz avatar xlz commented on July 26, 2024

We have created a workaround that does not requires creating symlink under /usr. Please test latest master.

from libfreenect2.

SebastianVarma avatar SebastianVarma commented on July 26, 2024

I installed the latest commit, but it still returns the same error.

from libfreenect2.

floe avatar floe commented on July 26, 2024

@SebastianVarma can you post the output of ls -la /usr/lib/*/libturbojpeg*?

from libfreenect2.

SebastianVarma avatar SebastianVarma commented on July 26, 2024

@floe I will do so tomorrow morning when I will be in front of my computer. Thank you for helping.

from libfreenect2.

SebastianVarma avatar SebastianVarma commented on July 26, 2024

@floe The output is as follows:

-rw-r--r-- 1 root root 499438 Dec 19 2013 /usr/lib/x86_64-linux-gnu/libturbojpeg.a
lrwxrwxrwx 1 root root 47 Jun 9 13:42 /usr/lib/x86_64-linux-gnu/libturbojpeg.so -> /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0.0.0
lrwxrwxrwx 1 root root 21 Dec 19 2013 /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0 -> libturbojpeg.so.0.0.0
-rw-r--r-- 1 root root 301472 Dec 19 2013 /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0.0.0

from libfreenect2.

floe avatar floe commented on July 26, 2024

This does look correct... can you please open a new issue and post the exact build error?

from libfreenect2.

neorobo avatar neorobo commented on July 26, 2024

Just wanted to chime in that I have this exact same issue, with the same output from ls -la /usr/lib/*/libturbojpeg*

from libfreenect2.

xlz avatar xlz commented on July 26, 2024

@neorobo
Can not reproduce.

I also have this same output from ls -la /usr/lib/*/libturbojpeg* and my build works fine.

Can you post the log of your cmake ..?

(Should have Found TurboJPEG: /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0)

from libfreenect2.

floe avatar floe commented on July 26, 2024

@neorobo Duplicate issue #286 was fixed by a fresh clone of master and re-run of cmake, maybe try that first?

from libfreenect2.

neorobo avatar neorobo commented on July 26, 2024

@xlz Based on your suggestion I checked CMakeCache.txt. It was pointing to the static library. I edited it to point to .so.0 as you suggested should be the case and protonect was succesfully installed.

from libfreenect2.

sketchc89 avatar sketchc89 commented on July 26, 2024

I've compiled libfreenect2 quite a few times in the past couple weeks and I don't know if I've ever gotten it to work on the first time through following the order in the documentation.
After failing, I remove it entirely from my system, reclone it, run ./depends/install_ubuntu.sh, cmake CMakeLists.txt, make && sudo make install it builds almost every time. Have repeated this on Ubuntu 14.04 32-bit & 64-bit and 15.04.

from libfreenect2.

floe avatar floe commented on July 26, 2024

I'm hoping that this is finally fixed for Debian and Ubuntu with latest master (both CMakeLists.txt and install_ubuntu.sh). I'll close it for now, but please comment if this is still a problem.

from libfreenect2.

Pincello avatar Pincello commented on July 26, 2024

I had the same Problem and had to delete /libfreenect2 and clone it again from Git. Now it works.

from libfreenect2.

jamesbellaero avatar jamesbellaero commented on July 26, 2024

Fixed it with ./depends/install_ubuntu.sh and then installing libturbojpeg with apt-get.

from libfreenect2.

YandanYang avatar YandanYang commented on July 26, 2024

I met the same problem, and I refer to this page : http://www.jetsonhacks.com/2015/02/26/install-kinect-v2-using-libfreenect2-on-nvidia-jetson-tk1/
Fixed with :sudo apt-get install -y build-essential libturbojpeg libtool autoconf libudev-dev cmake mesa-common-dev freeglut3-dev libxrandr-dev doxygen libxi-dev libjpeg-turbo8-dev

from libfreenect2.

xlz avatar xlz commented on July 26, 2024

The above suggestion is wrong.

The issue was fixed. Follow the instructions in README, and no workaround is necessary.

from libfreenect2.

paulnord avatar paulnord commented on July 26, 2024

@xlz can you point me to the README to which you refer?

from libfreenect2.

xlz avatar xlz commented on July 26, 2024

(Ubuntu 14.04 and newer) sudo apt-get install libturbojpeg libjpeg-turbo8-dev

According to https://packages.ubuntu.com/trusty/amd64/libturbojpeg/filelist, libturbojpeg provides /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0. Our CMake was specifically made to detect libturbojpeg.so.0 in the absence of libturbojpeg.so.

from libfreenect2.

Smilels avatar Smilels commented on July 26, 2024

@rayjs your solution also works for me in Ubuntu 16.04. Thanks a lot.

from libfreenect2.

hsandt avatar hsandt commented on July 26, 2024

I know the issue is closed, but in case someone still has it after trying the other suggestions:

We had a very similar issue on HaxeFoundation/hashlink#147 and our solution was to follow the error message on -fPIC and rebuild libjpeg-turbo ourselves with Position-Independent Code. It should be the default when building with cmake/make, but apparently was not done so for the Ubuntu package.

from libfreenect2.

xlz avatar xlz commented on July 26, 2024

@hsandt It's generally better to link shared libraries not static objects. In this case it's better to link libturbojpeg.so not libturbojpeg.a. This is also the reason libturbojpeg.a is not built with -fPIC, because it's not meant for building shared libraries. Either you go all shared or all static.

from libfreenect2.

hsandt avatar hsandt commented on July 26, 2024

Ah! I missed that point. I'll go all dynamic next time.

from libfreenect2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.