From 91d2e5ccd14cfb2a34de6c911344b4c10df4509b Mon Sep 17 00:00:00 2001 From: krande Date: Thu, 23 Nov 2023 14:58:34 +0100 Subject: [PATCH 01/12] add novtk/all variants to daily builds --- .github/workflows/ci-ifcopenshell-conda-daily.yml | 9 +++------ conda/Makefile | 8 -------- conda/conda_build_config.yaml | 6 +++++- conda/environment.yml | 13 ------------- conda/meta.yaml | 13 ++++++++++--- 5 files changed, 18 insertions(+), 31 deletions(-) delete mode 100644 conda/Makefile delete mode 100644 conda/environment.yml diff --git a/.github/workflows/ci-ifcopenshell-conda-daily.yml b/.github/workflows/ci-ifcopenshell-conda-daily.yml index c5905afa75..7f124193b5 100644 --- a/.github/workflows/ci-ifcopenshell-conda-daily.yml +++ b/.github/workflows/ci-ifcopenshell-conda-daily.yml @@ -42,6 +42,7 @@ jobs: { name: Linux, distver: ubuntu-22.04, upload: 'true' }, { name: macOS, distver: macos-12, upload: 'true' } ] + variant: ['novtk', 'all'] steps: - uses: actions/checkout@v3 with: @@ -61,13 +62,9 @@ jobs: channel_priority: strict create-args: >- python=${{ matrix.pyver.distver }} + - name: build, test and upload ifcopenshell if: ${{ matrix.platform.upload == 'true' }} run: | - conda-build . --python ${{ matrix.pyver.distver }} -c conda-forge --token ${{ secrets.ANACONDA_TOKEN }} --user ifcopenshell - working-directory: ./conda - - name: build & test ifcopenshell - if: ${{ matrix.platform.upload == 'false' }} - run: | - conda-build . --python ${{ matrix.pyver.distver }} -c conda-forge + conda-build . --python ${{ matrix.pyver.distver }} -c conda-forge --token ${{ secrets.ANACONDA_TOKEN }} --user ifcopenshell --variants "{variant: ${{ matrix.variant }}}" working-directory: ./conda diff --git a/conda/Makefile b/conda/Makefile deleted file mode 100644 index c4cb211f1f..0000000000 --- a/conda/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -compile: - conda activate conda-build && conda-build -c conda-forge . --keep-old-work --python 3.10.5 - -debug: - conda activate conda-build && conda-debug -c conda-forge . --python 3.10.4 - -env: - conda env update --f environment.yml --prune \ No newline at end of file diff --git a/conda/conda_build_config.yaml b/conda/conda_build_config.yaml index 5a72b972fe..00c18acf5e 100644 --- a/conda/conda_build_config.yaml +++ b/conda/conda_build_config.yaml @@ -1,2 +1,6 @@ CONDA_BUILD_SYSROOT: - - /opt/MacOSX10.13.sdk # [osx] \ No newline at end of file + - /opt/MacOSX10.13.sdk # [osx] + +variant: + - novtk + - all \ No newline at end of file diff --git a/conda/environment.yml b/conda/environment.yml deleted file mode 100644 index 863f45f4fb..0000000000 --- a/conda/environment.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: conda-build -channels: - - conda-forge -dependencies: - - conda-build - - conda-verify - - anaconda-client - - ninja - - doxygen - - ripgrep - - pip - - pip: - - lief==0.13 diff --git a/conda/meta.yaml b/conda/meta.yaml index 5afdd5a56c..8b3448b805 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -1,6 +1,10 @@ {% set name = "ifcopenshell" %} {% set version = "0.7.0" %} +{% set build = 1 %} +# Higher number -> Always prioritize "novtk" variant over "all" variant +{% set build = build + 200 %} # [variant == "novtk"] +{% set build = build + 100 %} # [variant == "all"] package: name: {{ name }} @@ -10,8 +14,9 @@ source: path: .. build: + string: {{ variant }}_h{{ PKG_HASH }}_{{ build }} binary_relocation: false [osx] - number: 1 + number: {{ build }} requirements: build: @@ -24,7 +29,7 @@ requirements: host: - python - boost-cpp - - occt ==7.7.0 + - occt 7.7.2 *{{ variant }}* - libxml2 - cgal-cpp - hdf5 @@ -36,7 +41,7 @@ requirements: run: - python - - {{ pin_compatible('occt', max_pin='x.x.x') }} + - occt 7.7.2 *{{ variant }}* - {{ pin_compatible('cgal-cpp', max_pin='x.x.x') }} - {{ pin_compatible('boost-cpp', max_pin='x.x.x') }} - libxml2 @@ -46,6 +51,8 @@ requirements: - mpir # [win] - nlohmann_json - zlib + run_constrained: + - occt 7.7.2 *{{ variant }}* test: imports: From 46319634fb6bf79c0e8c58fc207de1fafabbf613 Mon Sep 17 00:00:00 2001 From: krande Date: Thu, 23 Nov 2023 15:05:17 +0100 Subject: [PATCH 02/12] run it once on fork --- .github/workflows/ci-ifcopenshell-conda-daily.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-ifcopenshell-conda-daily.yml b/.github/workflows/ci-ifcopenshell-conda-daily.yml index 7f124193b5..68b78253bc 100644 --- a/.github/workflows/ci-ifcopenshell-conda-daily.yml +++ b/.github/workflows/ci-ifcopenshell-conda-daily.yml @@ -18,7 +18,7 @@ jobs: activate: runs-on: ubuntu-latest if: | - github.repository == 'IfcOpenShell/IfcOpenShell' + github.repository == 'Krande/IfcOpenShell' steps: - name: Set env run: echo ok go @@ -66,5 +66,5 @@ jobs: - name: build, test and upload ifcopenshell if: ${{ matrix.platform.upload == 'true' }} run: | - conda-build . --python ${{ matrix.pyver.distver }} -c conda-forge --token ${{ secrets.ANACONDA_TOKEN }} --user ifcopenshell --variants "{variant: ${{ matrix.variant }}}" + conda-build . --python ${{ matrix.pyver.distver }} -c conda-forge --variants "{variant: ${{ matrix.variant }}}" working-directory: ./conda From 623d2b5be17f7799117b1670f84121622a8a31bd Mon Sep 17 00:00:00 2001 From: krande Date: Thu, 23 Nov 2023 15:06:56 +0100 Subject: [PATCH 03/12] add matrix variant to workflow name and do not use conda env yml file --- .github/workflows/ci-ifcopenshell-conda-daily.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-ifcopenshell-conda-daily.yml b/.github/workflows/ci-ifcopenshell-conda-daily.yml index 68b78253bc..fb4309e060 100644 --- a/.github/workflows/ci-ifcopenshell-conda-daily.yml +++ b/.github/workflows/ci-ifcopenshell-conda-daily.yml @@ -24,7 +24,7 @@ jobs: run: echo ok go test: - name: ${{ matrix.platform.distver }}-${{ matrix.pyver.name }} + name: ${{ matrix.platform.distver }}-${{ matrix.pyver.name }}-${{ matrix.variant }} needs: activate runs-on: ${{ matrix.platform.distver }} defaults: @@ -57,11 +57,11 @@ jobs: - uses: mamba-org/setup-micromamba@v1 # https://github.com/mamba-org/setup-micromamba with: cache-environment: true - environment-file: conda/environment.yml condarc: | channel_priority: strict create-args: >- - python=${{ matrix.pyver.distver }} + python=3.11 + boa - name: build, test and upload ifcopenshell if: ${{ matrix.platform.upload == 'true' }} From c04fa12051d18c3dfed6c8d069f541e74733add3 Mon Sep 17 00:00:00 2001 From: krande Date: Thu, 23 Nov 2023 15:09:24 +0100 Subject: [PATCH 04/12] add mamba env name --- .github/workflows/ci-ifcopenshell-conda-daily.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-ifcopenshell-conda-daily.yml b/.github/workflows/ci-ifcopenshell-conda-daily.yml index fb4309e060..c55f5e3827 100644 --- a/.github/workflows/ci-ifcopenshell-conda-daily.yml +++ b/.github/workflows/ci-ifcopenshell-conda-daily.yml @@ -56,6 +56,7 @@ jobs: ls /opt/ - uses: mamba-org/setup-micromamba@v1 # https://github.com/mamba-org/setup-micromamba with: + environment-name: build-env cache-environment: true condarc: | channel_priority: strict From fc2da4ee8fab43436f8a49d161f139a8b3345882 Mon Sep 17 00:00:00 2001 From: krande Date: Thu, 23 Nov 2023 15:11:46 +0100 Subject: [PATCH 05/12] add conda-forge as a channel --- .github/workflows/ci-ifcopenshell-conda-daily.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-ifcopenshell-conda-daily.yml b/.github/workflows/ci-ifcopenshell-conda-daily.yml index c55f5e3827..835232eb07 100644 --- a/.github/workflows/ci-ifcopenshell-conda-daily.yml +++ b/.github/workflows/ci-ifcopenshell-conda-daily.yml @@ -59,6 +59,8 @@ jobs: environment-name: build-env cache-environment: true condarc: | + channels: + - conda-forge channel_priority: strict create-args: >- python=3.11 From 58af81e25629d203da16cd41fb30a58e93f70f29 Mon Sep 17 00:00:00 2001 From: krande Date: Thu, 23 Nov 2023 15:17:59 +0100 Subject: [PATCH 06/12] drop "all" variant for now. Will include if people request it. --- .github/workflows/ci-ifcopenshell-conda-daily.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-ifcopenshell-conda-daily.yml b/.github/workflows/ci-ifcopenshell-conda-daily.yml index 835232eb07..bfeb0344fe 100644 --- a/.github/workflows/ci-ifcopenshell-conda-daily.yml +++ b/.github/workflows/ci-ifcopenshell-conda-daily.yml @@ -18,7 +18,7 @@ jobs: activate: runs-on: ubuntu-latest if: | - github.repository == 'Krande/IfcOpenShell' + github.repository == 'IfcOpenShell/IfcOpenShell' steps: - name: Set env run: echo ok go @@ -42,7 +42,10 @@ jobs: { name: Linux, distver: ubuntu-22.04, upload: 'true' }, { name: macOS, distver: macos-12, upload: 'true' } ] - variant: ['novtk', 'all'] + variant: [ + 'novtk', +# 'all' + ] steps: - uses: actions/checkout@v3 with: @@ -69,5 +72,5 @@ jobs: - name: build, test and upload ifcopenshell if: ${{ matrix.platform.upload == 'true' }} run: | - conda-build . --python ${{ matrix.pyver.distver }} -c conda-forge --variants "{variant: ${{ matrix.variant }}}" + conda-build . --python ${{ matrix.pyver.distver }} -c conda-forge --variants "{variant: ${{ matrix.variant }}}" --token ${{ secrets.ANACONDA_TOKEN }} --user ifcopenshell working-directory: ./conda From 52cad9d11caddfa401d202cae17006ad1bfd1e17 Mon Sep 17 00:00:00 2001 From: krande Date: Thu, 23 Nov 2023 15:30:41 +0100 Subject: [PATCH 07/12] pin windows hdf5 to 1.12 windows hdf5 1.14 results in ninja: error: 'libhdf5_cpp.lib', needed by 'IfcConvert.exe', missing and no known rule to make it --- conda/meta.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conda/meta.yaml b/conda/meta.yaml index 8b3448b805..2b1bc99376 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -32,7 +32,8 @@ requirements: - occt 7.7.2 *{{ variant }}* - libxml2 - cgal-cpp - - hdf5 + - hdf5 1.12 # [win] + - hdf5 # [not win] - mpfr - gmp # [unix] - mpir # [win] @@ -44,8 +45,8 @@ requirements: - occt 7.7.2 *{{ variant }}* - {{ pin_compatible('cgal-cpp', max_pin='x.x.x') }} - {{ pin_compatible('boost-cpp', max_pin='x.x.x') }} + - {{ pin_compatible('hdf5', max_pin='x.x.x') }} - libxml2 - - hdf5 - mpfr - gmp # [unix] - mpir # [win] From 76ce117b46f324cc489edd332b429e1fc4372e27 Mon Sep 17 00:00:00 2001 From: krande Date: Thu, 23 Nov 2023 15:37:41 +0100 Subject: [PATCH 08/12] test one more time on my fork before merging --- .github/workflows/ci-ifcopenshell-conda-daily.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-ifcopenshell-conda-daily.yml b/.github/workflows/ci-ifcopenshell-conda-daily.yml index bfeb0344fe..f3ffb6c50a 100644 --- a/.github/workflows/ci-ifcopenshell-conda-daily.yml +++ b/.github/workflows/ci-ifcopenshell-conda-daily.yml @@ -18,7 +18,7 @@ jobs: activate: runs-on: ubuntu-latest if: | - github.repository == 'IfcOpenShell/IfcOpenShell' + github.repository == 'Krande/IfcOpenShell' steps: - name: Set env run: echo ok go From f5f68ea150bb93ce3fada0e29efbda810730dc79 Mon Sep 17 00:00:00 2001 From: krande Date: Thu, 23 Nov 2023 15:39:24 +0100 Subject: [PATCH 09/12] add a workflow dispatch trigger (lets you click a button in the github actions workflow panel to start a new build) --- .github/workflows/ci-ifcopenshell-conda-daily.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-ifcopenshell-conda-daily.yml b/.github/workflows/ci-ifcopenshell-conda-daily.yml index f3ffb6c50a..51bfa1cc57 100644 --- a/.github/workflows/ci-ifcopenshell-conda-daily.yml +++ b/.github/workflows/ci-ifcopenshell-conda-daily.yml @@ -1,6 +1,7 @@ name: ci-ifcopenshell-conda-daily on: + workflow_dispatch: push: paths: - .github/workflows/ci-ifcopenshell-conda-daily.yml @@ -18,7 +19,7 @@ jobs: activate: runs-on: ubuntu-latest if: | - github.repository == 'Krande/IfcOpenShell' + github.repository == 'IfcOpenShell/IfcOpenShell' steps: - name: Set env run: echo ok go From bc0c2e641bdd5fd80c4ce4b8a941860a57c6b1d5 Mon Sep 17 00:00:00 2001 From: krande Date: Thu, 23 Nov 2023 15:51:41 +0100 Subject: [PATCH 10/12] make modifications to support conda hdf5 1.14 in CMakeLists.txt --- .../workflows/ci-ifcopenshell-conda-daily.yml | 6 +---- cmake/CMakeLists.txt | 25 +++++++++++++------ conda/meta.yaml | 3 +-- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-ifcopenshell-conda-daily.yml b/.github/workflows/ci-ifcopenshell-conda-daily.yml index 51bfa1cc57..8ed8a67275 100644 --- a/.github/workflows/ci-ifcopenshell-conda-daily.yml +++ b/.github/workflows/ci-ifcopenshell-conda-daily.yml @@ -2,10 +2,6 @@ name: ci-ifcopenshell-conda-daily on: workflow_dispatch: - push: - paths: - - .github/workflows/ci-ifcopenshell-conda-daily.yml - - conda/** schedule: # ┌───────────── minute (0 - 59) # │ ┌───────────── hour (0 - 23) @@ -19,7 +15,7 @@ jobs: activate: runs-on: ubuntu-latest if: | - github.repository == 'IfcOpenShell/IfcOpenShell' + github.repository == 'Krande/IfcOpenShell' steps: - name: Set env run: echo ok go diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 6d8fac006e..08fb022088 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -582,19 +582,30 @@ if(HDF5_SUPPORT) else() message(STATUS "Packaging hdf5 and zlib for conda distribution") - + set(HDF5_LIBRARIES) if(WIN32) # Windows - set(zlib_post zlib) - set(lib_ext lib) + find_package(HDF5 COMPONENTS CXX) + if (HDF5_FOUND) + set(HDF5_LIBRARIES ${HDF5_CXX_LIBRARIES}) + endif() + list(APPEND HDF5_LIBRARIES + "${HDF5_LIBRARY_DIR}/zlib.lib" + ) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # macOS - set(zlib_post libz) - set(lib_ext dylib) + list(APPEND HDF5_LIBRARIES + "${HDF5_LIBRARY_DIR}/libhdf5_cpp.dylib" + "${HDF5_LIBRARY_DIR}/libhdf5.dylib" + "${HDF5_LIBRARY_DIR}/libz.dylib" + ) else() # linux - set(zlib_post libz) - set(lib_ext so) + list(APPEND HDF5_LIBRARIES + "${HDF5_LIBRARY_DIR}/libhdf5_cpp.so" + "${HDF5_LIBRARY_DIR}/libhdf5.so" + "${HDF5_LIBRARY_DIR}/libz.so" + ) endif() set(HDF5_LIBRARIES diff --git a/conda/meta.yaml b/conda/meta.yaml index 2b1bc99376..7b9d6b51b0 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -32,8 +32,7 @@ requirements: - occt 7.7.2 *{{ variant }}* - libxml2 - cgal-cpp - - hdf5 1.12 # [win] - - hdf5 # [not win] + - hdf5 - mpfr - gmp # [unix] - mpir # [win] From 1dd8624825f60d7c15ab21a5267d8096269c2307 Mon Sep 17 00:00:00 2001 From: krande Date: Thu, 23 Nov 2023 15:55:23 +0100 Subject: [PATCH 11/12] need to use a push trigger on fork (dispatch is not allowed on PR from forks it seems). --- .github/workflows/ci-ifcopenshell-conda-daily.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci-ifcopenshell-conda-daily.yml b/.github/workflows/ci-ifcopenshell-conda-daily.yml index 8ed8a67275..48917b3d69 100644 --- a/.github/workflows/ci-ifcopenshell-conda-daily.yml +++ b/.github/workflows/ci-ifcopenshell-conda-daily.yml @@ -2,6 +2,10 @@ name: ci-ifcopenshell-conda-daily on: workflow_dispatch: + push: + paths: + - .github/workflows/ci-ifcopenshell-conda-daily.yml + - conda/** schedule: # ┌───────────── minute (0 - 59) # │ ┌───────────── hour (0 - 23) From b01bd8afb3bd3bc9b52a8471f52fa65c3c5dfc96 Mon Sep 17 00:00:00 2001 From: krande Date: Thu, 23 Nov 2023 16:05:00 +0100 Subject: [PATCH 12/12] only modify windows in CMakeLists.txt --- .../workflows/ci-ifcopenshell-conda-daily.yml | 2 ++ cmake/CMakeLists.txt | 35 +++++++++---------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci-ifcopenshell-conda-daily.yml b/.github/workflows/ci-ifcopenshell-conda-daily.yml index 48917b3d69..6d43cae605 100644 --- a/.github/workflows/ci-ifcopenshell-conda-daily.yml +++ b/.github/workflows/ci-ifcopenshell-conda-daily.yml @@ -51,6 +51,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: recursive + - name: Download MacOSX SDK if: ${{ matrix.platform.name == 'macOS' }} run: | @@ -58,6 +59,7 @@ jobs: tar xf MacOSX10.13.sdk.tar.xz && \ sudo mv -v MacOSX10.13.sdk /opt/ && \ ls /opt/ + - uses: mamba-org/setup-micromamba@v1 # https://github.com/mamba-org/setup-micromamba with: environment-name: build-env diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 08fb022088..c44f9ddc77 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -582,9 +582,10 @@ if(HDF5_SUPPORT) else() message(STATUS "Packaging hdf5 and zlib for conda distribution") - set(HDF5_LIBRARIES) + if(WIN32) # Windows + set(HDF5_LIBRARIES) find_package(HDF5 COMPONENTS CXX) if (HDF5_FOUND) set(HDF5_LIBRARIES ${HDF5_CXX_LIBRARIES}) @@ -592,27 +593,23 @@ if(HDF5_SUPPORT) list(APPEND HDF5_LIBRARIES "${HDF5_LIBRARY_DIR}/zlib.lib" ) - elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - # macOS - list(APPEND HDF5_LIBRARIES - "${HDF5_LIBRARY_DIR}/libhdf5_cpp.dylib" - "${HDF5_LIBRARY_DIR}/libhdf5.dylib" - "${HDF5_LIBRARY_DIR}/libz.dylib" - ) else() - # linux - list(APPEND HDF5_LIBRARIES - "${HDF5_LIBRARY_DIR}/libhdf5_cpp.so" - "${HDF5_LIBRARY_DIR}/libhdf5.so" - "${HDF5_LIBRARY_DIR}/libz.so" + if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + # macOS + set(zlib_post libz) + set(lib_ext dylib) + else() + # linux + set(zlib_post libz) + set(lib_ext so) + endif() + + set(HDF5_LIBRARIES + "${HDF5_LIBRARY_DIR}/libhdf5_cpp.${lib_ext}" + "${HDF5_LIBRARY_DIR}/libhdf5.${lib_ext}" + "${HDF5_LIBRARY_DIR}/${zlib_post}.${lib_ext}" ) endif() - - set(HDF5_LIBRARIES - "${HDF5_LIBRARY_DIR}/libhdf5_cpp.${lib_ext}" - "${HDF5_LIBRARY_DIR}/libhdf5.${lib_ext}" - "${HDF5_LIBRARY_DIR}/${zlib_post}.${lib_ext}" - ) endif() endif()