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 futhark build on Darwin #53523

Merged
merged 2 commits into from Jan 7, 2019
Merged

Conversation

jacereda
Copy link
Contributor

@jacereda jacereda commented Jan 6, 2019

Motivation for this change

Futhark won't build on Darwin and there's duplication (obsolete non-hackage package).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Member

@peti peti left a comment

Choose a reason for hiding this comment

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

👍

@basvandijk basvandijk merged commit 8ad610b into NixOS:master Jan 7, 2019
@basvandijk
Copy link
Member

Thanks. The following runs successfully on my Mac Book Pro:

$(nix-build -A haskellPackages.futhark)/bin/futhark --version
Futhark 0.8.1
git: UNKNOWN @ UNKNOWN (UNKNOWN)
Copyright (C) DIKU, University of Copenhagen, released under the ISC license.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

@infinisil
Copy link
Member

Can it compile anything on Darwin though? Just run through the first example on https://futhark-lang.org/examples.html

And what was the error on Darwin?

@jacereda
Copy link
Contributor Author

Works for me with the OpenCL backend. Keep in mind you need to pass arguments on stdin.

@infinisil
Copy link
Member

Odd, because the wrapping thing is not present at all on Darwin now, no idea how it can still work.

@jacereda
Copy link
Contributor Author

I don't know what you mean, can you elaborate?

@infinisil
Copy link
Member

The line in this PR makes it such that on Darwin it uses the unwrapped Futhark package. The wrapping logic under that line will only be applied on non-Darwin. And I added that logic down there to make compiling work, because it didn't work if it wasn't wrapped properly.

@jacereda
Copy link
Contributor Author

Have you tried it on Darwin? What's the error?

@infinisil
Copy link
Member

Um, I thought you were on Darwin, because I asked earlier whether it worked on Darwin and you replied that it does..

@jacereda
Copy link
Contributor Author

I'm on Darwin and it does work for me, I was just asking if it was different for you.

The wrapper isn't needed on Darwin. There's no ocl-icd and everything should be available through OpenCL.framework.

@infinisil
Copy link
Member

Oh I see, no I'm not on darwin.

@jacereda Do you have gcc or clang in your PATH though? Because that's another thing the wrapper does for you. Try compiling a Futhark program with export PATH="" beforehand

@jacereda
Copy link
Contributor Author

It's finding impure dependencies, it will run if you leave /usr/bin in the path.

@infinisil
Copy link
Member

Yeah but we don't want impure dependencies in Nix. If somebody doesn't have gcc/clang installed, the program should still run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants