From: John Stone (johns_at_ks.uiuc.edu)
Date: Tue Aug 24 2010 - 10:02:20 CDT

Hi Steve,
  I just got back from giving talks at ACS, so I'm behind on email.

The linkage errors you are getting appear to be caused by a mismatched
target architecture when you are compiling. How did you compile the
other codes (e.g. ACTC?)

Generally speaking, the easiest way to compile VMD is begin small,
compiling against only the depencies and libraries that are absolutely
necessary to get things up and running. For a basic VMD compilation,
you need:
  FLTK, Tcl/Tk, and a compiled VMD plugin tree

If you want to include NetCDF support, then you'll need that at the outset
when you begin building the plugins.
I would disable ACTC and LIBTACHYON and all that stuff to start with,
until you get things going.

You would setup a minimal MacOS X x86 build like this:

./configure MACOSXX86 FLTKOPENGL FLTK TK TCL SILENT PTHREADS

>From there, you can add the other libraries or features you want, but I
would wait until you get the basic compilation done and you have no
other troubles.

By default, VMD looks for all of the library dependencies in the
vmd/lib directory. This is because we link against our own compilations
of Tcl/Tk etc, that are known to have fewer bugs than whatever version
the vendors may be shipping at any given time. I have in the past tried
to make Mac versions that use the Apple-provided Tcl/Tk and Python, but
those attempts turned out to be pointless, as the Apple-provided versions
were rife with bugs that made the VMD builds unstable. Given that one has
no influence over what versions the vendors include with the OS, this
leaves us in a position to stick with our own builds, and to statically
link where possible rather than dynamically linking, to prevent various
shared library conflicts (though they are typically a bigger problem on
the Windows platform than anywhere else).

If you want to make VMD use your own libraries, you need to edit the
default paths in the configure script to point at your own directories.
These are generally easy to find, they are variables in the configure
script:
  fltk_dir
  stock_tcl_include_dir
  stock_tk_library_dir
and so on.

The Tcl/Tk paths can also be overidden by environment variables:
  TCL_INCLUDE_DIR
  TCL_LIBRARY_DIR
  TK_INCLUDE_DIR
  TK_LIBRARY_DIR

Let me know if you have specific questions and I'm happy to help out.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Tue, Aug 24, 2010 at 08:39:59AM -0600, Steve Smith wrote:
> Thanks to Josh and Axel on their responses...
>
> I am (more) confident now that I can achieve what I need to here, but that
> the path might be a little cluttered along the way.
>
> So far, my problems have been precisely what Josh refers to here...
> getting includes and libraries in places that VMD can find them and/or
> pointing them out to the VMD makefile.
>
> I'm stuck now on a (simple?) misunderstanding:
>
> ld: warning: in ../lib/actc/lib_MACOSXX86/libactc.a, file was built
> for unsupported file format which is not the architecture being linked
> (i386)
>
> this error comes up on all (many?) of the libraries I so carefully
> downloaded and built... most (all?) of which had no way to specify any
> architecture or a ./configure, etc..
>
> fumbling around, I tried the following which merely reinforces that I
> don't really know what I'm doing here. Any OSX (or other) Wizards who
> can help sort me out?
>
> $ ld -v libactc.a
> @(#)PROGRAM:ld PROJECT:ld64-97.2
> Library search paths:
> /usr/lib
> /usr/local/lib
> Framework search paths:
> /Library/Frameworks/
> /System/Library/Frameworks/
> ld: warning: -arch not specified
> ld: could not find entry point "start" (perhaps missing crt1.o) for
> inferred architecture x86_64
>
> - Steve
>
> On Monday 23 August 2010 4:32:05 pm you wrote:
>
>
> I'm having trouble building VMD from source on OSX 10.6
>
> On one hand, I'm finding a large number of dependencies that I need to
> manually download, build and link into the VMD build system. I am
> guessing that I am missing something about how the build system is
> supposed to work?
>
> On the other hand, all the references I find are to OSX 10.2 and 10.3,
> so I'm wondering if there is up-to-date support for 10.6 building?
>
> - Steve
>
>
> The biggest trouble I had building on 10.6 is that you need the svn trunk/
> version of FLTK if you want to build it for x86_64. That and the configure
> scripts for VMD are weird and take a lot of hacking to specify libraries from
> a generic location (in my case, setting to /opt/loca/lib to build against
> macports installed python & other libs).
>
> - Josh
>
>
> --
> Los Alamos Visualization Associates
> LAVA-Synergy
> 4200 W. Jemez rd
> Los Alamos, NM 87544
> www.lava3d.com
> sas_at_lava3d.com
> 505-920-0252

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078