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

fatal error: 'mlir/Dialect/Arithmetic/IR/Arithmetic.h' file not found #11

Open
tshadley opened this issue Oct 24, 2022 · 3 comments
Open

Comments

@tshadley
Copy link

tshadley commented Oct 24, 2022

The following is using https://github.com/nektos/act to run the .github workflow. Is circt supposed to be using the Arith->Arithmetic change yet? It doesn't seem so if currently linked to llvm @ 8c8775e

[Build CIRCT-HLS/Build Release ubuntu-latest Object] | /usr/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I../circt/llvm/llvm/include -I../circt/llvm/build/include -I../circt/llvm/mlir/include -I../circt/llvm/build/tools/mlir/include -I../circt/include -I../circt/build/include -I../include -Iinclude -fno-exceptions -fno-rtti -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-exceptions -fno-rtti -UNDEBUG -std=gnu++17 -MD -MT lib/Transforms/CMakeFiles/obj.HLSTransforms.dir/PushConstants.cpp.o -MF lib/Transforms/CMakeFiles/obj.HLSTransforms.dir/PushConstants.cpp.o.d -o lib/Transforms/CMakeFiles/obj.HLSTransforms.dir/PushConstants.cpp.o -c ../lib/Transforms/PushConstants.cpp

Build CIRCT-HLS/Build Release ubuntu-latest Object] | ../lib/Transforms/PushConstants.cpp:14:10: fatal error: 'mlir/Dialect/Arithmetic/IR/Arithmetic.h' file not found
[Build CIRCT-HLS/Build Release ubuntu-latest Object] | #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
[Build CIRCT-HLS/Build Release ubuntu-latest Object] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Build CIRCT-HLS/Build Release ubuntu-latest Object] | 1 error generated.

[Build CIRCT-HLS/Build Release ubuntu-latest Object] | [13/36] Building CXX object lib/Transforms/CMakeFiles/obj.HLSTransforms.dir/AsyncifyCalls.cpp.o

[Build CIRCT-HLS/Build Release ubuntu-latest Object] | FAILED: lib/Transforms/CMakeFiles/obj.HLSTransforms.dir/AsyncifyCalls.cpp.o

@mortbopet
Copy link
Member

It's been a while since i've updated circt-hls to the head of CIRCT. Previously, we haven't added CIRCT as a submodule (developers of circt-hls typically have a standalone CIRCT project which they're working on, and don't want duplicates). However, this method obviously only works if the dependency will be actively maintained and updated to track HEAD of CIRCT... which we (I) have not.

I don't have a known-good CIRCT commit SHA lying around, but you should be able to get stuff to build if you check out a CIRCT commit from around May 25th.

Alternatively, I'd be open to a PR adding CIRCT as a submodule (with whatever changes required for the merge to go through successfully). I think enough people have encountered issues with this repo regarding things being out of sync to warrant pinning CIRCT here as a submodule (then, it's up to the developer whether they'd want to build against this known good submodule or use their own local CIRCT build).

@tshadley
Copy link
Author

@mortbopet, thanks so much for the reply and details.
I was able to get a successful compile with 76e38b19f6738dfb4d3c8dd26db017ffbf432e06 for circt.

All tests pass except for 1:

timed Out:  1
    Which test failed
[Test CIRCT-HLS/Test Release ubuntu-latest Object  ]   |   CIRCT-HLS cosim :: suites/Dynamatic/insertion_sort/tst_insertion_sort.c

Added ref to .github/workflows/actions/build_circt_hls/action.yml:

    - name: Checkout CIRCT
      uses: actions/checkout@v2
      with:
        repository: llvm/circt
+      ref: '76e38b19f6738dfb4d3c8dd26db017ffbf432e06'

For anyone using https://github.com/nektos/act on the github workflow directly I needed the following extra steps:

Added nodejs install (probably a github workflow action possible here) to .github/workflows/actions/build_circt_hls/action.yml:


 runs:
     using: 'composite'
     steps:
+    - name: Node
+      #uses: actions/setup-node@v2
+      #run: npm ci
+      shell: bash
+      run: |
+        apt-get -y install nodejs
+

Also to same file, needed an apt-get update --fix-missing at Verilator:

    - name: Verilator build
      env:
          CC: ${{ inputs.cc }}
          CXX: ${{ inputs.cxx }}
      shell: bash
      run: |
+        apt-get update --fix-missing        
         apt-get install -y git perl python3 make autoconf g++ flex bison

Finally, needed a personal access token passed to act via -s (see https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token and actions/checkout#298 (comment))

act -s GITHUB_TOKEN=<token string> ..

@tshadley
Copy link
Author

Sorry, I think my failure testing report was incomplete, there are 3 more errors likely due to a version mismatch somewhere.

Failed Tests (3):
  CIRCT-HLS :: Dialect/Cosim/test-call.mlir
  CIRCT-HLS :: Transforms/asyncify.mlir
  CIRCT-HLS :: Transforms/asyncify_errors.mlir

Testing Time: 0.15s
  Passed           : 3
  Expectedly Failed: 1
  Failed           : 3

Failed Tests (1):
  CIRCT-HLS integration :: mlir-resolve/file1.mlir

Testing Time: 0.11s
  Passed: 1
  Failed: 1

Timed Out Tests (1):
  CIRCT-HLS cosim :: suites/Dynamatic/insertion_sort/tst_insertion_sort.c
Testing Time: 1485.74s
  Passed   : 39
  Timed Out:  1

Will investigate these further.

CIRCT-HLS :: Dialect/Cosim/test-call.mlir
CIRCT-HLS :: Transforms/asyncify.mlir
CIRCT-HLS integration :: mlir-resolve/file1.mlir
CIRCT-HLS cosim :: suites/Dynamatic/insertion_sort/tst_insertion_sort.c

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

2 participants