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

Help needed? #1

Open
ivan-pi opened this issue Aug 11, 2021 · 3 comments
Open

Help needed? #1

ivan-pi opened this issue Aug 11, 2021 · 3 comments

Comments

@ivan-pi
Copy link
Collaborator

ivan-pi commented Aug 11, 2021

Hello Sebastian,

I have the feeling like you went through the trouble of doing a full interface rewrite?

I had attempted a Fortran interface a few years ago, but never completed it: stevengj/nlopt#233
An issue I ran into at the time was memory leaks, when calling the remove inequality constraints.
Recently I also started to make an fpm compatible version in a private repo, after realizing this is in fact an easier distribution method than contributing to the upstream.

I understand you support both function and derived-type call back interfaces? 🚀 Just like I did you are using an adaptor pattern to conform to the original NLopt interface.

Are there any remaining areas where you could use some help? I'm very familiar with NLopt and even used it in a paper I submitted. I'm really happy I get to use it as a fpm package now!

@ivan-pi
Copy link
Collaborator Author

ivan-pi commented Aug 11, 2021

A few points I've noticed:

Also, I wonder if calling codes should really import the kind as wp => nlopt_wp? (Of course in big projects you still need to verify that the nlopt_wp parameter matches whatever precision is being used elsewhere.)

@awvwgk
Copy link
Member

awvwgk commented Aug 11, 2021

Sure, you're always welcome. I just invited you as a collaborator for this repository.

I've seen your fork, but considered it impractical to use a patched upstream version of nlopt due to the ABI compatibility issue this would introduce for different Fortran compilers. Instead I decided it would be preferable to use the excellent stability of the C-ABI and create a separate project that can be easily redistributed with the dependent projects.

My target is to have something that can be included in my tblite library (especially for the parameter optimization subcommand), which itself is a dependency of projects like DFTB+ (CMake based) or QCxMS (meson based).

@ivan-pi
Copy link
Collaborator Author

ivan-pi commented Aug 11, 2021

Instead I decided it would be preferable to use the excellent stability of the C-ABI and create a separate project that can be easily redistributed with the dependent projects.

I came to the same realization after we opened the pkgconfig issue in fpm, and realized it is easier to ship a nlopt wrapper as an independent project. They do the same for the Julia wrapper: https://github.com/JuliaOpt/NLopt.jl.

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

No branches or pull requests

2 participants