Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added arm and aarch64 builds #51184

Merged
merged 8 commits into from
Oct 7, 2024
Merged

Conversation

kowallus
Copy link
Contributor

@kowallus kowallus commented Oct 6, 2024

added arm and aarch64 builds to mbgc recipe


Please read the guidelines for Bioconda recipes before opening a pull request (PR).

General instructions

  • If this PR adds or updates a recipe, use "Add" or "Update" appropriately as the first word in its title.
  • New recipes not directly relevant to the biological sciences need to be submitted to the conda-forge channel instead of Bioconda.
  • PRs require reviews prior to being merged. Once your PR is passing tests and ready to be merged, please issue the @BiocondaBot please add label command.
  • Please post questions on Gitter or ping @bioconda/core in a comment.

Instructions for avoiding API, ABI, and CLI breakage issues

Conda is able to record and lock (a.k.a. pin) dependency versions used at build time of other recipes.
This way, one can avoid that expectations of a downstream recipe with regards to API, ABI, or CLI are violated by later changes in the recipe.
If not already present in the meta.yaml, make sure to specify run_exports (see here for the rationale and comprehensive explanation).
Add a run_exports section like this:

build:
  run_exports:
    - ...

with ... being one of:

Case run_exports statement
semantic versioning {{ pin_subpackage("myrecipe", max_pin="x") }}
semantic versioning (0.x.x) {{ pin_subpackage("myrecipe", max_pin="x.x") }}
known breakage in minor versions {{ pin_subpackage("myrecipe", max_pin="x.x") }} (in such a case, please add a note that shortly mentions your evidence for that)
known breakage in patch versions {{ pin_subpackage("myrecipe", max_pin="x.x.x") }} (in such a case, please add a note that shortly mentions your evidence for that)
calendar versioning {{ pin_subpackage("myrecipe", max_pin=None) }}

while replacing "myrecipe" with either name if a name|lower variable is defined in your recipe or with the lowercase name of the package in quotes.

Bot commands for PR management

Please use the following BiocondaBot commands:

Everyone has access to the following BiocondaBot commands, which can be given in a comment:

@BiocondaBot please update Merge the master branch into a PR.
@BiocondaBot please add label Add the please review & merge label.
@BiocondaBot please fetch artifacts Post links to CI-built packages/containers.
You can use this to test packages locally.

Note that the @BiocondaBot please merge command is now depreciated. Please just squash and merge instead.

Also, the bot watches for comments from non-members that include @bioconda/<team> and will automatically re-post them to notify the addressed <team>.

Copy link
Contributor

coderabbitai bot commented Oct 6, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces changes across multiple files to address build issues related to the asmlib library for macOS builds. In MBGC_Encoder.cpp, SlidingWindowSparseEMMatcher.cpp, and MBGC_Decoder.cpp, the preprocessor directive for including asmlib.h is modified to always evaluate to false, preventing its inclusion. In helper.h and helper.cpp, the condition for ARM-specific code is set to always evaluate to true, ensuring the A_memcpy function is defined regardless of architecture. Additionally, the CMakeLists.txt file has been updated to comment out the linking of the ASM_LIB library for macOS.

The build.sh script has been restructured to improve its functionality, including updates to environment variables and a conditional check for macOS to set CONFIG_ARGS. The CMake command has been enhanced to specify source and build directories explicitly. The meta.yaml file has been updated to increment the build number, add libgomp as a requirement for Linux, and modify license information. A new patches section has been introduced, and additional platforms have been specified.

Possibly related PRs

Suggested labels

please review & merge, aarch64, osx-arm64

Suggested reviewers

  • bgruening

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c83cc8a and fba1fe4.

📒 Files selected for processing (1)
  • recipes/mbgc/asmlib_off.patch (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • recipes/mbgc/asmlib_off.patch

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (3)
recipes/mbgc/meta.yaml (1)

27-27: Remove trailing spaces.

There are trailing spaces on this line. While this doesn't affect functionality, it's good practice to remove them for consistency and to avoid potential issues in some systems.

Please remove the trailing spaces from this line.

🧰 Tools
🪛 yamllint

[error] 27-27: trailing spaces

(trailing-spaces)

recipes/mbgc/build.sh (2)

16-19: Simplify CMake command and verify compiler settings

The CMake command is explicit, but there are a couple of considerations:

  • If ${CXX} is the default compiler, specifying -DCMAKE_CXX_COMPILER="${CXX}" may be unnecessary.
  • Since CXXFLAGS already includes the include path, and CMake typically handles compiler flags, you might simplify the command.

Consider simplifying the CMake command:

 cmake -S . -B build -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-	-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER="${CXX}" \
-	-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
+	-DCMAKE_BUILD_TYPE=Release \
 	"${CONFIG_ARGS}"

This assumes that the default compiler and flags are appropriately set by the environment and that no special compiler options are needed.


22-23: Set executable permissions using CMake

If you prefer to keep manual installation steps, consider setting the executable permissions within the CMake configuration to avoid the need for a separate chmod command.

In your CMakeLists.txt, you can add the following to set the permissions:

set_target_properties(mbgc PROPERTIES
    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
    OUTPUT_NAME "mbgc"
    INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib"
    INSTALL_RPATH_USE_LINK_PATH TRUE
    INSTALL_MODE OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)

This way, when you build the target, the permissions are set correctly.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between eefcbe7 and 798096a.

📒 Files selected for processing (2)
  • recipes/mbgc/build.sh (1 hunks)
  • recipes/mbgc/meta.yaml (2 hunks)
🧰 Additional context used
🪛 yamllint
recipes/mbgc/meta.yaml

[error] 27-27: trailing spaces

(trailing-spaces)

🔇 Additional comments (8)
recipes/mbgc/meta.yaml (6)

8-8: Build number increment looks good.

The build number has been correctly incremented from 0 to 1. This is appropriate when making changes to a package without changing its version.


34-34: License information updates are appropriate and improve clarity.

The changes to the license information are positive:

  1. The license is now specified as "GPL-3.0-or-later", which follows the SPDX identifier standard and is more precise.
  2. The license family update to "GPL3" is consistent with the license change.

These modifications enhance the clarity and standardization of the license information.

Also applies to: 36-36


38-38: Addition of dev_url is beneficial.

The inclusion of the dev_url field, pointing to the GitHub repository, is a positive change. It improves the package metadata by providing a direct link to the development repository, making it easier for users to find the source code and potentially contribute to the project.


41-43: Addition of ARM and AArch64 platforms is aligned with PR objectives.

The inclusion of linux-aarch64 and osx-arm64 as additional platforms is consistent with the PR's goal of adding ARM and AArch64 architecture builds. This expands the package's compatibility to include these important architectures.

To ensure proper support for these new platforms, please verify:

  1. The build system (CMake in this case) is configured to support cross-compilation for these architectures.
  2. Any architecture-specific code or optimizations are properly handled.

You may want to run test builds for these platforms to confirm everything works as expected.


46-47: Addition of DOI identifier is valuable.

The inclusion of the DOI (Digital Object Identifier) in the identifiers field is a positive addition. This improves the package metadata by providing a persistent identifier for academic citation and tracking purposes. It will make it easier for users to cite the software in academic contexts, potentially increasing its visibility and impact in the scientific community.


23-23: Addition of libgomp dependency for Linux looks appropriate.

The inclusion of libgomp as both a host and run dependency for Linux platforms is correct. This suggests that the package now requires OpenMP support on Linux.

To ensure this addition is necessary, please run the following script:

If the script finds OpenMP usage, the addition is justified. If not, consider removing this dependency.

Also applies to: 25-26

recipes/mbgc/build.sh (2)

7-8: Correct usage of compiler and linker flags

Appending ${PREFIX}/include to CXXFLAGS and ${PREFIX}/lib to LDFLAGS ensures that the compiler and linker can find the necessary headers and libraries during the build process.


10-14: Appropriate configuration for macOS builds

The conditional setting of CONFIG_ARGS for macOS using -DCMAKE_FIND_FRAMEWORK=NEVER and -DCMAKE_FIND_APPBUNDLE=NEVER correctly prevents CMake from searching for frameworks and app bundles, which is suitable for this build.

Comment on lines +5 to +6
export INCLUDES="-I${PREFIX}/include"
export LIBPATH="-L${PREFIX}/lib"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Unused environment variables INCLUDES and LIBPATH

The environment variables INCLUDES and LIBPATH are defined but not used elsewhere in the script. These variables can be removed to simplify the script and avoid confusion.

Apply this diff to remove the unused variables:

-export INCLUDES="-I${PREFIX}/include"
-export LIBPATH="-L${PREFIX}/lib"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export INCLUDES="-I${PREFIX}/include"
export LIBPATH="-L${PREFIX}/lib"

Comment on lines +22 to +23
chmod 0755 build/mbgc
cp -rf build/mbgc $PREFIX/bin
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Use cmake --install for installation

Instead of manually setting permissions and copying the binary, you can use cmake --install to handle the installation process. This ensures that any additional installation steps defined in the CMakeLists.txt are executed correctly.

Replace the manual install steps with:

-chmod 0755 build/mbgc
-cp -rf build/mbgc $PREFIX/bin
+cmake --install build

This change assumes that the install target is properly configured in your CMakeLists.txt file.

Committable suggestion was skipped due to low confidence.

@kowallus kowallus closed this Oct 7, 2024
@kowallus kowallus reopened this Oct 7, 2024
@martin-g
Copy link
Contributor

martin-g commented Oct 7, 2024

The failure on OSX is caused due to missing value for LIBOMP_DIRECTORY at https://github.com/kowallus/mbgc/blob/46d8c6b08507272a2eb2b551c0b16c0caed2fe90/CMakeLists.txt#L88

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
recipes/mbgc/meta.yaml (2)

25-25: LGTM: Addition of libgomp for Linux is appropriate.

The inclusion of libgomp as a host requirement for Linux platforms is correct and consistent with the existing llvm-openmp requirement for macOS. This ensures proper OpenMP support across different platforms.

Consider adding a comment explaining why these OpenMP libraries are needed, for clarity:

- llvm-openmp  # [osx] # OpenMP support for macOS
- libgomp  # [linux] # OpenMP support for Linux

39-40: LGTM: Metadata updates enhance package information and discoverability.

The changes to the metadata are comprehensive and valuable:

  1. The summary now properly ends with a period.
  2. The addition of a dev_url provides a direct link to the development repository.
  3. Specifying additional platforms (linux-aarch64 and osx-arm64) aligns with the PR objective of adding ARM and AArch64 builds.
  4. The recipe-maintainers field replaces the previous maintainers field, which is the correct format for Conda-forge recipes.
  5. The inclusion of a DOI in the identifiers field enhances the package's discoverability and citability.

These updates significantly improve the package's metadata.

Consider adding a doc_url field if documentation is available separately from the dev_url.

Also applies to: 43-49

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f6bfa69 and f6bf451.

📒 Files selected for processing (2)
  • recipes/mbgc/libamac64.a.patch (1 hunks)
  • recipes/mbgc/meta.yaml (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • recipes/mbgc/libamac64.a.patch
🧰 Additional context used
🔇 Additional comments (5)
recipes/mbgc/meta.yaml (5)

8-8: LGTM: Build number increment is appropriate.

The build number has been correctly incremented from 0 to 1. This is the expected practice when modifying a recipe without changing the package version.


27-28: LGTM: Inclusion of OpenMP libraries in run requirements is correct.

The addition of llvm-openmp for macOS and libgomp for Linux in the run requirements is appropriate. This ensures that the necessary OpenMP support is available at runtime, maintaining consistency with the host requirements and guaranteeing runtime compatibility across different platforms.


36-36: LGTM: License information updates are accurate and follow best practices.

The changes to the license information are appropriate:

  1. Updating the license to "GPL-3.0-or-later" follows the SPDX identifier format, which is a best practice for specifying licenses.
  2. Changing the license family to "GPL3" is consistent with the updated license.

These modifications provide more precise and standardized license information for the package.

Also applies to: 38-38


Line range hint 1-49: Summary: Recipe updates successfully incorporate ARM builds and improve metadata.

This review confirms that the changes to the meta.yaml file successfully address the PR objective of incorporating ARM and AArch64 builds. The recipe has been updated with:

  1. Proper build number increment.
  2. Addition of a patch for macOS x86_64 (though more information is needed).
  3. Inclusion of necessary OpenMP libraries for different platforms.
  4. More precise license specification.
  5. Comprehensive metadata updates, including support for ARM architectures.

These changes adhere to Conda packaging best practices and significantly improve the recipe. Minor suggestions have been made for further enhancements, but overall, the updates are well-implemented and ready for integration.

To fully address the PR objectives, ensure that the build.sh script (not reviewed here) properly handles the build process for the new architectures.


11-12: Please provide more information about the patch.

A new patch libamac64.a.patch has been added for macOS on x86_64 architecture. While the conditional application is correct, it would be helpful to understand:

  1. What specific issue does this patch address?
  2. Is there a corresponding issue or pull request in the upstream repository?

Consider adding a comment in the recipe to explain the purpose of this patch for future maintainers.

To verify the existence and content of the patch file, please run:

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (5)
recipes/mbgc/asmlib_off.patch (5)

15-16: Approved: Disabling asmlib inclusion.

The change effectively disables the inclusion of the asmlib library for all architectures, which aligns with the PR objective of avoiding build problems on macOS.

Consider adding a comment explaining why asmlib is disabled:

-#if !defined(__arm__) && !defined(__aarch64__) && !defined(__ARM_ARCH)
+#if false  // Disable asmlib to avoid build problems on macOS

32-33: Approved: Consistent disabling of asmlib inclusion.

This change is consistent with the modification in MBGC_Encoder.cpp, ensuring that asmlib is not included across the codebase.

For consistency, consider adding the same comment as suggested for MBGC_Encoder.cpp:

-#if !defined(__arm__) && !defined(__aarch64__) && !defined(__ARM_ARCH)
+#if false  // Disable asmlib to avoid build problems on macOS

49-50: Approved: Ensuring A_memcpy declaration for all architectures.

This change ensures that the A_memcpy function declaration is always included, providing consistent behavior across all architectures.

Consider adding a comment explaining the change:

-#if defined(__arm__) || defined(__aarch64__) || defined(__ARM_ARCH)
+#if true  // Include A_memcpy for all architectures to ensure consistent behavior

66-67: Approved: Consistent inclusion of A_memcpy implementation.

This change is consistent with the modification in helper.h, ensuring that the A_memcpy function implementation is always included.

For consistency, consider adding the same comment as suggested for helper.h:

-#if defined(__arm__) || defined(__aarch64__) || defined(__ARM_ARCH)
+#if true  // Include A_memcpy for all architectures to ensure consistent behavior

83-84: Approved with suggestion: Prevent linking against ASM_LIB.

Commenting out the link_libraries(${ASM_LIB}) command effectively prevents linking against asmlib for all builds, which is consistent with the other changes. However, using CMake's conditional statements would be a more robust solution.

Consider using a CMake option to control asmlib linking:

option(USE_ASMLIB "Use asmlib" OFF)
if(USE_ASMLIB)
    link_libraries(${ASM_LIB})
endif()

This approach allows easier toggling of asmlib usage if needed in the future.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 0c7c647 and 33d88fa.

📒 Files selected for processing (2)
  • recipes/mbgc/asmlib_off.patch (1 hunks)
  • recipes/mbgc/meta.yaml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • recipes/mbgc/meta.yaml
🧰 Additional context used
🔇 Additional comments (1)
recipes/mbgc/asmlib_off.patch (1)

1-87: Overall patch review: Effectively disables asmlib usage.

This patch successfully addresses the objective of disabling asmlib usage to avoid build problems on macOS. The changes are consistent across multiple files, ensuring that asmlib is not included or linked in the build process.

While the changes achieve their purpose, consider implementing the suggested improvements:

  1. Add explanatory comments to the preprocessor directives for better code readability.
  2. Use a CMake option for more flexible control over asmlib usage in the build system.

These enhancements will improve code maintainability and provide more explicit control over the build configuration.

@kowallus
Copy link
Contributor Author

kowallus commented Oct 7, 2024

@BiocondaBot please add label

@BiocondaBot BiocondaBot added the please review & merge set to ask for merge label Oct 7, 2024
@kowallus
Copy link
Contributor Author

kowallus commented Oct 7, 2024

The failure on OSX is caused due to missing value for LIBOMP_DIRECTORY at https://github.com/kowallus/mbgc/blob/46d8c6b08507272a2eb2b551c0b16c0caed2fe90/CMakeLists.txt#L88

Thanks @martin-g . cmake surely could be better, but it was not the failure cause.

@kowallus kowallus deleted the update_mbgc201_recipe branch November 20, 2024 21:01
@kowallus kowallus restored the update_mbgc201_recipe branch November 20, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
please review & merge set to ask for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants