How to fix the ShiningPanda virtualenv error with gnureadline on Jenkins? - jenkins

Running setup.py bdist_wheel for gnureadline
Error:
DHAVE_RL_CALLBACK -DHAVE_RL_CATCH_SIGNAL -DHAVE_RL_COMPLETION_APPEND_CHARACTER -DHAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK -DHAVE_RL_COMPLETION_MATCHES -DHAVE_RL_COMPLETION_SUPPRESS_APPEND -DHAVE_RL_PRE_INPUT_HOOK -I. -I/usr/include/python2.7 -c Modules/2.x/readline.c -o build/temp.linux-x86_64-2.7/Modules/2.x/readline.o
In file included from Modules/2.x/readline.c:31:0:
./readline/readline.h:385:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/Modules/2.x/readline.o readline/libreadline.a readline/libhistory.a -lncurses -o build/lib.linux-x86_64-2.7/gnureadline.so
/usr/bin/ld: cannot find -lncurses
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
Mange Jenkins settings:
Python : CPython-2.7
Path: /usr/bin/python

The problem was gnureadline was in my requirements.txt and when building the virtual environments and installing requirements it could not install the package.
gnureadline isn't required on most OSes. As Ludwig points out in this post:
gnureadline [is only needed] on platforms that don't provide readline
at all, or that substitute readline for an incompatible product like
libedit (i.e. Mac OS X)
So the solution was simply to remove gnureadline from requirements.txt

Related

Trouble in installing zipline

I faced this error in installing zipline using pip command - note that I upgraded numpy as well but the problem remains:
1 error generated.
error: Command "clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -Ibuild/src.macosx-10.9-universal2-3.1/numpy/core/src/npymath -Inumpy/core/include -Ibuild/src.macosx-10.9-universal2-3.1/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -Ibuild/src.macosx-10.9-universal2-3.1/numpy/core/src/private -Ibuild/src.macosx-10.9-universal2-3.1/numpy/core/src/npymath -Ibuild/src.macosx-10.9-universal2-3.1/numpy/core/src/private -Ibuild/src.macosx-10.9-universal2-3.1/numpy/core/src/npymath -Ibuild/src.macosx-10.9-universal2-3.1/numpy/core/src/private -Ibuild/src.macosx-10.9-universal2-3.1/numpy/core/src/npymath -c numpy/core/src/npymath/npy_math.c -o build/temp.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math.o -MMD -MF build/temp.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math.o.d" failed with exit status 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> numpy
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Will be thankful if anyone can help.

linker can't find lua library

I ran g++ -g ./src/*.cpp -L/usr/lib/ -llua5.3
and got an error.
/usr/bin/ld: cannot find -llua5.3
collect2: error: ld returned 1 exit status
How can I make linker find lua library?
I've installed lua with this commands
wget -R -O http://www.lua.org/ftp/lua-5.3.0.tar.gz
tar zxf lua-5.3.0.tar.gz
cd lua-5.4.2
make linux
make install
I've installed apt install liblua5.3-dev instead of wget -R -O http://www.lua.org/ftp/lua-5.3.0.tar.gz to make it work

How to set the include path, #include "opencv2/opencv.hpp"

I am trying to do Compiling With OpenCV section in this page: Installing Darknet
After I did OPENCV = 1, I tried to do re-make, so I did make in the darknet directory.
The directory is below.
(yolo) bash-3.2$ pwd
/Users/moray/darknet
(yolo) bash-3.2$ ls
LICENSE LICENSE.gpl LICENSE.v1 backup data libdarknet.a python src
LICENSE.fuck LICENSE.meta Makefile cfg examples libdarknet.so results
LICENSE.gen LICENSE.mit README.md darknet include obj scripts
and the result of the re-makaing is here.
(yolo) bash-3.2$ make
g++ -Iinclude/ -Isrc/ -DOPENCV `pkg-config --cflags opencv` -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -c ./src/image_opencv.cpp -o obj/image_opencv.o
/bin/sh: pkg-config: command not found
./src/image_opencv.cpp:6:10: fatal error: 'opencv2/opencv.hpp' file not found
#include "opencv2/opencv.hpp"
^~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [obj/image_opencv.o] Error 1
So I thought include path could not reference opencv.hpp, I looked for the file and found it.
(yolo) bash-3.2$ ls ~/opt/anaconda3/pkgs/libopencv-3.4.2-h7c891bd_1/include/opencv2/opencv.hpp
/Users/moray/opt/anaconda3/pkgs/libopencv-3.4.2-h7c891bd_1/include/opencv2/opencv.hpp
Therefore I tried to change #include "opencv2/opencv.hpp" to "include "~/opt/anaconda3/pkgs/libopencv-3.4.2-h7c891bd_1/include/opencv2/opencv.hpp" in ./src/image_opencv.cpp
And the result is here.
(yolo) bash-3.2$ make
g++ -Iinclude/ -Isrc/ -DOPENCV `pkg-config --cflags opencv` -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -c ./src/image_opencv.cpp -o obj/image_opencv.o
/bin/sh: pkg-config: command not found
./src/image_opencv.cpp:7:10: fatal error:
'~/opt/anaconda3/pkgs/libopencv-3.4.2-h7c891bd_1/include/opencv2/opencv.hpp' file not found
#include "~/opt/anaconda3/pkgs/libopencv-3.4.2-h7c891bd_1/include/opencv2/opencv.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [obj/image_opencv.o] Error 1
I cannot understand why the error happens.
Please tell me your think.
============================================
os: macOS Catalina 10.15.1
(yolo) is a virtual environment in anaconda(3)
opencv was installed by pip command in (yolo)
all the packages by pip command in (yolo):
(yolo) bash-3.2$ pip list
Package Version
--------------------- -------------------
certifi 2019.11.28
numpy 1.17.4
opencv-contrib-python 4.1.2.30
opencv-python 4.1.1.26
pip 19.3.1
setuptools 42.0.2.post20191203
wheel 0.33.6
gcc:
(yolo) bash-3.2$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.12)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
This error explains it pkg-config: command not found. In order to use OpenCV in YOLO, you have to install OpenCV that works for C or C++ program, not Python. You probably installed opencv using pip for Python. Follow these steps in one of these links to install opencv : this or this or other tutorial.
After that, to check whether you have installed OpenCV correctly and can be used in C program, run this command :
pkg-config --modversion opencv
If it doesn't show anything or shows wrong version, try to reinstall OpenCV OR it is possible that your machine doesn't locate opencv version correctly.
So add command to your ~/.bashrc for example :
vim ~/.bashrc
export PKG_CONFIG_PATH=/home/user/installation/OpenCV-3.4.0/lib/pkgconfig
source ~/.bashrc
Notes : Change the path according to your opencv installation directory that contains opencv.pc

xmake always reports: error: cannot get program for cxx, why?

I've "brew install xmake" on my mac, and having a .cpp file, I run xmake and it generates a xmake.lua in the directory. Then it reports:
error: cannot get program for cxx
I've installed clang (alias as g++). It works fine. I then:
$sudo ln -s /usr/bin/g++ /usr/local/bin/cxx
Well, running xmake again, but it still reports same error:
error: cannot get program for cxx
How to handle this? Thanks
----------------------I tried these, don't work:
$xmake f -p cross
$xmake
error: cannot get program for cxx
$export CC=clang LD=clang++ xmake
$xmake
error: cannot get program for cxx
----------------------See my diagnotics:
$xmake f -p cross -c
(In fact no output)
$xmake -r -v
configure
{
plat = cross
, arch = none
, ccache = true
, kind = static
, buildir = build
, host = macosx
, mode = release
, clean = true
}
checking for the g++ ... no
checking for the linker (ld: g++) ... no
checking for the gcc ... no
checking for the linker (ld: gcc) ... no
checking for the clang++ ... no
checking for the linker (ld: clang++) ... no
checking for the clang ... no
checking for the linker (ld: clang) ... no
error: cannot get program for ld
$which g++
/usr/bin/g++
$which clang
/usr/bin/clang
xmake will detect and use xcrun -sdk macosx clang on macOS. Do you have Xcode command line tools installed?
If not, you can switch to cross platform to compile it. for example
xmake f -p cross
xmake
It will use gcc/clang directly.
Or set --cc=clang or CC, LD envirnoment vars to modify compiler and linker.
xmake f -c --cc=clang --ld=clang++
xmake
Or
export CC=clang LD=clang++
xmake
It works now, please update to latest version.

Error to build opencv on Ubuntu 14.04 [cannot find -lstdc++]

I'm new to build and install opencv on my Ubuntu 14.04.
I follow pyimagesearch to do it.
After typing cmake command, I encounter some errors as follows.
I google some solutions and try to reinstall some packages, ex:gcc.
Still can not work... :(
for /usr/bin/ld: cannot find -lstdc++ problem, anyone has ideas?
thank you :)
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=/home/eric/program_files/OpenCV/opencv_contrib/modules \
-D BUILD_EXAMPLES=ON ..
-- The CXX compiler identification is Clang 3.4.0
-- The C compiler identification is GNU 4.8.5
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:54 (message):
The C++ compiler "/usr/bin/clang++" is not able to compile a simple test
program.
It fails with the following output:
Change Dir:
/home/eric/program_files/OpenCV/opencv/build/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make "cmTryCompileExec3807027872/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec3807027872.dir/build.make
CMakeFiles/cmTryCompileExec3807027872.dir/build
make[1]: Entering directory
`/home/eric/program_files/OpenCV/opencv/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report
/home/eric/program_files/OpenCV/opencv/build/CMakeFiles/CMakeTmp/CMakeFiles
1
Building CXX object
CMakeFiles/cmTryCompileExec3807027872.dir/testCXXCompiler.cxx.o
/usr/bin/clang++ -o
CMakeFiles/cmTryCompileExec3807027872.dir/testCXXCompiler.cxx.o -c
/home/eric/program_files/OpenCV/opencv/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTryCompileExec3807027872
/usr/bin/cmake -E cmake_link_script
CMakeFiles/cmTryCompileExec3807027872.dir/link.txt --verbose=1
/usr/bin/clang++
CMakeFiles/cmTryCompileExec3807027872.dir/testCXXCompiler.cxx.o -o
cmTryCompileExec3807027872 -rdynamic
/usr/bin/ld: cannot find -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
make[1]: *** [cmTryCompileExec3807027872] Error 1
make[1]: Leaving directory
`/home/eric/program_files/OpenCV/opencv/build/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec3807027872/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:88 (project)
-- Configuring incomplete, errors occurred!
try:
sudo apt-get install g++
or
ln -s /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so

Resources