Re: [GRASS-dev] libLAS in GRASS 7.4 for Mac

2018-02-20 Thread Michael Barton
Vaclav,

I've been tied up for awhile, but I just now followed up on the suggestion to 
open a request to include laslib-config with the laslib/lastools Anaconda 
package.

But I can see no way to do this. Not even a way to contact whoever is 
maintaining this package for Anaconda Cloud. The only link is back to the 
original site where the open source code can be downloaded.

Here is the link if you or anyone out there has a suggestion.
https://anaconda.org/conda-forge/lastools

Michael

C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Head, Graduate Faculty in Complex Adaptive Systems Science
Arizona State University

voice:  480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC),  480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu



On Feb 9, 2018, at 8:14 AM, Vaclav Petras 
> wrote:

Moving libLAS+Mac+Anaconda discussion to the list.

On Fri, Feb 9, 2018 at 12:23 AM, Michael Barton 
> wrote:

The Anaconda LAS package seems to have all the binary distribution files and 
libraries built by compiling LAS from source (i.e., those that I bundled 
previously)--EXCEPT for liblas-config.

That's what I'm saying. Open an issue (wherever appropriate) to fix libLAS 
Anaconda package. Perhaps all you need is a development version of this package 
if Anaconda packaging is similar to Linux packaging.

It would be nice if I could build GRASS with LAS support without the need for 
this file.

That seems like a workaround for an upstream issue as opposed to reporting the 
issue upstream as first step in fixing it. If libLAS is dropping liblas-config 
a way to get the libraries and headers or of if liblas-config usage in this 
context is not appropriate (which I can't tell), then yes, we should switch to 
specifying the libraries manually.


I've looked at liblas-config and can see what it does. But AFAICT, when running 
v.in.lidar or r.in.lidar, they are only really using the LAS libraries and 
binary tools las2txt and laszip.

liblas-config is needed for the compilation of things against libLAS, not for 
runtime. It's the same as with the C header files, you don't need them during 
runtime, but you need them for compilation.

So perhaps GRASS is not using any of the non-LAS linked libraries that 
laslib-config provides paths to (e.g., boost and gdal).

As far as I understand, they are needed for the compilation because libLAS 
needs them.

If GRASS actually needs all of the linked files that laslib-config provides, 
then we can't just use the binaries in the Anaconda LAS tools package.

libLAS uses Boost and (I think optionally) GDAL, so I would expect that to be 
part of the Anaconda package (or installed as a dependency).

The only recourse is to try to recompile it in an Anaconda environment and have 
it create an appropriate laslib-config. A serious pain.

I would not do that until you see what the upstream (Anaconda package) people 
say.

In the mean time, before the issue is resolved upstream, you can create the 
liblas-config, youself. It will look something like this:

if [ "$1" = "--libs" ]
then
echo -L/usr/lib -llas -llas_c -L... /usr/lib/x86_64-linux-gnu/libtiff.so
...

I'm attaching a full script, but you need to supply the values appropriate for 
Mac/your computer. Start with what you would put to the --with-liblas-libs=...

Unrelated to the Mac issue, I wonder if it is a probable that we are not making 
use of the --defines option in liblas-config (which gives "-DHAVE_GDAL=1 
-DHAVE_LIBGEOTIFF=1", but perhaps it is important only when compiling libLAS 
binary tools.


But if all GRASS really needs are the LAS binaries and libraries (liblas.dylib 
on the Mac), then maybe we can just point to the resources it needs.


Try the attached script to do that. For me GRASS configures successfully when I 
use it instead of liblas-config:

--with-liblas="/home/.../fake-liblas-config.sh"

Best,
Vaclav


Cheers
Michael

C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Head, Graduate Faculty in Complex Adaptive Systems Science
Arizona State University

voice:  480-965-6262 (SHESC), 
480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC),  
480-727-0709 (CSDC)
www: 
http://www.public.asu.edu/~cmbarton,
 

Re: [GRASS-dev] libLAS in GRASS 7.4 for Mac

2018-02-09 Thread Michael Barton
Thanks Vaclav.

C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Head, Graduate Faculty in Complex Adaptive Systems Science
Arizona State University

voice:  480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC),  480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu



On Feb 9, 2018, at 8:14 AM, Vaclav Petras 
> wrote:

Moving libLAS+Mac+Anaconda discussion to the list.

On Fri, Feb 9, 2018 at 12:23 AM, Michael Barton 
> wrote:

The Anaconda LAS package seems to have all the binary distribution files and 
libraries built by compiling LAS from source (i.e., those that I bundled 
previously)--EXCEPT for liblas-config.

That's what I'm saying. Open an issue (wherever appropriate) to fix libLAS 
Anaconda package. Perhaps all you need is a development version of this package 
if Anaconda packaging is similar to Linux packaging.

It would be nice if I could build GRASS with LAS support without the need for 
this file.

That seems like a workaround for an upstream issue as opposed to reporting the 
issue upstream as first step in fixing it. If libLAS is dropping liblas-config 
a way to get the libraries and headers or of if liblas-config usage in this 
context is not appropriate (which I can't tell), then yes, we should switch to 
specifying the libraries manually.


I've looked at liblas-config and can see what it does. But AFAICT, when running 
v.in.lidar or r.in.lidar, they are only really using the LAS libraries and 
binary tools las2txt and laszip.

liblas-config is needed for the compilation of things against libLAS, not for 
runtime. It's the same as with the C header files, you don't need them during 
runtime, but you need them for compilation.

So perhaps GRASS is not using any of the non-LAS linked libraries that 
laslib-config provides paths to (e.g., boost and gdal).

As far as I understand, they are needed for the compilation because libLAS 
needs them.

If GRASS actually needs all of the linked files that laslib-config provides, 
then we can't just use the binaries in the Anaconda LAS tools package.

libLAS uses Boost and (I think optionally) GDAL, so I would expect that to be 
part of the Anaconda package (or installed as a dependency).

The only recourse is to try to recompile it in an Anaconda environment and have 
it create an appropriate laslib-config. A serious pain.

I would not do that until you see what the upstream (Anaconda package) people 
say.

In the mean time, before the issue is resolved upstream, you can create the 
liblas-config, youself. It will look something like this:

if [ "$1" = "--libs" ]
then
echo -L/usr/lib -llas -llas_c -L... /usr/lib/x86_64-linux-gnu/libtiff.so
...

I'm attaching a full script, but you need to supply the values appropriate for 
Mac/your computer. Start with what you would put to the --with-liblas-libs=...

Unrelated to the Mac issue, I wonder if it is a probable that we are not making 
use of the --defines option in liblas-config (which gives "-DHAVE_GDAL=1 
-DHAVE_LIBGEOTIFF=1", but perhaps it is important only when compiling libLAS 
binary tools.


But if all GRASS really needs are the LAS binaries and libraries (liblas.dylib 
on the Mac), then maybe we can just point to the resources it needs.


Try the attached script to do that. For me GRASS configures successfully when I 
use it instead of liblas-config:

--with-liblas="/home/.../fake-liblas-config.sh"

Best,
Vaclav


Cheers
Michael

C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Head, Graduate Faculty in Complex Adaptive Systems Science
Arizona State University

voice:  480-965-6262 (SHESC), 
480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC),  
480-727-0709 (CSDC)
www: 
http://www.public.asu.edu/~cmbarton,
 
http://csdc.asu.edu



On Feb 8, 2018, at 6:16 PM, Vaclav Petras 
> wrote:

Hi Michael,

I would say first thing is to check if it is really missing and if so why is 
that. I assume you have *-config for GDAL, so in general there is no special 
thing why there should be no