Menu

relocation truncated to fit: R_X86_64_PC32 error

Anonymous
2019-04-18
2020-03-31
  • Anonymous

    Anonymous - 2019-04-18

    Discussion moved from here

    Dear Prof. Meyer,
    Thanks for your quick reply!
    I have tried what you suggested, but it still did not work.
    By the way, when I run the following code :(according to the post Calculating reaction rates)
    cd nucnet-tools-code/build
    make clean_all
    make -f Makefile.libnucnet all_libnucnet
    I got a similar error saying:
    /tmp/ccArEZHJ.o:In function ‘main’:
    /home/David/nucnet-tools-code/build/../vendor/libnucnet/0.35/src/../examples/average_zones.c:152:undefined reference to ‘gsl_vector_scale’
    /home/David/nucnet-tools-code/build/../vendor/libnucnet/0.35/src/../examples/average_zones.c:152:(.text+0x3ac): relocation truncated to fit: R_X86_64_PC32 against undefined symbol gsl_vector_scale
    /home/David/nucnet-tools-code/build/../vendor/libnucnet/0.35/src/../examples/average_zones.c:154:undefined reference to ‘gsl_vector_add’
    /home/David/nucnet-tools-code/build/../vendor/libnucnet/0.35/src/../examples/average_zones.c:154:(.text+0x3c2): relocation truncated to fit: R_X86_64_PC32 against undefined symbol gsl_vector_add
    /home/David/nucnet-tools-code/build/../vendor/libnucnet/0.35/src/../examples/average_zones.c:166:undefined reference to ‘gsl_vector_scale’
    /home/David/nucnet-tools-code/build/../vendor/libnucnet/0.35/src/../examples/average_zones.c:166:(.text+0x408): relocation truncated to fit: R_X86_64_PC32 against undefined symbol gsl_vector_scale
    collect2: error: ld returned 1 exit status
    make: *** [Makefile.libnucnet:84: average_zones] Error 1"
    I am not sure if these two problems might have a same origin.
    Best wishes.

     
    • Bradley S. Meyer

      Thanks for this post. The problem you encountered is more subtle than I first realized. I wonder if you can reply and tell me the kind of computer and operating system you have. In the meantime, I'll read on this issue. Best wishes.

       
  • Anonymous

    Anonymous - 2019-04-19

    Dear Prof. Meyer,

    Thanks for your reply.
    My computer is Lenovo Thinkpad X280 based on x64 CPU with 64-bit Windows 10 operating system.

    Best wishes.

     
    • Bradley S. Meyer

      Thanks. Are you running cygwin? Also, what is the result of

      gsl-config --version

      Best wishes.

       
  • Anonymous

    Anonymous - 2019-04-20

    Dear Prof. Meyer,

    Yes, I am running cygwin. And the version of gsl is 2.3.
    Thanks for your attention!

    Best wishes.

     
    • Bradley S. Meyer

      Let's make sure the attached simple program test.c works. Try typing:

      gcc `gsl-config --cflags --libs` test.c 
      ./a.out
      

      I get

      v_0 = 1.845
      v_1 = 3.345
      v_2 = 4.845
      
       
      • Anonymous

        Anonymous - 2019-04-21

        Dear Prof. Meyer,

        After typting : gcc gsl-config --cflags --libs test.c
        it prints out:

        /tmp/ccynXjMh.o:test.c:(.text+0x13):undefined reference to ‘gsl_vector_alloc’
        /tmp/ccynXjMh.o:test.c:(.text+0x13): relocation truncated to fit: R_X86_64_PC32 against undefined symbol gsl_vector_alloc
        /tmp/ccynXjMh.o:test.c:(.text+0x21):undefined reference to ‘gsl_vector_alloc’
        /tmp/ccynXjMh.o:test.c:(.text+0x21): relocation truncated to fit: R_X86_64_PC32 against undefined symbol gsl_vector_alloc
        /tmp/ccynXjMh.o:test.c:(.text+0x49):undefined reference to ‘gsl_vector_set’
        /tmp/ccynXjMh.o:test.c:(.text+0x49): relocation truncated to fit: R_X86_64_PC32 against undefined symbol gsl_vector_set
        /tmp/ccynXjMh.o:test.c:(.text+0x67):undefined reference to ‘gsl_vector_set’
        /tmp/ccynXjMh.o:test.c:(.text+0x67): relocation truncated to fit: R_X86_64_PC32 against undefined symbol gsl_vector_set
        /tmp/ccynXjMh.o:test.c:(.text+0x81):undefined reference to ‘gsl_vector_add’
        /tmp/ccynXjMh.o:test.c:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against undefined symbol gsl_vector_add
        /tmp/ccynXjMh.o:test.c:(.text+0x99):undefined reference to ‘gsl_vector_scale’
        /tmp/ccynXjMh.o:test.c:(.text+0x99): relocation truncated to fit: R_X86_64_PC32 against undefined symbol gsl_vector_scale
        /tmp/ccynXjMh.o:test.c:(.text+0xb4):undefined reference to ‘gsl_vector_get’
        /tmp/ccynXjMh.o:test.c:(.text+0xb4): relocation truncated to fit: R_X86_64_PC32 against undefined symbol gsl_vector_get
        /tmp/ccynXjMh.o:test.c:(.text+0xfe):undefined reference to ‘gsl_vector_free’
        /tmp/ccynXjMh.o:test.c:(.text+0xfe): relocation truncated to fit: R_X86_64_PC32 against undefined symbol gsl_vector_free

        It seems there are some problems to link to GSL library, I found a post in which such a problem is discussed and another command is used to run the test file.

        So I tried typing:

        gcc test.c $(gsl-config --cflags --libs)
        ./a.exe

        I can get the same result with yours:
        v_0 = 1.845
        v_1 = 3.345
        v_2 = 4.845

        But I don't know what is the key point of such difference.

        Thank you.
        Best wishes.

         
        • Bradley S. Meyer

          Interesting. You might change the

          CINCLUDE += `xml2-config --cflags` \
                      `gsl-config --cflags`  \
                      -I$(LIBNUCNETDIR)      \
                      -I$(WNMATRIXDIR)       \
                      -I$(LIBSTATMECHDIR)    \
                      -I$(LIBNUCEQDIR)       \
                      -I$(NUCNET_TARGET)     \
          

          in the build/Makefile to

          CINCLUDE += $(xml2-config --cflags) \
                      $(gsl-config --cflags)  \
                      -I$(LIBNUCNETDIR)      \
                      -I$(WNMATRIXDIR)       \
                      -I$(LIBSTATMECHDIR)    \
                      -I$(LIBNUCEQDIR)       \
                      -I$(NUCNET_TARGET)     \
          

          And

            CLIBS += `xml2-config --libs` `gsl-config --libs`
          

          to

            CLIBS += $(xml2-config --libs) $(gsl-config --libs)
          

          and see what happens when you recompile. Let me know. Best wishes.

           

          Last edit: Bradley S. Meyer 2019-04-21
  • Anonymous

    Anonymous - 2019-04-22

    Dear Prof. Meyer,

    I type make -f Makefile.libnuceq clean
    make -f Makefile.libnuceq alllibnuceq
    It shows:

    In file included from ../vendor/wn_matrix/0.19/src/WnMatrix.c:40:0:
    ../vendor/wn_matrix/0.19/src/WnMatrix.h:49:10: fatal error:libxml/hash.h:No such file or directory

     
    • Bradley S. Meyer

      Do you have libxml2 installed? For example, what happens if you type

      xml2-config --version

      Best wishes.

       
  • Anonymous

    Anonymous - 2019-04-23

    Dear Prof. Meyer,

    I have installed libxml2, the result of xml2-config --version is 2.9.9

    Best wishes.

     
    • Bradley S. Meyer

      Thanks. I think the issue is that the Makefile is not executing the xml2-config and gsl-config commands. Let's try what we did above but indicate the shell command:

      CINCLUDE += `xml2-config --cflags` \
                  `gsl-config --cflags`  \
                  -I$(LIBNUCNETDIR)      \
                  -I$(WNMATRIXDIR)       \
                  -I$(LIBSTATMECHDIR)    \
                  -I$(LIBNUCEQDIR)       \
                  -I$(NUCNET_TARGET)     \
      

      in the build/Makefile to

      CINCLUDE += $(shell xml2-config --cflags) \
                  $(shell gsl-config --cflags)  \
                  -I$(LIBNUCNETDIR)      \
                  -I$(WNMATRIXDIR)       \
                  -I$(LIBSTATMECHDIR)    \
                  -I$(LIBNUCEQDIR)       \
                  -I$(NUCNET_TARGET)     \
      

      And

        CLIBS += `xml2-config --libs` `gsl-config --libs`
      

      to

        CLIBS += $(shell xml2-config --libs) $(shell gsl-config --libs)
      

      Note the addition of shell to what I suggested before. Then try recompiling. Let me know what happens. Best wishes.

       
  • Anonymous

    Anonymous - 2019-04-25

    Dear Prof. Meyer,

    I modified Makefile and then type:
    make -f Makefile.libnuceq cleanall_libnuceq
    make -f Makefile.libnuceq all_libnuceq

    It returns the same error as the very beginning, just like:
    /home/David/nucnet-tools-code/build/../vendor/libnuceq/0.7/src/../examples/compute_function_integrand_wse.c:376:undefined reference to ‘gsl_sf_fermi_dirac_half’
    /home/David/nucnet-tools-code/build/../vendor/libnuceq/0.7/src/../examples/compute_function_integrand_wse.c:376:(.text+0x981): relocation truncated to fit: R_X86_64_PC32 against undefined symbol 'gsl_sf_fermi_dirac_half'

    Best wishes.

     
    • Bradley S. Meyer

      This seems like it is getting very specific to your system. Could I ask you to contact me directly at mbradle at clemson dot edu? Thanks, and best wishes.

       
      • Anonymous

        Anonymous - 2020-03-31

        Dear Prof. Meyer,
        I am new here. I want to compute nuclear statistical equilibrium. I have downleded the C codes. Now i want to know how to use these codes? Is it necessary to have a linux system for it? Can i use C++ software for it?

         
        • Bradley S. Meyer

          I moved this discussion here.

           

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.