Forums ยป Game Discussion ยป
Mac
Added by xet7 about 1 year ago
Hi,
I tried to build rpg on Mac M1 Big Sur.
Other dependencies than glvnd¶
Other dependencies I installed this way:
brew install cmake libx11 libxrandr libice \
libxext libsm libxrender libxau libxdmcp \
icu4c zlib automake libxinerama libxcursor \
libxi pkg-config
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
at-spi2-atk
==> Updated Formulae
Updated 65 formulae.
==> Renamed Formulae
grakn -> typedb
==> New Casks
flomo prisma-studio wolfram-player
kubenav usbimager
==> Updated Casks
Updated 32 casks.
Warning: Treating cmake as a formula. For the cask, use homebrew/cask/cmake
Warning: icu4c 69.1 is already installed and up-to-date.
To reinstall 69.1, run:
brew reinstall icu4c
Warning: pkg-config 0.29.2_3 is already installed and up-to-date.
To reinstall 0.29.2_3, run:
brew reinstall pkg-config
==> Downloading https://ghcr.io/v2/homebrew/core/cmake/manifests/3.20.3
#=#=# ##O#- # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/cmake/blobs/sha256:64f8e3
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
### ##### ####### ######### ############ ############## ################# #################### ####################### ########################## ############################## ################################# ##################################### ######################################### ############################################## ################################################## ####################################################### ############################################################ ################################################################## ######################################################################## 100.0%
==> Pouring cmake--3.20.3.arm64_big_sur.bottle.tar.gz
==> Caveats
Emacs Lisp files have been installed to:
/opt/homebrew/share/emacs/site-lisp/cmake
==> Summary
๐บ /opt/homebrew/Cellar/cmake/3.20.3: 6,468 files, 67.7MB
==> Downloading https://ghcr.io/v2/homebrew/core/libpthread-stubs/manifest
#=#=# ##O#- # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libpthread-stubs/blobs/sh
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/xorgproto/manifests/2021.
#=#=# ##O#- # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/xorgproto/blobs/sha256:e7
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libxau/manifests/1.0.9
#=#=# ##O#- # ##O=# # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libxau/blobs/sha256:c2663
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libxdmcp/manifests/1.1.3
#=#=# ##O#- # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libxdmcp/blobs/sha256:6c1
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libxcb/manifests/1.14_1-1
#=#=# ##O#- # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libxcb/blobs/sha256:5ffb8
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libx11/manifests/1.7.1
#=#=# ##O#- # ##O=# # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libx11/blobs/sha256:4228b
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
###################### #################################### ##################################################### ###################################################################### ######################################################################## 100.0%
==> Installing dependencies for libx11: libpthread-stubs, xorgproto, libxau, libxdmcp and libxcb
==> Installing libx11 dependency: libpthread-stubs
==> Pouring libpthread-stubs--0.4.arm64_big_sur.bottle.tar.gz
๐บ /opt/homebrew/Cellar/libpthread-stubs/0.4: 5 files, 6.9KB
==> Installing libx11 dependency: xorgproto
==> Pouring xorgproto--2021.4.all.bottle.tar.gz
๐บ /opt/homebrew/Cellar/xorgproto/2021.4: 264 files, 3.9MB
==> Installing libx11 dependency: libxau
==> Pouring libxau--1.0.9.arm64_big_sur.bottle.tar.gz
๐บ /opt/homebrew/Cellar/libxau/1.0.9: 20 files, 136.0KB
==> Installing libx11 dependency: libxdmcp
==> Pouring libxdmcp--1.1.3.arm64_big_sur.bottle.tar.gz
๐บ /opt/homebrew/Cellar/libxdmcp/1.1.3: 11 files, 142KB
==> Installing libx11 dependency: libxcb
==> Pouring libxcb--1.14_1.arm64_big_sur.bottle.1.tar.gz
๐บ /opt/homebrew/Cellar/libxcb/1.14_1: 2,452 files, 7.3MB
==> Installing libx11
==> Pouring libx11--1.7.1.arm64_big_sur.bottle.tar.gz
๐บ /opt/homebrew/Cellar/libx11/1.7.1: 1,055 files, 7.1MB
==> Downloading https://ghcr.io/v2/homebrew/core/libxext/manifests/1.3.4
#=#=# ##O#- # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libxext/blobs/sha256:24e4
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libxrender/manifests/0.9.
#=#=# ##O#- # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libxrender/blobs/sha256:4
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libxrandr/manifests/1.5.2
#=#=# ##O#- # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libxrandr/blobs/sha256:57
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
######################################################################## 100.0%
==> Installing dependencies for libxrandr: libxext and libxrender
==> Installing libxrandr dependency: libxext
==> Pouring libxext--1.3.4.arm64_big_sur.bottle.tar.gz
๐บ /opt/homebrew/Cellar/libxext/1.3.4: 87 files, 440.0KB
==> Installing libxrandr dependency: libxrender
==> Pouring libxrender--0.9.10.arm64_big_sur.bottle.tar.gz
๐บ /opt/homebrew/Cellar/libxrender/0.9.10: 12 files, 186.4KB
==> Installing libxrandr
==> Pouring libxrandr--1.5.2.arm64_big_sur.bottle.tar.gz
๐บ /opt/homebrew/Cellar/libxrandr/1.5.2: 26 files, 222KB
==> Downloading https://ghcr.io/v2/homebrew/core/libice/manifests/1.0.10
#=#=# ##O#- # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libice/blobs/sha256:647f1
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
######################################################################## 100.0%
==> Pouring libice--1.0.10.arm64_big_sur.bottle.tar.gz
๐บ /opt/homebrew/Cellar/libice/1.0.10: 16 files, 342.9KB
==> Downloading https://ghcr.io/v2/homebrew/core/libsm/manifests/1.2.3
#=#=# ##O#- # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libsm/blobs/sha256:cea6bf
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
######################################################################## 100.0%
==> Pouring libsm--1.2.3.arm64_big_sur.bottle.tar.gz
๐บ /opt/homebrew/Cellar/libsm/1.2.3: 13 files, 195.1KB
==> Downloading https://ghcr.io/v2/homebrew/core/zlib/manifests/1.2.11
#=#=# ##O#- # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/zlib/blobs/sha256:b480ed6
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
######################################################################## 100.0%
==> Pouring zlib--1.2.11.arm64_big_sur.bottle.tar.gz
==> Caveats
zlib is keg-only, which means it was not symlinked into /opt/homebrew,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
For compilers to find zlib you may need to set:
export LDFLAGS="-L/opt/homebrew/opt/zlib/lib"
export CPPFLAGS="-I/opt/homebrew/opt/zlib/include"
For pkg-config to find zlib you may need to set:
export PKG_CONFIG_PATH="/opt/homebrew/opt/zlib/lib/pkgconfig"
==> Summary
๐บ /opt/homebrew/Cellar/zlib/1.2.11: 12 files, 430.2KB
==> Downloading https://ghcr.io/v2/homebrew/core/automake/manifests/1.16.3
#=#=# ##O#- # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/automake/blobs/sha256:916
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
######################################################################## 100.0%
==> Pouring automake--1.16.3_1.arm64_big_sur.bottle.tar.gz
๐บ /opt/homebrew/Cellar/automake/1.16.3_1: 131 files, 3.4MB
==> Downloading https://ghcr.io/v2/homebrew/core/libxinerama/manifests/1.1
#=#=# ##O#- # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libxinerama/blobs/sha256:
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
######################################################################## 100.0%
==> Pouring libxinerama--1.1.4.arm64_big_sur.bottle.tar.gz
๐บ /opt/homebrew/Cellar/libxinerama/1.1.4: 16 files, 115.2KB
==> Downloading https://ghcr.io/v2/homebrew/core/libxfixes/manifests/6.0.0
#=#=# ##O#- # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libxfixes/blobs/sha256:96
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libxcursor/manifests/1.2.
#=#=# ##O#- # ##O=# # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libxcursor/blobs/sha256:d
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
######################################################################## 100.0%
==> Installing dependencies for libxcursor: libxfixes
==> Installing libxcursor dependency: libxfixes
==> Pouring libxfixes--6.0.0.arm64_big_sur.bottle.tar.gz
๐บ /opt/homebrew/Cellar/libxfixes/6.0.0: 12 files, 133.3KB
==> Installing libxcursor
==> Pouring libxcursor--1.2.0.arm64_big_sur.bottle.tar.gz
๐บ /opt/homebrew/Cellar/libxcursor/1.2.0: 43 files, 199.4KB
==> Downloading https://ghcr.io/v2/homebrew/core/libxi/manifests/1.7.10
#=#=# ##O#- # ######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libxi/blobs/sha256:59e524
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/bl
######################################################################## 100.0%
==> Pouring libxi--1.7.10.arm64_big_sur.bottle.tar.gz
๐บ /opt/homebrew/Cellar/libxi/1.7.10: 84 files, 664.5KB
==> Caveats
==> cmake
Emacs Lisp files have been installed to:
/opt/homebrew/share/emacs/site-lisp/cmake
==> zlib
zlib is keg-only, which means it was not symlinked into /opt/homebrew,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
For compilers to find zlib you may need to set:
export LDFLAGS="-L/opt/homebrew/opt/zlib/lib"
export CPPFLAGS="-I/opt/homebrew/opt/zlib/include"
For pkg-config to find zlib you may need to set:
export PKG_CONFIG_PATH="/opt/homebrew/opt/zlib/lib/pkgconfig"
glvnd¶
There does not seem to be prebuild dependency for libglvnd-dev,
there is this issue related to it:
https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/216
Repo is at:
https://gitlab.freedesktop.org/glvnd/libglvnd
I tried to start building libglvnd this way:
% ./autogen.sh autoreconf: export WARNINGS= autoreconf: Entering directory '.' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force -I m4 autoreconf: configure.ac: tracing autoreconf: configure.ac: not using Libtool autoreconf: configure.ac: not using Intltool autoreconf: configure.ac: not using Gtkdoc autoreconf: running: /opt/homebrew/Cellar/autoconf/2.71/bin/autoconf --force configure.ac:11: warning: The macro `AC_CANONICAL_SYSTEM' is obsolete. configure.ac:11: You should run autoupdate. ./lib/autoconf/general.m4:2081: AC_CANONICAL_SYSTEM is expanded from... configure.ac:11: the top level configure.ac:23: warning: The macro `AC_PROG_CC_C99' is obsolete. configure.ac:23: You should run autoupdate. ./lib/autoconf/c.m4:1659: AC_PROG_CC_C99 is expanded from... configure.ac:23: the top level configure.ac:28: error: possibly undefined macro: AC_PROG_LIBTOOL If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure.ac:31: error: possibly undefined macro: AC_PROG_NM autoreconf: error: /opt/homebrew/Cellar/autoconf/2.71/bin/autoconf failed with exit status: 1 % autoupdate configure.ac:23: warning: AC_PROG_CC_C99 is obsolete; use AC_PROG_CC
Building rpg¶
% cmake -DCMAKE_BUILD_TYPE=Debug .. -- The CXX compiler identification is AppleClang 12.0.5.12050022 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Compiling these dependencies: /Users/WekanTeam/repos/rpg/build/deps/lib/libglfw3.a;/Users/WekanTeam/repos/rpg/build/deps/lib/OGRE/libRenderSystem_GL3PlusStatic.a;/Users/WekanTeam/repos/rpg/build/deps/lib/OGRE/libPlugin_PCZSceneManagerStatic.a;/Users/WekanTeam/repos/rpg/build/deps/lib/OGRE/libPlugin_ParticleFXStatic.a;/Users/WekanTeam/repos/rpg/build/deps/lib/OGRE/libPlugin_OctreeZoneStatic.a;/Users/WekanTeam/repos/rpg/build/deps/lib/OGRE/libPlugin_OctreeSceneManagerStatic.a;/Users/WekanTeam/repos/rpg/build/deps/lib/OGRE/libPlugin_BSPSceneManagerStatic.a;/Users/WekanTeam/repos/rpg/build/deps/lib/OGRE/libCodec_STBIStatic.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libOgreVolumeStatic.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libOgreTerrainStatic.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libOgreRTShaderSystemStatic.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libOgrePropertyStatic.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libOgrePagingStatic.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libOgreOverlayStatic.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libOgreMeshLodGeneratorStatic.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libOgreGLSupportStatic.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libOgreMainStatic.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libzzip-0.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libharfbuzz.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libfreetype.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libharfbuzz-icu.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libharfbuzz.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libicui18n.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libicuuc.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libicudata.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libpng16.a;/Users/WekanTeam/repos/rpg/build/deps/lib/libz.a -- Found X11: /opt/homebrew/include -- Looking for XOpenDisplay in /opt/homebrew/lib/libX11.dylib;/opt/homebrew/lib/libXext.dylib -- Looking for XOpenDisplay in /opt/homebrew/lib/libX11.dylib;/opt/homebrew/lib/libXext.dylib - found -- Looking for gethostbyname -- Looking for gethostbyname - found -- Looking for connect -- Looking for connect - found -- Looking for remove -- Looking for remove - found -- Looking for shmat -- Looking for shmat - found -- Looking for IceConnectionNumber in ICE -- Looking for IceConnectionNumber in ICE - found -- Looking for C++ include pthread.h -- Looking for C++ include pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE CMake Error at /opt/homebrew/Cellar/cmake/3.20.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find OpenGL (missing: GLX) Call Stack (most recent call first): /opt/homebrew/Cellar/cmake/3.20.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) /opt/homebrew/Cellar/cmake/3.20.3/share/cmake/Modules/FindOpenGL.cmake:443 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:93 (find_package) -- Configuring incomplete, errors occurred! See also "/Users/WekanTeam/repos/rpg/build/CMakeFiles/CMakeOutput.log". See also "/Users/WekanTeam/repos/rpg/build/CMakeFiles/CMakeError.log".
Attached are those CMake logs.
CMakeError.log (348 Bytes) CMakeError.log | |||
CMakeOutput.log (30.6 KB) CMakeOutput.log |
Replies (5)
RE: Mac
-
Added by quintus about 1 year ago
The game code currently only supports Linux.
Our X11 dependencies only come from glfw, which depends on X11 on Linux. On MacOS is does not depend on X11, hence you don't even need any of the X11 stuff on MacOS. I suppose you don't even need libglvnd. This is because glfw, our window library, has different dependencies depending on the platform it is installed on. You will need to install whatever glfw requires for MacOS; for that, refer to glfw's online docs, see here. It seems to be pretty easy. glfw itself is built as part of the compilation process so you don't need to do anything beyond installing its dependencies.
The game code however will need modifications. You will first have to adapt CMakeLists.txt and add a Mac-specific section in which you replace the search for X11 with a search glfw's for MacOS dependencies. Once you have completed that, the build process for the game should go through until the final rpg
target, which is the game itself. This target will fail to compile, because the source code contains OS-specific sections marked with #ifdef
. I am taking great care to have each and every OS-specific section end with an #else
clause that contains an #error
directive to make compilation fail. This way, you can resolve each OS-specific section one by one by adding the required MacOS-spsecific code.
In fact, this time I have been careful about the compilation process. glfw's dependencies are nearly the only things one needs to install when compiling the code.
-quintus
RE: Mac
-
Added by quintus about 1 year ago
I have now made the required changes to CMakeLists.txt. It should now work for MacOS (and Win32). On MacOS, for glfw it is necessary and sufficient to install XCode. You don't need X11, glvnd, or anything else. Just XCode.
Please try again after installing XCode; it should now compile until the rpg
target (which will in turn fail, see above).
If a dependency fails to compile, it could be due to the fact you're using one of these new-fangled M1 macs. You might be out for filing some bugs against the dependencies then.
-quintus
RE: Mac
-
Added by SiggyPop about 1 year ago
Good idea, xet7, :)
to make the game available for other platforms as well! How about Windows? Most of the really good games are mostly available on Windows. - That will of course cause problems with the code ...
Yours,
SiggyPop. ;>)
RE: Mac
-
Added by xet7 about 1 year ago
rpg uses Ogre. Ogre supports Windows, Mac, Linux, Android, iOS https://www.ogre3d.org/about/features . To support anything other than Linux, it needs some testing and additional code to support it. It's not like it would be any "problem", it just takes time to figure out. For M1, it's so new hardware so it could be that not all dependencies work yet, but there is progress being made by some of those dependency authors. Also, this rpg game is at very beginning stages, it's just testing for basic controls, it's not a playable game yet, so there is time to add support for Ogre supported OSes.
BR,
xet7