potree / PotreeConverter

Create multi res point cloud to use with potree
http://potree.org
BSD 2-Clause "Simplified" License
679 stars 423 forks source link

build fails on Centos 7 with gcc 4.8.5 #210

Closed straz closed 8 years ago

straz commented 8 years ago

I attempted to follow the build instructions ("linux / gcc 4.9" in README.md to build on CentOS 7:

cd ~/dev/workspaces/PotreeConverter
git clone https://github.com/potree/PotreeConverter.git master
cd master
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DLASZIP_INCLUDE_DIRS=~/dev/workspaces/lastools/master/LASzip/dll -DLASZIP_LIBRARY=~/dev/workspaces/lastools/master/LASzip/build/src/liblaszip.so ..

# copy ./PotreeConverter/resources/page_template to your binary working directory.

It seems this has a couple of problems: 1) gcc 4.8.5 does not recognize -std=c++14. It gives this error:
c++: error: unrecognized command line option ‘-std=c++14’
Apparently one workaround is to manually replace this with -std=c++1y in two files created by cmake. A better fix would be to have the cmake script be more careful to generate the correct option, in these two files:

PotreeConverter/CMakeFiles/PotreeConverter.dir/flags.make
PotreeConverter/CMakeFiles/PotreeConverter.dir/link.txt

2) ./PotreeConverter/resources/page_template seems to be missing after the cmake step. I assume that we're missing a call to make in these instructions

3) Calling make leads to a large number of errors, only some of which are included below. This seems like some kind of library dependency error that could presumably be caught by some dependency checks. Any suggestions?

[vagrant@localhost PotreeConverter]$ make
[  9%] Building CXX object PotreeConverter/CMakeFiles/PotreeConverter.dir/src/main.cpp.o
/home/vagrant/sync/potree/dev/workspaces/PotreeConverter/master/PotreeConverter/src/main.cpp: In function ‘void printArguments(Arguments&)’:
/home/vagrant/sync/potree/dev/workspaces/PotreeConverter/master/PotreeConverter/src/main.cpp:186:19: warning: unused variable ‘s’ [-Wunused-variable]
   for(const auto &s : a.source) {
                   ^
[ 18%] Building CXX object PotreeConverter/CMakeFiles/PotreeConverter.dir/src/stuff.cpp.o
[ 27%] Building CXX object PotreeConverter/CMakeFiles/PotreeConverter.dir/src/SparseGrid.cpp.o
[ 36%] Building CXX object PotreeConverter/CMakeFiles/PotreeConverter.dir/src/BINPointReader.cpp.o
[ 45%] Building CXX object PotreeConverter/CMakeFiles/PotreeConverter.dir/src/PointAttributes.cpp.o
[ 54%] Building CXX object PotreeConverter/CMakeFiles/PotreeConverter.dir/src/PotreeWriter.cpp.o
In file included from /home/vagrant/sync/potree/dev/workspaces/PotreeConverter/master/PotreeConverter/src/PotreeWriter.cpp:28:0:
/home/vagrant/sync/potree/dev/workspaces/PotreeConverter/master/PotreeConverter/include/PotreeWriter.h:40:21: warning: missing terminating ' character [enabled by default]
  int storeLimit = 20'000;
                     ^
/home/vagrant/sync/potree/dev/workspaces/PotreeConverter/master/PotreeConverter/include/PotreeWriter.h:40:2: error: missing terminating ' character
  int storeLimit = 20'000;
  ^
/home/vagrant/sync/potree/dev/workspaces/PotreeConverter/master/PotreeConverter/src/PotreeWriter.cpp:406:28: warning: multi-character character constant [-Wmultichar]
   if(aabb.size.length() > 1'000'000){
                            ^
/home/vagrant/sync/potree/dev/workspaces/PotreeConverter/master/PotreeConverter/src/PotreeWriter.cpp:458:22: warning: missing terminating ' character [enabled by default]
  if(store.size() > 10'000){
                      ^
/home/vagrant/sync/potree/dev/workspaces/PotreeConverter/master/PotreeConverter/src/PotreeWriter.cpp:458:2: error: missing terminating ' character
  if(store.size() > 10'000){
  ^
In file included from /home/vagrant/sync/potree/dev/workspaces/PotreeConverter/master/PotreeConverter/src/PotreeWriter.cpp:28:0:
/home/vagrant/sync/potree/dev/workspaces/PotreeConverter/master/PotreeConverter/include/PotreeWriter.h:41:2: error: expected ‘;’ before ‘vector’
  vector<Point> store;
  ^
/home/vagrant/sync/potree/dev/workspaces/PotreeConverter/master/PotreeConverter/src/PotreeWriter.cpp: In member function ‘void Potree::PWNode::loadFromDisk()’:
/home/vagrant/sync/potree/dev/workspaces/PotreeConverter/master/PotreeConverter/src/PotreeWriter.cpp:131:4: error: ‘store’ was not declared in this scope
    store.push_back(p);
    ^
cvvergara commented 8 years ago

c++ 4.8 -std=c++1y is not c++14

http://en.cppreference.com/w/cpp/language/integer_literal mentions:

Optional single quotes(') may be inserted between the digits as a separator. They are ignored by the compiler.  (since C++14)

c++14 starts with g++4.9 you need to install g++4.9

straz commented 8 years ago

OK, thanks. I cannot find a simple way (i.e. yum install ...) to install g++4.9 in CentOS 7. I'll switch to Ubuntu.