How to Call Custom Perl Module in a Script - linux

I am installing mireap software on my Linux VM (https://sourceforge.net/projects/mireap/). After installation, I am unable to run the software as I am always getting the error that FFW1.pm module needs to be installed; however, the module is present in lib directory. The script failed to call the module from the library. I will really appreciate if you help me in this regard. The steps which I performed are there in the image.

It's not clear what you mean by "lib directory".
If you mean the the module is in a directory named lib, and that this directory is a subdirectory of the one in which the script is located, then this should be added to the script:
use FindBin qw( $RealBin );
use lib "$RealBin/lib";

Related

I used the ddpkg-buildpackage tool to generate the deb package in linux, and the dynamic library of the dependent report could not be found

My project is based on QT5.14 and relies on the mxml library and libhv library. Now to port to Ubuntu, I choose to use ddpkg-buildpackage to generate the deb package. Run the dpkg-buildpackage -b -rfakeroot -us-uc command. The following error message is displayed:
dpkg-shlibdeps: error: cannot find library libmxml.so.1 need by debian/pip/opt/pip/bin/pip(ELF format: elf64-littleaarch64 abi:'020100b7000000000'; rpath:'usr/lib/qt5/lib')
How can I solve this problem?
I am not familiar with linux environment, please help me to look at it, thank you
This is the structure directory for my project
pip
pip/src // source code
pip/vendor // dependent library directory
pip/vendor/mxml/lib/libmxml.so.1
pip/vendor/libhv/lib/libhv.so
debian/ruler Is generated using dh_make and is not modified
I am not familiar with linux environment

gnuradio OOT module can't access shared object file while using gnuaradio companion (linux)

I've made an OOT module that uses a dynamic shared library.
The library files are located at "/home/username/intel/oneapi/ipp/2021.6.0/lib/intel64".
I've added to the module_folder/lib/CMakeFile.txt the line:
target_link_libraries(module_name -L/home/username/intel/oneapi/ipp/2021.6.0/lib/intel64 ipp_iw ippch ippcore ippcv ippdc ippi ipps ippvm)
to link all the libraries I need.
I've then used make && sudo make install to install the OOT module.
I've also added the line:
export LD_LIBRARY_PATH=~/intel/oneapi/ipp/2021.6.0/lib/intel64:$LD_LIBRARY_PATH to ~/.bashrc.
When I try to run a flow graph in gnuradio companion that uses the block from the OOT module i get the error: "ImportError: libippcore.so.10: cannot open shared object file: No such file or directory"
However if I try to run what gnuradio companion runs through the terminal:
/usr/bin/python3 -u /home/username/Documents/oot_test.py
I'm able to find the shared object file and it runs without any problems.
My question is how can i make gnuradio companion look for the shared object files in the given folder? (From my understanding the use of export LD_LIBRARY_PATH in .bashrc only executes when opening a terminal).
Classic problem of setting paths, especially LD_LIBRARY_PATH. In the shell you're manually starting python from, it's set correctly, the way you started GRC it's not.
Solution: Start GRC from the same shell, or make sure LD_LIBRARY_PATH is set for your whole session correctly, not just in a shell.

make: i686-linux-gnu-ld: Command not found

i want to install cpanm WWW::Curl::Form on my Synology NAS. But that fails. Here is the output cpanm WWW::Curl::Form WWW::Curl::Easy File::Find::Rule String::CRC32 URI::Escape
--> Working on WWW::Curl::Form
Fetching http://www.cpan.org/authors/id/S/SZ/SZBALINT/WWW-Curl-4.17.tar.gz ... OK
Configuring WWW-Curl-4.17 ... OK
Building and testing WWW-Curl-4.17 ... FAIL
! Installing WWW::Curl::Form failed. See /var/services/homes/fox/.cpanm/work/1541095458.25803/build.log
the log file gives me:
make: i686-linux-gnu-ld: Command not found
But i dont know how to fix it on my Synology NAS (DSM 6.2 and appollolake architecture DS918+)
After reviewing your additional comments, I believe I have potential solution. It looks like you are trying to install some Perl modules via the default Perl shell, cpan. As part of the installation process, the make utility is being executed. This utility is heavily used for compiling and building source from C and C++ source code, along with other languages.
The make utility is trying to call some executable i686-linux-gnu-ld which is a linker, see ld. A linker is a utility used in C programming for linking (combining) multiple compiled object files into a single executable binary. make is calling this utility as some sort of build process. Instead of calling i686-linux-gnu-ld it should probably just be calling ld. The only thing I am not sure about is why it is using the full name of the utility instead of ld.
I can think of two solutions. The first would be to update the make file to use the correct name for the linker. I'm not sure how you would do this when it is being installed via cpan since it is downloading a package and executing the make file before you have a chance to modify it. The other option is to create a symbolic link from the incorrect name and path of ld that the make file is using to the correct path /opt/bin/ld. This will result in ld being called when i686-linux-gnu-ld is called. Also, I forgot to mention it earlier but the which command will tell you where an executable / command is located on your shell's path.
The Stack Overflow post, How to symlink a file in Liunx?, gives a good explanation of how to create a symlink. You need to create a symlink to point to the correct name and path of the linker. To do so run the following command:
ln -s /opt/bin/ld /usr/bin/i686-linux-gnu-ld
Depending on the permissions of these directories you may need to run this command under a account with elevated permissions or via sudo. I apologize for this post being rather long and verbose. I just wanted to explain my solution in detail. I hope this helps. Please let me know if this doesn't resolve the problem.
edit: fixed typo in the command.

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.

julia: system image file "sys.ji" not found

I am using the IDE Netbeans to code a project c++ under Linux(red hat 7). As I need to use some math functions, I try to embed the julia language into my c++ project.
Here is what I have done:
Download the Julia from here (I choose this: Generic Linux binaries)
Set project properties: build-->C++ Complier-->Include Directories, add the include of Julia, something like this: ../myjulia/include/julia
Add the libraries: open a terminal and type the command line: sudo ln -s ../myjulia/lib/julia/libjulia.so /usr/lib/libjulia.so
Now if I run my project, I will get this error: System image file "../myproject/dist/Debug/GNU-Linux-x86/../lib/julia/sys.ji" not found
I hve checked this file: ../myjulia/lib/julia, in this file, there are all of the lib files (libjulia.so etc) and a file named "sys.ji".
I ran into this issue after installing Julia v0.3.10 on a Windows machine and thought I'd post it in case it can help someone else.
When I ran julia.exe it gave me the error message listed above.
Problem:
I had created a system environment variable called JULIA_HOME and pointed it to the directory where Julia was installed. Then, I added %JULIA_HOME%\bin to my PATH.
Solution:
I pointed JULIA_HOME to the \bin directory under the Julia install directory. Then, I added %JULIA_HOME% to my PATH
A "hello world" example from here
Now we know that we need to setup the julia context with this code:
jl_init(NULL);
In fact this code may not setup a good context because the project can't find the system image file "sys.ji". So what we need to do is using another function instead of jl_init: jl_init_with_image. This function accept two parameters: the first is the path of the image file, the second is the name of the image file. So we should use it like this: jl_init_with_image("/thePathOfSys.ji", "sys.ji"); One more thing: the path of sys.ji must be the absolute path.

Resources