goldeneye-source / ges-code

GoldenEye: Source on SDK 2013
http://www.geshl2.com
GNU General Public License v3.0
200 stars 27 forks source link

Engine Error: Could not load library client... #15

Closed 0xBADEAFFE closed 7 years ago

0xBADEAFFE commented 9 years ago

I built ges successfully on linux but after launch I get this error: bildschirmfoto_2015-05-07_20-02-53 I hope somebody can help me.

jonathonracz commented 9 years ago

Go to the properties page for Source SDK Base 2013 Multiplayer, and under the "betas" tab opt-in for the "- upcoming" beta. Let me know if that doesn't fix it.

0xBADEAFFE commented 9 years ago

@jonathonracz I switched to the upcoming beta branch but the error is still there. Here is the gdb output:

Reading symbols from /run/media/vincent/xyz/SteamLibrary/steamapps/common/Source SDK Base 2013 Multiplayer/hl2_linux...(no debugging symbols found)...done.
Breakpoint 1 at 0x80486c6
Setting environment variable "LD_PRELOAD" to null value.
LD_PRELOAD = 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Breakpoint 1, 0x080486c6 in main ()
Argument list to give program being debugged when it is started is "-steam -game /run/media/vincent/xyz/SteamLibrary/steamapps/sourcemods/gesource".
(gdb) continue
Continuing.
SDL video target is 'x11'
SDL video target is 'x11'
This system supports the OpenGL extension GL_EXT_framebuffer_object.
This system supports the OpenGL extension GL_EXT_framebuffer_blit.
This system supports the OpenGL extension GL_EXT_framebuffer_multisample.
This system DOES NOT support the OpenGL extension GL_APPLE_fence.
This system supports the OpenGL extension GL_NV_fence.
This system supports the OpenGL extension GL_ARB_sync.
This system supports the OpenGL extension GL_EXT_draw_buffers2.
This system supports the OpenGL extension GL_EXT_bindable_uniform.
This system DOES NOT support the OpenGL extension GL_APPLE_flush_buffer_range.
This system supports the OpenGL extension GL_ARB_map_buffer_range.
This system supports the OpenGL extension GL_ARB_vertex_buffer_object.
This system supports the OpenGL extension GL_ARB_occlusion_query.
This system DOES NOT support the OpenGL extension GL_APPLE_texture_range.
This system DOES NOT support the OpenGL extension GL_APPLE_client_storage.
This system DOES NOT support the OpenGL extension GL_ARB_uniform_buffer.
This system supports the OpenGL extension GL_ARB_vertex_array_bgra.
This system supports the OpenGL extension GL_EXT_vertex_array_bgra.
This system supports the OpenGL extension GL_ARB_framebuffer_object.
This system DOES NOT support the OpenGL extension GL_GREMEDY_string_marker.
This system supports the OpenGL extension GL_ARB_debug_output.
This system supports the OpenGL extension GL_EXT_direct_state_access.
This system supports the OpenGL extension GL_NV_bindless_texture.
This system DOES NOT support the OpenGL extension GL_AMD_pinned_memory.
This system supports the OpenGL extension GL_EXT_framebuffer_multisample_blit_scaled.
This system supports the OpenGL extension GL_EXT_texture_sRGB_decode.
This system supports the OpenGL extension GL_NVX_gpu_memory_info.
This system DOES NOT support the OpenGL extension GL_ATI_meminfo.
This system supports the OpenGL extension GL_EXT_texture_compression_s3tc.
This system supports the OpenGL extension GL_EXT_texture_compression_dxt1.
This system DOES NOT support the OpenGL extension GL_ANGLE_texture_compression_dxt3.
This system DOES NOT support the OpenGL extension GL_ANGLE_texture_compression_dxt5.
This system supports the OpenGL extension GLX_EXT_swap_control_tear.
GL_NV_bindless_texture: DISABLED
GL_AMD_pinned_memory: DISABLED
GL_EXT_texture_sRGB_decode: AVAILABLE
Using breakpad crash handler
Setting breakpad minidump AppID = 243750
Forcing breakpad minidump interfaces to load
Looking up breakpad interfaces from steamclient
Calling BreakpadMiniDumpSystemInit
Looking up breakpad interfaces from steamclient
Calling BreakpadMiniDumpSystemInit
Steam_SetMinidumpSteamID:  Caching Steam ID:  xxxxxxxxxxxxxxxxx [API loaded yes]
Steam_SetMinidumpSteamID:  Setting Steam ID:  xxxxxxxxxxxxxxxxx
Did not detect any valid joysticks.
GL_NVX_gpu_memory_info: AVAILABLE
GL_ATI_meminfo: UNAVAILABLE
GL_NVX_gpu_memory_info: Total Dedicated: 2097152, Total Avail: 2097152, Current Avail: 1792576
GL_MAX_SAMPLES_EXT: 32
CShaderDeviceMgrBase::GetRecommendedConfigurationInfo: CPU speed: 5900 MHz, Processor: GenuineIntel
GlobalMemoryStatus: 4294967295
CShaderDeviceMgrBase::GetRecommendedConfigurationInfo: CPU speed: 5900 MHz, Processor: GenuineIntel
GlobalMemoryStatus: 4294967295
IDirect3DDevice9::Create: BackBufWidth: 1920, BackBufHeight: 1080, D3DFMT: 3, BackBufCount: 1, MultisampleType: 0, MultisampleQuality: 0
GL sampler object usage: ENABLED
GL prefer MapBufferRange: NO

 ##### swap interval = 0     swap limit = 1 #####
Could not load program cache file glbaseshaders.cfg
Could not find base GL shader cache file
Could not load program cache file glshaders.cfg
Could not find user GL shader cache file
Precache: Took 0 ms, Vertex 0, Pixel 0
[New Thread 0xf4464b40 (LWP 3436)]
[New Thread 0xf6f40b40 (LWP 3435)]

Program received signal SIGSEGV, Segmentation fault.
0xf304371b in ?? ()
   from /run/media/vincent/xyz/SteamLibrary/steamapps/common/Source SDK Base 2013 Multiplayer/bin/engine.so
(gdb) continue
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0xf304371b in ?? ()
   from /run/media/vincent/xyz/SteamLibrary/steamapps/common/Source SDK Base 2013 Multiplayer/bin/engine.so
(gdb) continue
Continuing.
No minidump written, nothing to upload.

Program received signal SIGSEGV, Segmentation fault.
0xf304371b in ?? ()
   from /run/media/vincent/xyz/SteamLibrary/steamapps/common/Source SDK Base 2013 Multiplayer/bin/engine.so
(gdb) continue
Continuing.
[Thread 0xf4464b40 (LWP 3436) exited]
[Thread 0xf6f40b40 (LWP 3435) exited]

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) 
droidmonkey commented 9 years ago

Make sure you are running the game using: https://github.com/goldeneye-source/ges-code/blob/develop/runges.sh

You have to define a GES_PATH environment variable that points to your sourcemods/gesource folder and a STEAMAPPS_PATH that points to the steamapps folder. Unfortunately Linux mods with external libraries are still borked because Valve doesn't map the bin directory in the moddir to load so's from.

0xBADEAFFE commented 9 years ago

I'm using runges.sh and definded both variables, the error is still present.

droidmonkey commented 9 years ago

Could be a permission issue, check to see which user owns the client.so and other libs that were deployed in the bin directory.

droidmonkey commented 9 years ago

I haven't built on Linux since I moved over to Fedora... unfortunately Valve prefers Debian distributions. I'll try to rebuild and deploy on my end to see if I experience the issue.

0xBADEAFFE commented 9 years ago

@droidmonkey Ok thanks! Maybe it's helpfull for you to reproduce my build procedure. I have modiefied some files to get everything compiled with 32 bit steamruntime on a 64 bit os: IMPORTANT: define STEAM_RUNTIME_ROOT ges-code-develop/runmake.sh

#!/bin/bash
# Set path to steam runtime sdk
export STEAM_RUNTIME_ROOT="yourpathtosteamruntime"

# Stop the script if we run into any errors
set -e

if ! [ -d "${STEAM_RUNTIME_ROOT}" ]; then
    echo "You need to set STEAM_RUNTIME_ROOT to a valid directory in order to compile!" >&2
    exit 2
fi

# Store away the PATH variable for restoration
OLD_PATH=$PATH

# Set our host and target architectures
if [ -z "${STEAM_RUNTIME_HOST_ARCH}" ]; then
if [ "$(uname -m)" == "i686" ]; then
    STEAM_RUNTIME_HOST_ARCH=i386
    elif [ "$(uname -m)" == "x86_64" ]; then
    STEAM_RUNTIME_HOST_ARCH=amd64
    else
    echo "Unknown target architecture: ${STEAM_RUNTIME_HOST_ARCH}"
    exit 1
    fi  
fi

if [ -z "$STEAM_RUNTIME_TARGET_ARCH" ]; then
  STEAM_RUNTIME_TARGET_ARCH=$STEAM_RUNTIME_HOST_ARCH
fi

#export STEAM_RUNTIME_HOST_ARCH
#export STEAM_RUNTIME_TARGET_ARCH

# Force 32 bit build
export STEAM_RUNTIME_TARGET_ARCH="i386"

echo "Host architecture set to $STEAM_RUNTIME_HOST_ARCH"
echo "Target architecture set to $STEAM_RUNTIME_TARGET_ARCH"

# Check if our runtime is valid
if [ ! -d "${STEAM_RUNTIME_ROOT}/runtime/${STEAM_RUNTIME_TARGET_ARCH}" ]; then
    echo "$0: ERROR: Couldn't find steam runtime directory" >&2
    echo "Do you need to run setup.sh to download the ${STEAM_RUNTIME_TARGET_ARCH} target?" >&2
    exit 2
fi

export PATH="${STEAM_RUNTIME_ROOT}/bin:$PATH"

echo

# Cleanup
echo "Cleanup..."
./clean.sh

echo

# Create Game Projects
echo "Create Game Projects..."
./creategameprojects.sh

echo

# Build Python while in our runtime environment
pushd "thirdparty/python3" > /dev/null
echo "Building Python..."
./build_python3.sh
popd > /dev/null

echo

# Build GE:S
echo "Building GE:S..."
make -f games.mak

#
chmod 0664 ./bin/mod_ges/client.so
chmod 0664 ./bin/mod_ges/server.so

# Deploy to GES_PATH if a valid directory
if [ -d "$GES_PATH/bin" ]; then
    echo "Deploying binaries to GES_PATH..."
    cp -v ./bin/mod_ges/client.so* $GES_PATH/bin/
    cp -v ./bin/mod_ges/server.so* $GES_PATH/bin/
    cp -v ./bin/mod_ges/libpython* $GES_PATH/bin/
else
    echo "Cannot deploy binaries since GES_PATH is unset or non-existant!"
fi

echo "Cleaning up..."
export PATH=$OLD_PATH

echo "GE:S Build Complete!"

ges-code-develop/clean.sh

rm -rf ./thirdparty/python3/ges_build/*
rm -rf ./bin/mod_ges/*
rm games.mak

ges-code-develop/thirdparty/python3/build_python3.sh

#!/bin/bash

if ! [ -d "./ges_build" ]; then
  mkdir ges_build
fi

pushd ges_build 1> /dev/null

# Only configure if we haven't done it yet
if ! [ -f "Makefile" ]; then
  LDFLAGS="-L ../Extras/lib32" ../configure --prefix=`pwd`/bin --enable-shared --build=i386-unknown-linux-gnu
else
  echo "No need to configure!"
  sleep 1
fi

if ! [ -f ./bin/lib/libpython3.4m.so.1.0 ]; then
  # Remove leftovers if they exist
  if [ -f "../Include/pyconfig.h" ]; then
    rm ../Include/pyconfig.h
  fi

  # Patch Makefile for steam runtime compile
  sed -i 's|Modules/zlibmodule.o: $(srcdir)/Modules/zlibmodule.c; $(CC) $(PY_CORE_CFLAGS)  -I$(prefix)/include -c $(srcdir)/Modules/zlibmodule.c -o Modules/zlibmodule.o|Modules/zlibmodule.o: $(srcdir)/Modules/zlibmodule.c; $(CC) $(PY_CORE_CFLAGS)  -I$(srcdir)/Modules/zlib -c $(srcdir)/Modules/zlibmodule.c -o Modules/zlibmodule.o|' Makefile
  #sed -i 's|Modules/zlibmodule$(SO):  Modules/zlibmodule.o; $(BLDSHARED)  Modules/zlibmodule.o  -L$(exec_prefix)/lib -lz  -o Modules/zlibmodule$(SO)|Modules/zlibmodule$(SO):  Modules/zlibmodule.o; $(BLDSHARED)  Modules/zlibmodule.o   -o Modules/zlibmodule$(SO)|' Makefile
  sed -i 's|LOCALMODLIBS=                          -L$(exec_prefix)/lib -lz |LOCALMODLIBS=                          -L$(exec_prefix)/lib -L$(srcdir)/Modules/zlib -lz |' Makefile 
  # -L$(srcdir)/Modules/zlib
  sed -i 's|Modules/zlibmodule$(SO):  Modules/zlibmodule.o; $(BLDSHARED)  Modules/zlibmodule.o  -L$(exec_prefix)/lib -lz  -o Modules/zlibmodule$(SO)|Modules/zlibmodule$(SO):  Modules/zlibmodule.o; $(BLDSHARED)  Modules/zlibmodule.o  -L$(exec_prefix)/lib -L$(srcdir)/Modules/zlib -lz -o Modules/zlibmodule$(SO)|' Makefile

  # Build zlib
  pushd .. 1> /dev/null
  if ! [ -f ./Modules/zlib/test/minigzip.c ]; then
  mkdir /Modules/zlib/test
  cp -v ./Modules/zlib/minigzip.c ./Modules/zlib/test/minigzip.c
  cp -v ./Modules/zlib/example.c ./Modules/zlib/test/example.c
  fi
  if ! [ -f ./Modules/zlib/libz.a ]; then
  pushd  Modules/zlib 1> /dev/null
  chmod +x configure
  ./configure
  make
  popd 1> /dev/null
  fi
  popd 1> /dev/null

  # Build Python
  make
  make install
else
  echo "No need to build Python!"
fi

echo "Deploying Python to build directories..."
sleep 1

# Link to the built pyconfig.h
ln -vfs ../ges_build/bin/include/python3.4m/pyconfig.h ../Include/pyconfig.h

# Copy the shared library (eventually deploys to $GES_PATH/bin)
cp -v ./bin/lib/libpython3.4m.so.1.0 ../../../bin/mod_ges/
chmod 0664 ../../../bin/mod_ges/libpython*

# Create a link to the library for gcc's use
ln -vfs ../../../bin/mod_ges/libpython3.4m.so.1.0 ../../../lib/ges/linux32/libpython3.so

popd 1> /dev/null

Also important: replace in steam runtime sdk .sh files the following part, if you are not using a debian based os:

if [ -z "${STEAM_RUNTIME_HOST_ARCH}" ]; then
...
fi

with:

if [ -z "${STEAM_RUNTIME_HOST_ARCH}" ]; then
if [ "$(uname -m)" == "i686" ]; then
    STEAM_RUNTIME_HOST_ARCH=i386
    elif [ "$(uname -m)" == "x86_64" ]; then
    STEAM_RUNTIME_HOST_ARCH=amd64
    else
    echo "Unknown target architecture: ${STEAM_RUNTIME_HOST_ARCH}"
    exit 1
    fi  
fi
0xBADEAFFE commented 9 years ago

@droidmonkey Now it starts without the error message (libfmodexL.so, libfmodex.so libs were missing). But now it crashes with following error:

 ##### swap interval = 0     swap limit = 1 #####
Could not load program cache file glbaseshaders.cfg
Could not find base GL shader cache file
Loaded program cache file "glshaders.cfg", total keyvalues: 52, total successfully linked: 52
Precache: Took 161 ms, Vertex 318, Pixel 437
ConVarRef mat_dxlevel doesn't point to an existing ConVar
server.so loaded for "GoldenEye: Source"
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
crash_20150512015241_1.dmp[17377]: Uploading dump (out-of-process)
/tmp/dumps/crash_20150512015241_1.dmp
./hl2.sh: Zeile 67: 17364 Abgebrochen             (Speicherabzug geschrieben) ${GAME_DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@"
droidmonkey commented 9 years ago

You need to checkout the python3 branch of the ges-python repo: https://github.com/goldeneye-source/ges-python/tree/python3

Check this out into gesource/python folder, we no longer put python under scripts.

Sorry, this should be documented somewhere.

0xBADEAFFE commented 9 years ago

Thanks, its now running! :+1: It should be also mentiont that you need the two fmodex libs.

0xBADEAFFE commented 9 years ago

There seems to be a problem with python when adding bots to the server:

RROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/run/media/vincent/xyz/SteamLibrary/steamapps/sourcemods/gesource/python/ges/AiManager.py", line 46, in CreateNPC
    npc = getattr( sys.modules[module], ident )( parent )
KeyError: 'Ai.bot_deathmatch'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/run/media/vincent/xyz/SteamLibrary/steamapps/sourcemods/gesource/python/lib/hashlib.py", line 210, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/run/media/vincent/xyz/SteamLibrary/steamapps/sourcemods/gesource/python/lib/hashlib.py", line 95, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/run/media/vincent/xyz/SteamLibrary/steamapps/sourcemods/gesource/python/ges/AiManager.py", line 46, in CreateNPC
    npc = getattr( sys.modules[module], ident )( parent )
KeyError: 'Ai.bot_deathmatch'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/run/media/vincent/xyz/SteamLibrary/steamapps/sourcemods/gesource/python/lib/hashlib.py", line 210, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/run/media/vincent/xyz/SteamLibrary/steamapps/sourcemods/gesource/python/lib/hashlib.py", line 95, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "/run/media/vincent/xyz/SteamLibrary/steamapps/sourcemods/gesource/python/ges/AiManager.py", line 46, in CreateNPC
    npc = getattr( sys.modules[module], ident )( parent )
KeyError: 'Ai.bot_deathmatch'
droidmonkey commented 9 years ago

This indicates that your build of the python library so is not correct. You are missing critical built-in modules (md5, etc in this case). I am not sure why that is happening, but I do know that building python can be rather tenuous because it does not use a modern compiler approach (ala CMake).

0xBADEAFFE commented 9 years ago

I've managed to get it working. First you need to symlink some .h files to steamruntime and after successfull compiling you need to copy the content of/ges-code-develop/thirdparty/python3/ges_build/build/lib.linux-x86_64-3.4/ to /steamapps/sourcemods/gesource/python/lib.

droidmonkey commented 7 years ago

This no longer applies with the new cmake build system that corrects all these issues.