From dbec7f96a21e83c820e87c30fdf6637404b65ce6 Mon Sep 17 00:00:00 2001 From: Tim Devereux Date: Fri, 17 Apr 2026 21:59:31 +0000 Subject: [PATCH 1/2] Migrate LAS/LAZ I/O from libLAS to LASzip C API Switches readLas/writeLas and LasWriter from libLAS to the laszip_api.h C API, adding LAS 1.4 support (formats 6-10 and 64-bit point counts) and replacing the legacy DataFormatId bit-mask checks for time/colour. Updates the build to find LASzip 3.x and drops libLAS from the devcontainer. --- .devcontainer/Dockerfile | 18 +-- .devcontainer/devcontainer.json | 3 +- CMakeLists.txt | 8 +- cmake/FindLASzip.cmake | 26 ++++ raylib/raylaz.cpp | 206 +++++++++++++++++++++----------- raylib/raylaz.h | 8 +- 6 files changed, 180 insertions(+), 89 deletions(-) create mode 100644 cmake/FindLASzip.cmake diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1ff8d3f7c..b73a1d999 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -26,26 +26,16 @@ RUN apt-get update && apt-get upgrade -y && \ libgtest-dev && \ rm -rf /var/lib/apt/lists/* -# Clone, build and clean up LASzip +# Clone, build and clean up LASzip (3.x supports LAS 1.4 via laszip_api.h C API) RUN git clone https://github.com/LASzip/LASzip.git && \ cd LASzip && \ - git checkout tags/2.0.1 && \ + git checkout tags/3.4.4 && \ mkdir build && cd build && \ cmake .. && \ make -j$(nproc) && \ make install && \ - cp bin/Release/liblas* /usr/lib/ && \ cd ../.. && rm -rf LASzip -# Clone, build and clean up libLAS -RUN git clone https://github.com/libLAS/libLAS.git && \ - cd libLAS && \ - mkdir build && cd build && \ - cmake .. -DWITH_LASZIP=ON -DWITH_GEOTIFF=OFF && \ - make -j$(nproc) && \ - make install && \ - cd ../.. && rm -rf libLAS - # Clone, build and clean up Qhull RUN git clone https://github.com/qhull/qhull.git && \ cd qhull && \ @@ -69,6 +59,10 @@ RUN git clone https://github.com/ethz-asl/libnabo.git && \ # Update ldconfig RUN ldconfig /usr/local/lib +# Copy build script into image +COPY .devcontainer/commands/compile_install.sh /usr/local/bin/compile_install.sh +RUN chmod +x /usr/local/bin/compile_install.sh + # Set the working directory WORKDIR /workspaces/raycloudtools diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index abc42ae37..1768d359c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -16,5 +16,6 @@ }, "remoteUser": "root", "forwardPorts": [], - "postCreateCommand": "chmod +x /workspaces/raycloudtools/.devcontainer/commands/compile_install.sh && /workspaces/raycloudtools/.devcontainer/commands/compile_install.sh" + "postCreateCommand": "compile_install.sh", + "runArgs": ["--security-opt", "label=disable"] } \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 520f2138f..a8d26b384 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ option(RAYCLOUD_BUILD_TESTS "Build unit tests?" OFF) option(RAYCLOUD_LEAK_TRACK "Enable memory leak tracking?" OFF) # WITH_ build options. -option(WITH_LAS "With liblas for las file support?" OFF) +option(WITH_LAS "With LASzip for las/laz file support (LAS 1.0-1.4)?" OFF) option(WITH_QHULL "With libqhull support?" OFF) option(WITH_TIFF "With libgeotiff support?" OFF) option(WITH_TBB "With Intel Threading Building Blocks support multi-threadding?" OFF) @@ -58,9 +58,9 @@ set(RAYTOOLS_LINK ${libnabo_LIBRARIES} OpenMP::OpenMP_CXX Threads::Threads) # Optionally configured packages. if(WITH_LAS) - find_package(libLAS REQUIRED) - list(APPEND RAYTOOLS_INCLUDE ${libLAS_INCLUDE_DIRS}) - list(APPEND RAYTOOLS_LINK ${libLAS_LIBRARIES}) + find_package(LASzip REQUIRED) + list(APPEND RAYTOOLS_INCLUDE ${LASzip_INCLUDE_DIRS}) + list(APPEND RAYTOOLS_LINK ${LASzip_LIBRARIES}) endif(WITH_LAS) if(WITH_QHULL) diff --git a/cmake/FindLASzip.cmake b/cmake/FindLASzip.cmake new file mode 100644 index 000000000..6bfa2f0df --- /dev/null +++ b/cmake/FindLASzip.cmake @@ -0,0 +1,26 @@ +# This module searches for the standalone LASzip library (3.x+, with LAS 1.4 support) +# and defines: +# LASzip_LIBRARIES - link libraries +# LASzip_INCLUDE_DIRS - include directories (contains laszip/laszip_api.h) +# LASzip_FOUND - true if found + +find_path(LASzip_INCLUDE_DIRS + NAMES laszip/laszip_api.h + HINTS ENV LASzip_ROOT + PATH_SUFFIXES include +) + +find_library(LASzip_LIBRARY + NAMES laszip + HINTS ENV LASzip_ROOT + PATH_SUFFIXES lib +) + +set(LASzip_LIBRARIES ${LASzip_LIBRARY}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LASzip + REQUIRED_VARS LASzip_LIBRARIES LASzip_INCLUDE_DIRS +) + +mark_as_advanced(LASzip_INCLUDE_DIRS LASzip_LIBRARIES LASzip_LIBRARY) diff --git a/raylib/raylaz.cpp b/raylib/raylaz.cpp index 46fa9e685..439c9ce75 100644 --- a/raylib/raylaz.cpp +++ b/raylib/raylaz.cpp @@ -9,8 +9,7 @@ #include "rayunused.h" #if RAYLIB_WITH_LAS -#include -#include +#include #endif // RAYLIB_WITH_LAS namespace ray @@ -24,36 +23,56 @@ bool readLas(const std::string &file_name, #if RAYLIB_WITH_LAS std::cout << "readLas: filename: " << file_name << std::endl; - std::ifstream ifs; - ifs.open(file_name.c_str(), std::ios::in | std::ios::binary); + laszip_POINTER reader; + if (laszip_create(&reader)) + { + std::cerr << "readLas: failed to create LASzip reader" << std::endl; + return false; + } - if (ifs.fail()) + laszip_BOOL is_compressed; + if (laszip_open_reader(reader, file_name.c_str(), &is_compressed)) { - std::cerr << "readLas: failed to open stream" << std::endl; + laszip_CHAR *error; + laszip_get_error(reader, &error); + std::cerr << "readLas: failed to open stream: " << error << std::endl; + laszip_destroy(reader); return false; } - liblas::ReaderFactory f; - liblas::Reader reader = f.CreateWithStream(ifs); - liblas::Header const &header = reader.GetHeader(); + laszip_header_struct *header; + laszip_get_header_pointer(reader, &header); - Eigen::Vector3d offset(header.GetOffsetX(), header.GetOffsetY(), header.GetOffsetZ()); + Eigen::Vector3d offset(header->x_offset, header->y_offset, header->z_offset); if (offset_to_remove) { *offset_to_remove = offset; std::cout << "offset to remove: " << offset.transpose() << std::endl; } - const size_t number_of_points = header.GetPointRecordsCount(); + // LAS 1.4 uses a 64-bit point count; legacy uses the 32-bit field + const size_t number_of_points = + (header->version_minor >= 4 && header->extended_number_of_point_records > 0) + ? static_cast(header->extended_number_of_point_records) + : static_cast(header->number_of_point_records); + + const uint8_t format = header->point_data_format; + // Formats 1,3,4,5 have GPS time in LAS 1.0-1.3; formats 6-10 always have GPS time (LAS 1.4) + const bool using_time = (format == 1 || format == 3 || format == 4 || format == 5 || format >= 6); + // Formats 2,3,5 have RGB in LAS 1.0-1.3; formats 7,8,10 have RGB in LAS 1.4 + const bool using_colour = (format == 2 || format == 3 || format == 5 || format == 7 || format == 8 || format == 10); - bool using_time = (header.GetDataFormatId() & 1) > 0; - bool using_colour = (header.GetDataFormatId() & 2) > 0; if (!using_time) { std::cerr << "No timestamps found on laz file, these are required" << std::endl; + laszip_close_reader(reader); + laszip_destroy(reader); return false; } + laszip_point_struct *point; + laszip_get_point_pointer(reader, &point); + ray::Progress progress; ray::ProgressThread progress_thread(progress); const size_t num_chunks = (number_of_points + (chunk_size - 1)) / chunk_size; @@ -72,31 +91,34 @@ bool readLas(const std::string &file_name, colours.reserve(chunk_size); num_bounded = 0; - for (unsigned int i = 0; i < number_of_points; i++) + for (size_t i = 0; i < number_of_points; i++) { - reader.ReadNextPoint(); - liblas::Point point = reader.GetPoint(); + if (laszip_read_point(reader)) + { + laszip_CHAR *error; + laszip_get_error(reader, &error); + std::cerr << "readLas: error reading point " << i << ": " << error << std::endl; + break; + } - Eigen::Vector3d position; - position[0] = point.GetX(); - position[1] = point.GetY(); - position[2] = point.GetZ(); + laszip_F64 coords[3]; + laszip_get_coordinates(reader, coords); + Eigen::Vector3d position(coords[0], coords[1], coords[2]); ends.push_back(position); starts.push_back(position); // equal to position for laz files, as we do not store the start points if (using_colour) { - liblas::Color colour = point.GetColor(); RGBA col; - col.red = static_cast(colour.GetRed()); - col.green = static_cast(colour.GetGreen()); - col.blue = static_cast(colour.GetBlue()); + col.red = static_cast(point->rgb[0]); + col.green = static_cast(point->rgb[1]); + col.blue = static_cast(point->rgb[2]); colours.push_back(col); } - times.push_back(point.GetTime()); + times.push_back(point->gps_time); - const double point_int = point.GetIntensity(); + const double point_int = point->intensity; const double normalised_intensity = (255.0 * point_int) / max_intensity; const uint8_t intensity = static_cast(std::min(normalised_intensity, 255.0)); if (intensity > 0) @@ -109,8 +131,8 @@ bool readLas(const std::string &file_name, { colourByTime(times, colours); } - for (int i = 0; i < (int)colours.size(); i++) // add intensity into alhpa channel - colours[i].alpha = intensities[i]; + for (size_t j = 0; j < colours.size(); j++) // add intensity into alpha channel + colours[j].alpha = intensities[j]; apply(starts, ends, times, colours); starts.clear(); ends.clear(); @@ -125,6 +147,9 @@ bool readLas(const std::string &file_name, progress_thread.requestQuit(); progress_thread.join(); + laszip_close_reader(reader); + laszip_destroy(reader); + std::cout << "loaded " << file_name << " with " << number_of_points << " points" << std::endl; return true; #else // RAYLIB_WITH_LAS @@ -144,12 +169,12 @@ bool readLas(std::string file_name, std::vector &positions, std { std::vector starts; // dummy as lax just reads in point clouds, not ray clouds auto apply = [&](std::vector &start_points, std::vector &end_points, - std::vector &time_points, std::vector &colour_values) + std::vector &time_points, std::vector &colour_values) { starts.insert(starts.end(), start_points.begin(), start_points.end()); positions.insert(positions.end(), end_points.begin(), end_points.end()); times.insert(times.end(), time_points.begin(), time_points.end()); - colours.insert(colours.end(), colour_values.begin(), colour_values.end()); + colours.insert(colours.end(), colour_values.begin(), colour_values.end()); }; size_t num_bounded; bool success = @@ -169,37 +194,56 @@ bool RAYLIB_EXPORT writeLas(std::string file_name, const std::vectorversion_major = 1; + header->version_minor = 2; + header->point_data_format = 1; // GPS time only + const double scale = 1e-4; + header->x_scale_factor = scale; + header->y_scale_factor = scale; + header->z_scale_factor = scale; + header->x_offset = 0.0; + header->y_offset = 0.0; + header->z_offset = 0.0; + header->number_of_point_records = static_cast(points.size()); + const bool is_laz = file_name.find(".laz") != std::string::npos; std::cout << "Saving points to " << file_name << std::endl; - std::ofstream ofs; - ofs.open(file_name.c_str(), std::ios::out | std::ios::binary); - if (ofs.fail()) + if (laszip_open_writer(writer, file_name.c_str(), is_laz ? 1 : 0)) { - std::cerr << "Error: cannot open " << file_name << " for writing." << std::endl; + laszip_CHAR *error; + laszip_get_error(writer, &error); + std::cerr << "writeLas: failed to open file for writing: " << error << std::endl; + laszip_destroy(writer); return false; } - const double scale = 1e-4; - header.SetScale(scale, scale, scale); + laszip_point_struct *point; + laszip_get_point_pointer(writer, &point); - liblas::Writer writer(ofs, header); - liblas::Point point(&header); - point.SetHeader(&header); // TODO HACK Version 1.7.0 does not correctly resize the data. Commit - // 6e8657336ba445fcec3c9e70c2ebcd2e25af40b9 (1.8.0 3 July fixes it) - for (unsigned int i = 0; i < points.size(); i++) + for (size_t i = 0; i < points.size(); i++) { - point.SetCoordinates(points[i][0], points[i][1], points[i][2]); - point.SetIntensity(colours[i].alpha); + laszip_F64 coords[3] = { points[i][0], points[i][1], points[i][2] }; + laszip_set_coordinates(writer, coords); + point->intensity = colours[i].alpha; if (!times.empty()) - point.SetTime(times[i]); - writer.WritePoint(point); + point->gps_time = times[i]; + laszip_write_point(writer); } + + laszip_update_inventory(writer); + laszip_close_writer(writer); + laszip_destroy(writer); return true; #else // RAYLIB_WITH_LAS RAYLIB_UNUSED(file_name); @@ -215,21 +259,44 @@ bool RAYLIB_EXPORT writeLas(std::string file_name, const std::vectorversion_major = 1; + header_->version_minor = 2; + header_->point_data_format = 1; // GPS time only + const double scale = 1e-4; + header_->x_scale_factor = scale; + header_->y_scale_factor = scale; + header_->z_scale_factor = scale; + header_->x_offset = 0.0; + header_->y_offset = 0.0; + header_->z_offset = 0.0; + + const bool is_laz = file_name_.find(".laz") != std::string::npos; std::cout << "Saving points to " << file_name_ << std::endl; - out_.open(file_name_.c_str(), std::ios::out | std::ios::binary); - if (out_.fail()) + + if (laszip_open_writer(writer_handle_, file_name_.c_str(), is_laz ? 1 : 0)) { - std::cerr << "Error: cannot open " << file_name << " for writing." << std::endl; + laszip_CHAR *error; + laszip_get_error(writer_handle_, &error); + std::cerr << "LasWriter: failed to open file for writing: " << error << std::endl; + laszip_destroy(writer_handle_); + writer_handle_ = nullptr; return; } - const double scale = 1e-4; - header_.SetScale(scale, scale, scale); - writer_ = new liblas::Writer(out_, header_); + + laszip_get_point_pointer(writer_handle_, &point_); } #else // RAYLIB_WITH_LAS LasWriter::LasWriter(const std::string &file_name) @@ -244,7 +311,12 @@ LasWriter::LasWriter(const std::string &file_name) LasWriter::~LasWriter() { #if RAYLIB_WITH_LAS - delete writer_; + if (writer_handle_) + { + laszip_update_inventory(writer_handle_); + laszip_close_writer(writer_handle_); + laszip_destroy(writer_handle_); + } #else std::cerr << "writeLas: cannot write file as WITHLAS not enabled. Enable using: cmake .. -DWITH_LAS=true" << std::endl; @@ -259,21 +331,19 @@ bool LasWriter::writeChunk(const std::vector &points, const std { return true; // this is acceptable behaviour. It avoids calling function checking for emptiness each time } - if (out_.fail()) + if (!writer_handle_ || !point_) { std::cerr << "Error: cannot open " << file_name_ << " for writing." << std::endl; return false; } - liblas::Point point(&header_); - point.SetHeader(&header_); // TODO HACK Version 1.7.0 does not correctly resize the data. Commit - // 6e8657336ba445fcec3c9e70c2ebcd2e25af40b9 (1.8.0 3 July fixes it) - for (unsigned int i = 0; i < points.size(); i++) + for (size_t i = 0; i < points.size(); i++) { - point.SetCoordinates(points[i][0], points[i][1], points[i][2]); - point.SetIntensity(colours[i].alpha); + laszip_F64 coords[3] = { points[i][0], points[i][1], points[i][2] }; + laszip_set_coordinates(writer_handle_, coords); + point_->intensity = colours[i].alpha; if (!times.empty()) - point.SetTime(times[i]); - writer_->WritePoint(point); + point_->gps_time = times[i]; + laszip_write_point(writer_handle_); } return true; #else // RAYLIB_WITH_LAS diff --git a/raylib/raylaz.h b/raylib/raylaz.h index 4562931da..e7b482607 100644 --- a/raylib/raylaz.h +++ b/raylib/raylaz.h @@ -10,7 +10,7 @@ #include "rayutils.h" #if RAYLIB_WITH_LAS -#include +#include #endif // RAYLIB_WITH_LAS @@ -48,10 +48,10 @@ class RAYLIB_EXPORT LasWriter private: const std::string &file_name_; - std::ofstream out_; #if RAYLIB_WITH_LAS - liblas::Header header_; - liblas::Writer *writer_; + laszip_POINTER writer_handle_; + laszip_header_struct *header_; + laszip_point_struct *point_; #endif // RAYLIB_WITH_LAS }; } // namespace ray From c21769b4a313fd8830346ec9cfedfeb7a18f146c Mon Sep 17 00:00:00 2001 From: Tim Devereux Date: Fri, 17 Apr 2026 22:34:35 +0000 Subject: [PATCH 2/2] Update docs and Docker for LASzip 3.x migration - README: replace libLAS + LASzip 2.0.1 build steps with a single LASzip 3.4.4 instruction, note LAS 1.4 / COPC support. - docker/Dockerfile: drop the libLAS build stage, bump LASzip to 3.4.4 and build it Release. - .devcontainer/Dockerfile: build LASzip in Release (unoptimized builds make LAZ decompression 5-15x slower). - Remove the now-unused cmake/FindlibLAS.cmake module. --- .devcontainer/Dockerfile | 2 +- README.md | 7 ++-- cmake/FindlibLAS.cmake | 85 ---------------------------------------- docker/Dockerfile | 16 ++------ 4 files changed, 7 insertions(+), 103 deletions(-) delete mode 100644 cmake/FindlibLAS.cmake diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b73a1d999..284c1afe6 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -31,7 +31,7 @@ RUN git clone https://github.com/LASzip/LASzip.git && \ cd LASzip && \ git checkout tags/3.4.4 && \ mkdir build && cd build && \ - cmake .. && \ + cmake .. -DCMAKE_BUILD_TYPE=Release && \ make -j$(nproc) && \ make install && \ cd ../.. && rm -rf LASzip diff --git a/README.md b/README.md index e6f47e80a..1b1401067 100644 --- a/README.md +++ b/README.md @@ -231,11 +231,10 @@ This gives an example of how the command line tools could be sequenced to analys *Optional build dependencies:* -For rayconvert to work from .laz files: -* git clone https://github.com/LASzip/LASzip.git, then git checkout tags/2.0.1, then mkdir build, cd build, cmake .., make, sudo make install. -* git clone https://github.com/libLAS/libLAS.git, then mkdir build, cd build, cmake .. -DWITH_LASZIP=ON, make, sudo make install (you'll need GEOTIFF to be off in libLAS, and to have installed boost) +For rayimport/rayexport to work with .las and .laz files (LAS 1.0 through 1.4, including COPC): +* git clone https://github.com/LASzip/LASzip.git, git checkout tags/3.4.4, then mkdir build, cd build, cmake .. -DCMAKE_BUILD_TYPE=Release, make, sudo make install. * in raycloudtools/build: cmake .. -DWITH_LAS=ON (or ccmake .. to turn on/off WITH_LAS) -* note that you may need to add the liblas path into LD_LIBRARY path, normally this can be done with the following line in your ~/.bashrc: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib +* note that you may need to add the LASzip install path into LD_LIBRARY_PATH, normally this can be done with the following line in your ~/.bashrc: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib For raywrap: diff --git a/cmake/FindlibLAS.cmake b/cmake/FindlibLAS.cmake deleted file mode 100644 index 5f6400ca4..000000000 --- a/cmake/FindlibLAS.cmake +++ /dev/null @@ -1,85 +0,0 @@ -# This module searches liblas and defines -# libLAS_LIBRARIES - link libraries -# libLAS_RUNTIME_LIBRARIES - runtime binaries (DLLs) -# libLAS_FOUND, if false, do not try to link -# libLAS_INCLUDE_DIR, libLAS_INCLUDE_DIRS, where to find the headers -# -# $libLAS_ROOT is an environment variable that would - -set(LL_HEADER liblas/liblas.hpp) -set(LL_HEADER_SUFFIX include) -set(LL_LIB liblas las) -set(LL_LIB_DEBUG) -set(LL_SHARED) -set(LL_SHARED_DEBUG) - -foreach(LLIB ${LL_LIB}) - list(APPEND LL_LIB_DEBUG ${LLIB}d) -endforeach(LLIB) - -foreach(LLIB ${LL_LIB}) - list(APPEND LL_SHARED ${LLIB}${CMAKE_SHARED_LIBRARY_SUFFIX}) -endforeach(LLIB) - -foreach(LLIB ${LL_LIB_DEBUG}) - list(APPEND LL_SHARED_DEBUG ${LLIB}${CMAKE_SHARED_LIBRARY_SUFFIX}) -endforeach(LLIB) - -# Target the C API if COMPONENTS specified as "capi" -if(libLAS_FIND_COMPONENTS STREQUAL "capi") - set(LL_HEADER liblas/capi/liblas.h) - set(LL_HEADER_SUFFIX include) - set(LL_LIB liblas_c las_c) -else(libLAS_FIND_COMPONENTS STREQUAL "capi") -endif(libLAS_FIND_COMPONENTS STREQUAL "capi") - -find_path(libLAS_INCLUDE_DIR ${LL_HEADER} HINTS ENV libLAS_ROOT PATH_SUFFIXES ${LL_HEADER_SUFFIX}) -set(libLAS_INCLUDE_DIRS ${libLAS_INCLUDE_DIR}) - -find_library(libLAS_LIBRARY_DEBUG NAMES ${LL_LIB_DEBUG} HINTS ENV libLAS_ROOT PATH_SUFFIXES lib) -find_library(libLAS_LIBRARY_RELEASE NAMES ${LL_LIB} HINTS ENV libLAS_ROOT PATH_SUFFIXES lib) - -find_file(libLAS_RUNTIME_DEBUG NAMES ${LL_SHARED_DEBUG} HINTS ENV libLAS_ROOT PATH_SUFFIXES bin) -find_file(libLAS_RUNTIME_RELEASE NAMES ${LL_SHARED} HINTS ENV libLAS_ROOT PATH_SUFFIXES bin) - -if(libLAS_LIBRARY_DEBUG) - list(APPEND libLAS_LIBRARIES debug ${libLAS_LIBRARY_DEBUG}) - if(libLAS_LIBRARY_RELEASE) - list(APPEND libLAS_LIBRARIES optimized ${libLAS_LIBRARY_RELEASE}) - endif(libLAS_LIBRARY_RELEASE) -else(libLAS_LIBRARY_DEBUG) - list(APPEND libLAS_LIBRARIES ${libLAS_LIBRARY_RELEASE}) -endif(libLAS_LIBRARY_DEBUG) - -if(libLAS_RUNTIME_DEBUG) - list(APPEND libLAS_RUNTIME_LIBRARIES debug ${libLAS_RUNTIME_DEBUG}) - if(libLAS_RUNTIME_RELEASE) - list(APPEND libLAS_RUNTIME_LIBRARIES optimized ${libLAS_RUNTIME_RELEASE}) - endif(libLAS_RUNTIME_RELEASE) -else(libLAS_RUNTIME_DEBUG) - list(APPEND libLAS_RUNTIME_LIBRARIES ${libLAS_RUNTIME_RELEASE}) -endif(libLAS_RUNTIME_DEBUG) - -if(libLAS_RUNTIME_DEBUG) - get_filename_component(RUNTIME_DIR "${libLAS_RUNTIME_DEBUG}" DIRECTORY) - list(APPEND libLAS_RUNTIME_DIRS "${RUNTIME_DIR}") -endif(libLAS_RUNTIME_DEBUG) -if(libLAS_RUNTIME_RELEASE) - get_filename_component(RUNTIME_DIR "${libLAS_RUNTIME_RELEASE}" DIRECTORY) - list(APPEND libLAS_RUNTIME_DIRS "${RUNTIME_DIR}") -endif(libLAS_RUNTIME_RELEASE) -if (libLAS_RUNTIME_DIRS) - list(REMOVE_DUPLICATES libLAS_RUNTIME_DIRS) -endif(libLAS_RUNTIME_DIRS) -set(libLAS_RUNTIME_DIRS "${libLAS_RUNTIME_DIRS}" CACHE PATH "LIBLAS runtime directories") - - -# handle the QUIETLY and REQUIRED arguments and set libLAS_FOUND to TRUE if -# all listed variables are TRUE -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(libLAS REQUIRED_VARS libLAS_LIBRARIES libLAS_INCLUDE_DIR) -if(libLAS_RUNTIME_LIBRARIES) - set(libLAS_RUNTIME_LIBRARIES ${libLAS_RUNTIME_LIBRARIES} CACHE PATH "LIBBLAS runtime libraries") -endif(libLAS_RUNTIME_LIBRARIES) - -mark_as_advanced(libLAS_INCLUDE_DIR libLAS_LIBRARIES libLAS_RUNTIME_LIBRARIES) diff --git a/docker/Dockerfile b/docker/Dockerfile index a27b4f0d7..0df8349c2 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -31,26 +31,16 @@ WORKDIR /deps RUN mkdir -p /deps && \ cd /deps -# Clone, build and clean up LASzip +# Clone, build and clean up LASzip (3.x supports LAS 1.4 via laszip_api.h C API) RUN git clone https://github.com/LASzip/LASzip.git && \ cd LASzip && \ - git checkout tags/2.0.1 && \ + git checkout tags/3.4.4 && \ mkdir build && cd build && \ - cmake .. && \ + cmake .. -DCMAKE_BUILD_TYPE=Release && \ make -j$(nproc) && \ make install && \ - cp bin/Release/liblas* /usr/lib/ && \ cd ../.. && rm -rf LASzip -# Clone, build and clean up libLAS -RUN git clone https://github.com/libLAS/libLAS.git && \ - cd libLAS && \ - mkdir build && cd build && \ - cmake .. -DWITH_LASZIP=ON -DWITH_GEOTIFF=OFF -DCMAKE_CXX_STANDARD=14 && \ - make -j$(nproc) && \ - make install && \ - cd ../.. && rm -rf libLAS - # Clone, build and clean up Qhull RUN git clone https://github.com/qhull/qhull.git && \ cd qhull && \