From 498cdc7a5ebf3e11654b86fceb2b907d4753ace5 Mon Sep 17 00:00:00 2001 From: Mayeul d'Avezac <2745737+mdavezac@users.noreply.github.com> Date: Sat, 10 Apr 2021 16:08:00 +0100 Subject: [PATCH 01/10] Add so3 package Closes #5154 --- recipes/so3/all/CMakeLists.txt | 7 +++ recipes/so3/all/conandata.yml | 4 ++ recipes/so3/all/conanfile.py | 58 +++++++++++++++++++++ recipes/so3/all/test_package/CMakeLists.txt | 11 ++++ recipes/so3/all/test_package/conanfile.py | 20 +++++++ recipes/so3/all/test_package/example.c | 10 ++++ recipes/so3/config.yml | 3 ++ 7 files changed, 113 insertions(+) create mode 100644 recipes/so3/all/CMakeLists.txt create mode 100644 recipes/so3/all/conandata.yml create mode 100644 recipes/so3/all/conanfile.py create mode 100644 recipes/so3/all/test_package/CMakeLists.txt create mode 100644 recipes/so3/all/test_package/conanfile.py create mode 100644 recipes/so3/all/test_package/example.c create mode 100644 recipes/so3/config.yml diff --git a/recipes/so3/all/CMakeLists.txt b/recipes/so3/all/CMakeLists.txt new file mode 100644 index 0000000000000..32d0b43daf801 --- /dev/null +++ b/recipes/so3/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.0) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(source_subfolder) diff --git a/recipes/so3/all/conandata.yml b/recipes/so3/all/conandata.yml new file mode 100644 index 0000000000000..36c1e2d89f7b8 --- /dev/null +++ b/recipes/so3/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.3.3": + url: "https://github.com/astro-informatics/so3/archive/refs/tags/1.3.3rc1.zip" + sha256: "dd19ad9446f4b89f7f37bcdebd5aad062552e07d517b35fdc79ca879079268a6" diff --git a/recipes/so3/all/conanfile.py b/recipes/so3/all/conanfile.py new file mode 100644 index 0000000000000..6549afdaca2a1 --- /dev/null +++ b/recipes/so3/all/conanfile.py @@ -0,0 +1,58 @@ +from conans import CMake, ConanFile, tools +from conans.errors import ConanInvalidConfiguration +from glob import glob +import os + + + +class So3Conan(ConanFile): + name = "so3" + license = "GPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/astro-informatics/so3" + description = "Fast and accurate Wigner transforms" + settings = "os", "arch", "compiler", "build_type" + topics = ("physics", "astrophysics", "radio interferometry") + options = {"fPIC": [True, False]} + default_options = {"fPIC": True} + requires = "fftw/3.3.9", "ssht/1.3.7" + generators = "cmake", "cmake_find_package", "cmake_paths" + exports_sources = ["CMakeLists.txt"] + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def config_options(self): + if self.settings.compiler == "Visual Studio": + raise ConanInvalidConfiguration("SO3 requires C99 support for complex numbers.") + del self.settings.compiler.cppstd + del self.settings.compiler.libcxx + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = glob('so3-*/')[0] + os.rename(extracted_dir, self._source_subfolder) + + @property + def cmake(self): + if not hasattr(self, "_cmake"): + self._cmake = CMake(self) + self._cmake.definitions["tests"] = False + self._cmake.definitions["python"] = False + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + self.cmake.build() + + def package(self): + self.copy("LICENSE", dst="licenses", src=self._source_subfolder) + self.cmake.install() + + def package_info(self): + self.cpp_info.libs = ["so3"] diff --git a/recipes/so3/all/test_package/CMakeLists.txt b/recipes/so3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..ac9e3c299a63f --- /dev/null +++ b/recipes/so3/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +find_package(So3 REQUIRED NO_MODULE) + +add_executable(${PROJECT_NAME} example.c) +target_compile_features(${PROJECT_NAME} PUBLIC c_std_99) +target_link_libraries(${PROJECT_NAME} so3::so3) diff --git a/recipes/so3/all/test_package/conanfile.py b/recipes/so3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..4930d744506dc --- /dev/null +++ b/recipes/so3/all/test_package/conanfile.py @@ -0,0 +1,20 @@ +import os +from conans import ConanFile, CMake, tools + + +class SshtTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def configure(self): + del self.settings.compiler.libcxx + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/so3/all/test_package/example.c b/recipes/so3/all/test_package/example.c new file mode 100644 index 0000000000000..5e35f02f0e18f --- /dev/null +++ b/recipes/so3/all/test_package/example.c @@ -0,0 +1,10 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + so3_parameters_t params; + params.sampling_scheme = SO3_SAMPLING_MW; + so3_sampling_weight(¶ms, 2); + return 0; +} diff --git a/recipes/so3/config.yml b/recipes/so3/config.yml new file mode 100644 index 0000000000000..3abfca40293f6 --- /dev/null +++ b/recipes/so3/config.yml @@ -0,0 +1,3 @@ +versions: + "1.3.3": + folder: all From df4267fc59fad1c0d210fb8ab97a0a27c5c79384 Mon Sep 17 00:00:00 2001 From: Mayeul d'Avezac <2745737+mdavezac@users.noreply.github.com> Date: Sun, 11 Apr 2021 09:47:33 +0100 Subject: [PATCH 02/10] Apply code review comments From conan-io/conan-center-index#5178 --- recipes/so3/all/conanfile.py | 2 +- recipes/so3/all/test_package/conanfile.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/recipes/so3/all/conanfile.py b/recipes/so3/all/conanfile.py index 6549afdaca2a1..d9d3ead989470 100644 --- a/recipes/so3/all/conanfile.py +++ b/recipes/so3/all/conanfile.py @@ -16,7 +16,7 @@ class So3Conan(ConanFile): options = {"fPIC": [True, False]} default_options = {"fPIC": True} requires = "fftw/3.3.9", "ssht/1.3.7" - generators = "cmake", "cmake_find_package", "cmake_paths" + generators = "cmake", "cmake_find_package" exports_sources = ["CMakeLists.txt"] @property diff --git a/recipes/so3/all/test_package/conanfile.py b/recipes/so3/all/test_package/conanfile.py index 4930d744506dc..cc2b4dc2b31c2 100644 --- a/recipes/so3/all/test_package/conanfile.py +++ b/recipes/so3/all/test_package/conanfile.py @@ -6,9 +6,6 @@ class SshtTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake", "cmake_find_package_multi" - def configure(self): - del self.settings.compiler.libcxx - def build(self): cmake = CMake(self) cmake.configure() From b68c60c7beb398a8d744ab575ac3176cc350d07a Mon Sep 17 00:00:00 2001 From: Mayeul d'Avezac <2745737+mdavezac@users.noreply.github.com> Date: Wed, 14 Apr 2021 11:28:32 +0100 Subject: [PATCH 03/10] Add math libraries to so3 package info Co-authored-by: Uilian Ries --- recipes/so3/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/so3/all/conanfile.py b/recipes/so3/all/conanfile.py index d9d3ead989470..5b54893962ecc 100644 --- a/recipes/so3/all/conanfile.py +++ b/recipes/so3/all/conanfile.py @@ -56,3 +56,5 @@ def package(self): def package_info(self): self.cpp_info.libs = ["so3"] + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["m"] From a497891b6520c22c717877328ad0e5ddaba12cb4 Mon Sep 17 00:00:00 2001 From: Mayeul d'Avezac <2745737+mdavezac@users.noreply.github.com> Date: Wed, 14 Apr 2021 11:34:44 +0100 Subject: [PATCH 04/10] so3 uses BUILD_TESTING --- recipes/so3/all/conandata.yml | 6 +++--- recipes/so3/all/conanfile.py | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/recipes/so3/all/conandata.yml b/recipes/so3/all/conandata.yml index 36c1e2d89f7b8..29837247e0938 100644 --- a/recipes/so3/all/conandata.yml +++ b/recipes/so3/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "1.3.3": - url: "https://github.com/astro-informatics/so3/archive/refs/tags/1.3.3rc1.zip" - sha256: "dd19ad9446f4b89f7f37bcdebd5aad062552e07d517b35fdc79ca879079268a6" + "1.3.4": + url: "https://github.com/astro-informatics/so3/archive/refs/tags/1.3.4rc1.zip" + sha256: "9a6b5aa1d624f90ed70c9e531aea0311b356035ffb5e8d5278cdb112ffa3051d" diff --git a/recipes/so3/all/conanfile.py b/recipes/so3/all/conanfile.py index 5b54893962ecc..6e5cff42e2a4c 100644 --- a/recipes/so3/all/conanfile.py +++ b/recipes/so3/all/conanfile.py @@ -4,7 +4,6 @@ import os - class So3Conan(ConanFile): name = "so3" license = "GPL-3.0-or-later" @@ -29,20 +28,22 @@ def _build_subfolder(self): def config_options(self): if self.settings.compiler == "Visual Studio": - raise ConanInvalidConfiguration("SO3 requires C99 support for complex numbers.") + raise ConanInvalidConfiguration( + "SO3 requires C99 support for complex numbers." + ) del self.settings.compiler.cppstd del self.settings.compiler.libcxx def source(self): tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = glob('so3-*/')[0] + extracted_dir = glob("so3-*/")[0] os.rename(extracted_dir, self._source_subfolder) @property def cmake(self): if not hasattr(self, "_cmake"): self._cmake = CMake(self) - self._cmake.definitions["tests"] = False + self._cmake.definitions["BUILD_TESTING"] = False self._cmake.definitions["python"] = False self._cmake.configure(build_folder=self._build_subfolder) return self._cmake From e516cb5ec60e0384d345c8acca10c5bd2271fa82 Mon Sep 17 00:00:00 2001 From: Mayeul d'Avezac <2745737+mdavezac@users.noreply.github.com> Date: Wed, 14 Apr 2021 11:38:20 +0100 Subject: [PATCH 05/10] Bump so3 to 1.3.4 Because 1.3.3 published prematurely to pipy and that's irrevocable. --- recipes/so3/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/so3/config.yml b/recipes/so3/config.yml index 3abfca40293f6..a81e52666d075 100644 --- a/recipes/so3/config.yml +++ b/recipes/so3/config.yml @@ -1,3 +1,3 @@ versions: - "1.3.3": + "1.3.4": folder: all From 10173a3ad9054cf9c38ddad1a1d0b27c4dec7b8e Mon Sep 17 00:00:00 2001 From: Mayeul d'Avezac <2745737+mdavezac@users.noreply.github.com> Date: Thu, 15 Apr 2021 21:25:34 +0100 Subject: [PATCH 06/10] Do not generate CONAN_PKGS::XXX targets Co-authored-by: Uilian Ries --- recipes/so3/all/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/so3/all/CMakeLists.txt b/recipes/so3/all/CMakeLists.txt index 32d0b43daf801..0496b29838549 100644 --- a/recipes/so3/all/CMakeLists.txt +++ b/recipes/so3/all/CMakeLists.txt @@ -2,6 +2,6 @@ cmake_minimum_required(VERSION 3.0) project(cmake_wrapper) include(conanbuildinfo.cmake) -conan_basic_setup(TARGETS) +conan_basic_setup() add_subdirectory(source_subfolder) From ddf234dc8e4cc20ca686d1d1a7d7c76668cbc6b3 Mon Sep 17 00:00:00 2001 From: Mayeul d'Avezac <2745737+mdavezac@users.noreply.github.com> Date: Mon, 19 Apr 2021 08:54:04 +0100 Subject: [PATCH 07/10] Apply code-review comments --- recipes/so3/all/conanfile.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/recipes/so3/all/conanfile.py b/recipes/so3/all/conanfile.py index 6e5cff42e2a4c..ef8f330d516f2 100644 --- a/recipes/so3/all/conanfile.py +++ b/recipes/so3/all/conanfile.py @@ -26,13 +26,15 @@ def _source_subfolder(self): def _build_subfolder(self): return "build_subfolder" + def configure(self): + del self.settings.compiler.cppstd + del self.settings.compiler.libcxx + def config_options(self): if self.settings.compiler == "Visual Studio": raise ConanInvalidConfiguration( "SO3 requires C99 support for complex numbers." ) - del self.settings.compiler.cppstd - del self.settings.compiler.libcxx def source(self): tools.get(**self.conan_data["sources"][self.version]) @@ -44,7 +46,6 @@ def cmake(self): if not hasattr(self, "_cmake"): self._cmake = CMake(self) self._cmake.definitions["BUILD_TESTING"] = False - self._cmake.definitions["python"] = False self._cmake.configure(build_folder=self._build_subfolder) return self._cmake From 29236baf8f65116bb8a521c2c0b263121d461008 Mon Sep 17 00:00:00 2001 From: Mayeul d'Avezac <2745737+mdavezac@users.noreply.github.com> Date: Mon, 19 Apr 2021 09:27:22 +0100 Subject: [PATCH 08/10] Change test package name Co-authored-by: theirix --- recipes/so3/all/test_package/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/so3/all/test_package/conanfile.py b/recipes/so3/all/test_package/conanfile.py index cc2b4dc2b31c2..abcaeed3f89b6 100644 --- a/recipes/so3/all/test_package/conanfile.py +++ b/recipes/so3/all/test_package/conanfile.py @@ -2,7 +2,7 @@ from conans import ConanFile, CMake, tools -class SshtTestConan(ConanFile): +class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake", "cmake_find_package_multi" From 8da86eb26d0d0e0cabab34f9f2967d62b6dc68d3 Mon Sep 17 00:00:00 2001 From: Mayeul d'Avezac <2745737+mdavezac@users.noreply.github.com> Date: Thu, 13 May 2021 21:35:38 +0100 Subject: [PATCH 09/10] Rename so3 -> astro-informatics-so3 --- recipes/{so3 => astro-informatics-so3}/all/CMakeLists.txt | 0 recipes/{so3 => astro-informatics-so3}/all/conandata.yml | 2 +- recipes/{so3 => astro-informatics-so3}/all/conanfile.py | 6 +++--- .../all/test_package/CMakeLists.txt | 5 +++-- .../all/test_package/conanfile.py | 0 .../all/test_package/example.c | 0 recipes/{so3 => astro-informatics-so3}/config.yml | 0 7 files changed, 7 insertions(+), 6 deletions(-) rename recipes/{so3 => astro-informatics-so3}/all/CMakeLists.txt (100%) rename recipes/{so3 => astro-informatics-so3}/all/conandata.yml (56%) rename recipes/{so3 => astro-informatics-so3}/all/conanfile.py (93%) rename recipes/{so3 => astro-informatics-so3}/all/test_package/CMakeLists.txt (59%) rename recipes/{so3 => astro-informatics-so3}/all/test_package/conanfile.py (100%) rename recipes/{so3 => astro-informatics-so3}/all/test_package/example.c (100%) rename recipes/{so3 => astro-informatics-so3}/config.yml (100%) diff --git a/recipes/so3/all/CMakeLists.txt b/recipes/astro-informatics-so3/all/CMakeLists.txt similarity index 100% rename from recipes/so3/all/CMakeLists.txt rename to recipes/astro-informatics-so3/all/CMakeLists.txt diff --git a/recipes/so3/all/conandata.yml b/recipes/astro-informatics-so3/all/conandata.yml similarity index 56% rename from recipes/so3/all/conandata.yml rename to recipes/astro-informatics-so3/all/conandata.yml index 29837247e0938..f58d59b69191f 100644 --- a/recipes/so3/all/conandata.yml +++ b/recipes/astro-informatics-so3/all/conandata.yml @@ -1,4 +1,4 @@ sources: "1.3.4": url: "https://github.com/astro-informatics/so3/archive/refs/tags/1.3.4rc1.zip" - sha256: "9a6b5aa1d624f90ed70c9e531aea0311b356035ffb5e8d5278cdb112ffa3051d" + sha256: "8d3e4bfda99706080cf7dacda894b2134111632ab817a98d330206f6787c1970" diff --git a/recipes/so3/all/conanfile.py b/recipes/astro-informatics-so3/all/conanfile.py similarity index 93% rename from recipes/so3/all/conanfile.py rename to recipes/astro-informatics-so3/all/conanfile.py index ef8f330d516f2..bb25ceafd2ae6 100644 --- a/recipes/so3/all/conanfile.py +++ b/recipes/astro-informatics-so3/all/conanfile.py @@ -4,8 +4,8 @@ import os -class So3Conan(ConanFile): - name = "so3" +class AstroInformaticsSO3(ConanFile): + name = "astro-informatics-so3" license = "GPL-3.0-or-later" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/astro-informatics/so3" @@ -57,6 +57,6 @@ def package(self): self.cmake.install() def package_info(self): - self.cpp_info.libs = ["so3"] + self.cpp_info.libs = ["astro-informatics-so3"] if self.settings.os == "Linux": self.cpp_info.system_libs = ["m"] diff --git a/recipes/so3/all/test_package/CMakeLists.txt b/recipes/astro-informatics-so3/all/test_package/CMakeLists.txt similarity index 59% rename from recipes/so3/all/test_package/CMakeLists.txt rename to recipes/astro-informatics-so3/all/test_package/CMakeLists.txt index ac9e3c299a63f..aecca63b59f68 100644 --- a/recipes/so3/all/test_package/CMakeLists.txt +++ b/recipes/astro-informatics-so3/all/test_package/CMakeLists.txt @@ -4,8 +4,9 @@ project(test_package C) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() -find_package(So3 REQUIRED NO_MODULE) +find_package(astro-informatics-so3 REQUIRED NO_MODULE) add_executable(${PROJECT_NAME} example.c) target_compile_features(${PROJECT_NAME} PUBLIC c_std_99) -target_link_libraries(${PROJECT_NAME} so3::so3) +target_link_libraries(${PROJECT_NAME} + astro-informatics-so3::astro-informatics-so3) diff --git a/recipes/so3/all/test_package/conanfile.py b/recipes/astro-informatics-so3/all/test_package/conanfile.py similarity index 100% rename from recipes/so3/all/test_package/conanfile.py rename to recipes/astro-informatics-so3/all/test_package/conanfile.py diff --git a/recipes/so3/all/test_package/example.c b/recipes/astro-informatics-so3/all/test_package/example.c similarity index 100% rename from recipes/so3/all/test_package/example.c rename to recipes/astro-informatics-so3/all/test_package/example.c diff --git a/recipes/so3/config.yml b/recipes/astro-informatics-so3/config.yml similarity index 100% rename from recipes/so3/config.yml rename to recipes/astro-informatics-so3/config.yml From 7f5c0a7dc41bf8dfe9fd27b6ad962aaa55ff9df9 Mon Sep 17 00:00:00 2001 From: Mayeul d'Avezac <2745737+mdavezac@users.noreply.github.com> Date: Fri, 14 May 2021 15:54:46 +0100 Subject: [PATCH 10/10] Released upstream v1.3.4 --- recipes/astro-informatics-so3/all/conandata.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/astro-informatics-so3/all/conandata.yml b/recipes/astro-informatics-so3/all/conandata.yml index f58d59b69191f..044d46996e9be 100644 --- a/recipes/astro-informatics-so3/all/conandata.yml +++ b/recipes/astro-informatics-so3/all/conandata.yml @@ -1,4 +1,4 @@ sources: "1.3.4": - url: "https://github.com/astro-informatics/so3/archive/refs/tags/1.3.4rc1.zip" - sha256: "8d3e4bfda99706080cf7dacda894b2134111632ab817a98d330206f6787c1970" + url: "https://github.com/astro-informatics/so3/archive/refs/tags/v1.3.4.zip" + sha256: "383431c3078faa073c3017ceb3e0108885ab7628e81af13488f9aa021b95bbc7"