Re: [Plplot-devel] Possible fix for the test_ada project on Cygwin (NO LONGER RELEVANT)

2017-11-08 Thread Alan W. Irwin

On 2017-11-08 07:49- Arjen Markus wrote:


Hi Alan,




-Original Message-
From: Alan W. Irwin [mailto:ir...@beluga.phys.uvic.ca]
Sent: Tuesday, November 07, 2017 11:20 PM

Hi Arjen:

To clean up some preliminary stuff, please don't set GNAT_LIB unless absolutely
necessary.  Specifying that variable is a workaround that bypasses all testing 
of the
find_library command (see
 for why that is 
so.


Oh, that was a stupid mistake - too many little tasks clogging my head and thus I simply 
followed the advice from the error message: an unaided 
"comprehensive_test_ada.sh" does not find the Gnat library.




With CMAKE_LIBRARY_PATH set to the right directory the test does

succeed but fails in the same way as before. So the CMake build script
finds the proper library, but there is something going on with the
library itself.

I agree with that general conclusion based on what I see in your report
tarball for this shared case.  But I would add that the fundamental
run time error you are seeing is

raised PROGRAM_ERROR : EXCEPTION_ACCESS_VIOLATION

for the hello.exe that is built from the installed example source
code.  And for me any error message that mentions "access violation"
in any way likely means there is a memory management issue.  So I
think the most obvious next step is to run a memory management
analysis tool like valgrind (although not that exact tool since it
apparently does not work on Windows platforms) on the hello.exe
executables that are built in the build tree and the install tree.


I have attached two tarballs: one with only the CMAKE_LIBRARY_PATH

set and one excluding the shared build, leaving the static case. This
fails on account of duplicate symbols again.

I also looked at that additional report tarball, and the build system has done
everything in the static case that I thought it should do, i.e.,
always link with import form of the gnat library regardless of whether
the test_ada Ada library is built as a shared library (which builds
without issues from your other report tarball) or as a static library
(this case which you have just showed obviously does not build correctly).  So
please follow up by using GNAT_LIB in this emergency situation for the
static case to specify libgnat.a, and let me know those results
to help guide me toward the correct find_library configuration
for the normal case where CMAKE_LIBRARY_PATH is specified on Cygwin.


No time right now to look into your other suggestions.


I promise to be patient.  And in any case I think we are headed toward
preparing a bug report for the Ada components of the gcc toolchain on
Cygwin.  So patience is needed in any case because that bug (once we
isolate it for the simplest case possible and prepare the bug report)
is likely going to take some time for the Cygwin gcc package
maintainers or possibly even the upstream Ada compiler developers to
fix.

Nevertheless, even though I think we are likely stuck in a long
process, I would like to continue moving forward with that process
without too many inefficient long gaps.  So the next chance you have
to work on PLplot I would appreciate it if you followed up with this
issue in the two ways I have suggested above.

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
__

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Possible fix for the test_ada project on Cygwin (NO LONGER RELEVANT)

2017-11-07 Thread Arjen Markus
Hi Alan,



> -Original Message-
> From: Alan W. Irwin [mailto:ir...@beluga.phys.uvic.ca]
> Sent: Tuesday, November 07, 2017 11:20 PM
>
> Hi Arjen:
>
> To clean up some preliminary stuff, please don't set GNAT_LIB unless 
> absolutely
> necessary.  Specifying that variable is a workaround that bypasses all 
> testing of the
> find_library command (see
>  for why that 
> is so.

Oh, that was a stupid mistake - too many little tasks clogging my head and thus 
I simply followed the advice from the error message: an unaided 
"comprehensive_test_ada.sh" does not find the Gnat library.

With CMAKE_LIBRARY_PATH set to the right directory the test does succeed but 
fails in the same way as before. So the CMake build script finds the proper 
library, but there is something going on with the library itself.

I have attached two tarballs: one with only the CMAKE_LIBRARY_PATH set and one 
excluding the shared build, leaving the static case. This fails on account of 
duplicate symbols again.

No time right now to look into your other suggestions.

Regards,

Arjen







DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited. 
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.


comprehensive_test_shared.tar.gz
Description: comprehensive_test_shared.tar.gz


comprehensive_test_static.tar.gz
Description: comprehensive_test_static.tar.gz
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Possible fix for the test_ada project on Cygwin (NO LONGER RELEVANT)

2017-11-07 Thread Alan W. Irwin

On 2017-11-07 12:35- Arjen Markus wrote:


Hi Alan,



I got an odd error while running the comprehensive test script for

Ada - see the attached tarball. The good news is that it was a crash
in running the program, not an interruption of the build process.

Hi Arjen:

To clean up some preliminary stuff, please don't set GNAT_LIB unless
absolutely necessary.  Specifying that variable is a workaround that
bypasses all testing of the find_library command (see
 for why
that is so.  For example, it completely bypasses the changed
find_library command in my patch.  Instead, I would prefer you to set
the environment variable CMAKE_LIBRARY_PATH (if necessary) to the
directory location where the gnat import library can be found.  That
method then tests whether find_library works properly (which is part
of the point of these tests).

Furthermore, the run-time error you found was for the shared case so
please follow up by testing whether that also occurs for the static case using

cmake/test_ada/scripts/comprehensive_test.sh --do_shared no

(that "--do_shared no" option skips over the shared part of the test
as documented if you run cmake/test_ada/scripts/comprehensive_test.sh
--help).

Moving on to the run-time error you found for the shared case, i.e.,

raised PROGRAM_ERROR : EXCEPTION_ACCESS_VIOLATION

, that issue was just raised for the installed examples case
and not the build-tree case which is an interesting result.

So from your report tarball I looked carefully at how the two
different cases were built, i.e.,

# Build tree
/usr/bin/gnatmake.exe  -Wl,--enable-auto-import "-aI/cygdrive/d/plplot-svn/plplot-git/cmake/test_ada/src_executable" "-aI/cygdrive/d/plplot-svn/plplot-git/cmake/test_ada/src_lib" "-aL/cygdrive/d/plplot-svn/comprehensive_test_ada_disposeable/shared/noninteractive/build_tree/src_lib/CMakeFiles/hello_1.dir" hello.adb -cargs  -largs ../dll/libhello.dll.a 
# Build tree for the installed example

/usr/bin/gnatmake.exe  -Wl,--enable-auto-import 
"-aI/cygdrive/d/plplot-svn/comprehensive_test_ada_disposeable/shared/noninteractive/install_tree/share/test_ada/examples/ada"
 
"-aI/cygdrive/d/plplot-svn/comprehensive_test_ada_disposeable/shared/noninteractive/install_tree/share/ada/adainclude/test_ada"
 
"-aL/cygdrive/d/plplot-svn/comprehensive_test_ada_disposeable/shared/noninteractive/install_tree/lib/ada/adalib/test_ada"
 hello.adb -cargs  -largs 
/cygdrive/d/plplot-svn/comprehensive_test_ada_disposeable/shared/noninteractive/install_tree/lib/libhello.dll.a

My experience is gnatmake is extraordinarily picky about its builds
and will error out if the slightest thing is wrong.  But all was well
in that regard with your two builds.  Furthermore, visual inspection
of the two separate commands above indicates the two different
versions refer respectively to build-tree and installed examples build
tree locations (as expected).  In addition, Ada libraries are really
straightforward to build and install (build the objects from *.adb
source with no special gcc options other than -fPIC, collect the
generated object files in a library and keep track of the
corresponding Ada *.adb source files and generated *.ali files and
install the library, and its corresponding *.ada and *.ali files.) If
that installation were incomplete in the slightest way, the above
second gnatmake command would have errored out. So I really think all
is well with the install.

Thus, the only thing I can think of to follow up with this error is
the above PROGRAM_ERROR appears to be referring to a memory management
issue.  Often those are silent errors (especially on Windows) so by
accident the given memory management issue might be silent for the
build tree but not for the installed examples build tree.  So I looked
for that sort of issue here (Debian Jessie) after a run of

cmake/test_ada/scripts/comprehensive_test.sh

as follows:

# change to comprehensive test prefix directory
software@raven> cd ../comprehensive_test_ada_disposeable
# valgrind test hello executables in both the build and installed
# examples build directories.
software@raven> valgrind shared/noninteractive/build_tree/src_executable/hello
==26389== Memcheck, a memory error detector
==26389== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==26389== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==26389== Command: shared/noninteractive/build_tree/src_executable/hello
==26389== 
==26389== 
==26389== HEAP SUMMARY:

==26389== in use at exit: 0 bytes in 0 blocks
==26389==   total heap usage: 4 allocs, 4 frees, 740 bytes allocated
==26389== 
==26389== All heap blocks were freed -- no leaks are possible
==26389== 
==26389== For counts of detected and suppressed errors, rerun with: -v

==26389== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

software@raven> valgrind shared/noninteractive/install_build_tree/ada/hello
==26390== Memcheck, a memory error 

Re: [Plplot-devel] Possible fix for the test_ada project on Cygwin (NO LONGER RELEVANT)

2017-11-07 Thread Arjen Markus
Hi Alan,



I got an odd error while running the comprehensive test script for Ada - see 
the attached tarball. The good news is that it was a crash in running the 
program, not an interruption of the build process.



Regards,



Arjen



> -Original Message-
> From: Alan W. Irwin [mailto:ir...@beluga.phys.uvic.ca]
> Sent: Tuesday, November 07, 2017 11:16 AM
...

>
> Once you have complete success with the test_ada project, than I will want to
> make a similar change to the PLplot project, but I haven't done that yet.
>
As indicated above, only partial success.

DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited. 
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.


comprehensive_test.tar.gz
Description: comprehensive_test.tar.gz
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Possible fix for the test_ada project on Cygwin (NO LONGER RELEVANT)

2017-11-07 Thread Alan W. Irwin

On 2017-11-07 08:34- Arjen Markus wrote:


Hi Alan,




-Original Message-
From: Alan W. Irwin [mailto:ir...@beluga.phys.uvic.ca]
Sent: Friday, November 03, 2017 8:37 PM
When you get a chance please commit this change on a local topic branch using
"git am" and try it out on Cygwin using

cmake/test_ada/scripts/comprehensive_test.sh


I applied the patch and got some encouraging results:

- With -DCMAKE_LIBRARY_PATH=/path/to/ada-libraries I go the same errors as 
before




- With -DGNAT_LIB=/path/and/name/of/import-library I got - finally -

working Ada examples. Both the standard and traditional versions work
fine.

It appears from your last comment that you have been testing the plplot
project.  Those do sound like promising results, but they are premature.

The present patch was limited to just the test_ada project. So to test
that patch you need to follow my test instructions above. Likely you
will have to set CMAKE_LIBRARY_PATH to the location of the import
library to get that comprehensive test (of test_ada) to work.

Once you have complete success with the test_ada project, than
I will want to make a similar change to the PLplot project, but
I haven't done that yet.

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
__

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Possible fix for the test_ada project on Cygwin (NO LONGER RELEVANT)

2017-11-07 Thread Arjen Markus
Hi Alan,



> -Original Message-
> From: Alan W. Irwin [mailto:ir...@beluga.phys.uvic.ca]
> Sent: Friday, November 03, 2017 8:37 PM
> When you get a chance please commit this change on a local topic branch using
> "git am" and try it out on Cygwin using
>
> cmake/test_ada/scripts/comprehensive_test.sh
>
I applied the patch and got some encouraging results:

- With -DCMAKE_LIBRARY_PATH=/path/to/ada-libraries I go the same errors as 
before

- With -DGNAT_LIB=/path/and/name/of/import-library I got - finally - working 
Ada examples. Both the standard and traditional versions work fine.

(I did notice something odd about example x03: with both the C and Ada examples 
using the wingcc and X Window the window is empty. The PostScript file shows 
only a partial plot - labels around the radial diagram. I have attached it for 
further discussion. Very strange - other examples work fine)

Regards,

Arjen



DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited. 
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.


aa.ps
Description: aa.ps
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Possible fix for the test_ada project on Cygwin (NO LONGER RELEVANT)

2017-11-03 Thread Alan W. Irwin

On 2017-11-03 11:52- Arjen Markus wrote:


Yes, I saw it [new Ada packaging for Cygwin] and I have updated my

installation.

Good.


I see the import library now, but my very preliminary

tests (test_ada and a simple build) have failed so far:


- test_ada does not produce an executable - see the tarball (sorry,

output to the screen is missing, but there was nothing much to see
anyway).


- a simple build finds the static library and then the duplicate

symbols problem is back.


I guess PLplot needs to be told to use the import library before

trying the static one. I have not had time yet to do the manual steps
that you suggest.

On Linux I have tried the experiment of forcing the shared
or static versions of gnat lib as follows:

-DGNAT_LIB=/usr/lib/gcc/x86_64-linux-gnu/4.9/adalib/libgnat.so

or

-DGNAT_LIB=/usr/lib/gcc/x86_64-linux-gnu/4.9/adalib/libgnat.a

The shared version (equivalent to the import library version for
you) works both with -DBUILD_SHARED_LIBS=ON or OFF.  (N.B.
-DBUILD_SHARED_LIBS affects only how our Ada library is built
and does not affect how that library and our 
Ada executables are linked to external libraries such as gnat.)


The static version of the gnat library only works for the
-DBUILD_SHARED_LIB=OFF case. (The Linux issue for the
-DBUILD_SHARED_LIB=ON case is libgnat.a was built without the -fPIC
flag, but I presume there are similar compilation flag issues when
attempting to use libgnat.a for -DBUILD_SHARED_LIB=ON on Cygwin that
cause the duplicate symbols issue you see there.)

So I agree with you we should likely be fine if we always find the shared 
version of the gnat
library on Linux and the import version of the gnat library on Cygwin (and
other Windows platforms).

That happens automatically (if not forcing like above) in the Linux
case since CMake always prefers to find the shared version of
libraries if given a choice with the same basename ("gnat" above with
no version number).  So that is why comprehensive testing of test_ada
has "just worked" on that platform.

But Windows has no standard naming conventions
for libraries so you have to identify independently what filename
corresponds to the import library (in the Cygwin case that filename is
libgnat-6.dll.a, but who knows, for example, what it might be for
MinGW-w64/MSYS2 or some arbitrary build of the gnu tool chain on
Windows) so we have to be quite specific for what library name we want
to find in the Windows case in order to guarantee we have the import
form of the gnat library.

The attached commit makes this change for the Cygwin case (and fills
in something generic for the non-Cygwin Windows case which will likely
need to be corrected in the future for the MinGW-w64/MSYS2 case).

When you get a chance please commit this change on a local topic branch using "git 
am" and
try it out on Cygwin using

cmake/test_ada/scripts/comprehensive_test.sh

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
__

0001-test_ada-build-system-Find-the-non-static-version-of.patch.gz
Description: test_ada build system: Find the non-static version of the gnat library on Cygwin
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Possible fix for the test_ada project on Cygwin (NO LONGER RELEVANT)

2017-11-02 Thread Alan W. Irwin

On 2017-10-30 11:33-0700 Alan W. Irwin wrote:


Hi Arjen (returning this discussion to the plplot-devel list):

Thanks for sending me (off list) the output from the

gnatmake -v hello.adb -cargs -fPIC -bargs -shared -largs -v -shared

gnatmake -v hello.adb -bargs -static -largs -v -static

commands on Cygwin.  Based on that information I have come up with the
attached local commit (prepared with "git format-patch") to workaround
(just for the test_ada project for now) the Cygwin Ada packaging issue
revealed by the first of the above commands.

Could you let me know if that commit works for you,
i.e., once it is locally applied with "git am" does

cmake/test_ada/scripts/comprehensive_test.sh

finally work for you on Cygwin?  Also, win or lose, I would like to
see the report tarball from this test.


Hi Arjen:

As you are probably aware, thanks to the efforts of Marco to bring
this Ada packaging issue to the Cygwin mailing list and Jon
to implement the packaging fix, my workaround patch
is no longer relevant.  See
 where
the latest version of the gcc collection of compilers now properly
includes the gnat import library.  I followed up with a gnat-6.dll
search on  and the
gcc-ada-6.4.0-2 package includes

2017-10-31 04:09 9473456 
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/adalib/libgnat-6.dll.a
2017-10-31 04:0916423982 
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/adalib/libgnat.a

and the libgnat6-6.4.0-2 package includes

2017-10-31 04:11 2984467 /usr/bin/cyggnat-6.dll

Note how the import library form is much larger than the dll form and
therefore completely distinct from it (as expected).

So the next chance you have to work on PLplot, please upgrade your
Cygwin installation to this latest (6.4.0-2) gcc collection of
compilers, and confirm the following tests now work (note the change
from the above for the shared one which is a simpler and better form
of the test):

# Create the simple Ada test code (if you have not done so before)
cat > hello.adb
with Ada.Text_IO; use Ada.Text_IO;
procedure Hello is
begin
   Put_Line ("Hello WORLD!");
end Hello;

# shared case
# remove results of all previous build attempts (if any)
rm -f hello hello.ali hello.o
gnatmake -v hello.adb -bargs -shared -largs -v
# test shared case
./hello

# static case
# remove results of all previous build attempts (if any)
rm -f hello hello.ali hello.o
gnatmake -v hello.adb -bargs -static -largs -v
# test static case
./hello

I find these tests work here (Debian Jessie with gcc 4.9.2) without
issues, and I urge anyone here who wants to test their Ada and gnat
installation to try these simple tests first.

Assuming the above simple gnatmake tests work on Cygwin for the
6.4.0-2 case, please follow up by running
cmake/test_ada/scripts/comprehensive_test.sh for our current master
branch without my patch (i.e., nothing locally changed in
cmake/test_ada).

I am pretty sure the net result when linking the test_ada library will
be the import form of the gnat library will be found and linked in the
shared case and the static form of the gnat library will be found and
linked in the static case, and the test will "just work".  However, if
your report tarball shows any remaining issues for the test_ada
comprehensive test, I will fix them.

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
__

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel