Changes between Version 2 and Version 3 of Ticket #59832, comment 30


Ignore:
Timestamp:
Mar 16, 2020, 9:19:36 PM (4 years ago)
Author:
noloader (Jeffrey Walton)
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #59832, comment 30

    v2 v3  
    1 @kencu,
    2 
    3 A quick and dirty patch for CMake 3.16.5 bootstrap. This enables a `make -j 4` so you can test changes in three or four minutes rather then 10 to 15 minutes:
    4 
    5 {{{
    6 echo "Patching CMake 3.16.5"
    7 sed -i '1648,1652d' bootstrap
    8 sed -i '1648imake -j 4' bootstrap
    9 }}}
    10 
    11 The `sed` deletes this block, which CMake seems to mishandle somehow...
    12 
    13 {{{
    14 # Run make to build bootstrap cmake
    15 if [ "x${cmake_parallel_make}" != "x" ]; then
    16   ${cmake_make_processor} ${cmake_make_flags}
    17 else
    18   ${cmake_make_processor}
    19 fi
    20 }}}
    21 
    22 Here's my full build script for testing. Notice the export of `cmake_make_processor` and `cmake_parallel_make`. When `cmake_parallel_make` is set, `bootstrap` is supposed to set `cmake_make_flags="-j ${cmake_parallel_make}"`, but it is not working for some reason. Hence the need for the `sed`.
    23 
    24 {{{
    25 #!/usr/bin/env bash
    26 
    27 printf '\033c'
    28 rm -rf cmake-3.16.5/
    29 
    30 export CC=/opt/local/bin/gcc-mp-5
    31 export CXX=/opt/local/bin/g++-mp-5
    32 export CFLAGS="-Wall"
    33 export CXXFLAGS="-Wall"
    34 export RANLIB=/opt/local/bin/gcc-ranlib-mp-5
    35 
    36 export MAKE="make"
    37 export cmake_make_processor="make"
    38 export cmake_parallel_make="4"
    39 
    40 echo
    41 echo "CC: $CC"
    42 echo "CXX: $CXX"
    43 echo "CFLAGS: $CFLAGS"
    44 echo "CXXFLAGS: $CXXFLAGS"
    45 echo "LDFLAGS: $LDFLAGS"
    46 echo
    47 
    48 if [ -e cmake-3.16.5.tar.gz ];
    49 then
    50     echo "Found CMake 3.16.5"
    51 else
    52     echo "Downloading CMake 3.16.5"
    53     if ! curl -L -s -k -o cmake-3.16.5.tar.gz \
    54          https://github.com/Kitware/CMake/releases/download/v3.16.5/cmake-3.16.5.tar.gz;
    55     then
    56         echo "Failed to download CMake"
    57         exit 1
    58     fi
    59 fi
    60 
    61 echo "Unpacking CMake 3.16.5"
    62 if ! tar xzf cmake-3.16.5.tar.gz;
    63 then
    64     echo "Failed to unpack CMake"
    65     exit 1
    66 fi
    67 
    68 cd cmake-3.16.5 || exit 1
    69 
    70 echo "Patching CMake 3.16.5"
    71 sed -i '1648,1652d' bootstrap
    72 sed -i '1648imake -j 4' bootstrap
    73 
    74 echo "Configuring CMake 3.16.5"
    75 if ! ./bootstrap;
    76 then
    77     echo "Failed to configure CMake"
    78     exit 1
    79 fi
    80 
    81 echo "Building CMake 3.16.5"
    82 if ! "${MAKE}";
    83 then
    84     echo "Failed to build CMake"
    85     exit 1
    86 fi
    87 
    88 echo
    89 echo "CMake 3.16.5 is ready to install. Change directories"
    90 echo "to cmake-3.16.5, and then run 'sudo make install'."
    91 
    92 exit 0
    93 }}}
     1Deleted. No longer needed.