Hello everybody,
 
this is my very first post on this mailing list so if I have made any mistakes please feel free to point me to it.
 
I have written a package for R. This package internally uses Rcpp-Modules. However my package got rejected from CRAN due to the fact that my package can not be loaded under Solaris. So, i set up a virtual machine with Solaris 10 to find the error in my code. For now it appears to me, that it is not possible to use Rcpp-Modules under Solaris using Oracle Studio 12 compilers (which are used by CRAN as far as i know).
I created a minimal example through:
 
"Rcpp.package.skeleton("somename", module=TRUE)"
 
I removed every file from the "src"-folder except the "Num.cpp" file and reduced the content of the "zzz.R" file located in the "R" folder to the single line "loadModule("NumEx", TRUE)".
Compiling this minimal example with the latest version of R using the Oracle Studio 12 compilers results in the output given below. Also i have used the following enviroment variables (which are used by CRAN too):
CC=suncc
CFLAGS="-xO5 -xc99 -xlibmil -nofstore"
CPICFLAGS=-Kpic
F77=sunf95
FFLAGS="-O5 -libmil -nofstore"
FPICFLAGS=-Kpic
CXX="sunCC -library=stlport4"
CXXFLAGS="-xO5 -xlibmil -nofstore -features=tmplrefstatic"
CXXPICFLAGS=-Kpic
FC=sunf95
FCFLAGS=$FFLAGS
FCPICFLAGS=-Kpic
LDFLAGS=-L/opt/sunstudio12.1/rtlibs/amd64
SHLIB_LDFLAGS=-shared
SHLIB_CXXLDFLAGS=-G
SHLIB_FCLDFLAGS=-G
SAFE_FFLAGS="-O5 -libmil"

 
Output generated through "R CMD INSTALL ./somename" :
 
# R CMD INSTALL ./somename
* installing to library '/Desktop/R-3.1.2/library'
* installing *source* package 'somename' ...
** libs
CC -library=stlport4 -I/Desktop/R-3.1.2/include -DNDEBUG  -I/usr/local/include -I"/Desktop/R-3.1.2/library/Rcpp/include"   -KPIC  -g  -c Num.cpp -o Num.o
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/Interrupt.h", line 60: Warning (Anachronism): Using void(*)(void*) to initialize extern "C" void(*)(void*).
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/module/class.h", line 110: Warning: docstring hides Rcpp::class_Base::docstring.
"Num.cpp", line 43:     Where: While instantiating "Rcpp::class_<Num>::default_constructor(const char*, bool(*)(SEXPREC**,int))".
"Num.cpp", line 43:     Where: Instantiated from non-template code.
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/module/Module_Add_Property.h", line 45: Warning: docstring hides Rcpp::class_Base::docstring.
"Num.cpp", line 46:     Where: While instantiating "Rcpp::class_<Num>::property<double>(const char*, double(Num::*)(), void(Num::*)(double), const char*)".
"Num.cpp", line 46:     Where: Instantiated from non-template code.
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/module/Module_Add_Property.h", line 26: Warning: docstring hides Rcpp::class_Base::docstring.
"Num.cpp", line 49:     Where: While instantiating "Rcpp::class_<Num>::property<int>(const char*, int(Num::*)(), const char*)".
"Num.cpp", line 49:     Where: Instantiated from non-template code.
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/XPtr.h", line 118: Warning (Anachronism): Using void(*)(SEXPREC*) to initialize extern "C" void(*)(SEXPREC*).
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/XPtr.h", line 88:     Where: While instantiating "Rcpp::XPtr<Rcpp::Module, PreserveStorage, &Rcpp::standard_delete_finalizer<Rcpp::Module>>::setDeleteFinalizer()".
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/XPtr.h", line 88:     Where: Instantiated from non-template code.
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/module/Module_generated_class_constructor.h", line 103: Warning: docstring hides Rcpp::class_Base::docstring.
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/module/class.h", line 111:     Where: While instantiating "Rcpp::class_<Num>::constructor(const char*, bool(*)(SEXPREC**,int))".
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/module/class.h", line 111:     Where: Instantiated from non-template code.
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/module/class.h", line 333: Warning: name hides Rcpp::class_Base::name.
"Num.cpp", line 38:     Where: While instantiating "Rcpp::class_<Num>::methods_voidness()".
"Num.cpp", line 38:     Where: Instantiated from non-template code.
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/module/class.h", line 309: Warning: name hides Rcpp::class_Base::name.
"Num.cpp", line 38:     Where: While instantiating "Rcpp::class_<Num>::methods_arity()".
"Num.cpp", line 38:     Where: Instantiated from non-template code.
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/module/class.h", line 288: Warning: name hides Rcpp::class_Base::name.
"Num.cpp", line 38:     Where: While instantiating "Rcpp::class_<Num>::method_names()".
"Num.cpp", line 38:     Where: Instantiated from non-template code.
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/module/class.h", line 100: Warning: docstring hides Rcpp::class_Base::docstring.
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/module/Module_generated_class_constructor.h", line 104:     Where: While instantiating "Rcpp::class_<Num>::AddConstructor(Rcpp::Constructor_Base<Num>*, bool(*)(SEXPREC**,int), const char*)".
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/module/Module_generated_class_constructor.h", line 104:     Where: Instantiated from non-template code.
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/XPtr.h", line 118: Warning (Anachronism): Using void(*)(SEXPREC*) to initialize extern "C" void(*)(SEXPREC*).
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/XPtr.h", line 88:     Where: While instantiating "Rcpp::XPtr<Num, PreserveStorage, &Rcpp::standard_delete_finalizer<Num>>::setDeleteFinalizer()".
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/XPtr.h", line 88:     Where: Instantiated from non-template code.
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/XPtr.h", line 118: Warning (Anachronism): Using void(*)(SEXPREC*) to initialize extern "C" void(*)(SEXPREC*).
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/XPtr.h", line 88:     Where: While instantiating "Rcpp::XPtr<Rcpp::CppProperty<Num>, PreserveStorage, &Rcpp::standard_delete_finalizer<Rcpp::CppProperty<Num>>>::setDeleteFinalizer()".
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/XPtr.h", line 88:     Where: Instantiated from non-template code.
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/XPtr.h", line 118: Warning (Anachronism): Using void(*)(SEXPREC*) to initialize extern "C" void(*)(SEXPREC*).
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/XPtr.h", line 88:     Where: While instantiating "Rcpp::XPtr<std::vector<Rcpp::SignedMethod<Num>*>, PreserveStorage, &Rcpp::standard_delete_finalizer<std::vector<Rcpp::SignedMethod<Num>*>>>::setDeleteFinalizer()".
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/XPtr.h", line 88:     Where: Instantiated from non-template code.
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/XPtr.h", line 118: Warning (Anachronism): Using void(*)(SEXPREC*) to initialize extern "C" void(*)(SEXPREC*).
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/XPtr.h", line 88:     Where: While instantiating "Rcpp::XPtr<Rcpp::SignedConstructor<Num>, PreserveStorage, &Rcpp::standard_delete_finalizer<Rcpp::SignedConstructor<Num>>>::setDeleteFinalizer()".
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/XPtr.h", line 88:     Where: Instantiated from non-template code.
14 Warning(s) detected.
CC -library=stlport4 -G -L/usr/local/lib -o somename.so Num.o
installing to /Desktop/R-3.1.2/library/somename/libs
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/Desktop/R-3.1.2/library/somename/libs/somename.so':
  ld.so.1: R: fatal: relocation error: file /Desktop/R-3.1.2/library/somename/libs/somename.so: symbol __1cERcppZstandard_delete_finalizer4nDNum__6FpTA_v_: referenced symbol not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing '/Desktop/R-3.1.2/library/somename'
* restoring previous '/Desktop/R-3.1.2/library/somename'
 
I have no idea how to solve this problem. Using the "Rcpp.package.skeleton" without "module=TRUE" compiles just fine (except for one warning) and can be loaded:
 
# R CMD INSTALL noModule
* installing to library '/Desktop/R-3.1.2/library'
* installing *source* package 'noModule' ...
** libs
CC -library=stlport4 -I/Desktop/R-3.1.2/include -DNDEBUG  -I/usr/local/include -I"/Desktop/R-3.1.2/library/Rcpp/include"   -KPIC  -g  -c RcppExports.cpp -o RcppExports.o
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/Interrupt.h", line 60: Warning (Anachronism): Using void(*)(void*) to initialize extern "C" void(*)(void*).
1 Warning(s) detected.
CC -library=stlport4 -I/Desktop/R-3.1.2/include -DNDEBUG  -I/usr/local/include -I"/Desktop/R-3.1.2/library/Rcpp/include"   -KPIC  -g  -c rcpp_hello_world.cpp -o rcpp_hello_world.o
"/Desktop/R-3.1.2/library/Rcpp/include/Rcpp/Interrupt.h", line 60: Warning (Anachronism): Using void(*)(void*) to initialize extern "C" void(*)(void*).
1 Warning(s) detected.
CC -library=stlport4 -G -L/usr/local/lib -o noModule.so RcppExports.o rcpp_hello_world.o
installing to /Desktop/R-3.1.2/library/noModule/libs
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (noModule)
 
If you need any further informations to help me please feel free to ask.
 
Thank you in advance,
Marius.
 
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to