Community
cancel
Showing results for 
Search instead for 
Did you mean: 
sharma__animesh
Beginner
1,320 Views

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

Dear Experts,

I have recently downloaded and installed the "Intel(R) Parallel Studio XE 2018 Update 1" which seems to lack "stdio.h"? 

For example, if i try to initiate the env with "psxevars.bat intel64", it shows no error:


Intel(R) Parallel Studio XE 2018 Update 1
Copyright (C) 2017 Intel Corporation. All rights reserved.

Intel(R) Compiler 18.0 Update 1 (package 156)

**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.5.7
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

however if i try to build some program, for example https://software.intel.com/sites/default/files/openmp_samples_C_win_20170912.zip , it fails with following message:

C:\Users\animeshs\Desktop\openmp_samples>build
icl /nologo /O2 /Qstd=c99 /Qopenmp /F256000000  /Forelease\ src\openmp_sample.c /link /INCREMENTAL:NO /SUBSYSTEM:CONSOLE /MANIFEST:NO  /out:release\openmp_sample.exe
openmp_sample.c
src\openmp_sample.c(54): catastrophic error: cannot open source file "stdio.h"
  #include <stdio.h>
                    ^

compilation aborted for src\openmp_sample.c (code 4)

Any ideas on how to proceed?

Best regards,

Ani

0 Kudos
4 Replies
TimP
Black Belt
1,320 Views

That's one of many include and library files which ICL inherits from Microsoft CL and SDK.  As the .bat file which sets up ICL also sets up CL, as shown by your echo of vcvarsall.bat, you should also be able to build with CL (if your sample doesn't depend too much on C99 or OpenMP beyond 2.0 and you stick with CL command line options).  In VS2017 install, you must install C++ and appropriate SDK choice.  If you need to go back and update those, you will likely need to reinstall (not simply repair) ICL.

sharma__animesh
Beginner
1,320 Views

Thanks Tim, reinstalling the VS2017 worked! However i am wondering if VS is needed at all to compile a MPI based C++ program?

The program compiles flawlessly on the Linux systems with GCC/MPI but i am not able to do same using Intel on Windows. The compile documents plainly mentioned to use icpc https://github.com/sebhtml/ray/blob/master/Documentation/COMPILERS.txt , any ideas on how to proceed on this one?

zhu__shiying
Beginner
1,320 Views

Dear expert,

I have same issue to install CNS_solve on MacOS Mojave, as "catastrophic error: cannot open source file "stdio.h"" the scripts as followed:

Using Makefile template for compiler: ifort

removing old source files

linking source files to mac-intel-darwin/source

linking machine_f.f to source directory

linking machine_c.c to source directory

linking generic fft file to source directory

making Makefile in source directory

testing Fortran and C compilers

compiling: icc -O -axSSSE3 -DINTEGER='long int' -DCNS_ARCH_TYPE_LINUX 

test_c.c(1): catastrophic error: cannot open source file "stdio.h"

  #include <stdio.h>

                    ^

 

compilation aborted for test_c.c (code 4)

/bin/sh: ./test_c: No such file or directory

***** ERROR: problem with C compiler *****

make[3]: *** [c-test] Error 3

compiling: ifort -i8 -traceback -w -vec-report0 -O -axSSSE3  

linking: ifort -static-intel -save-temps -traceback -O -axPT 

ifort: command line remark #10279: option '-axP' is deprecated and will be removed in a future release. See '-help deprecated'

ifort: command line warning #10150: option '-axT' not supported

Fortran compiler passes test

making utility programs

make relink

make default

ifort -o PSmapx -O -xP -w -vec-report0 PSmapx.f -i-static

ifort -o PSmapy -O -xP -w -vec-report0 PSmapy.f -i-static

ifort -o PSmapz -O -xP -w -vec-report0 PSmapz.f -i-static

icc -o to_cns -O to_cns.c -lm

to_cns.c(11): catastrophic error: cannot open source file "stdio.h"

  #include <stdio.h>

                    ^

 

compilation aborted for to_cns.c (code 4)

make[4]: *** [to_cns] Error 4

make[3]: *** [utils] Error 2

make[2]: *** [compile-utils] Error 2

make[1]: *** [utils] Error 2

 

flags:

 fortran -> [ifort] -i8 -traceback -w -vec-report0 -O -axSSSE3  

       c -> [icc] -O -axSSSE3 -DINTEGER='long int' -DCNS_ARCH_TYPE_LINUX 

    link -> [ifort] -static-intel -save-temps -traceback -O -axPT   

 

Any suggestion,

 

Best regards

 

Viet_H_Intel
Moderator
1,320 Views

Does it work with gcc?

Reply