---
title: "makeDynamicLibrary(library:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtl4compiler/makedynamiclibrary(library:)"
---

# makeDynamicLibrary(library:)

Creates a new dynamic library from a library containing Metal IR code synchronously.

## Declaration

```swift
func makeDynamicLibrary(library: any MTLLibrary) throws -> any MTLDynamicLibrary
```

## Parameters

- `library`: A library from which this compiler creates the new a dynamic library

## Return Value

Return Value A new dynamic Metal library upon success, nil otherwise.
