Trouble building ogre-next-deps Topic is solved

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
jwwalker
Goblin
Posts: 224
Joined: Thu Aug 12, 2021 10:06 pm
Location: San Diego, CA, USA
x 17
Contact:

Trouble building ogre-next-deps

Post by jwwalker »

I'm trying to build Ogre-Next-Deps, and I first tried it using the CMake GUI, version 3.23.2, on macOS 12.4. I select the source and build directories, click Configure, choose Xcode as the generator, and there are immediate errors:

The C compiler identification is unknown
The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_C_COMPILER could be found.

CMake Error at CMakeLists.txt:3 (project):
No CMAKE_CXX_COMPILER could be found.

So then I tried going the command line route. This time, cmake succeeds, but make fails:

Code: Select all

[  1%] Building CXX object src/FreeImage/CMakeFiles/FreeImage.dir/Source/FreeImage/BitmapAccess.cpp.o
clang: error: invalid arch name '-arch -isysroot'
clang: warning: /Applications/Xcode14-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk: 'linker' input unused [-Wunused-command-line-argument]
make[2]: *** [src/FreeImage/CMakeFiles/FreeImage.dir/Source/FreeImage/BitmapAccess.cpp.o] Error 1
make[1]: *** [src/FreeImage/CMakeFiles/FreeImage.dir/all] Error 2
make: *** [all] Error 2

Any hints?

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: Trouble building ogre-next-deps

Post by dark_sylinc »

We provide build scripts for iOS and macOS now.

The following works for me on x86 macs (assuming XCode is installed):

Code: Select all

mkdir Ogre
cd Ogre

mkdir ogre-next-deps
echo "--- Cloning ogre-next-deps ---"
git clone --recurse-submodules --shallow-submodules https://github.com/OGRECave/ogre-next-deps

cd ogre-next-deps
mkdir build
cd build
cmake -G Xcode ..
cmake --build . --target install --config Debug
cmake --build . --target install --config RelWithDebInfo

If you just installed or updated XCode, make sure to launch it first at least once.

If this still gives you errors; perhaps you need to call xcode-select.

For what I've heard, M1 build should also be working (I can't test it) and we recently received a patch for it.

jwwalker
Goblin
Posts: 224
Joined: Thu Aug 12, 2021 10:06 pm
Location: San Diego, CA, USA
x 17
Contact:

Re: Trouble building ogre-next-deps

Post by jwwalker »

Thanks! My selected version of Xcode was a beta of Xcode 14. With that, cmake -G Xcode .. again gave an error about being unable to find a compiler. When I switched to Xcode 13.4.1, the error went away, and OGREDEPS.xcodeproj was generated.

When I went to do an ALL_BUILD of the dependencies, using Xcode 13.4.1, it all worked except for SDL2. The SDL2-configure shell script phase fails, with messages including:

Code: Select all


Showing All Messages
-- Check for working CXX compiler: /Applications/Xcode13.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - broken

CMake Error at /usr/local/Cellar/cmake/3.23.2/share/cmake/Modules/CMakeTestCXXCompiler.cmake:62 (message):

  The C++ compiler



    "/Applications/Xcode13.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"



  is not able to compile a simple test program.



  It fails with the following output:



    Change Dir: /Volumes/Work/git-repos/ogre-next-deps/build/src/SDL2-prefix/src/SDL2-build/CMakeFiles/CMakeTmp

    

    Run Build Command(s):/Applications/Xcode13.4.1.app/Contents/Developer/usr/bin/xcodebuild -project CMAKE_TRY_COMPILE.xcodeproj build -target cmTC_50821 -parallelizeTargets -configuration Debug -hideShellScriptEnvironment && 2022-06-24 16:04:19.292 xcodebuild[20871:18164994] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore

    2022-06-24 16:04:19.293 xcodebuild[20871:18164994] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore

    Command line invocation:

        /Applications/Xcode13.4.1.app/Contents/Developer/usr/bin/xcodebuild -project CMAKE_TRY_COMPILE.xcodeproj build -target cmTC_50821 -parallelizeTargets -configuration Debug -hideShellScriptEnvironment

    

    User defaults from command line:

        HideShellScriptEnvironment = YES

        IDEPackageSupportUseBuiltinSCM = YES

    

    Build settings from command line:

        TOOLCHAINS = com.apple.dt.toolchain.XcodeDefault
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: Trouble building ogre-next-deps

Post by dark_sylinc »

jwwalker wrote: Sat Jun 25, 2022 12:15 am

Thanks! My selected version of Xcode was a beta of Xcode 14. With that, cmake -G Xcode .. again gave an error about being unable to find a compiler. When I switched to Xcode 13.4.1, the error went away, and OGREDEPS.xcodeproj was generated.

Ahh, you just had a too recent XCode version. So CMake doesn't know to look for it.

jwwalker wrote: Sat Jun 25, 2022 12:15 am

When I went to do an ALL_BUILD of the dependencies, using Xcode 13.4.1, it all worked except for SDL2. The SDL2-configure shell script phase fails, with messages including:

Mmmm that's possible. Maybe you just need to clear the build folder if it already had garbage from back then with XCode 14.
Otherwise disable SDL2 build and use brew to install SDL2 (that was what we were doing until literally a few days ago; getting SDL2 to build with CMake in macOS is a major PITA)

jwwalker
Goblin
Posts: 224
Joined: Thu Aug 12, 2021 10:06 pm
Location: San Diego, CA, USA
x 17
Contact:

Re: Trouble building ogre-next-deps

Post by jwwalker »

I tried again with a whole new build folder, all using the command line steps, and it still fails on SDL:

Code: Select all

** BUILD FAILED **


The following build commands failed:
	PhaseScriptExecution Generate\ src/SDL2-prefix/src/SDL2-stamp/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/SDL2-configure /Volumes/Work/git-repos/ogre-next-deps/build/src/OGREDEPS.build/Debug/SDL2.build/Script-2245076968F1302272FF43E2.sh (in target 'SDL2' from project 'OGREDEPS')
(1 failure)

So I'll stop worrying about making SDL2 with Ogre-Next-Deps and use brew. Thanks again.

Post Reply