From 98d18c0ec5fcebca15bc530532963013cae05990 Mon Sep 17 00:00:00 2001 From: Jean-Marco Alameddine Date: Sat, 1 Apr 2023 15:32:17 +0200 Subject: [PATCH 01/10] add proposal version 7.5.1 and inverse order of versions --- recipes/proposal/all/conandata.yml | 75 ++++++++++++++++-------------- recipes/proposal/config.yml | 26 ++++++----- 2 files changed, 53 insertions(+), 48 deletions(-) diff --git a/recipes/proposal/all/conandata.yml b/recipes/proposal/all/conandata.yml index 8565075961d2c..0fd8a065192d9 100644 --- a/recipes/proposal/all/conandata.yml +++ b/recipes/proposal/all/conandata.yml @@ -1,40 +1,43 @@ sources: - "7.0.2": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.2.tar.gz" - sha256: "8166ffca150abce77cc4254343bb89d3476e17910e96fa4936b87dafcc72d592" - "7.0.4": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.4.tar.gz" - sha256: "1442b9f5d8824e7794e97a2eca3f5f109e33c423a37714ada9ad98435b4d4b01" - "7.0.5": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.5.tar.gz" - sha256: "232f84e410f439e6bc1b721fc65280906e9f6ad5b39490561870d42a1ee1af17" - "7.0.7": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.7.tar.gz" - sha256: "e366e9280fbe99e68bc5b31a74f51610e27ca8a646dff28e883573893572ab75" - "7.1.0": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.1.0.tar.gz" - sha256: "98faba7cd9d743dae2a8bec70b1c4a382339b9fa40b71fda2936c9d7054d7a85" - "7.1.1": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.1.1.tar.gz" - sha256: "090e885d6f241b87a98234571cc1bd2ff935933365717e327602ea37f4d3548a" - "7.2.1": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.2.1.tar.gz" - sha256: "279c1b897c8ae426a493ca77e01c8cfd47e8cd313f3e35ed3ddf098dcccdeeda" - "7.3.0": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.3.0.tar.gz" - sha256: "fa3763fee656164e5f3a7d6a11f08771dd70700adb93de9db4625ad981e0defb" - "7.3.1": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.3.1.tar.gz" - sha256: "260426f71226c888832a6da47c55c05dab31b8240dbbc67b4b2466af24d962d3" - "7.4.0": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.0.tar.gz" - sha256: "34865a84052c670fbc4554361acef716655906f65f5bba88e3fd73dff92989de" - "7.4.1": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.1.tar.gz" - sha256: "e6ff9749f402dd77f320a2a28b77a45636cbe186f926d9b5a7b54ea6ee631ada" - "7.4.2": - url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.2.tar.gz" - sha256: "f0db44c96a80a6ce3dda02c598574f5f0209376bd2c6c176797710da8eb3e108" + "7.5.1": + url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.5.1.tar.gz" + sha256: "2a283bfc335c4b6b01d2acc1eea1a5e4c456bd3dd11e41ef24ca3d955c9655a3" "7.5.0": url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.5.0.tar.gz" sha256: "ba31bd0a2337f3717a1ad88a3b3f7fefa3f1e4dae4fc922e72144cfecffe5e94" + "7.4.2": + url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.2.tar.gz" + sha256: "f0db44c96a80a6ce3dda02c598574f5f0209376bd2c6c176797710da8eb3e108" + "7.4.1": + url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.1.tar.gz" + sha256: "e6ff9749f402dd77f320a2a28b77a45636cbe186f926d9b5a7b54ea6ee631ada" + "7.4.0": + url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.4.0.tar.gz" + sha256: "34865a84052c670fbc4554361acef716655906f65f5bba88e3fd73dff92989de" + "7.3.1": + url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.3.1.tar.gz" + sha256: "260426f71226c888832a6da47c55c05dab31b8240dbbc67b4b2466af24d962d3" + "7.3.0": + url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.3.0.tar.gz" + sha256: "fa3763fee656164e5f3a7d6a11f08771dd70700adb93de9db4625ad981e0defb" + "7.2.1": + url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.2.1.tar.gz" + sha256: "279c1b897c8ae426a493ca77e01c8cfd47e8cd313f3e35ed3ddf098dcccdeeda" + "7.1.1": + url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.1.1.tar.gz" + sha256: "090e885d6f241b87a98234571cc1bd2ff935933365717e327602ea37f4d3548a" + "7.1.0": + url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.1.0.tar.gz" + sha256: "98faba7cd9d743dae2a8bec70b1c4a382339b9fa40b71fda2936c9d7054d7a85" + "7.0.7": + url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.7.tar.gz" + sha256: "e366e9280fbe99e68bc5b31a74f51610e27ca8a646dff28e883573893572ab75" + "7.0.5": + url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.5.tar.gz" + sha256: "232f84e410f439e6bc1b721fc65280906e9f6ad5b39490561870d42a1ee1af17" + "7.0.4": + url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.4.tar.gz" + sha256: "1442b9f5d8824e7794e97a2eca3f5f109e33c423a37714ada9ad98435b4d4b01" + "7.0.2": + url: "https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/7.0.2.tar.gz" + sha256: "8166ffca150abce77cc4254343bb89d3476e17910e96fa4936b87dafcc72d592" diff --git a/recipes/proposal/config.yml b/recipes/proposal/config.yml index a200f922017df..279c6cb19e836 100644 --- a/recipes/proposal/config.yml +++ b/recipes/proposal/config.yml @@ -1,27 +1,29 @@ versions: - "7.0.2": + "7.5.1": folder: all - "7.0.4": + "7.5.0": folder: all - "7.0.5": + "7.4.2": folder: all - "7.0.7": + "7.4.1": folder: all - "7.1.0": + "7.4.0": folder: all - "7.1.1": + "7.3.1": + folder: all + "7.3.0": folder: all "7.2.1": folder: all - "7.3.0": + "7.1.1": folder: all - "7.3.1": + "7.1.0": folder: all - "7.4.0": + "7.0.7": folder: all - "7.4.1": + "7.0.5": folder: all - "7.4.2": + "7.0.4": folder: all - "7.5.0": + "7.0.2": folder: all From e0bfd1b335014782ffd60b20a735940166cff061 Mon Sep 17 00:00:00 2001 From: Jean-Marco Alameddine Date: Sat, 1 Apr 2023 20:18:44 +0200 Subject: [PATCH 02/10] update proposal package for conan2 --- recipes/proposal/all/conanfile.py | 44 +++++++++---------- .../proposal/all/test_package/CMakeLists.txt | 3 -- .../proposal/all/test_package/conanfile.py | 20 ++++++--- .../all/test_v1_package/CMakeLists.txt | 11 +++++ .../proposal/all/test_v1_package/conanfile.py | 17 +++++++ .../all/test_v1_package/test_package.cpp | 21 +++++++++ 6 files changed, 85 insertions(+), 31 deletions(-) create mode 100644 recipes/proposal/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/proposal/all/test_v1_package/conanfile.py create mode 100644 recipes/proposal/all/test_v1_package/test_package.cpp diff --git a/recipes/proposal/all/conanfile.py b/recipes/proposal/all/conanfile.py index ee6b6552ac5bc..50b62530f3a95 100644 --- a/recipes/proposal/all/conanfile.py +++ b/recipes/proposal/all/conanfile.py @@ -1,6 +1,10 @@ -from conans import ConanFile, CMake, tools -from conans.errors import ConanInvalidConfiguration import os +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.files import get, rmdir, copy +from conan.tools.cmake import CMake, CMakeToolchain +from conan.errors import ConanInvalidConfiguration +from conan.tools.scm import Version required_conan_version = ">=1.43.0" @@ -26,8 +30,7 @@ class PROPOSALConan(ConanFile): "with_python": False, } - generators = "cmake", "cmake_find_package" - _cmake = None + generators = "CMakeDeps" @property def _source_subfolder(self): @@ -62,7 +65,7 @@ def validate(self): "Can not build shared library on Visual Studio." ) if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, "14") + check_min_cppstd(self, "14") minimum_version = self._minimum_compilers_version.get( str(self.settings.compiler), False @@ -71,34 +74,31 @@ def validate(self): self.output.warn( "PROPOSAL requires C++14. Your compiler is unknown. Assuming it supports C++14." ) - elif tools.Version(self.settings.compiler.version) < minimum_version: + elif Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( "PROPOSAL requires gcc >= 5, clang >= 5 or Visual Studio >= 15 as a compiler!" ) def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.definitions["BUILD_PYTHON"] = self.options.with_python - self._cmake.definitions["BUILD_DOCUMENTATION"] = False - self._cmake.configure() - return self._cmake + get(self, **self.conan_data["sources"][self.version], strip_root=True) def build(self): - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE.md", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def generate(self): + tc = CMakeToolchain(self) + tc.cache_variables["BUILD_TESTING"] = False + tc.cache_variables["BUILD_PYTHON"] = self.options.with_python + tc.cache_variables["BUILD_DOCUMENTATION"] = False + tc.generate() def package_info(self): self.cpp_info.set_property("cmake_file_name", "PROPOSAL") diff --git a/recipes/proposal/all/test_package/CMakeLists.txt b/recipes/proposal/all/test_package/CMakeLists.txt index 705e044c0e357..21e3612eb1487 100644 --- a/recipes/proposal/all/test_package/CMakeLists.txt +++ b/recipes/proposal/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required(VERSION 3.1) project(test_package CXX) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(PROPOSAL REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) diff --git a/recipes/proposal/all/test_package/conanfile.py b/recipes/proposal/all/test_package/conanfile.py index 38f4483872d47..cacc1e49c2b49 100644 --- a/recipes/proposal/all/test_package/conanfile.py +++ b/recipes/proposal/all/test_package/conanfile.py @@ -1,10 +1,18 @@ -from conans import ConanFile, CMake, tools import os - +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + requires = "spdlog/1.9.2" # TODO: not sure why this is explicitly necessary, but it fails without it + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +20,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") \ No newline at end of file diff --git a/recipes/proposal/all/test_v1_package/CMakeLists.txt b/recipes/proposal/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..705e044c0e357 --- /dev/null +++ b/recipes/proposal/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(PROPOSAL REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PROPOSAL::PROPOSAL) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) diff --git a/recipes/proposal/all/test_v1_package/conanfile.py b/recipes/proposal/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..38f4483872d47 --- /dev/null +++ b/recipes/proposal/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/proposal/all/test_v1_package/test_package.cpp b/recipes/proposal/all/test_v1_package/test_package.cpp new file mode 100644 index 0000000000000..da2ad7c9c7773 --- /dev/null +++ b/recipes/proposal/all/test_v1_package/test_package.cpp @@ -0,0 +1,21 @@ +#include "PROPOSAL/PROPOSAL.h" +#include +#include + +int main() +{ + auto particle = PROPOSAL::MuMinusDef(); + auto target = PROPOSAL::Ice(); + auto cut = std::make_shared(500, 0.05, false); + auto cross = PROPOSAL::GetStdCrossSections(particle, target, cut, false); + + auto energy = 1e4; + for (auto c : cross) { + auto type = c->GetInteractionType(); + auto name = PROPOSAL::Type_Interaction_Name_Map.at(type); + auto dEdx = c->CalculatedEdx(energy); + std::cout << "The " << name << " average loss for a " << energy << " MeV " + << particle.name << " in " << target.GetName() + << " is: " << dEdx << " MeV * cm^2 / g" << std::endl; + } +} From fb12d8a73eb10dedee66ce9dc0d7c106766db04e Mon Sep 17 00:00:00 2001 From: Jean-Marco Alameddine Date: Sat, 1 Apr 2023 21:18:59 +0200 Subject: [PATCH 03/10] fix hook errors --- recipes/proposal/all/test_package/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/proposal/all/test_package/conanfile.py b/recipes/proposal/all/test_package/conanfile.py index cacc1e49c2b49..daa7bdee4ae46 100644 --- a/recipes/proposal/all/test_package/conanfile.py +++ b/recipes/proposal/all/test_package/conanfile.py @@ -22,4 +22,4 @@ def build(self): def test(self): if can_run(self): bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") - self.run(bin_path, env="conanrun") \ No newline at end of file + self.run(bin_path, env="conanrun") From 59e717e4b39b87c83f5873040939fe89cba08785 Mon Sep 17 00:00:00 2001 From: Jean-Marco Alameddine Date: Sat, 1 Apr 2023 23:08:16 +0200 Subject: [PATCH 04/10] fix wrong license path --- recipes/proposal/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/proposal/all/conanfile.py b/recipes/proposal/all/conanfile.py index 50b62530f3a95..6a6fe70b24d49 100644 --- a/recipes/proposal/all/conanfile.py +++ b/recipes/proposal/all/conanfile.py @@ -88,7 +88,7 @@ def build(self): cmake.build() def package(self): - copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE.md", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) From c00a2cab1c588e32dce345f8c50f48e94d870e14 Mon Sep 17 00:00:00 2001 From: Jean-Marco Alameddine Date: Wed, 5 Apr 2023 11:06:52 +0200 Subject: [PATCH 05/10] address review comments by @prince-chrismc --- recipes/proposal/all/conanfile.py | 17 +++++++-------- .../proposal/all/test_package/conanfile.py | 1 - .../all/test_v1_package/CMakeLists.txt | 7 ++----- .../all/test_v1_package/test_package.cpp | 21 ------------------- 4 files changed, 10 insertions(+), 36 deletions(-) delete mode 100644 recipes/proposal/all/test_v1_package/test_package.cpp diff --git a/recipes/proposal/all/conanfile.py b/recipes/proposal/all/conanfile.py index 6a6fe70b24d49..85bb2d6b2e554 100644 --- a/recipes/proposal/all/conanfile.py +++ b/recipes/proposal/all/conanfile.py @@ -5,8 +5,9 @@ from conan.tools.cmake import CMake, CMakeToolchain from conan.errors import ConanInvalidConfiguration from conan.tools.scm import Version +from conan.tools.microsoft import is_msvc -required_conan_version = ">=1.43.0" +required_conan_version = ">=1.53.0" class PROPOSALConan(ConanFile): @@ -14,6 +15,7 @@ class PROPOSALConan(ConanFile): homepage = "https://github.com/tudo-astroparticlephysics/PROPOSAL" license = "LGPL-3.0" exports_sources = "CMakeLists.txt" + package_type = "library" url = "https://github.com/conan-io/conan-center-index" description = "monte Carlo based lepton and photon propagator" topics = ("propagator", "lepton", "photon", "stochastic") @@ -36,21 +38,18 @@ class PROPOSALConan(ConanFile): def _source_subfolder(self): return "source_subfolder" - @property - def _is_msvc(self): - return str(self.settings.compiler) in ["Visual Studio", "msvc"] - def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC + self.options.rm_safe("fPIC") def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") def requirements(self): self.requires("cubicinterpolation/0.1.4") - self.requires("spdlog/1.9.2") + #TODO: Add note why transitive_headers are necessary + self.requires("spdlog/1.9.2", transitive_headers=True) self.requires("nlohmann_json/3.10.5") if self.options.with_python: self.requires("pybind11/2.9.1") @@ -60,7 +59,7 @@ def _minimum_compilers_version(self): return {"Visual Studio": "15", "gcc": "5", "clang": "5", "apple-clang": "5"} def validate(self): - if self._is_msvc and self.options.shared: + if is_msvc(self) and self.options.shared: raise ConanInvalidConfiguration( "Can not build shared library on Visual Studio." ) diff --git a/recipes/proposal/all/test_package/conanfile.py b/recipes/proposal/all/test_package/conanfile.py index daa7bdee4ae46..ab249f266b429 100644 --- a/recipes/proposal/all/test_package/conanfile.py +++ b/recipes/proposal/all/test_package/conanfile.py @@ -6,7 +6,6 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" - requires = "spdlog/1.9.2" # TODO: not sure why this is explicitly necessary, but it fails without it def requirements(self): self.requires(self.tested_reference_str) diff --git a/recipes/proposal/all/test_v1_package/CMakeLists.txt b/recipes/proposal/all/test_v1_package/CMakeLists.txt index 705e044c0e357..7ea0378c83fe1 100644 --- a/recipes/proposal/all/test_v1_package/CMakeLists.txt +++ b/recipes/proposal/all/test_v1_package/CMakeLists.txt @@ -4,8 +4,5 @@ project(test_package CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(PROPOSAL REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PROPOSAL::PROPOSAL) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/proposal/all/test_v1_package/test_package.cpp b/recipes/proposal/all/test_v1_package/test_package.cpp deleted file mode 100644 index da2ad7c9c7773..0000000000000 --- a/recipes/proposal/all/test_v1_package/test_package.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "PROPOSAL/PROPOSAL.h" -#include -#include - -int main() -{ - auto particle = PROPOSAL::MuMinusDef(); - auto target = PROPOSAL::Ice(); - auto cut = std::make_shared(500, 0.05, false); - auto cross = PROPOSAL::GetStdCrossSections(particle, target, cut, false); - - auto energy = 1e4; - for (auto c : cross) { - auto type = c->GetInteractionType(); - auto name = PROPOSAL::Type_Interaction_Name_Map.at(type); - auto dEdx = c->CalculatedEdx(energy); - std::cout << "The " << name << " average loss for a " << energy << " MeV " - << particle.name << " in " << target.GetName() - << " is: " << dEdx << " MeV * cm^2 / g" << std::endl; - } -} From d89467d4267ebe5a64038b63b8f29b2d1d2bdff5 Mon Sep 17 00:00:00 2001 From: Jean-Marco Alameddine Date: Sat, 8 Apr 2023 13:17:35 +0200 Subject: [PATCH 06/10] self.output.warning instead of self.output.warn --- recipes/proposal/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/proposal/all/conanfile.py b/recipes/proposal/all/conanfile.py index 85bb2d6b2e554..19a49bcf5b858 100644 --- a/recipes/proposal/all/conanfile.py +++ b/recipes/proposal/all/conanfile.py @@ -70,7 +70,7 @@ def validate(self): str(self.settings.compiler), False ) if not minimum_version: - self.output.warn( + self.output.warning( "PROPOSAL requires C++14. Your compiler is unknown. Assuming it supports C++14." ) elif Version(self.settings.compiler.version) < minimum_version: From 7b697cba8ad571a6f1c75e43a0c86522209dfac0 Mon Sep 17 00:00:00 2001 From: Jean-Marco Alameddine Date: Sun, 9 Apr 2023 14:01:58 +0200 Subject: [PATCH 07/10] try fixing compile error of testpackage in CI by using transitive headers for nlohmann --- recipes/proposal/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/proposal/all/conanfile.py b/recipes/proposal/all/conanfile.py index 19a49bcf5b858..cbef69c8c9440 100644 --- a/recipes/proposal/all/conanfile.py +++ b/recipes/proposal/all/conanfile.py @@ -50,7 +50,8 @@ def requirements(self): self.requires("cubicinterpolation/0.1.4") #TODO: Add note why transitive_headers are necessary self.requires("spdlog/1.9.2", transitive_headers=True) - self.requires("nlohmann_json/3.10.5") + # transitive_headers due to usage of json_fwd.hpp + self.requires("nlohmann_json/3.10.5", transitive_headers=True) if self.options.with_python: self.requires("pybind11/2.9.1") From 6704c1a1c2447fa8891ac7a9d986bed3d817fca7 Mon Sep 17 00:00:00 2001 From: Jean-Marco Alameddine Date: Wed, 12 Apr 2023 14:06:30 +0200 Subject: [PATCH 08/10] add transitive_headers for cubicinterpolation --- recipes/proposal/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/proposal/all/conanfile.py b/recipes/proposal/all/conanfile.py index cbef69c8c9440..c06de467c51bf 100644 --- a/recipes/proposal/all/conanfile.py +++ b/recipes/proposal/all/conanfile.py @@ -47,10 +47,10 @@ def configure(self): self.options.rm_safe("fPIC") def requirements(self): - self.requires("cubicinterpolation/0.1.4") #TODO: Add note why transitive_headers are necessary + self.requires("cubicinterpolation/0.1.4", transitive_headers=True) self.requires("spdlog/1.9.2", transitive_headers=True) - # transitive_headers due to usage of json_fwd.hpp + # transitive_headers probably due to usage of json_fwd.hpp self.requires("nlohmann_json/3.10.5", transitive_headers=True) if self.options.with_python: self.requires("pybind11/2.9.1") From b1155bab5ba563eb767789d50364e4f90b3213a0 Mon Sep 17 00:00:00 2001 From: Jean-Marco Alameddine Date: Thu, 13 Apr 2023 09:45:43 +0200 Subject: [PATCH 09/10] fix DSO missing from command line error --- recipes/proposal/all/conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/proposal/all/conanfile.py b/recipes/proposal/all/conanfile.py index c06de467c51bf..a4a8c74c23510 100644 --- a/recipes/proposal/all/conanfile.py +++ b/recipes/proposal/all/conanfile.py @@ -48,10 +48,10 @@ def configure(self): def requirements(self): #TODO: Add note why transitive_headers are necessary - self.requires("cubicinterpolation/0.1.4", transitive_headers=True) - self.requires("spdlog/1.9.2", transitive_headers=True) + self.requires("cubicinterpolation/0.1.4", transitive_headers=True, transitive_libs=True) + self.requires("spdlog/1.9.2", transitive_headers=True, transitive_libs=True) # transitive_headers probably due to usage of json_fwd.hpp - self.requires("nlohmann_json/3.10.5", transitive_headers=True) + self.requires("nlohmann_json/3.10.5", transitive_headers=True, transitive_libs=True) if self.options.with_python: self.requires("pybind11/2.9.1") From 9218ba032efe564b43ebae3fe6142d4cbbe4f1bf Mon Sep 17 00:00:00 2001 From: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> Date: Thu, 13 Apr 2023 14:47:30 +0100 Subject: [PATCH 10/10] proposal: add comments for transitive traits, add logging to test_package.cpp --- recipes/proposal/all/conanfile.py | 8 +++++--- recipes/proposal/all/test_package/test_package.cpp | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/recipes/proposal/all/conanfile.py b/recipes/proposal/all/conanfile.py index a4a8c74c23510..f2e38e6d0a4ef 100644 --- a/recipes/proposal/all/conanfile.py +++ b/recipes/proposal/all/conanfile.py @@ -47,11 +47,13 @@ def configure(self): self.options.rm_safe("fPIC") def requirements(self): - #TODO: Add note why transitive_headers are necessary + # cubicinterpolation: headers are transitively included, and function calls are made + # from implementation in headers (templates) self.requires("cubicinterpolation/0.1.4", transitive_headers=True, transitive_libs=True) + # spdlog: requires transitive_libs due to direct calls to functionality from headers self.requires("spdlog/1.9.2", transitive_headers=True, transitive_libs=True) - # transitive_headers probably due to usage of json_fwd.hpp - self.requires("nlohmann_json/3.10.5", transitive_headers=True, transitive_libs=True) + # nlohmann_json: public headers include json.hpp and json_fwd.hpp + self.requires("nlohmann_json/3.10.5", transitive_headers=True) if self.options.with_python: self.requires("pybind11/2.9.1") diff --git a/recipes/proposal/all/test_package/test_package.cpp b/recipes/proposal/all/test_package/test_package.cpp index da2ad7c9c7773..76ca13b1a3245 100644 --- a/recipes/proposal/all/test_package/test_package.cpp +++ b/recipes/proposal/all/test_package/test_package.cpp @@ -1,4 +1,5 @@ #include "PROPOSAL/PROPOSAL.h" +#include "PROPOSAL/Logging.h" #include #include @@ -18,4 +19,6 @@ int main() << particle.name << " in " << target.GetName() << " is: " << dEdx << " MeV * cm^2 / g" << std::endl; } + + PROPOSAL::Logging::Get("proposal.conan_test_package")->warn("logging test"); }