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

Problem with environment variables

Rodrigo_B_
Beginner
392 Views

Hello, I installed the intel compiler without much problem, but I'm having some problems with the variables

I did run the script like this:

source /opt/intel/bin/iccvars.sh ia32

Then I can run the compiler with no problems, but always when I exit the terminal I have to run the iccvars.sh script again because the terminal says that he won't find the icpc command.

I guess it's a problem with the variables, but I can't figure out what problem it is

Thanks in advance

 

 

0 Kudos
3 Replies
TimP
Honored Contributor III
392 Views

This is intentional.  In accordance with documentation if you want environment set every time shell opens you will add the source command e.g. in .profile

0 Kudos
Rodrigo_B_
Beginner
392 Views

Didn't think that was intentional, I will try set it on the .profile.

 

Thanks for the help

0 Kudos
Shenghong_G_Intel
392 Views

Hi Rodrigo,

This is something related to environment variable concept in Linux. There are 3 kind of settings if I did not miss:

1. export xx=value, on terminal: this will set it on current terminal only and will "disappear" in a new terminal.

2. export xx=value, in user's profile file (like ~/.profile, or ~/.bash_profile) depends on your Linux. This will set it for a specific user, when the user login, it will be available.

3. export xx=value, in system-wide (in /etc/profile file). This will set it for all users on a specific machine.

What the "source iccvar.sh" really have done are, to set some environment variables like "PATH". So, it may not be intentional by our compiler, but intentional by Linux. :) Hope it is more clear now.

For your references: https://wiki.archlinux.org/index.php/environment_variables

Thanks,

Shenghong

0 Kudos
Reply