Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# LURE build artifacts
*.deb
*.rpm
*.pkg.tar.zst
*.pkg.tar.xz

# Build directories
build/
dist/

# Editor files
*~
*.swp
*.swo
.*.swp

# OS files
.DS_Store
Thumbs.db
48 changes: 48 additions & 0 deletions beignet-git/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# beignet-git

Intel OpenCL implementation for IvyBridge & Haswell iGPUs.

## Description

Beignet is an open source OpenCL implementation for Intel Gen7/Gen7.5 GPUs (IvyBridge, Haswell). This package builds from git master with LLVM 7.0.

**Supported Hardware:**
- Intel HD Graphics 4000/4200/4400/4600 (Haswell)
- Intel HD Graphics 2500/4000 (IvyBridge)

## Installation

```bash
# Install all dependencies (builds llvm70 and clang70 first)
lure install beignet-git
```

## Verification

```bash
clinfo | grep -i "Intel Gen"
```

Expected output:
```
Platform Name Intel Gen OCL Driver
Device Name Intel(R) HD Graphics Haswell ...
```

## Dependencies

- **clang70** - Clang 7.0.1 (automatically pulls in llvm70)
- ocl-icd-libopencl1, libgl1, libdrm2

## Why LLVM 7.0?

Beignet was abandoned by Intel and only supports LLVM 3.9-7.0. Modern LLVM versions have incompatible API changes. This package uses a self-contained LLVM 7.0 installation in `/opt/llvm70/`.

## Alternatives

- **rusticl** (Mesa 24.0+) - Modern OpenCL for Intel GPUs, actively maintained
- **intel-compute-runtime** - For newer Intel GPUs (Broadwell+)

## License

LGPL-2.1-or-later
76 changes: 76 additions & 0 deletions beignet-git/lure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name="beignet-git"
version="0.0.0"
release="1"
desc="Open source OpenCL implementation for Intel IvyBridge & Haswell iGPUs"
homepage="https://01.org/beignet"
maintainer="Your Name <email@example.com>"
architectures=("amd64")
license=("LGPL-2.1-or-later")
provides=("beignet" "opencl-driver")
conflicts=("beignet")

# Runtime Dependencies
deps=("ocl-icd-libopencl1" "libgl1" "libdrm2" "clang70")

# Build Dependencies
# Note: We use clang70 which depends on llvm70, providing LLVM 7.0 in /opt/llvm70
build_deps=("git" "cmake" "ninja-build" "pkg-config" "python3" "clang70" "ocl-icd-opencl-dev" "opencl-headers" "mesa-common-dev" "libgl1-mesa-dev" "libdrm-dev" "libx11-dev" "libxext-dev" "libxfixes-dev")

# LURE does NOT support PKGBUILD's "filename::url" rename syntax.
# The filename is derived from the URL path.
sources=(
"git+https://github.com/intel/beignet.git"
"https://raw.githubusercontent.com/michaellass/AUR/master/beignet-git/GBE-let-GenRegister-reg-never-return-uninitialized-m.patch"
"https://raw.githubusercontent.com/michaellass/AUR/master/beignet-git/utests_add_limits.patch"
)
checksums=("SKIP" "SKIP" "SKIP")

version() {
cd "$srcdir/beignet"
git describe --long --tags | sed 's/^Release_v//;s/-/.r/;s/-/./'
}

prepare() {
cd "$srcdir/beignet"

# PKGBUILD Revert: "Static linking leads to build failure due to the gbe compiler still using shared libs"
git revert -n 1bd0d252d733

# Apply patches - use FULL filenames as downloaded by LURE
patch -p1 < "$srcdir/GBE-let-GenRegister-reg-never-return-uninitialized-m.patch"
patch -p1 < "$srcdir/utests_add_limits.patch"

# Note: We do NOT need llvm10.patch when using LLVM 7.0
}

build() {
cd "$srcdir/beignet"
mkdir -p build
cd build

# Use LLVM 7.0 from /opt/llvm70
export PATH=/opt/llvm70/bin:$PATH

cmake .. -G Ninja \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=/usr/lib/x86_64-linux-gnu \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE \
-DLLVM_INSTALL_DIR=/opt/llvm70/bin

ninja
}

package() {
cd "$srcdir/beignet/build"

# Install
DESTDIR="$pkgdir" ninja install

# Cleanup headers provided by opencl-headers package (as per PKGBUILD)
if [ -d "${pkgdir}/usr/include/CL" ]; then
cd "${pkgdir}/usr/include/CL"
rm -f cl.h cl_d3d10.h cl_d3d11.h cl_dx9_media_sharing.h cl_egl.h cl_ext.h \
cl_gl.h cl_gl_ext.h cl_platform.h opencl.h
fi
}
37 changes: 37 additions & 0 deletions clang70/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# clang70

Clang 7.0.1 C/C++/Objective-C compiler for LURE, installed under `/opt/llvm70`.

## Description

This package provides Clang 7.0.1, the C language family frontend for LLVM 7.0. Required by [beignet](https://github.com/intel/beignet) to compile OpenCL kernels for Intel IvyBridge/Haswell GPUs.

## Installation

```bash
lure install clang70
```

Automatically installs `llvm70` as a dependency.

## Build Dependencies

- cmake, ninja-build, libffi-dev, libedit-dev, libncurses-dev, libxml2-dev
- llvm70 (runtime dependency, must be installed first)

## Files

Installs to `/opt/llvm70/` alongside LLVM 7.0.

## Related Packages

- **llvm70** - LLVM 7.0.1 backend (dependency)
- **beignet-git** - Intel OpenCL driver (requires this package)

## Build Time

Expect 15-30 minutes depending on CPU.

## License

NCSA
57 changes: 57 additions & 0 deletions clang70/lure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name="clang70"
version="7.0.1"
release="1"
desc="C language family frontend for LLVM, version 7.0 (installed under /opt/llvm70)"
homepage="https://llvm.org/"
maintainer="Your Name <email@example.com>"
architectures=("amd64")
license=("NCSA")

# Runtime dependencies - clang70 needs llvm70
deps=("llvm70" "python3")

# Build dependencies - Debian/Ubuntu package names
build_deps=("cmake" "ninja-build" "libffi-dev" "libedit-dev" "libncurses-dev" "libxml2-dev")

sources=(
"https://releases.llvm.org/${version}/llvm-${version}.src.tar.xz"
"https://releases.llvm.org/${version}/cfe-${version}.src.tar.xz"
)

checksums=(
"a38dfc4db47102ec79dcc2aa61e93722c5f6f06f0a961073bd84b78fb949419b"
"a45b62dde5d7d5fdcdfa876b0af92f164d434b06e9e89b5d0b1cbc65dfe3f418"
)

build() {
cd "$srcdir/cfe-${version}.src"
mkdir -p build
cd build

# Add llvm70 to PATH so cmake can find llvm-config
export PATH=/opt/llvm70/bin:$PATH

cmake .. -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/llvm70 \
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
-DBUILD_SHARED_LIBS=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_BUILD_TESTS=OFF \
-DLLVM_INCLUDE_DOCS=OFF \
-DLLVM_BUILD_DOCS=OFF \
-DLLVM_ENABLE_SPHINX=OFF \
-DSPHINX_WARNINGS_AS_ERRORS=OFF \
-DLLVM_MAIN_SRC_DIR="$srcdir/llvm-${version}.src"

ninja
}

package() {
cd "$srcdir/cfe-${version}.src/build"
DESTDIR="$pkgdir" ninja install

# Install license
install -Dm644 ../LICENSE.TXT "$pkgdir/usr/share/licenses/$name/LICENSE"
}
41 changes: 41 additions & 0 deletions clinfo-git/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# clinfo-git

LURE package for clinfo - OpenCL platform and device information tool.

## Description

clinfo prints all known information about all available OpenCL platforms and devices in the system.

## Dependencies

- Build: `git`, `build-essential`, `opencl-headers`, `ocl-icd-opencl-dev`
- Runtime: `ocl-icd-libopencl1`

## Installation

```bash
lure build
sudo apt install ./clinfo-git_*.deb
```

## Usage

```bash
clinfo # List all OpenCL platforms and devices
clinfo -l # Short listing
clinfo --json # JSON output
```

## Lessons Learned

1. **Version function**: The AUR PKGBUILD uses `git describe --long --tags` which may fail if no tags exist. Added fallback to commit-based versioning.

2. **Bash local variables**: LURE's shell may not support `local` keyword in all contexts. The warning `local: can only be used in a function` appears but doesn't affect the build.

## Notes

This is a generic OpenCL tool that works with any OpenCL implementation (VC4CL, POCL, Mesa Clover, etc.).

## Upstream

- https://github.com/Oblomov/clinfo
45 changes: 45 additions & 0 deletions clinfo-git/lure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name="clinfo-git"
version="0.0.0"
release="1"
desc="Print all known information about all available OpenCL platforms and devices in the system"
homepage="https://github.com/Oblomov/clinfo"
maintainer="Foad Sojoodi Farimani <f.s.farimani@gmail.com>"
architectures=("arm64" "arm" "amd64")
license=("custom:Public Domain")
provides=("clinfo")

# Runtime dependencies
deps=("ocl-icd-libopencl1")

# Build dependencies
build_deps=(
"git"
"build-essential"
"opencl-headers"
"ocl-icd-opencl-dev"
)

sources=("git+https://github.com/Oblomov/clinfo.git")
checksums=("SKIP")

version() {
cd "$srcdir/clinfo"
# Get version from git tags, make it Debian-compliant
local ver=$(git describe --long --tags 2>/dev/null | sed 's/-/.r/;s/-/./')
if [ -n "$ver" ]; then
echo "$ver"
else
printf "0.0.0.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
fi
}

build() {
cd "$srcdir/clinfo"
make
}

package() {
cd "$srcdir/clinfo"
make PREFIX="$pkgdir/usr" MANDIR="$pkgdir/usr/share/man" install
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$name/LICENSE"
}
34 changes: 34 additions & 0 deletions llvm70/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# llvm70

LLVM 7.0.1 compiler toolchain for LURE, installed under `/opt/llvm70`.

## Description

This package provides LLVM 7.0.1, an older but stable version required by [beignet](https://github.com/intel/beignet) for Intel IvyBridge/Haswell OpenCL support. Modern LLVM versions (11+) are incompatible with beignet due to API changes.

## Installation

```bash
lure install llvm70
```

## Build Dependencies

- cmake, ninja-build, libffi-dev, libedit-dev, libncurses-dev, libxml2-dev, binutils-dev

## Files

Installs to `/opt/llvm70/` to avoid conflicts with system LLVM.

## Related Packages

- **clang70** - Clang 7.0.1 frontend (requires this package)
- **beignet-git** - Intel OpenCL driver (requires clang70)

## Build Time

Expect 30-60+ minutes depending on CPU.

## License

NCSA
Loading
Loading