Installation of modules Perl 6 failed - No compiler available for Perl v6.c - perl-module

I installed Rakudo, the Perl 6 interpreter, by:
sudo apt-get install rakudo
I am following a tutorial about installation of Perl 6 modules:
http://perl6maven.com/how-to-install-perl6-modules
And in the last step I get this error:
perl6 bootstrap.pl===SORRY!=== Error while compiling /home/daniel/test/panda/bootstrap.pl
No compiler available for Perl v6.c
at /home/daniel/test/panda/bootstrap.pl:3
------> use v6.c⏏;
Information about versions:
Ubuntu 16.04.2 LTS
This is perl6 version 2015.11 built on MoarVM version 2015.11
How do I install the lacking compiler?

Warning: This solution can be used for development, but for production it is recommended to manually compile the interpreter until the Ubuntu repository will not be updated.
Panda described in the linked tutorial is depreciated. I should use zef to install Perl modules.
My build of Perl was too old. I realized this after reading issue 380 about not working version 6.c.
The correct tutorial about installation of the newest Perl, 6.c, on Ubuntu is here:
http://linuxtot.com/installing-perl-6-on-debian-or-ubuntu/
Now my rakudo -v prints:
This is Rakudo version 2017.07-132-gabf1cfe built on MoarVM version 2017.07-318-g604da4d
implementing Perl 6.c.
And everything works great.
The below commands are extracted from a tutorial linked below:
apt-get install build-essential git libssl-dev
git clone https://github.com/tadzik/rakudobrew ~/.rakudobrew
echo 'export PATH=~/.rakudobrew/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
rakudobrew build moar
rakudobrew build zef
Now to install the perl6 module:
zef install Module::Name

If you are comfortable installing your own software from source, then try the following (update the URL for the latest Rakudo Star from https://rakudo.perl6.org/downloads/star/):
wget -O rakudo-star-2017.07.tar.gz https://rakudo.perl6.org/downloads/star/rakudo-star-2017.07.tar.gz
tar -xvf rakudo-star-2017.07.tar.gz
cd rakudo-star-2017.07
perl Configure.pl --backend=moar --gen-moar
make
make rakudo-test
make install
Then add the following paths to your $PATH (replacing /path/to with the actual path, of course):
/path/to/rakudo-star-2017.07/install/bin
/path/to/rakudo-star-2017.07/install/share/perl6/site/bin
I use a module file for this:
#%Module1.0
## Metadata ###########################################
set this_module rakudo-star
set this_version 2017.07
set this_root /path/to/$this_module/$this_module-$this_version/install
set this_docs http://rakudo.org/documentation/
#######################################################
## Module #############################################
proc ModulesHelp { } {
global this_module this_version this_root this_docs
puts stderr "$this_module $this_version"
puts stderr "****************************************************"
puts stderr " $this_docs"
puts stderr "****************************************************\n"
}
module-whatis "Set up environment for $this_module $this_version"
prepend-path PATH $this_root/bin
prepend-path PATH $this_root/share/perl6/site/bin

Related

Failde to compile : ocamlfind: Package `xmlm' not found

I am trying to compile an OCaml .ml file with make command via command line remote machine but it shows me this error:
+ ocamlfind ocamlc -c -package xmlm -package unix -o pms.cmo pms.ml
ocamlfind: Package `xmlm' not found
Command exited with code 2.
Hint: Recursive traversal of subdirectories was not enabled for this build,
as the working directory does not look like an ocamlbuild project (no
'_tags' or 'myocamlbuild.ml' file). If you have modules in subdirectories,
you should add the option "-r" or create an empty '_tags' file.
To enable recursive traversal for some subdirectories only, you can use the
following '_tags' file:
true: -traverse
<dir1> or <dir2>: traverse
Compilation unsuccessful after building 6 targets (5 cached) in 00:00:00.
Makefile:10 : la recette pour la cible « native » a échouée
make: *** [native] Erreur 10
I tried to export the environment with this command:
eval $(/usr/bin/opam config env --root=/path/Ocaml/opam-ocaml-4.04-strech)
But also I had this error :
# opam-version 1.2.2
# os linux
File /p/opas/src/Ocaml/opam-ocaml-4.04-strech/config does not exist
while the config file does exist in the directory
any help Please ?!!
Thank you
To make a package available via opam (assuming that opam is properly installed and configured) you need to:
install the package
activate your opam
To install a package named foo, execute the following command in your shell
opam install foo
To activate your opam installation (which enables the search paths), issue the following command
eval $(opam config env)
or, with modern opam (that is of version 2.x) just eval $(opam env)
Before doing this, you need to properly initialize your opam installation, i.e., to install the compiler (or use the system compiler) and the base packages. This is done via the opam init command that creates an opam-managed subdirectory in your home, e.g., using an (old by today's standards) OCaml version 4.04.0, you can initialize it like this
opam init --comp=4.04.0
once the initialization is finished, do not forget to activate it via eval $(opam config env) and now you can install the package.
Finally, the version of opam that you're using is outdated and long ago deprecated, thus it is not receiving updates and the repositories that this version can understand are frozen and no longer updated. You really need to update your opam to a 2.x version. Please follow the opam installation instructions to get the latest version.

git-svn Can't locate SVN/Core.pm after fresh installation of macOS Catalina 10.15.4

Recently I reinstalled macOS Catalina 10.15.4. After I installed Command_Line_Tools_11.4.1, it told me svn is no longer working with Xcode. Then I installed both git and svn by brew, hopefully git-svn would work. Unfortunately got this error message:
Can't locate SVN/Core.pm in #INC (you may need to install the SVN::Core module) (#INC contains: /usr/local/Cellar/git/2.26.2/share/perl5 /Applications/Xcode.app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level /Library/Developer/CommandLineTools/Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /usr/local/Cellar/git/2.26.2/share/perl5/Git/SVN/Utils.pm line 6.
Both git & svn are the latest version.
Please help me out.
Finally I figure it out!!!
Open the git-svn file (perl script, in my case file location is /usr/local/opt/git/libexec/git-core/git-svn), change the first line #!/usr/bin/perl to #!/usr/local/bin/perl
And it works!
I guess system perl doesn't include perl SVN/Core, but brew perl has it (dependency of brew svn).
Solution for MacOS Big Sur 11.5
After struggling with this error for hours:
Can't locate SVN/Core.pm in #INC (you may need to install the SVN::Core module)
I've finally found a solution that actually works.
If you run:
brew reinstall subversion
It will print a message like this:
The perl bindings are located in various subdirectories of:
/usr/local/opt/subversion/lib/perl5
Then you just need to run this command before using git svn to load the SVN module from the correct path:
export PERL5LIB=/usr/local/opt/subversion/lib/perl5/site_perl/5.30.2/darwin-thread-multi-2level
Solution for those, who, like me - want to use Sourcetree client on macOS Catalina with git-svn:
First step:
brew install git
brew install perl
brew install subversion
edit
/usr/local/Cellar/git/git_version/libexec/git-core/git-svn
replace
#!/usr/bin/perl
with
#!/usr/local/bin/perl
Second step, install missed perl modules:
cpan SVN::Core
cpan Term::ReadKey
Third step, configure SourceTree:
In Sourcetree->Preferences - set option "use system git", from:
/usr/local/Cellar/git/git_version/git
While not a permanent fix, a workaround is to set ${GITPERLLIB}:
$ export GITPERLLIB=/usr/local/Cellar/git/2.31.1/share/perl5:/usr/local/lib/perl5/site_perl/5.28.2/darwin-thread-multi-2level
$ git svn clone svn+ssh://...
worked for me without editing any scripts installed by brew.
Ensure you've installed Perl, Subversion and dependencies via Homebrew:
brew install perl subversion apr apr-util
Install required Perl modules into ~/perl5:
export PATH="/usr/local/opt/apr/bin:/usr/local/opt/apr-util/bin:$PATH"
PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib Git::SVN SVN::Core
Verify installed modules by:
PERL5LIB="$HOME/perl5" cpan -l | grep SVN
Then configure Perl as following (based on brew info perl steps):
eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)"
Finally run Git's SVN:
PERLLIB="$HOME/perl5" git svn clone https://svn.somecode.example.com/svn/trunk
If you're still stuck, try GitHub and GitLab websites which offer migration with a Git/SVN.
E.g. in GitHub, create a new repository, then import the project by pasting old repository’s clone URL.
The error message says:
$ git svn --version
Can't locate SVN/Core.pm in #INC (you may need to install the SVN::Core module) (#INC contains: /usr/local/opt/subversion/lib/perl5 /usr/local/Cellar/git/2.31.1/share/perl5 /Applications/Xcode.app/Contents/Developer/Library/Perl/5.28/darwin-thread-multi-2level /Library/Developer/CommandLineTools/Library/Perl/5.28/darwin-thread-multi-2level /Library/Perl/5.30/darwin-thread-multi-2level /Library/Perl/5.30 /Network/Library/Perl/5.30/darwin-thread-multi-2level /Network/Library/Perl/5.30 /Library/Perl/Updates/5.30.2 /System/Library/Perl/5.30/darwin-thread-multi-2level /System/Library/Perl/5.30 /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level /System/Library/Perl/Extras/5.30) at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN/Utils.pm line 6.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN/Utils.pm line 6.
Compilation failed in require at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN.pm line 25.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN.pm line 32.
Compilation failed in require at /usr/local/Cellar/git/2.31.1/libexec/git-core/git-svn line 23.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/libexec/git-core/git-svn line 23.
This is because git-svn is implemented by Perl, it needs a Perl library called SVN::Core to run。
Changing the first line of git-svn script from #!/usr/bin/perl to #!/usr/local/bin/perl won't fix this error!!! Because this just changes the Perl library from system default version to brew installed version。If the brew installed version doesn't contains SVN::Core, it'll still fail:
$ git svn --version
Can't locate SVN/Core.pm in #INC (you may need to install the SVN::Core module) (#INC contains: /usr/local/Cellar/git/2.31.1/share/perl5 /Applications/Xcode.app/Contents/Developer/Library/Perl/5.28/darwin-thread-multi-2level /Library/Developer/CommandLineTools/Library/Perl/5.28/darwin-thread-multi-2level /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0 /usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0 /usr/local/lib/perl5/site_perl/5.34.0/darwin-thread-multi-2level /usr/local/lib/perl5/site_perl/5.34.0) at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN/Utils.pm line 6.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN/Utils.pm line 6.
Compilation failed in require at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN.pm line 25.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN.pm line 32.
Compilation failed in require at /usr/local/Cellar/git/2.31.1/libexec/git-core/git-svn line 23.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/libexec/git-core/git-svn line 23.
Note that the Perl version has been changed, but the error still exists. Because there is no SVN:Core in the directories indicated by #INC.
Now some answers may tell you to install SVN::Core by cpan SVN::Core, Don't do that!!! This won't solve the problem! Because the version of SVN::Core it installed, may not match with your SVN version:
$ git svn --version
error: git-svn died of signal 11
By the way, cpan is rubbish, don't use it to install anything. It compiles the source before installation but cannot control the compile flags/options, and it cannot uninstall things that are installed by itself.
Here is the right solution:
The corresponding Perl libraries are already installed when you installed svn, and brew has already told you:
$ brew info svn
subversion: stable 1.14.1 (bottled), HEAD
Version control system designed to be a better CVS
https://subversion.apache.org/
/usr/local/Cellar/subversion/1.14.1_2 (234 files, 32.1MB) *
Poured from bottle on 2021-06-02 at 15:52:30
From: https://mirrors.ustc.edu.cn/homebrew-core.git/Formula/subversion.rb
License: Apache-2.0
==> Dependencies
Build: openjdk ✘, pkg-config ✘, python#3.9 ✔, scons ✘, swig ✘
Required: apr ✔, apr-util ✔, gettext ✔, lz4 ✔, openssl#1.1 ✔, utf8proc ✔
==> Options
--HEAD
Install HEAD version
==> Caveats
svntools have been installed to:
/usr/local/opt/subversion/libexec
The perl bindings are located in various subdirectories of:
/usr/local/opt/subversion/lib/perl5
You may need to link the Java bindings into the Java Extensions folder:
sudo mkdir -p /Library/Java/Extensions
sudo ln -s /usr/local/lib/libsvnjavahl-1.dylib /Library/Java/Extensions/libsvnjavahl-1.dylib
==> Analytics
install: 33,749 (30 days), 67,978 (90 days), 239,148 (365 days)
install-on-request: 33,129 (30 days), 67,011 (90 days), 229,097 (365 days)
build-error: 0 (30 days)
We can see that the Perl bindings are located in /usr/local/opt/subversion/lib/perl5, we just need to let git-svn use this path. With a little investigation of git-svn script, we can see this behavior is controlled by an environment variable called GITPERLLIB:
$ head /usr/local/Cellar/git/2.31.1/libexec/git-core/git-svn
#!/usr/bin/perl
use lib (split(/:/, $ENV{GITPERLLIB} || '/usr/local/Cellar/git/2.31.1/share/perl5:/Applications/Xcode.app/Contents/Developer/Library/Perl/5.28/darwin-thread-multi-2level:/Library/Developer/CommandLineTools/Library/Perl/5.28/darwin-thread-multi-2level'));
# Copyright (C) 2006, Eric Wong <normalperson#yhbt.net>
# License: GPL v2 or later
So the right way to solve this problem is to add the following code to your bashrc or zshrc:
export GITPERLLIB=/usr/local/opt/subversion/lib/perl5/site_perl/$<your_perl_version>/darwin-thread-multi-2level
Problem solved!

How to install Net::SSH2 from CPAN on Cygwin

I needed to install Net:SSH2 in a Cygwin environment under Windows 7 (64 bit). As usually I tried to install it with cpanm.
I already had the necessary Cygwin packages (see below) installed but the Perl build failed because it couldn't find the libssh2 library.
There is a special text file BUILDING.WIN32 in the Net::SSH2 package but this is only useful when building the module by hand and it refers mainly to MinGW. So this no help.
This is the log of the build:
Entering Net-SSH2-0.53
Checking configure dependencies from META.yml
Checking if you have ExtUtils::MakeMaker 6.59 ... Yes (7.02)
Running Makefile.PL
Configuring Net-SSH2-0.53 ... Subroutine checklibs redefined at inc/Module/Install/CheckLib.pm line 11.
Subroutine assertlibs redefined at inc/Module/Install/CheckLib.pm line 25.
Subroutine _author_side redefined at inc/Module/Install/CheckLib.pm line 39.
The libssh2 library is required by this module. If you don't have it, you can
download it from http://www.libssh2.org; you may also need OpenSSL, which can
be obtained from http://www.openssl.org , or libgcrypt, which can be obtained
from http://www.gnupg.org .
Debian: sudo aptitude install libssh2-1-dev
OpenSUSE: sudo zypper in libssh2-1 libssh2-devel
You can pass your libssh2 lib and include dirs (and extra link args) on the
command line. E.g.:
perl Makefile.PL lib=$HOME/libssh2/lib inc=$HOME/libssh2/include \
ldargs="-lz"
These can also be set through the LIBSSH2_LIB/LIBSSH2_INCLUDE/LIBSSH2_LDARGS
environment variables.
To build with libgcrypt instead of OpenSSL, pass 'gcrypt' as a parameter to
Makefile.PL, e.g.:
perl Makefile.PL gcrypt
If you want to build on Windows, see the file BUILDING.WIN32 in the
distribution.
Can't link/include C library 'ssh2', aborting.
First install the libssh2-devel package from Cygwin, e.g. with apt-cyg the command line frontend for installing packages from within a cygwin shell.
apt-cyg install libssh2-devel
Then set some environment variables to the right path for getting Net::SSH2 to work with the Cygwin packages:
LIBSSH2_LIB=/usr/lib/ LIBSSH2_INCLUDE=/usr/include/ cpanm -v Net::SSH2
That worked for me. Much easier than what the readme file linked above looked like.

How to downgrade Perl on Mac OS X Mavericks

The newly release Mavericks has removed the deprecated module "Switch.pm" from its repository.
However, I have recently try to build AOSP source tree and it somehow uses this module to generate "make-hash-tools.pl"
The Mavericks has perl version of 5.16.2, and its predecessor Mountain Lion has a 5.12.4. Is there a way to downgrade my Perl?
Compilation error looks like this:
Can't locate Switch.pm in #INC (#INC contains: /Library/Perl/5.16/darwin-thread-\
multi-2level /Library/Perl/5.16 /Network/Library/Perl/5.16/darwin-thread-multi-2level\
/Network/Library/Perl/5.16 /Library/Perl/Updates/5.16.2\
/System/Library/Perl/5.16/darwin-thread-multi-2level /System/Library/Perl/5.16\
/System/Library/Perl/Extras/5.16/darwin-thread-multi-2level \
/System/Library/Perl/Extras/5.16 .) at external/webkit/Source/WebCore\
/make-hash-tools.pl line 23.
Thanks~!
You can use perlbrew to install a parallel version of Perl in its own directory with its own modules. Currently it lets you install Perl as far back as 5.003_07, although not all of them are supported by Perl Porters for security fixes.
It would probably be simpler to install Switch from CPAN though.
looks like running sudo cpanm Switch --force worked for me
you can also use this:
$ sudo defaults write '/Library/Preferences/com.apple.versioner.perl' Version 5.12
It makes perl run version 12 for most stuff. Unfortunately, not for apache ...
Worked for me on 10.9.2, with no "force".
cpan[2]> install Switch
Running install for module 'Switch'
Running make for C/CH/CHORNY/Switch-2.17.tar.gz
Fetching with LWP:
... bunch of fetch stuff ...
CPAN.pm: Building C/CH/CHORNY/Switch-2.17.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for Switch
Writing MYMETA.yml and MYMETA.json
... a bunch of xcode license stuff ...
cp Switch.pm blib/lib/Switch.pm
Manifying blib/man3/Switch.3pm
CHORNY/Switch-2.17.tar.gz
/usr/bin/make -- OK
'YAML' not installed, will not store persistent state
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/given.t ... ok
t/nested.t .. ok
t/switch.t .. ok
All tests successful.
Files=3, Tests=590, 0 wallclock secs ( 0.04 usr 0.01 sys + 0.22 cusr 0.01 csys = 0.28 CPU)
Result: PASS
CHORNY/Switch-2.17.tar.gz
/usr/bin/make test -- OK
Running make install
Installing /Library/Perl/5.16/Switch.pm
Installing /usr/local/share/man/man3/Switch.3pm
Appending installation info to /Library/Perl/Updates/5.16.2/darwin-thread-multi-2level/perllocal.pod
CHORNY/Switch-2.17.tar.gz
/usr/bin/make install -- OK
I then ran my code that previously pitched the "Can't locate Switch.pm in #INC" error, and the code ran fine.
I found another command :
sudo cpan -f Switch
I had to execute the command 2 times but for me it works on Yosemite. Thank s this blog.
I find these command works.
sudo perl -MCPAN -e shell
cpan > force install Switch

Can not configure Mapnik due to icuuc

Trying to compile Mapnik on OSX 10.8
So after I clone the Github repo, I go to run the configure command like so:
./configure and then get the error:
Checking for C++ library icuuc... no
Could not find required header or shared library for icuuc
and later:
Exiting... the following required dependencies were not found:
- icuuc (ICU C++ library | configure with ICU_LIBS & ICU_INCLUDES or use ICU_LIB_NAME to specify custom lib name | more info: http://site.icu-project.org/)
Looking at the Mapnik troubleshooting area for a solution: https://github.com/mapnik/mapnik/wiki/InstallationTroubleshooting
Says: Solution: If g++ is available then ICU must be in a custom location so set the paths to the libs and includes - ie. ICU_LIBS=/usr/local/lib and ICU_INCLUDES=/usr/local/include.
By running g++ from command line I get: i686-apple-darwin11-llvm-g++-4.2: no input files
So this means that g++ is available, but I have no idea how to go about setting the paths so that configure can find them.
ICU Libraries were installed by default or with homebrew, not sure which.
terminal: brew install icu4c
Warning: icu4c-51.1 already installed
Finding the icu4c install directory:
terminal: mdfind icu4c
/usr/local/Cellar/icu4c
You can add the path of your ICU_LIB/INCLUDE to your configure command:
./configure ICU_INCLUDES=/usr/local/Cellar/icu4c/include ICU_LIBS=/usr/local/Cellar/icu4c/lib
And for more help about configure on what options are accepted do:
./configure --help
For the installation reference, you can check this:
https://github.com/mapnik/mapnik/blob/v2.2.0/INSTALL.md
As per our discussion and my last comment something like the following might work.
export ICU_LIBS=/usr/local/Cellar/icu4c/lib
export ICU_INCLUDES=/usr/local/Cellar/icu4c/include
./configure
If you find same errors:
Checking for C++ library XXX... no
Follow the command
sudo apt-get install g++ libXXX-dev
Using tips (TAB button), you can see what XXX libraries you have available
sudo apt-get install libXXX(press double TAB)

Resources