lrberge / fixest

Fixed-effects estimations
https://lrberge.github.io/fixest/
361 stars 59 forks source link

Cannot download the package. #488

Open Houdanait opened 2 months ago

Houdanait commented 2 months ago

Hello, When I try to download fixest via install.package("fixest") I get the below error and couldn't find a way to solve it:

install.packages("fixest")
Installing package into ‘/Users/houdanaitelbarj_1/Library/R/4.0/library’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
       binary source needs_compilation
fixest 0.10.4 0.12.0              TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) yes
installing the source package ‘fixest’

trying URL 'https://cran.rstudio.com/src/contrib/fixest_0.12.0.tar.gz'
Content type 'application/x-gzip' length 2327110 bytes (2.2 MB)
==================================================
downloaded 2.2 MB

* installing *source* package ‘fixest’ ...
** package ‘fixest’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -c RcppExports.cpp -o RcppExports.o
In file included from RcppExports.cpp:4:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp.h:27:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/RcppCommon.h:167:
/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp/internal/r_coerce.h:255:7: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    ::sprintf(buff, "%02x", from);
      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 warning generated.
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -c convergence.cpp -o convergence.o
In file included from convergence.cpp:34:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp.h:27:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/RcppCommon.h:167:
/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp/internal/r_coerce.h:255:7: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    ::sprintf(buff, "%02x", from);
      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 warning generated.
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -c demeaning.cpp -o demeaning.o
In file included from demeaning.cpp:32:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp.h:27:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/RcppCommon.h:167:
/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp/internal/r_coerce.h:255:7: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    ::sprintf(buff, "%02x", from);
      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
demeaning.cpp:114:18: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
  double *p_dble = nullptr;
                 ^
demeaning.cpp:115:14: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
  int *p_int = nullptr;
             ^
demeaning.cpp:121:15: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
  bool is_int = false;
              ^
demeaning.cpp:153:9: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
  int n = 0;
        ^
demeaning.cpp:154:9: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
  int K = 0;
        ^
demeaning.cpp:156:12: warning: deleted function definitions are a C++11 extension [-Wc++11-extensions]
  sMat() = delete;
           ^
demeaning.cpp:283:26: warning: deleted function definitions are a C++11 extension [-Wc++11-extensions]
  simple_mat_with_id() = delete;
                         ^
demeaning.cpp:287:39: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
  int nrow, ncol, n_total, id_current = 0;
                                      ^
demeaning.cpp:337:21: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
  double *p_weights = nullptr;
                    ^
10 warnings generated.
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -c dsb.cpp -o dsb.o
In file included from dsb.cpp:1:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp.h:27:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/RcppCommon.h:167:
/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp/internal/r_coerce.h:255:7: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    ::sprintf(buff, "%02x", from);
      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 warning generated.
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -c lm_related.cpp -o lm_related.o
In file included from lm_related.cpp:15:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp.h:27:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/RcppCommon.h:167:
/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp/internal/r_coerce.h:255:7: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    ::sprintf(buff, "%02x", from);
      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 warning generated.
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include   -DSTRICT_R_HEADERS -fPIC  -Wall -g -O2  -c misc_funs.cpp -o misc_funs.o
In file included from misc_funs.cpp:18:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp.h:27:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/RcppCommon.h:167:
/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp/internal/r_coerce.h:255:7: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    ::sprintf(buff, "%02x", from);
      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
misc_funs.cpp:858:25: warning: deleted function definitions are a C++11 extension [-Wc++11-extensions]
  simple_vec_double() = delete;
                        ^
misc_funs.cpp:859:21: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
  double *px_double = nullptr;
                    ^
misc_funs.cpp:860:15: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
  int *px_int = nullptr;
              ^
misc_funs.cpp:1277:38: error: expected '(' for function-style cast or type construction
  double res = std::hash<std::string>{}(x);
               ~~~~~~~~~~~~~~~~~~~~~~^
misc_funs.cpp:1315:37: error: expected ';' at end of declaration
  std::vector<std::string> open_tags{"", "\\textit{", "\\textbf{", "\\textbf{\\textit{"};
                                    ^
                                    ;
misc_funs.cpp:1316:40: error: expected ';' at end of declaration
  std::vector<std::string> closing_tags{"", "}", "}", "}}"};
                                       ^
                                       ;
misc_funs.cpp:1317:33: error: expected ';' at end of declaration
  std::vector<std::string> stars{"", "*", "**", "***"};
                                ^
                                ;
4 warnings and 4 errors generated.
make: *** [misc_funs.o] Error 1
ERROR: compilation failed for package ‘fixest’
* removing ‘/Users/houdanaitelbarj_1/Library/R/4.0/library/fixest’
Warning in install.packages :
  installation of package ‘fixest’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/n4/wpsfjhts12sd_yt7_jh3lhr00000gp/T/RtmpqkLlKg/downloaded_packages’
grantmcdermott commented 2 months ago

tl;dr Try installing again now that the pre-compiled binaries for fixest 0.12.0 MacOS have been built on CRAN.

Longer version: Looks like you are trying to install and build from source, in which case you'll need an appropriate compile toolchain. (On MacOS, installing XTools should take care of this. One easy way to do this for your future self: https://mac.thecoatlessprofessor.com/macrtools/) But the simpler solution is just to wait a few days for pre-compiled binaries to be made available on CRAN. That should be done now if I look at the fixest CRAN page: https://cran.r-project.org/web/packages/fixest/index.html. Alternatively, the r-universe builds for the dev version of the package are also rep-compiled for MacOS; see this repo's landing page README for instructions.

lrberge commented 2 months ago

+1 with Grant's solution. Otherwise, it seems you need to enforce C++11 when compiling (errors are due to the version). I had it in the Makevars but the R team made me to remove it.... and I don't know enough here. Best option is to simply wait.