[MOAB-dev] pytaps: can't import iBase and iMesh

Huayi Wei huayiwei1984 at gmail.com
Tue Jun 10 02:48:12 CDT 2014


Hi, Anthony,

I do some tests on |setup.py|, and notice a strange thing. When I launch 
python and do following tests:

|why at why-XPS-15-9530:~$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getenv('LD_LIBRARY_PATH')
'/home/why/software/itaps/parallel-shared/lib'
>>>
|

I can get the value of |LD_LIBRARY_PATH| as I want.

But in |setup.py|, I put |os.getenv(‘LD_LIBRARY_PATH’)| in 
|ITAPSCommand._find_defs()| and I get None, please see following codes 
and output.

|     @staticmethod
     def _find_defs(iface, path=None):
         if path:
             if os.path.isfile(path):
                 return os.path.normpath(path)
             name = os.path.join(path, iface+'-Defs.inc')
             if os.path.isfile(name):
                 return os.path.normpath(name)
             name = os.path.join(path, 'lib', iface+'-Defs.inc')
             if os.path.isfile(name):
                 return os.path.normpath(name)
             raise Exception("Unable to locate %s-Defs.inc" % iface)
         elif iface.upper()+'_DEFS' in os.environ:
             name = os.getenv(iface.upper()+"_DEFS")
             if os.path.isfile(name):
                 return os.path.normpath(name)
         else:
             # try a bunch of places where iXxx-Defs.inc might be located
             search = [os.path.join(i, '..', 'lib') for i in
                       os.getenv('PATH',  "").split(':') +
                       os.getenv('CPATH', "").split(':')] + \
                      os.getenv('LD_LIBRARY_PATH', "").split(':') + \
                      ['/usr/local/lib', '/usr/lib']
             print search
             print os.getenv('LD_LIBRARY_PATH')
             for i in search:
                 name = os.path.join(i, iface+'-Defs.inc')
                 if os.path.isfile(name):
                     return os.path.normpath(name)
|

|['/usr/local/sbin/../lib', '/usr/local/bin/../lib', '/usr/sbin/../lib', '/usr/bin/../lib', '/sbin/../lib', '/bin/../lib', '../lib', '', '/usr/local/lib', '/usr/lib']
None
['/usr/local/sbin/../lib', '/usr/local/bin/../lib', '/usr/sbin/../lib', '/usr/bin/../lib', '/sbin/../lib', '/bin/../lib', '../lib', '', '/usr/local/lib', '/usr/lib']
None
['/usr/local/sbin/../lib', '/usr/local/bin/../lib', '/usr/sbin/../lib', '/usr/bin/../lib', '/sbin/../lib', '/bin/../lib', '../lib', '', '/usr/local/lib', '/usr/lib']
None
|

That means |setup.py| didn’t find right thing. Is is a bug? Can you give 
me some furthermore hints? Thanks very much.

Best

Huayi

On 2014年06月10日 11:39, Huayi Wei wrote:

> when I launch python, and import iBase and iMesh, the output like this:
>
> |why at why-XPS-15-9530:~$ python
> Python 2.7.6 (default, Mar 22 2014, 22:59:56)
> [GCC 4.8.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from itaps import iBase, iMesh
> Traceback (most recent call last):
>    File "<stdin>", line 1, in <module>
> ImportError: /usr/local/lib/python2.7/dist-packages/PyTAPS-1.4-py2.7-linux-x86_64.egg/itaps/iMesh.so: undefined symbol: imesh_getentities_
> >>>
> |
>
> Huayi
>
> On 2014年06月10日 11:35, Huayi Wei wrote:
>
>> I put it into /etc/bash.bashrc, like following:
>>
>> export 
>> LD_LIBRARY_PATH=/home/why/software/itaps/parallel-shared/lib:$LD_LIBRARY_PATH
>>
>> Huayi
>>
>> On 2014年06月10日 11:25, Anthony Scopatz wrote:
>>> Did you export it or just put in in the env?
>>>
>>>
>>> On Mon, Jun 9, 2014 at 10:24 PM, Huayi Wei <huayiwei1984 at gmail.com 
>>> <mailto:huayiwei1984 at gmail.com>> wrote:
>>>
>>>     I put it in env, here is my setting:
>>>
>>>     |env | grep 'LD'
>>>     LD_LIRARY_PATH=/home/why/software/itaps/parallel-shared/lib
>>>     |
>>>
>>>     But the problem is still there.
>>>
>>>     Best
>>>
>>>     Huayi
>>>
>>>     On 2014年06月10日 10:54, Huayi Wei wrote:
>>>
>>>>     Hi, Anthony,
>>>>     Thanks for your reply. Now I rebuild cgm/moab/lasso with
>>>>     —enable-shared option, but I still have the same problem. Here
>>>>     is the content of my |setup.cfg| in pytaps dir:
>>>>
>>>>     |[global]
>>>>     iMesh-path   = /home/why/software/itaps/parallel-shared
>>>>     iGeom-path   = /home/why/software/itaps/parallel-shared
>>>>     iRel-path    = /home/why/software/itaps/parallel-shared
>>>>     [egg_info]
>>>>     tag_build =
>>>>     tag_date = 0
>>>>     tag_svn_revision = 0
>>>>     [build_ext]
>>>>     include-dirs = /home/why/software/itaps/parallel-shared/include
>>>>     |
>>>>
>>>>     The following is the output of the command |sudo python
>>>>     setup.py install|
>>>>
>>>>     |[sudo] password for why:
>>>>     running install
>>>>     running bdist_egg
>>>>     running egg_info
>>>>     writing requirements to PyTAPS.egg-info/requires.txt
>>>>     writing PyTAPS.egg-info/PKG-INFO
>>>>     writing top-level names to PyTAPS.egg-info/top_level.txt
>>>>     writing dependency_links to PyTAPS.egg-info/dependency_links.txt
>>>>     reading manifest file 'PyTAPS.egg-info/SOURCES.txt'
>>>>     writing manifest file 'PyTAPS.egg-info/SOURCES.txt'
>>>>     installing library code to build/bdist.linux-x86_64/egg
>>>>     running install_lib
>>>>     running build_py
>>>>     running build_ext
>>>>     Checking for usability of iRel...
>>>>     cc -I/home/why/software/itaps/parallel-shared/include -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -c iRel.c -o iRel.o
>>>>     Checking for usability of iMesh...
>>>>     cc -I/home/why/software/itaps/parallel-shared/include -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -c iMesh.c -o iMesh.o
>>>>     Checking for usability of iGeom...
>>>>     cc -I/home/why/software/itaps/parallel-shared/include -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -c iGeom.c -o iGeom.o
>>>>     Checking for usability of iMesh...
>>>>     cc -I/home/why/software/itaps/parallel-shared/include -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -c iMesh.c -o iMesh.o
>>>>     creating build/bdist.linux-x86_64/egg
>>>>     creating build/bdist.linux-x86_64/egg/itaps
>>>>     copying build/lib.linux-x86_64-2.7/itaps/iRel.so -> build/bdist.linux-x86_64/egg/itaps
>>>>     copying build/lib.linux-x86_64-2.7/itaps/iMesh.so -> build/bdist.linux-x86_64/egg/itaps
>>>>     copying build/lib.linux-x86_64-2.7/itaps/iMeshExtensions.so -> build/bdist.linux-x86_64/egg/itaps
>>>>     copying build/lib.linux-x86_64-2.7/itaps/iGeom.so -> build/bdist.linux-x86_64/egg/itaps
>>>>     copying build/lib.linux-x86_64-2.7/itaps/helpers.py -> build/bdist.linux-x86_64/egg/itaps
>>>>     copying build/lib.linux-x86_64-2.7/itaps/iBase.so -> build/bdist.linux-x86_64/egg/itaps
>>>>     copying build/lib.linux-x86_64-2.7/itaps/__init__.py -> build/bdist.linux-x86_64/egg/itaps
>>>>     byte-compiling build/bdist.linux-x86_64/egg/itaps/helpers.py to helpers.pyc
>>>>     byte-compiling build/bdist.linux-x86_64/egg/itaps/__init__.py to __init__.pyc
>>>>     creating stub loader for itaps/iBase.so
>>>>     creating stub loader for itaps/iRel.so
>>>>     creating stub loader for itaps/iMesh.so
>>>>     creating stub loader for itaps/iGeom.so
>>>>     creating stub loader for itaps/iMeshExtensions.so
>>>>     byte-compiling build/bdist.linux-x86_64/egg/itaps/iBase.py to iBase.pyc
>>>>     byte-compiling build/bdist.linux-x86_64/egg/itaps/iRel.py to iRel.pyc
>>>>     byte-compiling build/bdist.linux-x86_64/egg/itaps/iMesh.py to iMesh.pyc
>>>>     byte-compiling build/bdist.linux-x86_64/egg/itaps/iGeom.py to iGeom.pyc
>>>>     byte-compiling build/bdist.linux-x86_64/egg/itaps/iMeshExtensions.py to iMeshExtensions.pyc
>>>>     creating build/bdist.linux-x86_64/egg/EGG-INFO
>>>>     installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
>>>>     running install_scripts
>>>>     running build_scripts
>>>>     creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
>>>>     copying build/scripts-2.7/tagviewer -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
>>>>     changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/tagviewer to 755
>>>>     copying PyTAPS.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
>>>>     copying PyTAPS.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
>>>>     copying PyTAPS.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
>>>>     copying PyTAPS.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
>>>>     copying PyTAPS.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
>>>>     copying PyTAPS.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
>>>>     writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
>>>>     creating 'dist/PyTAPS-1.4-py2.7-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
>>>>     removing 'build/bdist.linux-x86_64/egg' (and everything under it)
>>>>     Processing PyTAPS-1.4-py2.7-linux-x86_64.egg
>>>>     removing '/usr/local/lib/python2.7/dist-packages/PyTAPS-1.4-py2.7-linux-x86_64.egg' (and everything under it)
>>>>     creating /usr/local/lib/python2.7/dist-packages/PyTAPS-1.4-py2.7-linux-x86_64.egg
>>>>     Extracting PyTAPS-1.4-py2.7-linux-x86_64.egg to /usr/local/lib/python2.7/dist-packages
>>>>     PyTAPS 1.4 is already the active version in easy-install.pth
>>>>     Installing tagviewer script to /usr/local/bin
>>>>
>>>>     Installed /usr/local/lib/python2.7/dist-packages/PyTAPS-1.4-py2.7-linux-x86_64.egg
>>>>     Processing dependencies for PyTAPS==1.4
>>>>     Searching for numpy==1.8.1
>>>>     Best match: numpy 1.8.1
>>>>     numpy 1.8.1 is already the active version in easy-install.pth
>>>>
>>>>     Using /usr/lib/python2.7/dist-packages
>>>>     Finished processing dependencies for PyTAPS==1.4
>>>>     |
>>>>
>>>>     In the output, I don’t see any information about linking
>>>>     iMesh.so with MOAB / iGeom.so with CGM / iRel.so with Lasso.
>>>>     Best
>>>>     Huayi
>>>>
>>>>>>>>>>
>>>
>>
>
​
​

​

​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20140610/fbb0d044/attachment-0001.html>


More information about the moab-dev mailing list