From 5e22f9c1322f122b22ea3fdcdc322c25f9c19940 Mon Sep 17 00:00:00 2001 From: Werner Van Geit Date: Tue, 26 Nov 2024 11:46:26 +0100 Subject: [PATCH 1/8] Fix version filec --- itis_dakota/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/itis_dakota/__init__.py b/itis_dakota/__init__.py index b7755b9..7c36ffd 100644 --- a/itis_dakota/__init__.py +++ b/itis_dakota/__init__.py @@ -1,7 +1,7 @@ from importlib.metadata import PackageNotFoundError, version try: - __version__ = version("osparc_filecomms") + __version__ = version("itis-dakota") except PackageNotFoundError: # package is not installed pass From e8af258a48db5314f38b962c715b8dcead8b979c Mon Sep 17 00:00:00 2001 From: Werner Van Geit Date: Tue, 10 Dec 2024 16:23:51 +0100 Subject: [PATCH 2/8] Switch boost version --- pyproject.toml | 8 ++++---- src_patches/find_python.patch | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 src_patches/find_python.patch diff --git a/pyproject.toml b/pyproject.toml index 4d67d3e..2a4ae8a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,8 +41,8 @@ repair-wheel-command = "auditwheel repair -w {dest_dir} {wheel} && ./scripts/fix build-verbosity = 2 [tool.cibuildwheel.environment] -BOOST_LIBRARYDIR = "/usr/lib64/boost169" -BOOST_INCLUDEDIR = "/usr/include/boost169" +BOOST_LIBRARYDIR = "/usr/lib64/boost1.78" +BOOST_INCLUDEDIR = "/usr/include/boost1.78" [tool.cibuildwheel.linux] environment-pass = [ @@ -54,7 +54,7 @@ before-all = [ "yum install -y epel-release yum-utils", "yum-config-manager --enable epel", "yum makecache --refresh", - "yum install -y lapack-devel boost169-devel blas-devel hdf5-devel zip unzip ccache wget", + "yum install -y lapack-devel boost1.78-devel blas-devel hdf5-devel zip unzip ccache wget", "wget --progress=dot:mega https://github.com/mozilla/sccache/releases/download/v0.8.1/sccache-v0.8.1-x86_64-unknown-linux-musl.tar.gz", "tar xzvf sccache-v0.8.1-x86_64-unknown-linux-musl.tar.gz", "cp sccache-v0.8.1-x86_64-unknown-linux-musl/sccache /usr/bin/", @@ -79,4 +79,4 @@ BUILD_SHARED_LIBS = "OFF" CMAKE_POSITION_INDEPENDENT_CODE = "ON" [tool.pytest.ini_options] -addopts = "--ignore=dakota/" +addopts = "--ignore=dakota/" diff --git a/src_patches/find_python.patch b/src_patches/find_python.patch new file mode 100644 index 0000000..414eae8 --- /dev/null +++ b/src_patches/find_python.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/DakotaFindPython.cmake b/cmake/DakotaFindPython.cmake +index 9ffa1ca..8edd853 100644 +--- a/cmake/DakotaFindPython.cmake ++++ b/cmake/DakotaFindPython.cmake +@@ -8,7 +8,7 @@ macro(dakota_find_python) + if(DAKOTA_PYTHON_DIRECT_INTERFACE OR DAKOTA_PYTHON_SURROGATES OR + DAKOTA_PYTHON_WRAPPER OR DAKOTA_PYBIND11) + message(STATUS "Dakota enabling Python (Development) for direct or surrogate interface") +- list(APPEND dakota_python_components Development) ++ list(APPEND dakota_python_components Development.module) + + if (DAKOTA_PYTHON_DIRECT_INTERFACE_LEGACY) + if (DAKOTA_PYTHON_DIRECT_INTERFACE) +@@ -31,7 +31,7 @@ macro(dakota_find_python) + + endif() + +- find_package(Python REQUIRED ${dakota_python_components}) ++ # find_package(Python REQUIRED ${dakota_python_components}) + + if (DAKOTA_PYTHON_DIRECT_INTERFACE_NUMPY) + message(STATUS "NumPy version ${Python_NumPy_VERSION} found at ${Python_NumPy_INCLUDE_DIRS}") From b0a0cf6c621351f80f5efc298913bf89b1afff27 Mon Sep 17 00:00:00 2001 From: Werner Van Geit Date: Tue, 10 Dec 2024 17:00:41 +0100 Subject: [PATCH 3/8] Add queso --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2a4ae8a..d9584d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ before-all = [ "yum install -y epel-release yum-utils", "yum-config-manager --enable epel", "yum makecache --refresh", - "yum install -y lapack-devel boost1.78-devel blas-devel hdf5-devel zip unzip ccache wget", + "yum install -y lapack-devel boost1.78-devel blas-devel hdf5-devel zip unzip ccache wget gsl-devel", "wget --progress=dot:mega https://github.com/mozilla/sccache/releases/download/v0.8.1/sccache-v0.8.1-x86_64-unknown-linux-musl.tar.gz", "tar xzvf sccache-v0.8.1-x86_64-unknown-linux-musl.tar.gz", "cp sccache-v0.8.1-x86_64-unknown-linux-musl/sccache /usr/bin/", @@ -73,6 +73,8 @@ install_components = ["dakota_for_python"] [tool.py-build-cmake.cmake.options] CMAKE_CXX_COMPILER_LAUNCHER = "sccache" DAKOTA_HAVE_HDF5 = "ON" +HAVE_QUESO = "ON" +DAKOTA_HAVE_GSL = "ON" DAKOTA_PYTHON_WRAPPER = "ON" DAKOTA_PYTHON_DIRECT_INTERFACE = "ON" BUILD_SHARED_LIBS = "OFF" From 3586f93e0ea9b59c221b451f1e359820212ffaea Mon Sep 17 00:00:00 2001 From: Werner Van Geit Date: Wed, 11 Dec 2024 13:36:17 +0100 Subject: [PATCH 4/8] Fixes gcc error related to cstdint --- Makefile | 3 +++ src_patches/cstdint.patch | 24 ++++++++++++++++++++++++ src_patches/cstdint_dak_types.patch | 12 ++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 src_patches/cstdint.patch create mode 100644 src_patches/cstdint_dak_types.patch diff --git a/Makefile b/Makefile index 0da52e1..8779ad5 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,9 @@ get-dakota-src: git apply ../src_patches/dakota-src.patch && \ git apply ../src_patches/boost.patch && \ git apply ../src_patches/dakenv_restart.patch && \ + git apply ../src_patches/cstdint_dak_types.patch && \ git apply --whitespace=nowarn ../src_patches/adaptsampl_batch.patch && \ find . \( -name \*.cpp -o -name \*.hpp -o -name \*.c -o -name \*.h \) -exec \ sed -i -E -f ../src_patches/replace_old_macros_numpy.sed {} + + cd dakota/packages/external && \ + git apply ../../../src_patches/cstdint.patch diff --git a/src_patches/cstdint.patch b/src_patches/cstdint.patch new file mode 100644 index 0000000..c8c462e --- /dev/null +++ b/src_patches/cstdint.patch @@ -0,0 +1,24 @@ +diff --git a/trilinos/packages/teuchos/core/src/Teuchos_BigUInt.hpp b/trilinos/packages/teuchos/core/src/Teuchos_BigUInt.hpp +index 5b6d3c5e..7fbfec7b 100644 +--- a/trilinos/packages/teuchos/core/src/Teuchos_BigUInt.hpp ++++ b/trilinos/packages/teuchos/core/src/Teuchos_BigUInt.hpp +@@ -43,6 +43,7 @@ + #define TEUCHOS_BIG_UINT_HPP + + #include ++#include + #include + + /*! \file Teuchos_BigUInt.hpp +diff --git a/trilinos/packages/teuchos/core/src/Teuchos_BigUIntDecl.hpp b/trilinos/packages/teuchos/core/src/Teuchos_BigUIntDecl.hpp +index e82e8be9..a51f66cf 100644 +--- a/trilinos/packages/teuchos/core/src/Teuchos_BigUIntDecl.hpp ++++ b/trilinos/packages/teuchos/core/src/Teuchos_BigUIntDecl.hpp +@@ -42,6 +42,7 @@ + #ifndef TEUCHOS_BIG_UINT_DECL_HPP + #define TEUCHOS_BIG_UINT_DECL_HPP + ++#include + #include + + /*! \file Teuchos_BigUIntDecl.hpp diff --git a/src_patches/cstdint_dak_types.patch b/src_patches/cstdint_dak_types.patch new file mode 100644 index 0000000..66af001 --- /dev/null +++ b/src_patches/cstdint_dak_types.patch @@ -0,0 +1,12 @@ +diff --git a/src/dakota_data_types.hpp b/src/dakota_data_types.hpp +index 8771587..a430d51 100644 +--- a/src/dakota_data_types.hpp ++++ b/src/dakota_data_types.hpp +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + namespace Dakota { + From 18ba8478af2148be71536ef96a673696e7b40257 Mon Sep 17 00:00:00 2001 From: Werner Van Geit Date: Wed, 11 Dec 2024 14:09:51 +0100 Subject: [PATCH 5/8] Fix versioning --- itis_dakota/__init__.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/itis_dakota/__init__.py b/itis_dakota/__init__.py index 7c36ffd..dc44cb8 100644 --- a/itis_dakota/__init__.py +++ b/itis_dakota/__init__.py @@ -1,7 +1,2 @@ -from importlib.metadata import PackageNotFoundError, version - -try: - __version__ = version("itis-dakota") -except PackageNotFoundError: - # package is not installed - pass +from ._version import __version__ #NOQA +from ._version import __version_tuple__ #NOQA From 25d7ddd8587d8462b00ad6292e6d43e1344d93cf Mon Sep 17 00:00:00 2001 From: Werner Van Geit Date: Wed, 11 Dec 2024 14:12:53 +0100 Subject: [PATCH 6/8] Add cron build every week --- .github/workflows/build-wheels.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 899491a..b223ee4 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -2,7 +2,9 @@ name: build-wheel on: push: - + schedule: + - cron: "5 0 * * 0" + jobs: tag: name: Tag new version @@ -24,7 +26,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} WITH_V: false DEFAULT_BUMP: patch - + wheels: name: Build wheel on ${{ matrix.python }} ${{ matrix.os }} ${{ matrix.arch }} runs-on: ${{ matrix.os }} @@ -81,7 +83,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write - if: github.ref == 'refs/heads/master' + if: github.event_name == 'push' && github.ref == 'refs/heads/master' needs: - tag - wheels @@ -102,7 +104,7 @@ jobs: runs-on: ubuntu-latest needs: - release - if: github.ref == 'refs/heads/master' + if: github.event_name == 'push' && github.ref == 'refs/heads/master' environment: name: testpypi url: https://test.pypi.org/p/itis-dakota @@ -125,7 +127,7 @@ jobs: runs-on: ubuntu-latest needs: - test-pypi - if: github.ref == 'refs/heads/master' + if: github.event_name == 'push' && github.ref == 'refs/heads/master' environment: name: pypi url: https://pypi.org/p/itis-dakota From c98235dffab5a4156d24b24881619334e582355b Mon Sep 17 00:00:00 2001 From: Werner Van Geit Date: Wed, 11 Dec 2024 14:23:32 +0100 Subject: [PATCH 7/8] Add 3.13 python --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index b223ee4..8c933b2 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -34,7 +34,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - python: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] arch: [x86_64] env: SCCACHE_GHA_ENABLED: "on" From b48e0b022eea11ddc1a41a0c34e1a2b855031fcd Mon Sep 17 00:00:00 2001 From: Werner Van Geit Date: Wed, 11 Dec 2024 15:23:13 +0100 Subject: [PATCH 8/8] Remove py 3.13 again --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 8c933b2..b223ee4 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -34,7 +34,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - python: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + python: ['3.8', '3.9', '3.10', '3.11', '3.12'] arch: [x86_64] env: SCCACHE_GHA_ENABLED: "on"