From 4dfb3db9a0b4668705feb92dafbb7a5503d632fc Mon Sep 17 00:00:00 2001 From: messner Date: Wed, 30 Oct 2024 14:24:53 -0400 Subject: [PATCH 1/9] First batch of fixes --- CMakeLists.txt | 2 +- pybind11 | 2 +- src/CMakeLists.txt | 6 ++++-- src/cp/slipharden.cxx | 4 ---- test/test_nemlmath.py | 4 +++- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fbf201a6..a55d1d88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.1) +CMAKE_MINIMUM_REQUIRED(VERSION 3.5) project(NEML LANGUAGES CXX) ### Version ### diff --git a/pybind11 b/pybind11 index 1a917f18..7c33cdc2 160000 --- a/pybind11 +++ b/pybind11 @@ -1 +1 @@ -Subproject commit 1a917f1852eb7819b671fc3fa862840f4c491a07 +Subproject commit 7c33cdc2d39c7b99a122579f53bc94c8eb3332ff diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 69646b39..3aa966d8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -40,8 +40,7 @@ target_include_directories(neml PRIVATE "../include") target_link_libraries(neml ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${SOLVER_LIBRARIES} ${OpenMP_CXX_LIBRARIES}) generate_export_header(neml EXPORT_FILE_NAME ${PROJECT_SOURCE_DIR}/include/neml_export.h) generate_export_header(neml EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/include/neml_export.h) -set_target_properties(neml PROPERTIES PUBLIC_HEADER - "${PROJECT_BINARY_DIR}/include/neml_export.h;../include/neml_interface.h;../include/nemlerror.h;../include/windows.h") + # An annoyance for building the python package if (PYTHON_PACKAGE) @@ -49,6 +48,9 @@ if (PYTHON_PACKAGE) install(TARGETS neml LIBRARY DESTINATION neml) else() + set_target_properties(neml PROPERTIES PUBLIC_HEADER + "${PROJECT_BINARY_DIR}/include/neml_export.h;../include/neml_interface.h;../include/nemlerror.h;../include/windows.h" + ) install(TARGETS neml LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include) diff --git a/src/cp/slipharden.cxx b/src/cp/slipharden.cxx index 03f4ad14..5b1557aa 100644 --- a/src/cp/slipharden.cxx +++ b/src/cp/slipharden.cxx @@ -392,10 +392,8 @@ void FASlipHardening::populate_hist(History & history) const void FASlipHardening::init_hist(History & history) const { - size_t i = 0; for (auto vn : varnames_) { history.get(vn) = 0.0; - i++; } } @@ -799,10 +797,8 @@ void SimpleLinearHardening::populate_hist(History & history) const void SimpleLinearHardening::init_hist(History & history) const { - size_t i = 0; for (auto vn : varnames_) { history.get(vn) = 0; - i++; } } diff --git a/test/test_nemlmath.py b/test/test_nemlmath.py index f2b3d38c..7b836c4c 100644 --- a/test/test_nemlmath.py +++ b/test/test_nemlmath.py @@ -1,6 +1,8 @@ import sys sys.path.append('..') +import math + from neml.math.nemlmath import * from common import * @@ -396,7 +398,7 @@ def test_isclose(self): class TestVariousFactorial(unittest.TestCase): def test_factorial(self): for i in range(10): - self.assertTrue(np.isclose(np.math.factorial(i), factorial(i))) + self.assertTrue(np.isclose(math.factorial(i), factorial(i))) class TestEigenstuff(unittest.TestCase): def setUp(self): From f96d323192db3f2ab78def0d7e696919af9d8541 Mon Sep 17 00:00:00 2001 From: messner Date: Wed, 30 Oct 2024 14:28:34 -0400 Subject: [PATCH 2/9] Fix upload artifact --- .github/workflows/package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index eea028de..2581fb25 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -60,7 +60,7 @@ jobs: runs-on: ubuntu-latest name: Upload packages to pypi steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4.1.7 with: name: packages path: dist From 618fa0877a76371e35ae51c9c4aebb6dc6ec5682 Mon Sep 17 00:00:00 2001 From: messner Date: Wed, 30 Oct 2024 14:36:12 -0400 Subject: [PATCH 3/9] More depreciated packages --- .github/workflows/package.yml | 4 ++-- .github/workflows/test_packages.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 2581fb25..62d45991 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -32,7 +32,7 @@ jobs: run: python -m pip install cibuildwheel - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: path: ./wheelhouse/*.whl name: packages @@ -50,7 +50,7 @@ jobs: python-version: '3.8' - name: Build source distribution run: python setup.py sdist - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: path: dist/*.tar.gz name: packages diff --git a/.github/workflows/test_packages.yml b/.github/workflows/test_packages.yml index 71b7ceab..1a15b2a4 100644 --- a/.github/workflows/test_packages.yml +++ b/.github/workflows/test_packages.yml @@ -30,7 +30,7 @@ jobs: run: python -m pip install cibuildwheel - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: path: ./wheelhouse/*.whl name: packages @@ -48,7 +48,7 @@ jobs: python-version: '3.8' - name: Build source distribution run: python setup.py sdist - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: path: dist/*.tar.gz name: packages From ddcc11ea2eceddec114c19a6bd544d277c4a0f8b Mon Sep 17 00:00:00 2001 From: messner Date: Wed, 30 Oct 2024 14:42:55 -0400 Subject: [PATCH 4/9] More issues being fixed --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef1a26f6..7c61af6a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,7 +44,7 @@ jobs: with: submodules: recursive - run: brew update - - run: brew install cmake openblas superlu 1>/dev/null || true + - run: brew install cmake openblas superlu - uses: actions/setup-python@v4 with: python-version: '3.11' @@ -62,8 +62,9 @@ jobs: with: submodules: recursive - run: brew update - - run: brew install cmake openblas superlu gfortran valgrind 1>/dev/null || true + - run: brew install cmake openblas superlu gfortran valgrind - run: brew reinstall gcc + - run: echo `which gfortran` - run: cmake -D CMAKE_CXX_COMPILER=/usr/bin/g++ -D CMAKE_C_COMPILER=/usr/bin/gcc -D CMAKE_Fortran_COMPILER=/usr/local/bin/gfortran -D CMAKE_BUILD_TYPE=${{ matrix.btype }} -D USE_OPENMP=OFF -D BUILD_UTILS=ON . - run: make -j 2 - run: test/drivers/test_drivers.sh From 6178eb9e3f334dae0dd591a90920c4caa3285ebc Mon Sep 17 00:00:00 2001 From: messner Date: Wed, 30 Oct 2024 14:49:12 -0400 Subject: [PATCH 5/9] More fixes --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7c61af6a..bc6121ce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -62,7 +62,7 @@ jobs: with: submodules: recursive - run: brew update - - run: brew install cmake openblas superlu gfortran valgrind + - run: brew install cmake openblas superlu gfortran - run: brew reinstall gcc - run: echo `which gfortran` - run: cmake -D CMAKE_CXX_COMPILER=/usr/bin/g++ -D CMAKE_C_COMPILER=/usr/bin/gcc -D CMAKE_Fortran_COMPILER=/usr/local/bin/gfortran -D CMAKE_BUILD_TYPE=${{ matrix.btype }} -D USE_OPENMP=OFF -D BUILD_UTILS=ON . From b8ddc8a838546b71c3b37a8c6692a35c2f61116d Mon Sep 17 00:00:00 2001 From: messner Date: Wed, 30 Oct 2024 14:55:28 -0400 Subject: [PATCH 6/9] Hopefully fix mac --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bc6121ce..3d2a821f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -64,8 +64,7 @@ jobs: - run: brew update - run: brew install cmake openblas superlu gfortran - run: brew reinstall gcc - - run: echo `which gfortran` - - run: cmake -D CMAKE_CXX_COMPILER=/usr/bin/g++ -D CMAKE_C_COMPILER=/usr/bin/gcc -D CMAKE_Fortran_COMPILER=/usr/local/bin/gfortran -D CMAKE_BUILD_TYPE=${{ matrix.btype }} -D USE_OPENMP=OFF -D BUILD_UTILS=ON . + - run: cmake -D CMAKE_CXX_COMPILER=/usr/bin/g++ -D CMAKE_C_COMPILER=/usr/bin/gcc -D CMAKE_Fortran_COMPILER=/opt/homebrew/bin/gfortran -D CMAKE_BUILD_TYPE=${{ matrix.btype }} -D USE_OPENMP=OFF -D BUILD_UTILS=ON . - run: make -j 2 - run: test/drivers/test_drivers.sh - run: cd profiling && ./check_memory.sh From e251e4a28fb1a0ffaa3a7e314250ccbc007c4700 Mon Sep 17 00:00:00 2001 From: messner Date: Wed, 30 Oct 2024 15:06:51 -0400 Subject: [PATCH 7/9] Install gfortran --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d2a821f..d5a15fd0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,7 +84,7 @@ jobs: with: msystem: MINGW64 update: true - install: git mingw-w64-x86_64-toolchain base-devel mingw-w64-x86_64-openblas mingw-w64-x86_64-cmake mingw-w64-x86_64-python-pip mingw-w64-x86_64-python-numpy mingw-w64-x86_64-python-scipy mingw-w64-x86_64-python-networkx mingw-w64-x86_64-python-matplotlib + install: git mingw-w64-x86_64-toolchain base-devel mingw-w64-x86_64-openblas mingw-w64-x86_64-cmake mingw-w64-x86_64-python-pip mingw-w64-x86_64-python-numpy mingw-w64-x86_64-python-scipy mingw-w64-x86_64-python-networkx mingw-w64-x86_64-python-matplotlib mingw-w64-x86_64-gcc-fortran - run: pip install nose2 - run: cmake . -G"MSYS Makefiles" -D"WRAP_PYTHON=ON" -D"CMAKE_BUILD_TYPE=${{ matrix.btype }}" - run: make -j 2 @@ -105,7 +105,7 @@ jobs: with: msystem: MINGW64 update: true - install: git mingw-w64-x86_64-toolchain base-devel mingw-w64-x86_64-openblas mingw-w64-x86_64-cmake + install: git mingw-w64-x86_64-toolchain base-devel mingw-w64-x86_64-openblas mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc-fortran - run: cmake . -G"MSYS Makefiles" -D"BUILD_UTILS=ON" -D"CMAKE_BUILD_TYPE=${{ matrix.btype }}" - run: make -j 2 - run: PATH=$PATH:$PWD/lib ./test/drivers/test_drivers.sh From 898545eaa19d127b94a8df88fe37e16dbe6cb484 Mon Sep 17 00:00:00 2001 From: messner Date: Wed, 30 Oct 2024 15:26:34 -0400 Subject: [PATCH 8/9] Don't build python 3.6 --- .github/workflows/package.yml | 2 +- .github/workflows/test_packages.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 62d45991..223e87a1 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -5,7 +5,7 @@ on: jobs: build_wheels_linux_mac: env: - CIBW_SKIP: cp311-* cp312-* cp313-* *-manylinux_i686 pp* *_ppc641e *_s390x *_aarch64 *musllinux* + CIBW_SKIP: cp36-* cp311-* cp312-* cp313-* *-manylinux_i686 pp* *_ppc641e *_s390x *_aarch64 *musllinux* CIBW_BEFORE_ALL_LINUX: yum -y install cmake cmake3 blas-devel lapack-devel && alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake 10 --slave /usr/local/bin/ctest ctest /usr/bin/ctest --slave /usr/local/bin/cpack cpack /usr/bin/cpack --slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake --family cmake && alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 --slave /usr/local/bin/ctest ctest /usr/bin/ctest3 --slave /usr/local/bin/cpack cpack /usr/bin/cpack3 --slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 --family cmake CIBW_BEFORE_ALL_MACOS: brew install cmake openblas superlu gfortran CIBW_BEFORE_BUILD: "cmake -DCMAKE_BUILD_TYPE=Release -DUSE_OPENMP=OFF . && cmake --build . && rm CMakeCache.txt && rm -rf CMakeFiles && pip install -r requirements.txt" diff --git a/.github/workflows/test_packages.yml b/.github/workflows/test_packages.yml index 1a15b2a4..a7a008b5 100644 --- a/.github/workflows/test_packages.yml +++ b/.github/workflows/test_packages.yml @@ -3,7 +3,7 @@ on: pull_request jobs: test_wheels_linux_mac: env: - CIBW_SKIP: cp311-* cp312-* cp313-* *-manylinux_i686 pp* *_ppc641e *_s390x *_aarch64 *musllinux* + CIBW_SKIP: cp36-* cp311-* cp312-* cp313-* *-manylinux_i686 pp* *_ppc641e *_s390x *_aarch64 *musllinux* CIBW_BEFORE_ALL_LINUX: yum -y install cmake cmake3 blas-devel lapack-devel && alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake 10 --slave /usr/local/bin/ctest ctest /usr/bin/ctest --slave /usr/local/bin/cpack cpack /usr/bin/cpack --slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake --family cmake && alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 --slave /usr/local/bin/ctest ctest /usr/bin/ctest3 --slave /usr/local/bin/cpack cpack /usr/bin/cpack3 --slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 --family cmake CIBW_BEFORE_ALL_MACOS: brew install cmake openblas superlu gfortran CIBW_BEFORE_BUILD: "cmake -DCMAKE_BUILD_TYPE=Release -DUSE_OPENMP=OFF . && cmake --build . && rm CMakeCache.txt && rm -rf CMakeFiles && pip install -r requirements.txt" From 92fe09ec16e25f971371f784844ef5011f7dc2fe Mon Sep 17 00:00:00 2001 From: messner Date: Thu, 31 Oct 2024 08:16:28 -0400 Subject: [PATCH 9/9] Please work --- .github/workflows/package.yml | 25 +++++++++++++++++++++---- .github/workflows/test_packages.yml | 2 +- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 223e87a1..8dbd537f 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -35,7 +35,7 @@ jobs: - uses: actions/upload-artifact@v4 with: path: ./wheelhouse/*.whl - name: packages + name: packages-${{matrix.os}} build_sdist: name: Build source distribution @@ -53,16 +53,33 @@ jobs: - uses: actions/upload-artifact@v4 with: path: dist/*.tar.gz - name: packages + name: packages-source - upload_pypi: + upload_pypi_wheel: + needs: [build_wheels_linux_mac, build_sdist] + runs-on: ubuntu-latest + name: Upload packages to pypi + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - uses: actions/download-artifact@v4.1.7 + with: + name: packages-${{matrix.os}} + path: dist + - uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PIPY_PASSWORD }} + + upload_pypi_source: needs: [build_wheels_linux_mac, build_sdist] runs-on: ubuntu-latest name: Upload packages to pypi steps: - uses: actions/download-artifact@v4.1.7 with: - name: packages + name: packages-source path: dist - uses: pypa/gh-action-pypi-publish@master with: diff --git a/.github/workflows/test_packages.yml b/.github/workflows/test_packages.yml index a7a008b5..481bdf63 100644 --- a/.github/workflows/test_packages.yml +++ b/.github/workflows/test_packages.yml @@ -33,7 +33,7 @@ jobs: - uses: actions/upload-artifact@v4 with: path: ./wheelhouse/*.whl - name: packages + name: packages-${{matrix.os}} test_sdist: name: Test source distribution on linux