hkmoffat / cantera

Automatically exported from code.google.com/p/cantera
0 stars 0 forks source link

Comiling with Intel compilers on Linux #86

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.sudo scons install
2.
3.

What is the expected output? What do you see instead?
Checking for C++ header file cmath... yes

I see:
Checking for C++ header file cmath... no
ERROR: The C++ compiler is not correctly configured.

What version of the product are you using? On what operating system?
latest svn of /cantera/trunk r1473

Please provide any additional information below.
I do the :
source /opt/intel/bin/compilervars.sh intel64
scons build env_vars=all CC=icc CXX=icpc F90=ifort F77=ifort

But when doing the sudo install (needed in my case) the evniroments are not 
setup in sudo, and it falls with the sanity check
sudo install
Checking for C++ header file cmath... no
ERROR: The C++ compiler is not correctly configured.

If instead I do:
sudo su
source /opt/intel/bin/compilervars.sh intel64
scons install

It installs fine. I also tried sudo -E and it didn't help...

Original issue reported on code.google.com by Termope...@gmail.com on 21 May 2012 at 11:55

GoogleCodeExporter commented 9 years ago
I'm not sure that there's a better solution than your workaround. SCons expects 
the environment not to change in certain ways between calls, but sudo doesn't 
like to pass the full set of environment variables, and this interacts badly 
with the Intel compiler's reliance on configuration by environment variables.

sudo is quite conservative by default. The -E option only works if the 'setenv' 
option is allowed in the /etc/sudoers file.

Original comment by yarmond on 24 May 2012 at 4:52