AIX not detecting compiler ?
I am trying to port our cmake project from Linux to AIX but have hit a bit of a problem, so i pared it back to a simple hello world my app. Not sure where to go at this point. We really want to move away from our old legacy shell scripts and makefiles but this is a stopper for me.
I am going to get the XLC updated to the latest 16.10 patch set, but that will take a few days i imagine, not sure if that will help though.
CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(myapp)
add_executable(myapp myapp.cpp)
myapp.cpp
#include <stdio.h>
int main(int argc char**argv) {
return printf("Hello MyApp\n");
}
We've got XLC 16 loaded
-bash-5.1$ xlC -qversion
IBM XL C/C++ for AIX, V16.1.0 (5725-C72, 5765-J12)
Version: 16.01.0000.0007
-bash-5.1$ cc -qversion
IBM XL C/C++ for AIX, V16.1.0 (5725-C72, 5765-J12)
Version: 16.01.0000.0007
-bash-5.1$
when i run a cmake . it fails to build the Makefiles with the following output
-- 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$
Cmake version 3.22.0
-bash-5.1$ cmake --version
cmake version 3.22.0
CMake suite maintained and supported by Kitware (kitware.com/cmake).
-bash-5.1$
Edited by Brad King