Skip to content

Add build option for ILP64 - #184

Open
ndgrigorian wants to merge 6 commits into
masterfrom
add-ilp64-build-option
Open

Add build option for ILP64#184
ndgrigorian wants to merge 6 commits into
masterfrom
add-ilp64-build-option

Conversation

@ndgrigorian

Copy link
Copy Markdown
Collaborator

This PR adds a meson.options file and adds a build option for ILP64.

With this option added, the definition of functions for initializing MKL with the ILP64 interface are gated by ifdefs, silencing a compiler warning

@ndgrigorian
ndgrigorian marked this pull request as ready for review April 13, 2026 16:18
@ndgrigorian
ndgrigorian force-pushed the add-ilp64-build-option branch 2 times, most recently from 7e1f82a to b06c721 Compare May 10, 2026 01:41
Base automatically changed from use-meson-build to master July 21, 2026 14:49
fixes compiler warning about unused function
Copilot AI lite review requested due to automatic review settings August 6, 2026 14:12
@ndgrigorian
ndgrigorian force-pushed the add-ilp64-build-option branch from b06c721 to cacc4ab Compare August 6, 2026 14:12
@antonwolfy antonwolfy added this to the 2.9.0 release milestone Aug 6, 2026
Comment thread meson.options

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Meson build-time option to compile mkl-service against MKL’s ILP64 interface, and uses that option to conditionally compile the ILP64 vs LP64 init path in the Linux preload/init extension to avoid unused-function compiler warnings.

Changes:

  • Introduces a new Meson boolean option ilp64 in meson.options.
  • Wires -DMKL_ILP64 into the Meson c_args when the option is enabled.
  • Gates _set_mkl_ilp64() / _set_mkl_lp64() compilation and selection in mkl/_mklinitmodule.c.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
mkl/_mklinitmodule.c Conditionally compiles and selects ILP64 vs LP64 init helper to avoid unused code paths and warnings.
meson.options Adds a new ilp64 boolean build option.
meson.build Attempts to add -DMKL_ILP64 to compiler args when the option is enabled.

Comment thread meson.build
@ndgrigorian
ndgrigorian requested a review from antonwolfy August 6, 2026 15:21
@ndgrigorian

Copy link
Copy Markdown
Collaborator Author

CI failures are unrelated to PR content and are likely some kind of server issue

Comment thread meson.options
Comment thread meson.options
Comment thread meson.options

@antonwolfy antonwolfy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @ndgrigorian
I added few more comments nits, but all of them are minor and can be dropped.

Comment thread README.md
Comment on lines +60 to +61
| Option | Type | Default | Description |
| ------- | ------- | ------- | ------------------------------------ |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems the table is missaligned:

Suggested change
| Option | Type | Default | Description |
| ------- | ------- | ------- | ------------------------------------ |
| Option | Type | Default | Description |
| ------- | ------- | ------- | ------------------------------------- |

Comment thread meson.build
c_args = ['-DNDEBUG']

if get_option('ilp64')
c_args += '-DMKL_ILP64'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be helpful to add a comment "correct only for MKL_LINK=sdl; for static/dynamic, also drive the interface library via MKL_INTERFACE"?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or probably even to add setting MKL_INTERFACE=ilp64 with SDL, since it makes no effect with SDL, but will work for static/dynamic.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And adding MKL_INTERFACE=lp64 to off explicitly when ilp64=false

Comment thread meson.build
c_args = ['-DNDEBUG']

if get_option('ilp64')
c_args += '-DMKL_ILP64'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it seems meson is going to be more strict:

The SDL defaults to the LP64 interface and Intel OpenMP
('iomp') threading, with switching other interface and threading options
being accessible at runtime. When using the 'sdl' module, either leave out
the interface and threading modules or use values that match the SDL defaults -
anything else will raise an error.

and will not planning to automate sdl + ilp64 combination.

If anything, it's worth a note to the meson PR that SDL+ILP64 is a legitimate Intel-supported configuration that their current model can't express

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants