problem with the library

This is a discussion on problem with the library within the C Programming forums, part of the General Programming Boards category; before i write anything.. tell me if this is correct : Code: the path to the lib directory is /compiler/fftw-3.1.1/lib ...

  1. #16
    Eager young mind
    Join Date
    Jun 2006
    Posts
    342
    before i write anything..
    tell me if this is correct :
    Code:
           the path to the lib directory is /compiler/fftw-3.1.1/lib
           the path to the include dir is  /compiler/fftw-3.1.1/include
    
            the include dir contains :  fftw3.f  fftw3.h
     
            the lib dir contains  :  libfftw3.a  libfftw3.la  pkgconfig
       
       so, at the prompt i must be entering :
     mpicc -v -I/compiler/fftw-3.1.1/include  prog6.c -L/compiler/fftw-3.1.1/lib -lfftw3

    sorry about that ,
    this happened now:

    Code:
       mpicc -v  -I/compiler/fftw-3.1.1/include  prog6.c -L/compiler/fftw-3.1.1/lib -lfftw3
    mpicc for 1.2.6 (release) of : 2004/08/04 11:10:38
    Reading specs from /usr/lib/gcc-lib/x86_64-unknown-linux/3.2.3/specs
    Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=x86_64-unknown-linux
    Thread model: posix
    gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-42)
     /usr/lib/gcc-lib/x86_64-unknown-linux/3.2.3/cc1 -lang-c -v -I/compiler/fftw-3.1.1/include -I///usr/local/ibgd/mpi/gcc/mvapich-0.9.5-mlx1.0.2/include -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=3 -D__GXX_ABI_VERSION=102 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=x86_64 -Amachine=x86_64 -D__x86_64 -D__x86_64__ -D__SIZE_TYPE__=unsigned long int -D__PTRDIFF_TYPE__=long int -D__tune_athlon__ -D__tune_athlon_sse__ -D__LONG_MAX__=9223372036854775807L -D__LP64__ -D_LP64 -DUSE_STDARG -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDARG_H=1 -DUSE_STDARG=1 -DMALLOC_RET_VOID=1 prog6.c -quiet -dumpbase prog6.c -version -o /tmp/cc7w4SDb.s
    GNU CPP version 3.2.3 20030502 (Red Hat Linux 3.2.3-42) (cpplib) (x86-64 Linux/ELF)
    GNU C version 3.2.3 20030502 (Red Hat Linux 3.2.3-42) (x86_64-unknown-linux)
            compiled by GNU C version 3.2.3 20030502 (Red Hat Linux 3.2.3-42).
    ignoring nonexistent directory "/usr/x86_64-unknown-linux/include"
    #include "..." search starts here:
    #include <...> search starts here:
     /compiler/fftw-3.1.1/include
     /usr/local/ibgd/mpi/gcc/mvapich-0.9.5-mlx1.0.2/include
     /usr/local/include
     /usr/lib/gcc-lib/x86_64-unknown-linux/3.2.3/include
     /usr/include
    End of search list.
    prog6.c: In function `main':
    prog6.c:92: warning: assignment makes pointer from integer without a cast
     as -V -Qy -o prog6.o /tmp/cc7w4SDb.s
    GNU assembler version 2.14.90.0.4 (x86_64-unknown-linux) using BFD version 2.14.90.0.4 20030523
    Reading specs from /usr/lib/gcc-lib/x86_64-unknown-linux/3.2.3/specs
    Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=x86_64-unknown-linux
    Thread model: posix
    gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-42)
      /usr/lib/gcc-lib/x86_64-unknown-linux/3.2.3/collect2 --eh-frame-hdr -m elf_x86_64 -Y P,/usr/lib64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/gcc-lib/x86_64-unknown-linux/3.2.3/../../../../lib64/crt1.o /usr/lib/gcc-lib/x86_64-unknown-linux/3.2.3/../../../../lib64/crti.o /usr/lib/gcc-lib/x86_64-unknown-linux/3.2.3/crtbegin.o -L///usr/local/ibgd/mpi/gcc/mvapich-0.9.5-mlx1.0.2/lib/shared -L///usr/local/ibgd/mpi/gcc/mvapich-0.9.5-mlx1.0.2/lib -L/compiler/fftw-3.1.1/lib -L//usr/local/ibgd/driver/infinihost/lib64 -L/usr/lib/gcc-lib/x86_64-unknown-linux/3.2.3 -L/usr/lib/gcc-lib/x86_64-unknown-linux/3.2.3/../../../../lib64 -L/usr/lib/gcc-lib/x86_64-unknown-linux/3.2.3/../../.. -L/lib/../lib64 -L/usr/lib/../lib64 -rpath-link ///usr/local/ibgd/mpi/gcc/mvapich-0.9.5-mlx1.0.2/lib/shared prog6.o -lfftw3 -lmpich -lmtl_common -lvapi -lmosal -lmpga -lpthread -lgcc -lgcc_eh -lc -lgcc -lgcc_eh /usr/lib/gcc-lib/x86_64-unknown-linux/3.2.3/crtend.o /usr/lib/gcc-lib/x86_64-unknown-linux/3.2.3/../../../../lib64/crtn.o
    prog6.o(.text+0x301): In function `main':
    : undefined reference to `fttw_plan_dft_r2r_1d'
    /compiler/fftw-3.1.1/lib/libfftw3.a(mapflags.o)(.text+0x80): In function `timelimit_to_flags':
    : undefined reference to `log'
    /compiler/fftw-3.1.1/lib/libfftw3.a(mapflags.o)(.text+0x93): In function `timelimit_to_flags':
    : undefined reference to `log'
    /compiler/fftw-3.1.1/lib/libfftw3.a(trig.o)(.text+0x92): In function `real_cexp':
    : undefined reference to `fastsincos'
    /compiler/fftw-3.1.1/lib/libfftw3.a(trig.o)(.text+0x187): In function `real_cexp':
    : undefined reference to `fastsincos'
    /compiler/fftw-3.1.1/lib/libfftw3.a(trig.o)(.text+0x1c2): In function `real_cexp':
    : undefined reference to `fastsincos'
    collect2: ld returned 1 exit status
    i get a new set of errors now..
    I havent even used the `fastsincos' or the 'log' or `real_cexp' in my prog anywhere

  2. #17
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,854
    Ah - progress
    Now it's finding your fftw library, but it has dependencies on something else.

    Both those look like math functions, so I would have
    Code:
    mpicc -v  -I/compiler/fftw-3.1.1/include  prog6.c -L/compiler/fftw-3.1.1/lib -lfftw3 -lm
    That should get log(), but I'm not familiar with fastsincos()
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #18
    Eager young mind
    Join Date
    Jun 2006
    Posts
    342
    yeah,.. that kicks log() out..

    Code:
       In function `main':
    : undefined reference to `fttw_plan_dft_r2r_1d'
    /compiler/fftw-3.1.1/lib/libfftw3.a(trig.o)(.text+0x92): In function `real_cexp':
    : undefined reference to `fastsincos'
    /compiler/fftw-3.1.1/lib/libfftw3.a(trig.o)(.text+0x187): In function `real_cexp':
    : undefined reference to `fastsincos'
    /compiler/fftw-3.1.1/lib/libfftw3.a(trig.o)(.text+0x1c2): In function `real_cexp':
    : undefined reference to `fastsincos'
    collect2: ld returned 1 exit status
    but ,if its finding the lib ,then why am i still getting
    Code:
      
     In function `main':
    : undefined reference to `fttw_plan_dft_r2r_1d'
    how do i get rid of fastsincos now??
    will running a "check" on the hpc help? it helped me on my machine atleast..

  4. #19
    Eager young mind
    Join Date
    Jun 2006
    Posts
    342
    Code:
        prog6.o(.text+0x301): In function `main':
    : undefined reference to `fttw_plan_dft_r2c_1d'
    is now gone too...

    Apparently, fastsincos is an AMD core Math Lib. the cluster here uses AMD processors..
    does this mean, that the fastsincos lib is not installed on the cluster here??

    The source code for the lib file is here:
    http://darwinsource.opendarwin.org/1...j/FastSinCos.c

    So, shul i ask teh administrator to put this in the cluster lib too..
    Will, this solve the problem?
    Last edited by kris.c; 07-06-2006 at 03:49 AM.

  5. #20
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,854
    Well if you have the source, and it's self-contained (doesn't have any external dependencies), then you can just add it to the list of files to compile.

    > So, shul i ask teh administrator to put this in the cluster lib too..
    Seems like a useful thing to have around, if the package does more stuff than just sincos.

    > Will, this solve the problem?
    Maybe - have you read all the instructions on the FFTW site to check for dependency lists, build requirements etc.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  6. #21
    Eager young mind
    Join Date
    Jun 2006
    Posts
    342
    well ,the problem is kind back again :
    the ACML has been downloaded on the cluster .

    Code:
              the location of the include dir is :
           /compiler/acml3.1.0/pathscale64
     
             the contents of the include dir are :
           acml.h  acml_mv.h  acml_mv_m128.h
    
             the location of the lib dir is :
             /compiler/acml3.1.0/pathscale64
    
             the contents of the lib dir are :
            libacml.a  libacml_mv.a  libacml_mv.so  libacml.so
    so, as in my previous attempt this is what i tried :

    Code:
           mpicc -I/compiler/fftw-3.1.1/include -I/compiler/acml3.1.0/pathscale64/include prog6.c -L/compiler/fftw-3.1.1/lib -L/compiler/acml3.1.0/pathscale64/lib -lfftw3 -lacml -lm
    and this is what i got :

    Code:
      
         /usr/bin/ld: warning: libacml_mv.so, needed by /compiler/acml3.1.0/pathscale64/lib/libacml.so, not found (try using -rpath or -rpath-link)
    /compiler/fftw-3.1.1/lib/libfftw3.a(trig.o)(.text+0x92): In function `real_cexp':
    : undefined reference to `fastsincos'
    /compiler/fftw-3.1.1/lib/libfftw3.a(trig.o)(.text+0x187): In function `real_cexp':
    : undefined reference to `fastsincos'
    /compiler/fftw-3.1.1/lib/libfftw3.a(trig.o)(.text+0x1c2): In function `real_cexp':
    : undefined reference to `fastsincos'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `vcosf'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `__powdi'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `__powri'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `_index90'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `vrda_sincos_'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `vexp'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `vrsa_sincosf_'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `vrsa_logf_'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `s_cmp'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `vrda_log_'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `vrda_exp_'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `_F90_STOP'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `vexpf'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `s_cat'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `__powii'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `vcos'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `_FWF'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `vrsa_expf_'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `_FRF'
    /compiler/acml3.1.0/pathscale64/lib/libacml.so: undefined reference to `s_copy'
    collect2: ld returned 1 exit status
    what's happening now??
    what are .so files? what is the -rpath message that it is showing?

  7. #22
    Eager young mind
    Join Date
    Jun 2006
    Posts
    342

    Thumbs up

    I could get it sorted out.. IT was quite complicated becasue of chaining dependencies.. fftw reqd acml, acml required something related to pathfortran and pathcc...
    thanks anyway..

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. undefined Reference when linking a library
    By steve1_rm in forum C Programming
    Replies: 7
    Last Post: 03-12-2008, 06:34 PM
  2. Templates from DLL or static library problem
    By mikahell in forum C++ Programming
    Replies: 2
    Last Post: 01-01-2008, 01:49 AM
  3. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  4. Bin packing problem....
    By 81N4RY_DR460N in forum C++ Programming
    Replies: 0
    Last Post: 08-01-2005, 06:20 AM
  5. Problem With WinPcap library
    By DrMario in forum C Programming
    Replies: 0
    Last Post: 03-26-2005, 11:26 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21