I am pretty satisfied with the CMake build system improvements I have just
checked in to substantially refine how we deal with the Ada interface and
examples.  Here is what I have done.

* I have implemented a limited Ada language support for CMake.  As a result
of this effort, add_library should now work cross-platform, but
add_executable is not available since it needs a change to the core of CMake
to do the required gnatbind and gnatlink.

* I have substantially refined the configuration and taken advantage of the
new Ada language support so that the build of libplplotada and the build of
the example (still done with a custom rule rather than add_executable
because of above limitation in the language support ) should "just work"
cross-platform.

Caveats:

* GNAT compiler package has to be installed (e.g., gnat-4.0 package on Ubuntu
Dapper).  GNAT is an add-on package for gcc so you must ensure that the
version of GNAT that you install is consistent with the gcc version that
you have installed.

* ENABLE_ada is OFF by default (and we should continue with that default
until this interface gets a lot more testing) so must use -DENABLE_ada=ON
cmake option to build the libplplotada library.

* On really old systems (e.g., Debian stable but not Ubuntu Dapper) it is
difficult to find libgnat so you may have to set, e.g.,

export CMAKE_LIBRARY_PATH=/usr/lib/gcc-lib/i486-linux/3.3.5/adalib

to give CMake a strong hint where to find libgnat.

* Must use -DBUILD_TEST=ON cmake option so that the "make" command in the
build tree builds the ada example.

* Must set, e.g., the following environment variables to run the example
that was built in the build tree (these have to be set for any example in
the build tree, but normally you don't have to worry about this because
ctest takes care of it for you):

export EXAMPLES_DIR=/home/software/plplot_cvs/HEAD/build_dir/examples
export 
SRC_EXAMPLES_DIR=/home/software/plplot_cvs/HEAD/build_dir/../plplot_cmake/examples
export PLPLOT_LIB=/home/software/plplot_cvs/HEAD/build_dir/../plplot_cmake/data

Once those caveats are satisfied, then from the top-level of the build tree

ldd -r bindings/ada/libplplotadad.so

and

ldd -r examples/ada/ada_plplot

give good results after the "cmake" and "make" commands are executed showing
all libraries have been properly found and all symbols resolved.
Furthermore,

examples/ada/ada_plplot -dev whatever

gives good results (so far on Debian stable and Ubuntu Dapper).

ToDo:

(1) Lots of testing on a variety of platforms. Jerry (and other interested
developers), please give it a try, and let me know whether everything works
well on your platform of choice.

(2) Set up ctest so that the ada example will be executed as a result of the
ctest command. This refinement is not essential for testing so long as you
remember to set the EXAMPLES_DIR, SRC_EXAMPLES_DIR, and PLPLOT_LIB
environment variables to the proper locations for everything.

(3) Fill in the rest of the standard examples implemented in Ada.

(4) Once a substantial number of standard examples have been implemented and
this Ada binding has substantially matured, configure the install.  The big
question there is where to install libplplotada and its accompanying Ada
source files and *.ali files.  (N.B. Ada libraries usually have their own
directory filled with the library and the source files [at least the spec
files but possibly body files as well] and *.ali files.)

I will take responsibility for (2) fairly soon, and (4) in the "fullness of
time".  I may chip in with some help on (3) as well once the pattern of how
you program in Ada has been established by the implementation of a few more
standard examples.

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); PLplot scientific plotting software
package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the
Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to