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

Update PRIMA.jl for the updated artifact #1

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

amontoison
Copy link
Member

@amontoison amontoison commented Sep 21, 2023

I generated the wrappers with Clang.jl last week (libprima/prima#62),
I propose to merge everything in this repository.

@emmt
Copy link
Collaborator

emmt commented Sep 22, 2023

Sorry I pushed a lots of changes (mostly documentation) before I realized that you have made this PR.

In the mean time, I have commented in libprima/prima#62 (comment) about the needs of a separate repository for the Julia interface.

I'll try to review your proposed changes as soon as possible.

@emmt
Copy link
Collaborator

emmt commented Sep 22, 2023

OK if I understood well, the subdirectory gen contains code to help building the src/wrappers.jl file that implement all the low-level interface to the PRIMA library. In its current state, the produced src/wrappers.jlhas to be edited by hand (what you have done) to eliminate some definitions and replace function pointer types byPtr{Cvoid}` and push the changes.

Thus, the code in gen is mostly for us, the developpers, in the sense that it is not meant to be part of the build stage when PRIMA.jl is installed by some end-user.

I think all this is very good idea. It spares the end-user installing and loading heavy package such as Clang.jl. Parts of the wrapper that can be written automatically will be easy to update while we keep our hands on the other parts to fix what has been done by Clang.jl (which is powerful but not always do exactly what we want). Since the generated and edited code is part of the repoitory, we can always follows changes in the end-product (not just in the generator). I seriously think that I will propagate this sort of tricks in the other packages where I use Clang.jl.

As was done before your proposed changes, I would like to "simpify" the names of the symbols (such as enumeration constants) that may be useful for the end-user. These will not be exported, so the package module prefix will avoid ambiguities. For example, currently PRIMA.SMALL_TR_RADIUS whereas with the generated wraper PRIMA.PRIMA_SMALL_TR_RADIUS. This can be done automatically (by making string/regex substitutions in the auto-generated code) or by hand.

@emmt emmt merged commit 4dab2a9 into libprima:main Sep 22, 2023
@emmt
Copy link
Collaborator

emmt commented Sep 22, 2023

Merge done, I just had to make a few fixes (emmt@cc5afd3).

Thanks for all this!

@amontoison amontoison deleted the julia_wrappers branch October 16, 2023 05:51
@amontoison
Copy link
Member Author

Sorry for not answering ealier @emmt. In general I add a rewriter.jl in the gen folder such that we don't edit by hand the wrappers generated by Clang.jl.
I have an example of rewriter.jl in HSL.jl.
I will open a PR tonight.

@amontoison
Copy link
Member Author

You were faster than me, you already added the string/regex substitutions.

@emmt
Copy link
Collaborator

emmt commented Oct 16, 2023

Yes, I did that some time ago. Sorry I didn't mention it specifically. I just wrote that:

Merge done, I just had to make a few fixes (cc5afd3).

Shall we close this?

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.

2 participants