Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for GPU Interface #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Define version macros in extension
  • Loading branch information
lukastruemper committed Mar 11, 2023
commit c0d9289dc0f978a5830b6b37a7b60eaf663750fd
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -95,6 +95,8 @@ def get_hierarchy():

try:
LIKWID_PREFIX, LIKWID_LIBPATH, LIKWID_LIB, LIKWID_INCPATH = get_hierarchy()
# TODO
major, minor, release = (5, 3, 2)
Copy link
Member

Choose a reason for hiding this comment

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

Hardcoded version is not future-proof. The major and minor number is present in likwid.h after installation, so maybe we read it from there.
Remark: There is no version 5.3.2

print(LIKWID_PREFIX, LIKWID_LIBPATH, LIKWID_LIB, LIKWID_INCPATH)
except Exception as e:
print(e)
@@ -105,6 +107,7 @@ def get_hierarchy():
include_dirs=[LIKWID_INCPATH],
libraries=[LIKWID_LIB],
library_dirs=[LIKWID_LIBPATH],
define_macros=[("LIKWID_MAJOR", major), ("LIKWID_MINOR", minor), (("LIKWID_RELEASE", release))],
Copy link
Member

Choose a reason for hiding this comment

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

Does this work? The variables major, minor and release are defined in a try block, so they are probably not in scope anymore.

Copy link
Member

Choose a reason for hiding this comment

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

There exists a function likwidversion that returns the version at runtime.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, but the MACROS are not defined. It seems like there's a differently named MACRO in likwid.h, which comprises a string of the full version, .e.g., "5.3.2". So it seems like the function is broken when not defining the macros here

sources=["pylikwid.c"])

setup(