Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation problem for release 2.0.9 and 2.1.0 on Ubuntu 18 #99

Closed
vincentvanhees opened this issue Feb 6, 2024 · 17 comments
Closed
Assignees
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@vincentvanhees
Copy link

vincentvanhees commented Feb 6, 2024

Describe the bug

I am not able to install the two most recent Rfast versions (2.0.9 and 2.1.0) on Ubuntu 18.04.6 LTS (bionic):

> remotes::install_github("RfastOfficial/Rfast")
Downloading GitHub repo RfastOfficial/Rfast@HEAD
── R CMD build ────────────────────────────────────────────────────────────
✔  checking for file ‘/tmp/Rtmp6iAUnp/remotes5c571d31599d/RfastOfficial-Rfast-00f3d0f/DESCRIPTION’ ...
─  preparing ‘Rfast’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  installing the package to process help pages
         -----------------------------------
─  installing *source* package ‘Rfast’ ...
   ** using staged installation
   ** libs
   using C compiler: ‘gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0’
   using C++ compiler: ‘g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0’
   using C++17
   g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -I../inst/include -I'/home/vincent/R/x86_64-pc-linux-gnu-brary/4.3/Rcpp/include' -I'/home/vincent/R/x86_64-pc-linux-gnu-library/4.3/RcppArmadillo/include' -/home/vincent/R/x86_64-pc-linux-gnu-library/4.3/RcppParallel/include'    -fopenmp -fpic  -g -O2 -fdebug-prefix-p=/build/r-base-E8saoI/r-base-4.3.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -FORTIFY_SOURCE=2  -Wall -pedantic -fdiagnostics-color=always -c Coeff.cpp -o Coeff.o
   In file included from ../inst/include/Rfast/templates.h:10:0
                    from ../inst/include/Rfast/matrix.hpp:14
                    from ../inst/include/Rfast.h:5
                    from mn.h:4
                    from Coeff.cpp:4
   ../inst/include/Rfast/parallel.h:20:10:fatal error: tion: No such file or directory
    #include <execution>
             ^~~~~~~~~~~
   compilation terminated.
   /usr/lib/R/etc/Makeconf:200: recipe for target 'Coeff.o' failed
   make: *** [Coeff.o] Error 1
   ERROR: compilation failed for package ‘Rfast’
─  removing ‘/tmp/RtmpHL0acr/Rinst6fb91edd9314/Rfast’
         -----------------------------------
   ERROR: package installation failed
Error: Failed to install 'Rfast' from GitHub:
  ! System command 'R' failed

I get the same error when installing from CRAN via install.packages().

However, I managed to successfully install:

  • The older Rfast 2.0.8 on the above mentioned Ubuntu 18.
  • The latest Rfast 2.1.0 on Ubuntu 22.

Could it be that the latest releases have a new dependency that is not automatically installed on Ubuntu 18 which I missed? or should I conclude that Ubuntu 18 is no longer supported by Rfast or its dependencies?

To Reproduce

I hope the description above is enough to reproduce the issue.

Expected behavior

Successful installation

Desktop (please complete the following information):
 - OS: Ubuntu 18.04.6 LTS (bionic)
 - R-Version 4.3.2
 - Rfast-Version 2.1.0
 - GCC-Version gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0

Additional context
none

@vincentvanhees vincentvanhees added the bug Something isn't working label Feb 6, 2024
@leahfa
Copy link

leahfa commented Feb 12, 2024

Hi
I have same issue on opensuse LEAP 15.4, R version 4.1.2
Tried newer compilers (up to gcc-++13 ), no effect. For me teh older version (2.0.8) is not installing either.

@VincentGardeux
Copy link

Same here with RHEL 8, R v.4.3.1

@ManosPapadakis95
Copy link
Contributor

It seems that nobody has update it's system. Do it! the newer gcc has incredible optimizations from execution time to compilation size.

@VincentGardeux
Copy link

VincentGardeux commented Feb 27, 2024

Just did a yum update and it did not change anything.

Of note, the latest default system gcc in RHEL8 is the following:
g++ (GCC) 8.5.0 20210514 (Red Hat 8.5.0-20)

I guess I could upgrade gcc from source, but from @leahfa's comment this does not change anything?

@vincentvanhees
Copy link
Author

@ManosPapadakis95 this is not about my own operating system. This is about whether or not as maintainer of a package depending on Rfast I can continue to facilitate backward compatibility for my package with these older Ubuntu/gcc versions. So, this affects all users of the package and not just me.

Further, this is not only about people's personal laptop but also about what is installed on computing clusters and servers, things that can be hard to control for a user and for that reason some level of backward compatibility is helpful.

However, it is understandable that backward compatibility cannot be preserved forever and we are talking here about fairly old stuff. So, my post is mainly intended to better understand whether I should consider these gcc/Ubuntu versions as no longer supported.

@ManosPapadakis95
Copy link
Contributor

I understand what you mean. Each new version of Rfast fixes bugs and optimize code from the previous ones. So no, there is not a backward compatibillity for Rfast and of course this affects everyone. It is a great idea to to do it but I am alone. I support this package alone and its core is huge. Rfast is always checked to work with CRAN's supported operating systems. I cannot check for any system that exist out there. Also I don't know what to answer about all these different operating systems. If anyone knows how to fix it I will gladly accept his help.
I suggest everyone to upgrade its system even if it is a person or some company. The old C++ must go and this includes compiler and old techniques. This is my opinion of course.

@ManosPapadakis95 ManosPapadakis95 self-assigned this Feb 27, 2024
@ManosPapadakis95 ManosPapadakis95 added the duplicate This issue or pull request already exists label Feb 27, 2024
@ManosPapadakis95
Copy link
Contributor

closed as duplicate to #92

@leahfa
Copy link

leahfa commented Feb 28, 2024

Just did a yum update and it did not change anything.

Of note, the latest default system gcc in RHEL8 is the following: g++ (GCC) 8.5.0 20210514 (Red Hat 8.5.0-20)

I guess I could upgrade gcc from source, but from @leahfa's comment this does not change anything?

@VincentGardeux - After updating my compilers to gcc13/gcc++13, and properly configuring R session to use these compilers (below) -I did manage to install older Rfast versions (up to 2.0.8).
Puzzled as to why 2.0.9 and higher still fails, as I think gcc13 is the latest major release. I preferred to set the gcc compiler version within R and not systemwide, so am wondering if possibly I am still missing some gcc config variable (pasting the ones I set below). But bottom line - 2.0.8 is working perfectly for me (only needed it as a dependency), so I am happy! Thank you, ManosPapadakis95, for all your work here, and @vincentvanhees - as a maintainer, maybe the key is to allow, if possible, backward compatibility with old package versions - this 2.0.8 was a life saver for me.

** Flags set to configure R session **
Sys.setenv(
CC = "gcc-13",
CXX = "g++-13",
CXX1X = "-std=c++17",
PKG_CXXFLAGS = "-std=c++17"
)

@VincentGardeux
Copy link

Hi @leahfa and thank you for your comment.

I was probably unclear with my message, but I could install Rfast 2.0.8 as well without issue (did not even need to add specific flags, or update gcc, it worked with the default system config). This actually matches with the title of this issue, which states that the problem is only related to the latest versions (after version 2.0.8).

It's only the latest versions that did not work with the default RHEL8 gcc:

gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-20)
g++ (GCC) 8.5.0 20210514 (Red Hat 8.5.0-20)

However, I installed the gcc-toolset-13 package with yum:

yum install gcc-toolset-13 gcc-toolset-13-gcc-13.1.1

Which creates two new gcc / g++ compilers in /opt/rh/gcc-toolset-13/ (at least on my RHEL8 system). And thus do not update the default system gcc/g++
I can activate it using

source scl_source enable gcc-toolset-13

And, when I compile Rfast from R using install.packages("Rfast"), it now works.

* installing *source* package ‘Rfast’ ...
** package ‘Rfast’ successfully unpacked and MD5 sums checked
** libs
using C compiler: ‘gcc (GCC) 13.1.1 20230614 (Red Hat 13.1.1-4)’
using C++ compiler: ‘g++ (GCC) 13.1.1 20230614 (Red Hat 13.1.1-4)’
using C++17

So it seems that the issue was indeed coming from the gcc/g++ version, as suggested by @ManosPapadakis95
This solution has the advantage of not messing up with the default system gcc/g++ versions.

Hope this helps

@leahfa
Copy link

leahfa commented Feb 29, 2024 via email

@VincentGardeux
Copy link

Hi @leahfa,

Your error seems exactly the same as the one I had with gcc/g++ 8.5.0 but disappeared with gcc/g++ 13.1.1

Could you share the very beginning of the installation output?
Like

* installing *source* package ‘Rfast’ ...
** package ‘Rfast’ successfully unpacked and MD5 sums checked
** libs
using C compiler: ‘gcc (GCC) 13.1.1 20230614 (Red Hat 13.1.1-4)’
using C++ compiler: ‘g++ (GCC) 13.1.1 20230614 (Red Hat 13.1.1-4)’
using C++17

Just to see which version of gcc/g++ is used by the installation procedure?

Thanks

@leahfa
Copy link

leahfa commented Feb 29, 2024

Hey, i dont know how you get it to print out the compiler version! Its one of my frustrations that I cant (maybe depends on OS) . However can verify my flags are pointing to correct location, and other packages that had been giving me compilation issues do get installed now:

Sys.getenv("CC")
[1] "/usr/bin/gcc-13"
Sys.getenv("CXX")
[1] "/usr/bin/g++-13

Pasting below the full output from install.packages ( after setting Sys.setenv(VERBOSE = "1"), which is as verbal as i know of) .
BiocManager install or repos provide same output.

Full output from installation attempts

install.packages("Rfast", type="source")
Installing package into ‘/home/leah/R/x86_64-suse-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/Rfast_2.1.0.tar.gz'
Content type 'application/x-gzip' length 331500 bytes (323 KB)
==================================================
downloaded 323 KB

  • installing source package ‘Rfast’ ...
    ** package ‘Rfast’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    g++ -std=gnu++17 -I"/usr/lib64/R/include" -DNDEBUG -I../inst/include -I'/home/leah/R/x86_64-suse-linux-gnu-library/4.1/Rcpp/include' -I'/home/leah/R/x86_64-suse-linux-gnu-library/4.1/RcppArmadillo/include' -I'/home/leah/R/x8
    6_64-suse-linux-gnu-library/4.1/RcppParallel/include' -I/usr/local/include -fopenmp -fpic -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwin
    d-tables -fstack-clash-protection -g -c Coeff.cpp -o Coeff.o
    In file included from ../inst/include/Rfast/templates.h:10:0,
    from ../inst/include/Rfast/matrix.hpp:14,
    from ../inst/include/Rfast.h:5,
    from mn.h:4,
    from Coeff.cpp:4:
    ../inst/include/Rfast/parallel.h:20:10: fatal error: execution: No such file or directory
    #include
    ^~~~~~~~~~~
    compilation terminated.
    make: *** [/usr/lib64/R/etc/Makeconf:177: Coeff.o] Error 1
    ERROR: compilation failed for package ‘Rfast’
  • removing ‘/home/leah/R/x86_64-suse-linux-gnu-library/4.1/Rfast’
  • restoring previous ‘/home/leah/R/x86_64-suse-linux-gnu-library/4.1/Rfast’

The downloaded source packages are in
‘/tmp/RtmpxfRGYL/downloaded_packages’
Warning message:
In install.packages("Rfast", type = "source") :
installation of package ‘Rfast’ had non-zero exit status

@VincentGardeux
Copy link

VincentGardeux commented Feb 29, 2024

Hi @leahfa
Ha sorry, it's printing on my R output, I thought it was the default behaviour, but apparently not, since you don't have it.

Maybe you could try running this from R:

system("gcc --version")
system("g++ --version")

Just before running the install.packages() function. To see which gcc/g++ versions are currently used?

[Edit] I think that running install.packages() from within R makes it that it's not using the Sys.getenv("CXX") information?

@leahfa
Copy link

leahfa commented Feb 29, 2024 via email

@VincentGardeux
Copy link

Yep indeed...

It's because it seems to run g++ -std=gnu++17 and thus not your g++13 version

Changing the .R/Makevars file could maybe fix it. Just another option.

Good luck!

@leahfa
Copy link

leahfa commented Feb 29, 2024

uh-uh, pretty sure the g++ -std=gnu++17 is NOT version number (I dont even think there is one that high), it refers to some standard of C++ language, quote chatgpt (as I am no computer scientist :-) ) - "the GNU dialect of the C++17 standard"

@VincentGardeux
Copy link

I meant the CXX you defined is "/usr/bin/g++-13" if I understand correctly?
But the compiler is apparently using the g++ command, not g++-13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants