hello all,
I am trying to build Lidarview incl. GDAL, but the tag “-DPARAVIEW_ENABLE_GDAL=True” or “-DLIDARVIEW_ENABLE_GDAL=True” to build does not work. My system is a current Ubuntu 20.04.
I am new to building from source so I would appriciate your help.
Best regards,
Oliver
Hello,
GDAL is not currently a maintained part of LidarView’s dedicated superbuild, howerver it is part of Paraview’s Superbuild (See https://gitlab.kitware.com/paraview/paraview-superbuild) and could potentially be used in the same manner.
This has not been tested, but if you wish to experiment yourself do as follow:
- Add this file projects/gdal.cmake from ParaView’s Superbuild to LidarView’s Superbuild.
- Also add the corresponding patches to the LidarView’s patches directory.
- Add gdal to LidarView Superbuild’s top CMakeLists’ project list.
- Proceed with SuperBuild with Gdal enabled: “-DENABLE_gdal=ON”.
If you are unfamilliar with the Superbuild I recommend you study the following pieces of code or reach us out for professional support.
thank you very much for the quick reply. I’ll try it out
Hi,
I added the file, copied the patches to the src/Superbuild/lidarview-superbuild/Projects/patches folder and added the gdal dependency to the CMakeLists.txt file in the src/Superbuild/lidarview-superbuild folder. Now I get the following error:
[88/249] Performing build step for ‘gdal’
FAILED: lidarview-superbuild/common-superbuild/gdal/stamp/gdal-build /home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/stamp/gdal-build
cd /home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/build && /usr/local/bin/cmake -P /home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/sb-gdal-build.cmake && /usr/local/bin/cmake -E touch /home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/stamp/gdal-build
[1/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_atomic_ops.cpp.o
[2/369] Building CXX object port/CMakeFiles/cpl.dir/cplgetsymbol.cpp.o
[3/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_hash_set.cpp.o
[4/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_error.cpp.o
[5/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_list.cpp.o
[6/369] Building CXX object port/CMakeFiles/cpl.dir/cplstringlist.cpp.o
[7/369] Building CXX object port/CMakeFiles/cpl.dir/cplstring.cpp.o
[8/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_base64.cpp.o
[9/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_getexecpath.cpp.o
[10/369] Building CXX object alg/CMakeFiles/alg.dir/gdalproximity.cpp.o
[11/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_findfile.cpp.o
[12/369] Building CXX object port/CMakeFiles/cpl.dir/cplkeywordparser.cpp.o
[13/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_csv.cpp.o
[14/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_http.cpp.o
[15/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdalmajorobject.cpp.o
[16/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_multiproc.cpp.o
[17/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_strtod.cpp.o
[18/369] Building CXX object alg/CMakeFiles/alg.dir/gdalmediancut.cpp.o
[19/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_time.cpp.o
[20/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_conv.cpp.o
/home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/port/cpl_conv.cpp: In function ‘void* CPLRealloc(void*, size_t)’:
/home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/port/cpl_conv.cpp:208:65: warning: ‘ bytes.’ directive writing 7 bytes into a region of size between 2 and 20 [-Wformat-overflow=]
208 | “CPLRealloc(): Out of memory allocating %ld bytes.”,
| ^~~~~~~
In file included from /usr/include/stdio.h:867,
from /home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/port/cpl_port.h:143,
from /home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/port/cpl_conv.h:34,
from /home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/port/cpl_conv.cpp:32:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output between 48 and 66 bytes into a destination of size 60
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ~~~~~^
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/port/cpl_conv.cpp: In function ‘void* CPLMalloc(size_t)’:
/home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/port/cpl_conv.cpp:140:64: warning: ‘ bytes.’ directive writing 7 bytes into a region of size between 3 and 21 [-Wformat-overflow=]
140 | “CPLMalloc(): Out of memory allocating %ld bytes.”,
| ^~~~~~~
In file included from /usr/include/stdio.h:867,
from /home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/port/cpl_port.h:143,
from /home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/port/cpl_conv.h:34,
from /home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/port/cpl_conv.cpp:32:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output between 47 and 65 bytes into a destination of size 60
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ~~~~~^
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[21/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdaldriver.cpp.o
[22/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_recode.cpp.o
[23/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_quad_tree.cpp.o
[24/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdaldataset.cpp.o
[25/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_recode_stub.cpp.o
[26/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_path.cpp.o
[27/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_vsil_cache.cpp.o
[28/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_vsil_buffered_reader.cpp.o
[29/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_xml_validate.cpp.o
[30/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_vsil_curl.cpp.o
[31/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_minixml.cpp.o
[32/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_progress.cpp.o
[33/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_vsil_stdin.cpp.o
[34/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_string.cpp.o
[35/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_vsil_stdout.cpp.o
[36/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_spawn.cpp.o
[37/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_vsisimple.cpp.o
[38/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_minizip_ioapi.cpp.o
[39/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_vsil.cpp.o
[40/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_google_oauth2.cpp.o
[41/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_vsil_subfile.cpp.o
[42/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_recode_iconv.cpp.o
[43/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_vsil_sparsefile.cpp.o
[44/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_minizip_unzip.cpp.o
[45/369] Building CXX object gcore/CMakeFiles/gcore.dir/rasterio.cpp.o
[46/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_vsil_abstract_archive.cpp.o
[47/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_vsil_tar.cpp.o
[48/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdalrasterblock.cpp.o
[49/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_vsil_unix_stdio_64.cpp.o
[50/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdalallvalidmaskband.cpp.o
[51/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdalnodatamaskband.cpp.o
[52/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_vsi_mem.cpp.o
[53/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_minizip_zip.cpp.o
[54/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdalopeninfo.cpp.o
[55/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdalcolortable.cpp.o
[56/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdalnodatavaluesmaskband.cpp.o
[57/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdaldrivermanager.cpp.o
[58/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdalmultidomainmetadata.cpp.o
[59/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdaldllmain.cpp.o
[60/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdaldefaultasync.cpp.o
[61/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdalgmlcoverage.cpp.o
[62/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdalproxypool.cpp.o
[63/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdaldefaultoverviews.cpp.o
[64/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdalproxydataset.cpp.o
[65/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdalexif.cpp.o
[66/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdal_rpcimdio.cpp.o
[67/369] Building CXX object alg/CMakeFiles/alg.dir/gdalchecksum.cpp.o
[68/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdaljp2metadata.cpp.o
[69/369] Building CXX object port/CMakeFiles/cpl.dir/cpl_vsil_gzip.cpp.o
[70/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdaljp2box.cpp.o
[71/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdalpamrasterband.cpp.o
[72/369] Building CXX object alg/CMakeFiles/alg.dir/gdalcutline.cpp.o
[73/369] Building CXX object alg/CMakeFiles/alg.dir/gdalrasterfpolygonenumerator.cpp.o
[74/369] Building CXX object alg/CMakeFiles/alg.dir/gdalrasterpolygonenumerator.cpp.o
[75/369] Building CXX object alg/CMakeFiles/alg.dir/gdaldither.cpp.o
[76/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdalrasterband.cpp.o
[77/369] Building CXX object alg/CMakeFiles/alg.dir/contour.cpp.o
[78/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdalpamproxydb.cpp.o
[79/369] Building CXX object alg/CMakeFiles/alg.dir/fpolygonize.cpp.o
[80/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdalpamdataset.cpp.o
[81/369] Building CXX object alg/CMakeFiles/alg.dir/gdalsievefilter.cpp.o
[82/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdal_misc.cpp.o
[83/369] Building CXX object alg/CMakeFiles/alg.dir/gdalgrid.cpp.o
[84/369] Building CXX object alg/CMakeFiles/alg.dir/gdalgeoloc.cpp.o
[85/369] Building CXX object alg/CMakeFiles/alg.dir/gdalsimplewarp.cpp.o
[86/369] Building CXX object alg/CMakeFiles/alg.dir/llrasterize.cpp.o
[87/369] Building CXX object gcore/CMakeFiles/gcore.dir/overview.cpp.o
[88/369] Building CXX object alg/CMakeFiles/alg.dir/gdalrasterize.cpp.o
[89/369] Building CXX object alg/CMakeFiles/alg.dir/gdal_tps.cpp.o
[90/369] Building C object alg/CMakeFiles/alg.dir/gdal_crs.c.o
[91/369] Building CXX object alg/CMakeFiles/alg.dir/gdalwarper.cpp.o
[92/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdal_rat.cpp.o
[93/369] Building CXX object alg/CMakeFiles/alg.dir/thinplatespline.cpp.o
[94/369] Building CXX object alg/CMakeFiles/alg.dir/gdal_rpc.cpp.o
[95/369] Building CXX object alg/CMakeFiles/alg.dir/gdalwarpoperation.cpp.o
[96/369] Building CXX object ogr/CMakeFiles/ogr.dir/ogrct.cpp.o
FAILED: ogr/CMakeFiles/ogr.dir/ogrct.cpp.o
/usr/bin/c++ -DHAVE_EXPAT -DHAVE_GEOS=1 -DHAVE_LIBZ -DHAVE_PROJ -DHAVE_ZLIB -DHAVE_ZLIB_H -DOGR_ENABLED -DPROJ_STATIC -DSTRICT -DZIP_SUPPORT -I/home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/build -I/home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/port -I/home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/gcore -I/home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/ogr -I/home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/ogr/ogrsf_frmts -I/usr/capi -I/home/lidarstation/veloview/build2/install/include -fPIC -std=c++11 -fPIC -fno-strict-aliasing -O3 -DNDEBUG -std=gnu++11 -MD -MT ogr/CMakeFiles/ogr.dir/ogrct.cpp.o -MF ogr/CMakeFiles/ogr.dir/ogrct.cpp.o.d -o ogr/CMakeFiles/ogr.dir/ogrct.cpp.o -c /home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/ogr/ogrct.cpp
In file included from /home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/ogr/ogrct.cpp:38:
/usr/include/proj_api.h:37:2: error: #error ‘To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H’
37 | #error ‘To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H’
| ^~~~~
[97/369] Building CXX object alg/CMakeFiles/alg.dir/polygonize.cpp.o
[98/369] Building CXX object ogr/CMakeFiles/ogr.dir/ograssemblepolygon.cpp.o
[99/369] Building CXX object ogr/CMakeFiles/ogr.dir/ogrcurve.cpp.o
[100/369] Building CXX object alg/CMakeFiles/alg.dir/gdal_octave.cpp.o
[101/369] Building CXX object alg/CMakeFiles/alg.dir/gdaltransformer.cpp.o
[102/369] Building CXX object alg/CMakeFiles/alg.dir/rasterfill.cpp.o
[103/369] Building CXX object alg/CMakeFiles/alg.dir/gdal_simplesurf.cpp.o
[104/369] Building CXX object ogr/CMakeFiles/ogr.dir/ogrfielddefn.cpp.o
[105/369] Building CXX object ogr/CMakeFiles/ogr.dir/ogr2gmlgeometry.cpp.o
[106/369] Building CXX object ogr/CMakeFiles/ogr.dir/ogrgeomfielddefn.cpp.o
[107/369] Building CXX object ogr/CMakeFiles/ogr.dir/ogrfeaturedefn.cpp.o
[108/369] Building CXX object ogr/CMakeFiles/ogr.dir/ogrgeometry.cpp.o
[109/369] Building CXX object ogr/CMakeFiles/ogr.dir/gml2ogrgeometry.cpp.o
[110/369] Building CXX object ogr/CMakeFiles/ogr.dir/ogrfeaturestyle.cpp.o
[111/369] Building CXX object ogr/CMakeFiles/ogr.dir/ogrfeature.cpp.o
[112/369] Building CXX object alg/CMakeFiles/alg.dir/gdalwarpkernel.cpp.o
[113/369] Building CXX object gcore/CMakeFiles/gcore.dir/gdalclientserver.cpp.o
/home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/gcore/gdalclientserver.cpp: In function ‘void MyChdirRootDirectory()’:
/home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/gcore/gdalclientserver.cpp:388:10: warning: ignoring return value of ‘int chdir(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
388 | chdir("/");
| ~^
/home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/gcore/gdalclientserver.cpp: In function ‘void MyChdir(const char*)’:
/home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/gdal/src/gcore/gdalclientserver.cpp:375:10: warning: ignoring return value of ‘int chdir(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
375 | chdir(pszCWD);
| ~~~~^
ninja: build stopped: subcommand failed.
CMake Error at /home/lidarstation/veloview/build2/lidarview-superbuild/common-superbuild/sb-gdal-build.cmake:47 (message):
Failed with exit code 1
If I find a solution I will write it here, otherwise a big praise to the developers. The software runs really fast (using data from a HDL 64E S3).