Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang on FreeBSD fails to compile quantizer.cpp #1823

Open
stemann opened this issue Feb 2, 2025 · 5 comments
Open

Clang on FreeBSD fails to compile quantizer.cpp #1823

stemann opened this issue Feb 2, 2025 · 5 comments

Comments

@stemann
Copy link
Contributor

stemann commented Feb 2, 2025

Clang on the latest FreeBSD, 13.4, and 14.2, is unhappy with the sims::Simd calls in quantizer.cpp L167-L168: error: implicit instantiation of undefined template 'mlx::core::simd::Simd<unsigned int, 4>, cf.
https://buildkite.com/julialang/yggdrasil/builds/17042#0194c6a1-5b8d-4a7c-8cef-8e098d29b750/6-32274

@awni
Copy link
Member

awni commented Feb 2, 2025

The basic problem is

if constepxr (false) {
 // code <- this shouldn't be compiled but is
} else {
// other code
} 

Probably we can resolve this using a template instead of a constexpr

@stemann
Copy link
Contributor Author

stemann commented Feb 2, 2025

Ah OK.

That’s a bit annoying though - that a single compiler/platform combo is restricting the programming style.

It’s also possible to just not build for FreeBSD - though that would also be a pity.

@awni
Copy link
Member

awni commented Feb 2, 2025

I don't have an easy way to test on a FreeBSD... there is no github runner for it as far as I can tell and it's not in CircleCI. How do you do CI on that platform?

@stemann
Copy link
Contributor Author

stemann commented Feb 2, 2025

I can currently only compile. I use BinaryBuilder, to cross-compile for FreeBSD etc. in a Linux-based build environment - by executing the build recipe in build_tarballs.jl from https://github.com/JuliaPackaging/Yggdrasil/tree/master/M/MLX

You only need a Linux system, or a Mac with Docker, and an ancient Julia version (version 1.7), which you can get most easily via https://github.com/JuliaLang/juliaup

juliaup add 1.7

julia +1.7 --eval '
  using Pkg
  Pkg.add("BinaryBuilder")
'

BINARYBUILDER_USE_CCACHE=true julia +1.7 build_tarballs.jl --debug=error --verbose aarch64-unknown-freebsd

This will start a build for FreeBSD and will drop you into a shell in the cross compile env. in case of failure.

... but in order to have the latest FreeBSD version (14.2), you will want to use the build_tarballs.jl recipe from JuliaPackaging/Yggdrasil#10374

@ararslan
Copy link

ararslan commented Feb 4, 2025

there is no github runner for it as far as I can tell and it's not in CircleCI. How do you do CI on that platform?

With GitHub Actions you can use vmactions/freebsd-vm. It generally works well (and is used by JuliaUp, the tool mentioned above) though the jobs take longer to execute due to the VM setup and teardown and copying files back and forth. If you're open to using a different CI provider, Cirrus CI supports FreeBSD natively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants