Bootstrapping ninja and building from source


(Lane Schwartz) #1

Hi,

First of all, congratulations on the open source release! I'm very excited!

Second, I'm running into trouble building from source, particularly in
regards to getting ninja bootstrapped. I'm on Scientific Linux. I first
used yum to install packages for llvm, llvm-devel, clang, and cmake.

I then did the following, following the README.md in the swift git repo:

git clone git@github.com:apple/swift.git swift
git clone git@github.com:apple/swift-llvm.git llvm
git clone git@github.com:apple/swift-clang.git clang
git clone git@github.com:apple/swift-lldb.git lldb
git clone git@github.com:apple/swift-cmark.git cmark
git clone git@github.com:apple/swift-llbuild.git llbuild
git clone git@github.com:apple/swift-package-manager.git swiftpm
git clone git@github.com:apple/swift-corelibs-xctest.git
git clone git@github.com:apple/swift-corelibs-foundation.git

The README.md also states:

Ninja is the current recommended build system for building Swift and is the

default configuration generated by CMake. If you're on OS X or don't
install it as part of your Linux distribution, clone it next to the other
projects and it will be bootstrapped automatically

My Linux distro doesn't package ninja, so I also did this:

git clone git@github.com:martine/ninja.git

I then attempted to build swift:

$ ./swift/utils/build-script

Which resulted in errors, and as far as I can tell did not attempt to build
the ninja distro that I downloaded into the ninja directory in my current
working directory:

which: no ninja in

(/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/lanes/.local/bin:/home/lanes/bin)
Building the standard library for: swift-stdlib-linux-x86_64
Running Swift tests for: check-swift-linux-x86_64
+ rm -rf /home/lanes/swift/build/Ninja-DebugAssert/ninja-build
+ cp -r /home/lanes/swift/ninja
/home/lanes/swift/build/Ninja-DebugAssert/ninja-build
++ uname -s
+ [[ Linux == \D\a\r\w\i\n ]]
+ cd /home/lanes/swift/build/Ninja-DebugAssert/ninja-build
+ python ./configure.py --bootstrap
bootstrapping ninja...
warning: A compatible version of re2c (>= 0.11.3) was not found; changes
to src/*.in.cc will not affect your build.
wrote build.ninja.
bootstrap complete. rebuilding...
[24/24] LINK ninja
cmark: using standard linker
+ cd /home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64
+ /usr/bin/cmake -G Ninja -DCMAKE_C_COMPILER:PATH=clang
-DCMAKE_CXX_COMPILER:PATH=clang++ -DCMAKE_BUILD_TYPE:STRING=Debug
/home/lanes/swift/cmark
CMake Error: CMake was unable to find a build program corresponding to
"Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a
different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be
not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Could not find cmake module
file:/home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64/CMakeFiles/2.8.11/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be
not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Could not find cmake module
file:/home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64/CMakeFiles/2.8.11/CMakeCXXCompiler.cmake
-- Configuring incomplete, errors occurred!
./swift/utils/build-script: command terminated with a non-zero exit status
1, aborting

This leads me to a couple of questions:

* Do I need to first build and install re2c? If so, this should perhaps be
mentioned as a prereq.
* Is there anything differently I should be doing to get the bootstrap
process running successfully?

Thanks,
Lane


(Daniel Dunbar) #2

Hi Lane,

You shouldn't need to install re2c to build Ninja.

This looks like something is wrong in the build script. It did successfully build Ninja, but it isn't getting found by CMake for the mark build.

Can you open an SR for this on bugs.swift.org?

If you want to debug yourself, it looks like the PATH export at utils/build-script-impl:1287 isn't working, it should have let ninja be found for the rest of the commands.

- Daniel

···

On Dec 4, 2015, at 11:22 AM, Lane Schwartz <dowobeha@gmail.com> wrote:

Hi,

First of all, congratulations on the open source release! I'm very excited!

Second, I'm running into trouble building from source, particularly in regards to getting ninja bootstrapped. I'm on Scientific Linux. I first used yum to install packages for llvm, llvm-devel, clang, and cmake.

I then did the following, following the README.md in the swift git repo:

git clone git@github.com:apple/swift.git swift
git clone git@github.com:apple/swift-llvm.git llvm
git clone git@github.com:apple/swift-clang.git clang
git clone git@github.com:apple/swift-lldb.git lldb
git clone git@github.com:apple/swift-cmark.git cmark
git clone git@github.com:apple/swift-llbuild.git llbuild
git clone git@github.com:apple/swift-package-manager.git swiftpm
git clone git@github.com:apple/swift-corelibs-xctest.git
git clone git@github.com:apple/swift-corelibs-foundation.git

The README.md also states:

Ninja is the current recommended build system for building Swift and is the default configuration generated by CMake. If you're on OS X or don't install it as part of your Linux distribution, clone it next to the other projects and it will be bootstrapped automatically

My Linux distro doesn't package ninja, so I also did this:

git clone git@github.com:martine/ninja.git

I then attempted to build swift:

$ ./swift/utils/build-script

Which resulted in errors, and as far as I can tell did not attempt to build the ninja distro that I downloaded into the ninja directory in my current working directory:

which: no ninja in (/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/lanes/.local/bin:/home/lanes/bin)
Building the standard library for: swift-stdlib-linux-x86_64
Running Swift tests for: check-swift-linux-x86_64
+ rm -rf /home/lanes/swift/build/Ninja-DebugAssert/ninja-build
+ cp -r /home/lanes/swift/ninja /home/lanes/swift/build/Ninja-DebugAssert/ninja-build
++ uname -s
+ [[ Linux == \D\a\r\w\i\n ]]
+ cd /home/lanes/swift/build/Ninja-DebugAssert/ninja-build
+ python ./configure.py --bootstrap
bootstrapping ninja...
warning: A compatible version of re2c (>= 0.11.3) was not found; changes to src/*.in.cc will not affect your build.
wrote build.ninja.
bootstrap complete. rebuilding...
[24/24] LINK ninja
cmark: using standard linker
+ cd /home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64
+ /usr/bin/cmake -G Ninja -DCMAKE_C_COMPILER:PATH=clang -DCMAKE_CXX_COMPILER:PATH=clang++ -DCMAKE_BUILD_TYPE:STRING=Debug /home/lanes/swift/cmark
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Could not find cmake module file:/home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64/CMakeFiles/2.8.11/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Could not find cmake module file:/home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64/CMakeFiles/2.8.11/CMakeCXXCompiler.cmake
-- Configuring incomplete, errors occurred!
./swift/utils/build-script: command terminated with a non-zero exit status 1, aborting

This leads me to a couple of questions:

* Do I need to first build and install re2c? If so, this should perhaps be mentioned as a prereq.
* Is there anything differently I should be doing to get the bootstrap process running successfully?

Thanks,
Lane

_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


(Dmitri Gribenko) #3

Hi,

First of all, congratulations on the open source release! I'm very excited!

Second, I'm running into trouble building from source, particularly in
regards to getting ninja bootstrapped. I'm on Scientific Linux.

Which version are you running? It is only feasible to try SL7+ because of
LLVM and Clang requirements.

I first used yum to install packages for llvm, llvm-devel, clang, and
cmake.

I then did the following, following the README.md in the swift git repo:

git clone git@github.com:apple/swift.git swift
git clone git@github.com:apple/swift-llvm.git llvm
git clone git@github.com:apple/swift-clang.git clang
git clone git@github.com:apple/swift-lldb.git lldb
git clone git@github.com:apple/swift-cmark.git cmark
git clone git@github.com:apple/swift-llbuild.git llbuild
git clone git@github.com:apple/swift-package-manager.git swiftpm
git clone git@github.com:apple/swift-corelibs-xctest.git
git clone git@github.com:apple/swift-corelibs-foundation.git

The README.md also states:

Ninja is the current recommended build system for building Swift and is

the default configuration generated by CMake. If you're on OS X or don't
install it as part of your Linux distribution, clone it next to the other
projects and it will be bootstrapped automatically

My Linux distro doesn't package ninja, so I also did this:

git clone git@github.com:martine/ninja.git

I then attempted to build swift:

$ ./swift/utils/build-script

Yes, this should work.

Which resulted in errors, and as far as I can tell did not attempt to
build the ninja distro that I downloaded into the ninja directory in my
current working directory:

which: no ninja in

(/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/lanes/.local/bin:/home/lanes/bin)
Building the standard library for: swift-stdlib-linux-x86_64
Running Swift tests for: check-swift-linux-x86_64
+ rm -rf /home/lanes/swift/build/Ninja-DebugAssert/ninja-build
+ cp -r /home/lanes/swift/ninja
/home/lanes/swift/build/Ninja-DebugAssert/ninja-build
++ uname -s
+ [[ Linux == \D\a\r\w\i\n ]]
+ cd /home/lanes/swift/build/Ninja-DebugAssert/ninja-build
+ python ./configure.py --bootstrap
bootstrapping ninja...
warning: A compatible version of re2c (>= 0.11.3) was not found; changes
to src/*.in.cc will not affect your build.
wrote build.ninja.
bootstrap complete. rebuilding...
[24/24] LINK ninja

So ninja built successfully.

cmark: using standard linker

+ cd /home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64
+ /usr/bin/cmake -G Ninja -DCMAKE_C_COMPILER:PATH=clang
-DCMAKE_CXX_COMPILER:PATH=clang++ -DCMAKE_BUILD_TYPE:STRING=Debug
/home/lanes/swift/cmark

I just verified, the script bootstraps ninja for me, and cmake finds it.

Could you apply this patch and see if the PATH was set correctly?

diff --git a/utils/build-script-impl b/utils/build-script-impl
index b2d2954..60ab51d 100755
--- a/utils/build-script-impl
+++ b/utils/build-script-impl
@@ -1312,6 +1312,7 @@ if [[ "${BUILD_NINJA}" ]] ; then
         fi
     fi
     export PATH="${build_dir}:${PATH}"
+ which ninja
fi

···

On Fri, Dec 4, 2015 at 11:22 AM, Lane Schwartz <dowobeha@gmail.com> wrote:

#
@@ -1805,6 +1806,7 @@ for deployment_target in
"${NATIVE_TOOLS_DEPLOYMENT_TARGETS[@]}" "${CROSS_TOOLS_
                     ( ! -z "${generator_output_path}" && ! -f
"${generator_output_path}" ) ]] ; then
             mkdir -p "${build_dir}"
             set -x
+ which ninja
             (cd "${build_dir}" && "$CMAKE" "${cmake_options[@]}"
${USER_CONFIG_ARGS})
             { set +x; } 2>/dev/null
         fi

Dmitri

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/


(Lane Schwartz) #4

Hi,

First of all, congratulations on the open source release! I'm very
excited!

Second, I'm running into trouble building from source, particularly in
regards to getting ninja bootstrapped. I'm on Scientific Linux.

Which version are you running? It is only feasible to try SL7+ because of
LLVM and Clang requirements.

I first used yum to install packages for llvm, llvm-devel, clang, and
cmake.

I then did the following, following the README.md in the swift git repo:

git clone git@github.com:apple/swift.git swift
git clone git@github.com:apple/swift-llvm.git llvm
git clone git@github.com:apple/swift-clang.git clang
git clone git@github.com:apple/swift-lldb.git lldb
git clone git@github.com:apple/swift-cmark.git cmark
git clone git@github.com:apple/swift-llbuild.git llbuild
git clone git@github.com:apple/swift-package-manager.git swiftpm
git clone git@github.com:apple/swift-corelibs-xctest.git
git clone git@github.com:apple/swift-corelibs-foundation.git

The README.md also states:

Ninja is the current recommended build system for building Swift and is

the default configuration generated by CMake. If you're on OS X or don't
install it as part of your Linux distribution, clone it next to the other
projects and it will be bootstrapped automatically

My Linux distro doesn't package ninja, so I also did this:

git clone git@github.com:martine/ninja.git

I then attempted to build swift:

$ ./swift/utils/build-script

Yes, this should work.

Which resulted in errors, and as far as I can tell did not attempt to
build the ninja distro that I downloaded into the ninja directory in my
current working directory:

which: no ninja in

(/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/lanes/.local/bin:/home/lanes/bin)
Building the standard library for: swift-stdlib-linux-x86_64
Running Swift tests for: check-swift-linux-x86_64
+ rm -rf /home/lanes/swift/build/Ninja-DebugAssert/ninja-build
+ cp -r /home/lanes/swift/ninja
/home/lanes/swift/build/Ninja-DebugAssert/ninja-build
++ uname -s
+ [[ Linux == \D\a\r\w\i\n ]]
+ cd /home/lanes/swift/build/Ninja-DebugAssert/ninja-build
+ python ./configure.py --bootstrap
bootstrapping ninja...
warning: A compatible version of re2c (>= 0.11.3) was not found; changes
to src/*.in.cc will not affect your build.
wrote build.ninja.
bootstrap complete. rebuilding...
[24/24] LINK ninja

So ninja built successfully.

cmark: using standard linker

+ cd /home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64
+ /usr/bin/cmake -G Ninja -DCMAKE_C_COMPILER:PATH=clang
-DCMAKE_CXX_COMPILER:PATH=clang++ -DCMAKE_BUILD_TYPE:STRING=Debug
/home/lanes/swift/cmark

I just verified, the script bootstraps ninja for me, and cmake finds it.

Could you apply this patch and see if the PATH was set correctly?

diff --git a/utils/build-script-impl b/utils/build-script-impl
index b2d2954..60ab51d 100755
--- a/utils/build-script-impl
+++ b/utils/build-script-impl
@@ -1312,6 +1312,7 @@ if [[ "${BUILD_NINJA}" ]] ; then
         fi
     fi
     export PATH="${build_dir}:${PATH}"
+ which ninja
fi

#
@@ -1805,6 +1806,7 @@ for deployment_target in
"${NATIVE_TOOLS_DEPLOYMENT_TARGETS[@]}" "${CROSS_TOOLS_
                     ( ! -z "${generator_output_path}" && ! -f
"${generator_output_path}" ) ]] ; then
             mkdir -p "${build_dir}"
             set -x
+ which ninja
             (cd "${build_dir}" && "$CMAKE" "${cmake_options[@]}"
${USER_CONFIG_ARGS})
             { set +x; } 2>/dev/null
         fi

Dmitri

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/

I'm on Scientific Linux 7.1. I added the two instances of "which ninja" as
you suggested, then re-ran build-script:

$ ./swift/utils/build-script

which: no ninja in
(/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/lanes/.local/bin:/home/lanes/bin)
Building the standard library for: swift-stdlib-linux-x86_64
Running Swift tests for: check-swift-linux-x86_64

/home/lanes/swift/build/Ninja-DebugAssert/ninja-build/ninja
cmark: using standard linker
+ which ninja
/home/lanes/swift/build/Ninja-DebugAssert/ninja-build/ninja
+ cd /home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64
+ /usr/bin/cmake -G Ninja -DCMAKE_C_COMPILER:PATH=clang
-DCMAKE_CXX_COMPILER:PATH=clang++ -DCMAKE_BUILD_TYPE:STRING=Debug
/home/lanes/swift/cmark
CMake Error: CMake was unable to find a build program corresponding to
"Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a
different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be
not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Could not find cmake module
file:/home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64/CMakeFiles/2.8.11/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be
not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Could not find cmake module
file:/home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64/CMakeFiles/2.8.11/CMakeCXXCompiler.cmake
-- Configuring incomplete, errors occurred!
./swift/utils/build-script: command terminated with a non-zero exit status
1, aborting

Thanks,
Lane

···

On Fri, Dec 4, 2015 at 1:39 PM, Dmitri Gribenko <gribozavr@gmail.com> wrote:

On Fri, Dec 4, 2015 at 11:22 AM, Lane Schwartz <dowobeha@gmail.com> wrote:


(Lane Schwartz) #5

Issue created: https://bugs.swift.org/browse/SR-58

···

On Fri, Dec 4, 2015 at 1:36 PM, Daniel Dunbar <daniel_dunbar@apple.com> wrote:

Hi Lane,

You shouldn't need to install re2c to build Ninja.

This looks like something is wrong in the build script. It did
successfully build Ninja, but it isn't getting found by CMake for the mark
build.

Can you open an SR for this on bugs.swift.org?

If you want to debug yourself, it looks like the PATH export at
utils/build-script-impl:1287 isn't working, it should have let ninja be
found for the rest of the commands.

- Daniel

On Dec 4, 2015, at 11:22 AM, Lane Schwartz <dowobeha@gmail.com> wrote:

Hi,

First of all, congratulations on the open source release! I'm very excited!

Second, I'm running into trouble building from source, particularly in
regards to getting ninja bootstrapped. I'm on Scientific Linux. I first
used yum to install packages for llvm, llvm-devel, clang, and cmake.

I then did the following, following the README.md in the swift git repo:

git clone git@github.com:apple/swift.git swift
git clone git@github.com:apple/swift-llvm.git llvm
git clone git@github.com:apple/swift-clang.git clang
git clone git@github.com:apple/swift-lldb.git lldb
git clone git@github.com:apple/swift-cmark.git cmark
git clone git@github.com:apple/swift-llbuild.git llbuild
git clone git@github.com:apple/swift-package-manager.git swiftpm
git clone git@github.com:apple/swift-corelibs-xctest.git
git clone git@github.com:apple/swift-corelibs-foundation.git

The README.md also states:

Ninja is the current recommended build system for building Swift and is

the default configuration generated by CMake. If you're on OS X or don't
install it as part of your Linux distribution, clone it next to the other
projects and it will be bootstrapped automatically

My Linux distro doesn't package ninja, so I also did this:

git clone git@github.com:martine/ninja.git

I then attempted to build swift:

$ ./swift/utils/build-script

Which resulted in errors, and as far as I can tell did not attempt to
build the ninja distro that I downloaded into the ninja directory in my
current working directory:

which: no ninja in

(/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/lanes/.local/bin:/home/lanes/bin)
Building the standard library for: swift-stdlib-linux-x86_64
Running Swift tests for: check-swift-linux-x86_64
+ rm -rf /home/lanes/swift/build/Ninja-DebugAssert/ninja-build
+ cp -r /home/lanes/swift/ninja
/home/lanes/swift/build/Ninja-DebugAssert/ninja-build
++ uname -s
+ [[ Linux == \D\a\r\w\i\n ]]
+ cd /home/lanes/swift/build/Ninja-DebugAssert/ninja-build
+ python ./configure.py --bootstrap
bootstrapping ninja...
warning: A compatible version of re2c (>= 0.11.3) was not found; changes
to src/*.in.cc will not affect your build.
wrote build.ninja.
bootstrap complete. rebuilding...
[24/24] LINK ninja
cmark: using standard linker
+ cd /home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64
+ /usr/bin/cmake -G Ninja -DCMAKE_C_COMPILER:PATH=clang
-DCMAKE_CXX_COMPILER:PATH=clang++ -DCMAKE_BUILD_TYPE:STRING=Debug
/home/lanes/swift/cmark
CMake Error: CMake was unable to find a build program corresponding to
"Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a
different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be
not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Could not find cmake module
file:/home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64/CMakeFiles/2.8.11/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be
not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Could not find cmake module
file:/home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64/CMakeFiles/2.8.11/CMakeCXXCompiler.cmake
-- Configuring incomplete, errors occurred!
./swift/utils/build-script: command terminated with a non-zero exit
status 1, aborting

This leads me to a couple of questions:

* Do I need to first build and install re2c? If so, this should perhaps be
mentioned as a prereq.
* Is there anything differently I should be doing to get the bootstrap
process running successfully?

Thanks,
Lane

_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


(Dmitri Gribenko) #6

Interesting. So ninja is found in both places, but CMake does not see
it. What's your CMake version?

Dmitri

···

On Fri, Dec 4, 2015 at 12:36 PM, Lane Schwartz <dowobeha@gmail.com> wrote:

I'm on Scientific Linux 7.1. I added the two instances of "which ninja" as
you suggested, then re-ran build-script:

$ ./swift/utils/build-script
which: no ninja in
(/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/lanes/.local/bin:/home/lanes/bin)
Building the standard library for: swift-stdlib-linux-x86_64
Running Swift tests for: check-swift-linux-x86_64

/home/lanes/swift/build/Ninja-DebugAssert/ninja-build/ninja
cmark: using standard linker
+ which ninja
/home/lanes/swift/build/Ninja-DebugAssert/ninja-build/ninja
+ cd /home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64
+ /usr/bin/cmake -G Ninja -DCMAKE_C_COMPILER:PATH=clang
-DCMAKE_CXX_COMPILER:PATH=clang++ -DCMAKE_BUILD_TYPE:STRING=Debug
/home/lanes/swift/cmark
CMake Error: CMake was unable to find a build program corresponding to
"Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a
different build tool.

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/


(Lane Schwartz) #7

cmake version 2.8.11

···

On Fri, Dec 4, 2015 at 2:42 PM, Dmitri Gribenko <gribozavr@gmail.com> wrote:

On Fri, Dec 4, 2015 at 12:36 PM, Lane Schwartz <dowobeha@gmail.com> wrote:
> I'm on Scientific Linux 7.1. I added the two instances of "which ninja"
as
> you suggested, then re-ran build-script:
>
>> $ ./swift/utils/build-script
>> which: no ninja in
>>
(/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/lanes/.local/bin:/home/lanes/bin)
>> Building the standard library for: swift-stdlib-linux-x86_64
>> Running Swift tests for: check-swift-linux-x86_64
>>
>> /home/lanes/swift/build/Ninja-DebugAssert/ninja-build/ninja
>> cmark: using standard linker
>> + which ninja
>> /home/lanes/swift/build/Ninja-DebugAssert/ninja-build/ninja
>> + cd /home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64
>> + /usr/bin/cmake -G Ninja -DCMAKE_C_COMPILER:PATH=clang
>> -DCMAKE_CXX_COMPILER:PATH=clang++ -DCMAKE_BUILD_TYPE:STRING=Debug
>> /home/lanes/swift/cmark
>> CMake Error: CMake was unable to find a build program corresponding to
>> "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a
>> different build tool.

Interesting. So ninja is found in both places, but CMake does not see
it. What's your CMake version?

Dmitri

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/

--
When a place gets crowded enough to require ID's, social collapse is not
far away. It is time to go elsewhere. The best thing about space travel
is that it made it possible to go elsewhere.
                -- R.A. Heinlein, "Time Enough For Love"


(Dmitri Gribenko) #8

Is it feasible for you to try with cmake 3, or at least 2.8.12.2?
There have been many fixes for ninja in the 2.8.12.* series.

Dmitri

···

On Fri, Dec 4, 2015 at 12:44 PM, Lane Schwartz <dowobeha@gmail.com> wrote:

cmake version 2.8.11

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/


(Lane Schwartz) #9

I can confirm that using newer versions of cmake >= 2.8.12.2 fix this
problem. I'm now getting other problems, which I'll post in a separate
thread.

The strange thing is that llvm/CMakeLists.txt contains the line
cmake_minimum_required(VERSION 2.8.12.2), so when I ran with cmake 2.8.11 I
would have expected cmake to die at that point with an error message saying
I had too old of a version, but it didn't.

···

On Sat, Dec 5, 2015 at 2:01 AM, Dmitri Gribenko <gribozavr@gmail.com> wrote:

On Fri, Dec 4, 2015 at 12:44 PM, Lane Schwartz <dowobeha@gmail.com> wrote:
> cmake version 2.8.11

Is it feasible for you to try with cmake 3, or at least 2.8.12.2?
There have been many fixes for ninja in the 2.8.12.* series.

Dmitri

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/

--
When a place gets crowded enough to require ID's, social collapse is not
far away. It is time to go elsewhere. The best thing about space travel
is that it made it possible to go elsewhere.
                -- R.A. Heinlein, "Time Enough For Love"