# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=42

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

**Page:** 43

---

## [Strange behaviour of addprocs on Julia 1.12-rc1](https://discourse.julialang.org/t/strange-behaviour-of-addprocs-on-julia-1-12-rc1/132094)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [September 5, 2025, 6:22am UTC](https://discourse.julialang.org/t/strange-behaviour-of-addprocs-on-julia-1-12-rc1/132094 "2025-09-05T06:22:45Z")

</div>

I used to use this call to add a process: using DistributedNext addprocs(1) I use the new process for plotting based on PyPlot, which normally works fine. I use a separate process for plotting because PyPlot doesn’t li…

---

## [Is this generated function for struct2tuple safe to use?](https://discourse.julialang.org/t/is-this-generated-function-for-struct2tuple-safe-to-use/132086)

<div class="topic-metadata">

**Author:** [@Tortar](https://discourse.julialang.org/u/Tortar)\
**Replies:** 6\
**Last updated:** [September 4, 2025, 10:42pm UTC](https://discourse.julialang.org/t/is-this-generated-function-for-struct2tuple-safe-to-use/132086 "2025-09-04T22:42:56Z")

</div>

I’m not really sure if this function could be used safely when I have a struct with mutable fields in it: @generated function struct2tuple(x::T) where T n = fieldcount(T) exprs = \[:(getfield(x, $(i))) for i in 1…

---

## [Bad interaction between IJulia and PythonCall (CondaPkg)?](https://discourse.julialang.org/t/bad-interaction-between-ijulia-and-pythoncall-condapkg/132109)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 2\
**Last updated:** [September 4, 2025, 9:26pm UTC](https://discourse.julialang.org/t/bad-interaction-between-ijulia-and-pythoncall-condapkg/132109 "2025-09-04T21:26:38Z")

</div>

IJulia in global environment A project environment that depends on PythonCall (and not IJulia) Because the limitation of IJulia, at the beginning of a Jupyter notebook, I have to do: using Pkg Pkg.activate(\<pkg dir\>) …

---

## [Metaprogramming | String to Symbolics Num; eval(Meta.parse(. . .))](https://discourse.julialang.org/t/metaprogramming-string-to-symbolics-num-eval-meta-parse/132078)

<div class="topic-metadata">

**Author:** [@Audrius-St](https://discourse.julialang.org/u/Audrius-St)\
**Replies:** 3\
**Last updated:** [September 4, 2025, 7:32pm UTC](https://discourse.julialang.org/t/metaprogramming-string-to-symbolics-num-eval-meta-parse/132078 "2025-09-04T19:32:36Z")

</div>

Hello, Context. I am using SymPy.solveset(. . .) within a function to solve an equation. I first convert the Symbolics Num equation to a string, pass it to the function, and within the function use SymPy.sympy.parse\_ex…

---

## [Limit number of threads in julia -t auto](https://discourse.julialang.org/t/limit-number-of-threads-in-julia-t-auto/132099)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 6\
**Last updated:** [September 4, 2025, 3:51pm UTC](https://discourse.julialang.org/t/limit-number-of-threads-in-julia-t-auto/132099 "2025-09-04T15:51:23Z")

</div>

Is there a way to start a (non-interactive) Julia process that automatically determines the sensible automatic number for theads but if that is higher than some threshold, limits it to the latter? Eg on a laptop with 8 …

---

## [Test.jl seems to have problems catching ArgParse.jl's exceptions](https://discourse.julialang.org/t/test-jl-seems-to-have-problems-catching-argparse-jls-exceptions/131795)

<div class="topic-metadata">

**Author:** [@pkalaczynski](https://discourse.julialang.org/u/pkalaczynski)\
**Replies:** 6\
**Last updated:** [September 4, 2025, 3:35pm UTC](https://discourse.julialang.org/t/test-jl-seems-to-have-problems-catching-argparse-jls-exceptions/131795 "2025-09-04T15:35:36Z")

</div>

Hi, I’ve been implementing unit tests for my project, and generally I’m very happy with Test.jl, however I stumbled across a weird problem when trying to do tests for argument parsing. I handle it using ArgParse.jl and …

---

## [Julia GPU FSI: Updating p0, v0, a0, t0 Each Step Without Non-isbits (Core.Box) Error](https://discourse.julialang.org/t/julia-gpu-fsi-updating-p0-v0-a0-t0-each-step-without-non-isbits-core-box-error/132090)

<div class="topic-metadata">

**Author:** [@Mr.Fool](https://discourse.julialang.org/u/Mr.Fool)\
**Replies:** 0\
**Last updated:** [September 4, 2025, 7:05am UTC](https://discourse.julialang.org/t/julia-gpu-fsi-updating-p0-v0-a0-t0-each-step-without-non-isbits-core-box-error/132090 "2025-09-04T07:05:42Z")

</div>

using WaterLily using Plots; gr() using StaticArrays using BenchmarkTools using CSV, DataFrames using Printf using CUDA function TwoCylWIV(Ur,mem=Array) Re = 150; U = 1 p = 6; L = 2^p nl = 12L; ml = 8L # signed …

---

## [New LLVM error introduced in Enzyme v0.13.69](https://discourse.julialang.org/t/new-llvm-error-introduced-in-enzyme-v0-13-69/132080)

<div class="topic-metadata">

**Author:** [@dameka](https://discourse.julialang.org/u/dameka)\
**Replies:** 3\
**Last updated:** [September 3, 2025, 9:29pm UTC](https://discourse.julialang.org/t/new-llvm-error-introduced-in-enzyme-v0-13-69/132080 "2025-09-03T21:29:25Z")

</div>

I recently updated my Enzyme package version from 0.13.68 (fully working) and incurred a new kind of bug I haven’t encountered before. I verified this bug exists in all versions of Enzyme since 0.13.69 inclusive. I am no…

---

## [Would it be possible to write LLVM in Julia?](https://discourse.julialang.org/t/would-it-be-possible-to-write-llvm-in-julia/103925)

<div class="topic-metadata">

**Author:** [@R.T.A.M](https://discourse.julialang.org/u/R.T.A.M)\
**Replies:** 6\
**Last updated:** [September 3, 2025, 4:30pm UTC](https://discourse.julialang.org/t/would-it-be-possible-to-write-llvm-in-julia/103925 "2025-09-03T16:30:24Z")

</div>

I was reading the Developer Documentation on Eval of Julia code and the 10,000 foot view of the whole process. I wondered if this is still up to date since there were speed ups in 1.9.3 ? I was also wondering if, Hypoth…

---

## [JULIA\_MAX\_NUM\_PRECOMPILE\_FILES and vscode](https://discourse.julialang.org/t/julia-max-num-precompile-files-and-vscode/132069)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 3\
**Last updated:** [September 3, 2025, 2:24pm UTC](https://discourse.julialang.org/t/julia-max-num-precompile-files-and-vscode/132069 "2025-09-03T14:24:49Z")

</div>

Hi, I would like to increase JULIA\_MAX\_NUM\_PRECOMPILE\_FILES for my workflow. However it is inconvenient to use export JULIA\_MAX\_NUM\_PRECOMPILE\_FILES = 10 when using vscode. What is the preferred workflow in this case? …

---

## [A question on dispatch on type parameter being UnionAll](https://discourse.julialang.org/t/a-question-on-dispatch-on-type-parameter-being-unionall/132070)

<div class="topic-metadata">

**Author:** [@sgaure](https://discourse.julialang.org/u/sgaure)\
**Replies:** 3\
**Last updated:** [September 3, 2025, 1:26pm UTC](https://discourse.julialang.org/t/a-question-on-dispatch-on-type-parameter-being-unionall/132070 "2025-09-03T13:26:52Z")

</div>

I’m a bit curious about the following problem, it’s not a big deal and has an easy solution, but anyway struct A{T,S} t::T s::S end struct B{V\<:A} v::Vector{V} end b1 = B(\[A(1,2), A(3,4.0)\]) # element typ…

---

## [Why does \`Union{Int,...}\` in a \`Vector\` not cause allocations but \`Union{Float64,...}\` does?](https://discourse.julialang.org/t/why-does-union-int-in-a-vector-not-cause-allocations-but-union-float64-does/132067)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 8\
**Last updated:** [September 3, 2025, 11:44am UTC](https://discourse.julialang.org/t/why-does-union-int-in-a-vector-not-cause-allocations-but-union-float64-does/132067 "2025-09-03T11:44:22Z")

</div>

I have a custom missing type which stores a symbol and a reference to an object whose type is not predetermined, so it’s an Any field. I need to store vectors of these, some values will be missing but most won’t be. Here…

---

## [Convert a PythonCall df to Julia df, incomplete conversion](https://discourse.julialang.org/t/convert-a-pythoncall-df-to-julia-df-incomplete-conversion/132054)

<div class="topic-metadata">

**Author:** [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Replies:** 6\
**Last updated:** [September 3, 2025, 6:02am UTC](https://discourse.julialang.org/t/convert-a-pythoncall-df-to-julia-df-incomplete-conversion/132054 "2025-09-03T06:02:34Z")

</div>

Hi, I have a PythonCall result looking like: julia\> forecast Python: ds trend yhat\_lower ... multiplicative\_terms\_lower multiplicative\_terms\_upper yhat 0 2024-04-08 06:19…

---

## [Iterate on calculated iterable](https://discourse.julialang.org/t/iterate-on-calculated-iterable/132026)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 6\
**Last updated:** [September 2, 2025, 10:23pm UTC](https://discourse.julialang.org/t/iterate-on-calculated-iterable/132026 "2025-09-02T22:23:08Z")

</div>

I have a type for which I want to implement a kind of iteration, which I can easily do with functions in Iterators. But I want iteration to happen on something I construct. MWE: struct NamedProduct{T} np::T end fun…

---

## [Calling Threads.@threads in a macro definition](https://discourse.julialang.org/t/calling-threads-threads-in-a-macro-definition/132058)

<div class="topic-metadata">

**Author:** [@bjarthur](https://discourse.julialang.org/u/bjarthur)\
**Replies:** 2\
**Last updated:** [September 2, 2025, 6:06pm UTC](https://discourse.julialang.org/t/calling-threads-threads-in-a-macro-definition/132058 "2025-09-02T18:06:39Z")

</div>

it’s a hygiene problem i think. is there a way to escape i? claude suggests i rewrite it to use @spawn, which i think would work, but i figure there must be a way to use @threads properly, no? julia\> macro foo() …

---

## [Can't build PythonCall](https://discourse.julialang.org/t/cant-build-pythoncall/132013)

<div class="topic-metadata">

**Author:** [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Replies:** 7\
**Last updated:** [September 2, 2025, 2:40pm UTC](https://discourse.julialang.org/t/cant-build-pythoncall/132013 "2025-09-02T14:40:21Z")

</div>

Hi, Julia 1.11.6: julia\> import Pkg julia\> Pkg.build("PythonCall") Precompiling project... ✗ PythonPlot 0 dependencies successfully precompiled in 4 seconds. 482 already precompiled. 1 dependency errored. For …

---

## [Warp, REPL, and diacritics](https://discourse.julialang.org/t/warp-repl-and-diacritics/132040)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 9\
**Last updated:** [September 2, 2025, 9:10am UTC](https://discourse.julialang.org/t/warp-repl-and-diacritics/132040 "2025-09-02T09:10:04Z")

</div>

If I use the Julia REPL from the Warp command line (with JuliaMono font), no diacritics are visible. They are visible on the Warp command line itself and also in the REPL if I start the REPL from the default (Ubuntu 25.…

---

## [Can't run julia from windows terminal (Julia 1.8.2 / Windows 10)](https://discourse.julialang.org/t/cant-run-julia-from-windows-terminal-julia-1-8-2-windows-10/88847)

<div class="topic-metadata">

**Author:** [@scelles](https://discourse.julialang.org/u/scelles)\
**Replies:** 6\
**Last updated:** [September 2, 2025, 8:05am UTC](https://discourse.julialang.org/t/cant-run-julia-from-windows-terminal-julia-1-8-2-windows-10/88847 "2025-09-02T08:05:39Z")

</div>

Hello, Under Windows 10 trying to run julia from terminal (added to PATH), I’m stuck with the following message : Cannot find file at 'c:\\windows\\system32\\config\\systemprofile\\appdata\\local\\programs\\julia-1.8.2\\bin\\jul…

---

## [Stack overflow when calling dynamic library requiring executable tack in the REPL](https://discourse.julialang.org/t/stack-overflow-when-calling-dynamic-library-requiring-executable-tack-in-the-repl/132027)

<div class="topic-metadata">

**Author:** [@HugoMVale](https://discourse.julialang.org/u/HugoMVale)\
**Replies:** 0\
**Last updated:** [September 1, 2025, 6:04pm UTC](https://discourse.julialang.org/t/stack-overflow-when-calling-dynamic-library-requiring-executable-tack-in-the-repl/132027 "2025-09-01T18:04:42Z")

</div>

I am writing bindings to a Fortran library. The bindings work perfectly when launched as “run file in new process”. Conversely, when launched directly from the REPL, a stack overflow error is raised, without further info…

---

## [Another undefined variable puzzle](https://discourse.julialang.org/t/another-undefined-variable-puzzle/132025)

<div class="topic-metadata">

**Author:** [@alan](https://discourse.julialang.org/u/alan)\
**Replies:** 1\
**Last updated:** [September 1, 2025, 4:47pm UTC](https://discourse.julialang.org/t/another-undefined-variable-puzzle/132025 "2025-09-01T16:47:42Z")

</div>

Here is some code that (I think) ought to work, but doesn’t: module foo x = 1 # line 3 while true y = x # line 5 x = 4 # line 6 break end end # module The error message (below) says that x on…

---

## [Wrapping a Flux FCN model with MLJFlux](https://discourse.julialang.org/t/wrapping-a-flux-fcn-model-with-mljflux/132024)

<div class="topic-metadata">

**Author:** [@cirobr](https://discourse.julialang.org/u/cirobr)\
**Replies:** 0\
**Last updated:** [September 1, 2025, 3:51pm UTC](https://discourse.julialang.org/t/wrapping-a-flux-fcn-model-with-mljflux/132024 "2025-09-01T15:51:49Z")

</div>

Cheers, I wonder if it is possible to wrap a fully convolutional network written in Flux (e.g. a U-Net) with MLJFlux, and benefit from the high-level interface from MLJ. FCN outputs are typically multi-dimensional array…

---

## [Create \`IOBuffer\` from \`Ptr{UInt8}\` (in a \`Base.@ccallable\` function)](https://discourse.julialang.org/t/create-iobuffer-from-ptr-uint8-in-a-base-ccallable-function/132014)

<div class="topic-metadata">

**Author:** [@asprionj](https://discourse.julialang.org/u/asprionj)\
**Replies:** 2\
**Last updated:** [September 1, 2025, 3:31pm UTC](https://discourse.julialang.org/t/create-iobuffer-from-ptr-uint8-in-a-base-ccallable-function/132014 "2025-09-01T15:31:45Z")

</div>

I have to generate a shared library that uses protocol buffers for receiving and sending data. So, basically a function such as @Base.ccallable function protobuf\_IO(pb\_in::Ptr{UInt8})::Ptr{UInt8} ... end that then …

---

## [Multi-threaded processing of a Dict](https://discourse.julialang.org/t/multi-threaded-processing-of-a-dict/131996)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 8\
**Last updated:** [September 1, 2025, 2:09pm UTC](https://discourse.julialang.org/t/multi-threaded-processing-of-a-dict/131996 "2025-09-01T14:09:08Z")

</div>

I have a function that iterates over all key-value pairs, does a computation based on the key and the value and then updates the value at that key. Due to the fact that in each iteration I only update the value and don’t…

---

## [Agents.jl: OpenStreetMaps example of zombie outbreak not running](https://discourse.julialang.org/t/agents-jl-openstreetmaps-example-of-zombie-outbreak-not-running/131909)

<div class="topic-metadata">

**Author:** [@xlejx-rodsxn](https://discourse.julialang.org/u/xlejx-rodsxn)\
**Replies:** 7\
**Last updated:** [September 1, 2025, 1:59pm UTC](https://discourse.julialang.org/t/agents-jl-openstreetmaps-example-of-zombie-outbreak-not-running/131909 "2025-09-01T13:59:01Z")

</div>

Hi, currently learning Julia and the Agents.jl library. So far, I’ve managed to reproduce other examples in the package tutorials, so I guess it has nothing to do with versions(?). The code is taken from Zombie Outbreak…

---

## [Question about GC.@preserve](https://discourse.julialang.org/t/question-about-gc-preserve/131999)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 1\
**Last updated:** [September 1, 2025, 9:31am UTC](https://discourse.julialang.org/t/question-about-gc-preserve/131999 "2025-09-01T09:31:30Z")

</div>

Consider the following two patterns: v = Vector(...) GC.@preserve v begin # unsafe stuff using pointer(v) end and v = Vector(...) # unsafe stuff using pointer(v) GC.@preserve v Are there situations where the sec…

---

## [MPI library mismatch erro HDF5, Netcdf with Oceananigans](https://discourse.julialang.org/t/mpi-library-mismatch-erro-hdf5-netcdf-with-oceananigans/131579)

<div class="topic-metadata">

**Author:** [@farolap](https://discourse.julialang.org/u/farolap)\
**Replies:** 2\
**Last updated:** [September 1, 2025, 6:17am UTC](https://discourse.julialang.org/t/mpi-library-mismatch-erro-hdf5-netcdf-with-oceananigans/131579 "2025-09-01T06:17:17Z")

</div>

Dear all, Im having strong issues with a specific package in Julia while trying to run it in MPI. Initially I define the following libraries: export LD\_LIBRARY\_PATH=/sw/spack-levante/netcdf-c-4.8.1-7dq6g2/lib/:$LD\_LIBR…

---

## [MethodError even when method is in methods(func, types...)](https://discourse.julialang.org/t/methoderror-even-when-method-is-in-methods-func-types/131973)

<div class="topic-metadata">

**Author:** [@ejmeitz](https://discourse.julialang.org/u/ejmeitz)\
**Replies:** 2\
**Last updated:** [August 31, 2025, 11:18pm UTC](https://discourse.julialang.org/t/methoderror-even-when-method-is-in-methods-func-types/131973 "2025-08-31T23:18:18Z")

</div>

I have a custom array type, NDArray in my own package which is templated on it element type and dimension like a normal Julia Array. The following code works totally fine if I define everything stand alone in the REPL, b…

---

## [SIMD.jl - vload() continuous blocks from higher-dimensional arrays?](https://discourse.julialang.org/t/simd-jl-vload-continuous-blocks-from-higher-dimensional-arrays/131981)

<div class="topic-metadata">

**Author:** [@jl\_enthusiast](https://discourse.julialang.org/u/jl_enthusiast)\
**Replies:** 4\
**Last updated:** [August 31, 2025, 9:45pm UTC](https://discourse.julialang.org/t/simd-jl-vload-continuous-blocks-from-higher-dimensional-arrays/131981 "2025-08-31T21:45:29Z")

</div>

Hi, I am currently doing some practice projects in Julia, which involves using SIMD.jl for writing/generating microkernels. My issue is trying to determine what is the “best” way of loading Vec types from a higher-dimen…

---

## [QRCoders.jl: dependency pinning blocking installs. is it abandoned?](https://discourse.julialang.org/t/qrcoders-jl-dependency-pinning-blocking-installs-is-it-abandoned/131482)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 10\
**Last updated:** [August 31, 2025, 9:08pm UTC](https://discourse.julialang.org/t/qrcoders-jl-dependency-pinning-blocking-installs-is-it-abandoned/131482 "2025-08-31T21:08:27Z")

</div>

Hi all, Trying to use QRCoders.jl on /1.11, I’ve run into resolver dead-ends caused by its frozen dependency set: Pinned Manifest.toml forces 2023-era packages (Images 0.26, FixedPointNumbers 0.8, etc.). I can open a …

---

## [Using SpecialFunctions spherical bessel functions with Reactant](https://discourse.julialang.org/t/using-specialfunctions-spherical-bessel-functions-with-reactant/131993)

<div class="topic-metadata">

**Author:** [@dameka](https://discourse.julialang.org/u/dameka)\
**Replies:** 3\
**Last updated:** [August 31, 2025, 6:06pm UTC](https://discourse.julialang.org/t/using-specialfunctions-spherical-bessel-functions-with-reactant/131993 "2025-08-31T18:06:56Z")

</div>

I’m trying to apply Reactant to my code which uses spherical Bessel functions from the SpecialFunctions package. I’m running into this error; has anyone been able to use spherical Bessel functions with Reactant? @avikpal …

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=41)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=43)
