# \#embedding

**URL:** https://discourse.julialang.org/tag/embedding/48.md

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

---

## [GC problems with \`jl\_gc\_unsafe\_enter\` with multithreaded embedding](https://discourse.julialang.org/t/gc-problems-with-jl-gc-unsafe-enter-with-multithreaded-embedding/104467)

<div class="topic-metadata">

**Author:** [@Keluaa](https://discourse.julialang.org/u/Keluaa)\
**Replies:** 3\
**Last updated:** [January 30, 2026, 7:39am UTC](https://discourse.julialang.org/t/gc-problems-with-jl-gc-unsafe-enter-with-multithreaded-embedding/104467 "2026-01-30T07:39:26Z")

</div>

I am currently developping a Kotlin library to embed Julia in the JVM, with the goal to support multithreading with jl\_adopt\_thread(). The main issue is that when using some frameworks, there may not be a way to be in co…

---

## [Embedding Julia in Windows](https://discourse.julialang.org/t/embedding-julia-in-windows/76693)

<div class="topic-metadata">

**Author:** [@DanielP](https://discourse.julialang.org/u/DanielP)\
**Replies:** 1\
**Last updated:** [July 12, 2025, 7:06pm UTC](https://discourse.julialang.org/t/embedding-julia-in-windows/76693 "2025-07-12T19:06:21Z")

</div>

Hi, I have tried to call my tested Julia function from C program on Windows 10. I am using gcc compiler (minGW). When I compile, link and launch my program from the IDE (I am using Code::Blocks IDE) it works fine. The co…

---

## [Getting docs in C embedding](https://discourse.julialang.org/t/getting-docs-in-c-embedding/129137)

<div class="topic-metadata">

**Author:** [@alexkolzov](https://discourse.julialang.org/u/alexkolzov)\
**Replies:** 2\
**Last updated:** [May 26, 2025, 8:08pm UTC](https://discourse.julialang.org/t/getting-docs-in-c-embedding/129137 "2025-05-26T20:08:42Z")

</div>

Hello everyone! I am trying to extract documentation from module items. I am trying to use the doc function to do this: jl\_module\_t \*m = jl\_new\_module(jl\_symbol(name), nullptr); jl\_module\_using(m, jl\_base\_module); jl\_m…

---

## [Composite type fields names from C code](https://discourse.julialang.org/t/composite-type-fields-names-from-c-code/128919)

<div class="topic-metadata">

**Author:** [@alexkolzov](https://discourse.julialang.org/u/alexkolzov)\
**Replies:** 2\
**Last updated:** [May 12, 2025, 11:12am UTC](https://discourse.julialang.org/t/composite-type-fields-names-from-c-code/128919 "2025-05-12T11:12:04Z")

</div>

Hello everyone! I am trying to get the name of composite type fields in version 1.11. A long time ago I did it like this: int nfields = jl\_datatype\_nfields(jtype); fields.resize(nfields); for (int i = 0; i \< nfields; …

---

## [Switch from Delphi/Pascal to Julia](https://discourse.julialang.org/t/switch-from-delphi-pascal-to-julia/66254)

<div class="topic-metadata">

**Author:** [@pjuergens](https://discourse.julialang.org/u/pjuergens)\
**Replies:** 14\
**Last updated:** [April 23, 2025, 10:50pm UTC](https://discourse.julialang.org/t/switch-from-delphi-pascal-to-julia/66254 "2025-04-23T22:50:26Z")

</div>

Dear Julia users, I am using an optimization model which is written in Delphi/Pascal and is called from a Python-Skript. However, Delphi (in my opinion) is not a very user friendly language and I would like to switch to…

---

## [Run c++ app with embedded julia on a machine without julia installation](https://discourse.julialang.org/t/run-c-app-with-embedded-julia-on-a-machine-without-julia-installation/127274)

<div class="topic-metadata">

**Author:** [@mitrandirsergey](https://discourse.julialang.org/u/mitrandirsergey)\
**Replies:** 3\
**Last updated:** [March 23, 2025, 11:40am UTC](https://discourse.julialang.org/t/run-c-app-with-embedded-julia-on-a-machine-without-julia-installation/127274 "2025-03-23T11:40:08Z")

</div>

Hi. Is it possible to provide julia dll along with my exe file, so it could be run on a PC without julia installation? I found out an example to dynamically load julia (which is quite old) But how to provide julia mo…

---

## [Calling C/Fortran program that embeds Julia in Julia](https://discourse.julialang.org/t/calling-c-fortran-program-that-embeds-julia-in-julia/126839)

<div class="topic-metadata">

**Author:** [@AreWeDreaming](https://discourse.julialang.org/u/AreWeDreaming)\
**Replies:** 2\
**Last updated:** [March 12, 2025, 10:52pm UTC](https://discourse.julialang.org/t/calling-c-fortran-program-that-embeds-julia-in-julia/126839 "2025-03-12T22:52:24Z")

</div>

We have a Julia framework that needs to interact with a lot of legacy Fortran/C(++) applications. Instead of manually preparing the proper interface for the applications which involves lots of manual type conversions, we…

---

## [Create named tuple in C to pass to jl\_call](https://discourse.julialang.org/t/create-named-tuple-in-c-to-pass-to-jl-call/63547)

<div class="topic-metadata">

**Author:** [@kkaravokyri](https://discourse.julialang.org/u/kkaravokyri)\
**Replies:** 2\
**Last updated:** [March 4, 2025, 2:29pm UTC](https://discourse.julialang.org/t/create-named-tuple-in-c-to-pass-to-jl-call/63547 "2025-03-04T14:29:56Z")

</div>

I’m embedding Julia in C and I would like to be able to create named tuples with the number of filelds, their names and types being determined at runtime. I am currently able to create a standard tuple like this: jl\_va…

---

## [Redirect stdout, stderr to string/stream C++ (embedded)](https://discourse.julialang.org/t/redirect-stdout-stderr-to-string-stream-c-embedded/124210)

<div class="topic-metadata">

**Author:** [@Nelson-numerical-sof](https://discourse.julialang.org/u/Nelson-numerical-sof)\
**Replies:** 7\
**Last updated:** [December 27, 2024, 11:21pm UTC](https://discourse.julialang.org/t/redirect-stdout-stderr-to-string-stream-c-embedded/124210 "2024-12-27T23:21:09Z")

</div>

Hi, I am currently a newbie on julia I try to redirect all outputs stderr, stdout to C/C++ from julia Currently I do and it seems to work: # Create custom IO buffer const io = IOBuffer() Ba…

---

## [Cfunction error handling](https://discourse.julialang.org/t/cfunction-error-handling/123925)

<div class="topic-metadata">

**Author:** [@Sergey](https://discourse.julialang.org/u/Sergey)\
**Replies:** 0\
**Last updated:** [December 17, 2024, 1:29pm UTC](https://discourse.julialang.org/t/cfunction-error-handling/123925 "2024-12-17T13:29:55Z")

</div>

Hi. Im calling cfunctions from c++ code. Is it possible not to break execution and do error handling if one occure on julia sode? for exmple: function calc(x :: Float32) return 100 \* sqrt(-x) end call this with …

---

## [@cfunction with CxxWrap arguments](https://discourse.julialang.org/t/cfunction-with-cxxwrap-arguments/123473)

<div class="topic-metadata">

**Author:** [@Sergey](https://discourse.julialang.org/u/Sergey)\
**Replies:** 1\
**Last updated:** [December 5, 2024, 9:31am UTC](https://discourse.julialang.org/t/cfunction-with-cxxwrap-arguments/123473 "2024-12-05T09:31:14Z")

</div>

Hi! Is it possible to get pointer by @function if this function argument is CxxWrap binded struct? Class binding types.add\_type\<DataBase\>("Database") .method("GetProperty", &DataBase::getProperty); and julia funct…

---

## [Embedded julia catch exception](https://discourse.julialang.org/t/embedded-julia-catch-exception/123287)

<div class="topic-metadata">

**Author:** [@Sergey](https://discourse.julialang.org/u/Sergey)\
**Replies:** 1\
**Last updated:** [December 3, 2024, 12:10pm UTC](https://discourse.julialang.org/t/embedded-julia-catch-exception/123287 "2024-12-03T12:10:16Z")

</div>

Hi. Im trying to use julia as user function extension. So i embed it into my qt application. But if there is an error in julia code everything will crash. Is it possible to catch julia exceptions from c++ or i could …

---

## [Embedding julia: jl\_atexit\_hook always segfaults](https://discourse.julialang.org/t/embedding-julia-jl-atexit-hook-always-segfaults/108722)

<div class="topic-metadata">

**Author:** [@xapkohheh](https://discourse.julialang.org/u/xapkohheh)\
**Replies:** 10\
**Last updated:** [October 19, 2024, 12:32am UTC](https://discourse.julialang.org/t/embedding-julia-jl-atexit-hook-always-segfaults/108722 "2024-10-19T00:32:12Z")

</div>

Hello there! I’ve been trying to embed julia into a digital content creation software named Houdini (I’ve asked questions about this about two years ago, finally got back at it :slight\_smile: ) So everything seems to w…

---

## [Is it possible to use embedded julia without julia installed](https://discourse.julialang.org/t/is-it-possible-to-use-embedded-julia-without-julia-installed/119145)

<div class="topic-metadata">

**Author:** [@Sergey](https://discourse.julialang.org/u/Sergey)\
**Replies:** 5\
**Last updated:** [September 7, 2024, 4:58pm UTC](https://discourse.julialang.org/t/is-it-possible-to-use-embedded-julia-without-julia-installed/119145 "2024-09-07T16:58:32Z")

</div>

Hi. Hope for community member experience! Im trying to extend my c++ app with power of julia. But i cant figure out some important questions: Should julia be installed on another computer Could i provide some library…

---

## [Julia to C function to Julia function call](https://discourse.julialang.org/t/julia-to-c-function-to-julia-function-call/115997)

<div class="topic-metadata">

**Author:** [@miniskar](https://discourse.julialang.org/u/miniskar)\
**Replies:** 5\
**Last updated:** [July 1, 2024, 11:32am UTC](https://discourse.julialang.org/t/julia-to-c-function-to-julia-function-call/115997 "2024-07-01T11:32:08Z")

</div>

I am trying having a runtime framework implemented in C++ launguage. Julia application calls this framework and this framework will call some other Julia function. I am facing some issue when the framework calls Julia fu…

---

## [Segmentation fault when embedding Julia and using DifferentialEquations.jl](https://discourse.julialang.org/t/segmentation-fault-when-embedding-julia-and-using-differentialequations-jl/113274)

<div class="topic-metadata">

**Author:** [@dmitry-kabanov](https://discourse.julialang.org/u/dmitry-kabanov)\
**Replies:** 1\
**Last updated:** [April 25, 2024, 9:46am UTC](https://discourse.julialang.org/t/segmentation-fault-when-embedding-julia-and-using-differentialequations-jl/113274 "2024-04-25T09:46:33Z")

</div>

Hi, I need to embed Julia in a C library that is dynamically loaded and invoked from Python. I can make basic stuff work with the embedded Julia. However, when I try to import DifferentialEquations.jl, I get a segmentati…

---

## [API reference for Julia Embedding in C](https://discourse.julialang.org/t/api-reference-for-julia-embedding-in-c/3963)

<div class="topic-metadata">

**Author:** [@tastelessjolt](https://discourse.julialang.org/u/tastelessjolt)\
**Replies:** 13\
**Last updated:** [April 16, 2024, 8:05pm UTC](https://discourse.julialang.org/t/api-reference-for-julia-embedding-in-c/3963 "2024-04-16T20:05:21Z")

</div>

Is there any official API reference for Julia Embedding in C, or should we be understanding by going through the code or asking here? And specifically, How to create and access the data in the tuple? How to convert a …

---

## [How to use \`jl\_ptr\_to\_array\`?](https://discourse.julialang.org/t/how-to-use-jl-ptr-to-array/112834)

<div class="topic-metadata">

**Author:** [@dmitry-kabanov](https://discourse.julialang.org/u/dmitry-kabanov)\
**Replies:** 0\
**Last updated:** [April 11, 2024, 3:40pm UTC](https://discourse.julialang.org/t/how-to-use-jl-ptr-to-array/112834 "2024-04-11T15:40:28Z")

</div>

Hi, I have difficulties with the correct usage of the function jl\_ptr\_to\_array. Particularly, there is no explanation in the documentation on embedding, neighter in the source code on how to construct the third argument …

---

## [Help with using @cfunction and arrays](https://discourse.julialang.org/t/help-with-using-cfunction-and-arrays/112717)

<div class="topic-metadata">

**Author:** [@dmitry-kabanov](https://discourse.julialang.org/u/dmitry-kabanov)\
**Replies:** 2\
**Last updated:** [April 11, 2024, 9:33am UTC](https://discourse.julialang.org/t/help-with-using-cfunction-and-arrays/112717 "2024-04-11T09:33:37Z")

</div>

Hi, I try to do Julia C API embedding, and I struggle with using @cfunction to work with arguments of the array type. I get a segmentation fault that is not very clear to me. MWE: Julia code jl\_qeq\_solver.jl: module …

---

## [How to embed Julia in interactive mode](https://discourse.julialang.org/t/how-to-embed-julia-in-interactive-mode/112264)

<div class="topic-metadata">

**Author:** [@droodman](https://discourse.julialang.org/u/droodman)\
**Replies:** 4\
**Last updated:** [March 29, 2024, 1:50pm UTC](https://discourse.julialang.org/t/how-to-embed-julia-in-interactive-mode/112264 "2024-03-29T13:50:42Z")

</div>

Another in my continuing series of questions about how to embed Julia… @mkitti and @GunnarFarneback have been very helpful in the past. I am embedding Julia in another program and am trying to approximately simulate th…

---

## [How to embed multithreaded Julia in a graphical macOS app](https://discourse.julialang.org/t/how-to-embed-multithreaded-julia-in-a-graphical-macos-app/111637)

<div class="topic-metadata">

**Author:** [@droodman](https://discourse.julialang.org/u/droodman)\
**Replies:** 14\
**Last updated:** [March 16, 2024, 1:52pm UTC](https://discourse.julialang.org/t/how-to-embed-multithreaded-julia-in-a-graphical-macos-app/111637 "2024-03-16T13:52:53Z")

</div>

I wrote a C++ plugin for the statistical software Stata to give it access to Julia. Stata is a GUI program, so in macOS, it is normally not launched from a shell. The problem I have is giving the user the option to launc…

---

## [Embedding the REPL](https://discourse.julialang.org/t/embedding-the-repl/110153)

<div class="topic-metadata">

**Author:** [@joelreymont](https://discourse.julialang.org/u/joelreymont)\
**Replies:** 2\
**Last updated:** [February 13, 2024, 2:27pm UTC](https://discourse.julialang.org/t/embedding-the-repl/110153 "2024-02-13T14:27:19Z")

</div>

How can I embed the Julia REPL into a C++ executable such that I can connect to it remotely, e.g. from a notebook? I know about the C++ interop packages but haven’t found anything on the REPL. Thanks, Joel

---

## [Signature for \`jl\_array\_data\` is different in stable and nightly](https://discourse.julialang.org/t/signature-for-jl-array-data-is-different-in-stable-and-nightly/108519)

<div class="topic-metadata">

**Author:** [@dmitry-kabanov](https://discourse.julialang.org/u/dmitry-kabanov)\
**Replies:** 3\
**Last updated:** [January 8, 2024, 6:41pm UTC](https://discourse.julialang.org/t/signature-for-jl-array-data-is-different-in-stable-and-nightly/108519 "2024-01-08T18:41:32Z")

</div>

Hi, I have some C code with Julia embedding. The code is tested with versions 1.8 and nightly. However, it fails on nightly, due to the changes in the signature of jl\_array\_data (macro that obtains a C pointer from a Jul…

---

## [Embedding Julia: GC race conditions](https://discourse.julialang.org/t/embedding-julia-gc-race-conditions/108346)

<div class="topic-metadata">

**Author:** [@sijo](https://discourse.julialang.org/u/sijo)\
**Replies:** 0\
**Last updated:** [January 4, 2024, 2:29pm UTC](https://discourse.julialang.org/t/embedding-julia-gc-race-conditions/108346 "2024-01-04T14:29:27Z")

</div>

I’m trying to understand how GC interaction from C works in case of multiple threads. How are race conditions avoided? The manual says: When writing code that embeds Julia, it is generally safe to use jl\_value\_t\* valu…

---

## [How to dynamically embed Julia in a Windows app](https://discourse.julialang.org/t/how-to-dynamically-embed-julia-in-a-windows-app/107133)

<div class="topic-metadata">

**Author:** [@droodman](https://discourse.julialang.org/u/droodman)\
**Replies:** 15\
**Last updated:** [December 7, 2023, 7:29pm UTC](https://discourse.julialang.org/t/how-to-dynamically-embed-julia-in-a-windows-app/107133 "2023-12-07T19:29:20Z")

</div>

I have written a plugin for the commercial statistical software Stata that bridges to Julia in order to exploit its speed. In an issue thread on juliaup, @davidanthoff and @staticfloat have helped me figure out how best …

---

## [Jl\_call - function call latency](https://discourse.julialang.org/t/jl-call-function-call-latency/106791)

<div class="topic-metadata">

**Author:** [@AntoineK](https://discourse.julialang.org/u/AntoineK)\
**Replies:** 5\
**Last updated:** [November 29, 2023, 3:59pm UTC](https://discourse.julialang.org/t/jl-call-function-call-latency/106791 "2023-11-29T15:59:06Z")

</div>

Hello, My first benchmarks show that calling the jl\_call function comes with a latency of 100 nanoseconds (measured by calling an empty Julia function) on a Xeon Gold processor. Is it expected ? In Julia, BenchmarksTo…

---

## [Effect of \`JULIA\_DEFINE\_FAST\_TLS\` and how to handle in shared library or Fortran](https://discourse.julialang.org/t/effect-of-julia-define-fast-tls-and-how-to-handle-in-shared-library-or-fortran/101114)

<div class="topic-metadata">

**Author:** [@sloede](https://discourse.julialang.org/u/sloede)\
**Replies:** 1\
**Last updated:** [September 2, 2023, 4:59am UTC](https://discourse.julialang.org/t/effect-of-julia-define-fast-tls-and-how-to-handle-in-shared-library-or-fortran/101114 "2023-09-02T04:59:53Z")

</div>

According to Embedding Julia · The Julia Language, one should define JULIA\_DEFINE\_FAST\_TLS in any program that embeds calls to Julia. The only documentation for this I could find is the attached inline comment (line brea…

---

## [Embedding multiple interpreters](https://discourse.julialang.org/t/embedding-multiple-interpreters/102571)

<div class="topic-metadata">

**Author:** [@dlandahl](https://discourse.julialang.org/u/dlandahl)\
**Replies:** 0\
**Last updated:** [August 7, 2023, 4:21pm UTC](https://discourse.julialang.org/t/embedding-multiple-interpreters/102571 "2023-08-07T16:21:27Z")

</div>

I would like to allow users to write Julia-based plugins for my software, which is written in a C-like language. I had a look at the embedding manual which seems really straightforward. However, I don’t know what the rig…

---

## [Embedding Julia: reading std::vector from C++?](https://discourse.julialang.org/t/embedding-julia-reading-std-vector-from-c/100857)

<div class="topic-metadata">

**Author:** [@frylock](https://discourse.julialang.org/u/frylock)\
**Replies:** 1\
**Last updated:** [June 26, 2023, 7:31pm UTC](https://discourse.julialang.org/t/embedding-julia-reading-std-vector-from-c/100857 "2023-06-26T19:31:43Z")

</div>

I’m aware of existing … packages for wrapping C++, this is really more of a learning exercise for me (and I’m trying to learn enough to read what is in the existing pacages). I knew that it was possible to get C++ to giv…

---

## [Where are the C API header files when I install with juliaup?](https://discourse.julialang.org/t/where-are-the-c-api-header-files-when-i-install-with-juliaup/99151)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 2\
**Last updated:** [May 20, 2023, 9:40am UTC](https://discourse.julialang.org/t/where-are-the-c-api-header-files-when-i-install-with-juliaup/99151 "2023-05-20T09:40:12Z")

</div>

I switched from manually downloading Julia to using the juliaup installer. Now I just get a binary executable that launches Julia, but I cannot find the header files for embedding Julia in C/C++. Is this a limitation of …

[Next page](https://discourse.julialang.org/tag/embedding/48.md?match_all_tags=true&page=1&tags%5B%5D=embedding)
