0 Replies Latest reply on Aug 30, 2010 2:42 PM by bamarker

    Notes on compiling C++ for SCC


      Compiling C++ programs with templates, STL libraries, etc. is possible on SCC, but it takes a few changes to your compiler/linker options.  Here is a list of the changes I had to make to our makefile to get our C++ code compiling and running.


      1. There is a bug in the version of icpc/icc used to compile for SCC that can cause undefined references to template instantiations.  If you see such an error when linking, just add explicit template instantiations to your source files.  Specifically, we saw this error when explicitly instantiating templates that call other templates.  The callee was not being instantiated with the caller.
      2. Use the –i-static link option instead of –static.  Change this option in the common/symbols.in file in your RCCE folder before configuring and making RCCE.  Then, you can use the linker options in the common/symbols file.
      3. Use the –cxxlib-icc link option to pull in the C++ libraries like those for STL classes.
      4. Use the -I/opt/icc-8.1.038/include/c++ compile option to get the C++ headers.
      5. Use the -L/opt/i386-unknown-linux-gnu/i386-unknown-linux-gnu/lib link option to prevent the compiler from loading from /usr/lib, which holds unsupported libraries.