[chimera-dev] making a python package

Eric Pettersen pett at cgl.ucsf.edu
Thu Aug 14 13:51:16 PDT 2008

Hi Bill,
	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  
variables themselves.
	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. :-)


                         Eric Pettersen
                         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  
> our
> software installs its own Python. Can you explain how your  
> installation
> package is set up? I have a script that goes through the usual
> configure, make, and make install commands, but it encounters  
> different
> problems on each platform (for us, Linux and Irix). How does the  
> Chimera
> install make sure everything is linked together properly?
> Any help is greatly appreciated.
> Thanks,
> 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
> Greg,
> thanks for your description. I have another couple of questions.
> My script goes through the usual configure, make, make install  
> commands,
> 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  
> to
> emulate it as far as possible.
> Any advice you can give is greatly appreciated.
> Thanks,
> Bill B.
> Greg Couch wrote:
>>> On Wed, 30 Jul 2008, William Baxter wrote:
>>>>> Hello,
>>>>> 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?
>>>>> Thanks,
>>>>> 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,
>>> <http://www.jrsoftware.org/isinfo.php>.
>>> 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  
>>> zip
>>> archive where an installation program is run after the files have  
>>> been
>>> extracted.
>>> In all cases, when chimera starts up, we set up the environment to  
>>> get
>>> 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...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-dev/attachments/20080814/6602127e/attachment.html>

More information about the Chimera-dev mailing list