Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Fix PDAL support for OSGeo4W #1821

Open
ninsbl opened this issue Aug 24, 2021 · 6 comments
Open

[Bug] Fix PDAL support for OSGeo4W #1821

ninsbl opened this issue Aug 24, 2021 · 6 comments
Labels
bug Something isn't working windows Microsoft Windows specific
Milestone

Comments

@ninsbl
Copy link
Member

ninsbl commented Aug 24, 2021

Describe the bug
OSGeo4W ships PDAL version 2.3.
When PDAL support is activated for OSGeo4W with a path to pdal-config, pdal-config is found, but GRASS complains that the PDAL library is not suitable Unable to locate suitable (>=1.7.1) PDAL library.

To Reproduce
See: https://github.com/ninsbl/grass/runs/3408602894?check_suite_focus=true

Expected behavior
It is important to have PDAL support on MS Windows too, so GRASS should be compiled with PDAL support on MS Windows as well.
Would be great to have that working for 8.0 but I set the 8.2 milestone. Feel free to change if feasible to get it into 8.0...

System description (please complete the following information):
GRASS OSGeo4W CI
GRASS GIS version 7.9 / 8.0 preview

Additional context
Here is how the PDAL packages for OSGeo4W are built:
https://github.com/jef-n/OSGeo4W/blob/master/src/pdal/osgeo4w/package.sh

@ninsbl ninsbl added bug Something isn't working windows Microsoft Windows specific labels Aug 24, 2021
@ninsbl ninsbl added this to the 8.2.0 milestone Aug 24, 2021
@marisn
Copy link
Contributor

marisn commented Aug 24, 2021

It just means compilation and linking to PDAL library has failed:

AC_MSG_ERROR([*** Unable to locate suitable (>=1.7.1) PDAL library.])

Actual error is visible in the configure.log file. Content of that file might help to shed some light into the issue. As usual – if Windows users need PDAL support in GRASS, one of Windows users must step up and fix the issue. I could look into the issue if a link to a VM image with suitable environment is provided.

@ninsbl
Copy link
Member Author

ninsbl commented Aug 24, 2021

Fair enough. Here: https://github.com/ninsbl/grass/runs/3412192862?check_suite_focus=true is at least the config.log

@marisn
Copy link
Contributor

marisn commented Aug 26, 2021

Could you, please, provide the output of following commands:
pdal-config --libs
pdal-config --cxxflags
pdal-config --includes
The error seems to be wrong compilation options coming out of pdal-config. Is PDAL compiled with MSVC?

g++ -o conftest.exe    -I/c/OSGeo4W/include /DWIN32 /D_WINDOWS /W3 /GR /EHsc -std=c++11 -I/c/OSGeo4W/include -I/c/OSGeo4W/include -I/c/OSGeo4W/include/libxml2 -I/c/OSGeo4W/include   -Wl,--export-dynamic,--enable-runtime-pseudo-reloc  -L/c/OSGeo4W/lib -L/c/OSGeo4W/bin conftest.C  -L/c/OSGeo4W/lib -lpdalcpp 1>&5
g++.exe: error: C:/msys64/DWIN32: No such file or directory
g++.exe: error: C:/msys64/D_WINDOWS: No such file or directory
g++.exe: error: C:/msys64/W3: No such file or directory
g++.exe: error: C:/msys64/GR: No such file or directory
g++.exe: error: C:/msys64/EHsc: No such file or directory

@ninsbl
Copy link
Member Author

ninsbl commented Aug 26, 2021

Thanks for bearing with me here, @marisn

The content for pdal-config in OSGeo4W is here:
https://gist.github.com/ninsbl/668db3cb3f1367d8f94c8b77c81f96e7

It seems that the returned cxxflags (/DWIN32 /D_WINDOWS /W3 /GR /EHsc -std=c++11) are CMake flags and do not work with g++. So I changed them - manually for now - to -DWIN32 -D_WINDOWS -std=c++11 No idea what g++ equivalents for
/W3 /GR /EHsc would be...

With that change first winsock2.h is not found, and after adding the location of winsock2.h to the includepath for c++ configuration proceeds a bit further, but then fails to find stdlib.hwhich definately is on the include path.

Latest configure log is here:
https://github.com/ninsbl/grass/runs/3429745293?check_suite_focus=true

And yes, I guess PDAL is compiled with MSVC. Here is the OSGeo4W build script:
https://github.com/jef-n/OSGeo4W/blob/master/src/pdal/osgeo4w/package.sh
which loads the vs2019env here:
https://github.com/jef-n/OSGeo4W/blob/master/scripts/build-helpers

@ninsbl
Copy link
Member Author

ninsbl commented Oct 10, 2021

This likely depends on: #348
See also:
jef-n/OSGeo4W#3

@wenzeslaus wenzeslaus modified the milestones: 8.2.0, 8.4.0 Mar 23, 2022
@HuidaeCho
Copy link
Member

Yes, unfortunately, OSGeo4W PDAL seems to be compiled with MSVC and there is no way to link against it using GCC.

configure:9427: x86_64-w64-mingw32-g++ -o conftest.exe -g -O2   -I/c/OSGeo4W/include -O2 -fPIC -std=c++11 -I/c/OSGeo4W/include -I/c/OSGeo4W/include -I/c/OSGeo4W/include/libxml2   -Wl,--export-dynamic,--enable-runtime-pseudo-reloc  -L/c/OSGeo4W/lib conftest.cpp  -L/c/OSGeo4W/bin -lpdalcpp >&5
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: warning: --export-dynamic is not supported for PE+ targets, did you mean --export-all-symbols?
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccxle6JS.o: in function `pdal::SimplePointTable::SimplePointTable(pdal::PointLayout&)':

Alternatively, using mingw-w64-x86_64-pdal seems to be overkill because it requires additional 108 packages, but if you really need it, you may try it.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows Microsoft Windows specific
Projects
None yet
Development

No branches or pull requests

4 participants