Doing dry-run gives: [zhupy@cedar1 src]$ R CMD SHLIB --dry-run closure.cpp
[mii] *Please select a module to run *R*:* * MODULE PARENT(S)* 1 r/4.4.0 StdEnv/2023 2 r/4.3.1 StdEnv/2023 3 r/4.3.1 StdEnv/2020 4 r/4.2.2 StdEnv/2020 5 r/4.2.1 StdEnv/2020 6 r/4.1.2 StdEnv/2020 7 r/4.1.0 StdEnv/2020 8 r/4.0.5 StdEnv/2020 9 r/4.0.2 StdEnv/2020 10 r/4.0.0 StdEnv/2020 11 sagemath/9.3 StdEnv/2020 Make a selection (1-11, q aborts) [1]: 1 [mii] loading StdEnv/2023 r/4.4.0 ... make cmd is make -f 'Makevars' -f '/cvmfs/ soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/r/4.4.0/lib64/R/etc/Makeconf' -f '/cvmfs/ soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/r/4.4.0/lib64/R/share/make/shlib.mk' SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB='closure.so' OBJECTS='closure.o' make would use g++ -std=gnu++17 -I"/cvmfs/ soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/r/4.4.0/lib64/R/include" -DNDEBUG -I/cvmfs/ soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Core/java/17.0.6/include -I/cvmfs/ soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Core/flexiblascore/3.3.1/include -I/cvmfs/ soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Core/flexiblascore/3.3.1/include/flexiblas -O3 -fpic -O2 -ftree-vectorize -march=x86-64-v3 -fno-math-errno -c closure.cpp -o closure.o if test "zclosure.o" != "z"; then \ echo g++ -std=gnu++17 -shared -L"/cvmfs/ soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/r/4.4.0/lib64/R/lib " -o closure.so closure.o -L"/cvmfs/ soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/r/4.4.0/lib64/R/lib" -lR; \ g++ -std=gnu++17 -shared -L"/cvmfs/ soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/r/4.4.0/lib64/R/lib " -o closure.so closure.o -L"/cvmfs/ soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/r/4.4.0/lib64/R/lib" -lR; \ fi On Wed, May 21, 2025 at 6:59 PM Peiyuan Zhu <garyzh...@gmail.com> wrote: > Unfortunately this still doesn't work. > > > devtools::install("/home/zhupy/projects/def-kwalley/zhupy/dst-1") > > ── R CMD build > ───────────────────────────────────────────────────────────────── > > ✔ checking for file ‘/project/6046455/zhupy/dst-1/DESCRIPTION’ (847ms) > > ─ preparing ‘dst’: (17.8s) > > ✔ checking DESCRIPTION meta-information ... > > ─ cleaning src > > ─ checking for LF line-endings in source and make files and shell scripts > (638ms) > > ─ checking for empty or unneeded directories > > Removed empty directory ‘dst/.idea’ > > ─ building ‘dst_1.9.0.tar.gz’ > > Warning: invalid uid value replaced by that for user 'nobody' > > Warning: invalid gid value replaced by that for user 'nobody' > > > > Running \ > > /cvmfs/ > soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/r/4.4.0/lib64/R/bin/R > \ > > CMD INSTALL /tmp/RtmpwaSy51/dst_1.9.0.tar.gz --install-tests > > * installing to library ‘/home/zhupy/R/x86_64-pc-linux-gnu-library/4.4’ > > * installing *source* package ‘dst’ ... > > ** using staged installation > > ** libs > > using C++ compiler: ‘g++ (Gentoo 12.3.1_p20230526 p2) 12.3.1 20230526’ > > g++ -std=gnu++17 -I"/cvmfs/ > soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/r/4.4.0/lib64/R/include" > -DNDEBUG -I'/home/zhupy/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include' > -I'/home/zhupy/R/x86_64-pc-linux-gnu-library/4.4/BH/include' > -I'/home/zhupy/R/x86_64-pc-linux-gnu-library/4.4/RcppProgress/include' > -I'/home/zhupy/R/x86_64-pc-linux-gnu-library/4.4/RcppArmadillo/include' > -I/cvmfs/ > soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Core/java/17.0.6/include > -I/cvmfs/ > soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Core/flexiblascore/3.3.1/include > -I/cvmfs/ > soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Core/flexiblascore/3.3.1/include/flexiblas > -O3 -fpic -O2 -ftree-vectorize -march=x86-64-v3 -fno-math-errno -c > RcppExports.cpp -o RcppExports.o > > g++ -std=gnu++17 -I"/cvmfs/ > soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Compiler/gcccore/r/4.4.0/lib64/R/include" > -DNDEBUG -I'/home/zhupy/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include' > -I'/home/zhupy/R/x86_64-pc-linux-gnu-library/4.4/BH/include' > -I'/home/zhupy/R/x86_64-pc-linux-gnu-library/4.4/RcppProgress/include' > -I'/home/zhupy/R/x86_64-pc-linux-gnu-library/4.4/RcppArmadillo/include' > -I/cvmfs/ > soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Core/java/17.0.6/include > -I/cvmfs/ > soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Core/flexiblascore/3.3.1/include > -I/cvmfs/ > soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Core/flexiblascore/3.3.1/include/flexiblas > -O3 -fpic -O2 -ftree-vectorize -march=x86-64-v3 -fno-math-errno -c > belplauHFast.cpp -o belplauHFast.o > > > > On Wed, May 21, 2025 at 6:50 PM Peiyuan Zhu <garyzh...@gmail.com> wrote: > >> I saw this line from the manual: >> >> Flags that are already set (for example in file etcR_ARCH/Makeconf) can >> be overridden by the environment variable MAKEFLAGS (at least for >> systems using a POSIX-compliant make), as in (Bourne shell syntax) >> >> MAKEFLAGS="CFLAGS=-O3" R CMD SHLIB *.c >> >> I can give it a try. >> >> >> >> On Wed, May 21, 2025 at 6:44 PM Peiyuan Zhu <garyzh...@gmail.com> wrote: >> >>> The manual seems unreadable at this point. Every sentence has at least >>> two words which I don't understand. >>> >>> That said, I was able to find the compiler flags. They're still in >>> Makeconf in the system. I don't know how I can control this in a package. >>> >>> dhcp-128-189-214-31:src garyzhubc$ R CMD SHLIB --dry-run closure.cpp >>> >>> make cmd is >>> >>> make -f 'Makevars' -f >>> '/Library/Frameworks/R.framework/Resources/etc/Makeconf' -f >>> '/Library/Frameworks/R.framework/Resources/share/make/shlib.mk' >>> SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' >>> SHLIB='closure.so' OBJECTS='closure.o' >>> >>> >>> make would use >>> >>> if test "zclosure.o" != "z"; then \ >>> >>> echo clang++ -arch x86_64 -std=gnu++17 -dynamiclib >>> -Wl,-headerpad_max_install_names -undefined dynamic_lookup >>> -L"/Library/Frameworks/R.framework/Resources/lib" -L/opt/R/x86_64/lib -o >>> closure.so closure.o -F/Library/Frameworks/R.framework/.. -framework >>> R -Wl,-framework -Wl,CoreFoundation; \ >>> >>> clang++ -arch x86_64 -std=gnu++17 -dynamiclib >>> -Wl,-headerpad_max_install_names -undefined dynamic_lookup >>> -L"/Library/Frameworks/R.framework/Resources/lib" -L/opt/R/x86_64/lib -o >>> closure.so closure.o -F/Library/Frameworks/R.framework/.. -framework >>> R -Wl,-framework -Wl,CoreFoundation; \ >>> >>> fi >>> >>> >>> >>> On Wed, May 21, 2025 at 2:22 PM Kevin Ushey <kevinus...@gmail.com> >>> wrote: >>> >>>> Peiyuan, >>>> >>>> Respectfully -- RTFM. >>>> >>>> https://cran.r-project.org/doc/manuals/R-exts.html#Using-Makevars >>>> >>>> https://cran.r-project.org/doc/manuals/R-admin.html#Customizing-package-compilation >>>> >>>> The compilation flags are coming either from your R installation's >>>> etc/Makeconf, etc/Makevars.site, a user Makevars, or the package's >>>> Makevars. >>>> >>>> You can also use R CMD SHLIB --dry-run to figure out what `make` >>>> invocation R is using, so you can know where these compiler flags are >>>> coming from. For example: >>>> >>>> $ R CMD SHLIB --dry-run example.cpp >>>> make cmd is >>>> make -f 'Makevars' -f >>>> '/Library/Frameworks/R.framework/Resources/etc/Makeconf' -f >>>> '/Library/Frameworks/R.framework/Resources/share/make/shlib.mk' -f >>>> '/Users/kevin/.R/Makevars' SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' >>>> SHLIB_LD='$(SHLIB_CXXLD)' SHLIB='example.so' OBJECTS='example.o' >>>> >>>> Kevin >>>> >>>> On Wed, May 21, 2025 at 2:12 PM Dirk Eddelbuettel <e...@debian.org> >>>> wrote: >>>> > >>>> > >>>> > On 21 May 2025 at 13:55, Peiyuan Zhu wrote: >>>> > | Thanks Kasper, but I don’t know how exactly to accomplish this. As >>>> Dirk says >>>> > | the system overwrites it every time. >>>> > >>>> > That is *not* what Dirk said. >>>> > >>>> > Dirk >>>> > >>>> > -- >>>> > dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org >>>> > >>>> > ______________________________________________ >>>> > R-package-devel@r-project.org mailing list >>>> > https://stat.ethz.ch/mailman/listinfo/r-package-devel >>>> >>> [[alternative HTML version deleted]] ______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel