trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: November 2012

Re: [trinity-devel] cmake bug with 64-bit?

From: Darrell Anderson <humanreadable@...>
Date: Sun, 11 Nov 2012 12:48:54 -0800 (PST)
> > > Do not override/pollute CMAKE_REQUIRED_INCLUDES, you can fall into
> > > another strange and hard to hunt bugs.
> > >
> > > Correct way:
> > >
> > > tde_save_and_set( CMAKE_REQUIRED_INCLUDES ${FRIBIDI_INCLUDE_DIRS} )
> > > check_include_file( fribidi/fribidi-types.h FRIBIDI_NEW_FILENAME )
> > > tde_restore( CMAKE_REQUIRED_INCLUDES  )
> >
> > It's a good practice, but here it is no difference...
> > CMAKE_REQUIRED_INCLUDES remains set only until end of file and there is no
> > other compilations...
> 
> Well, is bad idea to think that "in this particular case will working". The
> particular cases can be changed, new checks can be added, etc.

Serghei,

The patch provided in bug report 1311 resolves the problem on my system. I won't pretend to know how the patch resolves the problem but based upon your concerns expressed in this thread, would you please review the patch? If you approve then I'll push to GIT.

Regarding your previous request for the cmake error log, here is the relevant section:

Determining if the include file fribidi/fribidi-types.h exists failed with the following output:
Change Dir: /dev/shm/tdegraphics.build/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/gmake "cmTryCompileExec891115794/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec891115794.dir/build.make CMakeFiles/cmTryCompileExec891115794.dir/build
gmake[1]: Entering directory `/dev/shm/tdegraphics.build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /dev/shm/tdegraphics.build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec891115794.dir/CheckIncludeFile.c.o
/usr/bin/gcc   -O2 -fPIC     -o CMakeFiles/cmTryCompileExec891115794.dir/CheckIncludeFile.c.o   -c /dev/shm/tdegraphics.build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
In file included from /usr/include/fribidi/fribidi-types.h:36:0,
                 from /dev/shm/tdegraphics.build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:
/usr/include/fribidi/fribidi-common.h:65:20: fatal error: glib.h: No such file or directory
compilation terminated.
gmake[1]: *** [CMakeFiles/cmTryCompileExec891115794.dir/CheckIncludeFile.c.o] Error 1
gmake[1]: Leaving directory `/dev/shm/tdegraphics.build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec891115794/fast] Error 2


The problem seems to be that the check_include_file macro performs some kind of internal test of the fribidi-types.h file and then fails when not finding glib.h. Thus the output message:

-- checking for one of the modules 'fribidi'
-- Looking for fribidi/fribidi-types.h
-- Looking for fribidi/fribidi-types.h - not found

is technically incorrect. The file _is_ found but something else in the configuration process fails. I don't know why cmake is inspecting the contents of fribidi-types.h. Seems to me either the file exists or does not and that is all that should be checked.

Darrell