Casadi solver failure on MacOS #21

Closed
opened 2025-07-10 10:09:04 -07:00 by aniva · 1 comment
Owner
Vide: https://github.com/prefix-dev/pixi/issues/3479
aniva added the
category
build
label 2025-07-10 10:09:04 -07:00
aniva self-assigned this 2025-07-10 10:09:04 -07:00
Author
Owner

It says a script like this can fix the problem (with LIB_PATH replaced)

#!/bin/bash
# filepath: fix_lib_paths.sh
# https://github.com/conda-forge/numpy-feedstock/issues/347#issuecomment-2746317575
# Activate the conda environment and run this script.

set -e

LIB_PATH=".venv/lib"

# Find all dylib files
find "$LIB_PATH" -name "*.dylib" -o -name "*.so" | while read -r library; do
    echo "Processing $library..."
    
    # Extract all LC_RPATH entries
    rpaths=$(otool -l "$library" | grep -A2 LC_RPATH | grep "path " | awk '{print $2}')
    
    # Create a temporary file to track seen rpaths
    temp_file=$(mktemp)
    
    # Check for duplicates and remove them
    echo "$rpaths" | while read -r rpath; do
        if [[ -z "$rpath" ]]; then
            continue
        fi
        
        if grep -q "^$rpath$" "$temp_file"; then
            echo "  Removing duplicate RPATH: $rpath"
            install_name_tool -delete_rpath "$rpath" "$library" || true
        else
            echo "$rpath" >> "$temp_file"
            echo "  Keeping RPATH: $rpath"
        fi
    done
    
    # Re-sign the library
    echo "  Re-signing $library"
    codesign --force --sign - "$library" || echo "  Warning: Could not sign $library"
    
    # Clean up the temporary file
    rm -f "$temp_file"
    
    echo "Done with $library"
    echo "-----------------------"
done

echo "All libraries processed!"

It says a script like this can fix the problem (with `LIB_PATH` replaced) ```sh #!/bin/bash # filepath: fix_lib_paths.sh # https://github.com/conda-forge/numpy-feedstock/issues/347#issuecomment-2746317575 # Activate the conda environment and run this script. set -e LIB_PATH=".venv/lib" # Find all dylib files find "$LIB_PATH" -name "*.dylib" -o -name "*.so" | while read -r library; do echo "Processing $library..." # Extract all LC_RPATH entries rpaths=$(otool -l "$library" | grep -A2 LC_RPATH | grep "path " | awk '{print $2}') # Create a temporary file to track seen rpaths temp_file=$(mktemp) # Check for duplicates and remove them echo "$rpaths" | while read -r rpath; do if [[ -z "$rpath" ]]; then continue fi if grep -q "^$rpath$" "$temp_file"; then echo " Removing duplicate RPATH: $rpath" install_name_tool -delete_rpath "$rpath" "$library" || true else echo "$rpath" >> "$temp_file" echo " Keeping RPATH: $rpath" fi done # Re-sign the library echo " Re-signing $library" codesign --force --sign - "$library" || echo " Warning: Could not sign $library" # Clean up the temporary file rm -f "$temp_file" echo "Done with $library" echo "-----------------------" done echo "All libraries processed!" ```
aniva closed this issue 2025-07-10 21:01:42 -07:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: aniva/Cosplay#21
No description provided.