When I try to use the <future> library in icc, an error shows up. Could anyone know what is the solution? I have searched for the forum and Google, but could not find any solutions. The setting up of icc and the environment is well because I have been using it for a long while.
-bash-4.1$ icc axpy_c++.cpp -std=c++11
axpy_c++_async2.cpp(10): catastrophic error: cannot open source file "future"
compilation aborted for axpy_c++_async2.cpp (code 4)
Intel does not provide its own headers and libraries so if you are using an older version of GNU (older than GNU 4.5) then it will not be available. What does gcc -v say?
Thank you for your reply.
Actually, I can use g++ to compile the code in this machine. But I can use icc to compile the code in other machine(the version of icc is the same for both machines). The difference of this two machine is the version of gcc 4.47 (the machine icc count't recognize <future> library) and gcc 4.8(icc recognize <fugure> library). Is it the reason why icc count not recognize? Do you know any solutions? Should I link some specific dynamic library or include some header files to do that? The info of gcc -v is as follows:
-bash-4.1$ g++ -v
Using built-in specs.
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-220.127.116.11/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)
You must put a version of g++ on path which supports that feature. If you don't want to update the default gcc, this means installing gcc in another path location and setting PATH and LD_LIBRARY_PATH accordingly.
Just so you know, Intel compiler is based on the GNU tool chain (uses its asm, ln etc as well) mainly to ensure compatibility with GCC (source, binary and commandline) and hence you'll need to make sure GCC/G++ and binutils are all installed on the system for the compiler to work, like Judy/Tim mentioned earlier.