[petsc-users] Petscmatlabengine, libicudata not found, undefined symbol mexPrintf
Barry Smith
bsmith at mcs.anl.gov
Wed Feb 16 07:57:42 CST 2011
On Feb 16, 2011, at 1:35 AM, Birendra jha wrote:
> Hi,
>
> I removed -licudata at three places in petscvariables. The error just shifted to -licui18n:
>
> 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 -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 -licui18n
> 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 -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 -licui18n
> collect2: ld returned 1 exit status
> make[3]: [ex5f] Error 1 (ignored)
> /bin/rm -f ex5f.o
> Completed test examples
>
>
> I removed its references, error shifted to -licuuc, removed its references, error became:
> ...
> /home/bjha/src/petsc-dev/linux_gcc-4.4.1_64/lib/libpetsc.a(aij.o): In function `MatCreate_SeqAIJ':
> /home/bjha/src/petsc-dev/src/mat/impls/aij/seq/aij.c:3492: undefined reference to `MatGetFactor_seqaij_matlab'
Send configure.log and make.log to petsc-maint at mcs.anl.gov Looks like those two libraries are not needed, but something went wrong with the PETSc compile.
Barry
> ...
>
> It seems a linking issue.
>
> I checked "file" for few other libraries--they are all ELF 32-bit:
>
> bjha at ubuntu:~/MATLAB/R2010b/bin/glnx86$ file libmwblas.so
> libmwblas.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
> bjha at ubuntu:~/MATLAB/R2010b/bin/glnx86$ file libjogl.so
> libjogl.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped
> bjha at ubuntu:~/MATLAB/R2010b/bin/glnx86$ file libmwfftw.so
> libmwfftw.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
> bjha at ubuntu:~/MATLAB/R2010b/bin/glnx86$ file libeng.so
> libeng.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
>
> PyLith configure also gives Petsc linking error:
>
> checking for PETSc dir... /home/bjha/src/petsc-dev
> checking for PETSc arch... linux_gcc-4.4.1_64
> checking for PETSc config... /home/bjha/src/petsc-dev/linux_gcc-4.4.1_64/conf/petscvariables
> checking for PETSc version == 3.1.0... yes
> checking for PetscInitialize... no
> checking for the libraries used by mpicc... -pthread -L/home/bjha/tools/gcc-4.4.1_64/lib -lmpi -lopen-rte -lopen-pal -ldl -lnsl -lutil -lm -ldl
> checking for PetscInitialize... no
> configure: error: cannot link against PETSc libraries
>
> Please help.
>
> Thanks & regards
> 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:55 AM
>>
>> On Feb 15, 2011, at 8:14 PM, Birendra jha wrote:
>>
>>> 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
>>
>> Humm. Run file on some of the other
>> libraries in that directory. Are they also ELF 32 bit?
>> You can try editing ${PETSC_ARCH/conf/petscvariables and
>> removing the reference to libicudata then run make test. It
>> may not be needed.
>>
>> Barry
>>
>>>
>>>
>>> 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
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>> <MATLAB_R2010b_bin_glnx86_files.txt>
>>
>>
>
>
>
More information about the petsc-users
mailing list