Skip to content

lapacke_mangling.h file not found for CMake build #614

@bjack205

Description

@bjack205

I'm trying to build LAPACK / BLAS inside of a CMake project and using the exported targets. My CMakeLists.txt file looks like this:

include(FetchContent)
FetchContent_Declare(lapacklib
  GIT_REPOSITORY https://github.com/Reference-LAPACK/lapack.git
  GIT_TAG aa631b4b4bd13f6ae2dbab9ae9da209e1e05b0fc
)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
set(CBLAS "ON")
set(LAPACKE "ON")
FetchContent_MakeAvailable(lapacklib)

add_executable(main
  main.c
)
target_link_libraries(main
  PRIVATE
  lapacke
  cblas
)

With a very simple main file:

#include <stdlib.h>
#include <stdio.h>
#include "lapacke.h"

int main() {
  printf("Hello, world!\n");
}

My project configures just fine, and I've verified that it exports the cblas and clapacke targets, but when I go to build my executable it fails with

[build] In file included from /home/brian/.julia/dev/SparseTOSolvers/build/_deps/lapacklib-src/LAPACKE/include/lapacke.h:36:
[build] /home/brian/.julia/dev/SparseTOSolvers/build/_deps/lapacklib-src/LAPACKE/include/lapack.h:11:10: fatal error: 'lapacke_mangling.h' file not found
[build] #include "lapacke_mangling.h"
[build]          ^~~~~~~~~~~~~~~~~~~~
[build] 1 error generated.

This file is supposed to be generated during the build, right? So why is this not working as expected?

Thanks!

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