Skip to content

SNOPT Module Compilation and OpenMDAO build_pyoptsparse deprecation #473

@robfalck

Description

@robfalck

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 sn27lu77.f and sn27lu90.f. I needed to include the latter to get this to work. 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.

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?

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