1 Reply Latest reply on Jun 24, 2009 5:35 PM by chipf

    GNU OpenMP Linking issues

    idg101

      I am using acml 4.2.0 and gcc 4.4 and when I try to compile, I get the following linking errors:

       

      12:34pm|sf1> make -f Makefile.integration_test.openmp
      g++ -I/mnt/ddn3/Geomatics/lib/acml4.2.0/gfortran64_mp/include  -L/mnt/ddn3/Geomatics/lib/gcc-4.4/lib64/ -L/mnt/ddn3/Geomatics/lib/acml4.2.0/gfortran64_mp/lib -lgfortran -lm -lpng -lstdc++ -lrt -lacml_mp integration_test.o CUls.o CNnls.o CUtils.o CMatrix.o CMathFunctions.o CStopwatch.o CDataBlock_Float32.o CLogger.o CPng.o  -o integration_test


      /home/isaacg/opt/gcc-4.4/lib64/libgomp.so.1: undefined reference to `pthread_setaffinity_np@GLIBC_2.3.4'
      /home/isaacg/opt/gcc-4.4/lib64/libgomp.so.1: undefined reference to `pthread_attr_setaffinity_np@GLIBC_2.3.4'
      /home/isaacg/opt/gcc-4.4/lib64/libgomp.so.1: undefined reference to `pthread_getaffinity_np@GLIBC_2.3.4'
      /home/isaacg/opt/gcc-4.4/lib64/libgomp.so.1: undefined reference to `__sched_cpucount@GLIBC_2.6'
      collect2: ld returned 1 exit status
      make: *** [integration_test] Error 1

      Please help!

       

      Thanks in advance,

      Isaac

        • GNU OpenMP Linking issues
          chipf

          First try to use that compiler to build the examples in the ACML directory.  There is a c++ example that may provide help on a known good command line.  I notice you are using the OpenMP ACML, but you haven't specified -fopenmp on the g++ comand line.

          It looks like you're using a gcc4.4 that you built yourself.  The error is coming from the libgomp that is part of that build.    Did you build this gcc on a different machine?  If so, perhaps some the libraries are in different places than gcc expects.  It's strange that there are two different GLIBC versions being requested.

          Next you might try adding in -lpthreads.  This should get picked up if you build with -fopenmp.

          After that, try using ldd to trace the library dependencies.  For instance my system shows that libgomp, libpthread, and libc are all found in /lib64