···1290129012911291### How to use Intel's MKL with numpy and scipy?
1292129212931293-A `site.cfg` is created that configures BLAS based on the `blas` parameter of
12941294-the `numpy` derivation. By passing in `mkl`, `numpy` and packages depending on
12951295-`numpy` will be built with `mkl`.
12961296-12971297-The following is an overlay that configures `numpy` to use `mkl`:
12981298-12991299-```nix
13001300-self: super: {
13011301- python37 = super.python37.override {
13021302- packageOverrides = python-self: python-super: {
13031303- numpy = python-super.numpy.override {
13041304- blas = super.pkgs.mkl;
13051305- };
13061306- };
13071307- };
13081308-}
13091309-```
13101310-13111311-`mkl` requires an `openmp` implementation when running with multiple processors.
13121312-By default, `mkl` will use Intel's `iomp` implementation if no other is
13131313-specified, but this is a runtime-only dependency and binary compatible with the
13141314-LLVM implementation. To use that one instead, Intel recommends users set it with
13151315-`LD_PRELOAD`.
13161316-13171317-Note that `mkl` is only available on `x86_64-{linux,darwin}` platforms;
13181318-moreover, Hydra is not building and distributing pre-compiled binaries using it.
12931293+MKL can be configured using an overlay. See the section “[Using
12941294+overlays to configure
12951295+alternatives](#sec-overlays-alternatives-blas-lapack)”.
1319129613201297### What inputs do `setup_requires`, `install_requires` and `tests_require` map to?
13211298
+114
doc/using/overlays.xml
···137137 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.
138138 </para>
139139 </section>
140140+ <section xml:id="sec-overlays-alternatives">
141141+ <title>Using overlays to configure alternatives</title>
142142+ <para>
143143+ Certain software has different implementations of the same
144144+ interface. Other distributions have functionality to switch
145145+ between these. For example, Debian provides <link
146146+ xlink:href="https://wiki.debian.org/DebianAlternatives">DebianAlternatives</link>.
147147+ Nixpkgs has what we call <literal>alternatives</literal>, which
148148+ are configured through overlays.
149149+ </para>
150150+ <section xml:id="sec-overlays-alternatives-blas-lapack">
151151+ <title>BLAS/LAPACK</title>
152152+ <para>
153153+ In Nixpkgs, we have multiple implementations of the BLAS/LAPACK
154154+ numerical linear algebra interfaces. They are:
155155+ </para>
156156+ <itemizedlist>
157157+ <listitem>
158158+ <para>
159159+ <link xlink:href="https://www.openblas.net/">OpenBLAS</link>
160160+ </para>
161161+ <para>
162162+ The Nixpkgs attribute is <literal>openblas</literal> for
163163+ ILP64 and <literal>openblasCompat</literal> for LP64. This
164164+ is the default.
165165+ </para>
166166+ </listitem>
167167+ <listitem>
168168+ <para>
169169+ <link xlink:href="http://www.netlib.org/lapack/">LAPACK
170170+ reference</link> (also provides BLAS)
171171+ </para>
172172+ <para>
173173+ The Nixpkgs attribute is <literal>lapack-reference</literal>.
174174+ </para>
175175+ </listitem>
176176+ <listitem>
177177+ <para>
178178+ <link
179179+ xlink:href="https://software.intel.com/en-us/mkl">Intel
180180+ MKL</link> (only works on x86 architecture, unfree)
181181+ </para>
182182+ <para>
183183+ The Nixpkgs attribute is <literal>mkl</literal>.
184184+ </para>
185185+ </listitem>
186186+ </itemizedlist>
187187+ <para>
188188+ Introduced in <link
189189+ xlink:href="https://github.com/NixOS/nixpkgs/pull/83888">PR
190190+ #83888</link>, we are able to override the ‘blas’ and ‘lapack’
191191+ packages to use different implementations, through the
192192+ ‘blasProvider’ and ‘lapackProvider’ argument. This can be used
193193+ to select a different provider. For example, an overlay can be
194194+ created that looks like:
195195+ </para>
196196+ <programlisting>
197197+self: super:
198198+199199+{
200200+ blas = super.blas.override {
201201+ blasProvider = self.mkl;
202202+ }
203203+ lapack = super.lapack.override {
204204+ lapackProvider = self.mkl;
205205+ }
206206+}
207207+ </programlisting>
208208+ <para>
209209+ This overlay uses Intel’s MKL library for both BLAS and LAPACK
210210+ interfaces. Note that the same can be accomplished at runtime
211211+ using <literal>LD_PRELOAD</literal> of libblas.so.3 and
212212+ liblapack.so.3.
213213+ </para>
214214+ <para>
215215+ Intel MKL requires an <literal>openmp</literal> implementation
216216+ when running with multiple processors. By default,
217217+ <literal>mkl</literal> will use Intel’s <literal>iomp</literal>
218218+ implementation if no other is specified, but this is a
219219+ runtime-only dependency and binary compatible with the LLVM
220220+ implementation. To use that one instead, Intel recommends users
221221+ set it with <literal>LD_PRELOAD</literal>. Note that
222222+ <literal>mkl</literal> is only available on
223223+ <literal>x86_64-linux</literal> and
224224+ <literal>x86_64-darwin</literal>. Moreover, Hydra is not build
225225+ and distributing pre-compiled binaries using it.
226226+ </para>
227227+ <para>
228228+ For BLAS/LAPACK switching to work correctly, all packages must
229229+ depend on <literal>blas</literal> or <literal>lapack</literal>.
230230+ This ensures that only one BLAS/LAPACK library is used at one
231231+ time. There are two versions versions of BLAS/LAPACK currently
232232+ in the wild, <literal>LP64</literal> (integer size = 32 bits)
233233+ and <literal>ILP64</literal> (integer size = 64 bits). Some
234234+ software needs special flags or patches to work with
235235+ <literal>ILP64</literal>. You can check if
236236+ <literal>ILP64</literal> is used in Nixpkgs with
237237+ <varname>blas.isILP64</varname> and
238238+ <varname>lapack.isILP64</varname>. Some software does NOT work
239239+ with <literal>ILP64</literal>, and derivations need to specify
240240+ an assertion to prevent this. You can prevent
241241+ <literal>ILP64</literal> from being used with the following:
242242+ </para>
243243+ <programlisting>
244244+{ stdenv, blas, lapack, ... }:
245245+246246+assert (!blas.isILP64) && (!lapack.isILP64);
247247+248248+stdenv.mkDerivation {
249249+ ...
250250+}
251251+ </programlisting>
252252+ </section>
253253+ </section>
140254</chapter>
···2121 services.yandex-disk = {
22222323 enable = mkOption {
2424+ type = types.bool;
2425 default = false;
2526 description = "
2627 Whether to enable Yandex-disk client. See https://disk.yandex.ru/
+1
nixos/modules/services/networking/amuled.nix
···1616 services.amule = {
17171818 enable = mkOption {
1919+ type = types.bool;
1920 default = false;
2021 description = ''
2122 Whether to run the AMule daemon. You need to manually run "amuled --ec-config" to configure the service for the first time.
···1818 options = {
19192020 services.mailpile = {
2121- enable = mkOption {
2222- default = false;
2323- description = "
2424- Whether to enable Mailpile the mail client.
2525- ";
2626- };
2121+ enable = mkEnableOption "Mailpile the mail client";
2222+2723 hostname = mkOption {
2824 default = "localhost";
2925 description = "Listen to this hostname or ip.";
+1
nixos/modules/services/networking/ntp/chrony.nix
···3030 options = {
3131 services.chrony = {
3232 enable = mkOption {
3333+ type = types.bool;
3334 default = false;
3435 description = ''
3536 Whether to synchronise your machine's time using chrony.
+1
nixos/modules/services/networking/ntp/ntpd.nix
···4040 services.ntp = {
41414242 enable = mkOption {
4343+ type = types.bool;
4344 default = false;
4445 description = ''
4546 Whether to synchronise your machine's time using ntpd, as a peer in
···2424 services.jboss = {
25252626 enable = mkOption {
2727+ type = types.bool;
2728 default = false;
2829 description = "Whether to enable JBoss. WARNING : this package is outdated and is known to have vulnerabilities.";
2930 };
···5454, less
5555}:
56565757-assert (!blas.is64bit) && (!lapack.is64bit);
5757+assert (!blas.isILP64) && (!lapack.isILP64);
58585959# This generates a `sage-env` shell file that will be sourced by sage on startup.
6060# It sets up various environment variables, telling sage where to find its
···2323}:
24242525# lots of segfaults with (64 bit) blas
2626-assert (!blas.is64bit) && (!lapack.is64bit);
2626+assert (!blas.isILP64) && (!lapack.isILP64);
27272828# Wrapper that combined `sagelib` with `sage-env` to produce an actually
2929# executable sage. No tests are run yet and no documentation is built.
+1-1
pkgs/applications/science/math/sage/sagelib.nix
···5353, pplpy
5454}:
55555656-assert (!blas.is64bit) && (!lapack.is64bit);
5656+assert (!blas.isILP64) && (!lapack.isILP64);
57575858# This is the core sage python package. Everything else is just wrappers gluing
5959# stuff together. It is not very useful on its own though, since it will not