# \#ffi

**URL:** https://discourse.julialang.org/tag/ffi/222.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Create \`BigInt\` directedly from MPZ pointer](https://discourse.julialang.org/t/create-bigint-directedly-from-mpz-pointer/138903)

<div class="topic-metadata">

**Author:** [@Chrysoberyl](https://discourse.julialang.org/u/Chrysoberyl)\
**Replies:** 6\
**Last updated:** [August 25, 2026, 5:52am UTC](https://discourse.julialang.org/t/create-bigint-directedly-from-mpz-pointer/138903 "2026-08-25T05:52:11Z")

</div>

I have some FFI code that interfaces with another library, and the target library has GNU multiprecision integers. Is it possible to create a BigInt directly from such a multiprecision integer pointer? The default constr…

---

## [I got bored and built a 2x2 MIMO FxNLMS ANC simulator in Julia + C23](https://discourse.julialang.org/t/i-got-bored-and-built-a-2x2-mimo-fxnlms-anc-simulator-in-julia-c23/138826)

<div class="topic-metadata">

**Author:** [@blah\_blah.jl](https://discourse.julialang.org/u/blah_blah.jl)\
**Replies:** 0\
**Last updated:** [August 15, 2026, 1:42pm UTC](https://discourse.julialang.org/t/i-got-bored-and-built-a-2x2-mimo-fxnlms-anc-simulator-in-julia-c23/138826 "2026-08-15T13:42:43Z")

</div>

Hey folks, Today morning was aggressively boring, so naturally I ended up building a 2x2 MIMO active noise control simulator. I have recently started poking around the border between DSP and control systems, and for so…

---

## [Julia's Interaction with Foreign Threads](https://discourse.julialang.org/t/julias-interaction-with-foreign-threads/133888)

<div class="topic-metadata">

**Author:** [@Chrysoberyl](https://discourse.julialang.org/u/Chrysoberyl)\
**Replies:** 1\
**Last updated:** [November 20, 2025, 4:04am UTC](https://discourse.julialang.org/t/julias-interaction-with-foreign-threads/133888 "2025-11-20T04:04:28Z")

</div>

In my use case, I’m creating a Julia library for Julia code to interact with Rust code. It has 3 types of threads: Threads created by Julia, which can handle foreign objects via ForeignType Threads created by Rust, whi…

---

## [Remove memory from Julia's management](https://discourse.julialang.org/t/remove-memory-from-julias-management/133983)

<div class="topic-metadata">

**Author:** [@Chrysoberyl](https://discourse.julialang.org/u/Chrysoberyl)\
**Replies:** 2\
**Last updated:** [November 19, 2025, 12:19pm UTC](https://discourse.julialang.org/t/remove-memory-from-julias-management/133983 "2025-11-19T12:19:01Z")

</div>

When calling into Julia and using it as a library, is it possible to remove an allocated datum from Julia’s management? My use case is this: I have a Julia function, passed across FFI as a callback, which creates data b…

---

## [Execute Function for each Julia Thread](https://discourse.julialang.org/t/execute-function-for-each-julia-thread/133889)

<div class="topic-metadata">

**Author:** [@Chrysoberyl](https://discourse.julialang.org/u/Chrysoberyl)\
**Replies:** 6\
**Last updated:** [November 15, 2025, 7:02am UTC](https://discourse.julialang.org/t/execute-function-for-each-julia-thread/133889 "2025-11-15T07:02:36Z")

</div>

I have an external library which requires thread local resources to function. For every thread Julia creates, it must notify this library via an initialize\_thread\_local() function. Is there a way to run this code for eac…

---

## [Having a julia package inside a monorepo called from python](https://discourse.julialang.org/t/having-a-julia-package-inside-a-monorepo-called-from-python/132549)

<div class="topic-metadata">

**Author:** [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Replies:** 1\
**Last updated:** [September 22, 2025, 3:26am UTC](https://discourse.julialang.org/t/having-a-julia-package-inside-a-monorepo-called-from-python/132549 "2025-09-22T03:26:55Z")

</div>

so I have a largish python code base in a nice mono-repo. (Its also got some typescript in there). I want to move some of our core logic to julia for performanced. So I thought I would make a (local, unregistered) jul…

---

## [Performance comparison of a custom gcd() function in Julia, C, and Rust](https://discourse.julialang.org/t/performance-comparison-of-a-custom-gcd-function-in-julia-c-and-rust/121665)

<div class="topic-metadata">

**Author:** [@jbytecode](https://discourse.julialang.org/u/jbytecode)\
**Replies:** 7\
**Last updated:** [October 23, 2024, 10:58pm UTC](https://discourse.julialang.org/t/performance-comparison-of-a-custom-gcd-function-in-julia-c-and-rust/121665 "2024-10-23T22:58:53Z")

</div>

Here is the naive implementation of the gcd (Greatest Common Divisor) in Julia: function mygcd(a::Int64, b::Int64)::Int64 if a == b return a elseif a \> b return mygcd(a-b, b) else return m…

---

## [How to call functions/use symbols from a static library archive using FFI](https://discourse.julialang.org/t/how-to-call-functions-use-symbols-from-a-static-library-archive-using-ffi/118136)

<div class="topic-metadata">

**Author:** [@sivakon](https://discourse.julialang.org/u/sivakon)\
**Replies:** 1\
**Last updated:** [August 14, 2024, 1:25pm UTC](https://discourse.julialang.org/t/how-to-call-functions-use-symbols-from-a-static-library-archive-using-ffi/118136 "2024-08-14T13:25:27Z")

</div>

Currently the docs only show shared library, how can I use ccall to import symbols from an archive .a?

---

## [Problems with \`dlopen\`](https://discourse.julialang.org/t/problems-with-dlopen/98679)

<div class="topic-metadata">

**Author:** [@frylock](https://discourse.julialang.org/u/frylock)\
**Replies:** 10\
**Last updated:** [May 11, 2023, 2:27pm UTC](https://discourse.julialang.org/t/problems-with-dlopen/98679 "2023-05-11T14:27:05Z")

</div>

Ok I realize that dlopen may not be a new-to-Julia issue, but FFI is important for us to be able to expand usage of Julia in my company. I have read through the manual section on using C and Fortran (which is rather good…

---

## [Accessing json file from CoolProp.jl c interface](https://discourse.julialang.org/t/accessing-json-file-from-coolprop-jl-c-interface/96292)

<div class="topic-metadata">

**Author:** [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Replies:** 1\
**Last updated:** [March 19, 2023, 5:41am UTC](https://discourse.julialang.org/t/accessing-json-file-from-coolprop-jl-c-interface/96292 "2023-03-19T05:41:19Z")

</div>

hi. i’m trying to make a port of some CoolProp functions in julia. The idea is to use the same CoolProp JSON files that have component properties, but read those in the julia side. One problem i see is that the current C…

---

## [New Julia interface in Wolfram Mathematica works great](https://discourse.julialang.org/t/new-julia-interface-in-wolfram-mathematica-works-great/64681)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 6\
**Last updated:** [July 15, 2021, 1:57pm UTC](https://discourse.julialang.org/t/new-julia-interface-in-wolfram-mathematica-works-great/64681 "2021-07-15T13:57:13Z")

</div>

Mathematica added a built-in Julia interface in version 12 last year. I had a try and found the interface quite convenient. Here’s a short example, using Julia to speed up calculation of Fibonacci numbers, using an ineff…

---

## [DLL problems, episode 2](https://discourse.julialang.org/t/dll-problems-episode-2/12405)

<div class="topic-metadata">

**Author:** [@Ralph\_Smith](https://discourse.julialang.org/u/Ralph_Smith)\
**Replies:** 22\
**Last updated:** [March 21, 2019, 1:06am UTC](https://discourse.julialang.org/t/dll-problems-episode-2/12405 "2019-03-21T01:06:29Z")

</div>

TL;DR: shared library conflicts are coming soon, to a Julia installation near you. Perhaps only for a short-run engagement. I don’t know where to file this issue, so I’ll try here. My immediate problem is in trying to …

---

## [Cfunctions with local types on v0.7](https://discourse.julialang.org/t/cfunctions-with-local-types-on-v0-7/12343)

<div class="topic-metadata">

**Author:** [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Replies:** 10\
**Last updated:** [July 13, 2018, 9:41pm UTC](https://discourse.julialang.org/t/cfunctions-with-local-types-on-v0-7/12343 "2018-07-13T21:41:14Z")

</div>

I am trying to get cfunction to work with local functions and types https://github.com/JuliaDiffEq/Sundials.jl/commit/54e7e18788fed1b10c2bb69fcc375f45f0de0177 I think I am having some GC segfaults because of this. @rde…
