pommedeterresautee / fastrtext

R wrapper for fastText
https://pommedeterresautee.github.io/fastrtext/
Other
101 stars 15 forks source link

Fastrtext fails to install direct from Git #43

Open alanault opened 3 years ago

alanault commented 3 years ago

Hi there

I was trying to install on a fresh OSX installation. As the package isn't on CRAN, I tried to install from Github using devtools, but this fails with compiling errors.

Any idea of a workaround?

Alan

R
library(devtools)
install_gihub("https://github.com/pommedeterresautee/fastrtext")

With session

R version 3.5.2 (2018-12-20)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] usethis_1.5.0  devtools_2.0.2

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.5        magrittr_1.5      pkgload_1.0.2     R6_2.4.1
 [5] rlang_0.4.9       fansi_0.4.0       tools_3.5.2       pkgbuild_1.0.3
 [9] sessioninfo_1.1.1 cli_2.0.1         withr_2.1.2       remotes_2.0.4
[13] assertthat_0.2.1  digest_0.6.24     rprojroot_1.3-2   crayon_1.3.4
[17] processx_3.4.2    callr_3.2.0       fs_1.3.1          ps_1.3.2
[21] curl_3.3          testthat_2.1.1    memoise_1.1.0     glue_1.4.2
[25] compiler_3.5.2    desc_1.2.0        backports_1.1.4   prettyunits_1.0.2

Returns

Downloading GitHub repo pommedeterresautee/fastrtext@master
   checking for file ‘/private/var/folders/lb/1sl3d1_n78jgtdt0x4php_j80000gn/T/RtmpIID4qT/remotes156871b7181d/pommedeterresautee-fastrtext-b63c5de/DESCRIPTION’ ✔  checking for file ‘/private/var/folders/lb/1sl3d1_n78jgtdt0x4php_j80000gn/T/RtmpIID4qT/remotes156871b7181d/pommedeterresautee-fastrtext-b63c5de/DESCRIPTION’
─  preparing ‘fastrtext’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  running ‘cleanup’
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  looking to see if a ‘data/datalist’ file should be added
─  building ‘fastrtext_0.3.4.tar.gz’

* installing *source* package ‘fastrtext’ ...
** libs
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c add_prefix.cpp -o add_prefix.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c r_compliance.cc -o r_compliance.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c fasttext/autotune.cc -o fasttext/autotune.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c fasttext/args.cc -o fasttext/args.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c fasttext/matrix.cc -o fasttext/matrix.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c fasttext/dictionary.cc -o fasttext/dictionary.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c fasttext/loss.cc -o fasttext/loss.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c fasttext/productquantizer.cc -o fasttext/productquantizer.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c fasttext/densematrix.cc -o fasttext/densematrix.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c fasttext/quantmatrix.cc -o fasttext/quantmatrix.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c fasttext/vector.cc -o fasttext/vector.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c fasttext/model.cc -o fasttext/model.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c fasttext/utils.cc -o fasttext/utils.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c fasttext/meter.cc -o fasttext/meter.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c fasttext/fasttext.cc -o fasttext/fasttext.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c fasttext/main.cc -o fasttext/main.o
fasttext/main.cc:324:14: warning: variable 'k' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
  } else if (args.size() == 4) {
             ^~~~~~~~~~~~~~~~
fasttext/main.cc:330:7: note: uninitialized use occurs here
  if (k <= 0) {
      ^
fasttext/main.cc:324:10: note: remove the 'if' if its condition is always true
  } else if (args.size() == 4) {
         ^~~~~~~~~~~~~~~~~~~~~~
fasttext/main.cc:321:12: note: initialize the variable 'k' to silence this warning
  int32_t k;
           ^
            = 0
1 warning generated.
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c fastrtext.cpp -o fastrtext.o
fastrtext.cpp:203:13: warning: unused variable 'i' [-Wunused-variable]
    int32_t i = 0;
            ^
1 warning generated.
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -include r_compliance.h -I./fasttext -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
clang++ -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o fastrtext.so add_prefix.o r_compliance.o ./fasttext/autotune.o ./fasttext/args.o ./fasttext/matrix.o ./fasttext/dictionary.o ./fasttext/loss.o ./fasttext/productquantizer.o ./fasttext/densematrix.o ./fasttext/quantmatrix.o ./fasttext/vector.o ./fasttext/model.o ./fasttext/utils.o ./fasttext/meter.o ./fasttext/fasttext.o ./fasttext/main.o fastrtext.o RcppExports.o -pthread -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
clang: warning: argument unused during compilation: '-pthread'
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
installing to /Library/Frameworks/R.framework/Versions/3.5/Resources/library/fastrtext/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘fastrtext’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/fastrtext/libs/fastrtext.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/fastrtext/libs/fastrtext.so, 6): Symbol not found: __ZN8fasttext8Autotune12kCutoffLimitE
  Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/fastrtext/libs/fastrtext.so
  Expected in: flat namespace
 in /Library/Frameworks/R.framework/Versions/3.5/Resources/library/fastrtext/libs/fastrtext.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/fastrtext’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/fastrtext’
Error in i.p(...) :
  (converted from warning) installation of package ‘/var/folders/lb/1sl3d1_n78jgtdt0x4php_j80000gn/T//RtmpIID4qT/file15682dc6f3a7/fastrtext_0.3.4.tar.gz’ had non-zero exit status