Hi R-devel, I'm trying to get R 3.2.1 working on Haiku (an open source OS inspired by BeOS, not Linux based) on i586. With a few small changes to library paths and ifdefs I am able to get a seemingly working R binary. The build process stops with the 'tools' package. The last lines from make are below. Does anyone have any tips? I'm rather new to debugging at this low level. Are there any checks I can do to the R binary to test if it works properly? Cheers Joe *********************************************************************** make[3]: Entering directory `/Store/buildr/src/library/tools' building package 'tools' make[4]: Entering directory `/Store/buildr/src/library/tools' all.R is unchanged make[4]: Leaving directory `/Store/buildr/src/library/tools' make[4]: Entering directory `/Store/buildr/src/library/tools' make[5]: Entering directory `/Store/buildr/src/library/tools/src' make[6]: Entering directory `/Store/buildr/src/library/tools/src' ../../../../library/tools/libs/tools.so is unchanged make[6]: Leaving directory `/Store/buildr/src/library/tools/src' make[5]: Leaving directory `/Store/buildr/src/library/tools/src' make[4]: Leaving directory `/Store/buildr/src/library/tools' make[4]: Entering directory `/Store/buildr/src/library/tools' installing 'sysdata.rda' export ADDON_PATH="%A/add-ons:/boot/home/config/non-packaged/add-ons:/boot/home/config/add-ons:/boot/system/non-packaged/add-ons:/boot/system/add-ons" export BEINCLUDES="/boot/system/develop/headers;/boot/system/develop/headers/be;/boot/system/develop/headers/posix;/boot/system/develop/headers/glibc;/boot/system/develop/headers/cpp;/boot/system/develop/headers/be/app;/boot/system/develop/headers/be/device;/boot/system/develop/headers/be/interface;/boot/system/develop/headers/be/locale;/boot/system/develop/headers/be/media;/boot/system/develop/headers/be/midi;/boot/system/develop/headers/be/midi2;/boot/system/develop/headers/be/net;/boot/system/develop/headers/be/kernel;/boot/system/develop/headers/be/storage;/boot/system/develop/headers/be/support;/boot/system/develop/headers/be/game;/boot/system/develop/headers/be/opengl;/boot/system/develop/headers/be/drivers;/boot/system/develop/headers/gnu;/boot/system/develop/headers/be/mail;/boot/system/develop/headers/be/translation;/boot/system/develop/headers/be/devel;/boot/system/develop/headers/be/add-ons/graphics;/boot/system/develop/headers/be/be_apps/Deskbar;/boot/system/develop/headers/be/be_apps/NetPositive;/boot/system/develop/headers/be/be_apps/Tracker" export BE_HOST_CPU="x86" export BUILDHOME="/boot/system/develop" export GROUP="root" export HISTCONTROL="ignoredups" export HISTFILESIZE="500" export HOME="/boot/home" export JAVA_HOME="/packages/openjdk-1.7_2013_11_08-2/.self/lib/openjdk" export LC_ALL="C" export LC_COLLATE="en.UTF-8" export LC_CTYPE="en.UTF-8" export LC_MESSAGES="en.UTF-8" export LC_MONETARY="en.UTF-8" export LC_NUMERIC="en.UTF-8" export LC_TIME="en.UTF-8" export LC_TYPE="en_US.UTF-8" export LIBRARY_PATH="%A/lib:/boot/home/config/non-packaged/lib:/boot/home/config/lib:/boot/system/non-packaged/lib:/boot/system/lib:/Store/buildr/lib" export LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;43:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:" export MAKEFLAGS="w" export MAKELEVEL="5" export MFLAGS="-w" export OLDPWD export PATH=".:/boot/home/config/non-packaged/bin:/boot/home/config/bin:/boot/system/non-packaged/bin:/bin:/boot/system/apps:/boot/system/preferences" export PWD="/Store/buildr/src/library/tools" export R_DEFAULT_PACKAGES="NULL" export R_DOC_DIR="/Store/buildr/doc" export R_ENVIRON="" export R_ENVIRON_USER="" export R_HOME="/Store/buildr" export R_INCLUDE_DIR="/Store/buildr/include" export R_PROFILE="" export R_PROFILE_USER="" export R_SHARE_DIR="/Store/buildr/share" export SAFEMODE="no" export SED="/bin/sed" export SHLVL="7" export TERM="xterm" export TTY="/dev/tt/p1" export TTYPE="UTF-8" export USER="user" export XDG_CACHE_HOME="/boot/home/config/cache" export XDG_CONFIG_DIRS="/boot/system/settings" export XDG_CONFIG_HOME="/boot/home/config/settings" export XDG_DATA_DIRS="/boot/system/non-packaged/data:/boot/system/data" export XDG_DATA_HOME="/boot/home/config/non-packaged/data" Error in .Call(PS_sigs, 1L) : first argument must be a string (of length 1) or native symbol reference Error: unable to load R code in package 'tools' Execution halted make[4]: *** [sysdata] Error 1 make[4]: Leaving directory `/Store/buildr/src/library/tools' make[3]: *** [all] Error 2 make[3]: Leaving directory `/Store/buildr/src/library/tools' make[2]: *** [R] Error 1 make[2]: Leaving directory `/Store/buildr/src/library' make[1]: *** [R] Error 1 make[1]: Leaving directory `/Store/buildr/src' make: *** [R] Error 1 [[alternative HTML version deleted]]
On 14/08/2015 15:19, Joe S wrote:> Hi R-devel, > I'm trying to get R 3.2.1 working on Haiku (an open source OS inspired by > BeOS, not Linux based) on i586. With a few small changes to library paths > and ifdefs I am able to get a seemingly working R binary. The build process > stops with the 'tools' package. The last lines from make are below. > > Does anyone have any tips? I'm rather new to debugging at this low level. > > Are there any checks I can do to the R binary to test if it works properly?This does not seem to be about the R binary, but about dynamically loaded modules. (All those export lines are non-standard, BTW, and your output is not from an ab initio build so we don't know e.g. how tools.so was built.) The meat is > Error in .Call(PS_sigs, 1L) : > first argument must be a string (of length 1) or native symbol reference That comes from package tools, which contains the R code PS_sigs <- getDLLRegisteredRoutines("tools")[[c(".Call", "ps_sigs")]] SIGHUP <- .Call(PS_sigs, 1L) So, startup R from the top-level build directory with something like env R_DEFAULT_PACKAGES=NULL bin/R and at the prompt run dyn.load("src/library/tools/src/tools.so") getLoadedDLLs() # should include a line for tools getDLLRegisteredRoutines("tools") My guess is that does not list any symbols, in particular not ps_sigs. We can only speculate as to what went wrong (visibility issues? Mapping symbols to u/case? ...).> > Cheers > Joe > > *********************************************************************** > make[3]: Entering directory `/Store/buildr/src/library/tools' > building package 'tools' > make[4]: Entering directory `/Store/buildr/src/library/tools' > all.R is unchanged > make[4]: Leaving directory `/Store/buildr/src/library/tools' > make[4]: Entering directory `/Store/buildr/src/library/tools' > make[5]: Entering directory `/Store/buildr/src/library/tools/src' > make[6]: Entering directory `/Store/buildr/src/library/tools/src' > ../../../../library/tools/libs/tools.so is unchanged > make[6]: Leaving directory `/Store/buildr/src/library/tools/src' > make[5]: Leaving directory `/Store/buildr/src/library/tools/src' > make[4]: Leaving directory `/Store/buildr/src/library/tools' > make[4]: Entering directory `/Store/buildr/src/library/tools' > installing 'sysdata.rda' > export > ADDON_PATH="%A/add-ons:/boot/home/config/non-packaged/add-ons:/boot/home/config/add-ons:/boot/system/non-packaged/add-ons:/boot/system/add-ons" > export > BEINCLUDES="/boot/system/develop/headers;/boot/system/develop/headers/be;/boot/system/develop/headers/posix;/boot/system/develop/headers/glibc;/boot/system/develop/headers/cpp;/boot/system/develop/headers/be/app;/boot/system/develop/headers/be/device;/boot/system/develop/headers/be/interface;/boot/system/develop/headers/be/locale;/boot/system/develop/headers/be/media;/boot/system/develop/headers/be/midi;/boot/system/develop/headers/be/midi2;/boot/system/develop/headers/be/net;/boot/system/develop/headers/be/kernel;/boot/system/develop/headers/be/storage;/boot/system/develop/headers/be/support;/boot/system/develop/headers/be/game;/boot/system/develop/headers/be/opengl;/boot/system/develop/headers/be/drivers;/boot/system/develop/headers/gnu;/boot/system/develop/headers/be/mail;/boot/system/develop/headers/be/translation;/boot/system/develop/headers/be/devel;/boot/system/develop/headers/be/add-ons/graphics;/boot/system/develop/headers/be/be_apps/Deskbar;/boot/system/develop/hea! > ders/be/be_apps/NetPositive;/boot/system/develop/headers/be/be_apps/Tracker" > export BE_HOST_CPU="x86" > export BUILDHOME="/boot/system/develop" > export GROUP="root" > export HISTCONTROL="ignoredups" > export HISTFILESIZE="500" > export HOME="/boot/home" > export JAVA_HOME="/packages/openjdk-1.7_2013_11_08-2/.self/lib/openjdk" > export LC_ALL="C" > export LC_COLLATE="en.UTF-8" > export LC_CTYPE="en.UTF-8" > export LC_MESSAGES="en.UTF-8" > export LC_MONETARY="en.UTF-8" > export LC_NUMERIC="en.UTF-8" > export LC_TIME="en.UTF-8" > export LC_TYPE="en_US.UTF-8" > export > LIBRARY_PATH="%A/lib:/boot/home/config/non-packaged/lib:/boot/home/config/lib:/boot/system/non-packaged/lib:/boot/system/lib:/Store/buildr/lib" > export > LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;43:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vo! > b=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:" > export MAKEFLAGS="w" > export MAKELEVEL="5" > export MFLAGS="-w" > export OLDPWD > export > PATH=".:/boot/home/config/non-packaged/bin:/boot/home/config/bin:/boot/system/non-packaged/bin:/bin:/boot/system/apps:/boot/system/preferences" > export PWD="/Store/buildr/src/library/tools" > export R_DEFAULT_PACKAGES="NULL" > export R_DOC_DIR="/Store/buildr/doc" > export R_ENVIRON="" > export R_ENVIRON_USER="" > export R_HOME="/Store/buildr" > export R_INCLUDE_DIR="/Store/buildr/include" > export R_PROFILE="" > export R_PROFILE_USER="" > export R_SHARE_DIR="/Store/buildr/share" > export SAFEMODE="no" > export SED="/bin/sed" > export SHLVL="7" > export TERM="xterm" > export TTY="/dev/tt/p1" > export TTYPE="UTF-8" > export USER="user" > export XDG_CACHE_HOME="/boot/home/config/cache" > export XDG_CONFIG_DIRS="/boot/system/settings" > export XDG_CONFIG_HOME="/boot/home/config/settings" > export XDG_DATA_DIRS="/boot/system/non-packaged/data:/boot/system/data" > export XDG_DATA_HOME="/boot/home/config/non-packaged/data" > Error in .Call(PS_sigs, 1L) : > first argument must be a string (of length 1) or native symbol reference > Error: unable to load R code in package 'tools' > Execution halted > make[4]: *** [sysdata] Error 1 > make[4]: Leaving directory `/Store/buildr/src/library/tools' > make[3]: *** [all] Error 2 > make[3]: Leaving directory `/Store/buildr/src/library/tools' > make[2]: *** [R] Error 1 > make[2]: Leaving directory `/Store/buildr/src/library' > make[1]: *** [R] Error 1 > make[1]: Leaving directory `/Store/buildr/src' > make: *** [R] Error 1 > > [[alternative HTML version deleted]] > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- Brian D. Ripley, ripley at stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford 1 South Parks Road, Oxford OX1 3TG, UK
On 31 August 2015 at 15:21, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:> On 14/08/2015 15:19, Joe S wrote: > >> Are there any checks I can do to the R binary to test if it works >> properly? >> > > This does not seem to be about the R binary, but about dynamically loaded > modules. (All those export lines are non-standard, BTW, and your output is > not from an ab initio build so we don't know e.g. how tools.so was built.) > The meat is >Yes, because etc/ldpaths doesn't get configured properly so I edited manually. I should fix the configure script to identify all the environment variables properly first. It may be causing problems further along.> > Error in .Call(PS_sigs, 1L) : > > first argument must be a string (of length 1) or native symbol > reference > > That comes from package tools, which contains the R code > > PS_sigs <- getDLLRegisteredRoutines("tools")[[c(".Call", "ps_sigs")]] > SIGHUP <- .Call(PS_sigs, 1L) > > So, startup R from the top-level build directory with something like > > env R_DEFAULT_PACKAGES=NULL bin/R > > and at the prompt run > > dyn.load("src/library/tools/src/tools.so") > getLoadedDLLs() # should include a line for tools > getDLLRegisteredRoutines("tools") >Indeed, I got that far myself in the meantime.> getLoadedDLLs()Filename Dynamic.Lookup base base FALSE tools /Store/d2/library/tools/libs/tools.so TRUE>getDLLRegisteredRoutines("tools")data frame with 0 columns and 0 rows> My guess is that does not list any symbols, in particular not ps_sigs. > > We can only speculate as to what went wrong (visibility issues? Mapping > symbols to u/case? ...).For now I will keep digging into what dyn.load() is doing and why the symbols are missing. Any tips are appreciated. Thanks Joe> nm -g library/tools/libs/tools.so00004178 B __bss_start U __ctype_get_mb_cur_max w __cxa_finalize w __deregister_frame_info w __register_frame_info 00004178 D _edata 00004198 B _end 00002951 T _fini 00004170 D _gSharedObjectHaikuABI 00004174 D _gSharedObjectHaikuVersion 00000b54 T _init U fclose U ferror U fopen U fread U free U get_image_symbol U INTEGER U kill U LENGTH U libintl_dgettext U malloc U mbcslocale U memcpy U R_CHAR U R_chk_calloc U R_chk_free U R_chk_realloc 000019a0 T R_init_tools U R_NaInt U R_NaString U R_NilValue U R_registerRoutines U R_useDynamicSymbols U realloc U Rf_allocVector U Rf_asInteger U Rf_asLogical U Rf_coerceVector U Rf_error U Rf_getCharCE U Rf_install U Rf_isString U Rf_length U Rf_mbrtowc U Rf_mkChar U Rf_mkCharCE U Rf_protect U Rf_ScalarInteger U Rf_ScalarLogical U Rf_setAttrib U Rf_translateChar U Rf_unprotect U Rf_warning U Rprintf U SET_STRING_ELT U sprintf U strcmp U STRING_ELT U strlen U strncmp U TYPEOF [[alternative HTML version deleted]]