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

Compiling with stable Rust #69

Open
IT302 opened this issue Jun 27, 2015 · 5 comments
Open

Compiling with stable Rust #69

IT302 opened this issue Jun 27, 2015 · 5 comments

Comments

@IT302
Copy link

IT302 commented Jun 27, 2015

I am evaluating writing a project in Rust instead of C++. I am not sure if rust-opencl works with the stable Rust compilers. I have tried compiling rust-opencl with rustc 1.1.0 but I am getting "unstable feature" error.

Thanks,

Geoffrey

@krupitskas
Copy link

+1

[warezovvv@atlas rust-opencl]$ cargo build
   Compiling opencl v0.3.0-dev (file:///home/warezovvv/Documents/Work/Projects/Robotics/rust-opencl)
src/lib.rs:5:1: 5:22 error: unstable feature
src/lib.rs:5 #![feature(std_misc)]
             ^~~~~~~~~~~~~~~~~~~~~
note: this feature may not be used in the stable release channel
error: aborting due to previous error
Could not compile `opencl`.

To learn more, run the command again with --verbose.

@Kerollmops
Copy link

If you want to be more efficient you can install (from brew for example) multirust github, brew formula.
Don't forget too uninstall rust previously, (multirust installation is really fast), it install cargo too
With this formula you will be capable to use any version of rust you want in all your computer (default rust) and another version for the directories you want (override) (for example nightly version).

rust-opencl compile with nightly version (cf. 60d5956)

@Razican
Copy link

Razican commented Sep 16, 2015

I'd really like to see this in stable rust :)

@eholk
Copy link
Collaborator

eholk commented Sep 17, 2015

One thing holding this back right now is needing static mutexes. It looks like some OpenCL implementations do not properly handle multiple calls into the API, so we use a mutex to work around this.

static mut platforms_mutex: std::sync::StaticMutex = std::sync::MUTEX_INIT;

It may be that OpenCL implementations are better now than when we added that code, or maybe we can just decide not to support broken implementations. I'm not sure whether calling clGetPlatformsIDs from multiple threads at once is in spec.

eholk added a commit to eholk/rust-opencl that referenced this issue Sep 17, 2015
Removed the mutex around clGetPlatformIDs, which may cause instability on some platforms. Also commented out the memory tests because they use slice_bytes.
@eholk
Copy link
Collaborator

eholk commented Sep 17, 2015

I just started a branch that compiles on stable Rust: https://github.com/eholk/rust-opencl/tree/rust-stable

I removed the platform lock, so we'll need some testing and experimentation to see if that was safe. Also, I commented out the memory tests because they use slice_bytes. We should see if we can rewrite the tests not to use slice_bytes.

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

No branches or pull requests

5 participants