Nealefelaen / weston-rift

Oculus Rift support for the Wayland reference compositor Weston
Other
26 stars 4 forks source link

Compiling problems #4

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hey, I've been trying to figure out how to compile weston-rift with ovrlib. There are many programs/games/demos etc that have their source released without the ovr sdk/lib in it for licensing reasons, this I understand, but none of them have any form of instructions on how to add and compile the application/program correctly WITH ovrlib. I have NO experience adding libraries to the existing code of a larger project.

Simply put, could you please provide instructions on where to place the LibOVR folder if there is a place the configure script looks for the libraries and source files, what parameters to add to what build script/config file, or what file to edit and what to put in it?

ChristophHaag commented 9 years ago

Yea, that's probably my fault. Sorry. I made a pull request fb6c12d38c809886d472991257811381dc915aac and switched to finding ovr libraries with pkg-config, but only my archlinux package of the oculus rift SDK https://aur.archlinux.org/packages/oculus-rift-sdk-jherico-git/ has that pkg-config support.

You may have better luck with my fork of this repository: https://github.com/ChristophHaag/weston-rift/

I haven't changed anything in the original code, just rebased it on more up to date versions of weston and luckily it seems to work.

But what I tried to change was adding this here: https://github.com/ChristophHaag/weston-rift/commit/6e605c5ce2f0460953e04ee8d10a3002bd686fbd#diff-67e997bcfdac55191033d57a16d1408aR449, meaning that when after detecting stuff with pkg-config the variables aren't set, just to use the hardcoded ones, but I haven't actually tested it. I actually know very little of autotools, so perhaps PKG_CHECK_MODULE makes it error out when the pkg-config call is not successful. Then just removing the PKG_CHECK_MODULES(...) line may help.

If not, then the simple way is to put https://gist.github.com/anonymous/40387b5fed3806734077 into /usr/lib/pkgconfig/libovr.pc and edit the paths so they fit.

ChristophHaag commented 9 years ago

Well, of course it didn't work. I made a new version and pushed it to my fork repo that should work without pkg-config.

https://github.com/ChristophHaag/weston-rift/commit/6a3bb7adba4f3aa8ceaba116b53c0a148c7914de#diff-67e997bcfdac55191033d57a16d1408aR449

If the sdk is at another place, simply edit the two lines that set OVR_CFLAGS and OVR_LIBS.

The OVR_CFLAGS are a bunch of -I/whatever/directory/with/*.h files. and OVR_LIB depends on what the library is called. Maybe it's libovr.so, then it's -lovr, maybe it's libOVR.a, then perhaps -lOVR. These things always change with SDK versions, and community verions like jherico's sdk do it differently, so it's hard to know for sure.

ghost commented 9 years ago

Sweet, thanks :)

ghost commented 9 years ago

Hm, I've got the same version of ovr lib in the exact place that's stated in configure.ac, but still I get, checking for OVR... no.
It just doesn't like me.. cries :P