Skip to content

feat: migrate build and dependencies to conda-only workflow#93

Open
Luohaothu wants to merge 17 commits intomasterfrom
feat-conda
Open

feat: migrate build and dependencies to conda-only workflow#93
Luohaothu wants to merge 17 commits intomasterfrom
feat-conda

Conversation

@Luohaothu
Copy link
Contributor

Summary

  • switch OpFlow build/deps to conda-only workflow and remove vendored external tree
  • add conda recipe variants for mpi/openmp and split tecio/teciompi dependency handling
  • fix package-config/test robustness for MPI HDF5 detection and macOS cmake runtime lookup

Test Plan

  • conda build conda/recipe --variants '{mpi: openmpi, openmp: off}' --no-anaconda-upload --dirty
  • conda build conda/recipe --variants '{mpi: openmpi, openmp: on}' --no-anaconda-upload --dirty
  • conda build /tmp/dep-work-tecio-1770781139/repo/conda/meta.yaml --variants '{mpi: nompi}' --no-anaconda-upload
  • conda build /tmp/dep-work-tecio-1770781139/repo/conda/meta.yaml --variants '{mpi: openmpi}' --no-anaconda-upload

@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-conda

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @Luohaothu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the OpFlow project's build and dependency management by transitioning to a conda-centric workflow. This change streamlines the build process, enhances maintainability by removing vendored external libraries, and introduces robust variant support for key components like MPI and OpenMP. The updated CMake logic now exclusively leverages find_package for all dependencies, ensuring a cleaner and more standard approach to external library integration.

Highlights

  • Conda-only Workflow Migration: The build system and dependency management for OpFlow have been migrated to a conda-only workflow, eliminating the need for vendored external libraries.
  • Conda Recipe Variants: New conda recipe variants have been introduced to support different configurations for MPI (nompi, openmpi) and OpenMP (on, off), allowing for flexible builds.
  • CMake Modernization and Robustness: The CMake configuration has been updated to remove deprecated experimental settings and now relies entirely on find_package for external dependencies, improving build robustness across different environments, including macOS.
  • Removal of Vendored Dependencies: All previously vendored third-party libraries, including AMGCL, spdlog, TBB, HYPRE, and TecIO, have been removed from the repository, with the expectation that they will be provided by the conda environment.
  • New Conda Recipe and Test Infrastructure: A complete conda recipe (meta.yaml, build.sh, conda_build_config.yaml) and a basic smoke test have been added to facilitate building and testing OpFlow within a conda environment.
Changelog
  • CMakeLists.txt
    • Removed deprecated CMAKE_EXPERIMENTAL settings and CMAKE_EXPORT_BUILD_DATABASE.
    • Updated OPFLOW_WITH_HDF5 and OPFLOW_WITH_VTK options to be always ON and cached.
    • Removed OPFLOW_USE_BUNDLED_GTEST option.
    • Removed options for bundled HYPRE, VTK, and TBB, enforcing external dependency usage.
    • Replaced add_subdirectory(external) with explicit find_package calls for spdlog, amgcl, TBB, HYPRE, TecIO/TecIOMPI, VTK, and HDF5.
    • Added logic to check for HYPRE_SStructFACCreate for conditional compilation.
    • Removed platform-specific OpenMP workarounds and PKG_CONFIG_REQUIRES for OpenMP.
    • Replaced bundled Google Benchmark configuration with find_package(benchmark).
    • Removed VTK installation directory logic.
    • Added install(EXPORT opflow-targets) and install(FILES "${CMAKE_BINARY_DIR}/Version.hpp") for package export.
  • cmake/AMGCLConfig.cmake
    • Removed custom CMake configuration for building and installing AMGCL from source.
  • cmake/DownloadGTest.cmake.in
    • Removed template for downloading Google Test via ExternalProject.
  • cmake/DownloadHYPRE.cmake.in
    • Removed template for downloading HYPRE via ExternalProject.
  • cmake/DownloadVTK.cmake.in
    • Removed template for downloading VTK via ExternalProject.
  • cmake/FMTConfig.cmake
    • Removed custom CMake configuration for building and installing FMT from source.
  • cmake/HYPREConfig.cmake
    • Removed custom CMake configuration for building and installing HYPRE from source.
  • cmake/SPDLOGConfig.cmake
    • Removed custom CMake configuration for building and installing spdlog from source.
  • cmake/TBBConfig.cmake
    • Removed custom CMake configuration for building and installing TBB from source.
  • cmake/TECIOConfig.cmake
    • Removed custom CMake configuration for building and installing TecIO from source.
  • cmake/UseBundledAMGCL.cmake.in
    • Removed template for using a pre-downloaded AMGCL source.
  • cmake/UseBundledGTest.cmake.in
    • Removed template for using a bundled Google Test source.
  • cmake/UseBundledHYPRE.cmake.in
    • Removed template for using a pre-downloaded HYPRE source.
  • cmake/UseExistingVTK.cmake.in
    • Removed template for acquiring an existing VTK build.
  • cmake/VTKConfig.cmake
    • Removed custom CMake configuration for building and finding VTK.
  • cmake/opflowConfig.cmake.in
    • Updated copyright year to 2026.
    • Refactored dependency finding to remove conditional logic for external/bundled libraries.
    • Standardized dependency finding using find_dependency for spdlog, TBB, amgcl, HYPRE, OpenMP, MPI, TecIO/TecIOMPI, VTK, and HDF5.
    • Added logic to prefer HDF5 from the active conda prefix and enforce MPI HDF5 via conda recipe constraints.
    • Updated the included targets file to opflowTargets.cmake.
  • conda/recipe/build.sh
    • Added a new shell script to configure, build, and install OpFlow using CMake and Ninja, supporting MPI and OpenMP variants.
  • conda/recipe/conda_build_config.yaml
    • Added a new YAML file defining mpi and openmp build variants for conda.
  • conda/recipe/meta.yaml
    • Added a new conda recipe defining package metadata, source path, build string, and comprehensive build, host, run, and test requirements for OpFlow, including conditional dependencies for MPI and OpenMP.
  • conda/recipe/test/CMakeLists.txt
    • Added a new CMakeLists.txt for a smoke test, setting C++26 standard, finding the OpFlow package, and linking an executable.
  • conda/recipe/test/main.cpp
    • Added a new C++ source file for a simple smoke test that asserts the OPFLOW_VERSION.
  • external/CMakeLists.txt
    • Removed the entire CMakeLists.txt file responsible for configuring and building external dependencies.
  • external/amgcl/CMakeLists.txt
    • Removed the entire CMakeLists.txt file for the vendored AMGCL library.
  • external/amgcl/LICENSE.md
    • Removed the license file for the vendored AMGCL library.
  • external/amgcl/MANIFEST.in
    • Removed the MANIFEST.in file for the vendored AMGCL library.
  • external/amgcl/README.md
    • Removed the README.md file for the vendored AMGCL library.
  • external/amgcl/amgcl/adapter/block_matrix.hpp
    • Removed the block_matrix.hpp adapter file for AMGCL.
  • external/amgcl/amgcl/adapter/complex.hpp
    • Removed the complex.hpp adapter file for AMGCL.
  • external/amgcl/amgcl/adapter/crs_builder.hpp
    • Removed the crs_builder.hpp adapter file for AMGCL.
  • external/amgcl/amgcl/adapter/crs_tuple.hpp
    • Removed the crs_tuple.hpp adapter file for AMGCL.
  • external/amgcl/amgcl/adapter/eigen.hpp
    • Removed the eigen.hpp adapter file for AMGCL.
  • external/amgcl/amgcl/adapter/epetra.hpp
    • Removed the epetra.hpp adapter file for AMGCL.
  • external/amgcl/amgcl/adapter/reorder.hpp
    • Removed the reorder.hpp adapter file for AMGCL.
  • external/amgcl/amgcl/adapter/scaled_problem.hpp
    • Removed the scaled_problem.hpp adapter file for AMGCL.
  • external/amgcl/amgcl/adapter/ublas.hpp
    • Removed the ublas.hpp adapter file for AMGCL.
  • external/amgcl/amgcl/adapter/zero_copy.hpp
    • Removed the zero_copy.hpp adapter file for AMGCL.
  • external/amgcl/amgcl/amg.hpp
    • Removed the amg.hpp file for AMGCL.
  • external/amgcl/amgcl/backend/blaze.hpp
    • Removed the blaze.hpp backend file for AMGCL.
  • external/amgcl/amgcl/backend/block_crs.hpp
    • Removed the block_crs.hpp backend file for AMGCL.
  • external/amgcl/amgcl/backend/builtin.hpp
    • Removed the builtin.hpp backend file for AMGCL.
  • external/amgcl/amgcl/backend/builtin_hybrid.hpp
    • Removed the builtin_hybrid.hpp backend file for AMGCL.
  • external/amgcl/amgcl/backend/cuda.hpp
    • Removed the cuda.hpp backend file for AMGCL.
  • external/amgcl/amgcl/backend/detail/default_direct_solver.hpp
    • Removed the default_direct_solver.hpp detail file for AMGCL.
  • external/amgcl/amgcl/backend/detail/matrix_ops.hpp
    • Removed the matrix_ops.hpp detail file for AMGCL.
  • external/amgcl/amgcl/backend/detail/mixing.hpp
    • Removed the mixing.hpp detail file for AMGCL.
  • external/amgcl/amgcl/backend/eigen.hpp
    • Removed the eigen.hpp backend file for AMGCL.
  • external/amgcl/amgcl/backend/hpx.hpp
    • Removed the hpx.hpp backend file for AMGCL.
  • external/amgcl/amgcl/backend/interface.hpp
    • Removed the interface.hpp backend file for AMGCL.
  • external/amgcl/amgcl/backend/mkl.hpp
    • Removed the mkl.hpp backend file for AMGCL.
  • external/amgcl/amgcl/backend/vexcl.hpp
    • Removed the vexcl.hpp backend file for AMGCL.
  • external/amgcl/amgcl/backend/vexcl_static_matrix.hpp
    • Removed the vexcl_static_matrix.hpp backend file for AMGCL.
  • external/amgcl/amgcl/backend/viennacl.hpp
    • Removed the viennacl.hpp backend file for AMGCL.
  • external/amgcl/amgcl/coarsening/aggregation.hpp
    • Removed the aggregation.hpp coarsening file for AMGCL.
  • external/amgcl/amgcl/coarsening/as_scalar.hpp
    • Removed the as_scalar.hpp coarsening file for AMGCL.
  • external/amgcl/amgcl/coarsening/detail/galerkin.hpp
    • Removed the galerkin.hpp coarsening detail file for AMGCL.
  • external/amgcl/amgcl/coarsening/detail/scaled_galerkin.hpp
    • Removed the scaled_galerkin.hpp coarsening detail file for AMGCL.
  • external/amgcl/amgcl/coarsening/plain_aggregates.hpp
    • Removed the plain_aggregates.hpp coarsening file for AMGCL.
  • external/amgcl/amgcl/coarsening/pointwise_aggregates.hpp
    • Removed the pointwise_aggregates.hpp coarsening file for AMGCL.
  • external/amgcl/amgcl/coarsening/rigid_body_modes.hpp
    • Removed the rigid_body_modes.hpp coarsening file for AMGCL.
  • external/amgcl/amgcl/coarsening/ruge_stuben.hpp
    • Removed the ruge_stuben.hpp coarsening file for AMGCL.
  • external/amgcl/amgcl/coarsening/runtime.hpp
    • Removed the runtime.hpp coarsening file for AMGCL.
  • external/amgcl/amgcl/coarsening/smoothed_aggr_emin.hpp
    • Removed the smoothed_aggr_emin.hpp coarsening file for AMGCL.
  • external/amgcl/amgcl/coarsening/smoothed_aggregation.hpp
    • Removed the smoothed_aggregation.hpp coarsening file for AMGCL.
  • external/amgcl/amgcl/coarsening/tentative_prolongation.hpp
    • Removed the tentative_prolongation.hpp coarsening file for AMGCL.
  • external/amgcl/amgcl/deflated_solver.hpp
    • Removed the deflated_solver.hpp file for AMGCL.
  • external/amgcl/amgcl/detail/inverse.hpp
    • Removed the inverse.hpp detail file for AMGCL.
  • external/amgcl/amgcl/detail/qr.hpp
    • Removed the qr.hpp detail file for AMGCL.
  • external/amgcl/amgcl/detail/sort_row.hpp
    • Removed the sort_row.hpp detail file for AMGCL.
  • external/amgcl/amgcl/detail/spgemm.hpp
    • Removed the spgemm.hpp detail file for AMGCL.
  • external/amgcl/amgcl/io/binary.hpp
    • Removed the binary.hpp I/O file for AMGCL.
  • external/amgcl/amgcl/io/ios_saver.hpp
    • Removed the ios_saver.hpp I/O file for AMGCL.
  • external/amgcl/amgcl/io/mm.hpp
    • Removed the mm.hpp I/O file for AMGCL.
  • external/amgcl/amgcl/make_block_solver.hpp
    • Removed the make_block_solver.hpp file for AMGCL.
  • external/amgcl/amgcl/make_solver.hpp
    • Removed the make_solver.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/amg.hpp
    • Removed the mpi/amg.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/block_preconditioner.hpp
    • Removed the mpi/block_preconditioner.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/coarsening/aggregation.hpp
    • Removed the mpi/coarsening/aggregation.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/coarsening/pmis.hpp
    • Removed the mpi/coarsening/pmis.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/coarsening/runtime.hpp
    • Removed the mpi/coarsening/runtime.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/coarsening/smoothed_aggregation.hpp
    • Removed the mpi/coarsening/smoothed_aggregation.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/cpr.hpp
    • Removed the mpi/cpr.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/direct_solver/eigen_splu.hpp
    • Removed the mpi/direct_solver/eigen_splu.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/direct_solver/pastix.hpp
    • Removed the mpi/direct_solver/pastix.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/direct_solver/runtime.hpp
    • Removed the mpi/direct_solver/runtime.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/direct_solver/skyline_lu.hpp
    • Removed the mpi/direct_solver/skyline_lu.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/direct_solver/solver_base.hpp
    • Removed the mpi/direct_solver/solver_base.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/distributed_matrix.hpp
    • Removed the mpi/distributed_matrix.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/inner_product.hpp
    • Removed the mpi/inner_product.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/make_solver.hpp
    • Removed the mpi/make_solver.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/partition/merge.hpp
    • Removed the mpi/partition/merge.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/partition/parmetis.hpp
    • Removed the mpi/partition/parmetis.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/partition/ptscotch.hpp
    • Removed the mpi/partition/ptscotch.hpp file for AMGCL.
  • external/amgcl/amgcl/mpi/partition/runtime.hpp
    • Removed the mpi/partition/runtime.hpp file for AMGCL.
Activity
  • The author, Luohaothu, has provided a detailed test plan including several conda build commands with different MPI and OpenMP variants, indicating thorough testing of the new workflow.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a significant and positive refactoring that migrates the project's build system to a modern, conda-only workflow. By removing vendored dependencies and using find_package in CMake, the build process is greatly simplified and dependency management becomes much cleaner. The new conda recipes are well-structured. I've found a couple of minor issues in the new conda recipe files that would prevent a successful build, and I've provided suggestions to fix them. Overall, this is an excellent improvement for the project.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c54b1e22db

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Luohaothu
Copy link
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link

💡 Codex Review

HYPRE_StructVectorSetValues(b, const_cast<int*>(first.get().data()), &zero);

P1 Badge Pass scalar zero to Struct RHS pinning call

In generateb(), the pinning path now calls HYPRE_StructVectorSetValues with &zero while the surrounding calls in the same handler pass scalar values; this introduces a type/ABI mismatch for the struct API and breaks builds (or mis-sets RHS) when this solver path is instantiated. The previous scalar literal was consistent with the rest of HYPRE_StructVectorSetValues usage in this file, so this change should be reverted to a scalar argument.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Luohaothu
Copy link
Contributor Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6be0f0de0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +106 to +107
package_paths.txt
${{ steps.croot.outputs.croot }}/${{ matrix.platform }}/opflow-*.conda

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fail upload when no package artifact is produced

Including package_paths.txt in the artifact path list means if-no-files-found: error will still pass even when the actual package glob matches nothing, because the text file is always present. In scenarios where the built package name/path differs (for example, different package format or output location), this job reports success while uploading no conda package, which can silently break downstream release consumption.

Useful? React with 👍 / 👎.

@Luohaothu
Copy link
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link

💡 Codex Review

HYPRE_StructVectorSetValues(b, const_cast<int*>(first.get().data()), &zero);

P1 Badge Pass scalar value to HYPRE_StructVectorSetValues

HYPRE_StructVectorSetValues takes a scalar HYPRE_Complex value, but this call passes &zero (a pointer), which causes a type mismatch when this template is instantiated for structured HYPRE solves (the same function is called with a scalar at line 172). This will break builds for configurations that compile HYPREEqnSolveHandler and prevents the fallback pinValue path from compiling.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Luohaothu and others added 5 commits February 18, 2026 01:31
Escape CMake variable interpolation in generated toolchain template.

Separate debug/release configure presets so Ninja release builds use CMAKE_BUILD_TYPE=Release.
Add OPFLOW_WITH_TECIO toggle and disable TecIO in CI/conda recipe paths.

Guard TecIO-specific test/code paths and allow MPI builds to skip teciompi when unavailable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant