[petsc-users] Petscmatlabengine, libicudata not found, undefined symbol mexPrintf

Birendra jha bjha7333 at yahoo.com
Tue Feb 15 20:14:11 CST 2011


Hi,

I attached the output of ls -l. Below are the outputs of "file" command:

bjha at ubuntu:~/src/pylith-dev/examples/3d/hex8$ file /home/bjha/MATLAB/R2010b/bin/glnx86/libicudata.so.42
/home/bjha/MATLAB/R2010b/bin/glnx86/libicudata.so.42: symbolic link to `libicudata.so.42.1'

bjha at ubuntu:~/src/pylith-dev/examples/3d/hex8$ file /home/bjha/MATLAB/R2010b/bin/glnx86/libicudata.so.42.1
/home/bjha/MATLAB/R2010b/bin/glnx86/libicudata.so.42.1: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped


Thanks
Bir

--- On Wed, 2/16/11, Barry Smith <bsmith at mcs.anl.gov> wrote:

> From: Barry Smith <bsmith at mcs.anl.gov>
> Subject: Re: [petsc-users] Petscmatlabengine, libicudata not found, undefined symbol mexPrintf
> To: "PETSc users list" <petsc-users at mcs.anl.gov>
> Date: Wednesday, February 16, 2011, 7:26 AM
> 
> On Feb 15, 2011, at 6:56 PM, Birendra jha wrote:
> 
> > Dear Petsc users,
> > 
> > I am getting "cannot find -licudata" error during
> "make test" on petsc-dev, even when libicudata.so.42.1, and
> its link, libicudata.so.42 are in
> /home/bjha/MATLAB/R2010b/bin/glnx86. Petsc "make" was fine.
> 
>   Run ls -l /home/bjha/MATLAB/R2010b/bin/glnx86 and
> send the output 
> also run file 
> /home/bjha/MATLAB/R2010b/bin/glnx86/libicudata.so.42 
> 
> > 
> > bjha at ubuntu:~/src/petsc-dev$ make
> PETSC_DIR=/home/bjha/src/petsc-dev
> PETSC_ARCH=linux_gcc-4.4.1_64 test
> > Running test examples to verify correct installation
> > --------------Error detected during compile or
> link!-----------------------
> > See http://www.mcs.anl.gov/petsc/petsc-2/documentation/faq.html
> > mpicxx -o ex19.o -c -Wall -Wwrite-strings
> -Wno-strict-aliasing -Wno-unknown-pragmas -g
> -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
> -I/home/bjha/src/petsc-dev/include
> -I/home/bjha/src/petsc-dev/linux_gcc-4.4.1_64/include
> -I/home/bjha/src/petsc-dev/include/sieve
> -I/home/bjha/MATLAB/R2010b/extern/include
> -I/home/bjha/tools/gcc-4.4.1_64/include
> -D__INSDIR__=src/snes/examples/tutorials/ ex19.c
> > mpicxx -Wall -Wwrite-strings -Wno-strict-aliasing
> -Wno-unknown-pragmas -g   -o ex19 
> ex19.o
> -L/home/bjha/src/petsc-dev/linux_gcc-4.4.1_64/lib 
> -lpetsc
> -Wl,-rpath,/home/bjha/src/petsc-dev/linux_gcc-4.4.1_64/lib
> -lparmetis -lmetis
> -Wl,-rpath,/home/bjha/MATLAB/R2010b/sys/os/glnx86:/home/bjha/MATLAB/R2010b/bin/glnx86:/home/bjha/MATLAB/R2010b/extern/lib/glnx86
> -L/home/bjha/MATLAB/R2010b/bin/glnx86
> -L/home/bjha/MATLAB/R2010b/extern/lib/glnx86 -leng -lmex
> -lmx -lmat -lut -licudata -licui18n -licuuc -lml -lchaco
> -L/usr/lib/atlas -llapack_atlas -llapack -latlas -lblas
> -L/home/bjha/tools/gcc-4.4.1_64/lib
> -L/usr/lib/gcc/i486-linux-gnu/4.4.3
> -L/usr/lib/i486-linux-gnu -ldl -lmpi -lopen-rte -lopen-pal
> -lnsl -lutil -lgcc_s -lpthread -lmpi_f90 -lmpi_f77
> -lgfortran -lm -lm -lm -lm -lmpi_cxx -lstdc++ -lmpi_cxx
> -lstdc++ -ldl -lmpi -lopen-rte -lopen-pal -lnsl -lutil
> -lgcc_s -lpthread -ldl 
> > /usr/bin/ld: cannot find -licudata
> > collect2: ld returned 1 exit status
> > make[3]: [ex19] Error 1 (ignored)
> > /bin/rm -f ex19.o
> > --------------Error detected during compile or
> link!-----------------------
> > See http://www.mcs.anl.gov/petsc/petsc-2/documentation/faq.html
> > mpif90 -c  -Wall -Wno-unused-variable
> -g   -I/home/bjha/src/petsc-dev/include
> -I/home/bjha/src/petsc-dev/linux_gcc-4.4.1_64/include
> -I/home/bjha/src/petsc-dev/include/sieve
> -I/home/bjha/MATLAB/R2010b/extern/include
> -I/home/bjha/tools/gcc-4.4.1_64/include    -o
> ex5f.o ex5f.F
> > mpif90 -Wall -Wno-unused-variable
> -g   -o ex5f ex5f.o
> -L/home/bjha/src/petsc-dev/linux_gcc-4.4.1_64/lib 
> -lpetsc
> -Wl,-rpath,/home/bjha/src/petsc-dev/linux_gcc-4.4.1_64/lib
> -lparmetis -lmetis
> -Wl,-rpath,/home/bjha/MATLAB/R2010b/sys/os/glnx86:/home/bjha/MATLAB/R2010b/bin/glnx86:/home/bjha/MATLAB/R2010b/extern/lib/glnx86
> -L/home/bjha/MATLAB/R2010b/bin/glnx86
> -L/home/bjha/MATLAB/R2010b/extern/lib/glnx86 -leng -lmex
> -lmx -lmat -lut -licudata -licui18n -licuuc -lml -lchaco
> -L/usr/lib/atlas -llapack_atlas -llapack -latlas -lblas
> -L/home/bjha/tools/gcc-4.4.1_64/lib
> -L/usr/lib/gcc/i486-linux-gnu/4.4.3
> -L/usr/lib/i486-linux-gnu -ldl -lmpi -lopen-rte -lopen-pal
> -lnsl -lutil -lgcc_s -lpthread -lmpi_f90 -lmpi_f77
> -lgfortran -lm -lm -lm -lm -lmpi_cxx -lstdc++ -lmpi_cxx
> -lstdc++ -ldl -lmpi -lopen-rte -lopen-pal -lnsl -lutil
> -lgcc_s -lpthread -ldl 
> > /usr/bin/ld: cannot find -licudata
> > collect2: ld returned 1 exit status
> > make[3]: [ex5f] Error 1 (ignored)
> > /bin/rm -f ex5f.o
> > Completed test examples
> > 
> > 
> > It is correct that I didn't install matlab in the
> default directory (/usr/local) because I had some permission
> issues on Ubuntu. But I have been running matlab (by running
> /MATLAB/R2010b/bin/matlab.sh) without any issues
> > for some time now. So it should be that, I suppose.
> > 
> > I still went ahead with compiling my application with
> few lines of PetscMatlabEngine functions, just to test:
> > 
> >  PetscMatlabEngine e;
> >  PetscScalar *array; array[0]=0;
> >  const char name[]="a";
>> PetscMatlabEngineCreate(PETSC_COMM_WORLD,PETSC_NULL,&e);
> >  PetscMatlabEnginePutArray(e,1,1,array,name);
> >  PetscMatlabEngineGetArray(e,1,1,array,name);
> >  PetscMatlabEngineDestroy(e);
> > 
> > Do I need to include any header file (e.g.
> petscmatlab.h) in the header of my class file?
> 
>   No
> 
> > Right now, the application compiled (make, make
> install) fine without any such include file. The application
> have been using Petsc for its solver without any issues, so
> it includes all the necessary files. I just want to exten
> the application to call some matlab scripts by using
> PetscMatlabEngine.
> > 
> > But, I get runtime error for mexPrintf:
> > 
> > bjha at ubuntu:~/src/pylith-dev/examples/3d/hex8$ pylith
> step06_pres.cfg
> > Traceback (most recent call last):
> >  File "/home/bjha/tools/gcc-4.4.1_64/bin/pylith",
> line 37, in <module>
> >    from pylith.apps.PyLithApp import
> PyLithApp
> >  File
> "/home/bjha/tools/gcc-4.4.1_64/lib/python2.6/site-packages/pylith/apps/PyLithApp.py",
> line 23, in <module>
> >    from PetscApplication import
> PetscApplication
> >  File
> "/home/bjha/tools/gcc-4.4.1_64/lib/python2.6/site-packages/pylith/apps/PetscApplication.py",
> line 27, in <module>
> >    class PetscApplication(Application):
> >  File
> "/home/bjha/tools/gcc-4.4.1_64/lib/python2.6/site-packages/pylith/apps/PetscApplication.py",
> line 41, in PetscApplication
> >    from pylith.utils.PetscManager import
> PetscManager
> >  File
> "/home/bjha/tools/gcc-4.4.1_64/lib/python2.6/site-packages/pylith/utils/PetscManager.py",
> line 29, in <module>
> >    import pylith.utils.petsc as petsc
> >  File
> "/home/bjha/tools/gcc-4.4.1_64/lib/python2.6/site-packages/pylith/utils/petsc.py",
> line 25, in <module>
> >    _petsc = swig_import_helper()
> >  File
> "/home/bjha/tools/gcc-4.4.1_64/lib/python2.6/site-packages/pylith/utils/petsc.py",
> line 21, in swig_import_helper
> >    _mod = imp.load_module('_petsc', fp,
> pathname, description)
> > ImportError:
> /home/bjha/tools/gcc-4.4.1_64/lib/libpylith.so.0: undefined
> symbol: mexPrintf
> 
>   Somehow all the Matlab shared libraries need to be
> found when python loads libpylith.so is loaded.  I
> don't know how this is done in Linux. It is really a python
> question if you want to use a dynamic library in python that
> uses another shared library how do you make sure python gets
> all the shared libraries loaded to resolve the symbols?
> 
>    Barry
> 
> > 
> > 
> > Can anyone help/suggest something?
> > 
> > Thanks a lot
> > Bir
> > 
> > 
> > 
> 
>


      
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: MATLAB_R2010b_bin_glnx86_files.txt
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110215/404b8157/attachment-0001.txt>


More information about the petsc-users mailing list