llvm / llvm/circt

Build instructions don't work out of the box for Mac OS X

Open
#9,938 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

I tried to follow the build instructions to install CIRCT in my Mac (OS X Sequoia 15.6.1) but they don't quite work out of the box.

One issue is the linker, I add to specify `-DLLVM_ENABLE_LLD=OFF`.

Another issue seems to be confusion about `llvm::Type` vs. `mlir::Type` e.g. in `PruneZeroValuedLogic.cpp`
Perhaps in such files one should write:

```cpp
types, [](mlir::Type type) { return ExportVerilog::isZeroBitType(type); });
```

instead of:

```cpp
types, [](Type type) { return ExportVerilog::isZeroBitType(type); });
```

to qualify the `Type`?

Or do something like this:

```cpp
using mlir::Type;
using mlir::Value;
```

I got around this problem by first building LLVM that comes in the submodule.
Then I built with:

```
cmake -G Ninja . -B build \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DMLIR_DIR=$PWD/llvm/build/lib/cmake/mlir \
-DLLVM_DIR=$PWD/llvm/build/lib/cmake/llvm \
-DLLVM_TARGETS_TO_BUILD=host \
-DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_EXTERNAL_PROJECTS=circt \
-DLLVM_EXTERNAL_CIRCT_SOURCE_DIR=$PWD \
-DLLVM_ENABLE_LLD=OFF \
-DCIRCT_SLANG_FRONTEND_ENABLED=ON
```

I had to specify ` -DLLVM_ENABLE_LLD=OFF`.

Perhaps worth updating the documentation, or build, to give a smoother install experience for Mac OS X?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Mac OS X Sequoia 15.6.1 build using the documented CMake/Ninja command, including the reported LLVM_ENABLE_LLD setting and the Type qualification issue in PruneZeroValuedLogic.cpp. Compare the documented steps with the working command in the issue; done means the build works out of the box or the instructions clearly document the required changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.