Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] want to use CGAL in Matlab, but can't compile mex file in matlab,

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] want to use CGAL in Matlab, but can't compile mex file in matlab,


Chronological Thread 
  • From: "" <>
  • To:
  • Subject: Re: [cgal-discuss] want to use CGAL in Matlab, but can't compile mex file in matlab,
  • Date: Sun, 12 Jan 2014 11:11:03 -0800 (PST)

Hi,

I am new to both Linux and CGAL, so apologies in advance for a naive
question.

I am trying to compile the file attached with this thread
(spherevoronoi.cpp) using same mex command and getting the same error:
*version `GLIBCXX_3.4.15' not found (required by /usr/bin/ld) *

/>>>mex -v spherevoronoi.cpp -ICGAL -lgmp -lboost_thread
-I/usr/include/:/usr/local/include/:/usr/local/MATLAB/R2012a/extern/include/
-L/usr/lib/:/usr/local/lib/:/usr/local/MATLAB/R2012a/extern/lib/glnxa64/

**************************************************************************
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
**************************************************************************

-> mexopts.sh sourced from directory (DIR = $PREF_DIR)
FILE = /home/comet/.matlab/R2012a/mexopts.sh
----------------------------------------------------------------
-> MATLAB = /usr/local/MATLAB/R2012a
-> 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,/usr/local/MATLAB/R2012a/bin/glnxa64
-L/usr/local/MATLAB/R2012a/bin/glnxa64 -lmx -lmex -lmat -lm
-L/usr/local/MATLAB/R2012a/sys/os/glnxa64 -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,/usr/local/MATLAB/R2012a/bin/glnxa64
-L/usr/local/MATLAB/R2012a/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,/usr/local/MATLAB/R2012a/bin/glnxa64
-L/usr/local/MATLAB/R2012a/bin/glnxa64 -lmx -lmex -lmat -lm
arguments = -DMX_COMPAT_32
-> LD = g++-4.4
-> Link flags:
LDFLAGS = -pthread -shared
-Wl,--version-script,/usr/local/MATLAB/R2012a/extern/lib/glnxa64/mexFunction.map
-Wl,--no-undefined
LDDEBUGFLAGS = -g
LDOPTIMFLAGS = -O
LDEXTENSION = .mexa64
arguments = -lgmp -lboost_thread
-L/usr/lib/:/usr/local/lib/:/usr/local/MATLAB/R2012a/extern/lib/glnxa64/
-> LDCXX =
-> Link flags:
LDCXXFLAGS =
LDCXXDEBUGFLAGS =
LDCXXOPTIMFLAGS =
LDCXXEXTENSION =
arguments = -lgmp -lboost_thread
-L/usr/lib/:/usr/local/lib/:/usr/local/MATLAB/R2012a/extern/lib/glnxa64/
----------------------------------------------------------------

-> g++-4.4 -c -ICGAL
-I/usr/include/:/usr/local/include/:/usr/local/MATLAB/R2012a/extern/include/
-I/usr/local/MATLAB/R2012a/extern/include
-I/usr/local/MATLAB/R2012a/simulink/include -DMATLAB_MEX_FILE -ansi
-D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread -DMX_COMPAT_32 -O
-DNDEBUG "spherevoronoi.cpp"

-> g++-4.4 -O -pthread -shared
-Wl,--version-script,/usr/local/MATLAB/R2012a/extern/lib/glnxa64/mexFunction.map
-Wl,--no-undefined -o "spherevoronoi.mexa64" spherevoronoi.o -lgmp
-lboost_thread
-L/usr/lib/:/usr/local/lib/:/usr/local/MATLAB/R2012a/extern/lib/glnxa64/
-Wl,-rpath-link,/usr/local/MATLAB/R2012a/bin/glnxa64
-L/usr/local/MATLAB/R2012a/bin/glnxa64 -lmx -lmex -lmat -lm

/usr/bin/ld: /usr/local/MATLAB/R2012a/bin/glnxa64/libstdc++.so.6: version
`GLIBCXX_3.4.15' not found (required by /usr/bin/ld)
collect2: ld returned 1 exit status

mex: link of ' "spherevoronoi.mexa64"' failed.

Error using mex (line 206)
Unable to complete successfully.
/


I tried to mimic the solution suggested by "魏华祎" but failed to get the
compiled. Can some CGAL expert folk help me with exact commands (as I am new
to linux) so that the file get compiled by mex without any trouble?

My Ubuntu version is 12.04, Matlab 2012a, g++/gcc 4.4. Please note that, I
can easily compile a c++ file that do not reference CGAL library, using mex
command. The problem occurs as soon as I use CGAL library.

Will appreciate your help,

Regards,
A.




--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/want-to-use-CGAL-in-Matlab-but-can-t-compile-mex-file-in-matlab-tp3521519p4658626.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.18.

Top of Page