I can not get Perl/Tk to install via CPAN on OS X Mountain Lion. It errors with an error in a file with which google does not help:
/Users/villadelfia/perl5/perlbrew/perls/perl-5.17.8/bin/perl5.17.8 /Users/villadelfia/perl5/perlbrew/perls/perl-5.17.8/lib/5.17.8/ExtUtils/xsubpp -typemap /Users/villadelfia/perl5/perlbrew/perls/perl-5.17.8/lib/5.17.8/ExtUtils/typemap -typemap /Users/villadelfia/Downloads/Tk-804.030/Tk/typemap IO.xs > IO.xsc && mv IO.xsc IO.c
Warning: Found a 'CODE' section which seems to be using 'RETVAL' but no 'OUTPUT' section. in IO.xs, line 235
cc -c -I.. -I/usr/X11R6/include -I/usr/local/include/freetype2 -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O3 -DVERSION=\"804.03\" -DXS_VERSION=\"804.03\" "-I/Users/villadelfia/perl5/perlbrew/perls/perl-5.17.8/lib/5.17.8/darwin-2level/CORE" -Wall -Wno-implicit-int -Wno-comment -Wno-unused -D__USE_FIXED_PROTOTYPES__ IO.c
IO.xs:210:10: error: invalid argument type 'void' to unary expression
if (!SvUPGRADE(buf, SVt_PV))
^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[1]: *** [IO.o] Error 1
make: *** [subdirs] Error 2
As you can see, I run perlbrew as well.
Any ideas what could cause this?
From the 5.17.7 release notes:
SvUPGRADE() is no longer an expression. Originally this macro (and its
underlying function, sv_upgrade()) were documented as boolean, although
in reality they always croaked on error and never returned false. In 2005
the documentation was updated to specify a void return value, but
SvUPGRADE() was left always returning 1 for backwards compatibility. This
has now been removed, and SvUPGRADE() is now a statement with no return
value.
So this is now a syntax error:
if (!SvUPGRADE(sv)) { croak(...); }
If you have code like that, simply replace it with
SvUPGRADE(sv);
or to to avoid compiler warnings with older perls, possibly
(void)SvUPGRADE(sv);
It has already been reported.
Related
this is a bit of a long shot but:
I'm following this guide: https://www.tutorialspoint.com/postgresql/postgresql_c_cpp.htm
But when running ./configure I get the following error:
(previous checking lines omitted for brevity)
checking for main in -lpq... yes
checking for PQexec in -lpq... yes
checking for correct C++ linkage of basic libpq functions...
sed: character class syntax is [[:space:]], not [:space:]
configure: error:
Linking a call to libpq failed in C++, even though it succeeded in C. If your
C and C++ compilers are very different beasts, this may mean that we do not have
the right options for linking with it after all.
Read the config.log file for more detailed information. Look for the last error
message, which may be several pages up from the end of the file.
And the configure.log file looks like this:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libpqxx configure 4.0, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
(some lines omitted)
configure:3039: g++ -V >&5
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:3050: $? = 1
configure:3039: g++ -qversion >&5
g++: error: unrecognized command line option '-qversion'; did you mean '--version'?
g++: fatal error: no input files
compilation terminated.
(some lines omitted)
configure:7629: gcc -E conftest.c
conftest.c:11:10: fatal error: ac_nonexistent.h: No such file or directory
#include <ac_nonexistent.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
(some lines omitted)
configure:8319: gcc -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5
cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C
(some lines omitted)
configure:16424: g++ -o conftest -g -O2 -L/usr/lib/x86_64-linux-gnu conftest.cpp >&5
/tmp/ccfFBf4K.o: In function `main':
/home/peter/libpqxx-4.0/conftest.cpp:44: undefined reference to `PQexec'
collect2: error: ld returned 1 exit status
(some liens omitted)
I don't believe I have any packages missing. I have the newest version of g++, psql and libpqxx installed.
I have updated and upgraded all packages on my system.
I have crawled the web for solutions to this error, but I have no clue what is wrong.
Do you have an idea where I can go from here?
There hasn't been a tarball release of libpqxx at the old spot in a long time, so the tutorial you used with its wget command to download the tarball is very outdated.
The issue you encountered looks related to this issue and appears to have been fixed in this commit:
commit 85e9336740475be25ed19924cca0961f7d844c4b
Author: Jeroen Vermeulen <jtvjtv#gmail.com>
Date: Thu Jun 1 11:39:08 2017 +0700
Fix #13: not linking to libpq.
This was that annoying interaction between autoconf, m4, GNU sed syntax,
and the shell which broke the "remove redundant -lpq options" code in
the configure script.
Solution: forget about GNU sed's "[[:space:]]" syntax, and just look for
a literal space. There aren't going to be any tabs, newlines,
non-breaking spaces, etc. there in even a moderately sane world.
I'm trying to install mutt on CentOS 6.7 and ./configure --prefix=$HOME/local runs fine but at make install step, I run into this error below that I don't know how to solve. I tried with mutt 1.6.1 and 1.6.0 and this same error came up so it's probably some system setting that wasn't correct. How could I fix it?
gcc -std=gnu99 -Wall -pedantic -Wno-long-long -g -O2 -o mutt addrbook.o alias.o attach.o base64.o browser.o buffy.o color.o crypt.o cryptglue.o commands.o complete.o compose.o copy.o curs_lib.o curs_main.o date.o edit.o enter.o flags.o init.o filter.o from.o getdomain.o group.o handler.o hash.o hdrline.o headers.o help.o hook.o keymap.o main.o mbox.o menu.o mh.o mx.o pager.o parse.o pattern.o postpone.o query.o recvattach.o recvcmd.o rfc822.o rfc1524.o rfc2047.o rfc2231.o rfc3676.o score.o send.o sendlib.o signal.o sort.o status.o system.o thread.o charset.o history.o lib.o muttlib.o editmsg.o mbyte.o mutt_idna.o url.o ascii.o crypt-mod.o safe_asprintf.o patchlist.o conststrings.o pgp.o pgpinvoke.o pgpkey.o pgplib.o gnupgparse.o pgpmicalg.o pgppacket.o crypt-mod-pgp-classic.o smime.o crypt-mod-smime-classic.o resize.o -lncursesw -lidn
/opt/gnu/bin/ld: curs_lib.o: undefined reference to symbol 'wtimeout'
/lib64/libtinfo.so.5: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [mutt] Error 1
OK, I somehow fixed it.. not really understand why this fixed it.
After configure, in the Makefile, change the LDFLAGS = line to LDFLAGS = -lncurses -ltinfo, then make install and it solved the issue.
Credit to this post: http://www.pclinuxos.com/forum/index.php?topic=129566.0, Tara-Rain-9.5ß's answer
I have a code by name mexCodeCuda.cu which uses dynamic parallelism. In the matlab interface, when I try to execute the following commands, I get the following error :
system('nvcc --compile mexCodeCuda.cu -o mexCodeCuda.o --compiler-options -fPIC -m64 -rdc=true -gencode arch=compute_35,code=sm_35 -O3 -lineinfo -use_fast_math -lcudadevrt -I/cm/shared/apps/MATLAB/extern/include')
system('nvcc -arch=sm_35 -dlink mexCodeCuda.o -o dlink.o')
eval('mex mexCodeCuda.o dlink.o -L'CUDA_LIB_PATH '-lcudart')
It gives the following error :
Error using mex
/usr/bin/ld: dlink.o: relocation R_X86_64_32S against `__nv_module_id' can
not be used when making a shared object; recompile with -fPIC
dlink.o: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
Can anyone help me ?
Thanks in advance...
A few changes:
Add -fPIC to the second nvcc command (using --compiler-options, just as you did with the first nvcc).
Specify the cudadevrt runtime option on the mex command (-lcudadevrt), just as you have with the first nvcc call.
And you may need to add -fPIC to the mex linking via LDCXXFLAGS or LDFLAGS. Not sure.
I've been trying to install the IPTables module for perl http://metacpan.org/pod/IPTables::IPv4 and I've been running into errors during installation.
I've tried installing using the CPAN in shell as well as downloading the tarball form the link above. Both installation give me errors. I am not sure how to get the dump from CPAN but what I can get is a dump of my shell when I run the MAKE file from the tarball:
[root#localhost IPTables-IPv4-0.98]# make
make -C libiptc/ all
make[1]: Entering directory `/home/student/Downloads/IPTables-IPv4-0.98/libiptc'
gcc -o libip6tc.o -c libip6tc.c -I../include -I/usr/src/linux/include -DIPTABLES_VERSION=\"1.2.8\" -O2 -Wall
In file included from libip6tc.c:111:0:
libiptc.c: In function ‘ip6tc_init’:
libiptc.c:312:10: warning: pointer targets in passing argument 5 of ‘getsockopt’ differ in signedness
/usr/include/sys/socket.h:190:12: note: expected ‘socklen_t * __restrict__’ but argument is of type ‘int *’
libiptc.c: In function ‘target_name’:
libiptc.c:727:2: warning: dereferencing type-punned pointer will break strict-aliasing rules
libip6tc.c: In function ‘ipv6_prefix_length’:
libip6tc.c:121:7: error: ‘const struct in6_addr’ has no member named ‘in6_u’
libip6tc.c:125:7: error: ‘const struct in6_addr’ has no member named ‘in6_u’
libip6tc.c: In function ‘dump_entry’:
libip6tc.c:201:3: warning: dereferencing type-punned pointer will break strict-aliasing rules
make[1]: *** [libip6tc.o] Error 1
make[1]: Leaving directory `/home/student/Downloads/IPTables-IPv4-0.98/libiptc'
make: *** [libiptc/libiptc.a] Error 2
[root#localhost IPTables-IPv4-0.98]#
I would like to know what do I need to do so that I can install the module. Are there some dependencies that I need to install?
Your help is greatly appreciated.
The cpanratings and CPAN testers reports for this module make me think that you're wasting your time here.
I'm trying to compile a GNU stack on Solaris 10 (x86).
I've managed to get the following up so far:
GMP
MPFR
MPC
GCC
binutils
libiconv
gettext
I'm currently trying to build Ncurses, and I'm hitting an error:
/db/pub/eq/tools/bin/g++ -I../c++ -I../include -I/db/pub/eq/src/ncurses-5.9/c++ -DHAVE_CONFIG_H -D__EXTENSIONS__ -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 -DNDEBUG -I. -I../include -I/db/pub/eq/src/ncurses-5.9/c++/../include -I/db/pub/eq/tools/include/ncurses -O2 -c /db/pub/eq/src/ncurses-5.9/c++/cursesf.cc -o ../objects/cursesf.o
<command-line>:0:0: warning: "_XOPEN_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
In file included from /usr/include/iso/stdlib_iso.h:30:0,
from /usr/include/stdlib.h:18,
from /db/pub/eq/src/ncurses-5.9/c++/internal.h:53,
from /db/pub/eq/src/ncurses-5.9/c++/cursesf.cc:34:
/db/pub/eq/tools/lib/gcc/i386-pc-solaris2.10/4.6.1/include-fixed/sys/feature_tests.h:341:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications"
*** Error code 1
make: Fatal error: Command failed for target `../objects/cursesf.o'
Current working directory /db/pub/eq/src/ncurses-5.9/c++
*** Error code 1
make: Fatal error: Command failed for target `all'
I'm not quite sure what the above error (Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications) means, or how to troubleshoot it.
I saw this error once before when I was building MPC (during gmake check), but I had no idea what it meant then, or how to fix it - but since it was in checks, it was ok.
Cheers,
Victor
apply this patch to the configure script:
--- configure.orig Fri Aug 5 14:28:28 2011
+++ configure Fri Aug 5 14:31:11 2011
## -7246,7 +7246,7 ##
# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
;;
solaris2.1[0-9]) #(vi
- cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+ cf_xopen_source="-D__EXTENSIONS__"
;;
solaris2.[1-9]) #(vi
cf_xopen_source="-D__EXTENSIONS__"
Ncurses 5.6 did not define _XOPEN_SOURCE for solaris either.
Cheers