Skip to content

GCC 15 omp.h error when using blis.h from C++ #873

Closed

Description

@melven

GCC 15.1 doesn't like to include omp.h from C++ in an extern "C" region.

However, there is a (unrequired?) #include <omp.h> in blis/blis.h in my installation.

Error message when using blis:

        /scratch/spack-25.2/opt/spack/linux-x86_64_v3/gcc-15.1.0-5n4zqcajsrnaeg7gaijph7rj54fpp76s/bin/g++ -DBLIS_WORKS -isystem /scratch/spack-25.2/opt/spack/linux-x86_64_v3/blis-1.0-nr2wasqmkindwiihhqfsivd7mahspgx7/include/blis -std=gnu
        In file included from ./frame/thread//bli_thrcomm_openmp.h:44,
                         from /home/zoel_ml/tartarus/build/CMakeFiles/CMakeScratch/TryCompile-HUaHcl/src.cxx:1:
        /scratch/spack-25.2/opt/spack/linux-x86_64_v3/gcc-15.1.0-5n4zqcajsrnaeg7gaijph7rj54fpp76s/lib/gcc/x86_64-pc-linux-gnu/15.1.0/include/omp.h:448:1: error: template with C linkage
          448 | template<typename __T, omp_allocator_handle_t __Handle>
              | ^~~~~~~~

Minimal example to demonstrate this behavior in a C++ file:

// works
//#include <omp.h>

// does not work
extern "C" {
#include <omp.h>
}

Activity

  1. devinamatthews commented on Jun 24, 2025

    @devinamatthews
    Member

    Hi @melven thanks for reporting this, it should be fixed in #875.

  2. melven commented on Jun 25, 2025

    @melven
    Author

    Looks good, thanks!

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions