On 2013-06-02 01:11-0700 Alan W. Irwin wrote:

> This last week or so I have been working on a software project whose
> sole purpose is to build software in an automated way for systems with
> access to at least a minimal set of Unix development tools.  For
> example, MSYS/Windows (and also a normal Linux or Mac OS X development
> environment) qualify as platforms for this project.
>
> The motivation for this project was I was fed up with building all the
> PLplot prerequisites by hand on the Wine version of Windows.  My goal
> with this script is for users to to launch it and forget it until it
> is done building, testing, and installing everything they need on
> MSYS. This build script may also have some usefulness on Linux and Mac
> OS X, although normally for those platforms, distributions are
> available to provide the same installed libraries and executables in a
> more convenient way.

I have implemented build configurations for libagg, libharu, libqhull,
shapelib and ndiff for revision 12367.  That revision also contains a
partial plplot build configuration where I have not actually put
in the appropriate commands yet to build PLplot, but I have at least
collected its current build dependencies within build_projects.

What these build configurations do is to download, check, unpack,
patch and/or update, configure, build, (optionally) test, and install
the designated piece of software with one call to ExternalProject_Add
(in build_projects/*/ep.cmake for each software project).  ep.cmake
files can also add logic to handle build dependencies properly (as in
the current plplot/ep.cmake file).

This project should already be useful for coherent builds on Windows
(or Unix if you are, for example, having trouble building ndiff on
Unix) of PLplot-related software.

Here are the steps to use it on Windows, but any Unix with a decent
tool chain for building software installed would be very similar
starting at step 4 below.

1. Install the latest MinGW/MSYS using the mingw-get-inst-20120426.exe
installer.  Specify all the MSYS build tools and also specify the
latest updates to all software.  That currently gets you MinGW-4.7.2
and msys-core-bin=1.0.18-1 plus lots of other MSYS packages.

1a. Downgrade from msys-core-bin=1.0.18-1 to msys-core-bin=1.0.17-1
following the instructions at http://sourceforge.net/p/mingw/bugs/1950
to workaround a parallel build bug for 1.0.18-1.  Those instructions
are to get out of everything MSYS related (such as bash) and then run
(say from cmd since you cannot use bash for this)

MinGW-4.7.2\bin\mingw-get.exe upgrade msys-core-bin=1.0.17-1

2. Now put CMake-2.8.10.2 or later, and Mingw and MSYS on your PATH.

3. Install the MSYS unzip package (essential to build_projects) which
the above steps leave out: This is done from bash.exe as follows:

mingw-get.exe --recursive install msys-unzip

This is the only required addition to the install of the subset of the
MSYS packages that are done by the automatic installer.

4. Create an empty build tree and use it to configure build_projects.
For example:

# Create the directory if it doesn't exist
bash.exe-3.1$ mkdir -p \
/z/home/wine/newstart/build_script/build_dir-1.5.31

# Make sure that directory is empty.
bash.exe-3.1$ rm -rf \
/z/home/wine/newstart/build_script/build_dir-1.5.31/*

# Change to that directory and configure build_projects.
bash.exe-3.1$ cd \
/z/home/wine/newstart/build_script/build_dir-1.5.31
bash.exe-3.1$ cmake -G"MSYS Makefiles" \
-DCMAKE_INSTALL_PREFIX:PATH=/z/home/wine/newstart/build_script/install-1.5.31 \
/z/home/software/plplot_svn/HEAD/plplot_allura/cmake/build_projects

The result of that cmake command on my (Wine) platform is

-- CMake version = 2.8.10.2
-- CMAKE_SYSTEM = Windows-5.1
-- CMAKE_INSTALL_PREFIX = z:/home/wine/newstart/build_script/install-1.5.31
-- EP_BASE = Z:/home/wine/newstart/build_script/build_dir-1.5.31/build_projects
-- Configuring done
-- Generating done
-- Build files have been written to: 
Z:/home/wine/newstart/build_script/build_dir-1.5.31

Note, you must specify (as above) the "MSYS Makefiles" generator (or
else the "Unix Makefiles" generator on Linux or Mac OS X) which is
propagated to all configured build projects.  You must also specify
(as above) a unique install prefix which is also propagated to all
configured build projects.

5. Download, check, unpack, patch and/or update, configure, build,
(optionally depending on the appropriate ep.cmake file) test, and
install ndiff and all PLplot dependencies (libagg, libharu, libqhull,
and shapelib) that have been configured so far.  ndiff must be
done separately because it is not a dependency of PLplot although
this fuzzy diff is extremely useful to PLplot developers.

bash.exe-3.1$ time make VERBOSE=1 build_ndiff >& build_ndiff.out

real    0m34.654s
user    0m1.120s
sys     0m2.340s
bash.exe-3.1$ time make VERBOSE=1 build_plplot >& build_plplot.out

real    4m11.703s
user    0m19.900s
sys     0m46.760s

Check for any warnings or errors in the *.out files.

This is already a promising start to getting the PLplot
dependencies built in a consistent way on Windows (and on Linux and
Mac OS X for that matter). I encourage others to try this and also to
help me expand the project along the following lines:

1. Do some necessary maintenance for the libharu and libqhull build
configurations. (ndiff and shapelib are already up to date and libagg
development stopped in 2006 so there is nothing much more to do
there.) The libharu and libqhull build configurations work fine now,
but they essentially use Werner's build system work in 2006 and the
appropriate downloads for that era.  So downloads of newer versions of
libharu and libqhull and updating the build system changes accordingly
should be done.

2. Expand this project to use other generators such as "MinGW
Makefiles" (which uses the mingw version of make), "NMake Makefiles
JOM" (which uses jom which implements a parallel version of nmake),
"Ninja" which uses the ninja build tool and "NMake Makefiles" (which
uses Microsoft nmake as the built tool).  The first three of those are
open source and readily available to me on Wine.

3. Expand the PLplot dependencies that are built.  That includes build
configurations for the wxwidgets library, Qt4, and pango/cairo (and
their dependencies).  For the pango/cairo case, I suspect I am simply
going to translate a current jhbuild configuration (which contains
URL's, checksums, build information, and dependencies for all GTK+
related projects such as pango and cairo) to the equivalent
ExternalProject_Add statements.

4. Add a complete build configuration for PLplot to replace the
current build configuration which only builds PLplot dependencies.
Once those dependencies include wxwidgets, Qt4, and pango/cairo,
then for the first time Windows users will have ready access to a high-quality
version of PLplot which is one of the principal motivators behind
build_projects.

5. Add build configurations for other projects that are of interest to
anyone here.  (I already am considering such build configurations for
ephcom, te_gen, lapack, and FreeEOS).

If you look at cmake/build_projects/ndiff/ep.cmake you will see that is an
extremely short file with most of it boilerplate that could be used as
a template for any project where you know a download URL and know the
instructions for building and installing that project.  So expansion
to additional build configurations like those mentioned in steps 3, 4, and 5
above should be straightforward.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to