diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml new file mode 100644 index 000000000..4579501b2 --- /dev/null +++ b/.github/workflows/build_and_test.yml @@ -0,0 +1,406 @@ +name: Build and test wheels 🐍 + +on: + push: + branches: + - '**' + pull_request: + workflow_call: + workflow_dispatch: + inputs: + full_matrix: + description: 'Run full OS and Python matrix' + required: false + type: boolean + default: false + +concurrency: + group: build-${{ github.ref }} + cancel-in-progress: true + +jobs: + set_matrix: + name: Set OS matrix + runs-on: ubuntu-latest + outputs: + os: ${{ steps.matrix.outputs.os }} + python_versions: ${{ steps.matrix.outputs.python_versions }} + steps: + - name: Set OS matrix + id: matrix + run: | + # macos-15-intel is intentionally omitted: an MPFR/Boost interaction + # causes SIGABRT in pytest that we cannot reproduce locally (no Intel + # Mac available to the maintainer). Intel macOS support is paused + # pending a reproducer or an upstream fix. Re-add "macos-15-intel" + # below when ready to revisit. + if [[ "${{ github.ref }}" == "refs/heads/main" || "${{ github.ref }}" == "refs/heads/develop" || "${{ github.ref }}" == refs/tags/* || "${{ inputs.full_matrix }}" == "true" || "${{ github.event.pull_request.base.ref }}" == "develop" || "${{ github.event.pull_request.base.ref }}" == "main" ]]; then + echo 'os=["ubuntu-latest","macos-14"]' >> $GITHUB_OUTPUT + echo 'python_versions=["3.9","3.10","3.11","3.12","3.13"]' >> $GITHUB_OUTPUT + else + echo 'os=["ubuntu-latest","macos-14"]' >> $GITHUB_OUTPUT + echo 'python_versions=["3.11"]' >> $GITHUB_OUTPUT + fi + + test_cpp_unix: + name: C++ tests on ${{ matrix.os }} + needs: [set_matrix] + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ${{ fromJson(needs.set_matrix.outputs.os) }} + steps: + - uses: actions/checkout@v5 + + - name: Install system dependencies (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y wget libgmp-dev libmpfr-dev libmpc-dev libeigen3-dev libtool + + - name: Install system dependencies (macOS) + if: runner.os == 'macOS' + run: brew install gmp mpfr libmpc eigen@3 + + - name: Build Boost base (Linux) + if: runner.os == 'Linux' + run: | + cd /tmp + curl -fsSL -o boost_1_90_0.tar.bz2 https://archives.boost.io/release/1.90.0/source/boost_1_90_0.tar.bz2 + tar xjf boost_1_90_0.tar.bz2 + cd boost_1_90_0 + ./bootstrap.sh --prefix=/tmp/boost-base \ + --with-libraries=serialization,filesystem,graph,chrono,regex,timer,log,thread,test + ./b2 install -j$(nproc) + + - name: Build Boost base (macOS) + if: runner.os == 'macOS' + run: | + cd /tmp + curl -fsSL -o boost_1_90_0.tar.bz2 https://archives.boost.io/release/1.90.0/source/boost_1_90_0.tar.bz2 + tar xjf boost_1_90_0.tar.bz2 + cd boost_1_90_0 + ./bootstrap.sh --prefix=/tmp/boost-base \ + --with-libraries=serialization,filesystem,graph,chrono,regex,timer,log,thread,test + ./b2 install -j2 hardcode-dll-paths=true dll-path=/tmp/boost-base/lib + + - name: Configure + run: | + cmake -B build \ + -DCMAKE_PREFIX_PATH=/tmp/boost-base \ + -DBUILD_PYTHON_BINDINGS=OFF \ + -DENABLE_UNIT_TESTING=ON \ + -DINSTALL_DOCUMENTATION=OFF \ + -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON \ + -DCMAKE_BUILD_TYPE=Release + + - name: Build + run: cmake --build build --parallel 2 + + - name: Test + working-directory: build + env: + LD_LIBRARY_PATH: /tmp/boost-base/lib:/tmp/boost-base/lib64 + DYLD_LIBRARY_PATH: /tmp/boost-base/lib + run: ctest --output-on-failure --parallel $(nproc 2>/dev/null || sysctl -n hw.ncpu) + + test_cpp_windows: + name: C++ tests on Windows + runs-on: windows-latest + env: + CONDA_PKGS_DIRS: ${{ github.workspace }}\conda_pkgs + steps: + - uses: actions/checkout@v5 + + - name: Cache conda packages + uses: actions/cache@v5 + with: + path: ${{ github.workspace }}\conda_pkgs + key: windows-conda-cpp-${{ hashFiles('environment-win.yml', '.github/workflows/build_and_test.yml') }} + restore-keys: | + windows-conda-cpp- + windows-conda- + + - uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: b2-windows + environment-file: environment-win.yml + auto-activate-base: false + channel-priority: strict + + - name: Configure and build C++ tests + shell: pwsh + run: | + $env:CC = 'clang-cl' + $env:CXX = 'clang-cl' + $env:CMAKE_GENERATOR = 'Ninja' + $env:CMAKE_GENERATOR_PLATFORM = '' + $env:CMAKE_GENERATOR_TOOLSET = '' + $env:CMAKE_PREFIX_PATH = "$env:CONDA_PREFIX\Library" + + $boostHeader = "$env:CONDA_PREFIX\Library\include\boost\archive\archive_exception.hpp" + (Get-Content $boostHeader).Replace('public virtual std::exception', 'public std::exception') | Set-Content $boostHeader + + cmake -B build ` + -DCMAKE_PREFIX_PATH="$env:CONDA_PREFIX\Library" ` + -DBUILD_PYTHON_BINDINGS=OFF ` + -DENABLE_UNIT_TESTING=ON ` + -DINSTALL_DOCUMENTATION=OFF ` + -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON ` + -DCMAKE_BUILD_TYPE=Release + cmake --build build --parallel + + - name: Test + shell: pwsh + working-directory: build + run: ctest --output-on-failure --parallel + + build_macos_ubuntu_wheels: + name: ${{ matrix.os }} Python-${{ matrix.python-version }} wheels + needs: [set_matrix] + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ${{ fromJson(needs.set_matrix.outputs.os) }} + python-version: ${{ fromJson(needs.set_matrix.outputs.python_versions) }} + + steps: + - uses: actions/checkout@v5 + - name: Cache cibuildwheel + pip + Homebrew + uses: actions/cache@v5 + with: + path: | + ~/.cache/pip + ~/.cache/cibuildwheel + ~/Library/Caches/Homebrew + /tmp/boost_1_90_0.tar.bz2 + /tmp/eigenpy-3.11.0.tar.gz + key: ${{ runner.os }}-cibw-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'python/pyproject.toml', 'CMakeLists.txt', 'core/CMakeLists.txt', '.github/workflows/build_and_test.yml') }} + restore-keys: | + ${{ runner.os }}-cibw-${{ matrix.python-version }}- + ${{ runner.os }}-cibw- + - name: Set CIBW_BUILD for this Python version + shell: bash + run: | + PY="${{ matrix.python-version }}" + PY_TAG="cp${PY//./}" + echo "CIBW_BUILD=${PY_TAG}-manylinux* ${PY_TAG}-macosx*" >> $GITHUB_ENV + - name: Set macOS deployment target + if: runner.os == 'macOS' + shell: bash + run: | + SW_VERS=$(sw_vers -productVersion | cut -d. -f1) + echo "MACOSX_DEPLOYMENT_TARGET=${SW_VERS}.0" >> $GITHUB_ENV + - uses: pypa/cibuildwheel@v2.23 + env: + # Build cp39 through cp313 for both Linux (manylinux) and macOS. + # Boost.Python and eigenpy are rebuilt per target Python in BEFORE_BUILD + # so each wheel bundles a matching libboost_python3X. + CIBW_BUILD: ${{ env.CIBW_BUILD }} + CIBW_SKIP: "*-musllinux_* *-manylinux_i686" + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 + # Install system deps + download (but DO NOT build) Boost & eigenpy sources + # once per container. Boost.Python is ABI-locked to a single CPython version, + # so it must be rebuilt per target Python in BEFORE_BUILD — building it here + # against the manylinux2014 system python3 produces a libboost_python39 that + # all five wheels would then bundle, breaking import on cp310/311/312/313. + CIBW_BEFORE_ALL_LINUX: > + yum install -y wget gmp-devel mpfr-devel libmpc-devel eigen3-devel libtool && + cd /tmp && + { [ -f eigenpy-3.11.0.tar.gz ] || wget -q https://github.com/stack-of-tasks/eigenpy/releases/download/v3.11.0/eigenpy-3.11.0.tar.gz ; } + # On macOS, Homebrew's boost-python3 / eigenpy bottles track the current + # Homebrew default Python (now 3.14), so a cp313 wheel that bundles them + # imports a libboost_python314.dylib into a 3.13 interpreter and segfaults. + # Install only the Python-version-independent libs from brew here; download + # Boost & eigenpy sources to /tmp for the per-Python build in BEFORE_BUILD. + CIBW_BEFORE_ALL_MACOS: > + brew install gmp mpfr libmpc eigen@3 && + cd /tmp && + { [ -f eigenpy-3.11.0.tar.gz ] || curl -fsSL -o eigenpy-3.11.0.tar.gz https://github.com/stack-of-tasks/eigenpy/releases/download/v3.11.0/eigenpy-3.11.0.tar.gz ; } + + # Build Boost and eigenpy fresh against the active per-Python interpreter + # so each wheel bundles a matching libboost_python3X. + CIBW_BEFORE_BUILD_LINUX: > + pip install scikit-build-core numpy scipy && + rm -rf /tmp/deps-py && mkdir -p /tmp/deps-py && + PY_VER=$(python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')") && + PY_INC=$(python -c "import sysconfig; print(sysconfig.get_path('include'))") && + PY_LIB=$(python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR') or '')") && + cd /tmp && + { [ -f boost_1_90_0.tar.bz2 ] || wget -q https://archives.boost.io/release/1.90.0/source/boost_1_90_0.tar.bz2 ; } && + rm -rf boost_1_90_0 && tar xjf boost_1_90_0.tar.bz2 && + cd boost_1_90_0 && + ./bootstrap.sh --with-python=$(which python) --prefix=/tmp/deps-py && + printf 'using python : %s : %s : %s : %s ;\n' "$PY_VER" "$(which python)" "$PY_INC" "$PY_LIB" > user-config.jam && + ./b2 install -j$(nproc) --user-config=user-config.jam python=$PY_VER && + cd /tmp && + rm -rf eigenpy-3.11.0 && tar zxf eigenpy-3.11.0.tar.gz && + cd eigenpy-3.11.0 && mkdir -p bld && cd bld && + cmake .. -DCMAKE_PREFIX_PATH=/tmp/deps-py -DCMAKE_INSTALL_PREFIX=/tmp/deps-py -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DPython3_EXECUTABLE=$(which python) -DPython3_NumPy_INCLUDE_DIR=$(python -c "import numpy; print(numpy.get_include())") -DBUILD_TESTING=OFF -DCMAKE_INSTALL_DO_STRIP=ON && + make -j2 install && + find /tmp/deps-py -name '*.so*' -type f | while read f; do + err=$(strip --strip-unneeded "$f" 2>&1) || echo "strip failed on $f: $err" + done + + # On macOS, build all Boost components (including Boost.Python) into /tmp/deps-py + # so delocate sees only one set of dylibs. boost-base is used only for C++ tests. + CIBW_BEFORE_BUILD_MACOS: > + pip install scikit-build-core numpy scipy && + rm -rf /tmp/deps-py && mkdir -p /tmp/deps-py && + PY_VER=$(python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')") && + PY_INC=$(python -c "import sysconfig; print(sysconfig.get_path('include'))") && + PY_LIB=$(python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR') or '')") && + cd /tmp && + { [ -f boost_1_90_0.tar.bz2 ] || curl -fsSL -o boost_1_90_0.tar.bz2 https://archives.boost.io/release/1.90.0/source/boost_1_90_0.tar.bz2 ; } && + rm -rf boost_1_90_0 && tar xjf boost_1_90_0.tar.bz2 && + cd boost_1_90_0 && + ./bootstrap.sh --with-python=$(which python) --prefix=/tmp/deps-py && + printf 'using python : %s : %s : %s : %s ;\n' "$PY_VER" "$(which python)" "$PY_INC" "$PY_LIB" > user-config.jam && + ./b2 install -j$(sysctl -n hw.ncpu) --user-config=user-config.jam python=$PY_VER hardcode-dll-paths=true dll-path=/tmp/deps-py/lib && + cd /tmp && + rm -rf eigenpy-3.11.0 && tar zxf eigenpy-3.11.0.tar.gz && + cd eigenpy-3.11.0 && mkdir -p bld && cd bld && + cmake .. -DCMAKE_PREFIX_PATH="/tmp/deps-py;/opt/homebrew" -DCMAKE_INSTALL_PREFIX=/tmp/deps-py -DPython3_EXECUTABLE=$(which python) -DPython3_NumPy_INCLUDE_DIR=$(python -c "import numpy; print(numpy.get_include())") -DBUILD_TESTING=OFF && + make -j2 install + CIBW_BEFORE_BUILD: "pip install scikit-build-core numpy" + CIBW_ENVIRONMENT_LINUX: "LD_LIBRARY_PATH=/tmp/deps-py/lib:/tmp/deps-py/lib64:$LD_LIBRARY_PATH CMAKE_PREFIX_PATH=/tmp/deps-py" + CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET CMAKE_PREFIX_PATH=/tmp/deps-py:/opt/homebrew DYLD_FALLBACK_LIBRARY_PATH=/tmp/deps-py/lib:/opt/homebrew/lib" + + - uses: actions/upload-artifact@v5 + with: + name: wheels-${{ matrix.os }}-${{ matrix.python-version }} + path: ./wheelhouse/*.whl + if-no-files-found: error + + build_windows_wheels: + name: Windows Python-${{ matrix.python-version }} wheels + runs-on: windows-latest + env: + CONDA_PKGS_DIRS: ${{ github.workspace }}\conda_pkgs + strategy: + fail-fast: false + matrix: + python-version: ['3.9', '3.10', '3.11'] + steps: + - uses: actions/checkout@v5 + with: + persist-credentials: false + - name: Cache conda packages + pip + uses: actions/cache@v5 + with: + path: | + ${{ github.workspace }}\conda_pkgs + ~\AppData\Local\pip\Cache + key: windows-conda-${{ matrix.python-version }}-${{ hashFiles('environment-win.yml', '.github/workflows/build_and_test.yml') }} + restore-keys: | + windows-conda-${{ matrix.python-version }}- + windows-conda- + - uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: b2-windows + environment-file: environment-win.yml + python-version: ${{ matrix.python-version }} + auto-activate-base: false + channel-priority: strict + + - name: Build Windows + shell: pwsh + run: | + conda install -y python=${{ matrix.python-version }} --update-deps + conda info + conda list + $env:CC = 'clang-cl' + $env:CXX = 'clang-cl' + $env:CMAKE_GENERATOR = 'Ninja' + $env:CMAKE_GENERATOR_PLATFORM = '' + $env:CMAKE_GENERATOR_TOOLSET = '' + $env:CMAKE_PREFIX_PATH = "$env:CONDA_PREFIX\Library" + + $boostHeader = "$env:CONDA_PREFIX\Library\include\boost\archive\archive_exception.hpp" + (Get-Content $boostHeader).Replace('public virtual std::exception', 'public std::exception') | Set-Content $boostHeader + + cd ${{ github.workspace }} + pip install build delvewheel + python -m build --wheel --no-isolation + + $wheelPath = (Get-ChildItem dist/*.whl | Select-Object -First 1).FullName + if (-not $wheelPath) { Write-Error "No wheel found in dist/"; exit 1 } + delvewheel repair $wheelPath -w repaired/ --add-path "$env:CONDA_PREFIX\Library\bin" + Remove-Item dist/*.whl + Move-Item repaired/*.whl dist/ + + - uses: actions/upload-artifact@v5 + with: + name: wheels-windows-${{ matrix.python-version }} + path: ./dist/*.whl + + test_wheels_linux_macos: + name: Test wheels on ${{ matrix.os }} / py${{ matrix.python-version }} + needs: [set_matrix, build_macos_ubuntu_wheels] + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ${{ fromJson(needs.set_matrix.outputs.os) }} + python-version: ${{ fromJson(needs.set_matrix.outputs.python_versions) }} + + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Download wheels artifact + uses: actions/download-artifact@v5 + with: + name: wheels-${{ matrix.os }}-${{ matrix.python-version }} + path: dist/ + + - name: Install wheel + run: | + pip install numpy + pip install --no-index --find-links dist/ bertini2 + + - name: Run Python tests + run: | + pip install pytest + python -m pytest python/test/ -v + + test_wheels_windows: + name: Test wheel on windows-${{ matrix.python-version }} + needs: [build_windows_wheels] + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + python-version: ['3.9', '3.10', '3.11'] + + steps: + - uses: actions/checkout@v5 + + - uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: b2-windows + environment-file: environment-win.yml + python-version: ${{ matrix.python-version }} + auto-activate-base: false + channel-priority: strict + + - name: Download wheels artifact + uses: actions/download-artifact@v5 + with: + name: wheels-windows-${{ matrix.python-version }} + path: dist/ + + - name: Install wheel and run tests + shell: pwsh + run: | + conda info + conda install -y python=${{ matrix.python-version }} --update-deps + $py = "C:\Miniconda\envs\b2-windows\python.exe" + & $py -m pip install --no-index --find-links dist/ bertini2 + & $py -m pip install pytest + & $py -m pytest python/test/ -v \ No newline at end of file diff --git a/.github/workflows/github-gitlab-sync.yml b/.github/workflows/github-gitlab-sync.yml new file mode 100644 index 000000000..1a7c3cfe1 --- /dev/null +++ b/.github/workflows/github-gitlab-sync.yml @@ -0,0 +1,22 @@ +name: Sync to MPI GitLab +on: + push +jobs: + sync: + if: github.repository == 'bertiniteam/b2' + runs-on: ubuntu-latest + steps: + - name: Sync to GitLab + # You may pin to the exact commit or the version. + # uses: kujov/gitlab-sync@b19399d43e81ac88acb6eefd5588e6ebde3d7d88 + uses: kujov/gitlab-sync@2.2.1 + with: + # The URL of the GitLab repository (e.g., https://gitlab.com/user/repo.git) + gitlab_url: ${{ secrets.GITLAB_URL }} + # Your GitLab username + username: ${{ secrets.GITLAB_USERNAME }} + # Your GitLab Personal Access Token with required permissions + gitlab_pat: ${{ secrets.GITLAB_PAT }} + # Whether to force push to GitLab. Defaults to false. + + #force_push: # optional, default is false diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..e5fdde3a2 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,251 @@ +name: Publish wheels 🐍 and deploy documentation 📝 + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + - 'v[0-9]+.[0-9]+.[0-9]+.dev[0-9]+' + - 'v[0-9]+.[0-9]+.[0-9]+a[0-9]+' + - 'v[0-9]+.[0-9]+.[0-9]+b[0-9]+' + - 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]+' + +concurrency: + group: publish-${{ github.ref }} + cancel-in-progress: true + +jobs: + check_version: + name: Check pyproject.toml version matches tag + runs-on: ubuntu-latest + outputs: + is_prerelease: ${{ steps.check.outputs.is_prerelease }} + steps: + - uses: actions/checkout@v5 + - name: Check version matches tag + id: check + run: | + TAG="$GITHUB_REF_NAME" + # Validate tag is a well-formed PEP 440 version tag + if ! echo "$TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+(\.dev[0-9]+|a[0-9]+|b[0-9]+|rc[0-9]+)?$'; then + echo "Error: tag '$TAG' is not a valid PEP 440 version tag (e.g. v1.2.3, v1.2.3.dev1, v1.2.3rc1)" + exit 1 + fi + TAG_VERSION="${TAG#v}" + PYPROJECT_VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])") + if [ "$TAG_VERSION" != "$PYPROJECT_VERSION" ]; then + echo "Error: tag '$TAG' does not match pyproject.toml version '$PYPROJECT_VERSION'" + exit 1 + fi + echo "OK: tag '$TAG' matches pyproject.toml version '$PYPROJECT_VERSION'" + echo "$TAG" | grep -Eq '\.(dev|a|b|rc)[0-9]+$' && echo "is_prerelease=true" >> $GITHUB_OUTPUT || echo "is_prerelease=false" >> $GITHUB_OUTPUT + + build_and_test: + name: Build and test + needs: check_version + uses: ./.github/workflows/build_and_test.yml + + publish-to-testpypi: + name: Publish to TestPyPI + if: needs.check_version.outputs.is_prerelease == 'true' + needs: [check_version, build_and_test] + runs-on: ubuntu-latest + + environment: + name: testpypi + url: https://test.pypi.org/p/bertini2 + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v5 + with: + merge-multiple: true + path: dist/ + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true + verbose: true + repository-url: https://test.pypi.org/legacy/ + + publish-to-pypi: + name: Publish to PyPI + if: needs.check_version.outputs.is_prerelease == 'false' + needs: [check_version, build_and_test] + runs-on: ubuntu-latest + + environment: + name: pypi + url: https://pypi.org/p/bertini2 + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v5 + with: + merge-multiple: true + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true + verbose: true + + github-release: + name: >- + Sign the Python 🐍 distribution 📦 with Sigstore + and upload them to GitHub Release + if: needs.check_version.outputs.is_prerelease == 'false' + needs: + - check_version + - publish-to-pypi + runs-on: ubuntu-latest + + permissions: + contents: write # IMPORTANT: mandatory for making GitHub Releases + id-token: write # IMPORTANT: mandatory for sigstore + + steps: + - name: Checkout Repository + uses: actions/checkout@v5 + + - name: Download Artifacts + uses: actions/download-artifact@v5 + with: + merge-multiple: true + path: dist/ + + - name: Sign the dists with Sigstore + uses: sigstore/gh-action-sigstore-python@v3.0.0 + with: + inputs: >- + ./dist/*.whl + + - name: Get Newest Changelog + run: | + python -c 'import re; from pathlib import Path; text=re.sub("", "", (Path.cwd() / "CHANGELOG.md").read_text(), flags=re.DOTALL); print(text); start=text.find("_" * 79); (Path.cwd() / "TEMP_CHANGELOG.md").write_text(text[start:text.find("_" * 79, start+1)])' + + - name: Create GitHub Release + id: create_release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + name: Release ${{ github.ref_name }} + draft: false + prerelease: false + body_path: ./TEMP_CHANGELOG.md + files: | + dist/*.* + + build_docs: + name: Build docs + if: needs.check_version.outputs.is_prerelease == 'false' + needs: [check_version, build_and_test] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + with: + # gitpython (used by python/docs/source/conf.py to derive version) + # needs the full history; the default depth=1 leaves it unable to + # resolve HEAD's commit object on some refs. + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Compute build metadata + id: meta + run: | + SHA=$(git rev-parse HEAD) + SHORT=$(git rev-parse --short HEAD) + DATE=$(date -u +'%Y-%m-%d %H:%M UTC') + echo "sha=$SHA" >> "$GITHUB_OUTPUT" + echo "short=$SHORT" >> "$GITHUB_OUTPUT" + echo "date=$DATE" >> "$GITHUB_OUTPUT" + echo "Build metadata: $SHORT ($SHA) at $DATE" + + - name: Install system dependencies (Doxygen) + run: | + sudo apt-get update + sudo apt-get install -y doxygen graphviz + + - name: Fetch doxygen-awesome-css + run: | + curl -sSL https://github.com/jothepro/doxygen-awesome-css/archive/refs/tags/v2.3.4.tar.gz | tar -xz + mv doxygen-awesome-css-2.3.4 doxygen-awesome-css + + - name: Build C++ docs (Doxygen) + env: + PROJECT_NUMBER: "${{ steps.meta.outputs.short }} (${{ steps.meta.outputs.date }})" + run: | + mkdir -p build/docs/cpp site + # Append PROJECT_NUMBER override via stdin; Doxygen reads stdin + # config when invoked with `-` and merges with the file. + (cat Doxyfile; echo "PROJECT_NUMBER = $PROJECT_NUMBER") | doxygen - + mv build/docs/cpp site/cpp + + - name: Install Python deps for Sphinx + run: | + python -m pip install --upgrade pip + pip install \ + sphinx sphinx-rtd-theme sphinxcontrib-bibtex gitpython \ + scikit-build-core build numpy eigenpy==3.11.0 + + - name: Download built wheel + uses: actions/download-artifact@v5 + with: + name: wheels-ubuntu-latest-3.11 + path: dist/ + + - name: Install bertini from built wheel + run: pip install --no-index --find-links dist/ bertini2 + + - name: Build Python docs (Sphinx) + working-directory: python/docs + env: + BERTINI_GIT_SHA: ${{ steps.meta.outputs.sha }} + BERTINI_BUILD_DATE: ${{ steps.meta.outputs.date }} + run: | + sphinx-build -b html -W --keep-going source ../../site/python + + - name: Add landing page + env: + COMMIT_SHA: ${{ steps.meta.outputs.sha }} + COMMIT_SHORT: ${{ steps.meta.outputs.short }} + BUILD_DATE: ${{ steps.meta.outputs.date }} + run: | + sed \ + -e "s|__COMMIT_SHA__|${COMMIT_SHA}|g" \ + -e "s|__COMMIT_SHORT__|${COMMIT_SHORT}|g" \ + -e "s|__BUILD_DATE__|${BUILD_DATE}|g" \ + doc_resources/landing/index.html > site/index.html + cp doc_resources/landing/style.css site/style.css + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: site + + deploy_docs: + name: Deploy to GitHub Pages + needs: + - build_docs + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 43e7603d4..dbc7ef640 100644 --- a/.gitignore +++ b/.gitignore @@ -26,17 +26,21 @@ m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4 - +core/doc/html/ +core/doc/latex/ +bertini_*.log /config # Python folders +python/build/ /python/test/.idea /.deps/* # Python files *.pyc - +python/pybertini_*.log +python/bertini_*.log *.dirstamp *.deps @@ -76,3 +80,18 @@ m4/lt~obsolete.m4 *.app python/autom4te.cache *.bak +python/temp.py +core/serialization_basic +core/test/classes/serialization_basic +python/conftest.cpp +*.tar.gz +python/src/UNKNOWN.egg-info/dependency_links.txt +python/src/UNKNOWN.egg-info/PKG-INFO +python/src/UNKNOWN.egg-info/SOURCES.txt +python/src/UNKNOWN.egg-info/top_level.txt + +_skbuild/ +*/build/ +build/ +bld/ +build_mine/ diff --git a/.gitmodules b/.gitmodules index 1e62b3d73..e69de29bb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "python/minieigen"] - path = python/minieigen -url=https://github.com/eudoxos/minieigen.git diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..83bd0ab05 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + // The following hides files created by and for the Sublime IDE + "files.exclude": { + "*.b2.sublime-project": true, + "**/*.sublime-project": true + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..a05b0439d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,215 @@ + +# bertini2 Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [CHANGELOG.md][CHANGELOG.md] +and this project adheres to [Semantic Versioning][Semantic Versioning]. + + + + + + +_______________________________________________________________________________ + +## [2.0.1] - 2026-05-16 + +First release under the `bertini2` PyPI name. This is the consolidation of +several months of cross-platform packaging work, dependency-compatibility +fixes, documentation, and a final round of precision-handling fixes in the +system / SLP path. Intel macOS is dropped from the supported platform list +for this release (see Removed below). + +### Added + +- Wheel distributions on PyPI for Linux, macOS (Apple Silicon), and Windows + across Python 3.9 – 3.13. Linux wheels use the `manylinux_2_28` image; macOS + and Linux wheels are produced via `cibuildwheel`; Windows wheels bundle + required DLLs via `delvewheel` and a `windows_dll_manager.py` helper that + registers DLL search paths before importing `_pybertini`. +- GitHub Pages documentation site: C++ API via Doxygen, Python API via Sphinx. +- Version numbers (b2, GMP, MPFR, Eigen, Boost) exposed from the Python + package so users can query them at runtime. +- `CHANGELOG.md` itself, following the *Keep a Changelog* format. + +### Changed + +- **Package renamed: `pybertini` → `bertini` → `bertini2`.** The current PyPI + name is `bertini2`. Update your `pip install` and import statements + accordingly; the Python module still imports as `import bertini`. +- Version is now read from `pyproject.toml` by CMake, removing the two-place + manual sync that previously drifted. +- Build system: `scikit-build-core` configures CMake for the wheel build; + `pyproject.toml` is the single source of truth for build inputs. The Linux + wheel build rebuilds Boost.Python and eigenpy per target Python version so + each wheel ships a matching `libboost_python3X`. +- CI matrix expanded to cover Ubuntu, macOS (Apple Silicon), and Windows for + Python 3.9 – 3.13. PRs targeting `develop` and pushes to `develop` / `main` + run the full matrix; other branches run a fast Ubuntu + macos-14 + Python + 3.11 matrix. +- CI build now uses Boost 1.90 (was 1.87). Boost 1.90 pre-seeds + `thread_default_precision` from the global default and guards against 0, + removing a class of MPFR abort hazards. +- `boost_system` is now conditionally linked for Boost < 1.89 only (Boost 1.89 + dropped the separate library). +- Eigen requirement updated to `3.3...3.4` with the macOS install switched to + Homebrew's `eigen@3` formula. +- Tests across platforms now use a unified precision-handling pattern, + eliminating per-platform skips and conditional precision rituals. +- `MACOSX_DEPLOYMENT_TARGET` co-varies with the runner version so wheels + produced on macos-14 are loadable on the same OS family. +- TestPyPI publishes on every push to `develop`; PyPI publishes on tagged + releases (`v*.*.*`) with Sigstore signing and a GitHub Release. + +### Fixed + +- `System::operator+=` and `System::operator*=` now invalidate the cached + derivatives flag (`is_differentiated_`), so a subsequent `eval` rebuilds the + SLP instead of evaluating against stale derivatives. The companion mutators + `Reorder`, `Simplify`, and `ClearVariables` also invalidate the cache. +- `SLPCompiler::Compile` now seeds the mpfr default precision from the SLP's + own `precision_` immediately before growing the `mpfr_complex` memory block. + This prevents a `mpfr_init2(x, 0)` abort when `thread_default_precision()` + is left at 0 on a fresh thread under Boost ≥ 1.87. +- Python module init seeds `thread_default_precision` so the first MPFR + construction on the interpreter thread is always valid. +- `eval` overload registration order in the Python bindings changed so the + double-precision overload is tried before the multi-precision overload for + ambiguous inputs (e.g. NumPy int64 arrays); this avoids the eigenpy + `Vec` extractor probing MPFR construction with precision 0. +- `EIGEN_MAKE_ALIGNED_OPERATOR_NEW` moved to the `public` section of the + `System` class (was incorrectly placed in a non-public section). +- A second `find_package(Boost)` no longer clobbers `Boost_LIBRARIES`. +- The `_pybertini` target is always created (previously it was only created + when bertini was the top-level CMake project, breaking out-of-tree builds). +- Various MSVC-specific build fixes: `/bigobj`, `/EHsc`, explicit-type + workarounds for template instantiation issues, Release-config library + linking. + +### Removed + +- **Intel macOS (`macos-15-intel`) is not built or tested in this release.** + A SIGABRT in pytest involving MPFR/Boost surfaces only on Intel runners and + cannot be reproduced on the maintainer's development hardware. Intel wheels + will return once a reproducer or upstream fix is in hand. Users on Intel + Macs should pin to a 1.0.x release or build from source. +- Stale build artifacts and outdated Python-binding documentation removed + from the repo. + +_______________________________________________________________________________ + +## [1.0.3] - 2025-05-16 + +Preparation for pypi release with github workflow + +### Changed + +* make it compatible for Windows + +_______________________________________________________________________________ + +## [1.0.2] - 2025-05-07 + +Preparation for pypi release with github workflow + +### Added + +- github workflow for pypi and github release + +### Changed + +- `publish-to-test-pypi.yml` for handling the comments correctly + +### Changed + +* merged the pull request for github ci release by @hkmoon in https://github.com/hkmoon/b2/pull/1 +* windows release preparation + * `size_t` is translated into `unsigned long` in linux, mac while `unsigned long long` in windows 10: `core/include/bertini2/eigen_extensions.hpp` and `core/test/classes/start_system_test.cpp` are modified + * use `clang` of LLVM in Windows since MSVC has different compiling way for `template` + * use `--no-isolation` for `scikit-build` in Windows +* For linux wheel naming convention, we cannot use x86_64, x86_i386 anymore for pypi repository. https://peps.python.org/pep-0600/ + * use `auditwheel` for it + +### New Contributors +* @hkmoon made their first contribution in https://github.com/hkmoon/b2/pull/1 + +_______________________________________________________________________________ + +## [1.0.1] - 2025-05-06 + +This is the initial version of the project. + +### Added + +- The base project + +[CHANGELOG.md]: https://keepachangelog.com/en/1.1.0/ +[Semantic Versioning]: http://semver.org/ + + + diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 000000000..2bee761e5 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,111 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +Bertini 2 (b2) is a C++17 numerical algebraic geometry library with Python bindings. It implements homotopy continuation for solving polynomial systems, including path tracking, endgames (power series, Cauchy), and start systems (total degree, multihomogeneous). The Python package is published to PyPI as `bertini`. + +## Build Commands + +### C++ Core Library (CMake + Ninja) + +```bash +# Configure (from repo root) +cmake -DENABLE_UNIT_TESTING=ON -G Ninja -B build -S . + +# Build +cmake --build build --target all --config Release + +# Run all C++ tests +ctest --test-dir build/core +``` + +### Python Wheel (scikit-build-core) + +```bash +python3 -m build --wheel +``` + +The build system uses `scikit-build-core` (configured in `pyproject.toml`). The wheel build invokes CMake internally. + +### macOS Dependencies (Homebrew) + +```bash +brew install gmp mpfr libmpc eigen@3 eigenpy boost boost-python3 +``` + +### Linux/CI Dependencies (conda) + +Use `environment.yml` (Ubuntu) or `environment-win.yml` (Windows) with conda/mamba/micromamba. + +## Running Tests + +### C++ Tests (Boost.Test) + +Tests are defined in `core/CMakeLists.txt`. Each test suite is a separate executable: + +```bash +# All tests +ctest --test-dir build/core + +# Individual test executables (after build) +./build/core/test_classes +./build/core/test_blackbox +./build/core/test_classic +./build/core/test_endgames +./build/core/test_generating +./build/core/test_nag_algorithms +./build/core/test_nag_datatypes +./build/core/test_tracking_basics +./build/core/test_settings +``` + +### Python Tests + +```bash +pytest python/test/ +``` + +## Architecture + +The project has three layers, built in order: + +1. **`core/`** -- C++ shared library (`libbertini2`). Header-only-heavy design under `core/include/bertini2/`. Key subsystems: + - `function_tree/` -- Expression tree (nodes, operators, symbols) for representing polynomial systems + - `system/` -- Polynomial system construction, start systems (`start/total_degree.hpp`, `start/mhom.hpp`), patches, slices + - `trackers/` -- Path tracking (fixed-precision and adaptive-precision trackers, predictors, Newton correctors) + - `endgames/` -- Power series and Cauchy endgames for singular endpoint handling + - `nag_algorithms/` -- Higher-level algorithms (zero-dim solve, numerical irreducible decomposition) + - `io/parsing/` -- Boost.Spirit Qi parsers for classic Bertini input format + - `blackbox/` -- CLI executable entry point (`bertini2_exe`) + +2. **`python_bindings/`** -- Boost.Python + eigenpy bindings producing `_pybertini` native module. Each `*_export.cpp` wraps the corresponding C++ subsystem. Depends on `eigenpy` for NumPy/Eigen interop. + +3. **`python/bertini/`** -- Pure Python package that wraps `_pybertini` into a user-friendly API. Submodules mirror the C++ structure: `function_tree`, `system`, `tracking`, `endgame`, `parse`, `nag_algorithm`, `multiprec`, etc. + +## Key Dependencies + +- **GMP/MPFR/MPC** -- Arbitrary-precision arithmetic (found via custom CMake modules in `cmake/`) +- **Eigen 3.3** -- Linear algebra (pinned to v3.3) +- **Boost** (serialization, filesystem, log, graph, regex, timer, chrono, thread, unit_test_framework, python) -- Boost >= 1.82 required; `boost_system` is conditionally linked for Boost < 1.89 +- **eigenpy** -- Eigen/NumPy bridge for Python bindings +- **jrl-cmakemodules** -- CMake helper macros (auto-fetched via FetchContent if not found) + +## Build System Notes + +- The root `CMakeLists.txt` uses `jrl-cmakemodules` (fetched automatically). It currently only adds `core/` as a subdirectory; `python_bindings/` and `python/` subdirectory calls are commented out (the wheel build via scikit-build-core handles them). +- `pyproject.toml` configures scikit-build-core: wheel packages from `python/bertini/`, build dir is `bld/`. +- Cross-platform: Linux uses manylinux Docker + `auditwheel`; macOS uses Homebrew; Windows uses conda + clang-cl (MSVC has template compilation issues). +- `-Werror` is disabled globally. `-pedantic` is stripped from flags. + +## CI/CD + +- `.github/workflows/build-and-publish-to-pypi.yml` -- Builds wheels on Ubuntu/macOS/Windows, publishes to TestPyPI on `develop` push, PyPI on version tags (`v*.*.*`). +- Pushes to `develop` trigger TestPyPI publish; tagged releases go to PyPI with Sigstore signing and GitHub Releases. + +## Conventions + +- C++ standard: C++17. Headers use `.hpp` extension. +- License: GPL v3 with additional terms (see `licenses/`, `core/ADDITIONAL_GPL_TERMS`). +- Version is tracked in `python/bertini/_version.py` and `pyproject.toml`. diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..84555f8c6 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,225 @@ +cmake_minimum_required(VERSION 3.22) + +set(PROJECT_NAME bertini2) + +file(READ "${CMAKE_SOURCE_DIR}/pyproject.toml" PYPROJECT_TOML) +string(REGEX MATCH "\nversion = \"([^\"]+)\"" _ ${PYPROJECT_TOML}) +set(PROJECT_VERSION_FULL ${CMAKE_MATCH_1}) + +# Strip PEP 440 prerelease suffix for cmake VERSION field +string(REGEX REPLACE "[._]?(dev|a|b|rc)[0-9]+.*$" "" PROJECT_VERSION ${PROJECT_VERSION_FULL}) + +message(STATUS "Full version: ${PROJECT_VERSION_FULL}") +message(STATUS "CMake version: ${PROJECT_VERSION}") + + +set(PROJECT_DESCRIPTION "Implementation of the foundations of Numerical Algebraic Geometry") +set(PROJECT_URL "https://github.com/bertiniteam/b2") +set(PROJECT_USE_CMAKE_EXPORT TRUE) +set(PROJECT_USE_KEYWORD_LINK_LIBRARIES TRUE) +set(PROJECT_CUSTOM_HEADER_EXTENSION "hpp") +set(PROJECT_COMPATIBILITY_VERSION AnyNewerVersion) +# To enable jrl-cmakemodules compatibility with workspace we must define the two +# following lines +set(PROJECT_AUTO_RUN_FINALIZE FALSE) +set(PROJECT_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}) + +# Check if the submodule cmake have been initialized +set(JRL_CMAKE_MODULES "${CMAKE_CURRENT_LIST_DIR}/cmake") +if(EXISTS "${JRL_CMAKE_MODULES}/base.cmake") + message(STATUS "JRL cmakemodules found in 'cmake/' git submodule") +else() + find_package(jrl-cmakemodules QUIET CONFIG) + if(jrl-cmakemodules_FOUND) + get_property( + JRL_CMAKE_MODULES + TARGET jrl-cmakemodules::jrl-cmakemodules + PROPERTY INTERFACE_INCLUDE_DIRECTORIES) + message(STATUS "JRL cmakemodules found on system at ${JRL_CMAKE_MODULES}") + elseif(${CMAKE_VERSION} VERSION_LESS "3.14.0") + message( + FATAL_ERROR + "\nCan't find jrl-cmakemodules. Please either:\n" + " - use git submodule: 'git submodule update --init'\n" + " - or install https://github.com/jrl-umi3218/jrl-cmakemodules\n" + " - or upgrade your CMake version to >= 3.14 to allow automatic fetching\n" + ) + else() + message(STATUS "JRL cmakemodules not found. Let's fetch it.") + include(FetchContent) + FetchContent_Declare( + "jrl-cmakemodules" + GIT_REPOSITORY "https://github.com/jrl-umi3218/jrl-cmakemodules.git") + FetchContent_MakeAvailable("jrl-cmakemodules") + FetchContent_GetProperties("jrl-cmakemodules" SOURCE_DIR JRL_CMAKE_MODULES) + endif() +endif() + +function(set_standard_output_directory target) + set_target_properties( + ${target} + PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin + LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib + ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) +endfunction() + +# Disable -Werror on Unix for now. +set(CXX_DISABLE_WERROR True) +set(CMAKE_VERBOSE_MAKEFILE True) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# ---------------------------------------------------- +# --- OPTIONS --------------------------------------- +# Need to be set before including base.cmake +# ---------------------------------------------------- +option(BUILD_PYTHON_BINDINGS "Build Python bindings" ON) +option(INSTALL_DOCUMENTATION "Generate and install the documentation" OFF) +option(SUFFIX_SO_VERSION "Suffix library name with its version" OFF) +option(BUILD_TESTING_SCIPY + "Build the SciPy tests (scipy should be installed on the machine)" ON) + +# ---------------------------------------------------- +# --- Policy ----------------------------------------- +# CMake Policy setup +# ---------------------------------------------------- +# Policy can be removed when cmake_minimum_required is updated. + +# We also set CMAKE_POLICY_DEFAULT_CMPXXXX because CMake modules can reset +# policy and redefine some macros like `find_dependency` that will not use our +# policy. + +# Use BoostConfig module distributed by boost library instead of using FindBoost +# module distributed by CMake (to remove in 3.30). +if(POLICY CMP0167) + cmake_policy(SET CMP0167 NEW) + set(CMAKE_POLICY_DEFAULT_CMP0167 NEW) +endif() +# install() DESTINATION paths are normalized (to remove in 3.31). +if(POLICY CMP0177) + cmake_policy(SET CMP0177 NEW) + set(CMAKE_POLICY_DEFAULT_CMP0177 NEW) +endif() +include("${JRL_CMAKE_MODULES}/base.cmake") +compute_project_args(PROJECT_ARGS LANGUAGES CXX) +project(${PROJECT_NAME} ${PROJECT_ARGS}) + +include("${JRL_CMAKE_MODULES}/boost.cmake") + +if(BUILD_PYTHON_BINDINGS) + include("${JRL_CMAKE_MODULES}/python.cmake") +endif(BUILD_PYTHON_BINDINGS) + +include("${JRL_CMAKE_MODULES}/ide.cmake") +include("${JRL_CMAKE_MODULES}/apple.cmake") + + + + + +if(APPLE) + option(BUILD_WITH_ACCELERATE_SUPPORT + "Build EigenPy with the Accelerate support" OFF) +else(APPLE) + set(BUILD_WITH_ACCELERATE_SUPPORT FALSE) +endif(APPLE) + +string(REPLACE "-pedantic" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + +# If needed, fix CMake policy for APPLE systems +apply_default_apple_configuration() +check_minimal_cxx_standard(11 ENFORCE) + + +if(WIN32) + set(LINK copy_if_different) +else(WIN32) + set(LINK create_symlink) +endif(WIN32) + +if(BUILD_PYTHON_BINDINGS) + if(CMAKE_CROSSCOMPILING) + set(PYTHON_COMPONENTS Interpreter NumPy) + else() + set(PYTHON_COMPONENTS Interpreter Development.Module NumPy) + endif() + set(PYTHON_EXPORT_DEPENDENCY ON) + findpython(REQUIRED) + + if(${NUMPY_VERSION} VERSION_LESS "1.16.0") + set(NUMPY_WITH_BROKEN_UFUNC_SUPPORT TRUE) + endif() +endif(BUILD_PYTHON_BINDINGS) + + + +if(WIN32) + if(BUILD_PYTHON_BINDINGS) + link_directories(${PYTHON_LIBRARY_DIRS}) + endif(BUILD_PYTHON_BINDINGS) + + # # Set default Windows build paths SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY + # ${PROJECT_BINARY_DIR}/Bin CACHE PATH "Single directory for all libraries") + # SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin CACHE PATH + # "Single directory for all executables") SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY + # ${PROJECT_BINARY_DIR}/Bin CACHE PATH "Sing$le directory for all archives") +endif(WIN32) + +# ---------------------------------------------------- +# --- DEPENDENCIES ----------------------------------- +# ---------------------------------------------------- +#add_project_dependency(Eigen3 REQUIRED PKG_CONFIG_REQUIRES "eigen3 >= 3.0.5") + +#set_boost_default_options() +#export_boost_default_options() +#find_package(Boost REQUIRED) +#search_for_boost_python(REQUIRED) +#find_package(Python 3.11 REQUIRED COMPONENTS Interpreter Development.Module NumPy) + +############################ +# the core builds a library and an executable depending on that library +# + +#add_library(bertini2 SHARED ${${PROJECT_NAME}_SOURCES} +# ${${PROJECT_NAME}_HEADERS}) +#add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) +#set_standard_output_directory(${PROJECT_NAME}) + +#set_standard_output_directory(${PROJECT_NAME}) + +#if(NOT WIN32) +# target_compile_options( +# ${PROJECT_NAME} PRIVATE $<$:-bigobj -MP> +# "-Wno-conversion") +#else() +# target_compile_options(${PROJECT_NAME} +# PRIVATE $<$:-bigobj -MP>) +# target_compile_definitions(${PROJECT_NAME} PUBLIC "HAVE_SNPRINTF") +#endif() + +#target_link_boost_python(${PROJECT_NAME} PUBLIC) + +#set_property(TARGET bertini2_exe PROPERTY OUTPUT_NAME bertini2) + +add_subdirectory(core) + + +########### +# next, in `python_bindings`, build a shared python library, and a pure-python library that wraps around that. +# + + +if(BUILD_PYTHON_BINDINGS) + add_subdirectory(python_bindings) +else() + message(STATUS "skipping the python bindings") +endif() + + + +########### +# finally, the pure-python part of the project. +# + +#add_subdirectory(python) diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 000000000..964dc90a7 --- /dev/null +++ b/Doxyfile @@ -0,0 +1,66 @@ +# Doxyfile for Bertini 2 -- C++ API reference. +# Only non-default settings are listed; everything else uses Doxygen defaults. + +PROJECT_NAME = "Bertini 2" +PROJECT_BRIEF = "Numerical algebraic geometry library (C++ core)" +PROJECT_NUMBER = +OUTPUT_DIRECTORY = build/docs/cpp +HTML_OUTPUT = . + +INPUT = core/include README.md +RECURSIVE = YES +USE_MDFILE_AS_MAINPAGE = README.md + +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO + +JAVADOC_AUTOBRIEF = YES +QT_AUTOBRIEF = YES +MULTILINE_CPP_IS_BRIEF = NO +INLINE_INHERITED_MEMB = YES + +GENERATE_HTML = YES +GENERATE_LATEX = NO +GENERATE_TREEVIEW = YES +DISABLE_INDEX = NO +FULL_SIDEBAR = NO +HTML_COLORSTYLE = LIGHT + +# doxygen-awesome-css is fetched in CI and these paths are wired up there. +HTML_EXTRA_STYLESHEET = doxygen-awesome-css/doxygen-awesome.css \ + doxygen-awesome-css/doxygen-awesome-sidebar-only.css +HTML_EXTRA_FILES = doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js \ + doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js \ + doxygen-awesome-css/doxygen-awesome-paragraph-link.js \ + doxygen-awesome-css/doxygen-awesome-interactive-toc.js + +HAVE_DOT = YES +DOT_IMAGE_FORMAT = svg +INTERACTIVE_SVG = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +COLLABORATION_GRAPH = YES +CLASS_GRAPH = YES + +QUIET = YES +WARN_IF_UNDOCUMENTED = NO +WARN_NO_PARAMDOC = NO + +# Don't error on a few patterns common in template-heavy code. +ALIASES = +PREDEFINED = BMP_EXPRESSION_TEMPLATES \ + BERTINI_HAVE_EIGEN + +EXCLUDE_PATTERNS = */test/* \ + */tests/* \ + */build/* \ + */bld/* \ + */dist/* \ + */wheelhouse/* + +GENERATE_TODOLIST = NO +GENERATE_TESTLIST = NO +SHOW_USED_FILES = NO diff --git a/README.md b/README.md index 8cce9ffd8..ca8d579b9 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,100 @@ + # Quick links - [Wiki](https://github.com/bertiniteam/b2/wiki) -- [Overview](#Overview) -- [Current capabilites](#Current-capabilites) -- [Building and installing](#Building-and-installing) -- [Other information](#Other-information) -Thanks for checking out Bertini 2! +--- -== +# Overview -### Important note on cloning +The solution of arbitrary polynomial systems is an area of active research, and has many applications in math, science and engineering. This software, Bertini 2, is a complete re-implementation of [Bertini 1](https://bertini.nd.edu) from C into C++/Python. -The recommended method for getting the code for Bertini 2 is to clone from command line using git: +The theoretical basis for the solution of polynomials with Bertini is a theorem which bounds the number of solutions a system may have. It sits together with the numerical computational tool of "homotopy continuation". the act of "continuing" from one system into another through a "homotopy", as depicted in the below diagram: -`git clone https://github.com/bertiniteam/b2 --recursive` +homotopy continuation -This ensures that any other repo's we depend on get cloned into their correct locations. We have at least one for the Python bindings -- [MiniEigen](https://github.com/eudoxos/minieigen). +--- -If you want the Core library only, you can just download a tarball by mousing. +# Current capabilites -== +Bertini 2 currently has implemented the foundations of Numerical Algebraic Geometry. Development is ongoing, and here's what we have so far: -# Overview +- C++ functions and types, with Python bindings. +- Through Python, runtime scriptable construction of systems and interactivity with their zero-dimensional solutions. +- Construction of multivariate polynomial and non-polynomial systems. +- Evaluation of systems and their Jacobians in double and arbitrary multiple precision, using two different methods. +- Construction of the Total Degree and Multihomogeneous start systems. +- Construction of homotopies (they're just systems with path variables defined). +- Tracking of a start point x_0, corresponding to a particular time $t_0 \in \mathbb{C}^n$ in a homotopy $H$, from $t_0$ to $t_1$. +- Running of the Power Series and Cauchy endgames, in double, multiple, and adaptive precision. -The solution of arbitrary polynomial systems is an area of active research, and has many applications in math, science and engineering. This program, Bertini 2, builds on the success of the first Bertini program, and seeks to eventually replace it entirely, as a powerful numerical engine. +Development is ongoing, and we want your help! -The theoretical basis for the solution of polynomials with Bertini is "homotopy continuation", the act of "continuing" from one system into another through a "homotopy", as depicted in the below diagram. +--- -![homotopy continuation](core/doc/images/homotopycontinuation_generic_40ppi.png "homotopy continuation") +# Missing functionality -== +* Parallel solving +* Numerical irreducible decomposition +* Membership testing +* and other algorithms -# Current capabilites +Users wanting a more developed implementation are recommended to use [Bertini 1](https://bertini.nd.edu) or [homotopycontinuation.jl](https://www.juliahomotopycontinuation.org/), or one of the other packages implementing the theory. -Bertini2 currently has implemented the foundations of Numerical Algebraic Geometry. Development is ongoing, but here's what we have so far: +--- -- C++ and Python bindings for access into any functionality. -- Construction of polynomial and non-polynomial multivariate systems. -- Evaluation of systems and Jacobians in double and arbitrary multiple precision. -- Construction of the Total Degree start system. -- Construction of homotopies (they're just systems with path variables defined). -- Tracking of a start point x_0, corresponding to a particular time $t_0 \in \mathbb{C}^n$ in a homotopy $H$, from $t_0$ to $t_1$. -- Running of the Power Series and Cauchy endgames. +# Installation -Development is ongoing, and we want your help! +## Pre-built wheels -- the way to go! + +The Python package `bertini2` provides pre-built wheels for Linux, macOS, and Windows. -== -# Building and Installing +```bash +pip install bertini2 +``` -Please see [the Wiki compiling section](https://github.com/bertiniteam/b2/wiki/Compilation-Guide) for instructions on compiling Bertini2's core library, and companion Python bindings, PyBertini. +Once it's installed, you `import bertini` -== +* Linux: Python 3.9-3.13 +* MacOS (Apple Silicon): Python 3.9-3.13 +* MacOS (Intel): not supported +* Windows: Python 3.9-3.11 + + +## Building from source + +Please see [the Wiki compiling section](https://github.com/bertiniteam/b2/wiki/Installation) for instructions on compiling Bertini 2. + +--- # Other information -The offical project repository is hosted on GitHub at [https://github.com/bertiniteam/b2](https://github.com/bertiniteam/b2). +The official project repository is hosted on GitHub at [github.com/bertiniteam/b2](https://github.com/bertiniteam/b2). Please note that this is a long-term project, and is under active development. If you want to help, please see [the wiki](https://github.com/bertiniteam/b2/wiki) for contact information. We have opportinuties for all skill levels and interests. +--- + # License Bertini 2 is Free and Open Source Software. Source is available under GPL Version 3, with additional terms as permitted under Section 7. + + +--- + +# Thank yous + +A huge thank you to: + +* HongKee Moon, for his help in getting this package to be pip-installable with a comprehensive CI build system. +* Jack Hagen, for helping get away from the autotools and replacing CMake. +* Mike Mumm, for helping with straight-line-programs +* Jeb Collins, for writing much of the parser system, implementing the predictors, and so much more +* Tim Hodges, for contributing to the endgame implementations +* Alan Liddel, for tons of help with Python parts +* Dan Bates, Jon Hauenstein, for critical advise support, and guidance +* Andrew Sommese, Charles Wampler, Dan Bates, Jon Hauenstein, for writing Bertini 1 + +And to all the other people who have contributed to this package over the years. diff --git a/b2.sublime-project b/b2.sublime-project new file mode 100644 index 000000000..cc8e9de5c --- /dev/null +++ b/b2.sublime-project @@ -0,0 +1,52 @@ +{ + "folders": + [ + { + "path": ".", + "file_exclude_patterns": ["serialization_test*", + "Makefile.in", + "*.la", + "libtool", + "stamp-h1", + ".dirstamp", + "*.lo", + "*~", + "aclocal.m4", + "ltoptions.m4", + "ltsugar.m4", + "ltversion.m4", + "lt~obsolete.m4", + "libtool.m4", + "b2_class_test", + "b2_classic_compatibility_test", + "b2_timing_test", + "tracking_basics_test", + "settings_test", + "nag_algorithms_test", + "endgames_test", + "pool_test", + "generating_test", + "config.status", + "configure", + "*.trs", + "ltmain.sh"], + "folder_exclude_patterns": [ + "__pycache__", + "pybertini.egg-info", + "bertini.egg-info", + "_static", + "_templates", + ".deps", + ".libs", + "*.dtps", + "autom4te.cache", + "generated_documentation", + ".pytest_cache"] + } + + + ], + +} + + diff --git a/cmake/FindGMP.cmake b/cmake/FindGMP.cmake new file mode 100644 index 000000000..ff15c0de8 --- /dev/null +++ b/cmake/FindGMP.cmake @@ -0,0 +1,32 @@ +# Borrowed from https://github.com/libigl/eigen/tree/master +# By Jack Hagen (December 2023) +# Try to find the GNU Multiple Precision Arithmetic Library (GMP) +# See http://gmplib.org/ + +# In order to find gmp installed with conda, run 'conda activate' and use 'cmake .. -DCMAKE_PREFIX_PATH=$CONDA_PREFIX' + +if (GMP_INCLUDES AND GMP_LIBRARIES) + set(GMP_FIND_QUIETLY TRUE) +endif (GMP_INCLUDES AND GMP_LIBRARIES) + +find_path(GMP_INCLUDES + NAMES + gmp.h + PATHS + $ENV{GMP_INC} + ${INCLUDE_INSTALL_DIR} +) + +if(WIN32) + find_library(GMP_LIBRARIES libgmp.dll.a PATHS $ENV{GMP_LIB} ${LIB_INSTALL_DIR}) +else() + find_library(GMP_LIBRARIES gmp PATHS $ENV{GMP_LIB} ${LIB_INSTALL_DIR}) +endif() + +include(FindPackageHandleStandardArgs) + +# Makes sure that gmp_include and gmp_libraries are valid +# https://cmake.org/cmake/help/latest/module/FindPackageHandleStandardArgs.html +find_package_handle_standard_args(GMP DEFAULT_MSG + GMP_INCLUDES GMP_LIBRARIES) +mark_as_advanced(GMP_INCLUDES GMP_LIBRARIES) diff --git a/cmake/FindMPC.cmake b/cmake/FindMPC.cmake new file mode 100644 index 000000000..eaaec2cb6 --- /dev/null +++ b/cmake/FindMPC.cmake @@ -0,0 +1,29 @@ +# Borrowed from https://github.com/libigl/eigen/tree/master +# By Jack Hagen (December 2023) +# Try to find the Multiple Precision Complex (MPC) + +if (MPC_INCLUDES AND MPC_LIBRARIES) + set(MPC_FIND_QUIETLY TRUE) +endif (MPC_INCLUDES AND MPC_LIBRARIES) + +find_path(MPC_INCLUDES + NAMES + mpc.h + PATHS + $ENV{MPC_INC} + ${INCLUDE_INSTALL_DIR} +) + +if(WIN32) + find_library(MPC_LIBRARIES libmpc.dll.a PATHS $ENV{MPC_LIB} ${LIB_INSTALL_DIR}) +else() + find_library(MPC_LIBRARIES mpc PATHS $ENV{MPC_LIB} ${LIB_INSTALL_DIR}) +endif() + +include(FindPackageHandleStandardArgs) + +# Makes sure that mpc_include and mpc_libraries are valid +# https://cmake.org/cmake/help/latest/module/FindPackageHandleStandardArgs.html +find_package_handle_standard_args(MPC DEFAULT_MSG + MPC_INCLUDES MPC_LIBRARIES) +mark_as_advanced(MPC_INCLUDES MPC_LIBRARIES) diff --git a/cmake/FindMPFR.cmake b/cmake/FindMPFR.cmake new file mode 100644 index 000000000..b30235cf1 --- /dev/null +++ b/cmake/FindMPFR.cmake @@ -0,0 +1,89 @@ +# Try to find the MPFR library +# See http://www.mpfr.org/ +# +# This module supports requiring a minimum version, e.g. you can do +# find_package(MPFR 2.3.0) +# to require version 2.3.0 to newer of MPFR. +# +# Once done this will define +# +# MPFR_FOUND - system has MPFR lib with correct version +# MPFR_INCLUDES - the MPFR include directory +# MPFR_LIBRARIES - the MPFR library +# MPFR_VERSION - MPFR version + +# Copyright (c) 2006, 2007 Montel Laurent, +# Copyright (c) 2008, 2009 Gael Guennebaud, +# Copyright (c) 2010 Jitse Niesen, +# Redistribution and use is allowed according to the terms of the BSD license. + +# Borrowed by Jack Hagen (December 2023) + +# Set MPFR_INCLUDES + +find_path(MPFR_INCLUDES + NAMES + mpfr.h + PATHS + $ENV{GMPDIR} + ${INCLUDE_INSTALL_DIR} +) + +# Set MPFR_FIND_VERSION to 1.0.0 if no minimum version is specified + +if(NOT MPFR_FIND_VERSION) + if(NOT MPFR_FIND_VERSION_MAJOR) + set(MPFR_FIND_VERSION_MAJOR 1) + endif(NOT MPFR_FIND_VERSION_MAJOR) + if(NOT MPFR_FIND_VERSION_MINOR) + set(MPFR_FIND_VERSION_MINOR 0) + endif(NOT MPFR_FIND_VERSION_MINOR) + if(NOT MPFR_FIND_VERSION_PATCH) + set(MPFR_FIND_VERSION_PATCH 0) + endif(NOT MPFR_FIND_VERSION_PATCH) + + set(MPFR_FIND_VERSION "${MPFR_FIND_VERSION_MAJOR}.${MPFR_FIND_VERSION_MINOR}.${MPFR_FIND_VERSION_PATCH}") +endif(NOT MPFR_FIND_VERSION) + + +if(MPFR_INCLUDES) + + # Set MPFR_VERSION + + file(READ "${MPFR_INCLUDES}/mpfr.h" _mpfr_version_header) + + string(REGEX MATCH "define[ \t]+MPFR_VERSION_MAJOR[ \t]+([0-9]+)" _mpfr_major_version_match "${_mpfr_version_header}") + set(MPFR_MAJOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+MPFR_VERSION_MINOR[ \t]+([0-9]+)" _mpfr_minor_version_match "${_mpfr_version_header}") + set(MPFR_MINOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+MPFR_VERSION_PATCHLEVEL[ \t]+([0-9]+)" _mpfr_patchlevel_version_match "${_mpfr_version_header}") + set(MPFR_PATCHLEVEL_VERSION "${CMAKE_MATCH_1}") + + set(MPFR_VERSION ${MPFR_MAJOR_VERSION}.${MPFR_MINOR_VERSION}.${MPFR_PATCHLEVEL_VERSION}) + + # Check whether found version exceeds minimum version + + if(${MPFR_VERSION} VERSION_LESS ${MPFR_FIND_VERSION}) + set(MPFR_VERSION_OK FALSE) + message(STATUS "MPFR version ${MPFR_VERSION} found in ${MPFR_INCLUDES}, " + "but at least version ${MPFR_FIND_VERSION} is required") + else(${MPFR_VERSION} VERSION_LESS ${MPFR_FIND_VERSION}) + set(MPFR_VERSION_OK TRUE) + endif(${MPFR_VERSION} VERSION_LESS ${MPFR_FIND_VERSION}) + +endif(MPFR_INCLUDES) + +# Set MPFR_LIBRARIES + +if(WIN32) + find_library(MPFR_LIBRARIES libmpfr.dll.a PATHS $ENV{GMPDIR} ${LIB_INSTALL_DIR}) +else() + find_library(MPFR_LIBRARIES mpfr PATHS $ENV{GMPDIR} ${LIB_INSTALL_DIR}) +endif() + +# Epilogue + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(MPFR DEFAULT_MSG + MPFR_INCLUDES MPFR_LIBRARIES MPFR_VERSION_OK) +mark_as_advanced(MPFR_INCLUDES MPFR_LIBRARIES) diff --git a/cmake/Findbertini2.cmake b/cmake/Findbertini2.cmake new file mode 100644 index 000000000..dda39962a --- /dev/null +++ b/cmake/Findbertini2.cmake @@ -0,0 +1,17 @@ +if(WIN32) + find_path(Bertini2_INCLUDE_DIR + NAMES bertini2 + PATHS "$ENV{BERTINI2_DIR}/Include") + find_library(Bertini2_LIBRARY + NAMES bertini2 + PATHS "$ENV{BERTINI2_DIR}/Lib") +elseif(UNIX) + find_path(Bertini2_INCLUDE_DIR + NAMES bertini2/bertini.hpp + PATHS "$ENV{BERTINI2_DIR}/include" ${INCLUDE_INSTALL_DIR}) + find_library(Bertini2_LIBRARY + NAMES bertini2 + PATHS "$ENV{BERTINI2_DIR}/lib" ${LIB_INSTALL_DIR}) +endif() +set(Bertini2_INCLUDES ${Bertini2_INCLUDE_DIR}) +set(Bertini2_LIBRARIES ${Bertini2_LIBRARY}) \ No newline at end of file diff --git a/core/.gitignore b/core/.gitignore index 8880a3e8e..6dd9f984b 100644 --- a/core/.gitignore +++ b/core/.gitignore @@ -15,7 +15,7 @@ stamp-h1 ltmain.sh config.h -config.h.in +#config.h.in config.status libtool @@ -36,6 +36,7 @@ nag_datatypes_test blackbox_test cachegrind.out.* +callgrind.out.* m4/libtool.m4 m4/ltoptions.m4 @@ -96,7 +97,15 @@ serialization_test* *.rej - +# trace objects from xcrun / instruments +*.trace # Maple files test/tracking_basics/*.bak + +# temporary files +*.tmp + +.devcontainer +*.check_cache +*.yaml diff --git a/core/ADDITIONAL_GPL_TERMS b/core/ADDITIONAL_GPL_TERMS index 2f9ff9153..501993ac1 100644 --- a/core/ADDITIONAL_GPL_TERMS +++ b/core/ADDITIONAL_GPL_TERMS @@ -34,7 +34,7 @@ Acknowledgements Current members of Bertini2 Development Team: -- Dan Bates, Colorado State University --- Dani Brake, University of Wisconsin Eau Claire +-- Silviana Amethyst, University of Wisconsin Eau Claire -- Jeb Collins, University of Mary Washington -- Jonathan Hauenstein, University of Notre Dame -- Tim Hodges, Colorado State University diff --git a/core/AUTHORS b/core/AUTHORS index de071ce7c..96ec70043 100644 --- a/core/AUTHORS +++ b/core/AUTHORS @@ -3,7 +3,7 @@ Acknowledgements Current members of Bertini2 Development Team: -- Dan Bates, Colorado State University --- Dani Brake, University of Wisconsin Eau Claire +-- Silviana Amethyst, University of Wisconsin Eau Claire -- Jeb Collins, University of Mary Washington -- Jonathan Hauenstein, University of Notre Dame -- Tim Hodges, Colorado State University diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt new file mode 100644 index 000000000..e7bc61136 --- /dev/null +++ b/core/CMakeLists.txt @@ -0,0 +1,767 @@ +cmake_minimum_required(VERSION 3.22) +project(bertini2-core) + +include(CMakePrintHelpers) # so we can print cmake variable values +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) +# set(BUILD_SHARED_LIBS ON) +# set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +# In order to find conda, run 'conda activate' and then use 'cmake .. -DCMAKE_PREFIX_PATH=$CONDA_PREFIX' when cmaking + +# All source files to be compiled +# We can either explicitly list all files or use glob, we chose to explicitly list files and not to glob +#file(GLOB SOURCES src/*.cpp) + +option(ENABLE_UNIT_TESTING "Turn on building and running of unit tests while compiling" OFF) + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release") + message(STATUS "Build type set to Release by default, since it was not specified.") +endif(NOT CMAKE_BUILD_TYPE) + + +message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") +message(STATUS "ENABLE_UNIT_TESTING: ${ENABLE_UNIT_TESTING}") + +if (WIN32) + add_compile_options(/bigobj) + add_compile_options(/EHsc) + set(CMAKE_BUILD_TYPE Release) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + set(BUILD_SHARED_LIBS TRUE) +else () + # add_compile_definitions(-DBMP_EXPRESSION_TEMPLATES=1) + add_compile_options( + # put things for debug compile here + $<$:-g> + $<$:-Wall> + + # and things for release here + $<$:-O3> + $<$:-g> + # using O2 or O3 cuts runtime by over half. + ) +endif () + + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake") + +find_package(GMP REQUIRED) +find_package(MPFR REQUIRED) +find_package(MPC REQUIRED) + +# include_directories(${GMP_INCLUDES}) +# include_directories(${MPC_INCLUDES}) + +# set_boost_default_options() +# export_boost_default_options() + +set(_BOOST_REQUIRED_COMPONENTS + serialization + unit_test_framework + filesystem + graph + chrono + regex + timer + log + log_setup + thread +) + +find_package(Boost REQUIRED COMPONENTS ${_BOOST_REQUIRED_COMPONENTS}) + +# Boost 1.89.0 removed the boost_system library (it's header-only now). +# Re-find with ALL components so Boost_LIBRARIES is not overwritten. +if(Boost_VERSION_STRING VERSION_LESS "1.89.0") + find_package(Boost REQUIRED COMPONENTS ${_BOOST_REQUIRED_COMPONENTS} system) +endif() + +find_package(Eigen3 REQUIRED NO_MODULE) + +# This was from a makemodule.am, take the lists and define them in seperate blocks with the variables they already have, then add the variable name to library_headrs +set(endgames_headers + include/bertini2/endgames/amp_endgame.hpp + include/bertini2/endgames/base_endgame.hpp + include/bertini2/endgames/cauchy.hpp + include/bertini2/endgames/config.hpp + include/bertini2/endgames/events.hpp + include/bertini2/endgames/fixed_prec_endgame.hpp + include/bertini2/endgames/interpolation.hpp + include/bertini2/endgames/observers.hpp + include/bertini2/endgames/powerseries.hpp + include/bertini2/endgames/prec_base.hpp +) + +set(basics_rootinclude_headers + include/bertini2/have_bertini.hpp + include/bertini2/mpfr_extensions.hpp + include/bertini2/mpfr_complex.hpp + include/bertini2/forbid_mixed_arithmetic.hpp + include/bertini2/double_extensions.hpp + include/bertini2/random.hpp + include/bertini2/num_traits.hpp + include/bertini2/classic.hpp + include/bertini2/eigen_extensions.hpp + include/bertini2/eigen_serialization_addon.hpp + include/bertini2/logging.hpp + include/bertini2/endgames.hpp + include/bertini2/bertini.hpp +) + +set(common_headers + include/bertini2/common/config.hpp + include/bertini2/common/stream_enum.hpp +) + +set(detail_headers + include/bertini2/detail/configured.hpp + include/bertini2/detail/events.hpp + include/bertini2/detail/visitable.hpp + include/bertini2/detail/visitor.hpp + include/bertini2/detail/observer.hpp + include/bertini2/detail/observable.hpp + include/bertini2/detail/is_template_parameter.hpp + include/bertini2/detail/enable_permuted_arguments.hpp + include/bertini2/detail/typelist.hpp +) + +set(function_tree_headers + include/bertini2/function_tree.hpp + include/bertini2/function_tree/node.hpp + include/bertini2/function_tree/forward_declares.hpp + include/bertini2/function_tree/simplify.hpp + include/bertini2/function_tree/operators/operator.hpp + include/bertini2/function_tree/symbols/symbol.hpp + include/bertini2/function_tree/symbols/variable.hpp + include/bertini2/function_tree/symbols/differential.hpp + include/bertini2/function_tree/symbols/special_number.hpp + include/bertini2/function_tree/symbols/number.hpp + include/bertini2/function_tree/symbols/linear_product.hpp + include/bertini2/function_tree/roots/function.hpp + include/bertini2/function_tree/roots/jacobian.hpp + include/bertini2/function_tree/operators/arithmetic.hpp + include/bertini2/function_tree/operators/trig.hpp +) + +set(function_tree_headers_rootinclude_HEADERS + include/bertini2/function_tree.hpp +) + +set(settings_headers + include/bertini2/settings/configIni_parse.hpp +) + +set(functiontreeinclude_HEADERS + include/bertini2/function_tree/node.hpp + include/bertini2/function_tree/factory.hpp + include/bertini2/function_tree/forward_declares.hpp + include/bertini2/function_tree/simplify.hpp +) + +set(functiontree_operators_HEADERS + include/bertini2/function_tree/operators/operator.hpp + include/bertini2/function_tree/operators/arithmetic.hpp + include/bertini2/function_tree/operators/trig.hpp +) + +set(functiontree_symbols_HEADERS + include/bertini2/function_tree/symbols/symbol.hpp + include/bertini2/function_tree/symbols/variable.hpp + include/bertini2/function_tree/symbols/differential.hpp + include/bertini2/function_tree/symbols/special_number.hpp + include/bertini2/function_tree/symbols/number.hpp + include/bertini2/function_tree/symbols/linear_product.hpp +) + +set(functiontree_roots_HEADERS + include/bertini2/function_tree/roots/function.hpp + include/bertini2/function_tree/roots/jacobian.hpp +) + +set(io_headers + include/bertini2/io/file_utilities.hpp + include/bertini2/io/generators.hpp + include/bertini2/io/parsing.hpp + include/bertini2/io/splash.hpp +) + +set(io_parsing_headers + include/bertini2/io/parsing/classic_utilities.hpp + include/bertini2/io/parsing/function_parsers.hpp + include/bertini2/io/parsing/function_rules.hpp + include/bertini2/io/parsing/number_parsers.hpp + include/bertini2/io/parsing/number_rules.hpp + include/bertini2/io/parsing/qi_files.hpp + include/bertini2/io/parsing/settings_parsers.hpp + include/bertini2/io/parsing/settings_rules.hpp + include/bertini2/io/parsing/system_parsers.hpp + include/bertini2/io/parsing/system_rules.hpp +) + +set(io_parsing_settings_headers + include/bertini2/io/parsing/settings_parsers/algorithm.hpp + include/bertini2/io/parsing/settings_parsers/base.hpp + include/bertini2/io/parsing/settings_parsers/endgames.hpp + include/bertini2/io/parsing/settings_parsers/tracking.hpp +) + +set(nag_algorithms_headers + include/bertini2/nag_algorithms/midpath_check.hpp + include/bertini2/nag_algorithms/numerical_irreducible_decomposition.hpp + include/bertini2/nag_algorithms/output.hpp + include/bertini2/nag_algorithms/sharpen.hpp + include/bertini2/nag_algorithms/trace.hpp + include/bertini2/nag_algorithms/zero_dim_solve.hpp +) + +set(nag_algorithms_common_headers + include/bertini2/nag_algorithms/common/algorithm_base.hpp + include/bertini2/nag_algorithms/common/config.hpp + include/bertini2/nag_algorithms/common/policies.hpp +) + +set(nag_datatypes_headers + include/bertini2/nag_datatypes/numerical_irreducible_decomposition.hpp + include/bertini2/nag_datatypes/witness_set.hpp +) + +set(nag_datatypes_common_headers + include/bertini2/nag_datatypes/common/policies.hpp +) + +set(parallel_headers + include/bertini2/parallel/initialize_finalize.hpp +) + +set(parallel_rootinclude_HEADERS + include/bertini2/parallel.hpp +) + +set(pool_headers + include/bertini2/pool/pool.hpp + include/bertini2/pool/system.hpp +) + +set(system_headers + include/bertini2/system/patch.hpp + include/bertini2/system/precon.hpp + include/bertini2/system/slice.hpp + include/bertini2/system/start_base.hpp + include/bertini2/system/start_systems.hpp + include/bertini2/system/straight_line_program.hpp + include/bertini2/system/system.hpp +) + +set(system_start_headers + include/bertini2/system/start/total_degree.hpp + include/bertini2/system/start/mhom.hpp + include/bertini2/system/start/user.hpp + include/bertini2/system/start/utility.hpp +) + +set(system_rootinclude_HEADERS + include/bertini2/system.hpp +) + +set(trackers_HEADERS + include/bertini2/trackers/adaptive_precision_utilities.hpp + include/bertini2/trackers/amp_criteria.hpp + include/bertini2/trackers/amp_tracker.hpp + include/bertini2/trackers/base_predictor.hpp + include/bertini2/trackers/base_tracker.hpp + include/bertini2/trackers/config.hpp + include/bertini2/trackers/events.hpp + include/bertini2/trackers/explicit_predictors.hpp + include/bertini2/trackers/fixed_precision_tracker.hpp + include/bertini2/trackers/fixed_precision_utilities.hpp + include/bertini2/trackers/newton_correct.hpp + include/bertini2/trackers/newton_corrector.hpp + include/bertini2/trackers/observers.hpp + include/bertini2/trackers/ode_predictors.hpp + include/bertini2/trackers/predict.hpp + include/bertini2/trackers/step.hpp + include/bertini2/trackers/tracker.hpp +) + +set(tracking_rootinclude_HEADERS + include/bertini2/tracking.hpp +) + +set(BERTINI2_LIBRARY_HEADERS + ${endgames_headers} + ${basics_headers} + ${common_headers} + ${detail_headers} + ${function_tree_headers} + ${io_headers} + ${io_parsing_headers} + ${io_parsing_settings_headers} + ${nag_algorithms_headers} + ${nag_algorithms_common_headers} + ${nag_datatypes_headers} + ${nag_datatypes_common_headers} + ${parallel_headers} + ${parallel_rootinclude_HEADERS} + ${pool_headers} + ${system_headers} + ${system_start_headers} + ${system_rootinclude_HEADERS} + ${systeminclude_HEADERS} + ${startinclude_HEADERS} + ${trackers_HEADERS} + ${tracking_header_files} + ${tracking_rootinclude_HEADERS} + ${trackersinclude_HEADERS} +) + +set(basics_sources + src/basics/random.cpp + src/basics/have_bertini.cpp +) + +set(function_tree_sources + src/function_tree/node.cpp + src/function_tree/simplify.cpp + src/function_tree/operators/arithmetic.cpp + src/function_tree/operators/trig.cpp + src/function_tree/linear_product.cpp + src/function_tree/operators/operator.cpp + src/function_tree/symbols/special_number.cpp + src/function_tree/symbols/differential.cpp + src/function_tree/symbols/symbol.cpp + src/function_tree/symbols/variable.cpp + src/function_tree/symbols/number.cpp + src/function_tree/roots/jacobian.cpp + src/function_tree/roots/function.cpp +) + +set(parallel_sources + src/parallel/parallel.cpp + src/parallel/initialize_finalize.cpp +) + +set(system_source_files + src/system/precon.cpp + src/system/slice.cpp + src/system/start_base.cpp + src/system/system.cpp + src/system/straight_line_program.cpp + src/system/start/total_degree.cpp + src/system/start/mhom.cpp + src/system/start/user.cpp +) + +set(tracking_source_files + src/tracking/explicit_predictors.cpp +) + +set(BERTINI2_LIBRARY_SOURCES + ${basics_sources} + ${function_tree_sources} + ${parallel_sources} + ${system_source_files} + ${tracking_source_files} +) + +set(BERTINI2_EXE_SOURCES + src/blackbox/bertini.cpp + src/blackbox/main_mode_switch.cpp + src/blackbox/argc_argv.cpp +) + +set(BERTINI2_EXE_HEADERS + include/bertini2/blackbox/main_mode_switch.hpp + include/bertini2/blackbox/argc_argv.hpp + include/bertini2/blackbox/config.hpp + include/bertini2/blackbox/algorithm_builder.hpp + include/bertini2/blackbox/global_configs.hpp + include/bertini2/blackbox/switches_zerodim.hpp + include/bertini2/blackbox/user_homotopy.hpp +) + + +# this is correct if run from core, but not if from a higher level... +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) + +# see https://stackoverflow.com/questions/25676277/cmake-target-include-directories-prints-an-error-when-i-try-to-add-the-source +# for more on these generator expressions, $ + $ + $ # /include + ) + + +# All library files +target_sources(bertini2 PUBLIC + ${BERTINI2_LIBRARY_SOURCES} + ${BERTINI2_LIBRARY_HEADERS} +) + +if(WIN32) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + set(BUILD_SHARED_LIBS TRUE) + target_compile_options(bertini2 + PRIVATE $<$:-bigobj -MP>) + target_compile_definitions(bertini2 PUBLIC "HAVE_SNPRINTF") +endif() + +target_link_libraries(bertini2 PUBLIC ${GMP_LIBRARIES}) +target_link_libraries(bertini2 PUBLIC ${MPFR_LIBRARIES}) +target_link_libraries(bertini2 PUBLIC ${MPC_LIBRARIES}) +target_link_libraries(bertini2 PUBLIC Eigen3::Eigen) +target_link_libraries(bertini2 PUBLIC ${Boost_LIBRARIES}) + + +if(SUFFIX_SO_VERSION) + set_target_properties(bertini2 PROPERTIES SOVERSION ${PROJECT_VERSION}) +endif(SUFFIX_SO_VERSION) + +add_executable(bertini2_exe) +target_sources(bertini2_exe PUBLIC ${BERTINI2_EXE_SOURCES} ${BERTINI2_EXE_HEADERS}) +target_link_libraries(bertini2_exe ${Boost_LIBRARIES} bertini2) + +# todo: this should be made a devmode thing +#target_compile_options(bertini2 PRIVATE -Wall -Wextra) + +install( + TARGETS bertini2 + EXPORT ${TARGETS_EXPORT_NAME} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + INCLUDES + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + +add_header_group(${PROJECT_NAME}_HEADERS) +add_source_group(${PROJECT_NAME}_SOURCES) + +install( + TARGETS bertini2 + ARCHIVE DESTINATION "lib" + LIBRARY DESTINATION "lib" + COMPONENT library +) + +install( + FILES ${BERTINI2_EXE_HEADERS} + DESTINATION "include/bertini2/blackbox" +) + +install( + FILES ${function_tree_headers_rootinclude_HEADERS} ${parallel_rootinclude_HEADERS} ${system_rootinclude_HEADERS} ${tracking_rootinclude_HEADERS} ${parallel_rootinclude_HEADERS} ${system_rootinclude_HEADERS} ${tracking_rootinclude_HEADERS} + DESTINATION "include/bertini2" +) + +install( + FILES ${CMAKE_BINARY_DIR}/include/bertini2/config.hpp + DESTINATION "include/bertini2" +) + +install( + FILES ${endgames_headers} + DESTINATION "include/bertini2/endgames" +) + +install( + FILES ${trackers_headers} + DESTINATION "include/bertini2/trackers" +) + +install( + FILES ${basics_rootinclude_headers} + DESTINATION "include/bertini2" +) + +install( + FILES ${common_headers} + DESTINATION "include/bertini2/common" +) + +install( + FILES ${detail_headers} + DESTINATION "include/bertini2/detail" +) + +install( + FILES ${function_tree_headers} + DESTINATION "include/bertini2/function_tree" +) + +install( + FILES ${function_tree_headers_rootinclude_HEADERS}# + DESTINATION "include/bertini2" +) + +install( + FILES ${functiontree_operators_HEADERS} + DESTINATION "include/bertini2/function_tree/operators" +) + +install( + FILES ${functiontree_symbols_HEADERS} + DESTINATION "include/bertini2/function_tree/symbols" +) + +install( + FILES ${functiontree_roots_HEADERS} + DESTINATION "include/bertini2/function_tree/roots/" +) + +install( + FILES ${io_headers} + DESTINATION "include/bertini2/io" +) + +install( + FILES ${io_parsing_headers} + DESTINATION "include/bertini2/io/parsing" +) + +install( + FILES ${io_parsing_settings_headers} + DESTINATION "include/bertini2/io/parsing/settings_parsers" +) + +install( + FILES ${nag_algorithms_headers} + DESTINATION "include/bertini2/nag_algorithms" +) + +install( + FILES ${nag_algorithms_common_headers} + DESTINATION "include/bertini2/nag_algorithms/common" +) + +install( + FILES ${nag_datatypes_headers} + DESTINATION "include/bertini2/nag_datatypes" +) + +install( + FILES ${nag_datatypes_common_headers} + DESTINATION "include/bertini2/nag_datatypes/common" +) + +install( + FILES ${parallel_headers} + DESTINATION "include/bertini2/parallel" +) + +install( + FILES ${parallel_rootinclude_HEADERS} + DESTINATION "include/bertini2" +) + +install( + FILES ${pool_headers} + DESTINATION "include/bertini2/pool" +) + +install( + FILES ${system_headers} + DESTINATION "include/bertini2/system" +) + +install( + FILES ${system_start_headers} + DESTINATION "include/bertini2/system/start" +) + +install( + FILES ${system_rootinclude_HEADERS} + DESTINATION "include/bertini2" +) + +install( + FILES ${tracking_rootinclude_HEADERS} + DESTINATION "include/bertini2" +) + +install( + FILES ${trackers_HEADERS} + DESTINATION "include/bertini2/trackers" +) + +install( + FILES ${settings_headers} + DESTINATION "include/bertini2/settings" +) + +install( + FILES ${tracking_header_files} + DESTINATION "include/bertini2/tracking" +) + +################### +# +# +# UNIT TESTING +# +# +############# + + + + + +if (ENABLE_UNIT_TESTING) + + set(B2_CLASS_TEST_SOURCES + test/classes/boost_multiprecision_test.cpp + test/classes/fundamentals_test.cpp + test/classes/eigen_test.cpp + test/classes/complex_test.cpp + test/classes/function_tree_test.cpp + test/classes/function_tree_transform.cpp + test/classes/system_test.cpp + test/classes/slp_test.cpp + test/classes/differentiate_test.cpp + test/classes/differentiate_wrt_var.cpp + test/classes/homogenization_test.cpp + test/classes/start_system_test.cpp + test/classes/node_serialization_test.cpp + test/classes/patch_test.cpp + test/classes/slice_test.cpp + test/classes/m_hom_start_system.cpp + test/classes/class_test.cpp + ) + + + add_executable(test_classes ${B2_CLASS_TEST_SOURCES}) + target_include_directories(test_classes PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") + target_link_libraries(test_classes ${Boost_LIBRARIES} bertini2) + add_test(NAME test_classes COMMAND ${CMAKE_BINARY_DIR}/core/test_classes) + + + set(B2_BLACKBOX_TEST + test/blackbox/blackbox.cpp + test/blackbox/zerodim.cpp + test/blackbox/parsing.cpp + test/blackbox/user_homotopy.cpp + ) + + add_executable(test_blackbox ${B2_BLACKBOX_TEST}) + target_include_directories(test_blackbox PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + target_link_libraries(test_blackbox ${Boost_LIBRARIES} bertini2) + add_test(NAME test_blackbox COMMAND ${CMAKE_BINARY_DIR}/core/test_blackbox) + + + set(B2_CLASSIC_TEST + test/classic/classic_parsing_test.cpp + test/classic/classic_test.cpp + ) + + add_executable(test_classic ${B2_CLASSIC_TEST}) + target_include_directories(test_classic PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") + target_link_libraries(test_classic ${Boost_LIBRARIES} bertini2) + add_test(NAME test_classic COMMAND ${CMAKE_BINARY_DIR}/core/test_classic) + + set(B2_ENDGAMES_TEST + test/endgames/endgames_test.cpp + test/endgames/generic_interpolation.hpp + test/endgames/interpolation.cpp + test/endgames/generic_pseg_test.hpp + test/endgames/amp_powerseries_test.cpp + test/endgames/fixed_double_powerseries_test.cpp + test/endgames/fixed_multiple_powerseries_test.cpp + test/endgames/generic_cauchy_test.hpp + test/endgames/amp_cauchy_test.cpp + test/endgames/fixed_double_cauchy_test.cpp + test/endgames/fixed_multiple_cauchy_test.cpp + ) + + add_executable(test_endgames ${B2_ENDGAMES_TEST}) + target_include_directories(test_endgames PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") + target_link_libraries(test_endgames ${Boost_LIBRARIES} bertini2) + add_test(NAME test_endgames COMMAND ${CMAKE_BINARY_DIR}/core/test_endgames) + + set(B2_GENERATING_TEST + test/generating/mpfr_float.cpp + test/generating/mpfr_complex.cpp + test/generating/double.cpp + test/generating/std_complex.cpp + test/generating/generating_test.cpp + ) + + add_executable(test_generating ${B2_GENERATING_TEST}) + target_include_directories(test_generating PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") + target_link_libraries(test_generating ${Boost_LIBRARIES} bertini2) + add_test(NAME test_generating COMMAND ${CMAKE_BINARY_DIR}/core/test_generating) + + set(B2_NAG_ALGORITHMS_TEST + test/nag_algorithms/nag_algorithms_test.cpp + test/nag_algorithms/zero_dim.cpp + test/nag_algorithms/numerical_irreducible_decomposition.cpp + test/nag_algorithms/trace.cpp + ) + + add_executable(test_nag_algorithms ${B2_NAG_ALGORITHMS_TEST}) + target_include_directories(test_nag_algorithms PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") + target_link_libraries(test_nag_algorithms ${Boost_LIBRARIES} bertini2) + add_test(NAME test_nag_algorithms COMMAND ${CMAKE_BINARY_DIR}/core/test_nag_algorithms) + + set(B2_NAG_DATATYPES_TEST + test/nag_datatypes/witness_set.cpp + test/nag_datatypes/nag_datatypes_test.cpp + test/nag_datatypes/numerical_irreducible_decomposition.cpp + ) + + add_executable(test_nag_datatypes ${B2_NAG_DATATYPES_TEST}) + target_include_directories(test_nag_datatypes PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") + target_link_libraries(test_nag_datatypes ${Boost_LIBRARIES} bertini2) + add_test(NAME test_nag_datatypes COMMAND ${CMAKE_BINARY_DIR}/core/test_nag_datatypes) + + set(B2_POOLS_TEST + test/pools/pool_test.cpp + ) + + add_executable(test_pool ${B2_POOLS_TEST}) + target_include_directories(test_pool PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") + target_link_libraries(test_pool ${Boost_LIBRARIES} bertini2) + add_test(NAME test_pool COMMAND ${CMAKE_BINARY_DIR}/core/test_pool) + + set(B2_SETTINGS_TEST + test/settings/settings_test.cpp + ) + + add_executable(test_settings ${B2_SETTINGS_TEST}) + target_include_directories(test_settings PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") + target_link_libraries(test_settings ${Boost_LIBRARIES} bertini2) + add_test(NAME test_settings COMMAND ${CMAKE_BINARY_DIR}/core/test_settings) + + set(B2_TRACKING_BASICS_TEST + test/tracking_basics/newton_correct_test.cpp + test/tracking_basics/euler_test.cpp + test/tracking_basics/heun_test.cpp + test/tracking_basics/higher_predictor_test.cpp + test/tracking_basics/tracking_basics_test.cpp + test/tracking_basics/fixed_precision_tracker_test.cpp + test/tracking_basics/amp_criteria_test.cpp + test/tracking_basics/amp_tracker_test.cpp + test/tracking_basics/path_observers.cpp + ) + + add_executable(test_tracking_basics ${B2_TRACKING_BASICS_TEST}) + target_include_directories(test_tracking_basics PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") + target_link_libraries(test_tracking_basics ${Boost_LIBRARIES} bertini2) + add_test(NAME test_tracking_basics COMMAND ${CMAKE_BINARY_DIR}/core/test_tracking_basics) + + enable_testing() + +endif (ENABLE_UNIT_TESTING) diff --git a/core/INSTALL b/core/INSTALL index 209984075..e82fd21de 100644 --- a/core/INSTALL +++ b/core/INSTALL @@ -1,8 +1,8 @@ Installation Instructions ************************* -Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, -Inc. + Copyright (C) 1994-1996, 1999-2002, 2004-2017, 2020-2021 Free +Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright @@ -12,97 +12,96 @@ without warranty of any kind. Basic Installation ================== - Briefly, the shell command `./configure && make && make install' + Briefly, the shell command './configure && make && make install' should configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for +more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this -`INSTALL' file but do not implement all of the features documented +'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. - The `configure' shell script attempts to guess correct values for + The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that +those values to create a 'Makefile' in each directory of the package. +It may also create one or more '.h' files containing system-dependent +definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). +file 'config.log' containing compiler output (useful mainly for +debugging 'configure'). - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. + It can also use an optional file (typically called 'config.cache' and +enabled with '--cache-file=config.cache' or simply '-C') that saves the +results of its tests to speed up reconfiguring. Caching is disabled by +default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can +to figure out how 'configure' could check whether to do them, and mail +diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you +some point 'config.cache' contains results you don't want to keep, you may remove or edit it. - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. + The file 'configure.ac' (or 'configure.in') is used to create +'configure' by a program called 'autoconf'. You need 'configure.ac' if +you want to change it or regenerate 'configure' using a newer version of +'autoconf'. The simplest way to compile this package is: - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. + 1. 'cd' to the directory containing the package's source code and type + './configure' to configure the package for your system. - Running `configure' might take a while. While running, it prints + Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. - 2. Type `make' to compile the package. + 2. Type 'make' to compile the package. - 3. Optionally, type `make check' to run any self-tests that come with + 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. - 4. Type `make install' to install the programs and any data files and + 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root + user, and only the 'make install' phase executed with root privileges. - 5. Optionally, type `make installcheck' to repeat any self-tests, but + 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a - regular user, particularly if the prior `make install' required + regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly + source code directory by typing 'make clean'. To also remove the + files that 'configure' created (so you can compile the package for + a different kind of computer), type 'make distclean'. There is + also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. - 7. Often, you can also type `make uninstall' to remove the installed + 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. - 8. Some packages, particularly those that use Automake, provide `make + 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. + targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' +the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: + You can give 'configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here is +an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix @@ -113,21 +112,21 @@ Compiling For Multiple Architectures You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the +own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. This -is known as a "VPATH" build. +the 'configure' script. 'configure' automatically checks for the source +code in the directory that 'configure' is in and in '..'. This is known +as a "VPATH" build. - With a non-GNU `make', it is safer to compile the package for one + With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before +installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like +"universal" binaries--by specifying multiple '-arch' options to the +compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ @@ -136,105 +135,104 @@ this: This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. +using the 'lipo' tool if you have problems. Installation Names ================== - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX', where PREFIX must be an + By default, 'make install' installs the package's commands under +'/usr/local/bin', include files under '/usr/local/include', etc. You +can specify an installation prefix other than '/usr/local' by giving +'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses +pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. In general, the -default for these options is expressed in terms of `${prefix}', so that -specifying just `--prefix' will affect all of the other directory +options like '--bindir=DIR' to specify different values for particular +kinds of files. Run 'configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the default +for these options is expressed in terms of '${prefix}', so that +specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or +correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without +'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each -affected directory. For example, `make install +affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and +'${prefix}'. Any directories that were specified during 'configure', +but not in terms of '${prefix}', must each be overridden at install time +for the entire installation to be relocated. The approach of makefile +variable overrides for each directory variable is required by the GNU +Coding Standards, and ideally causes no recompilation. However, some +platforms have known limitations with the semantics of shared libraries +that end up requiring recompilation when using this method, particularly +noticeable in packages that use GNU Libtool. + + The second method involves providing the 'DESTDIR' variable. For +example, 'make install DESTDIR=/alternate/directory' will prepend +'/alternate/directory' before all installation names. The approach of +'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. +when some directory options were not specified in terms of '${prefix}' +at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the +with an extra prefix or suffix on their names by giving 'configure' the +option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. + + Some packages pay attention to '--enable-FEATURE' options to +'configure', where FEATURE indicates an optional part of the package. +They may also pay attention to '--with-PACKAGE' options, where PACKAGE +is something like 'gnu-as' or 'x' (for the X Window System). The +'README' should mention any '--enable-' and '--with-' options that the package recognizes. - For packages that use the X Window System, `configure' can usually + For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. +you can use the 'configure' options '--x-includes=DIR' and +'--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure +execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure +overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. +overridden with 'make V=0'. Particular systems ================== - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in + On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC +is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. - HP-UX `make' updates targets which have the same time stamps as -their prerequisites, which makes it generally unusable when shipped -generated files such as `configure' are involved. Use GNU `make' -instead. + HP-UX 'make' updates targets which have the same timestamps as their +prerequisites, which makes it generally unusable when shipped generated +files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try +parse its '' header file. The option '-nodtk' can be used as a +workaround. If GNU CC is not installed, it is therefore recommended to +try ./configure CC="cc" @@ -242,26 +240,26 @@ and if that doesn't work, try ./configure CC="cc -nodtk" - On Solaris, don't put `/usr/ucb' early in your `PATH'. This + On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. +these programs are available in '/usr/bin'. So, if you need '/usr/ucb' +in your 'PATH', put it _after_ '/usr/bin'. - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: + On Haiku, software installed for all users goes in '/boot/common', +not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== - There may be some features `configure' cannot figure out + There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints +_same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: +'--build=TYPE' option. TYPE can either be a short name for the system +type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM @@ -270,101 +268,101 @@ where SYSTEM can have one of these forms: OS KERNEL-OS - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't + See the file 'config.sub' for the possible values of each field. If +'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will +use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. +eventually be run) with '--host=TYPE'. Sharing Defaults ================ - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. + If you want to set default values for 'configure' scripts to share, +you can create a site shell script called 'config.site' that gives +default values for variables like 'CC', 'cache_file', and 'prefix'. +'configure' looks for 'PREFIX/share/config.site' if it exists, then +'PREFIX/etc/config.site' if it exists. Or, you can set the +'CONFIG_SITE' environment variable to the location of the site script. +A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run +environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: +them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc -causes the specified `gcc' to be used as the C compiler (unless it is +causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf limitation. Until the limitation is lifted, you can use -this workaround: +Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an +Autoconf limitation. Until the limitation is lifted, you can use this +workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash -`configure' Invocation +'configure' Invocation ====================== - `configure' recognizes the following options to control how it + 'configure' recognizes the following options to control how it operates. -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. +'--help' +'-h' + Print a summary of all of the options to 'configure', and exit. -`--help=short' -`--help=recursive' +'--help=short' +'--help=recursive' Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. + 'configure', and exit. The 'short' variant lists options used only + in the top level, while the 'recursive' variant lists options also + present in any nested packages. -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' +'--version' +'-V' + Print the version of Autoconf used to generate the 'configure' script, and exit. -`--cache-file=FILE' +'--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to + traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. +'--config-cache' +'-C' + Alias for '--cache-file=config.cache'. -`--quiet' -`--silent' -`-q' +'--quiet' +'--silent' +'-q' Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error + suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). -`--srcdir=DIR' +'--srcdir=DIR' Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. + 'configure' can determine that directory automatically. -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. +'--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: for + more details, including other options available for fine-tuning the + installation locations. -`--no-create' -`-n' +'--no-create' +'-n' Run the configure checks, but stop before creating any output files. -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. +'configure' also accepts some other, not widely useful, options. Run +'configure --help' for more details. diff --git a/core/Makefile.am b/core/Makefile.am deleted file mode 100644 index c8d85f7bb..000000000 --- a/core/Makefile.am +++ /dev/null @@ -1,112 +0,0 @@ -#this is the main Makefile.am for Bertini 2. - -# # # # # # # # # # # # # # # # # # # # # # # # # # # # -# -# this project uses non-recursive make. -# -# # # # # # # # # # # # # # # # # # # # # # # # # # # # - -AM_YFLAGS = -d -p `basename $* | sed 's,y$$,,'` -AM_LFLAGS = -s -P`basename $* | sed 's,l$$,,'` -olex.yy.c - -AM_CPPFLAGS = -I$(top_srcdir)/include $(BOOST_CPPFLAGS) - -ACLOCAL_AMFLAGS = -I m4 - -#################################### -### set up the empty variables. these are added onto by the below included files, -### and are deliberately blank here. -################################# - -bin_PROGRAMS = -BUILT_SOURCES = -CLEANFILES = - -#installed headers -include_HEADERS = -rootinclude_HEADERS = - -#installed libraries, both free-standing and libtool -lib_LTLIBRARIES = -lib_LIBRARIES = - -#helper libraries, both free-standing and libtool -noinst_LIBRARIES = -noinst_LTLIBRARIES = - -#programs which are not installed, but are optional targets for building. -EXTRA_PROGRAMS = -EXTRA_LTLIBRARIES = - -TESTS = - -core_all = -core_sources = -core_headers = - - -############################################ -###### end deliberately blank items ## -########################################## - - -#see https://www.gnu.org/software/automake/manual/html_node/Suffixes.html -SUFFIXES = .cpp .hpp - -rootincludedir = $(includedir)/bertini2 - -#initialize to empty and add to it in the Makemodule.am files below - -############ -# -# a note for developers: -# -###### -# -# if you need to add an executable to the core, -# add a Makemodule.am file in the source folder for the `main()` file -# and include it below. -# -# see the b2 github wiki for detailed instructions. -# https://github.com/bertiniteam/b2 -############## - -############################ -### now include the Makemodule.am files from the subdirectories; -### they will add on to the variables which are set above. -### note that the name `Makemodule.am` is arbitrary. -################################## - -# include the bertini2 Makemodule first, as it defines some useful groups of files which are used later -# in other files. - -include src/basics/Makemodule.am -include src/common/Makemodule.am -include src/function_tree/Makemodule.am -include src/system/Makemodule.am -include src/tracking/Makemodule.am -include src/endgames/Makemodule.am -include src/detail/Makemodule.am -include src/io/Makemodule.am -include src/nag_algorithms/Makemodule.am -include src/nag_datatypes/Makemodule.am -include src/pool/Makemodule.am -include src/parallel/Makemodule.am - -include src/corelibrary/Makemodule.am -include src/blackbox/Makemodule.am - -### -# and finally test suites, built as extras -#### - -include test/classes/Makemodule.am -include test/tracking_basics/Makemodule.am -include test/classic/Makemodule.am -include test/settings/Makemodule.am -include test/endgames/Makemodule.am -include test/pools/Makemodule.am -include test/generating/Makemodule.am -include test/nag_algorithms/Makemodule.am -include test/nag_datatypes/Makemodule.am -include test/blackbox/Makemodule.am diff --git a/core/README b/core/README deleted file mode 100644 index 1162e5a7c..000000000 --- a/core/README +++ /dev/null @@ -1,66 +0,0 @@ -This README contains brief instructions for how to build the core of Bertini2. For more extensive instructions, visit the wiki for the GitHub repo: https://github.com/bertiniteam/b2/wiki - -If you struggle, find errors, or have comments, please let the dev team know. We want this process to be as painless as possible! Contact information can be found on the wiki. - -------------- - -BUILDING THE CORE OF BERTINI2 - -------------- - -Before getting started, please note that these instructions are for Linux and Mac only. Windows build instructions are yet to come. If you want to help write those instructions (and indeed create the process), please let the devteam know! - -------------- - -Prerequisites: - -- Compiler capable of compiling C++ code using C++14 features. -- Eigen 3.2.x or later. -- Boost 1.56 or later. To take advantage of expression templates for multiprecision real numbers (an important optimization), Boost versions prior to 1.61 must be patched. See https://github.com/boostorg/multiprecision/commit/f57bd6b31a64787425ec891bd2ceb536c9036f72 If you do not wish to patch Boost, and are using a version prior to 1.61, please disable expression templates when configuring. If you don't, you'll see a pair of errors, and comments basically saying this same message. The configure flag is --disable-expression_templates. -- Plenty of RAM. Since there are many templates in play in Bertini2, Eigen, and Boost, compilation is slower than Bertini1, and takes a lot of memory. GCC (g++) tends to use around 1 GB per thread when compiling the core, Clang perhaps 250MB. Plan your use of parallel make accordingly, and consider getting a cup of coffee while compiling. Enjoy! - -------------- - -Steps to compile: - -------------- - -1) Generate the ./configure script, and some other m4 macros, etc, so that the build system is complete. This requires the autotools, modern versions. The command for this is - - autoreconf -vfi - -The -vfi flags are for (v)erbose, (f)orce, and (i)nstall. If this step fails, you almost certainly have outdated autotools software, most namely automake, autoconf, and libtool. Update your tools as necessary. - -Important note: on Linux machines, you typically have to run the command - - libtoolize - -in order to get autoreconf to work. - --------------- - -2) Engage in the standard build process for any software built using the autotools. - - ./configure (with your options) - - make (consider using multiple threads [-j #] if you have enough memory) - -Then, if you want to, you can run the test programs. - - make check (again consider running in parallel) - -The test programs are built using the Boost.UnitTest library, and can produce a variety of output files, and be run in a variety of modes. These options are not documented here. Rather, if you ask for --help on them, they will tell you more. - -Finally, you probably want to install the core, particularly if you intend to build the Python bindings (b2/python). - - [sudo] make install - -------------- - -Notes for developers: - -If you add files to the project, or wish to add a compiled program, etc, you modify the b2/core/Makefile.am, and a b2/core/path/to/Makemodule.am file, or possibly create a Makemodule.am file at the correct location. If you need help with this, please contact Dani Brake brakeda@uwec.edu - -Please do not commit autotools-built files to the repository, including the configure script, any file in the created b2/core/config/ folder, or the others. There is a chance you may have to add a m4 macro or something, and this is ok. Do what you need, but commit only the source files, not generated files. - -Please maintain this file by editing it as necessary. diff --git a/core/README.md b/core/README.md new file mode 100644 index 000000000..6b84519e9 --- /dev/null +++ b/core/README.md @@ -0,0 +1,7 @@ +This is the top-level readme for the C++ core of Bertini 2. Main repository online at [github.com/bertiniteam/b2](https://github.com/bertiniteam/b2). + +The C++ core is standalone compilable, so if you don't want to build the Python bindings, or you want to build an application against the C++ functionality, it's not so bad. + +The library uses templates heavily, and is written to use the C++17 standard (most of the code is up to C++14, but there are a few 17 things in there). + +For compilation instructions, see [the Wiki compiling section on Github](https://github.com/bertiniteam/b2/wiki/Compilation-Guide). \ No newline at end of file diff --git a/core/compile_all_tests.sh b/core/compile_all_tests.sh deleted file mode 100755 index 9d93e7d99..000000000 --- a/core/compile_all_tests.sh +++ /dev/null @@ -1,14 +0,0 @@ -#! /bin/bash - -if [ $# -ne 1 ] -then - numprocs=1 -else - numprocs=$1 -fi - -printf "\n\n\ncompiling with %d processor(s)\n\n\n" $numprocs | tee -a "compile_all.log" -while read suite; do - printf "\n\n%s\n\n" $suite | tee -a "compile_all.log" - make -j $numprocs $suite | tee -a "compile_all.log" -done