-
Notifications
You must be signed in to change notification settings - Fork 0
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 fails due to compiler flags #1
Comments
Hi Jonathan, thanks for posting the first issue for this package! I agree it seems like your flags are not getting overridden, but unfortunately I haven't been able to reproduce this on my own setup. I'm not sure whether the right thing to do would be to incorporate your changes to Do you know whether you need both of Thanks, Nick |
I'll run some tests to see which flags are necessary (at least on my system). I figured having the issue here could be of help to someone in the same boat. I will also try running a matrix of linux jobs on rhub to see if I can trigger the issue elsewhere. I notice that CRAN only tested fedora. Great package, by the way - with really nice vignettes. I'm curating this week's RWeekly and want to bring some attention to this package. |
Thank you so much! I'm very much willing to add the required flags to |
Hi Jonathan, Do you have any update? I can't replicate this on my machine when using your custom CFLAGS, so I need your help to resolve this. I think I have come up with a new idea that might resolve this in a more general way, and if it works I would only need you to do one test for me. Could you try compiling the package with My thinking is that other users could well have other Thanks Nick |
Sorry - I got distracted. Just now I removed the installed package and confirmed that rebuilding failed. I tried As a reproduction of this, I tried in docker and can indeed reproduce it using the rocker/r-base (ubuntu) image $ docker run -it rocker/r-base
[...]
R> install.packages("luajr")
==== Building LuaJIT 2.1 (amalgamation) ====
make -C src amalg
make[2]: Entering directory '/tmp/Rtmp2KdHFX/R.INSTALL1a2b404e7a/luajr/src/luajit/src'
cc1: error: ‘-Wformat-security’ ignored without ‘-Wformat’ [-Werror=format-security]
cc1: some warnings being treated as errors
make all "LJCORE_O=ljamalg.o"
make[3]: Entering directory '/tmp/Rtmp2KdHFX/R.INSTALL1a2b404e7a/luajr/src/luajit/src'
cc1: error: ‘-Wformat-security’ ignored without ‘-Wformat’ [-Werror=format-security]
cc1: some warnings being treated as errors
HOSTCC host/minilua.o
cc1: error: ‘-Wformat-security’ ignored without ‘-Wformat’ [-Werror=format-security]
cc1: some warnings being treated as errors
make[3]: *** [Makefile:719: host/minilua.o] Error 1
make[3]: Leaving directory '/tmp/Rtmp2KdHFX/R.INSTALL1a2b404e7a/luajr/src/luajit/src'
make[2]: *** [Makefile:623: amalg] Error 2
make[2]: Leaving directory '/tmp/Rtmp2KdHFX/R.INSTALL1a2b404e7a/luajr/src/luajit/src'
make[1]: *** [Makefile:165: amalg] Error 2
make[1]: Leaving directory '/tmp/Rtmp2KdHFX/R.INSTALL1a2b404e7a/luajr/src/luajit'
make: *** [Makevars:19: luajit/src/libluajit.a] Error 2
ERROR: compilation failed for package ‘luajr’
* removing ‘/usr/local/lib/R/site-library/luajr’ These flags are a bit beyond my knowledge, but I threw the problem at ChatGPT and it suggests setting
which I can confirm does work, and presumably doesn't disable any of the error checking. In fact, just setting I can't check that in the R session of the docker image because the package sets its own flags, but one could drop to a shell and rebuild there for testing. It's interesting that your GH Actions doesn't complain - I'm not sure what the difference is - perhaps the setup for that action doesn't set the same default compiler flags. |
Thanks Jon! With the help of your notes, I can now reproduce the error using Docker. I'll see what I can do from here. I disabled the warnings in the first place because (1) the warnings otherwise generated during the build of the embedded Thanks Nick |
OK! Removing It's possible that this change will reintroduce some obscure CRAN check issue that I can't reproduce myself, but I guess I'll find out when I update the package. Either way, I'll update here. Thanks for your help! I have acknowledged your contribution in |
Do you mean removing Ah - looking at the commits, 9cd58b1 probably fixed the issue because it "reset" the flag, and removing that entirely should be equivalent, so I'd say go with not messing with Thanks for the mention in NEWS - that looks great. I'll keep playing around and see if there's any way I can usefully contribute. Do you have any plans for future improvements? |
Yes, that's what I meant — first I tried replacing it with
The main one specifically for this package is that I'd like to have a similar mechanism to "Arg codes" in luajr is how this is currently implemented, but the specific details of this are probably not as good as they can be. Do you have any ideas? |
Thinking of the other cross-language examples I know...
It's a shame there's no CRAN Task View for language interop. I'll play around with this and see if I get anything interesting working. |
Well, e-mail me first, as I have my own plans :) |
This is odd, because I can see that there are no CRAN check fails, so presumably my own system has some peculiarity.
I get the same errors trying with
remotes::install_github("nicholasdavies/luajr")
and if I clone the repo and try to build manually.My global
~/.R/Makevars
is empty, but my$R_HOME/etc/Makeconf
does contain-Wformat -Werror=format-security
and perhaps this isn't superseded during compilation of this package.I'm running Pop!_OS but it's almost Ubuntu
and have GNU Make
I did manage to get the package to build by changing the following line
luajr/src/Makevars.in
Line 20 in 7bd27ed
replacing
-Wformat=0
with-Wno-format -Wno-format-security
, and this then builds successfully and runs greatCreated on 2024-02-24 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: