Skip to content

[bolt] 16.0.5: cmake fails #63172

@kloczek

Description

@kloczek

I'm trying to build bolt using https://github.com/llvm/llvm-project//releases/download/llvmorg-16.0.5//bolt-16.0.5.src.tar.xz

I'm not sure but on first look it looks like no one have been trying to build bold out of that tar ball because cmake warns on missing projrect() and cmake fails
I'm building bolt using set of cmake params like below:

%build
%cmake \
        -D BOLT_CLANG_EXE=%{_bindir}/clang \
        -D BOLT_INCLUDE_DOCS=ON \
        -D BOLT_INCLUDE_TESTS=ON \
        -D BOLT_LLD_EXE=%{_bindir}/ld.lld \
        -D BUILD_SHARED_LIBS=OFF \
        -D CMAKE_SKIP_RPATH=ON \
        -D LLVM_BUILD_UTILS=ON \
        -D LLVM_DIR=%{_libdir}/cmake/llvm \
        -D LLVM_EXTERNAL_LIT=%{_bindir}/lit \
        -D LLVM_INCLUDE_TESTS=ON \
        -D LLVM_LINK_LLVM_DYLIB=OFF \
        -D LLVM_TABLEGEN_EXE=%{_bindir}/llvm-tblgen \
        -D LLVM_TARGETS_TO_BUILD="X86;AArch64" \
%if 0%{?__isa_bits} == 64
        -D LLVM_LIBDIR_SUFFIX=64 \
%else
        -D LLVM_LIBDIR_SUFFIX= \
%endif
        %{nil}
%cmake_build

and cmake fails with

+ /usr/bin/cmake -B x86_64-redhat-linux-gnu -D BUILD_SHARED_LIBS=ON -D CMAKE_AR=/usr/bin/gcc-ar -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_FLAGS_RELEASE=-DNDEBUG -D CMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -D CMAKE_Fortran_FLAGS_RELEASE=-DNDEBUG -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_NM=/usr/bin/gcc-nm -D CMAKE_RANLIB=/usr/bin/gcc-ranlib -D CMAKE_VERBOSE_MAKEFILE=ON -D INCLUDE_INSTALL_DIR=/usr/include -D LIB_INSTALL_DIR=/usr/lib64 -D LIB_SUFFIX=64 -D SHARE_INSTALL_PREFIX=/usr/share -D SYSCONF_INSTALL_DIR=/etc -S . -D BOLT_CLANG_EXE=/usr/bin/clang -D BOLT_INCLUDE_DOCS=ON -D BOLT_INCLUDE_TESTS=ON -D BOLT_LLD_EXE=/usr/bin/ld.lld -D BUILD_SHARED_LIBS=OFF -D CMAKE_SKIP_RPATH=ON -D LLVM_BUILD_UTILS=ON -D LLVM_DIR=/usr/lib64/cmake/llvm -D LLVM_EXTERNAL_LIT=/usr/bin/lit -D LLVM_INCLUDE_TESTS=ON -D LLVM_LINK_LLVM_DYLIB=OFF -D LLVM_TABLEGEN_EXE=/usr/bin/llvm-tblgen -D 'LLVM_TARGETS_TO_BUILD=X86;AArch64' -D LLVM_LIBDIR_SUFFIX=64
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 13.1.1
-- The CXX compiler identification is GNU 13.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:22 (if):
  Policy CMP0057 is not set: Support new IN_LIST if() operator.  Run "cmake
  --help-policy CMP0057" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  IN_LIST will be interpreted as an operator when the policy is set to NEW.
  Since the policy is not set the OLD behavior will be used.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at CMakeLists.txt:22 (if):
  if given arguments:

    "clang" "IN_LIST" "LLVM_ENABLE_PROJECTS" "AND" "BOLT_CLANG_EXE"

  Unknown arguments specified


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.26)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions