Installing software in your home directory/fr: Difference between revisions

Jump to navigation Jump to search
Updating to match new version of source page
No edit summary
(Updating to match new version of source page)
Line 19: Line 19:
Si d'autres erreurs surviennent, contactez [mailto:support@computecanada.ca support@calculcanada.ca]. Pour les détails, consultez les pages  [https://docs.computecanada.ca/wiki/Make/fr Make], [https://docs.computecanada.ca/wiki/Autotools/fr Autotools] et [https://docs.computecanada.ca/wiki/CMake/fr CMake].
Si d'autres erreurs surviennent, contactez [mailto:support@computecanada.ca support@calculcanada.ca]. Pour les détails, consultez les pages  [https://docs.computecanada.ca/wiki/Make/fr Make], [https://docs.computecanada.ca/wiki/Autotools/fr Autotools] et [https://docs.computecanada.ca/wiki/CMake/fr CMake].


<div class="mw-translate-fuzzy">
==Utiliser les libraries==
==Utiliser les libraries==
Le moyen le plus simple pour utiliser une librairie est habituellement de charger d'abord le module correspondant avec
Le moyen le plus simple pour utiliser une librairie est habituellement de charger d'abord le module correspondant avec
Line 25: Line 26:
{{Commande|gcc -o my_prog file1.o file2.o -llapack -lblas}}
{{Commande|gcc -o my_prog file1.o file2.o -llapack -lblas}}
pour lier les librairies LAPACK et BLAS. Sur la ligne pour le lien, le nom de la librairie doit être préfixé par <tt>-l</tt>; il s'agit d'un fichier de type <tt>.a</tt> ou <tt>.so</tt>. Vous trouverez dans la documentation relative à la librairie le nom de ce fichier et l'ordre dans lequel les liens doivent être établis dans les cas où vous avez plusieurs de ces fichiers. Le module pour la librairie doit être chargé pour effectuer le ''build'', mais aussi pour exécuter l'application compilée à l'aide de la librairie.
pour lier les librairies LAPACK et BLAS. Sur la ligne pour le lien, le nom de la librairie doit être préfixé par <tt>-l</tt>; il s'agit d'un fichier de type <tt>.a</tt> ou <tt>.so</tt>. Vous trouverez dans la documentation relative à la librairie le nom de ce fichier et l'ordre dans lequel les liens doivent être établis dans les cas où vous avez plusieurs de ces fichiers. Le module pour la librairie doit être chargé pour effectuer le ''build'', mais aussi pour exécuter l'application compilée à l'aide de la librairie.
</div>
With the module loaded, you can now modify the link phase of your build process to include the library, for example
{{Command|gcc -o my_prog file1.o file2.o -llapack -lblas}}
if I wanted to link with the LAPACK and BLAS libraries.
The link line needs to contain <tt>-l</tt> prefixed to the library name, which will be a file that has the extension <tt>.a</tt> or <tt>.so</tt>. The documentation for the library will typically inform you of the name of this file and, if there are more than one such file (as may be the case), the order in which they should be linked.
You will also need to load the library module when you wish to run this software, not only during the building of it.
Note that a library [[Using modules | modulefile]] will set environment variables <tt>CPATH</tt> and <tt>LIBRARY_PATH</tt> pointing to the location of the library itself and its include files. These environment variables are supported by most compilers (for example, [https://software.intel.com/en-us/node/522775 Intel] and [https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html GCC]), which will automatically try the directories listed in those environment variables during compilation and linking phases. This feature allows you you to easily link against the library without specifying its location explicitly by passing the <tt>-I</tt> and <tt>-L</tt> options to the compiler. If your make- or a config- file calls for an explicit location of the library to pass it to the compiler via those flags, you can safely skip setting those parameters altogether (usually by leaving the location of the library blank in a config file).


== BLAS/LAPACK et MKL ==
== BLAS/LAPACK et MKL ==
35,719

edits

Navigation menu