# Using BinaryBuilder.jl to build librariers for Julia versions \>1.7

**URL:** https://discourse.julialang.org/t/using-binarybuilder-jl-to-build-librariers-for-julia-versions-1-7/131085
**Category:** General Usage
**Tags:** package, binarybuilder
**Created:** [July 27, 2025, 2:43am UTC](https://discourse.julialang.org/t/using-binarybuilder-jl-to-build-librariers-for-julia-versions-1-7/131085 "2025-07-27T02:43:41Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![leespen1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leespen1/32/221928_2.png) [@leespen1](https://discourse.julialang.org/u/leespen1)
#### Post date: [July 27, 2025, 2:43am UTC](https://discourse.julialang.org/t/using-binarybuilder-jl-to-build-librariers-for-julia-versions-1-7/131085/1 "2025-07-27T02:43:41Z")

</div>

I have some small Fortran scripts that I use in a Julia package I am developing. Currently, I have just compiled them myself into a shared library and used ccall. But I want my package to be deployable on other people’s computers, without them having to compile the code themselves.

So I tried to use [BinaryBuilder.jl](https://docs.binarybuilder.org/v0.6/) to deploy binaries for many platforms. When trying to run my `build_tarball.jl` script, I ran into the error

```julia-auto
ERROR: LoadError: InitError: BinaryBuilder supports only Julia v1.7.

```

So I switched to Julia v1.7, hoping to use this version to run BinaryBuilder, but then use the resulting \_jll package with Julia v1.11. Is this not possible? And if not, is there a new preferred way to deploy shared libraries of Fortran code?

After building the shared library and deploying to a \_jll package, when I import the package in Julia v1.7 the library shows up in the package namespace, but not in v1.11. (`libbsplines` is the name of the shared library I am looking for)

v1.7 output:

```julia-auto
ulia> using BSplines_jll;
       names(BSplines_jll, all=true)
26-element Vector{Symbol}:
 Symbol("##meta#62")
 Symbol("# __init__")
 Symbol("#dev_jll")
 Symbol("#eager_mode")
 Symbol("#find_artifact_dir")
 Symbol("#get_libbsplines_path")
 Symbol("#is_available")
 Symbol("#make_wrapper_dict#2")
 Symbol("#parse_wrapper_platform#1")
 :BSplines_jll
 :LIBPATH
 :LIBPATH_list
 :PATH
 :PATH_list
 : __init__
 :artifact_dir
 :best_wrapper
 :dev_jll
 :eager_mode
 :find_artifact_dir
 :get_libbsplines_path
 :host_platform
 :is_available
 :libbsplines
 :libbsplines_handle
 :libbsplines_path

```

v1.11 output

```julia-auto
julia> using BSplines_jll;
       names(BSplines_jll, all=true)
15-element Vector{Symbol}:
 Symbol("##meta#59")
 Symbol("#dev_jll")
 Symbol("#is_available")
 Symbol("#make_wrapper_dict#2")
 Symbol("#parse_wrapper_platform#1")
 :BSplines_jll
 :LIBPATH
 :LIBPATH_list
 :PATH
 :PATH_list
 :artifact_dir
 :best_wrapper
 :dev_jll
 :host_platform
 :is_available

```

I am hoping that there is a way to get BinaryBuilder.jl to make \_jll packages that work with v1.11, but if not, does anyone know an alternative way to accomplish the same endgoal?

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [July 27, 2025, 2:54am UTC](https://discourse.julialang.org/t/using-binarybuilder-jl-to-build-librariers-for-julia-versions-1-7/131085/2 "2025-07-27T02:54:57Z")

</div>

> [@leespen1](#):
>
> Is this not possible?

The version of Julia used for running BinaryBuilder is totally unrelated to the versions of Julia which can use the generated packages. All jlls hosted on Yggdrasil are built with v1.7 and then used with any Julia version (well, in practice v1.6+ as a matter of fact, but not in any way dependent on the Julia version used for BinaryBuilder).

> [@leespen1](#):
>
> After building the shared library and deploying to a \_jll package, when I import the package in Julia v1.7 the library shows up in the package namespace, but not in v1.11. (`libbsplines` is the name of the shared library I am looking for)

I don’t quite know what you’re doing, but if I need to do a completely blind guess you built the package for libgfortran4 but not libgfortran5, or something like that: [Building Packages · BinaryBuilder.jl](https://docs.binarybuilder.org/stable/building/#Expanding-C-string-ABIs-or-libgfortran-versions).

---

<div class="post-metadata">

### Author: ![leespen1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leespen1/32/221928_2.png) [@leespen1](https://discourse.julialang.org/u/leespen1)
#### Post date: [July 27, 2025, 3:23am UTC](https://discourse.julialang.org/t/using-binarybuilder-jl-to-build-librariers-for-julia-versions-1-7/131085/3 "2025-07-27T03:23:09Z")

</div>

Thanks for the input, I’m not really sure what I am doing so any advice is appreciated.

I don’t understand the nuances of libgfortran4 vs 5, but I think that’s covered by me using `expand_gfortran_versions`. I’m not sure if my explicit use of `gfortran` in the build script interferes with this.

Also, I am deploying my own [github repo](https://github.com/leespen1/BSplines_jll.jl), not Yggdrasil. Should that make a difference in the build process? I used my own github repo because I didn’t want to cause any chaos in a publicly hosted environment while I am still learning to use BinaryBuilder.

This is my `build_tarballs.jl` script.

```julia-auto
using BinaryBuilder
using Pkg: PackageSpec

name = "BSplines"
version = v"0.1.9"

sources = [
    DirectorySource("./src"), 
]

script = raw"""
cd ${WORKSPACE}/srcdir
gfortran -O3 -shared -fPIC -fdefault-real-8 bsplvb.f bsplvd.f -o libbsplines.${dlext}
install -D libbsplines.${dlext} ${libdir}/libbsplines.${dlext}
"""                                      

# Only linux for now
platforms = [HostPlatform()]
#platforms = supported_platforms()
platforms = expand_gfortran_versions(platforms)

products = [
    LibraryProduct("libbsplines", :libbsplines),
]

dependencies = [
    Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae")),
]

build_tarballs(
    ARGS,
    name,
    version,
    sources,
    script,
    platforms,
    products,
    dependencies,
    julia_compat="1.11"
)

```

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [July 27, 2025, 4:22am UTC](https://discourse.julialang.org/t/using-binarybuilder-jl-to-build-librariers-for-julia-versions-1-7/131085/4 "2025-07-27T04:22:55Z")

</div>

> [@leespen1](#):
>
> ```julia-auto
> platforms = [HostPlatform()]
> 
> ```

That’s wrong, since HostPlatform literally encodes all properties of the current “platform”, including the current Julia version, but no one uses HostPlatform there. Maybe you want to elaborate what you want to achieve. For which platforms do you want to build your package?

---

<div class="post-metadata">

### Author: ![leespen1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leespen1/32/221928_2.png) [@leespen1](https://discourse.julialang.org/u/leespen1)
#### Post date: [July 27, 2025, 5:14am UTC](https://discourse.julialang.org/t/using-binarybuilder-jl-to-build-librariers-for-julia-versions-1-7/131085/5 "2025-07-27T05:14:12Z")

</div>

That’s almost certainly the issue! I’ll change that and see if that fixes things.

I want to build my package for all platforms, but while I was still figuring out how things work, I only built for the host platform to reduce the build time. I hadn’t considered that the Julia version was part of the platform. I assumed the platform only had to do with the OS and compiler info.

---

<div class="post-metadata">

### Author: ![leespen1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leespen1/32/221928_2.png) [@leespen1](https://discourse.julialang.org/u/leespen1)
#### Post date: [July 27, 2025, 4:15pm UTC](https://discourse.julialang.org/t/using-binarybuilder-jl-to-build-librariers-for-julia-versions-1-7/131085/6 "2025-07-27T16:15:21Z")

</div>

Changing that to a wider range of platforms fixed the issue. Thanks a bunch!
