From 599247ef07076b828d14d3bfab803f57320cc170 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Tue, 10 Nov 2020 11:40:54 +0100 Subject: [PATCH] Add patches --- bcd-cuda.patch | 11 ++++++++ bcd-eigen3.patch | 14 ++++++++++ bcd-gcc.patch | 45 ++++++++++++++++++++++++++++++++ bcd-json.patch | 12 +++++++++ bcd-links.patch | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ bcd-nodeps.patch | 13 ++++++++++ 6 files changed, 162 insertions(+) create mode 100644 bcd-cuda.patch create mode 100644 bcd-eigen3.patch create mode 100644 bcd-gcc.patch create mode 100644 bcd-json.patch create mode 100644 bcd-links.patch create mode 100644 bcd-nodeps.patch diff --git a/bcd-cuda.patch b/bcd-cuda.patch new file mode 100644 index 0000000..06acbff --- /dev/null +++ b/bcd-cuda.patch @@ -0,0 +1,11 @@ +diff -up bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/CMakeLists.txt.cuda bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/CMakeLists.txt +--- bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/CMakeLists.txt.cuda 2020-11-07 09:54:42.794266240 +0100 ++++ bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/CMakeLists.txt 2020-11-07 09:55:28.803832009 +0100 +@@ -79,7 +79,6 @@ SET(header_implementation_files + + IF(CUDA_FOUND) + MESSAGE(STATUS "Using cuda's nvcc for generating ${target_name}") +- list(APPEND CUDA_NVCC_FLAGS "-arch=sm_20") + SET(src_files ${src_files} CudaHistogramDistance.cu) + SET(header_files + ${header_files} diff --git a/bcd-eigen3.patch b/bcd-eigen3.patch new file mode 100644 index 0000000..cabc49f --- /dev/null +++ b/bcd-eigen3.patch @@ -0,0 +1,14 @@ +diff -up bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/include/bcd/core/DenoisingUnit.h.includes bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/include/bcd/core/DenoisingUnit.h +--- bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/include/bcd/core/DenoisingUnit.h.includes 2018-06-10 17:18:29.000000000 +0200 ++++ bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/include/bcd/core/DenoisingUnit.h 2020-10-22 19:12:47.365101082 +0200 +@@ -18,8 +18,8 @@ + #include "Chronometer.h" + #endif + +-#include "Eigen/Eigenvalues" +-#include "Eigen/Dense" ++#include ++#include + + #include + #include diff --git a/bcd-gcc.patch b/bcd-gcc.patch new file mode 100644 index 0000000..04423c1 --- /dev/null +++ b/bcd-gcc.patch @@ -0,0 +1,45 @@ +diff -up bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/SpikeRemovalFilter.cpp.gcc bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/SpikeRemovalFilter.cpp +--- bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/SpikeRemovalFilter.cpp.gcc 2018-06-10 17:18:29.000000000 +0200 ++++ bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/SpikeRemovalFilter.cpp 2020-10-22 19:10:56.427193789 +0200 +@@ -6,6 +6,8 @@ + // All rights reserved. Use of this source code is governed by a + // BSD-style license that can be found in the LICENSE.txt file. + ++#include ++ + #include "SpikeRemovalFilter.h" + + #include "DeepImage.h" +diff -up bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/SamplesAccumulator.cpp.gcc bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/SamplesAccumulator.cpp +--- bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/SamplesAccumulator.cpp.gcc 2018-06-10 17:18:29.000000000 +0200 ++++ bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/SamplesAccumulator.cpp 2020-10-22 19:20:26.824525139 +0200 +@@ -9,6 +9,7 @@ + #include "SamplesAccumulator.h" + #include "CovarianceMatrix.h" + ++#include + + #include + +diff -up bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/SamplesAccumulator.cpp.gcc bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/SamplesAccumulator.cpp +--- bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/SamplesAccumulator.cpp.gcc 2020-10-22 19:21:45.980735052 +0200 ++++ bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/SamplesAccumulator.cpp 2020-10-22 19:24:18.627211457 +0200 +@@ -12,6 +12,7 @@ + #include + + #include ++#include + + using namespace std; + +diff -up bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/io/ParametersIO.cpp.gcc bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/io/ParametersIO.cpp +--- bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/io/ParametersIO.cpp.gcc 2018-06-10 17:18:29.000000000 +0200 ++++ bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/io/ParametersIO.cpp 2020-10-22 19:26:19.823001758 +0200 +@@ -13,6 +13,7 @@ + #include "json.hpp" + + #include ++#include + #include + + using namespace std; diff --git a/bcd-json.patch b/bcd-json.patch new file mode 100644 index 0000000..73ffca0 --- /dev/null +++ b/bcd-json.patch @@ -0,0 +1,12 @@ +diff -up bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/io/ParametersIO.cpp.json bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/io/ParametersIO.cpp +--- bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/io/ParametersIO.cpp.json 2020-11-07 09:56:06.600477009 +0100 ++++ bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/io/ParametersIO.cpp 2020-11-07 10:15:20.274749142 +0100 +@@ -10,7 +10,7 @@ + + #include "Utils.h" + +-#include "json.hpp" ++#include + + #include + #include diff --git a/bcd-links.patch b/bcd-links.patch new file mode 100644 index 0000000..90d7621 --- /dev/null +++ b/bcd-links.patch @@ -0,0 +1,67 @@ +diff -up bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/CMakeLists.txt.links bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/CMakeLists.txt +--- bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/CMakeLists.txt.links 2020-10-22 20:25:28.604816544 +0200 ++++ bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/CMakeLists.txt 2020-10-22 20:25:56.806537995 +0200 +@@ -87,10 +87,12 @@ IF(CUDA_FOUND) + ${bcd_core_include_folder}/CudaUtils.h + ) + CUDA_INCLUDE_DIRECTORIES(${bcd_core_include_folder}) # sadly, the TARGET_INCLUDE_DIRECTORIES a few lines below does not work with CUDA, see https://cmake.org/Bug/view.php?id=14201 +- CUDA_ADD_LIBRARY(${target_name} ${src_files} ${header_files} ${header_implementation_files} STATIC) ++ CUDA_ADD_LIBRARY(${target_name} ${src_files} ${header_files} ${header_implementation_files} SHARED) + TARGET_COMPILE_DEFINITIONS(${target_name} PRIVATE FOUND_CUDA) + ELSE(CUDA_FOUND) +- ADD_LIBRARY(${target_name} STATIC ${src_files} ${header_files} ${header_implementation_files}) ++ ADD_LIBRARY(${target_name} SHARED ${src_files} ${header_files} ${header_implementation_files}) ++ set_property(TARGET ${target_name} PROPERTY VERSION "0.0.0") ++ set_property(TARGET ${target_name} PROPERTY SOVERSION 0 ) + ENDIF(CUDA_FOUND) + + +diff -uNr bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/CMakeLists.txt bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b-orig/src/core/CMakeLists.txt +--- bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/CMakeLists.txt 2020-10-22 20:29:00.141727229 +0200 ++++ bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b-orig/src/core/CMakeLists.txt 2020-10-22 20:25:56.806537995 +0200 +@@ -100,7 +100,7 @@ + if (OPENMP_FOUND) + TARGET_LINK_LIBRARIES(${target_name} PUBLIC OpenMP) + endif (OPENMP_FOUND) +-TARGET_LINK_LIBRARIES(${target_name} PRIVATE eigen) ++#TARGET_LINK_LIBRARIES(${target_name} PRIVATE eigen3) + + INSTALL(TARGETS ${target_name} ARCHIVE DESTINATION lib) + +diff -uNr bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/io/CMakeLists.txt bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b-orig/src/io/CMakeLists.txt +--- bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/io/CMakeLists.txt 2018-06-10 17:18:29.000000000 +0200 ++++ bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b-orig/src/io/CMakeLists.txt 2020-10-22 20:24:37.680319508 +0200 +@@ -63,7 +63,10 @@ + SET(header_implementation_files + ) + +-ADD_LIBRARY(${target_name} STATIC ${src_files} ${header_files} ${header_implementation_files}) ++ADD_LIBRARY(${target_name} SHARED ${src_files} ${header_files} ${header_implementation_files}) ++TARGET_LINK_LIBRARIES(${target_name} PRIVATE ${OPENEXR_LDFLAGS} -lIlmImf -lImath -lHalf -lIex -lIexMath -lIlmThread ) ++set_property(TARGET ${target_name} PROPERTY VERSION "0.0.0") ++set_property(TARGET ${target_name} PROPERTY SOVERSION 0 ) + + + TARGET_INCLUDE_DIRECTORIES(${target_name} PUBLIC "${bcd_include_folder}/io") +@@ -72,8 +72,8 @@ + + SET_TARGET_PROPERTIES(${target_name} PROPERTIES CXX_STANDARD 11) + TARGET_LINK_LIBRARIES(${target_name} PUBLIC ${lib_bcd_core}) +-TARGET_LINK_LIBRARIES(${target_name} PRIVATE OpenExr) +-TARGET_LINK_LIBRARIES(${target_name} PRIVATE Json) ++TARGET_LINK_LIBRARIES(${target_name} PRIVATE ${OPENEXR_LDFLAGS}) ++TARGET_LINK_LIBRARIES(${target_name} PRIVATE ${JSONCPP_LDFLAGS}) + + INSTALL(TARGETS ${target_name} ARCHIVE DESTINATION lib) + +diff -up bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/CMakeLists.txt.links bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/CMakeLists.txt +--- bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/CMakeLists.txt.links 2020-10-22 21:40:35.896688115 +0200 ++++ bcd-d94c9fa77c11afe7d04670d92b3930c417e19f4b/src/core/CMakeLists.txt 2020-10-22 21:43:26.791883540 +0200 +@@ -104,6 +104,6 @@ TARGET_LINK_LIBRARIES(${target_name} PUB + endif (OPENMP_FOUND) + #TARGET_LINK_LIBRARIES(${target_name} PRIVATE eigen3) + +-INSTALL(TARGETS ${target_name} ARCHIVE DESTINATION lib) ++INSTALL(TARGETS ${target_name} ARCHIVE DESTINATION lib${LIB_SUFFIX}) + + diff --git a/bcd-nodeps.patch b/bcd-nodeps.patch new file mode 100644 index 0000000..797486c --- /dev/null +++ b/bcd-nodeps.patch @@ -0,0 +1,13 @@ +diff -up bcd/CMakeLists.txt.nodeps bcd/CMakeLists.txt +--- bcd/CMakeLists.txt.nodeps 2020-07-01 14:18:24.846606789 +0200 ++++ bcd/CMakeLists.txt 2020-07-06 10:30:19.701861866 +0200 +@@ -111,9 +111,6 @@ ENDIF(BCD_USE_CUDA) + SET(bcd_include_folder "${CMAKE_SOURCE_DIR}/include/bcd") + + +-#MESSAGE(STATUS "Entering subdirectory 'ext'") +-ADD_SUBDIRECTORY(ext) +- + #MESSAGE(STATUS "Entering subdirectory 'src'") + ADD_SUBDIRECTORY(src) +