Software Archive
Read-only legacy content
17060 Discussions

catastrophic error: *MIC* cannot open source file "bits/c++config.h"

Keitaro_O_1
Beginner
1,079 Views

Hi,
After I updated MPSS and ICC to version 3.42 and 15.0.1 respectively, I cannot compile Xeon Phi program which uses iostream. For example, when I tried to compile the following program with "icc test.cpp", I receive the error which says "/usr/linux-k1om-4.7/linux-k1om/../x86_64-k1om-linux/include/c++/4.7.0/iostream(39): catastrophic error: *MIC* cannot open source file "bits/c++config.h". Can you please give me advice about the way to remove the error.

#include <iostream>
#include <stdio.h>

int main(int argc, char * argv[]){
  std::cout << "Hello World from host!" << std::endl;

#pragma offload target(mic:0)
  {
    printf("test");
    fflush(0);
  }
  std::cout << "Bye" << std::endl;
}

 

0 Kudos
4 Replies
Kevin_D_Intel
Employee
1,079 Views

I thought I had come across this in the past but have not been able to find any information I may have collected at the time. I cannot reproduce this today although I am still on MPSS 3.4.1. I included details below on what I see in connection with the missing include.

Can you check whether the same details that I have shown below exist on your system?

$ icc -V
Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.1.133 Build 20141023

$ icc -H u538814.cpp 2>&1 | grep c++config.h
.. /usr/include/c++/4.4.7/x86_64-redhat-linux/bits/c++config.h
.. /usr/linux-k1om-4.7/linux-k1om/../lib/gcc/x86_64-k1om-linux/4.7.0/include-fixed/bits/c++config.h

The above path to the header has an underlying sym-link into /opt/mpss:

$ ls -lrt /usr/linux-k1om-4.7/linux-k1om/../lib/gcc/x86_64-k1om-linux/4.7.0/include-fixed/bits

lrwxrwxrwx 1 root root 77 Oct 26 05:56 /usr/linux-k1om-4.7/linux-k1om/../lib/gcc/x86_64-k1om-linux/4.7.0/include-fixed/bits -> /opt/mpss/3.4.1/sysroots/k1om-mpss-linux/usr/include/c++/k1om-mpss-linux/bits

The actual header resides here:

$ ls -l /opt/mpss/3.4.1/sysroots/k1om-mpss-linux/usr/include/c++/k1om-mpss-linux/bits/*config.h

-rw-r--r-- 1 root root 45527 Oct 17 16:05 /opt/mpss/3.4.1/sysroots/k1om-mpss-linux/usr/include/c++/k1om-mpss-linux/bits/c++config.h

 

0 Kudos
Keitaro_O_1
Beginner
1,079 Views

I was able to remove the error. I have another machine with Xeon Phi. I copied /usr/linux-k1om-4.7/linux-k1om/../x86_64-k1om-linux/include/c++/4.7.0/bits/c++config.h in the machine into  the corresponding directory in the problematic machine. Then the error was removed. Is it okay to use c++config.h in the other system?

 And I got the same details as your results. The results of my system are the following.

$ icc -V
Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.1.133 Build 20141023
$ icc -H test.cpp 2>&1 | grep c++config.h
.. /usr/include/c++/4.4.6/x86_64-redhat-linux/bits/c++config.h
.. /usr/linux-k1om-4.7/linux-k1om/../x86_64-k1om-linux/include/c++/4.7.0/bits/c++config.h
$ ls -lrt /usr/linux-k1om-4.7/linux-k1om/../lib/gcc/x86_64-k1om-linux/4.7.0/include-fixed/bits
lrwxrwxrwx 1 root root 77 Jan 15 11:52 /usr/linux-k1om-4.7/linux-k1om/../lib/gcc/x86_64-k1om-linux/4.7.0/include-fixed/bits -> /opt/mpss/3.4.2/sysroots/k1om-mpss-linux/usr/include/c++/k1om-mpss-linux/bits

$ ls -l /opt/mpss/3.4.2/sysroots/k1om-mpss-linux/usr/include/c++/k1om-mpss-linux/bits/*config.h
-rw-r--r-- 1 root root 45527 Nov 25 09:34 /opt/mpss/3.4.2/sysroots/k1om-mpss-linux/usr/include/c++/k1om-mpss-linux/bits/c++config.h

 

 

0 Kudos
Kevin_D_Intel
Employee
1,079 Views

Interesting. So are the results you showed from the system you suffered the error on *before* you copied the file from your other system or are those from your other (I presume working) system?

I believe copying the file is ok but it leaves an uneasy feeling of what else might be missing on that system. Not knowing why it was missing leaves open the possibility of a glitch installing MPSS and has me wondering whether it is prudent to redo the MPSS installation on that system rather than copying the file.

0 Kudos
Keitaro_O_1
Beginner
1,079 Views

Yes. I copied c++config.h from another system where MPSS 2.1 is installed. I also found that this error can be removed by copying c++config.h in /opt/mpss/3.4.2/sysroots/k1om-mpss-linux/usr/include/c++/bits/c++config.h to /opt/mpss/3.4.2/sysroots/k1om-mpss-linux/usr/include/c++/k1om-mpss-linux/bits/ within the problematic machine.

Anyway, I'll reinstall MPSS and check if the error occurs again.

Thank you.

0 Kudos
Reply