Where is the environmental variables set in Visual Studio 2010?

Where is the environmental variables set in Visual Studio 2010?

Jihoe K.'s picture

 

 I am using XE Composer 2013  with Visual Studio 2012.

To add additional include path with a simple statement, I want to define an environmental variable.

I searched google in regard with this, but all things are about C++, and seems to be different from a Fortran Project.

 

Where are the environmetal variables for VS defined?

 

 

 

 

 

 

 

 

 

 

 

 

8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Sergey Kostrov's picture

>>...Where are the environmetal variables for VS defined?

Take a look at:

Tools -> Options -> Projects and Solutions

and select an item for Directories ( Executable, Include, Reference, Library, Source, Exclude ).

Jihoe K.'s picture

   This is my "Project and Solution" menu (in Attached File). There is no such a thing as Directories.  There is no menu about fortran thing. Is there something wrong?

Attachments: 

AttachmentSize
Download projectandsolution.png195.32 KB
Steve Lionel (Intel)'s picture

Sergey, that's not what's being asked.

The answer is that it is identical to that for a C++ project, under Debugging > Environment. Click the arrow to the right of the field and select Edit. Put your variables in, one per line, in the form name=value. Unlike in some other properties, you can't just put in a comma or semicolon-delimited list. The settings are stored in the .vfproj.user file.

Steve
Sergey Kostrov's picture

>>This is my "Project and Solution" menu (in Attached File). There is no such a thing as Directories. There is no menu
>>about fortran thing. Is there something wrong?

Sorry, my mistake and take a look at:

Tools -> Options -> Intel Composer XE -> Visual Fortran -> Compilers ( search paths for Executables, Libraries and Includes could be set )

Steve Lionel (Intel)'s picture

Still not what is being asked for, though it is useful to understand that option page in general. The page Sergey points to is for defining how the compiler and build tools get invoked - where VS looks for the compiler and what the default library and include directories are. It is not where you define user-specified environment variables.

Steve
Sergey Kostrov's picture

For example, I declared a regular Windows environment variable, like:

...
set WORKLIB_DIR = C:\[ SomePath ]\ - this is the path to some directory where all 3rd party libraries are installed
...

and then I use it in a Visual Studio, like:

...
$(WORKLIB_DIR)TBB\Include - this is the path to the directory with Intel TBB header files
...

Steve Lionel (Intel)'s picture

I must apologize - it seems I was the one who misunderstood the question.

Yes, the method for setting default directory paths is now different in Fortran than C++ - it used to be the same but C++ changed in VS2010 to use separate property pages. To be honest, I find the new C++ method to be confusing and complex, but...

Sergey has the right approach to add default include paths for all projects. Yes, you can also use your own environment variables but they need to be defined in the context of where VS is run.

Steve

Login to leave a comment.