Switch to different version of Perl - modules version - linux

I am trying to use a new version of perl - 5.18.1 and I get an error for one of the modules I am trying to use:
/usr/local/perl-5.18.1/bin/perl: symbol lookup error:
/home/riskprod/bin/lib/perl5/x86_64-linux-thread-multi/auto/Cwd/Cwd.so:
undefined symbol: Perl_Tstack_sp_ptr
I have cpan and use it for my modules. From my research it looks like the reason for the error is that it was built using different version of perl.
How can I change the version of the build? What would be the proper solution to this problem?
Some details
Here is what I have in bash_profile:
export PERL_LOCAL_LIB_ROOT="/home/riskprod/perl5:$PERL_LOCAL_LIB_ROOT";
export PERL_MB_OPT="--install_base "/home/riskprod/perl5"";
export PERL_MM_OPT="INSTALL_BASE=/home/riskprod/perl5";
export PERL5LIB="/home/riskprod/perl5/lib/perl5:$PERL5LIB";
export PATH="/home/riskprod/perl5/bin:$PATH";
Here is how I ran the cpan:
/usr/local/perl-5.18.1/bin/perl -MCPAN -e shell
I did this to reinstall:
force install Cwd

The module you are trying to use was compiled against a different build of Perl. It's not clear what you did for that to happen. Maybe you set PERL5LIB to point to an directory into which modules were installed using INSTALL_BASE? (Damn you, INSTALL_BASE!) You just need to reinstall the module, but it would also help to stop looking in whatever directory contains the that module.

Related

-bash: module: command not found while loading module

I am using following command to load module but it is not working.
module load $SOME_PATH
but i am getting error -bash: module: command not found .Do i need to isntall something using sudo apt-get install?
You need to have the module executable for which there seems to be no ready-made package. The documentation suggests that you build from source.
When you've built it, make sure that you are either in the directory where your module file is, or that it's in your $PATH.
Here are the docs

unable to execute 'x86_64-conda_cos6-linux-gnu-gcc': No such file or directory (pysam installation)

I am trying to install pysam.
After excecuting:
python path/to/pysam-master/setup.py build
This error is produced:
unable to execute 'x86_64-conda_cos6-linux-gnu-gcc': No such file or directory
error: command 'x86_64-conda_cos6-linux-gnu-gcc' failed with exit status 1
There are similar threads, but they all seem to address the problem assumig administriator rights, which I do not have. Is there a way around to install the needed files?
DISCLAIMER: This question derived from a previous post of mine.
manually installing pysam error: "ImportError: No module named version"
But since it might require a different approach, I made it a question of its own.
You can also receive the same error while installing some R packages if R was installed using conda (as I had).
Then just install the package by executing: conda install gxx_linux-64 to have that command available.
Source:
https://github.com/RcppCore/Rcpp/issues/770#issuecomment-346716808
It looks like Anaconda had a new release (4.3.27) that sets the C compiler path to a non-existing executable (quite an embarrassing bug; I'm sure they'll fix it soon). I had a similar issue with pip installing using the latest Miniconda, which I fixed by using the 4.3.21 version and ensuring I was not doing something like conda update conda.
See https://repo.continuum.io/miniconda/ which has release dates and versions.
It should now be safe to update conda. This is fixed in the following python packages for linux-64:
python-3.6.2-h0b30769_14.tar.bz2
python-2.7.14-h931c8b0_15.tar.bz2
python-2.7.13-hac47a24_15.tar.bz2
python-3.5.4-hc053d89_14.tar.bz2
The issue was as Jon Riehl described - we (Anaconda, formerly Continuum) build all of our packages with a new GCC package that we created using crosstool-ng. This package does not have gcc, it has a prefixed gcc - the missing command you're seeing, x86_64-conda_cos6-linux-gnu-gcc. This gets baked into python, and any extension built with that python goes looking for that compiler. We have fixed the issue using the _PYTHON_SYSCONFIGDATA_NAME variable that was added to python 3.6. We have backported that to python 2.7 and 3.5. You'll now only ever see python using default compilers (gcc), and you must set the _PYTHON_SYSCONFIGDATA_NAME to the appropriate filename to have the new compilers used. Setting this variable is something that we'll put into the activate scripts for the compiler package, so you'll never need to worry about it. It may take us a day or two to get new compiler packages out, though, so post issues on the conda-build issue tracker if you'd like to use the new compilers and need help getting started.
Relevant code changes are at:
py27: https://github.com/anacondarecipes/python-feedstock/tree/master-2.7.14
py35: https://github.com/anacondarecipes/python-feedstock/tree/master-3.5
py36: https://github.com/anacondarecipes/python-feedstock
The solution that worked for me was to use the conda to install the r packages:
conda install -c r r-tidyverse
or r-gggplot2, r-readr
Also ensure that the installation is not failing because of admin privileges.
It will save you a great deal of pain
After upgrading Golang to 1.19.1, I started to get:
# runtime/cgo
cgo: C compiler "x86_64-conda-linux-gnu-cc" not found: exec: "x86_64-conda-linux-gnu-cc": executable file not found in $PATH
Installing gcc_linux-64 from the same channel, has resolved it:
conda install -c anaconda gcc_linux-64
Somewhere in your $PATH (e.g., ~/bin), do
ln -sf $(which gcc) x86_64-conda_cos6-linux-gnu-gcc
Don't put this in a system directory or conda's bin directory, and remember to remove the link when the problem is resolved upstream. gcc --version should be version 6.
EDIT: I understand the sentiment in the comments against manipulating system paths, but maybe we can use a little critical thinking for the actual case in hand before reciting doctrine. What actually have we done with the command above? Nothing more than putting an executable (symlink) called x86_64-conda_cos6-linux-gnu-gcc in one's personal ~/bin directory.
If putting something in one's personal ~/bin directory broke future conda (after it fixes the C compiler path to point to gcc it embeds), then that would be a bug with conda. Would the existence of this verbosely named compiler mess with anything else? Unlikely either. Even if something did pick it up, it's just your system gcc after all...

Installed Module not contained in the Perl's #INC path

I have an issue on including the Excel-Writer-XLSX module in the #INC path. I did some research before posting this question and tried several solutions, but they all failed.
So I did
$sudo perl -MCPAN -e 'install Excel::Writer::XLSX'
But after I run the code, I got this message
--can't locate Excel/Writer/XLSX.pm in #INC(you may need to install the Excel::Writer::XLSX module) (#INC contains: /Library/Perl/5.18/darwin-thread-multi-2level/...)
This is not a duplicate question, because the Excel::Writer::XLSX module has been successfully installed in my computer and I don't need to install it again. The thing is when I checked my library folder, the perl5 folder is not there, as it was suggested by the #INC path. Instead, Perl5 folder is in my user folder...and actually the module can be found in the lib folder inside the perl5 folder
I'm not quite sure what is happening...Why the #INC path shows the perl/5.18 is inside the library folder? If you know how to solve this issue, please advice. Thank you so much!
Make sure the #INC contains the path where your modules are getting installed. You can specify that by
export PERL5LIB=/home/foobar/code (For Linux) (Add this to ~/.bashrc to make it always available when you log-in.)
set PERL5LIB = c:\path\to\dir (For Windows)
Also see:
How do I 'use' a Perl module in a directory not in #INC?
How to change #INC to find Perl modules in non-standard locations
At the very top of your perl code right after #!/usr/bin/perl
BEGIN
{
push(#INC, '/home/penny/perlModules');
}
use my::module;
use File::Path;
...
This will allow your code to use any module you've installed in perlModules dir.
Downside is you have to modify code. Or you can use PERL5LIB env path as answered above.

rvm & duplicate environment variables (rubymotion)

I think I have a gem installed twice but I don't know how to uninstall one of them. When I try to build my rubymotion project I get these warnings:
/Users/pachun/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.2.1/lib/Bundler.rb:12: warning: already initialized constant ORIGINAL_ENV
/Users/pachun/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.2.1/lib/Bundler.rb:64: warning: already initialized constant WINDOWS
/Users/pachun/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.2.1/lib/Bundler.rb:65: warning: already initialized constant FREEBSD
/Users/pachun/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.2.1/lib/Bundler.rb:66: warning: already initialized constant NULL
And regular builds still work, but I think this is causing my test suite (frank cucumber) to fail.
How can I fix this? Thanks
The easiest way to remove all gems and reinstall using rvm is do this:
rvm gemset empty <gemset name>
bundle
Instead of doing that, I would recommend you make a .rvmrc file and put the following:
rvm use 1.9.3#projectname --create
Save the file to your project folder and then cd out and back in to the folder, answering "Y" to the question of whether to load the .rvmrc file. This will switch you to a new (empty) gemset and you can re-run bundle.

issue in cygwin error like non-cygwin compatible make program?

My question is when I am trying to compile my ocr code with the help of cygwin and android-ndk. then it show me error of non-cygwin compatible make program error.
when I am writing this command on cygwin:
/cygdrive/c/android-ndk-r6b/ndk-build
then it show me error like this:
ERROR : You are using a non-Cygwin Compatible Make program.
Currently using C:/cygwin/bin/make
To solve the issue , follow this steps :
1. Ensure that the Cygwin 'make' package is installed.
Note : You will nedd GNU Make 3.81 or later !
2. Define the GNUMAKE environment variable to point to it, as in :
export GNUMAKE=usr/bin/make
3. Call 'ndk-build' again.
I am not using any space in path mean that my android-ndk path is "C:/android-ndk-r6b" so it do not contain any spaces.
Shot in the dark here, but have you actually tried Defining the GNUMAKE variable, as suggested?
cd /cygdrive/c/android-ndk-r6b
export GNUMAKE=/usr/bin/make
./ndk-build

Resources