bbopt / nomad

NOMAD - A blackbox optimization software
https://nomad-4-user-guide.readthedocs.io/
GNU Lesser General Public License v3.0
117 stars 24 forks source link

PyNomad is incompatible with Cython 3.0 #147

Closed jan-provaznik closed 1 year ago

jan-provaznik commented 1 year ago

With the new release (3.0) of Cython some implicit-cast errors have emerged in PyNomad.pyx, preventing PyNomad from being built.

One gets the following pair of errors.

Error compiling Cython file:
------------------------------------------------------------
...
    cdef size_t nbParams = len(params)
    for i in range(nbParams):
         eParams.append(params[i].encode(u"ascii"))

    if fSurrogate is None:
        runStatus = runNomad(cb, cbL, <void*> fBB, <vector[double]&> pX0,
                             ^
------------------------------------------------------------

PyNomad.pyx:196:29: Cannot assign type 'int (void *, shared_ptr[EvalPoint]) except? -1' to 'Callback'

Error compiling Cython file:
------------------------------------------------------------
...
    cdef size_t nbParams = len(params)
    for i in range(nbParams):
         eParams.append(params[i].encode(u"ascii"))

    if fSurrogate is None:
        runStatus = runNomad(cb, cbL, <void*> fBB, <vector[double]&> pX0,
                                 ^
------------------------------------------------------------

PyNomad.pyx:196:33: Cannot assign type 'vector[int] (void *, shared_ptr[Block]) except *' to 'CallbackL'