[CMake] trouble finding libraries on 64 bit

Wojciech Jarosz wjarosz at ucsd.edu
Fri Jan 5 16:42:56 EST 2007


I set my compiler to /usr/bin/g++32. I don't have access to that
computer at this moment, so I can't check if that implies that its not
a 64 bit compiler.

I switched to using g++32 because using regular g++ (which was version
4.1, i think) would give compiler errors when compiling very simple
c++ programs. Seems it couldn't find files such as c++config.h,
os_defines.h, etc, which were available in the i386 include directory
in /usr/include/c++/.../bits/  and not in the x64 include directory.
Does this sound familiar to anyone? Sorry that I can't be more
specific -- I'll write more when I get access to that machine again.

thanks,
-wojciech

On 1/5/07, Bill Hoffman <bill.hoffman at kitware.com> wrote:
> Wojciech Jarosz wrote:
> > Hi all,
> > I've been using cmake for a while now on my c++ code. Yesterday I
> > tried compiling my code for the first time on a 64 bit machine
> >
> > My main CMakeLists.txt file tries to find libtiff and libpng (among
> > other image libraries). The problem is that FIND_PACKAGE(TIFF) returns
> > /usr/lib/libtiff.so as ${TIFF_LIBRARIES}, even though this file does
> > not exist. The same thing is true for OpenEXR, libPNG, etc.
> >
> > Looking at the rpm libtiff:
> > /usr/lib/libtiff.so.3
> > /usr/lib/libtiff.so.3.8.2
> > /usr/lib/libtiffxx.so.3
> > /usr/lib/libtiffxx.so.3.8.2
> > /usr/lib64/libtiff.so.3
> > /usr/lib64/libtiff.so.3.8.2
> > /usr/lib64/libtiffxx.so.3
> > /usr/lib64/libtiffxx.so.3.8.2
> > ...
> >
> > and libtiff-devel includes:
> > /usr/lib64/libtiff.so
> > /usr/lib64/libtiffxx.so
> > ...
> >
> > On this machine libtiff.so is installed in /usr/lib64 and libtiff.so.3
> > is installed in /usr/lib. I could manually symlink the so files, but
> > that doesn't seem like a very elegant or scalable solution (I have
> > several libraries I need to link against that exhibit this problem).
> > Any idea how I can fix this?
> >
> > I am running on a run-of-the-mill fedora core 5 machine:
> >
> > uname -a
> > Linux grid 2.6.18-1.2257.fc5 #1 SMP Fri Dec 15 16:07:14 EST 2006
> > x86_64 x86_64 x86_64 GNU/Linux
> >
> >
> > The relevent portion of my CMakeLists.txt file:
> >
> > FIND_PACKAGE(TIFF)
> > IF(TIFF_FOUND)
> >    SET(HAVE_LIBTIFF 1)
> >    SET(IMG_LIBRARIES ${IMG_LIBRARIES} ${TIFF_LIBRARIES})
> >    SET(IMG_INCLUDE_DIR ${IMG_INCLUDE_DIR} ${TIFF_INCLUDE_DIR})
> > ENDIF(TIFF_FOUND)
> >
> > Then at the end of the CMakeLists.txt file I print out some of the
> > info for debug purposes:
> >
> > MESSAGE("
> > ---------------------------------------------
> > Summary for features:
> >
> >  IMG_LIBRARIES.............: ${IMG_LIBRARIES}
> >  IMG_INCLUDE_DIR...........: ${IMG_INCLUDE_DIR}
> >  TIFF_LIBRARIES............: ${TIFF_LIBRARIES}
> > ")
> >
> > This outputs:
> >
> > ---------------------------------------------
> > Summary for features:
> > IMG_LIBRARIES.............:
> > /usr/lib/libpng.so;/usr/lib/libz.so;/usr/lib/libtiff.so;/usr/lib/libjpeg.so;/usr/lib/libImath.so;/usr/lib/libIlmImf.so;/usr/lib/libIex.so;/usr/lib/libHalf.so
> >
> >  IMG_INCLUDE_DIR...........:
> > /usr/include;/usr/include;/usr/include;/usr/include;/usr/include/OpenEXR
> >  TIFF_LIBRARIES............: /usr/lib/libtiff.so
> What version of cmake are you using?  CMake should automatically change
> all of the lib to lib64 and search in those directories on 64 bit
> builds.  Are you sure the compiler is set to 64 bit?  Look at the size
> of void* test result in your CMakeCache.txt.
>
> -Bill
>
>


More information about the CMake mailing list