AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only

cmake on AIX not finding xlc 13.1.3 ?

  • 1.  cmake on AIX not finding xlc 13.1.3 ?

    Posted Tue January 16, 2018 06:13 AM

    Originally posted by: rumexcrispus


    Hi

    Can anyone shed some light on this.  I'm on AIX 7.1 with the 13.1.3 version of the xlc and xlC / xlc++ compiler.

     

    I'd like to avoid having to tell cmake where the AIX IBM compiler is using the argument -DCMAKE_C_COMPILER=/opt/IBM/xlc/13.1.3/bin/xlc

     

    The compiler has been installed (following IBM provided media and instructions) to /opt/IBM/xlc/13.1.3/bin.

    I have a CMakeLists.txt

    with

    cmake_minimum_required(VERSION 3.9)
    project(cmake-aix)
    add_executable(a.out hello.cc)

     

    When I try

    cd debug; cmake ..

    I see

    -- The C compiler identification is XL 13.1.3
    -- The CXX compiler identification is XL 13.1.3
    CMake Error at /opt/freeware/share/cmake/Modules/Compiler/CMakeCommonCompilerMacros.cmake:42 (message):
      CMAKE_C_STANDARD_COMPUTED_DEFAULT should be set for XL
      (/opt/IBM/xlC/13.1.3/bin/cc) version 13.1.3
    Call Stack (most recent call first):
      /opt/freeware/share/cmake/Modules/Compiler/XL-C.cmake:41 (__compiler_check_default_language_standard)
      /opt/freeware/share/cmake/Modules/CMakeCInformation.cmake:25 (include)
      CMakeLists.txt:16 (project)

     

    When I try

    cd debug; cmake -DCMAKE_C_COMPILER=/opt/IBM/xlc/13.1.3/bin/xlc   .

    cmake does not complain and I can make and run a hello world program successfully.

     


    #AIX-Forum