# Cmake not running on AIX 7.1,7.2

**URL:** https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989
**Category:** Usage
**Tags:** os:aix
**Created:** [April 26, 2023, 12:33pm UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989 "2023-04-26T12:33:28Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![tmx1835](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/t/43a26b/32.png) [@tmx1835](https://discourse.cmake.org/u/tmx1835)
#### Post date: [April 26, 2023, 12:33pm UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/1 "2023-04-26T12:33:28Z")

</div>

i have a very simple test cmake project which i am trying to build on aix 7.2. its as simple as it gets.

```cmake
cmake_minimum_required(VERSION 3.10)

project(myapp LANGUAGES CXX)

add_executable(myapp myapp.cpp)

```

when i run Cmake . there is an attempt to detect the aix Xlc compiler (as thats what i need to use and i know works and is installed correctly) however i get the following and cmake doesnt build the makefiles.

```auto
-- The C compiler identification is unknown
-- The CXX compiler identification is XL 16.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /opt/IBM/xlC/16.1.0/bin/cc
-- Check for working C compiler: /opt/IBM/xlC/16.1.0/bin/cc - broken
CMake Error at /opt/freeware/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/opt/IBM/xlC/16.1.0/bin/cc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /data/js/cmaketest/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/local/bin/gmake -f Makefile cmTC_b4d42/fast && /usr/local/bin/gmake -f CMakeFiles/cmTC_b4d42.dir/build.make CMakeFiles/cmTC_b4d42.dir/build
    gmake[1]: Entering directory '/data/js/cmaketest/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_b4d42.dir/testCCompiler.c.o
    /opt/IBM/xlC/16.1.0/bin/cc -o CMakeFiles/cmTC_b4d42.dir/testCCompiler.c.o -c /data/js/cmaketest/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_b4d42
    /opt/freeware/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b4d42.dir/link.txt --verbose=1
    /opt/IBM/xlC/16.1.0/bin/cc CMakeFiles/cmTC_b4d42.dir/testCCompiler.c.o -o cmTC_b4d42 /usr/lib /lib
    ld: 0711-168 SEVERE ERROR: Input file: /usr/lib
        Input files must be regular files.
    CMakeFiles/cmTC_b4d42.dir/build.make:98: recipe for target 'cmTC_b4d42' failed
    gmake[1]: *** [cmTC_b4d42] Error 12
    gmake[1]: Leaving directory '/data/js/cmaketest/CMakeFiles/CMakeTmp'
    Makefile:127: recipe for target 'cmTC_b4d42/fast' failed
    gmake: *** [cmTC_b4d42/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:4 (project)

-- Configuring incomplete, errors occurred!
See also "/data/js/cmaketest/CMakeFiles/CMakeOutput.log".
See also "/data/js/cmaketest/CMakeFiles/CMakeError.log".
-bash-5.1$

```

---

<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: [April 26, 2023, 3:54pm UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/2 "2023-04-26T15:54:51Z")

</div>

It looks like link directories are being passed without flags?

Cc: @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: [April 26, 2023, 4:57pm UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/3 "2023-04-26T16:57:39Z")

</div>

The first problem visible in the output is:

> `-- The C compiler identification is unknown`

Once that compiler identification fails, CMake doesn’t know what compiler flags to pass for anything later.

The `CMakeFiles/CMakeError.log` file mentioned at the end of the output may have details about the failure of the compiler identification step.

---

<div class="post-metadata">

### Author: ![tmx1835](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/t/43a26b/32.png) [@tmx1835](https://discourse.cmake.org/u/tmx1835)
#### Post date: [April 28, 2023, 6:25am UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/4 "2023-04-28T06:25:15Z")

</div>

I cant upload the log file so am pasting it in here. Looks like for some reason xlC is failing to compiler the compiler identification code, its a bit odd as the version of XLC does support single line comment. I have pasted the lines the error mentions into a standalone c module and they do compile.

> **CMakeError.log**
>
> ```auto
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags:
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: -c
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: -Aa
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: -D __CLASSIC_C__
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: --target=arm-arm-none-eabi;-mcpu=cortex-m3
> 
> The output was:
> 
> 1
> 
> /opt/IBM/xlC/16.1.0/bin/.orig/cc: 1501-216 (W) command option --target=arm-arm-none-eabi is not recognized - passed to ld
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: -c;-I __does_not_exist__
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags:
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: -c
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: -Aa
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: -D __CLASSIC_C__
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: --target=arm-arm-none-eabi;-mcpu=cortex-m3
> 
> The output was:
> 
> 1
> 
> /opt/IBM/xlC/16.1.0/bin/.orig/cc: 1501-216 (W) command option --target=arm-arm-none-eabi is not recognized - passed to ld
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: -c;-I __does_not_exist__
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":
> 
> /opt/IBM/xlC/16.1.0/bin/.orig/cc: 1501-294 (S) No input file specified. Please use -qhelp for more information.
> 
> Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":
> 
> /opt/IBM/xlC/16.1.0/bin/.orig/cc: 1501-294 (S) No input file specified. Please use -qhelp for more information.
> 
> Detecting C compiler ABI info failed to compile with the following output:
> 
> Change Dir: /data/js/cmaketest/CMakeFiles/CMakeTmp
> 
> Run Build Command(s):/usr/local/bin/gmake -f Makefile cmTC_04415/fast && /usr/local/bin/gmake -f CMakeFiles/cmTC_04415.dir/build.make CMakeFiles/cmTC_04415.dir/build
> 
> gmake[1]: Entering directory '/data/js/cmaketest/CMakeFiles/CMakeTmp'
> 
> Building C object CMakeFiles/cmTC_04415.dir/CMakeCCompilerABI.c.o
> 
> /opt/IBM/xlC/16.1.0/bin/cc -o CMakeFiles/cmTC_04415.dir/CMakeCCompilerABI.c.o -c /opt/freeware/share/cmake-3.22/Modules/CMakeCCompilerABI.c
> 
> Linking C executable cmTC_04415
> 
> /opt/freeware/bin/cmake -E cmake_link_script CMakeFiles/cmTC_04415.dir/link.txt --verbose=1
> 
> /opt/IBM/xlC/16.1.0/bin/cc CMakeFiles/cmTC_04415.dir/CMakeCCompilerABI.c.o -o cmTC_04415 /usr/lib /lib
> 
> ld: 0711-168 SEVERE ERROR: Input file: /usr/lib
> 
> Input files must be regular files.
> 
> CMakeFiles/cmTC_04415.dir/build.make:98: recipe for target 'cmTC_04415' failed
> 
> gmake[1]: *** [cmTC_04415] Error 12
> 
> gmake[1]: Leaving directory '/data/js/cmaketest/CMakeFiles/CMakeTmp'
> 
> Makefile:127: recipe for target 'cmTC_04415/fast' failed
> 
> gmake: *** [cmTC_04415/fast] Error 2
> 
> Determining if the C compiler works failed with the following output:
> 
> Change Dir: /data/js/cmaketest/CMakeFiles/CMakeTmp
> 
> Run Build Command(s):/usr/local/bin/gmake -f Makefile cmTC_8298e/fast && /usr/local/bin/gmake -f CMakeFiles/cmTC_8298e.dir/build.make CMakeFiles/cmTC_8298e.dir/build
> 
> gmake[1]: Entering directory '/data/js/cmaketest/CMakeFiles/CMakeTmp'
> 
> Building C object CMakeFiles/cmTC_8298e.dir/testCCompiler.c.o
> 
> /opt/IBM/xlC/16.1.0/bin/cc -o CMakeFiles/cmTC_8298e.dir/testCCompiler.c.o -c /data/js/cmaketest/CMakeFiles/CMakeTmp/testCCompiler.c
> 
> Linking C executable cmTC_8298e
> 
> /opt/freeware/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8298e.dir/link.txt --verbose=1
> 
> /opt/IBM/xlC/16.1.0/bin/cc CMakeFiles/cmTC_8298e.dir/testCCompiler.c.o -o cmTC_8298e /usr/lib /lib
> 
> ld: 0711-168 SEVERE ERROR: Input file: /usr/lib
> 
> Input files must be regular files.
> 
> CMakeFiles/cmTC_8298e.dir/build.make:98: recipe for target 'cmTC_8298e' failed
> 
> gmake[1]: *** [cmTC_8298e] Error 12
> 
> gmake[1]: Leaving directory '/data/js/cmaketest/CMakeFiles/CMakeTmp'
> 
> Makefile:127: recipe for target 'cmTC_8298e/fast' failed
> 
> gmake: *** [cmTC_8298e/fast] Error 2
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags:
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: -c
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: -Aa
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: -D __CLASSIC_C__
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: --target=arm-arm-none-eabi;-mcpu=cortex-m3
> 
> The output was:
> 
> 1
> 
> /opt/IBM/xlC/16.1.0/bin/.orig/cc: 1501-216 (W) command option --target=arm-arm-none-eabi is not recognized - passed to ld
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: -c;-I __does_not_exist__
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags:
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: -c
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: -Aa
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: -D __CLASSIC_C__
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: --target=arm-arm-none-eabi;-mcpu=cortex-m3
> 
> The output was:
> 
> 1
> 
> /opt/IBM/xlC/16.1.0/bin/.orig/cc: 1501-216 (W) command option --target=arm-arm-none-eabi is not recognized - passed to ld
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
> 
> Compiler: /opt/IBM/xlC/16.1.0/bin/cc
> 
> Build flags:
> 
> Id flags: -c;-I __does_not_exist__
> 
> The output was:
> 
> 1
> 
> "CMakeCCompilerId.c", line 758.2: 1506-275 (S) Unexpected text '/' encountered.
> 
> "CMakeCCompilerId.c", line 758.13: 1506-045 (S) Undeclared identifier _MSC_VER.
> 
> "CMakeCCompilerId.c", line 757.46: 1506-221 (S) Initializer must be a valid constant expression.
> 
> "CMakeCCompilerId.c", line 758.66: 1506-209 (S) Character constants must end before the end of a line.
> 
> "CMakeCCompilerId.c", line 758.39: 1506-076 (W) Character constant 's MSVC compatibility mode.' has more than 4 characters. No more than rightmost 4 characters are used.
> 
> "CMakeCCompilerId.c", line 758.23: 1506-277 (S) Syntax error: possible missing ';' or ','?
> 
> Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":
> 
> /opt/IBM/xlC/16.1.0/bin/.orig/cc: 1501-294 (S) No input file specified. Please use -qhelp for more information.
> 
> Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":
> 
> /opt/IBM/xlC/16.1.0/bin/.orig/cc: 1501-294 (S) No input file specified. Please use -qhelp for more information.
> 
> Detecting C compiler ABI info failed to compile with the following output:
> 
> Change Dir: /data/js/cmaketest/CMakeFiles/CMakeTmp
> 
> Run Build Command(s):/usr/local/bin/gmake -f Makefile cmTC_f124f/fast && /usr/local/bin/gmake -f CMakeFiles/cmTC_f124f.dir/build.make CMakeFiles/cmTC_f124f.dir/build
> 
> gmake[1]: Entering directory '/data/js/cmaketest/CMakeFiles/CMakeTmp'
> 
> Building C object CMakeFiles/cmTC_f124f.dir/CMakeCCompilerABI.c.o
> 
> /opt/IBM/xlC/16.1.0/bin/cc -o CMakeFiles/cmTC_f124f.dir/CMakeCCompilerABI.c.o -c /opt/freeware/share/cmake-3.22/Modules/CMakeCCompilerABI.c
> 
> Linking C executable cmTC_f124f
> 
> /opt/freeware/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f124f.dir/link.txt --verbose=1
> 
> /opt/IBM/xlC/16.1.0/bin/cc CMakeFiles/cmTC_f124f.dir/CMakeCCompilerABI.c.o -o cmTC_f124f /usr/lib /lib
> 
> ld: 0711-168 SEVERE ERROR: Input file: /usr/lib
> 
> Input files must be regular files.
> 
> CMakeFiles/cmTC_f124f.dir/build.make:98: recipe for target 'cmTC_f124f' failed
> 
> gmake[1]: *** [cmTC_f124f] Error 12
> 
> gmake[1]: Leaving directory '/data/js/cmaketest/CMakeFiles/CMakeTmp'
> 
> Makefile:127: recipe for target 'cmTC_f124f/fast' failed
> 
> gmake: *** [cmTC_f124f/fast] Error 2
> 
> Determining if the C compiler works failed with the following output:
> 
> Change Dir: /data/js/cmaketest/CMakeFiles/CMakeTmp
> 
> Run Build Command(s):/usr/local/bin/gmake -f Makefile cmTC_8d25a/fast && /usr/local/bin/gmake -f CMakeFiles/cmTC_8d25a.dir/build.make CMakeFiles/cmTC_8d25a.dir/build
> 
> gmake[1]: Entering directory '/data/js/cmaketest/CMakeFiles/CMakeTmp'
> 
> Building C object CMakeFiles/cmTC_8d25a.dir/testCCompiler.c.o
> 
> /opt/IBM/xlC/16.1.0/bin/cc -o CMakeFiles/cmTC_8d25a.dir/testCCompiler.c.o -c /data/js/cmaketest/CMakeFiles/CMakeTmp/testCCompiler.c
> 
> Linking C executable cmTC_8d25a
> 
> /opt/freeware/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8d25a.dir/link.txt --verbose=1
> 
> /opt/IBM/xlC/16.1.0/bin/cc CMakeFiles/cmTC_8d25a.dir/testCCompiler.c.o -o cmTC_8d25a /usr/lib /lib
> 
> ld: 0711-168 SEVERE ERROR: Input file: /usr/lib
> 
> Input files must be regular files.
> 
> CMakeFiles/cmTC_8d25a.dir/build.make:98: recipe for target 'cmTC_8d25a' failed
> 
> gmake[1]: *** [cmTC_8d25a] Error 12
> 
> gmake[1]: Leaving directory '/data/js/cmaketest/CMakeFiles/CMakeTmp'
> 
> Makefile:127: recipe for target 'cmTC_8d25a/fast' failed
> 
> gmake: *** [cmTC_8d25a/fast] Error 2
> 
> ```

---

<div class="post-metadata">

### Author: ![tmx1835](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/t/43a26b/32.png) [@tmx1835](https://discourse.cmake.org/u/tmx1835)
#### Post date: [April 28, 2023, 6:40am UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/5 "2023-04-28T06:40:43Z")

</div>

some more info after digging in a bit more, if i compile the CMakeCCompilerId.c manually with xlC then it does compile, however compiling with cc it fails.

Whats odd and i have checked and checked this is that cc is a soft link to xlC (see below) i wonder if the xlC compiler is compiling to a different standard when invoked as cc

-bash-5.1$ which cc  
/opt/IBM/xlC/16.1.0/bin/cc  
-bash-5.1$ which xlC  
/opt/IBM/xlC/16.1.0/bin/xlC  
-bash-5.1$ ls -l /opt/IBM/xlC/16.1.0/bin/cc  
lrwxrwxrwx 1 root system 3 24 Apr 10:04 /opt/IBM/xlC/16.1.0/bin/cc → xlC  
-bash-5.1$ ls -l /opt/IBM/xlC/16.1.0/bin/xlC  
-rwxr-xr-x 1 root system 677 28 Sep 2022 /opt/IBM/xlC/16.1.0/bin/xlC  
-bash-5.1$

---

<div class="post-metadata">

### Author: ![tmx1835](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/t/43a26b/32.png) [@tmx1835](https://discourse.cmake.org/u/tmx1835)
#### Post date: [April 28, 2023, 6:58am UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/6 "2023-04-28T06:58:11Z")

</div>

More info.

from the IBM XLC documentation:

cc

This command supports pre-ANSI C, and many common language extensions. You can use this command to compile legacy code that does not conform to standard C.

if i set CC=c99 and then run cmake . then the project compiles and does indeed work.

this does unblock me but i guess isnt ideal

---

<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: [April 28, 2023, 2:54pm UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/7 "2023-04-28T14:54:35Z")

</div>

FWIW, on one of our nightly testing machines with AIX 7.2:

```plaintext
$ export PATH=/opt/IBM/xlC/16.1.0/bin:$PATH
$ type -p cc
/opt/IBM/xlC/16.1.0/bin/cc
$ ls -l /opt/IBM/xlC/16.1.0/bin/cc
lrwxrwxrwx ... /opt/IBM/xlC/16.1.0/bin/cc -> xlC
$ cmake ../src
-- The C compiler identification is XL 16.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/IBM/xlC/16.1.0/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
...
$ cc CMakeFiles/*/CompilerIdC/CMakeCCompilerId.c && echo works
works

```

---

<div class="post-metadata">

### Author: ![bhuntsman](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/59ef9b/32.png) [@bhuntsman](https://discourse.cmake.org/u/bhuntsman)
#### Post date: [May 24, 2023, 10:15pm UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/8 "2023-05-24T22:15:52Z")

</div>

Did anyone else manage to get past this? I am seeing the exact same issue, with the same output as @tmx1835. XLC 16.1, cmake 3.22 from the IBM repo. AIX 7.3, but that shouldn’t matter.

@brad.king Do you have a working example of a CMakeLists.txt that works on AIX? This seems to be a fairly widespread issue, and it seems as though the IBM build of cmake may be broken.

Thank you.

---

<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: [May 25, 2023, 2:00pm UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/9 "2023-05-25T14:00:01Z")

</div>

> [@bhuntsman](#):
>
> Do you have a working example of a CMakeLists.txt that works on AIX?

CMake’s entire test suite runs on AIX 7.2 every night and passes. Several XL and XLClang compiler versions are covered, including version 16.1.0 of both.

The errors discussed above are unrelated to the particulars of any one `CMakeLists.txt` file.

Something seems to be wrong with the installation or configuration of the compiler on the machines in question.

---

<div class="post-metadata">

### Author: ![bhuntsman](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/59ef9b/32.png) [@bhuntsman](https://discourse.cmake.org/u/bhuntsman)
#### Post date: [May 25, 2023, 2:05pm UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/10 "2023-05-25T14:05:36Z")

</div>

Hi there!  
I think there is an issue with the IBM-supplied cmake 3.22. I built the latest 3.26.4 from source and it works just fine. I reported the issue to IBM.

Thank you!

---

<div class="post-metadata">

### Author: ![MrGaryTaco](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mrgarytaco/32/3696_2.png) [@MrGaryTaco](https://discourse.cmake.org/u/MrGaryTaco)
#### Post date: [August 8, 2023, 10:03pm UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/11 "2023-08-08T22:03:32Z")

</div>

Hi @bhuntsman,

Do you have instructions or special AIX settings you used when you built cmake 3.26.4 from source? I was trying to build cmake 3.25.1 from source on AIX 7.1 but got the following errors show below from the ./bootstrap command:

**gunzip** cmake-3.25.1.tar.gz

**tar** xf cmake-3.25.1.tar

cd cmake-3.25.1

**./bootstrap**

* * *

CMake 3.25.1, Copyright 2000-2022 Kitware, Inc. and Contributors

Found XL toolchain

C compiler on this system is: xlc

* * *

Error when bootstrapping CMake:

Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.

Please specify one using environment variable CXX.

The C++ flags are “”.

They can be changed using the environment variable CXXFLAGS.

See cmake\_bootstrap.log for compilers attempted.

* * *

Log of errors: /home1/hub/ghenry/cmake-3.25.1/Bootstrap.cmk/cmake\_bootstrap.log

* * *

Before I go down this rabbit hole, I thought you might have some good instructions on how you were able to build 3.26.4 from source.

Thanks!

---

<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: [August 9, 2023, 11:30am UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/12 "2023-08-09T11:30:38Z")

</div>

`bootstrap` might not support XL (I’m not sure), but you can use another `cmake` to configure and build a newer CMake itself.

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [August 9, 2023, 12:49pm UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/13 "2023-08-09T12:49:55Z")

</div>

For bootstrap, you would be best off using `xlclang` and `xlclang++`.

---

<div class="post-metadata">

### Author: ![MrGaryTaco](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mrgarytaco/32/3696_2.png) [@MrGaryTaco](https://discourse.cmake.org/u/MrGaryTaco)
#### Post date: [August 9, 2023, 6:56pm UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/14 "2023-08-09T18:56:25Z")

</div>

@ben.boeckel ,Thanks for the suggestion of using another cmake to configure and build a newer cmake. I tried to install one of the older builds of cmake from [cmake is now available on AIX Toolbox](https://community.ibm.com/community/user/power/discussion/cmake-is-now-available-on-aix-toolbox) but using yum and rpm there were a lot of unsatisfied dependencies I did not want to deal with because dependencies usually end up having other dependencies, thus the rabbit hole. If you have instructions on how to install an older version I would be more than happy to try it.

---

<div class="post-metadata">

### Author: ![MrGaryTaco](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mrgarytaco/32/3696_2.png) [@MrGaryTaco](https://discourse.cmake.org/u/MrGaryTaco)
#### Post date: [August 9, 2023, 6:58pm UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/15 "2023-08-09T18:58:31Z")

</div>

@kyle.edwards , I would like to try your suggestion. Would you happen to have an example using xlclang and xlclang++? Thanks.

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [August 9, 2023, 7:00pm UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/16 "2023-08-09T19:00:57Z")

</div>

```auto
export CC=/path/to/xlclang CXX=/path/to/xlclang++
./bootstrap

```

---

<div class="post-metadata">

### Author: ![MrGaryTaco](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mrgarytaco/32/3696_2.png) [@MrGaryTaco](https://discourse.cmake.org/u/MrGaryTaco)
#### Post date: [August 10, 2023, 4:07pm UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/17 "2023-08-10T16:07:38Z")

</div>

@kyle.edwards , I checked the version of my cc and xlc and it appears I have version 11.1:

```auto
cc -qversion
IBM XL C/C++ for AIX, V11.1 (5724-X13)
Version: 11.01.0000.0003

xlc -qversion
IBM XL C/C++ for AIX, V11.1 (5724-X13)
Version: 11.01.0000.0003

```

So I set the following:

```auto
export CC=/usr/vacpp/bin/cc CXX=/usr/vacpp/bin/xlc

```

But when I run bootstrap I get the following error saying: `Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.`:

```auto
---------------------------------------------
CMake 3.25.1, Copyright 2000-2022 Kitware, Inc. and Contributors
C compiler on this system is: /usr/vacpp/bin/cc
---------------------------------------------
Error when bootstrapping CMake:
Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.
Please specify one using environment variable CXX.
The C++ flags are "".
They can be changed using the environment variable CXXFLAGS.
See cmake_bootstrap.log for compilers attempted.
---------------------------------------------

```

If you happen to know what I am doing wrong or how to resolve this I would appreciate it. Thanks!

---

<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: [August 10, 2023, 4:14pm UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/18 "2023-08-10T16:14:34Z")

</div>

> [@MrGaryTaco](#):
>
> `export CC=/usr/vacpp/bin/cc CXX=/usr/vacpp/bin/xlc`

`xlc` is a C compiler. Use `xlC` (with capital `C`) for C++:

```auto
export CC=/usr/vacpp/bin/xlc CXX=/usr/vacpp/bin/xlC

```

---

<div class="post-metadata">

### Author: ![MrGaryTaco](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mrgarytaco/32/3696_2.png) [@MrGaryTaco](https://discourse.cmake.org/u/MrGaryTaco)
#### Post date: [August 10, 2023, 4:27pm UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/19 "2023-08-10T16:27:20Z")

</div>

@brad.king , Same error with uppercase C:

```auto
xlC -qversion
IBM XL C/C++ for AIX, V11.1 (5724-X13)
Version: 11.01.0000.0003

export CC=/usr/vacpp/bin/xlc CXX=/usr/vacpp/bin/xlC
./bootstrap
---------------------------------------------
CMake 3.25.1, Copyright 2000-2022 Kitware, Inc. and Contributors
C compiler on this system is: /usr/vacpp/bin/xlc
---------------------------------------------
Error when bootstrapping CMake:
Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.
Please specify one using environment variable CXX.
The C++ flags are "".
They can be changed using the environment variable CXXFLAGS.

```

Any other suggestions?

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [August 10, 2023, 4:36pm UTC](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989/20 "2023-08-10T16:36:20Z")

</div>

Please try `xlclang`:

```auto
export CC=/usr/vacpp/bin/xlclang CXX=/usr/vacpp/bin/xlclang++

```

[Next page](https://discourse.cmake.org/t/cmake-not-running-on-aix-7-1-7-2/7989.md?page=2)
