Cannot open source file "Priorities.h"

Cannot open source file "Priorities.h"

Bild des Benutzers TwainG

Hello,

I am using Intel's System Studio on an embedded Fedora 14 64-bit OS. I have sourced the iccvars.sh and installed the "Deployment Tools" so the compiler's tools and enviroment should be set up completely. I am attempting to compile a fairly compley .c file that contains several headers. I used the -H command to see that the compiler is locating these one by one from various spots. For some reason or another, it cannot open this particular source file. I used the find funtion to locate Priorities.h on my machine and have found it to be in just a slightly different location. Would the location be the source of my problems or is there another problem. I'm happy to share more specifics if it will help you answer my question, thank you in advance for the help.

Twain Glaser
5 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers Noah Clemons (Intel)

From your statement above, the compiler is looking for priorities.h in the wrong place. Here are a few questions we need to answer to in order to determine why. 

1) Where is the compiler looking for the file? 

2) Where actually is the file? Have you found it?

3) Where is the header file in relation to the calling source file?

4) What does the include line in the source file look like?

Let me know, thanks.

Bild des Benutzers TwainG

1)I'm not really sure on how to check where it is looking for the file but here is what I'm getting:

[root@localhost ptl_FIle]# icpc PTL_Main.c -H
. /usr/include/signal.h
.. /usr/include/features.h
... /usr/include/sys/cdefs.h
.... /usr/include/bits/wordsize.h
... /usr/include/gnu/stubs.h
.... /usr/include/bits/wordsize.h
.... /usr/include/gnu/stubs-32.h
.. /usr/include/bits/sigset.h
.. /usr/include/bits/types.h
... /usr/include/bits/wordsize.h
... /usr/include/bits/typesizes.h
.. /usr/include/bits/signum.h
.. /usr/include/time.h
.. /usr/include/bits/siginfo.h
... /usr/include/bits/wordsize.h
.. /usr/include/bits/sigaction.h
.. /usr/include/bits/sigcontext.h
... /usr/include/asm/sigcontext.h
.... /usr/include/linux/types.h
..... /usr/include/asm/types.h
...... /usr/include/asm-generic/types.h
....... /usr/include/asm-generic/int-ll64.h
........ /usr/include/asm/bitsperlong.h
......... /usr/include/asm-generic/bitsperlong.h
..... /usr/include/linux/posix_types.h
...... /usr/include/linux/stddef.h
...... /usr/include/asm/posix_types.h
....... /usr/include/asm/posix_types_32.h
.. /opt/intel/system_studio_2013.1.024/compiler/include/stddef.h
... /usr/lib/gcc/i686-redhat-linux/4.5.1/include/stddef.h
.. /usr/include/bits/sigstack.h
.. /usr/include/sys/ucontext.h
... /usr/include/signal.h
... /usr/include/bits/sigcontext.h
.. /usr/include/bits/pthreadtypes.h
.. /usr/include/bits/sigthread.h
. /usr/include/string.h
.. /opt/intel/system_studio_2013.1.024/compiler/include/stddef.h
... /usr/lib/gcc/i686-redhat-linux/4.5.1/include/stddef.h
.. /usr/include/xlocale.h
. /usr/include/stdio.h
.. /opt/intel/system_studio_2013.1.024/compiler/include/stddef.h
... /usr/lib/gcc/i686-redhat-linux/4.5.1/include/stddef.h
.. /usr/include/libio.h
... /usr/include/_G_config.h
.... /opt/intel/system_studio_2013.1.024/compiler/include/stddef.h
..... /usr/lib/gcc/i686-redhat-linux/4.5.1/include/stddef.h
.... /usr/include/wchar.h
... /usr/lib/gcc/i686-redhat-linux/4.5.1/include/stdarg.h
.. /usr/include/bits/stdio_lim.h
.. /usr/include/bits/sys_errlist.h
. /usr/include/unistd.h
.. /usr/include/bits/posix_opt.h
.. /usr/include/bits/environments.h
.. /opt/intel/system_studio_2013.1.024/compiler/include/stddef.h
... /usr/lib/gcc/i686-redhat-linux/4.5.1/include/stddef.h
.. /usr/include/bits/confname.h
.. /usr/include/getopt.h
PTL_Main.c(8): catastrophic error: cannot open source file "Priorities.h"
  #include "Priorities.h"
                         ^

compilation aborted for PTL_Main.c (code 4)

2) Yes, i have found the file, it's located at:

/home/twain/Desktop/PTL/PhaseII/code/PTL/Tasking/Priorities.h

3&4) #include "Priorities.h", is the first file included in the labeled section "User includes", which is after what the  "system includes" (signal.h, string.h, stdio.h, & unistd.h). After calling for Priorities.h the file goes on to include some odd 25 .h files, none of which have be sourced by the compiler as they follow Priorites.h, but they are in a similar path so i fear that they won't be able to be sourced either. I'm thinking now that these files might need to be be in the directory /usr/... like the other .h files, but im not sure.

Thanks again

Twain Glaser
Bild des Benutzers yang-wang (Intel)

Hi Twain,
    icc uses the same way as gcc to find the path for include files. For this case, you may just add option "-I/home/twain/Desktop/PTL/PhaseII/code/PTL/Tasking/" to specify the inlcude path for Priorities.h explicitly.

See http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html for your reference.
GCC looks in several different places for headers. On a normal Unix system, if you do not instruct it otherwise, it will look for headers requested with #include <file> in:
     /usr/local/include
     libdir/gcc/target/version/include
     /usr/target/include
     /usr/include
For C++ programs, it will also look in libdir/../include/c++/version, first. In the above, target is the canonical name of the system GCC was configured to compile code for; often but not always the same as the canonical name of the system it runs on. version is the version of GCC in use.
You can add to this list with the -Idir command line option. All the directories named by -I are searched, in left-to-right order, before the default directories. The only exception is when dir is already searched by default. In this case, the option is ignored and the search order for system directories remains unchanged.

Bild des Benutzers TwainG

Hello,

Thank you for the help, I was able to use the -I function. In order for the compiler to find all the.h files it needs to run the program I had to put all the non-defaulted .h files in one folder so the path following -I would lead to whatever file it was looking for. Thank you once again for the help and the rapid response.

Twain Glaser

Melden Sie sich an, um einen Kommentar zu hinterlassen.