Skip to content

Conversation

@kevinushey
Copy link
Contributor

@kevinushey kevinushey commented Aug 27, 2024

Closes #6409

@barracuda156 is this sufficient?

@MichaelChirico MichaelChirico changed the title also check plain '-fopenmp' for gcc (closes #6409) also check plain '-fopenmp' for gcc Aug 27, 2024
@barracuda156
Copy link

@kevinushey Thank you for addressing this.

At least in my case it works with gcc. Here I only apply your patch from e0bee18 and it builds and links correctly:

--->  Extracting data.table-1.16.0.tar.gz
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-data.table/R-data.table/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/R-data.table/data.table-1.16.0.tar.gz' | /usr/bin/gnutar --no-same-owner -xf - 
--->  Applying patches to R-data.table
--->  Applying e0bee1870b57be5fa05f69b0872001bc67cfbf71.patch
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-data.table/R-data.table/work/data.table-1.16.0" && /usr/bin/patch -t -N -p0 < '/opt/PPCSnowLeopardPorts/R/R-data.table/files/e0bee1870b57be5fa05f69b0872001bc67cfbf71.patch'
patching file configure
--->  Configuring R-data.table
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-data.table/R-data.table/work/data.table-1.16.0" && /opt/local/bin/R CMD build . --no-manual --no-build-vignettes --keep-empty-dirs 
* checking for file ‘./DESCRIPTION’ ... OK
* preparing ‘data.table’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* running ‘cleanup’
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building ‘data.table_1.16.0.tar.gz’

--->  Building R-data.table
xinstall: mkdir /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-data.table/R-data.table/work/build
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-data.table/R-data.table/work/data.table-1.16.0" && /opt/local/bin/R CMD INSTALL . --library=/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-data.table/R-data.table/work/build --install-tests 
* installing *source* package ‘data.table’ ...
** using staged installation
zlib 1.3.1 is available ok
* checking if R installation supports OpenMP with "-Xclang -fopenmp" ... no
* checking if R installation supports OpenMP with "-fopenmp" ... yes
** libs
using C compiler: ‘gcc-mp-13 (MacPorts gcc13 13.3.0_0+stdlib_flag) 13.3.0’
Warning in system2("xcrun", "--show-sdk-path", TRUE, TRUE) :
  running command ''xcrun' --show-sdk-path 2>&1' had status 64
using SDK: ‘NA’‘NA’‘NA’‘NA’‘NA’‘NA’
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c assign.c -o assign.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c between.c -o between.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c bmerge.c -o bmerge.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c chmatch.c -o chmatch.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c cj.c -o cj.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c coalesce.c -o coalesce.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c dogroups.c -o dogroups.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c fastmean.c -o fastmean.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c fcast.c -o fcast.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c fifelse.c -o fifelse.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c fmelt.c -o fmelt.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c forder.c -o forder.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c frank.c -o frank.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c fread.c -o fread.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c freadR.c -o freadR.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c froll.c -o froll.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c frollR.c -o frollR.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c frolladaptive.c -o frolladaptive.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c fsort.c -o fsort.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c fwrite.c -o fwrite.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c fwriteR.c -o fwriteR.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c gsumm.c -o gsumm.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c idatetime.c -o idatetime.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c ijoin.c -o ijoin.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c init.c -o init.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c inrange.c -o inrange.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c nafill.c -o nafill.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c negate.c -o negate.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c nqrecreateindices.c -o nqrecreateindices.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c openmp-utils.c -o openmp-utils.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c programming.c -o programming.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c quickselect.c -o quickselect.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c rbindlist.c -o rbindlist.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c reorder.c -o reorder.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c shift.c -o shift.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c snprintf.c -o snprintf.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c subset.c -o subset.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c transpose.c -o transpose.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c types.c -o types.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c uniqlist.c -o uniqlist.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c utils.c -o utils.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c vecseq.c -o vecseq.o
/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -fopenmp -fopenmp  -fPIC  -pipe -Os -arch ppc  -c wrappers.c -o wrappers.o
/opt/local/bin/gcc-mp-13 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/opt/local/Library/Frameworks/R.framework/Resources/lib -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -Wl,-rpath,/opt/local/lib/libgcc -arch ppc -o data.table.so assign.o between.o bmerge.o chmatch.o cj.o coalesce.o dogroups.o fastmean.o fcast.o fifelse.o fmelt.o forder.o frank.o fread.o freadR.o froll.o frollR.o frolladaptive.o fsort.o fwrite.o fwriteR.o gsumm.o idatetime.o ijoin.o init.o inrange.o nafill.o negate.o nqrecreateindices.o openmp-utils.o programming.o quickselect.o rbindlist.o reorder.o shift.o snprintf.o subset.o transpose.o types.o uniqlist.o utils.o vecseq.o wrappers.o -fopenmp -L/opt/local/lib -lz -F/opt/local/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
PKG_CFLAGS = -fopenmp -fopenmp
PKG_LIBS = -fopenmp -L/opt/local/lib -lz
if [ "data.table.so" != "data_table.so" ]; then mv data.table.so data_table.so; fi
if [ "" != "Windows_NT" ] && [ `uname -s` = 'Darwin' ]; then install_name_tool -id data_table.so data_table.so; fi
installing to /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-data.table/R-data.table/work/build/00LOCK-data.table-1.16.0/00new/data.table/libs
** R
** inst
** tests
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (data.table)
--->  Staging R-data.table into destroot
36-25% otool -L /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-data.table/R-data.table/work/data.table-1.16.0/src/data_table.so 
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-data.table/R-data.table/work/data.table-1.16.0/src/data_table.so:
	data_table.so (compatibility version 0.0.0, current version 0.0.0)
	/opt/local/lib/libMacportsLegacySupport.dylib (compatibility version 1.0.0, current version 1.3.0)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.3.1)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 511.1.0)
	/opt/local/Library/Frameworks/R.framework/Versions/4.4/Resources/lib/libR.dylib (compatibility version 4.4.0, current version 4.4.1)
	/opt/local/lib/libgcc/libgomp.1.dylib (compatibility version 2.0.0, current version 2.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 117.0.0)

@barracuda156
Copy link

I also ran tests, everything passes:

--->  Testing R-data.table
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-data.table/R-data.table/work/data.table-1.16.0" && /opt/local/bin/R CMD check ./data.table_1.16.0.tar.gz --no-manual --no-build-vignettes 
* using log directory ‘/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-data.table/R-data.table/work/data.table-1.16.0/data.table.Rcheck’
* using R version 4.4.1 (2024-06-14)
* using platform: powerpc-apple-darwin10.0.0d2 (32-bit)
* R was compiled by
    gcc-mp-13 (MacPorts gcc13 13.3.0_0+stdlib_flag) 13.3.0
    GNU Fortran (MacPorts gcc13 13.3.0_0+stdlib_flag) 13.3.0
* running under: OS X Snow Leopard 10.6
* using session charset: UTF-8
* using options ‘--no-manual --no-build-vignettes’
* checking for file ‘data.table/DESCRIPTION’ ... OK
* this is package ‘data.table’ version ‘1.16.0’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘data.table’ can be installed ... OK
* used C compiler: ‘gcc-mp-13 (MacPorts gcc13 13.3.0_0+stdlib_flag) 13.3.0’
* used SDK: ‘NA’‘NA’‘NA’‘NA’‘NA’‘NA’
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking whether startup messages can be suppressed ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in shell scripts ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking line endings in Makefiles ... OK
* checking compilation flags in Makevars ... OK
* checking for GNU extensions in Makefiles ... OK
* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
* checking use of PKG_*FLAGS in Makefiles ... OK
* checking compiled code ... OK
* checking files in ‘vignettes’ ... WARNING
Files in the 'vignettes' directory but no files in 'inst/doc':
  ‘Pitching.RData’ ‘Teams.RData’ ‘css/toc.css’
  ‘datatable-benchmarking.Rmd’ ‘datatable-faq.Rmd’
  ‘datatable-importing.Rmd’ ‘datatable-intro.Rmd’
  ‘datatable-keys-fast-subset.Rmd’ ‘datatable-programming.Rmd’
  ‘datatable-reference-semantics.Rmd’ ‘datatable-reshape.Rmd’
  ‘datatable-sd-usage.Rmd’
  ‘datatable-secondary-indices-and-auto-indexing.Rmd’ ‘flights14.csv’
  ‘plots/grouping_illustration.png’
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘S4.R’
  Running ‘autoprint.R’
  Comparing ‘autoprint.Rout’ to ‘autoprint.Rout.save’ ... OK
  Running ‘froll.R’
  Running ‘knitr.R’
  Comparing ‘knitr.Rout’ to ‘knitr.Rout.save’ ... OK
  Running ‘main.R’
  Running ‘nafill.R’
  Running ‘other.R’
  Running ‘programming.R’
  Running ‘types.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... WARNING
Directory 'inst/doc' does not exist.
Package vignettes without corresponding single PDF/HTML:
  ‘datatable-benchmarking.Rmd’
  ‘datatable-faq.Rmd’
  ‘datatable-importing.Rmd’
  ‘datatable-intro.Rmd’
  ‘datatable-keys-fast-subset.Rmd’
  ‘datatable-programming.Rmd’
  ‘datatable-reference-semantics.Rmd’
  ‘datatable-reshape.Rmd’
  ‘datatable-sd-usage.Rmd’
  ‘datatable-secondary-indices-and-auto-indexing.Rmd’
* checking running R code from vignettes ...
  ‘datatable-benchmarking.Rmd’ using ‘UTF-8’... OK
  ‘datatable-faq.Rmd’ using ‘UTF-8’... OK
  ‘datatable-importing.Rmd’ using ‘UTF-8’... OK
  ‘datatable-intro.Rmd’ using ‘UTF-8’... OK
  ‘datatable-keys-fast-subset.Rmd’ using ‘UTF-8’... OK
  ‘datatable-programming.Rmd’ using ‘UTF-8’... OK
  ‘datatable-reference-semantics.Rmd’ using ‘UTF-8’... OK
  ‘datatable-reshape.Rmd’ using ‘UTF-8’... OK
  ‘datatable-sd-usage.Rmd’ using ‘UTF-8’... OK
  ‘datatable-secondary-indices-and-auto-indexing.Rmd’ using ‘UTF-8’... OK
 OK
* checking re-building of vignette outputs ... SKIPPED
* DONE

Status: 2 WARNINGs

@MichaelChirico
Copy link
Member

Thanks @kevinushey and @barracuda156 for confirming. The change looks reasonable to me, let's add NEWS and ship it :)

fi

# https://github.com/Rdatatable/data.table/issues/6409
printf "%s" "* checking if R installation supports OpenMP with \"-fopenmp\" ... "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
To avoid the slight repetition with the check above though, you could consider merging them (if it still maintains readability), maybe something like:

printf "%s" "* Checking if R installation supports OpenMP with \"-Xclang -fopenmp\" or \"-fopenmp\" ... "
if CPPFLAGS="${CPPFLAGS} -Xclang -fopenmp" PKG_LIBS="-lomp" "${R_HOME}/bin/R" CMD SHLIB test-omp.c >> config.log 2>&1 || \
   CPPFLAGS="${CPPFLAGS} -fopenmp" "${R_HOME}/bin/R" CMD SHLIB test-omp.c >> config.log 2>&1; then
  echo "yes"
  if ${CC} --version 2>&1 | grep -q "clang"; then
    PKG_CFLAGS="${PKG_CFLAGS} -Xclang -fopenmp"
    PKG_LIBS="${PKG_LIBS} -lomp"
  else # This probably supports a few other GCC-compatible compilers too I reckon (such as ICC and PGI perhaps), so having a generic else sounds reasonable as opposed to being checked for GCC only.
    PKG_CFLAGS="${PKG_CFLAGS} -fopenmp"
  fi
  export PKG_CFLAGS
  export PKG_LIBS
  export R_OPENMP_ENABLED=1
  return
else
  echo "no"
fi

instead of:

printf "%s" "* checking if R installation supports OpenMP with \"-Xclang -fopenmp\" ... "
if CPPFLAGS="${CPPFLAGS} -Xclang -fopenmp" PKG_LIBS="-lomp" "${R_HOME}/bin/R" CMD SHLIB test-omp.c >> config.log 2>&1; then
  echo "yes"
  export PKG_CFLAGS="${PKG_CFLAGS} -Xclang -fopenmp"
  export PKG_LIBS="${PKG_LIBS} -lomp"
  export R_OPENMP_ENABLED=1
  return
else
  echo "no"
fi

printf "%s" "* checking if R installation supports OpenMP with \"-fopenmp\" ... "
if CPPFLAGS="${CPPFLAGS} -fopenmp" "${R_HOME}/bin/R" CMD SHLIB test-omp.c >> config.log 2>&1; then
  echo "yes"
  export PKG_CFLAGS="${PKG_CFLAGS} -fopenmp"
  export R_OPENMP_ENABLED=1
  return
else
  echo "no"
fi

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also: Unrelated to this PR, but a minor nit while we're discussing this file - 'openmp' > 'OpenMP' here: (for consistency with the other messages)

printf "%s" "* checking if R installation supports openmp with \"-fopenmp\" flag... "

MichaelChirico added a commit that referenced this pull request Aug 30, 2024
* also check plain '-fopenmp' for gcc (closes #6409)

* update NEWS

* cite in NEWS

---------

Co-authored-by: Michael Chirico <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please fix OpenMP support detection on macOS

5 participants