Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .conan2/conan.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"version": "0.5",
"requires": [
"zlib/1.3.1#b8bc2603263cf7eccbd6e17e66b0ed76%1733936244.862",
"xz_utils/5.4.5#b885d1d79c9d30cff3803f7f551dbe66%1724318972.064",
"xorg/system#98f82cb669e4ebc6b4d9d8a4f3f1faf4%1725460968.361",
"tk/8.6.10#1e8cbe0b5d8257de6bc6904da048766f%1707381381.875",
"tcl/8.6.10#bb67af0f98ba1c42f524578e0d12daff%1750072315.303",
"svgpp/1.3.1#a143c163f871a5340b190ef713c380e9%1706583880.791",
"sqlite3/3.50.4#fc0579bfa505c439d8abaf2af68e2697%1754052382.419",
"rocksdb/10.5.1#4a197eca381a3e5ae8adf8cffa5aacd0%1759820024.194",
"proj/9.7.0#2e912fcccb83d2b775e1c751b9afb61f%1761027876.503",
"openssl/3.6.0#89e8af1d4a21afcac0557079d23d8890%1759746682.365",
"opengl/system#7c02ea6ef926fd04844af53622a30541%1730805494.23",
"opencascade/7.9.1#d350d7e72420a1637c07c399037ed62a%1753788484.407",
"nlohmann_json/3.11.3#45828be26eb619a2e04ca517bb7b828d%1701220705.259",
"mpfr/4.2.1#3ea0c62e07e64e2be1518445351eb407%1758013189.65",
"libxml2/2.15.0#8d852c332225c0aa07a723fba8bcd0f5%1759824466.773",
"libtiff/4.6.0#b3fb32a80480ba4d4d9a71dd310ead02%1759735986.203",
"libpng/1.6.50#c96b3b9fa67d44545d6583bb0c348904%1751616189.701",
"libjpeg/9f#8edfe2699565c80c825d0256002504ff%1723665907.087",
"libiconv/1.17#1e65319e945f2d31941a9d28cc13c058%1751451666.321",
"libcurl/8.17.0#5f7b5b769dc3468ce693048cd8d7dd64%1764325761.224",
"libbacktrace/cci.20210118#a7691bfccd8caaf66309df196790a5a1%1722218217.276",
"hdf5/1.14.6#035eba94c2e506ee8f97b28e628eb9ec%1761768630.546",
"gmp/6.3.0#187de23af494e24e69bf9dfc1966a60d%1762267612.152",
"freetype/2.13.2#18656f7a6d52256a930f1cbd79f1509d%1756828316.696",
"fontconfig/2.13.93#2d320b7af475385bf1f0370441175ceb%1756454204.694",
"expat/2.7.3#f529802a90f0758a01f498a18f8c657b%1759399780.465",
"eigen/3.4.0#e7256a460e38f651ab0aa5246f94cf6a%1759398149.964",
"cgal/6.0.2#89a61c7731613b3c0b376fb0a2ce319b%1762854010.123",
"bzip2/1.0.8#00b4a4658791c1f06914e087f0e792f5%1744702067.178",
"brotli/1.1.0#406ce8f1c997f4ef7852fa01ff85ef9f%1743158659.041",
"boost/1.89.0#010f59feedfd171b15f467b42f723d13%1761718317.562"
],
"build_requires": [
"zstd/1.5.7#b68ca8e3de04ba5957761751d1d661f4%1760955092.069",
"zlib/1.3.1#b8bc2603263cf7eccbd6e17e66b0ed76%1733936244.862",
"xxhash/0.8.3#681d36a0a6111fc56e5e45ea182c19cc%1743678659.187",
"swig/4.1.0#f3788d6cf53ab28090e7f5caf68d024f%1723734200.021",
"sqlite3/3.50.4#fc0579bfa505c439d8abaf2af68e2697%1754052382.419",
"pkgconf/2.2.0#4ac315b50ef734072b00ff3aacbf52bf%1755505628.021",
"pkgconf/2.1.0#21f96520faf7660b99f872e956d2ac13%1755505630.82",
"pcre2/10.43#f46febf919eafb03fb3a27ea08e7fa61%1743524591.927",
"ninja/1.13.1#294f8721dbcde145674f7ba44994700e%1753400352.374",
"meson/1.9.1#abbc783cd297bedce14581b4aec060b8%1758626166.349",
"m4/1.4.19#b38ced39a01e31fef5435bc634461fd2%1700758725.451",
"libtool/2.4.7#14e7739cc128bc1623d2ed318008e47e%1755679003.847",
"hiredis/1.3.0#e39b0954c9bf2bac589b762bba5c5dce%1748521499.497",
"gperf/3.1#a7afdf8f7cccdc2dcd4d962370c33d4f%1755780571.156",
"gnu-config/cci.20210814#69fde734e1a46fd1655b4af46ab40945%1746203214.947",
"fmt/11.1.1#9d84ca70128ab4b84d80140b45d76b21%1735899159.864",
"flex/2.6.4#efa781fc5088b47c895bd4eef6911f2e%1761560242.855",
"cmake/4.1.2#6f844b9ec4e0e29d4f1232f9c5039901%1761647877.842",
"cmake/3.31.9#f9b9bb4bdfa37937619a33e9218703a6%1761647880.115",
"ccache/4.12.2#5ef6bb7ad7b4d61f52443dbe25683b0f%1765878017.419",
"bzip2/1.0.8#00b4a4658791c1f06914e087f0e792f5%1744702067.178",
"bison/3.8.2#c3490cbe0078b6fd3eb4cf5ed64144dc%1755688988.644",
"b2/5.3.3#107c15377719889654eb9a162a673975%1750340310.079",
"automake/1.16.5#b91b7c384c3deaa9d535be02da14d04f%1755524470.56",
"autoconf/2.71#51077f068e61700d65bb05541ea1e4b0%1731054366.86"
],
"python_requires": [],
"overrides": {
"boost/1.83.0": [
"boost/1.89.0"
],
"boost/1.82.0": [
"boost/1.89.0#010f59feedfd171b15f467b42f723d13"
]
},
"config_requires": []
}
13 changes: 13 additions & 0 deletions .conan2/profiles/linux_host
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[settings]
os=Linux
arch=x86_64
compiler=gcc
compiler.cppstd=17
compiler.version=11
compiler.libcxx=libstdc++11
build_type=Release

[conf]
# Automatically install required system packages
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True
238 changes: 74 additions & 164 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,31 @@ jobs:
- uses: actions/checkout@v6
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.11

- name: Setup Conan Client
uses: conan-io/setup-conan@v1
with:
version: 2.24.0
config_urls: |
.conan2/
cache_packages: true
profile_detect: false
# - name: ccache
# TODO: temporarily pointing to 1.2.19 to get notified by dependabot when 1.2.20 is released
# to update hardcoded references to commits in some other workflows.
# Then we can switch back to 1.2 in all actions.
# uses: hendrikmuhs/ccache-action@v1.2.19
# with:
# key: ubuntu-22.04-${{ runner.arch }}
- name: Install Conan dependencies
run: |
# swig -version
# cmake -version
sudo apt -y remove swig cmake
conan install . --lockfile=.conan2/conan.lock --lockfile-partial --lockfile-out=.conan2/conan.lock -pr:h=.conan2/profiles/linux_host -pr:b=.conan2/profiles/linux_host --build=missing
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -56,146 +75,44 @@ jobs:
pip install git+https://github.com/zdhoward/aud
pip install pytest-xdist==3.8.0

- name: Install C++ dependencies
run: |
sudo apt update
# `occt-misc` is only needed for 22.04, since it has cmake configs.
# In 24.04+, the needed files were moved `libocct-foundation-dev` and `occt-misc` can be removed.
# Other libs in `OCCT_CMAKE_DEPS` are needed only for cmake config to work properly, they're not used directly.
OCCT_CMAKE_DEPS="occt-misc libocct-draw-dev tcl-dev tk-dev libxi-dev"

sudo apt-get install --no-install-recommends \
git cmake gcc g++ \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-iostreams-dev \
libboost-program-options-dev \
libboost-regex-dev \
libboost-system-dev \
libboost-thread-dev \
libpcre3-dev libxml2-dev \
libtbb-dev nlohmann-json3-dev \
libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev libocct-data-exchange-dev \
${OCCT_CMAKE_DEPS} \
libhdf5-dev libcgal-dev libeigen3-dev

- name: ccache
# TODO: temporarily pointing to 1.2.19 to get notified by dependabot when 1.2.20 is released
# to update hardcoded references to commits in some other workflows.
# Then we can switch back to 1.2 in all actions.
uses: hendrikmuhs/ccache-action@v1.2.19
with:
key: ubuntu-22.04-${{ runner.arch }}

# RTTI is only enabled by default in Debug builds of rocksdb.
# Distros are using Release builds, so we're compiling it ourselves with RTTI forced on.
# https://github.com/facebook/rocksdb/blob/a3aa44a7167b8336f9bc15c8aba063260268ff68/CMakeLists.txt#L433
- name: build rocksdb
run: |
git clone https://github.com/facebook/rocksdb --branch v9.11.2
cd rocksdb
mkdir build && cd build
# rocksdb is using ccache automatically.
cmake -DFAIL_ON_WARNINGS=Off \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DWITH_TESTS=OFF \
-DWITH_TOOLS=OFF \
-DWITH_GFLAGS=OFF \
-DWITH_BENCHMARK_TOOLS=OFF \
-DWITH_CORE_TOOLS=OFF \
-DROCKSDB_BUILD_SHARED=Off \
-DCMAKE_POSITION_INDEPENDENT_CODE=On \
-DUSE_RTTI=On \
..
sudo make -j$(nproc) install

# OpenCOLLADA is ancient, but we still have it in the main build.
# So adding it to CI to catch any breakages.
- name: build OpenCOLLADA
run: |
git clone https://github.com/KhronosGroup/OpenCOLLADA
cd OpenCOLLADA
git checkout v1.6.68
patch -p1 --batch --forward -i ../nix/patches/opencollada/pr622_and_disable_subdirs.patch
patch -p1 --batch --forward -i ../nix/patches/opencollada/allow_static_libraries_config_on_unix.patch
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_FLAGS_INIT="-fPIC"
sudo make -j$(nproc) install

# We need zstd and libxml2 just for cmake config files to test the examples build.
# zslibzstd-dev has cmake config only on Ubuntu 24.04+.
- name : Build zstd
run: |
git clone https://github.com/facebook/zstd --depth 1 --branch v1.5.7
cd zstd
# `build` already exists.
mkdir build_ && cd build_
cmake ../build/cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
sudo cmake --build . --target install -j $(nproc)

# libxml2-dev doesn't have cmake configs even on Ubuntu 24.04+.
- name: Build libxml2
run: |
git clone https://gitlab.gnome.org/GNOME/libxml2.git --branch v2.13.8 --depth 1
cd libxml2
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
sudo cmake --build . --target install -j $(nproc)

# Ubuntu has `swig` package, but we build it to match the version we use in the main build.
# To avoid failing tests when checking stub generation.
- name: build swig
run: |
# Remove default swig to avoid conflicts.
sudo apt remove --purge swig swig4.0
sudo apt-get install -y libpcre2-dev bison
git clone https://github.com/swig/swig --branch v4.1.0 --depth 1
cd swig
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
sudo make -j$(nproc) install
# - name: build OpenCOLLADA
# run: |
# git clone https://github.com/KhronosGroup/OpenCOLLADA
# cd OpenCOLLADA
# git checkout v1.6.68
# patch -p1 --batch --forward -i ../nix/patches/opencollada/pr622_and_disable_subdirs.patch
# patch -p1 --batch --forward -i ../nix/patches/opencollada/allow_static_libraries_config_on_unix.patch
# mkdir build && cd build
# cmake .. \
# -DCMAKE_BUILD_TYPE=Release \
# -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
# -DCMAKE_C_COMPILER_LAUNCHER=ccache \
# -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
# -DCMAKE_CXX_FLAGS_INIT="-fPIC"
# sudo make -j$(nproc) install

- name: Build ifcopenshell
run: |
echo $Python3_ROOT_DIR
echo ${{ env.pythonLocation }}

mkdir build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=/usr \
-DCMAKE_SYSTEM_PREFIX_PATH=/usr \
-DPYTHON_EXECUTABLE:FILEPATH=${{ env.pythonLocation }}/bin/python \
-DPYTHON_INCLUDE_DIR:PATH=${{ env.pythonLocation }}/include/python3.11 \
-DUSE_MMAP=On \
"-DSCHEMA_VERSIONS=2x3;4;4x3_add2" \
-DGLTF_SUPPORT=On \
-DWITH_ROCKSDB=On \
../cmake
sudo make -j $(nproc)
sudo make install
conan build . -pr:h=.conan2/profiles/linux_host -pr:b=.conan2/profiles/linux_host
# conan export .
conan export-pkg . -pr:h=.conan2/profiles/linux_host -pr:b=.conan2/profiles/linux_host
# cd build
# cmake ../cmake/ -DCMAKE_TOOLCHAIN_FILE="Release/generators/conan_toolchain.cmake"
# make -j $(nproc)
# sudo make install

# - name: Run IfcConvert on Sample files
# run: |
# (find test/input src/bonsai/test/files -name '*.ifc' | while read i; do \
# echo $i | tee -a log; \
# timeout 1m "$(which IfcConvert)" -yv "$i" "$i.obj" --validate >> log 2>&1; \
# echo $i $? >> statuses; \
# done) || true
# (find test/input src/bonsai/test/files -name '*.ifc' | while read i; do \
# echo $i | tee -a log; \
# timeout 1m "./build/Debug/ifcconvert/IfcConvert" -yv "$i" "$i.obj" --validate >> log 2>&1; \
# echo $i $? >> statuses; \
# done) || true
# echo Failed
# grep -v 0$ statuses
# grep -v 0$ statuses | wc -l
Expand All @@ -205,44 +122,37 @@ jobs:

- name: Run IfcConvert on Sample file
run: |
IfcConvert test/input/acad2010_walls.ifc test/input/acad2010_walls.obj
./build/Release/ifcconvert/IfcConvert test/input/acad2010_walls.ifc test/input/acad2010_walls.obj

- name: Build standalone examples to test cmake package
run: |
cd src/examples
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build .
./IfcParseExamples "../IfcParseExamples_test.ifc"
./IfcOpenHouse
./IfcAdvancedHouse
./IfcAlignment
./IfcSimplifiedAlignment
conan test src/examples ifcopenshell/0.8.5 -pr:h=.conan2/profiles/linux_host -pr:b=.conan2/profiles/linux_host

- name: Test ifcopenshell-python
run: |
cd test
# ldd /opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/ifcopenshell/_ifcopenshell_wrapper.cpython-311-x86_64-linux-gnu.so
# readelf -Ws /opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/ifcopenshell/_ifcopenshell_wrapper.cpython-311-x86_64-linux-gnu.so

python tests.py
cd ../src/ifcopenshell-python
mv ifcopenshell ifcopenshell-local # Force testing on installed module
pip install -e ../ifcpatch --no-deps # Needed for sql.py tests.
ERROR=0
make test-parallel || ERROR=1
cd ../bcf && make test || ERROR=1
pip install requests
cd ../bsdd && make test || ERROR=1
pip install deepdiff
cd ../ifcdiff && make test || ERROR=1
cd ../ifcpatch && make test || ERROR=1
pip install -e ../ifctester --no-deps
cd ../ifctester && make test || ERROR=1
# Run mathutils related tests at the end to ensure no other code is relying on mathutils.
cd ../ifcopenshell-python
pip install mathutils
make test-mathutils || ERROR=1
if [ $ERROR -ne 0 ]; then
echo "One or more tests failed";
exit 1;
fi
# cd ../src/ifcopenshell-python
# mv ifcopenshell ifcopenshell-local # Force testing on installed module
# pip install -e ../ifcpatch --no-deps # Needed for sql.py tests.
# ERROR=0
# make test-parallel || ERROR=1
# cd ../bcf && make test || ERROR=1
# pip install requests
# cd ../bsdd && make test || ERROR=1
# pip install deepdiff
# cd ../ifcdiff && make test || ERROR=1
# cd ../ifcpatch && make test || ERROR=1
# pip install -e ../ifctester --no-deps
# cd ../ifctester && make test || ERROR=1
# # Run mathutils related tests at the end to ensure no other code is relying on mathutils.
# cd ../ifcopenshell-python
# pip install mathutils
# make test-mathutils || ERROR=1
# if [ $ERROR -ne 0 ]; then
# echo "One or more tests failed";
# exit 1;
# fi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
/src/qtviewer/out/

/win/BuildDepsCache*.txt
CMakeUserPresets.json

# General Python residue
__pycache__
Expand All @@ -37,6 +38,8 @@ venv
*.swp
*.swo

test_package/

# Flask
instance/*
!instance/.gitignore
Expand Down
Loading
Loading