'Error regarding PyNumero while running Parmest example

​ Hi,

Has anyone tried running the examples given for the parmest package? When I run the rooney_biegler/parameter_estimation_example.py, I get the following error related to pynumero :

Traceback (most recent call last):
  File "parameter_estimation_example.py", line 48, in <module>
    main()
  File "parameter_estimation_example.py", line 35, in main
    obj, theta, cov = pest.theta_est(calc_cov=True, cov_n=n)
  File "/home/sandekum/.local/lib/python3.8/site-packages/pyomo/contrib/parmest/parmest.py", line 686, in theta_est
    return self._Q_opt(solver=solver, return_values=return_values,
  File "/home/sandekum/.local/lib/python3.8/site-packages/pyomo/contrib/parmest/parmest.py", line 464, in _Q_opt
    inverse_reduced_hessian.inv_reduced_hessian_barrier(
  File "/home/sandekum/.local/lib/python3.8/site-packages/pyomo/contrib/interior_point/inverse_reduced_hessian.py", line 123, in inv_reduced_hessian_barrier
    kkt_builder = InteriorPointInterface(m)
  File "/home/sandekum/.local/lib/python3.8/site-packages/pyomo/contrib/interior_point/interface.py", line 253, in __init__
    self._nlp = pyomo_nlp.PyomoNLP(pyomo_model)
  File "/home/sandekum/.local/lib/python3.8/site-packages/pyomo/contrib/pynumero/interfaces/pyomo_nlp.py", line 97, in __init__
    super(PyomoNLP, self).__init__(nl_file)
  File "/home/sandekum/.local/lib/python3.8/site-packages/pyomo/contrib/pynumero/interfaces/ampl_nlp.py", line 52, in __init__
    self._asl = _asl.AmplInterface(self._nl_file)
  File "/home/sandekum/.local/lib/python3.8/site-packages/pyomo/contrib/pynumero/asl.py", line 222, in __init__
    raise RuntimeError(
RuntimeError: Cannot load the PyNumero ASL interface (pynumero_ASL)
Exception ignored in: <function AmplInterface.__del__ at 0x7f2e11ae58b0>
Traceback (most recent call last):
  File "/home/sandekum/.local/lib/python3.8/site-packages/pyomo/contrib/pynumero/asl.py", line 275, in __del__
    self.ASLib.EXTERNAL_AmplInterface_free_memory(self._obj)
AttributeError: 'NoneType' object has no attribute 'EXTERNAL_AmplInterface_free_memory'

And therefore, I tried to install PyNumero following these instructions, but the command pyomo build-extensions gives the error

CMake Error at CMakeLists.txt:18 (INCLUDE):
  INCLUDE could not find load file:

    /home/sandekum/.local/lib/python3.8/site-packages/pyomo/contrib/pynumero/src/../../ampl_function_demo/src/FindASL.cmake


-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Configuring incomplete, errors occurred!
See also "/tmp/tmprslx1w6e/CMakeFiles/CMakeOutput.log".
ERROR: DistutilsExecError: command '/usr/bin/cmake' failed with exit status 1
INFO: Finished building Pyomo extensions.
INFO: The following extensions were built:
        [FAIL]  ampl_function_demo
        [ OK ]  appsi
        [ OK ]  mcpp
        [FAIL]  pynumero

Could someone please suggest how to deal with these errors? Thank you,

Best,



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source