5 Replies Latest reply on Jan 26, 2011 6:36 AM by osarood

    Error at compile time

    osarood

      Hello

       

      I am getting the following errors at compile time:

       

       

      sarood1@scc:~/samples$ /opt/icc-8.1.038/bin/icpc -DCOPPERRIDGE -static -mcpu=pentium -gcc-version=340 helloSCC.c
      ld: skipping incompatible /usr/lib/libm.a when searching for -lm
      ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/32/../libstdc++.a when searching for -lstdc++
      ld: cannot find -lstdc++
      Does anyone know how to resolve it?
      Osman
      University of Illinois Urbana Champaign
        • 1. Re: Error at compile time
          christgau

          HI Osman,

           

          your trying to link your application with the 64-bit GNU C++ library. Since the SCC is a 32 bit system linking will fail. Take a look at bug 74 and some other community posts. You should be able to compile your app with the following command line:

           

          icpc -DCOPPERRIDGE -mcpu=pentium -i-static -gcc-version=340 -cxxlib-icc -I/opt/icc-8.1.038/include/c++ -L/opt/i386-unknown-linux-gnu/i386-unknown-linux-gnu/lib test.cpp

           

          Regards Steffen

          1 of 1 people found this helpful
          • 2. Re: Error at compile time
            osarood

            Thanks for the answer.

             

            Can you tell me how can I look at bug 74?

            However, I tried compiling by using the command you have specified. It says the following:

             

            sarood1@scc:~/samples$ /opt/icc-8.1.038/bin/icpc -DCOPPERRIDGE -mcpu=pentium -i-static -gcc-version=340 -cxxlib-icc -I/opt/icc-8.1.038/include/c++ -L/opt/i386-unknown-linux-gnu/i386-unknown-linux-gnu/lib helloSCC.c
            ld: i386:x86-64 architecture of input file `/usr/lib/crt1.o' is incompatible with i386 output
            ld: i386:x86-64 architecture of input file `/usr/lib/crti.o' is incompatible with i386 output
            ld: i386:x86-64 architecture of input file `/usr/lib/crtn.o' is incompatible with i386 output
            ld: final link failed: Invalid operation

             

            It seems to be using a 64 bit version again. Any suggestion for correcting it?

             

            Osman

            • 3. Re: Error at compile time
              tedk

              http://marcbug.scc-dc.com/bugzilla3

               

              The bug number refers to our Bugzilla. If you have not made yourself an account there, please do so. General information in the forum but the real nitty gritty is in Bugzilla.  You can submit bugs, adjust their priority, and track their progress.

              • 4. Re: Error at compile time
                tedk

                What happens if you do a "which icc"? and the same for gcc and icc. It should look like the folloiwng.

                 

                tekubasx@marc005:~/bin$ which icc
                /opt/icc-8.1.038/bin/icc

                tekubasx@marc005:~/bin$ which gcc
                /opt/i386-unknown-linux-gnu/bin/gcc
                tekubasx@marc005:~/bin$ which icpc
                /opt/icc-8.1.038/bin/icpc

                 

                I noticed in your example that you were spcifying the complete path of icpc. It's best to set up the cross compile environment with the supplied script.

                • 5. Re: Error at compile time
                  osarood

                  it shows the path you have mentioned. I ran the script which sets these paths. I can now compile it and run the example. Thanks for the help.

                  Osman