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

Support default lib paths for m1 macs and MacPorts installations #186

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

ttytm
Copy link
Member

@ttytm ttytm commented Oct 25, 2023

Currently, when trying to run e.g., examples/mpi_basic_example/main.v on my m1 mac I'm getting:

/Users/t/.vmodules/vsl/mpi/cmpi.h:4:10: fatal error: 'mpi.h' file not found
#include "mpi.h"
         ^~~~~~~
1 error generated.
...
==================
(Use `v -cg` to print the entire error message)

builder error: 
==================

The changes in this PR add support for the default m1 library install paths and allow to compile it.

As ref., V does this kind of imports e.g. here:
https://github.com/vlang/v/blob/25f54669e25c58a6d6b62e670ec8940ed542f386/vlib/net/openssl/c.v#L19-L27

Alternatively, vdocs have a short mention about the differing paths for macos https://github.com/vlang/v/blob/25f54669e25c58a6d6b62e670ec8940ed542f386/examples/call_v_from_c/README.md#on-mac-osx.

Summary by CodeRabbit

  • Chore: Enhanced compatibility across different operating systems including Linux, FreeBSD, OpenBSD, and macOS. This update ensures smoother build processes and proper functioning of the software on these platforms.
  • New Feature: Added support for Intel, M1 brew, and MacPorts paths. This change improves the software's adaptability and ensures it can be compiled and linked correctly on a wider range of systems.
  • Maintenance: Updated the compiler flags to include or exclude certain directories, enhancing the reliability and performance of the software across different operating systems.

@coderabbitai
Copy link

coderabbitai bot commented Oct 25, 2023

Walkthrough

The changes across the files primarily focus on updating compiler flags for different operating systems, including Linux, FreeBSD, OpenBSD, and macOS. The updates add additional include and library paths for Intel, M1 brew, and MacPorts, ensuring proper compilation and linking across various platforms.

Changes

File(s) Summary
fft/_cflags.c.v, mpi/_cflags.c.v Updated flags for Linux, FreeBSD, OpenBSD, and macOS. Added paths for Intel, M1 brew, and MacPorts to ensure proper compilation and linking.
inout/h5/_cflags.c.v Added include and library paths for darwin platform, including paths for Intel, M1 brew, and MacPorts, to ensure correct compilation and linking.
vlas/cflags_d_cblas.v, vlas/cflags_notd_cblas.v Added additional paths for include and library directories for different platforms (Intel, M1 brew, and MacPorts) in the macOS section.

🐇

In the land of code, where the shadows lie,

The rabbit hops, under the binary sky.

Paths are laid, for the brew and port,

Ensuring compilation is of the right sort.

Flags are raised, for each OS in sight,

Guiding the code, through the build night.

So, celebrate the changes, for they are fine,

In the land of code, where the bits align. 🎉


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.json

@ttytm ttytm changed the title jjSupport default lib paths for m1 macs and MacPorts installations Support default lib paths for m1 macs and MacPorts installations Oct 25, 2023
Copy link

@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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 7d5ee50 and c68ba7b.
Files selected for processing (5)
  • fft/_cflags.c.v (1 hunks)
  • inout/h5/_cflags.c.v (1 hunks)
  • mpi/_cflags.c.v (1 hunks)
  • vlas/cflags_d_cblas.v (1 hunks)
  • vlas/cflags_notd_cblas.v (1 hunks)
Files skipped from review due to trivial changes (5)
  • fft/_cflags.c.v
  • inout/h5/_cflags.c.v
  • mpi/_cflags.c.v
  • vlas/cflags_d_cblas.v
  • vlas/cflags_notd_cblas.v

@ulises-jeremias ulises-jeremias merged commit c806a5a into vlang:main Oct 25, 2023
9 checks passed
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.

2 participants