Building Chapel 1.25.0 on Alpine

I'm using Alpine 3.14 (under WSLv2) to try to build Chapel in the preferred configuration. It looks like check_llvm_config (and the entire build process) assumes a setup that Alpine's clang/llvm11 doesn't match.

Specifically, clang and llvm11 are installed in unrelated directories, so the directory llvm-config --includedir reports (/usr/lib/llvm11/include) doesn't contain clang/Basic/Version.h (it doesn't have a clang subdirectory at all). /usr/include/clang/Basic/Version.h exists, and looks like the right thing, so explicitly making /usr/lib/llvm11/include/clang symlink to /usr/include/clang makes the prechecks pass and the build find the necessary #define-d constants.

Once I've done that, I also need to use apk to add clang-static, not just clang-dev. And set CC=clang and CXX=clang++ (if I don't do that, it tries to find clang & clang++ in an llvm rooted directory where they're not installed at a later stage of the build), then edit third-party/qthread/qthread-src/src/hashmap.c and third-party/qthread/qthread-src/src/qloop.c to manually add #include <sys/types.h> (because they both use ssize_t without including any of the headers that provide it).

This was decidedly unintuitive, and I'm trying to figure out if I missed anything that would have simplified it.

Hi Josh —

Thanks for bringing this to our attention. I'm not the best person to answer this question, and those who are (e.g., @mppf) were stuck in meetings for most of the day today. However, as a placeholder response, I'm not aware of anything you missed, and I think you're correct in concluding that we presume a certain amount of parity between how llvm and clang are installed, which it sounds like we can't rely upon on Alpine-based systems.

I know that Michael did a certain amount of portability testing prior to our recent 1.25.0 release, but don't happen know whether Alpine Linux was among the configurations he tested or not (though it sounds like "not" is likely if your configuration reflects the typical organization). We're currently working through various LLVM install / portability issues that have shown up as a result of the 1.25.0 release, and it'd be good to get an issue capturing this into our GitHub issues list, if you're willing to do that. It might make sense to wait for Michael to confirm that I haven't missed anything tomorrow, though.


Hi Josh -

I'd like to reproduce this problem in a VM but I'm not familiar with Alpine linux. Could you share the commands you ran to install the dependencies? Thanks.

Hi Josh —

We're working on a 1.25.1 release of Chapel to address some portability and correctness issues, particularly with the LLVM back-end, making me curious whether you saw Michael's response and whether we could work through this with you to see whether the changes we've made are likely to improve the situation.


1 Like