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

Fix opencl usage and example compilation on macOS #185

Merged
merged 4 commits into from
Oct 25, 2023

Conversation

ttytm
Copy link
Member

@ttytm ttytm commented Oct 24, 2023

This PR should fix opencl usage on macOS.

Now it should be possible to run the opencl examples that used to fail macos. They run locally tested on my mac machine.

But I think the example compilation via the script is false positive. E.g., on my linux main machine I can compile the opencl examples but it's not possible to run them.

I'd address a CI improvement in a separate PR.

Summary by CodeRabbit

  • New Feature: Enhanced compatibility with Apple systems, ensuring a smoother and more reliable user experience on these devices.
  • Test: Expanded our testing scope to include examples, providing a more comprehensive evaluation of our software's performance and functionality.
  • Chore: Updated our CI/CD pipeline to install necessary packages, improving the efficiency and reliability of our development process.

Please note, these changes may not directly impact the user interface but contribute to the overall performance and reliability of our software.

@coderabbitai
Copy link

coderabbitai bot commented Oct 24, 2023

Walkthrough

This pull request introduces changes to the CI/CD pipeline, compilation process, and platform-specific code adjustments for Apple systems. The modifications aim to enhance the project's compatibility with OpenCL libraries and Apple platforms, and to include examples in the test suite.

Changes

File Summary
.github/workflows/ci.yml Adds a step to install opencl-headers using Homebrew and removes --skip-examples flag from test commands.
bin/test Adds -d dlopencl flag to the compilation command, likely related to dynamic loading of OpenCL libraries.
vcl/vcl.h Changes the preprocessor directive from #ifdef DARWIN to #ifdef __APPLE__ for better compatibility with Apple systems.

🐇💻

In the land of code, where the shadows lie,

A rabbit hops, under the cloudless sky.

With each hop, a change is made,

In the realm of OpenCL, a foundation is laid.

Tests now run, with examples in sight,

And Apple systems bask in the new light.

So, let's celebrate this code, so fine,

For in the land of GitHub, it's pull request time! 🎉


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

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 ec19b28.
Files selected for processing (3)
  • .github/workflows/ci.yml (1 hunks)
  • bin/test (1 hunks)
  • vcl/vcl.h (1 hunks)
Files skipped from review due to trivial changes (2)
  • .github/workflows/ci.yml
  • vcl/vcl.h
Additional comments: 1
bin/test (1)
  • 68-68: The -d dlopencl flag has been added to the compilation command. This flag is related to the dynamic loading of OpenCL libraries, which is necessary for macOS compatibility. Ensure that this flag does not affect the compilation process on other platforms.
-        v ${flags} -o "${file}.o" "${file}"
+        v ${flags} -d dlopencl -o "${file}.o" "${file}"
Committable suggestion (Beta)
         echo "Compiling ${file}"
         v ${flags} -d dlopencl -o "${file}.o" "${file}"
         echo "${file}.o created"
         echo "Removing ${file}.o"
         rm -f "${file}.o"

@ulises-jeremias ulises-jeremias merged commit 0a5f65b 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