How to go from LLVM Src to minimal development setup for compiler development

I’m trying to bridge the gap between where Getting Started left off and My First Language Frontend starts. I think I’m missing the step where after building I install??? and then setup my dev-env so I can build against what I just installed. Any tips are appreciated.

If your just installing this is mentioned in Getting Started after make, make install should work like
most projects:
make install
Installs LLVM header files, libraries, tools, and documentation in a hierarchy under $PREFIX , specified with CMAKE_INSTALL_PREFIX , which defaults to /usr/local .

You may want to change it depending on your system or use case. Not sure that helps.

1 Like

Thanks! That helps.

I didn’t run make install because I wasn’t exactly sure what that would do and I assumed whatever it did do would take a long time. ninja -n install didn’t show me anything, and ninja -n -v install showed me a lot that didn’t make sense. Not wanting to mess up my system a way I couldn’t easily fix, I went with an install from brew, which worked after I figured out what to do with llvm-config. Brew puts things in its own directory structure and then links to that from /usr/local/opt because macOS already has clang installed and they hope to avoid conflicts.

They mention that issue here on the GitHub page as well:

  • -DCMAKE_INSTALL_PREFIX=directory — Specify for directory the full path name of where you want the LLVM tools and libraries to be installed (default /usr/local ). Be careful if you install runtime libraries: if your system uses those provided by LLVM (like libc++ or libc++abi), you must not overwrite your system’s copy of those libraries, since that could render your system unusable. In general, using something like /usr is not advised, but /usr/local is fine.
1 Like