···12901291### How to use Intel's MKL with numpy and scipy?
12921293-A `site.cfg` is created that configures BLAS based on the `blas` parameter of
1294-the `numpy` derivation. By passing in `mkl`, `numpy` and packages depending on
1295-`numpy` will be built with `mkl`.
1296-1297-The following is an overlay that configures `numpy` to use `mkl`:
1298-1299-```nix
1300-self: super: {
1301- python37 = super.python37.override {
1302- packageOverrides = python-self: python-super: {
1303- numpy = python-super.numpy.override {
1304- blas = super.pkgs.mkl;
1305- };
1306- };
1307- };
1308-}
1309-```
1310-1311-`mkl` requires an `openmp` implementation when running with multiple processors.
1312-By default, `mkl` will use Intel's `iomp` implementation if no other is
1313-specified, but this is a runtime-only dependency and binary compatible with the
1314-LLVM implementation. To use that one instead, Intel recommends users set it with
1315-`LD_PRELOAD`.
1316-1317-Note that `mkl` is only available on `x86_64-{linux,darwin}` platforms;
1318-moreover, Hydra is not building and distributing pre-compiled binaries using it.
13191320### What inputs do `setup_requires`, `install_requires` and `tests_require` map to?
1321
···12901291### How to use Intel's MKL with numpy and scipy?
12921293+MKL can be configured using an overlay. See the section “[Using
1294+overlays to configure
1295+alternatives](#sec-overlays-alternatives-blas-lapack)”.
0000000000000000000000012961297### What inputs do `setup_requires`, `install_requires` and `tests_require` map to?
1298
+114
doc/using/overlays.xml
···137 Overlays are similar to other methods for customizing Nixpkgs, in particular the <literal>packageOverrides</literal> attribute described in <xref linkend="sec-modify-via-packageOverrides"/>. Indeed, <literal>packageOverrides</literal> acts as an overlay with only the <varname>super</varname> argument. It is therefore appropriate for basic use, but overlays are more powerful and easier to distribute.
138 </para>
139 </section>
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140</chapter>
···137 Overlays are similar to other methods for customizing Nixpkgs, in particular the <literal>packageOverrides</literal> attribute described in <xref linkend="sec-modify-via-packageOverrides"/>. Indeed, <literal>packageOverrides</literal> acts as an overlay with only the <varname>super</varname> argument. It is therefore appropriate for basic use, but overlays are more powerful and easier to distribute.
138 </para>
139 </section>
140+ <section xml:id="sec-overlays-alternatives">
141+ <title>Using overlays to configure alternatives</title>
142+ <para>
143+ Certain software has different implementations of the same
144+ interface. Other distributions have functionality to switch
145+ between these. For example, Debian provides <link
146+ xlink:href="https://wiki.debian.org/DebianAlternatives">DebianAlternatives</link>.
147+ Nixpkgs has what we call <literal>alternatives</literal>, which
148+ are configured through overlays.
149+ </para>
150+ <section xml:id="sec-overlays-alternatives-blas-lapack">
151+ <title>BLAS/LAPACK</title>
152+ <para>
153+ In Nixpkgs, we have multiple implementations of the BLAS/LAPACK
154+ numerical linear algebra interfaces. They are:
155+ </para>
156+ <itemizedlist>
157+ <listitem>
158+ <para>
159+ <link xlink:href="https://www.openblas.net/">OpenBLAS</link>
160+ </para>
161+ <para>
162+ The Nixpkgs attribute is <literal>openblas</literal> for
163+ ILP64 and <literal>openblasCompat</literal> for LP64. This
164+ is the default.
165+ </para>
166+ </listitem>
167+ <listitem>
168+ <para>
169+ <link xlink:href="http://www.netlib.org/lapack/">LAPACK
170+ reference</link> (also provides BLAS)
171+ </para>
172+ <para>
173+ The Nixpkgs attribute is <literal>lapack-reference</literal>.
174+ </para>
175+ </listitem>
176+ <listitem>
177+ <para>
178+ <link
179+ xlink:href="https://software.intel.com/en-us/mkl">Intel
180+ MKL</link> (only works on x86 architecture, unfree)
181+ </para>
182+ <para>
183+ The Nixpkgs attribute is <literal>mkl</literal>.
184+ </para>
185+ </listitem>
186+ </itemizedlist>
187+ <para>
188+ Introduced in <link
189+ xlink:href="https://github.com/NixOS/nixpkgs/pull/83888">PR
190+ #83888</link>, we are able to override the ‘blas’ and ‘lapack’
191+ packages to use different implementations, through the
192+ ‘blasProvider’ and ‘lapackProvider’ argument. This can be used
193+ to select a different provider. For example, an overlay can be
194+ created that looks like:
195+ </para>
196+ <programlisting>
197+self: super:
198+199+{
200+ blas = super.blas.override {
201+ blasProvider = self.mkl;
202+ }
203+ lapack = super.lapack.override {
204+ lapackProvider = self.mkl;
205+ }
206+}
207+ </programlisting>
208+ <para>
209+ This overlay uses Intel’s MKL library for both BLAS and LAPACK
210+ interfaces. Note that the same can be accomplished at runtime
211+ using <literal>LD_PRELOAD</literal> of libblas.so.3 and
212+ liblapack.so.3.
213+ </para>
214+ <para>
215+ Intel MKL requires an <literal>openmp</literal> implementation
216+ when running with multiple processors. By default,
217+ <literal>mkl</literal> will use Intel’s <literal>iomp</literal>
218+ implementation if no other is specified, but this is a
219+ runtime-only dependency and binary compatible with the LLVM
220+ implementation. To use that one instead, Intel recommends users
221+ set it with <literal>LD_PRELOAD</literal>. Note that
222+ <literal>mkl</literal> is only available on
223+ <literal>x86_64-linux</literal> and
224+ <literal>x86_64-darwin</literal>. Moreover, Hydra is not build
225+ and distributing pre-compiled binaries using it.
226+ </para>
227+ <para>
228+ For BLAS/LAPACK switching to work correctly, all packages must
229+ depend on <literal>blas</literal> or <literal>lapack</literal>.
230+ This ensures that only one BLAS/LAPACK library is used at one
231+ time. There are two versions versions of BLAS/LAPACK currently
232+ in the wild, <literal>LP64</literal> (integer size = 32 bits)
233+ and <literal>ILP64</literal> (integer size = 64 bits). Some
234+ software needs special flags or patches to work with
235+ <literal>ILP64</literal>. You can check if
236+ <literal>ILP64</literal> is used in Nixpkgs with
237+ <varname>blas.isILP64</varname> and
238+ <varname>lapack.isILP64</varname>. Some software does NOT work
239+ with <literal>ILP64</literal>, and derivations need to specify
240+ an assertion to prevent this. You can prevent
241+ <literal>ILP64</literal> from being used with the following:
242+ </para>
243+ <programlisting>
244+{ stdenv, blas, lapack, ... }:
245+246+assert (!blas.isILP64) && (!lapack.isILP64);
247+248+stdenv.mkDerivation {
249+ ...
250+}
251+ </programlisting>
252+ </section>
253+ </section>
254</chapter>
···21 services.yandex-disk = {
2223 enable = mkOption {
24+ type = types.bool;
25 default = false;
26 description = "
27 Whether to enable Yandex-disk client. See https://disk.yandex.ru/
+1
nixos/modules/services/networking/amuled.nix
···16 services.amule = {
1718 enable = mkOption {
019 default = false;
20 description = ''
21 Whether to run the AMule daemon. You need to manually run "amuled --ec-config" to configure the service for the first time.
···16 services.amule = {
1718 enable = mkOption {
19+ type = types.bool;
20 default = false;
21 description = ''
22 Whether to run the AMule daemon. You need to manually run "amuled --ec-config" to configure the service for the first time.
···18 options = {
1920 services.mailpile = {
21- enable = mkOption {
22- default = false;
23- description = "
24- Whether to enable Mailpile the mail client.
25- ";
26- };
27 hostname = mkOption {
28 default = "localhost";
29 description = "Listen to this hostname or ip.";
···18 options = {
1920 services.mailpile = {
21+ enable = mkEnableOption "Mailpile the mail client";
22+000023 hostname = mkOption {
24 default = "localhost";
25 description = "Listen to this hostname or ip.";
+1
nixos/modules/services/networking/ntp/chrony.nix
···30 options = {
31 services.chrony = {
32 enable = mkOption {
033 default = false;
34 description = ''
35 Whether to synchronise your machine's time using chrony.
···30 options = {
31 services.chrony = {
32 enable = mkOption {
33+ type = types.bool;
34 default = false;
35 description = ''
36 Whether to synchronise your machine's time using chrony.
+1
nixos/modules/services/networking/ntp/ntpd.nix
···40 services.ntp = {
4142 enable = mkOption {
043 default = false;
44 description = ''
45 Whether to synchronise your machine's time using ntpd, as a peer in
···40 services.ntp = {
4142 enable = mkOption {
43+ type = types.bool;
44 default = false;
45 description = ''
46 Whether to synchronise your machine's time using ntpd, as a peer in
···24 services.jboss = {
2526 enable = mkOption {
027 default = false;
28 description = "Whether to enable JBoss. WARNING : this package is outdated and is known to have vulnerabilities.";
29 };
···24 services.jboss = {
2526 enable = mkOption {
27+ type = types.bool;
28 default = false;
29 description = "Whether to enable JBoss. WARNING : this package is outdated and is known to have vulnerabilities.";
30 };
···54, less
55}:
5657-assert (!blas.is64bit) && (!lapack.is64bit);
5859# This generates a `sage-env` shell file that will be sourced by sage on startup.
60# It sets up various environment variables, telling sage where to find its
···54, less
55}:
5657+assert (!blas.isILP64) && (!lapack.isILP64);
5859# This generates a `sage-env` shell file that will be sourced by sage on startup.
60# It sets up various environment variables, telling sage where to find its
···23}:
2425# lots of segfaults with (64 bit) blas
26-assert (!blas.is64bit) && (!lapack.is64bit);
2728# Wrapper that combined `sagelib` with `sage-env` to produce an actually
29# executable sage. No tests are run yet and no documentation is built.
···23}:
2425# lots of segfaults with (64 bit) blas
26+assert (!blas.isILP64) && (!lapack.isILP64);
2728# Wrapper that combined `sagelib` with `sage-env` to produce an actually
29# executable sage. No tests are run yet and no documentation is built.
+1-1
pkgs/applications/science/math/sage/sagelib.nix
···53, pplpy
54}:
5556-assert (!blas.is64bit) && (!lapack.is64bit);
5758# This is the core sage python package. Everything else is just wrappers gluing
59# stuff together. It is not very useful on its own though, since it will not
···53, pplpy
54}:
5556+assert (!blas.isILP64) && (!lapack.isILP64);
5758# This is the core sage python package. Everything else is just wrappers gluing
59# stuff together. It is not very useful on its own though, since it will not