ready v0.8 branch for conda daily PR

This commit is contained in:
krande
2023-08-01 16:14:04 +02:00
committed by Thomas Krijnen
parent dad5845db7
commit 339aea0295
13 changed files with 211 additions and 101 deletions
@@ -1,23 +1,15 @@
name: ci-ifcopenshell-conda-daily name: ci-ifcopenshell-conda-daily-v0.8.0
on: on:
push: push:
paths: branches:
- .github/workflows/ci-ifcopenshell-conda-daily.yml - v0.8.0-compile-daily
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# * * * * *
- cron: "49 23 * * *" # 11min before utc midnight every day
jobs: jobs:
activate: activate:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: | if: |
github.repository == 'IfcOpenShell/IfcOpenShell' github.repository == 'krande/IfcOpenShell'
steps: steps:
- name: Set env - name: Set env
run: echo ok go run: echo ok go
@@ -33,38 +25,48 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
pyver: [ pyver: [
{ name: py310, distver: '3.10'}, { name: py311, distver: '3.11' }
{ name: py311, distver: '3.11'}
] ]
platform: [ platform: [
{ name: Windows, distver: windows-2022, upload: 'true' }, { name: Windows, distver: windows-2022, upload: 'true' },
{ name: Linux, distver: ubuntu-22.04, upload: 'true' }, { name: Linux, distver: ubuntu-22.04, upload: 'true' },
{ name: macOS, distver: macos-12, upload: 'true' } { name: macOS, distver: macos-13, upload: 'true' }
] ]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
submodules: recursive submodules: recursive
- name: Download MacOSX SDK
- name: Download and extract MacOSX SDK
if: ${{ matrix.platform.name == 'macOS' }} if: ${{ matrix.platform.name == 'macOS' }}
run: | run: |
curl -o MacOSX10.13.sdk.tar.xz -L https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.13.sdk.tar.xz && \ curl -L https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.13.sdk.tar.xz | tar -xvJf - -C /Users/runner/work/
tar xf MacOSX10.13.sdk.tar.xz && \
sudo mv -v MacOSX10.13.sdk /opt/ && \ - name: Install ninja
ls /opt/ run: |
- uses: seanmiddleditch/gha-setup-ninja@master if [[ "$OSTYPE" == "linux-gnu"* ]]; then
- uses: conda-incubator/setup-miniconda@v2 # https://github.com/conda-incubator/setup-miniconda sudo apt-get install ninja-build
elif [[ "$OSTYPE" == "darwin"* ]]; then
brew install ninja
elif [[ "$OSTYPE" == "win32" ]]; then
choco install ninja
fi
- uses: mamba-org/setup-micromamba@v1 # https://github.com/mamba-org/setup-micromamba
with: with:
activate-environment: conda-build environment-file: conda/environment.build.yml
python-version: ${{ matrix.pyver.distver }} create-args: >-
environment-file: conda/environment.yml python=${{ matrix.pyver.distver }}
- name: build, test and upload ifcopenshell anaconda-client
if: ${{ matrix.platform.upload == 'true' }}
- name: create conda package dist dir
run: | run: |
conda-build . --python ${{ matrix.pyver.distver }} -c conda-forge --token ${{ secrets.ANACONDA_TOKEN }} --user ifcopenshell mkdir -p ${{ github.workspace }}/dist
working-directory: ./conda
- name: build & test ifcopenshell - name: build & test ifcopenshell
if: ${{ matrix.platform.upload == 'false' }}
run: | run: |
conda-build . --python ${{ matrix.pyver.distver }} -c conda-forge boa build . --python ${{ matrix.pyver.distver }} --no-remove-work-dir --output-folder '${{ github.workspace }}/dist'
working-directory: ./conda working-directory: ./conda
- name: upload to anaconda
run: |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --force --user ${{ secrets.ANACONDA_USER }} --label dev ${{ github.workspace }}/dist/${{ matrix.pyver.pkg_dir }}/*.tar.bz2
+19 -3
View File
@@ -65,6 +65,7 @@ OPTION(USERSPACE_PYTHON_PREFIX "Installs IfcPython for the current user only ins
OPTION(ADD_COMMIT_SHA "Add commit sha and branch in version number, warning results in many rebuilds, requires git" OFF) OPTION(ADD_COMMIT_SHA "Add commit sha and branch in version number, warning results in many rebuilds, requires git" OFF)
OPTION(WITH_OPENCASCADE "Enable geometry interpretation using Open CASCADE" ON) OPTION(WITH_OPENCASCADE "Enable geometry interpretation using Open CASCADE" ON)
OPTION(WITH_CGAL "Enable geometry interpretation using CGAL" ON) OPTION(WITH_CGAL "Enable geometry interpretation using CGAL" ON)
OPTION(CITYJSON_SUPPORT "Build IfcConvert with CityJSON support (requires CityJSON library)." ON)
IF(NOT CMAKE_BUILD_TYPE) IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "Release") SET(CMAKE_BUILD_TYPE "Release")
@@ -154,6 +155,17 @@ endif()
UNIFY_ENVVARS_AND_CACHE(EIGEN_DIR) UNIFY_ENVVARS_AND_CACHE(EIGEN_DIR)
# Include the 'convert_env_var_to_bool' and 'get_all_option_flags' functions
include(utilities.cmake)
# Get a list of all OPTION flags from the CMakeLists.txt
get_all_option_flags(option_flags)
# Loop through the list of OPTION flags and convert the corresponding environment variables
foreach(option_flag IN LISTS option_flags)
convert_env_var_to_bool("${option_flag}")
endforeach()
if(WASM_BUILD) if(WASM_BUILD)
# when using the nix/build-all.py build script we should not # when using the nix/build-all.py build script we should not
# look into the sysroot for most of the dependencies but rather # look into the sysroot for most of the dependencies but rather
@@ -178,8 +190,11 @@ endif()
if (NOT MINIMAL_BUILD) if (NOT MINIMAL_BUILD)
if (WITH_CGAL) if (WITH_CGAL)
add_definitions(-DIFOPSH_WITH_CGAL) if (CITYJSON_SUPPORT)
set(SWIG_DEFINES ${SWIG_DEFINES} -DIFOPSH_WITH_CGAL) add_definitions(-DIFOPSH_WITH_CGAL)
set(SWIG_DEFINES ${SWIG_DEFINES} -DIFOPSH_WITH_CGAL)
endif ()
list(APPEND GEOMETRY_KERNELS cgal) list(APPEND GEOMETRY_KERNELS cgal)
endif() endif()
endif() endif()
@@ -939,7 +954,8 @@ endif()
if (BUILD_CONVERT) if (BUILD_CONVERT)
if (WITH_CGAL) if (WITH_CGAL AND CITYJSON_SUPPORT)
message(STATUS "Building CityJSON support")
set(CITYJSON_CONVERT_FILES set(CITYJSON_CONVERT_FILES
../src/ifcconvert/cityjson/geobim.cpp ../src/ifcconvert/cityjson/geobim.cpp
../src/ifcconvert/cityjson/global_execution_context.cpp ../src/ifcconvert/cityjson/global_execution_context.cpp
+32
View File
@@ -0,0 +1,32 @@
function(get_all_option_flags output_list)
# Read the contents of the CMakeLists.txt
file(READ "${CMAKE_SOURCE_DIR}/CMakeLists.txt" cmake_contents)
# Find all OPTION flags using a regular expression
string(REGEX MATCHALL "OPTION\\s*\\(\\s*([A-Za-z0-9_]+)" matches "${cmake_contents}")
# Extract the variable names from the matches
set(option_flags)
foreach(match IN LISTS matches)
string(REGEX REPLACE "OPTION\\s*\\(\\s*([A-Za-z0-9_]+)" "\\1" option_flag "${match}")
list(APPEND option_flags "${option_flag}")
endforeach()
# Return the list of OPTION flags
set(${output_list} "${option_flags}" PARENT_SCOPE)
endfunction()
function(convert_env_var_to_bool var_name)
if(DEFINED ENV{${var_name}})
string(TOUPPER "$ENV{${var_name}}" bool_value)
if(bool_value STREQUAL "ON" OR bool_value STREQUAL "TRUE" OR bool_value STREQUAL "1")
set(${var_name} ON CACHE BOOL "${var_name} as boolean" FORCE)
elseif(bool_value STREQUAL "OFF" OR bool_value STREQUAL "FALSE" OR bool_value STREQUAL "0")
set(${var_name} OFF CACHE BOOL "${var_name} as boolean" FORCE)
else()
# Not a bool, leave it as a string
endif()
else()
# Not defined, leave it as a string
endif()
endfunction()
+1
View File
@@ -0,0 +1 @@
.env
-8
View File
@@ -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
+7 -3
View File
@@ -1,7 +1,7 @@
mkdir build && cd build mkdir build && cd build
set MY_PY_VER=%PY_VER:.=% set MY_PY_VER=%PY_VER:.=%
set LIBXML2="%LIBRARY_PREFIX%/lib/libxml2.lib" rem set LIBXML2="%LIBRARY_PREFIX%/lib/libxml2.lib"
cmake -G "Ninja" ^ cmake -G "Ninja" ^
-D CMAKE_BUILD_TYPE:STRING=Release ^ -D CMAKE_BUILD_TYPE:STRING=Release ^
@@ -11,6 +11,9 @@ cmake -G "Ninja" ^
-D OCC_INCLUDE_DIR:FILEPATH="%LIBRARY_PREFIX%\include\opencascade" ^ -D OCC_INCLUDE_DIR:FILEPATH="%LIBRARY_PREFIX%\include\opencascade" ^
-D OCC_LIBRARY_DIR:FILEPATH="%LIBRARY_PREFIX%\lib" ^ -D OCC_LIBRARY_DIR:FILEPATH="%LIBRARY_PREFIX%\lib" ^
-D CGAL_INCLUDE_DIR:FILEPATH="%LIBRARY_PREFIX%\include" ^ -D CGAL_INCLUDE_DIR:FILEPATH="%LIBRARY_PREFIX%\include" ^
-D EIGEN_DIR:FILEPATH="%LIBRARY_PREFIX%\include\eigen3" ^
-D LIBXML2_INCLUDE_DIR=%LIBRARY_PREFIX%/include/libxml2 ^
-D LIBXML2_LIBRARIES=%LIBRARY_PREFIX%/lib/libxml2.lib ^
-D GMP_INCLUDE_DIR:FILEPATH="%LIBRARY_PREFIX%\include" ^ -D GMP_INCLUDE_DIR:FILEPATH="%LIBRARY_PREFIX%\include" ^
-D GMP_LIBRARY_DIR:FILEPATH="%LIBRARY_PREFIX%\lib" ^ -D GMP_LIBRARY_DIR:FILEPATH="%LIBRARY_PREFIX%\lib" ^
-D MPFR_LIBRARY_DIR:FILEPATH="%LIBRARY_PREFIX%\lib" ^ -D MPFR_LIBRARY_DIR:FILEPATH="%LIBRARY_PREFIX%\lib" ^
@@ -31,9 +34,10 @@ cmake -G "Ninja" ^
-D BUILD_CONVERT:BOOL=ON ^ -D BUILD_CONVERT:BOOL=ON ^
-D BUILD_IFCMAX:BOOL=OFF ^ -D BUILD_IFCMAX:BOOL=OFF ^
-D IFCXML_SUPPORT:BOOL=ON ^ -D IFCXML_SUPPORT:BOOL=ON ^
-D Boost_LIBRARYDIR:FILEPATH="%LIBRARY_PREFIX%\lib" ^ -D Boost_LIBRARY_DIR:FILEPATH="%LIBRARY_PREFIX%\lib" ^
-D Boost_INCLUDEDIR:FILEPATH="%LIBRARY_PREFIX%\include" ^ -D Boost_INCLUDE_DIR:FILEPATH="%LIBRARY_PREFIX%\include" ^
-D Boost_USE_STATIC_LIBS:BOOL=OFF ^ -D Boost_USE_STATIC_LIBS:BOOL=OFF ^
-D CITYJSON_SUPPORT:BOOL=OFF ^
%SRC_DIR%/cmake %SRC_DIR%/cmake
if errorlevel 1 exit 1 if errorlevel 1 exit 1
+16 -10
View File
@@ -1,16 +1,18 @@
#!/bin/bash #!/bin/bash
declare -a CMAKE_PLATFORM_FLAGS # IF osx use file lib suffix .dylib
# IF linux use file lib suffix .so
# IF windows use file lib suffix .dll
if [[ ${HOST} =~ .*linux.* ]]; then if [ "$(uname)" == "Darwin" ]; then
CMAKE_PLATFORM_FLAGS+=(-DCMAKE_TOOLCHAIN_FILE=$RECIPE_DIR/cross-linux.cmake) export FSUFFIX=dylib
export CFLAGS="$CFLAGS -Wl,-flat_namespace,-undefined,suppress"
export CXXFLAGS="$CXXFLAGS -Wl,-flat_namespace,-undefined,suppress"
export LDFLAGS="$LDFLAGS -Wl,-flat_namespace,-undefined,suppress"
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
export FSUFFIX=so
fi fi
if [ `uname` == Darwin ]; then
export CFLAGS="$CFLAGS -Wl,-flat_namespace,-undefined,suppress"
export CXXFLAGS="$CXXFLAGS -Wl,-flat_namespace,-undefined,suppress"
export LDFLAGS="$LDFLAGS -Wl,-flat_namespace,-undefined,suppress"
fi
cmake -G Ninja \ cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
@@ -28,7 +30,10 @@ cmake -G Ninja \
-DHDF5_LIBRARY_DIR=$PREFIX/lib \ -DHDF5_LIBRARY_DIR=$PREFIX/lib \
-DJSON_INCLUDE_DIR=$PREFIX/include \ -DJSON_INCLUDE_DIR=$PREFIX/include \
-DCGAL_INCLUDE_DIR=$PREFIX/include \ -DCGAL_INCLUDE_DIR=$PREFIX/include \
-DCOLLADA_SUPPORT=0 \ -DLIBXML2_INCLUDE_DIR=$PREFIX/include/libxml2 \
-DLIBXML2_LIBRARIES=$PREFIX/lib/libxml2.$FSUFFIX \
-DEIGEN_DIR:FILEPATH=$PREFIX/include/eigen3 \
-DCOLLADA_SUPPORT:BOOL=OFF \
-DBUILD_EXAMPLES:BOOL=OFF \ -DBUILD_EXAMPLES:BOOL=OFF \
-DIFCXML_SUPPORT:BOOL=ON \ -DIFCXML_SUPPORT:BOOL=ON \
-DGLTF_SUPPORT:BOOL=ON \ -DGLTF_SUPPORT:BOOL=ON \
@@ -37,8 +42,9 @@ cmake -G Ninja \
-DBUILD_IFCGEOM:BOOL=ON \ -DBUILD_IFCGEOM:BOOL=ON \
-DBUILD_GEOMSERVER:BOOL=OFF \ -DBUILD_GEOMSERVER:BOOL=OFF \
-DBOOST_USE_STATIC_LIBS:BOOL=OFF \ -DBOOST_USE_STATIC_LIBS:BOOL=OFF \
-DCITYJSON_SUPPORT:BOOL=OFF \
./cmake ./cmake
ninja ninja
ninja install -j 2 ninja install -j 1
+11 -2
View File
@@ -1,2 +1,11 @@
CONDA_BUILD_SYSROOT: CONDA_BUILD_SYSROOT: # used for github actions conda daily build
- /opt/MacOSX10.13.sdk # [osx] - /Users/runner/work/MacOSX10.13.sdk # [osx]
occt:
- 7.7.1
c_compiler:
- vs2022 # [win]
cxx_compiler:
- vs2022 # [win]
-16
View File
@@ -1,16 +0,0 @@
# this one is important
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_PLATFORM Linux)
# specify the cross compiler
set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX})
# where is the target environment
set(CMAKE_FIND_ROOT_PATH $ENV{PREFIX} $ENV{BUILD_PREFIX}/$ENV{HOST}/sysroot)
# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+58
View File
@@ -0,0 +1,58 @@
@echo off
:: This is a batch file to set the environment variables for the project
:: It is not necessary for conda compilation, but it provides you with type hints when working with the c++ libraries
:: OpenCascade, CGAL, Eigen, etc distributed using conda-forge in your IDE.
::
:: mamba env update -f environment.build.yml --prune
:: mamba activate ifcopenshell-build
::
:: Note!
:: You have to add a .env file next to this env.bat file where you set PREFIX=<path to your conda env>
set CONDA_BUILD=1
set MY_PY_VER=311
:: set this file's parent directory as a variable
set THIS_DIR=%~dp0
:: read the .env file located in THIS_DIR and set the environment variables.
:: the .env file should contain a line like this:
:: PREFIX=C:\Users\your_user_name\mambaforge3\envs\ifcopenshell-build
for /f "tokens=*" %%i in (%THIS_DIR%.env) do set %%i
set LIBRARY_PREFIX=%PREFIX%/Library
set CMAKE_PREFIX_PATH=%PREFIX%;%LIBRARY_PREFIX%/include;%LIBRARY_PREFIX%/lib;%LIBRARY_PREFIX%/bin
set OCC_LIBRARY_DIR=%LIBRARY_PREFIX%/lib
set OCC_INCLUDE_DIR=%LIBRARY_PREFIX%/include/opencascade
set CGAL_DIR=%LIBRARY_PREFIX%/lib/cmake/CGAL
set CGAL_INCLUDE_DIR=%LIBRARY_PREFIX%/include
set EIGEN_DIR=%LIBRARY_PREFIX%/include/eigen3
set LIBXML2_INCLUDE_DIR=%LIBRARY_PREFIX%/include/libxml2
set LIBXML2_LIBRARIES=%LIBRARY_PREFIX%/lib/libxml2.lib
set Boost_LIBRARY_DIR=%LIBRARY_PREFIX%/lib
set Boost_INCLUDE_DIR=%LIBRARY_PREFIX%/include
set Boost_USE_STATIC_LIBS=OFF
set GMP_INCLUDE_DIR=%LIBRARY_PREFIX%/include
set GMP_LIBRARY_DIR=%LIBRARY_PREFIX%/lib
set MPFR_LIBRARY_DIR=%LIBRARY_PREFIX%/lib
set HDF5_INCLUDE_DIR=%LIBRARY_PREFIX%/include
set HDF5_LIBRARY_DIR=%LIBRARY_PREFIX%/lib
set JSON_INCLUDE_DIR=%LIBRARY_PREFIX%/include
set HDF5_SUPPORT=ON
set BUILD_IFCPYTHON=ON
set BUILD_IFCGEOM=ON
set COLLADA_SUPPORT=OFF
set BUILD_EXAMPLES=OFF
set BUILD_GEOMSERVER=OFF
set GLTF_SUPPORT=ON
set BUILD_CONVERT=ON
set BUILD_IFCMAX=OFF
set IFCXML_SUPPORT=ON
set PYTHON_EXECUTABLE=%PREFIX%/python.exe
set PYTHON_LIBRARY=%PREFIX%/libs/python%MY_PY_VER%.lib
+17
View File
@@ -0,0 +1,17 @@
name: ifcopenshell-build
channels:
- conda-forge
dependencies:
- boa
- boost-cpp
- occt
- libxml2
- cgal-cpp
- hdf5
- mpfr
- nlohmann_json
- swig
- zlib
# These needs to be installed per platform
#- sel(unix): gmp
#- sel(win): mpir
-14
View File
@@ -1,14 +0,0 @@
name: conda-build
channels:
- conda-forge
dependencies:
- conda-build
- conda-verify
- anaconda-client
- ninja
- doxygen
- ripgrep
- pip
- pip:
- --extra-index-url https://lief.s3-website.fr-par.scw.cloud/latest
- lief==0.13.0.dev0
+17 -14
View File
@@ -1,22 +1,21 @@
{% set name = "ifcopenshell" %} context:
{% set version = "0.7.0" %} name: ifcopenshell
version: 0.8.0alpha1
package: package:
name: {{ name }} name: '{{ name|lower }}'
version: {{ version }} version: '{{ version }}'
source: source:
path: .. path: ..
build: build:
binary_relocation: false [osx]
number: 1 number: 1
requirements: requirements:
build: build:
- {{ compiler('c') }} - "{{ compiler('c') }}"
- {{ compiler('cxx') }} - "{{ compiler('cxx') }}"
- ninja >=1.10.2 - ninja >=1.10.2
- cmake - cmake
- swig >=4.0.2 - swig >=4.0.2
@@ -28,10 +27,12 @@ requirements:
- libxml2 - libxml2
- cgal-cpp - cgal-cpp
- hdf5 - hdf5
- eigen
- mpfr - mpfr
- gmp # [unix] - sel(unix): gmp
- mpir # [win] - sel(win): mpir
- nlohmann_json - nlohmann_json
- zlib
run: run:
- python - python
@@ -40,22 +41,24 @@ requirements:
- libxml2 - libxml2
- cgal-cpp - cgal-cpp
- hdf5 - hdf5
- eigen
- mpfr - mpfr
- gmp # [unix] - sel(unix): gmp
- mpir # [win] - sel(win): mpir
- nlohmann_json - nlohmann_json
- zlib
test: test:
imports: imports:
- ifcopenshell - ifcopenshell
about: about:
home: http://ifcopenshell.org home: https://ifcopenshell.org
license: LGPL-3.0-or-later license: LGPL-3.0-or-later
license_file: COPYING license_file: COPYING
summary: 'IfcOpenShell is a library to support the IFC file format' summary: 'IfcOpenShell is a library to support the IFC file format'
description: | description: |
IfcOpenShell is an open source (LGPL) software library for IfcOpenShell is an open source (LGPL) software library for
working with the Industry Foundation Classes (IFC) file format. working with the Industry Foundation Classes (IFC) file format.
doc_url: http://ifcopenshell.org/ doc_url: https://blenderbim.org/docs-python/
dev_url: https://github.com/IfcOpenShell/IfcOpenShell dev_url: https://github.com/IfcOpenShell/IfcOpenShell