bloomberg/clang-p2996

Instructions on how to build a docker container?

Closed this issue · 7 comments

It would quite sweet to be able to generate a docker container. This would allow us to experiment.

Hey, @lemire ! I haven't tried to build a docker container for this project, but it should be the same process as for any other clang compiler. In case it's helpful, here's the magic spell that I've used to build for Linux.

cmake -G "Ninja" -S llvm -B build-llvm -DCMAKE_BUILD_TYPE=Release \
    -DLLVM_ENABLE_ASSERTIONS=ON \
    -DLLVM_UNREACHABLE_OPTIMIZE=ON \
    -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
    -DLLVM_ENABLE_PROJECTS=clang

Let me know if you have any luck! And don't forget, you can also play around with the compiler on godbolt.

you can also play around with the compiler on godbolt.

I know, and that's great, but that's somewhat limited. We would like to build whole prototypes.

Ah Ah.

Using precisely your command works...

cmake -G "Ninja" -S llvm -B build-llvm -DCMAKE_BUILD_TYPE=Release \
    -DLLVM_ENABLE_ASSERTIONS=ON \
    -DLLVM_UNREACHABLE_OPTIMIZE=ON \
    -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
    -DLLVM_ENABLE_PROJECTS=clang
cmake --build build-llvm -j

Great.

So we should be able to turn it into docker container then.

Great to hear! I'll go ahead and close this one.

@katzdm Thanks.

In case someone finds this issue... you can find a recipe for a docker container at https://github.com/lemire/docker_programming_station/tree/master/clangp2996

See the README file for further instructions. The gist of it is that you can build a docker container from the current version of this repo and build projects with it.