rem5 Posted May 8, 2020 Share Posted May 8, 2020 (edited) Hello, When building gemrb (master branch) to use SDL2 and OpenGL on linux, at runtime it doesn't find 'Shaders' directory [SDL 2 GL Driver/FATAL]: Can't build shader program: GLSLProgram error: Can't open file: share/gemrb/Shaders/SDLTextureV.glsl the directory is : /usr/share/gemrb/Shaders and not : share/gemrb/Shaders here are the path listed at building : -- These are the configured paths: -- PREFIX: /usr -- LIB_DIR: lib64 -- PLUGIN_DIR: lib64/plugins -- BIN_DIR: bin -- DATA_DIR: share/gemrb -- MAN_DIR: share/man/man6 -- SYSCONF_DIR: /etc/gemrb -- DOC_DIR: share/doc/gemrb-9999 -- ICON_DIR: share/pixmaps -- SVG_DIR: share/icons/hicolor/scalable/apps -- MENU_DIR: share/applications -- -- Options: -- LAYOUT: fhs -- NOCOLOR: disabled -- STATIC_LINK: disabled -- INSOURCEBUILD: disabled -- DISABLE_WERROR: 1 -- WIN32_USE_STDIO: disabled -- SDL_BACKEND: SDL2 -- OPENGL_BACKEND: OpenGL -- -- Build type: Gentoo -- Target bitness: 8*8 -- -- <<< Gentoo configuration >>> Build type Gentoo Install path /usr It seems it's not specific to Shaders as by default it doesn't find other directory like : unhardcoded I had to "force" the good directory by setting : GemRBUnhardcodedPath=/usr/share/gemrb in conf here are cmake options used : -DBIN_DIR=bin -DDATA_DIR=share/gemrb -DDOC_DIR=share/doc/${PF} -DICON_DIR=share/pixmaps -DLIB_DIR=$(get_libdir) -DMAN_DIR=share/man/man6 -DMENU_DIR=share/applications -DSVG_DIR=share/icons/hicolor/scalable/apps -DSYSCONF_DIR=/etc/${PN} -DCMAKE_SKIP_RPATH=ON -DDISABLE_WERROR=1 -DSDL_BACKEND=SDL2 -DOPENGL_BACKEND=OpenGL I must have done some mistake, if someone have an idea ? Thanks by advance Edited May 11, 2020 by rem5 Quote Link to comment
lynx Posted May 9, 2020 Share Posted May 9, 2020 Is this an ebuild or something? I see the paths are not what we have upstream and the build type is invalid. Quote Link to comment
rem5 Posted May 9, 2020 Author Share Posted May 9, 2020 (edited) Yes this is an ebuild, but here I think it's more understanding how cmake works with paths than distribution problem nor gemrb. I just find that by not definying some path (-DDATA_DIR=share/gemrb), it's ok (and limit number of path to modify in gemrb.cfg which is good !). I think the problem here is that gentoo automatically prefix path with '/usr' so '/usr' had to be removed from defined path, but at runtime there's not automagically prefixing. So with master all is ok, sdl1, sdl2 (+opengl) On subviews, are the cmake option the same for opengl ? When building with same cmake options with opengl : -DSDL_BACKEND=SDL2 -DOPENGL_BACKEND=OpenGL I have no Shaders directory created so obviously it complain at start : [SDL 2 GL Driver/FATAL]: Can't build shader program: GLSLProgram error: Can't open file: /usr/share/gemrb/Shaders/SDLTextureV.glsl edit : CMAKE_BUILD_TYPE='Debug' or 'Release' doesn't change the result. build : cmake --no-warn-unused-cli -C /var/tmp/portage/games-engines/gemrb-6666/work/gemrb-6666_build/gentoo_common_config.cmake -G Unix Makefiles -DCMAKE_INSTALL_PREFIX=/usr -DDOC_DIR=share/doc/gemrb-6666 -DLIB_DIR=lib64 -DCMAKE_SKIP_RPATH=ON -DDISABLE_WERROR=1 -DSDL_BACKEND=SDL2 -DOPENGL_BACKEND=OpenGL -DCMAKE_BUILD_TYPE=Gentoo -DCMAKE_INSTALL_DO_STRIP=OFF -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/games-engines/gemrb-6666/work/gemrb-6666_build/gentoo_toolchain.cmake /var/tmp/portage/games-engines/gemrb-6666/work/gemrb-6666 -- Options: -- LAYOUT: fhs -- NOCOLOR: disabled -- STATIC_LINK: disabled -- INSOURCEBUILD: disabled -- DISABLE_WERROR: 1 -- WIN32_USE_STDIO: disabled -- SDL_BACKEND: SDL2 -- OPENGL_BACKEND: 1 Edited May 9, 2020 by rem5 Quote Link to comment
rem5 Posted May 9, 2020 Author Share Posted May 9, 2020 (edited) As I should have made it from the start, I check directly from source without ebuild to compare master & subviews and the problem is here too : no 'Shaders' directory with subviews branch at 'make install' in '<somepath>/build/gemrb/cmake_install.cmake', this paragraph is missing in subviews : if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES "/usr/local/share/gemrb/Shaders") if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION) message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}") endif() if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION) message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}") endif() file(INSTALL DESTINATION "/usr/local/share/gemrb" TYPE DIRECTORY FILES "/home/myhome/Downloads/gemrb_master/gemrb/gemrb/plugins/SDLVideo/Shaders" REGEX "/[^/]*\\.am$" EXCLUDE) endif() If I add it, 'Shaders' directory get installed. I'm not familiar with cmake and I don't find exactly what must be fixed... Edited May 10, 2020 by rem5 Quote Link to comment
lynx Posted May 10, 2020 Share Posted May 10, 2020 Are you trying to install into a folder, not systemwide? If that's the case, just pass -DLAYOUT=home — I don't understand why you're setting so many paths. Quote Link to comment
rem5 Posted May 10, 2020 Author Share Posted May 10, 2020 Yes, these too many path come from official ebuild in gentoo (outdated). As you said I thing it has to be "simplified" at the path level. But this is another story..... It's gentoo dev/user problem. Here I think there is a problem with generated install script from subviews branch. In what follow there's no ebuild nor distribution specific. I directly get source, compile and install manually (git, cmake, make) here are the cmake arguments used : cmake .. -DSDL_BACKEND=SDL2 -DCMAKE_BUILD_TYPE=Debug -DOPENGL_BACKEND=OpenGL at 'make install' (system wide, so /usr/local/), '/usr/local/share/gemrb/Shaders' is not here with subviews branch If I do the same (same cmake args) with master branch, the directory is here. Theses are the lines in master (/build/gemrb/cmake_install.cmake) after build which are not in with subviews branch : Quote if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES "/usr/local/share/gemrb/Shaders") if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION) message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}") endif() if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION) message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}") endif() file(INSTALL DESTINATION "/usr/local/share/gemrb" TYPE DIRECTORY FILES "/home/myhome/Downloads/gemrb_master/gemrb/gemrb/plugins/SDLVideo/Shaders" REGEX "/[^/]*\\.am$" EXCLUDE) endif() If I manually add them before 'make install' in '/build/gemrb/cmake_install.cmake' (subviews branch), 'Shaders' directory get installed. I hope it's more clear ? Quote Link to comment
khelban12 Posted May 10, 2020 Share Posted May 10, 2020 (edited) Can you try this https://pastebin.com/DE71jzpV It a bit old too but i think it is better than the one in the gentoo tree. I wrote it because gentoo didn't have a SDL2 gemrb ebuild and i wanted to get rid of SDL1. I haven't tried all options but i have tried sdl, sdl2+opengl, sdl2-opengl scenarios and all worked. At that time, opengl gave me some problems (i can't remember what, maybe flickering or rendering issues) so i personally settled for sdl2 - opengl. I haven't tried the subviews branch with it but i use it as gemrb-9999 and recompile the git version every now and then and it compiles fine with the git tree. Edited May 10, 2020 by khelban12 Quote Link to comment
lynx Posted May 10, 2020 Share Posted May 10, 2020 (edited) Try calling with an additional -DUSE_OPENGL=1, I see the problem in the subviews branch now (I guess from bad merge some time ago). EDIT: ok, shouldn't be needed any more. Edited May 10, 2020 by lynx Quote Link to comment
rem5 Posted May 11, 2020 Author Share Posted May 11, 2020 10 hours ago, khelban12 said: Can you try this https://pastebin.com/DE71jzpV It a bit old too but i think it is better than the one in the gentoo tree. I wrote it because gentoo didn't have a SDL2 gemrb ebuild and i wanted to get rid of SDL1. I haven't tried all options but i have tried sdl, sdl2+opengl, sdl2-opengl scenarios and all worked. At that time, opengl gave me some problems (i can't remember what, maybe flickering or rendering issues) so i personally settled for sdl2 - opengl. I haven't tried the subviews branch with it but i use it as gemrb-9999 and recompile the git version every now and then and it compiles fine with the git tree. ohh, nice !!, same job but way better written than mine :D, yes settled too with sdl2 -opengl (here I needed opengl to test a particular point compared to just sdl2) Quote Link to comment
rem5 Posted May 11, 2020 Author Share Posted May 11, 2020 (edited) On 5/10/2020 at 11:51 PM, lynx said: Try calling with an additional -DUSE_OPENGL=1, I see the problem in the subviews branch now (I guess from bad merge some time ago). EDIT: ok, shouldn't be needed any more. I will test that as soon as I have time edit : as expected Thanks Edited May 13, 2020 by rem5 Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.