conan-center-index icon indicating copy to clipboard operation
conan-center-index copied to clipboard

[request] recipe for LLVM components

Open jcar87 opened this issue 9 months ago • 5 comments

Package Name/Version

llvm/*

Webpage

https://llvm.org/

Source code

https://llvm.org/

Description of the library/tool

This issue is to gather information about potential use cases of an llvm recipe, or recipe for different llvm components.

jcar87 avatar Apr 30 '24 15:04 jcar87

I need LLVM for the Mesa package, several components. The libclang library is also used by Qt for QtTools. Currently a system library is used.

jwillikers avatar Apr 30 '24 15:04 jwillikers

My use case is for building clang tooling - ie standalone refactoring tools built on libclang and LLVM, code translation etc.

The llvm-core recipe has been updated for conan-2 and has been ready for review for some time. https://github.com/conan-io/conan-center-index/pull/22997

planetmarshall avatar Apr 30 '24 16:04 planetmarshall

I need llvm, libclang, and compiler-rt for a static analysis framework I want to see in CCI. The analysis is done on llvm-ir. For the generation of llvm-ir files, we need clang, clang++, and opt binary, which must be the same version as the consumed llvm library. As developers and consumers, this will allow us to use a different compiler/compiler version and remove the necessity of installing the same compiler again. We currently need llvm 14 because we relied on a crucial analysis part, which has been removed from llvm 15.

jusito avatar Apr 30 '24 18:04 jusito

I am a little bit confused about what's being asked here - there already is a recipe for LLVM in CCI - llvm-core, and has been for nearly three years. I've updated it for conan2, and additionally tested it with LLVM 18 and a downstream clang recipe that uses it as a dependency, but I can't add PRs for any of this work until #22997 is reviewed.

planetmarshall avatar May 01 '24 10:05 planetmarshall

I would like a way to deliver via Conan tools such as clang and supporting tools like clangd, clang-format and clang-tidy. The effort is to maintain a consistent developer environment. A working example is that CMake can be delivered consistently via Conan.

skipfowler avatar May 04 '24 19:05 skipfowler

The interest in LLVM Conan recipes is ancient, see https://github.com/conan-io/wishlist/issues/197 and the linked references there

and this issue is probably more or less a duplicate of #683 considering the talking points of each issue.

We do already have

  • https://github.com/conan-io/conan-center-index/tree/master/recipes/llvm-core
  • https://github.com/conan-io/conan-center-index/tree/master/recipes/llvm-openmp

There is also:

General issues / Component & Recipes requests / Technical discussions / Pull Requests

  • #683 (as mentioned)
  • #6816
    • a working stable recipe providing Fortran also blocks every project requiring Fortran, e.g. #4509
  • #9376
  • #6869
  • #17526
  • #20716
  • #1842
  • #1841
  • #20330
  • #23057
  • #22997
  • #1450
  • #7613
  • #17509
  • #24317
  • #24315

Bug reports (also showing interest in such recipes):

  • #20339
  • #12139
  • #17701
  • #9962
  • #5906

Duplicates:

  • #20163
  • #6548
  • #9669

Croydon avatar Jun 06 '24 05:06 Croydon

llvm-core and llvm-openmp are merely parts of the LLVM project (components). I've evaluated @planetmarshall 's llvm-core (version 18) and @jusito 's llvm (15, I'm looking towards 17). For my uses (c++ abi, unwind, clang, llvm, tidy) of analysis and compilation, the complete llvm project (not just core, or openmp), is ideal.

I would rather not cause more confusion with a new "llvm-components" recipe when there already exists llvm-openmp, or llvm-core, and @jusito 's llvm . I would keep it at a single recipe as llvm or llvm-projects and have users modify which components are needed.

Edit: For my uses, jusito's llvm works fine and provides me with what I need.

jacobfriedman avatar Jun 10 '24 20:06 jacobfriedman

It should be possible for LLVM component recipes to use llvm-core as a dependency, as LLVM itself works in this fashion.

For example, I have a clang recipe which uses llvm-core, but the clang recipe itself only contains the clang sources and not the entirety of the LLVM project.

planetmarshall avatar Jun 10 '24 20:06 planetmarshall

A similar experience is found with aws-sdk-cpp and its myriad of co-dependencies. @planetmarshall If one were to endeavour on such a task - to build out the libraries and resulting graph for llvm's projects conan - it would be A Great Thing. I would certainly lend my time to contribute to it.

The most fascinating aspect of LLVM is its ability to bootstrap / compile its own projects. If done incorrectly, it would not do the LLVM project justice. I insist; anyone who would want to manage this behemoth should care to have its own projects as build / tool dependencies.

jacobfriedman avatar Jun 10 '24 20:06 jacobfriedman

For those interested, I have opened draft PRs for llve-core 18.1.7 and a clang recipe based on it. These are WIP (particularly the clang recipe) but I have tested both for a local Linux build.

  • https://github.com/conan-io/conan-center-index/pull/24317
  • https://github.com/conan-io/conan-center-index/pull/24315

planetmarshall avatar Jun 13 '24 15:06 planetmarshall

Cool. Re: the settings... are you interested in using the self-compilation (bootstrap) process to avoid the need for gcc?

Evebtually something like build_requires('llvm-clang/18.1.7')

On Thu., Jun. 13, 2024, 11:43 a.m. Andrew Marshall, < @.***> wrote:

For those interested, I have opened draft PRs for llve-core 18.1.7 and a clang recipe based on it. These are WIP (particularly the clang recipe) but I have tested both for a local Linux build.

— Reply to this email directly, view it on GitHub https://github.com/conan-io/conan-center-index/issues/23834#issuecomment-2166044422, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFKHXQICWSUBYGJE3LZFCTZHG4YXAVCNFSM6AAAAABHAPLPN2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRWGA2DINBSGI . You are receiving this because you commented.Message ID: @.***>

jacobfriedman avatar Jun 13 '24 15:06 jacobfriedman

I'm surprised that it's been almost a week, yet there's no discussion on it. @memsharded, bootstrapped clang is the absolute base case for managing C-/C++-compiled dependencies. GCC requiring GCC to build is absurd. Clang should be a priority in this regard.

jacobfriedman avatar Jun 18 '24 15:06 jacobfriedman

This isn't a capability I need so I haven't really given it much thought. It would be something quite unusual in the conan ecosystem and I'm not aware of any other dependencies that do not depend on at least having a compiler available.

I expect it would need changes on the conan application level to allow this, in which case @memsharded is probably the one to ask.

planetmarshall avatar Jun 18 '24 15:06 planetmarshall

I've been working with dependency managers for decades. The inability of a dependency-management system to build absolutely everything, from its core, is a critical FAILURE of the dependency management system.

Some examples: cpython and its prebuilt .whl files for pip and setuptools. OpenJDK for its requirement of a previous Java installation. GCC for requiring GCC. I don't even want to mention Node or JS in any detail.

These eventually cause buildups and failures as churn and burnout hit when trying to whittle dependencies. Or, it results in disastrous security vulnerabilities and tsunami-scale updates when major patches come in.

I'm hoping that conan will rise above (and perhaps even build itself using C++, rather than python), but it needs a bootstrapped Clang first and foremost. All we need is some direction... @Croydon?

jacobfriedman avatar Jun 18 '24 16:06 jacobfriedman

Sounds great, but I think you're being a bit dramatic. I've been using Conan for years in commercial environments, as have many others, successfully, without the need to bootstrap a compiler.

As for rewriting the entire application in C++ purely for, as far as I can tell, aesthetic reasons - I think you're going to need to make a stronger case.

First and foremost I need something that works, and I will be focusing my energies there. It's an open source project, and I'm sure any improvements you can make will be welcome.

planetmarshall avatar Jun 18 '24 17:06 planetmarshall

This thread's purpose is to gather requirements and potential use cases. There exists a certain level-of-trust for sources, executables, and compilers that may never see a commercial environment. If all sources are to be gathered and compiled from scratch (i.e. absolute dependency management) this cannot happen until clang... or gcc... is bootstrapped.

jacobfriedman avatar Jun 18 '24 21:06 jacobfriedman