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
Expand all | Collapse all

problems with R, libiconv and gcc

  • 1.  problems with R, libiconv and gcc

    Posted Sun November 13, 2022 01:15 PM
    Hi,

    I've installed R and R-devel on one of our AIX 7.3 LPARs and now I'm hoping to install a basic set of R packages.  I'm getting a magic number error associated with libiconv and gcclib but everything is latest and all from Toolbox.  Is there a way to fix this?  Please see below.  Thanks.

    Mike

    > install.packages('colorspace',repos='cran.rstudio.com')
    trying URL 'cran.rstudio.com/src/contrib/colorspace_2.0-3.tar.gz'
    Content type 'application/x-gzip' length 2199185 bytes (2.1 MB)
    ==================================================
    downloaded 2.1 MB

    * installing *source* package 'colorspace' ...
    ** package 'colorspace' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    gcc -maix64 -pthread -fPIC -I"/opt/freeware/lib64/R/include" -DNDEBUG -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -mminimal-toc -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -c colorspace.c -o colorspace.o
    Could not load program gcc:
    Could not load module /opt/freeware/lib/libiconv.a(libiconv.so.2).
    Dependent module /opt/freeware/lib/pthread/ppc64/libgcc_s.a(shr.o) could not be loaded.
    The module has an invalid magic number.
    Could not load module gcc-10.
    Dependent module /opt/freeware/lib/libiconv.a(libiconv.so.2) could not be loaded.
    make: The error code from the last command is 255.

    [root@crilacs1 ~]# rpm -qa | grep -iE '(gcc|iconv)'
    libgcc-10-2.ppc
    gcc10-10.3.0-6.ppc
    gcc10-gfortran-10.3.0-6.ppc
    gcc-10-2.ppc
    libiconv-1.17-1.ppc
    libgcc10-10.3.0-6.ppc
    gcc10-cpp-10.3.0-6.ppc
    gcc-cpp-10-2.ppc
    gcc-gfortran-10-2.ppc



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

    #AIXOpenSource


  • 2.  RE: problems with R, libiconv and gcc

    Posted Mon November 14, 2022 02:24 AM
    Looks like gcc10 pthread library " /opt/freeware/lib/pthread/ppc64/libgcc_s.a " doesn't have 32bit shared object. We are looking into it. 

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



  • 3.  RE: problems with R, libiconv and gcc

    Posted Mon November 14, 2022 02:39 AM
    Hi Ayappan,

    Okay. When I installed R it seemed as though gcc10 kind of came with it. In other words it didn’t look like it was easily avoided. Thanks for looking into it. Please let me know when there’s a fix or workaround.

    Best,
    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: problems with R, libiconv and gcc

    Posted Wed November 16, 2022 10:40 AM
    Hello,

    Has there been any progress on this issue? Please advise. 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="">




  • 5.  RE: problems with R, libiconv and gcc

    Posted Thu November 17, 2022 08:03 AM
    Hi Mike,

    As an workaround please run the below steps.

    cd /opt/freeware/lib/gcc/powerpc-ibm-aix7.3.0.0/10/pthread
    ar -X32 xv libgcc_s.a
    ar -X32 -q ppc64/libgcc_s.a shr.o

    We will continue to work on permanent solution.

    ------------------------------
    SANGAMESH
    ------------------------------



  • 6.  RE: problems with R, libiconv and gcc

    Posted Thu November 17, 2022 10:19 AM
    Hi Sangamesh,

    Okay. I’ll give this a try. 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="">




  • 7.  RE: problems with R, libiconv and gcc

    Posted Thu November 17, 2022 05:00 PM
    Hi Sangamesh,

    I gave that a try and the package compiles but it throws a lot of duplicate symbol warnings which makes me wonder if this is a good path to go down. Please see below and advise. Thanks.

    Mike

    [root@crilacs1 ~]# R

    R version 4.1.2 (2021-11-01) -- "Bird Hippie"
    Copyright (C) 2021 The R Foundation for Statistical Computing
    Platform: powerpc-ibm-aix7.1.3.0 (64-bit)

    R is free software and comes with ABSOLUTELY NO WARRANTY.
    You are welcome to redistribute it under certain conditions.
    Type 'license()' or 'licence()' for distribution details.

    R is a collaborative project with many contributors.
    Type 'contributors()' for more information and
    'citation()' on how to cite R or R packages in publications.

    Type 'demo()' for some demos, 'help()' for on-line help, or
    'help.start()' for an HTML browser interface to help.
    Type 'q()' to quit R.

    > install.packages('colorspace',repos='cran.rstudio.com<http: cran.rstudio.com="">')
    trying URL 'cran.rstudio.com/src/contrib/colorspace_2.0-3.tar.gz<http: cran.rstudio.com/src/contrib/colorspace_2.0-3.tar.gz="">'
    Content type 'application/x-gzip' length 2199185 bytes (2.1 MB)
    ==================================================
    downloaded 2.1 MB

    * installing *source* package ‘colorspace’ ...
    ** package ‘colorspace’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    gcc -maix64 -pthread -fPIC -I"/opt/freeware/lib64/R/include" -DNDEBUG -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -mminimal-toc -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -c colorspace.c -o colorspace.o
    gcc -maix64 -pthread -fPIC -I"/opt/freeware/lib64/R/include" -DNDEBUG -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -mminimal-toc -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -c init.c -o init.o
    gcc -maix64 -pthread -fPIC -shared -Wl,-brtl -Wl,-G -Wl,-bexpall -Wl,-bnoentry -lc -L/opt/freeware/lib64/R/lib -L/opt/freeware/lib/pthread/ppc64 -L/opt/freeware/lib64 -L/opt/freeware/lib -L/usr/lib -Wl,-blibpath:/opt/freeware/lib/pthread/ppc64:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib -o colorspace.so colorspace.o init.o -lm -L/opt/freeware/lib64/R/lib -lR /opt/freeware/lib64/libintl.a
    ld: 0711-224 WARNING: Duplicate symbol: .strcmp
    ld: 0711-224 WARNING: Duplicate symbol: strcmp
    ld: 0711-224 WARNING: Duplicate symbol: .pow
    ld: 0711-224 WARNING: Duplicate symbol: pow
    ld: 0711-224 WARNING: Duplicate symbol: .fsav
    ld: 0711-224 WARNING: Duplicate symbol: fsav
    ld: 0711-224 WARNING: Duplicate symbol: .fres
    ld: 0711-224 WARNING: Duplicate symbol: fres
    ld: 0711-224 WARNING: Duplicate symbol: .cexp
    ld: 0711-224 WARNING: Duplicate symbol: cexp
    ld: 0711-224 WARNING: Duplicate symbol: .ctanh
    ld: 0711-224 WARNING: Duplicate symbol: .ctan
    ld: 0711-224 WARNING: Duplicate symbol: .csqrt
    ld: 0711-224 WARNING: Duplicate symbol: .csinh
    ld: 0711-224 WARNING: Duplicate symbol: .csin
    ld: 0711-224 WARNING: Duplicate symbol: .ccosh
    ld: 0711-224 WARNING: Duplicate symbol: .ccos
    ld: 0711-224 WARNING: Duplicate symbol: .catan
    ld: 0711-224 WARNING: Duplicate symbol: .casin
    ld: 0711-224 WARNING: Duplicate symbol: .cacos
    ld: 0711-224 WARNING: Duplicate symbol: .finite
    ld: 0711-224 WARNING: Duplicate symbol: finite
    ld: 0711-224 WARNING: Duplicate symbol: .sin
    ld: 0711-224 WARNING: Duplicate symbol: sin
    ld: 0711-224 WARNING: Duplicate symbol: .cos
    ld: 0711-224 WARNING: Duplicate symbol: cos
    ld: 0711-224 WARNING: Duplicate symbol: .sinh
    ld: 0711-224 WARNING: Duplicate symbol: sinh
    ld: 0711-224 WARNING: Duplicate symbol: .expm1
    ld: 0711-224 WARNING: Duplicate symbol: expm1
    ld: 0711-224 WARNING: Duplicate symbol: .scalb
    ld: 0711-224 WARNING: Duplicate symbol: scalb
    ld: 0711-224 WARNING: Duplicate symbol: .scalbn
    ld: 0711-224 WARNING: Duplicate symbol: .cosh
    ld: 0711-224 WARNING: Duplicate symbol: cosh
    ld: 0711-224 WARNING: Duplicate symbol: .exp
    ld: 0711-224 WARNING: Duplicate symbol: exp
    ld: 0711-224 WARNING: Duplicate symbol: .exp__E
    ld: 0711-224 WARNING: Duplicate symbol: exp__E
    ld: 0711-224 WARNING: Duplicate symbol: .raise_ie
    ld: 0711-224 WARNING: Duplicate symbol: raise_ie
    ld: 0711-224 WARNING: Duplicate symbol: .logb
    ld: 0711-224 WARNING: Duplicate symbol: logb
    ld: 0711-224 WARNING: Duplicate symbol: .log
    ld: 0711-224 WARNING: Duplicate symbol: log
    ld: 0711-224 WARNING: Duplicate symbol: .log1p
    ld: 0711-224 WARNING: Duplicate symbol: log1p
    ld: 0711-224 WARNING: Duplicate symbol: .atan
    ld: 0711-224 WARNING: Duplicate symbol: atan
    ld: 0711-224 WARNING: Duplicate symbol: tantab
    ld: 0711-224 WARNING: Duplicate symbol: .atan2
    ld: 0711-224 WARNING: Duplicate symbol: atan2
    ld: 0711-224 WARNING: Duplicate symbol: .atanh
    ld: 0711-224 WARNING: Duplicate symbol: atanh
    ld: 0711-224 WARNING: Duplicate symbol: .asin
    ld: 0711-224 WARNING: Duplicate symbol: asin
    ld: 0711-224 WARNING: Duplicate symbol: .asinh
    ld: 0711-224 WARNING: Duplicate symbol: asinh
    ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
    Target "all" is up to date.
    installing to /opt/freeware/lib64/R/library/00LOCK-colorspace/00new/colorspace/libs
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** demo
    ** 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 from temporary location
    ** testing if installed package can be loaded from final location
    ** testing if installed package keeps a record of temporary installation path
    * DONE (colorspace)

    The downloaded source packages are in
    ‘/tmp/RtmpUvaqia/downloaded_packages’
    Updating HTML index of packages in '.Library'
    Making 'packages.html' ... done
    >


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

    On Nov 17, 2022, at 7:19 AM, Metts, Michael < /><mailto:mmetts@cornerstone.com>> wrote:

    Hi Sangamesh,

    Okay. I’ll give this a try. 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/="">




  • 8.  RE: problems with R, libiconv and gcc

    Posted Fri November 18, 2022 03:10 AM
    Hi Mike,

    You can ignore these errors.
    While creating a shared object it's using bexpall and -lc ,-lm and -lR. With bexpall it will try to export all the libc, libm symbols coming from static .o files.
    Since libR is also exporting symbols from libc & libm it's throwing an warning in this case.

    ------------------------------
    SANGAMESH
    ------------------------------



  • 9.  RE: problems with R, libiconv and gcc

    Posted Fri November 18, 2022 10:26 AM
    Hi Sangamesh,

    I understand what you’re saying but I’m wondering whether it’s always going to throw this many warnings on every R package build. That seems problematic in my view. I guess I’m hoping that we can use R on AIX much as we do on Linux. If that’s unreasonable someone just tell me now. In other words, it’s not okay for it to spew 50 or 100 times the number of warnings when building on AIX than it otherwise would on Linux and then just call that “normal”. Right? Is it reasonable to ask that this to be fixed? Please advise. 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="">




  • 10.  RE: problems with R, libiconv and gcc

    Posted Mon November 21, 2022 06:40 AM
    R uses "-bexpall" linker option in AIX to simplify the build process. With the libc.a & libm.a having static objects, the -bexpall option ended up re-exporting some of the symbols in the R library (libR.so). So when the R modules are compiled , during the linkage with libc, libm and libR , the linker finds the duplicate symbols and throws these warnings. 
    We understand that these warnings are a menace and we will work on fixing the R build by removing the "-bexpall" option.

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



  • 11.  RE: problems with R, libiconv and gcc

    Posted Mon November 21, 2022 10:15 AM
    Great. Thanks so much! Any idea when that and the original issue will be fixed?

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




  • 12.  RE: problems with R, libiconv and gcc

    Posted Tue November 22, 2022 08:15 AM
    gcc can be easily fixed and re-published soon, perhaps next week.
    But rebuilding R without "-bexpall" requires some effort. It might require couple of weeks.

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



  • 13.  RE: problems with R, libiconv and gcc

    Posted Fri December 23, 2022 09:14 AM
    R-4.1.2-2 is now available in AIX Toolbox with the issues fixed.

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



  • 14.  RE: problems with R, libiconv and gcc

    Posted Fri December 23, 2022 10:28 AM
    Great. 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="">




  • 15.  RE: problems with R, libiconv and gcc

    Posted Mon December 26, 2022 02:01 AM
    Hi Ayappan,

    When I run `dnf check-update` I don’t see an update for R consistent with R-4.1.2-2 being available. I have R-4.1.2-1 installed. Is there something I should do differently? Please advise. 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="">




  • 16.  RE: problems with R, libiconv and gcc

    Posted Mon December 26, 2022 05:38 AM
    We have updated the repository now, so you can try it again.

    ------------------------------
    RESHMA KUMAR
    ------------------------------



  • 17.  RE: problems with R, libiconv and gcc

    Posted Mon December 26, 2022 11:20 AM
    Hi Reshma,

    Yes. I see them there now. 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="">




  • 18.  RE: problems with R, libiconv and gcc

    Posted Mon December 26, 2022 03:02 PM
    I am getting the below error message when trying to build the CRAN package `stringi` . Does anyone have thoughts on how to fix or avoid this? Please advise. Thanks.

    cu69/i18n/ztrans.o icu69/stubdata/stubdata.o -lm -L/opt/freeware/lib64/R/lib -lR /opt/freeware/lib64/libintl.a
    ld: 0711-781 ERROR: TOC overflow. TOC size: 108984 Maximum size: 65536
    collect2: error: ld returned 12 exit status
    make: The error code from the last command is 1.

    Stop.
    ERROR: compilation failed for package ‘stringi’
    * removing ‘/opt/freeware/lib64/R/library/stringi’


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

    On Dec 26, 2022, at 8:19 AM, Metts, Michael < /><mailto:mmetts@cornerstone.com>> wrote:

    Hi Reshma,

    Yes. I see them there now. 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/="">




  • 19.  RE: problems with R, libiconv and gcc

    Posted Mon December 26, 2022 03:29 PM
    Okay, I created this file:

    [root@crilacs1 ~]# cat .R/Makevars
    LDFLAGS += -Wl,-bbigtoc

    Then I attempted to build `broom` again which depends on `stringi` and it worked. If there are other things like this that you know if please let me know. In other words, if there are things you haven’t told me about making sure I have a viable R package build environment, please let me know what those things are. My goal is to have a reasonably function R installation on one of our AIX 7.3 machines. In my view, that doesn’t seem unreasonable. 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="">

    On Dec 26, 2022, at 12:02 PM, Metts, Michael < /><mailto:mmetts@cornerstone.com>> wrote:

    I am getting the below error message when trying to build the CRAN package `stringi` . Does anyone have thoughts on how to fix or avoid this? Please advise. Thanks.

    cu69/i18n/ztrans.o icu69/stubdata/stubdata.o -lm -L/opt/freeware/lib64/R/lib -lR /opt/freeware/lib64/libintl.a
    ld: 0711-781 ERROR: TOC overflow. TOC size: 108984 Maximum size: 65536
    collect2: error: ld returned 12 exit status
    make: The error code from the last command is 1.

    Stop.
    ERROR: compilation failed for package ‘stringi’
    * removing ‘/opt/freeware/lib64/R/library/stringi’


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

    On Dec 26, 2022, at 8:19 AM, Metts, Michael < /><mailto:mmetts@cornerstone.com>> wrote:

    Hi Reshma,

    Yes. I see them there now. 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/="">