Giter Club home page Giter Club logo

Comments (11)

alicebain avatar alicebain commented on September 28, 2024 1

Both are working! Thanks so much for the effort!

from pyopt.

madebr avatar madebr commented on September 28, 2024

I think the issue is not with pyopt (which is unmaintained, so please don't use this in new software).
Looks like you are building numpy from source for avx512 which your toolchain does not support.
I think you need to either install numpy first (python -m pip install --user numpy),
or pass extra arguments to limit the cpu features numpy uses.

from pyopt.

quantumadventure avatar quantumadventure commented on September 28, 2024

Thanks for the reply. I will try play with your suggestion and give a note in case of problems.

from pyopt.

alicebain avatar alicebain commented on September 28, 2024

Hi all,

I have also some issues with the installation of pyOpt in Python 3.10. Some of the optimizers work, some don't. It would be really great, if somebody can find a solution to get all the optimizers running. It is quite crucial for a project and was the whole reason to use pyOpt.

This is what I tried. I compiled them all one-by-one inplace via:

python setup.py build_ext --cpu-baseline="native" --inplace

The ones that I cannot import after building are: ALGENCAN, FSQP, GCMMA, MMA, MMFD, NLPQL, NLPQLP, SNOPT. These are the detailed errors that I get upon importing in Python:

For ALGENCAN:

Python 3.10.12+ (heads/3.10:917439d, Aug 16 2023, 18:31:40) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import algencan
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: pyALGENCAN/algencan.cpython-310-x86_64-linux-gnu.so: undefined symbol: pyobj_from_character1
>>> 

For FSQP

Python 3.10.12+ (heads/3.10:917439d, Aug 16 2023, 18:31:40) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ffsqp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: pyFSQP/ffsqp.cpython-310-x86_64-linux-gnu.so: undefined symbol: ffsqp_

For GCMMA

Python 3.10.12+ (heads/3.10:917439d, Aug 16 2023, 18:31:40) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gcmma
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: pyGCMMA/gcmma.cpython-310-x86_64-linux-gnu.so: undefined symbol: gcmma_

For MMA

Python 3.10.12+ (heads/3.10:917439d, Aug 16 2023, 18:31:40) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mma
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: pyMMA/mma.cpython-310-x86_64-linux-gnu.so: undefined symbol: mma_

For MMFD

Python 3.10.12+ (heads/3.10:917439d, Aug 16 2023, 18:31:40) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mmfd
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: pyMMFD/mmfd.cpython-310-x86_64-linux-gnu.so: undefined symbol: ads_

For NLPQL

Python 3.10.12+ (heads/3.10:917439d, Aug 16 2023, 18:31:40) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import nlpql
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: pyNLPQL/nlpql.cpython-310-x86_64-linux-gnu.so: undefined symbol: nlpql1_

For NLPQLP

Python 3.10.12+ (heads/3.10:917439d, Aug 16 2023, 18:31:40) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import nlpqlp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: pyNLPQLP/nlpqlp.cpython-310-x86_64-linux-gnu.so: undefined symbol: ql_

For SNOPT (throws also a lot of f2py errors while building):

Python 3.10.12+ (heads/3.10:917439d, Aug 16 2023, 18:31:40) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import snopt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: pySNOPT/snopt.cpython-310-x86_64-linux-gnu.so: undefined symbol: sninit_

Thanks a lot for any help!

from pyopt.

madebr avatar madebr commented on September 28, 2024

The algencan error is not expected, and I have reported a reproducer upstream (=numpy).

About the other optimizers, these don't work because their fortran sources are missing.
You need to obtain a license for these, and add their sources in the appropriate locations.

from pyopt.

madebr avatar madebr commented on September 28, 2024

ALGENCAN links now without missing symbols, but it is 100% untested.

from pyopt.

madebr avatar madebr commented on September 28, 2024

Closing this issue, since there's nothing I can do about the other failing modules, apart from moving them to another location.

from pyopt.

alicebain avatar alicebain commented on September 28, 2024

Great, it compiles and importing algencan directly from ~/.pyenv/versions/3.10-dev/lib/python3.10/site-packages/pyOpt/pyALGENCAN does not show any errors anymore!

BUT there is still the problem that ALGENCAN and FILTERSD do not appear as methods to pyOpt like the others, e.g. COBYLA:

Python 3.10.12+ (heads/3.10:56e8c87, Aug 22 2023, 13:43:03) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyOpt
>>> pyOpt.
pyOpt.COBYLA(             pyOpt.Objective(          pyOpt.SOLVOPT(            pyOpt.pyFILTERSD          pyOpt.pyOpt_objective     pyOpt.pySLSQP
pyOpt.CONMIN(             pyOpt.Optimization(       pyOpt.Variable(           pyOpt.pyKSOPT             pyOpt.pyOpt_optimization  pyOpt.pySOLVOPT
pyOpt.Constraint(         pyOpt.Optimizer(          pyOpt.pyALGENCAN          pyOpt.pyMIDACO            pyOpt.pyOpt_optimizer     
pyOpt.Gradient(           pyOpt.PSQP(               pyOpt.pyALHSO             pyOpt.pyNSGA2             pyOpt.pyOpt_parameter     
pyOpt.History(            pyOpt.Parameter(          pyOpt.pyALPSO             pyOpt.pyOpt_constraint    pyOpt.pyOpt_variable      
pyOpt.KSOPT(              pyOpt.SDPEN(              pyOpt.pyCOBYLA            pyOpt.pyOpt_gradient      pyOpt.pyPSQP              
pyOpt.NSGA2(              pyOpt.SLSQP(              pyOpt.pyCONMIN            pyOpt.pyOpt_history       pyOpt.pySDPEN    

Therefore, using these solvers unfortunately does not work. Can you please have a look? This most likely requires only a minor change to the code as I am pretty sure that both worked in python2. Thanks a lot! Can you please re-open the issue?

from pyopt.

madebr avatar madebr commented on September 28, 2024

I fixed algencan in 4e1aa7d.

pyopt.FILTERSD is apparently a wrapper around a python "filterSD" library, but Google doesn't tell me where I can find this library.
So unless you are able to track it down, consider filtersd dead too.

from pyopt.

alicebain avatar alicebain commented on September 28, 2024

Thanks! The module is now there, but I get another error:

  File ".pyenv/versions/3.10-dev/lib/python3.10/site-packages/pyOpt/pyALGENCAN/pyALGENCAN.py", line 401, in __solve__
    algencan.algencan(epsfeas,epsopt,efacc,eoacc,iprint,ncomp,nn,xx,xl,xu,mm,lm,equatn,linear,coded,checkder,ff,cnormu,snorm,nlpsupn,inform,ifile,evalf,evalg,evalh,evalc,evaljac,evalhc,evalfc,evalgjac,evalgjacp,evalhl,evalhlp)
ValueError: algencan.algencan() 22nd argument (ifile) can't be converted to int

And about FILTERSD I found this: https://github.com/coin-or/filterSD

from pyopt.

madebr avatar madebr commented on September 28, 2024

I think I fixed the obvious python errors.
It looks like the algencan optimizer did not receive a lot of attention, or it has bit rotted a lot.
So I'm not sure it will even work, and it might hang.

And about FILTERSD I found this: https://github.com/coin-or/filterSD

Cool. I looked at it again, and it was just a wrong import. It now imports.
But again, no guarantee on it working.

from pyopt.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.