Building on Linux

559 views
Skip to first unread message

Neil Woodhouse

unread,
Mar 16, 2014, 10:17:33 AM3/16/14
to last...@googlegroups.com
Hey,

   I am one of those weird guys that does not use Windows at all and I wanted to build LASTools on Linux to be specific Ubuntu. I downloaded LAStools.zip and built it. I will say at the start it did get to the end, but there were lots of warnings and the final results mixed in the bin file with all of the windows executables. So my question why is this such a mess? With all of the warnings can I have confidence that the code will work? It would be nice if a test suite could be run after a build for validation.

  Here is a snippet at the end of the make process:

../LASlib/inc/lasdefinitions.hpp: In member function ‘void LASvlr_wave_packet_descr::setDigitizerOffset(F64)’:
../LASlib/inc/lasdefinitions.hpp:1152:68: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   inline void setDigitizerOffset(F64 offset) {((F64*)&(data[18]))[0] = offset;};
                                                                    ^
lasindex.cpp: In function ‘int main(int, char**)’:
lasindex.cpp:114:10: warning: variable ‘start_time’ set but not used [-Wunused-but-set-variable]
   double start_time = 0;
          ^
lasindex.cpp:125:71: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
     fprintf(stderr,"enter input file: "); fgets(file_name, 256, stdin);

Neil
   

Saulteau Don

unread,
Mar 16, 2014, 1:30:46 PM3/16/14
to last...@googlegroups.com
Compiling is full of "warnings". A majority of the time, they are safe to ignore.

Errors are what you got to look out for =) That's when the compilation actually fails.

So if you're compilation from source actually finished without errors, you should be good to go.

You can always test out the resulting lastool binaries (on Windows they're called executables) to see if they work when the compilation finishes too.
They can be tested from the source directory before you even run `make install` or whatever you're using to compile and install your packages.



Donovan


Martin Isenburg

unread,
Mar 17, 2014, 1:28:49 AM3/17/14
to LAStools - efficient command line tools for LIDAR processing
Hello Neil,

I always do a quick test compile on the one linux box that I have access to before I upload a new version. I agree that some simple testing of lasinfo, las2las, lasmerge, lasprecision, txt2las, las2txt, and laszip on the data in the lastools/data example folders would be a nice option to have. Maybe you can add a small patch to the Makefiles to do this that can be started via 'make unit' and contribute it back ... ?

See my compile below ...

Martin @rapidlasso

[ftp: isenburg/lastools] {55} % lsb_release -a
LSB Version:    :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: RedHatEnterpriseClient
Description:    Red Hat Enterprise Linux Client release 5.10 (Tikanga)
Release: 5.10
Codename: Tikanga

[ftp: isenburg/lastools] {56} % make
cd LASlib && make
make[1]: Entering directory `/afs/cs.unc.edu/home/isenburg/lastools/LASlib'
cd src && make
make[2]: Entering directory `/afs/cs.unc.edu/home/isenburg/lastools/LASlib/src'
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. ../../LASzip/src/laszip.cpp -o ../../LASzip/src/laszip.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. ../../LASzip/src/lasreadpoint.cpp -o ../../LASzip/src/lasreadpoint.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. ../../LASzip/src/lasreaditemcompressed_v1.cpp -o ../../LASzip/src/lasreaditemcompressed_v1.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. ../../LASzip/src/lasreaditemcompressed_v2.cpp -o ../../LASzip/src/lasreaditemcompressed_v2.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. ../../LASzip/src/laswritepoint.cpp -o ../../LASzip/src/laswritepoint.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. ../../LASzip/src/laswriteitemcompressed_v1.cpp -o ../../LASzip/src/laswriteitemcompressed_v1.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. ../../LASzip/src/laswriteitemcompressed_v2.cpp -o ../../LASzip/src/laswriteitemcompressed_v2.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. ../../LASzip/src/integercompressor.cpp -o ../../LASzip/src/integercompressor.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. ../../LASzip/src/arithmeticdecoder.cpp -o ../../LASzip/src/arithmeticdecoder.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. ../../LASzip/src/arithmeticencoder.cpp -o ../../LASzip/src/arithmeticencoder.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. ../../LASzip/src/arithmeticmodel.cpp -o ../../LASzip/src/arithmeticmodel.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasreader.cpp -o lasreader.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. laswriter.cpp -o laswriter.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasreader_las.cpp -o lasreader_las.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasreader_bin.cpp -o lasreader_bin.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasreader_qfit.cpp -o lasreader_qfit.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasreader_shp.cpp -o lasreader_shp.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasreader_asc.cpp -o lasreader_asc.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasreader_bil.cpp -o lasreader_bil.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasreader_dtm.cpp -o lasreader_dtm.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasreader_txt.cpp -o lasreader_txt.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasreadermerged.cpp -o lasreadermerged.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasreaderbuffered.cpp -o lasreaderbuffered.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasreaderpipeon.cpp -o lasreaderpipeon.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. laswriter_las.cpp -o laswriter_las.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. laswriter_bin.cpp -o laswriter_bin.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. laswriter_qfit.cpp -o laswriter_qfit.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. laswriter_wrl.cpp -o laswriter_wrl.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. laswriter_txt.cpp -o laswriter_txt.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. laswaveform13reader.cpp -o laswaveform13reader.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. laswaveform13writer.cpp -o laswaveform13writer.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasutility.cpp -o lasutility.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasinterval.cpp -o lasinterval.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasspatial.cpp -o lasspatial.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasquadtree.cpp -o lasquadtree.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasindex.cpp -o lasindex.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lasfilter.cpp -o lasfilter.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. lastransform.cpp -o lastransform.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG -DUNORDERED -I/usr/include/ -I../../LASzip/src -I../inc -I. fopen_compressed.cpp -o fopen_compressed.o
ar rc liblas.a ../../LASzip/src/laszip.o ../../LASzip/src/lasreadpoint.o ../../LASzip/src/lasreaditemcompressed_v1.o ../../LASzip/src/lasreaditemcompressed_v2.o ../../LASzip/src/laswritepoint.o  ../../LASzip/src/laswriteitemcompressed_v1.o ../../LASzip/src/laswriteitemcompressed_v2.o ../../LASzip/src/integercompressor.o ../../LASzip/src/arithmeticdecoder.o ../../LASzip/src/arithmeticencoder.o ../../LASzip/src/arithmeticmodel.o lasreader.o laswriter.o lasreader_las.o lasreader_bin.o lasreader_qfit.o lasreader_shp.o lasreader_asc.o lasreader_bil.o lasreader_dtm.o lasreader_txt.o lasreadermerged.o lasreaderbuffered.o lasreaderpipeon.o laswriter_las.o laswriter_bin.o laswriter_qfit.o laswriter_wrl.o laswriter_txt.o laswaveform13reader.o laswaveform13writer.o lasutility.o lasinterval.o lasspatial.o lasquadtree.o lasindex.o lasfilter.o lastransform.o fopen_compressed.o
cp -p liblas.a ../lib
make[2]: Leaving directory `/afs/cs.unc.edu/home/isenburg/lastools/LASlib/src'
cd example && make
make[2]: Entering directory `/afs/cs.unc.edu/home/isenburg/lastools/LASlib/example'
g++  -c -O3 -Wall -I/usr/include -I../../LASzip/src -I../inc lasexample.cpp -o lasexample.o
g++  -O3 -Wall lasexample.o -llas -o lasexample  -L../lib -I/usr/include -I../../LASzip/src -I../inc
make[2]: Leaving directory `/afs/cs.unc.edu/home/isenburg/lastools/LASlib/example'
make[1]: Leaving directory `/afs/cs.unc.edu/home/isenburg/lastools/LASlib'
cd LASzip && make
make[1]: Entering directory `/afs/cs.unc.edu/home/isenburg/lastools/LASzip'
cd example && make
make[2]: Entering directory `/afs/cs.unc.edu/home/isenburg/lastools/LASzip/example'
g++  -c -O3 -Wall -I/usr/include -I../src laszippertest.cpp -o laszippertest.o
g++  -O3 -Wall laszippertest.o ../src/laszip.o ../src/laszipper.o ../src/lasunzipper.o ../src/lasreadpoint.o ../src/lasreaditemcompressed_v1.o ../src/lasreaditemcompressed_v2.o ../src/laswritepoint.o  ../src/laswriteitemcompressed_v1.o ../src/laswriteitemcompressed_v2.o ../src/integercompressor.o ../src/arithmeticdecoder.o ../src/arithmeticencoder.o ../src/arithmeticmodel.o -o laszippertest   -I/usr/include -I../src
make[2]: Leaving directory `/afs/cs.unc.edu/home/isenburg/lastools/LASzip/example'
make[1]: Leaving directory `/afs/cs.unc.edu/home/isenburg/lastools/LASzip'
cd src && make
make[1]: Entering directory `/afs/cs.unc.edu/home/isenburg/lastools/src'
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG   -I../LASzip/src -I../LASlib/inc  laszip.cpp -o laszip.o
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG   -I../LASzip/src -I../LASlib/inc  geoprojectionconverter.cpp -o geoprojectionconverter.o
g++  -O3 -Wall -Wno-deprecated -DNDEBUG  laszip.o geoprojectionconverter.o -llas -o laszip  -L../LASlib/lib  -I../LASzip/src -I../LASlib/inc
cp laszip ../bin
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG   -I../LASzip/src -I../LASlib/inc  lasinfo.cpp -o lasinfo.o
g++  -O3 -Wall -Wno-deprecated -DNDEBUG  lasinfo.o -llas -o lasinfo  -L../LASlib/lib  -I../LASzip/src -I../LASlib/inc
cp lasinfo ../bin
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG   -I../LASzip/src -I../LASlib/inc  lasprecision.cpp -o lasprecision.o
g++  -O3 -Wall -Wno-deprecated -DNDEBUG  lasprecision.o geoprojectionconverter.o -llas -o lasprecision  -L../LASlib/lib  -I../LASzip/src -I../LASlib/inc
cp lasprecision ../bin
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG   -I../LASzip/src -I../LASlib/inc  las2txt.cpp -o las2txt.o
g++  -O3 -Wall -Wno-deprecated -DNDEBUG  las2txt.o -llas -o las2txt  -L../LASlib/lib  -I../LASzip/src -I../LASlib/inc
cp las2txt ../bin
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG   -I../LASzip/src -I../LASlib/inc  txt2las.cpp -o txt2las.o
g++  -O3 -Wall -Wno-deprecated -DNDEBUG  txt2las.o geoprojectionconverter.o -llas -o txt2las  -L../LASlib/lib  -I../LASzip/src -I../LASlib/inc
cp txt2las ../bin
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG   -I../LASzip/src -I../LASlib/inc  las2las.cpp -o las2las.o
g++  -O3 -Wall -Wno-deprecated -DNDEBUG  las2las.o geoprojectionconverter.o -llas -o las2las  -L../LASlib/lib  -I../LASzip/src -I../LASlib/inc
cp las2las ../bin
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG   -I../LASzip/src -I../LASlib/inc  lasdiff.cpp -o lasdiff.o
g++  -O3 -Wall -Wno-deprecated -DNDEBUG  lasdiff.o -llas -o lasdiff  -L../LASlib/lib  -I../LASzip/src -I../LASlib/inc
cp lasdiff ../bin
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG   -I../LASzip/src -I../LASlib/inc  lasmerge.cpp -o lasmerge.o
g++  -O3 -Wall -Wno-deprecated -DNDEBUG  lasmerge.o geoprojectionconverter.o -llas -o lasmerge  -L../LASlib/lib  -I../LASzip/src -I../LASlib/inc
cp lasmerge ../bin
g++  -c -O3 -Wall -Wno-deprecated -DNDEBUG   -I../LASzip/src -I../LASlib/inc  lasindex.cpp -o lasindex.o
g++  -O3 -Wall -Wno-deprecated -DNDEBUG  lasindex.o -llas -o lasindex  -L../LASlib/lib  -I../LASzip/src -I../LASlib/inc
cp lasindex ../bin
make[1]: Leaving directory `/afs/cs.unc.edu/home/isenburg/lastools/src'
[ftp: isenburg/lastools] {57} %


--

AW

unread,
Mar 18, 2014, 3:57:15 AM3/18/14
to last...@googlegroups.com
Hello,

as I am using Ubuntu as my main OS during work, I am highly interested in running LAStools natively on it. At the moment I have it running in a virtual win7 box. 
I have no real compiling experience, so if anybody could provide a short tutorial/hints (if it could be even described in a "short" tutorial ;) ) how that would work, I would be very thankful.

Andreas
Reply all
Reply to author
Forward
0 new messages