Opened 8 years ago

Closed 6 years ago

Last modified 6 years ago

#3243 closed defect (fixed)

v.in.pdal build error: some PDAL 1.4.0 includes are not where the module expects them

Reported by: msieczka Owned by: wenzeslaus
Priority: normal Milestone: 7.2.4
Component: Vector Version: 7.2.0
Keywords: v.in.pdal PDAL Cc:
CPU: All Platform: All

Description

PDAL 1.4.0, Arch Linux, x86_64.

Some PDAL includes are not in /usr/include/pdal, where v.in.pdal expects them, but in the /usr/include/pdal/io subdirectory. This leads a following build error:

$ cd ~/src/grass-7.2.0/vector/v.in.pdal
$ make
c++  -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong  -I/home/dane/devel/aur/grass7/src/grass-7.2.0/dist.x86_64-pc-linux-gnu/include -I/home/dane/devel/aur/grass7/src/grass-7.2.0/dist.x86_64-pc-linux-gnu/include   -I/usr/include -I/usr/include -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -Wextra -Wall -Wno-unused-parameter -Wno-unused-variable -Wpointer-arith -Wcast-align -Wcast-qual -Wredundant-decls -Wno-long-long -Wno-unknown-pragmas -Wno-deprecated-declarations -isystem /usr/local/include -std=c++11 -std=c++11 -DPACKAGE=\""grassmods"\"   -I/usr/include -I/usr/include -I/usr/include -I/usr/include/libxml2 -I/usr/include -I/usr/include -I/home/dane/devel/aur/grass7/src/grass-7.2.0/dist.x86_64-pc-linux-gnu/include -I/home/dane/devel/aur/grass7/src/grass-7.2.0/dist.x86_64-pc-linux-gnu/include -DRELDIR=\"vector/v.in.pdal\" -o OBJ.x86_64-pc-linux-gnu/main.o -c main.cpp
main.cpp:4:30: fatal error: pdal/LasReader.hpp: No such file or directory
 #include <pdal/LasReader.hpp>
                              ^
compilation terminated.
make: *** [../../include/Make/Compile.make:35: OBJ.x86_64-pc-linux-gnu/main.o] Error 1

The reason why:

$ locate LasReader.hpp
/usr/include/pdal/io/LasReader.hpp

$ ls /usr/include/pdal/io/*.hpp | wc -l
37

$ ls /usr/include/pdal/*.hpp | wc -l
50

Attachments (1)

v_in_pdal.diff (572 bytes ) - added by neteler 8 years ago.
Patch to update include statements for PDAL 1.4.0

Download all attachments as: .zip

Change History (15)

by neteler, 8 years ago

Attachment: v_in_pdal.diff added

Patch to update include statements for PDAL 1.4.0

comment:1 by neteler, 8 years ago

I have attached a patch which solves the changes include paths.

However, I get several compilation errors with PDAL 1.4.0. Due to API changes?

[neteler@oboe v.in.pdal]$ make
...
cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C
cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C
c++  -g -Wall  -I/home/neteler/software/grass72/dist.x86_64-pc-linux-gnu/include -I/home/neteler/software/grass72/dist.x86_64-pc-linux-gnu/include   -I/usr/include/gdal -I/usr/include -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wextra -Wall -Wno-unused-parameter -Wno-unused-variable -Wpointer-arith -Wcast-align -Wcast-qual -Wredundant-decls -Wno-long-long -Wno-unknown-pragmas -Wno-deprecated-declarations -isystem /usr/local/include -std=c++11 -std=c++11 -DPACKAGE=\""grassmods"\"   -I/usr/include/gdal -I/usr/include -I/usr/include/gdal -I/usr/include/libxml2 -I/usr/include -I/usr/include -I/home/neteler/software/grass72/dist.x86_64-pc-linux-gnu/include -I/home/neteler/software/grass72/dist.x86_64-pc-linux-gnu/include -DRELDIR=\"vector/v.in.pdal\" -o OBJ.x86_64-pc-linux-gnu/main.o -c main.cpp
main.cpp:62:47: error: ‘pdal::Dimension::Id::Enum’ has not been declared
                          pdal::Dimension::Id::Enum dim_to_use_as_z)
                                               ^~~~
main.cpp: In function ‘void pdal_point_to_grass(Map_info*, line_pnts*, line_cats*, pdal::PointViewPtr, pdal::PointId, GLidarLayers*, int, int)’:
main.cpp:67:38: error: ‘Id’ is not a namespace-name
     using namespace pdal::Dimension::Id;
                                      ^~
main.cpp:67:40: error: expected namespace-name before ‘;’ token
     using namespace pdal::Dimension::Id;
                                        ^
main.cpp:68:47: error: ‘X’ was not declared in this scope
     double x = point_view->getFieldAs<double>(X, idx);
                                               ^
main.cpp:69:47: error: ‘Y’ was not declared in this scope
     double y = point_view->getFieldAs<double>(Y, idx);
                                               ^
main.cpp:70:67: error: no matching function for call to ‘pdal::PointView::getFieldAs(int&, pdal::PointId&)’
     double z = point_view->getFieldAs<double>(dim_to_use_as_z, idx);
                                                                   ^
In file included from main.cpp:2:0:
/usr/include/pdal/PointView.hpp:116:7: note: candidate: template<class T> T pdal::PointView::getFieldAs(pdal::Dimension::Id, pdal::PointId) const
     T getFieldAs(Dimension::Id dim, PointId pointIndex) const;
       ^~~~~~~~~~
/usr/include/pdal/PointView.hpp:116:7: note:   template argument deduction/substitution failed:
main.cpp:70:67: note:   cannot convert ‘dim_to_use_as_z’ (type ‘int’) to type ‘pdal::Dimension::Id’
     double z = point_view->getFieldAs<double>(dim_to_use_as_z, idx);
                                                                   ^
main.cpp:78:52: error: ‘ReturnNumber’ was not declared in this scope
         int return_n = point_view->getFieldAs<int>(ReturnNumber, idx);
                                                    ^~~~~~~~~~~~
main.cpp:79:53: error: ‘NumberOfReturns’ was not declared in this scope
         int n_returns = point_view->getFieldAs<int>(NumberOfReturns, idx);
                                                     ^~~~~~~~~~~~~~~
main.cpp:85:50: error: ‘Classification’ was not declared in this scope
                      point_view->getFieldAs<int>(Classification, idx));
                                                  ^~~~~~~~~~~~~~
main.cpp:88:47: error: ‘Red’ was not declared in this scope
         int red = point_view->getFieldAs<int>(Red, idx);
                                               ^~~
main.cpp:89:49: error: ‘Green’ was not declared in this scope
         int green = point_view->getFieldAs<int>(Green, idx);
                                                 ^~~~~
main.cpp:90:48: error: ‘Blue’ was not declared in this scope
         int blue = point_view->getFieldAs<int>(Blue, idx);
                                                ^~~~
main.cpp: In function ‘int main(int, char**)’:
main.cpp:224:37: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
     max_ground_window_opt->answer = "33";
                                     ^~~~
main.cpp:233:32: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
     ground_slope_opt->answer = "1.0";
                                ^~~~~
main.cpp:241:39: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
     max_ground_distance_opt->answer = "2.5";
                                       ^~~~~
main.cpp:250:40: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
     init_ground_distance_opt->answer = "0.15";
                                        ^~~~~~
main.cpp:259:36: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
     ground_cell_size_opt->answer = "1";
                                    ^~~
main.cpp:326:5: error: ‘Enum’ is not a member of ‘pdal::Dimension::Id’
     pdal::Dimension::Id::Enum dim_to_use_as_z = pdal::Dimension::Id::Z;
     ^~~~
main.cpp:479:20: error: ‘eHorizontalOnly’ is not a member of ‘pdal::SpatialReference’
             getWKT(pdal::SpatialReference::eHorizontalOnly);
                    ^~~~
main.cpp:541:9: error: ‘dim_to_use_as_z’ was not declared in this scope
         dim_to_use_as_z = point_view->layout()->findDim("Height");
         ^~~~~~~~~~~~~~~
main.cpp:549:29: error: ‘dim_to_use_as_z’ was not declared in this scope
     if (!point_view->hasDim(dim_to_use_as_z))
                             ^~~~~~~~~~~~~~~
main.cpp:570:51: error: ‘dim_to_use_as_z’ was not declared in this scope
         double z = point_view->getFieldAs<double>(dim_to_use_as_z, idx);
                                                   ^~~~~~~~~~~~~~~
../../include/Make/Compile.make:35: recipe for target 'OBJ.x86_64-pc-linux-gnu/main.o' failed
make: *** [OBJ.x86_64-pc-linux-gnu/main.o] Error 1

System: Using Fedora 24 with PDAL from own COPR RPM installed.

Last edited 8 years ago by neteler (previous) (diff)

in reply to:  1 comment:2 by wenzeslaus, 8 years ago

Replying to neteler:

However, I get several compilation errors with PDAL 1.4.0. Due to API changes?

Yes.

comment:3 by martinl, 8 years ago

Milestone: 7.2.17.2.2

comment:4 by ptschrum, 7 years ago

Owner: changed from grass-dev@… to ptschrum
Status: newassigned

I (ptschrum) assigned this ticket to myself.

comment:5 by neteler, 7 years ago

Milestone: 7.2.27.2.3

Ticket retargeted after milestone closed

comment:6 by neteler, 7 years ago

See r72253: v.in.pdal: change API calls to PDAL 1.6.0 (available in G7.4)

comment:7 by wenzeslaus, 7 years ago

Owner: changed from ptschrum to wenzeslaus
Status: assignednew

Assigning to myself for clarity, but should be fixed in r72253 from #3496 by felixg for 7.4. Do we need/want to backport?

in reply to:  7 comment:8 by mlennert, 7 years ago

Replying to wenzeslaus:

Assigning to myself for clarity, but should be fixed in r72253 from #3496 by felixg for 7.4. Do we need/want to backport?

Yes, please. For me v.in.pdal compilation fails in 7.2.3RC1 because of this.

Moritz

comment:9 by wenzeslaus, 7 years ago

In 72363:

v.in.pdal: change API calls to PDAL 1.6.0, see #3496, #3243, #3101, #2732 (author: felixg, backport of trunk r72246) + GPL header added in r72245

comment:10 by martinl, 7 years ago

Milestone: 7.2.3

Ticket retargeted after milestone closed

comment:11 by martinl, 7 years ago

Milestone: 7.2.4

comment:12 by wenzeslaus, 6 years ago

r72363 backported this to 7.2 branch, closing.

comment:13 by wenzeslaus, 6 years ago

Resolution: fixed
Status: newclosed

comment:14 by wenzeslaus, 6 years ago

Keywords: v.in.pdal PDAL added
Note: See TracTickets for help on using tickets.