How to read errors when compiling from source code - linux

Goal:
Compile multiple libraries from source code to ultimately install a fully compiled version of FFmpeg with desirable libraries attached.
Problem:
During the compilation, all libraries (seemingly) are successful until liblv2 is reached.
Error output via terminal:
building lv2 - version 1.18.10
=======================
Downloading https://lv2plug.in/spec/lv2-1.18.10.tar.xz as lv2-1.18.10.tar.bz2
... Done
Extracted lv2-1.18.10.tar.bz2
$ python3 ./waf configure --prefix=/home/jman/tmp/ffmpeg/ffmpeg-build/workspace --lv2-user
python3: can't open file '/home/jman/tmp/ffmpeg/ffmpeg-build/packages/lv2-1.18.10/./waf': [Errno 2] No such file or directory
Failed to Execute python3 ./waf configure --prefix=/home/jman/tmp/ffmpeg/ffmpeg-build/workspace --lv2-user
Where I need guidance:
python3: can't open file '/home/jman/tmp/ffmpeg/ffmpeg-build/packages/lv2-1.18.10/./waf': [Errno 2] No such file or directory
My question:
What does this part mean?
lv2-1.18.10/./waf'
specifically the part /./
My best guess so far is it:
obviously is looking for a directory it can't find (perhaps because it truly doesn't exist)
The missing 'waf' directory should be located inside either the "${PACKAGES}" or "${WORKSPACE}" directory.
The ${PACKAGES}" path in this script should = /home/jman/tmp/ffmpeg/ffmpeg-build/packages
The ${WORKSPACE}" path in this script should = /home/jman/tmp/ffmpeg/ffmpeg-build/workspace
The full build script:
https://github.com/slyfox1186/ffmpeg-build-script/blob/master/scripts/build-ffmpeg
I tried my best to make this worth sometimes time without giving too much info... sorry if I don't meet the expectations of this forum.
Am I even close?

Related

Can Execute Commands in Terminal But Not from Text File

I'm running code using Ubuntu on a WSL. Every time I edit some C files I need to execute a makefile and run an installer to ensure that the changes are reflected in the python package that I am using. The set of commands I need to execute is
make clean
make
cd python
python setup.py install --user
This works perfectly when I execute them in the terminal. In order to make my life easier, I decided to put these commands in a text file Compile.txt to be executed whenever I need to compile the relevant files. I found this question and tried to replicate its solution. However, whenever I type ./Compile.txt into the terminal I get the error
'. Stop. No rule to make target 'clean
gcc -o .o
gcc: fatal error: no input files
compilation terminated.
make: *** [<builtin>: .o] Error 1
./Compile.txt: line 7: cd: $'python\r': No such file or directory
python: can't open file 'setup.py': [Errno 2] No such file or directory
Can anyone explain what I've done wrong? I apologise for any misuse of terminology as I'm still quite new to Linux.
Thanks in advance.

error opening executable file on ssh - error while loading shared libraries

I am trying to run tor on Ubuntu with terminal (using SSH). Whenever I am trying to open the executable file I am getting this error:
./tor: error while loading shared libraries: libevent-2.1.so.7:
cannot open shared object file: No such file or directory
I have tried to re-install the packages and nothing going well, also tried to link the library and that also did nothing. Whenever I am trying to create another executable file it runs okay, the problem is only with this tor file.
Further details:
$ ldd ./tor | grep libevent
libevent-2.1.so.7 => not found
$ ls -l /usr/lib/libevent*
No such file or directory
Can anyone guide me on how to solve it? Any help would be really appreciated.

f2py does not properly import, despite successfully compiling

I am successfully compiling my Fortran subroutine with f2py. However, a folder is created as well as a pyd file.
If I do not put the created pyd file in the generated folder I get this error
ImportError: DLL load failed: The specified module could not be found.
If I put the generated .pyd file in the generated folder, my python script will run, and the import seems to work. However, if I run print(energy_f2py.__doc__) None is the output, and when I try to use the subroutine I get an error AttributeError: module 'energy_f2py' has no attribute 'potential_3'
potential_3 is the name of the subroutine inside energy_f2py.f90
I have also tried making energy_f2py.f90 a module containing the subroutine, with no difference in results.
This is the pyd file that is generated energy_f2py.cp36-win_amd64.pyd. I am using the commandline in Pycharm (windows 10 64 bit) to compile the Fortran file using
f2py -c -m energy_f2py energy_f2py.f90
python -m numpy.f2py -c -m energy_f2py energy_f2py.f90
The same thing happens.
It seems weird to me that both the pyd file is created as well as a folder, see the below image
I am stuck at this point... it seems like it is 95% of the way to working...
Lastly, this other post had a solution saying to name the Python and Fortran modules different names. I have tried this, and it did not make a difference either.
The best solution I found which worked was to partition my hardrive and install Linux. I chose to use Lubuntu, but you could use anything.
Everything works as it should on Linux.
Anther option to is to make it a static build, with the -static flag. This builds everything needed into a single file:
python -m numpy.f2py -c -m energy_f2py energy_f2py.f90 -static
You should then be able to use that .pyd file no matter what folder you've placed it in.
If you are using windows, I think adding --compiler=mingw32 may help. The defualt compiler is msvc on windows.
It occurs to me that the resulting .pyd module is looking for the DLL library in the same directory it itself resides in. Therefore, try moving the DLL from .libs directory to energy_f2py - it worked for me on Windows 10.

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.

Matlab Libopencv error using Linux

I am running into errors with opencv. I downloaded a package online and compiled each of the folders by cd into them and running make through the command line. But when I try using one of the functions, I run into this error: libopencv_core.so.2.3: cannot open shared object file: No such file or directory
The file its trying to reach is indeed there, since I checked this, but for some reason its saying its not. I am pretty bad at figuring out path problems but I think this is one of them. Can anyone tell me how to fix this? Thanks

Resources