diff --git a/HOWTORELEASE.txt b/HOWTORELEASE.txt index 77ae09603e..b65e1ea901 100644 --- a/HOWTORELEASE.txt +++ b/HOWTORELEASE.txt @@ -4,7 +4,7 @@ Steps for Making a PDAL Release :Author: Howard Butler :Contact: howard@hobu.co -:Date: 03/14/2017 +:Date: 05/31/2017 This document describes the process for releasing a new version of PDAL. @@ -31,9 +31,17 @@ Release Process - doc/quickstart.rst has a number of current-release references + - Make and push new release branch + + :: + + git branch 1.6-maintenance + git push origin 1.6-maintenance + + - Increment the doc build branch of .travis.yml: - "$TRAVIS_BRANCH" = "1.2-maintenance" + "$TRAVIS_BRANCH" = "1.6-maintenance" - Make DockerHub build entry for new release branch. @@ -51,6 +59,7 @@ Release Process ctest -V + 5) Clone a new tree and issue cmake. The package_source CMake target is aggressive about scooping up every file in the tree to include in the package. It does ok with CMake-specific stuff, but any other cruft in the tree is @@ -94,7 +103,43 @@ Release Process 11) Upload Python extension to PyPI -12) Publish JNI Bindings + :: + + cd python; python setup.py sdist upload + +12) Upload new OSGeo4W package to download.osgeo.org:/osgeo/download/osgeo4w/x86_64/release/pdal + + - Go to https://ci.appveyor.com/project/hobu/pdal + - Choose ``OSGEO4W_BUILD=ON`` build + - Scroll to very bottom + - Fetch tarball "OSGeo4W64 build will be uploaded to https://s3.amazonaws.com/pdal/osgeo4w/pdal-a4af2420b09725a4a0fff1ef277b1e6370c497d2.tar.bz2" + + - rename to match current release and set OSGeo4W build number to 1 + + :: + + mv pdal-a4af2420b09725a4a0fff1ef277b1e6370c497d2.tar.bz2 pdal-1.6.0-1.tar.bz2 + + - copy to OSGeo4W server + + :: + + scp pdal-1.6.0-1.tar.bz2 hobu@download.osgeo.org:/osgeo/download/osgeo4w/x86_64/release/pdal + + - refresh OSGeo4W + + :: + http://upload.osgeo.org/cgi-bin/osgeo4w-regen.sh + + + - promote release + + :: + + http://upload.osgeo.org/cgi-bin/osgeo4w-promote.sh + + +13) Publish JNI Bindings What you need: - an account on sonatype (https://issues.sonatype.org/secure/Signup!default.jspa) - ~/.sbt/0.13/sonatype.sbt file with the following content: diff --git a/appveyor.yml b/appveyor.yml index 908c9cb9cb..2344b45d95 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,27 +10,23 @@ matrix: fast_finish: true environment: - OSGEO4W_ROOT: C:\OSGeo4W64 + OSGEO4W_ROOT: C:\\OSGeo4W64 matrix: - PDAL_OPTIONAL_COMPONENTS: OFF - PDAL_OPTIONAL_COMPONENTS: ON + - OSGEO4W_BUILD: ON # Should speed up repository cloning shallow_clone: true clone_depth: 5 -# Uncomment if you need to debug AppVeyor session (https://www.appveyor.com/docs/how-to/rdp-to-build-worker) -# on_finish: -# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - -init: - - set PYTHONHOME=C:\Python27-x64 - - set PYTHONPATH=%PYTHONHOME%\Lib;%OSGEO4W_ROOT%\apps\Python27\lib\site-packages - - set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH% - - set PATH=%PYTHONHOME%;%PATH% - - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) +#init: +# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) +# on_finish: +# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + install: # make a temp directory for downloading osgeo4w-setup.exe # this may not matter as much if part of the install step, as pdal has @@ -43,8 +39,12 @@ install: # get the OSGeo installer - ps: (new-object net.webclient).DownloadFile("http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe", "C:\temp\osgeo4w-setup.exe") # and install our dependencies - - C:\temp\osgeo4w-setup.exe -q -k -r -A -s http://download.osgeo.org/osgeo4w/ -a x86_64 -P boost-devel,eigen,gdal,geos,hexer,iconv,laszip,libgeotiff,libpq,libtiff,libxml2,nitro,pcl,points2grid,proj,python-numpy,zlib -R %OSGEO4W_ROOT% > NUL + - C:\temp\osgeo4w-setup.exe -q -k -r -A -s http://download.osgeo.org/osgeo4w/ -a x86_64 -P eigen,gdal,geos,hexer,iconv,laszip,libgeotiff,libpq,libtiff,libxml2,msys,nitro,laz-perf,proj,zlib,python3-core,python3-devel,python3-numpy,oci,oci-devel -R %OSGEO4W_ROOT% > NUL # call our PDAL install script + - call %OSGEO4W_ROOT%\bin\o4w_env.bat + - call %OSGEO4W_ROOT%\bin\py3_env.bat + - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 + - set PATH=%PATH%;C:\Program Files (x86)\MSBuild\14.0\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\7-Zip;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Tools\GitVersion;C:\Program Files (x86)\CMake\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;C:\Program Files\AppVeyor\BuildAgent\ - call .\\scripts\\appveyor\\config.cmd build: @@ -53,22 +53,26 @@ build: verbosity: minimal after_build: - - 7z a pdal.zip %APPVEYOR_BUILD_FOLDER%\bin\*.* + - call %OSGEO4W_ROOT%\bin\o4w_env.bat + - set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH% + - set PATH=%PATH%;C:\Program Files (x86)\MSBuild\14.0\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\7-Zip;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Tools\GitVersion;C:\Program Files (x86)\CMake\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;C:\Program Files\AppVeyor\BuildAgent\ + - call .\\scripts\\appveyor\\install.cmd + test_script: # FIXME: Clear PATH to avoid OSGeo4W loading incompatible DLLs - set PATH= - - set PATH=%OSGEO4W_ROOT%\bin;C:\Program Files (x86)\MSBuild\14.0\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\7-Zip;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Python27;C:\Tools\GitVersion;C:\Program Files (x86)\CMake\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;C:\Program Files\AppVeyor\BuildAgent\ - - set PYTHONHOME=C:\Python27-x64 - - set PYTHONPATH=%PYTHONHOME%\Lib;%OSGEO4W_ROOT%\apps\Python27\lib\site-packages - - echo %PATH% - - set GDAL_DATA=%OSGEO4W_ROOT%\share\epsg_csv - - set PROJ_LIB=%OSGEO4W_ROOT%\share\proj + - set PATH=%OSGEO4W_ROOT%\bin;C:\Program Files (x86)\MSBuild\14.0\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\7-Zip;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Tools\GitVersion;C:\Program Files (x86)\CMake\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;C:\Program Files\AppVeyor\BuildAgent\ + - call %OSGEO4W_ROOT%\bin\o4w_env.bat + - call %OSGEO4W_ROOT%\bin\py3_env.bat + - set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH% + - set PATH=%PATH%;C:\Program Files (x86)\MSBuild\14.0\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\7-Zip;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Tools\GitVersion;C:\Program Files (x86)\CMake\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;C:\Program Files\AppVeyor\BuildAgent\ - ctest -V --output-on-failure -C Release artifacts: - - path: pdal.zip - name: pdalmaster + - path: pdal-$(APPVEYOR_REPO_COMMIT).tar.bz2 + name: pdalosgeo4w + type: file deploy: # Amazon S3 deployment provider settings @@ -79,7 +83,7 @@ deploy: secure: cSqZlsaCxFwXgxJw0BLd7npMFvQk3Vbr74ZPLaBQWLKnOz1cKss9qab1SzSygwkh bucket: "pdal" folder: "osgeo4w/" - artifact: pdalmaster + artifact: pdalosgeo4w set_public: true notifications: @@ -91,3 +95,5 @@ notifications: - provider: Slack incoming_webhook: secure: KxbDvaPmsvNmYpsp0TH3m3hJr7PqQL1sxR8xILBzaF2Lbku03M3mJ/h787TvDGQGX3IlyZtfTP0wvSRqMl4nMmdvDQZoAe8+Gyfc7BOkYIg= + + \ No newline at end of file diff --git a/cmake/examples/hobu-windows.bat b/cmake/examples/hobu-windows.bat index 830b79d296..c4cbabb6b7 100644 --- a/cmake/examples/hobu-windows.bat +++ b/cmake/examples/hobu-windows.bat @@ -7,8 +7,8 @@ :: Pick your CMake GENERATOR. (NMake will pick up architecture (x32, x64) from your environment) set GENERATOR="NMake Makefiles" -rem set GENERATOR="Visual Studio 10 Win64" -rem set GENERATOR="Visual Studio 10" +REM set GENERATOR="Ninja" +REM set GENERATOR="Visual Studio 14 Win64" :: Pick your build type set BUILD_TYPE=Release @@ -47,23 +47,26 @@ set ORACLE_INCLUDE_DIR=%ORACLE_HOME%\include set ORACLE_OCI_LIBRARY=%ORACLE_HOME%\lib\oci.lib :: LibXML2 -set LIBXML2_ENABLED=ON set LIBXML2_INCLUDE_DIR=%OSGEO4W_DIR%\include set LIBXML2_LIBRARIES=%OSGEO4W_DIR%\lib\libxml2.lib :: Python set PYTHON_ENABLED=ON -set PYTHON_EXECUTABLE=%OSGEO4W_DIR\bin\python27.exe -set PYTHON_INCLUDE_DIR=%OSGEO4W_DIR\apps\python27\include -set PYTHON_LIBRARY=%OSGEO4W_DIR\apps\python27\libs\python27.lib +set PYTHON_EXECUTABLE=%OSGEO4W_DIR\bin\python36.exe +set PYTHON_INCLUDE_DIR=%OSGEO4W_DIR\apps\python36\include +set PYTHON_LIBRARY=%OSGEO4W_DIR\apps\python36\libs\python36.lib +:: CURL +set CURL_INCLUDE_DIR=%OSGEO4W_DIR%\include +set CURL_LIBRARY=%OSGEO4W_DIR%\lib\libcurl.lib + if EXIST CMakeCache.txt del CMakeCache.txt -cmake -G "Visual Studio 14 2015 Win64" ^ +cmake -G %GENERATOR% ^ -DBUILD_PLUGIN_CPD=OFF ^ - -DBUILD_PLUGIN_GREYHOUND=OFF ^ + -DBUILD_PLUGIN_GREYHOUND=ON ^ -DBUILD_PLUGIN_HEXBIN=ON ^ -DBUILD_PLUGIN_ICEBRIDGE=OFF ^ -DBUILD_PLUGIN_MRSID=OFF ^ @@ -76,16 +79,20 @@ cmake -G "Visual Studio 14 2015 Win64" ^ -DBUILD_PLUGIN_PYTHON=ON ^ -DENABLE_CTEST=OFF ^ -DWITH_APPS=ON ^ - -DWITH_LAZPERF=c:\pdalbin\ ^ + -DWITH_LAZPERF=ON ^ + -DLazperf_DIR=c:\pdalbin\cmake ^ -DWITH_LASZIP=ON ^ -DWITH_TESTS=ON ^ - -DPYTHON_EXECUTABLE=%OSGEO4W_DIR%\bin\python.exe ^ - -DPYTHON_INCLUDE_DIR=%OSGEO4W_DIR%\apps\python27\include ^ - -DPYTHON_LIBRARY=%OSGEO4W_DIR%\apps\python27\libs\python27.lib ^ - -DNUMPY_INCLUDE_DIR=%OSGEO4W_DIR%\apps\python27\lib\site-packages\numpy\core\include ^ + -DPYTHON_EXECUTABLE=%OSGEO4W_DIR%\apps\python36\python.exe ^ + -DPYTHON_INCLUDE_DIR=%OSGEO4W_DIR%\apps\python36\include ^ + -DPYTHON_LIBRARY=%OSGEO4W_DIR%\apps\python36\libs\python36.lib ^ + -DPYTHON_DEBUG_LIBRARY=%OSGEO4W_DIR%\apps\python36\libs\python36.lib ^ + -DCURL_INCLUDE_DIR=%CURL_INCLUDE_DIR% ^ + -DCURL_LIBRARY=%CURL_LIBRARY% ^ + -DNUMPY_INCLUDE_DIR=%OSGEO4W_DIR%\apps\python36\lib\site-packages\numpy\core\include ^ -DNUMPY_VERSION=1.11.1 ^ -Dgtest_force_shared_crt=ON ^ - -DCMAKE_INSTALL_PREFIX=C:\pdalbin ^ + -DCMAKE_INSTALL_PREFIX=C:\projects\pdal\install ^ -DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^ -DCMAKE_VERBOSE_MAKEFILE=OFF ^ . diff --git a/cmake/modules/FindNumPy.cmake b/cmake/modules/FindNumPy.cmake index b663ba8795..0ad4be7e41 100644 --- a/cmake/modules/FindNumPy.cmake +++ b/cmake/modules/FindNumPy.cmake @@ -20,7 +20,7 @@ FIND_PACKAGE(PythonLibs QUIET REQUIRED) EXECUTE_PROCESS(COMMAND "${PYTHON_EXECUTABLE}" -c "import numpy; print (numpy.get_include()); print (numpy.version.version)" OUTPUT_VARIABLE NUMPY_OUTPUT ERROR_VARIABLE NUMPY_ERROR) - +message(STATUS "Numpy output: ${NUMPY_OUTPUT}") IF(NOT NUMPY_ERROR) STRING(REPLACE "\n" ";" NUMPY_OUTPUT ${NUMPY_OUTPUT}) LIST(GET NUMPY_OUTPUT 0 NUMPY_INCLUDE_DIR) diff --git a/pdal/Mesh.hpp b/pdal/Mesh.hpp index 41e1db4af0..389599751e 100644 --- a/pdal/Mesh.hpp +++ b/pdal/Mesh.hpp @@ -35,6 +35,7 @@ #pragma once #include +#include namespace pdal { @@ -58,6 +59,8 @@ class PDAL_DLL Mesh {}; + + /** A mesh where the faces are triangles. */ @@ -74,7 +77,11 @@ class PDAL_DLL TriangularMesh : public Mesh const Triangle& operator[](PointId id) const { return m_index[id]; } protected: +#ifdef PDAL_COMPILER_MSVC +#pragma warning(disable:4251)// [templated class] needs to have dll-interface... +#endif std::deque m_index; + }; } // namespace pdal diff --git a/pdal/plang/Redirector.hpp b/pdal/plang/Redirector.hpp index 40d1ed11ed..2a34dbada0 100644 --- a/pdal/plang/Redirector.hpp +++ b/pdal/plang/Redirector.hpp @@ -15,8 +15,10 @@ #ifdef PDAL_COMPILER_MSVC # pragma warning(disable: 4127) // conditional expression is constant +#ifndef HAVE_ROUND #define HAVE_ROUND // inconsistent dll linkage otherwise #endif +#endif #include diff --git a/plugins/geowave/io/GeoWaveReader.cpp b/plugins/geowave/io/GeoWaveReader.cpp index 7172bd7a45..d269ca78d4 100644 --- a/plugins/geowave/io/GeoWaveReader.cpp +++ b/plugins/geowave/io/GeoWaveReader.cpp @@ -129,6 +129,9 @@ using jace::proxy::mil::nga::giat::geowave::datastore::accumulo::AccumuloDataSto #include "jace/proxy/mil/nga/giat/geowave/datastore/accumulo/metadata/AccumuloAdapterStore.h" using jace::proxy::mil::nga::giat::geowave::datastore::accumulo::metadata::AccumuloAdapterStore; +namespace pdal +{ + static PluginInfo const s_info = PluginInfo( "readers.geowave", "\"GeoWave\" reader support. ", @@ -138,12 +141,10 @@ CREATE_SHARED_PLUGIN(1, 0, GeoWaveReader, Reader, s_info) std::string pdal::GeoWaveReader::getName() const { return s_info.name; } - #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) -namespace pdal -{ + void GeoWaveReader::addArgs(ProgramArgs& args) { args.add("zookeeper_url", "The comma-delimited URLs for all " diff --git a/plugins/geowave/io/GeoWaveWriter.cpp b/plugins/geowave/io/GeoWaveWriter.cpp index ad53a17da1..12f8bfb62d 100644 --- a/plugins/geowave/io/GeoWaveWriter.cpp +++ b/plugins/geowave/io/GeoWaveWriter.cpp @@ -34,6 +34,7 @@ #include "GeoWaveWriter.hpp" +#include #include #include @@ -135,6 +136,9 @@ using jace::proxy::mil::nga::giat::geowave::datastore::accumulo::AccumuloDataSto #include "jace/proxy/mil/nga/giat/geowave/datastore/accumulo/AccumuloIndexWriter.h" using jace::proxy::mil::nga::giat::geowave::datastore::accumulo::AccumuloIndexWriter; +namespace pdal +{ + static PluginInfo const s_info = PluginInfo( "writers.geowave", "Write data using GeoWave.", @@ -144,12 +148,9 @@ CREATE_SHARED_PLUGIN(1, 0, GeoWaveWriter, Writer, s_info) std::string pdal::GeoWaveWriter::getName() const { return s_info.name; } - #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) -namespace pdal -{ void GeoWaveWriter::addArgs(ProgramArgs& args) { args.add("zookeeper_url", "The comma-delimited URLs for all " @@ -162,7 +163,7 @@ namespace pdal "an Accumulo connector.", m_username).setPositional(); args.add("password", "The password for the account to establish " "an Accumulo connector.", m_password).setPositional(); - args.add("table_namespace", " "The table name to be used when " + args.add("table_namespace", "The table name to be used when " "interacting with GeoWave.", m_tableNamespace).setPositional(); args.add("feature_type_name", "The feature type name to be used " "when interacting with GeoWave.", m_featureTypeName, "PDAL_Point"); @@ -193,7 +194,7 @@ namespace pdal // get a list of all the dimensions & their types Dimension::IdList all = table.layout()->dims(); for (auto di = all.begin(); di != all.end(); ++di) - if (!contains(m_dims, *di)) + if (!Utils::contains(m_dims, *di)) m_dims.push_back(*di); } diff --git a/plugins/greyhound/CMakeLists.txt b/plugins/greyhound/CMakeLists.txt index 8d89bb8071..f0df7ce397 100644 --- a/plugins/greyhound/CMakeLists.txt +++ b/plugins/greyhound/CMakeLists.txt @@ -3,6 +3,9 @@ # add_definitions(-DHAVE_JSONCPP=1) +if (WIN32) +add_definitions("-DARBITER_DLL_IMPORT") +endif() PDAL_ADD_PLUGIN(libname reader greyhound FILES @@ -15,6 +18,7 @@ target_include_directories(${libname} PRIVATE ${PDAL_JSONCPP_INCLUDE_DIR} ${PDAL_VENDOR_DIR}) + if (WITH_TESTS) PDAL_ADD_TEST(greyhoundreadertest FILES diff --git a/plugins/greyhound/io/bounds.hpp b/plugins/greyhound/io/bounds.hpp index 97829bbfa5..6cdf163075 100644 --- a/plugins/greyhound/io/bounds.hpp +++ b/plugins/greyhound/io/bounds.hpp @@ -11,6 +11,7 @@ #include #include +#include #include @@ -22,7 +23,7 @@ namespace pdal namespace entwine { -class Bounds +class PDAL_DLL Bounds { public: Bounds() = default; @@ -279,11 +280,11 @@ class Bounds } }; -std::ostream& operator<<(std::ostream& os, const Bounds& bounds); +PDAL_DLL std::ostream& operator<<(std::ostream& os, const Bounds& bounds); // Orders Bounds by their midpoint. This is really only useful if the bounds // are arranged in a grid and are of equal size (like during a MetaQuery). -inline bool operator<(const Bounds& lhs, const Bounds& rhs) +PDAL_DLL inline bool operator<(const Bounds& lhs, const Bounds& rhs) { const auto& lhsMid(lhs.mid()); const auto& rhsMid(rhs.mid()); @@ -294,12 +295,12 @@ inline bool operator<(const Bounds& lhs, const Bounds& rhs) (lhsMid.x == rhsMid.x && lhsMid.y == rhsMid.y && lhsMid.z < rhsMid.z); } -inline bool operator==(const Bounds& lhs, const Bounds& rhs) +PDAL_DLL inline bool operator==(const Bounds& lhs, const Bounds& rhs) { return lhs.min() == rhs.min() && lhs.max() == rhs.max(); } -inline bool operator!=(const Bounds& lhs, const Bounds& rhs) +PDAL_DLL inline bool operator!=(const Bounds& lhs, const Bounds& rhs) { return !(lhs == rhs); } diff --git a/plugins/greyhound/io/point.hpp b/plugins/greyhound/io/point.hpp index b8d6ac9321..f6f3fc2556 100644 --- a/plugins/greyhound/io/point.hpp +++ b/plugins/greyhound/io/point.hpp @@ -17,6 +17,7 @@ #include #include +#include namespace pdal { @@ -25,7 +26,7 @@ namespace entwine using Transformation = std::vector; -class Point +class PDAL_DLL Point { public: Point() noexcept diff --git a/plugins/nitf/test/NitfReaderTest.cpp b/plugins/nitf/test/NitfReaderTest.cpp index 85ccde2f14..8d2976c0b9 100644 --- a/plugins/nitf/test/NitfReaderTest.cpp +++ b/plugins/nitf/test/NitfReaderTest.cpp @@ -138,6 +138,7 @@ TEST(NitfReaderTest, optionSrs) lasOpts.add("filename", outfile); LasWriter writer; + writer.setInput(*nitfReader); writer.setOptions(lasOpts);; diff --git a/plugins/sqlite/io/SQLiteCommon.hpp b/plugins/sqlite/io/SQLiteCommon.hpp index 36deff126e..1076ad847f 100644 --- a/plugins/sqlite/io/SQLiteCommon.hpp +++ b/plugins/sqlite/io/SQLiteCommon.hpp @@ -203,13 +203,17 @@ class SQLite checkSession(); m_log->get(LogLevel::Debug3) << "Executing '" << sql <<"'"<< std::endl; - - int status = sqlite3_exec(m_session, sql.c_str(), NULL, NULL, NULL); + char* errmsg; + int status = sqlite3_exec(m_session, sql.c_str(), NULL, NULL, &errmsg); if (status != SQLITE_OK) { std::ostringstream oss; - oss << "Database operation failed: " - << sql; + std::string msg = std::string(errmsg); + Utils::trimTrailing(msg); + oss << "Database operation failed: " + << "'" << sql << "'" + << " with error '" << msg << "'"; + sqlite3_free(errmsg); error(oss.str(), "execute"); } } @@ -453,12 +457,12 @@ class SQLite std::string so_extension; std::string lib_extension; #ifdef __APPLE__ - so_extension = "dylib"; + so_extension = ".dylib"; lib_extension = "mod_"; #endif #if defined(__linux__) || defined(__FreeBSD_kernel__) - so_extension = "so"; + so_extension = ".so"; #ifdef MOD_SPATIALITE lib_extension = "mod_"; #else @@ -467,8 +471,8 @@ class SQLite #endif #ifdef _WIN32 - so_extension = "dll"; - lib_extension = "mod_"; + so_extension = ".dll"; + lib_extension = "pdal"; #endif // #if !defined(sqlite3_enable_load_extension) @@ -480,15 +484,22 @@ class SQLite error("spatialite library load failed", "loadSpatialite"); } - std::ostringstream oss; + std::ostringstream oss; + + oss << "SELECT load_extension('"; if (module_name.size()) oss << module_name; else - oss << lib_extension << "spatialite"; - oss << "')"; - execute(oss.str()); + oss << lib_extension << "spatialite" << so_extension; +#ifdef _WIN32 + oss << "', 'sqlite3_modspatialite_init"; +#endif + oss << "')"; + + std::string sql(oss.str()); + execute(sql); oss.str(""); m_log->get(LogLevel::Debug3) << "SpatiaLite version: " << getSpatialiteVersion() << std::endl; diff --git a/scripts/appveyor/config.cmd b/scripts/appveyor/config.cmd index 0f97515f5e..c7036e6d03 100644 --- a/scripts/appveyor/config.cmd +++ b/scripts/appveyor/config.cmd @@ -1,27 +1,61 @@ @echo off +REM If OSGEO4W_BUILD is set, we build an OSGeo4W64 tarball package and +REM and install it to C:\pdalbin before letting AppVeyor upload it as +REM an artifact to S3. + +if "%OSGEO4W_BUILD%"=="ON" ( + +SET PDAL_OPTIONAL_COMPONENTS=ON +SET PDAL_PLUGIN_INSTALL_PATH="C:/OSGeo4W64/bin" +set PDAL_BUILD_TESTS=OFF + +) ELSE ( + +SET PDAL_PLUGIN_INSTALL_PATH="C:\pdalbin" +set PDAL_BUILD_TESTS=ON + +) + +REM needed or else CMake won't find the Oracle library that OSGeo4W installs + +SET ORACLE_HOME="C:/OSGEO4W64/" + cmake -G "Visual Studio 14 2015 Win64" ^ -DBUILD_PLUGIN_CPD=OFF ^ - -DBUILD_PLUGIN_GREYHOUND=OFF ^ - -DBUILD_PLUGIN_HEXBIN=OFF ^ + -DBUILD_PLUGIN_GREYHOUND=%PDAL_OPTIONAL_COMPONENTS% ^ + -DBUILD_PLUGIN_HEXBIN=%PDAL_OPTIONAL_COMPONENTS% ^ -DBUILD_PLUGIN_ICEBRIDGE=OFF ^ -DBUILD_PLUGIN_MRSID=OFF ^ - -DBUILD_PLUGIN_NITF=OFF ^ - -DBUILD_PLUGIN_OCI=OFF ^ + -DBUILD_PLUGIN_NITF=%PDAL_OPTIONAL_COMPONENTS% ^ + -DBUILD_PLUGIN_OCI=%PDAL_OPTIONAL_COMPONENTS% ^ -DBUILD_PLUGIN_PCL=OFF ^ - -DBUILD_PLUGIN_PGPOINTCLOUD=OFF ^ - -DBUILD_PLUGIN_SQLITE=OFF ^ + -DBUILD_PLUGIN_PGPOINTCLOUD=%PDAL_OPTIONAL_COMPONENTS% ^ + -DBUILD_PLUGIN_SQLITE=%PDAL_OPTIONAL_COMPONENTS% ^ -DBUILD_PLUGIN_RIVLIB=OFF ^ -DBUILD_PLUGIN_PYTHON=%PDAL_OPTIONAL_COMPONENTS% ^ -DENABLE_CTEST=OFF ^ - -DWITH_APPS=ON ^ - -DWITH_LAZPERF=%PDAL_OPTIONAL_COMPONENTS% ^ - -DWITH_LASZIP=%PDAL_OPTIONAL_COMPONENTS% ^ - -DWITH_PDAL_JNI=%OPTIONAL_COMPONENT_SWITCH% ^ - -DWITH_TESTS=ON ^ - -DNUMPY_INCLUDE_DIR=%OSGEO4W_ROOT%\apps\python27\lib\site-packages\numpy\core\include ^ - -DNUMPY_VERSION=1.8.1 ^ + -DWITH_LAZPERF=ON ^ + -DLazperf_DIR=%OSGEO4W_ROOT% ^ + -DWITH_LASZIP=ON ^ + -DWITH_TESTS=%PDAL_BUILD_TESTS% ^ + -DPDAL_PLUGIN_INSTALL_PATH=%PDAL_PLUGIN_INSTALL_PATH% ^ + -DGDAL_INCLUDE_DIR=%OSGEO4W_ROOT%/apps/gdal-dev/include ^ + -DGDAL_LIBRARY=%OSGEO4W_ROOT%/apps/gdal-dev/lib/gdal_i.lib ^ + -DPYTHON_EXECUTABLE=%OSGEO4W_ROOT%/apps/python36/python.exe ^ + -DPYTHON_INCLUDE_DIR=%OSGEO4W_ROOT%/apps/python36/include ^ + -DPYTHON_LIBRARY=%OSGEO4W_ROOT%/apps/python36/libs/python36.lib ^ + -DPYTHON_DEBUG_LIBRARY=%OSGEO4W_ROOT%/apps/python36/libs/python36.lib ^ + -DCURL_INCLUDE_DIR=%OSGEO4W_ROOT%/include ^ + -DCURL_LIBRARY=%OSGEO4W_ROOT%/lib/libcurl.lib ^ + -DNUMPY_INCLUDE_DIR=%OSGEO4W_ROOT%/apps/python36/lib/site-packages/numpy/core/include ^ + -DNUMPY_VERSION=1.12.0 ^ -Dgtest_force_shared_crt=ON ^ -DCMAKE_INSTALL_PREFIX=C:\pdalbin ^ -DCMAKE_VERBOSE_MAKEFILE=OFF ^ + -DBUILD_PGPOINTCLOUD_TESTS=OFF ^ + -DBUILD_SQLITE_TESTS=OFF ^ + -DBUILD_OCI_TESTS=OFF ^ . + + \ No newline at end of file diff --git a/scripts/appveyor/install.cmd b/scripts/appveyor/install.cmd index 239b599100..4630d81a29 100644 --- a/scripts/appveyor/install.cmd +++ b/scripts/appveyor/install.cmd @@ -1,3 +1,8 @@ @echo off -cmake --build . --target install +cmake --build . --target install --config Release +cd c:\pdalbin +dir +tar jcvf ..\pdal-%APPVEYOR_REPO_COMMIT%.tar.bz2 . +copy c:\pdal-%APPVEYOR_REPO_COMMIT%.tar.bz2 c:\projects\pdal +echo "OSGeo4W64 build will be uploaded to https://s3.amazonaws.com/pdal/osgeo4w/pdal-%APPVEYOR_REPO_COMMIT%.tar.bz2" diff --git a/scripts/docker/dependencies/Dockerfile b/scripts/docker/dependencies/Dockerfile index 31a7d743c4..2d4c69ddd7 100644 --- a/scripts/docker/dependencies/Dockerfile +++ b/scripts/docker/dependencies/Dockerfile @@ -271,7 +271,7 @@ RUN git clone --depth 1 --branch v0.4.6 https://github.com/gadomski/fgt.git \ && make install \ && rm -rf /fgt -RUN git clone --depth 1 --branch v0.5.0 https://github.com/gadomski/cpd.git \ +RUN git clone --depth 1 --branch v0.5.1 https://github.com/gadomski/cpd.git \ && cd cpd \ && cmake . \ -DWITH_TESTS=OFF \ diff --git a/scripts/osgeo4w/config.cmd b/scripts/osgeo4w/config.cmd new file mode 100644 index 0000000000..e43f102d47 --- /dev/null +++ b/scripts/osgeo4w/config.cmd @@ -0,0 +1,71 @@ +@echo off + +:: This configure script is designed for the default Windows world, which means +:: you have OSGeo4W installed, including Oracle and GDAL and LASzip. + +:: This configure script expects to be run from the PDAL root directory. + +:: Pick your CMake GENERATOR. (NMake will pick up architecture (x32, x64) from your environment) +REM set GENERATOR="Visual Studio 14 2015 Win64" +set GENERATOR="NMake Makefiles" +REM set GENERATOR="Ninja" +REM set GENERATOR="Visual Studio 14 Win64" + + +REM set BUILD_TYPE=Debug + +:: Where is your PDAL build tree? +set PDAL_DIR=%~dp0 + +:: Where is your OSGeo4W installed (recommended basic way to satisfy dependent libs) +set OSGEO4W_DIR=C:/OSGeo4W64 + + +if EXIST CMakeCache.txt del CMakeCache.txt +del /s /q CMakeFiles +del /s /q install + +cmake -G %GENERATOR% ^ + -DBUILD_PLUGIN_CPD=OFF ^ + -DBUILD_PLUGIN_GREYHOUND=ON ^ + -DBUILD_PLUGIN_HEXBIN=ON ^ + -DBUILD_PLUGIN_ICEBRIDGE=OFF ^ + -DBUILD_PLUGIN_MRSID=OFF ^ + -DBUILD_PLUGIN_NITF=ON ^ + -DBUILD_PLUGIN_OCI=ON ^ + -DBUILD_PLUGIN_PCL=OFF ^ + -DBUILD_PLUGIN_PGPOINTCLOUD=ON ^ + -DBUILD_PLUGIN_SQLITE=ON ^ + -DBUILD_PLUGIN_RIVLIB=OFF ^ + -DBUILD_PLUGIN_PYTHON=ON ^ + -DENABLE_CTEST=OFF ^ + -DWITH_LAZPERF=ON ^ + -DLazperf_DIR=%OSGEO4W_DIR% ^ + -DWITH_LASZIP=ON ^ + -DWITH_TESTS=ON ^ + -DPDAL_PLUGIN_INSTALL_PATH=C:/OSGeo4W64/bin ^ + -DGDAL_INCLUDE_DIR=%OSGEO4W_DIR%/apps/gdal-dev/include ^ + -DGDAL_LIBRARY=%OSGEO4W_DIR%/apps/gdal-dev/lib/gdal_i.lib ^ + -DPYTHON_EXECUTABLE=%OSGEO4W_DIR%/apps/python36/python.exe ^ + -DPYTHON_INCLUDE_DIR=%OSGEO4W_DIR%/apps/python36/include ^ + -DPYTHON_LIBRARY=%OSGEO4W_DIR%/apps/python36/libs/python36.lib ^ + -DPYTHON_DEBUG_LIBRARY=%OSGEO4W_DIR%/apps/python36/libs/python36.lib ^ + -DORACLE_INCLUDE_DIR=%OSGEO4W_DIR%/include ^ + -DORACLE_LIBRARY=%OSGEO4W_DIR%/lib/oci.lib ^ + -DCURL_INCLUDE_DIR=%OSGEO4W_DIR%/include ^ + -DCURL_LIBRARY=%OSGEO4W_DIR%/lib/libcurl.lib ^ + -DNUMPY_INCLUDE_DIR=%OSGEO4W_DIR%/apps/python36/lib/site-packages/numpy/core/include ^ + -DNUMPY_VERSION=1.12.0 ^ + -Dgtest_force_shared_crt=ON ^ + -DCMAKE_INSTALL_PREFIX=%PDAL_DIR%/install ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_VERBOSE_MAKEFILE=OFF ^ + . + +REM ninja +REM ninja install +REM set PATH=%PATH%;%OSGEO4W_DIR%/apps/msys/bin +REM cd %PDAL_DIR%\install +REM echo %cd% +REM %OSGEO4W_DIR%/apps/msys/bin/tar jcvf ../pdal-1.5.0-3.tar.bz2 . +REM cd %PDAL_DIR% diff --git a/vendor/arbiter/CMakeLists.txt b/vendor/arbiter/CMakeLists.txt index 576de24bae..c474076bdd 100644 --- a/vendor/arbiter/CMakeLists.txt +++ b/vendor/arbiter/CMakeLists.txt @@ -19,7 +19,11 @@ target_link_libraries(${PDAL_ARBITER_LIB_NAME} ) # Arbiter is built static but is included in a shared lib. # if (UNIX) -target_compile_options(${PDAL_ARBITER_LIB_NAME} PRIVATE "-fPIC") + target_compile_options(${PDAL_ARBITER_LIB_NAME} PRIVATE "-fPIC") +else() + set_target_properties(${PDAL_ARBITER_LIB_NAME} + PROPERTIES + COMPILE_DEFINITIONS ARBITER_DLL_EXPORT) endif() set_target_properties(${PDAL_ARBITER_LIB_NAME} PROPERTIES diff --git a/vendor/arbiter/arbiter.hpp b/vendor/arbiter/arbiter.hpp index 50bf7a6dc1..a67730dae2 100644 --- a/vendor/arbiter/arbiter.hpp +++ b/vendor/arbiter/arbiter.hpp @@ -346,13 +346,13 @@ namespace http /** Perform URI percent-encoding, without encoding characters included in * @p exclusions. */ -std::string sanitize(std::string path, std::string exclusions = "/"); +ARBITER_DLL std::string sanitize(std::string path, std::string exclusions = "/"); /** Build a query string from key-value pairs. If @p query is empty, the * result is an empty string. Otherwise, the result will start with the * '?' character. */ -std::string buildQueryString(const http::Query& query); +ARBITER_DLL std::string buildQueryString(const http::Query& query); /** @cond arbiter_internal */ @@ -876,7 +876,7 @@ namespace drivers * * Internal methods for derivers are provided as protected methods. */ -class Http : public Driver +class ARBITER_DLL Http : public Driver { public: Http(http::Pool& pool);