This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: CMake fails to find the LLVM package with the LLVMConfig.cmake
- From: Ken Brown <kbrown at cornell dot edu>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Tue, 26 Nov 2019 23:48:13 +0000
- Subject: Re: CMake fails to find the LLVM package with the LLVMConfig.cmake
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LsxAMvOTH8T2AdB6DnkbaLcOypDkA5Iz7Himo1vNW5o=; b=jHc25x1FYstFUy0VomqnzBnkxYtalFIE2D15v1TtiAtoe82EwotNOasCPfGFqVVF3qsdWjNrmt9WLQqNZQ5zIxaZSFPSGXGxbZ8gEzEsrL1vxm64qXuZNQu/pfdEzJjcnUeM7GJ3CKTmeWG0lN8z0wQgFc6+5SNca3A5ssVlABTcoHj6klJFoLoYYt8nzofHXfydu5j8U7TwofBY6VIGqn+XM5BYRF6dyW3jTYfnVIgXxnKIdSYrmJFTxy9d52obKecKUTind5MS6FC7qMeH1FdyIJ5R+Zdn9t4KyGuL+oSpuI6ns/sMFxKCBS2FYmAQgwU+Ej5o/ieNnr09sjjXAw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nAL5E209C61u/vSsrnKLHdREeilvxnT1sEaoXb6G036/04pYDRcUgtwUoZ7+9lCK7/yGT0cHP2tieWiOBRMrDSVf9kWuFINoKkSi9JeXnI4hDjq15R1acOBAwGhvR4M2RCK/IZJ6E0dOO8aUE/zS1j4Yh/g6YH9j5dKT94ZkgaRBpw2wFQBj2tglCN/Df3ZQsYU57XAqTipZybN84ouFjkLMwPe4hdBfTMmC2PN53tIFEBgSgU3+Nn7mWHj/PWJnWaisUc0dCqucv2nIuvTBHpE/Z0vH9C0tcbv6TKMhbAz2vU2ELS3bLDASAm56KUq+SmwWunDpG5qCeX/K0pzQ1w==
- References: <CAOME8XTripBup--2v4OtrufAUS21pZySCQiK_3s+1ffvOM110g@mail.gmail.com>
On 11/25/2019 10:42 PM, Zhenghui Zhou wrote:
> I'm trying to build a project in cygwin64 under windows 10 which depends the
> LLVM libraries and had been built successfully under some linux
> environment. The problem is that the build scripts of CMake can not find
> the LLVM libraries.
>
> I have installed LLVM-devel package of cygwin64, and cmake can located the
> LLVMConfig.cmake file in /usr/lib/cmake/llvm directory which is installed
> along with the LLVM packages.
>
> An example of CMakeList.txt likes:
>
> cmake_minimum_required(VERSION 3.1)
> project(simple)
> message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
> find_package(LLVM REQUIRED CONFIG)
> message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
> ...
>
> And the output reports:
>
> -- Using LLVMConfig.cmake in: /usr/lib/cmake/llvm
> CMake Error at CMakeLists.txt:10 (find_package):
> Found package configuration file:
>
> /usr/lib/cmake/llvm/LLVMConfig.cmake
>
> but it set LLVM_FOUND to FALSE so package "LLVM" is considered to be NOT
> FOUND. Reason given by package:
>
> The following imported targets are referenced, but are missing:
> LLVMSupport
> LLVMCore LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMAnalysis
> LLVMipo LLVMMC LLVMPasses LLVMLinker LLVMIRReader LLVMBitReader
> LLVMMCParser LLVMObject LLVMProfileData LLVMTarget LLVMVectorize
>
> -- Configuring incomplete, errors occurred!
>
> After digging for several hours, I think the problem is caused by lacking
> of shared objects of LLVM. There are only static libraries of LLVM under
> Cygwin/Windows. A submit <https://reviews.llvm.org/D32668> of LLVM tells
> that the shared library targets may only need on most platforms so that the
> static library targets is split into theire own export file and can be
> ignored, The configuration entries in LLVMConfig.cmake are:
> ...
> include("${LLVM_CMAKE_DIR}/LLVMExports.cmake")
> include("${LLVM_CMAKE_DIR}/LLVMStaticExports.cmake" OPTIONAL)
> ...
> The static targets export file is set optional at the second line。However,
> configuration under cygwin will fail on the first line.
>
> So it may be figured that the second line goes in front:
> ...
> include("${LLVM_CMAKE_DIR}/LLVMStaticExports.cmake" OPTIONAL)
> include("${LLVM_CMAKE_DIR}/LLVMExports.cmake")
> ...
> Everything works fine now.
>
> Is there anything I missed or better suggestions?
The same problem was reported in
https://cygwin.com/ml/cygwin/2019-08/msg00419.html, and the solution you found
is the same as the one suggested by Yaakov in his reply.
Ken
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple