Skip to content

How to compile funtion(type) to a shared library.  #217

@hudengjunai

Description

@hudengjunai

I'm very appricate your work.
Currently pylir comile a python script with main entry to AOT excutable binary.
Is there any way to modify code , to compile python function with type-hint to shared library that can be link and load in c++.

for example. just like the numba aot export.

from numba.pycc import CC

cc = CC('my_module')
# Uncomment the following line to print out the compilation steps
#cc.verbose = True

@cc.export('multf', 'f8(f8, f8)')
@cc.export('multi', 'i4(i4, i4)')
def mult(a, b):
    return a * b

@cc.export('square', 'f8(f8)')
def square(a):
    return a ** 2

if __name__ == "__main__":
    cc.compile()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions