Slashdot Mirror


Building Distributable Linux Binaries?

Grubby Games asks: "I make games for a living, and I want to ensure that my games will run on as many Linux distros as possible. However, since I distribute binary game executables, the programs often fail to run on certain distros because of missing dependencies, and so forth. So, how do the Slashdot Linux gurus handle this situation? I've heard a number of theories on the subject, but have yet to find one that results in 100% cross-distro compatibility. Is it even possible, short of distributing source code?"

128 comments

  1. Distribute source by baadger · · Score: 2, Funny

    How many comments until someone asks "Why not distribute the source?"?

    Ah geeks..always finding a way to answer the question with a better(?) one.

    1. Re:Distribute source by Ithika · · Score: 3, Funny

      You forgot force the user to move to your distro of choice and I only play Nethack.

    2. Re:Distribute source by PunkOfLinux · · Score: 2, Insightful

      I would just write a script that checked for everything it needed, and, if something isn't there, informs the user and (if possible) installs the dependency for the user (with their permission, of course,)

    3. Re:Distribute source by eyepeepackets · · Score: 1

      Yes, just provide the tarball, a list of required libs, perhaps a gentle hint on using ldd, and the three or four step process to config/make/make install/change perms. Ye gads man, it's not hard to do either on your end or the users'. Granted, there are exceptions: Xnotes++ is a harsh mistress I've not yet been able to tame, but then it's hardly your standard build process.

      And if Joe Noobie hoses his libc, qt _and_ gtk libs in an attempt to play a cheesey version of Hearts, well then the lesson is more valuable than the game, eh? I remember soundly trashing my first few Slackware systems doing stupid things all the while learning what is whereis and when not to do whatis and why wget won't and when wish will, etc. (And perhaps somewhere a grammar/usage Nazi just fainted.)

      In summation: Don't expect "linux" to act like Windows because it most certainly is not, and, with much continued good work and good fortune, it never will be.

      Oops, sorry Baadger, this response is talking to the submitter, but you inspired it so here it was put.

      --
      Everything in the Universe sucks: It's the law!
    4. Re:Distribute source by dasunt · · Score: 1
      You forgot force the user to move to your distro of choice and I only play Nethack.

      We are more open minded then that. Most of us have also tried slash'em once or twice. :)

  2. Staticly link EVERYTHING. It's the only way. by Anm · · Score: 1

    Turkey.

  3. Ideas by MBCook · · Score: 5, Interesting
    You're going to have a hard time, I think. Obviously if you have to just build for a number of distros you'll want to do it for the most popular (Ubuntu, Debian, Fedora, and Gentoo, for example). That said, there are some solutions:
    • Java
    • Python
    • Static Build

    Java and Python are obvious. You can always use things like JNI and the Python-C bridge if you feel you need better speed in some parts. As long as those parts don't link to any external code, you won't have any problem. They are both very fast these days, and by using things like PyOpenGL and Java3D you can get accelerated rendering and everything. Plus you would only need one codebase for both windows, linux, and OS X.

    As for a static build, you may or may not want to do that. The size of the executable will be much larger, and it will take more memory to run, but you won't have the problem of everyone has a different version. It would solve your problem.

    As an odd suggestion: why not build all your code into objects and distribute those with a little script to link them on the client machine into an executable. That would fix the problem right? The problem is you couldn't strip the binary (if you do that) because the linker needs the symbols (right?). But it would solve you problem. This is my understanding of how nVidia's kernel drivers work (they have a little glue source too, which you could include). This way they don't have to put out a version for every combination under the sun.

    I hope this helps. This is one area where Linux is (rather far) behind Windows and OS X. It's not much of a problem if you've got the source, but if the application is closed source (like yours) then it can be a headache. This is something that the LSB was trying to solve, but I don't know how far they got (or how many distros follow their guidelines).

    --
    Comment forecast: Bits of genius surrounded by a sea of mediocrity.
    1. Re:Ideas by ultranova · · Score: 1

      Java and Python are obvious. You can always use things like JNI and the Python-C bridge if you feel you need better speed in some parts. As long as those parts don't link to any external code, you won't have any problem.

      That is a big if ;). Personally, I'd stay away from Python and use Java - Pythons nature (lack of data hiding, lack of strong typing) makes it very easy to have the program collapse into a horrendous mess. On the other hand, for proof-of-concept things and people with tempered steel discipline it works very well.

      Just remember to skip any library that says something about requiring "Boost", and you will be fine.

      They are both very fast these days, and by using things like PyOpenGL and Java3D you can get accelerated rendering and everything. Plus you would only need one codebase for both windows, linux, and OS X.

      Unfortunately, Java3D doesn't come with the platform, and getting it to work requires quite a bit of manual copying of stuff :(. Then again, there are several Java OpenGL wrappers out there, and 2D graphics are fast enough out of the box (at least on Linux, don't know about Windows).

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    2. Re:Ideas by Anonymous Coward · · Score: 0

      Java and Python... They are both very fast these days

      Firstly, for Java and Python, it's very hard to keep your source code hidden. Even if you only distribute bytecode, it's trivial to decompile into a reasonably legible form. Obfuscation is only of limited use. If you don't care about hiding your source code, then just distribute it as source code and your problems disappear!

      Secondly, I don't know what planet you're on, but here on Earth, Java performs tolerably on a good day and Python practically defines "slow"; in no possible sense can you consider either "very fast".

    3. Re:Ideas by Anonymous Coward · · Score: 0

      Python is strongly typed.

    4. Re:Ideas by grotgrot · · Score: 1

      Python and Java aren't as simple as you imply. Non-trivial applications are going to require other libraries. They may need printing, gui, data exchange, remote communication, database etc. There are extra packages that can be installed to do all that for each environment, and in many cases those packages aren't provided with each distro, or they don't keep the versions up to date.

      I package a GPLed Python application which requires 8 other Python libraries. Although users could run from source, they would have a really hard time installing each of those dependencies. Even a CPAN style solution has problems since the distro's packaging system then doesn't know about the modules installed.

      The Gaim folks ended up making something for each distro. Note how they only need exactly one Windows download even though the same/equivalent libraries are used.

      Ultimately the only thing that may work is doing as the Gaim folks do. Using VMWare and some scripting it isn't too difficult to pull off.

      Now if only SourceForge would provide some automated way of uploading files without their arduous and annoying interface...

    5. Re:Ideas by 42forty-two42 · · Score: 1
      As an odd suggestion: why not build all your code into objects and distribute those with a little script to link them on the client machine into an executable. That would fix the problem right?

      Nope. If it was that simple, it'd just work anyway. Problem is, if structures in header files or whatever change, then the old object files are no longer compatible with the new library, and a recompile is needed.
    6. Re:Ideas by jazir1979 · · Score: 0

      "This is one area where Linux is (rather far) behind Windows and OS X"

      ummm ... Linux is not behind, it's just that Windows and OS X are not available in a large number of distributions, and are not as configurable.

      --
      What's your GCNSEQNO?
    7. Re:Ideas by MBCook · · Score: 2, Interesting
      I realize that they are different beasts. I know there is only one "distro" of Windows and one of OS X. But to the end user, they won't care about that difference. All they know is they have this problem on Linux and not OS X.

      I have nothing against the Linux way, there is good stuff to say about it. But you if you want to compete, you can't go around saying "We're not windows so you can't criticize us for that." It is a very valid concern.

      Maybe this is where some middle-man can make money. If they can create a platform to fix this problem that works on all the distros (or at least most) because they spend time working on it, and can get Linux game makers to target it for a tiny fee ($0.25 per copy?) then they could get established doing this (and giving it free to the users).

      --
      Comment forecast: Bits of genius surrounded by a sea of mediocrity.
    8. Re:Ideas by ashot · · Score: 1

      I think he meant lack of static typing. There has been a lot of talk on the python forums about adding this lately.

      --
      -ashot
    9. Re:Ideas by try_anything · · Score: 1

      Just curious, why avoid Boost? Most of Boost is template code, so it gets compiled into your objects and doesn't leave any library dependencies. I use Boost heavily and distribute to customers who don't have it installed.

    10. Re:Ideas by rmstar · · Score: 1
      Personally, I'd stay away from Python and use Java - Pythons nature (lack of data hiding, lack of strong typing) makes it very easy to have the program collapse into a horrendous mess.

      Whoa. My FUD-o-meter almost melted on that.

      Large amounts of software survive quite well without static typing or data hiding.

  4. It's not possible. by keesh · · Score: 1, Informative

    It can't be done with dynamic linking, despite what the Autopackage people tell you. There's too much variety between distributions with things like libc and libstdc++ versions. There's even too much variety between distribution releases in many cases.

    Most distributions don't aim to provide binary compatibility between releases. Even RedHat get sick of shipping multiple copies of libraries eventually... And if you throw distributions like Gentoo into the mix, anything binary-based using dynamic linking is out of the question.

    If you really must distribute binaries, static link them and distribute the associated libraries too. Assuming, of course, that said libraries' licences don't prohibit this -- for open things you're fine, but for obnoxiously licenced code (like your own) you're short of luck. Also note that you can't legally do this with LGPLed libraries (nor GPLed, of course).

    *shrug* Of course, any respectable Linux user won't use your software unless they can see the code anyway. How else do we know it's not chock full of security holes and spyware?

    1. Re:It's not possible. by Spudley · · Score: 4, Insightful

      *shrug* Of course, any respectable Linux user won't use your software unless they can see the code anyway. How else do we know it's not chock full of security holes and spyware?

      Ah. So that's why Loki went bust.

      But you know what... I'm respectable, and I bought their games. And no, I didn't get any source code.

      There are legitimate reasons not to release source code, and the original poster didn't give any details of his licence, so I think you're being excessively harsh to call it obnoxious.

      The decision to distribute source code or not does not affect the quality of the software. It may make it harder for you to look inside, but remember - Sony didn't release their DRM source code either.

      --
      (Spudley Strikes Again!)
    2. Re:It's not possible. by Anonymous Coward · · Score: 0

      do you personally audit the source of every application you install?

    3. Re:It's not possible. by Mprx · · Score: 1

      It's possible to distribute statically linked LGPLed binaries, as long as you include in the distribution all the .o files and library source needed to make it possible to relink with a modified library.

    4. Re:It's not possible. by Carl+T · · Score: 1
      I bought [Loki's] games. And no, I didn't get any source code.

      Nor did I, and that means that I have no hope of ever getting the bugs in Railroad Tycoon II fixed. (And that includes the one that makes the game crash if you want to play multiplayer. I wonder how they could not notice that before release.)

      I, too, see the point in hiding the source code of games while they're new. But I would love for the law to require source to be released when a program is no longer actively maintained. And that will of course never happen.

      --

      This signature is not in the public domain.
    5. Re:It's not possible. by bitraid · · Score: 1

      The upcoming Autopackage release is much improved in that regard (currently in beta stage). It allows you to ship dynamically linked binaries for several libstdc++ versions based on binary deltas.

    6. Re:It's not possible. by Draconomicon · · Score: 1

      I'm all in favor of Open Source, and wanting to know all the innards of the code that's running on your box. I think this is an outstanding approach to development and testing, as well as an incredible tool for people wanting to learn how to perform a particular task by letting them see an example of how someone else did something similar.

      But let's be honest -- how many of the programs running on our systems have we sat down and carefully examined the code for? Five percent? Ten?

      Most users assume that the majority of the code, especially the core, has been microscopically analyzed by hordes of uber-geek programmers and given it their blessing, therefore we don't need to check it ourselves.

      For that matter, it's not as if all Linux code is written in one language. In order to examine all of the code on their system, a person would have to be fluent in C/C++, Perl, Java, and a host of other languages.

      While I'm sure there are people who have the skills, the inclination, and the time to do this, I hope you'll forgive me if I consider those individuals to be well beyond merely "respectable Linux users."

      --
      You must be PRESENT to win!
    7. Re:It's not possible. by FooBarWidget · · Score: 1

      "It can't be done with dynamic linking, despite what the Autopackage people tell you"

      Dude, *we* aren't the only ones that tell you it can be done. The *users* also tell you it can be done. What more proof do you need?

      "There's too much variety between distributions with things like libc and libstdc++ versions."

      That is exactly why we have developed APBuild. We've done extensive research into finding out *why* glibc versions cause problems.

  5. dont rely on anything by Anonymous Coward · · Score: 0

    - statically link everything
    - do not expect any file to be in a given place

    Though you could create a live cd based on knoppix with only what you need and distribute that.

  6. Re:You make games for a living? by pilot1 · · Score: 1

    actually, they look entertaining.
    a hardcore gamer might not want to play them, but for casual gamers, they look like they could be quite fun (if they're done properly).

  7. UT2K4 by niskel · · Score: 1

    I believe UT2K4 achieves this by including the libraries themselves in one of the application's directories. Just link to the ones you place in the applications directory as opposed to system libraries and you are all set. Correct me if I am wrong, which is entirely possible.

    1. Re:UT2K4 by ultranova · · Score: 1

      I believe UT2K4 achieves this by including the libraries themselves in one of the application's directories. Just link to the ones you place in the applications directory as opposed to system libraries and you are all set.

      Neverwinter Nights also packaged SDL to a subdirectory, and then had a wrapper script say "export LD_LIBRARY_PATH=./miles:./SDL-1.2.5:$LD_LIBRARY_PA TH" which worked fine and let the user update the libraries if needed.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    2. Re:UT2K4 by Aeiri · · Score: 1

      I believe UT2K4 achieves this by including the libraries themselves in one of the application's directories. Just link to the ones you place in the applications directory as opposed to system libraries and you are all set. Correct me if I am wrong, which is entirely possible.

      The entire point of having dynamically linked libraries is to have one central source to update your libraries at, and to share that functionality with other programs. If you are going to include the dynamic library with the program, it's easier to just make a statically linked executable...

      Doing it the way (apparently) UT2K4 does it will turn Linux into Windows, with each program installing its own version of the library. Since there is not one place to upgrade the library, you end up with buggy, possibly insecure, libraries all over the place being run for every application.

    3. Re:UT2K4 by rbarreira · · Score: 2, Informative

      The entire point of having dynamically linked libraries is to have one central source to update your libraries at, and to share that functionality with other programs. If you are going to include the dynamic library with the program, it's easier to just make a statically linked executable...

      But you can't statically link LGPL licensed libraries...

      --

      The AACS key is NOT 0xF606EEFD628B1CA427BEA93A9CA9773F
    4. Re:UT2K4 by Anonymous Coward · · Score: 0

      Actually, doing it the way UT2k4 does (and Loki before that) has the advantages of both. The libraries get put in a sub directory of the game directory, which ensures the game working, and LD_LIBRARY_PATH tells the dynamic linker to look there *before* looking in the system directory.

      If you already have the right libraries, you can just delete them from the game directory (maybe the installer should just check if you have them, but it doesn't (yet)), at it will grab the system ones instead. So the geeks among us get to use less disk space, and upgrade everything at once, and everyone else gets to install the game without problems.

    5. Re:UT2K4 by morbuz · · Score: 1

      There's no need to use shell scripts that export LD_LIBRARY_PATH any more, and there hasn't been for many, many years. With the GNU dynamic linker, and any other modern linker, you can spesify an $ORIGIN which will be searched for libraries, for example "./libs".

      Read this for more about why LD_LIBRARY_PATH is bad practise:
      http://www.visi.com/~barr/ldpath.html

      --
      CAPS LOCK IS LIKE CRUISE CONTROL FOR COOL!
    6. Re:UT2K4 by ultranova · · Score: 1

      There's no need to use shell scripts that export LD_LIBRARY_PATH any more, and there hasn't been for many, many years. With the GNU dynamic linker, and any other modern linker, you can spesify an $ORIGIN which will be searched for libraries, for example "./libs".

      I'm sure you can. However, using a shell script and LD_LIBRARY_PATH allows the user to switch into using the systems default library if wanted. For example, I have a newer version of SDL installed than the one supplied with NWN, and NWN works perfectly fine with it; all it took to use it was to alter the shell script a little (remove NWNs SDL subdirectory from the LD_LIBRARY_PATH), following the instructions provided as comments in the script itself.

      As for the link you provided, since NWN doesn't launch other programs and doesn't set any environment variables globally (and yes, I agree that relying on globally set LD_LIBRARY_PATH would be a stupid idea), I don't see how it applies here.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

  8. Re:Staticly link EVERYTHING. It's the only way. by Miffe · · Score: 4, Informative

    Not the only way, there is also statifier

    From the page:
    Statifier create from dynamically linked executables and all it's libraries one file. This file can be copied and run on another machine without need to drag all it's libraries.

  9. compatibility with C libraries by Mihai+Cartoaje · · Score: 1

    I have noticed that applications compiled for glibc 2.1.3 run on systems with glibc 2.3.1, but not the reverse. You can find glibc 2.1.3 and gcc 2.95 on Slackware 7.1.

    Netscape 4.8 and Maple 5.0 have been compiled for libc5 and run on many systems.

    1. Re:compatibility with C libraries by RAMMS+EIN · · Score: 1

      In general, link against the least specific filename. If you link against libfoo.so.1.2.3, it will be difficult to get your software running with libfoo.so.1.2.2 or libfoo.so.1.3.4, even though both should be compatible. If you link against libfoo.so.1, there is a much better chance that things will work.

      --
      Please correct me if I got my facts wrong.
  10. I meant 2.3.4 by Mihai+Cartoaje · · Score: 1

    I meant that applications compiled for glibc 2.1.3 run on systems with glibc 2.3.4. I have not tried 2.3.1.

  11. Compiling for different distribution versions by hbr · · Score: 0, Offtopic
    I have a similar question about creating binaries that run on different versions of the same distribution, say, Redhat Linux/Fedora Core.

    I have been building binaries on Redhat7.2 which seem to work OK on Fedora Core 3 (with compat-libstdc++, except there have been some problems when exceptions are thrown - anyone know anything about this?) - I assume they work OK on distributions in between too.

    Does anyone know how to build binaries on newer distributions that run on older ones, especially ones that use C++. Stuff compiled on fc3 seems to link to linux-gate.so, which I guess is not going to go down too well on the older distros.

  12. Open Source Engine, Proprietary Data by RAMMS+EIN · · Score: 4, Insightful

    If you're making games, it's usually a good solution to make the game engine open source, and charge for the data. The game engine can get ported to dog knows what platforms without any effort from you, and you can still get compensated by charging for the data files. The real value of a game tends to be in the data files, as they control the story line, the graphics, the sound effects, basically everything. The game engine is just like a library used to play the datafiles. Of course, not all games work like this.

    --
    Please correct me if I got my facts wrong.
    1. Re:Open Source Engine, Proprietary Data by Anonymous Coward · · Score: 1, Interesting

      If you're making games, it's usually a good solution to make the game engine open source, and charge for the data.

      (ppffftttt) Milk just shot out of my nose (and I'm not drinking milk).

      The real value of a game tends to be in the data files

      Wipe the drool from your chin before posting, please. Do you know how brutally retarded you sound? Take any commercial game company. For example:

      "John Carmack - your Doom 3 engine is merely a 'playback library', the real value here is in the 'data files' (snicker)".

      "Rockstar - your Grand Theft Auto engine may not be entirely YOURS since you licenced the RenderWare 3D engine to build your game, but give me the source to it anyway."

      "Blizzard - your World Of Warcraft engine is merely a 'playback engine', there's absolutely no danger of people having an easier time trying to cheat if they have the source code."

      Of course, not all games work like this

      Err.. how about none worth playing work like this?

      Brutally. Retarded. Is. You. So quit whining about not having games on Linux when you expect source code.

    2. Re:Open Source Engine, Proprietary Data by AlexMax2742 · · Score: 2, Informative
      If you're making games, it's usually a good solution to make the game engine open source, and charge for the data. The game engine can get ported to dog knows what platforms without any effort from you, and you can still get compensated by charging for the data files. The real value of a game tends to be in the data files, as they control the story line, the graphics, the sound effects, basically everything. The game engine is just like a library used to play the datafiles. Of course, not all games work like this.

      "Usually?" How many games have you made, sir? Where is your data?

      Meanwhile, here is a list of paid-for engines which you might have heard of, that get lots of money thrown at them from software developers:

      • Doom 3 Engine
      • Unreal Engine 2.0
      • Source Engine
      • Renderware
      • Gamebryo

      This doesn't even take into account the specific engines, such as Havok, or engines of past that have made their parent companies TONS of money, such as the myrid of engines created by id and Epic. They DO have value. Maybe not to the end user, but they DO have value to the developers who otherwise creating these games would be a bigger chore than need be. These engines prevents developers from having to re-invent the wheel, for sound code, graphics code, physics, etc., every time they create a game.

      He even said specificly "Is it even possible, short of distributing source code?". He clearly does not want to distribute his source, for one reason or another.

      --
      I'm the guy with the unpopular opinion
    3. Re:Open Source Engine, Proprietary Data by Anonymous Coward · · Score: 0
      "John Carmack - your Doom 3 engine is merely a 'playback library', the real value here is in the 'data files' (snicker)".

      This guy is clearly not John Carmack. How do I know? For starters, he's asking Slashdot for help. The number of game engines around who can be sold on their technical merits is an almost insignificant fraction of the engine code floating around out there.

      Rockstar - your Grand Theft Auto engine may not be entirely YOURS since you licenced the RenderWare 3D engine to build your game, but give me the source to it anyway.

      Obviously not a valid request. Of course, if you license your engine you can just bug your vendor for a version that works across as many Linux distros as possible. If you're Rockstar, you'll get it.

      Blizzard - your World Of Warcraft engine is merely a 'playback engine', there's absolutely no danger of people having an easier time trying to cheat if they have the source code.

      At this point I'd almost be willing to bet that WoW.exe has spent more time this year in IDA Pro than any other executable (save maybe parts of the Sony rootkit). While the code isn't available, the purpose of pretty much every function found in the executable is known (and is hooked by more than one library designed to help you cheat), and every file format that would be useful to a cheater is both thorougly understood and has free software code to read it. Having the code at this point would be a convenience, but a small one.

      What does this post have to do with the original topic? Nothing. How applicable are these examples to this situation? Not very. Move along now. Nothing to see here.

  13. Easy by orasio · · Score: 1, Funny
    1 - Statically Link everything
    2 - Realize you are linking GPLed or LGPLed libraries. Who will notice? They will.
    3 - Remove GPL and LGPL libraries.
    4 - Look for proprietary-friendly libraries.
    5.a - Develop for .NET. Be sure you charge enough for support.
    5.b - Cave in after finding you can't afford it, or you can't find what you want, and GPL your own code. Keep the artwork proprietary. Try to raise money to "liberate" your game.
    5.c - Pay for libraries. Distribute your games. Be happy.
     
    6.a - ???
    6.b - We profit
    6.c - Profit!!!
    1. Re:Easy by SolitaryMan · · Score: 1
      1. Statically Link everything
      2. Realize you are linking GPLed or LGPLed libraries. Who will notice? They will.
      3. Remove GPL and LGPL libraries.
      4. Look for proprietary-friendly libraries.
      1. Even dynamic linking of GPL'ed libraries into non-free software is prohibited
      2. LGPL'ed libraries ARE proprietary-friendly. This is the key difference between GPL and LGPL. You can link LGPL'ed libraries to whatever you like.
      --
      May Peace Prevail On Earth
    2. Re:Easy by orasio · · Score: 1

      1. True
      2. Not enough, for high values of proprietary-ness, such as the case we are talking about, where the guy wants to distribute binaries that run by themselves.

      --------

      I'll use this to bitch about moderation.

      I _do_ have karma to burn, but I really hate to see a +1, Funny , and then a -1, Overrated.
      Nobody cares that you think something is not funny. Punishing people who get Funny ratings (This combination is a -1 karma penalty), even if they are not fun to you, ruins my experience. I like silly comments, it's one of the things I come to slashdot for. There's no need to punish people, and waste moderation on them, just because they are not as serious as you would like. /rant

  14. Half-Binary by RAMMS+EIN · · Score: 2, Interesting

    If you absolutely can't have the source to your app open, you could do like the developers of binary kernel modules: ship your software in object format, with all the parts that interface with the rest of the system open source. That way, people can't read your actual application source, but they can compile and link the glue layer to make your code work on their system.

    If you take this approach, be _very_ careful to have _everything_ that interfaces with the outside system in the open source part; I've worked with kernel modules where some OS calls were still made from inside the binary part, and they were hell.

    --
    Please correct me if I got my facts wrong.
    1. Re:Half-Binary by jonwil · · Score: 3, Informative

      Even that doesnt necessarily work if C++ is involved and the system its built on and the one its run on have different GCC & libstdc++ versions with different incompatible ABIs...

    2. Re:Half-Binary by jonwil · · Score: 1

      I think the OP was refering to the fact that there were kernel modules that tried to be "open" by having all the OS calls abstracted away but in fact still made OS calls from the "closed" part.

  15. control the whole show by ubiquitin · · Score: 2, Interesting

    I'd suggest doing a bootable CD. You can have total control, then. In my limited experience, gamers are typically not too disturbed by having to do a reboot to get to their game.

    --
    http://tinyurl.com/4ny52
    1. Re:control the whole show by rbarreira · · Score: 1

      That depends on the game, and for some people, it even doesn't (they'd always be annoyed by that).

      --

      The AACS key is NOT 0xF606EEFD628B1CA427BEA93A9CA9773F
    2. Re:control the whole show by obeythefist · · Score: 1

      Ugh. I'm a windows gamer (I realise I am kissing my karma goodbye here) but I absolutely abhor rebooting my system at all, especially just to play a game for five minutes.

      It's the same reason I don't use Linux. I would like to use Linux. I know Linux isn't a beginner system and there's a lot of work involved in making it behave smoothly and completely on a system, I'm not afraid of that. I'm an I/T worker (this supports my gaming habit). But I don't use it because I need to play games, lots of games, and I don't want to pay for Cedega on the off chance that the games I want to play will be compatible with it. This leaves me with dual booting as the only viable option. That would mean an awful lot of restarts because I have a short attention span. And why restart when Windows happens to run all the apps I want as well as the games?

      It's even worse when you consider that there's no guarantee, as the topic informs us, that any binary you get has no guarantee of working right away like it does in Windows. I won't recommend Linux to anybody I know until I am 100% certain they will never need to compile anything, they will never need to know what a dependency is, and they will never need to use a text editor.

      Bye karma.

      --
      I am government man, come from the government. The government has sent me. -- G.I.R.
    3. Re:control the whole show by advocate_one · · Score: 1
      This leaves me with dual booting as the only viable option. That would mean an awful lot of restarts because I have a short attention span. And why restart when Windows happens to run all the apps I want as well as the games?

      I have two boxes under this desk, one Ubuntu Linux, the other XP... I have a KVM switch for swapping between them, so the flashy windows games are only a button click away, and I can leave one paused while getting on with real work on the Linux box...

      --
      Donald 'Duck' Dunn: We had a band powerful enough to turn goat piss into gasoline.
    4. Re:control the whole show by know1 · · Score: 0

      i run a webserver on my home box but i still want to be able to play quake 2 without taking down apache. linux users arenm't the same breed of windows users so used to reboots

    5. Re:control the whole show by bradkittenbrink · · Score: 1

      you totally don't need to reboot, just chroot to the cd's root dir.

  16. Binary Compatibility is an Illusion by RAMMS+EIN · · Score: 2, Interesting

    ``100% cross-distro compatibility. Is it even possible''

    In a word, no. Binary compatibility just isn't. It happens to work in very select situations, usually on proprietary operating systems that are themselves binary-only, which means the developers of the OS would be dealing with the same headaches you would if they broke binary compatibility.

    On Linux, where binary compatibility has very low priority because _everything_ on the system works fine without it, binary compatibility happens only by accident. It starts with the fact that Linux runs on many architectures, and people actually use it on most, if not all, of these architectures.

    Then there are distributions that are still using libc5. Think they don't matter? What happens when libc7 comes out? And if you think that isn't going to happen for a long time, how about when X.org replaces the monolithic structure they inherited from XFree86 by their new, modular one? Or how about when Qt 4 replaces Qt 3, or GNOME 3 is released? These projects are not going to let themselves held back because of your app. Because this is what binary compatibility means: slowing progress, because some changes become impossible.

    --
    Please correct me if I got my facts wrong.
    1. Re:Binary Compatibility is an Illusion by IvyKing · · Score: 1
      In a word, no. Binary compatibility just isn't. It happens to work in very select situations, usually on proprietary operating systems that are themselves binary-only, which means the developers of the OS would be dealing with the same headaches you would if they broke binary compatibility.

      There are a couple of paths that proprietary OS's have taken to maintain binary compatibility. One approach taken by Apple and Sun is to thoroughly document what will be the stable ABI and maintain backwards compatibility with that ABI. The other is the Microsoft approach which is to have purposely incomplete documentation on the ABI and then struggle to accomondate applications that use the undocumented ABI's. Linux, while having a well documented API, doesn't necessarily guarantee backwards compatibility (then again, neither did the original BSD - original as in from UCB).

    2. Re:Binary Compatibility is an Illusion by SanityInAnarchy · · Score: 1

      I like the way id has done this. Sure, way too much is statically linked, but often the games work even if you rip out their distributed libs and use the standard ones from the distro. And, by the time it becomes too much work for them to maintain the thing, it's also no longer profitable, so they release the source and let us worry about it.

      --
      Don't thank God, thank a doctor!
  17. Static Linking by yuri+benjamin · · Score: 0

    Static Linking. It results in bigger bloated binaries - but at least they're self-contained.

    --
    You make the mistake of thinking you can educate the fundamental stupidity out of people. You can't.
    1. Re:Static Linking by Omnifarious · · Score: 1

      This tactic is not legal under the LGPL. :-/

      I think the Open Source engine, proprietary content game is probably the best way to go. Of all the kinds of software out there, games are the kind where I question the viability of the Open Source model the most.

    2. Re:Static Linking by usrusr · · Score: 1

      i'm quite sure that losing the library reuse advantage of dynamic libraries is pretty much not a problem at all with games, since the typical user won't run a dozen of them at the same time (quite unlike anything office- or communication-related)

      what you still have is the harddisk space issue, but considering the typical ratio of code vs media in games this won't be much of a problem either.

      it would be a wholly different story in case of an IM client for example.

      --
      [i have an opinion and i am not afraid to use it]
    3. Re:Static Linking by yuri+benjamin · · Score: 1

      This tactic is not legal under the LGPL

      Unless the copyright holder(s) of the libraries agree to licence it under a different licence.
      Neither the GPL nor the LGPL preclude the owner from make individual agreements with other parties.

      --
      You make the mistake of thinking you can educate the fundamental stupidity out of people. You can't.
    4. Re:Static Linking by samjam · · Score: 1

      They are self contained.

      Do you remember the zlib buffer overrun problem a while back?
      So many appliactions statically linked to zlib had to be updated.

      How about the jpeg buffer overrun where MS provided a program to search out all the office apps that were statically linked to the joeg library so they could patch.

      I just thought I'd mention the downside.

      sam

    5. Re:Static Linking by FLEB · · Score: 1

      Once a library (or any software, for that matter) gets touched by enough fingers, though, doesn't that become a large problem, even just in finding out who to ask?

      --
      Information wants to be free.
      Entertainment wants to be paid.
      You just want to be cheap.
    6. Re:Static Linking by yuri+benjamin · · Score: 1

      I just thought I'd mention the downside.

      And good on you for doing so. Everything is a trade-off.

      --
      You make the mistake of thinking you can educate the fundamental stupidity out of people. You can't.
    7. Re:Static Linking by samjam · · Score: 1

      I like the .sig: "You make the mistake of thinking you can educate the fundamental stupidity out of people. You can't."

      Would that be a "stupid" mistake? heh!

      Sam

    8. Re:Static Linking by arkanes · · Score: 1

      It's *still* not legal under the LGPL - it becomes legal under something else which is not the LGPL. And you win the prize for "least usefull non-answer to a concern".

  18. klick by astrashe · · Score: 3, Insightful

    You might want to take a look at klik:

    http://klik.atekon.de/

  19. A couple of suggestions by bkhl · · Score: 1

    If you just link the stuff statically, you shouldn't have much trouble.

    I would probably set up an apt repository for Debian, where it's easy to make sure it works with the given dependencies. I would complement that with a statically linked rpm and plain old tarball.

    Well, in actual fact I would also distribute it as FOSS, of course. I doubt that would impact your revenue negatively. Rather, the fact that people have the possibility to patch bugs and port it themselves would probably make them more willing to shell out for it in the first place. There's few things as frustrating as broken software that you know you could fix, but the creator won't let you.

    1. Re:A couple of suggestions by Holi · · Score: 1

      ...would probably make them more willing to shell out for it in the first place

      Oh yes, because I see so much open source software making money on sales. More likely it would be copied and passed around on the p2p networks with no worries. I personally don't think games will ever do well as open source, to much capital has to be spent on development to allow anyone to give it away. You also would have massive cheats created for any network play which has killed several games.

      --
      Sorry, teleporters just kill you and then make a copy. A perfect, soul-less copy.
    2. Re:A couple of suggestions by bkhl · · Score: 1

      Oh yes, because I see so much open source software making money on sales. More likely it would be copied and passed around on the p2p networks with no worries.

      How is that different from any other computer games, now?

    3. Re:A couple of suggestions by binford2k · · Score: 1

      Why the hell would an open source game be copied and passed around on the p2p networks?

  20. chroot. by torpor · · Score: 1

    distribute your game as a chroot'able .dd.tar.gz file ..

    --
    ; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
  21. huh?? by mkcmkc · · Score: 2, Informative
    Can't statically link LGPL-licensed libraries? That's news to me. What is it that makes this impossible?

    Mike

    --
    "Not an actor, but he plays one on TV."
    1. Re:huh?? by mabinogi · · Score: 1

      You can statically link, but if you do so and distribute, then you must provide the source of the application you statically linked the libraries in to.

      The LGPL only allows for dynamic linking without providing source, and the resulting application must allow the substitution of newer or improved or replacement version of the libraries you link to.

      Personally, I'd question the need to use any sort of license if you just want to dynamically link - you're not using any of their code (assuming the header files contain only prototypes and simple constant #defines), so as long as you're not distributing their binary yourself, why should you need to accept a distribution license? It's not an infringement of copyright law to call an API.

      --
      Advanced users are users too!
    2. Re:huh?? by Mprx · · Score: 2, Interesting
      See LGPL section 6a:
      Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
      Static linking is allowed as long as you provide the object code so users can relink with a modified library.
    3. Re:huh?? by mabinogi · · Score: 1

      ahhh, OK.
      I can see I'll have to read it again a few times. The GPL is easy enough to understand, but the LPGL kinda makes my head hurt.

      --
      Advanced users are users too!
    4. Re:huh?? by arkanes · · Score: 1

      Rule of thumb is this: If you use an LGPL library, it must be possible for the end-user of your application to replace the LGPL library with something else. Theres a few different ways to do this - dynamically link, statically link but ship source, statically link but ship object files & linker scripts.

  22. that's what I do :) by theluckyleper · · Score: 1
    As an odd suggestion: why not build all your code into objects and distribute those with a little script to link them on the client machine into an executable.
    That's exactly what I already do, actually :) It works on about 90% of the Linux machines it has been tested on, but I want that last 10%!
    --
    Visit the Game Programming Wiki!
  23. Libs by Anonymous Coward · · Score: 0

    Static: Ah nice big pile of .a's or in Win .LIB, internet? wooz that
    Dynamic RTL : WEEEEEEEEEEEEEEEEEEE I just rely on $env, luck and def-alt
    THINKS
    Put the whole sheebang in and RDMS/SQL thing hidden even from uber-admin; viz Prog A calls proc Z in Lib G ver 1.2.3.4.5.6.7.8 mean while MEGA BIG HDD provides space for all libs ver 1.2.X up to 2.0.1.z
    Anything missing is XMLed/RSSed to the server(s) which contained said lib (obv. RTL)
    If only someone like SUN could think that up, maybe replace those 1.2.3.x with say a DNS style address...
    Oh and regression testing is a breeze, or do I mean wind/gale/typhoon?

    STOP programing, LEARN libs, STOP LEARN LIBS, FLUSH, RE-LEARN LIBS
    IF (OPPS .LT. deltaOPPS) THEN
          LIBS == CLASS
    ELSE
          java
    END IF
    {where LIBS & CLASS are submembers of CODE}

  24. There are a few different options by fdragon · · Score: 4, Informative

    You can do a few different options, each with their own drawbacks. Depending on the libraries you are currently using you will possibly have to use a combination of these items.

    Static linking allows you to distribute a single binary that will run on any linux system so long as you have the correct minimum kernel version and CPU. Some of the problems with this will include the license on the libraries you are using may not allow this, and the application's code image changes from what you have debugged against.

    Dynamic linking and putting all of the required dynamic libraries your application requires in their own personal library directory. This is the quickest solution, but not always the best solution. It does allow you to release periodic incremental patches to the binaries used by your applicaton.

    Usage of a application such as Elf Statifier to take your debugged dynamic application, and bundling the applicable libraries into your application. This is a halfway point between a completely dynamic and static application that allows you to take your "GOLD" release and package it up without changing the generated code in your application.

    Just release your application as a dynamic application and mark it with the correct dependancies in RPM format and follow the Linux Standards Base.

    Most commercial applications will use either the 2nd method (dynamic and distribute all their own versions of various dynamic libraries) or the 4th method. In both cases they specify a message to the effect of "We support X distro version Y. It may work on your linux distro, but we only support X version Y."

    As you are planning to make money off of this game, I wish you luck, and suggest you take a look into what the most popular linux distros for your target audience will be. Based on advertisements from Wal-Mart and Fry's selling Linux preloaded I would bet Linspire and Xandros is high on that list. As with all things, don't forget the testing across many distributions to make sure the solution you choose actually works.

    --
    The program isn't debugged until the last user is dead.
    1. Re:There are a few different options by Anonymous Coward · · Score: 0

      Just release your application as a dynamic application and mark it with the correct dependancies in RPM format and follow the Linux Standards Base [linuxbase.org].

      And meet the wrath of everyone who hates RPM. I.e. the geeks. You know, the people who spend more time in front of the computer than with a girlfriend ("a what?"). Aka. your primary customer group.

    2. Re:There are a few different options by cortana · · Score: 1

      The LSB specifies RPM as a distribution format. It does not mandate its use as a package manager. They could (should) have picked 'gzip compressed tar archive' for all I care. The point is that LSB software comes in a standard format that it is easy to install on any LSB compliant system. For example, on Debian (and derivatives), you do:

        alien --to-deb blah.rpm
        dpkg --install blah.deb

  25. fun idea by Mage+Powers · · Score: 1

    I saw blah blah blah distro, so fun idea, why not make the necessary libraries for running the application available, and then run the program in a self contained box (chroot jail?) for distros that wont work with said game?

  26. How to kill Linux (as per Unix) by davecb · · Score: 3, Insightful
    If you can't run the same binaries on all the distributions, then you're on the way to suffering from the same thing that made Windows so much more popular than Unix.

    Distributors who want to make it hard for you to run your binaries are every bit as wise as the Unix vendors who tried to avoid standardization and the risk of mutual success...

    --dave

    --
    davecb@spamcop.net
    1. Re:How to kill Linux (as per Unix) by Anonymous Coward · · Score: 1

      Library hell on Linux is ten times worse than DLL hell ever was on Windows. So that ship has already sailed...

    2. Re:How to kill Linux (as per Unix) by Anonymous Coward · · Score: 0

      It's not that they don't want applications to run, it's just that someone is going to use a newer version of some library, with some bug fixed that the app depends on.

      The solution is to included the required libraries with the game (using LD_LIBRARY_PATH), like suggested in about a third of the posts here. And btw, that's the way it's done on Windows.

    3. Re:How to kill Linux (as per Unix) by davecb · · Score: 1

      And that's the root cause of DLL hell (:-)). Shipping down-rev libraries with applications and adding them to a the general LD_LIBRARY_PATH is something of bad thing.

      Now, I'm sure you meant one should put them in a different place ad set the application's LD_LIBRARY_PATH or load path, but many Windows and some Unix folks do it the wrong way.

      I admit I'm being grumpy, but it burns my ass when folks repeat the same mistake over and over again, expecting a different result. The library problem was solved in the era of CTSS and Multics, but VMS, Windows and most Unixes failed to notice.

      I owe the community a transcription o Paul.Stachour@HI-Multics.ARPA's talks on continuous maintenance, which is an accessible discussion of t problem an the solution set.

      What I don't have is a talk on the larger problem, that of putting yourself out o business by letting marketing differentiate you so much that customers can't write portable software for your distribution.

      --dave (DRBrown.TSDC@HI-Multics.ARPA) c-b

      --
      davecb@spamcop.net
    4. Re:How to kill Linux (as per Unix) by Burz · · Score: 1

      Many of the better-behaved Windows apps explicitly search the application's containing folder for DLLs, instead of mucking with system-wide path variables or (worse) trying to copy their stuff into \WINDOWS. The typical Linux development model doesn't even try to address this issue for the end-user, and instead codifies something resembling "stuff it into \WINDOWS" as normal behavior... then invents a "package management" system as a band-aid. Then, you pray to the package management system every day and hope that having this "culture" makes up for not having a stable platform.

      Apple takes the most workable approach IMHO: Use appdirs as a general rule, and document which APIs are stable and which are still evolving.

  27. autopackage by mrsbrisby · · Score: 2, Informative

    autopackage is probably the current best tool for this. It makes a single, easily installable (and removable) package while coercing my system's GCC and libs into versions that are suitable for other distributions.

    I use it currently for schism tracker (particularly the CVS builds that I do).

    It works very well for me: Debian, Ubuntu, SUSE, Fedora, Gentoo, and Mandrake users have reported success with these binaries built with (gasp) a lone FC4 machine.

    One day, I'll actually do a proper release and six years later it'll show up in the next Debian release. Then your fancy apt-get tools will work.

    And to kneejerk jackasses that say "just release the source"- you must realize that the source is good for you and me (well me anyway, I cannot speak for you, obviously), the people who USE these programs have absolutely NO INTEREST in doing the work that I have just done for my own purposes.

    Plus, having them use a single binary means that it's very easy to debug with nothing more than a core file.

    Oh, and I suppose I am giving the submitter the benefit of the doubt that we are indeed talking about Free Software, aren't we? :)

    1. Re:autopackage by lachlan76 · · Score: 1
      This is related to Gentoo, but it explains quite well IMO why autopackage is flawed.

      For the non-clickers among us:

      1. To even unpack the package, you must run arbitrary code supplied by an untrusted source.
      2. They install directly to the live filesystem.
      3. Their intrinsic dependency resolver is broken.
      4. They do not support the filesystem layout used by Gentoo.
      5. They do not support configuration protection.
      6. They can clobber arbitrary files on uninstall.
      7. The linking mechanism used is insufficiently flexible.
      8. The entire format is completely unportable and highly tied to x86 Linux systems.
    2. Re:autopackage by Burz · · Score: 1

      Why is a vendor website "an untrusted source"?

      That's like saying Firefox extensions are broken, because they might come from sites other than mozilla.org.

    3. Re:autopackage by bogado · · Score: 1
      Why is a vendor website "an untrusted source"?


      * Because the site may have been hacked?
      * Because the package may have been downloaded from an untrusted mirror?
      * Because the package may have came from an untrusted third party?
      * Because the proxy server of your institution may be compromised?

      Usually the distribution package checks a signature that is already trusted, either by a one time download of a key or by having being installed by the original cd-rom. The problem with runing a package to install it is that every package has a chance of being compromised. Shure it is possible to get a fony key and a fony package, but it is a lot harder.

      Securing program and packages install is a very hard problem, people don't want to be bothered with password or checks. But they will surely be very mad when the computer starts to become unusuable bue to spyware, and they blame windows now, and if this come to be under linux they will blame linux also.
      --
      []'s Victor Bogado da Silva Lins

      ^[:wq

  28. But I still love SUSE 10 anyway... by guardianfox · · Score: 1

    Many distrobutions = Good, (more competition, more innovation).

    HOWEVER, the catch is that the answer to the above question is not a unanimous "Yes, here's how and it'll work for most if not all distrobutions." Why? Too many variables to account for. To be almost universal across the linux distro, you'd have to release at least three different binarys (which at most covers a dozen or so of the most common distros). To make it completly universal across all linux distros, you'd have to release your source codes and provide detailed instructions to compile for some of the more difficult distrobutions AND be prepared to make adjustments and help people with new flavors of linux every day.

    How many times have I found a reasonably popular piece of software for linux, and been detered by a compile process that was either too complicated (and undocumented) or that produced a binary that just didn't work. I personally shy away from any software that has to be compiled unless I REALLY want it. Sure, two times out of three it moves along painlessly, but when there's a problem it can sometimes be a *badword* to figure out. How many times have I found a great looking linux application only to discover that they dont release ANYTHING for my distrobution and maybe only even for some obscure distro. It's a pain in the hindquarters.

    Alternativly, you could release your games online in flash. I realise that isn't the BEST business model and that it's NOT universal across all platforms, but you have a standard that works for a large number of Linux distrobutions AND Mac AND Windows.

    We need a single standard for software under linux... and a full-featured set of libraries to go with it. Whereby if a coder chooses to write for all linux platforms he'll know that if it works for one, it'll work for everyone who complies with the standards and keeps their libraries up-to-date. If that coder chooses to code specifically for some special feature found only in one or two distros, so be it... but at least the divide wont HAVE to be there.

  29. Write Once, Run Anywhere by Anonymous Coward · · Score: 0

    This was the idea behind Java. Have you looked into using that?

    1. Re:Write Once, Run Anywhere by Anonymous Coward · · Score: 0

      This was the idea behind Java.

      You're right, it *was* the idea, originally. Unfortunately the idea got lost somewhere in its implementation.

      I run many dozens of languages across many different kinds of boxes, and have not the slightest problem with any of them ... except for Java. It's the least portable language of any that I've ever experienced, and I'm a languages person. It's so bad that when a Java application is found to work, it's a matter of some surprise.

      This is such a pity. The original idea of "Write Once, Run Anywhere" was superb.

  30. Re:Staticly link EVERYTHING. It's the only way. by Tamerlan · · Score: 5, Informative

    As someone who is involved in supporting commerical closed-source applications on 3 Windozes, 5 Linuxes and 4 Solarises, I must confess - binary compatibility on Linux is too damn hard.

    Solaris is way better than Linux in that regard, everything compiled on lower versions always works like a breeze on higher versions. Windows has a clear dividing line between retarded 95/98/ME and 2000/XP/2003/Vista, but we do not support 95/98/ME anyway, so binary compatibiity on Windows is wonderful, aside from some minor glitches with missing DLLs.

    Now, binary compatibility on Linux is a total pain in the butt. Incompatibilities in glibc 2.2 vs 2.3, pthreads vs nptl, gcc C++ ABI is broken on every other gcc release, thread local storage, just to name a few hurdles.

    Distributing statically linked executables is the most reliable way to go, if you want to support as many Linux variants as possible. However, there are few things to remember:
    * If your application is security-critical, you link against static library and later security flaw is found in the library, OS security update leaves your application vulnerable.
    * Never link statically with libdl. For example, application, statically linked on RH 7.3 witl libdl will misteriously crash on RH9
    * Size of executables is big. Even worse if you have many executables using same libraries.

    Oh, you said you are going to market games... Boy, you are better to build them for Windows anyway. Don't let me be misunderstood, I love Linux (except, for its binary (in)compatibility, of course), but it's just not the right market and business model for you anyway.

    If you keep insisting on Linux, here is a hint. Most commercial vendors shipping products for Linux are oriented towards a limited number of distros, those used in enterprises. RedHat and SuSE that is. Mandriva? Ha-ha-ha. Oh, you say, Ubuntu and Debian are popular? Ouch, not among our cutomers.

  31. Just program it to do that. by rice_burners_suck · · Score: 1

    Dude, all you have to do is build a static binary that doesn't need any outside files, and program it so that the only thing outside of your program that you depend on are system calls that have been around since, say, kernel 2.4 or so. Then, you're just about guaranteed that your software will work on any system. In fact, if you use system calls that are pretty much available on any *nix, then you're pretty much guaranteed that it will work on anything with an x86.

  32. Java and Python dependencies by Latent+Heat · · Score: 1
    Python has its dependencies -- you have to figure out which GUI, there are other interesting libraries. You don't just install Python -- it is Python plus a bunch of supporting stuff.

    Java on the other hand is Java. Unless you want to go the SWT route, if you are using Swing/Java2D, all the stuff is there.

    1. Re:Java and Python dependencies by grotgrot · · Score: 1
      Java on the other hand is Java. Unless you want to go the SWT route, if you are using Swing/Java2D, all the stuff is there.

      Errm, that isn't true except for trivial applications. A standard Linux box will not have all the many libraries used to run bigger Java applications. How do they print, how do they do databases, what about Hibernate, servlet containers etc

      A good example is a finance manager. Look at how many libraries it needs:

      http://www.gnucash.org/en/required.phtml

      With a program like Azureus you may need log4j and commons. Again it is pretty random as to whether a distro includes those and how up to date they are.

    2. Re:Java and Python dependencies by Anonymous Coward · · Score: 0

      Errm, that isn't true except for trivial applications. A standard Linux box will not have all the many libraries used to run bigger Java applications. How do they print, how do they do databases, what about Hibernate, servlet containers etc

      ??? Java apps aren't going to need servlet containers - that's for server side code which (obviously) woudln't be running on Joe User's desktop. Printing is part of the AWT (in every Java install), as is JDBC (database access) these days. Hibernate is a red herring - if you want it, just include the jar files it needs. No biggie.

      With a program like Azureus you may need log4j and commons. Again it is pretty random as to whether a distro includes those and how up to date they are.

      With Java, you can include jar files (akin to Unix's share object .so files) with your app, and set the classpath (kind of like LD_LIBRARY_PATH) on each run of the JVM. What this amounts to is that Java apps usually come with a shell script to use the correct parameters and include all the needed jar files on Unix platforms, and a .bat or .exe file to do the same on Windows.

      None of the problems you mentioned are real problems. You don't rely on the OS to provide those libraries - you include them with your app. With Java Web Start, its even easier, as the install process consits of clicking a link on a web page, then hitting "ok" on a couple of dialog boxes.

  33. distribute the libs you need, except glibc by molo · · Score: 1

    Distribute all the shared libs you need, except for glibc. (BSD licensed, right?) Link all your binaries (including shared libs) against an older glibc version, and it will be forward-compatible with newer glibc versions, thanks to versioned symbols.

    This pretty much guarantees compatibility across distributions. Just make sure the glibc you link against is old enough. Then just distribute binary tarballs and tell people only "glibc 2.2 or newer required" "glibc 2.3 or newer required" etc. It works pretty well.

    -molo

    --
    Using your sig line to advertise for friends is lame.
  34. Been there, done that. by NullProg · · Score: 1

    We (my company) use a disk image from Redhat 6 to compile binaries. Old versions of gcc, X, gtk etc. The programs work fine on everything new. GCC/Gtk/QT all need to do a feature freeze for programs to work in all distros IMHO. I might suggest to also looking at the loki installer. It works on new and old Linux systems.

    Enjoy,

    --
    It's just the normal noises in here.
  35. Re:You make games for a living? by patio11 · · Score: 2, Interesting
    I'm a fairly hardcore gamer with a 20 hour a week WoW habit. My last three game purchases were WoW (one year ago -- that sure sucks the life out of your gaming time budget, saved me a lot of money though), Civ4 (played it compulsively for a week, great for days I don't feel like playing WoW), and... Pizza Frenzy. Its a really simple arcade-style game, which involves mindless clicking... and its just hilariously fun. I blew through two hours before I even knew what I was doing. $20 for mindless brain candy? Sign me up. And this is the sort of game that could keep my father busy forever (he's one of those crazy Freecell players who does it like its his job).

    Gamers shouldn't condescend so much to the casual gaming market, and certainly not their developers. These guys are living the dream, after all (and realizing the dream means coding down in the trenches). Power to you, Linux-supporting casual gamer guy.

  36. Not so hard by jd · · Score: 2, Interesting
    Java and Python are only maybes - different versions of the engine may break the scripts. (Actually, if you're going to include scripts, then you can also include Perl, Tcl/Tk, Ruby and Scheme.) The only way to be 100% sure a script will run is to also ship a copy of the interpreter (statically linked) which you conditionally install if no interpreter is installed or is the wrong version.

    For regular binaries, a static build is pretty much guaranteed to work. Alternatively, all Linux distributions I know of do honor the LD_LIBRARY_PATH environment variable. Create a library directory on the target computer, then test the libraries already installed. If the ones you want are either not there or the wrong version, copy the ones you have on the CD into the library directory and have that directory searched BEFORE the default system library directories.

    If using custom versions of standard libraries, use a chroot jail to guarantee that the program cannot see the regular library directories.

    If you don't actually need standard functions at all, but use your own routines and maybe some system calls, then there's absolutely no problem - just remember that when you compile, you want to PREVENT GCC from linking in the C library. Rescue tools, installers and other components that have to run PRIOR to being able to check versions, etc, should either be statically linked OR not linked at all.

    If you want to avoid including stuff that might not be necessary, then you can use yet another technique. Write a "loader" program and include that as source. All the loader does is dlopen() the application (which is now written as a shared library, not an executable) and start it up.

    This technique works by linking to the installed libraries in the wrapper, and then when you dlopen() the application, the application can then access the linked libraries. The linking is entirely done in the wrapper, which would always be compiled for the local system.

    This technique would only work if all the required libraries are present, and the parts of the API that are used are present and the same. If you write to the libraries which are damn-near universal, then this will work. If you are writing to libraries which are not universal, then you would still have to do the whole process of checking and installing your own libraries, then setting the LD_LIBRARY_PATH. In which case, don't bother with the wrapper and just do that for all libraries.

    A final option is to provide TWO programs. The first program assumes nothing about the native system and doesn't do any checks at all. It just installs everything it needs in local directories, sets all the paths as needed, and runs in its own corner.

    The second program would be a clean-up program. It has a list of applications it knows about, what versions of what libraries are needed, etc. It would pull libraries that are not system-wide into a standard set of directories, then use symlinks or LD_LIBRARY_PATH to repoint applications to where the libraries are. It would also need two additional capabilities - deinstalling libraries when NO application still installed uses it, and updating records (and shuffling links as needed) when an application is updated.

    The reason for the second program is that many developers (especially commercial vendors) have the same problem. If a standardized mechanism existed for library tracking, with a well-known API, I believe it would become very popular very quickly. If such a program were developed, and was sufficiently widely adopted, you could abandon system-wide libraries altogether. Which would be no bad thing, as the existing system has problems with multiple versions and will also fail when libraries have the same filename. It's also slow when you've a lot of libraries installed.

    By creating virtual directories, in which the ONLY libraries present are ALL that the application needs, you eliminate not only the application/library issue, but al

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  37. Re:Staticly link EVERYTHING. It's the only way. by orangesquid · · Score: 1

    I think his best option is to distribute packages for various common distros, and a few statically-linked tarballs for everything else. Another thing that comes to mind is CPU optimizations; I don't know if he's thuoght of this, but is he distributing generic 80386-compatible packages, or things designed to run on MMX or 3dNow! chips?

    Kermit and distributed.net are examples of places where you can almost always find a binary for your system. Those might not be bad places to look to figure out what sorts of binaries people actually find themselves needing. You're right---there aren't going to be millions of Ubuntu users out there, but for those that are there, static linking might be okay. It's true that security fixes in shared libraries aren't going to fix the same flaws in statically linked binaries, but if someone is using a non-mainstream distribution, they're more likely to be more security-conscious anyway, and probably will only run binaries they didn't compile themselves under special UIDs or chroot jails, so it's probably not a big issue.

    Automagically-obfuscated source code is always an option, although remember it's only obfuscation, so if someone figures out your secrets, you're out of luck. Of course, obfuscated source code isn't that much different from assembled code, sicne you can always disassemble/reverse-engineer binaries to get some form of obfuscated source...

    --
    --TheOrangeSquid Is it any wonder things seem so awry? We swim in a sea of confusion and don't have to think to survive
  38. Use a virtual machine? by Sad+Loser · · Score: 1

    It depends what sort of games you are writing, but if not graphics intensive, you could package the game+all essentials on a lightweight linux distro, and put the whole thing out as a virtual machine using VMWare Player.

    --
    Humorous signatures are over-rated.
  39. Moderators on crack by Anonymous Coward · · Score: 0

    The parent may be completely wrong, but it's certainly not trolling. The post provides a perfectly viable and logical explanation of the point it is making about binary compatibility.

    Just because you (or I) don't think that the explanation is likely doesn't make it a bad post. And it's certainly not a troll (ie. done for effect) by any stretch of the imagination.

    Go easy on the troll key. In this case it was totally misapplied.

  40. Re:Distribute source and binaries by wysiwia · · Score: 0

    I do distribute source but i'd like to distribute binaries as well since building from source isn't what everybody likes. E.g. I've made a simple sample code for the Tor GUI contest (http://wyoguide.sf.net/index.php?page=tormgr.html ) but to build it from the source, to get an idea how it works, isn't easy for everybody. O. Wyss

    --
    See http://wyoguide.sf.net/papers/Cross-platform.html
  41. How it works in an ideal world where LSB works... by cortana · · Score: 2

    Package your software into an LSB RPM. Anyone (using an LSB compliant distribution) can then install it.

    If you are using libraries that the LSB does not specify, build private copies and distribute them in your package.

    Good lord! That's pretty much exactly how software distribution works on Windows! :) And it works pretty well.

  42. Remember STATIC linking? by Anonymous Coward · · Score: 1

    Whatever happened to the good old days before dynamic libraries?
    We used to link EVERYTHING static and we had a stand-alone binary.

    I miss the old days...we've got the resources for it...multi gig RAM, multi-multi gig hard disks, etc.

  43. Need J2EE for a game? by Latent+Heat · · Score: 1

    Yeah, but how much of these libraries do you need for a game?

    1. Re:Need J2EE for a game? by Taladar · · Score: 1

      Probably none of those but an equal amount of different ones.

      Disclaimer: I didn't actually look at the list so the "none of those" part might be wrong.

  44. Re:Staticly link EVERYTHING. It's the only way. by Anonymous Coward · · Score: 0

    You mean Linux still has DLL hell? MS solved that with COM.

  45. other archs by Anonymous Coward · · Score: 0

    you might also want to think about making it work on linux on powerpc, amd64, sparc etc.

  46. Oh come on! by Anonymous Coward · · Score: 0

    Call those games? Jeez, you could have done that simple stuff in java.

  47. autopackage has been working on this stuff by petermgreen · · Score: 1

    whether or not you like thier installer/package system you would be pretty mad not to check out thier developer tools.

    another option is to build on the oldest distro you plan to target.

    in any case there are two main issues with building distributable linux binaries

    1: glibc symbol versioning
    glibc uses a symbol versioning system that means builds made against a newer glibc not work with an older one.

    2: macros in headers. e.g. if you use gtk 2.4 headers then your binary will end up relying on new gtk 2.4 features even if you don't use them in your own code.

    both can be solved with some effort i don't know of the details myself but i know autopackages developer tools have found ways to solve the problems with many common libraries.

    also if you use C++ libraries (like qt) there are abi issues which basically force you to ship more than one binary. i belive autopackage has recently gained the ability to build multiple binaries for such apps at once and then select the appropriate one at install time.

    --
    note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  48. statically link with every dependency by sashang · · Score: 2

    nuff said. the reality is dynamic linking causes more problems than it solves. the argument about it saving space is 'blah' (i.e. true but irrelevant).

  49. Re:You make games for a living? by kimvette · · Score: 1

    Since when is gaming all about eye candy? Commander Keen is still a ton of fun to this very day. It'd be nice if Id or Apogee were to update those games with newer graphics, but that wouldn't make the game any more fun. Heck once in a while I boot up C64 games in VICE and a lot of games for the commie blow away nearly any modern PC or PS2 games for pure fun and playability, even with its lowly 2bpp graphics.

    --
    The Christian Right is Neither (Christian nor right). See: Matthew 23, Matthew 25, Ezekiel 16:48-50
  50. Binary Compatibility is a long-solved problem by davecb · · Score: 1
    I used to be on the ABI team at Sun that did this, and it's really pretty trivial.

    A minimally necessary step is to label interfaces with what revision of what standard they use. The distributor then adds interfaces labeled "POSIX 20.3.6" (an imaginary standard) when the 3.6 release comes out. They don't remove the 20.2 stuff until no-one uses it any more (e.g., when they switch from 32 to 64-bit), and ELF apps link to the version they need.

    If an application needs a newer version than 20.2, the user can download the newest version from the distributor and have all the versions up to and including 20.3.6.

    If, on the other hand, the app needs 20.2.19, it's already there.

    And, by the way, the number of down-rev functions needed in libc or the other system libraries is diminishingly small, as standards don;t change very much. Variability is usually seen in application libraries.

    The next, optional, steps can be found at MIT, in the documents about CTSS, ITS and Multics: this problem was solved long before Unix saw the light of day.

    --dave

    --
    davecb@spamcop.net
  51. Software distribution model by jbolden · · Score: 1

    Linux solved this problem by changing the software distribution model from being customer centric to being distribution centric. I.E. Customer gets software from distribution who compiles and configures software from source. The problem with commercial apps is that they want to bypass the Linux model and use the Windows model where: Distributions are configured similarly enough so that the same app runs on all versions. Companies that want to run commercial software succesfully under Linux on machines running multiple apps: Oracle, DB2, cross-over, OEA products... work with distributions not directly with customers for configuration.

  52. What about Mono? by darnok · · Score: 1

    An option that nobody seems to have come up with yet is to use Mono. Yep, it's reverse-engineered "MS crap", but it's actually really good. C# is a nice language to develop in.

    Assuming you *can* switch to Mono (and that's a really big "if" there), you could supply instructions for how to install Mono at your Web site for the common distros - it's simple for all Debian-based distros and for Gentoo, and probably RedHat/Mandriva/etc. as well. Alternately, you could (possibly|probably) ship Mono with your code, in something broadly similar to a statically-linked binary.

    A big advantage of using Mono would be if you decide you want to ship to Windows users as well - it could be as simple as changing your UI code.

    Not guaranteeing that it's a good solution for you, but it might be.

  53. glue layer and lib auto update by Mungkie · · Score: 1
    I looked at doing something like the debian boot floppys library mklibs.py script with a glue layer. The basic concept is :
    • write your program
    • run script to:
      • scan for required stubs
      • all custom lib code copied to custom dir and procnames renamed to xxx_callname.
      • glue layer library created where callname -> xxx_callname
    • compile custom lib
    • compile glue layer
    • compile your program, link it to glue layer
    • distribute program binary, source code to the glue layer, the code for the custom library, and a script to check dependency for the glue layer.
    • the user then runs dependency check script and compiles only missing lib calls and links to those available when the glue layer is compiled
    advantages

    This allows you to avoid the GNU licence problems as you only link to your glue layer library.

    You make it simple for the user to compile all required library code as you distribute everything and avoid the possibility of missing librarys.

    You still have the advantage of shared library

  54. You make a living doing this? by MooseTick · · Score: 1

    "I make games for a living, and I want to ensure that my games will run on as many Linux distros as possible."

    Are you saying that you make a living making games for Linux? Its a great OS and gaining support every day, but I find it hard to believe anyone is making a living creating games for it. I can see making a living creating games for PDAs or cell phones, but not for Linux PCs today. Perhaps in 5 years it will be possible, but not today. Its good someone is out there making games and trying, but making a living?

  55. Re:Staticly link EVERYTHING. It's the only way. by Skapare · · Score: 1
    * Never link statically with libdl. For example, application, statically linked on RH 7.3 witl libdl will misteriously crash on RH9

    I've heard about this problem, but I don't recall whether it is due to a bug in glibc, or a bug in Redhat's many modifications. I just know I haven't run into any such problem in Slackware. I don't even touch Redhat anymore given so many issues like this.

    Oh, you say, Ubuntu and Debian are popular? Ouch, not among our cutomers.

    Maybe you should do a survey of your Linux customers and find out exactly why they chose the distribution they are using. I'll bet the answer mostly turns out to be things like "more applications support it". Then you'll see the circular argument. Suffice it to say, if more software makers supported a platform like Slackware or Ubuntu, then more people would choose it. When more people choose it, your market for that version enlarges. There will be other reasons for choosing something like Redhat, such that's what the CEO first heard of.

    Then take the subset of cases where the decision of which distribution was left up to a technical person who has lots of experience, and you'll find a wider, and better, variety.

    --
    now we need to go OSS in diesel cars