Perl Module Installation From CPAN Failure - perl

I am trying to install module Algorithm::SVM from CPAN but I get the error listed below. At the message it says "failed". What may be the error?
*kadir#kadir-Inspiron-N5010:cpan install Algorithm::SVM
Reading '/home/kadir/.cpan/Metadata'
Database was generated on Thu, 07 Jan 2016 07:54:01 GMT
Running install for module 'Algorithm::SVM'
......
Makefile:350: recipe for target 'bindings.o' failed
make: *** [bindings.o] Error 1
LAIRDM/Algorithm-SVM-0.13.tar.gz
/usr/bin/make -- NOT OK*

If you are using Debian go to the build location of the module(after you ran cpan Algorithm::SVM ):
sudo vim /home/youruser/.cpan/build/Algorithm-SVM-0.13-biHfmx/bindings.h
Add these two lines in this area:
using namespace std;
#include <vector>
#include <map>
#include <assert.h>
#include <cstdlib> <===== Add these
#include <string.h> <===== two lines
Save and exit and the rebuild the module from here:
sudo make
sudo make install
Test if the installation is successful:
sudo cpan Algorithm::SVM
Here is a more detailed explanation concerning this issue: https://rt.cpan.org/Public/Bug/Display.html?id=43669

Related

Raspberry pi kernel module disagrees about version of symbol layout, although complied against running kernel

I created the simplest external kernel module for my Raspberry PI as a test:
#include <linux/module.h>
#include <linux/kernel.h>
int hello_init(void) {
printk("Hello World");
return 0;
}
void hello_exit(void) {
printk("Goodbye World!");
}
module_init(hello_init);
module_exit(hello_exit);
MODULE_LICENSE("GPL");
I complied it successfully with the following line:
sudo make -C /lib/modules/$(uname -r)/build M=$PWD modules
I tried to use sudo insmod hello.ko, and got the following error:
insmod: ERROR: could not insert module hello.ko: Invalid module format
And following this error in dmesg:
hello: disagrees about version of symbol module_layout
I've read everything there is to read about this error online. All the research has yielded the assumption that this is caused by compiling the module against a kernel which differs from the running kernel in either version or configuration.
However, this is absolutely not my case. The running kernel was loaded by the distribution and was not changed by me (Raspberry PI 3). Moreover, inspection of the kernel's other modules and hello.ko (using modinfo) is yielding the exact same vermagic and flags, which are:
vermagic: 5.15.33-v8+ SMP preempt mod_unload modversions aarch64
Since all online material originates this fault in version difference, I'm at a lost.

libopencv_highgui.so.3.4: cannot open shared object file: No such file or directory in the eclipse ide for cross compiler

I have stucked a problem. I develop cross-compile for the embedded system. I built the opencv for arm_linux-gnueabihf.
My ubuntu version is 18.04.2 x86_64 5.3.0.51-generic.
The problem that
libopencv_highgui.so.3.4: cannot open shared object file: No such file or directory
I build the project success but when I run the project, I get the problem
this my code
#include <iostream>
#include <stdio.h>
#include <cv.h>
#include <opencv2/videoio.hpp>
#include <opencv2/core.hpp>
#include <opencv2/core/mat.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
using namespace std;
int main(int, char**){
Mat frame;
VideoCapture cap;
int deviceId = 0;
int apiId = cv::CAP_ANY;
cap.open(deviceId,apiId);
if (!cap.isOpened()){
cerr<<"Error! Unable to camera\n";
return -1;
}
for(;;){
// read frame
cap.read(frame);
if (frame.empty()){
cerr <<" ERROR ! black frame grabbed ! \n";
break;
}
imshow("Live",frame);
if (waitKey(5) >= 0){
break;
}
}
return 0;
}
I checked the library as follows:
sudo find / -name "libopencv_highgui.so.3.4"
the command returned as follows
/usr/local/lib/libopencv_highgui.so.3.4
/usr/local/lib/libopencv_highgui.so.3.4.4
/usr/local/include/lib/libopencv_highgui.so.3.4
/usr/local/include/lib/libopencv_highgui.so.3.4.4
I created a file in /etc/ld.so.conf.d/opencv.conf that contain
/usr/local/lib
/usr/local/include
then I run the command that sudo ldconfig -v, and it returned as follow
/sbin/ldconfig.real: /usr/local/lib/libopencv_highgui.so.3.4.4 is for unknown machine 40.
/sbin/ldconfig.real: /usr/local/lib/libopencv_imgproc.so is for unknown machine 40.
/sbin/ldconfig.real: /usr/local/lib/libopencv_xfeatures2d.so is for unknown machine 40.
/sbin/ldconfig.real: /usr/local/lib/libopencv_bgsegm.so.3.4.4 is for unknown machine 40.
/sbin/ldconfig.real: /usr/local/lib/libopencv_objdetect.so.3.4 is for unknown machine 40.
and also other opencv's libraries.
I configured setting of the eclipse for the libraries as follows:
the "Includes" folder that in cross G++ Compiler
"Libraries" folder that in cross G++ Linker
Finally, I added the LD_LIBRARY_PATH in debug of the eclipse setting
I tried sudo apt update and sudo apt upgrade commands,but I still getting the error.
Does any one have any advice ?
the solution is add the "/usr/local/lib" to LD_LIBRARY_PATH in environment.
mine is
LD_LIBRARY_PATH /usr/arm-linux-gnueabihf/lib/:usr/local/lib/

Trying to build nominatim 3.4.1 I get "fatal error: postgres.h: No such file or directory"

I'm trying to install Nominatim 3.4.1 on Ubuntu 20.04 and PostgreSQL 12, so I'm following the official instructions from here, the issue is when I execute make, I have this error:
[ 79%] Built target osm2pgsql_lib
[ 79%] Built target osm2pgsql
[ 79%] Running external makefile /usr/lib/postgresql/12/lib/pgxs/src/makefiles/pgxs.mk
/srv/nominatim/Nominatim-3.4.0/module/Makefile:11: warning: overriding recipe for target &apos;install&apos;
/usr/lib/postgresql/12/lib/pgxs/src/makefiles/pgxs.mk:241: warning: ignoring old recipe for target &apos;install&apos;
/srv/nominatim/Nominatim-3.4.0/module/nominatim.c:1:10: fatal error: postgres.h: No such file or directory
1 | #include "postgres.h"
| ^~~~~~~~~~~~
compilation terminated.
make[3]: *** [<builtin>: nominatim.o] Error 1
make[2]: *** [module/CMakeFiles/nominatim_lib.dir/build.make:61: /srv/nominatim/Nominatim-3.4.0/module/dummy] Error 2
make[1]: *** [CMakeFiles/Makefile2:1908: module/CMakeFiles/nominatim_lib.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
first lines of nominatim.c file:
#include "postgres.h"
#include "fmgr.h"
I've tried find / -name "postgres.h" and find / -name "fmgr.h" and there is no such files.
I'm almost sure that the problem is that PostgreSQL 12 removed this files, changed the names or something similar, and Nominatim 3.1.4 are not aware of that change. I'd like not to downgrade PostgreSQL to solve this unless that is the only possible solution, also I don't know if a downgrade solve the issue.
on my case this got solved by reinstalling postgres sudo apt install postgresql-server-dev-12 postgresql-12-postgis-3 \ postgresql-contrib-12 postgresql-12-postgis-3-scripts

Need some help in Fuzzing Mosquitto lib

Here comes a bug while fuzzing Mosquitto lib, I would like to know the solution.
Step1. compile the lib
#:~/fuzz/fuzzmqtt/mosquitto$ ls
about.html doc Makefile security
aclfile.example docker man SECURITY.md
appveyor.yml edl-v10 misc service
buildtest.py epl-v10 mosquitto.conf set-version.sh
ChangeLog.txt examples Mosquitto.podspec snap
client installer notice.html src
CMakeLists.txt lib pskfile.example test
compiling.txt libmosquitto.pc.in pwfile.example THANKS.txt
config.h libmosquittopp.pc.in readme.md travis-configure.sh
config.mk LICENSE.txt readme-tests.md travis-install.sh
CONTRIBUTING.md logo readme-windows.txt www
#:~/fuzz/fuzzmqtt/mosquitto$ sudo make install CC="clang -O2 -fno-omit-frame-pointer -g -fsanitize=address -fsanitize-coverage=trace-pc-guard,trace-cmp,trace-gep,trace-div" -j2
Step2. compile the fuzzer
#:~/fuzz/fuzzmqtt/mosquitto/lib$ clang -g -O1 -fsanitize=fuzzer,address mos_fuzzer.cc -o mos_fuzzer -lmosquitto
Step3. Run the fuzzer and got the bug
#~/fuzz/fuzzmqtt/mosquitto/lib$ ./mos_fuzzer
INFO: Seed: 106983829
INFO: Loaded 1 modules (2337 guards): 2337 [0x7f157cd816b0, 0x7f157cd83b34),
INFO: Loaded 1 modules (1 inline 8-bit counters): 1 [0x787f80, 0x787f81),
INFO: Loaded 1 PC tables (1 PCs): 1 [0x565af8,0x565b08),
ERROR: The size of coverage PC tables does not match the
number of instrumented PCs. This might be a compiler bug,
please contact the libFuzzer developers.
Also check https://bugs.llvm.org/show_bug.cgi?id=34636
for possible workarounds (tl;dr: don't use the old GNU ld)
The code is as follow
#include "stdio.h"
#include "mosquitto.h"
#include "assert.h"
#include "stdint.h"
#include "stddef.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
bool clean_session = true;
struct mosquitto *mosq = NULL;
mosquitto_lib_init();
void *data_1=(void *)data;
mosq = mosquitto_new(NULL, clean_session, data_1);
mosquitto_destroy(mosq);
mosquitto_lib_cleanup();
return 0;
}
Thank you

Error installing MEAD, no such file or directory: 'prank.o'

I am not quite sure why I am getting this error when installing MEAD. Does anyone have a idea how I can fix this? I need to install MEAD for a school homework and I don't have much experience with Perl.
Fixing perl directives:
bin/default-classifier.pl
bin/default-reranker.pl
bin/driver.pl
bin/extract-to-summary.pl
bin/feature-scripts/Centroid.pl
bin/feature-scripts/IsLongestSentence.pl
bin/feature-scripts/Length.pl
bin/feature-scripts/Position.pl
bin/feature-scripts/QueryCosine.pl
bin/feature-scripts/QueryCosineNoIDF.pl
bin/feature-scripts/QueryWordOverlap.pl
bin/feature-scripts/SimWithFirst.pl
bin/feature-scripts/Skeleton.pl
bin/identity-reranker.pl
bin/leadbased-classifier.pl
bin/make-CHIN-docsent.pl
bin/mead.pl
bin/meadeval.pl
bin/novelty-reranker.pl
bin/random-classifier.pl
bin/read-idf.pl
bin/relative-utility.pl
bin/sentjudge-to-extract.pl
bin/write-idf.pl
Fixing $MEADDIR in MEAD::MEAD
Building English IDF DBM:
Wd: 65300
Building Chinese IDF DBM:
Wd: 54700
******** Compiling LexRank ********
In file included from prank.cpp:10:
./prmain.h:80:8: error: unknown type name 'pthread_mutex_t'; did you mean
'pthread_attr_t'?
extern pthread_mutex_t *mu; /* For general use */
^~~~~~~~~~~~~~~
pthread_attr_t
/usr/include/sys/_types/_pthread_attr_t.h:30:34: note: 'pthread_attr_t' declared
here
typedef __darwin_pthread_attr_t pthread_attr_t;
^
1 error generated.
clang: error: no such file or directory: 'prank.o'
******** Compiling tf2gen ********
MEAD Installation successful.
Add #include <pthread.h> to prmain.h on a line by itself just before the extern pthread_mutex_t *mu; line