AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
  • 1.  Install GNU make on AIX7.1

    Posted Tue August 28, 2018 10:58 AM

    Originally posted by: @AAB


    Hi everyone,

    I tryed to compile GNU make on AIX (ftp://ftp.gnu.org/gnu/make/make-4.2.tar.gz), and faced a problem :

     

    export CC=cc

    export PATH=/tools/list/admin/sbin/gcc/bin:/opt/freeware/bin:$PATH

    cd /var/tmp/make/make-4.2

    autoreconf -i -> success

    ./configure -> success

    make -> Error

            (CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /var/tmp/make/make-4.2/config/missing autoheader)
            rm -f stamp-h1
            touch ./config.h.in
            cd . && /bin/sh ./config.status config.h
    config.status: creating config.h
    config.status: config.h is unchanged
            make  all-recursive
    Making all in glob
    Target "all" is up to date.
    Making all in config
    Target "all" is up to date.
    Making all in po
    Target "all" is up to date.
    Making all in doc
    Target "all" is up to date.
            source='read.c' object='read.o' libtool=no  DEPDIR=.deps depmode=xlc /bin/sh ./config/depcomp  cc -qlanglvl=extc89 -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I.  -I./glob     -g -c -o read.o read.c
    "dep.h", line 55.5: 1506-159 (E) Bit field type specified for flags is not valid. Type unsigned assumed.
    "dep.h", line 55.5: 1506-159 (E) Bit field type specified for changed is not valid. Type unsigned assumed.
    "dep.h", line 55.5: 1506-159 (E) Bit field type specified for ignore_mtime is not valid. Type unsigned assumed.
    "dep.h", line 55.5: 1506-159 (E) Bit field type specified for staticpattern is not valid. Type unsigned assumed.
    "dep.h", line 55.5: 1506-159 (E) Bit field type specified for need_2nd_expansion is not valid. Type unsigned assumed.
    "dep.h", line 64.5: 1506-159 (E) Bit field type specified for flags is not valid. Type unsigned assumed.
    "dep.h", line 64.5: 1506-159 (E) Bit field type specified for changed is not valid. Type unsigned assumed.
    "dep.h", line 64.5: 1506-159 (E) Bit field type specified for ignore_mtime is not valid. Type unsigned assumed.
    "dep.h", line 64.5: 1506-159 (E) Bit field type specified for staticpattern is not valid. Type unsigned assumed.
    "dep.h", line 64.5: 1506-159 (E) Bit field type specified for need_2nd_expansion is not valid. Type unsigned assumed.
    "read.c", line 2344.15: 1506-046 (S) Syntax error.
    "read.c", line 2344.61: 1506-209 (S) Character constants must end before the end of a line.
    "read.c", line 2344.53: 1506-076 (W) Character constant 're done' has more than 4 characters. No more than rightmost 4 characters are used.
    "read.c", line 2344.18: 1506-045 (S) Undeclared identifier If.
    make: The error code from the last command is 1.


    Stop.
    make: The error code from the last command is 1.


    Stop.
    make: The error code from the last command is 2.


    Stop.
     

    thank you for help !

     

    Best

    Abderahim

     

     

     



  • 2.  Re: Install GNU make on AIX7.1

    Posted Tue August 28, 2018 11:16 AM

    Originally posted by: AyappanP


    We have make-4.2.1 already available in AIX Toolbox --> ftp://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/make/



  • 3.  Re: Install GNU make on AIX7.1

    Posted Tue August 28, 2018 11:26 AM

    Originally posted by: @AAB


    Hi

     

    Thanks for your response

    I have this error when trying use it :

    CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /opt/freeware/src/packages/SOURCES/jq-1.5/config/missing aclocal-1.14 -I config/m4
    /opt/freeware/src/packages/SOURCES/jq-1.5/config/missing[81]: aclocal-1.14:  not found
    WARNING: 'aclocal-1.14' is missing on your system.
             You should only need it if you modified 'acinclude.m4' or
             'configure.ac' or m4 files included by 'configure.ac'.
             The 'aclocal' program is part of the GNU Automake package:
             <http://www.gnu.org/software/automake>
             It also requires GNU Autoconf, GNU m4 and Perl in order to run:
             <http://www.gnu.org/software/autoconf>
             <http://www.gnu.org/software/m4/>
             <http://www.perl.org/>
    make: *** [Makefile:759: aclocal.m4] Error 127

     

    have you an idea ?

     



  • 4.  Re: Install GNU make on AIX7.1

    Posted Tue August 28, 2018 12:05 PM

    Originally posted by: @AAB


    Just to note that there are another error when i didn't use autoconf :

    export CC=cc

    export PATH=/tools/list/admin/sbin/gcc/bin:/opt/freeware/bin:$PATH

    cd /var/tmp/make/make-4.2

    ./configure -> success

    make -> Error

    root@inf000ora0002:/opt/freeware/src/packages/SOURCES/jq-1.5# make
      GEN      version.h
    make  all-am
    make[1]: Entering directory '/opt/freeware/src/packages/SOURCES/jq-1.5'
      CC       locfile.lo
    cc: 1501-289 (W) Option -Wextra was incorrectly specified. The option will be ignored.
    cc: 1501-289 (W) Option -Wall was incorrectly specified. The option will be ignored.
    cc: 1501-289 (W) Option -Wno-missing-field-initializers was incorrectly specified. The option will be ignored.
    cc: 1501-289 (W) Option -Wno-unused-parameter was incorrectly specified. The option will be ignored.
    cc: 1501-289 (W) Option -Wno-unused-function was incorrectly specified. The option will be ignored.
    "./jv.h", line 115.19: 1506-172 (S) Parameter type list for function jv_string_vfmt contains parameters without identifiers.
    "./jv.h", line 115.32: 1506-172 (S) Parameter type list for function jv_string_vfmt contains parameters without identifiers.
    "./jv.h", line 115.41: 1506-276 (S) Syntax error: possible missing '{'?
    "./jv.h", line 164.3: 1506-045 (S) Undeclared identifier JV_PRINT_PRETTY.
    "./jv.h", line 165.3: 1506-045 (S) Undeclared identifier JV_PRINT_ASCII.
    "./jv.h", line 166.3: 1506-045 (S) Undeclared identifier JV_PRINT_COLOUR.
    "./jv.h", line 167.3: 1506-045 (S) Undeclared identifier JV_PRINT_SORTED.
    "./jv.h", line 168.3: 1506-045 (S) Undeclared identifier JV_PRINT_INVALID.
    "./jv.h", line 169.3: 1506-045 (S) Undeclared identifier JV_PRINT_REFCOUNT.
    "./jv.h", line 170.3: 1506-045 (S) Undeclared identifier JV_PRINT_TAB.
    "./jv.h", line 171.3: 1506-045 (S) Undeclared identifier JV_PRINT_ISATTY.
    "./jv.h", line 172.3: 1506-045 (S) Undeclared identifier JV_PRINT_SPACE0.
    "./jv.h", line 173.3: 1506-045 (S) Undeclared identifier JV_PRINT_SPACE1.
    "./jv.h", line 174.3: 1506-045 (S) Undeclared identifier JV_PRINT_SPACE2.
    "./jv.h", line 175.1: 1506-046 (S) Syntax error.
    "locfile.c", line 80.41: 1506-280 (S) Function argument assignment between types "struct {...}" and "int" is not allowed.
    "locfile.c", line 84.9: 1506-196 (S) Initialization between types "struct {...}" and "int" is not allowed.
    make[1]: *** [Makefile:903: locfile.lo] Error 1
    make[1]: Leaving directory '/opt/freeware/src/packages/SOURCES/jq-1.5'
    make: *** [Makefile:723: all] Error 2
     

    thank you for helping !

     

    Best

    Abderahim

     



  • 5.  Re: Install GNU make on AIX7.1

    Posted Wed August 29, 2018 05:10 AM

    Originally posted by: AyappanP


    This is a compilation problem with xlc. You can check this one https://github.com/stedolan/jq/issues/1335

    And also you can try with gcc compiler. 



  • 6.  Re: Install GNU make on AIX7.1

    Posted Wed August 29, 2018 11:36 AM

    Originally posted by: @AAB


    Same error !

    root@XXXXXXXXX:/opt/freeware/src/packages/SOURCES/jq-1.5# grep ^CC Makefile
    CCLD = $(CC)
    CC = cc -qlanglvl=extc89 -qlanglvl=extc99 -D_OPEN_SOURCE=700
    CCDEPMODE = depmode=xlc
    root@inf000ora0002:/opt/freeware/src/packages/SOURCES/jq-1.5# make
      GEN      version.h
    make  all-am
    make[1]: Entering directory '/opt/freeware/src/packages/SOURCES/jq-1.5'
      CC       locfile.lo
    cc: 1501-289 (W) Option -Wextra was incorrectly specified. The option will be ignored.
    cc: 1501-289 (W) Option -Wall was incorrectly specified. The option will be ignored.
    cc: 1501-289 (W) Option -Wno-missing-field-initializers was incorrectly specified. The option will be ignored.
    cc: 1501-289 (W) Option -Wno-unused-parameter was incorrectly specified. The option will be ignored.
    cc: 1501-289 (W) Option -Wno-unused-function was incorrectly specified. The option will be ignored.
    "./jv.h", line 115.19: 1506-172 (S) Parameter type list for function jv_string_vfmt contains parameters without identifiers.
    "./jv.h", line 115.32: 1506-172 (S) Parameter type list for function jv_string_vfmt contains parameters without identifiers.
    "./jv.h", line 115.41: 1506-276 (S) Syntax error: possible missing '{'?
    "./jv.h", line 164.3: 1506-045 (S) Undeclared identifier JV_PRINT_PRETTY.
    "./jv.h", line 165.3: 1506-045 (S) Undeclared identifier JV_PRINT_ASCII.
    "./jv.h", line 166.3: 1506-045 (S) Undeclared identifier JV_PRINT_COLOUR.
    "./jv.h", line 167.3: 1506-045 (S) Undeclared identifier JV_PRINT_SORTED.
    "./jv.h", line 168.3: 1506-045 (S) Undeclared identifier JV_PRINT_INVALID.
    "./jv.h", line 169.3: 1506-045 (S) Undeclared identifier JV_PRINT_REFCOUNT.
    "./jv.h", line 170.3: 1506-045 (S) Undeclared identifier JV_PRINT_TAB.
    "./jv.h", line 171.3: 1506-045 (S) Undeclared identifier JV_PRINT_ISATTY.
    "./jv.h", line 172.3: 1506-045 (S) Undeclared identifier JV_PRINT_SPACE0.
    "./jv.h", line 173.3: 1506-045 (S) Undeclared identifier JV_PRINT_SPACE1.
    "./jv.h", line 174.3: 1506-045 (S) Undeclared identifier JV_PRINT_SPACE2.
    "./jv.h", line 175.1: 1506-046 (S) Syntax error.
    "locfile.c", line 80.41: 1506-280 (S) Function argument assignment between types "struct {...}" and "int" is not allowed.
    "locfile.c", line 84.9: 1506-196 (S) Initialization between types "struct {...}" and "int" is not allowed.
    make[1]: *** [Makefile:903: locfile.lo] Error 1
    make[1]: Leaving directory '/opt/freeware/src/packages/SOURCES/jq-1.5'
    make: *** [Makefile:723: all] Error 2
    root@XXXXXXXXX:/opt/freeware/src/packages/SOURCES/jq-1.5#

     



  • 7.  Re: Install GNU make on AIX7.1

    Posted Wed August 29, 2018 01:05 PM

    Originally posted by: @AAB


    jq running successfully on AIX7.1 Smile

    1. donwload jq from jq site : https://stedolan.github.io/jq/

    2. Make copy on my work directory /opt/freeware/src/packages/SOURCES/

         cd /opt/freeware/src/packages/SOURCES/jq-1.5

         tar -xvf jq-1.5.tar; cd jq-1.5

    3. Modify jv.h and builtin.c files as recommanded on  https://github.com/stedolan/jq/issues/1335

    --- jv_orig.h    2015-07-27 01:32:03.000000000 +0200
    +++ jv.h    2017-02-28 11:21:28.000000000 +0100
    @@ -99,6 +99,9 @@
        __attribute__ ((__format__( __printf__, fmt_arg_num, args_num)))
      #define JV_VPRINTF_LIKE(fmt_arg_num) \
        __attribute__ ((__format__( __printf__, fmt_arg_num, 0)))
    + #else
    + #define JV_PRINTF_LIKE(fmt_arg_num, args_num)
    + #define JV_VPRINTF_LIKE(fmt_arg_num)
      #endif
     
    --- builtin_orig.c    2015-08-16 06:38:10.000000000 +0200
    +++ builtin.c    2017-02-28 13:47:26.000000000 +0100
    @@ -1,6 +1,10 @@
      #define _BSD_SOURCE
      #define _GNU_SOURCE
    + #if defined(_AIX)       /* AIX */
    + #define _XOPEN_SOURCE 700
    + #elif
      #define _XOPEN_SOURCE
    + #endif   /* _AIX */
      #include <sys/time.h>
      #include <stdlib.h>
      #include <stddef.h>

     

    4. Compilation with cc succeeded :

         export PATH=/opt/freeware/bin:$PATH

          export CC=cc

         ./configure --disable-maintainer-mode

          make

          make install

    5. Test it, by extract some informations from JSON file :

    root@XXXXXXXXX:/root# export PATH=/usr/local/bin:$PATH
    root@XXXXXXXXX:/root# uname
    AIX
    root@XXXXXXXXX:/root# oslevel -s
    7100-05-01-1731
    root@XXXXXXXXX:/root# cat /tmp/VM_AIX.json | jq '.servers | .[] | [.name, .max_memory_mb, .cpus, .["OS-EXT-AZ:availability_zone"], .operating_system]'
    [
      "xxxxx",
      9472,
      1,
      "XXXY",
      "AIX 6.1 6100-08-03-1339"
    ]
    [
      "xxxxxxxxxxxx",
      9216,
      1,
      "XXXY",
      "AIX 6.1 6100-08-03-1339"
    ]
    [
      "wwwwwwwwww",
      16384,
      4,
      "XXXY",
      "AIX 6.1 6100-09-07-1614"
    ]

    ...

    root@XXXXXXXXX:/root# echo $?
    0

    6. PowerVC Use case and validate JSON file before send API request :

    root@XXXXXXXXX:/root# jq '.' /tmp/auth.json
    {
      "auth": {
        "scope": {
          "project": {
            "name": "ibm-default",
            "domain": {
              "name": "Default"
            }
          }
        },
        "identity": {
          "methods": [
            "password"
          ],
          "password": {
            "user": {
              "domain": {
                "name": "Default"
              },
              "name": "root",
              "password": "xxxxxx"
            }
          }
        }
      }
    }

    # request a token by API

    root@XXXXXXXXX:/root# curl -l -k -i -X POST https://MyPowerVCIP:5000/v3/auth/tokens -H "Accept: application/json" -H "Content-Type: application/json" -d @/tmp/auth.json

    curl -l -k -i -X POST https://MyPowerVCIP:5000/v3/auth/tokens -H "Accept: application/json" -H "Content-Type: application/json" -d @/tmp/auth.json
    HTTP/1.1 201 Created
    Date: Wed, 29 Aug 2018 16:47:37 GMT
    Server: Apache
    X-Subject-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Vary: X-Auth-Token
    x-openstack-request-id: rxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Content-Length: 8388
    Content-Type: application/json

    ...
    ...

     

    Very useful, thank you so much for every one IBMers !