ValveSoftware / steamworks-vr-api

Source for the Steamworks VR API
Other
137 stars 30 forks source link

Fails to build on OS X #1

Closed yaakov-h closed 10 years ago

yaakov-h commented 10 years ago

Hi Joe!

I've encountered the following errors trying to build this on Mac OS X:

  1. xcode_ccache_wrapper has Windows newlines and not Linux/OS X ones. This can be fixed by using dos2unix and/or adding xcode_ccache_wrapper text to .gitattributes
  2. After generating the Xcode project, every target builds against the Mac OS X 10.7 SDK (macosx10.7) which is not available when using any version of Xcode from the last year and a half. You should probably default to Latest OS X (macosx) considering that the only use of the SDK itself is the single call to NSHomeDirectory in osxfilebridge.mm.
  3. The generated LIBRARY_SEARCH_PATHS looks one directory too far up for libraries. The error is as follows:
ld: warning: directory not found for option '-L/Users/yaakov/Development/Steamworks/steamworks-vr-api/public/lib/osx32'

On my machine this should be -L/Users/yaakov/Development/Steamworks/steamworks-vr-api/**src**/public/lib/osx32 (without the asterisks). I attempted to try fix this but I don't have enough knowledge of vpc to do so.

  1. OVR.h could not be found:
In file included from /Users/yaakov/Development/Steamworks/steamworks-vr-api/src/drivers/oculus/oculushmdlatest.cpp:2:
/Users/yaakov/Development/Steamworks/steamworks-vr-api/src/drivers/oculus/oculushmdlatest.h:6:10: fatal error: 'OVR.h' file not found
#include "OVR.h"
  1. protoc crashes during the build and when I try run the same command outside of the build:
/bin/sh: line 3:  5924 Segmentation fault: 11  ../devtools/bin/osx32/protoc --proto_path=../thirdparty/protobuf-2.3.0/src --proto_path=/Users/yaakov/Development/Steamworks/steamworks-vr-api/src/common/ --cpp_out=../vrclient/generated_proto /Users/yaakov/Development/Steamworks/steamworks-vr-api/src/common/vr_messages.proto
Command /bin/sh failed with exit code 139
[06:03pm yaakov@Expression:~/Development/Steamworks/steamworks-vr-api/src/vrclient] (branch: master) ../devtools/bin/osx32/protoc --proto_path=../thirdparty/protobuf-2.3.0/src --proto_path=/Users/yaakov/Development/Steamworks/steamworks-vr-api/src/common/ --cpp_out=../vrclient/generated_proto /Users/yaakov/Development/Steamworks/steamworks-vr-api/src/common/vr_messages.proto
Illegal instruction: 4

Edit: It looks like protoc has also been unix2dos'ed unintentionally.

  1. ihmddriver.h line 47 (see here) triggers a Clang compiler warning:
In file included from /Users/yaakov/Development/Steamworks/steamworks-vr-api/src/drivers/oculus/driver_oculus.cpp:3:
/Users/yaakov/Development/Steamworks/steamworks-vr-api/public/headers/ihmddriver.h:47:2: warning: '/*' within block comment [-Wcomment]
        /* Position of the driver tracking reference in driver world space

GitHub Flavored Markdown doesn't seem to like my numbers so please pretend that these are numbered 1 through 6.

JoeLudwig commented 10 years ago

Next time 6 Issues would be better than one with 6 items in it. These aren't all likely to be fixed at the same time/in the same way.

Regarding #1 (the second one anyway): OVR.h is part of the Oculus SDK. Download it and stick it in src/thirdparty/OculusSDK if you want to build the Oculus driver.

I'll take a look at the others.

yaakov-h commented 10 years ago

Thanks.

I was gonna create 6 issues at first but I didn't want to spam you.

1 and 5 (the third 1) are probably the same issue - you probably need a .gitattributes like https://github.com/ValveSoftware/source-sdk-2013/blob/master/.gitattributes

JoeLudwig commented 10 years ago

Added .gitattributes in https://github.com/ValveSoftware/steamworks-vr-api/commit/8dd491a42bd1c0bdf183171ab3b166eb0cecb556

I haven't actually tested to see if I need to recommit those files with fixed line endings. If that is necessary and you've already made the change I'd love to take a pull request to fix it.

yaakov-h commented 10 years ago

Thanks, I've created the two pull requests listed above to deal with items 1, 2 and 5.

Regarding point 3,

[02:46pm yaakov@Expression:~/Development/Steamworks/steamworks-vr-api/public/lib] (branch: master) find .
.
./linux32
./linux32/libvrtest_api.so
./win32
./win32/vrtest_api.lib

Why is there no public/lib/osx32 folder?

Regarding point 4, I tried downloading the Oculus SDK (0.2.5c) and putting it in the folder you mentioned, and I've progressed to a linker error:

ld: warning: directory not found for option '-L/Users/yaakov/Development/Steamworks/steamworks-vr-api/public/lib/osx32'
Undefined symbols for architecture i386:
  "typeinfo for OVR::MessageHandler", referenced from:
      typeinfo for COculusHmdLatest in oculushmdlatest.o
  "typeinfo for OVR::Allocator", referenced from:
      typeinfo for OVR::Allocator_SingletonSupport<OVR::DefaultAllocator> in driver_oculus.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
JoeLudwig commented 10 years ago

I'd like to track the OculusSDK issue here: https://github.com/ValveSoftware/steamworks-vr-api/issues/3

You have to turn on RTTI and rebuild the Oculus SDK so it's a little more complicated than just grabbing the SDK. I'm working on a solution for all of that.

3 is fixed here: https://github.com/ValveSoftware/steamworks-vr-api/commit/c317d4cec20bf80a66301f7384c0c1076eb3de97

2 is fixed here: https://github.com/ValveSoftware/steamworks-vr-api/commit/31a2f1e3f5c0125c23a168a7c1ad6b55b5796e39

6 (1 number 3) is fixed here: https://github.com/ValveSoftware/steamworks-vr-api/commit/125e4e64011e73b7912a8a85204cb9eb8f063810

I think 1 and 5 were fixed with the line endings. If there are still OSX bugs please open a new issue for (each of) those.