OpenMathLib / OpenMathLib/OpenBLAS

cblas.h function declarations should include calling convention specifier

Open
#618 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature request
Dominant language
C
Stars
7.6k
Forks
1.7k
Avg merge
1d 3h
Merged PRs (30d)
42

Description

Hi there!
I'm trying to use OpenBLAS in my code in MSVC2015 (@ Win7 x64). The code uses __vectorcall calling convention by default, and therefore any external function declared (such as that in cblas.h) are expected to conform this calling convention (extern "C" doesn't influence on that). At the same time, OpenBLAS is built with __cdecl calling convention and therefore it can't be used until cblas.h function declarations are hacked with proper __cdecl calling convention.

For example,

void cblas_dgemm(OPENBLAS_CONST enum .....bla-bla-bla);

should be declared as:

void __cdecl cblas_dgemm(OPENBLAS_CONST enum .....bla-bla-bla);

in order to be used in code with non-cdecl calling convention.

__cdecl keyword might be Microsoft specific, but you can make generic workaround with preprocessor macros.

Could you please update function declarations of cblas.h?
Thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating cblas.h and reviewing its CBLAS function declarations and existing preprocessor macros. Check how the declarations behave with MSVC2015 and __vectorcall, then verify that the declarations consistently preserve the library's __cdecl calling convention without breaking other platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.