On Mon, Mar 02, 2009 at 11:16:37AM -0800, Alan Irwin wrote:
> On 2009-03-02 11:38-0600 Thomas Stover wrote:
> 
> > Thanks for the input on cross compiling with cmake. Using the latest 
> > version 
> > of cmake, and the documentation I made a number of attempts to use mingw to 
> > build a win32 plplot from a linux host. By the end of the day Friday I 
> > reached the conclusion that although this is probably possible using the 
> > new 
> > cmake, almost certainly the cmake project itself would needs some tweaks. 
> > If 
> > anyone is interested I can go into the details of that.
> 
> I think doing your own specific Makefile based build system for PLplot would
> work, but I also think it would take a rather large effort on your part with
> no beneficial networking effects at all (nobody else would use your approach
> so you could gain little help from anybody else or lend help to anybody
> else). Furthermore, developing your CMake skills is worth doing in its own
> right since an increasing number of projects (KDE is probably the biggest of
> these) use it. Therefore, I encourage you to stick with CMake a bit longer
> even though you are unfamiliar with it at the moment.
> 
> Whatever you decide to do, cross-compilation is going to be tricky because
> of all the various library dependencies (mostly from PLplot device drivers,
> but the core PLplot library also has a few library dependencies).  All the
> dependent libraries must be available for the "other" platform before PLplot
> can be built for the "other" platform.  So I suggest you start with a simple
> PLplot cross-compile with no library dependencies, and once that works, go
> on from there adding dependencies in small amounts.
> 
> Specifically, build just the plplot C library (with libqhull and freetype
> dropped to eliminate those dependencies and with no dynamic drivers to
> eliminate the dependence on dynamic loading libraries) and the ps device
> driver (which has no external dependencies).  The appropriate cmake options
> for that build scenario are
> 
> -DDEFAULT_NO_BINDINGS=ON \
> -DHAVE_QHULL=OFF -DWITH_FREETYPE=OFF -DENABLE_DYNDRIVERS=OFF \
> -DDEFAULT_NO_DEVICES=ON -DPLD_ps=ON
> 
> Can you get that combination to work with (a) an ordinary build on Linux,
> (b) an ordinary build on MinGW, and (c) a cross-build on Linux for MinGW?
> 
> Once you get that first simple cross-build working properly, then I think
> the next step is to figure out what to do with dynamic devices.  That does
> work on MinGW so it should be straightforward to get it to work for a Linux
> cross-build for MinGW, but I am not familiar with the MinGW dynamic device
> details so someone else will have to help you there.
> 
> The next step after cross-built dynamic devices work could be cross-build of
> cairo-based devices. A pango/cairo stack is available for MinGW Windows so
> extending the cross-build to use cairo devices should be straightforward.
> 
> In sum, my advice is to stick with CMake (since we should be able to give
> you some help in that case, and CMake skill with a normal build environment
> and also a cross-build environment is worth developing in its own right),
> and take it one step at a time. Do the simplest cross-build first with no
> dependencies. Once that works, start adding dependencies to your cross-build
> in small steps until you achieve the cross-build that you desire.

Thomas,

I've now done the necessary changes to plplot to allow a cmake
cross-compilation of at least the basic library. See the plplot wiki 
http://www.miscdebris.net/plplot_wiki/index.php?title=Main_Page 
for instructions. I have cross-compiled for mingw32 under linux. Note that I
have not tested the resulting binaries, but the compilation progresses
cleanly. It would be good if you (and others) could try this approach. The
only change required was to pick up build-time executables from a native
build rather than the cross-compiled build. PLplot uses these in several
places to generate data / source code for the build.

The current stumbling block for the cairo drivers is that they use
pkg-config to get the correct paths and libraries to link in. This won't
work on a cross-compiled environment unless you provide suitable pkg-config
files from a cross-compiled version of cairo. This should be possible
though. 

Andrew

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to