From 57d863f73cecf31bf361d8cb30f3eafe1bdf0204 Mon Sep 17 00:00:00 2001 From: Atsushi Togo Date: Sun, 7 Jul 2024 11:52:56 +0900 Subject: [PATCH] Updats github workflows --- .../phono3py-pytest-conda-mkl-phphmtblas.yml | 7 +++---- .../phono3py-pytest-conda-mkl-v2.yml | 5 ++--- .../workflows/phono3py-pytest-conda-mkl.yml | 5 ++--- .../phono3py-pytest-conda-numpy2.yml | 4 ++-- .../phono3py-pytest-conda-phphmtblas.yml | 7 +++---- .github/workflows/phono3py-pytest-conda.yml | 5 ++--- CMakeLists.txt | 19 ++++++++++--------- pyproject.toml | 3 +++ 8 files changed, 27 insertions(+), 28 deletions(-) diff --git a/.github/workflows/phono3py-pytest-conda-mkl-phphmtblas.yml b/.github/workflows/phono3py-pytest-conda-mkl-phphmtblas.yml index 36bc64eb..f8c54bed 100644 --- a/.github/workflows/phono3py-pytest-conda-mkl-phphmtblas.yml +++ b/.github/workflows/phono3py-pytest-conda-mkl-phphmtblas.yml @@ -24,8 +24,7 @@ jobs: run: | conda activate test conda install --yes python=${{ matrix.python-version }} - #conda install --yes matplotlib-base pyyaml "libblas=*=*openblas" openblas h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler - conda install --yes matplotlib-base pyyaml "libblas=*=*mkl" mkl-include h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler + conda install --yes matplotlib-base pyyaml "libblas=*=*mkl" mkl-include h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler cxx-compiler - name: Install symfc develop branch run: | conda activate test @@ -38,12 +37,12 @@ jobs: conda activate test git clone --depth 1 https://github.com/phonopy/phonopy.git cd phonopy - PHONOPY_USE_OPENMP=true pip install -e . -vvv + pip install -e . -vvv cd .. - name: Install phono3py run: | conda activate test - PHPHCALC_USE_MTBLAS=true pip install -e . -vvv + PHPHCALC_USE_MTBLAS=ON pip install -e . -vvv - name: Run pytest run: | pytest -v --cov=./ --cov-report=xml test diff --git a/.github/workflows/phono3py-pytest-conda-mkl-v2.yml b/.github/workflows/phono3py-pytest-conda-mkl-v2.yml index 4e755b19..91c32ee9 100644 --- a/.github/workflows/phono3py-pytest-conda-mkl-v2.yml +++ b/.github/workflows/phono3py-pytest-conda-mkl-v2.yml @@ -24,8 +24,7 @@ jobs: run: | conda activate test conda install --yes python=${{ matrix.python-version }} - #conda install --yes matplotlib-base pyyaml "libblas=*=*openblas" openblas h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler - conda install --yes matplotlib-base pyyaml "libblas=*=*mkl" mkl-include h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler + conda install --yes matplotlib-base pyyaml "libblas=*=*mkl" mkl-include h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler cxx-compiler - name: Install symfc develop branch run: | conda activate test @@ -38,7 +37,7 @@ jobs: conda activate test git clone --depth 1 https://github.com/phonopy/phonopy.git cd phonopy - PHONOPY_USE_OPENMP=true pip install -e . -vvv + pip install -e . -vvv cd .. - name: Install phono3py run: | diff --git a/.github/workflows/phono3py-pytest-conda-mkl.yml b/.github/workflows/phono3py-pytest-conda-mkl.yml index 486af093..72616e31 100644 --- a/.github/workflows/phono3py-pytest-conda-mkl.yml +++ b/.github/workflows/phono3py-pytest-conda-mkl.yml @@ -24,8 +24,7 @@ jobs: run: | conda activate test conda install --yes python=${{ matrix.python-version }} - #conda install --yes matplotlib-base pyyaml "libblas=*=*openblas" openblas h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler - conda install --yes matplotlib-base pyyaml "libblas=*=*mkl" mkl-include h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler + conda install --yes matplotlib-base pyyaml "libblas=*=*mkl" mkl-include h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler cxx-compiler - name: Install symfc develop branch run: | conda activate test @@ -38,7 +37,7 @@ jobs: conda activate test git clone --depth 1 https://github.com/phonopy/phonopy.git cd phonopy - PHONOPY_USE_OPENMP=true pip install -e . -vvv + pip install -e . -vvv cd .. - name: Install phono3py run: | diff --git a/.github/workflows/phono3py-pytest-conda-numpy2.yml b/.github/workflows/phono3py-pytest-conda-numpy2.yml index cc1798ff..92f010cd 100644 --- a/.github/workflows/phono3py-pytest-conda-numpy2.yml +++ b/.github/workflows/phono3py-pytest-conda-numpy2.yml @@ -24,7 +24,7 @@ jobs: run: | conda activate test conda install --yes python=${{ matrix.python-version }} - conda install --yes matplotlib-base pyyaml "libblas=*=*openblas" openblas h5py "numpy=2" scipy pytest codecov pytest-cov cmake c-compiler + conda install --yes matplotlib-base pyyaml "libblas=*=*openblas" openblas h5py "numpy=2" scipy pytest codecov pytest-cov cmake c-compiler cxx-compiler - name: Install spglib develop branch run: | conda activate test @@ -44,7 +44,7 @@ jobs: conda activate test git clone --depth 1 https://github.com/phonopy/phonopy.git cd phonopy - PHONOPY_USE_OPENMP=true pip install -e . -vvv + pip install -e . -vvv cd .. - name: Install phono3py run: | diff --git a/.github/workflows/phono3py-pytest-conda-phphmtblas.yml b/.github/workflows/phono3py-pytest-conda-phphmtblas.yml index 5d6aac02..37473838 100644 --- a/.github/workflows/phono3py-pytest-conda-phphmtblas.yml +++ b/.github/workflows/phono3py-pytest-conda-phphmtblas.yml @@ -24,8 +24,7 @@ jobs: run: | conda activate test conda install --yes python=${{ matrix.python-version }} - conda install --yes matplotlib-base pyyaml "libblas=*=*openblas" openblas h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler - #conda install --yes matplotlib-base pyyaml "libblas=*=*mkl" mkl-include h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler + conda install --yes matplotlib-base pyyaml "libblas=*=*openblas" openblas h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler cxx-compiler - name: Install symfc develop branch run: | conda activate test @@ -38,12 +37,12 @@ jobs: conda activate test git clone --depth 1 https://github.com/phonopy/phonopy.git cd phonopy - PHONOPY_USE_OPENMP=true pip install -e . -vvv + pip install -e . -vvv cd .. - name: Install phono3py run: | conda activate test - PHPHCALC_USE_MTBLAS=true pip install -e . -vvv + PHPHCALC_USE_MTBLAS=ON pip install -e . -vvv - name: Run pytest run: | pytest -v --cov=./ --cov-report=xml test diff --git a/.github/workflows/phono3py-pytest-conda.yml b/.github/workflows/phono3py-pytest-conda.yml index 05eb347b..e9f0f1e2 100644 --- a/.github/workflows/phono3py-pytest-conda.yml +++ b/.github/workflows/phono3py-pytest-conda.yml @@ -24,14 +24,13 @@ jobs: run: | conda activate test conda install --yes python=${{ matrix.python-version }} - conda install --yes matplotlib-base pyyaml "libblas=*=*openblas" openblas h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler - #conda install --yes matplotlib-base pyyaml "libblas=*=*mkl" mkl-include h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler + conda install --yes matplotlib-base pyyaml "libblas=*=*openblas" openblas h5py scipy pytest codecov pytest-cov spglib alm cmake c-compiler cxx-compiler - name: Install phonopy develop branch run: | conda activate test git clone --depth 1 https://github.com/phonopy/phonopy.git cd phonopy - PHONOPY_USE_OPENMP=true pip install -e . -vvv + pip install -e . -vvv cd .. - name: Install phono3py run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index fbad8568..43391759 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,9 +150,9 @@ if(PHPHCALC OR BUILD_NANOBIND_MODULE) # Shared library add_library(phphcalc_lib SHARED ${SOURCES_PHPHCALC}) target_link_libraries(phphcalc_lib m ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} - ${OpenMP_C_LIBRARIES}) + OpenMP::OpenMP_C) target_include_directories(phphcalc_lib PRIVATE ${MY_INCLUDES}) - target_compile_options(phphcalc_lib PRIVATE ${OpenMP_C_FLAGS}) + target_compile_options(phphcalc_lib) if(BLAS_LIBRARIES MATCHES "libmkl") if(PHPHCALC_USE_MTBLAS) @@ -178,9 +178,9 @@ if(PHPHCALC OR BUILD_NANOBIND_MODULE) # Static link library add_library(phphcalc_lib STATIC ${SOURCES_PHPHCALC}) target_link_libraries(phphcalc_lib m ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} - ${OpenMP_C_LIBRARIES}) + OpenMP::OpenMP_C) target_include_directories(phphcalc_lib PRIVATE ${MY_INCLUDES}) - target_compile_options(phphcalc_lib PRIVATE ${OpenMP_C_FLAGS}) + target_compile_options(phphcalc_lib) if(BLAS_LIBRARIES MATCHES "libmkl") if(PHPHCALC_USE_MTBLAS) @@ -234,9 +234,9 @@ if(PHONONCALC OR BUILD_NANOBIND_MODULE) # Shared library add_library(phononcalc_lib SHARED ${SOURCES_PHONONCALC}) target_link_libraries(phononcalc_lib m ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} - ${OpenMP_C_LIBRARIES}) + OpenMP::OpenMP_C) target_include_directories(phononcalc_lib PRIVATE ${MY_INCLUDES}) - target_compile_options(phononcalc_lib PRIVATE ${OpenMP_C_FLAGS}) + target_compile_options(phononcalc_lib) if(BLAS_LIBRARIES MATCHES "libmkl") target_compile_definitions(phononcalc_lib PRIVATE MKL_LAPACKE @@ -250,10 +250,11 @@ if(PHONONCALC OR BUILD_NANOBIND_MODULE) else() # Static link library add_library(phononcalc_lib STATIC ${SOURCES_PHONONCALC}) - target_link_libraries(phononcalc_lib m ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} - ${OpenMP_C_LIBRARIES}) + target_link_libraries( + phononcalc_lib PRIVATE m ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} + OpenMP::OpenMP_C) target_include_directories(phononcalc_lib PRIVATE ${MY_INCLUDES}) - target_compile_options(phononcalc_lib PRIVATE ${OpenMP_C_FLAGS}) + target_compile_options(phononcalc_lib) if(BLAS_LIBRARIES MATCHES "libmkl") target_compile_definitions(phononcalc_lib PRIVATE MKL_LAPACKE diff --git a/pyproject.toml b/pyproject.toml index a699aec8..c7d20539 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,9 @@ sdist.include = [ "README.md", ] +[tool.scikit-build.cmake.define] +PHPHCALC_USE_MTBLAS = {env="PHPHCALC_USE_MTBLAS", default="OFF"} + [tool.setuptools_scm] write_to = "phono3py/_version.py"