Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29001 Discussions

How get intel libraries on linux path so users can run programs without running setvars.sh?

crobar
Novice
648 Views

I'm using OneAPi compilers installed on Ubuntu using APT as per the standard instructions. I have successfully build a program which uses the mkl and iomp libraries. However, I cannot run these programs (without sourcing setvars.sh) as the intel libraries are not in the path. What are the recommended steps for allowing all users on the system to be able to run the programs?

I tried adding source /opt/intel/oneapi/setvars.sh to a script in /etc/profile.d but this sets variables which interfere with gcc and is not acceptable. What is the best and most robust way to adjust my system so all users can run the programs created with the intel compiler suite and libraries?

0 Kudos
7 Replies
Keith_R_1
Novice
602 Views

I would advise using the "environment modules" mechanism (https://modules.sourceforge.net/).  This allows users to dynamically modify their shell and library paths using the commands "module load", "module unload" etc.  The Intel installation provides a script modulefiles-setup.sh to create to create the entries for the oneAPI toolset.  You should be able to install environment modules itself via APT.

 

0 Kudos
Umar__Sait
Novice
585 Views

You can put the bin paths into /etc/profile and /etc/bashrc. You can then put the location of the library directories for each one, e.g. compiler, mkl etc. into /etc/ld.so.conf.d directory.....you can create a file oneapi.conf file and list the directory paths in each line.After doing "ldconfig" and relogin everything should be available. When updates occur you need to modify these paths.

0 Kudos
crobar
Novice
532 Views

So installing dedicated software just to get the paths isn't really something I want to do, and I also don't want the actual users of the software to have to worry about this once I've installed it. It should 'just work' for them.

 

It seem that setting the paths manually in /etc/ld.so.conf.d seems like it might be the best way. The docs say there are symlinks in the 'latest' folder that always point to the latest version, so I think I need to add the following. What else might I need to add?

/opt/intel/oneapi/tbb/latest/lib/intel64/gcc4.8
/opt/intel/oneapi/mkl/latest/lib/intel64
/opt/intel/oneapi/mpi/latest/lib/release

 

I find it a bit disappointing that this presumably basic and common need is not really addressed anywhere, but maybe I have missed it in the documentation (I've not been super thorough)? I did wonder if the config option for setvars might be useful?

0 Kudos
andrew_4619
Honored Contributor III
519 Views

Your problem is running a program? It seems it is redistributable packages that need to be installed on the target machine to make the runtime dynamic libraries available?? The setvars is to establish a build environment.

crobar
Novice
516 Views

@andrew_4619 great you have a solution, could you point me to the Linux redistributable packages and the instructions for installing them please?

0 Kudos
jimdempseyatthecove
Honored Contributor III
433 Views

Instead of directly running the application, make a script that sources the setvars then runs your application. This script can also perform additional preparatory actions and post run actions as well.

 

Jim Dempsey

0 Kudos
Reply