diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index eea028de..8dbd537f 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" @@ -32,10 +32,10 @@ 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 + name: packages-${{matrix.os}} build_sdist: name: Build source distribution @@ -50,19 +50,36 @@ 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 + 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@v2 + - 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.yml b/.github/workflows/test.yml index ef1a26f6..d5a15fd0 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,9 +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 - run: brew reinstall gcc - - 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 @@ -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 diff --git a/.github/workflows/test_packages.yml b/.github/workflows/test_packages.yml index 71b7ceab..481bdf63 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" @@ -30,10 +30,10 @@ 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 + name: packages-${{matrix.os}} test_sdist: name: Test source distribution on linux @@ -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 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):