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

Issue building on Ubuntu 20.04 #410

Closed erroneoustwain closed 4 years ago

erroneoustwain commented 4 years ago

Hi all,

I'm having problems compiling on Ubuntu 20.04. I've seen similar problems in multiple issues however I'm at a loss on how to proceed. All research points to issues with the gcc version and c++17, however my gcc version appears to be a much later version from when these issues were occurring. It's entirely possible it's something really simple and extremely obvious but any help would be greatly appreciated.

Scanning dependencies of target PotreeConverter
[  8%] Building CXX object PotreeConverter/CMakeFiles/PotreeConverter.dir/src/BINPointReader.cpp.o
In file included from /home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/include/BINPointReader.hpp:11,
                 from /home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/src/BINPointReader.cpp:8:
/home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/include/PointReader.h:11:21: error: ‘filesystem’ is not a namespace-name
   11 | namespace fs = std::filesystem;
      |                     ^~~~~~~~~~
In file included from /home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/src/BINPointReader.cpp:9:
/home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/include/stuff.h:38:21: error: ‘filesystem’ is not a namespace-name
   38 | namespace fs = std::filesystem;
      |                     ^~~~~~~~~~
/home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/include/stuff.h:96:15: error: ‘fs’ has not been declared
   96 |  bool copyDir(fs::path source, fs::path destination);
      |               ^~
/home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/include/stuff.h:96:32: error: ‘fs’ has not been declared
   96 |  bool copyDir(fs::path source, fs::path destination);
      |                                ^~
/home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/include/stuff.h:96:52: error: expression list treated as compound expression in initializer [-fpermissive]
   96 |  bool copyDir(fs::path source, fs::path destination);
      |                                                    ^
/home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/src/BINPointReader.cpp:11:21: error: ‘filesystem’ is not a namespace-name
   11 | namespace fs = std::filesystem;
      |                     ^~~~~~~~~~
/home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/src/BINPointReader.cpp: In constructor ‘Potree::BINPointReader::BINPointReader(std::string, Potree::AABB, double, Potree::PointAttributes)’:
/home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/src/BINPointReader.cpp:27:5: error: ‘fs’ has not been declared
   27 |  if(fs::is_directory(path)){
      |     ^~
/home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/src/BINPointReader.cpp:30:7: error: ‘fs’ has not been declared
   30 |   for(fs::directory_iterator it(path); it != fs::directory_iterator(); it++){
      |       ^~
/home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/src/BINPointReader.cpp:30:40: error: ‘it’ was not declared in this scope; did you mean ‘int’?
   30 |   for(fs::directory_iterator it(path); it != fs::directory_iterator(); it++){
      |                                        ^~
      |                                        int
/home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/src/BINPointReader.cpp:30:46: error: ‘fs’ has not been declared
   30 |   for(fs::directory_iterator it(path); it != fs::directory_iterator(); it++){
      |                                              ^~
/home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/src/BINPointReader.cpp:31:4: error: ‘fs’ has not been declared
   31 |    fs::path filepath = it->path();
      |    ^~
/home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/src/BINPointReader.cpp:32:7: error: ‘fs’ has not been declared
   32 |    if(fs::is_regular_file(filepath)){
      |       ^~
/home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/src/BINPointReader.cpp:32:27: error: ‘filepath’ was not declared in this scope
   32 |    if(fs::is_regular_file(filepath)){
      |                           ^~~~~~~~
/home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/src/BINPointReader.cpp: In member function ‘virtual bool Potree::BINPointReader::readNextPoint()’:
/home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/src/BINPointReader.cpp:182:5: error: ‘memcpy’ was not declared in this scope
  182 |     memcpy(target.data(), (buffer + offset), attribute.byteSize);
      |     ^~~~~~
/home/nathan/dev/workspaces/PotreeConverter/master/PotreeConverter/src/BINPointReader.cpp:10:1: note: ‘memcpy’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
    9 | #include "stuff.h"
  +++ |+#include <cstring>
   10 |
make[2]: *** [PotreeConverter/CMakeFiles/PotreeConverter.dir/build.make:63: PotreeConverter/CMakeFiles/PotreeConverter.dir/src/BINPointReader.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:94: PotreeConverter/CMakeFiles/PotreeConverter.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

My gcc version:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-10ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)
attilaolah commented 4 years ago

Should be fixed by #405.

erroneoustwain commented 4 years ago

Thanks for your reply. It seems to have fixed the problem.

I'm guessing that until the pull request is merged into the main repo, the process of building on Linux (Ubuntu 20.04 LTS in my case) would more accurately be described as:

cd ~/dev/workspaces/PotreeConverter
git clone https://github.com/potree/PotreeConverter.git master
cd master
git fetch origin pull/405/head:405
git checkout 405
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 ..
make

Thanks again for your help.

ghost commented 4 years ago

I have the same problem. I tried @erroneoustwain suggestion but still, on 'make' I get this: make[2]: No rule to make target '/root/LAStools/LASzip/build/src/liblaszip.so', needed by 'PotreeConverter/PotreeConverter'. Stop. make[1]: [CMakeFiles/Makefile2:91: PotreeConverter/CMakeFiles/PotreeConverter.dir/all] Error 2 make: *** [Makefile:130: all] Error 2

m-schuetz commented 4 years ago

Hi,

Closing this because PotreeConverer 1.7 is now replaced by a complete rewrite, PotreeConverter 2.0, and the old version will no longer be worked on. The requested feature or issue may not apply to PotreeConverter 2.0, either because it is fixed or the feature is not yet ported.

With respect to this issue, PotreeConverter 2.0 currently only has windows builds.