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

Get cc() working on Windows 10 #4189

Closed
ColeMiller1 opened this issue Jan 21, 2020 · 0 comments
Closed

Get cc() working on Windows 10 #4189

ColeMiller1 opened this issue Jan 21, 2020 · 0 comments

Comments

@ColeMiller1
Copy link
Contributor

I have Windows 10 and am trying to use cc(). When I load R and RStudio, I have cc() already sourced:

cc()
*truncated_directory*/data.table_names_SD/src 
NULL

This is the part of cc() that I get stuck on. ret evaluates to 127:

data.table/.dev/cc.R

Lines 62 to 68 in c005296

if (debug) {
ret = system(sprintf("MAKEFLAGS='-j CC=%s PKG_CFLAGS=-f%sopenmp CFLAGS=-std=c99\\ -O0\\ -ggdb\\ -pedantic' R CMD SHLIB -d -o datatable.so *.c", CC, OMP))
} else {
ret = system(sprintf("MAKEFLAGS='-j CC=%s CFLAGS=-f%sopenmp\\ -std=c99\\ -O3\\ -pipe\\ -Wall\\ -pedantic\\ -fno-common' R CMD SHLIB -o datatable.so *.c", CC, OMP))
# TODO add -Wextra too?
}
if (ret) return()

mingw_64 is downloaded with RBuildTools. I currently compile with these two lines - each c script uses the mingw_64/32 libraries for compilation:

devtools::build(vignettes = FALSE)
install.packages('data.table_1.12.9.tar.gz', repos = NULL, type="source")

C:/RBuildTools/3.5/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG       -fopenmp   -O2 -Wall  -std=gnu99 -mtune=generic -c assign.c -o assign.o

I feel like I need to combine these two lines but am unsure of how to do it.

"MAKEFLAGS='-j CC=gcc CFLAGS=-fopenmp\\ -std=c99\\ -O3\\ -pipe\\ -Wall\\ -pedantic\\ -fno-common' R CMD SHLIB -o datatable.so *.c"

C:/RBuildTools/3.5/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG       -fopenmp   -O2 -Wall  -std=gnu99 -mtune=generic -c assign.c -o assign.o

From #2103, I am curious if @franknarf1 has had luck on Windows with the cc() function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants