Re: [Pythonocc-users] Compatibility OCE & PythonOCC
Hi, Thomas: Thanks! That info helps. Cheers, *Steven F. Zalek* Email:zalek.ste...@gmail.com Mobile: (734) 255-0404 Home:(734) 483-3952 On Thu, Apr 17, 2014 at 9:53 AM, Thomas Paviot wrote: > 2014-04-17 15:18 GMT+02:00 Steven Zalek : > >> Hi, Mark: >> >> I like your approach. I'd like to better understand its capabilities. I >> think it would work well for development, where a developer is trying to >> slowly port from one newly-improved library: e.g. OCE-0.1x to OCE-0.1y, etc. >> >> Would this approach eliminate the need for the extra *.hxx files that are >> currently in the OCE-0.14 SWIG/darwin folder? I think these *.hxx files >> were placed there in order to ensure that the right OCE version was >> referenced. >> >> >> Those .hxx are actually used only to generate the swig .i files. Whey > it's done, they can be safley removed. I surely forgot to remove them > before pushing files to the repository. > > Thomas > > > ___ > 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
Re: [Pythonocc-users] Compatibility OCE & PythonOCC
2014-04-17 15:18 GMT+02:00 Steven Zalek : > Hi, Mark: > > I like your approach. I'd like to better understand its capabilities. I > think it would work well for development, where a developer is trying to > slowly port from one newly-improved library: e.g. OCE-0.1x to OCE-0.1y, etc. > > Would this approach eliminate the need for the extra *.hxx files that are > currently in the OCE-0.14 SWIG/darwin folder? I think these *.hxx files > were placed there in order to ensure that the right OCE version was > referenced. > > > Those .hxx are actually used only to generate the swig .i files. Whey it's done, they can be safley removed. I surely forgot to remove them before pushing files to the repository. Thomas ___ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users
Re: [Pythonocc-users] Compatibility OCE & PythonOCC
Hi, Mark: I like your approach. I'd like to better understand its capabilities. I think it would work well for development, where a developer is trying to slowly port from one newly-improved library: e.g. OCE-0.1x to OCE-0.1y, etc. Would this approach eliminate the need for the extra *.hxx files that are currently in the OCE-0.14 SWIG/darwin folder? I think these *.hxx files were placed there in order to ensure that the right OCE version was referenced. *Steven F. Zalek* Email:zalek.ste...@gmail.com Mobile: (734) 255-0404 Home:(734) 483-3952 On Thu, Apr 17, 2014 at 8:20 AM, Marc Weber wrote: > [simpler way] glad to hear it. >> > If I succeed with your version combination (OCE 0.14 and > > I could show you how I made nixos compile master and with oce-0.12 > > It basically is a set of "versions which should work" and a function (not > posted) turning this into build recipes. > > set_git = rec { # by gmane mail tpaviot says this should work .. > # fails: geom: > BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx > is missing > occ = pkgs.opencascadeCommunityFork.override { version = "0.12"; > }; > pythonocc_extra = [ cmake_stuff { > patchPhase = '' > sed -i "s@os.environ\['CSF_GraphicShr'\] = > util.find_library('TKOpenGl')@os.environ['CSF_GraphicShr'] = > '${occ}/lib/libTKOpenGl.so'@" src/addons/Display/OCCViewer.py > ''; > } ]; > pythonocc = pythonocc_git; > geom = geomFun { inherit pythonocc occ; }; > smesh = smeshFun { inherit pythonocc occ; }; > extraIncludes = "-I${smesh}/include/smesh -I${geom}/include/geom"; > }; > > > Trying to compile pythonocc-master with OCE 0.14 (without knowing which > benefits this will have). > > Then choosing the OCC version can be done by setting env vars (such as > PYTHONPATH). > > If you're interested I can show you > > Marc Weber > > > ___ > 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
Re: [Pythonocc-users] Compatibility OCE & PythonOCC
[simpler way] glad to hear it. If I succeed with your version combination (OCE 0.14 and I could show you how I made nixos compile master and with oce-0.12 It basically is a set of "versions which should work" and a function (not posted) turning this into build recipes. set_git = rec { # by gmane mail tpaviot says this should work .. # fails: geom: BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx is missing occ = pkgs.opencascadeCommunityFork.override { version = "0.12"; }; pythonocc_extra = [ cmake_stuff { patchPhase = '' sed -i "s@os.environ\['CSF_GraphicShr'\] = util.find_library('TKOpenGl')@os.environ['CSF_GraphicShr'] = '${occ}/lib/libTKOpenGl.so'@" src/addons/Display/OCCViewer.py ''; } ]; pythonocc = pythonocc_git; geom = geomFun { inherit pythonocc occ; }; smesh = smeshFun { inherit pythonocc occ; }; extraIncludes = "-I${smesh}/include/smesh -I${geom}/include/geom"; }; Trying to compile pythonocc-master with OCE 0.14 (without knowing which benefits this will have). Then choosing the OCC version can be done by setting env vars (such as PYTHONPATH). If you're interested I can show you Marc Weber ___ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users
Re: [Pythonocc-users] Compatibility OCE & PythonOCC
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 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 : > >> >> 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 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
Re: [Pythonocc-users] Compatibility OCE & PythonOCC
Success - finally With this patch [1] I was able to install https://github.com/tpaviot/oce/archive/OCE-0.12.tar.gz. I've also seen that later versions this issue was fixed (they build without problems). smesh, geom, pythonocc compiled, and with some little hackery (TKOpenGL) due to nixos being different I can run both qt_demo.py and wx_demo.py :) Thanks so much for giving the hint about which versions to use. I'll contribute a build recipe for nixos linux soon (after tidying up). [1] diff --git a/inc/OpenGl_glext.h b/inc/OpenGl_glext.h index d1fb445..56258b7 100644 --- a/inc/OpenGl_glext.h +++ b/inc/OpenGl_glext.h @@ -5563,7 +5563,7 @@ typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severit typedef GLintptr GLvdpauSurfaceNV; #endif -#ifndef GL_VERSION_1_2 +// #ifndef GL_VERSION_1_2 #define GL_VERSION_1_2 1 #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); @@ -5579,7 +5579,7 @@ typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif +// #endif #ifndef GL_VERSION_1_2_DEPRECATED #define GL_VERSION_1_2_DEPRECATED 1 ___ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users
Re: [Pythonocc-users] Compatibility OCE & PythonOCC
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 : > > 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 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
Re: [Pythonocc-users] Compatibility OCE & PythonOCC
Thank you Le 11 avr. 2014 à 15:07, Thomas Paviot a écrit : > Hi, > > Current pythonocc master compiles with oce-0.12. > > tp/oc-0.14 is an attempt to port pythonocc to oce-0.14 > > Thomas > > 2014-04-11 12:17 GMT+02:00 Pierre Benjamin : > Hello, > > With the last version of pythonOCC, what is the right version of OCE? > With the last version of OCE, I can’t compile due to a problem of missing > header file. > > Thanks > Pierre > ___ > 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
Re: [Pythonocc-users] Compatibility OCE & PythonOCC
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 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
Re: [Pythonocc-users] Compatibility OCE & PythonOCC
Hi, Current pythonocc master compiles with oce-0.12. tp/oc-0.14 is an attempt to port pythonocc to oce-0.14 Thomas 2014-04-11 12:17 GMT+02:00 Pierre Benjamin : > Hello, > > With the last version of pythonOCC, what is the right version of OCE? > With the last version of OCE, I can't compile due to a problem of missing > header file. > > Thanks > Pierre > ___ > 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
Re: [Pythonocc-users] Compatibility OCE & PythonOCC
With the last version of pythonOCC, what is the right version of OCE? With the last version of OCE, I can’t compile due to a problem of I totally agree that documenting the versions which are known "to work" would be incredible useful. Can I help doing so? It took me quite a while, but was able to compile pythonocc-0.5 this way: mkdir -p build/swig_output_linux2_py27 ln -sf `pwd`/wrapper/SWIG ../1 python setup.py \ --with-occ-lib=${occ}/lib \ --with-occ-include=${occ}/include \ --with-geom-lib=${geom}/lib \ --with-smesh-lib=${smesh}/lib \ install --prefix="$out" install using these versions: src = fetchurl { url = http://pythonocc.googlecode.com/files/pythonocc-0.5.tar.gz; sha256 = "1z3grc7m3js5h27z7g4l56xdn71vj7w27ci4vwby6jsg9rlh93ka"; }; src = fetchurl { url = http://files.opencascade.com/OCC_6.3_release/OpenCASCADE_src.tgz; md5 = "52778127974cb3141c2827f9d40d1f11"; }; However eventually the 0.12 version of the community work might work as well. I forgot about where I read about it. smesh and geom are compiled and installed to their own target directories. Now I have this list of files in the output directory: http://mawercer.de/tmp/pythonocc-files-first-compilation-success.txt and I fail importing anything. Also adding a top-level __ini__.py file with these contents: OCC/__init__.py: __all__ = [ 'GEOMImpl' ] and creating such a symlink: ln -s `pwd`/_GEOMImpl.so GEOMImpl.so still makes me fail at: ImportError: /nix/store/hndmb0dd82i6a35fnkbk7q4mh81m22r3-opencascade-6.3.0/lib/libTKService.so.0: undefined symbol: XConfigureWindow XConfigureWindow is contained in libX11 This might be due to nixos linux distribution. I haven't had time to test setting rpath The problems seems to be that eg Ubuntu ships with opencascade 6.5 now not with 6.3. questions: 1) Is anybody able to confirm that the versions I'm using are the recommended ones? 2) Is anybody who has this working able to just run find in the pythonocc installation directory so that I can compare the file list? I've tried quite a lot of combinations of versions - and almost always failed due to some details. Thus some documentation about which versions are known to work would be highly appreciated. I've found another comment that tpaviot has not much time at the moment (and he didn't reply to a mail to his github email address asking about which versions to use) Is anybody willing to give enough "support" (even if payed) so that I get this up and running faster? All I want is creating some small models, and the last time I tried using cascade it looked very time consuming which is why I love that python wrappers were written. Thanks Marc Weber ___ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users