From b5d93881478d17333a86001a1093faafba64add7 Mon Sep 17 00:00:00 2001 From: mencian Date: Tue, 12 Nov 2024 10:20:03 -0600 Subject: [PATCH 1/2] Rebuild regenie recipe --- recipes/regenie/build.sh | 40 +- recipes/regenie/build_failure.osx-64.yaml | 104 ----- recipes/regenie/conda_build_config.yaml | 2 - recipes/regenie/meta.yaml | 33 +- .../patches/0001-use-shared-cxxopts.patch | 25 -- .../patches/0002-import-shared-Eigen3.patch | 27 -- .../patches/0003-use-conda-cmakelists.patch | 116 ------ .../patches/0004-fix-fail-exit-on-help.patch | 30 -- .../0005-use-conda-cmakelist-file.patch | 307 --------------- .../patches/0006-fix-cmakelist-file.patch | 317 ---------------- .../0007-fix-cmakelist-file-for-osx.patch | 306 --------------- ...08-fix-cmakelist-file-for-osx-eigen4.patch | 306 --------------- .../0009-update-cmake-file-for-conda.patch | 306 --------------- ...010-update-cmakelist-file-for-v3.2.7.patch | 306 --------------- ...011-update-cmakelist-file-for-v3.2.9.patch | 300 --------------- .../0012-update-cmakelist-file-for-v3.4.patch | 348 ----------------- ...013-update-cmakelist-file-for-v3.4.1.patch | 343 ----------------- .../0014-update-cmakelist.txt-for-v3.5.patch | 355 ------------------ 18 files changed, 30 insertions(+), 3541 deletions(-) delete mode 100644 recipes/regenie/build_failure.osx-64.yaml delete mode 100644 recipes/regenie/conda_build_config.yaml delete mode 100644 recipes/regenie/patches/0001-use-shared-cxxopts.patch delete mode 100644 recipes/regenie/patches/0002-import-shared-Eigen3.patch delete mode 100644 recipes/regenie/patches/0003-use-conda-cmakelists.patch delete mode 100644 recipes/regenie/patches/0004-fix-fail-exit-on-help.patch delete mode 100644 recipes/regenie/patches/0005-use-conda-cmakelist-file.patch delete mode 100644 recipes/regenie/patches/0006-fix-cmakelist-file.patch delete mode 100644 recipes/regenie/patches/0007-fix-cmakelist-file-for-osx.patch delete mode 100644 recipes/regenie/patches/0008-fix-cmakelist-file-for-osx-eigen4.patch delete mode 100644 recipes/regenie/patches/0009-update-cmake-file-for-conda.patch delete mode 100644 recipes/regenie/patches/0010-update-cmakelist-file-for-v3.2.7.patch delete mode 100644 recipes/regenie/patches/0011-update-cmakelist-file-for-v3.2.9.patch delete mode 100644 recipes/regenie/patches/0012-update-cmakelist-file-for-v3.4.patch delete mode 100644 recipes/regenie/patches/0013-update-cmakelist-file-for-v3.4.1.patch delete mode 100644 recipes/regenie/patches/0014-update-cmakelist.txt-for-v3.5.patch diff --git a/recipes/regenie/build.sh b/recipes/regenie/build.sh index 1b8a8269d4876..fb57151bb5ad3 100644 --- a/recipes/regenie/build.sh +++ b/recipes/regenie/build.sh @@ -3,29 +3,29 @@ set -e set -x -if [ "$(uname)" = "Darwin" ]; then - # LDFLAGS fix: https://github.com/AnacondaRecipes/intel_repack-feedstock/issues/8 - export LDFLAGS="-Wl,-pie -Wl,-headerpad_max_install_names -Wl,-rpath,$PREFIX/lib -L$PREFIX/lib" +export INCLUDES="-I${PREFIX}/include" +export LIBPATH="-L${PREFIX}/lib" +export CXXFLAGS="${CXXFLAGS} -O3 -I${PREFIX}/include" + +if [[ "$(uname)" = "Darwin" ]]; then + # LDFLAGS fix: https://github.com/AnacondaRecipes/intel_repack-feedstock/issues/8 + export LDFLAGS="${LDFLAGS} -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-rpath,$PREFIX/lib -L$PREFIX/lib" + export CONFIG_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER -DCMAKE_FIND_APPBUNDLE=NEVER" else - export LDFLAGS="-L$PREFIX/lib" - export MKL_THREADING_LAYER="GNU" + export LDFLAGS="${LDFLAGS} -L$PREFIX/lib" + export MKL_THREADING_LAYER="GNU" + export CONFIG_ARGS="" fi # https://bioconda.github.io/troubleshooting.html#zlib-errors -export CFLAGS="-I$PREFIX/include" -export CPATH=${PREFIX}/include - - -mkdir -p build +export CFLAGS="${CFLAGS} -O3 -I$PREFIX/include" +export CPATH="${PREFIX}/include" -cmake \ - -DBUILD_SHARED_LIBS:BOOL=ON \ - -DCMAKE_PREFIX_PATH:PATH=${PREFIX} \ - -DCMAKE_INSTALL_PREFIX:PATH=${PREFIX} \ - -DCMAKE_BUILD_TYPE="Release" \ - -S "${SRC_DIR}" \ - -B build -make -C build -j1 regenie -make -C build install +cmake -S . -B build -DCMAKE_BUILD_TYPE="Release" \ + -DCMAKE_INSTALL_PREFIX="${PREFIX}" \ + -DCMAKE_CXX_COMPILER="${CXX}" \ + -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \ + -DBOOST_ROOT="${PREFIX}" \ + "${CONFIG_ARGS}" -# bash test/test_conda.sh --path "${SRC_DIR}" +cmake --build build --target install -j "${CPU_COUNT}" diff --git a/recipes/regenie/build_failure.osx-64.yaml b/recipes/regenie/build_failure.osx-64.yaml deleted file mode 100644 index e759abd9b6e93..0000000000000 --- a/recipes/regenie/build_failure.osx-64.yaml +++ /dev/null @@ -1,104 +0,0 @@ -recipe_sha: 79124a9aa8c8c4bfc4ac1b2a6d10a5fa7bbc0886136237cccdac70de0b0ca6bc # The commit at which this recipe failed to build. -skiplist: true # Set to true to skiplist this recipe so that it will be ignored as long as its latest commit is the one given above. -log: |- - INFO:conda_build.metadata:Attempting to finalize metadata for regenie - Reloading output folder: /opt/mambaforge/envs/bioconda/conda-bld - Reloading output folder: /opt/mambaforge/envs/bioconda/conda-bld - Mamba failed to solve: - - llvm-openmp >=15.0.7 - - liblapack * *mkl - - boost-cpp 1.78.0.* - - libcxx >=15.0.7 - - mkl >=2020.4 - - bgenix >=1.1.7 - - zstd 1.5.* - - zlib 1.2.* - - mkl-include - - libgfortran5 >=12.2.0 - - libgfortran 5.* - - with channels: - - conda-forge - - bioconda - - defaults - - The reported errors are: - - Encountered problems while solving: - - - package bgenix-1.1.7-h4a65bee_0 requires boost-cpp 1.63.0.*, but none of the providers can be installed - - - - Leaving build/test directories: - Work: - /opt/mambaforge/envs/bioconda/conda-bld/work - Test: - /opt/mambaforge/envs/bioconda/conda-bld/test_tmp - Leaving build/test environments: - Test: - source activate /opt/mambaforge/envs/bioconda/conda-bld/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla - Build: - source activate /opt/mambaforge/envs/bioconda/conda-bld/_build_env - - - Traceback (most recent call last): - File "/opt/mambaforge/envs/bioconda/lib/python3.8/site-packages/boa/cli/mambabuild.py", line 141, in mamba_get_install_actions - solution = solver.solve_for_action(_specs, prefix) - File "/opt/mambaforge/envs/bioconda/lib/python3.8/site-packages/boa/core/solver.py", line 230, in solve_for_action - t = self.solve(specs) - File "/opt/mambaforge/envs/bioconda/lib/python3.8/site-packages/boa/core/solver.py", line 220, in solve - raise RuntimeError("Solver could not find solution." error_string) - RuntimeError: Solver could not find solution.Mamba failed to solve: - - llvm-openmp >=15.0.7 - - liblapack * *mkl - - boost-cpp 1.78.0.* - - libcxx >=15.0.7 - - mkl >=2020.4 - - bgenix >=1.1.7 - - zstd 1.5.* - - zlib 1.2.* - - mkl-include - - libgfortran5 >=12.2.0 - - libgfortran 5.* - - with channels: - - conda-forge - - bioconda - - defaults - - The reported errors are: - - Encountered problems while solving: - - - package bgenix-1.1.7-h4a65bee_0 requires boost-cpp 1.63.0.*, but none of the providers can be installed - - - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "/opt/mambaforge/envs/bioconda/bin/conda-mambabuild", line 10, in - sys.exit(main()) - File "/opt/mambaforge/envs/bioconda/lib/python3.8/site-packages/boa/cli/mambabuild.py", line 256, in main - call_conda_build(action, config) - File "/opt/mambaforge/envs/bioconda/lib/python3.8/site-packages/boa/cli/mambabuild.py", line 228, in call_conda_build - result = api.build( - File "/opt/mambaforge/envs/bioconda/lib/python3.8/site-packages/conda_build/api.py", line 180, in build - return build_tree( - File "/opt/mambaforge/envs/bioconda/lib/python3.8/site-packages/conda_build/build.py", line 3078, in build_tree - packages_from_this = build(metadata, stats, - File "/opt/mambaforge/envs/bioconda/lib/python3.8/site-packages/conda_build/build.py", line 2038, in build - output_metas = expand_outputs([(m, need_source_download, need_reparse_in_env)]) - File "/opt/mambaforge/envs/bioconda/lib/python3.8/site-packages/conda_build/render.py", line 787, in expand_outputs - for (output_dict, m) in deepcopy(_m).get_output_metadata_set(permit_unsatisfiable_variants=False): - File "/opt/mambaforge/envs/bioconda/lib/python3.8/site-packages/conda_build/metadata.py", line 2524, in get_output_metadata_set - conda_packages = finalize_outputs_pass( - File "/opt/mambaforge/envs/bioconda/lib/python3.8/site-packages/conda_build/metadata.py", line 884, in finalize_outputs_pass - fm = finalize_metadata( - File "/opt/mambaforge/envs/bioconda/lib/python3.8/site-packages/conda_build/render.py", line 547, in finalize_metadata - build_unsat, host_unsat = add_upstream_pins(m, - File "/opt/mambaforge/envs/bioconda/lib/python3.8/site-packages/conda_build/render.py", line 409, in add_upstream_pins - host_deps, host_unsat, extra_run_specs_from_host = _read_upstream_pin_files(m, 'host', - File "/opt/mambaforge/envs/bioconda/lib/python3.8/site-packages/conda_build/render.py", line 374, in _read_upstream_pin_files - deps, actions, unsat = get_env_dependencies(m, env, m.config.variant, - File "/opt/mambaforge/envs/bioconda/lib/python3.8/site-packages/conda_build/render.py", line 131, in get_env_dependencies - actions = environ.get_install_actions(tmpdir, tuple(dependencies), env, - File "/opt/mambaforge/envs/bioconda/lib/python3.8/site-packages/boa/cli/mambabuild.py", line 150, in mamba_get_install_actions - raise err - conda_build.exceptions.DependencyNeedsBuildingError: Unsatisfiable dependencies for platform osx-64: {MatchSpec("boost-cpp=1.63.0"), MatchSpec("bgenix==1.1.7=h4a65bee_0")} -# Last 100 lines of the build log. diff --git a/recipes/regenie/conda_build_config.yaml b/recipes/regenie/conda_build_config.yaml deleted file mode 100644 index 0e245780bd2d9..0000000000000 --- a/recipes/regenie/conda_build_config.yaml +++ /dev/null @@ -1,2 +0,0 @@ -boost: - - 1.63.0 diff --git a/recipes/regenie/meta.yaml b/recipes/regenie/meta.yaml index 71895d3fa8aa6..6cdf4fbc28e35 100644 --- a/recipes/regenie/meta.yaml +++ b/recipes/regenie/meta.yaml @@ -10,25 +10,10 @@ source: url: https://github.com/rgcgithub/regenie/archive/v{{ version }}.tar.gz sha256: {{ sha256 }} patches: - # Fixing postrelease issues - # - patches/0001-use-shared-cxxopts.patch - # - patches/0002-import-shared-Eigen3.patch - # - patches/0003-use-conda-cmakelists.patch - # - patches/0004-fix-fail-exit-on-help.patch - # - patches/0005-use-conda-cmakelist-file.patch - # - patches/0006-fix-cmakelist-file.patch - # - patches/0007-fix-cmakelist-file-for-osx.patch - # - patches/0008-fix-cmakelist-file-for-osx-eigen4.patch - # - patches/0009-update-cmake-file-for-conda.patch - # - patches/0010-update-cmakelist-file-for-v3.2.7.patch - # - patches/0011-update-cmakelist-file-for-v3.2.9.patch - # - patches/0012-update-cmakelist-file-for-v3.4.patch - # - patches/0013-update-cmakelist-file-for-v3.4.1.patch - # - patches/0014-update-cmakelist.txt-for-v3.5.patch - patches/0015-update-cmakelist.txt-for-v3.6.patch build: - number: 0 + number: 1 run_exports: - {{ pin_subpackage('regenie', max_pin="x") }} @@ -40,22 +25,22 @@ requirements: - binutils >=2.33.1 # [linux] - cmake >=3.13 - make + host: - llvm-openmp # [osx] - libgomp # [linux] - host: - bgenix >=1.1.7 - - boost-cpp 1.74 + - boost-cpp >=1.74 - liblapack * *mkl - mkl >=2020.4 - mkl-include - zlib - zstd run: - - boost-cpp 1.74 + - llvm-openmp # [osx] + - libgomp # [linux] + - boost-cpp >=1.74 - mkl >=2020.4 - sqlite - - zlib - - zstd test: commands: @@ -64,15 +49,17 @@ test: - regenie --version about: - home: https://rgcgithub.github.io/regenie/ + home: https://rgcgithub.github.io/regenie license: MIT license_family: MIT license_file: LICENSE summary: 'Regenie is a C++ program for whole genome regression modelling of large genome-wide association studies (GWAS).' dev_url: https://github.com/rgcgithub/regenie - doc_url: https://rgcgithub.github.io/regenie/options/ + doc_url: https://rgcgithub.github.io/regenie/options extra: recipe-maintainers: - matuskosut - joellembatchou + identifiers: + - doi:10.1038/s41588-021-00870-7 diff --git a/recipes/regenie/patches/0001-use-shared-cxxopts.patch b/recipes/regenie/patches/0001-use-shared-cxxopts.patch deleted file mode 100644 index dc705efd27cfa..0000000000000 --- a/recipes/regenie/patches/0001-use-shared-cxxopts.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 545caf4f8557e056765c61db1b0e3200a0dc39fb Mon Sep 17 00:00:00 2001 -From: Matus Kosut -Date: Sun, 1 Nov 2020 15:35:40 +0100 -Subject: [PATCH 1/3] use shared cxxopts - ---- - src/Regenie.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/Regenie.cpp b/src/Regenie.cpp -index 03d0edb..759f95a 100755 ---- a/src/Regenie.cpp -+++ b/src/Regenie.cpp -@@ -24,7 +24,7 @@ - - */ - --#include "cxxopts/include/cxxopts.hpp" -+#include "cxxopts.hpp" - #include "Regenie.hpp" - #include "Geno.hpp" - #include "Step1_Models.hpp" --- -2.23.0 - diff --git a/recipes/regenie/patches/0002-import-shared-Eigen3.patch b/recipes/regenie/patches/0002-import-shared-Eigen3.patch deleted file mode 100644 index c2aeeb4414f17..0000000000000 --- a/recipes/regenie/patches/0002-import-shared-Eigen3.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 644f0db61395be9283bc7dfe3b6a77a90a50c40b Mon Sep 17 00:00:00 2001 -From: Matus Kosut -Date: Sun, 1 Nov 2020 15:38:16 +0100 -Subject: [PATCH 2/3] import shared Eigen3 - ---- - src/Regenie.hpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/Regenie.hpp b/src/Regenie.hpp -index a51db25..b6f5506 100644 ---- a/src/Regenie.hpp -+++ b/src/Regenie.hpp -@@ -58,8 +58,8 @@ - #include - - #include "bgen_to_vcf.hpp" --#include "eigen3.3/Dense" --#include "eigen3.3/StdVector" -+#include "Eigen/Dense" -+#include "Eigen/StdVector" - - #ifdef __linux__ - #include --- -2.23.0 - diff --git a/recipes/regenie/patches/0003-use-conda-cmakelists.patch b/recipes/regenie/patches/0003-use-conda-cmakelists.patch deleted file mode 100644 index c496194332944..0000000000000 --- a/recipes/regenie/patches/0003-use-conda-cmakelists.patch +++ /dev/null @@ -1,116 +0,0 @@ -From 38cf311fd20dc3a0ec82f2d35af500732d91614a Mon Sep 17 00:00:00 2001 -From: Matus Kosut -Date: Sun, 1 Nov 2020 15:48:54 +0100 -Subject: [PATCH 3/3] use conda cmakelists - ---- - CMakeLists.txt | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 98 insertions(+) - create mode 100644 CMakeLists.txt - -diff --git a/CMakeLists.txt b/CMakeLists.txt -new file mode 100644 -index 0000000..b959bef ---- /dev/null -+++ CMakeLists.txt -@@ -0,0 +1,98 @@ -+cmake_minimum_required(VERSION 3.15) -+file(STRINGS "VERSION" PROJECT_VERSION) -+project(regenie VERSION "${PROJECT_VERSION}") -+include(CMakePackageConfigHelpers) -+include(GNUInstallDirs) -+ -+set(CMAKE_CXX_STANDARD 11) -+set(CMAKE_CXX_STANDARD_REQUIRED True) -+ -+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -ffast-math -std=c++11") -+set(THREADS_PREFER_PTHREAD_FLAG TRUE CACHE BOOL -+ "Prefer using the -pthread compiler flag over -lpthread") -+ -+set(ENV{CFLAGS} "${CMAKE_C_FLAGS}") -+set(ENV{CXXFLAGS} "${CMAKE_CXX_FLAGS}") -+set(ENV{LDFLAGS} "-L${CMAKE_PREFIX_PATH}/lib") -+set(ENV{MKLROOT} "${CMAKE_PREFIX_PATH}") -+ -+if(BUILD_SHARED_LIBS) -+ set(ENV{STATIC} OFF) -+ set(Boost_USE_STATIC_LIBS OFF) -+ set(BLA_STATIC OFF) -+else() -+ set(ENV{STATIC} ON) -+ set(BLA_STATIC ON) -+ set(Boost_USE_STATIC_LIBS ON) -+ set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") -+ set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc" "-static-libstdc++") -+endif(BUILD_SHARED_LIBS) -+set(Boost_USE_DEBUG_LIBS OFF) -+set(Boost_USE_MULTITHREADED ON) -+set(Boost_USE_STATIC_RUNTIME OFF) -+ -+find_package(Boost REQUIRED COMPONENTS iostreams system filesystem thread) -+find_library(ZLIB_LIBRARY z) -+find_library(MLIB_LIBRARY m) -+find_library(DLLIB_LIBRARY dl) -+find_library(ZSTD_LIBRARY zstd) -+find_library(BGEN_LIBRARY bgen) -+find_library(SQLITE3_LIBRARY sqlite3) -+find_library(DB_LIBRARY db) -+find_package(Threads) -+find_package(BLAS) -+find_package(LAPACK) -+find_package(Eigen3 3.3 REQUIRED NO_MODULE) -+ -+if(Boost_FOUND) -+ add_definitions(${Boost_DEFINITIONS}) -+ if(Boost_iostreams_FOUND) -+ add_definitions(-DHAS_BOOST_IOSTREAM=1) -+ add_definitions(-DVERSION_NUMBER="${PROJECT_VERSION}.gz") -+ else() -+ add_definitions(-DVERSION_NUMBER="${PROJECT_VERSION}") -+ endif(Boost_iostreams_FOUND) -+endif(Boost_FOUND) -+ -+if(BLAS_FOUND) -+ if(LAPACK_FOUND) -+ add_definitions(-DWITH_MKL) -+ add_definitions(-DEIGEN_USE_BLAS) -+ add_definitions(-DEIGEN_USE_LAPACKE) -+ endif(LAPACK_FOUND) -+endif(BLAS_FOUND) -+ -+set(SIMDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external_libs/pgenlib/simde") -+file(GLOB SIMDE_SOURCES "${SIMDE_PATH}/*.h" "${SIMDE_PATH}/x86/*.h") -+add_library(simde INTERFACE) -+target_sources(simde INTERFACE "${SIMDE_SOURCES}") -+target_compile_options(simde BEFORE INTERFACE "-fopenmp-simd") -+target_include_directories(simde INTERFACE $ $) -+ -+set(PGEN_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external_libs/pgenlib") -+file(GLOB PGEN_SOURCES "${PGEN_PATH}/*.cpp" "${PGEN_PATH}/*.h" "${PGEN_PATH}/**/*.cc" "${PGEN_PATH}/**/*.h") -+add_library(pgen INTERFACE) -+target_link_libraries(pgen INTERFACE simde) -+target_sources(pgen INTERFACE "${PGEN_SOURCES}") -+target_include_directories(pgen INTERFACE $) -+ -+file(GLOB REGENIE_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp") -+add_executable(regenie "${REGENIE_PATHS}") -+target_link_libraries(regenie pgen ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} Boost::iostreams Boost::system Boost::filesystem Boost::thread LAPACK::LAPACK Eigen3::Eigen ${ZLIB_LIBRARY} ${ZSTD_LIBRARY} ${MLIB_LIBRARY} ${DLLIB_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) -+target_include_directories(regenie PUBLIC -+ $ -+ $ -+ $ -+ $) -+ -+install(TARGETS regenie -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ OPTIONAL) -+ -+write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake COMPATIBILITY SameMajorVersion) -+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake DESTINATION share/${PROJECT_NAME}) -+ -+set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) -+set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) -+set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) -+include(CPack) --- -2.23.0 diff --git a/recipes/regenie/patches/0004-fix-fail-exit-on-help.patch b/recipes/regenie/patches/0004-fix-fail-exit-on-help.patch deleted file mode 100644 index 64208c97416ec..0000000000000 --- a/recipes/regenie/patches/0004-fix-fail-exit-on-help.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 28910770bb6b31df80f2c9eff25f517e6bc86432 Mon Sep 17 00:00:00 2001 -From: Matus Kosut -Date: Sun, 1 Nov 2020 18:11:11 +0100 -Subject: [PATCH] fix fail exit on help - ---- - src/Regenie.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/Regenie.cpp b/src/Regenie.cpp -index 759f95a..bf8f020 100755 ---- a/src/Regenie.cpp -+++ b/src/Regenie.cpp -@@ -190,11 +190,11 @@ void read_params_and_check(int argc, char *argv[], struct param* params, struct - if (vm.count("help")){ - print_header(std::cout); - std::cout << AllOptions.help({"", "Main"}) << '\n' << webinfo << "\n\n"; -- exit(-1); -+ exit(0); - } else if (vm.count("helpFull")) { - print_header(std::cout); - std::cout << AllOptions.help({"", "Main", "Additional"}) << '\n' << webinfo << "\n\n"; -- exit(-1); -+ exit(0); - } - - if (!vm.count("out")){ --- -2.23.0 - diff --git a/recipes/regenie/patches/0005-use-conda-cmakelist-file.patch b/recipes/regenie/patches/0005-use-conda-cmakelist-file.patch deleted file mode 100644 index 0acc076f1749f..0000000000000 --- a/recipes/regenie/patches/0005-use-conda-cmakelist-file.patch +++ /dev/null @@ -1,307 +0,0 @@ -From c18d1f024eeddd844c91da835009a0d9fb698cae Mon Sep 17 00:00:00 2001 -From: Joelle Mbatchou -Date: Thu, 17 Mar 2022 18:47:15 -0500 -Subject: [PATCH] use conda cmakelist file - ---- - - CMakeLists.txt | 203 ++++++++++++++++++++++++++------------------------------- - 1 file changed, 93 insertions(+), 110 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5153c91..6c9e934 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,11 +1,3 @@ --# For Intel MKL, set MKLROOT= when running cmake --# e.g. MKLROOT=/opt/mkl/ cmake -S regenie_dir/ -B regenie_dir/build/ --# For OpenBLAS, set OPENBLAS_ROOT= when running cmake --# note: it also requires lapacke library --# For static compilation on Linux systems, set STATIC=1 when running cmake --# -> this excludes GLIBC -- -- - cmake_minimum_required(VERSION 3.13) - - # detect OS architecture -@@ -33,48 +25,16 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Ensures -std=c++11 - ###################################### - ######## check input variables - --# check BGEN_PATH --if("$ENV{BGEN_PATH}" STREQUAL "") -- message( FATAL_ERROR "Must specify path to BGEN library in 'BGEN_PATH'") --else() -- set(BGEN_PATH "$ENV{BGEN_PATH}" CACHE INTERNAL "Set BGEN library path") -- if (NOT EXISTS ${BGEN_PATH}) -- message( FATAL_ERROR "Specified BGEN library directory '${BGEN_PATH}' does not exist") -- endif() --endif() -- - # check for static compilation --if($ENV{STATIC}) -+if(BUILD_SHARED_LIBS) -+ set(BUILD_STATIC OFF CACHE INTERNAL "Dynamic compilation") -+ set(Boost_USE_STATIC_LIBS OFF) -+else() - set(BUILD_STATIC ON CACHE INTERNAL "Static compilation") -+ set(Boost_USE_STATIC_LIBS ON) - message( STATUS "Static compilation mode") - endif() - --# check Boost IOStreams --if($ENV{HAS_BOOST_IOSTREAM}) -- set(HAS_BOOST_IOSTREAM 1 CACHE INTERNAL "Add Boost IO") -- set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") --else() -- set(HAS_BOOST_IOSTREAM 0 CACHE INTERNAL "Skip Boost IO") --endif() -- --# check MKL --if(NOT "$ENV{MKLROOT}" STREQUAL "") -- set(MKLROOT "$ENV{MKLROOT}" CACHE INTERNAL "Set MKL library path") -- if (NOT EXISTS ${MKLROOT}) -- message( FATAL_ERROR "Specified MKL library directory '${MKLROOT}' does not exist") -- endif() -- message( STATUS "Will compile with Intel MKL library") --endif() -- --# check OpenBLAS --if(NOT "$ENV{OPENBLAS_ROOT}" STREQUAL "") -- set(OPENBLAS_ROOT "$ENV{OPENBLAS_ROOT}" CACHE INTERNAL "Set OpenBLAS library path") -- if (NOT EXISTS ${OPENBLAS_ROOT}) -- message( FATAL_ERROR "Specified OpenBLAS library directory '${OPENBLAS_ROOT}' does not exist") -- endif() -- message( STATUS "Will compile with OpenBLAS library") --endif() -- - ###################################### - ######## set flags and required libraries - -@@ -83,6 +43,7 @@ set(Boost_USE_STATIC_LIBS ${BUILD_STATIC}) - set(Boost_USE_DEBUG_LIBS OFF) - set(Boost_USE_MULTITHREADED ON) - set(Boost_USE_STATIC_RUNTIME OFF) -+set(MKLROOT "${CMAKE_PREFIX_PATH}") - - # list each file specifically - add_executable(regenie -@@ -100,32 +61,60 @@ add_executable(regenie - ${CMAKE_SOURCE_DIR}/src/Step1_Models.cpp - ${CMAKE_SOURCE_DIR}/src/Step2_Models.cpp - ) --target_include_directories(regenie PRIVATE ${CMAKE_SOURCE_DIR}/src) -+target_include_directories(regenie PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_PREFIX_PATH}/include) - - set(CMAKE_CXX_FLAGS "-O3 -Wall -pedantic -ffast-math -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-long-long -Wno-c11-extensions -fPIC") --add_definitions(-DVERSION_NUMBER="${RG_VERSION}") - -+find_package(OpenMP REQUIRED) -+target_link_libraries(regenie OpenMP::OpenMP_CXX) - if("${UNAME_S}" STREQUAL "Linux") -- find_package(OpenMP REQUIRED) -- target_link_libraries(regenie PRIVATE OpenMP::OpenMP_CXX) - if(${BUILD_STATIC}) -- target_link_options(regenie BEFORE PRIVATE -static-libgcc PRIVATE -static-libstdc++) -+ target_link_options(regenie BEFORE -static-libgcc -static-libstdc++) - endif() - elseif("${UNAME_S}" STREQUAL "Darwin") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - endif() - --set(EXTERN_LIBS_PATH "${CMAKE_SOURCE_DIR}/external_libs") --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/) -+set(EXTERN_LIBS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external_libs") -+target_include_directories(regenie PUBLIC ${EXTERN_LIBS_PATH}/) - --# BGEN library and its dependencies --find_library(ZSTD_LIBRARY libzstd.a HINTS "${BGEN_PATH}/build/3rd_party/zstd-1.1.0" REQUIRED) --find_library(DB_LIBRARY libdb.a HINTS "${BGEN_PATH}/build/db" REQUIRED) --find_library(SQLITE3_LIBRARY libsqlite3.a HINTS "${BGEN_PATH}/build/3rd_party/sqlite3" REQUIRED) --find_library(Boost_LIBRARY libboost.a HINTS "${BGEN_PATH}/build/3rd_party/boost_1_55_0" REQUIRED) --find_library(BGEN_LIBRARY libbgen.a HINTS "${BGEN_PATH}/build" REQUIRED) --target_link_libraries(regenie PRIVATE ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARY}) --target_include_directories(regenie PRIVATE ${BGEN_PATH} ${BGEN_PATH}/genfile/include/ ${BGEN_PATH}/3rd_party/boost_1_55_0/ ${BGEN_PATH}/3rd_party/zstd-1.1.0/lib ${BGEN_PATH}/db/include/ ${BGEN_PATH}/3rd_party/sqlite3) -+# for BGEN (choose static if present first) -+find_library(ZSTD_LIBRARY -+ NAMES libzstd.a zstd -+ REQUIRED -+ ) -+find_library(DB_LIBRARY -+ NAMES libdb.a db -+ REQUIRED -+ ) -+find_library(SQLITE3_LIBRARY -+ NAMES libsqlite3.a sqlite3 -+ REQUIRED -+ ) -+find_package(Boost -+ REQUIRED COMPONENTS system filesystem thread -+ OPTIONAL_COMPONENTS iostreams -+ ) -+find_library(BGEN_LIBRARY -+ NAMES libbgen.a -+ REQUIRED -+ ) -+target_link_libraries(regenie ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARIES}) -+target_include_directories(regenie -+ PUBLIC -+ $ -+ $ -+ $ -+ $ -+ ) -+add_definitions(${Boost_DEFINITIONS}) -+ -+# Boost IO -+if(Boost_iostreams_FOUND) -+ add_definitions(-DHAS_BOOST_IOSTREAM) -+ set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") -+ message( STATUS "Will compile with Boost Iostreams library") -+endif() - - # MVTNorm library - set(MVTN_PATH "${EXTERN_LIBS_PATH}/mvtnorm") -@@ -134,7 +123,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${MVTN_PATH} - ) --target_link_libraries(regenie PRIVATE ${MVTN_PATH}/libMvtnorm.a) -+target_link_libraries(regenie ${MVTN_PATH}/libMvtnorm.a) - add_dependencies(regenie libMvtnorm) - - # QF library -@@ -144,7 +133,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QF_PATH} - ) --target_link_libraries(regenie PRIVATE ${QF_PATH}/qf.a) -+target_link_libraries(regenie ${QF_PATH}/qf.a) - add_dependencies(regenie libqf) - - # Quadpack library -@@ -154,7 +143,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QUAD_PATH} - ) --target_link_libraries(regenie PRIVATE ${QUAD_PATH}/libquad.a) -+target_link_libraries(regenie ${QUAD_PATH}/libquad.a) - add_dependencies(regenie libquad) - - # PGEN library -@@ -164,59 +153,51 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${PGEN_PATH} - ) --target_link_libraries(regenie PRIVATE ${PGEN_PATH}/pgenlib.a) --target_include_directories(regenie PRIVATE ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) -+target_link_libraries(regenie ${PGEN_PATH}/pgenlib.a) -+target_include_directories(regenie PUBLIC ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) - add_dependencies(regenie pgenlib) - - # Intel MKL --if(EXISTS ${MKLROOT}) -+if(DEFINED MKLROOT) - add_definitions(-DWITH_MKL -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${MKLROOT}/include/) -- if(${BUILD_STATIC}) # specify static libs -- find_library(MKL_LP64_LIB libmkl_intel_lp64.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB libmkl_gnu_thread.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB libmkl_core.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) -+ target_include_directories(regenie PUBLIC ${MKLROOT}/include/) -+ find_library(MKL_LP64_LIB -+ NAMES libmkl_intel_lp64.a mkl_intel_lp64 -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ find_library(MKL_THREAD_LIB -+ NAMES libmkl_gnu_thread.a mkl_gnu_thread -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ find_library(MKL_CORE_LIB -+ NAMES libmkl_core.a mkl_core -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ if(${BUILD_STATIC}) -+ target_link_libraries(regenie "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) - else() # use dynamic libs -- find_library(MKL_LP64_LIB mkl_intel_lp64 PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB mkl_gnu_thread PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB mkl_core PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) -+ target_link_libraries(regenie "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) - endif() --elseif(EXISTS ${OPENBLAS_ROOT}) # OpenBLAS -- add_definitions(-DWITH_OPENBLAS -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${OPENBLAS_ROOT}/include/) -- find_library(LAPACK_LIB lapack REQUIRED) -- find_library(BLAS_LIB openblas HINTS "${OPENBLAS_ROOT}/lib/" REQUIRED) -- target_link_libraries(regenie PRIVATE ${LAPACK_LIB} -llapacke ${BLAS_LIB}) -+ message( STATUS "Will compile with Intel MKL library") - endif() - - # cxxopts (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/cxxopts/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/cxxopts/include/) - - # LBFGS (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/LBFGSpp/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/LBFGSpp/include/) - - # Eigen (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/eigen3/) -- --# Boost IO --if(${HAS_BOOST_IOSTREAM}) -- if("${UNAME_S}" STREQUAL "Darwin") -- find_library(BOOST_LIB_IO libboost_iostreams libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- elseif(${BUILD_STATIC}) -- find_library(BOOST_LIB_IO libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- else() -- target_link_libraries(regenie PRIVATE -lboost_iostreams) -- endif() -- add_definitions(-DHAS_BOOST_IOSTREAM) -- message( STATUS "Will compile with Boost Iostreams library") --endif() -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/eigen3/) - - # Other libraries --find_library(ZLIB_LIBRARY libz.a z REQUIRED) -+find_library(ZLIB_LIBRARY -+ NAMES libz.a z -+ REQUIRED -+ ) - find_library(M_LIB m REQUIRED) - find_library(DL_LIB dl REQUIRED) - if("${UNAME_S}" STREQUAL "Linux") -@@ -224,14 +205,16 @@ if("${UNAME_S}" STREQUAL "Linux") - elseif("${UNAME_S}" STREQUAL "Darwin") - find_library(GFORTRAN_LIBRARY gfortran REQUIRED) - endif() --target_link_libraries(regenie PRIVATE ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} ${GFORTRAN_LIBRARY}) -+target_link_libraries(regenie ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} ${GFORTRAN_LIBRARY}) - --install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+add_definitions(-DVERSION_NUMBER="${RG_VERSION}") -+install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) - message( STATUS "REGENIE v" ${RG_VERSION}) - --add_custom_target(full-clean -- COMMAND cd "${MVTN_PATH}" && make clean -- COMMAND cd "${QF_PATH}" && make clean -- COMMAND cd "${QUAD_PATH}" && make clean -- COMMAND cd "${PGEN_PATH}" && make clean -- ) -+write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake COMPATIBILITY SameMajorVersion) -+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake DESTINATION share/${PROJECT_NAME}) -+ -+set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) -+set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) -+set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) -+include(CPack) diff --git a/recipes/regenie/patches/0006-fix-cmakelist-file.patch b/recipes/regenie/patches/0006-fix-cmakelist-file.patch deleted file mode 100644 index 5e615abe7f77d..0000000000000 --- a/recipes/regenie/patches/0006-fix-cmakelist-file.patch +++ /dev/null @@ -1,317 +0,0 @@ -From ec72f5a52a7116f79778d0c94bd9559cb2c30792 Mon Sep 17 00:00:00 2001 -From: Joelle Mbatchou -Date: Fri, 18 Mar 2022 11:28:08 -0500 -Subject: [PATCH] fix cmakelist file - ---- - CMakeLists.txt | 211 +++++++++++++++++++++++-------------------------- - 1 file changed, 101 insertions(+), 110 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5153c91..3206f61 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,11 +1,3 @@ --# For Intel MKL, set MKLROOT= when running cmake --# e.g. MKLROOT=/opt/mkl/ cmake -S regenie_dir/ -B regenie_dir/build/ --# For OpenBLAS, set OPENBLAS_ROOT= when running cmake --# note: it also requires lapacke library --# For static compilation on Linux systems, set STATIC=1 when running cmake --# -> this excludes GLIBC -- -- - cmake_minimum_required(VERSION 3.13) - - # detect OS architecture -@@ -33,48 +25,16 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Ensures -std=c++11 - ###################################### - ######## check input variables - --# check BGEN_PATH --if("$ENV{BGEN_PATH}" STREQUAL "") -- message( FATAL_ERROR "Must specify path to BGEN library in 'BGEN_PATH'") --else() -- set(BGEN_PATH "$ENV{BGEN_PATH}" CACHE INTERNAL "Set BGEN library path") -- if (NOT EXISTS ${BGEN_PATH}) -- message( FATAL_ERROR "Specified BGEN library directory '${BGEN_PATH}' does not exist") -- endif() --endif() -- - # check for static compilation --if($ENV{STATIC}) -+if(BUILD_SHARED_LIBS) -+ set(BUILD_STATIC OFF CACHE INTERNAL "Dynamic compilation") -+ set(Boost_USE_STATIC_LIBS OFF) -+else() - set(BUILD_STATIC ON CACHE INTERNAL "Static compilation") -+ set(Boost_USE_STATIC_LIBS ON) - message( STATUS "Static compilation mode") - endif() - --# check Boost IOStreams --if($ENV{HAS_BOOST_IOSTREAM}) -- set(HAS_BOOST_IOSTREAM 1 CACHE INTERNAL "Add Boost IO") -- set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") --else() -- set(HAS_BOOST_IOSTREAM 0 CACHE INTERNAL "Skip Boost IO") --endif() -- --# check MKL --if(NOT "$ENV{MKLROOT}" STREQUAL "") -- set(MKLROOT "$ENV{MKLROOT}" CACHE INTERNAL "Set MKL library path") -- if (NOT EXISTS ${MKLROOT}) -- message( FATAL_ERROR "Specified MKL library directory '${MKLROOT}' does not exist") -- endif() -- message( STATUS "Will compile with Intel MKL library") --endif() -- --# check OpenBLAS --if(NOT "$ENV{OPENBLAS_ROOT}" STREQUAL "") -- set(OPENBLAS_ROOT "$ENV{OPENBLAS_ROOT}" CACHE INTERNAL "Set OpenBLAS library path") -- if (NOT EXISTS ${OPENBLAS_ROOT}) -- message( FATAL_ERROR "Specified OpenBLAS library directory '${OPENBLAS_ROOT}' does not exist") -- endif() -- message( STATUS "Will compile with OpenBLAS library") --endif() -- - ###################################### - ######## set flags and required libraries - -@@ -83,6 +43,7 @@ set(Boost_USE_STATIC_LIBS ${BUILD_STATIC}) - set(Boost_USE_DEBUG_LIBS OFF) - set(Boost_USE_MULTITHREADED ON) - set(Boost_USE_STATIC_RUNTIME OFF) -+set(MKLROOT "${CMAKE_PREFIX_PATH}") - - # list each file specifically - add_executable(regenie -@@ -100,32 +61,60 @@ add_executable(regenie - ${CMAKE_SOURCE_DIR}/src/Step1_Models.cpp - ${CMAKE_SOURCE_DIR}/src/Step2_Models.cpp - ) --target_include_directories(regenie PRIVATE ${CMAKE_SOURCE_DIR}/src) -+target_include_directories(regenie PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_PREFIX_PATH}/include) - - set(CMAKE_CXX_FLAGS "-O3 -Wall -pedantic -ffast-math -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-long-long -Wno-c11-extensions -fPIC") --add_definitions(-DVERSION_NUMBER="${RG_VERSION}") - -+find_package(OpenMP REQUIRED) -+target_link_libraries(regenie OpenMP::OpenMP_CXX) - if("${UNAME_S}" STREQUAL "Linux") -- find_package(OpenMP REQUIRED) -- target_link_libraries(regenie PRIVATE OpenMP::OpenMP_CXX) - if(${BUILD_STATIC}) -- target_link_options(regenie BEFORE PRIVATE -static-libgcc PRIVATE -static-libstdc++) -+ target_link_options(regenie BEFORE -static-libgcc -static-libstdc++) - endif() - elseif("${UNAME_S}" STREQUAL "Darwin") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - endif() - --set(EXTERN_LIBS_PATH "${CMAKE_SOURCE_DIR}/external_libs") --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/) -+set(EXTERN_LIBS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external_libs") -+target_include_directories(regenie PUBLIC ${EXTERN_LIBS_PATH}/) -+ -+# for BGEN (choose static if present first) -+find_library(ZSTD_LIBRARY -+ NAMES libzstd.a zstd -+ REQUIRED -+ ) -+find_library(DB_LIBRARY -+ NAMES libdb.a db -+ REQUIRED -+ ) -+find_library(SQLITE3_LIBRARY -+ NAMES libsqlite3.a sqlite3 -+ REQUIRED -+ ) -+find_package(Boost -+ REQUIRED COMPONENTS system filesystem thread -+ OPTIONAL_COMPONENTS iostreams -+ ) -+find_library(BGEN_LIBRARY -+ NAMES libbgen.a -+ REQUIRED -+ ) -+target_link_libraries(regenie ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARIES}) -+target_include_directories(regenie -+ PUBLIC -+ $ -+ $ -+ $ -+ $ -+ ) -+add_definitions(${Boost_DEFINITIONS}) - --# BGEN library and its dependencies --find_library(ZSTD_LIBRARY libzstd.a HINTS "${BGEN_PATH}/build/3rd_party/zstd-1.1.0" REQUIRED) --find_library(DB_LIBRARY libdb.a HINTS "${BGEN_PATH}/build/db" REQUIRED) --find_library(SQLITE3_LIBRARY libsqlite3.a HINTS "${BGEN_PATH}/build/3rd_party/sqlite3" REQUIRED) --find_library(Boost_LIBRARY libboost.a HINTS "${BGEN_PATH}/build/3rd_party/boost_1_55_0" REQUIRED) --find_library(BGEN_LIBRARY libbgen.a HINTS "${BGEN_PATH}/build" REQUIRED) --target_link_libraries(regenie PRIVATE ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARY}) --target_include_directories(regenie PRIVATE ${BGEN_PATH} ${BGEN_PATH}/genfile/include/ ${BGEN_PATH}/3rd_party/boost_1_55_0/ ${BGEN_PATH}/3rd_party/zstd-1.1.0/lib ${BGEN_PATH}/db/include/ ${BGEN_PATH}/3rd_party/sqlite3) -+# Boost IO -+if(Boost_iostreams_FOUND) -+ add_definitions(-DHAS_BOOST_IOSTREAM) -+ set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") -+ message( STATUS "Will compile with Boost Iostreams library") -+endif() - - # MVTNorm library - set(MVTN_PATH "${EXTERN_LIBS_PATH}/mvtnorm") -@@ -134,7 +123,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${MVTN_PATH} - ) --target_link_libraries(regenie PRIVATE ${MVTN_PATH}/libMvtnorm.a) -+target_link_libraries(regenie ${MVTN_PATH}/libMvtnorm.a) - add_dependencies(regenie libMvtnorm) - - # QF library -@@ -144,7 +133,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QF_PATH} - ) --target_link_libraries(regenie PRIVATE ${QF_PATH}/qf.a) -+target_link_libraries(regenie ${QF_PATH}/qf.a) - add_dependencies(regenie libqf) - - # Quadpack library -@@ -154,7 +143,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QUAD_PATH} - ) --target_link_libraries(regenie PRIVATE ${QUAD_PATH}/libquad.a) -+target_link_libraries(regenie ${QUAD_PATH}/libquad.a) - add_dependencies(regenie libquad) - - # PGEN library -@@ -164,59 +153,59 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${PGEN_PATH} - ) --target_link_libraries(regenie PRIVATE ${PGEN_PATH}/pgenlib.a) --target_include_directories(regenie PRIVATE ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) -+target_link_libraries(regenie ${PGEN_PATH}/pgenlib.a) -+target_include_directories(regenie PUBLIC ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) - add_dependencies(regenie pgenlib) - - # Intel MKL --if(EXISTS ${MKLROOT}) -+if(DEFINED MKLROOT) - add_definitions(-DWITH_MKL -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${MKLROOT}/include/) -- if(${BUILD_STATIC}) # specify static libs -- find_library(MKL_LP64_LIB libmkl_intel_lp64.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB libmkl_gnu_thread.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB libmkl_core.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) -+ target_include_directories(regenie PUBLIC ${MKLROOT}/include/) -+ find_library(MKL_LP64_LIB -+ NAMES libmkl_intel_lp64.a mkl_intel_lp64 -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ if("${UNAME_S}" STREQUAL "Linux") -+ find_library(MKL_THREAD_LIB -+ NAMES libmkl_gnu_thread.a mkl_gnu_thread -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ elseif("${UNAME_S}" STREQUAL "Darwin") -+ find_library(MKL_THREAD_LIB -+ NAMES libmkl_intel_thread.a libmkl_intel_thread -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ endif() -+ find_library(MKL_CORE_LIB -+ NAMES libmkl_core.a mkl_core -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ if(${BUILD_STATIC}) -+ target_link_libraries(regenie "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) - else() # use dynamic libs -- find_library(MKL_LP64_LIB mkl_intel_lp64 PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB mkl_gnu_thread PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB mkl_core PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) -+ target_link_libraries(regenie "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) - endif() --elseif(EXISTS ${OPENBLAS_ROOT}) # OpenBLAS -- add_definitions(-DWITH_OPENBLAS -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${OPENBLAS_ROOT}/include/) -- find_library(LAPACK_LIB lapack REQUIRED) -- find_library(BLAS_LIB openblas HINTS "${OPENBLAS_ROOT}/lib/" REQUIRED) -- target_link_libraries(regenie PRIVATE ${LAPACK_LIB} -llapacke ${BLAS_LIB}) -+ message( STATUS "Will compile with Intel MKL library") - endif() - - # cxxopts (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/cxxopts/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/cxxopts/include/) - - # LBFGS (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/LBFGSpp/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/LBFGSpp/include/) - - # Eigen (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/eigen3/) -- --# Boost IO --if(${HAS_BOOST_IOSTREAM}) -- if("${UNAME_S}" STREQUAL "Darwin") -- find_library(BOOST_LIB_IO libboost_iostreams libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- elseif(${BUILD_STATIC}) -- find_library(BOOST_LIB_IO libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- else() -- target_link_libraries(regenie PRIVATE -lboost_iostreams) -- endif() -- add_definitions(-DHAS_BOOST_IOSTREAM) -- message( STATUS "Will compile with Boost Iostreams library") --endif() -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/eigen3/) - - # Other libraries --find_library(ZLIB_LIBRARY libz.a z REQUIRED) -+find_library(ZLIB_LIBRARY -+ NAMES libz.a z -+ REQUIRED -+ ) - find_library(M_LIB m REQUIRED) - find_library(DL_LIB dl REQUIRED) - if("${UNAME_S}" STREQUAL "Linux") -@@ -224,14 +213,16 @@ if("${UNAME_S}" STREQUAL "Linux") - elseif("${UNAME_S}" STREQUAL "Darwin") - find_library(GFORTRAN_LIBRARY gfortran REQUIRED) - endif() --target_link_libraries(regenie PRIVATE ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} ${GFORTRAN_LIBRARY}) -+target_link_libraries(regenie ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} ${GFORTRAN_LIBRARY}) - --install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+add_definitions(-DVERSION_NUMBER="${RG_VERSION}") -+install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) - message( STATUS "REGENIE v" ${RG_VERSION}) - --add_custom_target(full-clean -- COMMAND cd "${MVTN_PATH}" && make clean -- COMMAND cd "${QF_PATH}" && make clean -- COMMAND cd "${QUAD_PATH}" && make clean -- COMMAND cd "${PGEN_PATH}" && make clean -- ) -+write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake COMPATIBILITY SameMajorVersion) -+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake DESTINATION share/${PROJECT_NAME}) -+ -+set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) -+set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) -+set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) -+include(CPack) --- -2.24.3 (Apple Git-128) - diff --git a/recipes/regenie/patches/0007-fix-cmakelist-file-for-osx.patch b/recipes/regenie/patches/0007-fix-cmakelist-file-for-osx.patch deleted file mode 100644 index 96ebbcff9360c..0000000000000 --- a/recipes/regenie/patches/0007-fix-cmakelist-file-for-osx.patch +++ /dev/null @@ -1,306 +0,0 @@ -From a9b92e4a59ff5ef6dd030257cf7e943705130cf2 Mon Sep 17 00:00:00 2001 -From: Joelle Mbatchou -Date: Fri, 18 Mar 2022 16:18:21 -0500 -Subject: [PATCH] fix cmakelist file for osx - ---- - CMakeLists.txt | 200 ++++++++++++++++++++++--------------------------- - 1 file changed, 90 insertions(+), 110 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5153c91..eb42dc0 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,11 +1,3 @@ --# For Intel MKL, set MKLROOT= when running cmake --# e.g. MKLROOT=/opt/mkl/ cmake -S regenie_dir/ -B regenie_dir/build/ --# For OpenBLAS, set OPENBLAS_ROOT= when running cmake --# note: it also requires lapacke library --# For static compilation on Linux systems, set STATIC=1 when running cmake --# -> this excludes GLIBC -- -- - cmake_minimum_required(VERSION 3.13) - - # detect OS architecture -@@ -33,48 +25,16 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Ensures -std=c++11 - ###################################### - ######## check input variables - --# check BGEN_PATH --if("$ENV{BGEN_PATH}" STREQUAL "") -- message( FATAL_ERROR "Must specify path to BGEN library in 'BGEN_PATH'") --else() -- set(BGEN_PATH "$ENV{BGEN_PATH}" CACHE INTERNAL "Set BGEN library path") -- if (NOT EXISTS ${BGEN_PATH}) -- message( FATAL_ERROR "Specified BGEN library directory '${BGEN_PATH}' does not exist") -- endif() --endif() -- - # check for static compilation --if($ENV{STATIC}) -+if(BUILD_SHARED_LIBS) -+ set(BUILD_STATIC OFF CACHE INTERNAL "Dynamic compilation") -+ set(Boost_USE_STATIC_LIBS OFF) -+else() - set(BUILD_STATIC ON CACHE INTERNAL "Static compilation") -+ set(Boost_USE_STATIC_LIBS ON) - message( STATUS "Static compilation mode") - endif() - --# check Boost IOStreams --if($ENV{HAS_BOOST_IOSTREAM}) -- set(HAS_BOOST_IOSTREAM 1 CACHE INTERNAL "Add Boost IO") -- set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") --else() -- set(HAS_BOOST_IOSTREAM 0 CACHE INTERNAL "Skip Boost IO") --endif() -- --# check MKL --if(NOT "$ENV{MKLROOT}" STREQUAL "") -- set(MKLROOT "$ENV{MKLROOT}" CACHE INTERNAL "Set MKL library path") -- if (NOT EXISTS ${MKLROOT}) -- message( FATAL_ERROR "Specified MKL library directory '${MKLROOT}' does not exist") -- endif() -- message( STATUS "Will compile with Intel MKL library") --endif() -- --# check OpenBLAS --if(NOT "$ENV{OPENBLAS_ROOT}" STREQUAL "") -- set(OPENBLAS_ROOT "$ENV{OPENBLAS_ROOT}" CACHE INTERNAL "Set OpenBLAS library path") -- if (NOT EXISTS ${OPENBLAS_ROOT}) -- message( FATAL_ERROR "Specified OpenBLAS library directory '${OPENBLAS_ROOT}' does not exist") -- endif() -- message( STATUS "Will compile with OpenBLAS library") --endif() -- - ###################################### - ######## set flags and required libraries - -@@ -83,6 +43,7 @@ set(Boost_USE_STATIC_LIBS ${BUILD_STATIC}) - set(Boost_USE_DEBUG_LIBS OFF) - set(Boost_USE_MULTITHREADED ON) - set(Boost_USE_STATIC_RUNTIME OFF) -+set(MKLROOT "${CMAKE_PREFIX_PATH}") - - # list each file specifically - add_executable(regenie -@@ -100,32 +61,54 @@ add_executable(regenie - ${CMAKE_SOURCE_DIR}/src/Step1_Models.cpp - ${CMAKE_SOURCE_DIR}/src/Step2_Models.cpp - ) --target_include_directories(regenie PRIVATE ${CMAKE_SOURCE_DIR}/src) -+target_include_directories(regenie PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_PREFIX_PATH}/include) - - set(CMAKE_CXX_FLAGS "-O3 -Wall -pedantic -ffast-math -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-long-long -Wno-c11-extensions -fPIC") --add_definitions(-DVERSION_NUMBER="${RG_VERSION}") - -+find_package(OpenMP REQUIRED) -+target_link_libraries(regenie OpenMP::OpenMP_CXX) - if("${UNAME_S}" STREQUAL "Linux") -- find_package(OpenMP REQUIRED) -- target_link_libraries(regenie PRIVATE OpenMP::OpenMP_CXX) - if(${BUILD_STATIC}) -- target_link_options(regenie BEFORE PRIVATE -static-libgcc PRIVATE -static-libstdc++) -+ target_link_options(regenie BEFORE -static-libgcc -static-libstdc++) - endif() - elseif("${UNAME_S}" STREQUAL "Darwin") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - endif() - --set(EXTERN_LIBS_PATH "${CMAKE_SOURCE_DIR}/external_libs") --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/) -+set(EXTERN_LIBS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external_libs") -+target_include_directories(regenie PUBLIC ${EXTERN_LIBS_PATH}/) -+ -+# for BGEN (choose static if present first) -+find_library(ZSTD_LIBRARY zstd REQUIRED) -+find_library(DB_LIBRARY -+ NAMES libdb.a db -+ REQUIRED -+ ) -+find_library(SQLITE3_LIBRARY sqlite3 REQUIRED) -+find_package(Boost -+ REQUIRED COMPONENTS system filesystem thread -+ OPTIONAL_COMPONENTS iostreams -+ ) -+find_library(BGEN_LIBRARY -+ NAMES libbgen.a -+ REQUIRED -+ ) -+target_link_libraries(regenie ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARIES}) -+target_include_directories(regenie -+ PUBLIC -+ $ -+ $ -+ $ -+ $ -+ ) -+add_definitions(${Boost_DEFINITIONS}) - --# BGEN library and its dependencies --find_library(ZSTD_LIBRARY libzstd.a HINTS "${BGEN_PATH}/build/3rd_party/zstd-1.1.0" REQUIRED) --find_library(DB_LIBRARY libdb.a HINTS "${BGEN_PATH}/build/db" REQUIRED) --find_library(SQLITE3_LIBRARY libsqlite3.a HINTS "${BGEN_PATH}/build/3rd_party/sqlite3" REQUIRED) --find_library(Boost_LIBRARY libboost.a HINTS "${BGEN_PATH}/build/3rd_party/boost_1_55_0" REQUIRED) --find_library(BGEN_LIBRARY libbgen.a HINTS "${BGEN_PATH}/build" REQUIRED) --target_link_libraries(regenie PRIVATE ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARY}) --target_include_directories(regenie PRIVATE ${BGEN_PATH} ${BGEN_PATH}/genfile/include/ ${BGEN_PATH}/3rd_party/boost_1_55_0/ ${BGEN_PATH}/3rd_party/zstd-1.1.0/lib ${BGEN_PATH}/db/include/ ${BGEN_PATH}/3rd_party/sqlite3) -+# Boost IO -+if(Boost_iostreams_FOUND) -+ add_definitions(-DHAS_BOOST_IOSTREAM) -+ set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") -+ message( STATUS "Will compile with Boost Iostreams library") -+endif() - - # MVTNorm library - set(MVTN_PATH "${EXTERN_LIBS_PATH}/mvtnorm") -@@ -134,7 +117,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${MVTN_PATH} - ) --target_link_libraries(regenie PRIVATE ${MVTN_PATH}/libMvtnorm.a) -+target_link_libraries(regenie ${MVTN_PATH}/libMvtnorm.a) - add_dependencies(regenie libMvtnorm) - - # QF library -@@ -144,7 +127,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QF_PATH} - ) --target_link_libraries(regenie PRIVATE ${QF_PATH}/qf.a) -+target_link_libraries(regenie ${QF_PATH}/qf.a) - add_dependencies(regenie libqf) - - # Quadpack library -@@ -154,7 +137,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QUAD_PATH} - ) --target_link_libraries(regenie PRIVATE ${QUAD_PATH}/libquad.a) -+target_link_libraries(regenie ${QUAD_PATH}/libquad.a) - add_dependencies(regenie libquad) - - # PGEN library -@@ -164,59 +147,54 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${PGEN_PATH} - ) --target_link_libraries(regenie PRIVATE ${PGEN_PATH}/pgenlib.a) --target_include_directories(regenie PRIVATE ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) -+target_link_libraries(regenie ${PGEN_PATH}/pgenlib.a) -+target_include_directories(regenie PUBLIC ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) - add_dependencies(regenie pgenlib) - - # Intel MKL --if(EXISTS ${MKLROOT}) -+if(DEFINED MKLROOT) - add_definitions(-DWITH_MKL -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${MKLROOT}/include/) -- if(${BUILD_STATIC}) # specify static libs -- find_library(MKL_LP64_LIB libmkl_intel_lp64.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB libmkl_gnu_thread.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB libmkl_core.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) -+ target_include_directories(regenie PUBLIC ${MKLROOT}/include/) -+ find_library(MKL_LP64_LIB mkl_intel_lp64 -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ if("${UNAME_S}" STREQUAL "Linux") -+ find_library(MKL_THREAD_LIB mkl_gnu_thread -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ elseif("${UNAME_S}" STREQUAL "Darwin") -+ find_library(MKL_THREAD_LIB mkl_intel_thread -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ endif() -+ find_library(MKL_CORE_LIB mkl_core -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ if("${UNAME_S}" STREQUAL "Darwin") -+ target_link_libraries(regenie ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB}) -+ elseif(${BUILD_STATIC}) -+ target_link_libraries(regenie "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) - else() # use dynamic libs -- find_library(MKL_LP64_LIB mkl_intel_lp64 PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB mkl_gnu_thread PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB mkl_core PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) -+ target_link_libraries(regenie "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) - endif() --elseif(EXISTS ${OPENBLAS_ROOT}) # OpenBLAS -- add_definitions(-DWITH_OPENBLAS -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${OPENBLAS_ROOT}/include/) -- find_library(LAPACK_LIB lapack REQUIRED) -- find_library(BLAS_LIB openblas HINTS "${OPENBLAS_ROOT}/lib/" REQUIRED) -- target_link_libraries(regenie PRIVATE ${LAPACK_LIB} -llapacke ${BLAS_LIB}) -+ message( STATUS "Will compile with Intel MKL library") - endif() - - # cxxopts (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/cxxopts/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/cxxopts/include/) - - # LBFGS (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/LBFGSpp/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/LBFGSpp/include/) - - # Eigen (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/eigen3/) -- --# Boost IO --if(${HAS_BOOST_IOSTREAM}) -- if("${UNAME_S}" STREQUAL "Darwin") -- find_library(BOOST_LIB_IO libboost_iostreams libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- elseif(${BUILD_STATIC}) -- find_library(BOOST_LIB_IO libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- else() -- target_link_libraries(regenie PRIVATE -lboost_iostreams) -- endif() -- add_definitions(-DHAS_BOOST_IOSTREAM) -- message( STATUS "Will compile with Boost Iostreams library") --endif() -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/eigen3/) - - # Other libraries --find_library(ZLIB_LIBRARY libz.a z REQUIRED) -+find_library(ZLIB_LIBRARY z REQUIRED) - find_library(M_LIB m REQUIRED) - find_library(DL_LIB dl REQUIRED) - if("${UNAME_S}" STREQUAL "Linux") -@@ -224,14 +202,16 @@ if("${UNAME_S}" STREQUAL "Linux") - elseif("${UNAME_S}" STREQUAL "Darwin") - find_library(GFORTRAN_LIBRARY gfortran REQUIRED) - endif() --target_link_libraries(regenie PRIVATE ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} ${GFORTRAN_LIBRARY}) -+target_link_libraries(regenie ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} ${GFORTRAN_LIBRARY}) - --install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+add_definitions(-DVERSION_NUMBER="${RG_VERSION}") -+install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) - message( STATUS "REGENIE v" ${RG_VERSION}) - --add_custom_target(full-clean -- COMMAND cd "${MVTN_PATH}" && make clean -- COMMAND cd "${QF_PATH}" && make clean -- COMMAND cd "${QUAD_PATH}" && make clean -- COMMAND cd "${PGEN_PATH}" && make clean -- ) -+write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake COMPATIBILITY SameMajorVersion) -+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake DESTINATION share/${PROJECT_NAME}) -+ -+set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) -+set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) -+set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) -+include(CPack) --- -2.24.3 (Apple Git-128) - diff --git a/recipes/regenie/patches/0008-fix-cmakelist-file-for-osx-eigen4.patch b/recipes/regenie/patches/0008-fix-cmakelist-file-for-osx-eigen4.patch deleted file mode 100644 index 9eabffee7acef..0000000000000 --- a/recipes/regenie/patches/0008-fix-cmakelist-file-for-osx-eigen4.patch +++ /dev/null @@ -1,306 +0,0 @@ -From b58421061df0fd430f2543df4d63f2d1aa1ba6b3 Mon Sep 17 00:00:00 2001 -From: Joelle Mbatchou -Date: Fri, 6 May 2022 09:52:15 -0500 -Subject: [PATCH] fix cmakelist file for osx with eigen 3.4 - ---- - CMakeLists.txt | 200 ++++++++++++++++++++++--------------------------- - 1 file changed, 90 insertions(+), 110 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3c8567b..be834ab 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,11 +1,3 @@ --# For Intel MKL, set MKLROOT= when running cmake --# e.g. MKLROOT=/opt/mkl/ cmake -S regenie_dir/ -B regenie_dir/build/ --# For OpenBLAS, set OPENBLAS_ROOT= when running cmake --# note: it also requires lapacke library --# For static compilation on Linux systems, set STATIC=1 when running cmake --# -> this excludes GLIBC -- -- - cmake_minimum_required(VERSION 3.13) - - # detect OS architecture -@@ -33,48 +25,16 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Ensures -std=c++11 - ###################################### - ######## check input variables - --# check BGEN_PATH --if("$ENV{BGEN_PATH}" STREQUAL "") -- message( FATAL_ERROR "Must specify path to BGEN library in 'BGEN_PATH'") --else() -- set(BGEN_PATH "$ENV{BGEN_PATH}" CACHE INTERNAL "Set BGEN library path") -- if (NOT EXISTS ${BGEN_PATH}) -- message( FATAL_ERROR "Specified BGEN library directory '${BGEN_PATH}' does not exist") -- endif() --endif() -- - # check for static compilation --if($ENV{STATIC}) -+if(BUILD_SHARED_LIBS) -+ set(BUILD_STATIC OFF CACHE INTERNAL "Dynamic compilation") -+ set(Boost_USE_STATIC_LIBS OFF) -+else() - set(BUILD_STATIC ON CACHE INTERNAL "Static compilation") -+ set(Boost_USE_STATIC_LIBS ON) - message( STATUS "Static compilation mode") - endif() - --# check Boost IOStreams --if($ENV{HAS_BOOST_IOSTREAM}) -- set(HAS_BOOST_IOSTREAM 1 CACHE INTERNAL "Add Boost IO") -- set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") --else() -- set(HAS_BOOST_IOSTREAM 0 CACHE INTERNAL "Skip Boost IO") --endif() -- --# check MKL --if(NOT "$ENV{MKLROOT}" STREQUAL "") -- set(MKLROOT "$ENV{MKLROOT}" CACHE INTERNAL "Set MKL library path") -- if (NOT EXISTS ${MKLROOT}) -- message( FATAL_ERROR "Specified MKL library directory '${MKLROOT}' does not exist") -- endif() -- message( STATUS "Will compile with Intel MKL library") --endif() -- --# check OpenBLAS --if(NOT "$ENV{OPENBLAS_ROOT}" STREQUAL "") -- set(OPENBLAS_ROOT "$ENV{OPENBLAS_ROOT}" CACHE INTERNAL "Set OpenBLAS library path") -- if (NOT EXISTS ${OPENBLAS_ROOT}) -- message( FATAL_ERROR "Specified OpenBLAS library directory '${OPENBLAS_ROOT}' does not exist") -- endif() -- message( STATUS "Will compile with OpenBLAS library") --endif() -- - ###################################### - ######## set flags and required libraries - -@@ -83,6 +43,7 @@ set(Boost_USE_STATIC_LIBS ${BUILD_STATIC}) - set(Boost_USE_DEBUG_LIBS OFF) - set(Boost_USE_MULTITHREADED ON) - set(Boost_USE_STATIC_RUNTIME OFF) -+set(MKLROOT "${CMAKE_PREFIX_PATH}") - - # list each file specifically - add_executable(regenie -@@ -100,32 +61,54 @@ add_executable(regenie - ${CMAKE_SOURCE_DIR}/src/Step1_Models.cpp - ${CMAKE_SOURCE_DIR}/src/Step2_Models.cpp - ) --target_include_directories(regenie PRIVATE ${CMAKE_SOURCE_DIR}/src) -+target_include_directories(regenie PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_PREFIX_PATH}/include) - - set(CMAKE_CXX_FLAGS "-O3 -Wall -pedantic -ffast-math -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-long-long -Wno-c11-extensions -fPIC") --add_definitions(-DVERSION_NUMBER="${RG_VERSION}") - -+find_package(OpenMP REQUIRED) -+target_link_libraries(regenie OpenMP::OpenMP_CXX) - if("${UNAME_S}" STREQUAL "Linux") -- find_package(OpenMP REQUIRED) -- target_link_libraries(regenie PRIVATE OpenMP::OpenMP_CXX) - if(${BUILD_STATIC}) -- target_link_options(regenie BEFORE PRIVATE -static-libgcc PRIVATE -static-libstdc++) -+ target_link_options(regenie BEFORE -static-libgcc -static-libstdc++) - endif() - elseif("${UNAME_S}" STREQUAL "Darwin") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - endif() - --set(EXTERN_LIBS_PATH "${CMAKE_SOURCE_DIR}/external_libs") --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/) -+set(EXTERN_LIBS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external_libs") -+target_include_directories(regenie PUBLIC ${EXTERN_LIBS_PATH}/) -+ -+# for BGEN (choose static if present first) -+find_library(ZSTD_LIBRARY zstd REQUIRED) -+find_library(DB_LIBRARY -+ NAMES libdb.a db -+ REQUIRED -+ ) -+find_library(SQLITE3_LIBRARY sqlite3 REQUIRED) -+find_package(Boost -+ REQUIRED COMPONENTS system filesystem thread -+ OPTIONAL_COMPONENTS iostreams -+ ) -+find_library(BGEN_LIBRARY -+ NAMES libbgen.a -+ REQUIRED -+ ) -+target_link_libraries(regenie ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARIES}) -+target_include_directories(regenie -+ PUBLIC -+ $ -+ $ -+ $ -+ $ -+ ) -+add_definitions(${Boost_DEFINITIONS}) - --# BGEN library and its dependencies --find_library(ZSTD_LIBRARY libzstd.a HINTS "${BGEN_PATH}/build/3rd_party/zstd-1.1.0" REQUIRED) --find_library(DB_LIBRARY libdb.a HINTS "${BGEN_PATH}/build/db" REQUIRED) --find_library(SQLITE3_LIBRARY libsqlite3.a HINTS "${BGEN_PATH}/build/3rd_party/sqlite3" REQUIRED) --find_library(Boost_LIBRARY libboost.a HINTS "${BGEN_PATH}/build/3rd_party/boost_1_55_0" REQUIRED) --find_library(BGEN_LIBRARY libbgen.a HINTS "${BGEN_PATH}/build" REQUIRED) --target_link_libraries(regenie PRIVATE ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARY}) --target_include_directories(regenie PRIVATE ${BGEN_PATH} ${BGEN_PATH}/genfile/include/ ${BGEN_PATH}/3rd_party/boost_1_55_0/ ${BGEN_PATH}/3rd_party/zstd-1.1.0/lib ${BGEN_PATH}/db/include/ ${BGEN_PATH}/3rd_party/sqlite3) -+# Boost IO -+if(Boost_iostreams_FOUND) -+ add_definitions(-DHAS_BOOST_IOSTREAM) -+ set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") -+ message( STATUS "Will compile with Boost Iostreams library") -+endif() - - # MVTNorm library - set(MVTN_PATH "${EXTERN_LIBS_PATH}/mvtnorm") -@@ -134,7 +117,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${MVTN_PATH} - ) --target_link_libraries(regenie PRIVATE ${MVTN_PATH}/libMvtnorm.a) -+target_link_libraries(regenie ${MVTN_PATH}/libMvtnorm.a) - add_dependencies(regenie libMvtnorm) - - # QF library -@@ -144,7 +127,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QF_PATH} - ) --target_link_libraries(regenie PRIVATE ${QF_PATH}/qf.a) -+target_link_libraries(regenie ${QF_PATH}/qf.a) - add_dependencies(regenie libqf) - - # Quadpack library -@@ -154,7 +137,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QUAD_PATH} - ) --target_link_libraries(regenie PRIVATE ${QUAD_PATH}/libquad.a) -+target_link_libraries(regenie ${QUAD_PATH}/libquad.a) - add_dependencies(regenie libquad) - - # PGEN library -@@ -164,59 +147,54 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${PGEN_PATH} - ) --target_link_libraries(regenie PRIVATE ${PGEN_PATH}/pgenlib.a) --target_include_directories(regenie PRIVATE ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) -+target_link_libraries(regenie ${PGEN_PATH}/pgenlib.a) -+target_include_directories(regenie PUBLIC ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) - add_dependencies(regenie pgenlib) - - # Intel MKL --if(EXISTS ${MKLROOT}) -+if(DEFINED MKLROOT) - add_definitions(-DWITH_MKL -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${MKLROOT}/include/) -- if(${BUILD_STATIC}) # specify static libs -- find_library(MKL_LP64_LIB libmkl_intel_lp64.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB libmkl_gnu_thread.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB libmkl_core.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) -+ target_include_directories(regenie PUBLIC ${MKLROOT}/include/) -+ find_library(MKL_LP64_LIB mkl_intel_lp64 -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ if("${UNAME_S}" STREQUAL "Linux") -+ find_library(MKL_THREAD_LIB mkl_gnu_thread -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ elseif("${UNAME_S}" STREQUAL "Darwin") -+ find_library(MKL_THREAD_LIB mkl_intel_thread -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ endif() -+ find_library(MKL_CORE_LIB mkl_core -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ if("${UNAME_S}" STREQUAL "Darwin") -+ target_link_libraries(regenie ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB}) -+ elseif(${BUILD_STATIC}) -+ target_link_libraries(regenie "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) - else() # use dynamic libs -- find_library(MKL_LP64_LIB mkl_intel_lp64 PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB mkl_gnu_thread PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB mkl_core PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) -+ target_link_libraries(regenie "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) - endif() --elseif(EXISTS ${OPENBLAS_ROOT}) # OpenBLAS -- add_definitions(-DWITH_OPENBLAS -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${OPENBLAS_ROOT}/include/) -- find_library(LAPACK_LIB lapack REQUIRED) -- find_library(BLAS_LIB openblas HINTS "${OPENBLAS_ROOT}/lib/" REQUIRED) -- target_link_libraries(regenie PRIVATE ${LAPACK_LIB} -llapacke ${BLAS_LIB}) -+ message( STATUS "Will compile with Intel MKL library") - endif() - - # cxxopts (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/cxxopts/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/cxxopts/include/) - - # LBFGS (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/LBFGSpp/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/LBFGSpp/include/) - - # Eigen (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/eigen-3.4.0/) -- --# Boost IO --if(${HAS_BOOST_IOSTREAM}) -- if("${UNAME_S}" STREQUAL "Darwin") -- find_library(BOOST_LIB_IO libboost_iostreams libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- elseif(${BUILD_STATIC}) -- find_library(BOOST_LIB_IO libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- else() -- target_link_libraries(regenie PRIVATE -lboost_iostreams) -- endif() -- add_definitions(-DHAS_BOOST_IOSTREAM) -- message( STATUS "Will compile with Boost Iostreams library") --endif() -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/eigen-3.4.0/) - - # Other libraries --find_library(ZLIB_LIBRARY libz.a z REQUIRED) -+find_library(ZLIB_LIBRARY z REQUIRED) - find_library(M_LIB m REQUIRED) - find_library(DL_LIB dl REQUIRED) - if("${UNAME_S}" STREQUAL "Linux") -@@ -224,14 +202,16 @@ if("${UNAME_S}" STREQUAL "Linux") - elseif("${UNAME_S}" STREQUAL "Darwin") - find_library(GFORTRAN_LIBRARY gfortran REQUIRED) - endif() --target_link_libraries(regenie PRIVATE ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} ${GFORTRAN_LIBRARY}) -+target_link_libraries(regenie ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} ${GFORTRAN_LIBRARY}) - --install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+add_definitions(-DVERSION_NUMBER="${RG_VERSION}") -+install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) - message( STATUS "REGENIE v" ${RG_VERSION}) - --add_custom_target(full-clean -- COMMAND cd "${MVTN_PATH}" && make clean -- COMMAND cd "${QF_PATH}" && make clean -- COMMAND cd "${QUAD_PATH}" && make clean -- COMMAND cd "${PGEN_PATH}" && make clean -- ) -+write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake COMPATIBILITY SameMajorVersion) -+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake DESTINATION share/${PROJECT_NAME}) -+ -+set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) -+set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) -+set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) -+include(CPack) --- -2.24.3 (Apple Git-128) - diff --git a/recipes/regenie/patches/0009-update-cmake-file-for-conda.patch b/recipes/regenie/patches/0009-update-cmake-file-for-conda.patch deleted file mode 100644 index 43ad9b33cceed..0000000000000 --- a/recipes/regenie/patches/0009-update-cmake-file-for-conda.patch +++ /dev/null @@ -1,306 +0,0 @@ -From 9bf99e79a94e10430f6695b5fb1b21dd407a7486 Mon Sep 17 00:00:00 2001 -From: Joelle Mbatchou -Date: Fri, 10 Jun 2022 14:18:59 -0400 -Subject: [PATCH] update cmake file for conda - ---- - CMakeLists.txt | 200 ++++++++++++++++++++++--------------------------- - 1 file changed, 90 insertions(+), 110 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 38ef1d7..7e39c4f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,11 +1,3 @@ --# For Intel MKL, set MKLROOT= when running cmake --# e.g. MKLROOT=/opt/mkl/ cmake -S regenie_dir/ -B regenie_dir/build/ --# For OpenBLAS, set OPENBLAS_ROOT= when running cmake --# note: it also requires lapacke library --# For static compilation on Linux systems, set STATIC=1 when running cmake --# -> this excludes GLIBC -- -- - cmake_minimum_required(VERSION 3.13) - - # detect OS architecture -@@ -33,48 +25,16 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Ensures -std=c++11 - ###################################### - ######## check input variables - --# check BGEN_PATH --if("$ENV{BGEN_PATH}" STREQUAL "") -- message( FATAL_ERROR "Must specify path to BGEN library in 'BGEN_PATH'") --else() -- set(BGEN_PATH "$ENV{BGEN_PATH}" CACHE INTERNAL "Set BGEN library path") -- if (NOT EXISTS ${BGEN_PATH}) -- message( FATAL_ERROR "Specified BGEN library directory '${BGEN_PATH}' does not exist") -- endif() --endif() -- - # check for static compilation --if($ENV{STATIC}) -+if(BUILD_SHARED_LIBS) -+ set(BUILD_STATIC OFF CACHE INTERNAL "Dynamic compilation") -+ set(Boost_USE_STATIC_LIBS OFF) -+else() - set(BUILD_STATIC ON CACHE INTERNAL "Static compilation") -+ set(Boost_USE_STATIC_LIBS ON) - message( STATUS "Static compilation mode") - endif() - --# check Boost IOStreams --if($ENV{HAS_BOOST_IOSTREAM}) -- set(HAS_BOOST_IOSTREAM 1 CACHE INTERNAL "Add Boost IO") -- set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") --else() -- set(HAS_BOOST_IOSTREAM 0 CACHE INTERNAL "Skip Boost IO") --endif() -- --# check MKL --if(NOT "$ENV{MKLROOT}" STREQUAL "") -- set(MKLROOT "$ENV{MKLROOT}" CACHE INTERNAL "Set MKL library path") -- if (NOT EXISTS ${MKLROOT}) -- message( FATAL_ERROR "Specified MKL library directory '${MKLROOT}' does not exist") -- endif() -- message( STATUS "Will compile with Intel MKL library") --endif() -- --# check OpenBLAS --if(NOT "$ENV{OPENBLAS_ROOT}" STREQUAL "") -- set(OPENBLAS_ROOT "$ENV{OPENBLAS_ROOT}" CACHE INTERNAL "Set OpenBLAS library path") -- if (NOT EXISTS ${OPENBLAS_ROOT}) -- message( FATAL_ERROR "Specified OpenBLAS library directory '${OPENBLAS_ROOT}' does not exist") -- endif() -- message( STATUS "Will compile with OpenBLAS library") --endif() -- - ###################################### - ######## set flags and required libraries - -@@ -83,6 +43,7 @@ set(Boost_USE_STATIC_LIBS ${BUILD_STATIC}) - set(Boost_USE_DEBUG_LIBS OFF) - set(Boost_USE_MULTITHREADED ON) - set(Boost_USE_STATIC_RUNTIME OFF) -+set(MKLROOT "${CMAKE_PREFIX_PATH}") - - # list each file specifically - add_executable(regenie -@@ -101,32 +62,54 @@ add_executable(regenie - ${CMAKE_SOURCE_DIR}/src/Step2_Models.cpp - ${CMAKE_SOURCE_DIR}/src/MultiTrait_Tests.cpp - ) --target_include_directories(regenie PRIVATE ${CMAKE_SOURCE_DIR}/src) -+target_include_directories(regenie PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_PREFIX_PATH}/include) - - set(CMAKE_CXX_FLAGS "-O3 -Wall -pedantic -ffast-math -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-long-long -Wno-c11-extensions -fPIC") --add_definitions(-DVERSION_NUMBER="${RG_VERSION}") - -+find_package(OpenMP REQUIRED) -+target_link_libraries(regenie OpenMP::OpenMP_CXX) - if("${UNAME_S}" STREQUAL "Linux") -- find_package(OpenMP REQUIRED) -- target_link_libraries(regenie PRIVATE OpenMP::OpenMP_CXX) - if(${BUILD_STATIC}) -- target_link_options(regenie BEFORE PRIVATE -static-libgcc PRIVATE -static-libstdc++) -+ target_link_options(regenie BEFORE -static-libgcc -static-libstdc++) - endif() - elseif("${UNAME_S}" STREQUAL "Darwin") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - endif() - --set(EXTERN_LIBS_PATH "${CMAKE_SOURCE_DIR}/external_libs") --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/) -+set(EXTERN_LIBS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external_libs") -+target_include_directories(regenie PUBLIC ${EXTERN_LIBS_PATH}/) -+ -+# for BGEN (choose static if present first) -+find_library(ZSTD_LIBRARY zstd REQUIRED) -+find_library(DB_LIBRARY -+ NAMES libdb.a db -+ REQUIRED -+ ) -+find_library(SQLITE3_LIBRARY sqlite3 REQUIRED) -+find_package(Boost -+ REQUIRED COMPONENTS system filesystem thread -+ OPTIONAL_COMPONENTS iostreams -+ ) -+find_library(BGEN_LIBRARY -+ NAMES libbgen.a -+ REQUIRED -+ ) -+target_link_libraries(regenie ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARIES}) -+target_include_directories(regenie -+ PUBLIC -+ $ -+ $ -+ $ -+ $ -+ ) -+add_definitions(${Boost_DEFINITIONS}) - --# BGEN library and its dependencies --find_library(ZSTD_LIBRARY libzstd.a HINTS "${BGEN_PATH}/build/3rd_party/zstd-1.1.0" REQUIRED) --find_library(DB_LIBRARY libdb.a HINTS "${BGEN_PATH}/build/db" REQUIRED) --find_library(SQLITE3_LIBRARY libsqlite3.a HINTS "${BGEN_PATH}/build/3rd_party/sqlite3" REQUIRED) --find_library(Boost_LIBRARY libboost.a HINTS "${BGEN_PATH}/build/3rd_party/boost_1_55_0" REQUIRED) --find_library(BGEN_LIBRARY libbgen.a HINTS "${BGEN_PATH}/build" REQUIRED) --target_link_libraries(regenie PRIVATE ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARY}) --target_include_directories(regenie PRIVATE ${BGEN_PATH} ${BGEN_PATH}/genfile/include/ ${BGEN_PATH}/3rd_party/boost_1_55_0/ ${BGEN_PATH}/3rd_party/zstd-1.1.0/lib ${BGEN_PATH}/db/include/ ${BGEN_PATH}/3rd_party/sqlite3) -+# Boost IO -+if(Boost_iostreams_FOUND) -+ add_definitions(-DHAS_BOOST_IOSTREAM) -+ set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") -+ message( STATUS "Will compile with Boost Iostreams library") -+endif() - - # MVTNorm library - set(MVTN_PATH "${EXTERN_LIBS_PATH}/mvtnorm") -@@ -135,7 +118,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${MVTN_PATH} - ) --target_link_libraries(regenie PRIVATE ${MVTN_PATH}/libMvtnorm.a) -+target_link_libraries(regenie ${MVTN_PATH}/libMvtnorm.a) - add_dependencies(regenie libMvtnorm) - - # QF library -@@ -145,7 +128,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QF_PATH} - ) --target_link_libraries(regenie PRIVATE ${QF_PATH}/qf.a) -+target_link_libraries(regenie ${QF_PATH}/qf.a) - add_dependencies(regenie libqf) - - # Quadpack library -@@ -155,7 +138,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QUAD_PATH} - ) --target_link_libraries(regenie PRIVATE ${QUAD_PATH}/libquad.a) -+target_link_libraries(regenie ${QUAD_PATH}/libquad.a) - add_dependencies(regenie libquad) - - # PGEN library -@@ -165,59 +148,54 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${PGEN_PATH} - ) --target_link_libraries(regenie PRIVATE ${PGEN_PATH}/pgenlib.a) --target_include_directories(regenie PRIVATE ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) -+target_link_libraries(regenie ${PGEN_PATH}/pgenlib.a) -+target_include_directories(regenie PUBLIC ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) - add_dependencies(regenie pgenlib) - - # Intel MKL --if(EXISTS ${MKLROOT}) -+if(DEFINED MKLROOT) - add_definitions(-DWITH_MKL -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${MKLROOT}/include/) -- if(${BUILD_STATIC}) # specify static libs -- find_library(MKL_LP64_LIB libmkl_intel_lp64.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB libmkl_gnu_thread.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB libmkl_core.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) -+ target_include_directories(regenie PUBLIC ${MKLROOT}/include/) -+ find_library(MKL_LP64_LIB mkl_intel_lp64 -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ if("${UNAME_S}" STREQUAL "Linux") -+ find_library(MKL_THREAD_LIB mkl_gnu_thread -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ elseif("${UNAME_S}" STREQUAL "Darwin") -+ find_library(MKL_THREAD_LIB mkl_intel_thread -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ endif() -+ find_library(MKL_CORE_LIB mkl_core -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ if("${UNAME_S}" STREQUAL "Darwin") -+ target_link_libraries(regenie ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB}) -+ elseif(${BUILD_STATIC}) -+ target_link_libraries(regenie "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) - else() # use dynamic libs -- find_library(MKL_LP64_LIB mkl_intel_lp64 PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB mkl_gnu_thread PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB mkl_core PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) -+ target_link_libraries(regenie "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) - endif() --elseif(EXISTS ${OPENBLAS_ROOT}) # OpenBLAS -- add_definitions(-DWITH_OPENBLAS -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${OPENBLAS_ROOT}/include/) -- find_library(LAPACK_LIB lapack REQUIRED) -- find_library(BLAS_LIB openblas HINTS "${OPENBLAS_ROOT}/lib/" REQUIRED) -- target_link_libraries(regenie PRIVATE ${LAPACK_LIB} -llapacke ${BLAS_LIB}) -+ message( STATUS "Will compile with Intel MKL library") - endif() - - # cxxopts (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/cxxopts/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/cxxopts/include/) - - # LBFGS (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/LBFGSpp/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/LBFGSpp/include/) - - # Eigen (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/eigen-3.4.0/) -- --# Boost IO --if(${HAS_BOOST_IOSTREAM}) -- if("${UNAME_S}" STREQUAL "Darwin") -- find_library(BOOST_LIB_IO libboost_iostreams libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- elseif(${BUILD_STATIC}) -- find_library(BOOST_LIB_IO libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- else() -- target_link_libraries(regenie PRIVATE -lboost_iostreams) -- endif() -- add_definitions(-DHAS_BOOST_IOSTREAM) -- message( STATUS "Will compile with Boost Iostreams library") --endif() -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/eigen-3.4.0/) - - # Other libraries --find_library(ZLIB_LIBRARY libz.a z REQUIRED) -+find_library(ZLIB_LIBRARY z REQUIRED) - find_library(M_LIB m REQUIRED) - find_library(DL_LIB dl REQUIRED) - if("${UNAME_S}" STREQUAL "Linux") -@@ -225,14 +203,16 @@ if("${UNAME_S}" STREQUAL "Linux") - elseif("${UNAME_S}" STREQUAL "Darwin") - find_library(GFORTRAN_LIBRARY gfortran REQUIRED) - endif() --target_link_libraries(regenie PRIVATE ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} ${GFORTRAN_LIBRARY}) -+target_link_libraries(regenie ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} ${GFORTRAN_LIBRARY}) - --install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+add_definitions(-DVERSION_NUMBER="${RG_VERSION}") -+install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) - message( STATUS "REGENIE v" ${RG_VERSION}) - --add_custom_target(full-clean -- COMMAND cd "${MVTN_PATH}" && make clean -- COMMAND cd "${QF_PATH}" && make clean -- COMMAND cd "${QUAD_PATH}" && make clean -- COMMAND cd "${PGEN_PATH}" && make clean -- ) -+write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake COMPATIBILITY SameMajorVersion) -+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake DESTINATION share/${PROJECT_NAME}) -+ -+set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) -+set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) -+set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) -+include(CPack) --- -2.24.3 (Apple Git-128) - diff --git a/recipes/regenie/patches/0010-update-cmakelist-file-for-v3.2.7.patch b/recipes/regenie/patches/0010-update-cmakelist-file-for-v3.2.7.patch deleted file mode 100644 index 0998cd21e430c..0000000000000 --- a/recipes/regenie/patches/0010-update-cmakelist-file-for-v3.2.7.patch +++ /dev/null @@ -1,306 +0,0 @@ -From ff9af7e2ed26995c99a879b2813adc12a986b64e Mon Sep 17 00:00:00 2001 -From: Joelle Mbatchou -Date: Wed, 17 May 2023 16:19:07 -0400 -Subject: [PATCH] update cmakelist file for v3.2.7 - ---- - CMakeLists.txt | 200 ++++++++++++++++++++++--------------------------- - 1 file changed, 90 insertions(+), 110 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e81d7c8..cd376c6 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,11 +1,3 @@ --# For Intel MKL, set MKLROOT= when running cmake --# e.g. MKLROOT=/opt/mkl/ cmake -S regenie_dir/ -B regenie_dir/build/ --# For OpenBLAS, set OPENBLAS_ROOT= when running cmake --# note: it also requires lapacke library --# For static compilation on Linux systems, set STATIC=1 when running cmake --# -> this excludes GLIBC -- -- - cmake_minimum_required(VERSION 3.13) - - # detect OS architecture -@@ -33,48 +25,16 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Ensures -std=c++11 - ###################################### - ######## check input variables - --# check BGEN_PATH --if("$ENV{BGEN_PATH}" STREQUAL "") -- message( FATAL_ERROR "Must specify path to BGEN library in 'BGEN_PATH'") --else() -- set(BGEN_PATH "$ENV{BGEN_PATH}" CACHE INTERNAL "Set BGEN library path") -- if (NOT EXISTS ${BGEN_PATH}) -- message( FATAL_ERROR "Specified BGEN library directory '${BGEN_PATH}' does not exist") -- endif() --endif() -- - # check for static compilation --if($ENV{STATIC}) -+if(BUILD_SHARED_LIBS) -+ set(BUILD_STATIC OFF CACHE INTERNAL "Dynamic compilation") -+ set(Boost_USE_STATIC_LIBS OFF) -+else() - set(BUILD_STATIC ON CACHE INTERNAL "Static compilation") -+ set(Boost_USE_STATIC_LIBS ON) - message( STATUS "Static compilation mode") - endif() - --# check Boost IOStreams --if($ENV{HAS_BOOST_IOSTREAM}) -- set(HAS_BOOST_IOSTREAM 1 CACHE INTERNAL "Add Boost IO") -- set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") --else() -- set(HAS_BOOST_IOSTREAM 0 CACHE INTERNAL "Skip Boost IO") --endif() -- --# check MKL --if(NOT "$ENV{MKLROOT}" STREQUAL "") -- set(MKLROOT "$ENV{MKLROOT}" CACHE INTERNAL "Set MKL library path") -- if (NOT EXISTS ${MKLROOT}) -- message( FATAL_ERROR "Specified MKL library directory '${MKLROOT}' does not exist") -- endif() -- message( STATUS "Will compile with Intel MKL library") --endif() -- --# check OpenBLAS --if(NOT "$ENV{OPENBLAS_ROOT}" STREQUAL "") -- set(OPENBLAS_ROOT "$ENV{OPENBLAS_ROOT}" CACHE INTERNAL "Set OpenBLAS library path") -- if (NOT EXISTS ${OPENBLAS_ROOT}) -- message( FATAL_ERROR "Specified OpenBLAS library directory '${OPENBLAS_ROOT}' does not exist") -- endif() -- message( STATUS "Will compile with OpenBLAS library") --endif() -- - ###################################### - ######## set flags and required libraries - -@@ -83,6 +43,7 @@ set(Boost_USE_STATIC_LIBS ${BUILD_STATIC}) - set(Boost_USE_DEBUG_LIBS OFF) - set(Boost_USE_MULTITHREADED ON) - set(Boost_USE_STATIC_RUNTIME OFF) -+set(MKLROOT "${CMAKE_PREFIX_PATH}") - - # list each file specifically - add_executable(regenie -@@ -102,32 +63,54 @@ add_executable(regenie - ${CMAKE_SOURCE_DIR}/src/MultiTrait_Tests.cpp - ${CMAKE_SOURCE_DIR}/src/MCC.cpp - ) --target_include_directories(regenie PRIVATE ${CMAKE_SOURCE_DIR}/src) -+target_include_directories(regenie PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_PREFIX_PATH}/include) - - set(CMAKE_CXX_FLAGS "-O3 -Wall -pedantic -ffast-math -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-long-long -Wno-c11-extensions -fPIC") --add_definitions(-DVERSION_NUMBER="${RG_VERSION}") - -+find_package(OpenMP REQUIRED) -+target_link_libraries(regenie OpenMP::OpenMP_CXX) - if("${UNAME_S}" STREQUAL "Linux") -- find_package(OpenMP REQUIRED) -- target_link_libraries(regenie PRIVATE OpenMP::OpenMP_CXX) - if(${BUILD_STATIC}) -- target_link_options(regenie BEFORE PRIVATE -static-libgcc PRIVATE -static-libstdc++) -+ target_link_options(regenie BEFORE -static-libgcc -static-libstdc++) - endif() - elseif("${UNAME_S}" STREQUAL "Darwin") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - endif() - --set(EXTERN_LIBS_PATH "${CMAKE_SOURCE_DIR}/external_libs") --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/) -+set(EXTERN_LIBS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external_libs") -+target_include_directories(regenie PUBLIC ${EXTERN_LIBS_PATH}/) -+ -+# for BGEN (choose static if present first) -+find_library(ZSTD_LIBRARY zstd REQUIRED) -+find_library(DB_LIBRARY -+ NAMES libdb.a db -+ REQUIRED -+ ) -+find_library(SQLITE3_LIBRARY sqlite3 REQUIRED) -+find_package(Boost -+ REQUIRED COMPONENTS system filesystem thread -+ OPTIONAL_COMPONENTS iostreams -+ ) -+find_library(BGEN_LIBRARY -+ NAMES libbgen.a -+ REQUIRED -+ ) -+target_link_libraries(regenie ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARIES}) -+target_include_directories(regenie -+ PUBLIC -+ $ -+ $ -+ $ -+ $ -+ ) -+add_definitions(${Boost_DEFINITIONS}) - --# BGEN library and its dependencies --find_library(ZSTD_LIBRARY libzstd.a HINTS "${BGEN_PATH}/build/3rd_party/zstd-1.1.0" REQUIRED) --find_library(DB_LIBRARY libdb.a HINTS "${BGEN_PATH}/build/db" REQUIRED) --find_library(SQLITE3_LIBRARY libsqlite3.a HINTS "${BGEN_PATH}/build/3rd_party/sqlite3" REQUIRED) --find_library(Boost_LIBRARY libboost.a HINTS "${BGEN_PATH}/build/3rd_party/boost_1_55_0" REQUIRED) --find_library(BGEN_LIBRARY libbgen.a HINTS "${BGEN_PATH}/build" REQUIRED) --target_link_libraries(regenie PRIVATE ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARY}) --target_include_directories(regenie PRIVATE ${BGEN_PATH} ${BGEN_PATH}/genfile/include/ ${BGEN_PATH}/3rd_party/boost_1_55_0/ ${BGEN_PATH}/3rd_party/zstd-1.1.0/lib ${BGEN_PATH}/db/include/ ${BGEN_PATH}/3rd_party/sqlite3) -+# Boost IO -+if(Boost_iostreams_FOUND) -+ add_definitions(-DHAS_BOOST_IOSTREAM) -+ set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") -+ message( STATUS "Will compile with Boost Iostreams library") -+endif() - - # MVTNorm library - set(MVTN_PATH "${EXTERN_LIBS_PATH}/mvtnorm") -@@ -136,7 +119,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${MVTN_PATH} - ) --target_link_libraries(regenie PRIVATE ${MVTN_PATH}/libMvtnorm.a) -+target_link_libraries(regenie ${MVTN_PATH}/libMvtnorm.a) - add_dependencies(regenie libMvtnorm) - - # QF library -@@ -146,7 +129,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QF_PATH} - ) --target_link_libraries(regenie PRIVATE ${QF_PATH}/qf.a) -+target_link_libraries(regenie ${QF_PATH}/qf.a) - add_dependencies(regenie libqf) - - # Quadpack library -@@ -156,7 +139,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QUAD_PATH} - ) --target_link_libraries(regenie PRIVATE ${QUAD_PATH}/libquad.a) -+target_link_libraries(regenie ${QUAD_PATH}/libquad.a) - add_dependencies(regenie libquad) - - # PGEN library -@@ -166,59 +149,54 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${PGEN_PATH} - ) --target_link_libraries(regenie PRIVATE ${PGEN_PATH}/pgenlib.a) --target_include_directories(regenie PRIVATE ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) -+target_link_libraries(regenie ${PGEN_PATH}/pgenlib.a) -+target_include_directories(regenie PUBLIC ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) - add_dependencies(regenie pgenlib) - - # Intel MKL --if(EXISTS ${MKLROOT}) -+if(DEFINED MKLROOT) - add_definitions(-DWITH_MKL -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${MKLROOT}/include/) -- if(${BUILD_STATIC}) # specify static libs -- find_library(MKL_LP64_LIB libmkl_intel_lp64.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB libmkl_gnu_thread.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB libmkl_core.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) -+ target_include_directories(regenie PUBLIC ${MKLROOT}/include/) -+ find_library(MKL_LP64_LIB mkl_intel_lp64 -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ if("${UNAME_S}" STREQUAL "Linux") -+ find_library(MKL_THREAD_LIB mkl_gnu_thread -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ elseif("${UNAME_S}" STREQUAL "Darwin") -+ find_library(MKL_THREAD_LIB mkl_intel_thread -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ endif() -+ find_library(MKL_CORE_LIB mkl_core -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ if("${UNAME_S}" STREQUAL "Darwin") -+ target_link_libraries(regenie ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB}) -+ elseif(${BUILD_STATIC}) -+ target_link_libraries(regenie "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) - else() # use dynamic libs -- find_library(MKL_LP64_LIB mkl_intel_lp64 PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB mkl_gnu_thread PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB mkl_core PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) -+ target_link_libraries(regenie "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) - endif() --elseif(EXISTS ${OPENBLAS_ROOT}) # OpenBLAS -- add_definitions(-DWITH_OPENBLAS -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${OPENBLAS_ROOT}/include/) -- find_library(LAPACK_LIB lapack REQUIRED) -- find_library(BLAS_LIB openblas HINTS "${OPENBLAS_ROOT}/lib/" REQUIRED) -- target_link_libraries(regenie PRIVATE ${LAPACK_LIB} -llapacke ${BLAS_LIB}) -+ message( STATUS "Will compile with Intel MKL library") - endif() - - # cxxopts (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/cxxopts/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/cxxopts/include/) - - # LBFGS (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/LBFGSpp/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/LBFGSpp/include/) - - # Eigen (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/eigen-3.4.0/) -- --# Boost IO --if(${HAS_BOOST_IOSTREAM}) -- if("${UNAME_S}" STREQUAL "Darwin") -- find_library(BOOST_LIB_IO libboost_iostreams libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- elseif(${BUILD_STATIC}) -- find_library(BOOST_LIB_IO libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- else() -- target_link_libraries(regenie PRIVATE -lboost_iostreams) -- endif() -- add_definitions(-DHAS_BOOST_IOSTREAM) -- message( STATUS "Will compile with Boost Iostreams library") --endif() -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/eigen-3.4.0/) - - # Other libraries --find_library(ZLIB_LIBRARY libz.a z REQUIRED) -+find_library(ZLIB_LIBRARY z REQUIRED) - find_library(M_LIB m REQUIRED) - find_library(DL_LIB dl REQUIRED) - if("${UNAME_S}" STREQUAL "Linux") -@@ -226,14 +204,16 @@ if("${UNAME_S}" STREQUAL "Linux") - elseif("${UNAME_S}" STREQUAL "Darwin") - find_library(GFORTRAN_LIBRARY gfortran REQUIRED) - endif() --target_link_libraries(regenie PRIVATE ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} ${GFORTRAN_LIBRARY}) -+target_link_libraries(regenie ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} ${GFORTRAN_LIBRARY}) - --install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+add_definitions(-DVERSION_NUMBER="${RG_VERSION}") -+install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) - message( STATUS "REGENIE v" ${RG_VERSION}) - --add_custom_target(full-clean -- COMMAND cd "${MVTN_PATH}" && make clean -- COMMAND cd "${QF_PATH}" && make clean -- COMMAND cd "${QUAD_PATH}" && make clean -- COMMAND cd "${PGEN_PATH}" && make clean -- ) -+write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake COMPATIBILITY SameMajorVersion) -+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake DESTINATION share/${PROJECT_NAME}) -+ -+set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) -+set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) -+set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) -+include(CPack) --- -2.17.1 - diff --git a/recipes/regenie/patches/0011-update-cmakelist-file-for-v3.2.9.patch b/recipes/regenie/patches/0011-update-cmakelist-file-for-v3.2.9.patch deleted file mode 100644 index fe8e0d4233d31..0000000000000 --- a/recipes/regenie/patches/0011-update-cmakelist-file-for-v3.2.9.patch +++ /dev/null @@ -1,300 +0,0 @@ -commit 975bd4a5a757eeaae1f7db62977d97de94a1fabd -Author: Joelle Mbatchou -Date: Mon Jul 31 17:48:11 2023 -0400 - - cmakelist file for v3.2.9 - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4e0bfac..3609ab4 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,11 +1,3 @@ --# For Intel MKL, set MKLROOT= when running cmake --# e.g. MKLROOT=/opt/mkl/ cmake -S regenie_dir/ -B regenie_dir/build/ --# For OpenBLAS, set OPENBLAS_ROOT= when running cmake --# note: it also requires lapacke library --# For static compilation on Linux systems, set STATIC=1 when running cmake --# -> this excludes GLIBC -- -- - cmake_minimum_required(VERSION 3.13) - - # detect OS architecture -@@ -33,48 +25,16 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Ensures -std=c++11 - ###################################### - ######## check input variables - --# check BGEN_PATH --if("$ENV{BGEN_PATH}" STREQUAL "") -- message( FATAL_ERROR "Must specify path to BGEN library in 'BGEN_PATH'") --else() -- set(BGEN_PATH "$ENV{BGEN_PATH}" CACHE INTERNAL "Set BGEN library path") -- if (NOT EXISTS ${BGEN_PATH}) -- message( FATAL_ERROR "Specified BGEN library directory '${BGEN_PATH}' does not exist") -- endif() --endif() -- - # check for static compilation --if($ENV{STATIC}) -+if(BUILD_SHARED_LIBS) -+ set(BUILD_STATIC OFF CACHE INTERNAL "Dynamic compilation") -+ set(Boost_USE_STATIC_LIBS OFF) -+else() - set(BUILD_STATIC ON CACHE INTERNAL "Static compilation") -+ set(Boost_USE_STATIC_LIBS ON) - message( STATUS "Static compilation mode") - endif() - --# check Boost IOStreams --if($ENV{HAS_BOOST_IOSTREAM}) -- set(HAS_BOOST_IOSTREAM 1 CACHE INTERNAL "Add Boost IO") -- set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") --else() -- set(HAS_BOOST_IOSTREAM 0 CACHE INTERNAL "Skip Boost IO") --endif() -- --# check MKL --if(NOT "$ENV{MKLROOT}" STREQUAL "") -- set(MKLROOT "$ENV{MKLROOT}" CACHE INTERNAL "Set MKL library path") -- if (NOT EXISTS ${MKLROOT}) -- message( FATAL_ERROR "Specified MKL library directory '${MKLROOT}' does not exist") -- endif() -- message( STATUS "Will compile with Intel MKL library") --endif() -- --# check OpenBLAS --if(NOT "$ENV{OPENBLAS_ROOT}" STREQUAL "") -- set(OPENBLAS_ROOT "$ENV{OPENBLAS_ROOT}" CACHE INTERNAL "Set OpenBLAS library path") -- if (NOT EXISTS ${OPENBLAS_ROOT}) -- message( FATAL_ERROR "Specified OpenBLAS library directory '${OPENBLAS_ROOT}' does not exist") -- endif() -- message( STATUS "Will compile with OpenBLAS library") --endif() -- - ###################################### - ######## set flags and required libraries - -@@ -83,6 +43,7 @@ set(Boost_USE_STATIC_LIBS ${BUILD_STATIC}) - set(Boost_USE_DEBUG_LIBS OFF) - set(Boost_USE_MULTITHREADED ON) - set(Boost_USE_STATIC_RUNTIME OFF) -+set(MKLROOT "${CMAKE_PREFIX_PATH}") - - # list each file specifically - add_executable(regenie -@@ -103,32 +64,54 @@ add_executable(regenie - ${CMAKE_SOURCE_DIR}/src/MCC.cpp - ${CMAKE_SOURCE_DIR}/src/Ordinal.cpp - ) --target_include_directories(regenie PRIVATE ${CMAKE_SOURCE_DIR}/src) -+target_include_directories(regenie PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_PREFIX_PATH}/include) - - set(CMAKE_CXX_FLAGS "-O3 -Wall -pedantic -ffast-math -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-long-long -Wno-c11-extensions -fPIC") --add_definitions(-DVERSION_NUMBER="${RG_VERSION}") - -+find_package(OpenMP REQUIRED) -+target_link_libraries(regenie OpenMP::OpenMP_CXX) - if("${UNAME_S}" STREQUAL "Linux") -- find_package(OpenMP REQUIRED) -- target_link_libraries(regenie PRIVATE OpenMP::OpenMP_CXX) - if(${BUILD_STATIC}) -- target_link_options(regenie BEFORE PRIVATE -static-libgcc PRIVATE -static-libstdc++) -+ target_link_options(regenie BEFORE -static-libgcc -static-libstdc++) - endif() - elseif("${UNAME_S}" STREQUAL "Darwin") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - endif() - --set(EXTERN_LIBS_PATH "${CMAKE_SOURCE_DIR}/external_libs") --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/) -+set(EXTERN_LIBS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external_libs") -+target_include_directories(regenie PUBLIC ${EXTERN_LIBS_PATH}/) -+ -+# for BGEN (choose static if present first) -+find_library(ZSTD_LIBRARY zstd REQUIRED) -+find_library(DB_LIBRARY -+ NAMES libdb.a db -+ REQUIRED -+ ) -+find_library(SQLITE3_LIBRARY sqlite3 REQUIRED) -+find_package(Boost -+ REQUIRED COMPONENTS system filesystem thread -+ OPTIONAL_COMPONENTS iostreams -+ ) -+find_library(BGEN_LIBRARY -+ NAMES libbgen.a -+ REQUIRED -+ ) -+target_link_libraries(regenie ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARIES}) -+target_include_directories(regenie -+ PUBLIC -+ $ -+ $ -+ $ -+ $ -+ ) -+add_definitions(${Boost_DEFINITIONS}) - --# BGEN library and its dependencies --find_library(ZSTD_LIBRARY libzstd.a HINTS "${BGEN_PATH}/build/3rd_party/zstd-1.1.0" REQUIRED) --find_library(DB_LIBRARY libdb.a HINTS "${BGEN_PATH}/build/db" REQUIRED) --find_library(SQLITE3_LIBRARY libsqlite3.a HINTS "${BGEN_PATH}/build/3rd_party/sqlite3" REQUIRED) --find_library(Boost_LIBRARY libboost.a HINTS "${BGEN_PATH}/build/3rd_party/boost_1_55_0" REQUIRED) --find_library(BGEN_LIBRARY libbgen.a HINTS "${BGEN_PATH}/build" REQUIRED) --target_link_libraries(regenie PRIVATE ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARY}) --target_include_directories(regenie PRIVATE ${BGEN_PATH} ${BGEN_PATH}/genfile/include/ ${BGEN_PATH}/3rd_party/boost_1_55_0/ ${BGEN_PATH}/3rd_party/zstd-1.1.0/lib ${BGEN_PATH}/db/include/ ${BGEN_PATH}/3rd_party/sqlite3) -+# Boost IO -+if(Boost_iostreams_FOUND) -+ add_definitions(-DHAS_BOOST_IOSTREAM) -+ set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") -+ message( STATUS "Will compile with Boost Iostreams library") -+endif() - - # MVTNorm library - set(MVTN_PATH "${EXTERN_LIBS_PATH}/mvtnorm") -@@ -137,7 +120,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${MVTN_PATH} - ) --target_link_libraries(regenie PRIVATE ${MVTN_PATH}/libMvtnorm.a) -+target_link_libraries(regenie ${MVTN_PATH}/libMvtnorm.a) - add_dependencies(regenie libMvtnorm) - - # QF library -@@ -147,7 +130,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QF_PATH} - ) --target_link_libraries(regenie PRIVATE ${QF_PATH}/qf.a) -+target_link_libraries(regenie ${QF_PATH}/qf.a) - add_dependencies(regenie libqf) - - # Quadpack library -@@ -157,7 +140,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QUAD_PATH} - ) --target_link_libraries(regenie PRIVATE ${QUAD_PATH}/libquad.a) -+target_link_libraries(regenie ${QUAD_PATH}/libquad.a) - add_dependencies(regenie libquad) - - # PGEN library -@@ -167,59 +150,54 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${PGEN_PATH} - ) --target_link_libraries(regenie PRIVATE ${PGEN_PATH}/pgenlib.a) --target_include_directories(regenie PRIVATE ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) -+target_link_libraries(regenie ${PGEN_PATH}/pgenlib.a) -+target_include_directories(regenie PUBLIC ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) - add_dependencies(regenie pgenlib) - - # Intel MKL --if(EXISTS ${MKLROOT}) -+if(DEFINED MKLROOT) - add_definitions(-DWITH_MKL -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${MKLROOT}/include/) -- if(${BUILD_STATIC}) # specify static libs -- find_library(MKL_LP64_LIB libmkl_intel_lp64.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB libmkl_gnu_thread.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB libmkl_core.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) -+ target_include_directories(regenie PUBLIC ${MKLROOT}/include/) -+ find_library(MKL_LP64_LIB mkl_intel_lp64 -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ if("${UNAME_S}" STREQUAL "Linux") -+ find_library(MKL_THREAD_LIB mkl_gnu_thread -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ elseif("${UNAME_S}" STREQUAL "Darwin") -+ find_library(MKL_THREAD_LIB mkl_intel_thread -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ endif() -+ find_library(MKL_CORE_LIB mkl_core -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ if("${UNAME_S}" STREQUAL "Darwin") -+ target_link_libraries(regenie ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB}) -+ elseif(${BUILD_STATIC}) -+ target_link_libraries(regenie "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) - else() # use dynamic libs -- find_library(MKL_LP64_LIB mkl_intel_lp64 PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB mkl_gnu_thread PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB mkl_core PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) -+ target_link_libraries(regenie "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) - endif() --elseif(EXISTS ${OPENBLAS_ROOT}) # OpenBLAS -- add_definitions(-DWITH_OPENBLAS -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${OPENBLAS_ROOT}/include/) -- find_library(LAPACK_LIB lapack REQUIRED) -- find_library(BLAS_LIB openblas HINTS "${OPENBLAS_ROOT}/lib/" REQUIRED) -- target_link_libraries(regenie PRIVATE ${LAPACK_LIB} -llapacke ${BLAS_LIB}) -+ message( STATUS "Will compile with Intel MKL library") - endif() - - # cxxopts (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/cxxopts/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/cxxopts/include/) - - # LBFGS (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/LBFGSpp/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/LBFGSpp/include/) - - # Eigen (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/eigen-3.4.0/) -- --# Boost IO --if(${HAS_BOOST_IOSTREAM}) -- if("${UNAME_S}" STREQUAL "Darwin") -- find_library(BOOST_LIB_IO libboost_iostreams libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- elseif(${BUILD_STATIC}) -- find_library(BOOST_LIB_IO libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- else() -- target_link_libraries(regenie PRIVATE -lboost_iostreams) -- endif() -- add_definitions(-DHAS_BOOST_IOSTREAM) -- message( STATUS "Will compile with Boost Iostreams library") --endif() -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/eigen-3.4.0/) - - # Other libraries --find_library(ZLIB_LIBRARY libz.a z REQUIRED) -+find_library(ZLIB_LIBRARY z REQUIRED) - find_library(M_LIB m REQUIRED) - find_library(DL_LIB dl REQUIRED) - if("${UNAME_S}" STREQUAL "Linux") -@@ -227,14 +205,16 @@ if("${UNAME_S}" STREQUAL "Linux") - elseif("${UNAME_S}" STREQUAL "Darwin") - find_library(GFORTRAN_LIBRARY gfortran REQUIRED) - endif() --target_link_libraries(regenie PRIVATE ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} ${GFORTRAN_LIBRARY}) -+target_link_libraries(regenie ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} ${GFORTRAN_LIBRARY}) - --install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+add_definitions(-DVERSION_NUMBER="${RG_VERSION}") -+install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) - message( STATUS "REGENIE v" ${RG_VERSION}) - --add_custom_target(full-clean -- COMMAND cd "${MVTN_PATH}" && make clean -- COMMAND cd "${QF_PATH}" && make clean -- COMMAND cd "${QUAD_PATH}" && make clean -- COMMAND cd "${PGEN_PATH}" && make clean -- ) -+write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake COMPATIBILITY SameMajorVersion) -+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake DESTINATION share/${PROJECT_NAME}) -+ -+set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) -+set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) -+set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) -+include(CPack) diff --git a/recipes/regenie/patches/0012-update-cmakelist-file-for-v3.4.patch b/recipes/regenie/patches/0012-update-cmakelist-file-for-v3.4.patch deleted file mode 100644 index 0e6278d726201..0000000000000 --- a/recipes/regenie/patches/0012-update-cmakelist-file-for-v3.4.patch +++ /dev/null @@ -1,348 +0,0 @@ -From 918db42f41961bd4556662ade1edc6ca3378da7f Mon Sep 17 00:00:00 2001 -From: Joelle Mbatchou -Date: Thu, 14 Dec 2023 17:33:24 -0500 -Subject: [PATCH] pdate cmakelist file for v3.4 - ---- - CMakeLists.txt | 243 +++++++++++++++++++------------------------------ - 1 file changed, 94 insertions(+), 149 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5bb60d3..3609ab4 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,11 +1,3 @@ --# For Intel MKL, set MKLROOT= when running cmake --# e.g. MKLROOT=/opt/mkl/ cmake -S regenie_dir/ -B regenie_dir/build/ --# For OpenBLAS, set OPENBLAS_ROOT= when running cmake --# note: it also requires lapacke library --# For static compilation on Linux systems, set STATIC=1 when running cmake --# -> this excludes GLIBC -- -- - cmake_minimum_required(VERSION 3.13) - - # detect OS architecture -@@ -33,57 +25,16 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Ensures -std=c++11 - ###################################### - ######## check input variables - --# check BGEN_PATH --if("$ENV{BGEN_PATH}" STREQUAL "") -- message( FATAL_ERROR "Must specify path to BGEN library in 'BGEN_PATH'") --else() -- set(BGEN_PATH "$ENV{BGEN_PATH}" CACHE INTERNAL "Set BGEN library path") -- if (NOT EXISTS ${BGEN_PATH}) -- message( FATAL_ERROR "Specified BGEN library directory '${BGEN_PATH}' does not exist") -- endif() --endif() -- - # check for static compilation --if($ENV{STATIC}) -+if(BUILD_SHARED_LIBS) -+ set(BUILD_STATIC OFF CACHE INTERNAL "Dynamic compilation") -+ set(Boost_USE_STATIC_LIBS OFF) -+else() - set(BUILD_STATIC ON CACHE INTERNAL "Static compilation") -+ set(Boost_USE_STATIC_LIBS ON) - message( STATUS "Static compilation mode") - endif() - --# check Boost IOStreams --if($ENV{HAS_BOOST_IOSTREAM}) -- set(HAS_BOOST_IOSTREAM 1 CACHE INTERNAL "Add Boost IO") -- set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") --else() -- set(HAS_BOOST_IOSTREAM 0 CACHE INTERNAL "Skip Boost IO") --endif() -- --# check MKL --if(NOT "$ENV{MKLROOT}" STREQUAL "") -- set(MKLROOT "$ENV{MKLROOT}" CACHE INTERNAL "Set MKL library path") -- if (NOT EXISTS ${MKLROOT}) -- message( FATAL_ERROR "Specified MKL library directory '${MKLROOT}' does not exist") -- endif() -- message( STATUS "Will compile with Intel MKL library") --endif() -- --# check HTSlib --if(NOT "$ENV{HTSLIB_PATH}" STREQUAL "") -- set(HTSLIB_PATH "$ENV{HTSLIB_PATH}" CACHE INTERNAL "Set HTSlib library path") -- if (NOT EXISTS ${HTSLIB_PATH}) -- message( FATAL_ERROR "Specified HTSlib library directory '${HTSLIB_PATH}' does not exist") -- endif() -- message( STATUS "Will compile with HTSlib") --endif() -- --# check OpenBLAS --if(NOT "$ENV{OPENBLAS_ROOT}" STREQUAL "") -- set(OPENBLAS_ROOT "$ENV{OPENBLAS_ROOT}" CACHE INTERNAL "Set OpenBLAS library path") -- if (NOT EXISTS ${OPENBLAS_ROOT}) -- message( FATAL_ERROR "Specified OpenBLAS library directory '${OPENBLAS_ROOT}' does not exist") -- endif() -- message( STATUS "Will compile with OpenBLAS library") --endif() -- - ###################################### - ######## set flags and required libraries - -@@ -92,9 +43,10 @@ set(Boost_USE_STATIC_LIBS ${BUILD_STATIC}) - set(Boost_USE_DEBUG_LIBS OFF) - set(Boost_USE_MULTITHREADED ON) - set(Boost_USE_STATIC_RUNTIME OFF) -+set(MKLROOT "${CMAKE_PREFIX_PATH}") - --# list each file specifically --add_executable(regenie -+# list each file specifically -+add_executable(regenie - ${CMAKE_SOURCE_DIR}/src/Data.cpp - ${CMAKE_SOURCE_DIR}/src/Files.cpp - ${CMAKE_SOURCE_DIR}/src/Geno.cpp -@@ -112,32 +64,54 @@ add_executable(regenie - ${CMAKE_SOURCE_DIR}/src/MCC.cpp - ${CMAKE_SOURCE_DIR}/src/Ordinal.cpp - ) --target_include_directories(regenie PRIVATE ${CMAKE_SOURCE_DIR}/src) -+target_include_directories(regenie PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_PREFIX_PATH}/include) - - set(CMAKE_CXX_FLAGS "-O3 -Wall -pedantic -ffast-math -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-long-long -Wno-c11-extensions -fPIC") --add_definitions(-DVERSION_NUMBER="${RG_VERSION}") - -+find_package(OpenMP REQUIRED) -+target_link_libraries(regenie OpenMP::OpenMP_CXX) - if("${UNAME_S}" STREQUAL "Linux") -- find_package(OpenMP REQUIRED) -- target_link_libraries(regenie PRIVATE OpenMP::OpenMP_CXX) - if(${BUILD_STATIC}) -- target_link_options(regenie BEFORE PRIVATE -static-libgcc PRIVATE -static-libstdc++) -+ target_link_options(regenie BEFORE -static-libgcc -static-libstdc++) - endif() - elseif("${UNAME_S}" STREQUAL "Darwin") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - endif() - --set(EXTERN_LIBS_PATH "${CMAKE_SOURCE_DIR}/external_libs") --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/) -+set(EXTERN_LIBS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external_libs") -+target_include_directories(regenie PUBLIC ${EXTERN_LIBS_PATH}/) -+ -+# for BGEN (choose static if present first) -+find_library(ZSTD_LIBRARY zstd REQUIRED) -+find_library(DB_LIBRARY -+ NAMES libdb.a db -+ REQUIRED -+ ) -+find_library(SQLITE3_LIBRARY sqlite3 REQUIRED) -+find_package(Boost -+ REQUIRED COMPONENTS system filesystem thread -+ OPTIONAL_COMPONENTS iostreams -+ ) -+find_library(BGEN_LIBRARY -+ NAMES libbgen.a -+ REQUIRED -+ ) -+target_link_libraries(regenie ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARIES}) -+target_include_directories(regenie -+ PUBLIC -+ $ -+ $ -+ $ -+ $ -+ ) -+add_definitions(${Boost_DEFINITIONS}) - --# BGEN library and its dependencies --find_library(ZSTD_LIBRARY libzstd.a HINTS "${BGEN_PATH}/build/3rd_party/zstd-1.1.0" REQUIRED) --find_library(DB_LIBRARY libdb.a HINTS "${BGEN_PATH}/build/db" REQUIRED) --find_library(SQLITE3_LIBRARY libsqlite3.a HINTS "${BGEN_PATH}/build/3rd_party/sqlite3" REQUIRED) --find_library(Boost_LIBRARY libboost.a HINTS "${BGEN_PATH}/build/3rd_party/boost_1_55_0" REQUIRED) --find_library(BGEN_LIBRARY libbgen.a HINTS "${BGEN_PATH}/build" REQUIRED) --target_link_libraries(regenie PRIVATE ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARY}) --target_include_directories(regenie PRIVATE ${BGEN_PATH} ${BGEN_PATH}/genfile/include/ ${BGEN_PATH}/3rd_party/boost_1_55_0/ ${BGEN_PATH}/3rd_party/zstd-1.1.0/lib ${BGEN_PATH}/db/include/ ${BGEN_PATH}/3rd_party/sqlite3) -+# Boost IO -+if(Boost_iostreams_FOUND) -+ add_definitions(-DHAS_BOOST_IOSTREAM) -+ set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") -+ message( STATUS "Will compile with Boost Iostreams library") -+endif() - - # MVTNorm library - set(MVTN_PATH "${EXTERN_LIBS_PATH}/mvtnorm") -@@ -146,7 +120,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${MVTN_PATH} - ) --target_link_libraries(regenie PRIVATE ${MVTN_PATH}/libMvtnorm.a) -+target_link_libraries(regenie ${MVTN_PATH}/libMvtnorm.a) - add_dependencies(regenie libMvtnorm) - - # QF library -@@ -156,7 +130,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QF_PATH} - ) --target_link_libraries(regenie PRIVATE ${QF_PATH}/qf.a) -+target_link_libraries(regenie ${QF_PATH}/qf.a) - add_dependencies(regenie libqf) - - # Quadpack library -@@ -166,7 +140,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QUAD_PATH} - ) --target_link_libraries(regenie PRIVATE ${QUAD_PATH}/libquad.a) -+target_link_libraries(regenie ${QUAD_PATH}/libquad.a) - add_dependencies(regenie libquad) - - # PGEN library -@@ -176,100 +150,71 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${PGEN_PATH} - ) --target_link_libraries(regenie PRIVATE ${PGEN_PATH}/pgenlib.a) --target_include_directories(regenie PRIVATE ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) -+target_link_libraries(regenie ${PGEN_PATH}/pgenlib.a) -+target_include_directories(regenie PUBLIC ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) - add_dependencies(regenie pgenlib) - --# REMETA library --if(EXISTS ${HTSLIB_PATH}) -- set(REMETA_PATH "${EXTERN_LIBS_PATH}/remeta") -- add_custom_target( -- remeta -- COMMAND make HTSLIB_PATH=${HTSLIB_PATH} -- WORKING_DIRECTORY ${REMETA_PATH} -- ) -- target_link_libraries(regenie PUBLIC ${REMETA_PATH}/remeta.a) -- target_include_directories(regenie PUBLIC ${REMETA_PATH}) -- add_dependencies(regenie remeta) -- -- add_definitions(-DWITH_HTSLIB) -- find_library(HTSLIB libhts.a HINTS ${HTSLIB_PATH}) -- target_link_libraries(regenie PUBLIC ${HTSLIB}) --endif() -- - # Intel MKL --if(EXISTS ${MKLROOT}) -+if(DEFINED MKLROOT) - add_definitions(-DWITH_MKL -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${MKLROOT}/include/) -- if(${BUILD_STATIC}) # specify static libs -- find_library(MKL_LP64_LIB libmkl_intel_lp64.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB libmkl_gnu_thread.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB libmkl_core.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) -+ target_include_directories(regenie PUBLIC ${MKLROOT}/include/) -+ find_library(MKL_LP64_LIB mkl_intel_lp64 -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ if("${UNAME_S}" STREQUAL "Linux") -+ find_library(MKL_THREAD_LIB mkl_gnu_thread -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ elseif("${UNAME_S}" STREQUAL "Darwin") -+ find_library(MKL_THREAD_LIB mkl_intel_thread -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ endif() -+ find_library(MKL_CORE_LIB mkl_core -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ if("${UNAME_S}" STREQUAL "Darwin") -+ target_link_libraries(regenie ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB}) -+ elseif(${BUILD_STATIC}) -+ target_link_libraries(regenie "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) - else() # use dynamic libs -- find_library(MKL_LP64_LIB mkl_intel_lp64 PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB mkl_gnu_thread PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB mkl_core PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) -+ target_link_libraries(regenie "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) - endif() --elseif(EXISTS ${OPENBLAS_ROOT}) # OpenBLAS -- add_definitions(-DWITH_OPENBLAS -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${OPENBLAS_ROOT}/include/) -- find_library(LAPACK_LIB lapack REQUIRED) -- find_library(BLAS_LIB openblas HINTS "${OPENBLAS_ROOT}/lib/" REQUIRED) -- target_link_libraries(regenie PRIVATE ${LAPACK_LIB} -llapacke ${BLAS_LIB}) -+ message( STATUS "Will compile with Intel MKL library") - endif() - - # cxxopts (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/cxxopts/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/cxxopts/include/) - - # LBFGS (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/LBFGSpp/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/LBFGSpp/include/) - - # Eigen (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/eigen-3.4.0/) -- --# Boost IO --if(${HAS_BOOST_IOSTREAM}) -- if("${UNAME_S}" STREQUAL "Darwin") -- find_library(BOOST_LIB_IO libboost_iostreams libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- elseif(${BUILD_STATIC}) -- find_library(BOOST_LIB_IO libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- else() -- target_link_libraries(regenie PRIVATE -lboost_iostreams) -- endif() -- add_definitions(-DHAS_BOOST_IOSTREAM) -- message( STATUS "Will compile with Boost Iostreams library") --endif() -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/eigen-3.4.0/) - - # Other libraries --find_library(ZLIB_LIBRARY libz.a z REQUIRED) --find_library(M_LIB m REQUIRED) --find_library(DL_LIB dl REQUIRED) --find_library(BZ2_LIB libbz2.so) --find_library(LZMA_LIB liblzma.so) --find_library(CURL_LIB libcurl.so) --find_library(CRYPTO_LIB libcrypto.so) -+find_library(ZLIB_LIBRARY z REQUIRED) -+find_library(M_LIB m REQUIRED) -+find_library(DL_LIB dl REQUIRED) - if("${UNAME_S}" STREQUAL "Linux") - set(GFORTRAN_LIBRARY "-lgfortran") - elseif("${UNAME_S}" STREQUAL "Darwin") - find_library(GFORTRAN_LIBRARY gfortran REQUIRED) - endif() --target_link_libraries( -- regenie PRIVATE -- ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} -- ${BZ2_LIB} ${LZMA_LIB} -- ${CURL_LIB} ${CRYPTO_LIB} ${GFORTRAN_LIBRARY} --) -+target_link_libraries(regenie ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} ${GFORTRAN_LIBRARY}) - --install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+add_definitions(-DVERSION_NUMBER="${RG_VERSION}") -+install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) - message( STATUS "REGENIE v" ${RG_VERSION}) - --add_custom_target(full-clean -- COMMAND cd "${MVTN_PATH}" && make clean -- COMMAND cd "${QF_PATH}" && make clean -- COMMAND cd "${QUAD_PATH}" && make clean -- COMMAND cd "${PGEN_PATH}" && make clean -- ) -+write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake COMPATIBILITY SameMajorVersion) -+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake DESTINATION share/${PROJECT_NAME}) -+ -+set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) -+set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) -+set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) -+include(CPack) --- -2.34.1 - diff --git a/recipes/regenie/patches/0013-update-cmakelist-file-for-v3.4.1.patch b/recipes/regenie/patches/0013-update-cmakelist-file-for-v3.4.1.patch deleted file mode 100644 index a3072766dad91..0000000000000 --- a/recipes/regenie/patches/0013-update-cmakelist-file-for-v3.4.1.patch +++ /dev/null @@ -1,343 +0,0 @@ -From 40a095edbac9478fe818b43ae49c0d5e958d632f Mon Sep 17 00:00:00 2001 -From: Joelle Mbatchou -Date: Thu, 1 Feb 2024 17:14:05 -0500 -Subject: [PATCH] update cmakelist file for v3.4.1 - ---- - CMakeLists.txt | 228 +++++++++++++++++++++---------------------------- - 1 file changed, 95 insertions(+), 133 deletions(-) - mode change 100755 => 100644 CMakeLists.txt - -diff --git a/CMakeLists.txt b/CMakeLists.txt -old mode 100755 -new mode 100644 -index 4368ce0..2dc15fd ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,11 +1,3 @@ --# For Intel MKL, set MKLROOT= when running cmake --# e.g. MKLROOT=/opt/mkl/ cmake -S regenie_dir/ -B regenie_dir/build/ --# For OpenBLAS, set OPENBLAS_ROOT= when running cmake --# note: it also requires lapacke library --# For static compilation on Linux systems, set STATIC=1 when running cmake --# -> this excludes GLIBC -- -- - cmake_minimum_required(VERSION 3.13) - - # detect OS architecture -@@ -33,57 +25,16 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Ensures -std=c++11 - ###################################### - ######## check input variables - --# check BGEN_PATH --if("$ENV{BGEN_PATH}" STREQUAL "") -- message( FATAL_ERROR "Must specify path to BGEN library in 'BGEN_PATH'") --else() -- set(BGEN_PATH "$ENV{BGEN_PATH}" CACHE INTERNAL "Set BGEN library path") -- if (NOT EXISTS ${BGEN_PATH}) -- message( FATAL_ERROR "Specified BGEN library directory '${BGEN_PATH}' does not exist") -- endif() --endif() -- - # check for static compilation --if($ENV{STATIC}) -+if(BUILD_SHARED_LIBS) -+ set(BUILD_STATIC OFF CACHE INTERNAL "Dynamic compilation") -+ set(Boost_USE_STATIC_LIBS OFF) -+else() - set(BUILD_STATIC ON CACHE INTERNAL "Static compilation") -+ set(Boost_USE_STATIC_LIBS ON) - message( STATUS "Static compilation mode") - endif() - --# check Boost IOStreams --if($ENV{HAS_BOOST_IOSTREAM}) -- set(HAS_BOOST_IOSTREAM 1 CACHE INTERNAL "Add Boost IO") -- set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") --else() -- set(HAS_BOOST_IOSTREAM 0 CACHE INTERNAL "Skip Boost IO") --endif() -- --# check MKL --if(NOT "$ENV{MKLROOT}" STREQUAL "") -- set(MKLROOT "$ENV{MKLROOT}" CACHE INTERNAL "Set MKL library path") -- if (NOT EXISTS ${MKLROOT}) -- message( FATAL_ERROR "Specified MKL library directory '${MKLROOT}' does not exist") -- endif() -- message( STATUS "Will compile with Intel MKL library") --endif() -- --# check HTSlib --if(NOT "$ENV{HTSLIB_PATH}" STREQUAL "") -- set(HTSLIB_PATH "$ENV{HTSLIB_PATH}" CACHE INTERNAL "Set HTSlib library path") -- if (NOT EXISTS ${HTSLIB_PATH}) -- message( FATAL_ERROR "Specified HTSlib library directory '${HTSLIB_PATH}' does not exist") -- endif() -- message( STATUS "Will compile with HTSlib") --endif() -- --# check OpenBLAS --if(NOT "$ENV{OPENBLAS_ROOT}" STREQUAL "") -- set(OPENBLAS_ROOT "$ENV{OPENBLAS_ROOT}" CACHE INTERNAL "Set OpenBLAS library path") -- if (NOT EXISTS ${OPENBLAS_ROOT}) -- message( FATAL_ERROR "Specified OpenBLAS library directory '${OPENBLAS_ROOT}' does not exist") -- endif() -- message( STATUS "Will compile with OpenBLAS library") --endif() -- - ###################################### - ######## set flags and required libraries - -@@ -92,9 +43,10 @@ set(Boost_USE_STATIC_LIBS ${BUILD_STATIC}) - set(Boost_USE_DEBUG_LIBS OFF) - set(Boost_USE_MULTITHREADED ON) - set(Boost_USE_STATIC_RUNTIME OFF) -+set(MKLROOT "${CMAKE_PREFIX_PATH}") - --# list each file specifically --add_executable(regenie -+# list each file specifically -+add_executable(regenie - ${CMAKE_SOURCE_DIR}/src/Data.cpp - ${CMAKE_SOURCE_DIR}/src/Files.cpp - ${CMAKE_SOURCE_DIR}/src/Geno.cpp -@@ -112,32 +64,54 @@ add_executable(regenie - ${CMAKE_SOURCE_DIR}/src/MCC.cpp - ${CMAKE_SOURCE_DIR}/src/Ordinal.cpp - ) --target_include_directories(regenie PRIVATE ${CMAKE_SOURCE_DIR}/src) -+target_include_directories(regenie PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_PREFIX_PATH}/include) - - set(CMAKE_CXX_FLAGS "-O3 -Wall -pedantic -ffast-math -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-long-long -Wno-c11-extensions -fPIC") --add_definitions(-DVERSION_NUMBER="${RG_VERSION}") - -+find_package(OpenMP REQUIRED) -+target_link_libraries(regenie OpenMP::OpenMP_CXX) - if("${UNAME_S}" STREQUAL "Linux") -- find_package(OpenMP REQUIRED) -- target_link_libraries(regenie PRIVATE OpenMP::OpenMP_CXX) - if(${BUILD_STATIC}) -- target_link_options(regenie BEFORE PRIVATE -static-libgcc PRIVATE -static-libstdc++) -+ target_link_options(regenie BEFORE -static-libgcc -static-libstdc++) - endif() - elseif("${UNAME_S}" STREQUAL "Darwin") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - endif() - --set(EXTERN_LIBS_PATH "${CMAKE_SOURCE_DIR}/external_libs") --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/) -+set(EXTERN_LIBS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external_libs") -+target_include_directories(regenie PUBLIC ${EXTERN_LIBS_PATH}/) -+ -+# for BGEN (choose static if present first) -+find_library(ZSTD_LIBRARY zstd REQUIRED) -+find_library(DB_LIBRARY -+ NAMES libdb.a db -+ REQUIRED -+ ) -+find_library(SQLITE3_LIBRARY sqlite3 REQUIRED) -+find_package(Boost -+ REQUIRED COMPONENTS system filesystem thread -+ OPTIONAL_COMPONENTS iostreams -+ ) -+find_library(BGEN_LIBRARY -+ NAMES libbgen.a -+ REQUIRED -+ ) -+target_link_libraries(regenie ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARIES}) -+target_include_directories(regenie -+ PUBLIC -+ $ -+ $ -+ $ -+ $ -+ ) -+add_definitions(${Boost_DEFINITIONS}) - --# BGEN library and its dependencies --find_library(ZSTD_LIBRARY libzstd.a HINTS "${BGEN_PATH}/build/3rd_party/zstd-1.1.0" REQUIRED) --find_library(DB_LIBRARY libdb.a HINTS "${BGEN_PATH}/build/db" REQUIRED) --find_library(SQLITE3_LIBRARY libsqlite3.a HINTS "${BGEN_PATH}/build/3rd_party/sqlite3" REQUIRED) --find_library(Boost_LIBRARY libboost.a HINTS "${BGEN_PATH}/build/3rd_party/boost_1_55_0" REQUIRED) --find_library(BGEN_LIBRARY libbgen.a HINTS "${BGEN_PATH}/build" REQUIRED) --target_link_libraries(regenie PRIVATE ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARY}) --target_include_directories(regenie PRIVATE ${BGEN_PATH} ${BGEN_PATH}/genfile/include/ ${BGEN_PATH}/3rd_party/boost_1_55_0/ ${BGEN_PATH}/3rd_party/zstd-1.1.0/lib ${BGEN_PATH}/db/include/ ${BGEN_PATH}/3rd_party/sqlite3) -+# Boost IO -+if(Boost_iostreams_FOUND) -+ add_definitions(-DHAS_BOOST_IOSTREAM) -+ set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") -+ message( STATUS "Will compile with Boost Iostreams library") -+endif() - - # MVTNorm library - set(MVTN_PATH "${EXTERN_LIBS_PATH}/mvtnorm") -@@ -146,7 +120,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${MVTN_PATH} - ) --target_link_libraries(regenie PRIVATE ${MVTN_PATH}/libMvtnorm.a) -+target_link_libraries(regenie ${MVTN_PATH}/libMvtnorm.a) - add_dependencies(regenie libMvtnorm) - - # QF library -@@ -156,7 +130,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QF_PATH} - ) --target_link_libraries(regenie PRIVATE ${QF_PATH}/qf.a) -+target_link_libraries(regenie ${QF_PATH}/qf.a) - add_dependencies(regenie libqf) - - # Quadpack library -@@ -166,7 +140,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QUAD_PATH} - ) --target_link_libraries(regenie PRIVATE ${QUAD_PATH}/libquad.a) -+target_link_libraries(regenie ${QUAD_PATH}/libquad.a) - add_dependencies(regenie libquad) - - # PGEN library -@@ -176,12 +150,12 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${PGEN_PATH} - ) --target_link_libraries(regenie PRIVATE ${PGEN_PATH}/pgenlib.a) --target_include_directories(regenie PRIVATE ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) -+target_link_libraries(regenie ${PGEN_PATH}/pgenlib.a) -+target_include_directories(regenie PUBLIC ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) - add_dependencies(regenie pgenlib) - - # REMETA library --if(EXISTS ${HTSLIB_PATH}) -+if(DEFINED HTSLIB_PATH) - set(REMETA_PATH "${EXTERN_LIBS_PATH}/remeta") - add_custom_target( - remeta -@@ -198,78 +172,66 @@ if(EXISTS ${HTSLIB_PATH}) - endif() - - # Intel MKL --if(EXISTS ${MKLROOT}) -+if(DEFINED MKLROOT) - add_definitions(-DWITH_MKL -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${MKLROOT}/include/) -- if(${BUILD_STATIC}) # specify static libs -- find_library(MKL_LP64_LIB libmkl_intel_lp64.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB libmkl_gnu_thread.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB libmkl_core.a HINTS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) -+ target_include_directories(regenie PUBLIC ${MKLROOT}/include/) -+ find_library(MKL_LP64_LIB mkl_intel_lp64 -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ if("${UNAME_S}" STREQUAL "Linux") -+ find_library(MKL_THREAD_LIB mkl_gnu_thread -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ elseif("${UNAME_S}" STREQUAL "Darwin") -+ find_library(MKL_THREAD_LIB mkl_intel_thread -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ endif() -+ find_library(MKL_CORE_LIB mkl_core -+ HINTS "${MKLROOT}/lib/" -+ REQUIRED -+ ) -+ if("${UNAME_S}" STREQUAL "Darwin") -+ target_link_libraries(regenie ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB}) -+ elseif(${BUILD_STATIC}) -+ target_link_libraries(regenie "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) - else() # use dynamic libs -- find_library(MKL_LP64_LIB mkl_intel_lp64 PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_THREAD_LIB mkl_gnu_thread PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- find_library(MKL_CORE_LIB mkl_core PATHS "${MKLROOT}/lib/intel64" REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) -+ target_link_libraries(regenie "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) - endif() --elseif(EXISTS ${OPENBLAS_ROOT}) # OpenBLAS -- add_definitions(-DWITH_OPENBLAS -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${OPENBLAS_ROOT}/include/) -- find_library(LAPACK_LIB lapack REQUIRED) -- find_library(BLAS_LIB openblas HINTS "${OPENBLAS_ROOT}/lib/" REQUIRED) -- target_link_libraries(regenie PRIVATE ${LAPACK_LIB} -llapacke ${BLAS_LIB}) -+ message( STATUS "Will compile with Intel MKL library") - endif() - - # cxxopts (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/cxxopts/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/cxxopts/include/) - - # LBFGS (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/LBFGSpp/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/LBFGSpp/include/) - - # Eigen (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/eigen-3.4.0/) -- --# Boost IO --if(${HAS_BOOST_IOSTREAM}) -- if("${UNAME_S}" STREQUAL "Darwin") -- find_library(BOOST_LIB_IO libboost_iostreams libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- elseif(${BUILD_STATIC}) -- find_library(BOOST_LIB_IO libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- else() -- target_link_libraries(regenie PRIVATE -lboost_iostreams) -- endif() -- add_definitions(-DHAS_BOOST_IOSTREAM) -- message( STATUS "Will compile with Boost Iostreams library") --endif() -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/eigen-3.4.0/) - - # Other libraries --find_library(ZLIB_LIBRARY libz.a z REQUIRED) --find_library(M_LIB m REQUIRED) --find_library(DL_LIB dl REQUIRED) --find_library(BZ2_LIB bz2) --find_library(LZMA_LIB lzma) --find_library(CURL_LIB curl) --find_library(CRYPTO_LIB crypto) -+find_library(ZLIB_LIBRARY z REQUIRED) -+find_library(M_LIB m REQUIRED) -+find_library(DL_LIB dl REQUIRED) - if("${UNAME_S}" STREQUAL "Linux") - set(GFORTRAN_LIBRARY "-lgfortran") - elseif("${UNAME_S}" STREQUAL "Darwin") - find_library(GFORTRAN_LIBRARY gfortran REQUIRED) - endif() --target_link_libraries( -- regenie PRIVATE -- ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} -- ${BZ2_LIB} ${LZMA_LIB} -- ${CURL_LIB} ${CRYPTO_LIB} ${GFORTRAN_LIBRARY} --) -+target_link_libraries(regenie ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} ${GFORTRAN_LIBRARY}) - --install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+add_definitions(-DVERSION_NUMBER="${RG_VERSION}") -+install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) - message( STATUS "REGENIE v" ${RG_VERSION}) - --add_custom_target(full-clean -- COMMAND cd "${MVTN_PATH}" && make clean -- COMMAND cd "${QF_PATH}" && make clean -- COMMAND cd "${QUAD_PATH}" && make clean -- COMMAND cd "${PGEN_PATH}" && make clean -- ) -+write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake COMPATIBILITY SameMajorVersion) -+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake DESTINATION share/${PROJECT_NAME}) -+ -+set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) -+set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) -+set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) -+include(CPack) --- -2.34.1 - diff --git a/recipes/regenie/patches/0014-update-cmakelist.txt-for-v3.5.patch b/recipes/regenie/patches/0014-update-cmakelist.txt-for-v3.5.patch deleted file mode 100644 index 0637586f8c9c0..0000000000000 --- a/recipes/regenie/patches/0014-update-cmakelist.txt-for-v3.5.patch +++ /dev/null @@ -1,355 +0,0 @@ -From 70b5249cb7a454d7eeaa94c262050adee124aea6 Mon Sep 17 00:00:00 2001 -From: Joelle Mbatchou -Date: Wed, 3 Jul 2024 16:15:46 -0400 -Subject: [PATCH] update cmakelist.txt for v3.5 - ---- - CMakeLists.txt | 241 ++++++++++++++++++++----------------------------- - 1 file changed, 97 insertions(+), 144 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b955d8e..02bdbbb 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,11 +1,3 @@ --# For Intel MKL, set MKLROOT= when running cmake --# e.g. MKLROOT=/opt/mkl/ cmake -S regenie_dir/ -B regenie_dir/build/ --# For OpenBLAS, set OPENBLAS_ROOT= when running cmake --# note: it also requires lapacke library --# For static compilation on Linux systems, set STATIC=1 when running cmake --# -> this excludes GLIBC -- -- - cmake_minimum_required(VERSION 3.13) - - # detect OS architecture -@@ -33,57 +25,16 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Ensures -std=c++11 - ###################################### - ######## check input variables - --# check BGEN_PATH --if("$ENV{BGEN_PATH}" STREQUAL "") -- message( FATAL_ERROR "Must specify path to BGEN library in 'BGEN_PATH'") --else() -- set(BGEN_PATH "$ENV{BGEN_PATH}" CACHE INTERNAL "Set BGEN library path") -- if (NOT EXISTS ${BGEN_PATH}) -- message( FATAL_ERROR "Specified BGEN library directory '${BGEN_PATH}' does not exist") -- endif() --endif() -- - # check for static compilation --if($ENV{STATIC}) -+if(BUILD_SHARED_LIBS) -+ set(BUILD_STATIC OFF CACHE INTERNAL "Dynamic compilation") -+ set(Boost_USE_STATIC_LIBS OFF) -+else() - set(BUILD_STATIC ON CACHE INTERNAL "Static compilation") -+ set(Boost_USE_STATIC_LIBS ON) - message( STATUS "Static compilation mode") - endif() - --# check Boost IOStreams --if($ENV{HAS_BOOST_IOSTREAM}) -- set(HAS_BOOST_IOSTREAM 1 CACHE INTERNAL "Add Boost IO") -- set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") --else() -- set(HAS_BOOST_IOSTREAM 0 CACHE INTERNAL "Skip Boost IO") --endif() -- --# check MKL --if(NOT "$ENV{MKLROOT}" STREQUAL "") -- set(MKLROOT "$ENV{MKLROOT}" CACHE INTERNAL "Set MKL library path") -- if (NOT EXISTS ${MKLROOT}) -- message( FATAL_ERROR "Specified MKL library directory '${MKLROOT}' does not exist") -- endif() -- message( STATUS "Will compile with Intel MKL library") --endif() -- --# check HTSlib --if(NOT "$ENV{HTSLIB_PATH}" STREQUAL "") -- set(HTSLIB_PATH "$ENV{HTSLIB_PATH}" CACHE INTERNAL "Set HTSlib library path") -- if (NOT EXISTS ${HTSLIB_PATH}) -- message( FATAL_ERROR "Specified HTSlib library directory '${HTSLIB_PATH}' does not exist") -- endif() -- message( STATUS "Will compile with HTSlib") --endif() -- --# check OpenBLAS --if(NOT "$ENV{OPENBLAS_ROOT}" STREQUAL "") -- set(OPENBLAS_ROOT "$ENV{OPENBLAS_ROOT}" CACHE INTERNAL "Set OpenBLAS library path") -- if (NOT EXISTS ${OPENBLAS_ROOT}) -- message( FATAL_ERROR "Specified OpenBLAS library directory '${OPENBLAS_ROOT}' does not exist") -- endif() -- message( STATUS "Will compile with OpenBLAS library") --endif() -- - ###################################### - ######## set flags and required libraries - -@@ -92,9 +43,10 @@ set(Boost_USE_STATIC_LIBS ${BUILD_STATIC}) - set(Boost_USE_DEBUG_LIBS OFF) - set(Boost_USE_MULTITHREADED ON) - set(Boost_USE_STATIC_RUNTIME OFF) -+set(MKLROOT "${CMAKE_PREFIX_PATH}") - --# list each file specifically --add_executable(regenie -+# list each file specifically -+add_executable(regenie - ${CMAKE_SOURCE_DIR}/src/Data.cpp - ${CMAKE_SOURCE_DIR}/src/Files.cpp - ${CMAKE_SOURCE_DIR}/src/Geno.cpp -@@ -112,32 +64,54 @@ add_executable(regenie - ${CMAKE_SOURCE_DIR}/src/MCC.cpp - ${CMAKE_SOURCE_DIR}/src/Ordinal.cpp - ) --target_include_directories(regenie PRIVATE ${CMAKE_SOURCE_DIR}/src) -+target_include_directories(regenie PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_PREFIX_PATH}/include) - - set(CMAKE_CXX_FLAGS "-O3 -Wall -pedantic -ffast-math -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-long-long -Wno-c11-extensions -fPIC") --add_definitions(-DVERSION_NUMBER="${RG_VERSION}") - -+find_package(OpenMP REQUIRED) -+target_link_libraries(regenie OpenMP::OpenMP_CXX) - if("${UNAME_S}" STREQUAL "Linux") -- find_package(OpenMP REQUIRED) -- target_link_libraries(regenie PRIVATE OpenMP::OpenMP_CXX) - if(${BUILD_STATIC}) -- target_link_options(regenie BEFORE PRIVATE -static-libgcc PRIVATE -static-libstdc++) -+ target_link_options(regenie BEFORE -static-libgcc -static-libstdc++) - endif() - elseif("${UNAME_S}" STREQUAL "Darwin") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - endif() - --set(EXTERN_LIBS_PATH "${CMAKE_SOURCE_DIR}/external_libs") --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/) -+set(EXTERN_LIBS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external_libs") -+target_include_directories(regenie PUBLIC ${EXTERN_LIBS_PATH}/) -+ -+# for BGEN (choose static if present first) -+find_library(ZSTD_LIBRARY zstd REQUIRED) -+find_library(DB_LIBRARY -+ NAMES libdb.a db -+ REQUIRED -+ ) -+find_library(SQLITE3_LIBRARY sqlite3 REQUIRED) -+find_package(Boost -+ REQUIRED COMPONENTS system filesystem thread -+ OPTIONAL_COMPONENTS iostreams -+ ) -+find_library(BGEN_LIBRARY -+ NAMES libbgen.a -+ REQUIRED -+ ) -+target_link_libraries(regenie ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARIES}) -+target_include_directories(regenie -+ PUBLIC -+ $ -+ $ -+ $ -+ $ -+ ) -+add_definitions(${Boost_DEFINITIONS}) - --# BGEN library and its dependencies --find_library(ZSTD_LIBRARY libzstd.a HINTS "${BGEN_PATH}/build/3rd_party/zstd-1.1.0" REQUIRED) --find_library(DB_LIBRARY libdb.a HINTS "${BGEN_PATH}/build/db" REQUIRED) --find_library(SQLITE3_LIBRARY libsqlite3.a HINTS "${BGEN_PATH}/build/3rd_party/sqlite3" REQUIRED) --find_library(Boost_LIBRARY libboost.a HINTS "${BGEN_PATH}/build/3rd_party/boost_1_55_0" REQUIRED) --find_library(BGEN_LIBRARY libbgen.a HINTS "${BGEN_PATH}/build" REQUIRED) --target_link_libraries(regenie PRIVATE ${ZSTD_LIBRARY} ${BGEN_LIBRARY} ${DB_LIBRARY} ${SQLITE3_LIBRARY} ${Boost_LIBRARY}) --target_include_directories(regenie PRIVATE ${BGEN_PATH} ${BGEN_PATH}/genfile/include/ ${BGEN_PATH}/3rd_party/boost_1_55_0/ ${BGEN_PATH}/3rd_party/zstd-1.1.0/lib ${BGEN_PATH}/db/include/ ${BGEN_PATH}/3rd_party/sqlite3) -+# Boost IO -+if(Boost_iostreams_FOUND) -+ add_definitions(-DHAS_BOOST_IOSTREAM) -+ set(RG_VERSION "${RG_VERSION}.gz" CACHE INTERNAL "Update version") -+ message( STATUS "Will compile with Boost Iostreams library") -+endif() - - # MVTNorm library - set(MVTN_PATH "${EXTERN_LIBS_PATH}/mvtnorm") -@@ -146,7 +120,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${MVTN_PATH} - ) --target_link_libraries(regenie PRIVATE ${MVTN_PATH}/libMvtnorm.a) -+target_link_libraries(regenie ${MVTN_PATH}/libMvtnorm.a) - add_dependencies(regenie libMvtnorm) - - # QF library -@@ -156,7 +130,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QF_PATH} - ) --target_link_libraries(regenie PRIVATE ${QF_PATH}/qf.a) -+target_link_libraries(regenie ${QF_PATH}/qf.a) - add_dependencies(regenie libqf) - - # Quadpack library -@@ -166,7 +140,7 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${QUAD_PATH} - ) --target_link_libraries(regenie PRIVATE ${QUAD_PATH}/libquad.a) -+target_link_libraries(regenie ${QUAD_PATH}/libquad.a) - add_dependencies(regenie libquad) - - # PGEN library -@@ -176,12 +150,12 @@ add_custom_target( - COMMAND make - WORKING_DIRECTORY ${PGEN_PATH} - ) --target_link_libraries(regenie PRIVATE ${PGEN_PATH}/pgenlib.a) --target_include_directories(regenie PRIVATE ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) -+target_link_libraries(regenie ${PGEN_PATH}/pgenlib.a) -+target_include_directories(regenie PUBLIC ${PGEN_PATH} ${PGEN_PATH}/simde/ ${PGEN_PATH}/include/) - add_dependencies(regenie pgenlib) - - # REMETA library --if(EXISTS ${HTSLIB_PATH}) -+if(DEFINED HTSLIB_PATH) - set(REMETA_PATH "${EXTERN_LIBS_PATH}/remeta") - add_custom_target( - remeta -@@ -205,91 +179,70 @@ if(EXISTS ${HTSLIB_PATH}) - endif() - - # Intel MKL --if(EXISTS ${MKLROOT}) -+if(DEFINED MKLROOT) - add_definitions(-DWITH_MKL -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${MKLROOT}/include/) -- if(${BUILD_STATIC}) # specify static libs -- find_library(MKL_LP64_LIB libmkl_intel_lp64.a -- HINTS "${MKLROOT}/lib/intel64" -- "${MKLROOT}/lib" -- REQUIRED) -- find_library(MKL_THREAD_LIB libmkl_gnu_thread.a -- HINTS "${MKLROOT}/lib/intel64" -- "${MKLROOT}/lib" -- REQUIRED) -- find_library(MKL_CORE_LIB libmkl_core.a -- HINTS "${MKLROOT}/lib/intel64" -- "${MKLROOT}/lib" -- REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) -- else() # use dynamic libs -- find_library(MKL_LP64_LIB mkl_intel_lp64 -- PATHS "${MKLROOT}/lib/intel64" -- "${MKLROOT}/lib" -- REQUIRED) -+ target_include_directories(regenie PUBLIC ${MKLROOT}/include/) -+ find_library(MKL_LP64_LIB mkl_intel_lp64 -+ HINTS "${MKLROOT}/lib/intel64" -+ "${MKLROOT}/lib" -+ REQUIRED -+ ) -+ if("${UNAME_S}" STREQUAL "Linux") - find_library(MKL_THREAD_LIB mkl_gnu_thread -- PATHS "${MKLROOT}/lib/intel64" -+ HINTS "${MKLROOT}/lib/intel64" - "${MKLROOT}/lib" -- REQUIRED) -- find_library(MKL_CORE_LIB mkl_core -- PATHS "${MKLROOT}/lib/intel64" -+ REQUIRED -+ ) -+ elseif("${UNAME_S}" STREQUAL "Darwin") -+ find_library(MKL_THREAD_LIB mkl_intel_thread -+ HINTS "${MKLROOT}/lib/intel64" - "${MKLROOT}/lib" -- REQUIRED) -- target_link_libraries(regenie PRIVATE "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) -+ REQUIRED -+ ) -+ endif() -+ find_library(MKL_CORE_LIB mkl_core -+ HINTS "${MKLROOT}/lib/intel64" -+ "${MKLROOT}/lib" -+ REQUIRED -+ ) -+ if("${UNAME_S}" STREQUAL "Darwin") -+ target_link_libraries(regenie ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB}) -+ elseif(${BUILD_STATIC}) -+ target_link_libraries(regenie "-Wl,--start-group" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} "-Wl,--end-group" -lgomp) -+ else() # use dynamic libs -+ target_link_libraries(regenie "-Wl,--no-as-needed" ${MKL_LP64_LIB} ${MKL_THREAD_LIB} ${MKL_CORE_LIB} -lgomp) - endif() --elseif(EXISTS ${OPENBLAS_ROOT}) # OpenBLAS -- add_definitions(-DWITH_OPENBLAS -DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE) -- target_include_directories(regenie PRIVATE ${OPENBLAS_ROOT}/include/) -- find_library(LAPACK_LIB lapack REQUIRED) -- find_library(BLAS_LIB openblas HINTS "${OPENBLAS_ROOT}/lib/" REQUIRED) -- target_link_libraries(regenie PRIVATE ${LAPACK_LIB} -llapacke ${BLAS_LIB}) -+ message( STATUS "Will compile with Intel MKL library") - endif() - - # cxxopts (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/cxxopts/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/cxxopts/include/) - - # LBFGS (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/LBFGSpp/include/) -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/LBFGSpp/include/) - - # Eigen (header-only) --target_include_directories(regenie PRIVATE ${EXTERN_LIBS_PATH}/eigen-3.4.0/) -- --# Boost IO --if(${HAS_BOOST_IOSTREAM}) -- if("${UNAME_S}" STREQUAL "Darwin") -- find_library(BOOST_LIB_IO libboost_iostreams libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- elseif(${BUILD_STATIC}) -- find_library(BOOST_LIB_IO libboost_iostreams.a REQUIRED) -- target_link_libraries(regenie PRIVATE ${BOOST_LIB_IO}) -- else() -- target_link_libraries(regenie PRIVATE -lboost_iostreams) -- endif() -- add_definitions(-DHAS_BOOST_IOSTREAM) -- message( STATUS "Will compile with Boost Iostreams library") --endif() -+target_include_directories(regenie PUBLIC ${CMAKE_SOURCE_DIR}/external_libs/eigen-3.4.0/) - - # Other libraries --find_library(ZLIB_LIBRARY libz.a z REQUIRED) --find_library(M_LIB m REQUIRED) --find_library(DL_LIB dl REQUIRED) -+find_library(ZLIB_LIBRARY z REQUIRED) -+find_library(M_LIB m REQUIRED) -+find_library(DL_LIB dl REQUIRED) - if("${UNAME_S}" STREQUAL "Linux") - set(GFORTRAN_LIBRARY "-lgfortran") - elseif("${UNAME_S}" STREQUAL "Darwin") - find_library(GFORTRAN_LIBRARY gfortran REQUIRED) - endif() --target_link_libraries( -- regenie PRIVATE -- ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} -- ${GFORTRAN_LIBRARY} --) -+target_link_libraries(regenie ${ZLIB_LIBRARY} ${M_LIB} ${DL_LIB} ${PTHREAD_LIB} ${GFORTRAN_LIBRARY}) - --install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+add_definitions(-DVERSION_NUMBER="${RG_VERSION}") -+install(TARGETS regenie RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) - message( STATUS "REGENIE v" ${RG_VERSION}) - --add_custom_target(full-clean -- COMMAND cd "${MVTN_PATH}" && make clean -- COMMAND cd "${QF_PATH}" && make clean -- COMMAND cd "${QUAD_PATH}" && make clean -- COMMAND cd "${PGEN_PATH}" && make clean -- ) -+write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake COMPATIBILITY SameMajorVersion) -+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake DESTINATION share/${PROJECT_NAME}) -+ -+set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) -+set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) -+set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) -+include(CPack) --- -2.34.1 - From 0e2790f1a605659257e71d183101cb4e17e44b9a Mon Sep 17 00:00:00 2001 From: Joshua Zhuang <71105179+mencian@users.noreply.github.com> Date: Tue, 12 Nov 2024 10:32:03 -0600 Subject: [PATCH 2/2] Update meta.yaml --- recipes/regenie/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/regenie/meta.yaml b/recipes/regenie/meta.yaml index 6cdf4fbc28e35..7452690e0e94e 100644 --- a/recipes/regenie/meta.yaml +++ b/recipes/regenie/meta.yaml @@ -29,7 +29,7 @@ requirements: - llvm-openmp # [osx] - libgomp # [linux] - bgenix >=1.1.7 - - boost-cpp >=1.74 + - boost-cpp 1.74 - liblapack * *mkl - mkl >=2020.4 - mkl-include @@ -38,7 +38,7 @@ requirements: run: - llvm-openmp # [osx] - libgomp # [linux] - - boost-cpp >=1.74 + - boost-cpp 1.74 - mkl >=2020.4 - sqlite