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

Author Topic: How to release a sfml-program for several distribution?  (Read 9208 times)

0 Members and 1 Guest are viewing this topic.

c-jay

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
How to release a sfml-program for several distribution?
« on: August 20, 2016, 11:16:20 am »
Hi, my project of coding some stuff with sfml is in the final state.
Now I like to build a release for students but I'm very new to cmake/ make .

Do anybody know a good tutorial or bool to release an C-program, based on SFML/CSFML 2.3 to another machine like Ubuntu 14.04 ?

Thank you very much

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: How to release a sfml-program for several distribution?
« Reply #1 on: August 21, 2016, 09:44:36 pm »
1. Build your own sfml. 2. Build your executable with a RPATH that finds the library relative to the executable ($ORIGIN). 3. Package the library files alongside your executable in the expected location.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Re: How to release a sfml-program for several distribution?
« Reply #2 on: August 22, 2016, 10:31:39 am »
1. Build your own sfml. 2. Build your executable with a RPATH that finds the library relative to the executable ($ORIGIN). 3. Package the library files alongside your executable in the expected location.
I always wonder with that, how are SFML's dependencies handled? Can I compile this on Debian and then really run it on Ubuntu, Arch and Gentoo? What if runtime libs differ?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

texus

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • TGUI
    • Email
Re: How to release a sfml-program for several distribution?
« Reply #3 on: August 22, 2016, 04:54:03 pm »
Quote
I always wonder with that, how are SFML's dependencies handled? Can I compile this on Debian and then really run it on Ubuntu, Arch and Gentoo? What if runtime libs differ?
I have tried compiling an application in the past that ran on both ubuntu and arch linux. I never really knew which dependencies to ship so I just copied the ones that were asked for when starting the app. The result was that a year later on a different system it sometimes missed some library.
So I decided to take a more detailed look into this today and these are my findings (some information may be incorrect, these are simply my observations). Since I do not have ubuntu I used docker from arch linux.

There are 2 problems with distributing the executable:
1) You can only run the executable on newer systems (or the same) as the one you compile with.
(click to show/hide)

2) Not all dependencies should be shipped.
(click to show/hide)

A third problem might be 32bit vs 64bit, I didn't test with that but I doubt that my 64bit app will just run on a 32bit linux.

The following test program should run out of the box on anything newer than ubuntu 14.04 (only tested running on arch linux):
https://www.dropbox.com/s/jacna15uyttfwov/linux64-binary-test.tar.gz?dl=1

This is the code that I have in my cmake script to set the RPATH
Code: [Select]
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib/:$$ORIGIN/lib/")
« Last Edit: April 23, 2020, 11:59:35 am by eXpl0it3r »
TGUI: C++ SFML GUI