From b93f76b873385eebba803ac8f557bfde96dd0efe Mon Sep 17 00:00:00 2001 From: bpuchala Date: Sat, 12 Aug 2023 14:51:30 -0400 Subject: [PATCH 1/4] add rpath to libcasm_crystallography --- CMakeLists.txt | 8 +++++++- CMakeLists.txt.in | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d98f95d..998a01c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,7 +187,13 @@ target_link_libraries(casm_crystallography ${CMAKE_DL_LIBS} CASM::casm_global ) - +if(APPLE) + set_target_properties( + casm_mapping PROPERTIES INSTALL_RPATH "@loader_path") +else() + set_target_properties( + casm_mapping PROPERTIES INSTALL_RPATH "$ORIGIN") +endif() ############################################## ## Install libcasm_crystallography diff --git a/CMakeLists.txt.in b/CMakeLists.txt.in index f9725e1..c66400d 100644 --- a/CMakeLists.txt.in +++ b/CMakeLists.txt.in @@ -96,7 +96,13 @@ target_link_libraries(casm_crystallography ${CMAKE_DL_LIBS} CASM::casm_global ) - +if(APPLE) + set_target_properties( + casm_mapping PROPERTIES INSTALL_RPATH "@loader_path") +else() + set_target_properties( + casm_mapping PROPERTIES INSTALL_RPATH "$ORIGIN") +endif() ############################################## ## Install libcasm_crystallography From 9a076dfc7f375cc8c0107574b84baa68d6540ada Mon Sep 17 00:00:00 2001 From: bpuchala Date: Sat, 12 Aug 2023 15:14:29 -0400 Subject: [PATCH 2/4] add rpath to libcasm_crystallography --- CMakeLists.txt | 4 ++-- CMakeLists.txt.in | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 998a01c..c257774 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,10 +189,10 @@ target_link_libraries(casm_crystallography ) if(APPLE) set_target_properties( - casm_mapping PROPERTIES INSTALL_RPATH "@loader_path") + casm_crystallography PROPERTIES INSTALL_RPATH "@loader_path") else() set_target_properties( - casm_mapping PROPERTIES INSTALL_RPATH "$ORIGIN") + casm_crystallography PROPERTIES INSTALL_RPATH "$ORIGIN") endif() ############################################## diff --git a/CMakeLists.txt.in b/CMakeLists.txt.in index c66400d..76b20b0 100644 --- a/CMakeLists.txt.in +++ b/CMakeLists.txt.in @@ -98,10 +98,10 @@ target_link_libraries(casm_crystallography ) if(APPLE) set_target_properties( - casm_mapping PROPERTIES INSTALL_RPATH "@loader_path") + casm_crystallography PROPERTIES INSTALL_RPATH "@loader_path") else() set_target_properties( - casm_mapping PROPERTIES INSTALL_RPATH "$ORIGIN") + casm_crystallography PROPERTIES INSTALL_RPATH "$ORIGIN") endif() ############################################## From 2f14f797f382e44073d820972e0fa99c7f494bbf Mon Sep 17 00:00:00 2001 From: bpuchala Date: Sun, 13 Aug 2023 00:41:02 -0400 Subject: [PATCH 3/4] version 2.0a3 --- CHANGELOG.md | 2 +- pyproject.toml | 2 +- python/doc/conf.py | 2 +- python/setup.py | 2 +- setup.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f788005..20c1c5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [2.0a2] - 2023-08-11 +## [2.0a3] - 2023-08-11 This release separates out casm/crystallography from CASM v1, in particular removing remaining dependencies on casm/symmetry for constructing symmetry representations and getting basic symmetry operation info. It creates a Python package, libcasm.xtal, that enables using casm/crystallography and may be installed via pip install, using scikit-build, CMake, and pybind11. This release also includes usage and API documentation for using libcasm.xtal, built using Sphinx. diff --git a/pyproject.toml b/pyproject.toml index 3a88a6b..11acb5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta" [project] name = "libcasm-xtal" -version = "2.0a2" +version = "2.0a3" authors = [ { name="CASM developers", email="casm-developers@lists.engr.ucsb.edu" }, ] diff --git a/python/doc/conf.py b/python/doc/conf.py index 5040b8a..b5b0022 100644 --- a/python/doc/conf.py +++ b/python/doc/conf.py @@ -96,7 +96,7 @@ # The short X.Y version. version = "2.0" # The full version, including alpha/beta/rc tags. -release = "2.0a2" +release = "2.0a3" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/python/setup.py b/python/setup.py index 5d138e0..f8f7e31 100644 --- a/python/setup.py +++ b/python/setup.py @@ -1,6 +1,6 @@ import os -__version__ = "2.0a2" +__version__ = "2.0a3" # Available at setup time due to pyproject.toml from pybind11.setup_helpers import Pybind11Extension, build_ext diff --git a/setup.py b/setup.py index 48c9a03..e6dfa4b 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name="libcasm-xtal", - version="2.0a2", + version="2.0a3", packages=["libcasm", "libcasm.xtal"], package_dir={"": "python"}, cmake_install_dir="python/libcasm", From e2e00098e7d393fa474a2ab2c9b6f954df85d581 Mon Sep 17 00:00:00 2001 From: bpuchala Date: Wed, 16 Aug 2023 14:48:06 -0400 Subject: [PATCH 4/4] remove cross platform testing --- .github/workflows/test-linux-build.yml | 30 +++++--- .github/workflows/test-linux-cxx-only.yml | 24 +++++- .github/workflows/test-linux-dependencies.yml | 53 +++++++++++++ .github/workflows/test-linux-source.yml | 75 ------------------- .github/workflows/test-linux.yml | 21 +++++- 5 files changed, 112 insertions(+), 91 deletions(-) create mode 100644 .github/workflows/test-linux-dependencies.yml delete mode 100644 .github/workflows/test-linux-source.yml diff --git a/.github/workflows/test-linux-build.yml b/.github/workflows/test-linux-build.yml index 1891119..f461ec7 100644 --- a/.github/workflows/test-linux-build.yml +++ b/.github/workflows/test-linux-build.yml @@ -3,11 +3,14 @@ name: Testing build on ubuntu-latest on: [push, pull_request] env: - SKBUILD_CONFIGURE_OPTIONS: -DCMAKE_CXX_FLAGS='-D_GLIBCXX_USE_CXX11_ABI=0' SKBUILD_BUILD_OPTIONS: --verbose jobs: + build-depends: + uses: ./.github/workflows/test-linux-dependencies.yml + build: + needs: build-depends runs-on: ubuntu-latest timeout-minutes: 60 steps: @@ -21,16 +24,28 @@ jobs: sudo apt-get update sudo apt-get install build-essential cmake pip install --upgrade pip wheel build - pip install -r test_requirements.txt - echo "SKBUILD_CONFIGURE_OPTIONS=${{ env.SKBUILD_CONFIGURE_OPTIONS }}" >> "$GITHUB_ENV" echo "SKBUILD_BUILD_OPTIONS=${{ env.SKBUILD_BUILD_OPTIONS }}" >> "$GITHUB_ENV" + ### libcasm-global ### + - name: restore libcasm-global cache + id: cache-libcasm-global-restore + uses: actions/cache/restore@v3 + with: + path: CASMcode_global/dist + key: ${{ runner.os }}-libcasm-global-v2-0-3 + + - name: Install CASM dependencies + run: | + pip install CASMcode_global/dist/*.whl + pip install -r build_requirements.txt + pip install -r test_requirements.txt + - name: make shell: bash run: | python -m build - - name: install + - name: make install shell: bash run: | pip install dist/*.whl @@ -39,10 +54,3 @@ jobs: shell: bash run: | python -m pytest -rsap python/tests - - - name: upload libcasm-xtal-ubuntu-latest-x86_64-dist - if: always() - uses: actions/upload-artifact@v3 - with: - name: libcasm-xtal-ubuntu-latest-x86_64-dist - path: dist diff --git a/.github/workflows/test-linux-cxx-only.yml b/.github/workflows/test-linux-cxx-only.yml index 0ac6d70..8666378 100644 --- a/.github/workflows/test-linux-cxx-only.yml +++ b/.github/workflows/test-linux-cxx-only.yml @@ -2,7 +2,13 @@ name: Testing c++ only on ubuntu-latest on: [push, pull_request] +env: + SKBUILD_BUILD_OPTIONS: --verbose + jobs: + build-depends: + uses: ./.github/workflows/test-linux-dependencies.yml + build: runs-on: ubuntu-latest timeout-minutes: 60 @@ -16,6 +22,20 @@ jobs: run: | sudo apt-get update sudo apt-get install build-essential cmake + pip install --upgrade pip wheel build + echo "SKBUILD_BUILD_OPTIONS=${{ env.SKBUILD_BUILD_OPTIONS }}" >> "$GITHUB_ENV" + + ### libcasm-global ### + - name: restore libcasm-global cache + id: cache-libcasm-global-restore + uses: actions/cache/restore@v3 + with: + path: CASMcode_global/dist + key: ${{ runner.os }}-libcasm-global-v2-0-3 + + - name: Install CASM dependencies + run: | + pip install CASMcode_global/dist/*.whl pip install -r build_requirements.txt - name: configure @@ -23,7 +43,7 @@ jobs: run: | mkdir build_cxx_only cd build_cxx_only - cmake -DCMAKE_CXX_FLAGS='-D_GLIBCXX_USE_CXX11_ABI=0' -DCMAKE_BUILD_TYPE=Release .. + cmake -DCMAKE_BUILD_TYPE=Release .. - name: make shell: bash @@ -42,7 +62,7 @@ jobs: run: | mkdir build_cxx_test cd build_cxx_test - cmake -DCMAKE_CXX_FLAGS='-D_GLIBCXX_USE_CXX11_ABI=0' -DCMAKE_BUILD_TYPE=Release ../tests + cmake -DCMAKE_BUILD_TYPE=Release ../tests - name: make tests shell: bash diff --git a/.github/workflows/test-linux-dependencies.yml b/.github/workflows/test-linux-dependencies.yml new file mode 100644 index 0000000..969bcdd --- /dev/null +++ b/.github/workflows/test-linux-dependencies.yml @@ -0,0 +1,53 @@ +name: Build CASM dependencies on Ubuntu + +on: + workflow_call: + +jobs: + build-depends: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Set up requirements & configuration variables + run: | + sudo apt-get update + sudo apt-get install build-essential cmake + pip install --upgrade pip wheel build + + ### libcasm-global ### + - name: restore libcasm-global cache + id: cache-libcasm-global-restore + uses: actions/cache/restore@v3 + with: + path: CASMcode_global/dist + key: ${{ runner.os }}-libcasm-global-v2-0-3 + + - name: checkout libcasm-global + if: steps.cache-libcasm-global-restore.outputs.cache-hit != 'true' + uses: actions/checkout@v3 + with: + repository: prisms-center/CASMcode_global + path: CASMcode_global + ref: v2.0.3 + + - name: make global + if: steps.cache-libcasm-global-restore.outputs.cache-hit != 'true' + shell: bash + run: | + cd CASMcode_global + git submodule update --init --recursive + python -m build + pip install dist/*.whl + pip install -r test_requirements.txt + python -m pytest -rsap python/tests + + - name: save libcasm-global cache + id: cache-libcasm-global-save + uses: actions/cache/save@v3 + with: + path: CASMcode_global/dist + key: ${{ steps.cache-libcasm-global-restore.outputs.cache-primary-key }} diff --git a/.github/workflows/test-linux-source.yml b/.github/workflows/test-linux-source.yml deleted file mode 100644 index 1407f85..0000000 --- a/.github/workflows/test-linux-source.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Testing source build on ubuntu-latest - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - - name: checkout libcasm-global - uses: actions/checkout@v3 - with: - repository: prisms-center/CASMcode_global - path: CASMcode_global - - - name: checkout libcasm-xtal - uses: actions/checkout@v3 - with: - path: CASMcode_crystallography - - - name: Set up requirements & configuration variables - run: | - sudo apt-get update - sudo apt-get install build-essential cmake - pip install --upgrade pip wheel - - - name: make global - shell: bash - run: | - cd CASMcode_global - git submodule update --init --recursive - pip install -v . - - - name: make test global - shell: bash - run: | - cd CASMcode_global - pip install -r test_requirements.txt - python -m pytest -rsap python/tests - - - name: make - shell: bash - run: | - cd CASMcode_crystallography - pip install -v . - - - name: make test - shell: bash - run: | - cd CASMcode_crystallography - pip install -r test_requirements.txt - python -m pytest -rsap python/tests - - - name: Set up doc requirements - run: | - cd CASMcode_crystallography - pip install -r doc_requirements.txt - - - name: build docs - shell: bash - run: | - cd CASMcode_crystallography - cd python/doc - sphinx-build -b html . _build/html - - - name: upload docs - if: always() - uses: actions/upload-artifact@v3 - with: - name: libcasm-xtal-docs - path: python/doc/_build/html diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 786f34a..6bba072 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -3,11 +3,14 @@ name: Testing on ubuntu-latest on: [push, pull_request] env: - SKBUILD_CONFIGURE_OPTIONS: -DCMAKE_CXX_FLAGS='-D_GLIBCXX_USE_CXX11_ABI=0' SKBUILD_BUILD_OPTIONS: --verbose jobs: + build-depends: + uses: ./.github/workflows/test-linux-dependencies.yml + build: + needs: build-depends runs-on: ubuntu-latest timeout-minutes: 60 steps: @@ -21,10 +24,21 @@ jobs: sudo apt-get update sudo apt-get install build-essential cmake pip install --upgrade pip wheel - pip install -r test_requirements.txt - echo "SKBUILD_CONFIGURE_OPTIONS=${{ env.SKBUILD_CONFIGURE_OPTIONS }}" >> "$GITHUB_ENV" echo "SKBUILD_BUILD_OPTIONS=${{ env.SKBUILD_BUILD_OPTIONS }}" >> "$GITHUB_ENV" + ### libcasm-global ### + - name: restore libcasm-global cache + id: cache-libcasm-global-restore + uses: actions/cache/restore@v3 + with: + path: CASMcode_global/dist + key: ${{ runner.os }}-libcasm-global-v2-0-3 + + - name: Install CASM dependencies + run: | + pip install CASMcode_global/dist/*.whl + pip install -r build_requirements.txt + - name: make shell: bash run: | @@ -33,6 +47,7 @@ jobs: - name: make test shell: bash run: | + pip install -r test_requirements.txt python -m pytest -rsap python/tests - name: Set up doc requirements