[R-pkg-devel] R_MAKEVARS_USER fail to pass down to sub-makes?

Jan Gorecki j@goreck| @end|ng |rom w|t@edu@p|
Mon Jun 1 20:35:55 CEST 2020


What is the problem exactly? variable name is hardcoded, and variable
value is hardcoded as well.
How it is possible for the second `system` call to deliver different
makevars file than the first one?
This is the problem in question.

Yes, I haven't thought about Windows. I should have mentioned I am on Linux.

On Mon, Jun 1, 2020 at 7:20 PM Jeff Newmiller <jdnewmil using dcn.davis.ca.us> wrote:
>
> Each call to system is independent, so it definitely is a problem.
>
> Use Sys.setenv to make changes in environment variables that can be used within system calls.
>
> Bash is not involved with the system call on Windows... so your syntax for setting an environment variable is not portable.
>
> On June 1, 2020 11:10:41 AM PDT, Jan Gorecki <j.gorecki using wit.edu.pl> wrote:
> >Thank you Jeff for your comments.
> >Yet they does not seem to be related.
> >a) Environment variable is created inside `system` command, so env var
> >stays valid for the command. Which is confirmed in the first call that
> >properly shows CFLAGS.
> >b) Syntax passed checkbashisms so I expect no problems due to that.
> >
> >On Mon, Jun 1, 2020 at 4:03 PM Jeff Newmiller
> ><jdnewmil using dcn.davis.ca.us> wrote:
> >>
> >> I don't know anything about the function of that environment
> >variable, but
> >>
> >> a) system() invokes a child process so environment variable changes
> >made using it will only affect the child process created by that system
> >call.
> >>
> >> b) The syntax you have used is shell-specific, so does not look
> >portable.
> >>
> >> On June 1, 2020 4:58:19 AM PDT, Jan Gorecki <j.gorecki using wit.edu.pl>
> >wrote:
> >> >Hi package devel support,
> >> >
> >> >I am trying to use R_MAKEVARS_USER to customize build, rather than
> >> >.R/Makevars. It is properly displayed from config CFLAGS but during
> >> >package install it doesn't seem to work.
> >> >
> >> >In R-admin in "6.3.3 Customizing package compilation" there is:
> >> >
> >> >> Note that these mechanisms do not work with packages which fail to
> >> >pass settings down to sub-makes, perhaps reading etc/Makeconf in
> >> >makefiles in subdirectories.
> >> >
> >> >It seems that it applies to me. How should I debug that? to make
> >this
> >> >env var respected? Note that my pkg has src/Makevars to handle
> >openmp
> >> >switch nicely
> >> >Thank you
> >> >
> >> >system("R_MAKEVARS_USER=library/gcc/O3/Makevars R CMD config
> >CFLAGS")
> >> >-O3
> >> >
> >> >system("R_MAKEVARS_USER=library/gcc/O3/Makevars R CMD INSTALL
> >> >--library=library/gcc/O3 mypkg_1.0.0.tar.gz")
> >> >* installing *source* package 'mypkg' ...
> >> >** using staged installation
> >> >** libs
> >> >gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG    -fopenmp -fpic
> >-g
> >> >-O2 -fdebug-prefix-map=/build/r-base-V28x5H/r-base-3.6.3=.
> >> >-fstack-protector-strong -Wformat -Werror=format-security
> >-Wdate-time
> >> >-D_FORTIFY_SOURCE=2 -g  -c assign.c -o assign.o
> >> >
> >> >______________________________________________
> >> >R-package-devel using r-project.org mailing list
> >> >https://stat.ethz.ch/mailman/listinfo/r-package-devel
> >>
> >> --
> >> Sent from my phone. Please excuse my brevity.
>
> --
> Sent from my phone. Please excuse my brevity.



More information about the R-package-devel mailing list