Open Dimillian opened 5 years ago
Yes, but you'd need to ask one of the devs to give you a thorough breakdown of it. (I only remember that there was something...)
Well, I'll try tonight anyway, looking at dependencies, look like everything will link Ok on Mac. Maybe I'll have to tweaks code then.
Well, if you do get it to work, I know someone who might be interested in getting it. (Assuming he's still interested in the game... it's been a while since I talked to him about it, mostly because I never know when he has access to a Windows machine.)
There shouldn't be any major blockers for compiling on macOS, but the libraries in use had some issues of incompatible behavior, mostly around mouse interactions.
I've got it building on Mac, using brew libraries. Only issue I've found so far is that the mouse is invisible.
TLDR:
source/linux
to source/mac
gcc-ar
and gcc-ranlib
with ar
and ranlib
in makefiles
libpng
and glew
to match current versions in source/mac/Makefile
CC=g++-8 make -f source/mac/Makefile compile
./bin/osx64/StarRuler2.bin
It may be possible to switch from gcc-ar
and gcc-ranlib
to ar
and ranlib
with environment variables (AR=ar
, etc) however I haven't investigated this yet. This would avoid the need to change all the Makefiles.
End TLDR
For more details, the notes I made while working on this are pasted below:
Can install most dependencies using brew
brew install libpng zlib glew freetype libvorbis libogg libopenal
Dependencies which can’t be installed may not be strictly necessary
./source/linux/
Can fix initial Clang issues by setting environment variable NLTO
to some value
NLTO=1 make -f …
Next issue appears to be due to the lack of gcc-ar
in Clang.
./source/os/gcc/Makefile
Suggestion: Try compiling with GNU gcc. See if that fixes anything.
CC=g++-8 make -f …
gcc
seems very happy until it can’t find gcc-ar
(because brew calls it gcc-ar-8
)gcc-ar
appears to be missing liblto_plugin.so
ar
instead of gcc-ar
?gcc-ar…
gcc-ranlib
, but brew’s gcc-ranlib-8
is missing liblto_plugin.so
ranlib
instead of gcc-ranlib
?cmake
missing. Install with brew. (brew install cmake
)libpng
and glew
to match current versions in source/mac/Makefile
Success!!!
Now see if we can get it working with CLANG.
Got the game to run on macos as well -- thanks for the steps, @daviewales! Managed to simplify them quite a bit; just copy-paste the below in a terminal window in a directory with the source code.
Can other macos users confirm that the game runs?
# NOTE: ensure dependencies are installed.
# https://brew.sh/
brew install cmake freetype gcc glew libogg libpng libvorbis openal-soft zlib
# NOTE: create symlink aliases for missing executables.
mkdir -p "$HOME/bin"
ln -s "/usr/bin/ar" "$HOME/bin/gcc-ar"
ln -s "/usr/bin/ranlib" "$HOME/bin/gcc-ranlib"
# NOTE: set/add/override compiler and dependency paths.
export CC="g++-8"
export CXXFLAGS="-I$(brew --prefix libpng)/include -I$(brew --prefix glew)/include"
export LDFLAGS="-I$(brew --prefix libpng)/lib -L$(brew --prefix glew)/lib"
# NOTE: build using linux/macos makefile.
# NOTE: just ignore ld warnings about libpng/glew directories not found.
make -f "./source/linux/Makefile" compile
# NOTE: start the game!
./bin/osx64/StarRuler2.bin
The game starts, can click around in the menu, start to the tutorial etcetera. Didn't test gameplay yet.
./bin/osx64/StarRuler2.bin
terminal outputInitializing sound Initializing window system Loading engine settings Initializing OpenGL Engine Registering mods Starting 9 threads on 8 processors. Loading mod(s) OpenGL vendor 'ATI Technologies Inc.', renderer 'AMD Radeon R9 M370X OpenGL Engine' version '2.1 ATI-1.68.20' Loaded in 1.5 seconds libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile Shadow scripts: 347ms load, 3038ms compile libpng warning: iCCP: known incorrect sRGB profile Client scripts: 366ms load, 7034ms compile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: cHRM chunk does not match sRGB libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: cHRM chunk does not match sRGB Server scripts: 341ms load, 8053ms compile Loaded in 8.4 seconds libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: cHRM chunk does not match sRGB libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: cHRM chunk does not match sRGB libpng warning: iCCP: known incorrect sRGB profile Finished computing hulls in 12841.7ms Caught Segfault at 0x0 Stack trace: 0 StarRuler2.bin 0x0000000105c63a0d _Z11print_tracev + 29 1 ??? 0x00000001152f6bbf 0x0 + 4650396607 No active script context to log. Abort trap: 6
Excellent work! I knew there were a lot of ways to streamline it, but just haven't had the time.
I've noticed the retina scaling issue only occurs in windowed mode. But the cursor disappears in full screen mode! So we can't win, without having a serious look at the code.
I suspect we need to think carefully about the glfw
cursor mode.
Have a look at the output of
grep -rI cursor .
(Run from top level directory of project)
On 29 September 2018 2:36:15 am AEST, Joel Purra notifications@github.com wrote:
Got the game to run on macos as well -- thanks for the steps, @daviewales! Managed to simplify them quite a bit; just copy-paste the below in a terminal window in a directory with the source code.
Can other macos users confirm that the game runs?
# NOTE: ensure dependencies are installed. # https://brew.sh/ brew install cmake freetype gcc glew libogg libpng libvorbis openal-soft zlib # NOTE: create symlink aliases for missing executables. mkdir -p "$HOME/bin" ln -s "/usr/bin/ar" "$HOME/bin/gcc-ar" ln -s "/usr/bin/ranlib" "$HOME/bin/gcc-ranlib" # NOTE: set/add/override compiler and dependency paths. export CC="g++-8" export CXXFLAGS="-I$(brew --prefix libpng)/include -I$(brew --prefix glew)/include" export LDFLAGS="-I$(brew --prefix libpng)/lib -L$(brew --prefix glew)/lib" # NOTE: build using linux/macos makefile. # NOTE: just ignore ld warnings about libpng/glew directories not found. make -f "./source/linux/Makefile" compile # NOTE: start the game! ./bin/osx64/StarRuler2.bin
The game starts, can click around in the menu, start to the tutorial etcetera. Didn't test gameplay yet.
- The screen seems to be 1/4th of the size of the expected viewport.
- Might it be an issue with @2x/retina displays?
- Perhaps there's an easy enough patch for detecting/fixing it?
- The mouse pointer is visible, but due to the resized graphics the pointer "location" has a 2x scaled offset.
- The game crashes with a segfault upon exit, but it doesn't affect the experience.
./bin/osx64/StarRuler2.bin
terminal outputInitializing sound Initializing window system Loading engine settings Initializing OpenGL Engine Registering mods Starting 9 threads on 8 processors. Loading mod(s) OpenGL vendor 'ATI Technologies Inc.', renderer 'AMD Radeon R9 M370X OpenGL Engine' version '2.1 ATI-1.68.20' Loaded in 1.5 seconds libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile Shadow scripts: 347ms load, 3038ms compile libpng warning: iCCP: known incorrect sRGB profile Client scripts: 366ms load, 7034ms compile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: cHRM chunk does not match sRGB libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: cHRM chunk does not match sRGB Server scripts: 341ms load, 8053ms compile Loaded in 8.4 seconds libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: cHRM chunk does not match sRGB libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: cHRM chunk does not match sRGB libpng warning: iCCP: known incorrect sRGB profile Finished computing hulls in 12841.7ms Caught Segfault at 0x0 Stack trace: 0 StarRuler2.bin 0x0000000105c63a0d _Z11print_tracev + 29 1 ??? 0x00000001152f6bbf 0x0 + 4650396607 No active script context to log. Abort trap: 6-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/BlindMindStudios/StarRuler2-Source/issues/4#issuecomment-425493818
I didn't had time to look and the code and dependencies yet, but I was waiting for ages to play it natively on macOS.
Any blocker anyone already saw before I try to work on a compilation flow for macOs?