Skip to content

Create LLVM SDK Build#10

Merged
hughperkins merged 65 commits into
mainfrom
hp/llvm-u18-container
Sep 26, 2025
Merged

Create LLVM SDK Build#10
hughperkins merged 65 commits into
mainfrom
hp/llvm-u18-container

Conversation

@hughperkins
Copy link
Copy Markdown
Collaborator

@hughperkins hughperkins commented Sep 17, 2025

High level goal:

  • create LLVM SDK Build

Based on #5 from @johnnynunez

Global changes:

  • disable assertions
  • remove MLIR
  • disable ZSTD
  • disable ZLIB
  • disable xml2

Linux build changes:

  • switch to use manylinux for building on linux, to be compatible with our wheel building
  • no longer install python
  • dont install gcc

Windows build changes:

  • switch to using MSVC
  • install MSVC
  • switch threading model

@hughperkins hughperkins marked this pull request as ready for review September 21, 2025 19:40
@johnnynunez
Copy link
Copy Markdown
Contributor

nice work!

@hughperkins hughperkins changed the title Build llvm in manylinux container Create LLVM SDK Build Sep 23, 2025
CharlesMasson
CharlesMasson previously approved these changes Sep 24, 2025
Comment thread .github/workflows/llvm-ci.yml Outdated
Comment thread .github/workflows/llvm-ci.yml Outdated
Comment thread .github/workflows/llvm-ci.yml Outdated
Comment thread .github/workflows/llvm-ci.yml Outdated
cp llvm-project/LICENSE.TXT "$pkgroot/LLVM-LICENSE.txt" || true
# optional strip to shrink size
if [ -x "${CMAKE_INSTALL_PREFIX}/bin/llvm-strip" ]; then
find "$pkgroot/bin" -type f -exec "${CMAKE_INSTALL_PREFIX}/bin/llvm-strip" --strip-unneeded {} + || true
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why || true ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soo...

  • on Mac, this doesnt exist /Users/runner/work/_temp/llvm-install/bin/llvm-strip: error: option is not supported for MachO
    • we could presumably add some kind of condiitonal to not run on Mac
  • on arm, this gives /__w/_temp/llvm-install/bin/llvm-strip: error: '/__w/_temp/taichi-llvm-15.0.7-linux-aarch64/bin/scan-build': The file was not recognized as a valid object file

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(It's possible that the strip also fails on ubuntu x86 tbh, since that build didnt finish yet)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnnynunez thoughts on this llvm-strip error on arm?

Comment thread .github/workflows/llvm-ci.yml Outdated
@johnnynunez
Copy link
Copy Markdown
Contributor

@hughperkins can you try:

- name: Package (Linux/macOS)
        if: runner.os != 'Windows'
        env:
          CMAKE_INSTALL_PREFIX: ${{ steps.prefix.outputs.prefix }}
        run: |
          pkgroot="${RUNNER_TEMP}/taichi-llvm-${LLVM_VERSION}-${{ steps.pkgmeta.outputs.suffix }}"
          mkdir -p "$pkgroot"
          # copy install tree
          cp -R "${CMAKE_INSTALL_PREFIX}/." "$pkgroot/"
          # bundle license
          # The llvm-project directory is not available in this step, but the license was installed.
          cp "${CMAKE_INSTALL_PREFIX}/LICENSE.TXT" "$pkgroot/LLVM-LICENSE.txt" || true
          # optional strip to shrink size
          if [ -x "${CMAKE_INSTALL_PREFIX}/bin/llvm-strip" ]; then
            # Strip only ELF binaries and shared objects, not scripts.
            find "$pkgroot/bin" -type f -exec file {} + | grep -E 'ELF.*executable|ELF.*shared object' | cut -d: -f1 | xargs --no-run-if-empty "${CMAKE_INSTALL_PREFIX}/bin/llvm-strip" --strip-unneeded
            find "$pkgroot/lib" -type f \( -name "*.so*" -o -name "*.dylib" -o -name "*.a" \) \
              -exec "${CMAKE_INSTALL_PREFIX}/bin/llvm-strip" --strip-unneeded {} +
          fi
          ( cd "${RUNNER_TEMP}" && zip -r "${GITHUB_WORKSPACE}/${{ steps.pkgmeta.outputs.zip }}" \
              "taichi-llvm-${LLVM_VERSION}-${{ steps.pkgmeta.outputs.suffix }}" )
          # sha256
          ( cd "${GITHUB_WORKSPACE}" && shasum -a 256 "${{ steps.pkgmeta.outputs.zip }}" > "${{ steps.pkgmeta.outputs.zip }}.sha256" || sha256sum "${{ steps.pkgmeta.outputs.zip }}" > "${{ steps.pkgmeta.outputs.zip }}.sha256" )

- name: Compute package name
id: pkgmeta
run: |
os="${RUNNER_OS}"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnnynunez Where is RUNNER_OS defined?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, it's a standard github var:
Screenshot 2025-09-26 at 5 08 25 AM

@johnnynunez
Copy link
Copy Markdown
Contributor

@hughperkins good job!

@hughperkins hughperkins merged commit 24157f6 into main Sep 26, 2025
5 checks passed
@hughperkins hughperkins deleted the hp/llvm-u18-container branch September 26, 2025 11:50
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

Successfully merging this pull request may close these issues.

4 participants