Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Compile SFML on Odroid XU4  (Read 474 times)

0 Members and 1 Guest are viewing this topic.

calle81

  • Newbie
  • *
  • Posts: 5
    • View Profile
Compile SFML on Odroid XU4
« on: January 08, 2019, 02:48:30 pm »
Hi, sorry if I post this at the wrong place. I'm trying to compile SFML on an Odroid XU4 running an retropie fork (ORA) but I get this error message:

root@odroid:~/develop/fall/build# cmake -DSFML_OPENGL_ES=1 ..
-- The C compiler identification is GNU 5.4.1
-- The CXX compiler identification is GNU 5.4.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for XOpenDisplay in /usr/lib/arm-linux-gnueabihf/libX11.so;/usr/lib/arm-linux-gnueabihf/libXext.so
-- Looking for XOpenDisplay in /usr/lib/arm-linux-gnueabihf/libX11.so;/usr/lib/arm-linux-gnueabihf/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/arm-linux-gnueabihf/libX11.so
-- Found EGL: /usr/lib/arm-linux-gnueabihf/libEGL.so
-- Found GLES: /usr/lib/arm-linux-gnueabihf/libGLESv1_CM.so
-- libudev stable: 1
-- Found UDev: /usr/lib/arm-linux-gnueabihf/libudev.so
-- include: /usr/include
CMake Error at cmake/Macros.cmake:279 (message):
Target 'EGL' is already defined
Call Stack (most recent call first):
src/SFML/Graphics/CMakeLists.txt:117 (sfml_find_package)


-- Configuring incomplete, errors occurred!
See also "/root/develop/sfml/build/CMakeFiles/CMakeOutput.log".

And here is the log: https://pastebin.com/pYEFtp8A

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial

Would be very happy if you could point me in the right direction.

Thanks,
Carl
« Last Edit: January 08, 2019, 03:47:07 pm by calle81 »

calle81

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Compile SFML on Odroid XU4
« Reply #1 on: January 08, 2019, 06:20:30 pm »
This i where it fails:
cmake/Macros.cmake:279

# Find the requested package and make an INTERFACE library from it
# Usage: sfml_find_package(wanted_target_name
#                          [INCLUDE "OPENGL_INCLUDE_DIR"]
#                          [LINK "OPENGL_gl_LIBRARY"])
function(sfml_find_package)
    set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules/")
    list(GET ARGN 0 target)
    list(REMOVE_AT ARGN 0)

    if (TARGET ${target})
        message(FATAL_ERROR "Target '${target}' is already defined")

    endif()

calle81

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Compile SFML on Odroid XU4
« Reply #2 on: January 08, 2019, 06:29:39 pm »
And when i comment out that check I get this:

root@odroid:~/develop/sfml/build# cmake -DSFML_OPENGL_ES=1 ..
-- libudev stable: 1
-- Found UDev: /usr/lib/arm-linux-gnueabihf/libudev.so
--    include: /usr/include
CMake Error at cmake/Macros.cmake:293 (add_library):
  add_library cannot create target "EGL" because another target with the same
  name already exists.  The existing target is an interface library created
  in source directory "/root/develop/sfml/src/SFML/Window".  See
  documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  src/SFML/Graphics/CMakeLists.txt:117 (sfml_find_package)


CMake Error at cmake/Macros.cmake:293 (add_library):
  add_library cannot create target "GLES" because another target with the
  same name already exists.  The existing target is an interface library
  created in source directory "/root/develop/sfml/src/SFML/Window".  See
  documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  src/SFML/Graphics/CMakeLists.txt:118 (sfml_find_package)


-- Found OpenAL: /usr/lib/arm-linux-gnueabihf/libopenal.so
-- Found VORBIS: /usr/lib/arm-linux-gnueabihf/libvorbisenc.so;/usr/lib/arm-linux-gnueabihf/libvorbisfile.so;/usr/lib/arm-linux-gnueabihf/libvorbis.so;/usr/lib/arm-linux-gnueabihf/libogg.so
-- Found FLAC: /usr/lib/arm-linux-gnueabihf/libFLAC.so
-- Configuring incomplete, errors occurred!
See also "/root/develop/sfml/build/CMakeFiles/CMakeOutput.log".
root@odroid:~/develop/sfml/build#

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32098
    • View Profile
    • SFML's website
    • Email
Re: Compile SFML on Odroid XU4
« Reply #3 on: January 08, 2019, 06:42:56 pm »
Obviously, this macro (sfml_find_package) shouldn't fail if the target already exists, but instead silently return. Or sfml-graphics should use a similar strategy for EGL as for OpenGL:

    # Target OpenGL already defined for Window component so no sfml_find_package() here
    target_link_libraries(sfml-graphics PRIVATE OpenGL)
 

I prefer the first solution, as a module won't have to guess which interfaces are already defined by other modules.

Would you mind testing, and then submitting a PR if everything's OK?
« Last Edit: January 08, 2019, 06:44:35 pm by Laurent »
Laurent Gomila - SFML developer

calle81

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Compile SFML on Odroid XU4
« Reply #4 on: January 08, 2019, 07:48:44 pm »
Thanks!  With that change cmake can complete.

However, when I run "make install"  I get this error:

Code: [Select]
[ 33%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/EglContext.cpp.o
In file included from /usr/include/X11/Xlib.h:44:0,
                 from /usr/include/EGL/eglplatform.h:99,
                 from /usr/include/EGL/egl.h:39,
                 from /root/develop/sfml/src/SFML/Window/EGLCheck.hpp:32,
                 from /root/develop/sfml/src/SFML/Window/EglContext.hpp:33,
                 from /root/develop/sfml/src/SFML/Window/EglContext.cpp:29:
/root/develop/sfml/include/SFML/Window/WindowStyle.hpp:40:9: error: expected identifier before numeric constant
         None       = 0,      ///< No border / title bar (this flag and all othe
         ^
/root/develop/sfml/include/SFML/Window/WindowStyle.hpp:40:9: error: expected ‘}’ before numeric constant
/root/develop/sfml/include/SFML/Window/WindowStyle.hpp:40:9: error: expected unqualified-id before numeric constant
In file included from /root/develop/sfml/src/SFML/Window/Unix/CursorImpl.hpp:34:0,
                 from /root/develop/sfml/src/SFML/Window/CursorImpl.hpp:39,
                 from /root/develop/sfml/src/SFML/Window/WindowImpl.hpp:35,
                 from /root/develop/sfml/src/SFML/Window/EglContext.cpp:30:
/root/develop/sfml/include/SFML/Window/WindowStyle.hpp:50:1: error: expected declaration before ‘}’ token
 } // namespace sf
 ^
src/SFML/Window/CMakeFiles/sfml-window.dir/build.make:470: recipe for target 'src/SFML/Window/CMakeFiles/sfml-window.dir/EglContext.cpp.o' failed
make[2]: *** [src/SFML/Window/CMakeFiles/sfml-window.dir/EglContext.cpp.o] Error1
CMakeFiles/Makefile2:170: recipe for target 'src/SFML/Window/CMakeFiles/sfml-window.dir/all' failed
make[1]: *** [src/SFML/Window/CMakeFiles/sfml-window.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
root@odroid:~/develop/sfml/build# make install
« Last Edit: January 08, 2019, 10:20:18 pm by calle81 »

calle81

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Compile SFML on Odroid XU4
« Reply #5 on: January 08, 2019, 10:24:19 pm »
Meveric submitted a PR for the initial problem.

 

anything