portable applications

2009-06-24 Thread John Zavgren
Greetings:
I wrote a Glade-3/GTK2/G++ application on a ubuntu machine, and the
application works great. In fact it works so well that my colleagues want to
use it. Ujnfortunately, they are not using ubuntu (and neither was I until I
started developing my GUI. I chose ubuntu because it seemed to support GUI
development.)

I tried running my app on a Red Hat machine and the app failed because of an
unresolved external reference,,, missing shared object file.

No big deal. I attempted to statically link my app with the assistance of
strace, the doctrinaire approach with embedded systems. That opened
pandoras box! The number of references to shared object files was
astounding.
My intuition tells me that there must be a better way to build an
application that will run on more than one Linux machine.

Is there a simple way to statically link the esoteric aspects of my GUI

-- 
John Zavgren
603-371-0513 (home)
603-801-2094 (cell)
j...@zavgren.com
-
I want to retire with dignity like my father, not like the thousands of
productive people who's careers ended when he eliminated the RD department
to inflate short term profits.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: portable applications

2009-06-24 Thread Dan Kegel
On Wed, Jun 24, 2009 at 5:41 AM, John Zavgrenj...@zavgren.com wrote:
 Greetings:
 I wrote a Glade-3/GTK2/G++ application on a ubuntu machine, and the
 application works great. In fact it works so well that my colleagues want to
 use it. Ujnfortunately, they are not using ubuntu (and neither was I until I
 started developing my GUI. I chose ubuntu because it seemed to support GUI
 development.)

 I tried running my app on a Red Hat machine and the app failed because of an
 unresolved external reference,,, missing shared object file.

 No big deal. I attempted to statically link my app with the assistance of
 strace, the doctrinaire approach with embedded systems. That opened
 pandoras box! The number of references to shared object files was
 astounding.
 My intuition tells me that there must be a better way to build an
 application that will run on more than one Linux machine.

There is.  Check out http://ldn.linuxfoundation.org/lsb
(Or, as a first approximation, build your app on an old
version of linux, like Ubuntu 6.06.  But lsb is a better way
to go if you can do it.)
You don't need to create lsb packages; just building with
the lsb sdk will make your program more portable.

 Is there a simple way to statically link the esoteric aspects of my GUI

In general, static linking doesn't work well these days.  glibc
and several other libraries use dynamic linking at runtime.
- Dan
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: portable applications

2009-06-24 Thread Michael Torrie
John Zavgren wrote:
 My intuition tells me that there must be a better way to build an
 application that will run on more than one Linux machine.
 
 Is there a simple way to statically link the esoteric aspects of my GUI

You can use the ldd command to see what your binary is linking to.
The biggest problem you will run into is that your version of GTK may be
newer than the version of GTK on the machines you are trying to target.
 For example RHEL 5 probably is about a year or more behind Ubuntu in
terms of GTK version.  That said, GTK is supposed to be ABI stable for
the entire 2.x series.  In other words as long as you don't use an API
that was introduced along the line, it should run fine with older
libraries.  In practice it may not always work.  What most companies do
that distribute GTK-based software is to ship the GTK runtime libraries
with their app and using a script fall back to them (using the
LD_LIBRARY_PATH environment variable) when the system GTK will not
suffice.  However to make that work well you have to make sure you're
not trying to link against a version of GLIBC that is newer than the
target OS.

I think, however, that your best bet is to give your coworkers the
tarball and have them do a ./configure ; make ; make install.  With
source code available, that is the easiest, best, and most portable way.

So to summarize, the things you have to worry about are:
- target GLIBC version
- target GTK2 version
- target architecture (32-bit vs 64-bit)


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: portable applications

2009-06-24 Thread Thomas Stover



Date: Wed, 24 Jun 2009 08:41:50 -0400
From: John Zavgren j...@zavgren.com
Subject: portable applications
To: gtk-app-devel-list@gnome.org
Message-ID:
8bea388a0906240541p1bc747c7x174a9b35828b5...@mail.gmail.com
Content-Type: text/plain; charset=ISO-8859-1

Greetings:
I wrote a Glade-3/GTK2/G++ application on a ubuntu machine, and the
application works great. In fact it works so well that my colleagues want to
use it. Ujnfortunately, they are not using ubuntu (and neither was I until I
started developing my GUI. I chose ubuntu because it seemed to support GUI
development.)

I tried running my app on a Red Hat machine and the app failed because of an
unresolved external reference,,, missing shared object file.

No big deal. I attempted to statically link my app with the assistance of
strace, the doctrinaire approach with embedded systems. That opened
pandoras box! The number of references to shared object files was
astounding.
My intuition tells me that there must be a better way to build an
application that will run on more than one Linux machine.

Is there a simple way to statically link the esoteric aspects of my GUI

  


Another approach you could take is to figure out how to make a .deb and 
.rpm files that list the packages for the libraries your app needs as 
dependencies. Not exactly the same thing you are talking about, but very 
much related. I wish I could speak from experience, but this is still on 
my mental to-do list.


It is a sign of progress when someone uses portable to mean support 
for  more than one linux distro. I would not recommend statically 
linking gtk. Most of the trick here is 1) portable build system (I 
endorse SCons), and 2) configuring / installing the required pieces on a 
build box for a supported target. Actually, if you get that far, the 
.deb / .rpm is not required, but a nice finishing touch.


Binary portability is somewhat of a hot-button issue for many people 
now. It's not really a strong point for Linux. Sure it would be nice, 
but it's better to not require/expect its availability. For instance, 
there will always be different CPU architectures. Or if you are like 
many in my boat, you also still have windows builds.



--
www.thomasstover.com

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list