OpenXRay / xray-16

Improved version of the X-Ray Engine, the game engine used in the world-famous S.T.A.L.K.E.R. game series by GSC Game World. Join OpenXRay! ;)
https://discord.gg/sjRMQwv
Other
2.9k stars 455 forks source link

Build error on macOS arm64 #1649

Closed naymapl closed 2 days ago

naymapl commented 3 months ago

Hello. I try to build macOS version form arm64 but always got error aat 66%. Do you have any idea what is wrong? Thank you so much for any help.

[ 66%] Linking CXX shared library /Users/naymapl/xray-16/bin/arm64/Release/xrSound.dylib
ld: warning: ignoring duplicate libraries: '/Users/naymapl/xray-16/bin/arm64/Release/libxrMiscMath.a'
ld: warning: ignoring file '/Library/Frameworks/OpenAL.framework/Versions/A/OpenAL': fat file missing arch 'arm64', file has 'i386,x86_64'
ld: warning: ignoring file '/Library/Frameworks/ogg.framework/Versions/A/ogg': fat file missing arch 'arm64', file has 'i386,x86_64'
ld: warning: ignoring file '/Library/Frameworks/vorbis.framework/Versions/A/vorbis': fat file missing arch 'arm64', file has 'i386,x86_64'
ld: warning: ignoring file '/Library/Frameworks/vorbisfile.framework/Versions/A/vorbisfile': fat file missing arch 'arm64', file has 'i386,x86_64'
Undefined symbols for architecture arm64:
  "_alBufferData", referenced from:
      CSoundRender_TargetA::update() in lto.o
      CSoundRender_TargetA::submit_all_buffers() const in lto.o
      CSoundRender_TargetA::submit_all_buffers() const in lto.o
      CSoundRender_TargetA::submit_all_buffers() const in lto.o
      CSoundRender_TargetA::submit_all_buffers() const in lto.o
      CSoundRender_TargetA::submit_all_buffers() const in lto.o
      CSoundRender_TargetA::submit_buffer(unsigned int, void const*, unsigned long) const in lto.o
      ...
  "_alDeleteBuffers", referenced from:
      CSoundRender_TargetA::_destroy() in lto.o
  "_alDeleteSources", referenced from:
      CSoundRender_TargetA::_destroy() in lto.o
  "_alGenBuffers", referenced from:
      CSoundRender_TargetA::_initialize() in lto.o
  "_alGenSources", referenced from:
      CSoundRender_TargetA::_initialize() in lto.o
  "_alGetError", referenced from:
      CSoundRender_TargetA::_initialize() in lto.o
      CSoundRender_TargetA::update() in lto.o
      CSoundRender_TargetA::update() in lto.o
      CSoundRender_TargetA::update() in lto.o
      CSoundRender_CoreA::_initialize() in lto.o
  "_alGetSourcei", referenced from:
      CSoundRender_TargetA::update() in lto.o
      CSoundRender_TargetA::update() in lto.o
      CSoundRender_TargetA::update() in lto.o
  "_alGetString", referenced from:
      CSoundRender_TargetA::_initialize() in lto.o
  "_alIsExtensionPresent", referenced from:
      CSoundRender_CoreA::_initialize() in lto.o
      CSoundRender_CoreA::_initialize() in lto.o
      ALDeviceList::IterateAndAddDevicesString(char const*) in lto.o
      ALDeviceList::IterateAndAddDevicesString(char const*) in lto.o
      ALDeviceList::IterateAndAddDevicesString(char const*) in lto.o
      ALDeviceList::IterateAndAddDevicesString(char const*) in lto.o
  "_alIsSource", referenced from:
      CSoundRender_TargetA::_destroy() in lto.o
  "_alListener3f", referenced from:
      CSoundRender_CoreA::_initialize() in lto.o
      CSoundRender_CoreA::_initialize() in lto.o
      CSoundRender_CoreA::update_listener(_vector3<float> const&, _vector3<float> const&, _vector3<float> const&, _vector3<float> const&, float) in lto.o
      CSoundRender_CoreA::update_listener(_vector3<float> const&, _vector3<float> const&, _vector3<float> const&, _vector3<float> const&, float) in lto.o
  "_alListenerf", referenced from:
      CSoundRender_CoreA::set_master_volume(float) in lto.o
      CSoundRender_CoreA::_initialize() in lto.o
  "_alListenerfv", referenced from:
      CSoundRender_CoreA::_initialize() in lto.o
      CSoundRender_CoreA::update_listener(_vector3<float> const&, _vector3<float> const&, _vector3<float> const&, _vector3<float> const&, float) in lto.o
  "_alSource3f", referenced from:
      CSoundRender_TargetA::fill_parameters() in lto.o
  "_alSourcePlay", referenced from:
      CSoundRender_TargetA::render() in lto.o
      CSoundRender_TargetA::rewind() in lto.o
      CSoundRender_TargetA::update() in lto.o
  "_alSourceQueueBuffers", referenced from:
      CSoundRender_TargetA::render() in lto.o
      CSoundRender_TargetA::rewind() in lto.o
      CSoundRender_TargetA::update() in lto.o
  "_alSourceStop", referenced from:
      CSoundRender_TargetA::rewind() in lto.o
      CSoundRender_TargetA::stop() in lto.o
  "_alSourceUnqueueBuffers", referenced from:
      CSoundRender_TargetA::update() in lto.o
  "_alSourcef", referenced from:
      CSoundRender_TargetA::_initialize() in lto.o
      CSoundRender_TargetA::_initialize() in lto.o
      CSoundRender_TargetA::_initialize() in lto.o
      CSoundRender_TargetA::_initialize() in lto.o
      CSoundRender_TargetA::fill_parameters() in lto.o
      CSoundRender_TargetA::fill_parameters() in lto.o
      CSoundRender_TargetA::fill_parameters() in lto.o
      CSoundRender_TargetA::fill_parameters() in lto.o
      CSoundRender_TargetA::fill_parameters() in lto.o
      ...
  "_alSourcei", referenced from:
      CSoundRender_TargetA::_initialize() in lto.o
      CSoundRender_TargetA::rewind() in lto.o
      CSoundRender_TargetA::stop() in lto.o
      CSoundRender_TargetA::stop() in lto.o
      CSoundRender_TargetA::fill_parameters() in lto.o
  "_alcCloseDevice", referenced from:
      CSoundRender_CoreA::_initialize() in lto.o
      CSoundRender_CoreA::_clear() in lto.o
      ALDeviceList::IterateAndAddDevicesString(char const*) in lto.o
  "_alcCreateContext", referenced from:
      CSoundRender_CoreA::_initialize() in lto.o
      ALDeviceList::IterateAndAddDevicesString(char const*) in lto.o
  "_alcDestroyContext", referenced from:
      CSoundRender_CoreA::_clear() in lto.o
      ALDeviceList::IterateAndAddDevicesString(char const*) in lto.o
  "_alcGetError", referenced from:
      CSoundRender_CoreA::_initialize() in lto.o
  "_alcGetIntegerv", referenced from:
      ALDeviceList::IterateAndAddDevicesString(char const*) in lto.o
      ALDeviceList::IterateAndAddDevicesString(char const*) in lto.o
  "_alcGetString", referenced from:
      ALDeviceList::Enumerate() in lto.o
      ALDeviceList::Enumerate() in lto.o
      ALDeviceList::Enumerate() in lto.o
      ALDeviceList::Enumerate() in lto.o
      ALDeviceList::IterateAndAddDevicesString(char const*) in lto.o
  "_alcIsExtensionPresent", referenced from:
      ALDeviceList::Enumerate() in lto.o
      ALDeviceList::Enumerate() in lto.o
      ALDeviceList::IterateAndAddDevicesString(char const*) in lto.o
      ALDeviceList::IterateAndAddDevicesString(char const*) in lto.o
  "_alcMakeContextCurrent", referenced from:
      CSoundRender_CoreA::_initialize() in lto.o
      CSoundRender_CoreA::_clear() in lto.o
      ALDeviceList::IterateAndAddDevicesString(char const*) in lto.o
  "_alcOpenDevice", referenced from:
      CSoundRender_CoreA::_initialize() in lto.o
      ALDeviceList::IterateAndAddDevicesString(char const*) in lto.o
  "_ov_clear", referenced from:
      CSoundRender_Source::~CSoundRender_Source() in lto.o
      CSoundRender_Target::stop() in lto.o
      CSoundRender_Source::unload() in lto.o
      CSoundRender_Source::detach() in lto.o
      CSoundRender_Source::LoadWave(char const*, bool) in lto.o
      CSoundRender_Source::LoadWave(char const*, bool) in lto.o
      CSoundRender_Source::LoadWave(char const*, bool) in lto.o
      ...
  "_ov_comment", referenced from:
      CSoundRender_Source::LoadWave(char const*, bool) in lto.o
  "_ov_info", referenced from:
      CSoundRender_Source::LoadWave(char const*, bool) in lto.o
  "_ov_open_callbacks", referenced from:
      CSoundRender_Source::attach() in lto.o
  "_ov_pcm_seek", referenced from:
      CSoundRender_Source::decompress(void*, unsigned int, unsigned int) in lto.o
  "_ov_pcm_tell", referenced from:
      CSoundRender_Source::decompress(void*, unsigned int, unsigned int) in lto.o
  "_ov_pcm_total", referenced from:
      CSoundRender_Source::LoadWave(char const*, bool) in lto.o
  "_ov_read", referenced from:
      CSoundRender_Source::i_decompress(char*, unsigned int) in lto.o
  "_ov_read_float", referenced from:
      CSoundRender_Source::i_decompress(float*, unsigned int) in lto.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/naymapl/xray-16/bin/arm64/Release/xrSound.dylib] Error 1
make[1]: *** [src/xrSound/CMakeFiles/xrSound.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 66%] Built target xrScriptEngine
make: *** [all] Error 2
AMS21 commented 3 months ago

ld: warning: ignoring file '/Library/Frameworks/OpenAL.framework/Versions/A/OpenAL': fat file missing arch 'arm64', file has 'i386,x86_64'

Looks like your trying to link x86 code while building arm64 code. This likely causes the Undefined Symbols error later.

I have no experience with the macOS platform but you probably need the OpenAL library for arm64 from somewhere or explicitly tell CMake during configuration where to find the arm64 variant of OpenAL.

(Although it seems weird that on an arm64 machine you even have x86 libraries at all not sure)

naymapl commented 3 months ago

Ok - I delete x86 library and build fine. But when I try to open xr_3da file I always got error. Do you have any idea what is wrong?

! Couldn't create surface from image: Parameter 'src' is invalid
OpenXRay Release Master Gold build 9188, Apr  4 2024 (Apple ARM 64-bit, shared)
Custom build from commit[9f2e98c5421eee793c2ec9481c1460ed22947470] branch[dev]

command line

* CPU features: ARMSIMD, NEON
* CPU threads: 8

Initializing File System...
$fs_root$ = /Users/naymapl/Library/Application Support/GSC Game World/S.T.A.L.K.E.R. - Call of Pripyat/
using fs-ltx fsgame.ltx
FS: 38991 files cached 32 archives, 11776Kb memory used.
Init FileSystem 0.247497 sec
-----loading \Users\naymapl\Library\Application Support\GSC Game World\S.T.A.L.K.E.R. - Call of Pripyat\gamedata\configs\system.ltx
-----loading \Users\naymapl\Library\Application Support\GSC Game World\S.T.A.L.K.E.R. - Call of Pripyat\gamedata\configs\system.ltx
Starting INPUT device...
Loading module: xrRender_GL
Available render modes[1]:
renderer_rgl
Executing config-script "user.ltx"...
! Cannot open script file [user.ltx]
Selected renderer: renderer_rgl
Loading module: xrGame
Initializing Engine...
SOUND: OpenAL: system default sound device name is LG ULTRAFINE (eqMac)
Executing config-script "\Users\naymapl\Library\Application Support\GSC Game World\S.T.A.L.K.E.R. - Call of Pripyat\gamedata\configs\default_controls.ltx"...
[\Users\naymapl\Library\Application Support\GSC Game World\S.T.A.L.K.E.R. - Call of Pripyat\gamedata\configs\default_controls.ltx] successfully loaded.
Executing config-script "user.ltx"...
! Cannot open script file [user.ltx]
SOUND: Selected device is LG ULTRAFINE (eqMac)
Starting RENDER device...
* GPU vendor: [Apple] device: [Apple M1]
* GPU OpenGL version: 4.1 Metal - 88
* GPU OpenGL shading language version: 4.10
* GPU OpenGL VTF units: [16] CTI units: [80]
* DVB created: 4096K
* DIB created: 512K
! Renderer doesn't support blender 'effects\shadow_world'

FATAL ERROR

[error] Expression    : skinh
[error] Function      : CompatibilityCheck
[error] File          : /Users/naymapl/xray-16/src/Layers/xrRender/ResourceManager.cpp
[error] Line          : 274
[error] Description   : Can't open shader
[error] Arguments     : skin.h

stack trace:

xrDebug::GatherInfo(char*, unsigned long, ErrorLocation const&, char const*, char const*, char const*, char const*)
xrDebug::Fail(bool&, ErrorLocation const&, char const*, char const*, char const*, char const*)
CResourceManager::CompatibilityCheck()
D3DXRenderBase::OnDeviceCreate(char const*)
CRenderDevice::Create()
CApplication::CApplication(char const*)
6   xr_3da                              0x0000000102367c24 main + 256
7   dyld                                0x00000001987fa0e0 start + 2360
[1]  + 7644 trace trap  /Volumes/Macintosh\ HD/Users/naymapl/xray-16/bin/arm64/Release/xr_3da
Xottab-DUTY commented 3 months ago

Ok - I delete x86 library and build fine. But when I try to open xr_3da file I always got error. Do you have any idea what is wrong?

! Couldn't create surface from image: Parameter 'src' is invalid
OpenXRay Release Master Gold build 9188, Apr  4 2024 (Apple ARM 64-bit, shared)
Custom build from commit[9f2e98c5421eee793c2ec9481c1460ed22947470] branch[dev]

command line

* CPU features: ARMSIMD, NEON
* CPU threads: 8

Initializing File System...
$fs_root$ = /Users/naymapl/Library/Application Support/GSC Game World/S.T.A.L.K.E.R. - Call of Pripyat/
using fs-ltx fsgame.ltx
FS: 38991 files cached 32 archives, 11776Kb memory used.
Init FileSystem 0.247497 sec
-----loading \Users\naymapl\Library\Application Support\GSC Game World\S.T.A.L.K.E.R. - Call of Pripyat\gamedata\configs\system.ltx
-----loading \Users\naymapl\Library\Application Support\GSC Game World\S.T.A.L.K.E.R. - Call of Pripyat\gamedata\configs\system.ltx
Starting INPUT device...
Loading module: xrRender_GL
Available render modes[1]:
renderer_rgl
Executing config-script "user.ltx"...
! Cannot open script file [user.ltx]
Selected renderer: renderer_rgl
Loading module: xrGame
Initializing Engine...
SOUND: OpenAL: system default sound device name is LG ULTRAFINE (eqMac)
Executing config-script "\Users\naymapl\Library\Application Support\GSC Game World\S.T.A.L.K.E.R. - Call of Pripyat\gamedata\configs\default_controls.ltx"...
[\Users\naymapl\Library\Application Support\GSC Game World\S.T.A.L.K.E.R. - Call of Pripyat\gamedata\configs\default_controls.ltx] successfully loaded.
Executing config-script "user.ltx"...
! Cannot open script file [user.ltx]
SOUND: Selected device is LG ULTRAFINE (eqMac)
Starting RENDER device...
* GPU vendor: [Apple] device: [Apple M1]
* GPU OpenGL version: 4.1 Metal - 88
* GPU OpenGL shading language version: 4.10
* GPU OpenGL VTF units: [16] CTI units: [80]
* DVB created: 4096K
* DIB created: 512K
! Renderer doesn't support blender 'effects\shadow_world'

FATAL ERROR

[error] Expression    : skinh
[error] Function      : CompatibilityCheck
[error] File          : /Users/naymapl/xray-16/src/Layers/xrRender/ResourceManager.cpp
[error] Line          : 274
[error] Description   : Can't open shader
[error] Arguments     : skin.h

stack trace:

xrDebug::GatherInfo(char*, unsigned long, ErrorLocation const&, char const*, char const*, char const*, char const*)
xrDebug::Fail(bool&, ErrorLocation const&, char const*, char const*, char const*, char const*)
CResourceManager::CompatibilityCheck()
D3DXRenderBase::OnDeviceCreate(char const*)
CRenderDevice::Create()
CApplication::CApplication(char const*)
6   xr_3da                              0x0000000102367c24 main + 256
7   dyld                                0x00000001987fa0e0 start + 2360
[1]  + 7644 trace trap  /Volumes/Macintosh\ HD/Users/naymapl/xray-16/bin/arm64/Release/xr_3da

You didn't copied necessary gamedata files. Follow the portable installation step in Linux build instructions.

naymapl commented 3 months ago

Now I have missing file system.ltx in folder \Release\gamedata\configs\system.ltx. Zrzut ekranu 2024-04-5 o 12 12 15

Xottab-DUTY commented 3 months ago

You need to install game and it's files correctly. We only provide few modified files, but we don't provide entire game assets.

naymapl commented 3 months ago

I copy all folders fom GOG version of a game like on the instruction. Problem is somewhere else. I copy the gamedata directory and fsgame.ltx file from xray-16/res to game folder. But there is no system.ltx file.

Xottab-DUTY commented 3 months ago

system.ltx is packed inside game archives. So, it seems that something is wrong with the installation – engine can't find archives. Unfortunately, I don't have Mac and we don't have macOS-specific installation steps in our wiki (it should be same as for Linux, but there may be small exceptions). You probably need to find out this yourself :(

SquishyLeaf commented 3 months ago

@naymapl current dev branch builds and runs for me on macOS 14.4.1. Make sure you copied the required directories from your unpacked COP install (levels, localization, mp, patches, resources) into /Users/[your username]/Library/Application Support/GSC Game World/S.T.A.L.K.E.R. - Call of Pripyat.

shinra-electric commented 2 months ago

I think the OP fixed this, according to Discord. It was an issue with their setup

Can probably be closed.

Xottab-DUTY commented 2 days ago

Closed due to stale.