[CMake] xlC / HAVE_GETHOSTBYNAME_R_6 (Was Re: CMake 2.8.0 RC 1 ready for testing!)
Mathieu Malaterre
mathieu.malaterre at gmail.com
Wed Sep 30 04:35:45 EDT 2009
On Tue, Sep 29, 2009 at 11:34 PM, Brad King <brad.king at kitware.com> wrote:
> Mathieu Malaterre wrote:
>> On Fri, Sep 25, 2009 at 10:07 PM, Bill Hoffman <bill.hoffman at kitware.com> wrote:
>>> I am happy to announce that CMake 2.8.0 has entered the beta stage! You
>>> can find the source and binaries here: http://www.cmake.org/files/v2.8/.
>>>
>>
>> There is still one compilation issue with xlC on Linux:
>>
>> http://www.cdash.org/CDash/viewBuildError.php?buildid=437487
>>
>> For some reason HAVE_GETHOSTBYNAME_R_5 is being defined, while it
>> should be HAVE_GETHOSTBYNAME_R_6
>
> Check CMakeFiles/CMakeOutput.log (or wherever cmcurl puts its
> try-compile logs) to see why the test for R_5 passed.
Funny thing:
$ cat CMakeFiles/CMakeOutput.log
...
Performing Curl Test HAVE_GETHOSTBYNAME_R_5 passed with the following output:
Change Dir: /home/mmalater/Dashboards/My Tests/CMake-xlC-9.0/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/gmake "cmTryCompileExec/fast"
gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
CMakeFiles/cmTryCompileExec.dir/build
gmake[1]: Entering directory `/home/mmalater/Dashboards/My
Tests/CMake-xlC-9.0/CMakeFiles/CMakeTmp'
"/home/mmalater/Dashboards/My Tests/CMake-xlC-9.0/Bootstrap.cmk/cmake"
-E cmake_progress_report "/home/mmalater/Dashboards/My
Tests/CMake-xlC-9.0/CMakeFiles/CMakeTmp/CMakeFiles" 1
Building C object CMakeFiles/cmTryCompileExec.dir/CurlTests.c.o
/opt/ibmcmp/vacpp/9.0/bin/cc -DHAVE_GETHOSTBYNAME_R_5 -o
CMakeFiles/cmTryCompileExec.dir/CurlTests.c.o -c
"/home/mmalater/Dashboards/My
Tests/CMakeXLC/Utilities/cmcurl/CMake/CurlTests.c"
"/home/mmalater/Dashboards/My
Tests/CMakeXLC/Utilities/cmcurl/CMake/CurlTests.c", line 247.16:
1506-098 (E) Missing argument(s).
Linking C executable cmTryCompileExec
"/home/mmalater/Dashboards/My Tests/CMake-xlC-9.0/Bootstrap.cmk/cmake"
-E cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt
--verbose=1
/opt/ibmcmp/vacpp/9.0/bin/cc -DHAVE_GETHOSTBYNAME_R_5
CMakeFiles/cmTryCompileExec.dir/CurlTests.c.o -o cmTryCompileExec
-ldl -lidn
gmake[1]: Leaving directory `/home/mmalater/Dashboards/My
Tests/CMake-xlC-9.0/CMakeFiles/CMakeTmp'
Performing Curl Test HAVE_GETHOSTBYNAME_R_6 passed with the following output:
Change Dir: /home/mmalater/Dashboards/My Tests/CMake-xlC-9.0/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/gmake "cmTryCompileExec/fast"
gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
CMakeFiles/cmTryCompileExec.dir/build
gmake[1]: Entering directory `/home/mmalater/Dashboards/My
Tests/CMake-xlC-9.0/CMakeFiles/CMakeTmp'
"/home/mmalater/Dashboards/My Tests/CMake-xlC-9.0/Bootstrap.cmk/cmake"
-E cmake_progress_report "/home/mmalater/Dashboards/My
Tests/CMake-xlC-9.0/CMakeFiles/CMakeTmp/CMakeFiles" 1
Building C object CMakeFiles/cmTryCompileExec.dir/CurlTests.c.o
/opt/ibmcmp/vacpp/9.0/bin/cc -DHAVE_GETHOSTBYNAME_R_6 -o
CMakeFiles/cmTryCompileExec.dir/CurlTests.c.o -c
"/home/mmalater/Dashboards/My
Tests/CMakeXLC/Utilities/cmcurl/CMake/CurlTests.c"
Linking C executable cmTryCompileExec
"/home/mmalater/Dashboards/My Tests/CMake-xlC-9.0/Bootstrap.cmk/cmake"
-E cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt
--verbose=1
/opt/ibmcmp/vacpp/9.0/bin/cc -DHAVE_GETHOSTBYNAME_R_6
CMakeFiles/cmTryCompileExec.dir/CurlTests.c.o -o cmTryCompileExec
-ldl -lidn
gmake[1]: Leaving directory `/home/mmalater/Dashboards/My
Tests/CMake-xlC-9.0/CMakeFiles/CMakeTmp'
...
Indeed:
> /opt/ibmcmp/vacpp/9.0/bin/cc -DHAVE_GETHOSTBYNAME_R_5 -o CMakeFiles/cmTryCompileExec.dir/CurlTests.c.o -c "/home/mmalater/Dashboards/My Tests/CMakeXLC/Utilities/cmcurl/CMake/CurlTests.c"
"/home/mmalater/Dashboards/My
Tests/CMakeXLC/Utilities/cmcurl/CMake/CurlTests.c", line 247.16:
1506-098 (E) Missing argument(s).
> echo $?
0
And I found the answer here:
http://www.ethereal.com/lists/ethereal-dev/199911/msg00038.html
...
Yes, it is. There is a flag -qhalt=e which will cause the compiler
to stop after all warnings marked with (E).
...
This seems quite a common things to always add -qhalt=e in all
configure script I found. Looking at what curl does with this compiler
this leads to the following local changes for me:
> cvs di
Index: Modules/Platform/Linux-XL-C.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/Platform/Linux-XL-C.cmake,v
retrieving revision 1.2
diff -u -r1.2 Linux-XL-C.cmake
--- Modules/Platform/Linux-XL-C.cmake 29 Sep 2009 17:56:57 -0000 1.2
+++ Modules/Platform/Linux-XL-C.cmake 30 Sep 2009 08:33:49 -0000
@@ -1,3 +1,23 @@
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-qmkshrobj")
+
+# IBM_C)
+# #
+# dnl Ensure that compiler optimizations are always thread-safe.
+# tmp_CFLAGS="$tmp_CFLAGS -qthreaded"
+# dnl Disable type based strict aliasing optimizations, using worst
+# dnl case aliasing assumptions when compiling. Type based aliasing
+# dnl would restrict the lvalues that could be safely used to access
+# dnl a data object.
+# tmp_CFLAGS="$tmp_CFLAGS -qnoansialias"
+# dnl Force compiler to stop after the compilation phase, without
+# dnl generating an object code file when compilation has errors.
+# tmp_CFLAGS="$tmp_CFLAGS -qhalt=e"
+
+
+ SET(CMAKE_C_FLAGS_INIT "-qthreaded -qnoansialias -qhalt=e -qmaxerr=1")
+# SET(CMAKE_C_COMPILE_OBJECT
+# "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
+
+
Index: Modules/Platform/Linux-XL-CXX.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/Platform/Linux-XL-CXX.cmake,v
retrieving revision 1.2
diff -u -r1.2 Linux-XL-CXX.cmake
--- Modules/Platform/Linux-XL-CXX.cmake 29 Sep 2009 17:56:57 -0000 1.2
+++ Modules/Platform/Linux-XL-CXX.cmake 30 Sep 2009 08:33:49 -0000
@@ -3,3 +3,7 @@
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-qmkshrobj")
+
+ SET(CMAKE_CXX_COMPILE_OBJECT
+ "<CMAKE_CXX_COMPILER> -+ <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
+
--
Mathieu
More information about the CMake
mailing list