Commit 6d289e8d authored by Baptiste Esteban's avatar Baptiste Esteban
Browse files

WIP Packaging clean

parent 3013e2cf
Pipeline #26538 failed with stages
in 4 minutes and 55 seconds
......@@ -75,11 +75,11 @@ class Pylene(ConanFile):
self.cpp_info.components["Pylene"].requires = ["range-v3::range-v3", "fmt::fmt", "tbb::tbb", "xsimd::xsimd"]
if self.options.fPIC and self.options.pylena_numpy:
self.cpp_info.components["pylena_numpy"].names["cmake_find_pakage"] = "pylena_numpy"
self.cpp_info.components["pylena_numpy"].names["cmake_find_pakage_multi"] = "pylena_numpy"
self.cpp_info.components["pylena_numpy"].libs = ["pylena_numpy"]
self.cpp_info.components["pylena_numpy"].requires = ["Pylene", "pybind11::pybind11"]
self.cpp_info.components["pylena_numpy"].includedirs = [os.path.join(self.package_folder, "include")]
self.cpp_info.components["Pylene-numpy"].names["cmake_find_pakage"] = "Pylene-numpy"
self.cpp_info.components["Pylene-numpy"].names["cmake_find_pakage_multi"] = "Pylena-numpy"
self.cpp_info.components["Pylene-numpy"].libs = ["Pylene-numpy"]
self.cpp_info.components["Pylene-numpy"].requires = ["Pylene", "pybind11::pybind11"]
self.cpp_info.components["Pylene-numpy"].includedirs = [os.path.join(self.package_folder, "include")]
v = tools.Version(self.settings.compiler.version)
for comp in self.cpp_info.components:
......
add_library(pylena_numpy)
target_include_directories(pylena_numpy PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${CONAN_INCLUDE_DIRS_PYBIND11} ${PYTHON_INCLUDE_DIRS})
target_sources(pylena_numpy PRIVATE src/core/image_cast.cpp
pybind11_find_import(numpy REQUIRED)
add_library(Pylena_numpy)
add_library(Pylene::Pylena_numpy ALIAS Pylena_numpy)
target_include_directories(Pylena_numpy PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${CONAN_INCLUDE_DIRS_PYBIND11} ${PYTHON_INCLUDE_DIRS})
target_sources(Pylena_numpy PRIVATE src/core/image_cast.cpp
src/core/numpy_format.cpp)
target_link_libraries(pylena_numpy PRIVATE Pylene)
target_link_libraries(Pylena_numpy PUBLIC Pylene)
pybind11_add_module(pylena)
target_link_libraries(pylena PRIVATE Pylene pylena_numpy)
target_link_libraries(pylena PRIVATE Pylene Pylena_numpy)
target_include_directories(pylena PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_sources(pylena PRIVATE src/module.cpp)
include(GNUInstallDirs)
install(TARGETS pylena_numpy
install(TARGETS Pylena_numpy
EXPORT PyleneTargets)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/pln/core/image_cast.hpp
......
pybind11_find_import(numpy REQUIRED)
# Python module for testing
pybind11_add_module(pylena_test pylena_test.cpp)
target_link_libraries(pylena_test PRIVATE Pylene pylena_numpy)
target_include_directories(pylena_test PRIVATE ${CMAKE_SOURCE_DIR}/pylene-python/include)
target_link_libraries(pylena_test PRIVATE Pylene Pylena_numpy)
add_dependencies(build-tests pylena_test)
# Dummy extension for testing
pybind11_add_module(pylena_extension extension_pylena_numpy.cpp)
target_link_libraries(pylena_extension PRIVATE Pylene pylena_numpy)
target_include_directories(pylena_extension PRIVATE ${CMAKE_SOURCE_DIR}/pylene-python/include)
target_link_libraries(pylena_extension PRIVATE Pylene Pylena_numpy)
add_dependencies(build-tests pylena_extension)
# Sanitizer (clang linked statically asan by default unlike gcc)
......
......@@ -14,13 +14,15 @@ namespace pln::test
/// \return A boolean indicating if the convertion worked
auto check_from_numpy(const mln::ndbuffer_image& img)
{
bool res = true;
res = res && img.sample_type() == mln::sample_type_id::INT32;
res = res && img.pdim() == 2;
res = res && img.size(0) == 3;
res = res && img.size(1) == 4;
res = res && img.byte_stride(0) == 4;
res = res && img.byte_stride(1) == 12;
bool res = true;
res = res && img.sample_type() == mln::sample_type_id::INT32;
res = res && img.pdim() == 2;
res = res && img.size(0) == 3;
res = res && img.size(1) == 4;
res = res && img.byte_stride(0) == 4;
res = res && img.byte_stride(1) == 12;
if (!res)
return false;
std::int32_t i = 0;
auto casted = img.__cast<std::int32_t, 2>();
mln_foreach (auto p, casted.domain())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment