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

catastrophic error: cannot open source file "stdarg.h"

cherry_m
Beginner
2,058 Views
Hello everyone,
I am trying to install GMT (version 4.5.7) with netCDF (version 4.0.1) using the install parameters provided by the http://gmt.soest.hawaii.eduin a Mac Pro with OS X 10.7.3 using Intel Fortran Composer XE 2011 and C++ Composer XE 2011. I am encountering an error in the configuration of the status of the netCDF, specifically in executing libtool commands. In "Making check in libsrc", this error occurs:
libtool: compile: icc -DHAVE_CONFIG_H -I. -I.. -I../fortran -g -O2 -MT dim.lo -MD -MP -MF .deps/dim.Tpo -c dim.c -o dim.o
depbase=`echo error.lo | sed 's|[^/]*$|.deps/&|;s|\\.lo$||'`;\\
/bin/sh ../libtool --tag=CC --mode=compile icc -DHAVE_CONFIG_H -I. -I.. -I../fortran -g -O2 -MT error.lo -MD -MP -MF $depbase.Tpo -c -o error.lo error.c &&\\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: icc -DHAVE_CONFIG_H -I. -I.. -I../fortran -g -O2 -MT error.lo -MD -MP -MF .deps/error.Tpo -c error.c -o error.o
error.c(11): catastrophic error: cannot open source file "stdarg.h"
#include
^
I am not really sure how this could be solved though I have found a quite similar problem reported in 2009. The suggested solution is an upgrade and I'm not sure if the similar approach is still applicable today. Could anyone please suggest a solution to this issue?
Thanks!


0 Kudos
8 Replies
TimP
Honored Contributor III
2,058 Views
Did you install icc against an Xcode installation of g++ as specified in the installation notes? Can you build a simple C example with that header, both by gcc and by icc?
0 Kudos
SergeyKostrov
Valued Contributor II
2,058 Views
Quoting cherry.m
...libtool: compile: icc -DHAVE_CONFIG_H -I. -I.. -I../fortran -g -O2 -MT error.lo -MD -MP...

Header filessearch paths are as follows:

'.'
'..'
'../fortran'

and ifthe 'stdarg.h' is not found in these foldersthere will be a compilation error.

I assume that you have a proper installation of the C/C++ compiler with all header files including the'stdarg.h'.

Best regards,
Sergey
0 Kudos
cherry_m
Beginner
2,058 Views
Hi TimP,
I am not really sure which installation notes you are referring to. I actually installed Intel C++ Composer and Fortran Composer (both versions XE 2011) using licensed DVDs. I just followed the installation wizard. After then, I installed Xcode using the file from Apple Developer. I did not find any installation notes so I just installed it following the advice of several internet fora.
I have also asked Unidata for advise on installing netCDF since the problem seems to occur in the configuration of netCDF. They said that the configuration is picking up g++ as my preferred c++ compiler (see below).However, I have chosen icc as my default compiler.Quoting the message: "I see configure is picking up g++ as the C++ compiler, and I'm not sure it'scompatible with icc that you're using as the C compiler."
> checking CXX... g++
> checking CXXFLAGS... -g -O2
> checking type g++... g++ is /usr/bin/g++
> checking FC... ifort
> checking FFLAGS... -g
> checking type ifort... ifort is /usr/bin/ifort
I have tried changing my environment settings to CXX='' and changing the configuration option to disable cxx. However, this doesn't solve the issue.
Then, I tried searching for "stdarg.h"filenames in my system. It gives the following directories:
/usr/include/c++/4.2.1/tr1/stdarg.h
/usr/lib/clang/3.1/include/stdarg.h
/usr/llvm-gcc-4.2/include/gcc/darwin/4.2/stdarg.h
/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h
/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/install-tools/include/stdarg.h
I am not really sure what to do since I'm really new to handling server issues. It seems that I have to change the preferred c++ compiler. For now, I am exploring ways on how to do this.
Regards,
Cherry
0 Kudos
cherry_m
Beginner
2,058 Views
Thanks, Sergey!
Header filessearch paths are as follows:

'.'
'..'
'../fortran'

and ifthe 'stdarg.h' is not found in these foldersthere will be a compilation error.
I checked these paths and I have found 'stdarg.h'. I think I have a proper installation of C/C++ compiler though as I have stated in the previous post, the installation seems to choose g++ as my compiler and it may be incompatible with icc, my preferred c++ compiler.
I am not sure how to address this since I am really new to these things.
Best regards,
Cherry
0 Kudos
TimP
Honored Contributor III
2,058 Views
icc refers to g++ in order to locate several of the standard headers and libraries, so they had better be compatible. I don't know what you mean by "installation seems to choose g++." g++ must be active in order for icc to work. Applications which want g++ will use it; in order to use icc you must leave g++ active, set the icc environment variables by sourceing iccvars scripts, and invoke icc or icpc explicitly. If your installation has a symlink which make cc into an alias for gcc, that will remain unless you change it yourself.
0 Kudos
Jeffrey_A_Intel
Employee
2,058 Views
> After then, I installed Xcode using the file from Apple Developer.

The installation of the Intel compilers requires that Xcode be installed before the compilers are installed. (And that you reinstall the compilers whenever you install a new/different version of Xcode.)

BTW, just for the record, which version of Xcode are you using?

Try uninstalling the compilers and Xcode in that order (look in the Xcode and compiler release notes for instructions for uninstalling). Then install Xcode, make sure it works and afterwards install the compilers.
0 Kudos
cherry_m
Beginner
2,058 Views
Thanks, Jeff Arnold! Now I get it. :) I'm entirely new to handling Mac and servers so I really appreciate your explanation.
I am using Xcode 4.3.1, build version is 4E1019. I checked if the installation was carried out succesfully and working properly. I issued the command $ cc --version and I got the expected and correct response. I am not sure if OS X 10.7.3 with Xcode 4.3.1 is supported by intel (update 6 of release notes says that it supports Mac OS X 10.7 with Xcode 4.1. Another thread from Intel Network says that Xcode 4.3 is not yet supported).
It seems that uninstalling Xcode completely is a bit complicated so I'll try keeping the one that I have and then reinstall the compilers.
Since the installation of Intel Fortran and c++ composers do not recognize the real folders where I kept Xcode (I tried a lot of different folders after switching the path of Xcode using $ xcode-select -switch ), I just used "/" as the "location" of the Xcode as suggested here:http://software.intel.com/en-us/forums/showthread.php?t=103171
Now I have successfully installed GMT4.5.7 and netCDF4.0.1. However, I think, full integration of Xcode and the composers were not carried out successfully as there is no second copy of "opt/intel/..." underXcode directories (I checked just a few folders such as /Applications/Xcode.app/Contents/Developer). I am not sure how this would affect the performance of my computer in the future.
Thanks a lot for the help! Thanks to TimP too.
0 Kudos
Jeffrey_A_Intel
Employee
2,058 Views
> I am not sure if OS X 10.7.3 with Xcode 4.3.1 is supported by intel

No, we have not yet released compiler kits which integrate into Xcode 4.3. Xcode 4.2.latest is the most recent version of Xcode supported today.
0 Kudos
Reply