Open Source Development

Power Open Source Development

Explore the open source tools and capabilities for building and deploying modern applications on IBM Power platforms including AIX, IBM i, and Linux.


#Power


#Power

 View Only
  • 1.  R package fs build fails

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

    I'm trying to build the R package fs but I'm hitting an error that seems to be related to the ar command.  I'm not sure how to effect a workaround in this situation.  Please see below.  I would really appreciate any insights.  Thanks.

    Mike

    >
    trying URL 'cran.case.edu/src/contrib/fs_1.5.2.tar.gz'
    Content type 'application/x-gzip' length 793627 bytes (775 KB)
    ==================================================
    downloaded 775 KB
    * installing *source* package 'fs' ...
    ** package 'fs' successfully unpacked and MD5 sums checked
    ** using non-staged installation
    ** libs
    g++ -maix64 -pthread -fPIC -std=gnu++14 -I"/opt/freeware/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -O2 e -I/usr/include -D_GETDELIM -c dir.cc -o dir.o
    g++ -maix64 -pthread -fPIC -std=gnu++14 -I"/opt/freeware/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -O2 e -I/usr/include -D_GETDELIM -c error.cc -o error.o
    g++ -maix64 -pthread -fPIC -std=gnu++14 -I"/opt/freeware/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -O2 e -I/usr/include -D_GETDELIM -c file.cc -o file.o
    g++ -maix64 -pthread -fPIC -std=gnu++14 -I"/opt/freeware/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -O2 e -I/usr/include -D_GETDELIM -c fs.cc -o fs.o
    g++ -maix64 -pthread -fPIC -std=gnu++14 -I"/opt/freeware/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -O2 e -I/usr/include -D_GETDELIM -c getmode.cc -o getmode.o
    g++ -maix64 -pthread -fPIC -std=gnu++14 -I"/opt/freeware/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -O2 e -I/usr/include -D_GETDELIM -c id.cc -o id.o
    g++ -maix64 -pthread -fPIC -std=gnu++14 -I"/opt/freeware/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -O2 e -I/usr/include -D_GETDELIM -c init.cc -o init.o
    g++ -maix64 -pthread -fPIC -std=gnu++14 -I"/opt/freeware/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -O2 e -I/usr/include -D_GETDELIM -c link.cc -o link.o
    g++ -maix64 -pthread -fPIC -std=gnu++14 -I"/opt/freeware/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -O2 e -I/usr/include -D_GETDELIM -c path.cc -o path.o
    g++ -maix64 -pthread -fPIC -std=gnu++14 -I"/opt/freeware/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -O2 e -I/usr/include -D_GETDELIM -c utils.cc -o utils.o
    g++ -maix64 -pthread -fPIC -std=gnu++14 -I"/opt/freeware/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -O2 e -I/usr/include -D_GETDELIM -c unix/getmode.cc -o unix/getmode.o
    gcc -maix64 -pthread -fPIC -I"/opt/freeware/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -O2 -I/opt/freewade -I/usr/include -D_GETDELIM -c bsd/setmode.c -o bsd/setmode.o
    gcc -maix64 -pthread -fPIC -I"/opt/freeware/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -O2 -I/opt/freewade -I/usr/include -D_GETDELIM -c bsd/strmode.c -o bsd/strmode.o
    gcc -maix64 -pthread -fPIC -I"/opt/freeware/lib64/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread -O2 -I/opt/freewade -I/usr/include -D_GETDELIM -c bsd/reallocarray.c -o bsd/reallocarray.o
    (cd libuv-1.38.1 \
    && CC="gcc -maix64 -pthread -fPIC " CFLAGS="-O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -O2 -I/opt/freeware/include-L/opt/freeware/lib/pthread -L/opt/freeware/lib64 -L/opt/freeware/lib -L/usr/lib -Wl,-blibpath:/opt/freeware/lib/pthread:/opt/f
    make --directory=libuv-1.38.1 \
    HAVE_DTRACE=0
    make[1]: Entering directory '/tmp/RtmpVaZMea/R.INSTALLf7019c9083789/fs/src/libuv-1.38.1'
    CC src/libuv_la-fs-poll.lo
    CC src/libuv_la-idna.lo
    CC src/libuv_la-inet.lo
    CC src/libuv_la-random.lo
    CC src/libuv_la-strscpy.lo
    CC src/libuv_la-threadpool.lo
    CC src/libuv_la-timer.lo
    CC src/libuv_la-uv-data-getter-setters.lo
    CC src/libuv_la-uv-common.lo
    CC src/libuv_la-version.lo
    CC src/unix/libuv_la-async.lo
    CC src/unix/libuv_la-core.lo
    src/unix/core.c: In function 'uv__nonblock_ioctl':
    src/unix/core.c:574:19: warning: overflow in conversion from 'long unsigned int' to 'int' changes value from '18446744071562356
    574 | r = ioctl(fd, FIONBIO, &set);
    | ^~~~~~~
    src/unix/core.c: In function 'uv_os_uname':
    src/unix/core.c:1449:9: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsi
    1449 | if (r >= sizeof(buffer->release)) {
    | ^~
    CC src/unix/libuv_la-dl.lo
    CC src/unix/libuv_la-fs.lo
    src/unix/fs.c: In function 'uv__fs_statfs':
    src/unix/fs.c:635:22: warning: passing argument 1 of 'statfs' discards 'const' qualifier from pointer target type [-Wdiscarded-
    635 | if (0 != statfs(req->path, &buf))
    | ~~~^~~~~~
    In file included from src/unix/fs.c:85:
    /usr/include/sys/statfs.h:129:19: note: expected 'char *' but argument is of type 'const char *'
    129 | extern int statfs(char *, struct statfs *);
    | ^~~~~~
    CC src/unix/libuv_la-getaddrinfo.lo
    CC src/unix/libuv_la-getnameinfo.lo
    CC src/unix/libuv_la-loop-watcher.lo
    CC src/unix/libuv_la-loop.lo
    CC src/unix/libuv_la-pipe.lo
    CC src/unix/libuv_la-poll.lo
    CC src/unix/libuv_la-process.lo
    CC src/unix/libuv_la-random-devurandom.lo
    CC src/unix/libuv_la-signal.lo
    CC src/unix/libuv_la-stream.lo
    CC src/unix/libuv_la-tcp.lo
    CC src/unix/libuv_la-thread.lo
    CC src/unix/libuv_la-tty.lo
    CC src/unix/libuv_la-udp.lo
    CC src/unix/libuv_la-aix.lo
    CC src/unix/libuv_la-aix-common.lo
    src/unix/aix-common.c: In function 'uv_exepath':
    src/unix/aix-common.c:133:50: warning: '%s' directive output may be truncated writing up to 1022 bytes into a region of size 10
    133 | snprintf(trypath, sizeof(trypath) - 1, "%s/%s", token, args);
    | ^~ ~~~~
    src/unix/aix-common.c:133:7: note: 'snprintf' output 2 or more bytes (assuming 1024) into a destination of size 1022
    133 | snprintf(trypath, sizeof(trypath) - 1, "%s/%s", token, args);
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    CCLD libuv.la
    0654-210 src/.libs/libuv_la-fs-poll.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/.libs/libuv_la-idna.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/.libs/libuv_la-inet.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/.libs/libuv_la-random.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/.libs/libuv_la-strscpy.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/.libs/libuv_la-threadpool.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/.libs/libuv_la-timer.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/.libs/libuv_la-uv-data-getter-setters.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/.libs/libuv_la-uv-common.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/.libs/libuv_la-version.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-async.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-core.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-dl.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-fs.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-getaddrinfo.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-getnameinfo.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-loop-watcher.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-loop.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-pipe.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-poll.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-process.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-random-devurandom.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-signal.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-stream.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-tcp.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-thread.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-tty.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-udp.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-aix.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    0654-210 src/unix/.libs/libuv_la-aix-common.o is not valid in the current object file mode.
    Use the -X option to specify the desired object mode.
    make[1]: Leaving directory '/tmp/RtmpVaZMea/R.INSTALLf7019c9083789/fs/src/libuv-1.38.1'
    g++ -maix64 -pthread -fPIC -std=gnu++14 -shared -Wl,-brtl -Wl,-G -Wl,-bnoentry -lc -L/opt/freeware/lib64/R/lib -L/opt/freeware/pt/freeware/lib/pthread:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib -Wl,-bbigtoc -o fs.so dir.o error.o file.o fs.o getmode.d/reallocarray.o ./libuv-1.38.1/.libs/libuv.a -pthread -lm -L/opt/freeware/lib64/R/lib -lR /opt/freeware/lib64/libintl.a
    installing to /opt/freeware/lib64/R/library/fs/libs
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded
    Error: package or namespace load failed for 'fs' in dyn.load(file, DLLpath = DLLpath, ...):
    unable to load shared object '/opt/freeware/lib64/R/library/fs/libs/fs.so':
    Could not load module /opt/freeware/lib64/R/library/fs/libs/fs.so.
    Dependent module ./libuv-1.38.1/.libs/libuv.a(libuv.so.1) could not be loaded.
    Could not load module ./libuv-1.38.1/.libs/libuv.a(libuv.so.1).
    System error: No such file or directory
    Could not load module /opt/freeware/lib64/R/library/fs/libs/fs.so.
    Dependent module /opt/freeware/lib64/R/library/fs/libs/fs.so could not be loaded.
    Error: loading failed
    Execution halted
    ERROR: loading failed
    * removing '/opt/freeware/lib64/R/library/fs'

    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("fs", repos = "cran.case.edu") :
    installation of package 'fs' had non-zero exit status
    >

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

    #AIXOpenSource


  • 2.  RE: R package fs build fails

    Posted Fri December 30, 2022 01:31 PM
    Hi Michael
    You might try this:

    OBJECT_MODE=64
    export OBJECT_MODE


    ------------------------------
    Jan Harris
    AIX Development Support (Liaison to the AIX Toolbox for Open Source)
    IBM (Contract)
    Austin TX
    ------------------------------



  • 3.  RE: R package fs build fails

    Posted Fri December 30, 2022 02:27 PM
    Hi Jan,

    I’m pretty sure I already did that. I have a feeling that there’s an issue with libuv … It would be good to hear from others on this. Thanks.

    Mike

    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="">




  • 4.  RE: R package fs build fails

    Posted Tue January 10, 2023 01:49 AM

    There seems to be a linking problem between fs & libuv. 
    You can download the fs source tarball, extract and make this change.

    # diff -u /fs/src/Makevars_orig /fs/src/Makevars
    --- /fs/src/Makevars_orig 2023-01-10 01:08:26.740503928 +0000
    +++ /fs/src/Makevars 2023-01-10 01:12:12.207048716 +0000
    @@ -2,7 +2,7 @@

    LIBUV := libuv-1.38.1

    -PKG_LIBS = ./$(LIBUV)/.libs/libuv.a -pthread
    +PKG_LIBS = -L./$(LIBUV)/.libs -luv -pthread

    SOURCES = $(wildcard *.cc unix/*.cc)
    OBJECTS = $(SOURCES:.cc=.o)

    Then you should be able to install fs using "R CMD INSTALL fs"



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



  • 5.  RE: R package fs build fails

    Posted Tue January 10, 2023 03:22 AM

    You can ignore the previous mentioned change.

    Below is the correct one. 

    # diff -u /fs/src/Makevars_orig /fs/src/Makevars
    --- /fs/src/Makevars_orig 2023-01-10 03:16:55.278511462 +0000
    +++ /fs/src/Makevars 2023-01-10 02:58:48.265419115 +0000
    @@ -11,6 +11,9 @@
    PKG_LIBS += -lkstat -lsendfile -lsocket -lxnet
    OBJECTS += bsd/setmode.o bsd/strmode.o bsd/reallocarray.o
    endif
    +ifeq ($(UNAME), AIX)
    +PKG_LIBS += -lperfstat
    +endif
    ifeq ($(UNAME), FreeBSD)
    PKG_LIBS += -lkvm
    endif
    @@ -29,7 +32,7 @@

    $(LIBUV)/Makefile:
    (cd $(LIBUV) \
    - && CC="$(CC)" CFLAGS="$(CFLAGS) $(CPPFLAGS) $(CPICFLAGS) $(C_VISIBILITY)" AR="$(AR)" RANLIB="$(RANLIB)" LDFLAGS="$(LDFLAGS)" ./configure --quiet)
    + && CC="$(CC)" CFLAGS="$(CFLAGS) $(CPPFLAGS) $(CPICFLAGS) $(C_VISIBILITY)" AR="$(AR)" RANLIB="$(RANLIB)" LDFLAGS="$(LDFLAGS)" ./configure --quiet --enable-shared=no)

    $(LIBUV)/.libs/libuv.a: $(LIBUV)/Makefile
    $(MAKE) --directory=$(LIBUV) \



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



  • 6.  RE: R package fs build fails

    Posted Tue January 10, 2023 01:35 PM
    This worked! 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="">




  • 7.  RE: R package fs build fails

    Posted Tue January 10, 2023 01:38 PM
    Could use some help on uuid now. Any thoughts on that one (see thread). 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="">