I have recently worked through how to install multiple versions of OCE and PythonOCC on a linux (Ubuntu; Xubuntu-13.10_x64) computer. It requires a little more work (but not much) than a Mac OSX machine due to the way linux resolves the shared library search path. The Mac OSX handles this is a 'smarter' way.
I successfully built and installed OCE-0.12 and OCE-0.14 to /opt/oce-0.12/ and /opt/oce-0.14, respectively. I built pythonocc-0.6-rc1 against the OCE-0.12 libraries. The CMake configuration utility allowed me to put in all the necessary details (library locations, etc.) and pythonocc built and installed just fine. I installed pythonocc to /usr/lib/python2.7/dist-packages/OCC-0.6-rc1. I do create a OCC.pth file and place it in this directory; its only text is 'OCC' (no quotes). When I want to use the 0.6-rc1 version of pythonocc, I copy that folder to /usr/lib/python2.7/dist-packages/OCC, just as Thomas suggested. If I want to use a different version of pythonocc, I clear out the existing .../OCC folder and copy the desired one to .../OCC. Now for the extra step for linux users: even though pythonocc-0.6-rc1 built successfully against the /opt/oce-0.12 library location, it still needs help finding those libraries at run-time. The issue showed-up in the OCCViewer.py file, line 44: os.environ['CSF_GraphicShr'] = util.find_library('TKOpenGl'). Python ignore's LD_LIBRARY_PATH, so util.find_library('TKOpenGl') returns a 'None' since the OCE libraries aren't in the standard /usr/lib, or /usr/local/lib locations. I had to add a path configuration file to the /etc/ld.so.conf.d/ folder, and then run ldconfig with admin privileges. My file is simply called 'oce.conf' with the following text: # OCE library support /opt/oce-0.12/lib Now when I want to use a different pythonocc that uses a different version of OCE, I will need to manually change the contents of that oce.conf file, and re-run ldconfig to the proper location of the libraries. There is probably a more sophisticated way to change this value 'on the fly', but I'm content with this method for now. If anyone has a better way I'd be glad to hear it. *Steven F. Zalek* Email: zalek.ste...@gmail.com Mobile: (734) 255-0404 Home: (734) 483-3952 On Fri, Apr 11, 2014 at 9:46 AM, Thomas Paviot <tpav...@gmail.com> wrote: > I never install oce to the default location (/usr/local) because it > replaces the current one. I use to compile/install OCE to > /Library/OCE/0.12, /Library/OCE/0.14, /Library/OCE/0.15 etc. > > Then I compile/install pythonocc. In order to switch between pythonocc > versions, I just rename the one I want to use (for instance > /Library/Python/2.7/site-packages/OCC-oce0.12) to > /Library/Python/2.7/site-packages/OCC. > > Thomas > > 2014-04-11 15:35 GMT+02:00 jelle feringa <jelleferi...@gmail.com>: > >> >> Thomas, >> >> Do you have some hints on running 2 version of the OCE libs ( 0.12 / 0.14 >> ) in "parallel"? >> Is it possible to switch between version, or do you simply have 2 sources >> of OCE compiled, which you re-install before hacking ( on 0.14 in this >> case )? >> >> I'm curious if you have some tips... >> >> -jelle >> >> >> >> On Fri, Apr 11, 2014 at 3:07 PM, Thomas Paviot <tpav...@gmail.com> wrote: >> >>> Current pythonocc master compiles with oce-0.12. >>> >>> tp/oc-0.14 is an attempt to port pythonocc to oce-0.14 >>> >> >> >> >> _______________________________________________ >> Pythonocc-users mailing list >> Pythonocc-users@gna.org >> https://mail.gna.org/listinfo/pythonocc-users >> >> > > _______________________________________________ > Pythonocc-users mailing list > Pythonocc-users@gna.org > https://mail.gna.org/listinfo/pythonocc-users > >
_______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users