Loading...
You are not logged-in Login/Register





  • Posts   Search Threads
  • mattst88July 22, 2008 9:44 AM PDT   
    Problems including limits.h with icc-10.1.017 on Linux

    Hi,

    I have problems compiling programs that use limits.h such as PHP. The symptoms of this problem appear to differ from person to person and from x86 to x86_64. For instance, I can compile the same version of PHP cleanly with my x86 server, but the compile fails with my Core 2 x86_64 laptop and my Sempron 64 desktop. See this thread for reports.

    Commonly, I receive this error:

    /usr/include/gentoo-multilib/amd64/limits.h(125): catastrophic error: could not open source file "limits.h"
     # include_next 
                              ^ 

    I tried reproducing it with a simple test program, but was unable:

    #include 
    
    int main() { return 0; }


    realncJuly 22, 2008 5:15 PM PDT
    Rate
     
    Re: Problems including limits.h with icc-10.1.017 on Linux

    Confirmed with GCC 4.3.1 on 64-bit. Always reproducible with the following C++ program:

    #include <limits.h>
    int main()
    { return 0; }

    icpc test.cpp
    /usr/include/limits.h(125): catastrophic error: could not open source file
    "limits.h"

    There is no problem with C. Only C++.


    TimP (Intel)July 22, 2008 7:39 PM PDT
    Rate
     
    Re: Problems including limits.h with icc-10.1.017 on Linux

    This doesn't look like a problem with icpc.  You are running non-standard C++ (<limits.h> in place of <climits>) on an unsupported target.  icpc tries to use this header the same way as g++, unless something is done behind our backs to break it.  Unfortunately, g++ 4.3.1 is somewhat newer than what icpc 10.1 was built to support, so there will undoubtedly be problems elsewhere.


    realncJuly 23, 2008 8:18 AM PDT
    Rate
     
    Re: Problems including limits.h with icc-10.1.017 on Linux

    The problem persists even with #include <climits> instead of #include <limits.h> (the error message does not change, it still refers to "/usr/include/limits.h").

    I know of course that GCC 4.3.1 is too new to be supported. I'm just confirming that there is a problem because I assume ICC makes an effort to be GCC compatible.

    The code in /usr/include/limits.h where the error happens:

    /* Get the compiler's limits.h, which defines almost all the ISO constants.
        We put this #include_next outside the double inclusion check because
        it should be possible to include this file more than once and still get
        the definitions from gcc's header.  */
    #if defined __GNUC__ && !defined _GCC_LIMITS_H_
    /* `_GCC_LIMITS_H_' is what GCC's file defines.  */
    # include_next <limits.h>
    #endif


    mattst88July 23, 2008 10:17 AM PDT
    Rate
     
    Re: Problems including limits.h with icc-10.1.017 on Linux

    This should have been stated earlier, but I experience this with gcc-4.2.x. This isn't a gcc-4.3 issue.


    TimP (Intel)July 23, 2008 10:28 AM PDT
    Rate
     
    Re: Problems including limits.h with icc-10.1.017 on Linux

    Yes, icpc makes every attempt to search the paths owned by g++, in the same way that the g++ which is active in the same session does.     If this problem occurs with icpc, but not with g++, something is wrong with the icpc installation.  According to you first post, the include file system in your distro is different from the supported distros.
    I'm not expert on it, but this _GCC_LIMITS_H_ scheme appears to be designed to cause the <limits.h> provided by your glibc or other system library installation to be included the first time only, while adding some stuff determined during the fixincludes phase of gcc build.  On my linux installation, that system file is /usr/include/limits.h.  According to your diagnostic, it may be different on yours.
    It's also possible to make a plain limits.h using the Pemberton enquire.c program which used to be provided with gcc, in order to use K&R C to bootstrap in the absence of a system <limits.h>.  Maybe you could add that in your project and get something more compatible with generic software.  enquire.c should work identically with gcc or icc.


    realncJuly 23, 2008 11:38 AM PDT
    Rate
     
    Re: Problems including limits.h with icc-10.1.017 on Linux

    icpc can't find a limits.h even if I compile with:

    icpc -I/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.1/include -I/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.1/include-fixed -I./ -I/opt/intel/cce/10.1.017/include test.cpp

    And I created a dummy limits.h in the current directory. icpc simply refuses to pick up a limits.h no matter what.

    Using the -no-gcc switch fixes the problem though. But a lot packages won't build with -no-gcc.

    Also, compiling with -D_GCC_LIMITS_H_ fixes it too, but I really don't think that's a good idea.



    carlo@alinoe.comSeptember 4, 2008 8:10 PM PDT
    Rate
     
    Re: Problems including limits.h with icc-10.1.017 on Linux

    I can confirm that this problem still exists with 10.1.018 (Intel takes 'not supported' very seriously)...



    wverminFebruary 18, 2009 2:04 AM PST
    Rate
     
    Re: Problems including limits.h with icc-10.1.017 on Linux

    Quoting - realnc
    icpc can't find a limits.h even if I compile with:

    icpc -I/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.1/include -I/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.1/include-fixed -I./ -I/opt/intel/cce/10.1.017/include test.cpp

    And I created a dummy limits.h in the current directory. icpc simply refuses to pick up a limits.h no matter what.

    Using the -no-gcc switch fixes the problem though. But a lot packages won't build with -no-gcc.

    Also, compiling with -D_GCC_LIMITS_H_ fixes it too, but I really don't think that's a good idea.

     

    Another, probably better solution:

     

    icc (or icpc) -idirafter/usr/include/linux .....





    Kittur Ganesh (Intel)February 18, 2009 4:04 PM PST
    Rate
     
    Re: Problems including limits.h with icc-10.1.017 on Linux


    Hi,
    This issue has been fixed in the 10.1.021 version upwards (based on the build date  that I verified). Could you please download the latest version 10.1.022 and try it out? If the problem still exists, please let me know. Also, the latest 11.0 version 11.0.081 should not have this problem too, just FYI.

    The work-around earlier when the problem existed was to use -D_GCC_LIMITS_H_ option. But, it should be fixed in the latest 10.1 version. I tested with that version again on x86_64 EL5 and it worked fine. 

    -regards,
    Kittur

    mattst88March 4, 2009 9:27 PM PST
    Rate
     
    Re: Problems including limits.h with icc-10.1.017 on Linux

    Hi,

    Yes, I just confirmed that 10.1.021 does not have this problem.

    Thanks so much!


Forum jump:  

Intel Software Network Forums Statistics

16,356 users have contributed to 46,307 threads and 163,763 posts to date.

In the past 24 hours, we have 28 new thread(s) 110 new posts(s), and 85 new user(s).

In the past 3 days, the most popular thread for everyone has been Formula for the intersection of straight lines The most posts were made to Take a look at John Burkhard&# The post with the most views is Intel PCM - How can I watch monitoring results of multi core of AWS CC1?

Please welcome our newest member mechloreguy


For more complete information about compiler optimizations, see our Optimization Notice.