[chimera-dev] making a python package
pett at cgl.ucsf.edu
Thu Aug 14 13:51:16 PDT 2008
Greg is the real expert here, but he's at SIGGRAPH right now so I'll
put out what little I know and let Greg correct anything I get wrong
when he has time. Yeah, compiling/linking can be a nightmare when you
are trying to use libs you have no control over and that may have been
compiled with options you didn't anticipate or from modified sources.
That's why we cheat and include everything we depend on (which is one
reason Chimera is such a huge download). In particular, we include Tk
and Tcl libraries. If you look in Chimera's "foreign" source
directory, there is a TclTk subdirectory there. So no worries about
out-of-date/incompatible versions and all that.
We have another layer of control in that we're not (currently) trying
to provide a package that other people can easily compile on their own
system. So therefore we don't need a configure step. Our makefiles
have conditionals based on the OS to get the right flags for linking
and compiling and whatnot for the systems that we ourselves compile
on. A lot of that makefile logic is concentrated in the "includable"
makefiles found in the mk directory, so that individual makefiles only
have to include the appropriate mk makefile and then customize a few
We try to use "foreign" source with as little patching as possible so
that we can easily incorporate updated versions, so many of the
foreign packages (e.g. Tcl/Tk) do have their "native" configure step.
Nonetheless, the Chimera makefile that initiates the foreign package
build may supply arguments to the configure so that the final build
uses the right compiler flags, uses the right build/install location,
and so forth.
I don't know how much help this has been, but feel free to ask more
questions and maybe I'll know the answers. :-)
UCSF Computer Graphics Lab
On Aug 14, 2008, at 11:54 AM, William Baxter wrote:
> Hello Eric,
> I'm trying to make an installation package like Chimera's, in which
> software installs its own Python. Can you explain how your
> package is set up? I have a script that goes through the usual
> configure, make, and make install commands, but it encounters
> problems on each platform (for us, Linux and Irix). How does the
> install make sure everything is linked together properly?
> Any help is greatly appreciated.
> Bill Baxter
> William T. Baxter, Ph.D.
> Wadsworth Center
> Empire State Plaza, PO Box 509
> Albany, NY 12201-0509
> Subject: Re:[chimera-dev] making a python package
> From: William Baxter
> Date: 02:42 PM
> To: Greg Couch
> thanks for your description. I have another couple of questions.
> My script goes through the usual configure, make, make install
> but Chimera seems to go straight to compilation. How do you set it
> up to
> be so fast?
> Also, finding Tcl/Tk for Tkinter is a headache that seems to be
> different on each platform. How do you ensure that Python finds that
> right Tcl libs?
> The Chimera installation is really admirable and efficient. I'd like
> emulate it as far as possible.
> Any advice you can give is greatly appreciated.
> Bill B.
> Greg Couch wrote:
>>> On Wed, 30 Jul 2008, William Baxter wrote:
>>>>> we would like to package our software, Spire
>>>>> (www.wadsworth.org/spider_doc/spider/docs/spire/) the way
>>>>> Chimera is
>>>>> packaged, with its own Python, Tcl/Tk, and other libraries. Do
>>>>> you have
>>>>> some documentation, or can you point me toward some resources that
>>>>> explain how to go about creating such an installation package?
>>>>> Bill Baxter
>>> We don't have any documentation, but here's a quick description of
>>> what we do binary distributions for chimera:
>>> On Windows, we use the Inno Setup program,
>>> For Mac OS X, we build a disk image using the hdiutil program.
>>> And we
>>> modify the name all of the shared libraries with something like:
>>> install_name_tool -id @executable_path/$(LIBNAME)
>>> On Linux and other Unix systems, we use a modified self-extracting
>>> archive where an installation program is run after the files have
>>> In all cases, when chimera starts up, we set up the environment to
>>> our shared libraries (and clear the environment of things that would
>>> hurt us, like PYTHONHOME).
>>> Hope this helps,
>>> Greg Couch
>>> UCSF Computer Graphics Lab
> William T. Baxter, Ph.D.
> Wadsworth Center Empire State Plaza,
> PO Box 509 Albany, NY 12201-0509
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Chimera-dev