-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure.win
49 lines (43 loc) · 2.69 KB
/
configure.win
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
## use R to remove AVX2 references from BLOSC Makefiles
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e 'lines <- gsub("@M?AVX2[A-Z_]*@", "", readLines("src/compression_tools/blosc/lib/blosc-1.20.1/Makefile.in"));
lines <- gsub("@MSSE2@", "-msse2", lines);
lines <- gsub("@SSE2@", "-DSHUFFLE_SSE2_ENABLED", lines);
lines <- gsub("@SSE2_BITSHUFFLE_OBJ@", "bitshuffle-sse2.o", lines);
lines <- gsub("@SSE2_BITSHUFFLE@", "bitshuffle-sse2.o: bitshuffle-sse2.c\n\t$(CC) $(FLAGS) -c bitshuffle-sse2.c", lines);
lines <- gsub("@SSE2_SHUFFLE_OBJ@", "shuffle-sse2.o", lines);
lines <- gsub("@SSE2_SHUFFLE@", "shuffle-sse2.o: shuffle-sse2.c\n\t$(CC) $(FLAGS) -c shuffle-sse2.c", lines);
lines <- gsub("@NO_RLIB@", "", lines);
out_file <- file("src/compression_tools/blosc/lib/blosc-1.20.1/Makefile", open="wb");
writeLines(lines, con = out_file, sep = "\n");
close(out_file);'
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e 'lines <- gsub("@M?AVX2[A-Z_]*@", "", readLines("src/compression_tools/blosc/Makefile.in"));
lines <- gsub("@MSSE2@", "-msse2", lines);
lines <- gsub("@SSE2@", "-DSHUFFLE_SSE2_ENABLED", lines);
lines <- gsub("@SSE2_BITSHUFFLE_OBJ@", "bitshuffle-sse2.o", lines);
lines <- gsub("@SSE2_BITSHUFFLE@", "bitshuffle-sse2.o: bitshuffle-sse2.c\n\t$(CC) $(FLAGS) -c bitshuffle-sse2.c", lines);
lines <- gsub("@SSE2_SHUFFLE_OBJ@", "shuffle-sse2.o", lines);
lines <- gsub("@SSE2_SHUFFLE@", "shuffle-sse2.o: shuffle-sse2.c\n\t$(CC) $(FLAGS) -c shuffle-sse2.c", lines);
lines <- gsub("@SSE2_OBJ_PATH@", "lib/blosc-1.20.1/", lines);
out_file <- file("src/compression_tools/blosc/Makefile", open="wb");
writeLines(lines, con = out_file, sep = "\n");
close(out_file);'
sed \
-e "s^@NO_RLIB@^^" \
src/compression_tools/blosc/lib/snappy-1.1.1/Makefile.in > src/compression_tools/blosc/lib/snappy-1.1.1/Makefile
CC=`"${R_HOME}/bin${R_ARCH_BIN}/Rcmd.exe" config CC`
CFLAGS=`"${R_HOME}/bin${R_ARCH_BIN}/Rcmd.exe" config CFLAGS`
CPICFLAGS=`"${R_HOME}/bin${R_ARCH_BIN}/Rcmd.exe" config CPICFLAGS`
CXX=`"${R_HOME}/bin${R_ARCH_BIN}/Rcmd.exe" config CXX`
CPPFLAGS=`"${R_HOME}/bin${R_ARCH_BIN}/Rcmd.exe" config CPPFLAGS`
RANLIB=`"${R_HOME}/bin${R_ARCH_BIN}/Rcmd.exe" config RANLIB`
R_CPPFLAGS=`"${R_HOME}/bin${R_ARCH_BIN}/Rcmd.exe" config --cppflags`
sed \
-e "s^@CC@^${CC}^" \
-e "s^@CFLAGS@^${CFLAGS}^" \
-e "s^@CPICFLAGS@^${CPICFLAGS}^" \
-e "s^@CXX@^${CXX}^" \
-e "s^@CPPFLAGS@^${CPPFLAGS}^" \
-e "s^@RANLIB@^${RANLIB}^" \
-e "s^@R_CPPFLAGS@^${R_CPPFLAGS}^" \
src/Makevars.win.in > src/Makevars.win