Compiling DBD::mysql on SunOS 5.10 - perl

everybody
I apologize for the massive length of this post.
I am having some issues compiling DBD::mysql on SunOS.
# /usr/perl5/bin/perlgcc Makefile.PL
I will use the following settings for compiling and testing:
cflags (mysql_config) = -I/usr/sfw/include/mysql -xstrconst -mt
embedded (mysql_config) =
ldflags (mysql_config) = -R/usr/sfw/lib -R/usr/sfw/lib/mysql
libs (mysql_config) = -L/usr/sfw/lib -L/usr/sfw/lib/mysql -lmysqlclient -lz -lposix4 -lcrypt -lgen -lsocket -lnsl -lm
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
ssl (guessed ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testsocket (default ) =
testuser (guessed ) =
Checking if your kit is complete...
Looks good
Using DBI 1.58 (for perl 5.008004 on sun4-solaris-64int) installed in /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int/auto/DBI/
Writing Makefile for DBD::mysql
# /usr/sfw/bin/gmake
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
gcc -c -I/usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int/auto/DBI -I/usr/sfw/include/mysql -xstrconst -mt -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO -O2 -fno-strict-aliasing -DVERSION=\"4.022\" -DXS_VERSION=\"4.022\" -fPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE" dbdimp.c
gcc: language strconst not recognized
gcc: dbdimp.c: linker input file unused because linking not done
/usr/perl5/5.8.4/bin/perl -p -e "s/~DRIVER~/mysql/g" /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int/auto/DBI/Driver.xst > mysql.xsi
/usr/perl5/5.8.4/bin/perl /usr/perl5/5.8.4/lib/ExtUtils/xsubpp -typemap /usr/perl5/5.8.4/lib/ExtUtils/typemap mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line 242
Warning: duplicate function definition 'rows' detected in mysql.xs, line 752
gcc -c -I/usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int/auto/DBI -I/usr/sfw/include/mysql -xstrconst -mt -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO -O2 -fno-strict-aliasing -DVERSION=\"4.022\" -DXS_VERSION=\"4.022\" -fPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE" mysql.c
gcc: language strconst not recognized
gcc: mysql.c: linker input file unused because linking not done
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/usr/sfw/lib:/usr/lib:/lib" /usr/perl5/5.8.4/bin/perl myld gcc -G dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.so -L/usr/sfw/lib -L/usr/sfw/lib/mysql -lmysqlclient -lz -lposix4 -lcrypt -lgen -lsocket -lnsl -lm
gcc: dbdimp.o: No such file or directory
gcc: mysql.o: No such file or directory
gmake: *** [blib/arch/auto/DBD/mysql/mysql.so] Error 1
Probably relevant information:
mysql_config --cflags
-I/usr/sfw/include/mysql -xstrconst -mt
mysql_config --libs
-R/usr/sfw/lib -R/usr/sfw/lib/mysql -L/usr/sfw/lib -L/usr/sfw/lib/mysql -lmysqlclient -lz -lposix4 -lcrypt -lgen -lsocket -lnsl -lm
file `which perl`
/usr/bin/perl: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped
# perl --version
This is perl, v5.8.4 built for sun4-solaris-64int
ldd /usr/sfw/bin/mysql
libcurses.so.1 => /lib/libcurses.so.1
libmysqlclient.so.12 => /usr/sfw/lib/libmysqlclient.so.12
libz.so.1 => /usr/lib/libz.so.1
librt.so.1 => /lib/librt.so.1
libcrypt_i.so.1 => /usr/lib/libcrypt_i.so.1
libgen.so.1 => /lib/libgen.so.1
libsocket.so.1 => /lib/libsocket.so.1
libnsl.so.1 => /lib/libnsl.so.1
libm.so.2 => /lib/libm.so.2
libCstd.so.1 => /usr/lib/libCstd.so.1
libCrun.so.1 => /usr/lib/libCrun.so.1
libw.so.1 => /lib/libw.so.1
libthread.so.1 => /lib/libthread.so.1
libc.so.1 => /lib/libc.so.1
libaio.so.1 => /lib/libaio.so.1
libmd.so.1 => /lib/libmd.so.1
libmp.so.2 => /lib/libmp.so.2
libscf.so.1 => /lib/libscf.so.1
libdoor.so.1 => /lib/libdoor.so.1
libuutil.so.1 => /lib/libuutil.so.1
/usr/lib/cpu/sparcv8plus/libCstd_isa.so.1
/platform/SUNW,SPARC-Enterprise-T5120/lib/libc_psr.so.1
/platform/SUNW,SPARC-Enterprise-T5120/lib/libmd_psr.so.1
# perl -V
Summary of my perl5 (revision 5 version 8 subversion 4) configuration:
Platform:
osname=solaris, osvers=2.10, archname=sun4-solaris-64int
uname='sunos localhost 5.10 sun4u sparc SUNW,Ultra-2'
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO',
optimize='-xO3 -xspace -xildoff',
cppflags=''
ccversion='Sun WorkShop', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=87654321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='cc', ldflags =''
libpth=/lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc
perllibs=-lsocket -lnsl -ldl -lm -lc
libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-R /usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE'
cccdlflags='-KPIC', lddlflags='-G'
Characteristics of this binary (from libperl):
Compile-time options: USE_64_BIT_INT USE_LARGE_FILES
Locally applied patches:
22667 The optree builder was looping when constructing the ops ...
22715 Upgrade to FileCache 1.04
22733 Missing copyright in the README.
22746 fix a coredump caused by rv2gv not fully converting a PV ...
22755 Fix 29149 - another UTF8 cache bug hit by substr.
22774 [perl #28938] split could leave an array without ...
22775 [perl #29127] scalar delete of empty slice returned garbage
22776 [perl #28986] perl -e "open m" crashes Perl
22777 add test for change #22776 ("open m" crashes Perl)
22778 add test for change #22746 ([perl #29102] Crash on assign ...
22781 [perl #29340] Bizarre copy of ARRAY make sure a pad op's ...
22796 [perl #29346] Double warning for int(undef) and abs(undef) ...
22818 BOM-marked and (BOMless) UTF-16 scripts not working
22823 [perl #29581] glob() misses a lot of matches
22827 Smoke [5.9.2] 22818 FAIL(F) MSWin32 WinXP/.Net SP1 (x86/1 cpu)
22830 [perl #29637] Thread creation time is hypersensitive
22831 improve hashing algorithm for ptr tables in perl_clone: ...
22839 [perl #29790] Optimization busted: '#a = "b", sort #a' ...
22850 [PATCH] 'perl -v' fails if local_patches contains code snippets
22852 TEST needs to ignore SCM files
22886 Pod::Find should ignore SCM files and dirs
22888 Remove redundant %SIG assignments from FileCache
23006 [perl #30509] use encoding and "eq" cause memory leak
23074 Segfault using HTML::Entities
23106 Numeric comparison operators mustn't compare addresses of ...
23320 [perl #30066] Memory leak in nested shared data structures ...
23321 [perl #31459] Bug in read()
27722 perlio.c breaks on Solaris/gcc when > 256 FDs are available
SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962
6663288 Upgrade to CGI.pm 3.33
REGEXP0 - fix for UTF-8 recoding in regexps - CVE-2007-5116
6758953 Perl Sys::Syslog can log messages with wrong severity
Built under solaris
Compiled at May 21 2009 03:59:02
#INC:
/usr/perl5/5.8.4/lib/sun4-solaris-64int
/usr/perl5/5.8.4/lib
/usr/perl5/site_perl/5.8.4/sun4-solaris-64int
/usr/perl5/site_perl/5.8.4
/usr/perl5/site_perl
/usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int
/usr/perl5/vendor_perl/5.8.4
/usr/perl5/vendor_perl
.
isainfo -v
64-bit sparcv9 applications
asi_blk_init vis2 vis
32-bit sparc applications
asi_blk_init vis2 vis v8plus div32 mul32
Any tips as how I should proceed, if possible in a step-by-step (for dummies) manner?
Thanks!

Try using a Sun compiler, which presumably compiled your mysql. Others have had this problem, too.

Related

How to install Perl-5.8.9 on Ubuntu

I have a legacy Perl 5.8.9 project which I need to run in a docker environment. Since I new it worked on Ubuntu I tried compiling it on an Ubuntu 16.1 and
FROM ubuntu
RUN apt-get update \
&& apt-get install -y curl \
&& apt-get install -y wget \
&& apt-get install -y perlbrew
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
Images
since I couldn't find the version on perlbrew, I tried compiling from perl-5.8.9.tar.bz2 which I downloaded
Compilation failed having something to do with miniperl.
perlio.c:515:2: note: in expansion of macro 'PerlLIO_write'
PerlLIO_write(dbg, s, len);
^~~~~~~~~~~~~
perlio.c: In function 'PerlIO_parse_layers':
perlio.c:995:11: warning: this statement may fall through [-Wimplicit-
fallthrough=]
if (*e++) {
^
perlio.c:1001:4: note: here
case '\0':
^~~~
In file included from perl.h:3169:0,
from perlio.c:57:
perlio.c: In function 'S_more_refcounted_fds':
iperlsys.h:762:39: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
#define PerlLIO_write(fd, buf, count) write((fd), (buf), (count))
^~~~~~~~~~~~~~~~~~~~~~~~~~~
perlio.c:2307:2: note: in expansion of macro 'PerlLIO_write'
PerlLIO_write(PerlIO_fileno(Perl_error_log),
^~~~~~~~~~~~~
`sh cflags "optimize='-O2'" perlapi.o` perlapi.c
CCCMD = cc -DPERL_CORE -c -fno-strict-aliasing -pipe - I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c89 - O2 -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -DPERL_GCC_PEDANTIC
`sh cflags "optimize='-O2'" numeric.o` numeric.c
CCCMD = cc -DPERL_CORE -c -fno-strict-aliasing -pipe - I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c89 - O2 -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif- labels -Wc++-compat -DPERL_GCC_PEDANTIC
`sh cflags "optimize='-O2'" mathoms.o` mathoms.c
CCCMD = cc -DPERL_CORE -c -fno-strict-aliasing -pipe - I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c89 - O2 -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif- labels -Wc++-compat -DPERL_GCC_PEDANTIC
`sh cflags "optimize='-O2'" locale.o` locale.c
CCCMD = cc -DPERL_CORE -c -fno-strict-aliasing -pipe - I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c89 - O2 -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif- labels -Wc++-compat -DPERL_GCC_PEDANTIC
`sh cflags "optimize='-O2'" pp_pack.o` pp_pack.c
CCCMD = cc -DPERL_CORE -c -fno-strict-aliasing -pipe - I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c89 - O2 -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif- labels -Wc++-compat -DPERL_GCC_PEDANTIC
pp_pack.c: In function 'S_pack_rec':
pp_pack.c:2716:7: warning: variable 'was_utf8' set but not used [- Wunused-but-set-variable]
U32 was_utf8;
^~~~~~~~
`sh cflags "optimize='-O2'" pp_sort.o` pp_sort.c
CCCMD = cc -DPERL_CORE -c -fno-strict-aliasing -pipe - I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c89 - O2 -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif- labels -Wc++-compat -DPERL_GCC_PEDANTIC
`sh cflags "optimize='-O2'" opmini.o` -DPERL_EXTERNAL_GLOB opmini.c
CCCMD = cc -DPERL_CORE -c -fno-strict-aliasing -pipe -vI/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c89 - O2 -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif- labels -Wc++-compat -DPERL_GCC_PEDANTIC
opmini.c: In function 'Perl_list':
opmini.c:977:5: warning: this statement may fall through [-Wimplicit- fallthrough=]
if (!o->op_next && cUNOPo->op_first->op_type == OP_FLOP) {
^
opmini.c:981:5: note: here
case OP_LIST:
^~~~
opmini.c: In function 'Perl_mod':
opmini.c:1277:11: warning: this statement may fall through [-Wimplicit-v
fallthrough=]
PL_hints |= HINT_BLOCK_SCOPE;
opmini.c:1278:5: note: here
case OP_SASSIGN:
^~~~
opmini.c: In function 'Perl_fold_constants':
opmini.c:2119:40: warning: argument 'o' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
Perl_fold_constants(pTHX_ register OP *o)
^
cc -L/usr/local/lib -o miniperl \
`echo gv.o toke.o perly.o op.o pad.o regcomp.o dump.o util.o mg.o reentr.o hv.o av.o perl.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xsutils.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o | sed 's/ op.o / /'` \
miniperlmain.o opmini.o
pp.o: In function `Perl_pp_pow':
pp.c:(.text+0x2d84): undefined reference to `pow'
pp.o: In function `Perl_pp_modulo':
pp.c:(.text+0x3b80): undefined reference to `fmod'
pp.o: In function `Perl_pp_atan2':
pp.c:(.text+0x8884): undefined reference to `atan2'
pp.o: In function `Perl_pp_sin':
pp.c:(.text+0x8978): undefined reference to `sqrt'
pp.c:(.text+0x8a23): undefined reference to `log'
pp.c:(.text+0x8a4e): undefined reference to `cos'
pp.c:(.text+0x8afb): undefined reference to `sin'
pp.c:(.text+0x8b13): undefined reference to `exp'
collect2: error: ld returned 1 exit status
makefile:313: recipe for target 'miniperl' failed
make: *** [miniperl] Error 1
Is there a ready docker image?
If not how do I install on ubuntu or preferably on alpine or another light container.
Run the following commands in the terminal one after another.
sudo apt-get install perlbrew
perlbrew available
perlbrew install perl-5.8.9
If it fails to download, create a directory as shown below
mkdir -p perl5/perlbrew/dists
Try again the following command
perlbrew install perl-5.8.9
For more info , please refer this:
https://askubuntu.com/questions/425427/how-to-install-perl-php-mysql-and-ruby-packages-on-ubuntu
In case you don't want to use perlbrew, here is another way-
From https://stackoverflow.com/a/44441545/2001559
In your docker file -
RUN apt-get install -y gcc
ADD http://www.cpan.org/src/5.0/perl-5.8.9.tar.gz /shared
RUN tar -xzf perl-5.8.9.tar.gz
WORKDIR /shared/perl-5.8.9
RUN ./Configure -des -Dprefix=/opt/perl-5.8.9/localperl
RUN make
RUN make test
RUN make install
perl-5.8.0
I solved the issue when created 2 directories:
mkdir -p /home/<username>/perl5/perlbrew/dists/
mkdir -p /home/<username>/perl5/perlbrew/build/perl-5.8.0
Gave rwx-rwx-rwx (to avoid any problems with the access):
chmod -Rf 0777 /home/<username>/perl5/perlbrew/dists
chmod -Rf 0777 /home/<username>/perl5/perlbrew/build/perl-5.8.0

Perl installtion on ARMv7eb

I have cross compiled tool chain for armv7eb. Now I have copied the tools to my target machine and tried to build perl on target. In this process of building perl, there is a binary called 'miniperl' which crashes, outputting "ILLEGAL INSTRUCTION".
Can someone help me point out what I should be doing?
PERL VERSION: 5.8.8
GCC: 4.1.3
Please find the crash log below. Does anybody have any suggestions?
sh cflags "optimize='-O'" opmini.o` -DPIC -fPIC -DPERL_EXTERNAL_GLOB opmini.c
CCCMD = cc -DPERL_CORE -c -msoft-float -dynamic -fno-strict-aliasing -pipe -Wdeclaration-after-statement -O -Wall
LD_LIBRARY_PATH=/usr/pkg/src/perl-5.8.8:/lib:/usr/lib:/usr/pkg/lib:/usr/pkg/src/PTHREAD/lib cc -Wl,-rpath,/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/pkg/lib -L/lib -L/usr/lib -o miniperl miniperlmain.o opmini.o -L. -lperl -lm -lcrypt -lutil -lc -lposix
LD_LIBRARY_PATH=/usr/pkg/src/perl-5.8.8:/lib:/usr/lib:/usr/pkg/lpid 25563 (miniperl), uid 0: exited on signal 4 (core not dumped, err = 2)
ib:/usr/pkg/src/PTHREAD/lib ./miniperl -w -Ilib -MExporter -e '<?>' || make minitest
[1] Illegal instruction LD_LIBRARY_PATH=...
cp ext/re/re.pm lib/re.pm
LD_LIBRARY_PATH=/usr/pkg/src/perpid 8052 (miniperl), uid 0: exited on signal 4 (core not dumped, err = 2)
l-5.8.8:/lib:/usr/lib:/usr/pkg/lib:/usr/pkg/src/PTHREAD/lib ./miniperl -Ilib configpm --heavy=lib/Config_heavy.pl lib/Config.pm
[1] Illegal instruction LD_LIBRARY_PATH=...
*** Error code 132
Stop.
make: stopped in /upid 25595 (miniperl), uid 0: exited on signal 4 (core not dumped, err = 2)
sr/pkg/src/perl-5.8.8
*** Error code 1 (ignored)
You may see some irrelevant test failures if you have been unable
to build lib/Config.pm, lib/lib.pm or the Unicode data files.
cd t && (rm -f perl; /bin/ln -s ../miniperl perl) && LD_LIBRARY_PATH=/usr/pkg/src/perl-5.8.8:/lib:/usr/lib:/usr/pkg/lib:/usr/pkg/src/PTHREAD/lib ./perl TEST -minitest base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t uni/*.t </dev/tty
[1] Illegal instruction LD_LIBRARY_PATH=...
*** Error code 132 (ignored)
*** Error code 1 (ignored)
LD_LIBRARY_PATH=/usr/pkg/src/perpid 703 (miniperl), uid 0: exited on signal 4 (core not dumped, err = 2)
l-5.8.8:/lib:/usr/lib:/usr/pkg/lib:/usr/pkg/src/PTHREAD/lib ./miniperl -Ilib configpm --heavy=lib/Config_heavy.pl lib/Config.pm

Issues compiling MEX file (cannot find -lstdc++)

So I have been trying to compile this code using mex to on avail. The issue is it can not seem to find lstdc++ and lpthread and libm are for whatever reason incompatible. My /usr/lib32 folder looks like the following:
iggy#ThinkpadX1:~/Applications/Matlab_2012a/bin$ ls /usr/lib32/
crt1.o libanl.so libc_nonshared.a libg.a libmcheck.a libnss_files.so libpthread.so librt.so libz.so.1
crti.o libBrokenLocale.a libcrypt.a libgcc_s.so.1 libm.so libnss_hesiod.so libquadmath.so.0 libstdc++.so.6 libz.so.1.2.3.4
crtn.o libBrokenLocale.so libcrypt.so libgomp.so.1 libnsl.a libnss_nisplus.so libquadmath.so.0.0.0 libstdc++.so.6.0.16 Mcrt1.o
gconv libbsd-compat.a libc.so libgomp.so.1.0.0 libnsl.so libnss_nis.so libresolv.a libthread_db.so Scrt1.o
gcrt1.o libc.a libdl.a libieee.a libnss_compat.so libpthread.a libresolv.so libutil.a
libanl.a libcidn.so libdl.so libm.a libnss_dns.so libpthread_nonshared.a librt.a libutil.so
And the errors I am recieving are the following:
K>> make_csolve
**************************************************************************
Warning: Neither -compatibleArrayDims nor -largeArrayDims is selected.
Using -compatibleArrayDims. In the future, MATLAB will require
the use of -largeArrayDims and remove the -compatibleArrayDims
option. For more information, see:
http://www.mathworks.com/help/techdoc/matlab_external/bsflnue-1.html
**************************************************************************
/home/iggy/Applications/Matlab_2012a/bin/mex: 1: /home/iggy/Applications/Matlab_2012a/bin/util/oscheck.sh: /lib64/libc.so.6: not found
/home/iggy/Applications/Matlab_2012a/bin/mex: 1: /home/iggy/Applications/Matlab_2012a/bin/util/oscheck.sh: /lib64/libc.so.6: not found
-> mexopts.sh sourced from directory (DIR = $MATLAB/bin)
FILE = /home/iggy/Applications/Matlab_2012a/bin/mexopts.sh
----------------------------------------------------------------
-> MATLAB = /home/iggy/Applications/Matlab_2012a
-> CC = gcc-4.4
-> CC flags:
CFLAGS = -ansi -D_GNU_SOURCE -fexceptions -fPIC -fno-omit-frame-pointer -pthread
CDEBUGFLAGS = -g
COPTIMFLAGS = -O -DNDEBUG
CLIBS = -Wl,-rpath-link,/home/iggy/Applications/Matlab_2012a/bin/glnxa64 -L/usr/lib32 -L/home/iggy/Applications/Matlab_2012a/bin/glnxa64 -lmx -lmex -lmat -lm -lstdc++
arguments = -DMX_COMPAT_32
-> CXX = g++-4.4
-> CXX flags:
CXXFLAGS = -ansi -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread
CXXDEBUGFLAGS = -g
CXXOPTIMFLAGS = -O -DNDEBUG
CXXLIBS = -Wl,-rpath-link,/home/iggy/Applications/Matlab_2012a/bin/glnxa64 -L/home/iggy/Applications/Matlab_2012a/bin/glnxa64 -lmx -lmex -lmat -lm
arguments = -DMX_COMPAT_32
-> FC = gfortran
-> FC flags:
FFLAGS = -fexceptions -fbackslash -fPIC -fno-omit-frame-pointer
FDEBUGFLAGS = -g
FOPTIMFLAGS = -O
FLIBS = -Wl,-rpath-link,/home/iggy/Applications/Matlab_2012a/bin/glnxa64 -L/home/iggy/Applications/Matlab_2012a/bin/glnxa64 -lmx -lmex -lmat -lm
arguments = -DMX_COMPAT_32
-> LD = gcc-4.4
-> Link flags:
LDFLAGS = -pthread -shared -Wl,--version-script,/home/iggy/Applications/Matlab_2012a/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined
LDDEBUGFLAGS = -g
LDOPTIMFLAGS = -O
LDEXTENSION = .mexa64
arguments =
-> LDCXX =
-> Link flags:
LDCXXFLAGS =
LDCXXDEBUGFLAGS =
LDCXXOPTIMFLAGS =
LDCXXEXTENSION =
arguments =
----------------------------------------------------------------
-> gcc-4.4 -c -I/home/iggy/Applications/Matlab_2012a/extern/include -I/home/iggy/Applications/Matlab_2012a/simulink/include -DMATLAB_MEX_FILE -ansi -D_GNU_SOURCE -fexceptions -fPIC -fno-omit-frame-pointer -pthread -DMX_COMPAT_32 -O -DNDEBUG "csolve.c"
-> gcc-4.4 -c -I/home/iggy/Applications/Matlab_2012a/extern/include -I/home/iggy/Applications/Matlab_2012a/simulink/include -DMATLAB_MEX_FILE -ansi -D_GNU_SOURCE -fexceptions -fPIC -fno-omit-frame-pointer -pthread -DMX_COMPAT_32 -O -DNDEBUG "ldl.c"
-> gcc-4.4 -c -I/home/iggy/Applications/Matlab_2012a/extern/include -I/home/iggy/Applications/Matlab_2012a/simulink/include -DMATLAB_MEX_FILE -ansi -D_GNU_SOURCE -fexceptions -fPIC -fno-omit-frame-pointer -pthread -DMX_COMPAT_32 -O -DNDEBUG "matrix_support.c"
-> gcc-4.4 -c -I/home/iggy/Applications/Matlab_2012a/extern/include -I/home/iggy/Applications/Matlab_2012a/simulink/include -DMATLAB_MEX_FILE -ansi -D_GNU_SOURCE -fexceptions -fPIC -fno-omit-frame-pointer -pthread -DMX_COMPAT_32 -O -DNDEBUG "solver.c"
-> gcc-4.4 -c -I/home/iggy/Applications/Matlab_2012a/extern/include -I/home/iggy/Applications/Matlab_2012a/simulink/include -DMATLAB_MEX_FILE -ansi -D_GNU_SOURCE -fexceptions -fPIC -fno-omit-frame-pointer -pthread -DMX_COMPAT_32 -O -DNDEBUG "util.c"
-> gcc-4.4 -O -pthread -shared -Wl,--version-script,/home/iggy/Applications/Matlab_2012a/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined -o "csolve.mexa64" csolve.o ldl.o matrix_support.o solver.o util.o -Wl,-rpath-link,/home/iggy/Applications/Matlab_2012a/bin/glnxa64 -L/usr/lib32 -L/home/iggy/Applications/Matlab_2012a/bin/glnxa64 -lmx -lmex -lmat -lm -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib32/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib32/libm.a when searching for -lm
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib32/libpthread.so when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib32/libpthread.a when searching for -lpthread
collect2: ld returned 1 exit status
mex: link of ' "csolve.mexa64"' failed.
Error using mex (line 206)
Unable to complete successfully.
Error in make_csolve (line 10)
mex -v csolve.c ldl.c matrix_support.c solver.c util.c
Any advice would be greatly appreciated (I am on Ubuntu 12.04 64-bit running MATLAB R2012a).
The libraries in /use/lib32 are incompatible because they are the wrong architecture (32-bit instead of 64-bit). Try running mex -setup again first. I'm assuming you're using 64-bit MATLAB (check with ver) since there are glnxa64 folders in the current setup.
However, the real error seems to be the following:
/home/iggy/Applications/Matlab_2012a/bin/mex: 1: /home/iggy/Applications/Matlab_2012a/bin/util/oscheck.sh: /lib64/libc.so.6: not found
Since oscheck.sh fails to find /lib64/libc.so.6, you might need to go into the package manage and look for libc and libstdc++, install them and try again. But first try to make a link to any existing libc.so.6 in another folder. Typical locations for Ubuntu are below.
64-bit Ubuntu:
sudo ln -s /lib/x86_64-linux-gnu/libc.so.6 /lib64/libc.so.6
32-bit Ubuntu:
sudo ln -s /lib/i386-linux-gnu/libc.so.6 /lib/libc.so.6

Doxygen build failing with undefined reference to `libiconv_close', `libiconv', `libiconv_open'

I'm unable to build Doxygen on x86_64-linux.
I have Doxygen-1.8.6 unpacked.
I have libiconv-1.14 unpacked, built, installed.
I keep getting:
g++ -c -pipe -fsigned-char -D_LARGEFILE_SOURCE -Wall -W -O2 -I../qtools -I../libmd5 -I. -o ../objects/main.o main.cpp
g++ -o ../bin/doxygen ../objects/main.o -L../lib -ldoxygen -ldoxycfg -lqtools -lmd5 -lpthread
../lib/libdoxycfg.a(portable_c.o): In function `portable_iconv_close':
portable_c.c:(.text+0x1): undefined reference to `libiconv_close'
../lib/libdoxycfg.a(portable_c.o): In function `portable_iconv':
portable_c.c:(.text+0x11): undefined reference to `libiconv'
../lib/libdoxycfg.a(portable_c.o): In function `portable_iconv_open':
portable_c.c:(.text+0x21): undefined reference to `libiconv_open'
collect2: ld returned 1 exit status
Which iconv gives:
/usr/local/bin/iconv
as expected.
Any ideas?
add -liconv to the end of the line in src/doxygen.pro.in:
unix:LIBS += -L../lib -ldoxygen -lvhdlparser -ldoxycfg -lqtools -lmd5 -lpthread %%SQLITE3_LIBS%% %%LIBCLANG_LIBS%% -liconv

mex linker not finding mexFunction symbol

Up until recently I've been able to compile mex functions fine on my mac osx 10.8.4
but now it gives me the error as follows (for convenience I have included the entire -v invocation):
**************************************************************************
Warning: Neither -compatibleArrayDims nor -largeArrayDims is selected.
Using -compatibleArrayDims. In the future, MATLAB will require
the use of -largeArrayDims and remove the -compatibleArrayDims
option. For more information, see:
http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-
api.html
**************************************************************************
-> mexopts.sh sourced from directory (DIR = .)
FILE = /Users/munanxu/Dropbox/Code/CUDA/mexThomasTDM/mexopts.sh
----------------------------------------------------------------
-> MATLAB = /Applications/MATLAB_R2013a.app
-> CC = xcrun -sdk macosx10.7 clang
-> CC flags:
CFLAGS = -fno-common -arch x86_64 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOS
X10.7.sdk -mmacosx-version-min=10.7 -fexceptions
CDEBUGFLAGS = -g
COPTIMFLAGS = -O2 -DNDEBUG
CLIBS = -L/Applications/MATLAB_R2013a.app/bin/maci64 -lmx -lmex -lmat -
lstdc++
arguments = -DMX_COMPAT_32
-> CXX = xcrun -sdk macosx10.7 clang++
-> CXX flags:
CXXFLAGS = -fno-common -fexceptions -arch x86_64 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX
10.7.sdk -mmacosx-version-min=10.7
CXXDEBUGFLAGS = -g
CXXOPTIMFLAGS = -O2 -DNDEBUG
CXXLIBS = -L/Applications/MATLAB_R2013a.app/bin/maci64 -lmx -lmex -lmat -
lstdc++
arguments = -DMX_COMPAT_32
-> FC = gfortran
-> FC flags:
FFLAGS = -fexceptions -m64 -fbackslash
FDEBUGFLAGS = -g
FOPTIMFLAGS = -O
FLIBS = -L/Applications/MATLAB_R2013a.app/bin/maci64 -lmx -lmex -lmat -L
-lgfortran -L -lgfortranbegin
arguments = -DMX_COMPAT_32
-> LD = xcrun -sdk macosx10.7 clang
-> Link flags:
LDFLAGS = -arch x86_64 -Wl,-
syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/
SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -bundle -Wl,-
exported_symbols_list,/Applications/MATLAB_R2013a.app/extern/lib/maci64/mexFunction.map
LDDEBUGFLAGS = -g
LDOPTIMFLAGS = -O
LDEXTENSION = .mexmaci64
arguments =
-> LDCXX =
-> Link flags:
LDCXXFLAGS =
LDCXXDEBUGFLAGS =
LDCXXOPTIMFLAGS =
LDCXXEXTENSION =
arguments =
----------------------------------------------------------------
-> xcrun -sdk macosx10.7 clang -g -arch x86_64 -Wl,-
syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/
SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -bundle -Wl,-
exported_symbols_list,/Applications/MATLAB_R2013a.app/extern/lib/maci64/mexFunction.map -o
"inputsTest.mexmaci64" "inputsTest.o" -L/Applications/MATLAB_R2013a.app/bin/maci64 -lmx
-lmex -lmat -lstdc++
Undefined symbols for architecture x86_64:
"_mexFunction", referenced from:
-exported_symbol[s_list] command line option
ld: symbol(s) not found for architecture x86_64
I had copied the original mexopts.sh file to the local directory to ensure that the mex compiler was using the correct version. I had also previously compiled my cpp file using g++ just to make sure the code was compiled natively for the x86_64 architecture. However, the same result occurs when I attempt to use the mex compiler to do compilation and linking.
Any ideas on what might be going on here? It seems that people have had this issue before, but mostly with missing libraries or definitions. I have definitely defined a mexFunction in my source file.
I think Amro is correct, I would put this as a comment, but it's a bit large, I find this for clang command line options to select target CPU
Registered Targets:
alpha - Alpha [experimental]
arm - ARM
bfin - Analog Devices Blackfin [experimental]
c - C backend ... ...
mblaze - MBlaze
mips - Mips ...
msp430 - MSP430 [experimental] ...
thumb - Thumb
x86 - 32-bit X86: Pentium-Pro and above
x86-64 - 64-bit X86: EM64T and AMD64
xcore - XCoreI'm thinking Amro is correct:
So is -arch x86-64 the right command line switch, rather than x86_64