× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Re: Stuck with CPAN

Infinite
Aspirant

Stuck with CPAN

[This tread is based on another issue, but I want to make it more specific to CPAN and the ReadyNAS]

The problems I'm trying to resolve:
"How to compile CPAN modules on a ReadyNAS using the default 5.8.8 installation of Perl"
Message 1 of 8
Infinite
Aspirant

Re: Stuck with CPAN

After a lot of Googling and attempting to build various CPAN modules I hit a dead-end because MakeMaker.pm is missing. When I tried to build MakeMaker.pm I would hit a dead-end in another .pm. The good news is that I unblocked myself when I id the following steps:

hno wrote:
If apt-get complains that the package is already there then use the alternative dpkg method explained earlier, but extract to / instead of /tmp


# wget http://www.readynas.com/packages/readynas/perl-modules_5.8.8-7.infrant2_all.deb
# dpkg-deb -x perl-modules_5.8.8-7.infrant2_all.deb /


The package above adds MakeMakers and other needed modules. So I can get back to installing one of the first CPAN modules.
Message 2 of 8
Infinite
Aspirant

Re: Stuck with CPAN

Next snag...

I hit another snag right after running 'perl MakeInstall.pl'. When I run 'make' the system complains that:
make: *** No rule to make target `/usr/lib/perl/5.8/CORE/config.h', needed by `Makefile'. Stop.

Googling this tells me that I need 'Perl-devel' so that I can 'make' my module. So now I'm trying to figure out how to get 'perl-devel' on my ReadyNAS without having to build Perl from scratch as I'm afraid that will make modules that are not backwards compatible with Perl 5.8.8.

I have been trying to hunt down 'perl-devel' but I can only find is mentioned in some RPM's. Otherwise I have not been able to find it in any Debian Packages. Can anyone help?
Message 3 of 8
Infinite
Aspirant

Re: Stuck with CPAN

Uggg... fail. I thought I should try rebooting to make sure the Duo was still stable; NOPE! I'm currently resetting my Duo to Factory Defaults. I plan on trying this next:


apt-get install gcc bison make libc6-dev
wget http://www.cpan.org/src/5.0/perl-5.12.2.tar.gz
tar xzf perl-5.12.2.tar.gz
cd perl-5.12.2
./Configure -des -Dprefix=$HOME/tools/perl -Accflags="-DHAS_SYSCALL_PROTO -DHAS_SHMAT_PROTOTYPE"
make install
$HOME/tools/perl/bin/cpan install YAML LWP


I'm going to try to install 5.8.8 first... I'm still hoping that if I can get a clean build of Perl that I can make modules that I can distribute with Frontview.
Message 4 of 8
chirpa
Luminary

Re: Stuck with CPAN

FrontView uses perl bytecode. If you upgrade perl from the version that is on there, it will most likely break FrontView, so be careful.
Message 5 of 8
Infinite
Aspirant

Re: Stuck with CPAN

chirpa wrote:
FrontView uses perl bytecode. If you upgrade perl from the version that is on there, it will most likely break FrontView, so be careful.


Good to know, chirpa. I'm not planning on upgrading Perl, just re-installing version 5.8.8 so that I can use CPAN more easily. Do you have any recommendations on how to install and or use CPAN module with a ReadyNAS without rebuilding Perl? Unless I am mistaken rebuilding Perl should have no effect on the computability of the modules I compile as long as the version I install is the same as the version pre-installed on the ReadyNAS (5.8.8).

I wish that the perl modules I was using were all using interpreted code, but that doesn't seem to be the case.
Message 6 of 8
Infinite
Aspirant

Re: Stuck with CPAN

So... here what I have so far:

[Fresh NAS]
Add APT
Add SSH support
Add basic libs from here: http://www.readynas.com/?p=145

Now for perl:

apt-get install coreutils
apt-get install gcc bison make libc6-dev
wget http://www.cpan.org/src/5.0/perl-5.8.8.tar.gz
tar xfz perl-5.8.8.tar.gz
cd perl-5.8.8
./Configure -des -Dprefix=$HOME/tools/perl -Accflags="-DHAS_SYSCALL_PROTO -DHAS_SHMAT_PROTOTYPE"
make


At this point I'm blocked again.

$make
`sh cflags "optimize='-O2'" miniperlmain.o` miniperlmain.c
CCCMD = gcc -DPERL_CORE -c -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -Wall
In file included from miniperlmain.c:36:
perl.h:500: error: conflicting types for `syscall'
/usr/include/unistd.h:939: error: previous declaration of `syscall'
make: *** [miniperlmain.o] Error 1


:cry: I'm officially giving up. Maybe if I have some free time in the future I'll revisit the issue but I can't justify the time anymore. My only constructive feedback for the ReadyNAS team is that it would be super helpful if a functional version of 'cpan' was available for FrontView development. It clearly seems from the docs that Perl and sh are preferred for FrontView then it would make a lot of sense to support CPAN out of the box. Or at least lower the barrier of entry for developers like myself. I was super disappointing to get so far (having a working perl script, and fully understanding the FrontView deployment and packaging system) just to be blocked by a Perl module. It's a shame because you want your 3rd part developers to be banging their heads again making cool features for users not wasting time fighting with the dev environment itself. The only technical challenge that blocked me was getting the Net::Twitter:Lite CPAN module to build on the ReadyNAS. IMHO getting the the CPAN module running should have been the easiest step as it's a one-liner in OSX or Ubuntu. From my reading CPAN is a huge resource for Perl developers and thus should be rather important to FrontView developers, right?

Anyway, it was a good experience. I made it though my Perl book, coded an Twitter app that works, and I also got a very real life experience about the problems with modern tools chain programming. At this point I must say I prefer coding monolithic apps in Ruby and Python over Tool-Chains.

Thanks to the couple of folks that tried to provide assistance.

Sigh...
Message 7 of 8
dedmeet
Aspirant

Re: Stuck with CPAN

Old post, but for anyone who googles:

Install the apt addon http://www.readynas.com/?p=4216
And the rootSSh addon http://www.readynas.com/download/addons/4.00/EnableRootSSH_1.0.bin

Then
apt-get update
apt-get --reinstall install perl perl-base perl-modules perl-doc

Check perl version:
nas:~# perl -v
This is perl, v5.8.8 built for sparc-linux

🙂 Great, still same version of perl

nas:~# cpan -v
cpan script version 1.03
CPAN.pm version 1.7602

🙂 CPAN now installed

Also fix missing cc by linking it to gcc

cd /usr/bin
ln -s ./gcc ./cc
Message 8 of 8
Top Contributors
Discussion stats
  • 7 replies
  • 3720 views
  • 0 kudos
  • 3 in conversation
Announcements