4

I am trying to install omniorb in a virtualenv for python.

Doing this using the included configure script with omniorb seems rather difficult.

Does anyone know about a pip, setup.py or easy_install script for omniorb?

2
  • What platform are you doing this on? Linux, Windows, or ...?
    – Brian Neal
    Mar 26, 2012 at 23:52
  • My main environment is ubuntu 11.04 64 bit, but I was hoping for something platform-independent.
    – mirk
    Mar 27, 2012 at 7:12

1 Answer 1

10

Out of curiosity I just tried this on Ubuntu 10.04. I don't have a pip or setup.py solution for you, but it isn't too hard.

I think the secret is to set the PYTHON variable to configure to point to the python executable in your virtualenv. I built omniORB and omniORBPy from source and installed them to a directory under my virtualenv (by specifying the --prefix option to configure).

You then have to put the site-packages directory that gets created under the omniORB install directory on your PYTHONPATH. I chose to do this by creating a omniorb.pth file in my virtualenv's site-packages folder (more on this below).

Here is the shell history of what I did. I am working out of a directory /home/brian/coding/python/virtualenvs. You'll have to mentally adjust paths, etc. for your environment.

 virtualenv omniORB
 cd omniORB/
 . bin/activate
 cp /home/brian/Downloads/omni* .
 tar xvfj omniORB-4.1.6.tar.bz2 
 tar xvfj omniORBpy-3.6.tar.bz2 
 mkdir omniORB_install
 cd omniORB-4.1.6/
 mkdir build
 cd build
 ../configure --prefix=/home/brian/coding/python/virtualenvs/omniORB/omniORB_install/ PYTHON=/home/brian/coding/python/virtualenvs/omniORB/bin/python 
 make
 make install
 cd ../../omniORBpy-3.6/
 mkdir build
 cd build
 ../configure --prefix=/home/brian/coding/python/virtualenvs/omniORB/omniORB_install/ PYTHON=/home/brian/coding/python/virtualenvs/omniORB/bin/python --with-omniorb=/home/brian/coding/python/virtualenvs/omniORB/omniORB_install/
 make
 make install

Now here is that omniorb.pth file I mentioned earlier. Change directory to the top of your virtualenv. Create omniorb.pth such that it looks and is located like this:

$ cat lib/python2.6/site-packages/omniorb.pth 
/home/brian/coding/python/virtualenvs/omniORB/omniORB_install/lib/python2.6/site-packages

Now, inside my activated virtualenv:

$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import CORBA
>>> CORBA.__file__
'/home/brian/coding/python/virtualenvs/omniORB/omniORB_install/lib/python2.6/site-packages/omniORB/CORBA.pyc'
>>>
4
  • This works like a charm. Unless something spectacular happens, I will accept this answer soon.
    – mirk
    Mar 27, 2012 at 7:52
  • I have just tried this and it worked for me but only when I am in lib dir with e.g. in your example it would be /home/brian/coding/python/virtualenvs/omniORB/omniORB_install/. In other directories in your example I get: ... import _omnipy ImportError: libomniORB4.so.2: cannot open shared object file: No such file or directory. So I needed to add some hacks in activate script to change (and restore) LD_LIBRARY_PATH.
    – Patryk
    Dec 8, 2015 at 19:13
  • @Patryk if it only works when you are in the lib directory it sounds like your virtualenv isn't active and it is finding the files it needs in the current directory.
    – Brian Neal
    Dec 8, 2015 at 20:41
  • @BrianNeal It is active when I try to python -c "import CORBA"
    – Patryk
    Dec 8, 2015 at 21:54

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.