I have tried to install Net::Arping package using cpan and I can't do that because of errors...
CPAN.pm: Going to build R/RI/RIIKI/Net-Arping-0.02.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for Net::Arping
cp Arping.pm blib/lib/Net/Arping.pm
/usr/bin/perl /usr/lib/perl5/5.8.8/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.8.8/ExtUtils/typemap Arping.xs > Arping.xsc && mv Arping.xsc Arping.c
Please specify prototyping behavior for Arping.xs (see perlxs manual)
gcc -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after- statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 - I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack- protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DVERSION=\"0.02\" - DXS_VERSION=\"0.02\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE" - D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H Arping.c
Arping.xs: In function ‘XS_Net__Arping_send_arp’:
Arping.xs:116: warning: implicit declaration of function ‘libnet_name_resolve’
Arping.xs:124: warning: passing argument 1 of ‘libnet_select_device’ from incompatible pointer type
Arping.xs:124: error: too many arguments to function ‘libnet_select_device’
Arping.xs:130: warning: implicit declaration of function ‘libnet_open_link_interface’
Arping.xs:130: warning: assignment makes pointer from integer without a cast
Arping.xs:135: warning: implicit declaration of function ‘libnet_get_ipaddr’
Arping.xs:140: error: ‘LIBNET_IP_H’ undeclared (first use in this function)
Arping.xs:140: error: (Each undeclared identifier is reported only once
Arping.xs:140: error: for each function it appears in.)
Arping.xs:143: warning: implicit declaration of function ‘libnet_init_packet’
Arping.xs:148: warning: passing argument 1 of ‘libnet_get_hwaddr’ from incompatible pointer type
Arping.xs:148: error: too many arguments to function ‘libnet_get_hwaddr’
Arping.xs:148: warning: assignment from incompatible pointer type
Arping.xs:156: warning: passing argument 6 of ‘libnet_build_ethernet’ from incompatible pointer type
Arping.xs:156: error: too few arguments to function ‘libnet_build_ethernet’
Arping.xs:161: warning: passing argument 12 of ‘libnet_build_arp’ from incompatible pointer type
Arping.xs:161: error: too few arguments to function ‘libnet_build_arp’
Arping.xs:166: warning: pointer targets in passing argument 1 of ‘pcap_open_live’ differ in signedness
Arping.xs:185: warning: implicit declaration of function ‘libnet_write_link_layer’
Arping.xs:196: warning: implicit declaration of function ‘libnet_close_link_interface’
Arping.xs:197: warning: implicit declaration of function ‘libnet_destroy_packet’
make: *** [Arping.o] Error 1
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
I need this perl module for check_arping script for Nagios.
Some additional informations:
[root#atlantis build]# uname -a
Linux atlantis 2.6.18-238.9.1.el5xen #1 SMP Tue Apr 12 18:53:56 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
[root#atlantis build]# rpm -qa | grep libnet
libnet-1.1.2.1-2.rf
[root#atlantis build]# rpm -qa | grep libpcap
libpcap-devel-0.9.4-15.el5
libpcap-0.9.4-15.el5
libpcap-0.9.4-15.el5
libpcap-devel-0.9.4-15.el5
[root#atlantis build]#
As You see I've installed libnet, libpcap and still there are problems ... Is anyone have an idea how to resolve this problem?
You have installed libpcap-devel, but not libnet-devel. The *-devel version of an RPM includes C header files that are often required when building XS-based modules.
Try sudo yum install libnet-devel before trying to build the module again.
Update: The advice above was correct, but insufficient. I've just tested this on an installation of Centos 5.6 and it fails with exactly the same errors.
Looking at the CPAN testers results, it's clear that version 0.02 of Net::Arping hasn't built successfully for anyone for a very long time. This distribution was uploaded to CPAN in 2002 and it appears that its XS code just isn't compatible with modern versions of libnet.
There is, however, on CPAN a version 0.03 of Net::Arping. This builds successfully on my Centos 5.6. I suggest you switch to using that instead. I haven't yet worked out why cpan doesn't recognise version 0.03. I see it's by a different author, so it might be a permissions problem. You should consider reporting this issue to modules#cpan.org.
Related
I am on a shared server of a reputed web hosting company and here are the details of the version of the Linux I am on. I am adding all the commands here so that solution providers have all the information before answering.
$ uname -a
Linux somehosting.com 2.6.32-673.8.1.lve1.4.3.el6.x86_64 #1 SMP Wed Feb 10 08:57:30 EST 2016 x86_64 x86_64 x86_64 GNU/Linux
$ cat /proc/version
Linux version 2.6.32-673.8.1.lve1.4.3.el6.x86_64 (mockbuild#build.cloudlinux.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Wed Feb 10 08:57:30 EST 2016
$ cat /etc/*release*
CloudLinux Server release 6.8 (Oleg Makarov)
CloudLinux Server release 6.8 (Oleg Makarov)
cpe:/o:redhat:enterprise_linux:6:ga:server
What I am trying to acheive?
I need to install psycopg2 on my system.
What all I have done till now?
The oauth2client requires Python 2.7 or Python 3+, but my shared hosting provided me with Python 2.6. So, until now, I have successfully installed Python 3.5.3 and Pip locally on my shared server.
What step I am on now?
Right now, I am installing psycopg2 through source on my system (details of the system are mentioned in the beginning)
What problem I am facing?
Please see the following to know the issue.
[myname psycopg2-2.6.2]$ python setup.py install
running install
running bdist_egg
running egg_info
writing psycopg2.egg-info/PKG-INFO
writing dependency_links to psycopg2.egg-info/dependency_links.txt
writing top-level names to psycopg2.egg-info/top_level.txt
reading manifest file 'psycopg2.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'psycopg2.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building 'psycopg2._psycopg' extension
gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.6.2 (dt dec pq3 ext lo64)" -DPG_VERSION_HEX=0x09030F -DHAVE_LO64=1 -I/home/amanka5/python/Python-3.5.2/Include -I/home/amanka5/python/Python-3.5.2 -I. -I/usr/pgsql-9.3/include -I/usr/pgsql-9.3/include/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.5/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from psycopg/psycopgmodule.c:27:
./psycopg/psycopg.h:31:22: error: libpq-fe.h: No such file or directory
In file included from psycopg/psycopgmodule.c:29:
./psycopg/connection.h:98: error: expected specifier-qualifier-list before ‘PGconn’
./psycopg/connection.h:135: error: expected ‘)’ before ‘*’ token
./psycopg/connection.h:137: error: expected ‘)’ before ‘*’ token
./psycopg/connection.h:138: error: expected ‘)’ before ‘*’ token
./psycopg/connection.h:142: error: expected declaration specifiers or ‘...’ before ‘PGconn’
In file included from psycopg/psycopgmodule.c:30:
./psycopg/cursor.h:63: error: expected specifier-qualifier-list before ‘PGresult’
In file included from psycopg/psycopgmodule.c:31:
./psycopg/green.h:63: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
In file included from psycopg/psycopgmodule.c:32:
./psycopg/lobject.h:29:28: error: libpq/libpq-fs.h: No such file or directory
In file included from psycopg/psycopgmodule.c:32:
./psycopg/lobject.h:49: error: expected specifier-qualifier-list before ‘Oid’
./psycopg/lobject.h:55: error: expected declaration specifiers or ‘...’ before ‘Oid’
./psycopg/lobject.h:55: error: expected declaration specifiers or ‘...’ before ‘Oid’
In file included from psycopg/psycopgmodule.c:38:
./psycopg/error.h:38: error: expected specifier-qualifier-list before ‘PGresult’
psycopg/psycopgmodule.c: In function ‘psyco_register_type’:
psycopg/psycopgmodule.c:154: error: ‘cursorObject’ has no member named ‘string_types’
psycopg/psycopgmodule.c:161: error: ‘connectionObject’ has no member named ‘string_types’
psycopg/psycopgmodule.c: In function ‘psyco_libcrypto_threads_init’:
psycopg/psycopgmodule.c:191: warning: implicit declaration of function ‘PQinitOpenSSL’
error: command 'gcc' failed with exit status 1
What answers I am looking for?
I am receiving this gcc problem, but a basic hello world program in C outputs perfect. I have read almost all the answers here on stackoverflow, but I could not find answer for my problem anywhere. I even tried to install psycopg2 using pip and it gives the same error as described above. So, what is the solution to this problem? I am unable to figure it out and need help. Without psycopg2, I won't be able to make connection to my PostgreSQL v9.3 database, which I need real bad.
Some other relevant details (My gcc version)
$ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC)
the problem here is that the compilation fails due to a missing library: libpq-dev.
You can see that in the following log-messages:
gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.6.2 (dt dec pq3 ext lo64)" -DPG_VERSION_HEX=0x09030F -DHAVE_LO64=1 -I/home/amanka5/python/Python-3.5.2/Include -I/home/amanka5/python/Python-3.5.2 -I. -I/usr/pgsql-9.3/include -I/usr/pgsql-9.3/include/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.5/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from psycopg/psycopgmodule.c:27:
./psycopg/psycopg.h:31:22: error: libpq-fe.h: No such file or directory
To fix that you need to install postgresql developer-libraries. On Redhat-like Linux the package is called postgresql-devel. The following command will install the missing libraries:
yum install postgresql-devel
I am compiling the library provided here: http://www.robots.ox.ac.uk/~vgg/software/fastann/, but
bash-3.2$ PREFIX=/usr/local/ cmake . && make
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-Wall -O2 -g3 -msse2 -march=native -fno-exceptions -fno-rtti
--- Prefix = /usr/local/
-- Configuring done
-- Generating done
-- Build files have been written to: /path/to/dir
[ 14%] Building CXX object CMakeFiles/fastann.dir/dist_l2.cpp.o
/path/to/dir/dist_l2.cpp:1: error: bad value (native) for -march= switch
/path/to/dir/dist_l2.cpp:1: error: bad value (native) for -mtune= switch
make[2]: *** [CMakeFiles/fastann.dir/dist_l2.cpp.o] Error 1
make[1]: *** [CMakeFiles/fastann.dir/all] Error 2
make: *** [all] Error 2
bash-3.2$
This is only the first step in the provided instruction, and I don't know where to look next. Can somebody tell me what exactly is this error, and how to fix it?
How to fix error: bad value (native) for -march= switch and -mtune= switch?
The problem is with -march=nartive. According to Ian Lance Taylor on GCC's mailing list (Ian is one of the GCC devs):
The problem is that the driver code is not working, and the bug is
that gcc doesn't handle that [-march=native] correctly. There is some code in gcc to
handle the driver code failing, and it works for -mtune=native, but
not for -march=native.
The driver code is supposed to change the -march=native to be
-march=XXX for your CPU. The code is in
gcc/config/i386/driver-i386.c.
So the workaround is to avoid using -march=native; and use either (1) -m32 or -m64, or (2) use -march=cpu-type, where cpu-type is one of the ones listed at 3.17.15 Intel 386 and AMD x86-64 Options of the GCC manual. The list is extensive, and it includes pentium, pentium2, pentium3 and pentium4.
Switch to using a version of gcc equal or larger then 4.2.
gcc's version 4.2 introduced the native march.
Use
gcc --version
to get gcc's version information.
When I try to run clang as my C compiler I get an error (I think a linker error)
Compilation started at Sun Nov 11 14:34:55
make -k
clang -std=c99 -ggdb -o0 -Wall -Werror helloworld.c -o helloworld
clang: warning: unknown platform, assuming -mfloat-abi=soft
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [helloworld] Error 1
Compilation exited abnormally with code 2 at Sun Nov 11 14:34:56
I actually re-installed the Raspbian image thinking that the problem would go away but it persists. Raspbian version is the latest Raspbian Wheezy hard float ABI (2012-10-28).
As you've essentially figured out, the installed clang is unusably broken. If you installed this through a package manager, complain to whoever distributes the package, because they clearly didn't bother testing it.
I am trying to compile OpenCV with icc on Linux, in order to profile the execution with intel tools.
I installed the last version of icc with default options. I tried both "user" (icc is installed in my home) and "sudo" (icc is intalled in /opt) installs. The version of icc is 11.1 20090630
I also thought to source iccvars.sh, adding needed paths to PATH and LD_LIBRARY_PATH
I also tried several versions of OpenCV:
- the main one: pre1.1. configure does not recognize icc at all
- the 'latest_tested_snapshot' and the 'trunk' versions: icc is well recognized by configure (--enable-openmp produce -openmp option, and not -fopenmp)
When I make, everything seems all right until the middle of the compilation. Then come a lot of warnings (maybe a hundred) always about 'operator'. Here an example:
../include/opencv/cxcore.hpp(335): warning #597: "cv::Size_<_Tp>::operator cv::Size_<float>() const [with
_Tp=float]" will not be called for implicit or explicit conversions
operator Size_<float>() const;
^
detected during instantiation of class "cv::Size_<_Tp> [with _Tp=float]" at line 394
And finnally the error:
/bin/bash ../../../libtool --tag=CXX --mode=compile icpc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include/opencv -I. -DCV_NO_BACKWARD_COMPATIBILITY -fPIC -I/usr/include/python2.6 -g -O2 -MT _highgui_la-pyhelpers.lo -MD -MP -MF .deps/_highgui_la-pyhelpers.Tpo -c -o _highgui_la-pyhelpers.lo `test -f 'pyhelpers.cpp' || echo './'`pyhelpers.cpp
_ml.cpp(36134): error: argument of type "uchar={unsigned char} *" is incompatible with parameter of type "int *"
result = (int)(arg1)->get_ord_var_data(arg2,arg3,arg4,arg5,(float const **)arg6,(uchar const **)arg7);
^
_ml.cpp(36134): error: argument of type "const uchar={unsigned char} **" is incompatible with parameter of type "const int **"
result = (int)(arg1)->get_ord_var_data(arg2,arg3,arg4,arg5,(float const **)arg6,(uchar const **)arg7);
^
compilation aborted for _ml.cpp (code 2)
make[4]: *** [_ml_la-_ml.lo] Erreur 1
I anyone succeded to compile OpenCV with icc, let me know!
Ok, I finally compiled OpenCV with ICC. OpenCV is close to Intel, as Intel is highly involved in this project. Since version 1.1, OpenCV is supposed to natively support icc compiler. When you specify CC=icc in configure, there are some subtle changes as the -fopenmp (gcc style) in transformed into -openmp (icc style). However, between the release of OpenCV 1.1 (which is the latest stable) and now, icc has evolved. I think it used to compile with previous version of icc.
It comile with the latest tested version on svn:
https://opencvlibrary.svn.sourceforge.net/svnroot/opencvlibrary/tags/latest_tested_snapshot/opencv/
As the svn evolve, it could change, but at this time (27 august) it works. The warnings are still here (don't be affraid, there are a lot). Here my configure bash line:
./configure --prefix=/home/user/opencv/icc CC=icc CXX=icpc --enable-openmp --disable-apps --disable-optimization --disable-sse
I disabled optimizations and sse instructions, as it generates some conflicts with icc.
Your issue may result from using a different version from ICC used to create that library. You must ask the library provider which version to use.
I am interested in compiling windows for Python25 support but when I
make -f Make_ming.mak gvim.exe
I get the following (_MAX_PATH undeclared):
gcc -c -Iproto -DWIN32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 -DHAVE_PATHDEF -DFEAT_BIG -DHAVE_GETTEXT -DHAVE_LOCALE_H -DDYNAMIC_GETTEXT -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DDYNAMIC_ICONV -pipe -w -march=i386 -Wall -DFEAT_PYTHON -I c:/Python25/include -DDYNAMIC_PYTHON -DYNAMIC_PYTHON_DLL=\"python25.dll\" -O3 -fomit-frame-pointer -freg-struct-return -s fileio.c -o gobj/fileio.o
fileio.c: In function `buf_modname':
fileio.c:5877: error:_MAX_PATH' undeclared (first use in this function)
fileio.c:5877: error: (Each undeclared identifier is reported only once
fileio.c:5877: error: for each function it appears in.)
fileio.c: In function `vim_tempname':
fileio.c:6832: error: `_MAX_PATH' undeclared (first use in this function)
make: *** [gobj/fileio.o] Error 1
Any ideas? What am I missing?
Thanks.
I don't how to fix your problem myself, but I followed this video tutorial to do exactly what you are trying and it worked like a charm:
http://showmedo.com/videotutorials/video?name=1850010&fromSeriesID=185.
If you want the Vim text editor, why are you not using the download version(s) from vim.org, etc. (gvim, Cream, Portable Gvim)
If you are trying to build Python for windows, why are you not using the current 2.6.1 or 3.0.1 from python.org?
_MAX_PATH should maybe be PATH_MAX or _PATH_MAX which is defined via stdlib.h / limits.h or sys/param.h under Linux.
Have you checked any configuration logs? Any previous compiler warnings about missing includes or undefined values? Search for PATH_MAX and PATH_MAX.
Is it just for the support of Python 2.5?
Not the answer to your question, but the easy way:
downloaded the precompiled vim.exe and gvim.exe from gooli.org (for Python 2.5 and/or 2.6)