Skip to content

Provide a pkg-config file #56465

@nagisa

Description

@nagisa

🚀 Feature

A typical install of libtorch should come with a pkg-config file, describing how to build code relying on libtorch headers and how to link to libtorch libraries.

Motivation

Users of libtorch right now must resort to major hacks in order to correctly build torch-dependent code or link to libtorch, compared to most other native libraries.

Pitch

pkg-config is the standard and conventional mechanism to provide dependency information and linkage/build instructions on UNIX systems (with maybe an exception of macs).

Alternatives

People continue to hack around lack of the standard/blessed dependency discovery using the horror known as environment variables. Building any code successfully requires one to always remember to set this environment variable up.

They might also manually hardcode the dependency information into their build tooling. And then suffer breakage or and/or continue using irrelevant dependencies once the dependencies of torch itself change.

Additional context

https://en.wikipedia.org/wiki/Pkg-config
Tensorflow has this since 2017

cc @malfet @seemethere @walterddr

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA request for a proper, new feature.module: buildBuild system issuestriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions