GithubHelp home page GithubHelp logo

Comments (25)

evanmiller avatar evanmiller commented on June 18, 2024

Looks like <sys/uio.h> is unneeded. Try this:

a49c741

from readstat.

evanmiller avatar evanmiller commented on June 18, 2024

...the u_char errors are a separate problem. Working on a fix.

from readstat.

evanmiller avatar evanmiller commented on June 18, 2024

This commit should fix the u_char errors:

a45406b

from readstat.

evanmiller avatar evanmiller commented on June 18, 2024

This commit addresses the dprintf warnings:

eb6b293

from readstat.

jeroen avatar jeroen commented on June 18, 2024

Hmmm im getting an error on osx now, not sure if that is a problem on my end though:

clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c readstat_rdata.c -o readstat_rdata.o
src/readstat_por_parse.c:11:18: warning: unused variable 'por_field_parse_first_final' [-Wunused-const-variable]
static const int por_field_parse_first_final = 12;
                 ^
src/readstat_por_parse.c:12:18: warning: unused variable 'por_field_parse_error' [-Wunused-const-variable]
static const int por_field_parse_error = 0;
                 ^
src/readstat_por_parse.c:14:18: warning: unused variable 'por_field_parse_en_main' [-Wunused-const-variable]
static const int por_field_parse_en_main = 1;
                 ^
3 warnings generated.
readstat_rdata.c:16:10: fatal error: 'lzma.h' file not found
#include <lzma.h>
         ^
1 error generated.

from readstat.

evanmiller avatar evanmiller commented on June 18, 2024

This is a bug. lzma.dylib should be present on OS X 10.9 and 10.10, but the headers need to be installed manually.

from readstat.

dennisfisher avatar dennisfisher commented on June 18, 2024

Evan

I am not sure that is true. I just searched my system for dylib files — I found many but not that one. Interestingly, I can run Hadley’s code on that same machine without the lzma.h error. But, I encounter that error on a different OS X machine. I have a have a vague recollection of installing lzma on one or more machines.

Regardless, you refer to this as a “bug … but the headers need to be installed manually”. Is that something at the user end?

Dennis

Dennis Fisher MD
P < (The "P Less Than" Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com

On Feb 4, 2015, at 2:47 PM, Evan Miller [email protected] wrote:

This is a bug. lzma.dylib should be present on OS X 10.9 and 10.10, but the headers need to be installed manually.


Reply to this email directly or view it on GitHub.

from readstat.

jeroen avatar jeroen commented on June 18, 2024

Some more warnings on windows (this is gcc 4.6.3):

gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c CKHashTable.c -o CKHashTable.o
* installing to library 'C:/Users/Jeroen/Documents/R/win-library/3.1'
* installing *source* package 'haven' ...
** libs
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c DfBuilder.cpp -o DfBuilder.o
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c RcppExports.cpp -o RcppExports.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_bits.c -o readstat_bits.o
readstat_bits.c: In function 'byteswap_float':
readstat_bits.c:59:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
readstat_bits.c:60:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
readstat_bits.c: In function 'byteswap_double':
readstat_bits.c:64:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
readstat_bits.c:65:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_convert.c -o readstat_convert.o
readstat_convert.c: In function 'readstat_convert':
readstat_convert.c:23:9: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
C:/PROGRA~1/R/R-31~1.2/include/iconv.h:53:8: note: expected 'const char **' but argument is of type 'char **'
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_dta.c -o readstat_dta.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_error.c -o readstat_error.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_io.c -o readstat_io.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_por.c -o readstat_por.o
readstat_por.c: In function 'read_por_file_data':
readstat_por.c:549:21: warning: implicit declaration of function 'dprintf' [-Wimplicit-function-declaration]
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_por_parse.c -o readstat_por_parse.o
src/readstat_por_parse.rl: In function 'readstat_por_parse_double':
src/readstat_por_parse.rl:69:9: warning: implicit declaration of function 'dprintf' [-Wimplicit-function-declaration]
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_sas.c -o readstat_sas.o
readstat_sas.c: In function 'sas_read_header':
readstat_sas.c:204:20: warning: variable 'a2' set but not used [-Wunused-but-set-variable]
readstat_sas.c: In function 'sas_parse_page_pass1':
readstat_sas.c:791:23: warning: variable 'subheader_type' set but not used [-Wunused-but-set-variable]
readstat_sas.c:773:14: warning: variable 'page_type' set but not used [-Wunused-but-set-variable]
readstat_sas.c: In function 'sas_parse_page_pass2':
readstat_sas.c:864:27: warning: variable 'subheader_type' set but not used [-Wunused-but-set-variable]
readstat_sas.c: In function 'parse_sas7bdat':
readstat_sas.c:1032:9: warning: implicit declaration of function 'dprintf' [-Wimplicit-function-declaration]
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_sav.c -o readstat_sav.o
readstat_sav.c: In function 'sav_read_value_label_record':
readstat_sav.c:387:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
readstat_sav.c: In function 'handle_missing_double':
readstat_sav.c:451:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
readstat_sav.c:453:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
readstat_sav.c:455:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
readstat_sav.c: In function 'sav_read_data':
readstat_sav.c:540:29: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
readstat_sav.c:639:17: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
readstat_sav.c: In function 'sav_parse_machine_integer_info_record':
readstat_sav.c:691:13: warning: implicit declaration of function 'dprintf' [-Wimplicit-function-declaration]
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_sav_parse.c -o readstat_sav_parse.o
src/readstat_sav_parse.rl: In function 'sav_parse_long_variable_names_record':
src/readstat_sav_parse.rl:56:17: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
C:/PROGRA~1/R/R-31~1.2/include/iconv.h:53:8: note: expected 'const char **' but argument is of type 'char **'
src/readstat_sav_parse.rl:75:17: warning: implicit declaration of function 'dprintf' [-Wimplicit-function-declaration]
src/readstat_sav_parse.rl: In function 'sav_parse_very_long_string_record':
src/readstat_sav_parse.rl:154:17: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
C:/PROGRA~1/R/R-31~1.2/include/iconv.h:53:8: note: expected 'const char **' but argument is of type 'char **'
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_spss.c -o readstat_spss.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_value.c -o readstat_value.o

from readstat.

evanmiller avatar evanmiller commented on June 18, 2024

I think the only problematic warning is the dprintf stuff which the latest code should fix.

from readstat.

evanmiller avatar evanmiller commented on June 18, 2024

@dennisfisher: I believe Hadley's code works because it leaves out readstat_rdata.c, which is the only file that uses the lzma stuff.

Regarding header installation what I meant was that in order to work the user should install XZ Utils here:

http://tukaani.org/xz/

We need to make this optional somehow though.

from readstat.

hadley avatar hadley commented on June 18, 2024

I think the last piece is the iconv problems:

gcc  -I"D:/RCompile/recent/R-3.1.2/include"            -I"d:/RCompile/CRANpkg/lib/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/lib/3.1/BH/include" -I"d:/Rcompile/CRANpkg/extralibs215/local215/include"     -O3 -Wall  -std=gnu99 -mtune=core2 -c readstat_sav_parse.c -o readstat_sav_parse.o
src/readstat_sav_parse.rl: In function 'sav_parse_long_variable_names_record':
src/readstat_sav_parse.rl:56:17: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
D:/RCompile/recent/R-3.1.2/include/iconv.h:53:8: note: expected 'const char **' but argument is of type 'char **'
src/readstat_sav_parse.rl:109:17: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'int' [-Wformat]
src/readstat_sav_parse.rl: In function 'sav_parse_very_long_string_record':
src/readstat_sav_parse.rl:154:17: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
D:/RCompile/recent/R-3.1.2/include/iconv.h:53:8: note: expected 'const char **' but argument is of type 'char **'
src/readstat_sav_parse.rl:204:9: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Wformat]
src/readstat_sav_parse.rl:204:9: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'int' [-Wformat]
gcc  -I"D:/RCompile/recent/R-3.1.2/include"            -I"d:/RCompile/CRANpkg/lib/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/lib/3.1/BH/include" -I"d:/Rcompile/CRANpkg/extralibs215/local215/include"     -O3 -Wall  -std=gnu99 -mtune=core2 -c readstat_spss.c -o readstat_spss.o
gcc  -I"D:/RCompile/recent/R-3.1.2/include"            -I"d:/RCompile/CRANpkg/lib/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/lib/3.1/BH/include" -I"d:/Rcompile/CRANpkg/extralibs215/local215/include"     -O3 -Wall  -std=gnu99 -mtune=core2 -c readstat_value.c -o readstat_value.o
g++ -shared -s -static-libgcc -o haven.dll tmp.def CKHashTable.o DfBuilder.o RcppExports.o readstat_bits.o readstat_convert.o readstat_dta.o readstat_error.o readstat_io.o readstat_por.o readstat_por_parse.o readstat_rdata.o readstat_sas.o readstat_sav.o readstat_sav_parse.o readstat_spss.o readstat_value.o -Ld:/Rcompile/CRANpkg/extralibs215/local215/lib/i386 -Ld:/Rcompile/CRANpkg/extralibs215/local215/lib -LD:/RCompile/recent/R-3.1.2/bin/i386 -lR
readstat_convert.o:readstat_convert.c:(.text+0x42): undefined reference to `_imp__libiconv'
readstat_rdata.o:readstat_rdata.c:(.text+0x87): undefined reference to `lzma_code'
readstat_rdata.o:readstat_rdata.c:(.text+0x153): undefined reference to `inflate'
readstat_rdata.o:readstat_rdata.c:(.text+0x1cb9): undefined reference to `lzma_end'
readstat_rdata.o:readstat_rdata.c:(.text+0x1cd3): undefined reference to `inflateEnd'
readstat_rdata.o:readstat_rdata.c:(.text+0x1dd8): undefined reference to `lzma_end'
readstat_rdata.o:readstat_rdata.c:(.text+0x1df2): undefined reference to `inflateEnd'
readstat_rdata.o:readstat_rdata.c:(.text+0x1fe4): undefined reference to `inflateInit_'
readstat_rdata.o:readstat_rdata.c:(.text+0x203e): undefined reference to `lzma_stream_decoder'
readstat_sas.o:readstat_sas.c:(.text+0x10e5): undefined reference to `_imp__libiconv_close'
readstat_sas.o:readstat_sas.c:(.text+0x1158): undefined reference to `_imp__libiconv_open'
readstat_sas.o:readstat_sas.c:(.text+0x1e0c): undefined reference to `_imp__libiconv_open'
readstat_sas.o:readstat_sas.c:(.text+0x1e59): undefined reference to `_imp__libiconv_close'
readstat_sav.o:readstat_sav.c:(.text+0x135): undefined reference to `_imp__libiconv_close'
readstat_sav.o:readstat_sav.c:(.text+0x318): undefined reference to `_imp__libiconv_close'
readstat_sav.o:readstat_sav.c:(.text+0x5d8): undefined reference to `_imp__libiconv_open'
readstat_sav_parse.o:readstat_sav_parse.c:(.text+0x12c): undefined reference to `_imp__libiconv'
readstat_sav_parse.o:readstat_sav_parse.c:(.text+0x4bde): undefined reference to `_imp__libiconv'
collect2: ld returned 1 exit status

(This is from win-builder, a CRAN building service).

from readstat.

evanmiller avatar evanmiller commented on June 18, 2024

These iconv errors look identical to the ones Dennis reported earlier on Windows:

http://r.789695.n4.nabble.com/Failure-to-execute-R-CMD-SHLIB-successfully-td4702587.html

The other undefined references can be fixed by linking against liblzma and libz -- or by excluding readstat_rdata.c from the compilation.

from readstat.

dennisfisher avatar dennisfisher commented on June 18, 2024

Evan

In this case, my did the identical thing on 2 machines
install_github("hadley/haven")
require(“haven”)
read_sas(FILENAME)
I did these steps seconds apart so it is unlikely that Hadley had removed readstat_rdata.c (it is still there in https://github.com/hadley/haven/tree/master/src)

It worked on one machine. On the other, I got the lzma error.

The difference must be that one machine has lzma installed, the other not. I trust that you and Hadley can figure out how to deal with this. It does make sense to exclude readstat_rdata.c from his installation since is would be recursive to add software to R that enables reading of R files! However, it is still there in github

Dennis

Dennis Fisher MD
P < (The "P Less Than" Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com

On Feb 4, 2015, at 3:34 PM, Evan Miller [email protected] wrote:

@dennisfisher: I believe Hadley's code works because it leaves out readstat_rdata.c, which is the only file that uses the lzma stuff.

Regarding header installation what I meant was that in order to work the user should install XZ Utils here:

http://tukaani.org/xz/

We need to make this optional somehow though.


Reply to this email directly or view it on GitHub.

from readstat.

jeroen avatar jeroen commented on June 18, 2024

The iconv problems can be fixed by linking to Riconv.dll that is included with R on windows. I have created a PR for hadley to fix that.

The package now builds, however it still gives a bunch of warnings. Perhaps these are harmless, but it would be great to get these fixed:

==> Rcmd.exe INSTALL --preclean --no-multiarch --with-keep.source haven

* installing to library 'C:/Users/Jeroen/Documents/R/win-library/3.1'
* installing *source* package 'haven' ...
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c CKHashTable.c -o CKHashTable.o
** libs
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c DfBuilder.cpp -o DfBuilder.o
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c RcppExports.cpp -o RcppExports.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_bits.c -o readstat_bits.o
readstat_bits.c: In function 'byteswap_float':
readstat_bits.c:59:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
readstat_bits.c:60:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
readstat_bits.c: In function 'byteswap_double':
readstat_bits.c:64:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
readstat_bits.c:65:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_convert.c -o readstat_convert.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_dta.c -o readstat_dta.o
readstat_convert.c: In function 'readstat_convert':
readstat_convert.c:23:9: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
C:/PROGRA~1/R/R-31~1.2/include/iconv.h:53:8: note: expected 'const char **' but argument is of type 'char **'
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_error.c -o readstat_error.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_io.c -o readstat_io.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_por.c -o readstat_por.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_por_parse.c -o readstat_por_parse.o
src/readstat_por_parse.rl: In function 'readstat_por_parse_double':
src/readstat_por_parse.rl:69:9: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'long long int' [-Wformat]
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_sas.c -o readstat_sas.o
readstat_sas.c: In function 'sas_read_header':
readstat_sas.c:204:20: warning: variable 'a2' set but not used [-Wunused-but-set-variable]
readstat_sas.c: In function 'sas_parse_page_pass1':
readstat_sas.c:791:23: warning: variable 'subheader_type' set but not used [-Wunused-but-set-variable]
readstat_sas.c:773:14: warning: variable 'page_type' set but not used [-Wunused-but-set-variable]
readstat_sas.c: In function 'sas_parse_page_pass2':
readstat_sas.c:864:27: warning: variable 'subheader_type' set but not used [-Wunused-but-set-variable]
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_sav.c -o readstat_sav.o
readstat_sav.c: In function 'sav_read_value_label_record':
readstat_sav.c:387:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
readstat_sav.c: In function 'handle_missing_double':
readstat_sav.c:451:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
readstat_sav.c:453:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
readstat_sav.c:455:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
readstat_sav.c: In function 'sav_read_data':
readstat_sav.c:540:29: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
readstat_sav.c:639:17: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_sav_parse.c -o readstat_sav_parse.o
src/readstat_sav_parse.rl: In function 'sav_parse_long_variable_names_record':
src/readstat_sav_parse.rl:56:17: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
C:/PROGRA~1/R/R-31~1.2/include/iconv.h:53:8: note: expected 'const char **' but argument is of type 'char **'
src/readstat_sav_parse.rl:109:17: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'long long int' [-Wformat]
src/readstat_sav_parse.rl: In function 'sav_parse_very_long_string_record':
src/readstat_sav_parse.rl:154:17: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
C:/PROGRA~1/R/R-31~1.2/include/iconv.h:53:8: note: expected 'const char **' but argument is of type 'char **'
src/readstat_sav_parse.rl:204:9: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'long long int' [-Wformat]
src/readstat_sav_parse.rl:204:9: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'long long int' [-Wformat]
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_spss.c -o readstat_spss.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_value.c -o readstat_value.o
g++ -m64 -shared -s -static-libgcc -o haven.dll tmp.def CKHashTable.o DfBuilder.o RcppExports.o readstat_bits.o readstat_convert.o readstat_dta.o readstat_error.o readstat_io.o readstat_por.o readstat_por_parse.o readstat_sas.o readstat_sav.o readstat_sav_parse.o readstat_spss.o readstat_value.o -lRiconv -Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/PROGRA~1/R/R-31~1.2/bin/x64 -lR
installing to C:/Users/Jeroen/Documents/R/win-library/3.1/haven/libs/x64
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (haven)

from readstat.

evanmiller avatar evanmiller commented on June 18, 2024

This commit should fix all of the non-iconv warnings:

b4bfe77

from readstat.

evanmiller avatar evanmiller commented on June 18, 2024

Finally this commit only includes the LZMA/XZ stuff if HAVE_LZMA is defined:

1134902

So hopefully the library will now compile on Windows without having to manually remove the RData code.

from readstat.

jeroen avatar jeroen commented on June 18, 2024

Almost there. A few warnings remain:

gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_dta.c -o readstat_dta.o
readstat_convert.c: In function 'readstat_convert':
readstat_convert.c:23:9: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
C:/PROGRA~1/R/R-31~1.2/include/iconv.h:53:8: note: expected 'const char **' but argument is of type 'char **'
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_rdata.c -o readstat_rdata.o
src/readstat_por_parse.rl: In function 'readstat_por_parse_double':
src/readstat_por_parse.rl:69:9: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'long long int' [-Wformat]
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_sav_parse.c -o readstat_sav_parse.o
src/readstat_sav_parse.rl: In function 'sav_parse_long_variable_names_record':
src/readstat_sav_parse.rl:56:17: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
C:/PROGRA~1/R/R-31~1.2/include/iconv.h:53:8: note: expected 'const char **' but argument is of type 'char **'
src/readstat_sav_parse.rl: In function 'sav_parse_very_long_string_record':
src/readstat_sav_parse.rl:154:17: warning: passing argument 2 of 'libiconv' from incompatible pointer type [enabled by default]
C:/PROGRA~1/R/R-31~1.2/include/iconv.h:53:8: note: expected 'const char **' but argument is of type 'char **'

from readstat.

evanmiller avatar evanmiller commented on June 18, 2024

This commit should fix the second warning:

f7971ff

As for the iconv warnings -- it looks like the API signature is non-standard. Apparently R uses win_iconv on Windows and for some reason win_iconv added the const keyword to inbuf. I'm not sure what the proper resolution is since casting to (char **) will break the code on Windows and (const char **) will break the code on Unix.

from readstat.

jeroen avatar jeroen commented on June 18, 2024

You can use the WIN32 or _WIN32 variable to test if you're on windows:

#ifdef WIN32
..
#else
..
#endif

from readstat.

evanmiller avatar evanmiller commented on June 18, 2024

Ok try this commit then:

b871c8e

from readstat.

jeroen avatar jeroen commented on June 18, 2024

OK no more warnings in Windows with the standard compiler flags. Yay, great job!

CRAN sometimes complains about warnings from the -Wall -pedantic` flags. These are not super important but if you can fix them as well that would be awesome:

==> Rcmd.exe INSTALL --no-multiarch --with-keep.source haven

* installing to library 'C:/Users/Jeroen/Documents/R/win-library/3.1'
* installing *source* package 'haven' ...
** libs
rm -f CKHashTable.o readstat_bits.o readstat_convert.o readstat_dta.o readstat_error.o readstat_io.o readstat_por.o readstat_por_parse.o readstat_rdata.o readstat_sas.o readstat_sav.o readstat_sav_parse.o readstat_spss.o readstat_value.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"  -Wall -pedantic   -O2 -Wall  -std=gnu99 -mtune=core2 -c CKHashTable.c -o CKHashTable.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"  -Wall -pedantic   -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_bits.c -o readstat_bits.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"  -Wall -pedantic   -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_convert.c -o readstat_convert.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"  -Wall -pedantic   -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_dta.c -o readstat_dta.o
In file included from readstat_dta.c:9:0:
readstat_dta.h:20:22: warning: ISO C forbids zero-size array 'contents' [-pedantic]
readstat_dta.h:26:22: warning: ISO C forbids zero-size array 'contents' [-pedantic]
readstat_dta.c: In function 'dta_ctx_init':
readstat_dta.c:31:9: warning: overflow in implicit constant conversion [-Woverflow]
readstat_dta.c:92:9: warning: overflow in implicit constant conversion [-Woverflow]
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"  -Wall -pedantic   -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_error.c -o readstat_error.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"  -Wall -pedantic   -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_io.c -o readstat_io.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"  -Wall -pedantic   -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_por.c -o readstat_por.o
readstat_por.c: In function 'read_bytes':
readstat_por.c:140:20: warning: pointer of type 'void *' used in arithmetic [-pedantic]
readstat_por.c:166:20: warning: pointer of type 'void *' used in arithmetic [-pedantic]
readstat_por.c: In function 'utf8_encode':
readstat_por.c:300:13: warning: ISO C does not support the '%C' ms_printf format [-Wformat]
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"  -Wall -pedantic   -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_por_parse.c -o readstat_por_parse.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"  -Wall -pedantic   -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_rdata.c -o readstat_rdata.o
readstat_rdata.c: In function 'read_st_z':
readstat_rdata.c:87:40: warning: pointer of type 'void *' used in arithmetic [-pedantic]
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"  -Wall -pedantic   -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_sas.c -o readstat_sas.o
readstat_sas.c:53:5: warning: overflow in implicit constant conversion [-Woverflow]
readstat_sas.c:53:5: warning: overflow in implicit constant conversion [-Woverflow]
readstat_sas.c:53:5: warning: overflow in implicit constant conversion [-Woverflow]
readstat_sas.c:54:5: warning: overflow in implicit constant conversion [-Woverflow]
readstat_sas.c:54:5: warning: overflow in implicit constant conversion [-Woverflow]
readstat_sas.c:54:5: warning: overflow in implicit constant conversion [-Woverflow]
readstat_sas.c:54:5: warning: overflow in implicit constant conversion [-Woverflow]
readstat_sas.c:55:5: warning: overflow in implicit constant conversion [-Woverflow]
readstat_sas.c:55:5: warning: overflow in implicit constant conversion [-Woverflow]
readstat_sas.c:60:5: warning: overflow in implicit constant conversion [-Woverflow]
readstat_sas.c:60:5: warning: overflow in implicit constant conversion [-Woverflow]
readstat_sas.c:60:5: warning: overflow in implicit constant conversion [-Woverflow]
readstat_sas.c:61:5: warning: overflow in implicit constant conversion [-Woverflow]
readstat_sas.c:61:5: warning: overflow in implicit constant conversion [-Woverflow]
readstat_sas.c:61:5: warning: overflow in implicit constant conversion [-Woverflow]
readstat_sas.c:61:5: warning: overflow in implicit constant conversion [-Woverflow]
readstat_sas.c:62:5: warning: overflow in implicit constant conversion [-Woverflow]
readstat_sas.c:62:5: warning: overflow in implicit constant conversion [-Woverflow]
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"  -Wall -pedantic   -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_sav.c -o readstat_sav.o
readstat_sav.c: In function 'sav_ctx_init':
readstat_sav.c:140:9: warning: overflow in implicit constant conversion [-Woverflow]
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"  -Wall -pedantic   -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_sav_parse.c -o readstat_sav_parse.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"  -Wall -pedantic   -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_spss.c -o readstat_spss.o
gcc -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG    -I"C:/Users/Jeroen/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/Jeroen/Documents/R/win-library/3.1/BH/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"  -Wall -pedantic   -O2 -Wall  -std=gnu99 -mtune=core2 -c readstat_value.c -o readstat_value.o
g++ -m64 -shared -s -static-libgcc -o haven.dll tmp.def CKHashTable.o readstat_bits.o readstat_convert.o readstat_dta.o readstat_error.o readstat_io.o readstat_por.o readstat_por_parse.o readstat_rdata.o readstat_sas.o readstat_sav.o readstat_sav_parse.o readstat_spss.o readstat_value.o -lRzlib -lRiconv -Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/PROGRA~1/R/R-31~1.2/bin/x64 -lR
installing to C:/Users/Jeroen/Documents/R/win-library/3.1/haven/libs/x64
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (haven)

from readstat.

evanmiller avatar evanmiller commented on June 18, 2024

Ok, I think I've fixed all the pedantic warnings. Grab the latest code and see if it compiles cleanly.

from readstat.

hadley avatar hadley commented on June 18, 2024

Looks good to me :)

from readstat.

evanmiller avatar evanmiller commented on June 18, 2024

Closing for now. If new warnings arise on any platform please open a new issue.

from readstat.

diogocp avatar diogocp commented on June 18, 2024

New warnings in #28.

from readstat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.