11 Replies Latest reply on Aug 21, 2010 3:53 AM by Brane2

    Gentoo install problem & problem with using -mp option...

    Brane2

      I tried to install Open64-4.2.3.1 on my Gentoo and even with tweaks, listed in "INSTALL" for "Ubuntu" and "Red Hat" I can not finish install successfully without changing the line for library compilation from:

       

      make lib MACHINE_TYPE=i386 BUILD_COMPILER=OSP


      to

       

      export MACHINE_TYPE=i386 ; make lib  BUILD_COMPILER=OSP


      Error manifests itself at the very end of compilation with:

       

      make[3]: Nothing to be done for `first'.

      make make_libdeps

      C      /usr/src/x86_open64-4.2.3.1/osprey/targia32_builtonia32/libdwarf/../../libdwarf/dwarfdump/dwarfdump.c

      C      /usr/src/x86_open64-4.2.3.1/osprey/targia32_builtonia32/libdwarf/../../libdwarf/dwarfdump/makename.c

      C      /usr/src/x86_open64-4.2.3.1/osprey/targia32_builtonia32/libdwarf/../../libdwarf/dwarfdump/tag_attr.c

      collect2: ld terminated with signal 11 [Segmentation fault]

      /usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.so when searching for -lc

      /usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.a when searching for -lc

      /usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/../lib/crt1.o' is incompatible with i386 output

      /usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/../lib/crti.o' is incompatible with i386 output

      /usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/../lib/crtn.o' is incompatible with i386 output

      make[3]: *** [tag_attr_build] Error 1

      make[2]: *** [default] Error 2

      make[1]: *** [default] Error 2

      make[1]: Leaving directory `/usr/src/x86_open64-4.2.3.1/osprey/targia32_builtonia32'

      make: *** [lib] Error 2        



      When I change line to second form, everything compiles O.K.

      A

      lso, when I try to compile anything, even the trivial few-lines-example with "-mp" flag, I get errors like:

       

      undefined reference to `__ompc_can_fork'

      undefined reference to `omp_get_num_threads()'



       

      It seems as if compiler forgot to link in openmp part of library or something like that...

      Without the "-mp", everything compiles fine...

      I might also mention that I have several versions of gcc on the system (3.4.6 , 4.1.2 , 4.2.4 , 4.3.4 and 4.4.3 ) with 4.4.3 as an active one during instalation and usage...

       

        • Gentoo install problem & problem with using -mp option...
          dgilmore

          In response to your first question, I have a question:
          are you building on a 32 or 64 bit machine?

          About your second question:
          That's strange osprey/driver/phases.c contains:

                      if (option_was_seen(O_mp) ||
                          option_was_seen(O_apo) ||       // bug 6334
                          option_was_seen(O_fopenmp)) {
                          add_string(args, "-lopenmp");
                      }

          Note that option_was_seen(O_mp) wil be true when -mp is supplied.

          What command line did you supply?

          BTW, I was wondering why you were building from source -- are
          there issues with the binary distribution?

          Doug

            • Gentoo install problem & problem with using -mp option...
              Brane2

               

              Originally posted by: dgilmore In response to your first question, I have a question: are you building on a 32 or 64 bit machine?


              I am using 64-bit machine. 

               

               

              About your second question: That's strange osprey/driver/phases.c contains:

               

                          if (option_was_seen(O_mp) ||                 option_was_seen(O_apo) ||       // bug 6334                 option_was_seen(O_fopenmp)) {                 add_string(args, "-lopenmp");             }

               

              Note that option_was_seen(O_mp) wil be true when -mp is supplied.

               

              What command line did you supply? 

              I tried with :

               

               openCC -march=barcelona -O2 -m64 -mp stream.c -o stream


              and  then

               

               openCC  -march=barcelona -O2 -m64 -mp -lopenmp stream.c -o stream


              Both give same results. After that I searched for libopenmp.so and added directory where it is located with "-L /usr/local/lib/gcc-lib/x86_64-open64-linux/4.2.3.1" and then tried even with 32-bit version out of despair -with same results.

               

              • Gentoo install problem & problem with using -mp option...
                Brane2

                BTW, I was wondering why you were building from source -- are there issues with the binary distribution?

                Doug

                 

                I thought that having compiled it from source gives its infrastructure chance to adapt to my system. 

                But it seems that this creates much more trouble than it solves. Also, I wanted to see how system compiles itself as indication of its state...

                  • Gentoo install problem & problem with using -mp option...
                    Brane2

                    One more thing: I just did an:

                     

                     

                    readelf -s libopenmp.so.1 | grep "__ompc_can_fork"


                    and 

                     

                    readelf -s 32/libopenmp.so.1 | grep "__ompc_can_fork"


                     

                    It turns out that symbol is in 32-bit version of the library but not in 64-bit one...

                    So, i tried using "-m32" instead of "-m64".

                    Compiling fails, but now there is just one missing referrence:

                     

                    undefined reference to `omp_get_num_threads()


                     

                    i tried listing symbols in bot versions of libopenmp and it turns out that both versions have that function listed- twice- once as weak symbol and once as global definition. Which seems fine...

                      • Gentoo install problem & problem with using -mp option...
                        Brane2

                        Here is small script that I wrote for compiling: 

                         

                         

                        #! /bin/bash

                         

                        export TOOLROOT=/usr/src/x86_open64-4.2.3.1_bin

                        export PATH=${TOOLROOT}/bin:$PATH

                         

                        [ "$1" == "clobber" ] && { echo "CLEANING!\n\n" ; make clobber ; rm -f MADE_* ./*_****** ; exit ; }

                        make all MACHINE_TYPE=i386 && touch MADE_COMPILER || touch COMPILER_******

                         

                        # [ -f MADE_COMPILER ] && {  make lib MACHINE_TYPE=i386 BUILD_COMPILER=OSP && touch MADE_LIB  || touch LIB_****** ; }

                        [ -f MADE_COMPILER ] && {  export MACHINE_TYPE=i386 ; make lib  BUILD_COMPILER=OSP && touch MADE_LIB  || touch LIB_****** ; }

                        [ -f MADE_LIB ] && { make -C osprey/targx8664_builtonia32 BUILD_COMPILER=OSP && touch MADE_NEWCOMPILER || touch NEWCOMPILER_****** ; }

                         

                          • Gentoo install problem & problem with using -mp option...
                            dgilmore

                             

                            Originally posted by: Brane2 Here is small script that I wrote for compiling: 

                             

                             

                             

                             

                             

                             

                            #! /bin/bash

                             

                             

                             

                            export TOOLROOT=/usr/src/x86_open64-4.2.3.1_bin

                             

                            export PATH=${TOOLROOT}/bin:$PATH

                             

                             

                             

                            [ "$1" == "clobber" ] && { echo "CLEANING!\n\n" ; make clobber ; rm -f MADE_* ./*_****** ; exit ; }

                             

                            make all MACHINE_TYPE=i386 && touch MADE_COMPILER || touch COMPILER_******

                             

                             

                             

                            # [ -f MADE_COMPILER ] && {  make lib MACHINE_TYPE=i386 BUILD_COMPILER=OSP && touch MADE_LIB  || touch LIB_****** ; }

                             

                            [ -f MADE_COMPILER ] && {  export MACHINE_TYPE=i386 ; make lib  BUILD_COMPILER=OSP && touch MADE_LIB  || touch LIB_****** ; }

                             

                            [ -f MADE_LIB ] && { make -C osprey/targx8664_builtonia32 BUILD_COMPILER=OSP && touch MADE_NEWCOMPILER || touch NEWCOMPILER_****** ; }

                             

                             

                             

                            Your build script seems OK, BTW, the purpose of the lasat make is not to build a new compiler, just to build the 64 bit runtime that the newly built compiler will use.

                            Doug

                        • Gentoo install problem & problem with using -mp option...
                          dgilmore

                           

                          Originally posted by: Brane2


                           

                          BTW, I was wondering why you were building from source -- are there issues with the binary distribution?

                           

                          Doug

                           

                           

                           

                           

                          I thought that having compiled it from source gives its infrastructure chance to adapt to my system. 

                           

                          But it seems that this creates much more trouble than it solves. Also, I wanted to see how system compiles itself as indication of its state...

                           

                          Right, better build configuration is an issue we are trying to address (though that may take some time to work out).  So it is best to use the existing compiler binaries if you can, and if you really want to do compiler development, build on SLES10 or RHEL5.

                          Did you try your stream example using the existing compiler binaries?

                           

                            • Gentoo install problem & problem with using -mp option...
                              Brane2

                               

                              Right, better build configuration is an issue we are trying to address (though that may take some time to work out).  So it is best to use the existing compiler binaries if you can, and if you really want to do compiler development, build on SLES10 or RHEL5.

                               

                              Did you try your stream example using the existing compiler binaries?

                               

                               



                               

                              I did. It works with 64-bit code and with 32-bit code ( regardless of -mp) it fails with 

                               

                               

                              /usr/src/x86_open64-4.2.3.1_bin/lib/gcc-lib/x86_64-open64-linux/4.2.3.1/ipa_link: skipping incompatible /usr/lib/../lib//libc.so when searching for -lc

                              /usr/src/x86_open64-4.2.3.1_bin/lib/gcc-lib/x86_64-open64-linux/4.2.3.1/ipa_link: skipping incompatible /usr/lib/../lib//libc.a when searching for -lc

                              /usr/src/x86_open64-4.2.3.1_bin/lib/gcc-lib/x86_64-open64-linux/4.2.3.1/ipa_link: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/../../../../lib64/libc.so when searching for -lc

                              /usr/src/x86_open64-4.2.3.1_bin/lib/gcc-lib/x86_64-open64-linux/4.2.3.1/ipa_link: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/../../../../lib64/libc.a when searching for -lc

                              /usr/src/x86_open64-4.2.3.1_bin/lib/gcc-lib/x86_64-open64-linux/4.2.3.1/ipa_link: cannot find -lc

                              openCC INTERNAL ERROR: /usr/src/x86_open64-4.2.3.1_bin/lib/gcc-lib/x86_64-open64-linux/4.2.3.1/ipa_link returned non-zero status 1

                               

                               

                                • Gentoo install problem & problem with using -mp option...
                                  RaghavendraSwamy

                                  Hi,

                                   

                                  -    Under GENTOO the library folder organization is as follows,

                                  §  /lib points to /lib64 ( soft link )

                                  §  /usr/lib points to /usr/lib64 ( soft link )

                                  -    Since the open64 compiler is by default built as 32 bit binaries, The “ld” fails while linking with 64 bit object as reported.

                                  -    Stream benchmark build also has the similar issue as explained above when build under –m32 bit.

                                  -    To resolve, include the “–L/usr/lib32/” in the following command,

                                  “opencc –m32 –mp stream_d.c second_cpu.c –lm –L/usr/lib32/”

                                   

                                  Thanks and regards,

                                  AMD x86 open64 compiler support engineer.

                                   

                                   

                                  -------------------------
                                  The information presented in this document is for informational purposes only and may contain technical inaccuracies, omissions and typographical errors. Links to third party sites are for convenience only, and no endorsement is implied.