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

lacaml: init at 11.0.3 #57954

Merged
merged 1 commit into from Mar 24, 2019
Merged

lacaml: init at 11.0.3 #57954

merged 1 commit into from Mar 24, 2019

Conversation

rixed
Copy link
Contributor

@rixed rixed commented Mar 20, 2019

Motivation for this change

Addition of lacaml, the OCaml binding to lapack/blas

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.

@vbgl
Copy link
Contributor

vbgl commented Mar 24, 2019

@GrahamcOfBorg build ocamlPackages.lacaml

@vbgl vbgl merged commit 0206adc into NixOS:master Mar 24, 2019
@rixed rixed deleted the lacaml branch March 24, 2019 18:52
[ ocaml findlib dune base stdio liblapack blas ] ++
stdenv.lib.optionals stdenv.isDarwin
[ darwin.apple_sdk.frameworks.Accelerate ];

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vbgl: shouldn't liblapack and blas be listed in propagatedBuildInputs instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

Don’t know. Do you have a test case?

Copy link
Contributor Author

@rixed rixed Mar 27, 2019

Choose a reason for hiding this comment

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

I have a private nixpkgs with a package depending on lacaml, and I had to manually add -lblas in order to build it, or the build would fail with "-lblas: cannot find blas library". I then read a bit about propagatedBuildInputs, changed my local version of lacaml like this:

     sha256 = "1aflg07cc9ak9mg1cr0qr368c9s141glwlarl5nhalf6hhq7ibcb";
   };
 
-  buildInputs =
-    [ ocaml findlib dune base stdio liblapack blas ] ++
+  buildInputs = [ ocaml findlib dune base stdio ];
+  propagatedBuildInputs = [ liblapack blas ] ++
     stdenv.lib.optionals stdenv.isDarwin
       [ darwin.apple_sdk.frameworks.Accelerate ];

and it worked.
Note that my understanding of propagatedBuildInputs, esp. in the context of OCaml, is very limited.

Initially, I though the full path to the blas library would be recorded in the lacaml cmxa, but ocamlobjinfo reveals that only -cclib -lblas is recorded there, which prevent nix to automatically record the dependency, I guess.

Other packages (including zmq) seems to use propagatedBuildInputs, I guess for this reason.

Shall I open a PR for that change to lacaml?

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

3 participants