0

I'm trying to compile a simple hello world type program that reads an image file with OpenCv while MPI is initialised using. It works fine with gcc (mpicc), but I'm trying to use craycc for reasons I won't get into. When I do this, I get an errors that all the libraries are not found. It seems to be looking in a strange path.

Can anyone take some guesses at what's happening here? Could my pkg-config opencv.pc file be giving the wrong path? Is the typedef error triggering this (when I find the line and comment it out the warning disappears by the missing libraries remain)?

I'll try sleeping on it and see what comes up. Thanks for taking the time to read this folks, and I'll be sure to report back if I find anything.

@hector-xe6-7:~/work/disparity> cc `pkg-config --cflags --libs opencv` hello.c -o hello

CC-301 craycc: WARNING File = /home/d34/d34/s1138832/work/OpenCV-2.3/include/opencv2/core/types_c.h, Line = 159
  The indicated "typedef" name has already been declared (with same type).

  typedef unsigned short ushort;
                         ^

Total warnings detected in hello.c: 1
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_core
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_imgproc
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_highgui
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_ml
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_video
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_features2d
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_calib3d
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_objdetect
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_contrib
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_legacy
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_flann
benrules2
  • 417
  • 4
  • 14
  • 1
    This does seem to be a path issue. As a test, could you try hardcoding the path to the opencv libraries instead of calling pkg-config? Also, check that the libraries are properly installed and all the library symlinks are present: http://stackoverflow.com/questions/335928/ld-cannot-find-an-existing-library – Greg Inozemtsev Jul 29 '12 at 06:34
  • Cray's compilers are ridiculously strict about language standards so that is likely a bug in the source. You should fix it and submit a patch upstream. – Jeff Hammond Apr 29 '15 at 23:19

1 Answers1

1

Solved this by adding a -dynamic flag when compiling.

benrules2
  • 417
  • 4
  • 14