July 6, 06
Attempt to free non-existent shared string 'ldlibpthname' during global destruction.What's the problem?
July 5, 06
Error in .PerlExpr("use GCC::TranslationUnit;") : Error evaluating use GCC::TranslationUnit;: Can't load '/usr/local/lib/perl5/5.8.8/i686-linux/auto/Fcntl/Fcntl.so' for module Fcntl: /usr/local/lib/perl5/5.8.8/i686-linux/auto/Fcntl/Fcntl.so: undefined symbol: PL_sv_undef at /usr/local/lib/perl5/5.8.8/i686-linux/XSLoader.pm line 70. at /usr/local/lib/perl5/5.8.8/i686-linux/Fcntl.pm line 234where Fcntl is replaced by the package you are trying to load. What's the problem? and how can I fix it?
How do you get around this? There are two ways:
dyn.load(system.file("libs", paste("RSPerl", .Platform$dynlib.ext, sep = "")), package = "RSPerl") , local = FALSE)Do this BEFORE you load the RSPerl package with library(RSPerl) or it is implicitly loaded.
Jun 7, 06
R CMD INSTALL --configure-args='--with-perl-prefix=' RSPerlNote that there is no value given for the argument. This tells the configuration script that you want Perl's own setting. (Alternatively you can specify a directory of your own chosing and the files will be installed under that. That wasn't so hard now, was it? Well the only problem is that when the configuration script asked Perl to install these files it probably failed as you did not have permission to write to those system-level directories. (You may have if you were running as root, but that is far from ideal. Do you really trust this configuration script in all its complexity not to do something dangerous. I know I don't and I wrote the script!). To fix this problem, assuming you didn't use the --clean argument for R CMD INSTALL, we can do that part of the installation manually. Either use sudo or explicitly login as root to perform the following task:
RSPerl/src
make -f Makefile.perl install
R CMD INSTALL --configure-args='--with-modules="IO Fcntl Socket"' RSPerlIf you just specify IO and not the Fcntl and Socket, you'll see a segmentation fault after
library(RSPerl) .PerlExpr("use IO;")
/usr/bin/ld: cannot find -lperl collect2: ld returned 1 exit status make: *** [RSPerl.so] Error 1 ERROR: compilation failed for package `RSPerl'
edd@debian.org
),
points out
you need to install the matching -dev package which creates the link for you -- in this case the package is called "libperl-dev". |
---|
The simple perl script
perl -e 'use ExtUtils::Embed; print ldopts(), "\n"' ;should return the correct options. However, for some reason it is not giving the correct values on some machines.
perl plot.pl < fileName bar | perl plot.plthe plot does not appear! What's the problem?
To fix this "problem", just explicitly open a graphics device before calling plot. See plot1.pl in the tests directory of the package.
$a = "1"
can be used as a string or
a number.
However, when such a value is passed to R, we pass it is
a string to R. When used in an R expression that expects a
number, R raises an error.
This arises when we use R to read numbers from a file or stream
and then pass them directly to R. Instead, we must ensure that
they are numbers in Perl before passing them to R.
This can be done easily by merely adding 0 to the
value as it is read.
Or we can explicitly use R to convert the values to numbers
(e.g. by calling as.numeric
)
and then use the result. This invilves multople transfers
of the data.
See stringNums.pl
in the tests/ directory.
Non-code reference passed via .Perl.
Need a sub-routine name or Code object.
.Perl("myRoutine", pkg = "MyPackage")One thing to do is to load the Perl module/package (MyPackage) before using the call
.PerlPackage("MyPackage")Then the call
.Perl("myRoutine", pkg = "MyPackage")works fine.
Alternatively, we need to fix the code to identify the Code object that gets resolved.
.PerlGet("INC", TRUE)You may want to do this if you have two versions of perl installed and want to verify that it is using the right one.
ld: /System/Library/Perl/5.8.1/darwin-thread-multi-2level/auto/Apache/Leak/Leak.bundle is input for the dynamic link editor, is not relocatable by the static link editor again ld: /System/Library/Perl/5.8.1/darwin-thread-multi-2level/auto/Apache/Symbol/Symbol.bundle is input for the dynamic link editor, is not relocatable by the static link editor again
To run R inside Perl (only), you do not need this support for loading Perl modules. Accordingly, the default for PERL_MODULES is no. So
R CMD INSTALL --configure-args='--with-in-perl' RSPerlis the same as
R CMD INSTALL --configure-args='--with-in-perl --with-modules=no' RSPerl
perl -Vand the command line arguments to Configure with
perl -V:config_args
If I build Perl with the command line
./Configure -de -Doptimize='-fPIC -g' ; makethen the resulting version of Perl in /usr/local/bin behaves properly. Adding
-Dusemultiplicity
causes an error
to terminate the process, e.g.
.PerlPackage("Storable") just exits.
July 6, 06
strace -f -F -s 300 perl -e 'use Mail::Box::Mbox;' |& grep '/.*\.so"' | grep -v '\(No such file or directory\)' | grep -v CORE | sed -e 's|.*/auto/\(.*\)/.*\.so".*|\1|' | sort | uniqAll this does is run the Perl command to load the module and trace the system calls. We look only at the lines containing the string ".so" and exclude lines where the attempt to access the file was unsuccessful (i.e. there is a message "No such file or directory"). Then we exclude libperl.so itself which is in CORE and then get to work to extract the directory names after the /auto directory. We can then process the list further to convert / to :: to get the Perl module name when they are nested.