shinyquagsire23 / OpenJKDF2

A cross-platform reimplementation of JKDF2 in C
Other
487 stars 38 forks source link

Build_linux64 will not compile #287

Open JoshuaPettus opened 7 months ago

JoshuaPettus commented 7 months ago

Using Fedora 39 clang 17.0.3

First, following the build instructions given, I noticed the build script seems to ignore the system installed dynamic libraries and instead insists on downloading the submodule versions to statically link them. This is fine, but then why ask to download the dependencies in the package manager if you aren't using them?

The submodule init downloads the source for glew, sdl2, openal and the rest. Next I run the build script and it nearly completes but then fails at this finish with:

make[3]: *** No rule to make target 'SDL/lib/libSDL2.a', needed by 'openjkdf2'. Stop.

Of course the submodule download downloded the source for sdl2, and my system has the devel package of sdl2 installed, but again it's ignored by the whole process.

Thank you!

knutj commented 6 months ago

When I build openJKDF2 I got this errors

nutjb@knut:~/sources/OpenJKDF2$ ./build_linux64.sh ~/sources/OpenJKDF2/build_linux64 ~/sources/OpenJKDF2 -- Targeting Linux 64-bit CMake Deprecation Warning at 3rdparty/json/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- Using the multi-header code from /home/knutjb/sources/OpenJKDF2/3rdparty/json/include/ -- Going to build “FreeGLUT 3.4.0” from Git module -- Could NOT find GLEW (missing: GLEW_LIBRARIES) (found suitable version "2.2.0", minimum required is "2.2.0") -- Going to build “GLEW 2.2.0” from Git module -- Going to build “zlib 1.2.13” from Git module -- Going to build “PhysFS 3.2.0” from Git module -- Could NOT find GameNetworkingSockets (missing: GameNetworkingSockets_INCLUDE_DIRS GameNetworkingSockets_SHARED_LIBRARIES GameNetworkingSockets_STATIC_LIBRARIES) (Required is at least version "1.4.1") -- Going to build “protobuf 3.21.12” from Git module -- Going to build “GameNetworkingSockets 1.4.1” from Git module -- Protobuf_ROOT=/home/knutjb/sources/OpenJKDF2/build_linux64/protobuf CMake Warning at /usr/share/cmake/Modules/ExternalProject.cmake:1803 (message): Line 'CMAKE_POSITION_INDEPENDENT_CODE=ON' does not match regex. Ignoring. Call Stack (most recent call first): /usr/share/cmake/Modules/ExternalProject.cmake:3750 (_ep_command_line_to_initial_cache) /usr/share/cmake/Modules/ExternalProject.cmake:3796 (_ep_extract_configure_command) /usr/share/cmake/Modules/ExternalProject.cmake:4348 (_ep_add_configure_command) cmake_modules/build_gns.cmake:29 (ExternalProject_Add) cmake_modules/config_platform_deps.cmake:102 (include) CMakeLists.txt:206 (include)

-- Going to build “libpng 1.6.39” from Git module -- Going to build “SDL 2.26.5” from Git module SDL_VERSION_MAJOR == 2 SDL_VERSION_MINOR == 26 SDL_VERSION_PATCH == 5 -- Going to build “SDL_mixer 2.6.3” from Git module SDL_MIXER_VERSION_MAJOR == 2 SDL_MIXER_VERSION_MINOR == 6 SDL_MIXER_VERSION_PATCH == 3 -- Configuring done (0.1s) -- Generating done (0.0s) -- Build files have been written to: /home/knutjb/sources/OpenJKDF2/build_linux64 [ 50%] Built target ZLIB_Linux_x86_64 [100%] Built target PROTOBUF [ 6%] Built target ZLIB_Linux_x86_64 [ 6%] Built target SDL [ 9%] Built target GLEW [ 17%] Built target PROTOBUF [ 18%] Built target LIBPNG [ 18%] Built target PHYSFS [ 21%] Built target SDL_mixer [ 24%] Built target GAMENETWORKINGSOCKETS [ 24%] Built target GNS_HACK_ZLIB [ 99%] Built target sith_engine make[3]: No rule to make target 'SDL/lib/libSDL2.a', needed by 'openjkdf2'. Stop. make[2]: [CMakeFiles/Makefile2:394: CMakeFiles/openjkdf2.dir/all] Error 2 make[1]: [CMakeFiles/Makefile2:401: CMakeFiles/openjkdf2.dir/rule] Error 2 make: [Makefile:254: openjkdf2] Error 2 knutjb@knut:~/sources/OpenJKDF2$

nitro322 commented 5 months ago

I just ran into this issue myself. There seems to be an issue with lib vs. lib64. I got the same message as above for quite a few components: SDL SDL_mixer physfs libpng* GameNetworkingSockets

In each of those directories the library was located in lib64/, but make was looking for it in lib/. The easiest way I found for each of this was to symlink lib to lib64 in each directory. Ie.: cd GameNetworkingSockets && ln -s lib64 lib && cd ..

The exception was libpng, which already had a lib directory, but that just contained some cmake files. For that I renamed lib to lib-orig, then created the symlink.

After that the build completed. Maybe the build scripts can detect 64-bit vs. 32-bit and use lib64 automatically?

shinyquagsire23 commented 5 months ago

ahhh right I forgot I've basically only been testing on 64-bit systems since I refactored all my dependencies. Might try and fire up an ARM32 RPi and see if I can fix that then.