Skip to content
This repository has been archived by the owner on Jul 10, 2021. It is now read-only.

stable does not build Samples on Linux #31

Open
mungewell opened this issue Jun 6, 2014 · 13 comments
Open

stable does not build Samples on Linux #31

mungewell opened this issue Jun 6, 2014 · 13 comments

Comments

@mungewell
Copy link

Given that it used to, and is now commented out in 'CMakeList.txt' I suspect that it's on your list of things to do.... I attempted to make it build them but failed badly :-(

@mungewell
Copy link
Author

Manage to get OculusWorldDemo to build, but not SensorBox/TestSensor as it looks like these are now outdated by new API calls.

@jherico
Copy link
Owner

jherico commented Jun 7, 2014

I've mostly been focused on the examples for my book, located in https://github.com/OculusRiftInAction/OculusRiftInAction

I'll take a look at the in-SDK examples and see if I can bring them back to life.

@jherico
Copy link
Owner

jherico commented Jun 7, 2014

I've updated the files in commit 9052135

I'm able to build and run the OculusWorldDemo on the windows platform. I haven't tried the others yet. Let me know if this solves it for you.

Not sure how much time I'll be able to put into making all the other examples work.

@mungewell
Copy link
Author

Tried with '8de9c2c20b7b3d2a97697c2312d247fb25893095' on Linux

[ 78%] Building CXX object Samples/CommonSrc/CMakeFiles/CommonSrc.dir/Platform/Win32_Platform.cpp.o
/storage/OculusSDK-git2/Samples/CommonSrc/Platform/Win32_Platform.cpp:24:21: fatal error: Windows.h: No such file or directory
compilation terminated.
make[2]: *** [Samples/CommonSrc/CMakeFiles/CommonSrc.dir/Platform/Win32_Platform.cpp.o] Error 1
make[1]: *** [Samples/CommonSrc/CMakeFiles/CommonSrc.dir/all] Error 2
make: *** [all] Error 2

Will build OK with 'CMake/Modules/FindXinerama.cmake' and 'Samples/CommonSrc/CMakeLists.txt' from above patch. I remember some comment on Oculus forum that Xinerama may not be needed.

@zadacka
Copy link

zadacka commented Jul 9, 2014

Also experiencing this with '8de9c2c20b7b3d2a97697c2312d247fb25893095' on linux

[ 72%] Building CXX object    
Samples/CommonSrc/CMakeFiles/CommonSrc.dir/Platform/Win32_Gamepad.cpp.o
In file included from /home/azawadzki/Project/sundry/OculusSDK/Samples/CommonSrc/Platform/Win32_Gamepad.cpp:24:0:
/home/azawadzki/Project/sundry/OculusSDK/Samples/CommonSrc/Platform/Win32_Gamepad.h:29:21: fatal error: windows.h: No such file or directory
#include <windows.h>
                         ^
compilation terminated.
make[2]: *** [Samples/CommonSrc/CMakeFiles/CommonSrc.dir/Platform/Win32_Gamepad.cpp.o]     Error 1
make[1]: *** [Samples/CommonSrc/CMakeFiles/CommonSrc.dir/all] Error 2
make: *** [all] Error 2

It looks like CMake may be wrongly setting a bunch of Win32 targets.

@zadacka
Copy link

zadacka commented Jul 9, 2014

In case it helps, I tried to find the problem by iteratively removing source code and then running cmake, make. On the basis that my linux build shouldn't be trying to look for anything with Win32 or DirectX related stuff, I removed:

  • Win32_Gamepad.*
  • Win32_Platform.*
  • Render_D3D1X_Device.*
  • Render_D3D11_Device.*
  • Render_GL_Win32_Device.*
  • Render_D3D10_Device.*

Now I get

Linking CXX executable ../../output/OculusWorldDemo../../output/libCommonSrc.a(Linux_Platform.cpp.o): In function `OVR::Platform::Linux::PlatformCore::determineScreenOffset(int, int*, int*)': Linux_Platform.cpp:(.text+0xecd): undefined reference to `XineramaQueryScreens'
../../output/libCommonSrc.a(Linux_Platform.cpp.o): In function `OVR::Platform::Linux::PlatformCore::GetDisplayCount()': Linux_Platform.cpp:(.text+0x181e): undefined reference to `XineramaQueryScreens'
collect2: error: ld returned 1 exit status
make[2]: *** [output/OculusWorldDemo] Error 1
make[1]: *** [Samples/OculusWorldDemo/CMakeFiles/OculusWorldDemo.dir/all] Error 2
make: *** [all] Error 2

Probably not the right way to go digging for errors, but maybe it'll help someone more competent than me ;)

I suspect that globbing for source files in the CMakeLists.txt means that cmake tries to build a bunch of platform dependent stuff that it shouldn't do here for linux. Also, it seems that something that I deleted guilty cough is referenced by XineramaQueryScreens. Is there maybe a platform dependent call like GetDisplayCount that is causing the dependency issue?

@mungewell
Copy link
Author

This patch (from earlier) contains the files ('CMake/Modules/FindXinerama.cmake' and 'Samples/CommonSrc/CMakeLists.txt') which make it work...
https://dl.dropboxusercontent.com/u/34518077/0001-Some-patches-to-get-OculusWorldDemo-to-build-under-L.patch

@zadacka
Copy link

zadacka commented Jul 9, 2014

@mungewell thanks for the patch! Git threw some errors when I tried to apply it, so I went through it manually and can confirm that it fixes the build errors on my system too.

@jherico
Copy link
Owner

jherico commented Jul 9, 2014

I'm unlikely to integrate this patch. The use of Xinerama in the common code is only used for two things: fetching the desktop position of a given screen and fetching the count of screens. Both of these can be accomplished by using XRandr rather than Xinerama. I will update the CMake config to only include the appropriate platform specific files.

@mungewell
Copy link
Author

Thanks Brad, I wasn't really suggesting the (earlier) patch - just noting that it fixed the problems. Will you convert the sample applications to use xrandr?

@jherico
Copy link
Owner

jherico commented Jul 9, 2014

I've created a 'xinerama' branch to do so, though it should really be
called 'xinerama_deprecation'. I believe I've ported over one of the
functions successfully already, but I need to work on finishing the other
one and then testing the results.

@zadacka
Copy link

zadacka commented Jul 9, 2014

Thanks Brad. I gave it a shot on mac (linux at uni, mac at home ... cover all bases!) and found a glew include issue.

[ 84%] Building CXX object Samples/CommonSrc/CMakeFiles/CommonSrc.dir/Platform/OSX_Platform.mm.o 
In file included from /Users/az/Programming/OculusSDK/Samples/CommonSrc/Platform/OSX_Platform.mm:24:
In file included from /Users/az/Programming/OculusSDK/Samples/CommonSrc/Platform/../Platform/OSX_PlatformObjc.h:25:
In file included from /Users/az/Programming/OculusSDK/Samples/CommonSrc/Platform/OSX_Platform.h:25:
In file included from /Users/az/Programming/OculusSDK/Samples/CommonSrc/Platform/../Render/Render_GL_Device.h:27:
/Users/az/Programming/OculusSDK/3rdParty/glew/include/GL/glew.h:90:2: error: gltypes.h included before glew.h

It seems that glew.h may need to be included before Cocoa.h gets imported. Adding an include in that order in Samples/CommonSrc/Platform/OSX_PlatformObjc.h made the error go away. You said that you weren't finished, so I'll try again whenever you push to github again...

Hope that might be of use. Feel free to ignore it if not!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants