The Linux Foundation Projects
Skip to main content
Blog | Mentorship | Open z/OS Enablement Work Group | zopen community

Mentorship Series: Porting BLIS to z/OS – Enabling High-Performance BLAS on the Mainframe by Jerry Sun

By | August 7, 2025

Open Mainframe Project Summer Mentorship Series: Midterm Updates – At this midpoint, our selected mentees are reporting in. Below, you’ll learn what they’ve built, the challenges they’ve overcome, and their goals for the rest of the summer. We’re proud of every contribution and eager to see what comes next. Hear from Jerry Sun, University of British Columbia, Vancouver below. 

Hello Everyone! I am happy to share my progress so far as an Open Mainframe Project mentee. The zopen community is a collaborative initiative whose goal is to make z/OS a first-class home for open-source software. By porting widely used tools and libraries, we bridge the gap between traditional mainframe environments and other computing platforms. As part of my LFX mentorship with zopen, I undertook the port of BLIS to z/OS. BLIS provides high-performance implementations of basic linear algebra subprograms, and bringing it to z/OS enables scientific and AI workloads to tap into hardware-accelerated math routines on the mainframe.

A Bit About Me

I’m Jerry Sun, a fourth-year Computer Engineering student at the University of British Columbia. Last summer, I had the privilege to intern at IBM, where I gained hands-on development experience on z/OS and confronted the limitations of traditional tooling and workflows. The zopen tools were a game-changer for the platform. It streamlined our processes and dramatically improved our productivity. The chance to contribute back to an open source project that interests me and also helps all the other developers would be both meaningful and motivating.

Getting Started

Initially, I was intrigued by the idea of porting LuaJIT to z/OS, given my prior experience in compiler development. However, after evaluating the project’s scope and complexity, I realized it was too ambitious to complete within the mentorship timeframe. With guidance from my mentors, I explored other available projects and was immediately drawn to BLIS—a high-performance math library. Porting BLIS to z/OS offered a clear and impactful goal: to enhance the performance of AI inference engines like llama.cpp on z/OS, thereby enabling efficient on-premises AI inferencing.

Diving into the project

My mentor first granted me access to a z/OS machine and he guided me through setting up a zopen build sandbox, understanding the available tools and infrastructure in zopen community meta repo and the porting strategy. I first learned about how to use the commands that are available from the meta repo, this includes using “zopen build” with proper flags for bootstrap, configure, build, check, and install BLIS.

Overcoming Build Issues

z/OS’s toolchain diverges from typical Linux environments in several key ways, which required a series of targeted workarounds to build BLIS reliably under zopen. In this blog, I’ll share a few key adjustments I made:

Shell script compatibility

I updated all of BLIS’s shell scripts to use the Bash interpreter provided by zopen, instead of the default /bin/sh. This change was essential for proper handling of z/OS’s EBCDIC text encoding during script parsing and execution.

ranlib workaround

BLIS’s build system expects a ranlib utility to index static libraries. However, z/OS’s linker does not use these indices. To avoid build errors, I replaced the ranlib step with a stub that simply echoes, effectively turning it into a no-op.

Configure script overrides

The BLIS configure script did not respect CFLAGS or LDFLAGS from the environment as expected. To resolve this, I used the ZOPEN_CONFIGURE_OPTS environment variable in the zopen build environment to explicitly inject the compiler flags and installation prefix into the configure step.

Missing runtime features

Certain structs used in BLIS—such as __thread (for thread-local storage), pthread, and barrier types—are not available in the z/OS C runtime libraries. To work around this, I manually modified the relevant BLIS headers to avoid referencing unsupported features.

Future Plan

After the completion of the BLIS port, I will look into further optimizing and extending its capabilities on z/OS. The next step is to integrate IBM’s MASS libraries more deeply—leveraging hardware-accelerated math routines for math functions. I also plan to upgrade the port from BLIS version 1.2 to the upcoming 2.0 release, ensuring that any new features and performance improvements in the upstream project are fully supported on z/OS.

Conclusion

I’d like to thank my mentors, Igor, Mike and Sachin, for guiding me through every obstacle and sharing their expertise in porting open source software to z/OS. It’s remarkable how quickly these few weeks have flown by, yet I’ve already achieved significant milestones on the BLIS port. This project has deepened my understanding of build processes, high performance math libraries and mainframe environment. I am excited by the possibilities that BLIS and future projects can unlock for AI and HPC workloads on z/OS.

Finally, I am grateful to the Open Mainframe Project for providing this opportunity and I look forward to pushing the boundaries of what is possible on z/OS.