Closed jwijffels closed 4 years ago
Hi,
First, thanks for this package (and also udpipe). I use it and it works fine on my Ubuntu. This command doesn't finish in R : (Starspace alone works normally on my Mac).
model <- embed_tagspace(x = dekamer$x, y = dekamer$y,
dim = 50,
lr = 0.01, epoch = 40, loss = "softmax", adagrad = TRUE,
similarity = "cosine", negSearchLimit = 50,
ngrams = 2, minCount = 2)
For debugging, I've started with lldb
as suggested here but I have the same infinite time.
Here is what is printed in Terminal :
(some warnings on build about "non-virtual destructor" but it seems ok).
Last login: Tue Jan 22 20:08:42 on ttys000
MacBook-Pro-de-Guillaume:~ guillaumepressiat$ cd ~/Documents/debugs/
MacBook-Pro-de-Guillaume:debugs guillaumepressiat$ git clone https://github.com/bnosac/ruimtehol.git
Cloning into 'ruimtehol'...
remote: Enumerating objects: 174, done.
remote: Counting objects: 100% (174/174), done.
remote: Compressing objects: 100% (97/97), done.
remote: Total 1174 (delta 102), reused 130 (delta 77), pack-reused 1000
Receiving objects: 100% (1174/1174), 40.08 MiB | 5.86 MiB/s, done.
Resolving deltas: 100% (810/810), done.
MacBook-Pro-de-Guillaume:debugs guillaumepressiat$ cd ruimtehol
MacBook-Pro-de-Guillaume:ruimtehol guillaumepressiat$ R --debugger=lldb
(lldb) target create "/Library/Frameworks/R.framework/Resources/bin/exec/R"
Current executable set to '/Library/Frameworks/R.framework/Resources/bin/exec/R' (x86_64).
(lldb) run
Process 50199 launched: '/Library/Frameworks/R.framework/Resources/bin/exec/R' (x86_64)
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)
R est un logiciel libre livré sans AUCUNE GARANTIE.
Vous pouvez le redistribuer sous certaines conditions.
Tapez 'license()' ou 'licence()' pour plus de détails.
R est un projet collaboratif avec de nombreux contributeurs.
Tapez 'contributors()' pour plus d'information et
'citation()' pour la façon de le citer dans les publications.
Tapez 'demo()' pour des démonstrations, 'help()' pour l'aide
en ligne ou 'help.start()' pour obtenir l'aide au format HTML.
Tapez 'q()' pour quitter R.
> devtools::load_all()
Loading ruimtehol
Re-compiling ruimtehol
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ \
--no-save --no-restore --quiet CMD INSTALL \
'/Users/guillaumepressiat/Documents/debugs/ruimtehol' \
--library='/var/folders/rk/mm6mn1y50ll38rhm2ft7ndj80000gn/T//Rtmpps9Fdm/devtools_install_c41747c27418' \
--no-R --no-data --no-help --no-demo --no-inst --no-docs --no-exec \
--no-multiarch --no-test-load --preclean
* installing *source* package ‘ruimtehol’ ...
** libs
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/utils/args.cpp -o Starspace/src/utils/args.o
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/utils/normalize.cpp -o Starspace/src/utils/normalize.o
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/utils/utils.cpp -o Starspace/src/utils/utils.o
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/data.cpp -o Starspace/src/data.o
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/dict.cpp -o Starspace/src/dict.o
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/doc_data.cpp -o Starspace/src/doc_data.o
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/doc_parser.cpp -o Starspace/src/doc_parser.o
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/model.cpp -o Starspace/src/model.o
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/parser.cpp -o Starspace/src/parser.o
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/proj.cpp -o Starspace/src/proj.o
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/starspace.cpp -o Starspace/src/starspace.o
In file included from <built-in>:1:
In file included from ./compliance.h:3:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include/Rcpp.h:27:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include/RcppCommon.h:29:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include/Rcpp/r/headers.h:59:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include/Rcpp/platform/compiler.h:153:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/unordered_map:369:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__hash_table:16:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:5: warning:
destructor called on non-final 'starspace::DataParser' that has virtual
functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3617:9: note:
in instantiation of member function
'std::__1::__shared_ptr_emplace<starspace::DataParser,
std::__1::allocator<starspace::DataParser> >::__on_zero_shared' requested
here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note:
in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<starspace::DataParser,
std::__1::allocator<starspace::DataParser>
>::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note:
in instantiation of function template specialization
'std::__1::shared_ptr<starspace::DataParser>::make_shared<std::__1::shared_ptr<starspace::Dictionary>
&, std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:35:15: note: in instantiation of function template
specialization 'std::__1::make_shared<starspace::DataParser,
std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
parser_ = make_shared<DataParser>(dict_, args_);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:23: note:
qualify call to silence this warning
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:5: warning:
destructor called on non-final 'starspace::LayerDataParser' that has
virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3617:9: note:
in instantiation of member function
'std::__1::__shared_ptr_emplace<starspace::LayerDataParser,
std::__1::allocator<starspace::LayerDataParser> >::__on_zero_shared'
requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note:
in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<starspace::LayerDataParser,
std::__1::allocator<starspace::LayerDataParser>
>::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note:
in instantiation of function template specialization
'std::__1::shared_ptr<starspace::LayerDataParser>::make_shared<std::__1::shared_ptr<starspace::Dictionary>
&, std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:37:15: note: in instantiation of function template
specialization 'std::__1::make_shared<starspace::LayerDataParser,
std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
parser_ = make_shared<LayerDataParser>(dict_, args_);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:23: note:
qualify call to silence this warning
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:5: warning:
destructor called on non-final 'starspace::InternDataHandler' that has
virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3617:9: note:
in instantiation of member function
'std::__1::__shared_ptr_emplace<starspace::InternDataHandler,
std::__1::allocator<starspace::InternDataHandler> >::__on_zero_shared'
requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note:
in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<starspace::InternDataHandler,
std::__1::allocator<starspace::InternDataHandler>
>::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Args> &>'
requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note:
in instantiation of function template specialization
'std::__1::shared_ptr<starspace::InternDataHandler>::make_shared<std::__1::shared_ptr<starspace::Args>
&>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:63:12: note: in instantiation of function template
specialization 'std::__1::make_shared<starspace::InternDataHandler,
std::__1::shared_ptr<starspace::Args> &>' requested here
return make_shared<InternDataHandler>(args_);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:23: note:
qualify call to silence this warning
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:5: warning:
destructor called on non-final 'starspace::LayerDataHandler' that has
virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3617:9: note:
in instantiation of member function
'std::__1::__shared_ptr_emplace<starspace::LayerDataHandler,
std::__1::allocator<starspace::LayerDataHandler> >::__on_zero_shared'
requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note:
in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<starspace::LayerDataHandler,
std::__1::allocator<starspace::LayerDataHandler>
>::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Args> &>'
requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note:
in instantiation of function template specialization
'std::__1::shared_ptr<starspace::LayerDataHandler>::make_shared<std::__1::shared_ptr<starspace::Args>
&>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:65:12: note: in instantiation of function template
specialization 'std::__1::make_shared<starspace::LayerDataHandler,
std::__1::shared_ptr<starspace::Args> &>' requested here
return make_shared<LayerDataHandler>(args_);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:23: note:
qualify call to silence this warning
__data_.second().~_Tp();
^
4 warnings generated.
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c rcpp_textspace.cpp -o rcpp_textspace.o
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c compliance.cpp -o compliance.o
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/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 ruimtehol.so Starspace/src/utils/args.o Starspace/src/utils/normalize.o Starspace/src/utils/utils.o Starspace/src/data.o Starspace/src/dict.o Starspace/src/doc_data.o Starspace/src/doc_parser.o Starspace/src/model.o Starspace/src/parser.o Starspace/src/proj.o Starspace/src/starspace.o rcpp_textspace.o compliance.o RcppExports.o -pthread -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
rm -f Starspace/src/utils/args.o Starspace/src/utils/normalize.o Starspace/src/utils/utils.o Starspace/src/data.o Starspace/src/dict.o Starspace/src/doc_data.o Starspace/src/doc_parser.o Starspace/src/model.o Starspace/src/parser.o Starspace/src/proj.o Starspace/src/starspace.o rcpp_textspace.o compliance.o RcppExports.o
installing to /private/var/folders/rk/mm6mn1y50ll38rhm2ft7ndj80000gn/T/Rtmpps9Fdm/devtools_install_c41747c27418/ruimtehol/libs
* DONE (ruimtehol)
> data("dekamer", package = "ruimtehol")
> dekamer$x <- strsplit(dekamer$question, "\\W")
dekamer$x <- sapply(dekamer$x, FUN = function(x) paste(setdiff(x, ""), collapse = " "))
dekamer$x <- tolower(dekamer$x)
dekamer$y <- strsplit(dekamer$question_theme, split = ",")
dekamer$y <- lapply(dekamer$y, FUN=function(x) gsub(" ", "-", x))
set.seed(123456789)
e = " "))$x <- sapply(dekamer$x, FUN = function(x) paste(setdiff(x, ""), collaps
> dekamer$x <- tolower(dekamer$x)
> dekamer$y <- strsplit(dekamer$question_theme, split = ",")
> dekamer$y <- lapply(dekamer$y, FUN=function(x) gsub(" ", "-", x))
>
> set.seed(123456789)
> model <- embed_tagspace(x = dekamer$x, y = dekamer$y,
+ dim = 50,
+ lr = 0.01, epoch = 40, loss = "softmax", adagrad = TRUE,
+ similarity = "cosine", negSearchLimit = 50,
+ ngrams = 2, minCount = 2)
>
Start to initialize starspace model.
Build dict from input file : /var/folders/rk/mm6mn1y50ll38rhm2ft7ndj80000gn/T//Rtmpps9Fdm/textspace_c4172f53f876.txt
Read 0M words
Number of words in dictionary: 13417
Number of labels in dictionary: 1299
Loading data from file : /var/folders/rk/mm6mn1y50ll38rhm2ft7ndj80000gn/T//Rtmpps9Fdm/textspace_c4172f53f876.txt
Total number of examples loaded : 2858
Loading data from file : /var/folders/rk/mm6mn1y50ll38rhm2ft7ndj80000gn/T//Rtmpps9Fdm/textspace_validation_c41731dd2340.txt
Total number of examples loaded : 952
2019-01-22 20:26:21 Start training epoch 1 with learning rate 0.01
... Then I wait but nothing so I stopped it
Process 50199 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
frame #0: 0x00007fff5c9d194e libsystem_kernel.dylib`__ulock_wait + 10
libsystem_kernel.dylib`__ulock_wait:
-> 0x7fff5c9d194e <+10>: jae 0x7fff5c9d1958 ; <+20>
0x7fff5c9d1950 <+12>: movq %rax, %rdi
0x7fff5c9d1953 <+15>: jmp 0x7fff5c9cf3b7 ; cerror_nocancel
0x7fff5c9d1958 <+20>: retq
Target 0: (R) stopped.
Do you have an advice or a hint for next step in this bug search ? If I can help.
Guillaume
Hi Guillaume,
Thanks for the message. I know from some other people there are issues on Mac. I only tested the package on Windows and a bunch of Linux variants. I unfortunately do not have a Mac at my disposal so I can not debug what is going on on the Mac side. Looks like a race condition on the paralleld updates of the hogwild algorithm but I'm not sure. Any chance I can borrow your Mac?
Another possibility is that I've should not have included that compliance.h file
Maybe what you can do is remove the -include compliance.h
statement from the Makevars file in the src directory as well as remove the SOURCES += compliance.cpp
statment and rebuild the R package and run the code again to see if that caused the problem on Mac.
Can you do that?
Ok, I try this and let you know what happened.
I removed the two. Unfortunately it's the same, blocked on epoch 1.
I think the issue is the same as reported by @good-marketing in issue https://github.com/bnosac/ruimtehol/issues/2 There @good-marketing used commit https://github.com/bnosac/ruimtehol/commit/ba6ca68e525ef624a7890fa50df7b9e0fcadba2e At that timepoint the only fix I've made to the Starspace C++ code was to make the train function return the loss so that I could make a plot function for the evolution of the loss. In order to debug this, I would try out 2 checks
cd ruimtehol git checkout d79b6866ee1cb8923a576d024744f505ed30ba7c cd .. R CMD INSTALL ruimtehol
R
library(fastrtext) library(ruimtehol) data(train_sentences, package = "fastrtext")
filename <- tempfile() writeLines(text = paste(paste0("label", train_sentences$class.text), tolower(train_sentences$text)), con = filename)
model <- starspace(file = filename, trainMode = 0, label = "label", similarity = "dot", verbose = TRUE, initRandSd = 0.01, adagrad = FALSE, ngrams = 1, lr = 0.01, epoch = 5, thread = 20, dim = 10, negSearchLimit = 5, maxNegSamples = 3)
2. Get the compilation information when you installed Starspace yourself on Mac - can you run make on the original Starspace C++ code and show me what that gave so that I can compare to the compilation trace that you showed above
Hopefully that would provide more information. Thanks for the help!
Ok,
For "any chance I borrow my mac", I don't know if it's possible (practically), perhaps we can see this by mail ?
I've tried adding breakpoint in c++ call when calling embed_tagspacebut this gives nothing, no error..
(...)
installing to /Library/Frameworks/R.framework/Versions/3.4/Resources/library/ruimtehol/libs
** R
** inst
** preparing package for lazy loading
** help
Warning: /Users/guillaumepressiat/Documents/debugs/ruimtehol/man/starspace_embedding.Rd:14: unknown macro '\t'
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (ruimtehol)
MacBook-Pro-de-Guillaume:debugs guillaumepressiat$ R
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)
R est un logiciel libre livré sans AUCUNE GARANTIE.
Vous pouvez le redistribuer sous certaines conditions.
Tapez 'license()' ou 'licence()' pour plus de détails.
R est un projet collaboratif avec de nombreux contributeurs.
Tapez 'contributors()' pour plus d'information et
'citation()' pour la façon de le citer dans les publications.
Tapez 'demo()' pour des démonstrations, 'help()' pour l'aide
en ligne ou 'help.start()' pour obtenir l'aide au format HTML.
Tapez 'q()' pour quitter R.
> library(fastrtext)
> library(ruimtehol)
> data(train_sentences, package = "fastrtext")
> filename <- tempfile()
> writeLines(text = paste(paste0("__label__", train_sentences$class.text), tolower(train_sentences$text)),
+ con = filename)
>
> model <- starspace(file = filename,
+ trainMode = 0, label = "__label__",
+ similarity = "dot", verbose = TRUE, initRandSd = 0.01, adagrad = FALSE,
+ ngrams = 1, lr = 0.01, epoch = 5, thread = 20, dim = 10, negSearchLimit = 5, maxNegSamples = 3)
Start to initialize starspace model.
Build dict from input file : /var/folders/rk/mm6mn1y50ll38rhm2ft7ndj80000gn/T//RtmpvWyRwT/filed036340ed990
Read 0M words
Number of words in dictionary: 5060
Number of labels in dictionary: 15
Loading data from file : /var/folders/rk/mm6mn1y50ll38rhm2ft7ndj80000gn/T//RtmpvWyRwT/filed036340ed990
Total number of examples loaded : 2517
Initialized model weights. Model size :
matrix : 5075 10
Training epoch 0: 0.01 0.002
Epoch: 99.2% lr: 0.008000 loss: 0.021181 eta: <1min tot: 0h0m0s (19.8%
MacBook-Pro-de-Guillaume:StarSpace guillaumepressiat$ make
g++ -pthread -std=gnu++11 -O3 -funroll-loops -g -c src/utils/normalize.cpp
g++ -pthread -std=gnu++11 -O3 -funroll-loops -g -c src/dict.cpp
g++ -pthread -std=gnu++11 -O3 -funroll-loops -g -c src/utils/args.cpp
g++ -pthread -std=gnu++11 -O3 -funroll-loops -I/usr/local/bin/boost_1_63_0/ -g -c src/proj.cpp
g++ -pthread -std=gnu++11 -O3 -funroll-loops -I/usr/local/bin/boost_1_63_0/ -g -c src/parser.cpp -o parser.o
g++ -pthread -std=gnu++11 -O3 -funroll-loops -g -c src/data.cpp -o data.o
g++ -pthread -std=gnu++11 -O3 -funroll-loops -I/usr/local/bin/boost_1_63_0/ -g -c src/model.cpp
In file included from src/model.cpp:10:
In file included from /usr/local/bin/boost_1_63_0/boost/archive/binary_iarchive.hpp:20:
In file included from /usr/local/bin/boost_1_63_0/boost/archive/binary_iarchive_impl.hpp:21:
In file included from /usr/local/bin/boost_1_63_0/boost/archive/basic_binary_iarchive.hpp:30:
In file included from /usr/local/bin/boost_1_63_0/boost/archive/detail/common_iarchive.hpp:23:
In file included from /usr/local/bin/boost_1_63_0/boost/archive/detail/interface_iarchive.hpp:22:
/usr/local/bin/boost_1_63_0/boost/archive/detail/iserializer.hpp:69:7: warning: macro expansion producing 'defined' has undefined
behavior [-Wexpansion-to-defined]
#if ! DONT_USE_HAS_NEW_OPERATOR
^
/usr/local/bin/boost_1_63_0/boost/archive/detail/iserializer.hpp:63:12: note: expanded from macro 'DONT_USE_HAS_NEW_OPERATOR'
|| defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590) \
^
/usr/local/bin/boost_1_63_0/boost/archive/detail/iserializer.hpp:212:9: warning: macro expansion producing 'defined' has undefined
behavior [-Wexpansion-to-defined]
#if DONT_USE_HAS_NEW_OPERATOR
^
/usr/local/bin/boost_1_63_0/boost/archive/detail/iserializer.hpp:63:12: note: expanded from macro 'DONT_USE_HAS_NEW_OPERATOR'
|| defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590) \
^
2 warnings generated.
g++ -pthread -std=gnu++11 -O3 -funroll-loops -I/usr/local/bin/boost_1_63_0/ -g -c src/starspace.cpp
g++ -pthread -std=gnu++11 -O3 -funroll-loops -I/usr/local/bin/boost_1_63_0/ -g -c src/doc_parser.cpp -o doc_parser.o
g++ -pthread -std=gnu++11 -O3 -funroll-loops -g -c src/doc_data.cpp -o doc_data.o
g++ -pthread -std=gnu++11 -O3 -funroll-loops -g -c src/utils/utils.cpp -o utils.o
g++ -pthread -std=gnu++11 -O3 -funroll-loops normalize.o dict.o args.o proj.o parser.o data.o model.o starspace.o doc_parser.o doc_data.o utils.o -I/usr/local/bin/boost_1_63_0/ -g src/main.cpp -o starspace
So 1. was on commit https://github.com/bnosac/ruimtehol/commit/ba6ca68e525ef624a7890fa50df7b9e0fcadba2e ? About 2. So you compiled Starspace with g++ and R package ruimtehol with clang++ and pthread was also different. I thought I've set that one in Makevars but apparently not for clang++
It looks to me like the trick will be make sure R uses g++ instead of clang++ by setting the right directive in src/Makevars
Can you add
CXX = g++
CXX11 = g++
to src/Makevars and see if it works by recompiling the package and using the example Starspace also uses that in their makefile https://github.com/facebookresearch/StarSpace/blob/master/makefile although they say in their README at https://github.com/facebookresearch/StarSpace/blob/master/README.md that clang-3.3 or newer should also work
About 2, yes indeed I've seen. Do I have to change something about c++ compiler on my own ? I have homebrew and "developper tools" installed on my mac. I think that fastrtext
works on my mac, maybe looking at this Makevars is an idea ?
Ok, I see your last point, I will give it a try.
For 1, you're right, I was on d79b686, here is the complete echo with the good one :
MacBook-Pro-de-Guillaume:~ guillaumepressiat$ cd Desktop/ruimtehol/
MacBook-Pro-de-Guillaume:ruimtehol guillaumepressiat$ git branch
* (HEAD detached at d79b686)
master
MacBook-Pro-de-Guillaume:ruimtehol guillaumepressiat$ git checkout ba6ca68e525ef624a7890fa50df7b9e0fcadba2e
Previous HEAD position was d79b686 with getNgramVector, we can also get unigram embeddings
HEAD is now at ba6ca68 Temporary fix for #2
MacBook-Pro-de-Guillaume:ruimtehol guillaumepressiat$ cd
MacBook-Pro-de-Guillaume:ruimtehol guillaumepressiat$ cd ..
MacBook-Pro-de-Guillaume:Desktop guillaumepressiat$ R CMD INSTALL ruimtehol
* installing to library ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library’
* installing *source* package ‘ruimtehol’ ...
** libs
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -include compliance.h -I./Starspace/src -Wno-sign-compare -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/utils/args.cpp -o Starspace/src/utils/args.o
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
[-Wunknown-warning-option]
1 warning generated.
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -include compliance.h -I./Starspace/src -Wno-sign-compare -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/utils/normalize.cpp -o Starspace/src/utils/normalize.o
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
[-Wunknown-warning-option]
1 warning generated.
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -include compliance.h -I./Starspace/src -Wno-sign-compare -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/utils/utils.cpp -o Starspace/src/utils/utils.o
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
[-Wunknown-warning-option]
In file included from Starspace/src/utils/utils.cpp:10:
Starspace/src/utils/utils.h:108:10: warning: unused variable 'pos' [-Wunused-variable]
auto pos = tellg(f);
^
2 warnings generated.
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -include compliance.h -I./Starspace/src -Wno-sign-compare -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/data.cpp -o Starspace/src/data.o
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
[-Wunknown-warning-option]
In file included from Starspace/src/data.cpp:12:
./Starspace/src/utils/utils.h:108:10: warning: unused variable 'pos' [-Wunused-variable]
auto pos = tellg(f);
^
2 warnings generated.
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -include compliance.h -I./Starspace/src -Wno-sign-compare -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/dict.cpp -o Starspace/src/dict.o
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
[-Wunknown-warning-option]
1 warning generated.
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -include compliance.h -I./Starspace/src -Wno-sign-compare -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/doc_data.cpp -o Starspace/src/doc_data.o
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
[-Wunknown-warning-option]
In file included from Starspace/src/doc_data.cpp:12:
./Starspace/src/utils/utils.h:108:10: warning: unused variable 'pos' [-Wunused-variable]
auto pos = tellg(f);
^
2 warnings generated.
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -include compliance.h -I./Starspace/src -Wno-sign-compare -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/doc_parser.cpp -o Starspace/src/doc_parser.o
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
[-Wunknown-warning-option]
1 warning generated.
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -include compliance.h -I./Starspace/src -Wno-sign-compare -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/model.cpp -o Starspace/src/model.o
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
[-Wunknown-warning-option]
Starspace/src/model.cpp:111:14: warning: unused variable 'dim' [-Wunused-variable]
const auto dim = a.size();
^
Starspace/src/model.cpp:301:13: warning: unused variable 'etas' [-Wunused-variable]
int etas = (eta - etah * 3600 - etam * 60);
^
Starspace/src/model.cpp:249:13: warning: unused variable 'elapsed' [-Wunused-variable]
int64_t elapsed;
^
Starspace/src/model.cpp:350:22: warning: variable 'doneTraining' used in loop condition not modified in loop body
[-Wfor-loop-analysis]
for (int i = 0; !doneTraining; i++) {
^~~~~~~~~~~~
Starspace/src/model.cpp:397:8: warning: unused variable 'negSim' [-Wunused-variable]
Real negSim = (std::numeric_limits<Real>::min)();
^
6 warnings generated.
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -include compliance.h -I./Starspace/src -Wno-sign-compare -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/parser.cpp -o Starspace/src/parser.o
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
[-Wunknown-warning-option]
1 warning generated.
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -include compliance.h -I./Starspace/src -Wno-sign-compare -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/proj.cpp -o Starspace/src/proj.o
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
[-Wunknown-warning-option]
1 warning generated.
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -include compliance.h -I./Starspace/src -Wno-sign-compare -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/starspace.cpp -o Starspace/src/starspace.o
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
[-Wunknown-warning-option]
In file included from Starspace/src/starspace.cpp:12:
In file included from ./Starspace/src/starspace.h:19:
./Starspace/src/utils/utils.h:108:10: warning: unused variable 'pos' [-Wunused-variable]
auto pos = tellg(f);
^
In file included from <built-in>:1:
In file included from ./compliance.h:2:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include/Rcpp.h:27:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include/RcppCommon.h:29:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include/Rcpp/r/headers.h:59:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include/Rcpp/platform/compiler.h:153:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/unordered_map:369:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__hash_table:16:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:5: warning:
destructor called on non-final 'starspace::DataParser' that has virtual functions but non-virtual destructor
[-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3617:9: note: in
instantiation of member function 'std::__1::__shared_ptr_emplace<starspace::DataParser,
std::__1::allocator<starspace::DataParser> >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note: in
instantiation of function template specialization 'std::__1::__shared_ptr_emplace<starspace::DataParser,
std::__1::allocator<starspace::DataParser> >::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note: in
instantiation of function template specialization
'std::__1::shared_ptr<starspace::DataParser>::make_shared<std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:35:15: note: in instantiation of function template specialization
'std::__1::make_shared<starspace::DataParser, std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
parser_ = make_shared<DataParser>(dict_, args_);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:23: note: qualify
call to silence this warning
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:5: warning:
destructor called on non-final 'starspace::LayerDataParser' that has virtual functions but non-virtual destructor
[-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3617:9: note: in
instantiation of member function 'std::__1::__shared_ptr_emplace<starspace::LayerDataParser,
std::__1::allocator<starspace::LayerDataParser> >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note: in
instantiation of function template specialization 'std::__1::__shared_ptr_emplace<starspace::LayerDataParser,
std::__1::allocator<starspace::LayerDataParser> >::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note: in
instantiation of function template specialization
'std::__1::shared_ptr<starspace::LayerDataParser>::make_shared<std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:37:15: note: in instantiation of function template specialization
'std::__1::make_shared<starspace::LayerDataParser, std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
parser_ = make_shared<LayerDataParser>(dict_, args_);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:23: note: qualify
call to silence this warning
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:5: warning:
destructor called on non-final 'starspace::InternDataHandler' that has virtual functions but non-virtual destructor
[-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3617:9: note: in
instantiation of member function 'std::__1::__shared_ptr_emplace<starspace::InternDataHandler,
std::__1::allocator<starspace::InternDataHandler> >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note: in
instantiation of function template specialization 'std::__1::__shared_ptr_emplace<starspace::InternDataHandler,
std::__1::allocator<starspace::InternDataHandler> >::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Args> &>'
requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note: in
instantiation of function template specialization
'std::__1::shared_ptr<starspace::InternDataHandler>::make_shared<std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:63:12: note: in instantiation of function template specialization
'std::__1::make_shared<starspace::InternDataHandler, std::__1::shared_ptr<starspace::Args> &>' requested here
return make_shared<InternDataHandler>(args_);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:23: note: qualify
call to silence this warning
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:5: warning:
destructor called on non-final 'starspace::LayerDataHandler' that has virtual functions but non-virtual destructor
[-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3617:9: note: in
instantiation of member function 'std::__1::__shared_ptr_emplace<starspace::LayerDataHandler,
std::__1::allocator<starspace::LayerDataHandler> >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note: in
instantiation of function template specialization 'std::__1::__shared_ptr_emplace<starspace::LayerDataHandler,
std::__1::allocator<starspace::LayerDataHandler> >::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Args> &>' requested
here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note: in
instantiation of function template specialization
'std::__1::shared_ptr<starspace::LayerDataHandler>::make_shared<std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:65:12: note: in instantiation of function template specialization
'std::__1::make_shared<starspace::LayerDataHandler, std::__1::shared_ptr<starspace::Args> &>' requested here
return make_shared<LayerDataHandler>(args_);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:23: note: qualify
call to silence this warning
__data_.second().~_Tp();
^
6 warnings generated.
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -include compliance.h -I./Starspace/src -Wno-sign-compare -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c rcpp_textspace.cpp -o rcpp_textspace.o
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
[-Wunknown-warning-option]
In file included from rcpp_textspace.cpp:2:
In file included from ./Starspace/src/starspace.h:19:
./Starspace/src/utils/utils.h:108:10: warning: unused variable 'pos' [-Wunused-variable]
auto pos = tellg(f);
^
2 warnings generated.
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -include compliance.h -I./Starspace/src -Wno-sign-compare -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c compliance.cpp -o compliance.o
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
[-Wunknown-warning-option]
1 warning generated.
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -include compliance.h -I./Starspace/src -Wno-sign-compare -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
[-Wunknown-warning-option]
1 warning generated.
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 ruimtehol.so Starspace/src/utils/args.o Starspace/src/utils/normalize.o Starspace/src/utils/utils.o Starspace/src/data.o Starspace/src/dict.o Starspace/src/doc_data.o Starspace/src/doc_parser.o Starspace/src/model.o Starspace/src/parser.o Starspace/src/proj.o Starspace/src/starspace.o rcpp_textspace.o compliance.o RcppExports.o -pthread -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
rm -f Starspace/src/utils/args.o Starspace/src/utils/normalize.o Starspace/src/utils/utils.o Starspace/src/data.o Starspace/src/dict.o Starspace/src/doc_data.o Starspace/src/doc_parser.o Starspace/src/model.o Starspace/src/parser.o Starspace/src/proj.o Starspace/src/starspace.o rcpp_textspace.o compliance.o RcppExports.o
installing to /Library/Frameworks/R.framework/Versions/3.4/Resources/library/ruimtehol/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (ruimtehol)
MacBook-Pro-de-Guillaume:Desktop guillaumepressiat$ R
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)
R est un logiciel libre livré sans AUCUNE GARANTIE.
Vous pouvez le redistribuer sous certaines conditions.
Tapez 'license()' ou 'licence()' pour plus de détails.
R est un projet collaboratif avec de nombreux contributeurs.
Tapez 'contributors()' pour plus d'information et
'citation()' pour la façon de le citer dans les publications.
Tapez 'demo()' pour des démonstrations, 'help()' pour l'aide
en ligne ou 'help.start()' pour obtenir l'aide au format HTML.
Tapez 'q()' pour quitter R.
>
> library(fastrtext)
> library(ruimtehol)
> data(train_sentences, package = "fastrtext")
>
> filename <- tempfile()
> writeLines(text = paste(paste0("__label__", train_sentences$class.text), tolower(train_sentences$text)),
+ con = filename)
>
> model <- starspace(file = filename,
+ trainMode = 0, label = "__label__",
+ similarity = "dot", verbose = TRUE, initRandSd = 0.01, adagrad = FALSE,
+ ngrams = 1, lr = 0.01, epoch = 5, thread = 20, dim = 10, negSearchLimit = 5, maxNegSamples = 3)
Start to initialize starspace model.
Build dict from input file : /var/folders/rk/mm6mn1y50ll38rhm2ft7ndj80000gn/T//RtmpczYKeR/filed1a57b8d3284
Read 0M words
Number of words in dictionary: 5060
Number of labels in dictionary: 15
Loading data from file : /var/folders/rk/mm6mn1y50ll38rhm2ft7ndj80000gn/T//RtmpczYKeR/filed1a57b8d3284
Total number of examples loaded : 2517
Initialized model weights. Model size :
matrix : 5075 10
Training epoch 0: 0.01 0.002
Epoch: 99.2% lr: 0.008000 loss: 0.021184 eta: <1min tot: 0h0m0s (19.8%)
It gives the same..
Hi,
I've tested by adding the two lines in Makevars and it doesn't change anything about bug when loading the model. I've also updated R to the latest version to see if a hypothetic bug with clang was resolved, but no change.
Then I've tried to reinstall fastrtext from source with devtools and I also have clang++ for compiler. I think this part is ok on a mac because this package works fine.
I don't have my macbook with me today so I can't continue today.
Maybe the special condition on boost library when installing Starpsace make Starpsace search boost where it's not ? BH import needed ? I say that because in comparison fasttext doesn't need this boost library condition.
If you have any other idea, I will be glad to help, but I have very few skills with Rcpp for the moment and I'm not sure to really help you.
Did it still use clang++ instead of g++ when you compiled the ruimtehol R package with the change in the Makevars. As long as it still used clang++ that will apparently not work for Mac. We just need to set the right compiler directive in Makevars so that it uses g++ instead of clang++ and then it will work on Mac.
Yes it stills use clang. I will search and try other possibilities for setting the right c++ compiler.
FYI. Asked this on R-pkg-devel https://stat.ethz.ch/pipermail/r-package-devel/2019q1/003434.html It looks to me like to be a problem with clang++ on the original Starspace C++ code. Can you build the original Starspace C++ code with clang++ by replacing g++ in https://github.com/facebookresearch/StarSpace/blob/master/makefile with clang++ and executing a Starspace example? If that shows that after iteration 1 it still hangs, we can bug the Starspace authors with it.
Thanks for info. I read some pages about configure files, maybe it's needed for this context, just on mac...
Good idea, I will check that soon.
I've just tested compiling StarSpace with clang++, it works.
MacBook-Pro-de-Guillaume:~ guillaumepressiat$ cd StarSpace/
MacBook-Pro-de-Guillaume:StarSpace guillaumepressiat$ ls
CODE_OF_CONDUCT.md MVS makefile
CONTRIBUTING.md README.md src
LICENSE.md examples
MacBook-Pro-de-Guillaume:StarSpace guillaumepressiat$ make
clang++ -pthread -std=gnu++11 -O3 -funroll-loops -g -c src/utils/normalize.cpp
clang++ -pthread -std=gnu++11 -O3 -funroll-loops -g -c src/dict.cpp
clang++ -pthread -std=gnu++11 -O3 -funroll-loops -g -c src/utils/args.cpp
clang++ -pthread -std=gnu++11 -O3 -funroll-loops -I/usr/local/bin/boost_1_63_0/ -g -c src/proj.cpp
clang++ -pthread -std=gnu++11 -O3 -funroll-loops -I/usr/local/bin/boost_1_63_0/ -g -c src/parser.cpp -o parser.o
clang++ -pthread -std=gnu++11 -O3 -funroll-loops -g -c src/data.cpp -o data.o
clang++ -pthread -std=gnu++11 -O3 -funroll-loops -I/usr/local/bin/boost_1_63_0/ -g -c src/model.cpp
In file included from src/model.cpp:10:
In file included from /usr/local/bin/boost_1_63_0/boost/archive/binary_iarchive.hpp:20:
In file included from /usr/local/bin/boost_1_63_0/boost/archive/binary_iarchive_impl.hpp:21:
In file included from /usr/local/bin/boost_1_63_0/boost/archive/basic_binary_iarchive.hpp:30:
In file included from /usr/local/bin/boost_1_63_0/boost/archive/detail/common_iarchive.hpp:23:
In file included from /usr/local/bin/boost_1_63_0/boost/archive/detail/interface_iarchive.hpp:22:
/usr/local/bin/boost_1_63_0/boost/archive/detail/iserializer.hpp:69:7: warning: macro expansion
producing 'defined' has undefined behavior [-Wexpansion-to-defined]
#if ! DONT_USE_HAS_NEW_OPERATOR
^
/usr/local/bin/boost_1_63_0/boost/archive/detail/iserializer.hpp:63:12: note: expanded from
macro 'DONT_USE_HAS_NEW_OPERATOR'
|| defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590) \
^
/usr/local/bin/boost_1_63_0/boost/archive/detail/iserializer.hpp:212:9: warning: macro
expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
#if DONT_USE_HAS_NEW_OPERATOR
^
/usr/local/bin/boost_1_63_0/boost/archive/detail/iserializer.hpp:63:12: note: expanded from
macro 'DONT_USE_HAS_NEW_OPERATOR'
|| defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590) \
^
2 warnings generated.
clang++ -pthread -std=gnu++11 -O3 -funroll-loops -I/usr/local/bin/boost_1_63_0/ -g -c src/starspace.cpp
clang++ -pthread -std=gnu++11 -O3 -funroll-loops -I/usr/local/bin/boost_1_63_0/ -g -c src/doc_parser.cpp -o doc_parser.o
clang++ -pthread -std=gnu++11 -O3 -funroll-loops -g -c src/doc_data.cpp -o doc_data.o
clang++ -pthread -std=gnu++11 -O3 -funroll-loops -g -c src/utils/utils.cpp -o utils.o
clang++ -pthread -std=gnu++11 -O3 -funroll-loops normalize.o dict.o args.o proj.o parser.o data.o model.o starspace.o doc_parser.o doc_data.o utils.o -I/usr/local/bin/boost_1_63_0/ -g src/main.cpp -o starspace
MacBook-Pro-de-Guillaume:StarSpace guillaumepressiat$ sudo mv starspace /usr/local/bin
And then :
Start to initialize starspace model.
Build dict from input file : test_clang_in.txt
Read 0M words
Number of words in dictionary: 2198
Number of labels in dictionary: 552
Loading data from file : test_clang_in.txt
Total number of examples loaded : 50000
Training epoch 0: 0.01 0.002
Epoch: 100.0% lr: 0.008000 loss: 0.016909 eta: <1min tot: 0h0m6s (20.0%)
---+++ Epoch 0 Train error : 0.01731805 +++--- ☃
Training epoch 1: 0.008 0.002
Epoch: 100.0% lr: 0.006000 loss: 0.004157 eta: <1min tot: 0h0m13s (40.0%)
---+++ Epoch 1 Train error : 0.00409335 +++--- ☃
Training epoch 2: 0.006 0.002
Epoch: 100.0% lr: 0.004040 loss: 0.003052 eta: <1min tot: 0h0m19s (60.0%)
---+++ Epoch 2 Train error : 0.00313555 +++--- ☃
Training epoch 3: 0.004 0.002
Epoch: 100.0% lr: 0.002000 loss: 0.002634 eta: <1min tot: 0h0m26s (80.0%)
---+++ Epoch 3 Train error : 0.00264400 +++--- ☃
Training epoch 4: 0.002 0.002
Epoch: 100.0% lr: 0.000000 loss: 0.002154 eta: <1min tot: 0h0m32s (100.0%)
---+++ Epoch 4 Train error : 0.00215806 +++--- ☃
Saving model to file : test_clang_out
Saving model in tsv format : test_clang_out.tsv
So clang++ seems not to be the cause after all. So we have
Starspace is working with clang++
clang++ -pthread -std=gnu++11 -O3 -funroll-loops -I/usr/local/bin/boost_1_63_0/ -g -c src/starspace.cpp
ruimtehol with commit d79b6866ee1cb8923a576d024744f505ed30ba7c did not make any changes to the Starspace C++ and failed with
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -DSTRICT_R_HEADERS -include compliance.h -I./Starspace/src -Wno-sign-compare -Wno-unused-value -Wno-unused-variable -Wno-unused-but-set-variable -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
So it looks like we need to add -pthread -O3 -funroll-loops
Can you reinstall the ruimtehol R package by changing line in src/Makevars where it says
PKG_CPPFLAGS = -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h $(SHLIB_PTHREAD_FLAGS) -I./Starspace/src
to
PKG_CPPFLAGS = -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -pthread -O3 -funroll-loops -I./Starspace/src
And execute the R example again?
Hi,
Yes I've seen this funroll-loops too, you're right it's seems logic to add it. But unfortunately it doesn't change the problem.
I just print the end of compilation here, let me know if you want more things.
4 warnings generated.
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -pthread -O3 -funroll-loops -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c rcpp_textspace.cpp -o rcpp_textspace.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -pthread -O3 -funroll-loops -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c compliance.cpp -o compliance.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -pthread -O3 -funroll-loops -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/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 ruimtehol.so Starspace/src/utils/args.o Starspace/src/utils/normalize.o Starspace/src/utils/utils.o Starspace/src/data.o Starspace/src/dict.o Starspace/src/doc_data.o Starspace/src/doc_parser.o Starspace/src/model.o Starspace/src/parser.o Starspace/src/proj.o Starspace/src/starspace.o rcpp_textspace.o compliance.o RcppExports.o -pthread -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
rm -f Starspace/src/utils/args.o Starspace/src/utils/normalize.o Starspace/src/utils/utils.o Starspace/src/data.o Starspace/src/dict.o Starspace/src/doc_data.o Starspace/src/doc_parser.o Starspace/src/model.o Starspace/src/parser.o Starspace/src/proj.o Starspace/src/starspace.o rcpp_textspace.o compliance.o RcppExports.o
installing to /Library/Frameworks/R.framework/Versions/3.5/Resources/library/ruimtehol/libs
This is unexpected can you do the same on ruimtehol commit d79b6866ee1cb8923a576d024744f505ed30ba7c At that commit I really had not made any relevant changes to the Starspace C++ code.
cd ruimtehol
git checkout d79b6866ee1cb8923a576d024744f505ed30ba7c
cd ..
change in src/Makevars
PKG_CPPFLAGS = -DSTRICT_R_HEADERS -pthread -O3 -funroll-loops -I./Starspace/src
R CMD INSTALL ruimtehol
R
library(fastrtext)
library(ruimtehol)
data(train_sentences, package = "fastrtext")
filename <- tempfile()
writeLines(text = paste(paste0("__label__", train_sentences$class.text), tolower(train_sentences$text)),
con = filename)
model <- starspace(file = filename,
trainMode = 0, label = "__label__",
similarity = "dot", verbose = TRUE, initRandSd = 0.01, adagrad = FALSE,
ngrams = 1, lr = 0.01, epoch = 5, thread = 1, dim = 10, negSearchLimit = 5, maxNegSamples = 3)
Hi,
I've done that, but this doesn't work either. Sorry to only tell bad news !
hmm. Can you show me the logs of that install so that I can see the compilation execution.
Here is the log.
Last login: Sat Jan 26 16:25:40 on ttys000
MBPdeGuillaume:~ guillaumepressiat$ cd Documents/debugs/
MBPdeGuillaume:debugs guillaumepressiat$ mkdir hmm
MBPdeGuillaume:debugs guillaumepressiat$ cd hmm
MBPdeGuillaume:hmm guillaumepressiat$ git clone https://github.com/bnosac/ruimtehol.git
Cloning into 'ruimtehol'...
remote: Enumerating objects: 174, done.
remote: Counting objects: 100% (174/174), done.
remote: Compressing objects: 100% (97/97), done.
remote: Total 1174 (delta 102), reused 130 (delta 77), pack-reused 1000
Receiving objects: 100% (1174/1174), 40.08 MiB | 15.17 MiB/s, done.
Resolving deltas: 100% (810/810), done.
MBPdeGuillaume:hmm guillaumepressiat$ cd ruimtehol/
MBPdeGuillaume:ruimtehol guillaumepressiat$ git checkout d79b6866ee1cb8923a576d024744f505ed30ba7c
Note: checking out 'd79b6866ee1cb8923a576d024744f505ed30ba7c'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at d79b686 with getNgramVector, we can also get unigram embeddings
MBPdeGuillaume:ruimtehol guillaumepressiat$ cd ..
MBPdeGuillaume:hmm guillaumepressiat$ R CMD INSTALL ruimtehol
* installing to library ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library’
* installing *source* package ‘ruimtehol’ ...
** libs
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -pthread -O3 -funroll-loops -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/utils/args.cpp -o Starspace/src/utils/args.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -pthread -O3 -funroll-loops -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/utils/normalize.cpp -o Starspace/src/utils/normalize.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -pthread -O3 -funroll-loops -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/utils/utils.cpp -o Starspace/src/utils/utils.o
In file included from Starspace/src/utils/utils.cpp:10:
Starspace/src/utils/utils.h:108:10: warning: unused variable 'pos' [-Wunused-variable]
auto pos = tellg(f);
^
1 warning generated.
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -pthread -O3 -funroll-loops -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/data.cpp -o Starspace/src/data.o
In file included from Starspace/src/data.cpp:12:
./Starspace/src/utils/utils.h:108:10: warning: unused variable 'pos' [-Wunused-variable]
auto pos = tellg(f);
^
1 warning generated.
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -pthread -O3 -funroll-loops -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/dict.cpp -o Starspace/src/dict.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -pthread -O3 -funroll-loops -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/doc_data.cpp -o Starspace/src/doc_data.o
In file included from Starspace/src/doc_data.cpp:12:
./Starspace/src/utils/utils.h:108:10: warning: unused variable 'pos' [-Wunused-variable]
auto pos = tellg(f);
^
1 warning generated.
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -pthread -O3 -funroll-loops -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/doc_parser.cpp -o Starspace/src/doc_parser.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -pthread -O3 -funroll-loops -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/model.cpp -o Starspace/src/model.o
Starspace/src/model.cpp:111:14: warning: unused variable 'dim' [-Wunused-variable]
const auto dim = a.size();
^
Starspace/src/model.cpp:301:13: warning: unused variable 'etas' [-Wunused-variable]
int etas = (eta - etah * 3600 - etam * 60);
^
Starspace/src/model.cpp:249:13: warning: unused variable 'elapsed' [-Wunused-variable]
int64_t elapsed;
^
Starspace/src/model.cpp:350:22: warning: variable 'doneTraining' used in loop condition not modified in loop body [-Wfor-loop-analysis]
for (int i = 0; !doneTraining; i++) {
^~~~~~~~~~~~
Starspace/src/model.cpp:397:8: warning: unused variable 'negSim' [-Wunused-variable]
Real negSim = (std::numeric_limits<Real>::min)();
^
5 warnings generated.
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -pthread -O3 -funroll-loops -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/parser.cpp -o Starspace/src/parser.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -pthread -O3 -funroll-loops -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/proj.cpp -o Starspace/src/proj.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -pthread -O3 -funroll-loops -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/starspace.cpp -o Starspace/src/starspace.o
In file included from Starspace/src/starspace.cpp:11:
In file included from ./Starspace/src/starspace.h:18:
./Starspace/src/utils/utils.h:108:10: warning: unused variable 'pos' [-Wunused-variable]
auto pos = tellg(f);
^
In file included from Starspace/src/starspace.cpp:11:
In file included from ./Starspace/src/starspace.h:12:
In file included from ./Starspace/src/utils/args.h:12:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iostream:38:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:477:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string_view:176:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__string:56:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:643:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:5: warning: destructor called on non-final 'starspace::DataParser' that has virtual
functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3617:9: note: in instantiation of member function
'std::__1::__shared_ptr_emplace<starspace::DataParser, std::__1::allocator<starspace::DataParser> >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note: in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<starspace::DataParser, std::__1::allocator<starspace::DataParser> >::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note: in instantiation of function template specialization
'std::__1::shared_ptr<starspace::DataParser>::make_shared<std::__1::shared_ptr<starspace::Dictionary> &, std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:34:15: note: in instantiation of function template specialization 'std::__1::make_shared<starspace::DataParser, std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
parser_ = make_shared<DataParser>(dict_, args_);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:23: note: qualify call to silence this warning
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:5: warning: destructor called on non-final 'starspace::LayerDataParser' that has
virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3617:9: note: in instantiation of member function
'std::__1::__shared_ptr_emplace<starspace::LayerDataParser, std::__1::allocator<starspace::LayerDataParser> >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note: in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<starspace::LayerDataParser, std::__1::allocator<starspace::LayerDataParser> >::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note: in instantiation of function template specialization
'std::__1::shared_ptr<starspace::LayerDataParser>::make_shared<std::__1::shared_ptr<starspace::Dictionary> &, std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:36:15: note: in instantiation of function template specialization 'std::__1::make_shared<starspace::LayerDataParser, std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
parser_ = make_shared<LayerDataParser>(dict_, args_);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:23: note: qualify call to silence this warning
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:5: warning: destructor called on non-final 'starspace::InternDataHandler' that has
virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3617:9: note: in instantiation of member function
'std::__1::__shared_ptr_emplace<starspace::InternDataHandler, std::__1::allocator<starspace::InternDataHandler> >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note: in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<starspace::InternDataHandler, std::__1::allocator<starspace::InternDataHandler> >::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Args> &>' requested
here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note: in instantiation of function template specialization
'std::__1::shared_ptr<starspace::InternDataHandler>::make_shared<std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:62:12: note: in instantiation of function template specialization 'std::__1::make_shared<starspace::InternDataHandler, std::__1::shared_ptr<starspace::Args> &>'
requested here
return make_shared<InternDataHandler>(args_);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:23: note: qualify call to silence this warning
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:5: warning: destructor called on non-final 'starspace::LayerDataHandler' that has
virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3617:9: note: in instantiation of member function
'std::__1::__shared_ptr_emplace<starspace::LayerDataHandler, std::__1::allocator<starspace::LayerDataHandler> >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note: in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<starspace::LayerDataHandler, std::__1::allocator<starspace::LayerDataHandler> >::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Args> &>' requested
here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note: in instantiation of function template specialization
'std::__1::shared_ptr<starspace::LayerDataHandler>::make_shared<std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:64:12: note: in instantiation of function template specialization 'std::__1::make_shared<starspace::LayerDataHandler, std::__1::shared_ptr<starspace::Args> &>'
requested here
return make_shared<LayerDataHandler>(args_);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:23: note: qualify call to silence this warning
__data_.second().~_Tp();
^
5 warnings generated.
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -pthread -O3 -funroll-loops -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c rcpp_textspace.cpp -o rcpp_textspace.o
In file included from rcpp_textspace.cpp:2:
In file included from ./Starspace/src/starspace.h:18:
./Starspace/src/utils/utils.h:108:10: warning: unused variable 'pos' [-Wunused-variable]
auto pos = tellg(f);
^
1 warning generated.
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DSTRICT_R_HEADERS -pthread -O3 -funroll-loops -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -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 ruimtehol.so Starspace/src/utils/args.o Starspace/src/utils/normalize.o Starspace/src/utils/utils.o Starspace/src/data.o Starspace/src/dict.o Starspace/src/doc_data.o Starspace/src/doc_parser.o Starspace/src/model.o Starspace/src/parser.o Starspace/src/proj.o Starspace/src/starspace.o rcpp_textspace.o RcppExports.o -pthread -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
rm -f Starspace/src/utils/args.o Starspace/src/utils/normalize.o Starspace/src/utils/utils.o Starspace/src/data.o Starspace/src/dict.o Starspace/src/doc_data.o Starspace/src/doc_parser.o Starspace/src/model.o Starspace/src/parser.o Starspace/src/proj.o Starspace/src/starspace.o rcpp_textspace.o RcppExports.o
installing to /Library/Frameworks/R.framework/Versions/3.5/Resources/library/ruimtehol/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
Warning: /Users/guillaumepressiat/Documents/debugs/hmm/ruimtehol/man/starspace_embedding.Rd:14: unknown macro '\t'
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (ruimtehol)
MBPdeGuillaume:hmm guillaumepressiat$ R
R version 3.5.2 (2018-12-20) -- "Eggshell Igloo"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)
R est un logiciel libre livré sans AUCUNE GARANTIE.
Vous pouvez le redistribuer sous certaines conditions.
Tapez 'license()' ou 'licence()' pour plus de détails.
R est un projet collaboratif avec de nombreux contributeurs.
Tapez 'contributors()' pour plus d'information et
'citation()' pour la façon de le citer dans les publications.
Tapez 'demo()' pour des démonstrations, 'help()' pour l'aide
en ligne ou 'help.start()' pour obtenir l'aide au format HTML.
Tapez 'q()' pour quitter R.
> library(fastrtext)
> library(ruimtehol)
> data(train_sentences, package = "fastrtext")
>
> filename <- tempfile()
> writeLines(text = paste(paste0("__label__", train_sentences$class.text), tolower(train_sentences$text)),
+ con = filename)
>
> model <- starspace(file = filename,
+ trainMode = 0, label = "__label__",
+ similarity = "dot", verbose = TRUE, initRandSd = 0.01, adagrad = FALSE,
+ ngrams = 1, lr = 0.01, epoch = 5, thread = 1, dim = 10, negSearchLimit = 5, maxNegSamples = 3)
Start to initialize starspace model.
Build dict from input file : /var/folders/rk/mm6mn1y50ll38rhm2ft7ndj80000gn/T//RtmphtOquM/file6c57c51b91a
Read 0M words
Number of words in dictionary: 5060
Number of labels in dictionary: 15
Loading data from file : /var/folders/rk/mm6mn1y50ll38rhm2ft7ndj80000gn/T//RtmphtOquM/file6c57c51b91a
Total number of examples loaded : 2517
Initialized model weights. Model size :
matrix : 5075 10
Training epoch 0: 0.01 0.002
Epoch: 100.0% lr: 0.008000 loss: 0.022627 eta: <1min tot: 0h0m0s (20.0%)
Further research should be better done by you on a mac, don't you think ?
Many thanks Guillaume. I'm out of ideas right now what the cause might be. I'll try to get a Mac somehow. To be continued!
Note
So probably issue is related to different compilers on Guillaume's machine compared to the rhub machine (probably just read https://cran.r-project.org/bin/macosx/tools, https://github.com/Rdatatable/data.table/wiki/Installation#openmp-enabled-compiler-for-mac or https://github.com/r-hub/homebrew-cran) - maybe an update of the xcode is needed. I'll publish the updated package with the -pthread in makevars again to CRAN to see what happens (Mac OS on CRAN is OS X 10.11.6 | Mac Pro, Quad-Core Intel Xeon 2.93 GHz | Xcode 8.2.1, clang 4.0.0, GNU Fortran 6.1) .
@GuillaumePressiat If you are still into this. Can you download the binary on https://artifacts.r-hub.io/ruimtehol_0.1.2.tar.gz-147a4e1367b49538e6134bf0fdf76a32/ruimtehol_0.1.2.tgz which was built on rhub install it at your site (package was built for R version 3.5.2 which seems to be also your R version) and let me know if the dekamer example now runs?
Nice to see that it's working somewhere else ! Good point.
For Xcode udpate I did it but I didn't do all the things listed in the data.table wiki. I've also tried tuning the ~/.R/Makevars file but not as indicated.
@jwijffels ok I'll try
Yes, it works with the binary you mention:
> model <- embed_tagspace(x = dekamer$x, y = dekamer$y,
+ dim = 50,
+ lr = 0.01, epoch = 5, loss = "softmax", adagrad = TRUE,
+ similarity = "cosine", negSearchLimit = 50,
+ ngrams = 2, minCount = 2)
Start to initialize starspace model.
Build dict from input file : /var/folders/rk/mm6mn1y50ll38rhm2ft7ndj80000gn/T//RtmpNIyLDQ/textspace_3476fae0afb.txt
Read 0M words
Number of words in dictionary: 13398
Number of labels in dictionary: 1316
Loading data from file : /var/folders/rk/mm6mn1y50ll38rhm2ft7ndj80000gn/T//RtmpNIyLDQ/textspace_3476fae0afb.txt
Total number of examples loaded : 2858
Loading data from file : /var/folders/rk/mm6mn1y50ll38rhm2ft7ndj80000gn/T//RtmpNIyLDQ/textspace_validation_347b531e05.txt
Total number of examples loaded : 952
2019-01-28 14:38:09 Start training epoch 1 with learning rate 0.01
> Training data error 3.79274
> Validation data error 3.67874
2019-01-28 14:38:10 Start training epoch 2 with learning rate 0.008
> Training data error 3.60102
> Validation data error 3.63535
2019-01-28 14:38:11 Start training epoch 3 with learning rate 0.006
> Training data error 3.48333
> Validation data error 3.61649
2019-01-28 14:38:12 Start training epoch 4 with learning rate 0.004
> Training data error 3.44108
> Validation data error 3.61201
2019-01-28 14:38:12 Start training epoch 5 with learning rate 0.002
> Training data error 3.42653
> Validation data error 3.59788
Good. Would you mind providing me the the compiling trace ofdevtools::install_github("bnosac/ruimtehol")
such that I can compare with the build on rhub (https://builder.r-hub.io/status/ruimtehol_0.1.2.tar.gz-147a4e1367b49538e6134bf0fdf76a32) which also has Mac OS running R 3.5.2 and next run the dekamer example again to see if it runs fine.
Could you also provide the output of
sw_vers
xcodebuild -version
clang --version
First:
MacBook-Pro-de-Guillaume:~ guillaumepressiat$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.14.3
BuildVersion: 18D42
MacBook-Pro-de-Guillaume:~ guillaumepressiat$ xcodebuild -version
Xcode 10.1
Build version 10B61
MacBook-Pro-de-Guillaume:~ guillaumepressiat$ clang --version
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
> devtools::install_github("bnosac/ruimtehol")
Downloading GitHub repo bnosac/ruimtehol@master
✔ checking for file ‘/private/var/folders/rk/mm6mn1y50ll38rhm2ft7ndj80000gn/T/RtmpAtKovA/remotes481547a2e24/bnosac-ruimtehol-fb78584/DESCRIPTION’ ...
─ preparing ‘ruimtehol’:
✔ checking DESCRIPTION meta-information ...
─ cleaning src
─ 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 ‘ruimtehol_0.1.2.tar.gz’
* installing *source* package ‘ruimtehol’ ...
** libs
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/utils/args.cpp -o Starspace/src/utils/args.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/utils/normalize.cpp -o Starspace/src/utils/normalize.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/utils/utils.cpp -o Starspace/src/utils/utils.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/data.cpp -o Starspace/src/data.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/dict.cpp -o Starspace/src/dict.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/doc_data.cpp -o Starspace/src/doc_data.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/doc_parser.cpp -o Starspace/src/doc_parser.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/model.cpp -o Starspace/src/model.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/parser.cpp -o Starspace/src/parser.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/proj.cpp -o Starspace/src/proj.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/starspace.cpp -o Starspace/src/starspace.o
In file included from <built-in>:1:
In file included from ./compliance.h:3:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp.h:27:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/RcppCommon.h:29:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/r/headers.h:59:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/platform/compiler.h:153:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/unordered_map:369:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__hash_table:16:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:5: warning: destructor called on non-final 'starspace::DataParser' that has virtual
functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3617:9: note: in instantiation of member function
'std::__1::__shared_ptr_emplace<starspace::DataParser, std::__1::allocator<starspace::DataParser> >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note: in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<starspace::DataParser, std::__1::allocator<starspace::DataParser> >::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note: in instantiation of function template specialization
'std::__1::shared_ptr<starspace::DataParser>::make_shared<std::__1::shared_ptr<starspace::Dictionary> &, std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:35:15: note: in instantiation of function template specialization 'std::__1::make_shared<starspace::DataParser, std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
parser_ = make_shared<DataParser>(dict_, args_);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:23: note: qualify call to silence this warning
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:5: warning: destructor called on non-final 'starspace::LayerDataParser' that has
virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3617:9: note: in instantiation of member function
'std::__1::__shared_ptr_emplace<starspace::LayerDataParser, std::__1::allocator<starspace::LayerDataParser> >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note: in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<starspace::LayerDataParser, std::__1::allocator<starspace::LayerDataParser> >::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note: in instantiation of function template specialization
'std::__1::shared_ptr<starspace::LayerDataParser>::make_shared<std::__1::shared_ptr<starspace::Dictionary> &, std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:37:15: note: in instantiation of function template specialization 'std::__1::make_shared<starspace::LayerDataParser, std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
parser_ = make_shared<LayerDataParser>(dict_, args_);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:23: note: qualify call to silence this warning
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:5: warning: destructor called on non-final 'starspace::InternDataHandler' that has
virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3617:9: note: in instantiation of member function
'std::__1::__shared_ptr_emplace<starspace::InternDataHandler, std::__1::allocator<starspace::InternDataHandler> >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note: in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<starspace::InternDataHandler, std::__1::allocator<starspace::InternDataHandler> >::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Args> &>' requested
here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note: in instantiation of function template specialization
'std::__1::shared_ptr<starspace::InternDataHandler>::make_shared<std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:63:12: note: in instantiation of function template specialization 'std::__1::make_shared<starspace::InternDataHandler, std::__1::shared_ptr<starspace::Args> &>'
requested here
return make_shared<InternDataHandler>(args_);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:23: note: qualify call to silence this warning
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:5: warning: destructor called on non-final 'starspace::LayerDataHandler' that has
virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3617:9: note: in instantiation of member function
'std::__1::__shared_ptr_emplace<starspace::LayerDataHandler, std::__1::allocator<starspace::LayerDataHandler> >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4277:26: note: in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<starspace::LayerDataHandler, std::__1::allocator<starspace::LayerDataHandler> >::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Args> &>' requested
here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4656:29: note: in instantiation of function template specialization
'std::__1::shared_ptr<starspace::LayerDataHandler>::make_shared<std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:65:12: note: in instantiation of function template specialization 'std::__1::make_shared<starspace::LayerDataHandler, std::__1::shared_ptr<starspace::Args> &>'
requested here
return make_shared<LayerDataHandler>(args_);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:3656:23: note: qualify call to silence this warning
__data_.second().~_Tp();
^
4 warnings generated.
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c rcpp_textspace.cpp -o rcpp_textspace.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c compliance.cpp -o compliance.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -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 ruimtehol.so Starspace/src/utils/args.o Starspace/src/utils/normalize.o Starspace/src/utils/utils.o Starspace/src/data.o Starspace/src/dict.o Starspace/src/doc_data.o Starspace/src/doc_parser.o Starspace/src/model.o Starspace/src/parser.o Starspace/src/proj.o Starspace/src/starspace.o rcpp_textspace.o compliance.o RcppExports.o -pthread -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
rm -f Starspace/src/utils/args.o Starspace/src/utils/normalize.o Starspace/src/utils/utils.o Starspace/src/data.o Starspace/src/dict.o Starspace/src/doc_data.o Starspace/src/doc_parser.o Starspace/src/model.o Starspace/src/parser.o Starspace/src/proj.o Starspace/src/starspace.o rcpp_textspace.o compliance.o RcppExports.o
installing to /Library/Frameworks/R.framework/Versions/3.5/Resources/library/ruimtehol/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
* DONE (ruimtehol)
Is that what you needed ? Do you want I run R CMD CHECK ?
Just running the example on dekamer to see if it is still blocked or not.
(Yes it's still blocked).
So this is yours
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -stdlib=libc++ -std=c++11 -fPIC -Wall -g -O2 -c Starspace/src/utils/args.cpp -o Starspace/src/utils/args.o
And this is rhub (which runs fin and gave the binary)
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Users/userouiyREod/R/Rcpp/include" -I"/Users/userouiyREod/R/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/utils/args.cpp -o Starspace/src/utils/args.o
The difference is your computer uses -stdlib=libc++ -std=c++11
Yes, my mistake. Since our last discussion I've tuned the ~/.R/Makevars with this line :
-stdlib=libc++ -std=c++11
. My apologies.
I've deleted it, rebuild it and the example is always blocked.
see here an extract from new build :
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/utils/args.cpp -o Starspace/src/utils/args.o
So that's now exactly the same of the rhub build which gave a good binary file. Can you also provide the compilation information of the linking. On rhub that was
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 ruimtehol.so Starspace/src/utils/args.o Starspace/src/utils/normalize.o Starspace/src/utils/utils.o Starspace/src/data.o Starspace/src/dict.o Starspace/src/doc_data.o Starspace/src/doc_parser.o Starspace/src/model.o Starspace/src/parser.o Starspace/src/proj.o Starspace/src/starspace.o rcpp_textspace.o compliance.o RcppExports.o -pthread -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
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 ruimtehol.so Starspace/src/utils/args.o Starspace/src/utils/normalize.o Starspace/src/utils/utils.o Starspace/src/data.o Starspace/src/dict.o Starspace/src/doc_data.o Starspace/src/doc_parser.o Starspace/src/model.o Starspace/src/parser.o Starspace/src/proj.o Starspace/src/starspace.o rcpp_textspace.o compliance.o RcppExports.o -pthread -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
Ok, also the same. So only difference will be the software you have on your computer
Do you have xcode CLT (command line tools)
Can you provide information on the Rcpp version you have installed.
Let me also put here the rhub compilation trace in case it gets deleted later on
Started by user r-hub Jenkins admin
Building remotely on 192.168.23.12-f4b6075d (slave r-release swarm elcapitan macos) in workspace /Users/rhub/macoscheck/workspace/ruimtehol_0.1.2.tar.gz-147a4e1367b49538e6134bf0fdf76a32
[ruimtehol_0.1.2.tar.gz-147a4e1367b49538e6134bf0fdf76a32] $ /bin/sh -xe /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/hudson7963279809941598929.sh
++R-HUB-R-HUB-R-HUBdate -u +%Y-%m-%dT%H:%M:%SZ
+R-HUB-R-HUB-R-HUBcurl https://builder.r-hub.io/build/in-progress/ruimtehol_0.1.2.tar.gz-147a4e1367b49538e6134bf0fdf76a32/2019-01-28T12:25:34Z
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 15 0 15 0 0 25 0 --:--:-- --:--:-- --:--:-- 25
{"status":"ok"}+R-HUB-R-HUB-R-HUBcp /Users/rhub/macoscheck/JSON.sh /Users/rhub/macoscheck/run.sh /Users/rhub/macoscheck/slave.sh .
+R-HUB-R-HUB-R-HUB./run.sh ruimtehol_0.1.2.tar.gz ruimtehol_0.1.2.tar.gz-147a4e1367b49538e6134bf0fdf76a32 http://builder.r-hub.io/file/147a4e1367b49538e6134bf0fdf76a32 '' '' '' false ruimtehol
>>>>>============== Creating user userouiyREod
Guest group exists
2019-01-28 04:25:35.728 sysadminctl[79134:2434374] Creating user record…
2019-01-28 04:25:37.417 sysadminctl[79134:2434374] Assigning UID: 503
2019-01-28 04:25:38.283 sysadminctl[79134:2434374] Home directory is assigned (not created!) at /Users/userouiyREod
>>>>>============== Downloading package
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 178 100 178 0 0 1964 0 --:--:-- --:--:-- --:--:-- 1977
0 3233k 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 3233k 100 3233k 0 0 3282k 0 --:--:-- --:--:-- --:--:-- 5425k
>>>>>============== Setting up home directory
Querying R version
>>>>>============== Running check
Setting up R environment
> source('https://bioconductor.org/biocLite.R')
Installing package into '/Users/userouiyREod/R'
(as 'lib' is unspecified)
trying URL 'https://bioconductor.org/packages/3.7/bioc/bin/macosx/el-capitan/contrib/3.5/BiocInstaller_1.30.0.tgz'
Content type 'application/x-gzip' length 84646 bytes (82 KB)
==================================================
downloaded 82 KB
The downloaded binary packages are in
/Users/userouiyREod/Rtemp/Rtmpi4k65D/downloaded_packages
Bioconductor version 3.7 (BiocInstaller 1.30.0), ?biocLite for help
A newer version of Bioconductor is available for this version of R,
?BiocUpgrade for help
>
>
Setting up Xvfb
>>>>>============== Installing package dependencies
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
_XSERVTransSocketUNIXCreateListener: mkdir(/tmp/.X11-unix) failed, errno = 2
_XSERVTransMakeAllCOTSServerListeners: failed to create listener for local
(EE)
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE)
41 114k 41 48310 0 0 79733 0 0:00:01 --:--:-- 0:00:01 79719
100 114k 100 114k 0 0 179k 0 --:--:-- --:--:-- --:--:-- 179k
> source("install-github.R")$value("r-pkgs/remotes@r-hub")
Downloading GitHub repo r-pkgs/remotes@r-hub
Running `R CMD build`...
* checking for file ‘/Users/userouiyREod/Rtemp/Rtmp5X9PuK/remotes135484b14fd50/r-lib-remotes-8556f2b/DESCRIPTION’ ... OK
* preparing ‘remotes’:
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building ‘remotes_1.1.1.9000.tar.gz’
Installing package into ‘/Users/userouiyREod/R’
(as ‘lib’ is unspecified)
* installing *source* package ‘remotes’ ...
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (remotes)
>
>
> remotes::install_local('ruimtehol_0.1.2.tar.gz', dependencies = TRUE, INSTALL_opts = '--build')
Needs update -----------------------------
package installed available is_cran remote
BH NA 1.69.0-1 TRUE CRAN
data.table NA 1.12.0 TRUE CRAN
Rcpp NA 1.0.0 TRUE CRAN
udpipe NA 0.8 TRUE CRAN
Installing 4 packages: BH, data.table, Rcpp, udpipe
Installing packages into ‘/Users/userouiyREod/R’
(as ‘lib’ is unspecified)
trying URL 'https://cran.r-hub.io/bin/macosx/el-capitan/contrib/3.5/BH_1.69.0-1.tgz'
Content type 'application/x-gzip' length 11725641 bytes (11.2 MB)
==================================================
downloaded 11.2 MB
trying URL 'https://cran.r-hub.io/bin/macosx/el-capitan/contrib/3.5/data.table_1.12.0.tgz'
Content type 'application/x-gzip' length 1766492 bytes (1.7 MB)
==================================================
downloaded 1.7 MB
trying URL 'https://cran.r-hub.io/bin/macosx/el-capitan/contrib/3.5/Rcpp_1.0.0.tgz'
Content type 'application/x-gzip' length 4535632 bytes (4.3 MB)
==================================================
downloaded 4.3 MB
trying URL 'https://cran.r-hub.io/bin/macosx/el-capitan/contrib/3.5/udpipe_0.8.tgz'
Content type 'application/x-gzip' length 9112495 bytes (8.7 MB)
==================================================
downloaded 8.7 MB
The downloaded binary packages are in
/Users/userouiyREod/Rtemp/RtmpnqcImo/downloaded_packages
Running `R CMD build`...
* checking for file ‘/Users/userouiyREod/Rtemp/RtmpnqcImo/remotes135794aa8217/ruimtehol/DESCRIPTION’ ... OK
* preparing ‘ruimtehol’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking vignette meta-information ... OK
* 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 ‘ruimtehol_0.1.2.tar.gz’
Installing package into ‘/Users/userouiyREod/R’
(as ‘lib’ is unspecified)
* installing *source* package ‘ruimtehol’ ...
** libs
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Users/userouiyREod/R/Rcpp/include" -I"/Users/userouiyREod/R/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/utils/args.cpp -o Starspace/src/utils/args.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Users/userouiyREod/R/Rcpp/include" -I"/Users/userouiyREod/R/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/utils/normalize.cpp -o Starspace/src/utils/normalize.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Users/userouiyREod/R/Rcpp/include" -I"/Users/userouiyREod/R/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/utils/utils.cpp -o Starspace/src/utils/utils.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Users/userouiyREod/R/Rcpp/include" -I"/Users/userouiyREod/R/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/data.cpp -o Starspace/src/data.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Users/userouiyREod/R/Rcpp/include" -I"/Users/userouiyREod/R/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/dict.cpp -o Starspace/src/dict.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Users/userouiyREod/R/Rcpp/include" -I"/Users/userouiyREod/R/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/doc_data.cpp -o Starspace/src/doc_data.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Users/userouiyREod/R/Rcpp/include" -I"/Users/userouiyREod/R/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/doc_parser.cpp -o Starspace/src/doc_parser.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Users/userouiyREod/R/Rcpp/include" -I"/Users/userouiyREod/R/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/model.cpp -o Starspace/src/model.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Users/userouiyREod/R/Rcpp/include" -I"/Users/userouiyREod/R/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/parser.cpp -o Starspace/src/parser.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Users/userouiyREod/R/Rcpp/include" -I"/Users/userouiyREod/R/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/proj.cpp -o Starspace/src/proj.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Users/userouiyREod/R/Rcpp/include" -I"/Users/userouiyREod/R/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c Starspace/src/starspace.cpp -o Starspace/src/starspace.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Users/userouiyREod/R/Rcpp/include" -I"/Users/userouiyREod/R/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c rcpp_textspace.cpp -o rcpp_textspace.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Users/userouiyREod/R/Rcpp/include" -I"/Users/userouiyREod/R/BH/include" -I/usr/local/include -fPIC -Wall -g -O2 -c compliance.cpp -o compliance.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src -I"/Users/userouiyREod/R/Rcpp/include" -I"/Users/userouiyREod/R/BH/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 ruimtehol.so Starspace/src/utils/args.o Starspace/src/utils/normalize.o Starspace/src/utils/utils.o Starspace/src/data.o Starspace/src/dict.o Starspace/src/doc_data.o Starspace/src/doc_parser.o Starspace/src/model.o Starspace/src/parser.o Starspace/src/proj.o Starspace/src/starspace.o rcpp_textspace.o compliance.o RcppExports.o -pthread -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
clang: warning: argument unused during compilation: '-pthread'
rm -f Starspace/src/utils/args.o Starspace/src/utils/normalize.o Starspace/src/utils/utils.o Starspace/src/data.o Starspace/src/dict.o Starspace/src/doc_data.o Starspace/src/doc_parser.o Starspace/src/model.o Starspace/src/parser.o Starspace/src/proj.o Starspace/src/starspace.o rcpp_textspace.o compliance.o RcppExports.o
installing to /Users/userouiyREod/R/ruimtehol/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
* creating tarball
packaged installation of ‘ruimtehol’ as ‘ruimtehol_0.1.2.tgz’
* DONE (ruimtehol)
>
>
>>>>>============== Running R CMD check
* using log directory ‘/Users/userouiyREod/ruimtehol.Rcheck’
* using R version 3.5.2 (2018-12-20)
* using platform: x86_64-apple-darwin15.6.0 (64-bit)
* using session charset: UTF-8
* checking for file ‘ruimtehol/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘ruimtehol’ version ‘0.1.2’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘ruimtehol’ can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of ‘data’ directory ... OK
* checking data for non-ASCII characters ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking line endings in Makefiles ... OK
* checking compilation flags in Makevars ... OK
* checking for GNU extensions in Makefiles ... NOTE
GNU make is a SystemRequirements.
* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
* checking include directives in Makefiles ... OK
* checking compiled code ... OK
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... OK
* checking running R code from vignettes ...
‘ground-control-to-ruimtehol.Rnw’ using ‘UTF-8’ ... OK
OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE
Status: 1 NOTE
See
‘/Users/userouiyREod/ruimtehol.Rcheck/00check.log’
for details.
>>>>>============== Done with R CMD check
Cleaning up Xvfb
No matching processes belonging to you were found
Saving artifacts
Cleaning up user and home directory
SSH: Connecting from host [Rhubs-Mac-3.local]
SSH: Connecting with configuration [files] ...
SSH: Disconnecting configuration [files] ...
SSH: Transferred 3 file(s)
Build step 'Send files or execute commands over SSH' changed build result to SUCCESS
Pinging https://builder.r-hub.io/build/SUCCESS/ruimtehol_0.1.2.tar.gz-147a4e1367b49538e6134bf0fdf76a32/2019-01-28T12:31:30Z
{"status":"ok"}
Finished: SUCCESS
Yes :
MacBook-Pro-de-Guillaume:~ guillaumepressiat$ brew config
HOMEBREW_VERSION: 1.9.2
ORIGIN: https://github.com/Homebrew/brew
HEAD: 7be9ac1e9d550df18392550d611c5ff10b91292b
Last commit: 2 weeks ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: c8323256bd786e8d526758599ea08a1d1ba7fd19
Core tap last commit: 7 days ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_LOGS: /Users/guillaumepressiat/Library/Logs/Homebrew
CPU: octa-core 64-bit ivybridge
Homebrew Ruby: 2.3.7 => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Clang: 10.0 build 1000
Git: 2.17.2 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 11.0.2
macOS: 10.14.3-x86_64
CLT: 10.1.0.0.1.1539992718
Xcode: 10.1
MacBook-Pro-de-Guillaume:~ guillaumepressiat$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
I don't know Mac that well. Is that clang that you have from here https://cran.r-project.org/bin/macosx/tools/ or is it a clang version shipped with mac?
For Rcpp here is the DESCRIPTION file :
Package: Rcpp
Title: Seamless R and C++ Integration
Version: 1.0.0
Date: 2018-11-05
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou,
Nathan Russell, Douglas Bates and John Chambers
Maintainer: Dirk Eddelbuettel <edd@debian.org>
Description: The 'Rcpp' package provides R functions as well as C++ classes which
offer a seamless integration of R and C++. Many R data types and objects can be
mapped back and forth to C++ equivalents which facilitates both writing of new
code as well as easier integration of third-party libraries. Documentation
about 'Rcpp' is provided by several vignettes included in this package, via the
'Rcpp Gallery' site at <http://gallery.rcpp.org>, the paper by Eddelbuettel and
Francois (2011, <doi:10.18637/jss.v040.i08>), the book by Eddelbuettel (2013,
<doi:10.1007/978-1-4614-6868-4>) and the paper by Eddelbuettel and Balamuta (2018,
<doi:10.1080/00031305.2017.1375990>); see 'citation("Rcpp")' for details.
Depends: R (>= 3.0.0)
Imports: methods, utils
Suggests: RUnit, inline, rbenchmark, knitr, rmarkdown, pinp, pkgKitten
(>= 0.1.2)
VignetteBuilder: knitr
URL: http://www.rcpp.org, http://dirk.eddelbuettel.com/code/rcpp.html,
https://github.com/RcppCore/Rcpp
License: GPL (>= 2)
BugReports: https://github.com/RcppCore/Rcpp/issues
MailingList: Please send questions and comments regarding Rcpp to
rcpp-devel@lists.r-forge.r-project.org
RoxygenNote: 6.0.1
NeedsCompilation: yes
Packaged: 2018-11-06 03:02:42.98448 UTC; edd
Repository: CRAN
Date/Publication: 2018-11-07 20:00:03 UTC
Built: R 3.5.2; x86_64-apple-darwin15.6.0; 2019-01-23 17:47:25 UTC; unix
Does ruimtehol build works on CRAN now ?
Well, if you have R 3.4.4, not for R 3.5.2 (see CRAN checks https://cran.r-project.org/web/checks/check_results_ruimtehol.html). I'll try to upload the small change I made to CRAN today, hopefully fixing it for 3.5.2 but I'm not sure on this.
It's clang shipped with mac.
I'm not 100% sure on this but it look like you should install the tools at https://cran.r-project.org/bin/macosx/tools/
Yes you're right, I hadn't installed these tools and it's not good. Thanks. I've installed the two, reinstalled R and re build ruimtehol.
I have to make:
export PATH=/usr/local/clang6/bin:$PATH
and (following this https://github.com/RcppCore/Rcpp/issues/922):
sudo installer -pkg \
/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg \
-target /
Maybe I have not done all like it needs, it doesn't work.
At this point I searched other options to setup the mac properly to build ruimtehol.
This complete setup with Homebrew worked on my mac : https://github.com/GuillaumePressiat/setup_macOS_for_R but it takes some time following all the steps (I didn't skip a step to be sure to not have to do all again). We can find some very cool stuffs here, for example : FiraCode.
So good new : I've been able to run the dekamer example ! And multi thread works fine. I will be able to play with your package and StarSpace inside R.
Now I don't know how to help you on what is not good for CRAN build because my setup is clearly not "CRAN" anymore, I use llvm compilers and my ~/.R/Makevars file is:
CC=/usr/local/opt/llvm/bin/clang #-fopenmp
CXX=/usr/local/opt/llvm/bin/clang++ #-fopenmp
CFLAGS=-g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe
CXXFLAGS=-g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe
LDFLAGS=-L/usr/local/opt/gettext/lib -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib
CPPFLAGS=-I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include
Maybe try gettext in CPPFLAGS ?
Good to hear we are getting somewhere. I think the relevant part in what you did to fix things is
brew install llvm
and then the setup of CXX=/usr/local/opt/llvm/bin/clang++
as well as the usage of llvm in LDFLAGS
and CPPFLAGS
in your own ~/.R/Makevars such that the compiler no longer uses clang++ that you had by default from Mac OS but another more recent one.
For my part, I'll see on https://cran.r-project.org/web/checks/check_results_ruimtehol.html if version 0.1.2 which I published yesterday is building & running now fine on R 3.5.2 on CRAN (it already builded/was running fine for R 3.4.4 and for R 3.5.2 on rhub). And if it is not, I'll have to ask which software CRAN has which is different than rhub - probably by asking the Mac OS/rhub maintainers coatless/gaborcsardi/s-u directly (don't know how to catch these persons attention though).
Hi, it seems you were able to find a work around. I tried the following but the problem remains
Could you point me in the right direction to get the package working on Mac. Thank for your help. ]
=====
Makevars
PKG_LIBS = -pthread PKG_CPPFLAGS = -pthread -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -include compliance.h -I./Starspace/src
CC=/usr/local/opt/llvm/bin/clang #-fopenmp CXX=/usr/local/opt/llvm/bin/clang++ #-fopenmp CFLAGS=-g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe CXXFLAGS=-g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe LDFLAGS=-L/usr/local/opt/gettext/lib -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib CPPFLAGS=-I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include
SOURCES = Starspace/src/utils/args.cpp Starspace/src/utils/normalize.cpp Starspace/src/utils/utils.cpp SOURCES += Starspace/src/data.cpp Starspace/src/dict.cpp Starspace/src/doc_data.cpp Starspace/src/doc_parser.cpp Starspace/src/model.cpp Starspace/src/parser.cpp Starspace/src/proj.cpp Starspace/src/starspace.cpp SOURCES += rcpp_textspace.cpp SOURCES += compliance.cpp SOURCES += RcppExports.cpp
OBJECTS = $(SOURCES:.cpp=.o)
.PHONY: all
all: $(SHLIB); rm -f $(OBJECTS)
Session Info
Rversion 3.5.2 (2018-12-20) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS Mojave 10.14.2
Matrix products: default BLAS:/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] ruimtehol_0.2
loaded via a namespace (and not attached): [1] compiler_3.5.2 tools_3.5.2 Rcpp_1.0.1 packrat_0.5.0 `
Hi,
Do you have some news about this ?
Many thanks
I had a conversation with Simon who maintains the R packages on Mac OS on CRAN. Here it is
I can confirm that it simply "hangs" - I kept it running for two hours and it still didn't finish - so potentially an infinite loop? Here is the stack trace at the time of the hang:
(lldb) thread list
Process 22765 stopped
* thread #1: tid = 0x64099aa, 0x00007fff8df2e10a libsystem_kernel.dylib`__semwait_signal + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
thread #2: tid = 0x64099d3, 0x00000001088f49ee ruimtehol.so`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, starspace::EmbedModel::train(std::__1::shared_ptr<starspace::InternDataHandler>, int, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, int, float, float, bool)::$_3> >(void*) + 112 at functional.hpp:442
(lldb) bt
* thread #1: tid = 0x64099aa, 0x00007fff8df2e10a libsystem_kernel.dylib`__semwait_signal + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
* frame #0: 0x00007fff8df2e10a libsystem_kernel.dylib`__semwait_signal + 10
frame #1: 0x00007fff94ac0787 libsystem_pthread.dylib`pthread_join + 444
frame #2: 0x00000001089d341d libc++.1.dylib`std::__1::thread::join() + 29
frame #3: 0x00000001088ef2ae ruimtehol.so`starspace::EmbedModel::train(this=0x00007faf4e94fb88, data=std::__1::shared_ptr<starspace::InternDataHandler>::element_type @ 0x00007faf4e8e0768 strong=3 weak=1, numThreads=<unavailable>, t_start=<unavailable>, epochs_done=<unavailable>, rate=<unavailable>, finishRate=0.00000000000000000000000000000000000000000263444111, verbose=<unavailable>) + 1710 at model.cpp:365 [opt]
frame #4: 0x00000001088fcd5d ruimtehol.so`starspace::EmbedModel::test(this=0x00007faf4e94fb88, data=<unavailable>, numThreads=1) + 77 at model.h:52 [opt]
frame #5: 0x0000000108907369 ruimtehol.so`textspace_train(textspacemodel=<unavailable>) + 1001 at rcpp_textspace.cpp:102 [opt]
frame #6: 0x000000010890a5f8 ruimtehol.so`textspace(model=<unavailable>, save=<unavailable>, trainFile=<unavailable>, initModel="", validationFile="˟Z?\x7f\0\0\x90˟Z?\x7f\0\0\b\x80\x8cN?\x7f\0\0h\x80\x8cN?\x7f\0\0????\0\0\0\0\x10?aJ?\x7f\0\0\x98?aJ\0\0\0\0PƟZ?\x7f\0\0?7\x05\x01\0\0\0\x88~\x18M?\x7f\0\0\x88~\x18M?\x7f\0\0?", testFile="˟Z?\x7f\0\0?˟Z?\x7f\0\0\x10̟Z?\x7f\0\00̟Z?\x7f\0\0P̟Z?\x7f\0\0p̟Z?\x7f\0\0\x90̟Z?\x7f\0\0\0\0\0\0\0\0??\0\0\0\0\0\0\0\x19\0\0\0\0\0\0\0\x05\0\0\0?\x7f\0\0\0փ\0?\x7f\0\0\n\0\0\0?\x7f\0\0\x01", basedoc="˟Z?\x7f\0\0\x10̟Z?\x7f\0\00̟Z?\x7f\0\0P̟Z?\x7f\0\0p̟Z?\x7f\0\0\x90̟Z?\x7f\0\0\0\0\0\0\0\0??\0\0\0\0\0\0\0\x19\0\0\0\0\0\0\0\x05\0\0\0?\x7f\0\0\0փ\0?\x7f\0\0\n\0\0\0?\x7f\0\0\x01\0\0\0?\x7f\0\0\x02\0\0\0?\x7f\0\0\x01\0\0\0?\x7f\0\0\x02", predictionFile="̟Z?\x7f\0\00", fileFormat="̟Z?\x7f\0\0P̟Z?\x7f\0\0p̟Z?\x7f\0\0\x90", label="̟Z?\x7f\0\0p̟Z?\x7f\0\0\x90̟Z?\x7f\0\0\0\0\0\0\0\0??\0\0\0\0\0\0\0\x19", loss="̟Z?\x7f\0\0\x90̟Z?\x7f\0\0\0\0\0\0\0\0??\0\0\0\0\0\0\0\x19\0\0\0\0\0\0\0\x05\0\0\0?\x7f\0\0\0փ\0?\x7f\0\0\n", similarity="̟Z?\x7f\0\0\0\0\0\0\0\0??\0\0\0\0\0\0\0\x19\0\0\0\0\0\0\0\x05\0\0\0?\x7f\0\0\0փ\0?\x7f\0\0\n\0\0\0?\x7f\0\0\x01\0\0\0?\x7f\0\0\x02\0\0\0?\x7f\0\0\x01", lr=0.01, termLr=0.0000000010000000000000001, norm=1, margin=0.050000000000000003, initRandSd=0.001, p=0.5, dropoutLHS=0, dropoutRHS=0, wordWeight=0.5, dim=25, epoch=25, ws=5, maxTrainTime=8640000, validationPatience=10, thread=1, maxNegSamples=2, negSearchLimit=1, minCount=2, minCountLabel=1, bucket=2000000, ngrams=1, trainMode=2, K=5, batchSize=5, verbose=<unavailable>, debug=<unavailable>, adagrad=<unavailable>, normalizeText=<unavailable>, saveEveryEpoch=<unavailable>, saveTempModel=<unavailable>, shareEmb=<unavailable>, useWeight=<unavailable>, trainWord=<unavailable>, excludeLHS=<unavailable>, embeddings=Rcpp::NumericMatrix @ 0x00007fff5a9fca98) + 5912 at rcpp_textspace.cpp:352 [opt]
frame #7: 0x000000010891b21d ruimtehol.so`::_ruimtehol_textspace(modelSEXP=<unavailable>, saveSEXP=<unavailable>, trainFileSEXP=0x3f847ae147ae147b, initModelSEXP=0x3e112e0be826d695, validationFileSEXP=0x3ff0000000000000, testFileSEXP=0x3fa999999999999a, basedocSEXP=0x00007faf4aaca900, predictionFileSEXP=0x00007faf4aaca8c8, fileFormatSEXP=0x00007faf4aacb5e8, labelSEXP=0x00007faf4aab8ac0, lossSEXP=0x00007faf4aacb498, similaritySEXP=0x00007faf4aacb348, lrSEXP=0x00007faf4aab89e0, termLrSEXP=0x00007faf4aaca740, normSEXP=0x00007faf4aaca708, marginSEXP=0x00007faf4aab8858, initRandSdSEXP=0x00007faf4aaca698, pSEXP=0x00007faf4aaca660, dropoutLHSSEXP=0x00007faf4aaca628, dropoutRHSSEXP=0x00007faf4aaca5f0, wordWeightSEXP=0x00007faf4aaca5b8, dimSEXP=0x00007faf4aacaee8, epochSEXP=0x00007faf4aacaeb0, wsSEXP=0x00007faf4aacae40, maxTrainTimeSEXP=0x00007faf4aaddc40, validationPatienceSEXP=0x00007faf4aaca3f8, threadSEXP=0x00007faf4aacad60, maxNegSamplesSEXP=0x00007faf448d0450, negSearchLimitSEXP=0x00007faf4aacae78, minCountSEXP=0x00007faf4aacae08, minCountLabelSEXP=0x00007faf4aacadd0, bucketSEXP=0x00007faf4aaca270, ngramsSEXP=0x00007faf4aacad98, trainModeSEXP=0x00007faf4aacaf20, KSEXP=0x00007faf4aaca190, batchSizeSEXP=0x00007faf4aaca158, verboseSEXP=0x00007faf4aaca120, debugSEXP=0x00007faf4aaca0e8, adagradSEXP=0x00007faf4aab8740, normalizeTextSEXP=0x00007faf4aaca078, saveEveryEpochSEXP=0x00007faf4aaca008, saveTempModelSEXP=0x00007faf4aaddee0, shareEmbSEXP=0x00007faf4aaddea8, useWeightSEXP=0x00007faf4aadde70, trainWordSEXP=0x00007faf4aadde38, excludeLHSSEXP=0x00007faf4aadde00, embeddingsSEXP=0x00007faf4a61d270) + 2845 at RcppExports.cpp:82 [opt]
frame #8: 0x0000000105283cd3 libR.dylib`R_doDotCall(ofun=<unavailable>, nargs=<unavailable>, cargs=<unavailable>, call=<unavailable>) + 1907 at dotcode.c:0 [opt]
(lldb) thread select 2
ruimtehol.so was compiled with optimization - stepping may behave oddly; variables may not be available.
* thread #2: tid = 0x64099d3, 0x00000001088f49ee ruimtehol.so`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, starspace::EmbedModel::train(std::__1::shared_ptr<starspace::InternDataHandler>, int, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, int, float, float, bool)::$_3> >(void*) + 112 at functional.hpp:442
frame #0: 0x00000001088f49ee ruimtehol.so`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, starspace::EmbedModel::train(std::__1::shared_ptr<starspace::InternDataHandler>, int, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, int, float, float, bool)::$_3> >(void*) + 112 at functional.hpp:442 [opt]
439 vector_size_type size (e ().size ());
440 for (vector_size_type i = 0; i < size; ++ i) {
441 real_type u (type_traits<value_type>::norm_2 (e () (i)));
-> 442 t += u * u;
443 }
444 return type_traits<real_type>::type_sqrt (t);
445 #else
(lldb) bt
* thread #2: tid = 0x64099d3, 0x00000001088f49ee ruimtehol.so`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, starspace::EmbedModel::train(std::__1::shared_ptr<starspace::InternDataHandler>, int, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, int, float, float, bool)::$_3> >(void*) + 112 at functional.hpp:442
* frame #0: 0x00000001088f49ee ruimtehol.so`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, starspace::EmbedModel::train(std::__1::shared_ptr<starspace::InternDataHandler>, int, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, int, float, float, bool)::$_3> >(void*) + 112 at functional.hpp:442 [opt]
frame #1: 0x00000001088f497e ruimtehol.so`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, starspace::EmbedModel::train(std::__1::shared_ptr<starspace::InternDataHandler>, int, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, int, float, float, bool)::$_3> >(void*) [inlined] boost::numeric::ublas::vector_scalar_unary<boost::numeric::ublas::matrix_row<boost::numeric::ublas::matrix<float, boost::numeric::ublas::basic_row_major<unsigned long, long>, boost::numeric::ublas::unbounded_array<float, std::__1::allocator<float> > > >, boost::numeric::ublas::vector_norm_2<boost::numeric::ublas::matrix_row<boost::numeric::ublas::matrix<float, boost::numeric::ublas::basic_row_major<unsigned long, long>, boost::numeric::ublas::unbounded_array<float, std::__1::allocator<float> > > > > >::evaluate(this=<unavailable>) const at vector_expression.hpp:1542 [opt]
frame #2: 0x00000001088f497e ruimtehol.so`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, starspace::EmbedModel::train(std::__1::shared_ptr<starspace::InternDataHandler>, int, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, int, float, float, bool)::$_3> >(void*) [inlined] boost::numeric::ublas::vector_scalar_unary<boost::numeric::ublas::matrix_row<boost::numeric::ublas::matrix<float, boost::numeric::ublas::basic_row_major<unsigned long, long>, boost::numeric::ublas::unbounded_array<float, std::__1::allocator<float> > > >, boost::numeric::ublas::vector_norm_2<boost::numeric::ublas::matrix_row<boost::numeric::ublas::matrix<float, boost::numeric::ublas::basic_row_major<unsigned long, long>, boost::numeric::ublas::unbounded_array<float, std::__1::allocator<float> > > > > >::operator float(this=<unavailable>) const at vector_expression.hpp:1534 [opt]
frame #3: 0x00000001088f497e ruimtehol.so`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, starspace::EmbedModel::train(std::__1::shared_ptr<starspace::InternDataHandler>, int, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, int, float, float, bool)::$_3> >(void*) [inlined] boost::numeric::ublas::vector_scalar_unary_traits<boost::numeric::ublas::matrix_row<boost::numeric::ublas::matrix<float, boost::numeric::ublas::basic_row_major<unsigned long, long>, boost::numeric::ublas::unbounded_array<float, std::__1::allocator<float> > > >, boost::numeric::ublas::vector_norm_2<boost::numeric::ublas::matrix_row<boost::numeric::ublas::matrix<float, boost::numeric::ublas::basic_row_major<unsigned long, long>, boost::numeric::ublas::unbounded_array<float, std::__1::allocator<float> > > > > >::result_type boost::numeric::ublas::norm_2<boost::numeric::ublas::matrix_row<boost::numeric::ublas::matrix<float, boost::numeric::ublas::basic_row_major<unsigned long, long>, boost::numeric::ublas::unbounded_array<float, std::__1::allocator<float> > > > >(e=<unavailable>) at vector_expression.hpp:1609 [opt]
frame #4: 0x00000001088f497e ruimtehol.so`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, starspace::EmbedModel::train(std::__1::shared_ptr<starspace::InternDataHandler>, int, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, int, float, float, bool)::$_3> >(void*) [inlined] starspace::norm2(a=starspace::Matrix<float>::Row @ 0x00007fe8c0043ec0) at model.cpp:118 [opt]
frame #5: 0x00000001088f497e ruimtehol.so`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, starspace::EmbedModel::train(std::__1::shared_ptr<starspace::InternDataHandler>, int, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, int, float, float, bool)::$_3> >(void*) [inlined] starspace::EmbedModel::train(this=<unavailable>, row=starspace::Matrix<float>::Row @ 0x00007fe8c0044e40, maxNorm=1)::$_3::operator()() const::'lambda'(boost::numeric::ublas::matrix_row<boost::numeric::ublas::matrix<float, boost::numeric::ublas::basic_row_major<unsigned long, long>, boost::numeric::ublas::unbounded_array<float, std::__1::allocator<float> > > >, double)::operator()(boost::numeric::ublas::matrix_row<boost::numeric::ublas::matrix<float, boost::numeric::ublas::basic_row_major<unsigned long, long>, boost::numeric::ublas::unbounded_array<float, std::__1::allocator<float> > > >, double) const at model.cpp:349 [opt]
frame #6: 0x00000001088f497e ruimtehol.so`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, starspace::EmbedModel::train(std::__1::shared_ptr<starspace::InternDataHandler>, int, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, int, float, float, bool)::$_3> >(void*) + 103 at model.cpp:356 [opt]
frame #7: 0x00000001088f4917 ruimtehol.so`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, starspace::EmbedModel::train(std::__1::shared_ptr<starspace::InternDataHandler>, int, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, int, float, float, bool)::$_3> >(void*) [inlined] decltype(__f=<unavailable>)::$_3>(fp)(std::__1::forward<>(fp0))) std::__1::__invoke<starspace::EmbedModel::train(std::__1::shared_ptr<starspace::InternDataHandler>, int, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, int, float, float, bool)::$_3>(starspace::EmbedModel::train(std::__1::shared_ptr<starspace::InternDataHandler>, int, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, int, float, float, bool)::$_3&&) at type_traits:4353 [opt]
frame #8: 0x00000001088f4917 ruimtehol.so`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, starspace::EmbedModel::train(std::__1::shared_ptr<starspace::InternDataHandler>, int, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, int, float, float, bool)::$_3> >(void*) [inlined] void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, starspace::EmbedModel::train(std::__1::shared_ptr<starspace::InternDataHandler>, int, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, int, float, float, bool)::$_3>(__t=<unavailable>)::$_3>&, std::__1::__tuple_indices<>) at thread:342 [opt]
frame #9: 0x00000001088f4917 ruimtehol.so`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, starspace::EmbedModel::train(std::__1::shared_ptr<starspace::InternDataHandler>, int, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, int, float, float, bool)::$_3> >(__vp=0x000000000000047d) + 135 at thread:352 [opt]
frame #10: 0x00007fff94abe99d libsystem_pthread.dylib`_pthread_body + 131
frame #11: 0x00007fff94abe91a libsystem_pthread.dylib`_pthread_start + 168
frame #12: 0x00007fff94abc351 libsystem_pthread.dylib`thread_start + 13
Also note that your package makes it really hard to debug because of
all: $(SHLIB); rm -f $(OBJECTS)
in
ruimtehol/src/Makevars
which blows away all object files before dsym can be generated thus making it impossible to collect debugging symbols. I had to modify the package to build it.
Also there are bunch of warnings FWIW:
In file included from <built-in>:1:
In file included from ./compliance.h:3:
In file included from /Volumes/SSD-Data/Builds/R-dev-web/QA/Simon/packages/el-capitan-x86_64/Rlib/3.6/Rcpp/include/Rcpp.h:27:
In file included from /Volumes/SSD-Data/Builds/R-dev-web/QA/Simon/packages/el-capitan-x86_64/Rlib/3.6/Rcpp/include/RcppCommon.h:29:
In file included from /Volumes/SSD-Data/Builds/R-dev-web/QA/Simon/packages/el-capitan-x86_64/Rlib/3.6/Rcpp/include/Rcpp/r/headers.h:59:
In file included from /Volumes/SSD-Data/Builds/R-dev-web/QA/Simon/packages/el-capitan-x86_64/Rlib/3.6/Rcpp/include/Rcpp/platform/compiler.h:153:
In file included from /usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/unordered_map:384:
In file included from /usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/__hash_table:16:
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:3692:5: warning: destructor called on non-final 'starspace::DataParser' that has virtual functions but
non-virtual destructor [-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:3653:9: note: in instantiation of member function 'std::__1::__shared_ptr_emplace<starspace::DataParser,
std::__1::allocator<starspace::DataParser> >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:4313:26: note: in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<starspace::DataParser, std::__1::allocator<starspace::DataParser> >::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Dictionary> &,
std::__1::shared_ptr<starspace::Args> &>' requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:4692:29: note: in instantiation of function template specialization
'std::__1::shared_ptr<starspace::DataParser>::make_shared<std::__1::shared_ptr<starspace::Dictionary> &, std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:35:15: note: in instantiation of function template specialization 'std::__1::make_shared<starspace::DataParser,
std::__1::shared_ptr<starspace::Dictionary> &, std::__1::shared_ptr<starspace::Args> &>' requested here
parser_ = make_shared<DataParser>(dict_, args_);
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:3692:23: note: qualify call to silence this warning
__data_.second().~_Tp();
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:3692:5: warning: destructor called on non-final 'starspace::LayerDataParser' that has virtual functions but
non-virtual destructor [-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:3653:9: note: in instantiation of member function
'std::__1::__shared_ptr_emplace<starspace::LayerDataParser, std::__1::allocator<starspace::LayerDataParser> >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:4313:26: note: in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<starspace::LayerDataParser, std::__1::allocator<starspace::LayerDataParser>
>::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Dictionary> &, std::__1::shared_ptr<starspace::Args> &>' requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:4692:29: note: in instantiation of function template specialization
'std::__1::shared_ptr<starspace::LayerDataParser>::make_shared<std::__1::shared_ptr<starspace::Dictionary> &, std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:37:15: note: in instantiation of function template specialization 'std::__1::make_shared<starspace::LayerDataParser,
std::__1::shared_ptr<starspace::Dictionary> &, std::__1::shared_ptr<starspace::Args> &>' requested here
parser_ = make_shared<LayerDataParser>(dict_, args_);
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:3692:23: note: qualify call to silence this warning
__data_.second().~_Tp();
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:3692:5: warning: destructor called on non-final 'starspace::InternDataHandler' that has virtual functions
but non-virtual destructor [-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:3653:9: note: in instantiation of member function
'std::__1::__shared_ptr_emplace<starspace::InternDataHandler, std::__1::allocator<starspace::InternDataHandler> >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:4313:26: note: in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<starspace::InternDataHandler, std::__1::allocator<starspace::InternDataHandler>
>::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Args> &>' requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:4692:29: note: in instantiation of function template specialization
'std::__1::shared_ptr<starspace::InternDataHandler>::make_shared<std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:63:12: note: in instantiation of function template specialization 'std::__1::make_shared<starspace::InternDataHandler,
std::__1::shared_ptr<starspace::Args> &>' requested here
return make_shared<InternDataHandler>(args_);
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:3692:23: note: qualify call to silence this warning
__data_.second().~_Tp();
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:3692:5: warning: destructor called on non-final 'starspace::LayerDataHandler' that has virtual functions but
non-virtual destructor [-Wdelete-non-virtual-dtor]
__data_.second().~_Tp();
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:3653:9: note: in instantiation of member function
'std::__1::__shared_ptr_emplace<starspace::LayerDataHandler, std::__1::allocator<starspace::LayerDataHandler> >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:4313:26: note: in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<starspace::LayerDataHandler, std::__1::allocator<starspace::LayerDataHandler> >::__shared_ptr_emplace<std::__1::shared_ptr<starspace::Args>
&>' requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:4692:29: note: in instantiation of function template specialization
'std::__1::shared_ptr<starspace::LayerDataHandler>::make_shared<std::__1::shared_ptr<starspace::Args> &>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
Starspace/src/starspace.cpp:65:12: note: in instantiation of function template specialization 'std::__1::make_shared<starspace::LayerDataHandler,
std::__1::shared_ptr<starspace::Args> &>' requested here
return make_shared<LayerDataHandler>(args_);
^
/usr/local/clang+llvm-7.0.0-x86_64-apple-darwin/include/c++/v1/memory:3692:23: note: qualify call to silence this warning
__data_.second().~_Tp();
^
My answer on this was
The tracing basically indicate that in the program run by the example of the package, there are 2 thread groups.
- One which trains the model, of type vector
(code at https://github.com/bnosac/ruimtehol/blob/da1cd4da6bbcc6a7cc4c346989e8476f37864091/src/Starspace/src/model.cpp#L340) - Another one which does norm truncation, of type std::thread (code at https://github.com/bnosac/ruimtehol/blob/da1cd4da6bbcc6a7cc4c346989e8476f37864091/src/Starspace/src/model.cpp#L347)
Thread group 1 tries to combine the results of the model training using the join functionality (https://github.com/bnosac/ruimtehol/blob/da1cd4da6bbcc6a7cc4c346989e8476f37864091/src/Starspace/src/model.cpp#L362) That seems to apparently fail indicating thread group 1 never ends. Thread group 2 keeps on iterating untill thread group 1 has finished. As this apparently never happens on Mac OS, this fails.
Based on the trace information, however I still do not see the bug. Would it be possible to show the R CMD INSTALL of the package in order to compare that to the one which works on r-hub (https://builder.r-hub.io/status/ruimtehol_0.2.1.tar.gz-98f98671fd5fe78842e5bf463f1fe05c). Were there changes on CRAN regarding the use of threads on Mac OS or how must I interpret the fact that a previous version of the package did provide a binary on Mac OS? Or are there other ways to inspect why this thread joining fails?
many thanks already for any input,
who has a mac os machine and is willing to do some debugging?