[CMake] Help with libintl/configure tests

Tim Holy holy at wustl.edu
Thu Apr 24 07:12:28 EDT 2008


I'm getting sporadic behavior with the following code:
  check_type_size(intmax_t INTMAX_T)
  message("HIT ${HAVE_INTMAX_T}, IT ${INTMAX_T}")
sometimes produces
  HIT TRUE, IT 0
and other times produces
  HIT TRUE, IT 4
(i.e., it claims the size of an intmax_t is 0 sometimes and 4 other times)

This is the case even if I always do "rm -r *" in the build directory and then 
a "cmake --debug-trycompile [sourcedir]".

Version details: Kubuntu Hardy (pre-release),
$ cmake --version
cmake version 2.4-patch 7

Best,
--Tim

On Wednesday 23 April 2008, Tim Holy wrote:
> On Wednesday 23 April 2008, you wrote:
> > > So, I don't understand why this isn't discovering that these types have
> > > been declared. Can anyone offer some insight?
> >
> > Best thing to do is to use --debug-trycompile.
>
> Thanks for the tip. The outcome, however, is not at all what I expected.
> Check this out (sorry that the line wrapping will make the shell command
> look weird):
>
> tim at diva:/tmp/build-intl$ rm -r *
> tim at diva:/tmp/build-intl$ cmake --debug-trycompile
> ~/src/tux4kids/tuxmath/trunk/intl/
> debug trycompile on
> -- Check for working C compiler: /usr/bin/gcc
> -- Check for working C compiler: /usr/bin/gcc -- works
> -- Check size of void*
> -- Check size of void* - done
> -- Check for working CXX compiler: /usr/bin/c++
> -- Check for working CXX compiler: /usr/bin/c++ -- works
> -- Looking for iconv
> -- Looking for iconv - found
> -- Found iconv library:
> -- CMAKE_REQUIRED_INCLUDES:
> -- CMAKE_REQUIRED_INCLUDES: /usr/include
> -- Looking for include files HAVE_INTTYPES_H
> -- Looking for include files HAVE_INTTYPES_H - found
> -- Looking for snprintf
> -- Looking for snprintf - found
> -- Looking for asprintf
> -- Looking for asprintf - found
> -- Looking for wprintf
> -- Looking for wprintf - found
> -- Looking for printf
> -- Looking for printf - found
> -- Looking for intmax_t
> -- Looking for intmax_t - found
> -- Looking for uintmax_t
> -- Looking for uintmax_t - found
> -- Looking for LC_MESSAGES
> -- Looking for LC_MESSAGES - found
> -- Check size of intmax_t
> -- Check size of intmax_t - done
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /tmp/build-intl
>
> It works! It works! Now I don't have to debug anything, since it suddenly
> works. So, let's turn off the debugging:
>
> tim at diva:/tmp/build-intl$ rm -r *
> tim at diva:/tmp/build-intl$ cmake ~/src/tux4kids/tuxmath/trunk/intl/
> -- Check for working C compiler: /usr/bin/gcc
> -- Check for working C compiler: /usr/bin/gcc -- works
> -- Check size of void*
> -- Check size of void* - done
> -- Check for working CXX compiler: /usr/bin/c++
> -- Check for working CXX compiler: /usr/bin/c++ -- works
> -- Looking for iconv
> -- Looking for iconv - found
> -- Found iconv library:
> -- CMAKE_REQUIRED_INCLUDES:
> -- CMAKE_REQUIRED_INCLUDES: /usr/include
> -- Looking for include files HAVE_INTTYPES_H
> -- Looking for include files HAVE_INTTYPES_H - found
> -- Looking for snprintf
> -- Looking for snprintf - found
> -- Looking for asprintf
> -- Looking for asprintf - not found.
> -- Looking for wprintf
> -- Looking for wprintf - not found.
> -- Looking for printf
> -- Looking for printf - found
> -- Looking for intmax_t
> -- Looking for intmax_t - not found.
> -- Looking for uintmax_t
> -- Looking for uintmax_t - not found.
> -- Looking for LC_MESSAGES
> -- Looking for LC_MESSAGES - found
> -- Check size of intmax_t
> -- Check size of intmax_t - failed
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /tmp/build-intl
>
> It's perfectly reproducible: I can repeat either way many times, and it
> works only with debug-trycompile on.
>
> I examined the CMakeError.log. It's my first time looking at it, so I don't
> really know what I expect to see, but it doesn't seem to be weird: it looks
> like it tried to compile a file and encountered an undefined symbol. I just
> don't know why. I'm attaching both the error & output logs, just in case
> your far more experienced eyes catch anything.
>
> I can try to reduce to a more minimal test case and send the required files
> to the list if that would be useful.
>
> Best,
> --Tim




More information about the CMake mailing list