Skip to content

Catalyst should use the .dylib file extension where appropriate for macOS builds #1347

Open
@joeycarter

Description

@joeycarter

Catalyst uses the .so file extension for dynamic libraries on macOS in a few places (see below). We should rename these libraries so that they use the standard .dylib extension.

A few examples where we use the .so file extension (this is not necessarily an exhaustive list):

catalyst/setup.py

Lines 241 to 254 in 57bc011

class CustomBuildExtMacos(UnifiedBuildExt):
"""Custom build extension class for macOS platforms
In addition to the work performed by the base class UnifiedBuildExt, this
class also changes the LC_ID_DYLIB that is otherwise constant and equal to
where the shared library was created.
"""
def run(self):
# Run the original build_ext command
super().run()
# Construct library name based on ext suffix (contains python version, architecture and .so)
library_name = "libcustom_calls.so"

set_target_properties(catalyst_callback_registry PROPERTIES SUFFIX ".so")

set_target_properties(wrapper PROPERTIES SUFFIX ".so")

Be sure to update the relevant Makefile commands and build scripts as well, for example:

catalyst/Makefile

Lines 215 to 216 in 57bc011

clean-frontend:
find frontend/catalyst -name "*.so" -exec rm -v {} +

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions