Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

Problem with environment variables

Rodrigo_B_
Beginner
96 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
Black Belt
96 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

Rodrigo_B_
Beginner
96 Views

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

 

Thanks for the help

Shenghong_G_Intel
96 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

Reply