Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into azp
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Jul 8, 2019
2 parents 712810d + 3b8e723 commit 9a13101
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 6 deletions.
8 changes: 8 additions & 0 deletions apps/pdal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,14 @@ int App::execute(StringList& cmdArgs, LogPtr& log)
return ret;
}

// If we get here, all arguments should be consumed, if not, it's
// an error.
if (cmdArgs.size())
{
Utils::printError("Unexpected argument '" + cmdArgs[0] + "'.");
return -1;
}

if (m_showVersion)
outputVersion();
else if (m_showDrivers)
Expand Down
6 changes: 3 additions & 3 deletions pdal/util/Utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ namespace Utils
{

#if defined(__APPLE__) && defined(__MACH__)
const std::string dynamicLibExtension = ".dylib";
const char dynamicLibExtension[] = ".dylib";
const char dirSeparator = '/';
const char pathListSeparator = ':';
#elif defined _WIN32
const std::string dynamicLibExtension = ".dll";
const char dynamicLibExtension[] = ".dll";
const char dirSeparator = '\\';
const char pathListSeparator = ';';
#else
const std::string dynamicLibExtension = ".so";
const char dynamicLibExtension[] = ".so";
const char dirSeparator = '/';
const char pathListSeparator = ':';
#endif
Expand Down
2 changes: 2 additions & 0 deletions plugins/python/filters/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ PDAL_ADD_PLUGIN(python_libname filter python
SYSTEM_INCLUDES
${PYTHON_ALL_INCLUDE_DIRS}
)
target_compile_definitions(pdal_plugin_filter_python PRIVATE
PDAL_PYTHON_LIBRARY="${PYTHON_LIBRARY}")

if (WITH_TESTS)
PDAL_ADD_TEST(pdal_filters_python_test
Expand Down
2 changes: 2 additions & 0 deletions plugins/python/io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ PDAL_ADD_PLUGIN(numpy_reader reader numpy
SYSTEM_INCLUDES
${PYTHON_ALL_INCLUDE_DIRS}
)
target_compile_definitions(pdal_plugin_reader_numpy PRIVATE
PDAL_PYTHON_LIBRARY="${PYTHON_LIBRARY}")

# Install headers so Python extension
# can use them later
Expand Down
9 changes: 8 additions & 1 deletion plugins/python/plang/Environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@

#include "Environment.hpp"
#include "Redirector.hpp"

#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#define PY_ARRAY_UNIQUE_SYMBOL PDAL_ARRAY_API
#include <numpy/arrayobject.h>
#include <pdal/util/FileUtils.hpp>
#include <pdal/util/Utils.hpp>

#include <sstream>
Expand All @@ -66,8 +68,13 @@ static void loadPython()
std::string libname;

pdal::Utils::getenv("PDAL_PYTHON_LIBRARY", libname);

// PDAL_PYTHON_LIBRARY below is the result of the cmake FindPython script's
// PYTHON_LIBRARY.

if (libname.empty())
libname = "libPython" + pdal::Utils::dynamicLibExtension;
libname = PDAL_PYTHON_LIBRARY;
libname = pdal::FileUtils::getFilename(libname);
::dlopen(libname.data(), RTLD_LAZY | RTLD_GLOBAL);
}
#endif
Expand Down
4 changes: 3 additions & 1 deletion plugins/tiledb/io/TileDBWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ void TileDBWriter::ready(pdal::BasePointTable &table)

m_query.reset(new tiledb::Query(*m_ctx, *m_array));
m_query->set_layout(TILEDB_UNORDERED);
m_current_idx = 0;
}


Expand All @@ -289,7 +290,7 @@ bool TileDBWriter::processOne(PointRef& point)
double z = point.getFieldAs<double>(Dimension::Id::Z);

for (auto& a : m_attrs)
writeAttributeValue(a, point, m_cache_size);
writeAttributeValue(a, point, m_current_idx);

m_coords.push_back(x);
m_coords.push_back(y);
Expand Down Expand Up @@ -436,6 +437,7 @@ bool TileDBWriter::flushCache(size_t size)
}

m_current_idx = 0;
m_coords.clear();

if (status == tiledb::Query::Status::FAILED)
return false;
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/script.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/ash
#!/bin/ash -e
# Builds and tests PDAL

gcc --version
Expand Down

0 comments on commit 9a13101

Please sign in to comment.