Skip to content

pkg-config file doesn't reflect 64_ symbol suffix #3790

Closed
@rgommers

Description

If you build OpenBLAS for ILP64 with the standard symbol suffix 64_

$ make INTERFACE64=1 SYMBOLSUFFIX=64_ USE_OPENMP=0 NO_STATIC=1 BINARY="64" DYNAMIC_ARCH=1 QUIET_MAKE=1
$ make INTERFACE64=1 SYMBOLSUFFIX=64_ USE_OPENMP=0 NO_STATIC=1 BINARY="64" DYNAMIC_ARCH=1 QUIET_MAKE=1 PREFIX=$PWD/tmpdir install
$ ls tmpdir/lib/
cmake  libopenblas64_p-r0.3.21.dev.so  libopenblas64_.so  libopenblas64_.so.0  pkgconfig
$ ls tmpdir/lib/pkgconfig/
openblas.pc
$ cat tmpdir/lib/pkgconfig/openblas.pc 
libdir=/home/rgommers/code/tmp/OpenBLAS/tmpdir/lib
includedir=/home/rgommers/code/tmp/OpenBLAS/tmpdir/include
openblas_config= USE_64BITINT= DYNAMIC_ARCH=1 DYNAMIC_OLDER= NO_CBLAS= NO_LAPACK= NO_LAPACKE= NO_AFFINITY=1 USE_OPENMP=0 SKYLAKEX MAX_THREADS=24
version=0.3.21.dev
extralib=-lm -lpthread -lm -lpthread
suffix=64_
Name: openblas
Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version
Version: ${version}
URL: https://github.com/xianyi/OpenBLAS
Libs: -L${libdir} -lopenblas
Libs.private: ${extralib}
Cflags: -I${includedir}

If the library produced is libopenblas64_.so, then the link like should use -lopenblas64_ (and I tested that that fixes the issue I was seeing). Or more generally, it should probably contain -lopenblas${suffix} with a suffix variable defined above it.

The thing I'm less sure about is: should the produced .pc file be named openblas64_.pc instead of plain openblas.pc? Or perhaps better, don't use the symbol suffix in the name but name it openblas-ilp64.pc. That way it's actually possible to install both LP64 and ILP64 builds next to each other without a conflict, and select the one you want and know what it is without resorting to checking the binary itself via compiling some code. I'll also note that MKL uses a -lp64/-ilp64 scheme.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions