Linux build issues

Issue #6 new
Christoph Haag created an issue

I'm not sure how the state of the linux builds should be, but I have multiple issues.

First you should know that I use the feature-cmake branch from this repository for the oculus rift sdk: https://github.com/jherico/OculusSDK/tree/feature-cmake (stable and unstable branches don't build right now)

So this puts the oculus headers in $srcdir/OculusSDK/LibOVR/Include/OVR.h

I tried using cmake with:

         -DOCULUS_INCLUDE_DIR="$srcdir/OculusSDK/LibOVR/Include/" \

but it doesn't have an effect.

So I set it with this:

  export C_INCLUDE_PATH="$srcdir/OculusSDK/LibOVR/Include/"
  export CPLUS_INCLUDE_PATH="$srcdir/OculusSDK/LibOVR/Include/"

This works. (the -DOCULUS_LIBRARY_DIR option seems to work)

The next issue is that it doesn't find the opengl_helpers.h so I had to add $srcdir/ibex/ to the include path environment variables too so now they read

  export C_INCLUDE_PATH="$srcdir/OculusSDK/LibOVR/Include/:$srcdir/ibex/"
  export CPLUS_INCLUDE_PATH="$srcdir/OculusSDK/LibOVR/Include/:$srcdir/ibex/"

Now it fails with this:

/home/chris/ibex-git/src/ibex/x11/x11.cpp: In function 'void playVideo()':
/home/chris/ibex-git/src/ibex/x11/x11.cpp:915:19: error: no matching function for call to 'Ibex::VLCVideoPlayer::playVideo(const char*, bool, Display*&, Window&)'
          dpy, root);
                   ^
/home/chris/ibex-git/src/ibex/x11/x11.cpp:915:19: note: candidate is:
In file included from /home/chris/ibex-git/src/ibex/x11/x11.cpp:1:0:
/home/chris/ibex-git/src/ibex/x11/../video/VLCVideoPlayer.h:39:9: note: int Ibex::VLCVideoPlayer::playVideo(const char*, bool, Display*, GLXDrawable, const void*)
     int playVideo(const char *fileName, bool isStereo, Display *dpy, GLXDrawable root, const void *data);
         ^
/home/chris/ibex-git/src/ibex/x11/../video/VLCVideoPlayer.h:39:9: note:   candidate expects 5 arguments, 4 provided

all the declarations of playvideo(...) I found require a const void *data parameter...

Sorry for stuffing it all in one issue,

Comments (14)

  1. Hesham Wahba repo owner

    Hi Christopher,

    First off, the OculusSDK I believe should be one level up from your source directory. That's my default for now. I'll work on making more flexible at some point :)

    As to opengl_helpers.h not being found, not sure why it wasn't, I'll probably need to add the source directory to the header search paths, I use something other than CPLUS_INCLUDE_PATH but should be the same anyways.

    Lastly, the playVideo function, I'm not sure why that would fail unless I forgot to check something in. I'll take a look at this soon, but not too soon, not because I want to neglect Linux but because I'm working hard on upgrading the project to OpenGL 3.3+.

    This is currently working on the Mac but needs more love and once I have that I can make the rendering much more complex (in a good way I hope :) ). After that work is complete I'll integrate everything into the same code-path and so Linux, Mac and Windows should all build from the same source. I had already started that work and for the most part they all matched, but I may have missed something for Linux as I said earlier. I hope this makes up for the delay in getting a fix out. I'm hoping your card supports OpenGL 3.3?

    Regards, Hesham

  2. Emil Fridriksson

    There is an error in importing opengl_helpers.h in VLCVideoPlayer.h. It's correctly imported in VLCVideoPlayer.cpp.

    The other issue is also still a problem:

    ~/ibex/x11/x11.cpp: In function void playVideo()’:
    ~/ibex/x11/x11.cpp:915:19: error: no matching function for call to Ibex::VLCVideoPlayer::playVideo(const char*, bool, Display*&, Window&)
              dpy, root);
                       ^
    ~/ibex/x11/x11.cpp:915:19: note: candidate is:
    In file included from ~/ibex/x11/x11.cpp:1:0:
    ~/ibex/x11/../video/VLCVideoPlayer.h:39:9: note: int Ibex::VLCVideoPlayer::playVideo(const char*, bool, Display*, GLXDrawable, const void*)
         int playVideo(const char *fileName, bool isStereo, Display *dpy, GLXDrawable root, const void *data);
             ^
    ~/ibex/x11/../video/VLCVideoPlayer.h:39:9: note:   candidate expects 5 arguments, 4 provided
    make[2]: *** [x11/CMakeFiles/ibex_x11.dir/x11.cpp.o] Error 1
    make[1]: *** [x11/CMakeFiles/ibex_x11.dir/all] Error 2
    make: *** [all] Error 2
    
  3. ThePhil osopher

    I've got the same probleme here to install it on Linux (Ubuntu 14.04).

    ./video/VLCVideoPlayer.h:26:28: fatal error: opengl_helpers.h: No such file or directory
    

    I don't know how to fix it. Some suggestions to do it ? Thanks a lot in advance!

  4. Christoph Haag reporter

    I forked the repository in order to not have so many workarounds in my Archlinux AUR package:

    You can view the commits I did here: https://bitbucket.org/haagch/ibex/commits/all

    Fixes and workarounds include:

    Caveat: You need to build against a shared version of the library. I was not able to link against the statically built libOculusVR.a

    OculusSDK/LibOVR/Src/OVR_Linux_HMDDevice.cpp:181: undefined reference to `read_edid_data(_XDisplay*, unsigned long)'
    

    No idea why this happens, but it happens only when trying to link with ibex, not when compiling the Oculus sdk. You can create a shared library of the oculus rift sdk library by simply replacing one STATIC with shared in their cmake stuff before compiling the oculus sdk:

    sed "s/STATIC/SHARED/g" -i OculusSDK/LibOVR/CMakeLists.txt
    

    Note that this way libOculusVR.so must be found by the linker when starting ibex, so either copy it to /usr/lib or do something with LD_LIBRARY_PATH.

    1. I have no rift so I can not actually test whether the rift functionality actually works. Without a rift it starts and displays fine.
    2. I don't feel very comfortable submitting this as a pull request as it is probably of low quality. @druidsbane Please take a look at it and see how to apply this to your branch.
  5. Hesham Wahba repo owner

    Hi Christoph, Emil, ThePhil,

    Thanks for all those comments and changes. To be honest I haven't had much chance to integrate the fixes I made for the Windows branch in either the Mac or Linux ones. The main reason is that I have a newer and hopefully much better version coming soon. I will post updates to MTBS3D and on this issue to let you guys know.

    In terms of the changes, as nice as jherico's branch is, I found that it still had more issues than using the OculusSDK directly, especially in the preview 0.3.2 API. The rest of the changes look good. I will hold off on integrating changes till I get a chance to boot up in Linux again and give it a run through, and also to see if it might be worth switching to the new branch that I'm working on completely.

    Hope this helps! Also, are you all more interested in Linux because it is easier to develop for and faster than Windows and OSX or do you use the other operating systems but prefer Linux for work or other reasons?

    Thanks!

  6. ThePhil osopher

    Thanks for your answer Hesham. It's good to see that you are still improving this project! Looking forward to seeing that on MTBS3D. As for Linux, since I am hacking for fun at home, linux fits better than a closed OS.

  7. Emil Fridriksson

    Can't wait to get a chance to try this out on my machine. I've switched from Mint to Arch, so I don't have the same environment to test this as before.

  8. ThePhil osopher

    @haagch "You can create a shared library of the oculus rift sdk library by simply replacing one STATIC with shared in their cmake stuff before compiling the oculus sdk:"

    I don't use the oculus SDK but openHMD. Is it possible to use Ibex with OpenHMD?

  9. Emre S

    Hi guys,

    I am really trying hard to get this build up and running on Ubuntu. I have reached 63% built target. But I get a linker error. As far as I understand, it is about my OVR library. But when I check its cmake settings, the Xrandr dynamic library is referred while compiling.

    Please help

    [  4%] Built target ibex_x11
    [  9%] Built target ibex_filesystem
    [ 45%] Built target ibex_glm
    [ 50%] Built target ibex_windows
    [ 54%] Built target ibex_video
    [ 59%] Built target ibex_sixense
    [ 63%] Built target ibex_oculus
    Linking CXX executable ibex
    /usr/bin/ld: /home/emre/Downloads/ovr_sdk_linux_0.4.4/LibOVR/Lib/Linux/Release/x86_64/libovr.a(OVR_Linux_Display.o): undefined reference to symbol 'XRRGetOutputProperty'
    /usr/lib/gcc/x86_64-linux-gnu/4.8/libXrandr.so: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status
    make[2]: *** [ibex] Error 1
    make[1]: *** [CMakeFiles/ibex.dir/all] Error 2
    make: *** [all] Error 2
    
  10. Hesham Wahba repo owner

    Hi,

    Unfortunately the version of ibex available from sources is limited to the older SDK's mentioned in the documentation and isn't compatible with DK2, just DK1. I am working on a version that isn't on Bitbucket that runs on DK2 however but I don't anticipate being able to opensource that.

    Regards, Hesham

  11. Brian Peiris

    @druidsbane Any updates about Ibex? Is the project going to be closed-source going forward? Are you going to drop Linux support? Thanks.

  12. Log in to comment