openscenegraph / OpenSceneGraph

OpenSceneGraph git repository
http://www.openscenegraph.org
Other
3.25k stars 1.42k forks source link

OSG doesn't support OSX arm64? #1202

Closed remoe closed 1 year ago

remoe commented 1 year ago

How one can build OSG for OSX arm64 (Apple Silicon) ?

https://github.com/openscenegraph/OpenSceneGraph/blob/51b387c20c06fbc9cb4908b3e4a0af83531ab51f/CMakeLists.txt#L100

It is not supported?

robertosfield commented 1 year ago

I don't recall OSX + ARM64 being in the testing mix for the 3.6.5 so officially I'd say it's not supported. I don't there was even OSX + ARM64 hardware available back when it 3.6.5 was released.

However, I no idea if it might work. The OSG can be built on arm, but whether the OSX code paths can be coaxed to do it I can't say. You'll need to experiment with override the defaults like the CMAKE_OSX_ARCHITECTURES above to see if you can do it.

remoe commented 1 year ago

Ok, thanks. It's possible to build it with following additional settings for CMake:

-DCMAKE_OSX_ARCHITECTURES=arm64
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13
hejian01 commented 1 year ago

Hello, according to your method, I was able to compile and build successfully on an M1 chip computer, but it seems that I cannot use the new features of OpenGL 3.3 or OpenGL 4.1. I also tried setting OSG_GL3_AVAILABLE = ON, but it didn't work.Can you guide me on this? @remoe @robertosfield

remoe commented 1 year ago

one find some information (osgEarth) here https://docs.osgearth.org/en/latest/build.html