I tested it as Todd described on intrepid at Argonne, works.<br><br>Pat<br><br><div class="gmail_quote">On Sat, Jul 3, 2010 at 12:18 AM, Todd Gamblin <span dir="ltr"><<a href="mailto:tgamblin@llnl.gov">tgamblin@llnl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Brad,<br>
<br>
Sorry for the slow response. This patch works on dawndev (BG/P FEN) at LLNL. I tested it with cmake 2.8.2, and just did bootstrap --prefix=/path/to/install. Everything went fine.<br>
<font color="#888888"><br>
-Todd<br>
</font><div><div></div><div class="h5"><br>
<br>
On Jun 30, 2010, at 7:58 AM, Brad King wrote:<br>
<br>
> Look for a C/C++ compiler pair from known toolchains on some platforms.<br>
> This makes it less likely that mismatched compilers will be found.<br>
> Check only if the environment variables CC and CXX are both empty.<br>
> ---<br>
><br>
> Todd Gamblin wrote:<br>
>> 1. Bootstrap script doesn't seem to work quite right on the frontend.<br>
>><br>
>> Building CMake was a bit hairy on the Power6 front end node on our<br>
>> BlueGene systems. The machine runs Linux and has both GNU and IBM XL<br>
>> toolchains for the frontend itself. The CMake bootstrap script detected<br>
>> cc for the C compiler and xlC for the C++ compiler, and linking failed<br>
>> on something 50% through the build because it was passing -dynamic to<br>
>> xlC, which is the wrong flag. It would be nice if CMake would prefer<br>
>> one or the other tool chain.<br>
><br>
> Please try this patch on the Power6 front-end to your BlueGene.<br>
> It should prefer matching compiler pairs first.<br>
><br>
> -Brad<br>
><br>
> bootstrap | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-<br>
> 1 files changed, 69 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/bootstrap b/bootstrap<br>
> index 1687776..01d9e15 100755<br>
> --- a/bootstrap<br>
> +++ b/bootstrap<br>
> @@ -650,11 +650,74 @@ if ${cmake_system_haiku}; then<br>
> cmake_ld_flags="${LDFLAGS} -lroot -lbe"<br>
> fi<br>
><br>
> +#-----------------------------------------------------------------------------<br>
> +# Detect known toolchains on some platforms.<br>
> +cmake_toolchains=''<br>
> +case "${cmake_system}" in<br>
> + *AIX*) cmake_toolchains='XL GNU' ;;<br>
> + *CYGWIN*) cmake_toolchains='GNU' ;;<br>
> + *Darwin*) cmake_toolchains='GNU Clang' ;;<br>
> + *Linux*) cmake_toolchains='GNU Clang XL PGI PathScale' ;;<br>
> + *MINGW*) cmake_toolchains='GNU' ;;<br>
> +esac<br>
> +<br>
> +# Toolchain compiler name table.<br>
> +cmake_toolchain_Clang_CC='clang'<br>
> +cmake_toolchain_Clang_CXX='clang++'<br>
> +cmake_toolchain_GNU_CC='gcc'<br>
> +cmake_toolchain_GNU_CXX='g++'<br>
> +cmake_toolchain_PGI_CC='pgcc'<br>
> +cmake_toolchain_PGI_CXX='pgCC'<br>
> +cmake_toolchain_PathScale_CC='pathcc'<br>
> +cmake_toolchain_PathScale_CXX='pathCC'<br>
> +cmake_toolchain_XL_CC='xlc'<br>
> +cmake_toolchain_XL_CXX='xlC'<br>
> +<br>
> +cmake_toolchain_try()<br>
> +{<br>
> + tc="$1"<br>
> + TMPFILE=`cmake_tmp_file`<br>
> +<br>
> + eval "tc_CC=\${cmake_toolchain_${tc}_CC}"<br>
> + echo 'int main() { return 0; }' > "${TMPFILE}.c"<br>
> + cmake_try_run "$tc_CC" "" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1<br>
> + tc_result_CC="$?"<br>
> + rm -f "${TMPFILE}.c"<br>
> + test "${tc_result_CC}" = "0" || return 1<br>
> +<br>
> + eval "tc_CXX=\${cmake_toolchain_${tc}_CXX}"<br>
> + echo 'int main() { return 0; }' > "${TMPFILE}.cpp"<br>
> + cmake_try_run "$tc_CXX" "" "${TMPFILE}.cpp" >> cmake_bootstrap.log 2>&1<br>
> + tc_result_CXX="$?"<br>
> + rm -f "${TMPFILE}.cpp"<br>
> + test "${tc_result_CXX}" = "0" || return 1<br>
> +<br>
> + cmake_toolchain="$tc"<br>
> +}<br>
> +<br>
> +cmake_toolchain_detect()<br>
> +{<br>
> + cmake_toolchain=<br>
> + for tc in ${cmake_toolchains}; do<br>
> + echo "Checking for $tc toolchain" >> cmake_bootstrap.log 2>&1<br>
> + cmake_toolchain_try "$tc" &&<br>
> + echo "Found $tc toolchain" &&<br>
> + break<br>
> + done<br>
> +}<br>
> +<br>
> +if [ -z "${CC}" -a -z "${CXX}" ]; then<br>
> + cmake_toolchain_detect<br>
> +fi<br>
> +<br>
> +#-----------------------------------------------------------------------------<br>
> # Test C compiler<br>
> cmake_c_compiler=<br>
><br>
> # If CC is set, use that for compiler, otherwise use list of known compilers<br>
> -if [ -n "${CC}" ]; then<br>
> +if [ -n "${cmake_toolchain}" ]; then<br>
> + eval cmake_c_compilers="\${cmake_toolchain_${cmake_toolchain}_CC}"<br>
> +elif [ -n "${CC}" ]; then<br>
> cmake_c_compilers="${CC}"<br>
> else<br>
> cmake_c_compilers="${CMAKE_KNOWN_C_COMPILERS}"<br>
> @@ -697,13 +760,16 @@ See cmake_bootstrap.log for compilers attempted.<br>
> fi<br>
> echo "C compiler on this system is: ${cmake_c_compiler} ${cmake_c_flags}"<br>
><br>
> +#-----------------------------------------------------------------------------<br>
> # Test CXX compiler<br>
> cmake_cxx_compiler=<br>
><br>
> # On Mac OSX, CC is the same as cc, so make sure not to try CC as c++ compiler.<br>
><br>
> # If CC is set, use that for compiler, otherwise use list of known compilers<br>
> -if [ -n "${CXX}" ]; then<br>
> +if [ -n "${cmake_toolchain}" ]; then<br>
> + eval cmake_cxx_compilers="\${cmake_toolchain_${cmake_toolchain}_CXX}"<br>
> +elif [ -n "${CXX}" ]; then<br>
> cmake_cxx_compilers="${CXX}"<br>
> else<br>
> cmake_cxx_compilers="${CMAKE_KNOWN_CXX_COMPILERS}"<br>
> @@ -754,6 +820,7 @@ See cmake_bootstrap.log for compilers attempted."<br>
> fi<br>
> echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}"<br>
><br>
> +#-----------------------------------------------------------------------------<br>
> # Test Make<br>
><br>
> cmake_make_processor=<br>
> --<br>
> 1.7.0<br>
><br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br>