Hi Collin!

> I am trying to get the PLPlot Ada bindings to work and don't seem to be
> getting anywhere. I use the GNAT compiler provided by AdaCore but I don't
> know exactly how to point cmake to the compilers in the GNAT\2010\bin
> directory. Does anyone have any advice?

Is that on Windows or on Unix?

I managed to build the examples as well as own programs using GNAT on a  
windows platform. However, I was not able to tell CMake to build all  
these. So I partly worked around CMake and installed PLplot on my system  
with only minimal CMake participation.

Have you been able to compile PLplot itself? If yes, here is what to check:

1) PLplot Environment:
The following enviroment variables need to be set/changed and the files  
mentioned above have to be available:

a) PATH
The PATH has to include the directory in which all the DLLs of PLplot are  
to be found. On my system this is:
PATH=...;C:\Programme2\PLplot\dll;...
The PATH of course also has to include GNATs executables, but since this  
is normally done by the installer, it should be correct. To be sure,  
check, whether something like <some path here>\GNAT\2010\bin is in your  
PATH.

b) PLPLOT_HOME
This should point to the directory holding all the necessary  
subdirectories of PLplot. If you want, you could use this directory as a  
deployment base directory when copying PLplot to a new machine. *I* have  
the following subdirectories here:
- bindings
- dll
- drivers
- lib
In the bindings subdirectory I've just copied all the content of the  
bindings subdirectory of the PLplot download.
The dll subdirectory holds all DLLs that have been produced when building  
PLplot on your machine.
The drivers subdirectory holds all the *.rc files of the output drivers.
The lib directory holds all *.lib, cmap*.* and *.map files found after  
PLplot has been built on your machine.

c) PLPLOT_DRV_DIR
This environment variables should point to the drivers subdirectory of  
PLPLOT_HOME.

2) GNAT environment:
I assume, you have had installed GNAT before PLplot and also have been  
suing it successfully with some other projects (and be it only a Hello  
World program ;-) ).

For convenience reasons in my Ada projects I'm using the following two  
project files:
---snip: shared.gpr ---
-------------------------------------------------------------------------------
-- Copyright (C) 2011 Thorsten Behrens / WIHM-Tech GmbH
--
-- This project just defines some general paths, variables, etc. if they  
are
-- needed in more than one project file.
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
project Shared is
-------------------------------------------------------------------------------

   -- We define a variable holding the home directory of PLplot. This is  
defined
   -- in the environment variable PLPLOT_HOME. If this does not exist, we  
return
   -- a default directory, where PLplot might be found.
   -- The default value might (most probably) need to be adapted, if this
   -- project file is reused on some other development computer.
   --
   PLplotHome := external ("PLPLOT_HOME", "C:\Programme2\PLplot");

   -- The Shared project does not have any sources. We need to tell GPS  
this,
   -- otherwise we can't compile.
   --
   for Source_Files use ();

-------------------------------------------------------------------------------
end Shared;
-------------------------------------------------------------------------------
---snap---

---snip: plplot.gpr ---
-------------------------------------------------------------------------------
-- Copyright (C) 2011 Thorsten Behrens / WIHM-Tech GmbH
--
-- This project tells us where the PLplot library can be found.
-------------------------------------------------------------------------------
with "shared.gpr";

-------------------------------------------------------------------------------
project PLPlot is
-------------------------------------------------------------------------------

   -- The Library MUST not be built with GPS, but is built externally!
   --
   for Externally_Built use "true";

   -- Therefore, it does not have any source files.
   --
   for Source_Files use ();

   -- The library is found by using the environment variable defined in the
   -- shared project (in the subdirectory "dll" found there). Also, the  
name is
   -- stated here and that it is a dynamically linked library.
   --
   for Library_Dir use Shared.PLplotHome & "\dll";
   for Library_Name use "plplotd";
   for Library_Kind use "dynamic";

-------------------------------------------------------------------------------
end PLPlot;
-------------------------------------------------------------------------------
---snap---

With these two project files you should be able to compile all the  
examples by yourself. Here is a quick project file to build the first  
example (although I've not tested it to work - I compiled all the examples  
and then removed them again after I've got them working):
---snip---
with "shared.gpr";
with "plplot.gpr";
project Example_01 is
    for Shared_Library_Prefix use "";
    for Languages use ("Ada");
    for Main use ("xthick01a.adb");
    for Source_Dirs use (".", Shared.PLplotHome & "\bindings\ada");
    for Object_Dir use "obj";
    for Exec_Dir use ".";
end Example_01;
---snap---

-- 
Gruß,
Thorsten

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Plplot-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-general

Reply via email to