conda-forge / casadi-feedstock

A conda-smithy repository for casadi.
BSD 3-Clause "New" or "Revised" License
8 stars 12 forks source link

Add workaround for using ipopt with spral as linear solver from Python with libgomp >= 13 #94

Closed traversaro closed 11 months ago

traversaro commented 11 months ago

This PR adds a workaround for the issue discussed in https://github.com/conda-forge/casadi-feedstock/issues/93#issuecomment-1732344044 .

In a nutshell, we have the following problems:

To workaround this, I made the following modifications for the casadi's routing to open a library via dlopen([..], [..]|RTLD_DEEPBIND):

This workaround is working fine locally to fix https://github.com/conda-forge/casadi-feedstock/issues/93, and I also added a regression test in the CI.

Note that in theory this can be problematic if in another thread there is a call to setenv that reallocates (and so invalidates) the value contained in environ. However, this is a risk intrinsic in any access to the environ global variable. For example, if there is a call to setenv after the first loop of https://github.com/gcc-mirror/gcc/blob/15345980633c502f0486a2e40e96224f49134130/libgomp/env.c#L2228, the environ variable could not be valid anymore. So the workaround only have a risk similar to any use of the environ global variable.

Checklist

conda-forge-webservices[bot] commented 11 months ago

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

traversaro commented 11 months ago

@conda-forge-admin, please rerender

conda-forge-webservices[bot] commented 11 months ago

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipe) and found some lint.

Here's what I've got...

For recipe:

conda-forge-webservices[bot] commented 11 months ago

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

traversaro commented 11 months ago

@conda-forge/casadi if you have any opinion in favor or against this feel free to comment, thanks!