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.  Issue with mpfr when installing R packages

    Posted Mon February 10, 2020 03:37 PM

    Originally posted by: MM3S_VINCENT_DAVIS


    When installing R packages I regularly get the following error:

     

    # R CMD INSTALL Rcpp_0.12.19.tar.gz                 
    * installing to library '/opt/freeware/lib64/R/library'
    * installing *source* package 'Rcpp' ...
    ** package 'Rcpp' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    g++ -maix64 -std=gnu++11 -I"/opt/freeware/lib64/R/include" -DNDEBUG -I../inst/include/  -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM    -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM  -c Date.cpp -o Date.o
    exec(): 0509-036 Cannot load program /opt/freeware/libexec/gcc/powerpc-ibm-aix7.1.0.0/8.3.0/cc1plus because of the following errors:
            0509-150   Dependent module /opt/freeware/lib/libmpfr.a(libmpfr.so.6) could not be loaded.
            0509-152   Member libmpfr.so.6 is not found in archive
    make: *** [/opt/freeware/lib64/R/etc/Makeconf:176: Date.o] Error 1
    ERROR: compilation failed for package 'Rcpp'
    * removing '/opt/freeware/lib64/R/library/Rcpp'

     

    OR:

    gcc -Wl,-b64 -maix64 -I"/opt/freeware/lib64/R/include" -DNDEBUG   -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -mminimal-toc -fopenmp   -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM  -c assign.c -o assign.o
    exec(): 0509-036 Cannot load program /opt/freeware/libexec/gcc/powerpc-ibm-aix7.1.0.0/8.3.0/cc1 because of the following errors:
            0509-150   Dependent module /opt/freeware/lib64/libmpfr.a(libmpfr.so.6) could not be loaded.
            0509-103   The module has an invalid magic number.
    make: 1254-004 The error code from the last command is 1.

     

    I've tried different versions of MPFR that are on aix toolbox (3.1.2 and 4.0.2). I've tried different versions of gcc (7 & 8). I've tried gnu make. I'm just lost at this point. Any assistance would be helpful. Thanks.


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 2.  Re: Issue with mpfr when installing R packages

    Posted Mon February 10, 2020 05:31 PM

    Originally posted by: H0W2_tomasz_lacki


    The gcc-cpp-8.3.0-1.ppc + mpfr-4.0.2-1.ppc + libmpc-1.1.0-1.ppc shall work (they are the most recent versions for the AIX 7.1 you are using).

    Questions to the IBM AIX Toolbox team:

    1) Is the GCC 8.3.0-1 dependency on mpfr (mpfr >= 2.4.2) too low?
       The libmpfr.so.6 is provided by the mpfr-4.0.2-1.ppc but no by mpfr-3.1.2-3.ppc.
       
    2) Has the GCC 8.3 been built in the equal environment on the AIX71 vs AIX72.
       What is motivation on using different version of the libmpfr?

    AIX72:/opt/freeware/libexec/gcc/powerpc-ibm-aix7.2.0.0/8.3.0> dump -Hv cc1plus | grep libmpfr
    4                                    libmpfr.a           libmpfr.so.4
    AIX71:/opt/freeware/libexec/gcc/powerpc-ibm-aix7.1.0.0/8.3.0> dump -Hv cc1plus | grep libmpfr
    4                                    libmpfr.a           libmpfr.so.6

    3) Shall the ldd show only one version of the libmpfr.so needed for compiler invocation?

    AIX72:/opt/freeware/libexec/gcc/powerpc-ibm-aix7.2.0.0/8.3.0>  ldd cc1plus | grep libmpfr.a
    cc1plus needs:

             /opt/freeware/lib/libmpfr.a(libmpfr.so.4)

    AIX71:/opt/freeware/libexec/gcc/powerpc-ibm-aix7.1.0.0/8.3.0> ldd cc1plus | grep libmpfr.a
    cc1plus needs:
             /opt/freeware/lib/libmpfr.a(libmpfr.so.6)
             /opt/freeware/lib/libmpfr.a(libmpfr.so.4)

     


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 3.  Re: Issue with mpfr when installing R packages

    Posted Wed February 12, 2020 08:12 AM

    Originally posted by: AyappanP


    Thanks for reporting the issue. 

    There is an issue with the latest mpfr rpm ( 4.0.2). We will fix that issue.

    Meanwhile you can remove the file "/opt/freeware/lib64/libmpfr.a" and then R compilation should work. 

     

    @H0W2_tomasz_lacki

    And for the three questions

    1) This is a packaging issue. mpfr version should have been increased to 4.0.2 for gcc 8.3.0 ( for AIX 7.1 )

    2) mpfr is updated recently and we tend to use the latest libraries for the newer builds. gcc 8.3.0 build for AIX 7.2 is somewhat old and at that time mpfr was at the older level. 

    3) ldd tends to show the recursive dependencies. "dump -Hov " will show the proper dynamic linkings. 

        for AIX 7.1 gcc 8.3.0, it shows libmpfr.so.4 because libgmp.a links with this version. 


    #AIXOpenSource
    #AIX-Open-Source-Software


  • 4.  Re: Issue with mpfr when installing R packages

    Posted Wed February 12, 2020 09:51 AM

    Originally posted by: H0W2_tomasz_lacki


    3) I don't see ldd mistaken. The process loads both libraries:

    AIX71:/opt/freeware/libexec/gcc/powerpc-ibm-aix7.1.0.0/8.3.0> dbx cc1plus
    (dbx)  map
    Entry 2:
       Object name: /opt/freeware/lib/libmpfr.a
       Member name: libmpfr.so.4
    Entry 7:
       Object name: /opt/freeware/lib/libmpfr.a
       Member name: libmpfr.so.6

     


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 5.  Re: Issue with mpfr when installing R packages

    Posted Wed February 12, 2020 10:03 AM

    Originally posted by: AyappanP


    I am not telling ldd is mistaken. cc1plus loads both "libmpfr.so.4" & "libmpfr.so.6" . It loads libmpfr.so.4 because of other dependent libraries- libgmp & libmpc 


    #AIXOpenSource
    #AIX-Open-Source-Software


  • 6.  Re: Issue with mpfr when installing R packages

    Posted Wed February 12, 2020 10:59 AM

    Originally posted by: MM3S_VINCENT_DAVIS


    Removing "/opt/freeware/lib64/libmpfr.a" works! Thank you so much.


    #AIX-Open-Source-Software
    #AIXOpenSource