Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Ubuntu: source compilervars for graphical programs like Netbeans

Scheibe__Patrick
New Contributor I
336 Views

Hi,

First of all, the sourcing of the variable scripts for the intel compiler, vtune, advisor and inspector works fine for the shell when I put them in my bashrc. Nevertheless, I need the environment variables for the compiler (tbb, mkl, ..) in some of my graphical programs too because I use the icc in Netbeans or Mathematica. Unfortunately, I have not found a way to source the scripts for my gnome session so that graphical programs have them automatically. 

As far as I could find out, this is some specific issue for the compilervars.sh script because the e.g. the advisor-vars.sh script works. Here is what I did. I created a file /etc/profile.d/intelCC.sh with the content

[bash]

source /opt/intel/composerxe/bin/compilervars.sh intel64
source /opt/intel/inspector_xe/inspxe-vars.sh intel64
source /opt/intel/vtune_amplifier_xe/amplxe-vars.sh intel64
source /opt/intel/advisor_xe/advixe-vars.sh intel64

export XXXXX="Hello"

[/bash]

This seems to be the right way to set system-wide variables which are only loaded once at gnome-login. And indeed, after a logout/login some of the variables are always available, be it in a terminal or in a GUI program. For instance the defined XXXXX is available, but additionally e.g. VTUNE_AMPLIFIER_XE_2013_DIR and the PATH was adjusted to contain vtune,advisor,... directories.

What does not work is the setting which happens in all the sub-scripts executed in compilervars.sh.

Does someone has a clue what I am doing wrong here?

Cheers, Patrick

0 Kudos
1 Solution
Scheibe__Patrick
New Contributor I
336 Views

The problem was that Ubuntu 12 uses /bin/dash as sh which is not compatible with the variable scripts. To fix this you have to link sh to your bash as described here:

http://software.intel.com/en-us/articles/using-intel-compilers-for-linux-with-ubuntu

View solution in original post

0 Kudos
1 Reply
Scheibe__Patrick
New Contributor I
337 Views

The problem was that Ubuntu 12 uses /bin/dash as sh which is not compatible with the variable scripts. To fix this you have to link sh to your bash as described here:

http://software.intel.com/en-us/articles/using-intel-compilers-for-linux-with-ubuntu

0 Kudos
Reply