Discussion:
[Plplot-devel] wxPLplotDemo.cpp errors
Pedro Vicente
2016-12-10 04:57:17 UTC
Permalink
Hi Phil

So, resuming the last thread about wxWidgets, what I did was to build and run wxPLplotDemo.cpp from PLpplot 5.11.1 on CentOS 6.8

all builds fine, but when I do run , I get a seg fault

[***@rhw9121 c++]$ cd /data/home002/pvicente/plplot/build/examples/c++
[***@rhw9121 c++]$ ./wxPLplotDemo
Segmentation fault

I know that only this information is not much help to you to debug, but in the next couple of days I'll be debugging this and posting here any solution.

my cmake call was

cmake .. -G "Unix Makefiles" -DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=/data/data127/pvicente/install/plplot-5.11.1d -DPL_HAVE_PTHREAD:BOOL=OFF -DPLD_xwin:BOOL=OFF -DPLD_wxwidgets:BOOL=ON -DwxWidgets_ROOT_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0 -DwxWidgets_LIB_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0/lib -DwxWidgets_CONFIGURATION=mswud -DENABLE_MIX_CXX=ON -DwxWidgets_EXCLUDE_COMMON_LIBRARIES:BOOL=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_TEST:BOOL=ON >& cmake.txt &


the output of
cmake
and
make
are attached

-Pedro
Pedro Vicente
2016-12-10 05:59:01 UTC
Permalink
Hi Phil

So, the issue seems to be the same that I have been reporting


In the wxPLplotDemo.cpp code you have these callling functions


wxPLplotwindow<wxFrame> *frame = new wxPlDemoFrame();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );


that make 2 calls to the PLplot library, or the wxWidgets driver of it
all these calls are in the header file wxPLplotwindow.h

first the constructor is called

template<class WXWINDOW>
wxPLplotwindow<WXWINDOW>::wxPLplotwindow( bool useGraphicsContext, wxSize clientSize )
: m_created( false ), m_initialSize( clientSize )


then this call OnCreate() is called, like you mentioned
and the !m_created bool makes the initialization of the stream happen

the problem is that this function id *NOT* called on my linux build (it is on the Windows build)
so therefore later
wxPLplotstream* pls = plotwindow->GetStream();

this is NULL, so therefore it seg faults on the plot calls


//! This is called when the widow is created i.e. after WXWINDOW::Create

// has been called. We note that this has been called to avoid attempting

// to redraw a plot on a window that hasn't been created yet.

template<class WXWINDOW>

void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )

{

if ( !m_created )


so, one quick try is to put the code of

void wxPLplotwindow<WXWINDOW>::OnCreate

that is not called on the constructor maybe ?



-Pedro


----- Original Message -----
From: Pedro Vicente
To: plplot-***@lists.sourceforge.net ; Phil Rosenberg
Sent: Friday, December 09, 2016 11:57 PM
Subject: [Plplot-devel] wxPLplotDemo.cpp errors


Hi Phil

So, resuming the last thread about wxWidgets, what I did was to build and run wxPLplotDemo.cpp from PLpplot 5.11.1 on CentOS 6.8

all builds fine, but when I do run , I get a seg fault

[***@rhw9121 c++]$ cd /data/home002/pvicente/plplot/build/examples/c++
[***@rhw9121 c++]$ ./wxPLplotDemo
Segmentation fault

I know that only this information is not much help to you to debug, but in the next couple of days I'll be debugging this and posting here any solution.

my cmake call was

cmake .. -G "Unix Makefiles" -DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=/data/data127/pvicente/install/plplot-5.11.1d -DPL_HAVE_PTHREAD:BOOL=OFF -DPLD_xwin:BOOL=OFF -DPLD_wxwidgets:BOOL=ON -DwxWidgets_ROOT_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0 -DwxWidgets_LIB_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0/lib -DwxWidgets_CONFIGURATION=mswud -DENABLE_MIX_CXX=ON -DwxWidgets_EXCLUDE_COMMON_LIBRARIES:BOOL=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_TEST:BOOL=ON >& cmake.txt &


the output of
cmake
and
make
are attached

-Pedro


------------------------------------------------------------------------------


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
Pedro Vicente
2016-12-10 07:52:03 UTC
Permalink
Hi Phil

My idea for a fix is to move the stream initialization that is now on

void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event
{
if ( !m_created )

either to the OnSize or onPaint events

void wxPLplotwindow<WXWINDOW>::OnSize( wxSizeEvent& WXUNUSED( event ) )

and also in the plot call do this

template< class WXWINDOW >
void Plot( wxPLplotwindow<WXWINDOW> *plotwindow )
{
wxPLplotstream* pls = plotwindow->GetStream();

if (pls == NULL)
{
return;
}


Like this , in this sequence


wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->SetIcon( wxIcon( graph ) );
frame->Show();
Plot( frame );


first we go to
Plot( frame );

but the stream is NULL because
:OnCreate
was not called, but the function returns, avoiding the seg fault

then the window gets a paint or size event, and the stream initialization
code is called
at this time I have a PLplot empty black window

but because
Plot( frame );
was only called at start, it is not called again, so there is no draw

any ideas here ?

of course making the Plot() call in another app function should work


If you could replicate this issue, that would be great.
I am using CentOS 6.8, PLplot.5.11.1 , wxWidgets 3.1.0





----- Original Message -----
From: Pedro Vicente
To: plplot-***@lists.sourceforge.net ; Phil Rosenberg
Sent: Saturday, December 10, 2016 12:59 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors


Hi Phil

So, the issue seems to be the same that I have been reporting


In the wxPLplotDemo.cpp code you have these callling functions


wxPLplotwindow<wxFrame> *frame = new wxPlDemoFrame();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );


that make 2 calls to the PLplot library, or the wxWidgets driver of it
all these calls are in the header file wxPLplotwindow.h

first the constructor is called

template<class WXWINDOW>
wxPLplotwindow<WXWINDOW>::wxPLplotwindow( bool useGraphicsContext, wxSize
clientSize )
: m_created( false ), m_initialSize( clientSize )


then this call OnCreate() is called, like you mentioned
and the !m_created bool makes the initialization of the stream happen

the problem is that this function id *NOT* called on my linux build (it is
on the Windows build)
so therefore later
wxPLplotstream* pls = plotwindow->GetStream();
this is NULL, so therefore it seg faults on the plot calls

//! This is called when the widow is created i.e. after WXWINDOW::Create
// has been called. We note that this has been called to avoid attempting
// to redraw a plot on a window that hasn't been created yet.
template<class WXWINDOW>
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
if ( !m_created )

so, one quick try is to put the code of

void wxPLplotwindow<WXWINDOW>::OnCreate
that is not called on the constructor maybe ?

-Pedro

----- Original Message -----
From: Pedro Vicente
To: plplot-***@lists.sourceforge.net ; Phil Rosenberg
Sent: Friday, December 09, 2016 11:57 PM
Subject: [Plplot-devel] wxPLplotDemo.cpp errors


Hi Phil

So, resuming the last thread about wxWidgets, what I did was to build and
run wxPLplotDemo.cpp from PLpplot 5.11.1 on CentOS 6.8

all builds fine, but when I do run , I get a seg fault

[***@rhw9121 c++]$ cd
/data/home002/pvicente/plplot/build/examples/c++
[***@rhw9121 c++]$ ./wxPLplotDemo
Segmentation fault

I know that only this information is not much help to you to debug, but in
the next couple of days I'll be debugging this and posting here any
solution.

my cmake call was

cmake .. -G "Unix
Makefiles" -DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF
-DENABLE_tk:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=/data/data127/pvicente/install/plplot-5.11.1d
-DPL_HAVE_PTHREAD:BOOL=OFF -DPLD_xwin:BOOL=OFF -DPLD_wxwidgets:BOOL=ON -DwxWidgets_ROOT_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0
-DwxWidgets_LIB_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0/lib
-DwxWidgets_CONFIGURATION=mswud -DENABLE_MIX_CXX=ON -DwxWidgets_EXCLUDE_COMMON_LIBRARIES:BOOL=OFF
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_TEST:BOOL=ON >& cmake.txt &


the output of
cmake
and
make
are attached

-Pedro



------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi



_______________________________________________
Plplot-devel mailing list
Plplot-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel




------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi



_______________________________________________
Plplot-devel mailing list
Plplot-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel
Phil Rosenberg
2016-12-10 08:57:40 UTC
Permalink
Hi Pedro
I have included the devel list on this email, so the thread will get
documented on the mailing list.

It is very strange that the OnCreate function is not being called. If
you are calling Create then you should be generating a create event.
Am I correct in saying that you are getting this segfault with the
unchanged demo app?

This location really is the best (and maybe only) place this
initialisation should be done. It cannot be included in the
constructor, because the generic nature of the template specification
means the code in the constructor does not know which type of wxWindow
we are inheriting from so cannot pass the correct parameters to the
constructor. By the time OnPaint is called it is really too late,
because we would like to already have the plot initialised and ready
to draw and it would be a real pain for you in your code if you had to
somehow wait for the first paint or resize event.

I do have access to a CentOS machine at work, although I think I have
only got access to wxWidgets 2.8 on that system. I will check. I may
be able to build 3.1 from source. I presume you are using 3.1.0 as
released in February, rather than the head of the master branch?

On 10 December 2016 at 07:52, Pedro Vicente
Post by Pedro Vicente
Hi Phil
My idea for a fix is to move the stream initialization that is now on
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event
{
if ( !m_created )
either to the OnSize or onPaint events
void wxPLplotwindow<WXWINDOW>::OnSize( wxSizeEvent& WXUNUSED( event ) )
and also in the plot call do this
template< class WXWINDOW >
void Plot( wxPLplotwindow<WXWINDOW> *plotwindow )
{
wxPLplotstream* pls = plotwindow->GetStream();
if (pls == NULL)
{
return;
}
Like this , in this sequence
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->SetIcon( wxIcon( graph ) );
frame->Show();
Plot( frame );
first we go to
Plot( frame );
but the stream is NULL because
:OnCreate
was not called, but the function returns, avoiding the seg fault
then the window gets a paint or size event, and the stream initialization
code is called
at this time I have a PLplot empty black window
but because
Plot( frame );
was only called at start, it is not called again, so there is no draw
any ideas here ?
of course making the Plot() call in another app function should work
If you could replicate this issue, that would be great.
I am using CentOS 6.8, PLplot.5.11.1 , wxWidgets 3.1.0
----- Original Message ----- From: Pedro Vicente
Sent: Saturday, December 10, 2016 12:59 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, the issue seems to be the same that I have been reporting
In the wxPLplotDemo.cpp code you have these callling functions
wxPLplotwindow<wxFrame> *frame = new wxPlDemoFrame();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
that make 2 calls to the PLplot library, or the wxWidgets driver of it
all these calls are in the header file wxPLplotwindow.h
first the constructor is called
template<class WXWINDOW>
wxPLplotwindow<WXWINDOW>::wxPLplotwindow( bool useGraphicsContext, wxSize clientSize )
: m_created( false ), m_initialSize( clientSize )
then this call OnCreate() is called, like you mentioned
and the !m_created bool makes the initialization of the stream happen
the problem is that this function id *NOT* called on my linux build (it is
on the Windows build)
so therefore later
wxPLplotstream* pls = plotwindow->GetStream();
this is NULL, so therefore it seg faults on the plot calls
//! This is called when the widow is created i.e. after WXWINDOW::Create
// has been called. We note that this has been called to avoid attempting
// to redraw a plot on a window that hasn't been created yet.
template<class WXWINDOW>
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
if ( !m_created )
so, one quick try is to put the code of
void wxPLplotwindow<WXWINDOW>::OnCreate
that is not called on the constructor maybe ?
-Pedro
----- Original Message ----- From: Pedro Vicente
Sent: Friday, December 09, 2016 11:57 PM
Subject: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, resuming the last thread about wxWidgets, what I did was to build and
run wxPLplotDemo.cpp from PLpplot 5.11.1 on CentOS 6.8
all builds fine, but when I do run , I get a seg fault
/data/home002/pvicente/plplot/build/examples/c++
Segmentation fault
I know that only this information is not much help to you to debug, but in
the next couple of days I'll be debugging this and posting here any
solution.
my cmake call was
cmake .. -G "Unix Makefiles" -DBUILD_SHARED_LIBS:BOOL=OFF
-DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:PATH=/data/data127/pvicente/install/plplot-5.11.1d
-DPL_HAVE_PTHREAD:BOOL=OFF -DPLD_xwin:BOOL=OFF -DPLD_wxwidgets:BOOL=ON
-DwxWidgets_ROOT_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0
-DwxWidgets_LIB_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0/lib
-DwxWidgets_CONFIGURATION=mswud -DENABLE_MIX_CXX=ON
-DwxWidgets_EXCLUDE_COMMON_LIBRARIES:BOOL=OFF
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_TEST:BOOL=ON >& cmake.txt &
the output of
cmake
and
make
are attached
-Pedro
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
Pedro Vicente
2016-12-10 09:11:25 UTC
Permalink
Hi Phil
Post by Phil Rosenberg
I have included the devel list on this email, so the thread will get
documented on the mailing list.
I have been posting everything to the list
Post by Phil Rosenberg
Am I correct in saying that you are getting this segfault with the
unchanged demo app?
yes, correct
Post by Phil Rosenberg
It cannot be included in the
constructor, because the generic nature of the template specification
yes, exactly
Post by Phil Rosenberg
Post by Phil Rosenberg
Post by Phil Rosenberg
I do have access to a CentOS machine at work, although I think I have
only got access to wxWidgets 2.8 on that system.
I just did a build on Ubuntu with wxWidgets installed from package (not sure
which version, I will check)
see last email
Post by Phil Rosenberg
Post by Phil Rosenberg
I presume you are using 3.1.0 as
released in February,
yes, on CentOS


-Pedro




----- Original Message -----
From: "Phil Rosenberg" <***@gmail.com>
To: "Pedro Vicente" <***@space-research.org>;
<plplot-***@lists.sourceforge.net>
Sent: Saturday, December 10, 2016 3:57 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors
Post by Phil Rosenberg
Hi Pedro
I have included the devel list on this email, so the thread will get
documented on the mailing list.
It is very strange that the OnCreate function is not being called. If
you are calling Create then you should be generating a create event.
Am I correct in saying that you are getting this segfault with the
unchanged demo app?
This location really is the best (and maybe only) place this
initialisation should be done. It cannot be included in the
constructor, because the generic nature of the template specification
means the code in the constructor does not know which type of wxWindow
we are inheriting from so cannot pass the correct parameters to the
constructor. By the time OnPaint is called it is really too late,
because we would like to already have the plot initialised and ready
to draw and it would be a real pain for you in your code if you had to
somehow wait for the first paint or resize event.
I do have access to a CentOS machine at work, although I think I have
only got access to wxWidgets 2.8 on that system. I will check. I may
be able to build 3.1 from source. I presume you are using 3.1.0 as
released in February, rather than the head of the master branch?
On 10 December 2016 at 07:52, Pedro Vicente
Post by Phil Rosenberg
Hi Phil
My idea for a fix is to move the stream initialization that is now on
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event
{
if ( !m_created )
either to the OnSize or onPaint events
void wxPLplotwindow<WXWINDOW>::OnSize( wxSizeEvent& WXUNUSED( event ) )
and also in the plot call do this
template< class WXWINDOW >
void Plot( wxPLplotwindow<WXWINDOW> *plotwindow )
{
wxPLplotstream* pls = plotwindow->GetStream();
if (pls == NULL)
{
return;
}
Like this , in this sequence
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->SetIcon( wxIcon( graph ) );
frame->Show();
Plot( frame );
first we go to
Plot( frame );
but the stream is NULL because
:OnCreate
was not called, but the function returns, avoiding the seg fault
then the window gets a paint or size event, and the stream initialization
code is called
at this time I have a PLplot empty black window
but because
Plot( frame );
was only called at start, it is not called again, so there is no draw
any ideas here ?
of course making the Plot() call in another app function should work
If you could replicate this issue, that would be great.
I am using CentOS 6.8, PLplot.5.11.1 , wxWidgets 3.1.0
----- Original Message ----- From: Pedro Vicente
Sent: Saturday, December 10, 2016 12:59 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, the issue seems to be the same that I have been reporting
In the wxPLplotDemo.cpp code you have these callling functions
wxPLplotwindow<wxFrame> *frame = new wxPlDemoFrame();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
that make 2 calls to the PLplot library, or the wxWidgets driver of it
all these calls are in the header file wxPLplotwindow.h
first the constructor is called
template<class WXWINDOW>
wxPLplotwindow<WXWINDOW>::wxPLplotwindow( bool useGraphicsContext, wxSize clientSize )
: m_created( false ), m_initialSize( clientSize )
then this call OnCreate() is called, like you mentioned
and the !m_created bool makes the initialization of the stream happen
the problem is that this function id *NOT* called on my linux build (it is
on the Windows build)
so therefore later
wxPLplotstream* pls = plotwindow->GetStream();
this is NULL, so therefore it seg faults on the plot calls
//! This is called when the widow is created i.e. after WXWINDOW::Create
// has been called. We note that this has been called to avoid attempting
// to redraw a plot on a window that hasn't been created yet.
template<class WXWINDOW>
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
if ( !m_created )
so, one quick try is to put the code of
void wxPLplotwindow<WXWINDOW>::OnCreate
that is not called on the constructor maybe ?
-Pedro
----- Original Message ----- From: Pedro Vicente
Sent: Friday, December 09, 2016 11:57 PM
Subject: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, resuming the last thread about wxWidgets, what I did was to build and
run wxPLplotDemo.cpp from PLpplot 5.11.1 on CentOS 6.8
all builds fine, but when I do run , I get a seg fault
/data/home002/pvicente/plplot/build/examples/c++
Segmentation fault
I know that only this information is not much help to you to debug, but in
the next couple of days I'll be debugging this and posting here any
solution.
my cmake call was
cmake .. -G "Unix Makefiles" -DBUILD_SHARED_LIBS:BOOL=OFF
-DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:PATH=/data/data127/pvicente/install/plplot-5.11.1d
-DPL_HAVE_PTHREAD:BOOL=OFF -DPLD_xwin:BOOL=OFF -DPLD_wxwidgets:BOOL=ON
-DwxWidgets_ROOT_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0
-DwxWidgets_LIB_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0/lib
-DwxWidgets_CONFIGURATION=mswud -DENABLE_MIX_CXX=ON
-DwxWidgets_EXCLUDE_COMMON_LIBRARIES:BOOL=OFF
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_TEST:BOOL=ON >& cmake.txt &
the output of
cmake
and
make
are attached
-Pedro
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
Pedro Vicente
2016-12-10 09:18:20 UTC
Permalink
Hi Phil
Post by Phil Rosenberg
Post by Phil Rosenberg
I do have access to a CentOS machine at work, although I think I have
only got access to wxWidgets 2.8 on that system.
What I usually do when I want to quick test on many unices , I install
Virtual Box

https://www.virtualbox.org/

For example on my Windows PC I have a CentOS and Ubuntu as virtual guests
(not the ones I did the PLplot test)

-Pedro




----- Original Message -----
From: "Phil Rosenberg" <***@gmail.com>
To: "Pedro Vicente" <***@space-research.org>;
<plplot-***@lists.sourceforge.net>
Sent: Saturday, December 10, 2016 3:57 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors
Post by Phil Rosenberg
Hi Pedro
I have included the devel list on this email, so the thread will get
documented on the mailing list.
It is very strange that the OnCreate function is not being called. If
you are calling Create then you should be generating a create event.
Am I correct in saying that you are getting this segfault with the
unchanged demo app?
This location really is the best (and maybe only) place this
initialisation should be done. It cannot be included in the
constructor, because the generic nature of the template specification
means the code in the constructor does not know which type of wxWindow
we are inheriting from so cannot pass the correct parameters to the
constructor. By the time OnPaint is called it is really too late,
because we would like to already have the plot initialised and ready
to draw and it would be a real pain for you in your code if you had to
somehow wait for the first paint or resize event.
I do have access to a CentOS machine at work, although I think I have
only got access to wxWidgets 2.8 on that system. I will check. I may
be able to build 3.1 from source. I presume you are using 3.1.0 as
released in February, rather than the head of the master branch?
On 10 December 2016 at 07:52, Pedro Vicente
Post by Phil Rosenberg
Hi Phil
My idea for a fix is to move the stream initialization that is now on
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event
{
if ( !m_created )
either to the OnSize or onPaint events
void wxPLplotwindow<WXWINDOW>::OnSize( wxSizeEvent& WXUNUSED( event ) )
and also in the plot call do this
template< class WXWINDOW >
void Plot( wxPLplotwindow<WXWINDOW> *plotwindow )
{
wxPLplotstream* pls = plotwindow->GetStream();
if (pls == NULL)
{
return;
}
Like this , in this sequence
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->SetIcon( wxIcon( graph ) );
frame->Show();
Plot( frame );
first we go to
Plot( frame );
but the stream is NULL because
:OnCreate
was not called, but the function returns, avoiding the seg fault
then the window gets a paint or size event, and the stream initialization
code is called
at this time I have a PLplot empty black window
but because
Plot( frame );
was only called at start, it is not called again, so there is no draw
any ideas here ?
of course making the Plot() call in another app function should work
If you could replicate this issue, that would be great.
I am using CentOS 6.8, PLplot.5.11.1 , wxWidgets 3.1.0
----- Original Message ----- From: Pedro Vicente
Sent: Saturday, December 10, 2016 12:59 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, the issue seems to be the same that I have been reporting
In the wxPLplotDemo.cpp code you have these callling functions
wxPLplotwindow<wxFrame> *frame = new wxPlDemoFrame();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
that make 2 calls to the PLplot library, or the wxWidgets driver of it
all these calls are in the header file wxPLplotwindow.h
first the constructor is called
template<class WXWINDOW>
wxPLplotwindow<WXWINDOW>::wxPLplotwindow( bool useGraphicsContext, wxSize clientSize )
: m_created( false ), m_initialSize( clientSize )
then this call OnCreate() is called, like you mentioned
and the !m_created bool makes the initialization of the stream happen
the problem is that this function id *NOT* called on my linux build (it is
on the Windows build)
so therefore later
wxPLplotstream* pls = plotwindow->GetStream();
this is NULL, so therefore it seg faults on the plot calls
//! This is called when the widow is created i.e. after WXWINDOW::Create
// has been called. We note that this has been called to avoid attempting
// to redraw a plot on a window that hasn't been created yet.
template<class WXWINDOW>
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
if ( !m_created )
so, one quick try is to put the code of
void wxPLplotwindow<WXWINDOW>::OnCreate
that is not called on the constructor maybe ?
-Pedro
----- Original Message ----- From: Pedro Vicente
Sent: Friday, December 09, 2016 11:57 PM
Subject: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, resuming the last thread about wxWidgets, what I did was to build and
run wxPLplotDemo.cpp from PLpplot 5.11.1 on CentOS 6.8
all builds fine, but when I do run , I get a seg fault
/data/home002/pvicente/plplot/build/examples/c++
Segmentation fault
I know that only this information is not much help to you to debug, but in
the next couple of days I'll be debugging this and posting here any
solution.
my cmake call was
cmake .. -G "Unix Makefiles" -DBUILD_SHARED_LIBS:BOOL=OFF
-DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:PATH=/data/data127/pvicente/install/plplot-5.11.1d
-DPL_HAVE_PTHREAD:BOOL=OFF -DPLD_xwin:BOOL=OFF -DPLD_wxwidgets:BOOL=ON
-DwxWidgets_ROOT_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0
-DwxWidgets_LIB_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0/lib
-DwxWidgets_CONFIGURATION=mswud -DENABLE_MIX_CXX=ON
-DwxWidgets_EXCLUDE_COMMON_LIBRARIES:BOOL=OFF
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_TEST:BOOL=ON >& cmake.txt &
the output of
cmake
and
make
are attached
-Pedro
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
Pedro Vicente
2016-12-10 15:55:23 UTC
Permalink
Hi Phil

I tested on a third Linux, with libwxgtk3.0-dev from package (the latest
ubuntu package)

uname -a
Linux glace 3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:26 UTC 2016
x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty

then
git clone http://git.code.sf.net/p/plplot/plplot plplot-plplot
sudo apt-get install libwxgtk3.0-dev
cd plplot-plplot/build/
cmake .. -DBUILD_TEST=ON -DENABLE_f95:BOOL=OFF
make
cd /home/pvicente/plplot-plplot/build/examples/c++
***@glace:~/plplot-plplot/build/examples/c++$ ./wxPLplotDemo
Segmentation fault (core dumped)



----- Original Message -----
From: "Pedro Vicente" <***@space-research.org>
To: "Phil Rosenberg" <***@gmail.com>;
<plplot-***@lists.sourceforge.net>
Sent: Saturday, December 10, 2016 4:18 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors
Post by Pedro Vicente
Hi Phil
Post by Phil Rosenberg
Post by Phil Rosenberg
I do have access to a CentOS machine at work, although I think I have
only got access to wxWidgets 2.8 on that system.
What I usually do when I want to quick test on many unices , I install
Virtual Box
https://www.virtualbox.org/
For example on my Windows PC I have a CentOS and Ubuntu as virtual guests
(not the ones I did the PLplot test)
-Pedro
----- Original Message -----
Sent: Saturday, December 10, 2016 3:57 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors
Post by Phil Rosenberg
Hi Pedro
I have included the devel list on this email, so the thread will get
documented on the mailing list.
It is very strange that the OnCreate function is not being called. If
you are calling Create then you should be generating a create event.
Am I correct in saying that you are getting this segfault with the
unchanged demo app?
This location really is the best (and maybe only) place this
initialisation should be done. It cannot be included in the
constructor, because the generic nature of the template specification
means the code in the constructor does not know which type of wxWindow
we are inheriting from so cannot pass the correct parameters to the
constructor. By the time OnPaint is called it is really too late,
because we would like to already have the plot initialised and ready
to draw and it would be a real pain for you in your code if you had to
somehow wait for the first paint or resize event.
I do have access to a CentOS machine at work, although I think I have
only got access to wxWidgets 2.8 on that system. I will check. I may
be able to build 3.1 from source. I presume you are using 3.1.0 as
released in February, rather than the head of the master branch?
On 10 December 2016 at 07:52, Pedro Vicente
Post by Phil Rosenberg
Hi Phil
My idea for a fix is to move the stream initialization that is now on
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event
{
if ( !m_created )
either to the OnSize or onPaint events
void wxPLplotwindow<WXWINDOW>::OnSize( wxSizeEvent& WXUNUSED( event ) )
and also in the plot call do this
template< class WXWINDOW >
void Plot( wxPLplotwindow<WXWINDOW> *plotwindow )
{
wxPLplotstream* pls = plotwindow->GetStream();
if (pls == NULL)
{
return;
}
Like this , in this sequence
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->SetIcon( wxIcon( graph ) );
frame->Show();
Plot( frame );
first we go to
Plot( frame );
but the stream is NULL because
:OnCreate
was not called, but the function returns, avoiding the seg fault
then the window gets a paint or size event, and the stream
initialization
code is called
at this time I have a PLplot empty black window
but because
Plot( frame );
was only called at start, it is not called again, so there is no draw
any ideas here ?
of course making the Plot() call in another app function should work
If you could replicate this issue, that would be great.
I am using CentOS 6.8, PLplot.5.11.1 , wxWidgets 3.1.0
----- Original Message ----- From: Pedro Vicente
Sent: Saturday, December 10, 2016 12:59 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, the issue seems to be the same that I have been reporting
In the wxPLplotDemo.cpp code you have these callling functions
wxPLplotwindow<wxFrame> *frame = new wxPlDemoFrame();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
that make 2 calls to the PLplot library, or the wxWidgets driver of it
all these calls are in the header file wxPLplotwindow.h
first the constructor is called
template<class WXWINDOW>
wxPLplotwindow<WXWINDOW>::wxPLplotwindow( bool useGraphicsContext,
wxSize
clientSize )
: m_created( false ), m_initialSize( clientSize )
then this call OnCreate() is called, like you mentioned
and the !m_created bool makes the initialization of the stream happen
the problem is that this function id *NOT* called on my linux build (it is
on the Windows build)
so therefore later
wxPLplotstream* pls = plotwindow->GetStream();
this is NULL, so therefore it seg faults on the plot calls
//! This is called when the widow is created i.e. after WXWINDOW::Create
// has been called. We note that this has been called to avoid attempting
// to redraw a plot on a window that hasn't been created yet.
template<class WXWINDOW>
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
if ( !m_created )
so, one quick try is to put the code of
void wxPLplotwindow<WXWINDOW>::OnCreate
that is not called on the constructor maybe ?
-Pedro
----- Original Message ----- From: Pedro Vicente
Sent: Friday, December 09, 2016 11:57 PM
Subject: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, resuming the last thread about wxWidgets, what I did was to build and
run wxPLplotDemo.cpp from PLpplot 5.11.1 on CentOS 6.8
all builds fine, but when I do run , I get a seg fault
/data/home002/pvicente/plplot/build/examples/c++
Segmentation fault
I know that only this information is not much help to you to debug, but in
the next couple of days I'll be debugging this and posting here any
solution.
my cmake call was
cmake .. -G "Unix Makefiles" -DBUILD_SHARED_LIBS:BOOL=OFF
-DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:PATH=/data/data127/pvicente/install/plplot-5.11.1d
-DPL_HAVE_PTHREAD:BOOL=OFF -DPLD_xwin:BOOL=OFF -DPLD_wxwidgets:BOOL=ON
-DwxWidgets_ROOT_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0
-DwxWidgets_LIB_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0/lib
-DwxWidgets_CONFIGURATION=mswud -DENABLE_MIX_CXX=ON
-DwxWidgets_EXCLUDE_COMMON_LIBRARIES:BOOL=OFF
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_TEST:BOOL=ON >& cmake.txt &
the output of
cmake
and
make
are attached
-Pedro
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
Pedro Vicente
2016-12-11 04:25:05 UTC
Permalink
Hi Phil

There is actually a very simple solution.
Instead of figuring out why the OnCreate event is not triggered in some
linux cases, you can explicitally call that code with some function.

I did just that, like this, where
frame->CreatePLplotstream();

is a function that contains your code that is in OnCreate()

this makes it needed to a user to call this extra function, but well, you
can't win them all

this code below makes a plot in Windows and Linux

Note:
I did my own class
wx_PLplotFrame

that is virtually identical to wxPLplotwindow, but not templated

I'll put this code in github when I have a chance later

bool wxAppPlot::OnInit()
{
wx_PLplotFrame *frame = new wx_PLplotFrame();
frame->Create(NULL, wxID_ANY, wxT("wxPLplot"),
wxDefaultPosition,
wxSize(900, 700));
frame->CreatePLplotstream();
frame->Show();
wxPLplotstream* pls = frame->GetStream();
assert(pls);
PLFLT x[4] = { 1, 2, 3, 4 };
PLFLT y[4] = { 1, 2, 3, 4 };
pls->env(0, 5, 0, 5, 0, 0);
pls->line(4, x, y);
return true;
}

-Pedro


----- Original Message -----
From: "Phil Rosenberg" <***@gmail.com>
To: "Pedro Vicente" <***@space-research.org>;
<plplot-***@lists.sourceforge.net>
Sent: Saturday, December 10, 2016 3:57 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors
Post by Phil Rosenberg
Hi Pedro
I have included the devel list on this email, so the thread will get
documented on the mailing list.
It is very strange that the OnCreate function is not being called. If
you are calling Create then you should be generating a create event.
Am I correct in saying that you are getting this segfault with the
unchanged demo app?
This location really is the best (and maybe only) place this
initialisation should be done. It cannot be included in the
constructor, because the generic nature of the template specification
means the code in the constructor does not know which type of wxWindow
we are inheriting from so cannot pass the correct parameters to the
constructor. By the time OnPaint is called it is really too late,
because we would like to already have the plot initialised and ready
to draw and it would be a real pain for you in your code if you had to
somehow wait for the first paint or resize event.
I do have access to a CentOS machine at work, although I think I have
only got access to wxWidgets 2.8 on that system. I will check. I may
be able to build 3.1 from source. I presume you are using 3.1.0 as
released in February, rather than the head of the master branch?
On 10 December 2016 at 07:52, Pedro Vicente
Post by Pedro Vicente
Hi Phil
My idea for a fix is to move the stream initialization that is now on
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event
{
if ( !m_created )
either to the OnSize or onPaint events
void wxPLplotwindow<WXWINDOW>::OnSize( wxSizeEvent& WXUNUSED( event ) )
and also in the plot call do this
template< class WXWINDOW >
void Plot( wxPLplotwindow<WXWINDOW> *plotwindow )
{
wxPLplotstream* pls = plotwindow->GetStream();
if (pls == NULL)
{
return;
}
Like this , in this sequence
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->SetIcon( wxIcon( graph ) );
frame->Show();
Plot( frame );
first we go to
Plot( frame );
but the stream is NULL because
:OnCreate
was not called, but the function returns, avoiding the seg fault
then the window gets a paint or size event, and the stream initialization
code is called
at this time I have a PLplot empty black window
but because
Plot( frame );
was only called at start, it is not called again, so there is no draw
any ideas here ?
of course making the Plot() call in another app function should work
If you could replicate this issue, that would be great.
I am using CentOS 6.8, PLplot.5.11.1 , wxWidgets 3.1.0
----- Original Message ----- From: Pedro Vicente
Sent: Saturday, December 10, 2016 12:59 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, the issue seems to be the same that I have been reporting
In the wxPLplotDemo.cpp code you have these callling functions
wxPLplotwindow<wxFrame> *frame = new wxPlDemoFrame();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
that make 2 calls to the PLplot library, or the wxWidgets driver of it
all these calls are in the header file wxPLplotwindow.h
first the constructor is called
template<class WXWINDOW>
wxPLplotwindow<WXWINDOW>::wxPLplotwindow( bool useGraphicsContext, wxSize clientSize )
: m_created( false ), m_initialSize( clientSize )
then this call OnCreate() is called, like you mentioned
and the !m_created bool makes the initialization of the stream happen
the problem is that this function id *NOT* called on my linux build (it is
on the Windows build)
so therefore later
wxPLplotstream* pls = plotwindow->GetStream();
this is NULL, so therefore it seg faults on the plot calls
//! This is called when the widow is created i.e. after WXWINDOW::Create
// has been called. We note that this has been called to avoid attempting
// to redraw a plot on a window that hasn't been created yet.
template<class WXWINDOW>
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
if ( !m_created )
so, one quick try is to put the code of
void wxPLplotwindow<WXWINDOW>::OnCreate
that is not called on the constructor maybe ?
-Pedro
----- Original Message ----- From: Pedro Vicente
Sent: Friday, December 09, 2016 11:57 PM
Subject: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, resuming the last thread about wxWidgets, what I did was to build and
run wxPLplotDemo.cpp from PLpplot 5.11.1 on CentOS 6.8
all builds fine, but when I do run , I get a seg fault
/data/home002/pvicente/plplot/build/examples/c++
Segmentation fault
I know that only this information is not much help to you to debug, but in
the next couple of days I'll be debugging this and posting here any
solution.
my cmake call was
cmake .. -G "Unix Makefiles" -DBUILD_SHARED_LIBS:BOOL=OFF
-DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:PATH=/data/data127/pvicente/install/plplot-5.11.1d
-DPL_HAVE_PTHREAD:BOOL=OFF -DPLD_xwin:BOOL=OFF -DPLD_wxwidgets:BOOL=ON
-DwxWidgets_ROOT_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0
-DwxWidgets_LIB_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0/lib
-DwxWidgets_CONFIGURATION=mswud -DENABLE_MIX_CXX=ON
-DwxWidgets_EXCLUDE_COMMON_LIBRARIES:BOOL=OFF
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_TEST:BOOL=ON >& cmake.txt &
the output of
cmake
and
make
are attached
-Pedro
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
Pedro Vicente
2016-12-13 06:44:02 UTC
Permalink
Hi Phil

Here's the fix I did for the linux wxwidgets driver bug

https://github.com/pedro-vicente/plplot-wxwidgets


these are the comments I added in the code



// Modified from PLplot Copyright (C) 2015 Phil Rosenberg
// Changes:
// A non templated class derived from wxFrame
// Use of events by wxDECLARE_EVENT_TABLE()
// Explicit call to CreatePLplotstream() after Create()
//wx_PLplotFrame_stream *frame = new wx_PLplotFrame_stream();
//frame->Create(...);
//frame->CreatePLplotstream();
//frame->Show();

one thing that caught my attention in your code was this way of handling
events

WXWINDOW::Connect( wxEVT_SIZE, wxSizeEventHandler(
wxPLplotwindow<WXWINDOW>::OnSize ) );

I usually do a static event table, in fact all the wxWidgets samples do the
same, except
for some thread related code

but even using the static event table in your code, the bug still was there.
so the only way was to do an explicit call to

frame->CreatePLplotstream();

let me know if you have any questions
-Pedro


----- Original Message -----
From: "Pedro Vicente" <***@space-research.org>
To: "Phil Rosenberg" <***@gmail.com>;
<plplot-***@lists.sourceforge.net>
Sent: Saturday, December 10, 2016 11:25 PM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors - FIXED , with
workaround
Post by Pedro Vicente
Hi Phil
There is actually a very simple solution.
Instead of figuring out why the OnCreate event is not triggered in some
linux cases, you can explicitally call that code with some function.
I did just that, like this, where
frame->CreatePLplotstream();
is a function that contains your code that is in OnCreate()
this makes it needed to a user to call this extra function, but well, you
can't win them all
this code below makes a plot in Windows and Linux
I did my own class
wx_PLplotFrame
that is virtually identical to wxPLplotwindow, but not templated
I'll put this code in github when I have a chance later
bool wxAppPlot::OnInit()
{
wx_PLplotFrame *frame = new wx_PLplotFrame();
frame->Create(NULL, wxID_ANY, wxT("wxPLplot"),
wxDefaultPosition,
wxSize(900, 700));
frame->CreatePLplotstream();
frame->Show();
wxPLplotstream* pls = frame->GetStream();
assert(pls);
PLFLT x[4] = { 1, 2, 3, 4 };
PLFLT y[4] = { 1, 2, 3, 4 };
pls->env(0, 5, 0, 5, 0, 0);
pls->line(4, x, y);
return true;
}
-Pedro
----- Original Message -----
Sent: Saturday, December 10, 2016 3:57 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors
Post by Phil Rosenberg
Hi Pedro
I have included the devel list on this email, so the thread will get
documented on the mailing list.
It is very strange that the OnCreate function is not being called. If
you are calling Create then you should be generating a create event.
Am I correct in saying that you are getting this segfault with the
unchanged demo app?
This location really is the best (and maybe only) place this
initialisation should be done. It cannot be included in the
constructor, because the generic nature of the template specification
means the code in the constructor does not know which type of wxWindow
we are inheriting from so cannot pass the correct parameters to the
constructor. By the time OnPaint is called it is really too late,
because we would like to already have the plot initialised and ready
to draw and it would be a real pain for you in your code if you had to
somehow wait for the first paint or resize event.
I do have access to a CentOS machine at work, although I think I have
only got access to wxWidgets 2.8 on that system. I will check. I may
be able to build 3.1 from source. I presume you are using 3.1.0 as
released in February, rather than the head of the master branch?
On 10 December 2016 at 07:52, Pedro Vicente
Post by Pedro Vicente
Hi Phil
My idea for a fix is to move the stream initialization that is now on
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event
{
if ( !m_created )
either to the OnSize or onPaint events
void wxPLplotwindow<WXWINDOW>::OnSize( wxSizeEvent& WXUNUSED( event ) )
and also in the plot call do this
template< class WXWINDOW >
void Plot( wxPLplotwindow<WXWINDOW> *plotwindow )
{
wxPLplotstream* pls = plotwindow->GetStream();
if (pls == NULL)
{
return;
}
Like this , in this sequence
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->SetIcon( wxIcon( graph ) );
frame->Show();
Plot( frame );
first we go to
Plot( frame );
but the stream is NULL because
:OnCreate
was not called, but the function returns, avoiding the seg fault
then the window gets a paint or size event, and the stream
initialization
code is called
at this time I have a PLplot empty black window
but because
Plot( frame );
was only called at start, it is not called again, so there is no draw
any ideas here ?
of course making the Plot() call in another app function should work
If you could replicate this issue, that would be great.
I am using CentOS 6.8, PLplot.5.11.1 , wxWidgets 3.1.0
----- Original Message ----- From: Pedro Vicente
Sent: Saturday, December 10, 2016 12:59 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, the issue seems to be the same that I have been reporting
In the wxPLplotDemo.cpp code you have these callling functions
wxPLplotwindow<wxFrame> *frame = new wxPlDemoFrame();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
that make 2 calls to the PLplot library, or the wxWidgets driver of it
all these calls are in the header file wxPLplotwindow.h
first the constructor is called
template<class WXWINDOW>
wxPLplotwindow<WXWINDOW>::wxPLplotwindow( bool useGraphicsContext,
wxSize
clientSize )
: m_created( false ), m_initialSize( clientSize )
then this call OnCreate() is called, like you mentioned
and the !m_created bool makes the initialization of the stream happen
the problem is that this function id *NOT* called on my linux build (it is
on the Windows build)
so therefore later
wxPLplotstream* pls = plotwindow->GetStream();
this is NULL, so therefore it seg faults on the plot calls
//! This is called when the widow is created i.e. after WXWINDOW::Create
// has been called. We note that this has been called to avoid attempting
// to redraw a plot on a window that hasn't been created yet.
template<class WXWINDOW>
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
if ( !m_created )
so, one quick try is to put the code of
void wxPLplotwindow<WXWINDOW>::OnCreate
that is not called on the constructor maybe ?
-Pedro
----- Original Message ----- From: Pedro Vicente
Sent: Friday, December 09, 2016 11:57 PM
Subject: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, resuming the last thread about wxWidgets, what I did was to build and
run wxPLplotDemo.cpp from PLpplot 5.11.1 on CentOS 6.8
all builds fine, but when I do run , I get a seg fault
/data/home002/pvicente/plplot/build/examples/c++
Segmentation fault
I know that only this information is not much help to you to debug, but in
the next couple of days I'll be debugging this and posting here any
solution.
my cmake call was
cmake .. -G "Unix Makefiles" -DBUILD_SHARED_LIBS:BOOL=OFF
-DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:PATH=/data/data127/pvicente/install/plplot-5.11.1d
-DPL_HAVE_PTHREAD:BOOL=OFF -DPLD_xwin:BOOL=OFF -DPLD_wxwidgets:BOOL=ON
-DwxWidgets_ROOT_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0
-DwxWidgets_LIB_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0/lib
-DwxWidgets_CONFIGURATION=mswud -DENABLE_MIX_CXX=ON
-DwxWidgets_EXCLUDE_COMMON_LIBRARIES:BOOL=OFF
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_TEST:BOOL=ON >& cmake.txt &
the output of
cmake
and
make
are attached
-Pedro
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
Pedro Vicente
2016-12-14 15:59:54 UTC
Permalink
Hi Phil

Were you able to reproduce the error I get on my linux builds of
wxPLplotDemo?

I just did a git clone of the last plplot and I still get the error

see my last email from today, there are instructions on how to debug
with Qt

project here

https://github.com/pedro-vicente/plplot-wxwidgets/blob/master/wx_plplot/wx_plplot.qt.ubuntu.x86_64.pro

then install QtCreator

https://www.qt.io/download-open-source/#section-2

and use the file wx_plplot.qt.ubuntu.x86_64.pro

what I did

git clone http://git.code.sf.net/p/plplot/plplot plplot-plplot

then I edited the file examples/c++/wxPLplotDemo.cpp and added this
assert here

wxPLplotstream* pls = plotwindow->GetStream();
assert(pls);

just to make sure this is the issue.
then

cd plplot-plplot
cmake .. -G "Unix Makefiles" -DBUILD_SHARED_LIBS:BOOL=OFF
-DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF
-DBUILD_TEST:BOOL=ON >& cmake2.txt &
make >& make2.txt &
cd examples/c++/
./wxPLplotDemo
wxPLplotDemo:
/data/home002/pvicente/plplot-plplot/examples/c++/wxPLplotDemo.cpp:158:
void Plot(wxPLplotwindow<WXWINDOW>*) [with WXWINDOW = wxFrame]:
Assertion `pls' failed.
Aborted
Post by Phil Rosenberg
Hi Pedro
I have included the devel list on this email, so the thread will get
documented on the mailing list.
It is very strange that the OnCreate function is not being called. If
you are calling Create then you should be generating a create event.
Am I correct in saying that you are getting this segfault with the
unchanged demo app?
This location really is the best (and maybe only) place this
initialisation should be done. It cannot be included in the
constructor, because the generic nature of the template specification
means the code in the constructor does not know which type of
wxWindow
we are inheriting from so cannot pass the correct parameters to the
constructor. By the time OnPaint is called it is really too late,
because we would like to already have the plot initialised and ready
to draw and it would be a real pain for you in your code if you had to
somehow wait for the first paint or resize event.
I do have access to a CentOS machine at work, although I think I have
only got access to wxWidgets 2.8 on that system. I will check. I may
be able to build 3.1 from source. I presume you are using 3.1.0 as
released in February, rather than the head of the master branch?
On 10 December 2016 at 07:52, Pedro Vicente
Post by Pedro Vicente
Hi Phil
My idea for a fix is to move the stream initialization that is now
on
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event
{
if ( !m_created )
either to the OnSize or onPaint events
void wxPLplotwindow<WXWINDOW>::OnSize( wxSizeEvent& WXUNUSED( event ) )
and also in the plot call do this
template< class WXWINDOW >
void Plot( wxPLplotwindow<WXWINDOW> *plotwindow )
{
wxPLplotstream* pls = plotwindow->GetStream();
if (pls == NULL)
{
return;
}
Like this , in this sequence
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->SetIcon( wxIcon( graph ) );
frame->Show();
Plot( frame );
first we go to
Plot( frame );
but the stream is NULL because
:OnCreate
was not called, but the function returns, avoiding the seg fault
then the window gets a paint or size event, and the stream
initialization
code is called
at this time I have a PLplot empty black window
but because
Plot( frame );
was only called at start, it is not called again, so there is no draw
any ideas here ?
of course making the Plot() call in another app function should work
If you could replicate this issue, that would be great.
I am using CentOS 6.8, PLplot.5.11.1 , wxWidgets 3.1.0
----- Original Message ----- From: Pedro Vicente
Sent: Saturday, December 10, 2016 12:59 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, the issue seems to be the same that I have been reporting
In the wxPLplotDemo.cpp code you have these callling functions
wxPLplotwindow<wxFrame> *frame = new wxPlDemoFrame();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
that make 2 calls to the PLplot library, or the wxWidgets driver of it
all these calls are in the header file wxPLplotwindow.h
first the constructor is called
template<class WXWINDOW>
wxPLplotwindow<WXWINDOW>::wxPLplotwindow( bool useGraphicsContext, wxSize
clientSize )
: m_created( false ), m_initialSize( clientSize )
then this call OnCreate() is called, like you mentioned
and the !m_created bool makes the initialization of the stream happen
the problem is that this function id *NOT* called on my linux build (it is
on the Windows build)
so therefore later
wxPLplotstream* pls = plotwindow->GetStream();
this is NULL, so therefore it seg faults on the plot calls
//! This is called when the widow is created i.e. after
WXWINDOW::Create
// has been called. We note that this has been called to avoid attempting
// to redraw a plot on a window that hasn't been created yet.
template<class WXWINDOW>
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
if ( !m_created )
so, one quick try is to put the code of
void wxPLplotwindow<WXWINDOW>::OnCreate
that is not called on the constructor maybe ?
-Pedro
----- Original Message ----- From: Pedro Vicente
Sent: Friday, December 09, 2016 11:57 PM
Subject: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, resuming the last thread about wxWidgets, what I did was to build and
run wxPLplotDemo.cpp from PLpplot 5.11.1 on CentOS 6.8
all builds fine, but when I do run , I get a seg fault
/data/home002/pvicente/plplot/build/examples/c++
Segmentation fault
I know that only this information is not much help to you to debug, but in
the next couple of days I'll be debugging this and posting here any
solution.
my cmake call was
cmake .. -G "Unix Makefiles" -DBUILD_SHARED_LIBS:BOOL=OFF
-DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:PATH=/data/data127/pvicente/install/plplot-5.11.1d
-DPL_HAVE_PTHREAD:BOOL=OFF -DPLD_xwin:BOOL=OFF
-DPLD_wxwidgets:BOOL=ON
-DwxWidgets_ROOT_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0
-DwxWidgets_LIB_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0/lib
-DwxWidgets_CONFIGURATION=mswud -DENABLE_MIX_CXX=ON
-DwxWidgets_EXCLUDE_COMMON_LIBRARIES:BOOL=OFF
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_TEST:BOOL=ON >& cmake.txt &
the output of
cmake
and
make
are attached
-Pedro
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
--
Pedro Vicente
***@space-research.org
http://www.space-research.org/
Pedro Vicente
2016-12-14 16:47:30 UTC
Permalink
Hi Phil

I am using the attached qt project file on my CentOS 6.8 build, adapted
to build
examples/c++/wxPLplotDemo.cpp

to use, place the file in
examples/c++

just change these lines for your own case

dir_inc_plplot =
/data/home002/pvicente/plplot-plplot-install/include/plplot
dir_lib_plplot = /data/home002/pvicente/plplot-plplot-install/lib
dir_inc_wx =
/data/data127/pvicente/install/wxwidgets-3.1.0d/include/wx-3.1
dir_inc_wx_setup =
/data/data127/pvicente/install/wxwidgets-3.1.0d/lib/wx/include/gtk2-unicode-static-3.1
dir_lib_wx = /data/data127/pvicente/install/wxwidgets-3.1.0d/lib

in QtCreator change in Projects/Run, disable the the "Run in Terminal"

this is the stack on the window creation as shown in QtCreator


0 wxWindow::PostCreation window.cpp 2753 0x4d9ea4
1 wxTopLevelWindowGTK::Create toplevel.cpp 674 0x4cdb79
2 wxFrame::Create frame.cpp 48 0x4e672b
3 MyApp::OnInit wxPLplotDemo.cpp 148 0x4259d8
4 wxAppConsoleBase::CallOnInit app.h 93 0x426c23
5 wxEntry init.cpp 487 0x6bf36d
6 wxEntry init.cpp 515 0x6bf475
7 main wxPLplotDemo.cpp 131 0x4258a4


As opposed to the wxWidgets Windows build, that uses the WIN32 API, for
linux it's a totally different API (GTK),
so the issue may be a wxWidgets GTK code thing

-Pedro
Post by Pedro Vicente
Hi Phil
Were you able to reproduce the error I get on my linux builds of
wxPLplotDemo?
I just did a git clone of the last plplot and I still get the error
see my last email from today, there are instructions on how to debug
with Qt
project here
https://github.com/pedro-vicente/plplot-wxwidgets/blob/master/wx_plplot/wx_plplot.qt.ubuntu.x86_64.pro
then install QtCreator
https://www.qt.io/download-open-source/#section-2
and use the file wx_plplot.qt.ubuntu.x86_64.pro
what I did
git clone http://git.code.sf.net/p/plplot/plplot plplot-plplot
then I edited the file examples/c++/wxPLplotDemo.cpp and added this
assert here
wxPLplotstream* pls = plotwindow->GetStream();
assert(pls);
just to make sure this is the issue.
then
cd plplot-plplot
cmake .. -G "Unix Makefiles" -DBUILD_SHARED_LIBS:BOOL=OFF
-DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF
-DBUILD_TEST:BOOL=ON >& cmake2.txt &
make >& make2.txt &
cd examples/c++/
./wxPLplotDemo
Assertion `pls' failed.
Aborted
Post by Phil Rosenberg
Hi Pedro
I have included the devel list on this email, so the thread will get
documented on the mailing list.
It is very strange that the OnCreate function is not being called. If
you are calling Create then you should be generating a create event.
Am I correct in saying that you are getting this segfault with the
unchanged demo app?
This location really is the best (and maybe only) place this
initialisation should be done. It cannot be included in the
constructor, because the generic nature of the template
specification
means the code in the constructor does not know which type of
wxWindow
we are inheriting from so cannot pass the correct parameters to the
constructor. By the time OnPaint is called it is really too late,
because we would like to already have the plot initialised and ready
to draw and it would be a real pain for you in your code if you had to
somehow wait for the first paint or resize event.
I do have access to a CentOS machine at work, although I think I have
only got access to wxWidgets 2.8 on that system. I will check. I may
be able to build 3.1 from source. I presume you are using 3.1.0 as
released in February, rather than the head of the master branch?
On 10 December 2016 at 07:52, Pedro Vicente
Post by Pedro Vicente
Hi Phil
My idea for a fix is to move the stream initialization that is now
on
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event
{
if ( !m_created )
either to the OnSize or onPaint events
void wxPLplotwindow<WXWINDOW>::OnSize( wxSizeEvent& WXUNUSED( event ) )
and also in the plot call do this
template< class WXWINDOW >
void Plot( wxPLplotwindow<WXWINDOW> *plotwindow )
{
wxPLplotstream* pls = plotwindow->GetStream();
if (pls == NULL)
{
return;
}
Like this , in this sequence
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->SetIcon( wxIcon( graph ) );
frame->Show();
Plot( frame );
first we go to
Plot( frame );
but the stream is NULL because
:OnCreate
was not called, but the function returns, avoiding the seg fault
then the window gets a paint or size event, and the stream
initialization
code is called
at this time I have a PLplot empty black window
but because
Plot( frame );
was only called at start, it is not called again, so there is no draw
any ideas here ?
of course making the Plot() call in another app function should work
If you could replicate this issue, that would be great.
I am using CentOS 6.8, PLplot.5.11.1 , wxWidgets 3.1.0
----- Original Message ----- From: Pedro Vicente
Sent: Saturday, December 10, 2016 12:59 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, the issue seems to be the same that I have been reporting
In the wxPLplotDemo.cpp code you have these callling functions
wxPLplotwindow<wxFrame> *frame = new wxPlDemoFrame();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
that make 2 calls to the PLplot library, or the wxWidgets driver of it
all these calls are in the header file wxPLplotwindow.h
first the constructor is called
template<class WXWINDOW>
wxPLplotwindow<WXWINDOW>::wxPLplotwindow( bool useGraphicsContext, wxSize
clientSize )
: m_created( false ), m_initialSize( clientSize )
then this call OnCreate() is called, like you mentioned
and the !m_created bool makes the initialization of the stream happen
the problem is that this function id *NOT* called on my linux
build
(it is
on the Windows build)
so therefore later
wxPLplotstream* pls = plotwindow->GetStream();
this is NULL, so therefore it seg faults on the plot calls
//! This is called when the widow is created i.e. after
WXWINDOW::Create
// has been called. We note that this has been called to avoid attempting
// to redraw a plot on a window that hasn't been created yet.
template<class WXWINDOW>
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
if ( !m_created )
so, one quick try is to put the code of
void wxPLplotwindow<WXWINDOW>::OnCreate
that is not called on the constructor maybe ?
-Pedro
----- Original Message ----- From: Pedro Vicente
Sent: Friday, December 09, 2016 11:57 PM
Subject: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, resuming the last thread about wxWidgets, what I did was to build and
run wxPLplotDemo.cpp from PLpplot 5.11.1 on CentOS 6.8
all builds fine, but when I do run , I get a seg fault
/data/home002/pvicente/plplot/build/examples/c++
Segmentation fault
I know that only this information is not much help to you to debug, but in
the next couple of days I'll be debugging this and posting here any
solution.
my cmake call was
cmake .. -G "Unix Makefiles" -DBUILD_SHARED_LIBS:BOOL=OFF
-DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:PATH=/data/data127/pvicente/install/plplot-5.11.1d
-DPL_HAVE_PTHREAD:BOOL=OFF -DPLD_xwin:BOOL=OFF
-DPLD_wxwidgets:BOOL=ON
-DwxWidgets_ROOT_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0
-DwxWidgets_LIB_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0/lib
-DwxWidgets_CONFIGURATION=mswud -DENABLE_MIX_CXX=ON
-DwxWidgets_EXCLUDE_COMMON_LIBRARIES:BOOL=OFF
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_TEST:BOOL=ON >& cmake.txt &
the output of
cmake
and
make
are attached
-Pedro
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
--
Pedro Vicente
http://www.space-research.org/
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/plplot-devel
--
Pedro Vicente
***@space-research.org
http://www.space-research.org/
Alan W. Irwin
2016-12-14 19:47:09 UTC
Permalink
Post by Pedro Vicente
Hi Phil
I am using the attached qt project file on my CentOS 6.8 build, adapted to
build
examples/c++/wxPLplotDemo.cpp
to use, place the file in
examples/c++
just change these lines for your own case
dir_inc_plplot = /data/home002/pvicente/plplot-plplot-install/include/plplot
dir_lib_plplot = /data/home002/pvicente/plplot-plplot-install/lib
dir_inc_wx = /data/data127/pvicente/install/wxwidgets-3.1.0d/include/wx-3.1
dir_inc_wx_setup =
/data/data127/pvicente/install/wxwidgets-3.1.0d/lib/wx/include/gtk2-unicode-static-3.1
dir_lib_wx = /data/data127/pvicente/install/wxwidgets-3.1.0d/lib
in QtCreator change in Projects/Run, disable the the "Run in Terminal"
this is the stack on the window creation as shown in QtCreator
0 wxWindow::PostCreation window.cpp 2753 0x4d9ea4
1 wxTopLevelWindowGTK::Create toplevel.cpp 674 0x4cdb79
2 wxFrame::Create frame.cpp 48 0x4e672b
3 MyApp::OnInit wxPLplotDemo.cpp 148 0x4259d8
4 wxAppConsoleBase::CallOnInit app.h 93 0x426c23
5 wxEntry init.cpp 487 0x6bf36d
6 wxEntry init.cpp 515 0x6bf475
7 main wxPLplotDemo.cpp 131 0x4258a4
As opposed to the wxWidgets Windows build, that uses the WIN32 API, for linux
it's a totally different API (GTK),
so the issue may be a wxWidgets GTK code thing
Hi Pedro:

Just to interject here, my impression of this thread is you have
mostly been discussing issues with your own software, but now it
appears you finding issues with the git version of wxPLplotDemo rather
than your own software. Can you confirm that is the case for
unmodified PLplot from the tip of the git master branch? Because if
so, that would be quite interesting because here on Debian Jessie with
the GTK+ version of wxwidgets-3.0.2 installed, when I build the
test_wxPLplotDemo target, the wxPLplotDemo GUI builds and runs with
absolutely no issues.

If you really do have some build or run-time issue there with
wxPLplotDemo for _unmodified_ PLplot, then my advice is to submit a proper bug report to
us with complete cmake output from an initially empty build tree captured in the usual way, i.e.,

cmake <your usual cmake options> <path to PLplot source tree> >& cmake.out

_where those options include using the "Unix Makefiles" generator_. Then
run

make VERBOSE=1 test_wxPLplotDemo >& test_wxPLplotDemo.out

and submit both cmake.out and test_wxPLplotDemo.out here.

It may be that your issue is simply that the PLplot wxwidgets-related
code is not compatible with the GTK+ version of wxwidgets you have
installed on your Linux platforms, i.e., your GTK+ version of
wxwidgets may be too old (which we can see from your cmake.out file)
or too new. In the latter case I assume iPhil will eventually be able to
replicate your issue with that same GTK+ version of wxwidgets and then
fix whatever that incompatibility is.

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
__________________________
Pedro Vicente
2016-12-14 20:30:43 UTC
Permalink
Hi Alan
Post by Alan W. Irwin
Post by Alan W. Irwin
Can you confirm that is the case for
unmodified PLplot from the tip of the git master branch?
Yes, it is the unmodified PLplot from the tip of the git master branch
cloned today.
I only added this line
assert(pls)
in wxPLplotDemo.cpp, which you can see in the output
Post by Alan W. Irwin
Post by Alan W. Irwin
here on Debian Jessie with
the GTK+ version of wxwidgets-3.0.2
it could be the GTK+ version, yes.
In this case, I think the wxwidgets version does not matter, since it
picks whatever GTK+ it finds.

This can be checked on Debian with
rpm -qa | grep -i gtk2

and it shows on my CentOS 6.8

gtk2-devel-2.24.23-8.el6.x86_64

I also tried in
Ubuntu 16.04 i386
Ubuntu 14.04 x86_64

and the same happens (don't know which GTK+ they have)
these 2 above I just used the wxwidgets libraries from packages


the only way I was able to solve this to use PLplot/wxwidgets in my
code was to do a custom
wxwidgets window that does not use wxPLplotwindow (the class used by
the demo)

this code is here

https://github.com/pedro-vicente/plplot-wxwidgets

and the way to avoid the bug is just to explicitally call the stream
creation code with a function call,
named CreatePLplotstream()
(that as of now is supposed to be automatically called in the wxWidgets
window OnCreate(),
but apparently it is not)

my use is

wx_PLplotFrame_stream *frame = new wx_PLplotFrame_stream();
frame->Create(NULL, wxID_ANY, wxT("wxPLplot"),
wxDefaultPosition,
wxSize(900, 700));
frame->CreatePLplotstream();
frame->Show();
wx_PLplotstream* pls = frame->GetStream();
assert(pls);
Post by Alan W. Irwin
Post by Alan W. Irwin
to submit a proper bug report to us with complete cmake output
is there a place to submit bug reports?
or just send here by email?
The output is attached

-Pedro
Post by Alan W. Irwin
Post by Alan W. Irwin
Hi Phil
I am using the attached qt project file on my CentOS 6.8 build,
adapted to build
examples/c++/wxPLplotDemo.cpp
to use, place the file in
examples/c++
just change these lines for your own case
dir_inc_plplot =
/data/home002/pvicente/plplot-plplot-install/include/plplot
dir_lib_plplot = /data/home002/pvicente/plplot-plplot-install/lib
dir_inc_wx =
/data/data127/pvicente/install/wxwidgets-3.1.0d/include/wx-3.1
dir_inc_wx_setup =
/data/data127/pvicente/install/wxwidgets-3.1.0d/lib/wx/include/gtk2-unicode-static-3.1
dir_lib_wx = /data/data127/pvicente/install/wxwidgets-3.1.0d/lib
in QtCreator change in Projects/Run, disable the the "Run in
Terminal"
this is the stack on the window creation as shown in QtCreator
0 wxWindow::PostCreation window.cpp 2753 0x4d9ea4
1 wxTopLevelWindowGTK::Create toplevel.cpp 674 0x4cdb79
2 wxFrame::Create frame.cpp 48 0x4e672b
3 MyApp::OnInit wxPLplotDemo.cpp 148 0x4259d8
4 wxAppConsoleBase::CallOnInit app.h 93 0x426c23
5 wxEntry init.cpp 487 0x6bf36d
6 wxEntry init.cpp 515 0x6bf475
7 main wxPLplotDemo.cpp 131 0x4258a4
As opposed to the wxWidgets Windows build, that uses the WIN32 API,
for linux it's a totally different API (GTK),
so the issue may be a wxWidgets GTK code thing
Just to interject here, my impression of this thread is you have
mostly been discussing issues with your own software, but now it
appears you finding issues with the git version of wxPLplotDemo rather
than your own software. Can you confirm that is the case for
unmodified PLplot from the tip of the git master branch? Because if
so, that would be quite interesting because here on Debian Jessie with
the GTK+ version of wxwidgets-3.0.2 installed, when I build the
test_wxPLplotDemo target, the wxPLplotDemo GUI builds and runs with
absolutely no issues.
If you really do have some build or run-time issue there with
wxPLplotDemo for _unmodified_ PLplot, then my advice is to submit a proper bug report to
us with complete cmake output from an initially empty build tree
captured in the usual way, i.e.,
cmake <your usual cmake options> <path to PLplot source tree> >& cmake.out
_where those options include using the "Unix Makefiles" generator_.
Then
run
make VERBOSE=1 test_wxPLplotDemo >& test_wxPLplotDemo.out
and submit both cmake.out and test_wxPLplotDemo.out here.
It may be that your issue is simply that the PLplot wxwidgets-related
code is not compatible with the GTK+ version of wxwidgets you have
installed on your Linux platforms, i.e., your GTK+ version of
wxwidgets may be too old (which we can see from your cmake.out file)
or too new. In the latter case I assume iPhil will eventually be able to
replicate your issue with that same GTK+ version of wxwidgets and then
fix whatever that incompatibility is.
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
__________________________
--
Pedro Vicente
***@space-research.org
http://www.space-research.org/
Alan W. Irwin
2016-12-14 22:39:18 UTC
Permalink
Post by Pedro Vicente
Hi Alan
Post by Alan W. Irwin
Can you confirm that is the case for
unmodified PLplot from the tip of the git master branch?
Yes, it is the unmodified PLplot from the tip of the git master branch cloned
today.
I only added this line
assert(pls)
in wxPLplotDemo.cpp, which you can see in the output
Hi Pedro:

Thanks very much for that bug report. This is where you should report
such issues unless or until it turns out we cannot solve them in a
timely manner (in which case you should use the bugtracker to remind
us of the issue in the future).

Your cmake.out looks fine to me (although you should double-check all
of that wxwidgets-related and GTK+-related output for library
consistency).

And obviously from your test_wxPLplotDemo.out file, building
wxPLplotDemo failed right where you inserted the above assert
statement (from the output somewhere in void
Plot(wxPLplotwindow<WXWINDOW>*) presumably after the

wxPLplotstream* pls = plotwindow->GetStream();

statement).

And clearly pls has to be nonnegative if the above assigment succeeded.

However, a potential issue is it appears you are using a wxwidgets
version that you built yourself.

What happens if you try a Ubuntu platform with a system version
of wxwidgets version = 3.0.x? Same question for a Ubuntu
platform with wxwidgets version = 3.1.x?

Building wxwidgets is tricky (e.g., I have had some rather peculiar
results for wxwidgets versions I built myself) so I doubt I am going
to delay the release for this issue unless you can give me a bug
report (same cmake.out and test_wxPLplotDemo.out files requested) for
a system version of wxwidgets.

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
__________________________
Pedro Vicente
2016-12-14 23:00:58 UTC
Permalink
Hi Alan
Post by Alan W. Irwin
What happens if you try a Ubuntu platform with a system version
of wxwidgets version = 3.0.x? Same question for a Ubuntu
platform with wxwidgets version = 3.1.x?
I was actually just going to do that just now, so here it goes

lsb_release -a
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty


sudo apt-get install libwxgtk3.0-dev
git clone http://git.code.sf.net/p/plplot/plplot plplot-plplot
cd plplot-plplot
mkdir build
cd build
cmake .. -G "Unix
Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/home/pvicente/plplot-install -DCMAKE_BUILD_TYPE=Debug
-DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF
-DBUILD_TEST=ON >& cmake.ubuntu.txt &
make VERBOSE=1 test_wxPLplotDemo >& test_wxPLplotDemo.out.ubuntu.txt &

and the output files are attached


By looking at cmake.ubuntu.txt it uses this GTK+

-- Checking for module 'gtk+-x11-2.0'
-- Found gtk+-x11-2.0, version 2.24.27

so, exactly the same as my CentOS, if that matters


I also have another 16.04 ubuntu , I will try that next

also, you mentioned that on Debian Jessie it's OK.
so i'll try to install that or a recent Fedora on a VirtualBox to see
Post by Alan W. Irwin
Post by Pedro Vicente
Post by Alan W. Irwin
Building wxwidgets is tricky (e.g., I have had some rather peculiar
results for wxwidgets versions I built myself)
I never have any problems

I always do what says here

https://wiki.wxwidgets.org/Compiling_and_getting_started

cd /path/to/wxWidgets-3.0.x # adapt path as needed
mkdir gtk-build # or any other name you fancy
cd gtk-build
../configure --prefix=/my/path --enable-debug --disable-shared

I try as much as possible to use static and debug builds, it's always less
problems down the road, specially if you are distributing binaries


-Pedro


----- Original Message -----
From: "Alan W. Irwin" <***@beluga.phys.uvic.ca>
To: "Pedro Vicente" <***@space-research.org>
Cc: "PLplot development list" <plplot-***@lists.sourceforge.net>
Sent: Wednesday, December 14, 2016 5:39 PM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Alan W. Irwin
Post by Pedro Vicente
Hi Alan
Post by Alan W. Irwin
Post by Alan W. Irwin
Can you confirm that is the case for
unmodified PLplot from the tip of the git master branch?
Yes, it is the unmodified PLplot from the tip of the git master branch
cloned today.
I only added this line
assert(pls)
in wxPLplotDemo.cpp, which you can see in the output
Thanks very much for that bug report. This is where you should report
such issues unless or until it turns out we cannot solve them in a
timely manner (in which case you should use the bugtracker to remind
us of the issue in the future).
Your cmake.out looks fine to me (although you should double-check all
of that wxwidgets-related and GTK+-related output for library
consistency).
And obviously from your test_wxPLplotDemo.out file, building
wxPLplotDemo failed right where you inserted the above assert
statement (from the output somewhere in void
Plot(wxPLplotwindow<WXWINDOW>*) presumably after the
wxPLplotstream* pls = plotwindow->GetStream();
statement).
And clearly pls has to be nonnegative if the above assigment succeeded.
However, a potential issue is it appears you are using a wxwidgets
version that you built yourself.
What happens if you try a Ubuntu platform with a system version
of wxwidgets version = 3.0.x? Same question for a Ubuntu
platform with wxwidgets version = 3.1.x?
Building wxwidgets is tricky (e.g., I have had some rather peculiar
results for wxwidgets versions I built myself) so I doubt I am going
to delay the release for this issue unless you can give me a bug
report (same cmake.out and test_wxPLplotDemo.out files requested) for
a system version of wxwidgets.
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
__________________________
Pedro Vicente
2016-12-14 23:23:13 UTC
Permalink
Hi Alan

Results for

lsb_release -a
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial

sudo apt-get install libwxgtk3.0-dev

cmake .. -G "Unix
Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/home/pvn/plplot-install -DCMAKE_BUILD_TYPE=Debug
-DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF
-DBUILD_TEST=ON >& cmake.ubuntu.16.04.txt &

make VERBOSE=1 test_wxPLplotDemo >& test_wxPLplotDemo.out.ubuntu.16.04.txt &

files are attached, the same happens


-Pedro




----- Original Message -----
From: "Pedro Vicente" <***@space-research.org>
To: "Alan W. Irwin" <***@beluga.phys.uvic.ca>
Cc: "PLplot development list" <plplot-***@lists.sourceforge.net>
Sent: Wednesday, December 14, 2016 6:00 PM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Pedro Vicente
Hi Alan
Post by Alan W. Irwin
What happens if you try a Ubuntu platform with a system version
of wxwidgets version = 3.0.x? Same question for a Ubuntu
platform with wxwidgets version = 3.1.x?
I was actually just going to do that just now, so here it goes
lsb_release -a
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
sudo apt-get install libwxgtk3.0-dev
git clone http://git.code.sf.net/p/plplot/plplot plplot-plplot
cd plplot-plplot
mkdir build
cd build
cmake .. -G "Unix
Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/home/pvicente/plplot-install -DCMAKE_BUILD_TYPE=Debug
-DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF
-DBUILD_TEST=ON >& cmake.ubuntu.txt &
make VERBOSE=1 test_wxPLplotDemo >& test_wxPLplotDemo.out.ubuntu.txt &
and the output files are attached
By looking at cmake.ubuntu.txt it uses this GTK+
-- Checking for module 'gtk+-x11-2.0'
-- Found gtk+-x11-2.0, version 2.24.27
so, exactly the same as my CentOS, if that matters
I also have another 16.04 ubuntu , I will try that next
also, you mentioned that on Debian Jessie it's OK.
so i'll try to install that or a recent Fedora on a VirtualBox to see
Post by Alan W. Irwin
Post by Pedro Vicente
Post by Alan W. Irwin
Building wxwidgets is tricky (e.g., I have had some rather peculiar
results for wxwidgets versions I built myself)
I never have any problems
I always do what says here
https://wiki.wxwidgets.org/Compiling_and_getting_started
cd /path/to/wxWidgets-3.0.x # adapt path as needed
mkdir gtk-build # or any other name you fancy
cd gtk-build
../configure --prefix=/my/path --enable-debug --disable-shared
I try as much as possible to use static and debug builds, it's always less
problems down the road, specially if you are distributing binaries
-Pedro
----- Original Message -----
Sent: Wednesday, December 14, 2016 5:39 PM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Alan W. Irwin
Post by Pedro Vicente
Hi Alan
Post by Alan W. Irwin
Post by Alan W. Irwin
Can you confirm that is the case for
unmodified PLplot from the tip of the git master branch?
Yes, it is the unmodified PLplot from the tip of the git master branch
cloned today.
I only added this line
assert(pls)
in wxPLplotDemo.cpp, which you can see in the output
Thanks very much for that bug report. This is where you should report
such issues unless or until it turns out we cannot solve them in a
timely manner (in which case you should use the bugtracker to remind
us of the issue in the future).
Your cmake.out looks fine to me (although you should double-check all
of that wxwidgets-related and GTK+-related output for library
consistency).
And obviously from your test_wxPLplotDemo.out file, building
wxPLplotDemo failed right where you inserted the above assert
statement (from the output somewhere in void
Plot(wxPLplotwindow<WXWINDOW>*) presumably after the
wxPLplotstream* pls = plotwindow->GetStream();
statement).
And clearly pls has to be nonnegative if the above assigment succeeded.
However, a potential issue is it appears you are using a wxwidgets
version that you built yourself.
What happens if you try a Ubuntu platform with a system version
of wxwidgets version = 3.0.x? Same question for a Ubuntu
platform with wxwidgets version = 3.1.x?
Building wxwidgets is tricky (e.g., I have had some rather peculiar
results for wxwidgets versions I built myself) so I doubt I am going
to delay the release for this issue unless you can give me a bug
report (same cmake.out and test_wxPLplotDemo.out files requested) for
a system version of wxwidgets.
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
__________________________
--------------------------------------------------------------------------------
Post by Pedro Vicente
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
--------------------------------------------------------------------------------
Post by Pedro Vicente
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
Alan W. Irwin
2016-12-15 00:21:12 UTC
Permalink
Post by Pedro Vicente
Hi Alan
Results for
lsb_release -a
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
sudo apt-get install libwxgtk3.0-dev
cmake .. -G "Unix Makefiles"
-DCMAKE_INSTALL_PREFIX:PATH=/home/pvn/plplot-install -DCMAKE_BUILD_TYPE=Debug
-DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF
-DENABLE_tk:BOOL=OFF -DBUILD_TEST=ON >& cmake.ubuntu.16.04.txt &
make VERBOSE=1 test_wxPLplotDemo >& test_wxPLplotDemo.out.ubuntu.16.04.txt &
files are attached, the same happens
Hi Pedro:

If you can get rid of this problem on all distros accessible to you
with a short patch to our wxwidgets-related software, please send me
that patch in "git format-patch" form, and if it works here on Debian
Jessie as well, I will apply it to take care of this release-critical
issue.

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
__________________________
Alan W. Irwin
2016-12-15 00:16:38 UTC
Permalink
Post by Pedro Vicente
Hi Alan
Post by Alan W. Irwin
What happens if you try a Ubuntu platform with a system version
of wxwidgets version = 3.0.x? Same question for a Ubuntu
platform with wxwidgets version = 3.1.x?
I was actually just going to do that just now, so here it goes
lsb_release -a
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
sudo apt-get install libwxgtk3.0-dev
git clone http://git.code.sf.net/p/plplot/plplot plplot-plplot
cd plplot-plplot
mkdir build
cd build
cmake .. -G "Unix Makefiles"
-DCMAKE_INSTALL_PREFIX:PATH=/home/pvicente/plplot-install
-DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_f95:BOOL=OFF
-DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF -DBUILD_TEST=ON >&
cmake.ubuntu.txt &
make VERBOSE=1 test_wxPLplotDemo >& test_wxPLplotDemo.out.ubuntu.txt &
So you have the same bad result for system version of everything on
Ubuntu trusty including wxwidgets-3.0.x (except for Qt5 which should not matter here).

This certainly qualifies as a release-critical wxwidgets bug. And you
have certainly supplied enough information that Phil should find this
to be straightforward to reproduce. So if I get a communication from
Phil that he is actively working on this, I will hold the PLplot
release past December 22 for this. However, if he is out of e-mail
contact, I won't hold the release, and we will just have to live with
the fact that the fundamental wxwidgets binding just plain does not
work on most Linux distros, ugh!

Also, just in case any of those cmake options of yours were affecting the result I
just tried here

cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF -DBUILD_TEST=ON ../plplot.git >& cmake.out

and

make test_wxPLplotDemo >& test_wxPLplotDemo.out

with the same (good) results.

N.B. I have attached those two files in compressed form so you can see
what is different between them and your results. (Say if you get
failure there even on Debian Jessie.)
Post by Pedro Vicente
By looking at cmake.ubuntu.txt it uses this GTK+
-- Checking for module 'gtk+-x11-2.0'
-- Found gtk+-x11-2.0, version 2.24.27
so, exactly the same as my CentOS, if that matters
The corresponding output here is

-- Checking for module 'gtk+-x11-2.0'
-- Found gtk+-x11-2.0, version 2.24.25

So you are two patch-versions later with GTK+ which I doubt
matters much at all.
Post by Pedro Vicente
I also have another 16.04 ubuntu , I will try that next
also, you mentioned that on Debian Jessie it's OK.
so i'll try to install that or a recent Fedora on a VirtualBox to see
That's a good idea to at least make sure you can reproduce my good
result on Debian Jessie. If you can do that, but get bad results for
every other distro, I would begin to wonder what magic and secret
elixir the Debian Jessie packagers applied to wxwidgets and GTK+ to
get them to work properly together? :-)

Seriously, Phil's new wxwidgets binding and device driver first
started life as a wxwidgets-2.x software if I recall correctly. So it is possible that
Debian Jessie has maintained better wxwidgets-2 compatibility in their
wxwidgets-3 libraries than other distros. In which case to solve this,
Phil would have to figure out how to modernize the wxwidgets binding
and device driver so it does not rely on any wxwidgets-2.x capability
at all.

Do you see any use of (presumably deprecated) wxwidgets-2.x calls
in our wxwidgets binding or device driver? If so, that might be
a good place to start to work on this issue.

Also, I obviously haven't been paying much attention to this thread
before, but I do recall you were advocating some one-line "fix" with
Phil for our wxwidgets-related software which I did not understand at
all and which he appeared noncommittal about. But if that is all you
need to get the test_wxPLplotDemo build to work on _all_ Linux distros
(including Debian Jessie here), I would accept your git-formatted
patch to make that one-line change you recommend as a fix for this
release critical issue. But that one-liner might also be a workaround
for some wxwidgets-2.x calls left in our code like I was speculating
about above or some other issue so Phil may want to reverse this "fix"
after the release and implement a more fundamental fix instead.

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
__________________________
Pedro Vicente
2016-12-15 03:30:30 UTC
Permalink
Hi Alan

see my replies between your questions
Post by Alan W. Irwin
This certainly qualifies as a release-critical wxwidgets bug. And you
have certainly supplied enough information that Phil should find this
to be straightforward to reproduce.
easy to reproduce on the PLplot code, but not immediatley obvious to find
the root cause.

My speculation is that it happens because this function located in
\bindings\wxwidgets\wxPLplotwindow.h

void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
if ( !m_created )

is not automatically called in an wxwidgets event triggered by this code in
wxPLplotDemo.cpp, the Create() call

wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );

this can be easily confirmed if you put a print statement here

void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
wxLogDebug("wxPLplotwindow<WXWINDOW>::OnCreate");
if ( !m_created )

so, my solution is simple, it's just to specifically call the code that is
inside
void wxPLplotwindow<WXWINDOW>::OnCreate


I did this by doing a function that I called CreatePLplotstream(), that
contains the stream initialization code
that is in
wxPLplotwindow<WXWINDOW>::OnCreate


so, in the demo code the call is now

wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->CreatePLplotstream();
Post by Alan W. Irwin
Do you see any use of (presumably deprecated) wxwidgets-2.x calls
in our wxwidgets binding or device driver? If so, that might be
a good place to start to work on this issue.
not sure, I'll check

events are explained here

http://docs.wxwidgets.org/3.1/overview_events.html

I always do a static event table in my code.
it's also possible to do a dynamic event (with ::Bind())
actually in the PLplot code this is done another way, that I am not sure
about

//We use connect instead of Bind for compatiblity with wxWidgets 2.8
//but should move to bind in the future.
WXWINDOW::Connect( wxEVT_CREATE, wxWindowCreateEventHandler(
wxPLplotwindow<WXWINDOW>::OnCreate ) );


-Pedro


----- Original Message -----
From: "Alan W. Irwin" <***@beluga.phys.uvic.ca>
To: "Phil Rosenberg" <***@gmail.com>; "Pedro Vicente"
<***@space-research.org>
Cc: "PLplot development list" <plplot-***@lists.sourceforge.net>
Sent: Wednesday, December 14, 2016 7:16 PM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Alan W. Irwin
Post by Pedro Vicente
Hi Alan
Post by Alan W. Irwin
What happens if you try a Ubuntu platform with a system version
of wxwidgets version = 3.0.x? Same question for a Ubuntu
platform with wxwidgets version = 3.1.x?
I was actually just going to do that just now, so here it goes
lsb_release -a
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
sudo apt-get install libwxgtk3.0-dev
git clone http://git.code.sf.net/p/plplot/plplot plplot-plplot
cd plplot-plplot
mkdir build
cd build
cmake .. -G "Unix Makefiles"
-DCMAKE_INSTALL_PREFIX:PATH=/home/pvicente/plplot-install
-DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_f95:BOOL=OFF
-DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF -DBUILD_TEST=ON >&
cmake.ubuntu.txt &
make VERBOSE=1 test_wxPLplotDemo >& test_wxPLplotDemo.out.ubuntu.txt &
So you have the same bad result for system version of everything on
Ubuntu trusty including wxwidgets-3.0.x (except for Qt5 which should not matter here).
This certainly qualifies as a release-critical wxwidgets bug. And you
have certainly supplied enough information that Phil should find this
to be straightforward to reproduce. So if I get a communication from
Phil that he is actively working on this, I will hold the PLplot
release past December 22 for this. However, if he is out of e-mail
contact, I won't hold the release, and we will just have to live with
the fact that the fundamental wxwidgets binding just plain does not
work on most Linux distros, ugh!
Also, just in case any of those cmake options of yours were affecting the result I
just tried here
cmake -G "Unix
Makefiles" -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_f95:BOOL=OFF
-DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF -DBUILD_TEST=ON ../plplot.git
Post by Pedro Vicente
& cmake.out
and
make test_wxPLplotDemo >& test_wxPLplotDemo.out
with the same (good) results.
N.B. I have attached those two files in compressed form so you can see
what is different between them and your results. (Say if you get
failure there even on Debian Jessie.)
Post by Pedro Vicente
By looking at cmake.ubuntu.txt it uses this GTK+
-- Checking for module 'gtk+-x11-2.0'
-- Found gtk+-x11-2.0, version 2.24.27
so, exactly the same as my CentOS, if that matters
The corresponding output here is
-- Checking for module 'gtk+-x11-2.0'
-- Found gtk+-x11-2.0, version 2.24.25
So you are two patch-versions later with GTK+ which I doubt
matters much at all.
Post by Pedro Vicente
I also have another 16.04 ubuntu , I will try that next
also, you mentioned that on Debian Jessie it's OK.
so i'll try to install that or a recent Fedora on a VirtualBox to see
That's a good idea to at least make sure you can reproduce my good
result on Debian Jessie. If you can do that, but get bad results for
every other distro, I would begin to wonder what magic and secret
elixir the Debian Jessie packagers applied to wxwidgets and GTK+ to
get them to work properly together? :-)
Seriously, Phil's new wxwidgets binding and device driver first
started life as a wxwidgets-2.x software if I recall correctly. So it is possible that
Debian Jessie has maintained better wxwidgets-2 compatibility in their
wxwidgets-3 libraries than other distros. In which case to solve this,
Phil would have to figure out how to modernize the wxwidgets binding
and device driver so it does not rely on any wxwidgets-2.x capability
at all.
Do you see any use of (presumably deprecated) wxwidgets-2.x calls
in our wxwidgets binding or device driver? If so, that might be
a good place to start to work on this issue.
Also, I obviously haven't been paying much attention to this thread
before, but I do recall you were advocating some one-line "fix" with
Phil for our wxwidgets-related software which I did not understand at
all and which he appeared noncommittal about. But if that is all you
need to get the test_wxPLplotDemo build to work on _all_ Linux distros
(including Debian Jessie here), I would accept your git-formatted
patch to make that one-line change you recommend as a fix for this
release critical issue. But that one-liner might also be a workaround
for some wxwidgets-2.x calls left in our code like I was speculating
about above or some other issue so Phil may want to reverse this "fix"
after the release and implement a more fundamental fix instead.
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
__________________________
Alan W. Irwin
2016-12-15 05:35:45 UTC
Permalink
Post by Pedro Vicente
Hi Alan
see my replies between your questions
Post by Alan W. Irwin
This certainly qualifies as a release-critical wxwidgets bug. And you
have certainly supplied enough information that Phil should find this
to be straightforward to reproduce.
easy to reproduce on the PLplot code, but not immediatley obvious to find the
root cause.
Amen!
Post by Pedro Vicente
My speculation is that it happens because this function located in
\bindings\wxwidgets\wxPLplotwindow.h
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
if ( !m_created )
is not automatically called in an wxwidgets event triggered by this code in
wxPLplotDemo.cpp, the Create() call
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
this can be easily confirmed if you put a print statement here
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
wxLogDebug("wxPLplotwindow<WXWINDOW>::OnCreate");
if ( !m_created )
so, my solution is simple, it's just to specifically call the code that is
inside
void wxPLplotwindow<WXWINDOW>::OnCreate
I did this by doing a function that I called CreatePLplotstream(), that
contains the stream initialization code
that is in
wxPLplotwindow<WXWINDOW>::OnCreate
so, in the demo code the call is now
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->CreatePLplotstream();
I think you will agree with me that smells like a workaround rather
than a fundamental fix. Nevertheless, if you turn that change into a
PLplot patch AND that solves the present build issue for all the Linux
distros you have tried, and if it works here on Debian Jessie, then I
will apply that patch as a temporary fix for the release which we can
undo afterwards (or even before the release if we are lucky) with a
more fundamental fix.
Post by Pedro Vicente
Post by Alan W. Irwin
Do you see any use of (presumably deprecated) wxwidgets-2.x calls
in our wxwidgets binding or device driver? If so, that might be
a good place to start to work on this issue.
not sure, I'll check
events are explained here
http://docs.wxwidgets.org/3.1/overview_events.html
I always do a static event table in my code.
it's also possible to do a dynamic event (with ::Bind())
actually in the PLplot code this is done another way, that I am not sure
about
//We use connect instead of Bind for compatiblity with wxWidgets 2.8
//but should move to bind in the future.
WXWINDOW::Connect( wxEVT_CREATE, wxWindowCreateEventHandler(
wxPLplotwindow<WXWINDOW>::OnCreate ) );
Implementing a fundamental fix for the current build issue is already
way beyond my meager C++ and wxwidgets expertise, but I do have some
sense of the overview that may help you.

One issue you should be aware of is git blame results are obfuscated
by our code styling events (often triggered by me) which amount to
putting random blanks in the code to make it conform to our style.

So

***@raven> git blame bindings/wxwidgets/wxPLplotwindow.h |grep '2\.8'
39a6c01b (Alan W. Irwin 2015-02-14 19:32:12 -0800 90) //We use connect instead of Bind for compatiblity with wxWidgets 2.8
39a6c01b (Alan W. Irwin 2015-02-14 19:32:12 -0800 123) //on at least one system (CentOS with intel compiler and wxWidgets 2.8.12).

"shows" I was the author of the above comment in commit 39a6c01b, but
that was a styling commit so you have to back off one commit to 39a6c01b^ to find the true
author/commit which then shows the following:

***@raven> git blame 39a6c01b^ bindings/wxwidgets/wxPLplotwindow.h |grep '2\.8'
cf59c54a (Phil Rosenberg 2015-01-15 14:18:42 +0000 75) //We use connect instead of Bind for compatiblity with wxWidgets 2.8
fa121bd5 (Phil Rosenberg 2015-01-20 15:56:53 +0000 102) //on at least one system (CentOS with intel compiler and wxWidgets 2.8.12).

Also, if you look at the git log for references to wxwidgets 2.8 and
3.0, it appears we tried to keep backwards compatibility with 2.8 for
quite a while (the commit messages for cf59c54a, and fa121bd5 but also
other commits mention maintaining compatibility with 2.8) even though
principal development was on 3.0. Eventually, we had to change our
minimum acceptable wxwidgets version from 2.8 to 3.0 because of one
commit which only worked for 3.0. So it does appear our code is a
mixture of wxwidgets-2.8 (supported typically by an extra commit after
some development on 3.0) and 3.0, and it might be a bit of an effort
to remove all that wxwidgets-2.8 support.

@Phil:

If you are in e-mail contact, i.e., reading this, I would appreciate
your thoughts on this matter of moving to pure 3.0. If it is
straightforward to do, and you have time to work on that before
Christmas, I would be willing to hold the release for you for a few
extra days beyond December 27th until you are done and the result
thoroughly checked on Debian Jessie, Windows, and all the different
Linux distros available to Pedro. I advise this change eventually in
any case because the mixture of 2.8 and 3.0 we have now appears not to
be well supported on most Linux distros unless Pedro's workaround
turns out to (temporarily) save the day for us.

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
__________________________
Pedro Vicente
2016-12-15 06:31:20 UTC
Permalink
Hi Alan
Post by Alan W. Irwin
I think you will agree with me that smells like a workaround rather
than a fundamental fix.
yes, I agree.
Post by Alan W. Irwin
Post by Alan W. Irwin
Eventually, we had to change our
minimum acceptable wxwidgets version from 2.8 to 3.0 because of one
commit which only worked for 3.0.
hhm, ok
I have to double check this but the comments in your code say ::Bind() is
only available
for 3.0, and ::Bind() is not used

so probably the code as of now is compatible with 2.8 (meaning it only has
2.8 calls, not 3.0 calls)
Post by Alan W. Irwin
Post by Alan W. Irwin
I would appreciate
your thoughts on this matter of moving to pure 3.0.
we could try the ::Bind() route, yes, to see what happens

another thing
wxPLplotwindow.h is a header file
we can try to move the implementation to a .ccp file (with templates there
are some idiosyncrasies about the use of headers versus .cpp,
that's why I never use templates)
Post by Alan W. Irwin
Post by Alan W. Irwin
I would be willing to hold the release for you for a few
extra days beyond December 27th
that would be great, that should be enough to have a better idea.
I have more time to work on this on the weekends only.

-Pedro


----- Original Message -----
From: "Alan W. Irwin" <***@beluga.phys.uvic.ca>
To: "Pedro Vicente" <***@space-research.org>; "Phil Rosenberg"
<***@gmail.com>
Cc: "PLplot development list" <plplot-***@lists.sourceforge.net>
Sent: Thursday, December 15, 2016 12:35 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Alan W. Irwin
Post by Alan W. Irwin
Hi Alan
see my replies between your questions
Post by Alan W. Irwin
This certainly qualifies as a release-critical wxwidgets bug. And you
have certainly supplied enough information that Phil should find this
to be straightforward to reproduce.
easy to reproduce on the PLplot code, but not immediatley obvious to find
the root cause.
Amen!
Post by Alan W. Irwin
My speculation is that it happens because this function located in
\bindings\wxwidgets\wxPLplotwindow.h
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
if ( !m_created )
is not automatically called in an wxwidgets event triggered by this code
in wxPLplotDemo.cpp, the Create() call
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
this can be easily confirmed if you put a print statement here
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
wxLogDebug("wxPLplotwindow<WXWINDOW>::OnCreate");
if ( !m_created )
so, my solution is simple, it's just to specifically call the code that
is inside
void wxPLplotwindow<WXWINDOW>::OnCreate
I did this by doing a function that I called CreatePLplotstream(), that
contains the stream initialization code
that is in
wxPLplotwindow<WXWINDOW>::OnCreate
so, in the demo code the call is now
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->CreatePLplotstream();
I think you will agree with me that smells like a workaround rather
than a fundamental fix. Nevertheless, if you turn that change into a
PLplot patch AND that solves the present build issue for all the Linux
distros you have tried, and if it works here on Debian Jessie, then I
will apply that patch as a temporary fix for the release which we can
undo afterwards (or even before the release if we are lucky) with a
more fundamental fix.
Post by Alan W. Irwin
Post by Alan W. Irwin
Do you see any use of (presumably deprecated) wxwidgets-2.x calls
in our wxwidgets binding or device driver? If so, that might be
a good place to start to work on this issue.
not sure, I'll check
events are explained here
http://docs.wxwidgets.org/3.1/overview_events.html
I always do a static event table in my code.
it's also possible to do a dynamic event (with ::Bind())
actually in the PLplot code this is done another way, that I am not sure
about
//We use connect instead of Bind for compatiblity with wxWidgets 2.8
//but should move to bind in the future.
WXWINDOW::Connect( wxEVT_CREATE, wxWindowCreateEventHandler(
wxPLplotwindow<WXWINDOW>::OnCreate ) );
Implementing a fundamental fix for the current build issue is already
way beyond my meager C++ and wxwidgets expertise, but I do have some
sense of the overview that may help you.
One issue you should be aware of is git blame results are obfuscated
by our code styling events (often triggered by me) which amount to
putting random blanks in the code to make it conform to our style.
So
39a6c01b (Alan W. Irwin 2015-02-14 19:32:12 -0800 90) //We use
connect instead of Bind for compatiblity with wxWidgets 2.8
39a6c01b (Alan W. Irwin 2015-02-14 19:32:12 -0800 123) //on at least
one system (CentOS with intel compiler and wxWidgets 2.8.12).
"shows" I was the author of the above comment in commit 39a6c01b, but
that was a styling commit so you have to back off one commit to 39a6c01b^ to find the true
cf59c54a (Phil Rosenberg 2015-01-15 14:18:42 +0000 75) //We use
connect instead of Bind for compatiblity with wxWidgets 2.8
fa121bd5 (Phil Rosenberg 2015-01-20 15:56:53 +0000 102) //on at
least one system (CentOS with intel compiler and wxWidgets 2.8.12).
Also, if you look at the git log for references to wxwidgets 2.8 and
3.0, it appears we tried to keep backwards compatibility with 2.8 for
quite a while (the commit messages for cf59c54a, and fa121bd5 but also
other commits mention maintaining compatibility with 2.8) even though
principal development was on 3.0. Eventually, we had to change our
minimum acceptable wxwidgets version from 2.8 to 3.0 because of one
commit which only worked for 3.0. So it does appear our code is a
mixture of wxwidgets-2.8 (supported typically by an extra commit after
some development on 3.0) and 3.0, and it might be a bit of an effort
to remove all that wxwidgets-2.8 support.
If you are in e-mail contact, i.e., reading this, I would appreciate
your thoughts on this matter of moving to pure 3.0. If it is
straightforward to do, and you have time to work on that before
Christmas, I would be willing to hold the release for you for a few
extra days beyond December 27th until you are done and the result
thoroughly checked on Debian Jessie, Windows, and all the different
Linux distros available to Pedro. I advise this change eventually in
any case because the mixture of 2.8 and 3.0 we have now appears not to
be well supported on most Linux distros unless Pedro's workaround
turns out to (temporarily) save the day for us.
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
__________________________
Pedro Vicente
2016-12-15 06:57:36 UTC
Permalink
Hi Alan, Phil

I forgot about a very simple fix that does need a custom function call
(therefore a "real" fix, or better a non intrusive fix for users)

that is, right now, the code is responding to these 2 events

WXWINDOW::Connect( wxEVT_SIZE, wxSizeEventHandler(
wxPLplotwindow<WXWINDOW>::OnSize ) );
WXWINDOW::Connect( wxEVT_PAINT, wxPaintEventHandler(
wxPLplotwindow<WXWINDOW>::OnPaint ) );

so, it's just a matter of calling the OnCreate() stream on one

wxEVT_SIZE is a bad idea, because it's only called when the user moves the
window
but I think wxEVT_PAINT is *continuously* called in a event loop (meaning
always)

right now it even has some calls that are called there as a workaround


template<class WXWINDOW>
void wxPLplotwindow<WXWINDOW>::OnPaint( wxPaintEvent &WXUNUSED( event ) )
{
//Really this should be in the constructor, but it caused a segfault
//on at least one system (CentOS with intel compiler and wxWidgets
2.8.12).
//Moving it here after WXWINDOW::Create has been called stops this and
//the call does nothing if the style is the same as previous calls so
//should be safe to call here.


the boolean flag

if ( !m_created )
{
//create the stream


makes it that it's only called 1 time

I'll try this tomorrow

-Pedro



----- Original Message -----
From: "Pedro Vicente" <***@space-research.org>
To: "Alan W. Irwin" <***@beluga.phys.uvic.ca>; "Phil Rosenberg"
<***@gmail.com>
Cc: "PLplot development list" <plplot-***@lists.sourceforge.net>
Sent: Thursday, December 15, 2016 1:31 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Pedro Vicente
Hi Alan
Post by Alan W. Irwin
I think you will agree with me that smells like a workaround rather
than a fundamental fix.
yes, I agree.
Post by Alan W. Irwin
Post by Alan W. Irwin
Eventually, we had to change our
minimum acceptable wxwidgets version from 2.8 to 3.0 because of one
commit which only worked for 3.0.
hhm, ok
I have to double check this but the comments in your code say ::Bind() is
only available
for 3.0, and ::Bind() is not used
so probably the code as of now is compatible with 2.8 (meaning it only has
2.8 calls, not 3.0 calls)
Post by Alan W. Irwin
Post by Alan W. Irwin
I would appreciate
your thoughts on this matter of moving to pure 3.0.
we could try the ::Bind() route, yes, to see what happens
another thing
wxPLplotwindow.h is a header file
we can try to move the implementation to a .ccp file (with templates there
are some idiosyncrasies about the use of headers versus .cpp,
that's why I never use templates)
Post by Alan W. Irwin
Post by Alan W. Irwin
I would be willing to hold the release for you for a few
extra days beyond December 27th
that would be great, that should be enough to have a better idea.
I have more time to work on this on the weekends only.
-Pedro
----- Original Message -----
Sent: Thursday, December 15, 2016 12:35 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Alan W. Irwin
Post by Alan W. Irwin
Hi Alan
see my replies between your questions
Post by Alan W. Irwin
This certainly qualifies as a release-critical wxwidgets bug. And you
have certainly supplied enough information that Phil should find this
to be straightforward to reproduce.
easy to reproduce on the PLplot code, but not immediatley obvious to find
the root cause.
Amen!
Post by Alan W. Irwin
My speculation is that it happens because this function located in
\bindings\wxwidgets\wxPLplotwindow.h
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
if ( !m_created )
is not automatically called in an wxwidgets event triggered by this code
in wxPLplotDemo.cpp, the Create() call
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
this can be easily confirmed if you put a print statement here
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
wxLogDebug("wxPLplotwindow<WXWINDOW>::OnCreate");
if ( !m_created )
so, my solution is simple, it's just to specifically call the code that
is inside
void wxPLplotwindow<WXWINDOW>::OnCreate
I did this by doing a function that I called CreatePLplotstream(), that
contains the stream initialization code
that is in
wxPLplotwindow<WXWINDOW>::OnCreate
so, in the demo code the call is now
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->CreatePLplotstream();
I think you will agree with me that smells like a workaround rather
than a fundamental fix. Nevertheless, if you turn that change into a
PLplot patch AND that solves the present build issue for all the Linux
distros you have tried, and if it works here on Debian Jessie, then I
will apply that patch as a temporary fix for the release which we can
undo afterwards (or even before the release if we are lucky) with a
more fundamental fix.
Post by Alan W. Irwin
Post by Alan W. Irwin
Do you see any use of (presumably deprecated) wxwidgets-2.x calls
in our wxwidgets binding or device driver? If so, that might be
a good place to start to work on this issue.
not sure, I'll check
events are explained here
http://docs.wxwidgets.org/3.1/overview_events.html
I always do a static event table in my code.
it's also possible to do a dynamic event (with ::Bind())
actually in the PLplot code this is done another way, that I am not sure
about
//We use connect instead of Bind for compatiblity with wxWidgets 2.8
//but should move to bind in the future.
WXWINDOW::Connect( wxEVT_CREATE, wxWindowCreateEventHandler(
wxPLplotwindow<WXWINDOW>::OnCreate ) );
Implementing a fundamental fix for the current build issue is already
way beyond my meager C++ and wxwidgets expertise, but I do have some
sense of the overview that may help you.
One issue you should be aware of is git blame results are obfuscated
by our code styling events (often triggered by me) which amount to
putting random blanks in the code to make it conform to our style.
So
39a6c01b (Alan W. Irwin 2015-02-14 19:32:12 -0800 90) //We use
connect instead of Bind for compatiblity with wxWidgets 2.8
39a6c01b (Alan W. Irwin 2015-02-14 19:32:12 -0800 123) //on at least
one system (CentOS with intel compiler and wxWidgets 2.8.12).
"shows" I was the author of the above comment in commit 39a6c01b, but
that was a styling commit so you have to back off one commit to 39a6c01b^
to find the true
cf59c54a (Phil Rosenberg 2015-01-15 14:18:42 +0000 75) //We use
connect instead of Bind for compatiblity with wxWidgets 2.8
fa121bd5 (Phil Rosenberg 2015-01-20 15:56:53 +0000 102) //on at
least one system (CentOS with intel compiler and wxWidgets 2.8.12).
Also, if you look at the git log for references to wxwidgets 2.8 and
3.0, it appears we tried to keep backwards compatibility with 2.8 for
quite a while (the commit messages for cf59c54a, and fa121bd5 but also
other commits mention maintaining compatibility with 2.8) even though
principal development was on 3.0. Eventually, we had to change our
minimum acceptable wxwidgets version from 2.8 to 3.0 because of one
commit which only worked for 3.0. So it does appear our code is a
mixture of wxwidgets-2.8 (supported typically by an extra commit after
some development on 3.0) and 3.0, and it might be a bit of an effort
to remove all that wxwidgets-2.8 support.
If you are in e-mail contact, i.e., reading this, I would appreciate
your thoughts on this matter of moving to pure 3.0. If it is
straightforward to do, and you have time to work on that before
Christmas, I would be willing to hold the release for you for a few
extra days beyond December 27th until you are done and the result
thoroughly checked on Debian Jessie, Windows, and all the different
Linux distros available to Pedro. I advise this change eventually in
any case because the mixture of 2.8 and 3.0 we have now appears not to
be well supported on most Linux distros unless Pedro's workaround
turns out to (temporarily) save the day for us.
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
https://lists.sourceforge.net/lists/listinfo/plplot-devel
Pedro Vicente
2016-12-15 07:00:46 UTC
Permalink
Post by Pedro Vicente
Post by Pedro Vicente
Post by Pedro Vicente
I forgot about a very simple fix that does need a custom function call
I meant does NOT need a custom function call

----- Original Message -----
From: "Pedro Vicente" <***@space-research.org>
To: "Alan W. Irwin" <***@beluga.phys.uvic.ca>; "Phil Rosenberg"
<***@gmail.com>
Cc: "PLplot development list" <plplot-***@lists.sourceforge.net>
Sent: Thursday, December 15, 2016 1:57 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Pedro Vicente
Hi Alan, Phil
I forgot about a very simple fix that does need a custom function call
(therefore a "real" fix, or better a non intrusive fix for users)
that is, right now, the code is responding to these 2 events
WXWINDOW::Connect( wxEVT_SIZE, wxSizeEventHandler(
wxPLplotwindow<WXWINDOW>::OnSize ) );
WXWINDOW::Connect( wxEVT_PAINT, wxPaintEventHandler(
wxPLplotwindow<WXWINDOW>::OnPaint ) );
so, it's just a matter of calling the OnCreate() stream on one
wxEVT_SIZE is a bad idea, because it's only called when the user moves the
window
but I think wxEVT_PAINT is *continuously* called in a event loop (meaning
always)
right now it even has some calls that are called there as a workaround
template<class WXWINDOW>
void wxPLplotwindow<WXWINDOW>::OnPaint( wxPaintEvent &WXUNUSED( event ) )
{
//Really this should be in the constructor, but it caused a segfault
//on at least one system (CentOS with intel compiler and wxWidgets
2.8.12).
//Moving it here after WXWINDOW::Create has been called stops this and
//the call does nothing if the style is the same as previous calls so
//should be safe to call here.
the boolean flag
if ( !m_created )
{
//create the stream
makes it that it's only called 1 time
I'll try this tomorrow
-Pedro
----- Original Message -----
Sent: Thursday, December 15, 2016 1:31 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Pedro Vicente
Hi Alan
Post by Pedro Vicente
I think you will agree with me that smells like a workaround rather
than a fundamental fix.
yes, I agree.
Post by Pedro Vicente
Post by Alan W. Irwin
Eventually, we had to change our
minimum acceptable wxwidgets version from 2.8 to 3.0 because of one
commit which only worked for 3.0.
hhm, ok
I have to double check this but the comments in your code say ::Bind() is
only available
for 3.0, and ::Bind() is not used
so probably the code as of now is compatible with 2.8 (meaning it only has
2.8 calls, not 3.0 calls)
Post by Pedro Vicente
Post by Alan W. Irwin
I would appreciate
your thoughts on this matter of moving to pure 3.0.
we could try the ::Bind() route, yes, to see what happens
another thing
wxPLplotwindow.h is a header file
we can try to move the implementation to a .ccp file (with templates there
are some idiosyncrasies about the use of headers versus .cpp,
that's why I never use templates)
Post by Pedro Vicente
Post by Alan W. Irwin
I would be willing to hold the release for you for a few
extra days beyond December 27th
that would be great, that should be enough to have a better idea.
I have more time to work on this on the weekends only.
-Pedro
----- Original Message -----
Sent: Thursday, December 15, 2016 12:35 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Pedro Vicente
Post by Alan W. Irwin
Hi Alan
see my replies between your questions
Post by Alan W. Irwin
This certainly qualifies as a release-critical wxwidgets bug. And you
have certainly supplied enough information that Phil should find this
to be straightforward to reproduce.
easy to reproduce on the PLplot code, but not immediatley obvious to find
the root cause.
Amen!
Post by Alan W. Irwin
My speculation is that it happens because this function located in
\bindings\wxwidgets\wxPLplotwindow.h
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
if ( !m_created )
is not automatically called in an wxwidgets event triggered by this code
in wxPLplotDemo.cpp, the Create() call
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
this can be easily confirmed if you put a print statement here
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
wxLogDebug("wxPLplotwindow<WXWINDOW>::OnCreate");
if ( !m_created )
so, my solution is simple, it's just to specifically call the code that
is inside
void wxPLplotwindow<WXWINDOW>::OnCreate
I did this by doing a function that I called CreatePLplotstream(), that
contains the stream initialization code
that is in
wxPLplotwindow<WXWINDOW>::OnCreate
so, in the demo code the call is now
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->CreatePLplotstream();
I think you will agree with me that smells like a workaround rather
than a fundamental fix. Nevertheless, if you turn that change into a
PLplot patch AND that solves the present build issue for all the Linux
distros you have tried, and if it works here on Debian Jessie, then I
will apply that patch as a temporary fix for the release which we can
undo afterwards (or even before the release if we are lucky) with a
more fundamental fix.
Post by Alan W. Irwin
Post by Alan W. Irwin
Do you see any use of (presumably deprecated) wxwidgets-2.x calls
in our wxwidgets binding or device driver? If so, that might be
a good place to start to work on this issue.
not sure, I'll check
events are explained here
http://docs.wxwidgets.org/3.1/overview_events.html
I always do a static event table in my code.
it's also possible to do a dynamic event (with ::Bind())
actually in the PLplot code this is done another way, that I am not sure
about
//We use connect instead of Bind for compatiblity with wxWidgets 2.8
//but should move to bind in the future.
WXWINDOW::Connect( wxEVT_CREATE, wxWindowCreateEventHandler(
wxPLplotwindow<WXWINDOW>::OnCreate ) );
Implementing a fundamental fix for the current build issue is already
way beyond my meager C++ and wxwidgets expertise, but I do have some
sense of the overview that may help you.
One issue you should be aware of is git blame results are obfuscated
by our code styling events (often triggered by me) which amount to
putting random blanks in the code to make it conform to our style.
So
39a6c01b (Alan W. Irwin 2015-02-14 19:32:12 -0800 90) //We use
connect instead of Bind for compatiblity with wxWidgets 2.8
39a6c01b (Alan W. Irwin 2015-02-14 19:32:12 -0800 123) //on at least
one system (CentOS with intel compiler and wxWidgets 2.8.12).
"shows" I was the author of the above comment in commit 39a6c01b, but
that was a styling commit so you have to back off one commit to 39a6c01b^
to find the true
cf59c54a (Phil Rosenberg 2015-01-15 14:18:42 +0000 75) //We use
connect instead of Bind for compatiblity with wxWidgets 2.8
fa121bd5 (Phil Rosenberg 2015-01-20 15:56:53 +0000 102) //on at
least one system (CentOS with intel compiler and wxWidgets 2.8.12).
Also, if you look at the git log for references to wxwidgets 2.8 and
3.0, it appears we tried to keep backwards compatibility with 2.8 for
quite a while (the commit messages for cf59c54a, and fa121bd5 but also
other commits mention maintaining compatibility with 2.8) even though
principal development was on 3.0. Eventually, we had to change our
minimum acceptable wxwidgets version from 2.8 to 3.0 because of one
commit which only worked for 3.0. So it does appear our code is a
mixture of wxwidgets-2.8 (supported typically by an extra commit after
some development on 3.0) and 3.0, and it might be a bit of an effort
to remove all that wxwidgets-2.8 support.
If you are in e-mail contact, i.e., reading this, I would appreciate
your thoughts on this matter of moving to pure 3.0. If it is
straightforward to do, and you have time to work on that before
Christmas, I would be willing to hold the release for you for a few
extra days beyond December 27th until you are done and the result
thoroughly checked on Debian Jessie, Windows, and all the different
Linux distros available to Pedro. I advise this change eventually in
any case because the mixture of 2.8 and 3.0 we have now appears not to
be well supported on most Linux distros unless Pedro's workaround
turns out to (temporarily) save the day for us.
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
https://lists.sourceforge.net/lists/listinfo/plplot-devel
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/plplot-devel
Pedro Vicente
2016-12-15 07:40:40 UTC
Permalink
hmm, ok, I forgot Plot() is called right after the Create() call
so, this makes the assertion happen before there is a Paint event

xPLplotwindow<wxFrame> *frame = new wxPlDemoFrame();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->SetIcon( wxIcon( graph ) );
Plot( frame );

returning on PLot() avoids the assertion

void Plot( wxPLplotwindow<WXWINDOW> *plotwindow )
{
wxPLplotstream* pls = plotwindow->GetStream();
if (pls == NULL) return;
assert(pls);

and this makes all the events to be callled (*even* the OnCreate one)
and I was wrong, ::OnPaint is only called when I move the window (that now
has no plot primitives, but still
with the stream created, which is progress)

02:28:23: Debug: wxPLplotwindow constructor
02:28:23: Debug: wxPLplotwindow::OnSize stream creation
02:28:23: Debug: wxPLplotwindow<WXWINDOW>::OnCreate
02:28:23: Debug: wxPLplotwindow::OnPaint
02:28:23: Debug: wxPLplotwindow::OnPaint


so playing a bit with this it should be possible to have a non intrusive
workaround

as it happens wxWidgets is an excellent built framework, so this page

http://docs.wxwidgets.org/trunk/classwx_evt_handler.html

http://docs.wxwidgets.org/trunk/classwx_evt_handler.html#a0f30c8fa5583b4a5f661897d63de3b62

should have some solutions

-Pedro


----- Original Message -----
From: "Pedro Vicente" <***@space-research.org>
To: "Alan W. Irwin" <***@beluga.phys.uvic.ca>; "Phil Rosenberg"
<***@gmail.com>
Cc: "PLplot development list" <plplot-***@lists.sourceforge.net>
Sent: Thursday, December 15, 2016 1:57 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Pedro Vicente
Hi Alan, Phil
I forgot about a very simple fix that does need a custom function call
(therefore a "real" fix, or better a non intrusive fix for users)
that is, right now, the code is responding to these 2 events
WXWINDOW::Connect( wxEVT_SIZE, wxSizeEventHandler(
wxPLplotwindow<WXWINDOW>::OnSize ) );
WXWINDOW::Connect( wxEVT_PAINT, wxPaintEventHandler(
wxPLplotwindow<WXWINDOW>::OnPaint ) );
so, it's just a matter of calling the OnCreate() stream on one
wxEVT_SIZE is a bad idea, because it's only called when the user moves the
window
but I think wxEVT_PAINT is *continuously* called in a event loop (meaning
always)
right now it even has some calls that are called there as a workaround
template<class WXWINDOW>
void wxPLplotwindow<WXWINDOW>::OnPaint( wxPaintEvent &WXUNUSED( event ) )
{
//Really this should be in the constructor, but it caused a segfault
//on at least one system (CentOS with intel compiler and wxWidgets
2.8.12).
//Moving it here after WXWINDOW::Create has been called stops this and
//the call does nothing if the style is the same as previous calls so
//should be safe to call here.
the boolean flag
if ( !m_created )
{
//create the stream
makes it that it's only called 1 time
I'll try this tomorrow
-Pedro
----- Original Message -----
Sent: Thursday, December 15, 2016 1:31 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Pedro Vicente
Hi Alan
Post by Alan W. Irwin
I think you will agree with me that smells like a workaround rather
than a fundamental fix.
yes, I agree.
Post by Alan W. Irwin
Post by Alan W. Irwin
Eventually, we had to change our
minimum acceptable wxwidgets version from 2.8 to 3.0 because of one
commit which only worked for 3.0.
hhm, ok
I have to double check this but the comments in your code say ::Bind() is
only available
for 3.0, and ::Bind() is not used
so probably the code as of now is compatible with 2.8 (meaning it only has
2.8 calls, not 3.0 calls)
Post by Alan W. Irwin
Post by Alan W. Irwin
I would appreciate
your thoughts on this matter of moving to pure 3.0.
we could try the ::Bind() route, yes, to see what happens
another thing
wxPLplotwindow.h is a header file
we can try to move the implementation to a .ccp file (with templates there
are some idiosyncrasies about the use of headers versus .cpp,
that's why I never use templates)
Post by Alan W. Irwin
Post by Alan W. Irwin
I would be willing to hold the release for you for a few
extra days beyond December 27th
that would be great, that should be enough to have a better idea.
I have more time to work on this on the weekends only.
-Pedro
----- Original Message -----
Sent: Thursday, December 15, 2016 12:35 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Alan W. Irwin
Post by Alan W. Irwin
Hi Alan
see my replies between your questions
Post by Alan W. Irwin
This certainly qualifies as a release-critical wxwidgets bug. And you
have certainly supplied enough information that Phil should find this
to be straightforward to reproduce.
easy to reproduce on the PLplot code, but not immediatley obvious to find
the root cause.
Amen!
Post by Alan W. Irwin
My speculation is that it happens because this function located in
\bindings\wxwidgets\wxPLplotwindow.h
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
if ( !m_created )
is not automatically called in an wxwidgets event triggered by this code
in wxPLplotDemo.cpp, the Create() call
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
this can be easily confirmed if you put a print statement here
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
wxLogDebug("wxPLplotwindow<WXWINDOW>::OnCreate");
if ( !m_created )
so, my solution is simple, it's just to specifically call the code that
is inside
void wxPLplotwindow<WXWINDOW>::OnCreate
I did this by doing a function that I called CreatePLplotstream(), that
contains the stream initialization code
that is in
wxPLplotwindow<WXWINDOW>::OnCreate
so, in the demo code the call is now
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->CreatePLplotstream();
I think you will agree with me that smells like a workaround rather
than a fundamental fix. Nevertheless, if you turn that change into a
PLplot patch AND that solves the present build issue for all the Linux
distros you have tried, and if it works here on Debian Jessie, then I
will apply that patch as a temporary fix for the release which we can
undo afterwards (or even before the release if we are lucky) with a
more fundamental fix.
Post by Alan W. Irwin
Post by Alan W. Irwin
Do you see any use of (presumably deprecated) wxwidgets-2.x calls
in our wxwidgets binding or device driver? If so, that might be
a good place to start to work on this issue.
not sure, I'll check
events are explained here
http://docs.wxwidgets.org/3.1/overview_events.html
I always do a static event table in my code.
it's also possible to do a dynamic event (with ::Bind())
actually in the PLplot code this is done another way, that I am not sure
about
//We use connect instead of Bind for compatiblity with wxWidgets 2.8
//but should move to bind in the future.
WXWINDOW::Connect( wxEVT_CREATE, wxWindowCreateEventHandler(
wxPLplotwindow<WXWINDOW>::OnCreate ) );
Implementing a fundamental fix for the current build issue is already
way beyond my meager C++ and wxwidgets expertise, but I do have some
sense of the overview that may help you.
One issue you should be aware of is git blame results are obfuscated
by our code styling events (often triggered by me) which amount to
putting random blanks in the code to make it conform to our style.
So
39a6c01b (Alan W. Irwin 2015-02-14 19:32:12 -0800 90) //We use
connect instead of Bind for compatiblity with wxWidgets 2.8
39a6c01b (Alan W. Irwin 2015-02-14 19:32:12 -0800 123) //on at least
one system (CentOS with intel compiler and wxWidgets 2.8.12).
"shows" I was the author of the above comment in commit 39a6c01b, but
that was a styling commit so you have to back off one commit to 39a6c01b^
to find the true
cf59c54a (Phil Rosenberg 2015-01-15 14:18:42 +0000 75) //We use
connect instead of Bind for compatiblity with wxWidgets 2.8
fa121bd5 (Phil Rosenberg 2015-01-20 15:56:53 +0000 102) //on at
least one system (CentOS with intel compiler and wxWidgets 2.8.12).
Also, if you look at the git log for references to wxwidgets 2.8 and
3.0, it appears we tried to keep backwards compatibility with 2.8 for
quite a while (the commit messages for cf59c54a, and fa121bd5 but also
other commits mention maintaining compatibility with 2.8) even though
principal development was on 3.0. Eventually, we had to change our
minimum acceptable wxwidgets version from 2.8 to 3.0 because of one
commit which only worked for 3.0. So it does appear our code is a
mixture of wxwidgets-2.8 (supported typically by an extra commit after
some development on 3.0) and 3.0, and it might be a bit of an effort
to remove all that wxwidgets-2.8 support.
If you are in e-mail contact, i.e., reading this, I would appreciate
your thoughts on this matter of moving to pure 3.0. If it is
straightforward to do, and you have time to work on that before
Christmas, I would be willing to hold the release for you for a few
extra days beyond December 27th until you are done and the result
thoroughly checked on Debian Jessie, Windows, and all the different
Linux distros available to Pedro. I advise this change eventually in
any case because the mixture of 2.8 and 3.0 we have now appears not to
be well supported on most Linux distros unless Pedro's workaround
turns out to (temporarily) save the day for us.
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
https://lists.sourceforge.net/lists/listinfo/plplot-devel
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/plplot-devel
Alan W. Irwin
2016-12-15 09:43:19 UTC
Permalink
Post by Pedro Vicente
Hi Alan
Post by Alan W. Irwin
I think you will agree with me that smells like a workaround rather
than a fundamental fix.
yes, I agree.
Post by Alan W. Irwin
Post by Alan W. Irwin
Eventually, we had to change our
minimum acceptable wxwidgets version from 2.8 to 3.0 because of one
commit which only worked for 3.0.
hhm, ok
I have to double check this but the comments in your code say ::Bind() is
only available
for 3.0, and ::Bind() is not used
so probably the code as of now is compatible with 2.8 (meaning it only has
2.8 calls, not 3.0 calls)
Not exactly. If you read Phil's commit messages carefuly they imply
the code was developed for 3.0 and the minimum changes made as
an afterthought when it did not work on his CentOS box at that time
so it would work on 2.8. So, for example, there is a
commit that _replaced_ Bind by the current connect method.
Post by Pedro Vicente
Post by Alan W. Irwin
Post by Alan W. Irwin
I would appreciate
your thoughts on this matter of moving to pure 3.0.
we could try the ::Bind() route, yes, to see what happens
Good. And thanks for your willingness to give us some help with wxwidgets to
get these current Linux build errors straightened out.

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
__________________________
Pedro Vicente
2016-12-15 06:11:19 UTC
Permalink
Hi Alan

I just installed the latest debian on VirtualBox, and I get the same errors.
the results are attached, same thing that I did for ubuntu.

I even put out 2 print statements in wxPLplotwindow.h,
one in the constructor, other in OnCreate, as I explained before.
the print in OnCreate() is *NOT* printed

this is from the output

00:47:42: Debug: wxPLplotwindow<WXWINDOW>
wxPLplotDemo: /home/pvn/plplot-plplot/examples/c++/wxPLplotDemo.cpp:158:
void Plot(wxPLplotwindow<WXWINDOW>*) [with WXWINDOW = wxFrame]: Assertion
`0' failed.
Aborted


it seems that something on your debian is preventing this error,
but you should be able to verify this by just installing a new debian (or
any linux , it seems) on VirtualBox.

https://www.virtualbox.org/wiki/Downloads

then I just did

sudo apt-get install libwxgtk3.0-dev
git clone http://git.code.sf.net/p/plplot/plplot plplot-plplot

virtualbox is ideal to test this because we can have just a clean linux that
can be easily installed and deleted

-Pedro

----- Original Message -----
From: "Alan W. Irwin" <***@beluga.phys.uvic.ca>
To: "Phil Rosenberg" <***@gmail.com>; "Pedro Vicente"
<***@space-research.org>
Cc: "PLplot development list" <plplot-***@lists.sourceforge.net>
Sent: Wednesday, December 14, 2016 7:16 PM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Alan W. Irwin
Post by Pedro Vicente
Hi Alan
Post by Alan W. Irwin
What happens if you try a Ubuntu platform with a system version
of wxwidgets version = 3.0.x? Same question for a Ubuntu
platform with wxwidgets version = 3.1.x?
I was actually just going to do that just now, so here it goes
lsb_release -a
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
sudo apt-get install libwxgtk3.0-dev
git clone http://git.code.sf.net/p/plplot/plplot plplot-plplot
cd plplot-plplot
mkdir build
cd build
cmake .. -G "Unix Makefiles"
-DCMAKE_INSTALL_PREFIX:PATH=/home/pvicente/plplot-install
-DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_f95:BOOL=OFF
-DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF -DBUILD_TEST=ON >&
cmake.ubuntu.txt &
make VERBOSE=1 test_wxPLplotDemo >& test_wxPLplotDemo.out.ubuntu.txt &
So you have the same bad result for system version of everything on
Ubuntu trusty including wxwidgets-3.0.x (except for Qt5 which should not matter here).
This certainly qualifies as a release-critical wxwidgets bug. And you
have certainly supplied enough information that Phil should find this
to be straightforward to reproduce. So if I get a communication from
Phil that he is actively working on this, I will hold the PLplot
release past December 22 for this. However, if he is out of e-mail
contact, I won't hold the release, and we will just have to live with
the fact that the fundamental wxwidgets binding just plain does not
work on most Linux distros, ugh!
Also, just in case any of those cmake options of yours were affecting the result I
just tried here
cmake -G "Unix
Makefiles" -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_f95:BOOL=OFF
-DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF -DBUILD_TEST=ON ../plplot.git
Post by Pedro Vicente
& cmake.out
and
make test_wxPLplotDemo >& test_wxPLplotDemo.out
with the same (good) results.
N.B. I have attached those two files in compressed form so you can see
what is different between them and your results. (Say if you get
failure there even on Debian Jessie.)
Post by Pedro Vicente
By looking at cmake.ubuntu.txt it uses this GTK+
-- Checking for module 'gtk+-x11-2.0'
-- Found gtk+-x11-2.0, version 2.24.27
so, exactly the same as my CentOS, if that matters
The corresponding output here is
-- Checking for module 'gtk+-x11-2.0'
-- Found gtk+-x11-2.0, version 2.24.25
So you are two patch-versions later with GTK+ which I doubt
matters much at all.
Post by Pedro Vicente
I also have another 16.04 ubuntu , I will try that next
also, you mentioned that on Debian Jessie it's OK.
so i'll try to install that or a recent Fedora on a VirtualBox to see
That's a good idea to at least make sure you can reproduce my good
result on Debian Jessie. If you can do that, but get bad results for
every other distro, I would begin to wonder what magic and secret
elixir the Debian Jessie packagers applied to wxwidgets and GTK+ to
get them to work properly together? :-)
Seriously, Phil's new wxwidgets binding and device driver first
started life as a wxwidgets-2.x software if I recall correctly. So it is possible that
Debian Jessie has maintained better wxwidgets-2 compatibility in their
wxwidgets-3 libraries than other distros. In which case to solve this,
Phil would have to figure out how to modernize the wxwidgets binding
and device driver so it does not rely on any wxwidgets-2.x capability
at all.
Do you see any use of (presumably deprecated) wxwidgets-2.x calls
in our wxwidgets binding or device driver? If so, that might be
a good place to start to work on this issue.
Also, I obviously haven't been paying much attention to this thread
before, but I do recall you were advocating some one-line "fix" with
Phil for our wxwidgets-related software which I did not understand at
all and which he appeared noncommittal about. But if that is all you
need to get the test_wxPLplotDemo build to work on _all_ Linux distros
(including Debian Jessie here), I would accept your git-formatted
patch to make that one-line change you recommend as a fix for this
release critical issue. But that one-liner might also be a workaround
for some wxwidgets-2.x calls left in our code like I was speculating
about above or some other issue so Phil may want to reverse this "fix"
after the release and implement a more fundamental fix instead.
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
__________________________
Alan W. Irwin
2016-12-15 09:32:27 UTC
Permalink
Post by Pedro Vicente
Hi Alan
I just installed the latest debian on VirtualBox, and I get the same errors.
the results are attached, same thing that I did for ubuntu.
Hi Pedro:

Just for the record, what version of Debian?

Currently Jessie = stable (a largely frozen release from two years
ago), Stretch = testing (a rolling release not as stable as stable),
and Sid = unstable (another rolling release not as stable as testing).
Stretch has turned or will turn soon into a frozen distribution
similar to Jessie but two years more modern and be designated stable
likely sometime in 2017. Jessie will be redesignated as oldstable at
that Debian release epoch, and Sid is always going to be unstable.
:-)

So if you installed Jessie, I would be officially amazed you cannot
replicate my good results there. But if Stretch or Sid, then those
are quite different, and all bets are off.
Post by Pedro Vicente
it seems that something on your debian is preventing this error,
but you should be able to verify this by just installing a new debian (or any
linux , it seems) on VirtualBox.
Half my computer memory fried itself a year or so ago so my computer
(already 9 years old but with ASUS motherboard, Intel CPU's, new
disks, and new power supply still doing pretty well) is a little short
of memory. Thus, I don't plan to look at VirtualBox at the moment, but
when (if?) one of my motherboard, CPU's, or remaining RAM die so that
I really do have to replace all three, I intend to buy a huge amount
of memory for the new system so I can play with VirtualBox with ease.

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
__________________________
Pedro Vicente
2016-12-15 15:22:12 UTC
Permalink
Hi Alan

I installed the latest from the debian site, here

https://www.debian.org/distrib/

it's not surprising that I got the same results in ubuntu because I
used the same package

sudo apt-get install libwxgtk3.0-dev
Post by Alan W. Irwin
Post by Pedro Vicente
Hi Alan
I just installed the latest debian on VirtualBox, and I get the same errors.
the results are attached, same thing that I did for ubuntu.
Just for the record, what version of Debian?
Currently Jessie = stable (a largely frozen release from two years
ago), Stretch = testing (a rolling release not as stable as stable),
and Sid = unstable (another rolling release not as stable as
testing).
Stretch has turned or will turn soon into a frozen distribution
similar to Jessie but two years more modern and be designated stable
likely sometime in 2017. Jessie will be redesignated as oldstable at
that Debian release epoch, and Sid is always going to be unstable.
:-)
So if you installed Jessie, I would be officially amazed you cannot
replicate my good results there. But if Stretch or Sid, then those
are quite different, and all bets are off.
Post by Pedro Vicente
it seems that something on your debian is preventing this error,
but you should be able to verify this by just installing a new
debian (or any linux , it seems) on VirtualBox.
Half my computer memory fried itself a year or so ago so my computer
(already 9 years old but with ASUS motherboard, Intel CPU's, new
disks, and new power supply still doing pretty well) is a little short
of memory. Thus, I don't plan to look at VirtualBox at the moment, but
when (if?) one of my motherboard, CPU's, or remaining RAM die so that
I really do have to replace all three, I intend to buy a huge amount
of memory for the new system so I can play with VirtualBox with ease.
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
__________________________
--
Pedro Vicente
***@space-research.org
http://www.space-research.org/
Pedro Vicente
2016-12-15 16:24:34 UTC
Permalink
Hi Alan


Success

The solution is to override the Show() function of the window, that is
called in the demo.
So no need to modify the demo at all with a custom function call.


in wxPLplotwindow.h I just added this function

template<class WXWINDOW>
bool wxPLplotwindow<WXWINDOW>::Show(bool show)
{
wxLogDebug("wxPLplotwindow::Show");
CreateStream();
WXWINDOW::Show(show);

}

where
CreateStream();
is a new internal function of the class that contains the code that is
now in OnCreate()

the 2 files are attached
they contain a couple of debug messages

this is the sequence I get

11:13:52: Debug: wxPLplotwindow
11:13:52: Debug: frame->Create
11:13:52: Debug: wxPLplotwindow::Show
11:13:52: Debug: wxPLplotwindow::CreateStream
11:13:52: Debug: wxPLplotwindow::RenewPlot
11:13:52: Debug: Plot()
11:13:52: Debug: wxPLplotwindow::RenewPlot
11:13:52: Debug: wxPLplotwindow::RenewPlot
11:13:52: Debug: wxPLplotwindow::OnCreate
11:13:52: Debug: wxPLplotwindow::CreateStream
11:13:52: Debug: wxPLplotwindow::OnErase


as you can see the stream is NOT NULL when we get at
11:13:52: Debug: Plot()

-Pedro
Post by Pedro Vicente
Hi Alan
I installed the latest from the debian site, here
https://www.debian.org/distrib/
it's not surprising that I got the same results in ubuntu because I
used the same package
sudo apt-get install libwxgtk3.0-dev
Post by Alan W. Irwin
Post by Pedro Vicente
Hi Alan
I just installed the latest debian on VirtualBox, and I get the
same
errors.
the results are attached, same thing that I did for ubuntu.
Just for the record, what version of Debian?
Currently Jessie = stable (a largely frozen release from two years
ago), Stretch = testing (a rolling release not as stable as stable),
and Sid = unstable (another rolling release not as stable as
testing).
Stretch has turned or will turn soon into a frozen distribution
similar to Jessie but two years more modern and be designated stable
likely sometime in 2017. Jessie will be redesignated as oldstable at
that Debian release epoch, and Sid is always going to be unstable.
:-)
So if you installed Jessie, I would be officially amazed you cannot
replicate my good results there. But if Stretch or Sid, then those
are quite different, and all bets are off.
Post by Pedro Vicente
it seems that something on your debian is preventing this error,
but you should be able to verify this by just installing a new
debian (or any linux , it seems) on VirtualBox.
Half my computer memory fried itself a year or so ago so my computer
(already 9 years old but with ASUS motherboard, Intel CPU's, new
disks, and new power supply still doing pretty well) is a little short
of memory. Thus, I don't plan to look at VirtualBox at the moment, but
when (if?) one of my motherboard, CPU's, or remaining RAM die so that
I really do have to replace all three, I intend to buy a huge amount
of memory for the new system so I can play with VirtualBox with ease.
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
__________________________
--
Pedro Vicente
http://www.space-research.org/
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/plplot-devel
--
Pedro Vicente
***@space-research.org
http://www.space-research.org/
Alan W. Irwin
2016-12-15 21:12:13 UTC
Permalink
Post by Pedro Vicente
Hi Alan
Success
The solution is to override the Show() function of the window, that is called
in the demo.
So no need to modify the demo at all with a custom function call.
in wxPLplotwindow.h I just added this function
template<class WXWINDOW>
bool wxPLplotwindow<WXWINDOW>::Show(bool show)
{
wxLogDebug("wxPLplotwindow::Show");
CreateStream();
WXWINDOW::Show(show);
}
where
CreateStream();
is a new internal function of the class that contains the code that is now in
OnCreate()
the 2 files are attached
they contain a couple of debug messages
this is the sequence I get
11:13:52: Debug: wxPLplotwindow
11:13:52: Debug: frame->Create
11:13:52: Debug: wxPLplotwindow::Show
11:13:52: Debug: wxPLplotwindow::CreateStream
11:13:52: Debug: wxPLplotwindow::RenewPlot
11:13:52: Debug: Plot()
11:13:52: Debug: wxPLplotwindow::RenewPlot
11:13:52: Debug: wxPLplotwindow::RenewPlot
11:13:52: Debug: wxPLplotwindow::OnCreate
11:13:52: Debug: wxPLplotwindow::CreateStream
11:13:52: Debug: wxPLplotwindow::OnErase
as you can see the stream is NOT NULL when we get at
11:13:52: Debug: Plot()
I get something different here

12:45:37: Debug: wxPLplotwindow
12:45:37: Debug: frame->Create
12:45:37: Debug: wxPLplotwindow::Show
12:45:37: Debug: wxPLplotwindow::CreateStream
12:45:37: Debug: wxPLplotwindow::RenewPlot
12:45:37: Debug: wxPLplotwindow::RenewPlot
12:45:37: Debug: wxPLplotwindow::RenewPlot
12:45:37: Debug: wxPLplotwindow::OnCreate
12:45:37: Debug: wxPLplotwindow::CreateStream
12:45:37: Debug: Plot()
12:45:37: Debug: wxPLplotwindow::RenewPlot
12:45:37: Debug: wxPLplotwindow::OnErase
12:45:43: Debug: wxPLplotwindow::OnErase
12:45:45: Debug: wxPLplotwindow::OnErase
PLMemoryMap::close: just entering close
[100%] Built target test_wxPLplotDemo

Perhaps this different result is why the issue did not cause
any problems on my system?

But regardless of that system difference issue, your changes work
here, and also work there. So a big thanks for that fundamental
fix for the problem!

Important! Also please follow the cookbook instructions in
README.developers to format your change in "git format-patch" form. (I
just [commit ae4af16] updated those instructions with you in mind so I
hope you will find them easy to follow.)

The alternative is I could just go ahead and commit your changed files
here, but then that would give me git credit for your work (as seen
by, e.g., git log, git blame, etc.) so I far prefer you to use "git
format-patch" following the cookbook instructions in
README.developers. Then I can follow up properly here with "git am"
and then merge the commit that creates here (that is identified as
yours) to master.

I think the debugging output you have in your current changes should
stay in for your commit. Because that might help Phil understand
your changes (if he gets back in contact before the release).
Later on just before the release I plan to make an additional commit
to drop the debugging output your commit creates (and also
similarly for the debugging output I have put into -dev wxwidgets
and wxPLViewere).

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
__________________________
Pedro Vicente
2016-12-15 21:39:53 UTC
Permalink
Post by Alan W. Irwin
I get something different here
12:45:37: Debug: wxPLplotwindow
12:45:37: Debug: frame->Create
12:45:37: Debug: wxPLplotwindow::Show
this is interesting.
It seems that the
frame->Create
call does *NOT* trigger the
wxPLplotwindow::OnCreate
event on your run

otherwise you would have this


12:45:37: Debug: wxPLplotwindow
12:45:37: Debug: frame->Create
11:13:52: Debug: wxPLplotwindow::OnCreate

but on the other hand, without my changes, you did get the plot,
correct?

but probably this does not matter at this time, unless you're really
curious about the sequence
of events in your code.
In that case , start from the original files as in the repo now and
just add calls like these
wxLogDebug("wxPLplotwindow::OnCreate");

in all functions
Post by Alan W. Irwin
Important! Also please follow the cookbook instructions in
README.developers to format your change in "git format-patch" form. (I
just [commit ae4af16] updated those instructions with you in mind so I
hope you will find them easy to follow.)
ok
Post by Alan W. Irwin
But regardless of that system difference issue, your changes work
here, and also work there. So a big thanks for that fundamental
fix for the problem!
your're welcome, glad I could help
Post by Alan W. Irwin
The alternative is I could just go ahead and commit your changed files
here, but then that would give me git credit for your work (as seen
by, e.g., git log, git blame, etc.) so I far prefer you to use "git
format-patch" following the cookbook instructions in
README.developers.
I will commit, always good to get credit where credit is due :-)
do I have git permissions to do
git commit
git push
?
Post by Alan W. Irwin
I think the debugging output you have in your current changes should
stay in for your commit. Because that might help Phil understand
your changes
ok

-Pedro
Post by Alan W. Irwin
Post by Pedro Vicente
Hi Alan
Success
The solution is to override the Show() function of the window, that
is called in the demo.
So no need to modify the demo at all with a custom function call.
in wxPLplotwindow.h I just added this function
template<class WXWINDOW>
bool wxPLplotwindow<WXWINDOW>::Show(bool show)
{
wxLogDebug("wxPLplotwindow::Show");
CreateStream();
WXWINDOW::Show(show);
}
where
CreateStream();
is a new internal function of the class that contains the code that
is now in OnCreate()
the 2 files are attached
they contain a couple of debug messages
this is the sequence I get
11:13:52: Debug: wxPLplotwindow
11:13:52: Debug: frame->Create
11:13:52: Debug: wxPLplotwindow::Show
11:13:52: Debug: wxPLplotwindow::CreateStream
11:13:52: Debug: wxPLplotwindow::RenewPlot
11:13:52: Debug: Plot()
11:13:52: Debug: wxPLplotwindow::RenewPlot
11:13:52: Debug: wxPLplotwindow::RenewPlot
11:13:52: Debug: wxPLplotwindow::OnCreate
11:13:52: Debug: wxPLplotwindow::CreateStream
11:13:52: Debug: wxPLplotwindow::OnErase
as you can see the stream is NOT NULL when we get at
11:13:52: Debug: Plot()
I get something different here
12:45:37: Debug: wxPLplotwindow
12:45:37: Debug: frame->Create
12:45:37: Debug: wxPLplotwindow::Show
12:45:37: Debug: wxPLplotwindow::CreateStream
12:45:37: Debug: wxPLplotwindow::RenewPlot
12:45:37: Debug: wxPLplotwindow::RenewPlot
12:45:37: Debug: wxPLplotwindow::RenewPlot
12:45:37: Debug: wxPLplotwindow::OnCreate
12:45:37: Debug: wxPLplotwindow::CreateStream
12:45:37: Debug: Plot()
12:45:37: Debug: wxPLplotwindow::RenewPlot
12:45:37: Debug: wxPLplotwindow::OnErase
12:45:43: Debug: wxPLplotwindow::OnErase
12:45:45: Debug: wxPLplotwindow::OnErase
PLMemoryMap::close: just entering close
[100%] Built target test_wxPLplotDemo
Perhaps this different result is why the issue did not cause
any problems on my system?
But regardless of that system difference issue, your changes work
here, and also work there. So a big thanks for that fundamental
fix for the problem!
Important! Also please follow the cookbook instructions in
README.developers to format your change in "git format-patch" form. (I
just [commit ae4af16] updated those instructions with you in mind so I
hope you will find them easy to follow.)
The alternative is I could just go ahead and commit your changed files
here, but then that would give me git credit for your work (as seen
by, e.g., git log, git blame, etc.) so I far prefer you to use "git
format-patch" following the cookbook instructions in
README.developers. Then I can follow up properly here with "git am"
and then merge the commit that creates here (that is identified as
yours) to master.
I think the debugging output you have in your current changes should
stay in for your commit. Because that might help Phil understand
your changes (if he gets back in contact before the release).
Later on just before the release I plan to make an additional commit
to drop the debugging output your commit creates (and also
similarly for the debugging output I have put into -dev wxwidgets
and wxPLViewere).
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
__________________________
--
Pedro Vicente
***@space-research.org
http://www.space-research.org/
Phil Rosenberg
2016-12-15 22:06:07 UTC
Permalink
Hi Pedro, Alan
I'm still unable to reproduce the problem on my Ubuntu 14.04 system
with wxWidgets 3.0. Very strange. I have tried a totally fresh build
directory and static and dynamic builds.

I had forgotten to test on my work CentOS PC and although I know it is
powered on I can't ssh into it. I'm not sure why. I will test it when
I get in tomorrow.

I can't help feeling that there is something that we are missing here.
Given both I and Pedro have tested on Ubuntu 14.04 there must be
something different between the two systems.

Phil

On 15 December 2016 at 15:22, Pedro Vicente
Post by Pedro Vicente
Hi Alan
I installed the latest from the debian site, here
https://www.debian.org/distrib/
it's not surprising that I got the same results in ubuntu because I used the
same package
sudo apt-get install libwxgtk3.0-dev
Post by Alan W. Irwin
Post by Pedro Vicente
Hi Alan
I just installed the latest debian on VirtualBox, and I get the same errors.
the results are attached, same thing that I did for ubuntu.
Just for the record, what version of Debian?
Currently Jessie = stable (a largely frozen release from two years
ago), Stretch = testing (a rolling release not as stable as stable),
and Sid = unstable (another rolling release not as stable as testing).
Stretch has turned or will turn soon into a frozen distribution
similar to Jessie but two years more modern and be designated stable
likely sometime in 2017. Jessie will be redesignated as oldstable at
that Debian release epoch, and Sid is always going to be unstable.
:-)
So if you installed Jessie, I would be officially amazed you cannot
replicate my good results there. But if Stretch or Sid, then those
are quite different, and all bets are off.
Post by Pedro Vicente
it seems that something on your debian is preventing this error,
but you should be able to verify this by just installing a new debian (or
any linux , it seems) on VirtualBox.
Half my computer memory fried itself a year or so ago so my computer
(already 9 years old but with ASUS motherboard, Intel CPU's, new
disks, and new power supply still doing pretty well) is a little short
of memory. Thus, I don't plan to look at VirtualBox at the moment, but
when (if?) one of my motherboard, CPU's, or remaining RAM die so that
I really do have to replace all three, I intend to buy a huge amount
of memory for the new system so I can play with VirtualBox with ease.
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
__________________________
--
Pedro Vicente
http://www.space-research.org/
Pedro Vicente
2016-12-15 22:19:50 UTC
Permalink
Hi Phil
Post by Phil Rosenberg
Post by Phil Rosenberg
I can't help feeling that there is something that we are missing here.
Given both I and Pedro have tested on Ubuntu 14.04 there must be
something different between the two systems.
it seems so.
the only way to be sure is that on your side to install a completely new
Ubuntu, or Debian on VirtualBox, and then do

sudo apt-get install libwxgtk3.0-dev

VirtualBox can be installed on Windows or Mac (this is called the host
system).
I am running it on my Windows machine and I have three linux installed on it
, ubuntu, centos, debian

-Pedro




----- Original Message -----
From: "Phil Rosenberg" <***@gmail.com>
To: "Pedro Vicente" <***@space-research.org>
Cc: "Alan W. Irwin" <***@beluga.phys.uvic.ca>; "PLplot development list"
<plplot-***@lists.sourceforge.net>
Sent: Thursday, December 15, 2016 5:06 PM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Phil Rosenberg
Hi Pedro, Alan
I'm still unable to reproduce the problem on my Ubuntu 14.04 system
with wxWidgets 3.0. Very strange. I have tried a totally fresh build
directory and static and dynamic builds.
I had forgotten to test on my work CentOS PC and although I know it is
powered on I can't ssh into it. I'm not sure why. I will test it when
I get in tomorrow.
I can't help feeling that there is something that we are missing here.
Given both I and Pedro have tested on Ubuntu 14.04 there must be
something different between the two systems.
Phil
On 15 December 2016 at 15:22, Pedro Vicente
Post by Phil Rosenberg
Hi Alan
I installed the latest from the debian site, here
https://www.debian.org/distrib/
it's not surprising that I got the same results in ubuntu because I used the
same package
sudo apt-get install libwxgtk3.0-dev
Post by Alan W. Irwin
Post by Pedro Vicente
Hi Alan
I just installed the latest debian on VirtualBox, and I get the same errors.
the results are attached, same thing that I did for ubuntu.
Just for the record, what version of Debian?
Currently Jessie = stable (a largely frozen release from two years
ago), Stretch = testing (a rolling release not as stable as stable),
and Sid = unstable (another rolling release not as stable as testing).
Stretch has turned or will turn soon into a frozen distribution
similar to Jessie but two years more modern and be designated stable
likely sometime in 2017. Jessie will be redesignated as oldstable at
that Debian release epoch, and Sid is always going to be unstable.
:-)
So if you installed Jessie, I would be officially amazed you cannot
replicate my good results there. But if Stretch or Sid, then those
are quite different, and all bets are off.
Post by Pedro Vicente
it seems that something on your debian is preventing this error,
but you should be able to verify this by just installing a new debian (or
any linux , it seems) on VirtualBox.
Half my computer memory fried itself a year or so ago so my computer
(already 9 years old but with ASUS motherboard, Intel CPU's, new
disks, and new power supply still doing pretty well) is a little short
of memory. Thus, I don't plan to look at VirtualBox at the moment, but
when (if?) one of my motherboard, CPU's, or remaining RAM die so that
I really do have to replace all three, I intend to buy a huge amount
of memory for the new system so I can play with VirtualBox with ease.
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
__________________________
--
Pedro Vicente
http://www.space-research.org/
Alan W. Irwin
2016-12-16 00:05:00 UTC
Permalink
Post by Pedro Vicente
Hi Phil
Post by Phil Rosenberg
I can't help feeling that there is something that we are missing here.
Given both I and Pedro have tested on Ubuntu 14.04 there must be
something different between the two systems.
it seems so.
the only way to be sure is that on your side to install a completely new
Ubuntu, or Debian on VirtualBox, and then do
sudo apt-get install libwxgtk3.0-dev
VirtualBox can be installed on Windows or Mac (this is called the host
system).
I am running it on my Windows machine and I have three linux installed on it
, ubuntu, centos, debian
@ Phil and Pedro:

I am beginning to wonder whether something that is being done
differently but legitimately by VirtualBox is highlighting some subtle
bug we have in the Linux wxwidgets code that doesn't happen to show
any symptoms for the non-VirtualBox'd case.

@Phil:

I am just going to go ahead and merge Pedro's patch (once he gets it
to me in "git format-patch" form) to SF master since it apparently
solves his "VirtualBox" issue (if we can call it that) without messing
up the Linux success we have on non-VirtualBox'ed Linux. But if you
have any qualms about his changes, feel free to either contact me
immediately (if you are not sleeping now) or ask me to revert my merge
of his work tomorrow.

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
__________________________
Phil Rosenberg
2016-12-16 00:26:59 UTC
Permalink
Unfortunately I don't think I have enough space to install virtualbox.
I presume I need a few 10s of GB for an Ubuntu install?

I have also just tried on the Bash on Ubuntu on Windows (still trying
to decide if I like this or Cygwin best. Anyway...). Again everything
works fine on this (I'm using Xming for my X server).

Is there something different with the X server or something in a
VirtualBox install?

I suspect that you are correct Alan and this is a subtle VitualBox
thing. We should create a minimum working example of a wxFrame using
the two stage creation totally independent of plplot and see if this
works. If it doesn't then we know this is a VirtualBox/wxWidgets bug.
If it does then we can start adding complexity to find where it
breaks.
Post by Alan W. Irwin
Post by Pedro Vicente
Hi Phil
Post by Phil Rosenberg
I can't help feeling that there is something that we are missing here.
Given both I and Pedro have tested on Ubuntu 14.04 there must be
something different between the two systems.
it seems so.
the only way to be sure is that on your side to install a completely new
Ubuntu, or Debian on VirtualBox, and then do
sudo apt-get install libwxgtk3.0-dev
VirtualBox can be installed on Windows or Mac (this is called the host
system).
I am running it on my Windows machine and I have three linux installed on
it , ubuntu, centos, debian
I am beginning to wonder whether something that is being done
differently but legitimately by VirtualBox is highlighting some subtle
bug we have in the Linux wxwidgets code that doesn't happen to show any
symptoms for the non-VirtualBox'd case.
I am just going to go ahead and merge Pedro's patch (once he gets it
to me in "git format-patch" form) to SF master since it apparently
solves his "VirtualBox" issue (if we can call it that) without messing
up the Linux success we have on non-VirtualBox'ed Linux. But if you
have any qualms about his changes, feel free to either contact me
immediately (if you are not sleeping now) or ask me to revert my merge
of his work tomorrow.
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
__________________________
Pedro Vicente
2016-12-16 01:04:32 UTC
Permalink
Post by Phil Rosenberg
Post by Phil Rosenberg
Unfortunately I don't think I have enough space to install virtualbox.
I presume I need a few 10s of GB for an Ubuntu install?
not at all ! :-)

the beauty of Virtual Box is that it has this feature called dynamic size.
you can install ubuntu with 8GB or less.

all the OS is contained on a single file on the host system.
so it does not alter the host in any shape or form

I routinely install and delete linux installations just to test something
Post by Phil Rosenberg
Post by Phil Rosenberg
Post by Phil Rosenberg
I have also just tried on the Bash on Ubuntu on Windows (still trying
to decide if I like this or Cygwin best. Anyway...).
go for Bash on Ubuntu on Windows if you have Windows 10
I have Windows 7 and I use git bash ;
so I can run bash on Windows 7
Post by Phil Rosenberg
Post by Phil Rosenberg
Again everything
works fine on this (I'm using Xming for my X server).
the bug does not happen in Windows ;
that is if you mean the Visual Studio build that uses the wxWidgets WIN32
API
completely different from the GTK part on Linux
Post by Phil Rosenberg
Post by Phil Rosenberg
Post by Phil Rosenberg
I suspect that you are correct Alan and this is a subtle VitualBox
thing.
see my previous email
the errors happened on real linux installations



----- Original Message -----
From: "Phil Rosenberg" <***@gmail.com>
To: "Alan W. Irwin" <***@beluga.phys.uvic.ca>
Cc: "Pedro Vicente" <***@space-research.org>; "PLplot development
list" <plplot-***@lists.sourceforge.net>
Sent: Thursday, December 15, 2016 7:26 PM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Phil Rosenberg
Unfortunately I don't think I have enough space to install virtualbox.
I presume I need a few 10s of GB for an Ubuntu install?
I have also just tried on the Bash on Ubuntu on Windows (still trying
to decide if I like this or Cygwin best. Anyway...). Again everything
works fine on this (I'm using Xming for my X server).
Is there something different with the X server or something in a
VirtualBox install?
I suspect that you are correct Alan and this is a subtle VitualBox
thing. We should create a minimum working example of a wxFrame using
the two stage creation totally independent of plplot and see if this
works. If it doesn't then we know this is a VirtualBox/wxWidgets bug.
If it does then we can start adding complexity to find where it
breaks.
Post by Phil Rosenberg
Post by Phil Rosenberg
Hi Phil
Post by Phil Rosenberg
I can't help feeling that there is something that we are missing here.
Given both I and Pedro have tested on Ubuntu 14.04 there must be
something different between the two systems.
it seems so.
the only way to be sure is that on your side to install a completely new
Ubuntu, or Debian on VirtualBox, and then do
sudo apt-get install libwxgtk3.0-dev
VirtualBox can be installed on Windows or Mac (this is called the host
system).
I am running it on my Windows machine and I have three linux installed on
it , ubuntu, centos, debian
I am beginning to wonder whether something that is being done
differently but legitimately by VirtualBox is highlighting some subtle
bug we have in the Linux wxwidgets code that doesn't happen to show any
symptoms for the non-VirtualBox'd case.
I am just going to go ahead and merge Pedro's patch (once he gets it
to me in "git format-patch" form) to SF master since it apparently
solves his "VirtualBox" issue (if we can call it that) without messing
up the Linux success we have on non-VirtualBox'ed Linux. But if you
have any qualms about his changes, feel free to either contact me
immediately (if you are not sleeping now) or ask me to revert my merge
of his work tomorrow.
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
__________________________
Alan W. Irwin
2016-12-16 01:29:21 UTC
Permalink
Post by Phil Rosenberg
Unfortunately I don't think I have enough space to install virtualbox.
I presume I need a few 10s of GB for an Ubuntu install?
I have also just tried on the Bash on Ubuntu on Windows (still trying
to decide if I like this or Cygwin best. Anyway...). Again everything
works fine on this (I'm using Xming for my X server).
Is there something different with the X server or something in a
VirtualBox install?
Yes, the X server is different for VirtualBox. For example, my
understanding is they have implemented their own X device when Linux
is the host, and presumably something different again when Windows is
the host (as in Pedro's case). (By chance I happen to know this bit of arcane
knowledge from my couple of years of lurking on the Intel X driver
list in an attempt to help me figure out some glitches in how the Intel
Linux X driver was working for my Intel video chip.)
Post by Phil Rosenberg
I suspect that you are correct Alan and this is a subtle VitualBox
thing. We should create a minimum working example of a wxFrame using
the two stage creation totally independent of plplot and see if this
works. If it doesn't then we know this is a VirtualBox/wxWidgets bug.
If it does then we can start adding complexity to find where it
breaks.
If you could implement that great idea for looking at this issue
deeper, it would be great. Note I plan to merge Pedro's fix (once he
gets it to me in format-patch form) and let it ride for the release or
until you can figure this out if that happens before the release.

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
__________________________
Pedro Vicente
2016-12-16 00:56:05 UTC
Permalink
Alan

All my linux failures were on 3 different "real" machines (CentOS with
personal wxwidgets 3.1 build, 2 ubuntus 14.04 16.4 from packages)

the 4th linux failure was on a debian I installed on VirtualBox.
So, it's not a VirtualBox issue.
-Pedro


----- Original Message -----
From: "Alan W. Irwin" <***@beluga.phys.uvic.ca>
To: "Pedro Vicente" <***@space-research.org>; "Phil Rosenberg"
<***@gmail.com>
Cc: "PLplot development list" <plplot-***@lists.sourceforge.net>
Sent: Thursday, December 15, 2016 7:05 PM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Alan W. Irwin
Post by Pedro Vicente
Hi Phil
Post by Phil Rosenberg
I can't help feeling that there is something that we are missing here.
Given both I and Pedro have tested on Ubuntu 14.04 there must be
something different between the two systems.
it seems so.
the only way to be sure is that on your side to install a completely new
Ubuntu, or Debian on VirtualBox, and then do
sudo apt-get install libwxgtk3.0-dev
VirtualBox can be installed on Windows or Mac (this is called the host
system).
I am running it on my Windows machine and I have three linux installed on
it , ubuntu, centos, debian
I am beginning to wonder whether something that is being done
differently but legitimately by VirtualBox is highlighting some subtle
bug we have in the Linux wxwidgets code that doesn't happen to show any
symptoms for the non-VirtualBox'd case.
I am just going to go ahead and merge Pedro's patch (once he gets it
to me in "git format-patch" form) to SF master since it apparently
solves his "VirtualBox" issue (if we can call it that) without messing
up the Linux success we have on non-VirtualBox'ed Linux. But if you
have any qualms about his changes, feel free to either contact me
immediately (if you are not sleeping now) or ask me to revert my merge
of his work tomorrow.
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
__________________________
Phil Rosenberg
2016-12-16 01:05:54 UTC
Permalink
Hmm - well another theory down in smoke.

Attached is an absolute minimum example of the use of wxEVT_CREATE. On
Windows I get the expected behaviour of a popup dialog appearing
before the frame saying "OnCreate called."

Could you try it on one of your Linux machines? I'm afraid it's way
past my bedtime here in the UK, so I'll have to continue tomorrow.

Phil



On 16 December 2016 at 00:56, Pedro Vicente
Post by Pedro Vicente
Alan
All my linux failures were on 3 different "real" machines (CentOS with
personal wxwidgets 3.1 build, 2 ubuntus 14.04 16.4 from packages)
the 4th linux failure was on a debian I installed on VirtualBox.
So, it's not a VirtualBox issue.
-Pedro
----- Original Message ----- From: "Alan W. Irwin"
Sent: Thursday, December 15, 2016 7:05 PM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Alan W. Irwin
Post by Pedro Vicente
Hi Phil
Post by Phil Rosenberg
I can't help feeling that there is something that we are missing here.
Given both I and Pedro have tested on Ubuntu 14.04 there must be
something different between the two systems.
it seems so.
the only way to be sure is that on your side to install a completely new
Ubuntu, or Debian on VirtualBox, and then do
sudo apt-get install libwxgtk3.0-dev
VirtualBox can be installed on Windows or Mac (this is called the host
system).
I am running it on my Windows machine and I have three linux installed on
it , ubuntu, centos, debian
I am beginning to wonder whether something that is being done
differently but legitimately by VirtualBox is highlighting some subtle
bug we have in the Linux wxwidgets code that doesn't happen to show any
symptoms for the non-VirtualBox'd case.
I am just going to go ahead and merge Pedro's patch (once he gets it
to me in "git format-patch" form) to SF master since it apparently
solves his "VirtualBox" issue (if we can call it that) without messing
up the Linux success we have on non-VirtualBox'ed Linux. But if you
have any qualms about his changes, feel free to either contact me
immediately (if you are not sleeping now) or ask me to revert my merge
of his work tomorrow.
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
__________________________
Alan W. Irwin
2016-12-16 02:11:07 UTC
Permalink
Post by Phil Rosenberg
Hmm - well another theory down in smoke.
Attached is an absolute minimum example of the use of wxEVT_CREATE. On
Windows I get the expected behaviour of a popup dialog appearing
before the frame saying "OnCreate called."
Could you try it on one of your Linux machines? I'm afraid it's way
past my bedtime here in the UK, so I'll have to continue tomorrow.
@Pedro: You should do this test as well since your Linux platforms are the ones where
(so far at least) issues are showing up. But for what it is worth, I did the following

***@raven> g++ $(wx-config --cppflags --libs) evtCreateExample.cpp

to successfully (no errors/warnings) build Phil's test application.

Then I ran it with

***@raven> ./a.out

and a popup window came up (apparently as a subGUI of a grey GUI blank
called "My Frame") with the "OnCreate Called" message displayed (which
I understand was the expected result when everything is working
properly).

I hope that experiment helps you guys to gain some insight in what the
heck is going on for wxwidgets-gtk+ on Linux.

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
__________________________
Pedro Vicente
2016-12-16 18:01:47 UTC
Permalink
Hi Phil, Alan

I tried evtCreateExample.cpp and I get the good expected result.
This just means that for this simple example the OnCreate event is
triggered.

To note that on my bad results of the PLplot demo, the OnCreate event
is *also* triggered.
the problem is that is triggered after the plot was made


11:09:13: Debug: wxPLplotwindow::wxPLplotwindow
11:09:13: Debug: frame->Create
11:09:13: Debug: pls NULL
11:09:13: Debug: wxPLplotwindow::OnCreate

I am not that familiar with the wxWidgets internals but it seems events
are put in a queue.

http://docs.wxwidgets.org/3.1/overview_events.html

it could be that the event is not processed in the expected order or
delayed for some reason.
this could be a good question for the wxWidgets support list.

-Pedro
Post by Alan W. Irwin
Post by Phil Rosenberg
Hmm - well another theory down in smoke.
Attached is an absolute minimum example of the use of wxEVT_CREATE. On
Windows I get the expected behaviour of a popup dialog appearing
before the frame saying "OnCreate called."
Could you try it on one of your Linux machines? I'm afraid it's way
past my bedtime here in the UK, so I'll have to continue tomorrow.
@Pedro: You should do this test as well since your Linux platforms are the ones where
(so far at least) issues are showing up. But for what it is worth, I did the following
to successfully (no errors/warnings) build Phil's test application.
Then I ran it with
and a popup window came up (apparently as a subGUI of a grey GUI blank
called "My Frame") with the "OnCreate Called" message displayed (which
I understand was the expected result when everything is working
properly).
I hope that experiment helps you guys to gain some insight in what the
heck is going on for wxwidgets-gtk+ on Linux.
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
__________________________
--
Pedro Vicente
***@space-research.org
http://www.space-research.org/
Pedro Vicente
2016-12-19 17:47:45 UTC
Permalink
Hi Phil
Pedro can you please check if this works on your systems?
ok, I'll try it when the patch is pushed to the master .

Alan

I assume you are going to push the patch?
I get some compiling errors on the current master, please see my last
post

a new idea:

what about if we just override the Create() function of wxPLplotwindow
?

eliminate the Show() override, and the trigger of the OnCreate
function,
but just simply override the Create() function.

the client call would be

wxPLplotwindow<wxFrame> *frame = new wxPlDemoFrame();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->Show();

and the stream would be created *inside*
frame->Create

not posted to a queue event
PS - Pedro I just realised from your email address we are in the same
line of work. I work at the Institute for Climate and Atmospheric
Science at University of Leeds. Small world!
yes, good to know !

-Pedro
No worries :-)
Attached is a patch which I hope should fix things. It is the
simplest
possible fix as far as I can tell. It does have a while loop with no
counter, but unless there is some rather fatal bug in wxWidgets it
should never turn into an infinite loop. Alan if you prefer I will
add
a counter to ensure things can't go crazy. I have also added some
extra checks to wxPLplotwindow just in case the create event ends up
arriving after the first paint event or something - I don't know if
this can happen but the docs aren't clear so it does no harm to
include the checks.
I always have to check how to create patches with git. I followed the
instructions at
https://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git/.
The appropriate apply commands are listed there too.
Pedro can you please check if this works on your systems?
Phil
PS - Pedro I just realised from your email address we are in the same
line of work. I work at the Institute for Climate and Atmospheric
Science at University of Leeds. Small world!
On 19 December 2016 at 12:51, Alan W. Irwin
I'm just generating a test fix. I will send a patch round once
it's
done. If it works then I'll tidy it up. However you appear to have
bumped up the minimum CMake version so I need to reinstall CMake -
turns out the latest Windows version requires a manual uninstall
first. I'm sure you're not deliberately making my life hard Alan
;-)
:-D :-D
Sorry about that. I far prefer to make your life easy. :-)
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
__________________________
--
Pedro Vicente
***@space-research.org
http://www.space-research.org/
Phil Rosenberg
2016-12-19 18:59:58 UTC
Permalink
On 19 December 2016 at 17:47, Pedro Vicente
Post by Pedro Vicente
Hi Phil
Pedro can you please check if this works on your systems?
ok, I'll try it when the patch is pushed to the master .
Alan
I assume you are going to push the patch?
I get some compiling errors on the current master, please see my last post
It would be good for you to test the patch before it gets pushed to
master so we don't contaminate master with useless changes that just
get undone next commit. To do so create a new branch from master, then
apply the patch
git checkout master
git checkout -b myTestBranch
git apply path/to/patch.patch


If master is currently not working then try checking out a previous
commit as follows
git checkout master
git log
#select a working commit hash one or two back
git checkout <hash of previous commit>
git checkout -b myTestBranch
git apply path/to/patch.patch
Post by Pedro Vicente
what about if we just override the Create() function of wxPLplotwindow ?
Unfortunately we can't override the create function because we need to
call the base class create function. We can't call the base class
create function inside our own create function because the parameters
that need to be passed in will differ depending upon whether you use a
wxFrame, wxPanel or any other wxWindow as the template class that we
inherit from. In fact this is why we are using the create event in the
first place, otherwise we would just sort everything in the
constructor.

I'm pretty confident that the patch I sent will fix things if the
issue is just that the create event is delayed. If you are having
trouble getting it to apply, then I'll commit it to master. But I
guess we need to wait for Alan to fix the logging issues first.

I'm about to leave work and head home. If he hasn't fixed them by the
time I open my laptop this evening then I'll have a look at fixing the
issue myself.

Phil

Alan W. Irwin
2016-12-16 01:34:49 UTC
Permalink
Post by Pedro Vicente
Alan
All my linux failures were on 3 different "real" machines (CentOS with
personal wxwidgets 3.1 build, 2 ubuntus 14.04 16.4 from packages)
the 4th linux failure was on a debian I installed on VirtualBox.
Hi Pedro:

Sorry. As Phil said, one more theory goes up in smoke. :-(

My suggestion for reformatting your commit message still stands but obviously
without the Virtual box remark I inserted.

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
__________________________
Pedro Vicente
2016-12-16 01:42:21 UTC
Permalink
Hi Alan

ok, I will reformat the commit message later today.
since I am not that familiar with git to do the amend, I'll just create a
new branch and do the same commit with the message you sent in the last
email

that's a good idea to have messages as detailed as possible,

-Pedro

----- Original Message -----
From: "Alan W. Irwin" <***@beluga.phys.uvic.ca>
To: "Pedro Vicente" <***@space-research.org>
Cc: "Phil Rosenberg" <***@gmail.com>; "PLplot development list"
<plplot-***@lists.sourceforge.net>
Sent: Thursday, December 15, 2016 8:34 PM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp -- linux build error
Post by Alan W. Irwin
Post by Pedro Vicente
Alan
All my linux failures were on 3 different "real" machines (CentOS with
personal wxwidgets 3.1 build, 2 ubuntus 14.04 16.4 from packages)
the 4th linux failure was on a debian I installed on VirtualBox.
Sorry. As Phil said, one more theory goes up in smoke. :-(
My suggestion for reformatting your commit message still stands but obviously
without the Virtual box remark I inserted.
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
__________________________
Pedro Vicente
2016-12-10 09:04:01 UTC
Permalink
Hi Phil

I tested on a different setting

Ubuntu i686 GNU/Linux

Using wxWidgets installed from packages
using the PLplot from git

git clone http://git.code.sf.net/p/plplot/plplot plplot-plplot
cd plplot-plplot/
mkdir build
cd build
cmake .. -G "Unix
Makefiles" -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_f95:BOOL=OFF
-DENABLE_tcl:BOOL=OFF -DENABLE_tk:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=/home/pvn/install/plplot-5.11.1
-DPL_HAVE_PTHREAD:BOOL=OFF -DPLD_xwin:BOOL=OFF -DPLD_wxwidgets:BOOL=ON -DwxWidgets_ROOT_DIR:PATH=/usr/lib/i386-linux-gnu
-DwxWidgets_LIB_DIR:PATH=/usr/lib/i386-linux-gnu -DwxWidgets_CONFIGURATION=mswud
-DENABLE_MIX_CXX=ON -DwxWidgets_EXCLUDE_COMMON_LIBRARIES:BOOL=OFF -DBUILD_TEST:BOOL=ON
Post by Pedro Vicente
& cmake.txt &
make >& make.txt &
cd /home/pvn/svn/plot/plplot-5.11.1/build/examples/c++/
./wxPLplotDemo
Segmentation fault (core dumped)



-Pedro



----- Original Message -----
From: "Pedro Vicente" <***@space-research.org>
To: <plplot-***@lists.sourceforge.net>; "Phil Rosenberg"
<***@gmail.com>
Sent: Saturday, December 10, 2016 2:52 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors
Post by Pedro Vicente
Hi Phil
My idea for a fix is to move the stream initialization that is now on
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event
{
if ( !m_created )
either to the OnSize or onPaint events
void wxPLplotwindow<WXWINDOW>::OnSize( wxSizeEvent& WXUNUSED( event ) )
and also in the plot call do this
template< class WXWINDOW >
void Plot( wxPLplotwindow<WXWINDOW> *plotwindow )
{
wxPLplotstream* pls = plotwindow->GetStream();
if (pls == NULL)
{
return;
}
Like this , in this sequence
wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
frame->SetIcon( wxIcon( graph ) );
frame->Show();
Plot( frame );
first we go to
Plot( frame );
but the stream is NULL because
:OnCreate
was not called, but the function returns, avoiding the seg fault
then the window gets a paint or size event, and the stream initialization
code is called
at this time I have a PLplot empty black window
but because
Plot( frame );
was only called at start, it is not called again, so there is no draw
any ideas here ?
of course making the Plot() call in another app function should work
If you could replicate this issue, that would be great.
I am using CentOS 6.8, PLplot.5.11.1 , wxWidgets 3.1.0
----- Original Message -----
From: Pedro Vicente
Sent: Saturday, December 10, 2016 12:59 AM
Subject: Re: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, the issue seems to be the same that I have been reporting
In the wxPLplotDemo.cpp code you have these callling functions
wxPLplotwindow<wxFrame> *frame = new wxPlDemoFrame();
frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) );
that make 2 calls to the PLplot library, or the wxWidgets driver of it
all these calls are in the header file wxPLplotwindow.h
first the constructor is called
template<class WXWINDOW>
wxPLplotwindow<WXWINDOW>::wxPLplotwindow( bool useGraphicsContext, wxSize
clientSize )
: m_created( false ), m_initialSize( clientSize )
then this call OnCreate() is called, like you mentioned
and the !m_created bool makes the initialization of the stream happen
the problem is that this function id *NOT* called on my linux build (it is
on the Windows build)
so therefore later
wxPLplotstream* pls = plotwindow->GetStream();
this is NULL, so therefore it seg faults on the plot calls
//! This is called when the widow is created i.e. after WXWINDOW::Create
// has been called. We note that this has been called to avoid attempting
// to redraw a plot on a window that hasn't been created yet.
template<class WXWINDOW>
void wxPLplotwindow<WXWINDOW>::OnCreate( wxWindowCreateEvent &event )
{
if ( !m_created )
so, one quick try is to put the code of
void wxPLplotwindow<WXWINDOW>::OnCreate
that is not called on the constructor maybe ?
-Pedro
----- Original Message -----
From: Pedro Vicente
Sent: Friday, December 09, 2016 11:57 PM
Subject: [Plplot-devel] wxPLplotDemo.cpp errors
Hi Phil
So, resuming the last thread about wxWidgets, what I did was to build and
run wxPLplotDemo.cpp from PLpplot 5.11.1 on CentOS 6.8
all builds fine, but when I do run , I get a seg fault
/data/home002/pvicente/plplot/build/examples/c++
Segmentation fault
I know that only this information is not much help to you to debug, but in
the next couple of days I'll be debugging this and posting here any
solution.
my cmake call was
cmake .. -G "Unix
Makefiles" -DBUILD_SHARED_LIBS:BOOL=OFF -DENABLE_f95:BOOL=OFF -DENABLE_tcl:BOOL=OFF
-DENABLE_tk:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=/data/data127/pvicente/install/plplot-5.11.1d
-DPL_HAVE_PTHREAD:BOOL=OFF -DPLD_xwin:BOOL=OFF -DPLD_wxwidgets:BOOL=ON -DwxWidgets_ROOT_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0
-DwxWidgets_LIB_DIR:PATH=/data/data127/pvicente/install/wxwidgets-3.1.0/lib
-DwxWidgets_CONFIGURATION=mswud -DENABLE_MIX_CXX=ON -DwxWidgets_EXCLUDE_COMMON_LIBRARIES:BOOL=OFF
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_TEST:BOOL=ON >& cmake.txt &
the output of
cmake
and
make
are attached
-Pedro
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Plplot-devel mailing list
https://lists.sourceforge.net/lists/listinfo/plplot-devel
Loading...