Results 1 to 10 of 10

Thread: libc Problem

  1. #1

    Default libc Problem

    Hi everyone,

    I am trying already couple of days now to compile a code (written partly in fortran and partly in c) but I keep getting this error:

    /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib64/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie
    collect2: error: ld returned 1 exit status

    This is what my makefile looks like:

    CFLAGS = -Wall -O3 -I ../../../SPOOLES.2.2 -DARCH="Linux" -DSPOOLES -DARPACK -DMATRIXSTORAGE -fPIE -m64
    FFLAGS = -Wall -O3 -fPIE -m64
    LDFLAGS = -pie $(LDFLAGS)

    CC=mpic++
    FC=gfortran

    .c.o :
    $(CC) $(CFLAGS) -c $<
    .f.o :
    $(FC) $(FFLAGS) -c $<

    include Makefile.inc

    SCCXMAIN = ccx_2.7.c

    OCCXF = $(SCCXF:.f=.o)
    OCCXC = $(SCCXC:.c=.o)
    OCCXMAIN = $(SCCXMAIN:.c=.o)

    DIR=../../../SPOOLES.2.2

    LIBS = \
    ../../../SPOOLES.2.2/spooles.a \
    ../../../ARPACK/libarpack_INTEL.a \
    /usr/lib64/libpthread.a /usr/lib64/libm.a /usr/lib64/libc.a

    ccx_2.7: $(OCCXMAIN) ccx_2.7.a $(LIBS)
    ./date.pl; $(CC) $(CFLAGS) -c ccx_2.7.c; $(FC) -Wall -O3 -o $@ $(OCCXMAIN) ccx_2.7.a $(LIBS)

    ccx_2.7.a: $(OCCXF) $(OCCXC)
    ar vr $@ $?

    I have opensuse 13.1 installed. Any help is welcome. I am not a programmer, I just use research codes written in fortran for my research in computational solid mechanics.

    Thank you in advance.

  2. #2
    Join Date
    Sep 2012
    Posts
    7,096

    Default Re: libc Problem

    Why you are explicitly using static libraries? You should use "-lpthread -lm" and let compiler pick either static or dynamic version depending on other flags. -lc is normally redundant and assumed as default (unless you explicitly tell compiler to not use standard libraries).

  3. #3

    Default Re: libc Problem

    Quote Originally Posted by arvidjaar View Post
    Why you are explicitly using static libraries? You should use "-lpthread -lm" and let compiler pick either static or dynamic version depending on other flags. -lc is normally redundant and assumed as default (unless you explicitly tell compiler to not use standard libraries).
    Thanks for your answer.

    When I write in the makefile -lpthread -lm -lc (or just ignore -lc) I get a lot of "undefined reference to" and also an error at the end. Problem seems to be even bigger then.

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,775

    Default Re: libc Problem

    Hello jorgosm and welcome to these forums.

    Not easy to detect for a new forums user here, but very important are the CODE tags. You get them by clicking on the # button in the tool bar of the post editor. You then copy/paste computer text from your terminal window in between the tags. This will make computer text in a post much better readable.

    When possible we prefer to copy from the terminal window the prompt, the command, the output and the next prompt. Then you do not have to explain very much about what you did, where you did it and what you got because it is all there.
    Henk van Velden

  5. #5
    Join Date
    Sep 2012
    Posts
    7,096

    Default Re: libc Problem

    Quote Originally Posted by jorgosm View Post
    When I write in the makefile -lpthread -lm -lc (or just ignore -lc) I get a lot of "undefined reference to"
    Well, that suggests that you may need more libraries. Post full makefile output (if it is long, upload it to susepaste.org and post link here).

  6. #6

    Default Re: libc Problem

    Quote Originally Posted by arvidjaar View Post
    Well, that suggests that you may need more libraries. Post full makefile output (if it is long, upload it to susepaste.org and post link here).
    I have written in the makefile -lpthread -lm -lc, all the other parts remain the same.

    http://susepaste.org/69085593

    Here is a link to the output.

    Thank you very much.

  7. #7
    Join Date
    Sep 2012
    Posts
    7,096

    Default Re: libc Problem

    Patch to build ccx 2.6 (https://build.opensuse.org/package/v...patch?expand=1) is using "-lspooles -larpack -llapack -lblas" instead of direct archives. Of course version 2.7 may need more changes.

    I would suggest you contact maintainer of ccx package for openSUSE (http://software.opensuse.org/package/ccx); may be ask for new version.

  8. #8

    Default Re: libc Problem

    Quote Originally Posted by arvidjaar View Post
    Patch to build ccx 2.6 (https://build.opensuse.org/package/v...patch?expand=1) is using "-lspooles -larpack -llapack -lblas" instead of direct archives. Of course version 2.7 may need more changes.

    I would suggest you contact maintainer of ccx package for openSUSE (http://software.opensuse.org/package/ccx); may be ask for new version.
    I think it worked!!!!! With just a small change about the lspooles!!!!

    Man you 're great! I would so buy you a nice cold bavarian beer man!

    Thanks!

  9. #9
    Join Date
    Sep 2012
    Posts
    7,096

    Default Re: libc Problem

    Well, if you are serious, I'm in Augsburg for two weeks starting with May the 5th

  10. #10

    Default Re: libc Problem

    Quote Originally Posted by arvidjaar View Post
    Well, if you are serious, I'm in Augsburg for two weeks starting with May the 5th

    Munich is quite close :-) And the beer is always cold, so if you drop by. Thanks again!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •