# CMake on zOS?

**URL:** https://discourse.cmake.org/t/cmake-on-zos/6880
**Category:** Usage
**Created:** [November 16, 2022, 2:11pm UTC](https://discourse.cmake.org/t/cmake-on-zos/6880 "2022-11-16T14:11:07Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![nshustov](https://discourse.cmake.org/user_avatar/discourse.cmake.org/nshustov/32/2925_2.png) [@nshustov](https://discourse.cmake.org/u/nshustov)
#### Post date: [November 16, 2022, 2:11pm UTC](https://discourse.cmake.org/t/cmake-on-zos/6880/1 "2022-11-16T14:11:07Z")

</div>

Is CMake supported on zOS?  
If not, any plans for that?

---

<div class="post-metadata">

### Author: ![scivision](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a87d85/32.png) [@scivision](https://discourse.cmake.org/u/scivision)
#### Post date: [November 16, 2022, 2:49pm UTC](https://discourse.cmake.org/t/cmake-on-zos/6880/2 "2022-11-16T14:49:16Z")

</div>

from 2015: [https://cmake.org/pipermail/cmake-developers/2015-May/025276.html](https://cmake.org/pipermail/cmake-developers/2015-May/025276.html)

Is it possible to boostrap/build CMake by downloading/extracting the CMake source and then using GCC:

```nohighlight
./bootstrap
make

```

---

<div class="post-metadata">

### Author: ![nshustov](https://discourse.cmake.org/user_avatar/discourse.cmake.org/nshustov/32/2925_2.png) [@nshustov](https://discourse.cmake.org/u/nshustov)
#### Post date: [November 16, 2022, 2:53pm UTC](https://discourse.cmake.org/t/cmake-on-zos/6880/3 "2022-11-16T14:53:57Z")

</div>

Thank you, I saw that before posting the question. The thing is that this email thread dated 2015 and I could not find any updates.  
The Bison and Flex seem to support zOS now.  
I am not sure about the regex implementation that old post mentioned.  
That’s why I asked.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [November 17, 2022, 2:24pm UTC](https://discourse.cmake.org/t/cmake-on-zos/6880/4 "2022-11-17T14:24:04Z")

</div>

I haven’t heard of any updates. @brad.king?

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [November 17, 2022, 2:31pm UTC](https://discourse.cmake.org/t/cmake-on-zos/6880/5 "2022-11-17T14:31:06Z")

</div>

I’m not aware of any work on CMake support for z/OS. Internally, most code paths assume strings are UTF-8. I don’t know how that should be reconciled with EBCDIC environments.

---

<div class="post-metadata">

### Author: ![nshustov](https://discourse.cmake.org/user_avatar/discourse.cmake.org/nshustov/32/2925_2.png) [@nshustov](https://discourse.cmake.org/u/nshustov)
#### Post date: [November 17, 2022, 3:04pm UTC](https://discourse.cmake.org/t/cmake-on-zos/6880/6 "2022-11-17T15:04:39Z")

</div>

This assumption (UTF-8, not EBCDIC) - how is it really used in CMake, outside of Bison/Flex?  
Are there any operations in CMake itself that really sensitive?

If you could tell me how can I build CMake run its tests on zOS, I could try to see what would it be.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [November 17, 2022, 3:20pm UTC](https://discourse.cmake.org/t/cmake-on-zos/6880/7 "2022-11-17T15:20:02Z")

</div>

CMake has lots of places that sort and order strings lexicographically. There are also places that do encoding conversions for international character support. The UTF-8 assumption is baked in pretty deeply, and I don’t think we’d want to accept massive changes to lift that assumption.

As I suggested in my [post](https://cmake.org/pipermail/cmake-developers/2015-March/024832.html) to the 2015 mailing list thread, cross-compiling to z/OS from another host platform may be easier.

---

<div class="post-metadata">

### Author: ![nshustov](https://discourse.cmake.org/user_avatar/discourse.cmake.org/nshustov/32/2925_2.png) [@nshustov](https://discourse.cmake.org/u/nshustov)
#### Post date: [November 17, 2022, 3:32pm UTC](https://discourse.cmake.org/t/cmake-on-zos/6880/8 "2022-11-17T15:32:04Z")

</div>

Thank you. That makes sense. I tried to avoid cross-compilation, but oh, well. 🙂

---

<div class="post-metadata">

### Author: ![Crosswind](https://discourse.cmake.org/user_avatar/discourse.cmake.org/crosswind/32/5427_2.png) [@Crosswind](https://discourse.cmake.org/u/Crosswind)
#### Post date: [March 21, 2025, 10:01am UTC](https://discourse.cmake.org/t/cmake-on-zos/6880/9 "2025-03-21T10:01:04Z")

</div>

I know this is an old thread but it was the only one I could find on here. For some time the zopen community has been active in porting tools. cmake is obviously a part of it. The repository can be found here: [zopencommunity/cmakeport: A cross-platform build system](https://github.com/zopencommunity/cmakeport/tree/main)

The patch file is located here: [cmakeport/patches/PR1.patch at main · zopencommunity/cmakeport](https://github.com/zopencommunity/cmakeport/blob/main/patches/PR1.patch)

Currently, 82% of the tests pass so it’s still a way to go. Does it make sense to start looking at integrating the current state of the patch? My understanding is that those shouldn’t break any of the tests for non z/OS systems.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [March 21, 2025, 12:19pm UTC](https://discourse.cmake.org/t/cmake-on-zos/6880/10 "2025-03-21T12:19:30Z")

</div>

> [@Crosswind](#):
>
> Does it make sense to start looking at integrating the current state of the patch?

Sure, incrementally upstreaming the changes is fine, so long as it doesn’t regress existing support for other platforms.
