1 2 Previous Next 15 Replies Latest reply: Jul 14, 2011 12:52 PM by urimend RSS

    Problem compiling using ICC

    urimend

      Hi,

       

      I tried to compile according to http://communities.intel.com/thread/15499.

       

      Most of the issues did solved, but I still get the following:

      icc -o exe/app objs/*.o /home/urimend/rcce/bin/SCC_LINUX/libRCCE_bigflags_gory_nopwrmgmt.a -O3  -DSCC -DSHMADD -i-static -mcpu=pentium -gcc-version=340 -cxxlib-icc -I/opt/icc-8.1.038/include/c++ -L/opt/i386-unknown-linux-gnu/i386-unknown-linux-gnu/lib   -DGORY -I/home/urimend/rcce/include
      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

       

      Any ideas why icc still try to link with /usr/lib/ when I use the "-L/opt/i386-unknown-linux-gnu/i386-unknown-linux-gnu/lib" option?

       

      Thanks,

       

      Uri

        • 1. Re: Problem compiling using ICC
          tedk

          Here are some simple questions to just rule out the obvious.....

           

          What do you see when you issue "which icc"?

          What do you see when you issue "which gcc"?

          Can you successfully compile and execute straight C code (not C++ code)?

          Did you try compiling with icpc instead of icc?

          Can you successfully compile the simple hello.cpp?

          How large is your example? Can you post a simple code example here that illustrates the error? Along with a makefile.

          Are you working on one of our Data Center systems or is this your own MCPC/SCC system?

           

          We can try out some simple stuff in the Forum, but if this gets complicated we should file a Bigzilla and move the discussion there.

          • 2. Re: Problem compiling using ICC
            tedk

            What do we have two copies of this post? Strange.

            • 3. Re: Problem compiling using ICC
              urimend

              I work on your servers.

               

              marc011:~/rcce/apps/INVERT> which icc
              /opt/icc-8.1.038/bin//icc
              marc011:~/rcce/apps/INVERT> which gcc
              /usr/bin/gcc

              I can't compile anything, including ANSI-C code, and including this:

               

              #include "RCCE.h"
              int RCCE_APP(int argc, char **argv){

              RCCE_init(&argc, &argv);

              int ID = RCCE_ue();
              printf("core %d", ID);

              RCCE_finalize();
              return 0;

              }

               

              icpc causes the same errors.

               

              the exact command is:

              icc -o app main.c /home/urimend/rcce/bin/SCC_LINUX/libRCCE_bigflags_gory_nopwrmgmt.a -O3  -DSCC -DSHMADD -i-static -mcpu=pentium -gcc-version=340 -cxxlib-icc -I/opt/icc-8.1.038/include/c++ -L/opt/i386-unknown-linux-gnu/i386-unknown-linux-gnu/lib   -DGORY -I/home/urimend/rcce/include

               

              Thanks

              • 4. Re: Problem compiling using ICC
                tedk

                It looks as if you are not accessing the correct gcc. When you see

                 

                marc011:~/rcce/apps/INVERT> which gcc
                /usr/bin/gcc

                you should see

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

                 

                Can you post the script that you source to get your path? icc uses gcc under the covers.

                • 5. Re: Problem compiling using ICC
                  urimend

                  I tried:

                  setenv PATH /opt/i386-unknown-linux-gnu/bin/\:$PATH

                  and got:

                  marc011:~/rcce/apps/INVERT> icc -o exe/app /home/urimend/rcce/bin/SCC_LINUX/libRCCE_bigflags_gory_nopwrmgmt.a -O3  -DSCC -DSHMADD -i-static -mcpu=pentium -gcc-version=340 -cxxlib-icc -I/opt/icc-8.1.038/include/c++ -L/opt/i386-unknown-linux-gnu/i386-unknown-linux-gnu/lib   -DGORY -I/home/urimend/rcce/include
                  ld: /proj/MCEMU/modules/crosstool/0.42.1/gcc-3.4.5-glibc-2.3.6/i386-unknown-linux-gnu/lib/gcc/i386-unknown-linux-gnu/3.4.5/crtbegin.o: No such file: No such file or directory

                  Any ideas?

                  • 6. Re: Problem compiling using ICC
                    tedk

                    Please kill whatever shell you have. The start a new shell and source the file crosscompile.sh in your bin. That file should have the follwong lines in it. If you don't have such a file, please create it. Issue the command "source crosscompile.sh".  This will put all the compiler and associated libraries in your path. You need to source that file for every new shell.

                    #!/bin/bash

                    if [ -z "${PATH}" ]
                    then
                        PATH="/opt/icc-8.1.038/bin:/opt/i386-unknown-linux-gnu/bin"; export PATH
                    else
                        PATH="/opt/icc-8.1.038/bin:/opt/i386-unknown-linux-gnu/bin:$PATH"; export PATH
                    fi

                    if [ -z "${LD_LIBRARY_PATH}" ]
                    then
                        LD_LIBRARY_PATH="/opt/icc-8.1.038/lib:/opt/i386-unknown-linux-gnu/lib"; export LD_LIBRARY_PATH
                    else
                        LD_LIBRARY_PATH="/opt/icc-8.1.038/lib:/opt/i386-unknown-linux-gnu/lib:$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH
                    fi

                    • 7. Re: Problem compiling using ICC
                      urimend

                      I followed this, and I still get:

                      urimend@marc011:~/rcce/apps/INVERT$ make run
                      icc -o exe/app objs/*.o /home/urimend/rcce/bin/SCC_LINUX/libRCCE_bigflags_gory_nopwrmgmt.a -O3  -DSCC -DSHMADD -i-static -mcpu=pentium -gcc-version=340 -cxxlib-icc -I/opt/icc-8.1.038/include/c++ -L/opt/i386-unknown-linux-gnu/i386-unknown-linux-gnu/lib   -DGORY -I/home/urimend/rcce/include
                      ld: /proj/MCEMU/modules/crosstool/0.42.1/gcc-3.4.5-glibc-2.3.6/i386-unknown-linux-gnu/lib/gcc/i386-unknown-linux-gnu/3.4.5/crtbegin.o: No such file: No such file or directory
                      make: *** [exe/app] Error 1
                      urimend@marc011:~/rcce/apps/INVERT$ echo $PATH
                      /opt/icc-8.1.038/bin:/opt/i386-unknown-linux-gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/sccKit/1.3.0/bin:/opt/sccKit/1.3.0/bin
                      urimend@marc011:~/rcce/apps/INVERT$ echo $LD_LIBRARY_PATH
                      /opt/icc-8.1.038/lib:/opt/i386-unknown-linux-gnu/lib::/opt/sccKit/lib:/opt/sccKit/lib

                      icc insist on using /proj - which doesn't exist...

                       

                      I even tried:

                      urimend@marc011:~/rcce/apps/INVERT$ icc -o exe/app /opt/i386-unknown-linux-gnu/lib/gcc/i386-unknown-linux-gnu/3.4.5/crtbegin.o objs/*.o /home/urimend/rcce/bin/SCC_LINUX/libRCCE_bigflags_gory_nopwrmgmt.a -O3  -DSCC -DSHMADD -i-static -mcpu=pentium -gcc-version=340 -cxxlib-icc -I/opt/icc-8.1.038/include/c++ -L/opt/i386-unknown-linux-gnu/i386-unknown-linux-gnu/lib   -DGORY -I/home/urimend/rcce/include
                      ld: /proj/MCEMU/modules/crosstool/0.42.1/gcc-3.4.5-glibc-2.3.6/i386-unknown-linux-gnu/lib/gcc/i386-unknown-linux-gnu/3.4.5/crtbegin.o: No such file: No such file or directory

                      ...

                      • 8. Re: Problem compiling using ICC
                        tedk

                        Are you on marc011 right now? I'll go take a look.

                        • 9. Re: Problem compiling using ICC
                          tedk

                          What does your app do? I copied over your INVERT directory into my area and did a make build and got

                          tekubasx@marc011:~/sandbox/rcce/apps/INVERT$ make build
                          icc -o exe/app objs/*.o /home/tekubasx/sandbox/rcce/bin/SCC_LINUX/libRCCE_bigflags_gory_nopwrmgmt.a -O3  -DSCC -DSHMADD -static -mcpu=pentium -gcc-version=340 -I../include   -DGORY -I/home/tekubasx/sandbox/rcce/include
                          tekubasx@marc011:~/sandbox/rcce/apps/INVERT$ ls -l exe/app
                          -rwxr-x--- 1 tekubasx admin 473649 2011-07-14 10:16 exe/app
                          tekubasx@marc011:~/sandbox/rcce/apps/INVERT$

                           

                          What happens if I run it?

                          • 10. Re: Problem compiling using ICC
                            urimend

                            You can do what you want...

                             

                            How can I send messages to you on the marc?

                            • 11. Re: Problem compiling using ICC
                              tedk

                              Here's what I get when I run your app on 4 nodes. Is this what you would expect?

                               

                              tekubasx@marc011:/shared/tekubasx$ rccerun -nue 4 -f rc.hosts app
                              pssh -h PSSH_HOST_FILE.10440 -t -1 -p 4 /shared/tekubasx/mpb.10440 < /dev/null
                              [1] 10:26:02 [SUCCESS] rck01
                              [2] 10:26:02 [SUCCESS] rck02
                              [3] 10:26:02 [SUCCESS] rck00
                              [4] 10:26:02 [SUCCESS] rck03
                              pssh -h PSSH_HOST_FILE.10440 -t -1 -P -p 4 /shared/tekubasx/app 4 0.533 00 01 02 03 < /dev/null
                              rck03: core 3
                              rck00: core 0
                              rck01: core 1
                              rck02: core 2
                              [1] 10:26:14 [SUCCESS] rck01
                              [2] 10:26:14 [SUCCESS] rck02
                              [3] 10:26:14 [SUCCESS] rck03
                              [4] 10:26:14 [SUCCESS] rck00
                              tekubasx@marc011:/shared/tekubasx$

                              • 12. Re: Problem compiling using ICC
                                tedk

                                The messages I am sending you on marc011 ... I am using the Linux write command.

                                Type write <uername> <return>

                                Type your message

                                Type control-D to end it

                                • 13. Re: Problem compiling using ICC
                                  urimend

                                  Running it will cause exactly 4 UEs to print:

                                  UE <UE_ID>

                                   

                                  I compiled only this for debugging...

                                   

                                  Any ideas why I can't compile?

                                  • 14. Re: Problem compiling using ICC
                                    tedk

                                    I put a cmdcapture.txt in your home on marc011. It illustrates a build and run procedure for your simple example. I was running as you.

                                     

                                    You had changed the options under which RCCE was built. RCCE is C, not C++. It looked as if you were editing symbols and not symbols.in. The symbols.in is really symbols.in<put>. The file symbols is created by the RCCE configure. You shouldn't edit symbols.

                                     

                                    The Makefile you were using invoked rccerun with the -emulator switch. But all your code was not built for the emulator. Also, your executable must be under /shared. This is the directory that is mounted on the cores. What people often do is put a cp in the Makefile that copies the executable to your user directory under /shared. Then, cd to that directory and run rccerun.

                                     

                                    I also added a script in your bin that puts rccerun in your path and copied rc.hosts to your directory under /shared.

                                     

                                    This casues that simple example to run OK. Looking at your files I see some sophisticated numerics stuff. This won't be as easy as the simple example, but worth doing. Please look at Bug 74 for information about how to add C++ code   http://marcbug.scc-dc.com/bugzilla3/show_bug.cgi?id=74

                                     

                                    Please don't hesitate to ask for further clarification or to get over some humps when you do the "real" stuff.

                                    1 2 Previous Next