Skip to content

Commit 90c253a

Browse files
committed
Add CDT docs written by @isuruf
1 parent e8247b0 commit 90c253a

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

src/maintainer/knowledge_base.rst

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,58 @@ as opposed to generating feedstocks for them. (Note that historically we did use
369369
practice has been deprecated.) To add a new CDT, make a PR on the
370370
`conda-forge/cdt-builds <https://github.com/conda-forge/cdt-builds>`__ repo.
371371

372+
Why are CDTs bad?
373+
^^^^^^^^^^^^^^^^^
374+
375+
1. CDTs repackage old versions of the library.
376+
2. As a result, newer functionality in the packages won't be used by downstream conda packages
377+
which check for the version of the library being built against.
378+
For example: OpenGL functionality from the CentOS 6/7 packaged library is available, but
379+
any newer functionality cannot be used.
380+
3. We have no guarantees that the version provided by the user's system is compatible.
381+
We only have the ``__glibc>=2.17`` constraint and we assume that CentOS 6/7's
382+
lower bound of GLIBC and its corresponding lower bound of the CDT are equivalent.
383+
4. We have no guarantee that the library is provided by the user's system at all.
384+
385+
When should CDTs be used?
386+
^^^^^^^^^^^^^^^^^^^^^^^^^
387+
388+
1. When there are system specific configurations are used by the library.
389+
Some examples include:
390+
391+
a. OpenGL: if we provided the OpenGL loader library ``libglvnd``.
392+
and the user's system is not using ``libglvnd``, then we cannot load the vendor-specific
393+
implementations losing out on accelerator/hardware optimized performance.
394+
(This is only on old distributions and we may finally be able to package ``libglvnd``
395+
ourselves)
396+
b. linux-pam: This is a library that allows pluggable authentication modules and the
397+
configuration files for these modules usually live in ``/etc/pam.d``. The issue is that
398+
the pluggable modules live in a distro specific location. For example:
399+
``/usr/lib/x86_64-linux-gnu/security/``. The default modules are built into the
400+
conda package in ``$CONDA_PREFIX/lib/security``, but custom ones for
401+
system-wide configuration are installed into ``/usr/lib/x86_64-linux-gnu/security/``.
402+
So, we would need to patch the module to look into both, but the directory
403+
``/usr/lib/x86_64-linux-gnu/security/`` is distro specific and will be hard to
404+
detect.
405+
406+
2. When a conda packaged library will not work properly.
407+
For example: a new ``glibc`` package means we would have to edit the elf interpreter of
408+
all the conda package binaries.
409+
410+
What's are some good examples?
411+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
412+
413+
1. The OpenCL loader (``ocl-icd`` together with ``ocl-icd-system``) provides an OpenCL
414+
loading library. The loader will look at OpenCL implementations given in
415+
``$CONDA_PREFIX/etc/OpenCL/vendors``.
416+
For example: Pocl is a conda packaged implementation that runs OpenCL on the CPU. Vendor
417+
specific implementations like the NVIDIA OpenCL or ROCm OpenCL are not conda packaged, so we
418+
have to rely on the system. By installing ``ocl-icd-system`` we enable the loader to look at
419+
the configuration in ``/etc/OpenCL/vendors``, which is the configuration directory for all linux
420+
distributions. This gives us the best of both worlds. You don't need a system level package to
421+
run OpenCL because we have a conda packaged installation, but if there is a system wide
422+
implementation that is accelerated by specific hardware, we can use those.
423+
372424
In ``conda-forge`` the primary usages of CDTs is currently for packages that link against libGL.
373425

374426
libGL

0 commit comments

Comments
 (0)