Re: [Plplot-devel] CMake problem with hyphen in path

2019-07-15 Thread Arjen Markus
Hi Alan, Phil,

-Original Message-
From: Alan W. Irwin 
Sent: 13 July 2019 21:15
To: Phil Rosenberg 
Cc: PLplot development list 
Subject: Re: [Plplot-devel] CMake problem with hyphen in path

On 2019-07-13 08:05- Phil Rosenberg wrote:

> Hi Alan
> You may be right.
> I tried commenting out the offending regex replace, which meant cmake 
> finished with no issues. But, when I tried to compile I found I had a similar 
> problem with header files. I couldn't actually find the offending code that 
> is causing that problem. I tried adding some quotes, but that didn't seem to 
> help.
>
> So whatever workload you thought it was, it is actually double!

Actually there is at least one or two orders of magnitude more work according 
to my Linux tests if you consider dealing with this problem for all external 
free software libraries that PLplot depends on rather than just wxwidgets.  And 
the results would depend on all external libraries (and CMake itself) dealing 
with blank in pathname issues correctly which some preliminary tests I have 
done appears to be far from the case.  So the fundamental issue is PLplot has 
been responsible about its own internal source, build, and install tree blanks 
in pathname issues, but other free software has not been that responsible.  And 
a large supplementary issue is that even if external software eventually 
becomes completely responsible about this case, there would still be a lot more 
to do on the PLplot side to make "space in external library prefix" case work 
properly for all external libraries.

>>AM: FWIW, a check that the install directory does not include space would be 
>>inline with what a package like Anaconda for Python is doing on Windows. 
>>Instead of the more commonly used directory "C:\Program Files", it installs 
>>in "C:\ProgramData", to avoid the issue that packages do not take 
>>responsibility for spaces in directory names. PLplot might simply issue a 
>>warning if the user tries to use such names anyway.

Regards,

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


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


Re: [Plplot-devel] CMake problem with hyphen in path

2019-07-13 Thread Alan W. Irwin

On 2019-07-13 08:05- Phil Rosenberg wrote:


Hi Alan
You may be right.
I tried commenting out the offending regex replace, which meant cmake finished 
with no issues. But, when I tried to compile I found I had a similar problem 
with header files. I couldn't actually find the offending code that is causing 
that problem. I tried adding some quotes, but that didn't seem to help.

So whatever workload you thought it was, it is actually double!


Actually there is at least one or two orders of magnitude more work
according to my Linux tests if you consider dealing with this problem
for all external free software libraries that PLplot depends on rather
than just wxwidgets.  And the results would depend on all external
libraries (and CMake itself) dealing with blank in pathname issues
correctly which some preliminary tests I have done appears to be far
from the case.  So the fundamental issue is PLplot has been
responsible about its own internal source, build, and install tree
blanks in pathname issues, but other free software has not been that
responsible.  And a large supplementary issue is that even if external
software eventually becomes completely responsible about this case,
there would still be a lot more to do on the PLplot side to make
"space in external library prefix" case work properly for all external
libraries.


Would it be relatively straightforward to add a check, so if the user supplies an install 
or library/header path that contains " -" then we error out at that point?


The problem with *complete* configuration-time detection of that case
is that we would have to have reliable parsing to detect the
difference between hyphenated/spaced pathnames as opposed to the " -"
that delimits linker options.  That said, we could easily warn against
the case where "- " appears anywhere in the options string since that
case is obviously not a linker option.  If you agree, I will take
responsibility for implementing such a check.

But that check would obviously not guard against the case of, say, an
-L option of the form

-L/whatever -hyphen_pathname

where "whatever -hyphen_pathname" was the complete pathname rather
than "whatever" being the pathname with "-hyphen_pathname" being a
separate linker option.  And the check would only be available for
the external wxwidgets library and all external libraries that
use pkg-config.

So to supplement that proposed incomplete configuration-time check I
think we should create a prominent warning in our wiki for users not
to use installation prefixes that contain spaces for external free
software libraries.  I emphasize spaces rather than hyphens here since
it is the spaces that generate all the issues with or without hyphens
according to my Linux tests.  Also, most experienced Unix users would
not try spaces in installed library prefixes, but some might do that
so I think the warning should be a general one rather than Windows
only.

If you agree that wiki "no-space in external library prefixes" warning
would be useful as well, would you take responsibility for updating
the most fundamental PLplot build page in our wiki (whatever that is)
to that effect?

Alan
__
Alan W. Irwin

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.org); 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
__


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


Re: [Plplot-devel] CMake problem with hyphen in path

2019-07-13 Thread Phil Rosenberg
Hi Alan
You may be right.
I tried commenting out the offending regex replace, which meant cmake finished 
with no issues. But, when I tried to compile I found I had a similar problem 
with header files. I couldn't actually find the offending code that is causing 
that problem. I tried adding some quotes, but that didn't seem to help.

So whatever workload you thought it was, it is actually double!

Would it be relatively straightforward to add a check, so if the user supplies 
an install or library/header path that contains " -" then we error out at that 
point? This way if anyone else hits this problem it would be very clear to the 
user what the problem is and how to fix it.

I presume we can't check each library individually - or it would be easy to 
fix. But I am setting cmake_install_prefix to a path that is bad, so maybe that 
could be checked. I think there are other variables too. Link_directories and 
include_directories, any more?

I'll set a workaround up on my computer by symlinking my usr directory from 
c:\usr or something. But it's a work computer and I'll need someone with admin 
rights to sort it for me next week.

Phil

Get Outlook for Android


From: Alan W. Irwin 
Sent: Saturday, July 13, 2019 6:42:20 AM
To: Phil Rosenberg
Cc: PLplot development list
Subject: Re: CMake problem with hyphen in path

On 2019-07-13 00:35+0100 Phil Rosenberg wrote:

> There are no .pc files. I'm building on native windows with visual
> studio (not with Cygwin or MSYS2) so there is no pkg-config. All
> libraries get found with the findXXX.cmake modules. In this case it is
> shapelib and wxwidgets libraries.
>
> On windows CMake basically hunts in certain locations for the libs and
> headers. In this case it finds shapelib by checking in my
> CMAKE_INSTALL_PREFIX and it finds wxWidgets via the WXWIN environment
> variable.

[...]
> Output
> (original _link_flags_list) = debug;C:/Users/earpros/OneDrive -
> University of 
> Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxbase30ud.lib;

[...]

> (post regex replace _link_flags_list) =
> debug;C:/Users/earpros/OneDrive;- University of
> Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxbase30ud.lib;

[...]

Hi Phil:

Thanks for the above detailed information which contradicted some of
my assumptions (natch).

However, I am frankly beginning to get cold feet about working much
further on this topic since from my Linux test of the case where
external libraries have blanks and hyphens in their installation
prefixes, there are a huge bunch of issues we would have to deal with
before that case worked, i.e., it would be a lot of work for little
real gain.

For example, my understanding is Windows installers typically give you
a choice of any installation prefix you want.  So wouldn't it be a lot
easier to ask our Windows users to be careful of that choice, i.e.,
pick installation prefixes without blanks or hyphens?  For example,
MSYS2 allows users to choose any installation prefix they like.  And
I think they even recommend not choosing an installation prefix with
spaces because of all the trouble that causes with free software.

Alan
__
Alan W. Irwin

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.org); 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
__
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] CMake problem with hyphen in path

2019-07-12 Thread Alan W. Irwin

On 2019-07-13 00:35+0100 Phil Rosenberg wrote:


There are no .pc files. I'm building on native windows with visual
studio (not with Cygwin or MSYS2) so there is no pkg-config. All
libraries get found with the findXXX.cmake modules. In this case it is
shapelib and wxwidgets libraries.

On windows CMake basically hunts in certain locations for the libs and
headers. In this case it finds shapelib by checking in my
CMAKE_INSTALL_PREFIX and it finds wxWidgets via the WXWIN environment
variable.


[...]

Output
(original _link_flags_list) = debug;C:/Users/earpros/OneDrive -
University of 
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxbase30ud.lib;


[...]


(post regex replace _link_flags_list) =
debug;C:/Users/earpros/OneDrive;- University of
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxbase30ud.lib;


[...]

Hi Phil:

Thanks for the above detailed information which contradicted some of
my assumptions (natch).

However, I am frankly beginning to get cold feet about working much
further on this topic since from my Linux test of the case where
external libraries have blanks and hyphens in their installation
prefixes, there are a huge bunch of issues we would have to deal with
before that case worked, i.e., it would be a lot of work for little
real gain.

For example, my understanding is Windows installers typically give you
a choice of any installation prefix you want.  So wouldn't it be a lot
easier to ask our Windows users to be careful of that choice, i.e.,
pick installation prefixes without blanks or hyphens?  For example,
MSYS2 allows users to choose any installation prefix they like.  And
I think they even recommend not choosing an installation prefix with
spaces because of all the trouble that causes with free software.

Alan
__
Alan W. Irwin

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.org); 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
__


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


Re: [Plplot-devel] CMake problem with hyphen in path

2019-07-12 Thread Phil Rosenberg
cmake_link_flagsHi Alan
There are no .pc files. I'm building on native windows with visual
studio (not with Cygwin or MSYS2) so there is no pkg-config. All
libraries get found with the findXXX.cmake modules. In this case it is
shapelib and wxwidgets libraries.

On windows CMake basically hunts in certain locations for the libs and
headers. In this case it finds shapelib by checking in my
CMAKE_INSTALL_PREFIX and it finds wxWidgets via the WXWIN environment
variable.

However I have attached below, the value of _link_flag_list just
before and just after the regex replace in cmake_link_flags

Cmake code
message("(original _link_flags_list) = ${_link_flags_in}")
# Convert link flags to a list.  Note some link flags are blank-delimited
# (such as "-framework whatever") so preserve those by splitting into
# separate list elements only if the next element starts with a hyphen.
string(REGEX REPLACE " -" ";-" _link_flags_list "${_link_flags_in}")
message("(post regex replace _link_flags_list) = ${_link_flags_list}")


Output
(original _link_flags_list) = debug;C:/Users/earpros/OneDrive -
University of 
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxbase30ud.lib;optimized;C:/Users/earpros/OneDrive
- University of
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxbase30u.lib;debug;C:/Users/earpros/OneDrive
- University of
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxmsw30ud_core.lib;optimized;C:/Users/earpros/OneDrive
- University of
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxmsw30u_core.lib;debug;C:/Users/earpros/OneDrive
- University of
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxpngd.lib;optimized;C:/Users/earpros/OneDrive
- University of
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxpng.lib;debug;C:/Users/earpros/OneDrive
- University of
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxtiffd.lib;optimized;C:/Users/earpros/OneDrive
- University of
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxtiff.lib;debug;C:/Users/earpros/OneDrive
- University of
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxjpegd.lib;optimized;C:/Users/earpros/OneDrive
- University of
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxjpeg.lib;debug;C:/Users/earpros/OneDrive
- University of
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxzlibd.lib;optimized;C:/Users/earpros/OneDrive
- University of
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxzlib.lib;debug;C:/Users/earpros/OneDrive
- University of
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxregexud.lib;optimized;C:/Users/earpros/OneDrive
- University of
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxregexu.lib;debug;C:/Users/earpros/OneDrive
- University of
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxexpatd.lib;optimized;C:/Users/earpros/OneDrive
- University of
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxexpat.lib;winmm;comctl32;oleacc;rpcrt4;shlwapi;version;wsock32
(post regex replace _link_flags_list) =
debug;C:/Users/earpros/OneDrive;- University of
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxbase30ud.lib;optimized;C:/Users/earpros/OneDrive;-
University of 
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxbase30u.lib;debug;C:/Users/earpros/OneDrive;-
University of 
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxmsw30ud_core.lib;optimized;C:/Users/earpros/OneDrive;-
University of 
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxmsw30u_core.lib;debug;C:/Users/earpros/OneDrive;-
University of 
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxpngd.lib;optimized;C:/Users/earpros/OneDrive;-
University of 
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxpng.lib;debug;C:/Users/earpros/OneDrive;-
University of 
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxtiffd.lib;optimized;C:/Users/earpros/OneDrive;-
University of 
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxtiff.lib;debug;C:/Users/earpros/OneDrive;-
University of 
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxjpegd.lib;optimized;C:/Users/earpros/OneDrive;-
University of 
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxjpeg.lib;debug;C:/Users/earpros/OneDrive;-
University of 
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxzlibd.lib;optimized;C:/Users/earpros/OneDrive;-
University of 
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxzlib.lib;debug;C:/Users/earpros/OneDrive;-
University of 
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxregexud.lib;optimized;C:/Users/earpros/OneDrive;-
University of 
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxregexu.lib;debug;C:/Users/earpros/OneDrive;-
University of 
Leeds/Documents/usr/src/wxWidgets-3.0.4/lib/vc_x64_lib/wxexpatd.lib;optimized;C:/Users/earpros/OneDrive;-
University of 

[Plplot-devel] CMake problem with hyphen in path

2019-07-12 Thread Alan W. Irwin

Oops, I sent this to the wrong list so I am correcting that now.

On 2019-07-12 05:05-0700 Alan W. Irwin wrote:


I am virtually positive pkg-config has a way (likely with quotes) to
properly distinguish between these two cases, but I am going to have
to find what that is and adjust the above parsing logic accordingly
for the general fix.


Hi Phil:

It turns out that the correct *.pc file syntax to handle blanks in
pathnames is to quote all -L and -I options, e.g., -L"whatever blank".
Could you send me all the *.pc files (wrapped in a tarball for my
convenience) for the external libraries used by PLplot that you have
installed with " - " in the pathname?  Unless I am missing something
those *.pc files will have " - " embedded in every pathname mentioned
in those files.  And if so, then I want to check that those pathnames are
all quoted correctly.

Alan
__
Alan W. Irwin

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.org); 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
__


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