Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS compilation fails! #1344

Open
Treata11 opened this issue Dec 26, 2024 · 2 comments
Open

iOS compilation fails! #1344

Treata11 opened this issue Dec 26, 2024 · 2 comments

Comments

@Treata11
Copy link

Treata11 commented Dec 26, 2024

As stated in the README.md, I tried configuring for an iOS target:

$ SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) cmake -D NO_PTEX=1 -D NO_DOC=1 \
      -D NO_OMP=1 -D NO_TBB=1 -D NO_CUDA=1 -D NO_OPENCL=1 -D NO_CLEW=1 \
      -D CMAKE_TOOLCHAIN_FILE=../cmake/iOSToolchain.cmake -G Xcode \
      ..

but the following error occured:

-- Could NOT find OpenGL (missing: OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR) 
-- Found Python: /opt/homebrew/Frameworks/Python.framework/Versions/3.11/bin/python3.11 (found version "3.11.11") found components: Interpreter

CMake Warning at CMakeLists.txt:515 (message):
  OpenGL 4.2 was not found : support for GLSL transform feedback kernels will
  be disabled in Osd.  If you have an OpenGL SDK installed (version 4.2 or
  above), please refer to the FindOpenGL.cmake shared module in your cmake
  installation.


CMake Warning at CMakeLists.txt:530 (message):
  OpenGL 4.3 was not found : support for GLSL compute shader kernels will be
  disabled in Osd.  If you have an OpenGL SDK installed (version 4.3 or
  above), please refer to the FindOpenGL.cmake shared module in your cmake
  installation.


CMake Error at glLoader/CMakeLists.txt:40 (include_directories):
  include_directories given empty-string as include directory.


-- Configuring incomplete, errors occurred!

I tried fixing it with commit cf96302 & it worked... almost!
Alas, building that configuration was unsuccessful:

Click To Expand
$ sudo cmake --build .

.....
Build description signature: f4c3c571e8516803689c6afa721872b2
Build description path: /Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/build/XCBuildData/f4c3c571e8516803689c6afa721872b2.xcbuilddata
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. bfr_tutorial_3_1 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'bfr_tutorial_3_1' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. far_tutorial_5_2 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'far_tutorial_5_2' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. far_tutorial_5_1 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'far_tutorial_5_1' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. far_tutorial_3_1 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'far_tutorial_3_1' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. bfr_tutorial_1_5 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'bfr_tutorial_1_5' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. far_perf doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'far_perf' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. bfr_tutorial_2_1 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'bfr_tutorial_2_1' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. far_tutorial_5_3 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'far_tutorial_5_3' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. bfr_tutorial_1_1 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'bfr_tutorial_1_1' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. hbr_tutorial_0 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'hbr_tutorial_0' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. far_tutorial_2_3 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'far_tutorial_2_3' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. far_tutorial_4_2 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'far_tutorial_4_2' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. bfr_tutorial_1_4 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'bfr_tutorial_1_4' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. hbr_tutorial_2 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'hbr_tutorial_2' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. far_tutorial_1_2 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'far_tutorial_1_2' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. far_tutorial_2_1 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'far_tutorial_2_1' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. far_tutorial_2_2 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'far_tutorial_2_2' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. bfr_tutorial_3_2 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'bfr_tutorial_3_2' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. far_tutorial_4_1 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'far_tutorial_4_1' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. bfr_evaluate doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'bfr_evaluate' from project 'OpenSubdiv')
note: Run script build phase 'CMake PostBuild Rules' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'osd_static_framework' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. far_regression doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'far_regression' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. bfr_tutorial_1_3 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'bfr_tutorial_1_3' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. far_tutorial_4_3 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'far_tutorial_4_3' from project 'OpenSubdiv')
note: Run script build phase 'Generate CMakeFiles/ALL_BUILD' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ALL_BUILD' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. bfr_tutorial_2_2 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'bfr_tutorial_2_2' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. hbr_regression doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'hbr_regression' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. osd_tutorial_0 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'osd_tutorial_0' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. bfr_tutorial_1_2 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'bfr_tutorial_1_2' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. hbr_tutorial_1 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'hbr_tutorial_1' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Signing for "mtlViewer" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'mtlViewer' from project 'OpenSubdiv')
note: Run script build phase 'CMake PostBuild Rules' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'osd_dynamic_framework' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. far_tutorial_1_1 doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'far_tutorial_1_1' from project 'OpenSubdiv')
/Users/alaa/Developer/Git/Contribution/iOS_Port/OpenSubdiv/build/OpenSubdiv.xcodeproj: error: Bundle identifier is missing. hbr_baseline doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'hbr_baseline' from project 'OpenSubdiv')
** BUILD FAILED **
@Treata11
Copy link
Author

Well I've managed to get around the code-signing / bundle-identification issues with the following flag
(-- CODE_SIGNING_ALLOWED=NO):

SDKROOT=$(xcrun --sdk iphoneos --show-sdk-path) cmake -D NO_PTEX=1 -D NO_DOC=1 \
   -D NO_OMP=1 -D NO_TBB=1 -D NO_CUDA=1 -D NO_OPENCL=1 -D NO_CLEW=1 \
   -D CMAKE_TOOLCHAIN_FILE=../cmake/iOSToolchain.cmake \
      ..
cmake --build . -- CODE_SIGNING_ALLOWED=NO

But ran into a different issue:

[ 39%] Building CXX object opensubdiv/osd/CMakeFiles/osd_gpu_obj.dir/cpuGLVertexBuffer.cpp.o
/Users/.../OpenSubdiv/opensubdiv/osd/cpuGLVertexBuffer.cpp:25:10: fatal error: 'glLoader.h' file not found
   25 | #include "glLoader.h"
      |          ^~~~~~~~~~~~
1 error generated.
make[2]: *** [opensubdiv/osd/CMakeFiles/osd_gpu_obj.dir/cpuGLVertexBuffer.cpp.o] Error 1
make[1]: *** [opensubdiv/osd/CMakeFiles/osd_gpu_obj.dir/all] Error 2
make: *** [all] Error 2

@Treata11
Copy link
Author

Compilation is successful by setting the -D NO_OPENGL=1, essentially disabling OpenGL & relying on Metal instead.
If that doesn't interfere with the functionality of the framework, I would be happy to update the README.md.

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

No branches or pull requests

1 participant