SNOPT Module Compilation and OpenMDAO build_pyoptsparse deprecation
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 270
- Forks
- 123
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 3
Description
Description of feature
Hello all, first let me say that I'm really happy with the cyipopt interface so that we can get a working pyoptsparse with IPOPT trivially. Building the SNOPT module just seems like it could be made easier.
I've decided to take a approach of having a build_snopt_module script that will build the SNOPT module using either the source files or an existing shared library.
Potential solution
I've implemented a script that seems to work here, but I need more testers. I'd love to be able to get this working on windows using the Intel IFX compiler if possible.
https://github.com/robfalck/pyoptsparse/blob/build_snopt_module/pyoptsparse/build_snopt_module.py
This would mean we could get SNOPT up and working with a conda-installed version of pyoptsparse using a simple command:
python -m pyoptsparse.build_snopt_module ~/Downloads/snopt-7.7/src
or, if a dynamic library already exists:
python -m pyoptsparse.build_snopt_module --snopt-lib /path/to/libsnopt7.so
Some questions
I'm currently downloading some necessary files from github in the script because, while included in the setup.py package_data, they are not made available on conda: https://github.com/robfalck/pyoptsparse/blob/498e4820d2eddd06eb092c25e8701107a90804e2/pyoptsparse/build_snopt_module.py#L127
If these were available in the conda version this would get a little more simple.
The grab-all-fortran-files script was skipping both Actually this is a case where it seems that depending on when it was obtained some people have different files in their SNOPT library. I added logic to only include the appropriate ones in the compilation.sn27lu77.f and sn27lu90.f. I needed to include the latter to get this to work.
Testing is difficult on CI because, while I'd use this on the OpenMDAO side of things, I'm not sure how your CI testing works with SNOPT.
If we get this working we'd probably be able to deprecate build_pyoptsparse. Would you be interested in accepting this script?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with pyoptsparse/build_snopt_module.py and compare it with setup.py and the existing build_pyoptsparse flow. Run the documented commands using SNOPT source files and an existing shared library, then investigate the package-data and Windows Intel IFX concerns. Done means the module builds through the proposed entry point in the supported scenarios and the deprecation path is clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fortran, python
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100