AIX Open Source

 View Only
  • 1.  problem building R package uuid on AIX 7.3 will all the latest things

    Posted Mon December 26, 2022 09:27 PM
    Hello,

    This is a follow-on to another thread I have open re: R packages and R in the toolbox.  Here, I am trying to install the R package uuid but there's an error that causes it to fail.  I see some talk on the web about issues in gen_uuid.c involving AIX but I don't know myself how to effect a workaround.  Please let me know if anyone has thoughts.

    Thanks,
    Mike

    > install.packages("uuid", repo="https://rforge.net")
    trying URL 'https://rforge.net/src/contrib/uuid_1.1-1.tar.gz'
    Content type 'application/octet-stream' length 78302 bytes (76 KB)
    ==================================================
    downloaded 76 KB

    * installing *source* package 'uuid' ...
    ** using non-staged installation
    checking for gcc... gcc -maix64 -pthread -fPIC
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether the compiler supports GNU C... yes
    checking whether gcc -maix64 -pthread -fPIC accepts -g... yes
    checking for gcc -maix64 -pthread -fPIC option to enable C11 features... none needed
    checking for stdio.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for strings.h... yes
    checking for sys/stat.h... yes
    checking for sys/types.h... yes
    checking for unistd.h... yes
    checking for grp.h... yes
    checking for langinfo.h... yes
    checking for locale.h... yes
    checking for netinet/in.h... yes
    checking for stdlib.h... (cached) yes
    checking for sys/file.h... yes
    checking for sys/ioctl.h... yes
    checking for sys/socket.h... yes
    checking for sys/sockio.h... no
    checking for sys/syscall.h... no
    checking for sys/sendfile.h... no
    checking for sys/time.h... yes
    checking for sys/un.h... yes
    checking for unistd.h... (cached) yes
    checking for net/if.h... yes
    checking for net/if_dl.h... yes
    checking for dirfd... yes
    checking for err... no
    checking for errx... no
    checking for getexecname... no
    checking for getrandom... no
    checking for jrand48... yes
    checking for llseek... yes
    checking for lchown... yes
    checking for mempcpy... no
    checking for mkostemp... no
    checking for nanosleep... yes
    checking for sendfile... no
    checking for srandom... yes
    checking for strnchr... no
    checking for strndup... yes
    checking for strnlen... yes
    checking for usleep... yes
    checking for warn... no
    checking for warnx... no
    checking for flock... no
    checking for struct sockaddr.sa_len... yes
    checking for dlfcn.h... yes
    checking for library containing dlsym... none required
    checking for thread local storage (TLS) support... yes
    configure: creating ./config.status
    config.status: creating src/Makevars
    config.status: creating src/config.h
    ** libs
    gcc -maix64 -pthread -fPIC -I"/opt/freeware/lib64/R/include" -DNDEBUG -include config.h -O2 -I/opt/freeware/include -I/usr/incal-toc -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -c R.c -o R.o
    gcc -maix64 -pthread -fPIC -I"/opt/freeware/lib64/R/include" -DNDEBUG -include config.h -O2 -I/opt/freeware/include -I/usr/incal-toc -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -c Ruuid.c -o Ruuid.o
    gcc -maix64 -pthread -fPIC -I"/opt/freeware/lib64/R/include" -DNDEBUG -include config.h -O2 -I/opt/freeware/include -I/usr/incal-toc -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -c clear.c -o clear.o
    gcc -maix64 -pthread -fPIC -I"/opt/freeware/lib64/R/include" -DNDEBUG -include config.h -O2 -I/opt/freeware/include -I/usr/incal-toc -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -c compare.c -o compare.o
    gcc -maix64 -pthread -fPIC -I"/opt/freeware/lib64/R/include" -DNDEBUG -include config.h -O2 -I/opt/freeware/include -I/usr/incal-toc -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -c copy.c -o copy.o
    gcc -maix64 -pthread -fPIC -I"/opt/freeware/lib64/R/include" -DNDEBUG -include config.h -O2 -I/opt/freeware/include -I/usr/incal-toc -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -c gen_uuid.c -o gen_uuid.o
    gen_uuid.c: In function 'get_node_id':
    gen_uuid.c:151:29: error: 'struct ifreq' has no member named 'ifr_hwaddr'
    151 | a = (unsigned char *) &ifr.ifr_hwaddr.sa_data;
    | ^
    make: *** [/opt/freeware/lib64/R/etc/Makeconf:168: gen_uuid.o] Error 1
    ERROR: compilation failed for package 'uuid'
    * removing '/opt/freeware/lib64/R/library/uuid'

    The downloaded source packages are in
    '/tmp/RtmpiRkMea/downloaded_packages'
    Updating HTML index of packages in '.Library'
    Making 'packages.html' ... done
    Warning message:
    In install.packages("uuid", repo = "https://rforge.net") :
    installation of package 'uuid' had non-zero exit status

    ------------------------------
    Michael Metts
    ------------------------------


  • 2.  RE: problem building R package uuid on AIX 7.3 will all the latest things

    Posted Tue January 10, 2023 01:37 PM
    Hello everyone,

    Any thoughts on how to fix this one?  Please advise.

    Thanks,
    Mike

    ------------------------------
    Michael Metts
    ------------------------------



  • 3.  RE: problem building R package uuid on AIX 7.3 will all the latest things

    Posted Tue January 10, 2023 02:14 PM
    I tried hacking gen_uuid.c as shown below but now I'm getting another error.  Not sure...


    checking for library containing dlsym... none required
    checking for thread local storage (TLS) support... yes
    configure: creating ./config.status
    config.status: creating src/Makevars
    config.status: creating src/config.h
    config.status: src/config.h is unchanged
    ** libs
    gcc -maix64 -pthread -fPIC -I"/opt/freeware/lib64/R/include" -DNDEBUG -include config.h -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -mminimal-toc -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -c gen_uuid.c -o gen_uuid.o
    Assembler:
    /tmp/cchHOHfa.s: line 175: ".tc" only allowed inside ".toc" scope
    /tmp/cchHOHfa.s: line 181: ".tc" only allowed inside ".toc" scope
    /tmp/cchHOHfa.s: line 185: ".tc" only allowed inside ".toc" scope
    /tmp/cchHOHfa.s: line 189: ".tc" only allowed inside ".toc" scope
    /tmp/cchHOHfa.s: line 193: ".tc" only allowed inside ".toc" scope
    /tmp/cchHOHfa.s: line 710: ".tc" only allowed inside ".toc" scope
    /tmp/cchHOHfa.s: line 714: ".tc" only allowed inside ".toc" scope
    make: *** [/opt/freeware/lib64/R/etc/Makeconf:168: gen_uuid.o] Error 1
    ERROR: compilation failed for package 'uuid'
    * removing '/opt/freeware/lib64/R/library/uuid'

    with this hack:
    [root@crilacs1 src]# cd uuid/src
    [root@crilacs1 src]# diff gen_uuid.c.bak gen_uuid.c
    148c148
    < #ifdef SIOCGIFHWADDR
    ---
    > #if defined(SIOCGIFHWADDR) && (!defined(__aix__)) && (!defined(_AIX))
    [root@crilacs1 src]#

    ------------------------------
    Michael Metts
    ------------------------------



  • 4.  RE: problem building R package uuid on AIX 7.3 will all the latest things

    Posted Wed January 11, 2023 08:20 AM
    Edited by Ayappan P Wed January 11, 2023 09:14 AM

    Can you make the below two changes and try.

    --- /uuid/src/Makevars.in_orig 2023-01-11 07:52:27.384060360 +0000
    +++ /uuid/src/Makevars.in 2023-01-11 07:52:59.559591394 +0000
    @@ -1,2 +1,3 @@
    PKG_CPPFLAGS=-include config.h @CPPFLAGS@
    PKG_LIBS=@LIBS@
    +PKG_CFLAGS=-mno-minimal-toc


    # diff -u /uuid/src/gen_uuid.c_orig /uuid/src/gen_uuid.c
    --- /uuid/src/gen_uuid.c_orig 2023-01-11 09:09:20.646196489 +0000
    +++ /uuid/src/gen_uuid.c 2023-01-11 09:07:48.217985188 +0000
    @@ -109,6 +109,7 @@
    #ifdef HAVE_NET_IF_H
    int sd;
    struct ifreq ifr, *ifrp;
    + struct ifhwaddr_req ifrhw;
    struct ifconf ifc;
    char buf[1024];
    int n, i;
    @@ -146,9 +147,9 @@
    ifrp = (struct ifreq *)((char *) ifc.ifc_buf+i);
    strncpy(ifr.ifr_name, ifrp->ifr_name, IFNAMSIZ);
    #ifdef SIOCGIFHWADDR
    - if (ioctl(sd, SIOCGIFHWADDR, &ifr) < 0)
    + if (ioctl(sd, SIOCGIFHWADDR, &ifrhw) < 0)
    continue;
    - a = (unsigned char *) &ifr.ifr_hwaddr.sa_data;
    + a = (unsigned char *) &ifrhw.ifr_hwaddr;
    #else
    #ifdef SIOCGENADDR
    if (ioctl(sd, SIOCGENADDR, &ifr) < 0)



    ------------------------------
    Ayappan P
    ------------------------------



  • 5.  RE: problem building R package uuid on AIX 7.3 will all the latest things

    Posted Fri January 20, 2023 02:11 AM
    This worked and now I am able to build the remaining dependancies for tidyverse and tidyverse itself. Thanks!

    Michael L. Metts (he/him/his)
    /ˈmaɪkəɫ ˈɛɫ ˈmɛts/
    Principal Data Engineer
    CORNERSTONE RESEARCH
    1000 El Camino Real, Suite 250
    Menlo Park, CA 94025-4327
    650.470.7171 direct
    650.740.8551 mobile
    www.cornerstone.com<http: www.cornerstone.com="">