sultim-t / prboom-plus-rt

821 stars 50 forks source link

[linux] fix SDL header discoverability #1

Closed arrowgent closed 2 years ago

arrowgent commented 2 years ago

export RTGL1_SDK_PATH=/home/build/prboom-RTX/RayTracedGL1-SharedLibrary/

mkdir build cd build

cmake ..

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'RelWithDebInfo' as none was specified.
-- Looking for stricmp
-- Looking for stricmp - not found
-- Looking for strnicmp
-- Looking for strnicmp - not found
-- Looking for getopt
-- Looking for getopt - found
-- Looking for mmap
-- Looking for mmap - found
-- Looking for CreateFileMapping
-- Looking for CreateFileMapping - not found
-- Looking for sched_setaffinity
-- Looking for sched_setaffinity - found
-- Looking for usleep
-- Looking for usleep - found
-- Looking for strsignal
-- Looking for strsignal - found
-- Looking for mkstemp
-- Looking for mkstemp - found
-- Looking for sys/wait.h
-- Looking for sys/wait.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for asm/byteorder.h
-- Looking for asm/byteorder.h - found
-- Looking for dirent.h
-- Looking for dirent.h - found
CMake Warning (dev) at /usr/share/cmake-3.23/Modules/FindOpenGL.cmake:315 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  CMakeLists.txt:81 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- Found PCREPOSIX: /usr/lib/x86_64-linux-gnu/libpcreposix.so  
CMake Warning (dev) at /usr/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PCRE) does
  not match the name of the calling package (PCREPOSIX).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/FindPCREPOSIX.cmake:23 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:119 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PCRE: /usr/lib/x86_64-linux-gnu/libpcre.so  
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
-- Found LibMad: /usr/lib/x86_64-linux-gnu/libmad.so  
-- Found FluidSynth: /usr/lib/x86_64-linux-gnu/libfluidsynth.so  
-- Could NOT find Dumb
-- Could NOT find PortMidi (missing: PORTMIDI_LIBRARIES PORTMIDI_INCLUDE_DIR) 
-- Looking for snd_seq_create_simple_port in asound
-- Looking for snd_seq_create_simple_port in asound - found
-- Found ALSA: /usr/lib/x86_64-linux-gnu/libasound.so
-- Looking for SDL_JoystickGetAxis
-- Looking for SDL_JoystickGetAxis - not found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/build/prboom-RTX/prboom-plus-rt-rt-1.0/prboom2/build

cmake --build .

[  0%] Building C object data/CMakeFiles/rdatawad.dir/rd_main.c.o
[  1%] Building C object data/CMakeFiles/rdatawad.dir/rd_util.c.o
[  2%] Building C object data/CMakeFiles/rdatawad.dir/rd_output.c.o
[  2%] Building C object data/CMakeFiles/rdatawad.dir/rd_sound.c.o
[  3%] Building C object data/CMakeFiles/rdatawad.dir/rd_palette.c.o
[  4%] Building C object data/CMakeFiles/rdatawad.dir/rd_graphic.c.o
[  5%] Linking C executable rdatawad
[  5%] Built target rdatawad
[  6%] Generating ../prboom-plus.wad
[  6%] Built target prboomwad
[  6%] Building C object src/CMakeFiles/prboom-plus.dir/am_map.c.o
In file included from /home/build/prboom-RTX/prboom-plus-rt-rt-1.0/prboom2/src/am_map.c:42:
/home/build/prboom-RTX/prboom-plus-rt-rt-1.0/prboom2/src/gl_opengl.h:44:10: fatal error: SDL.h: No such file or directory
   44 | #include <SDL.h>
      |          ^~~~~~~
compilation terminated.
make[2]: *** [src/CMakeFiles/prboom-plus.dir/build.make:76: src/CMakeFiles/prboom-plus.dir/am_map.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:187: src/CMakeFiles/prboom-plus.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
arrowgent commented 2 years ago

for all references,

https://github.com/coelckers/prboom-plus

this compiles flawelessly without any issues.

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .

one and done.

rjzak commented 2 years ago

CMake probably isn't passing -I/usr/include/SDL to gcc.

arrowgent commented 2 years ago

that should be /usr/include/SDL2 because its using the SDL2 source, not SDL1.2

sultim-t commented 2 years ago

Yeah, sooner or later I will be reinstalling everything on my PC, so will install Linux as well to make RayTracedGL1 work there

Jackfritt commented 2 years ago

Ok i can confirm same problem here... Any solution or fast fix? Im just a player ;)

arrowgent commented 2 years ago

SDL fix are minor, the more pressing issues are fixing RT & RTGL code changes later in the build process (referenced above) alter the "win32isms" so that its properly cross-platform to compile