Hi, I'm new to PythonOcc, and found it very promising. Thanks for the work. However it took me more than 3 days to make it compile and I'm not finished yet. Still I would like to share my experience to make it smoother for new users and also for myself to get useful info. You may think I am did a lot of crap so that it takes me 3 days!!! Well this the story: I took support on the wiki page: http://www.pythonocc.org/wiki/index.php/Installing_pythonOCC_on_Linux and checked out the http://svn.gna.org/svn/pythonocc/tags/0.3 revision of pythonOcc.
- As explained, I had to install OCC (1 day of hard struggle until I found the pythonOcc wiki page http://www.pythonocc.org/wiki/index.php/Installing_OpenCASCADE_on_Linux!<http://www.pythonocc.org/wiki/index.php/Installing_OpenCASCADE_on_Linux%21> !) - Then a first missing (or not very clear) info is that you need to have the Geom module of Salome installed in order for the compilation to work (otherwise you have to specify -NO_GEOM and you get less functionalities) - I thought that as only the GEOM module was required I would build it from source : Such a huge mistake!!! their building scripts are based on automake&co and need tons of environment variable to be specified so as for the 3rd party libs to be found!! Actually I didn't make it work, until I discovered that they had a hidden script allowing to use CMake. Afterwards everything was just pleasure. (this step took me almost 2 days. - Besides, another info was missing in the wiki : one have to set the env variable SALOME_GEOM_LIB to the path where to find the GEOM libraries. - That's not all, some of the Geom library names seems to have change (that's my own explanation for what follows) as I had to change in setup.py Sketcher by GEOMSketcher GEOMImpl by GEOMimpl (downcase the i) Archimede by GEOMArchimede - Also, the fact that some headers have been renamed SGEOM_yyy.hxx is a problem (i know it was done because of some windows conflicting behaviour) because some of the functionalities have become inline (declaration is in the header) in the last sources of Salome (5.1.2). So you get some undefined reference to XXX::YYY(). As a consequence I had to regenerate cpp wrap files (-generate_swig). And actually it's still running, I'm not sure it will succeed) - Finally, there is a small problem with the environment.py file : platform.machine() returns x86_64 which is invalid for g++ -march flag ( expects "x86-64 apparently). I've attached a file patch.txt, but it's rather a summary of the workaround I had to use than a real fix. Maybe some of these problems have been solved in the trunk, or are just due to a misunderstanding from me. In this case I hope some folks will correct the concerned points. And of course I wish I can make it compile finally!!! Cheers, Loïc
Index: src/wrapper/environment.py =================================================================== --- src/wrapper/environment.py (révision 649) +++ src/wrapper/environment.py (copie de travail) @@ -138,7 +138,7 @@ SWIG_OPTS = ['-python','-modern','-fcompact','-c++','-DHAVE_LIMITS_H','-DHAVE_CONFIG_H','-DCSFDB',\ '-w302,314,509,512','-DOCC_CONVERT_SIGNALS','-DLIN','-DLININTEL','-D_GNU_SOURCE=1',\ '-outdir','%s'%os.path.join(os.getcwd(),'OCC')] - ECA = ['-O0','-march=%s'%platform.machine()] + ECA = ['-O0','-march=%s'%'x86-64']#platform.machine()] lib_python = sysconfig.get_config_var('BLDLIBRARY').split(' ')[1] ELA = ['-Wl,--no-undefined','-lm','-lstdc++',lib_python] EXTRA_LIBS = ['m','stc++',lib_python] Index: src/setup.py =================================================================== --- src/setup.py (révision 649) +++ src/setup.py (copie de travail) @@ -195,9 +195,9 @@ # Salome Geom libs # if WRAP_SALOME_GEOM: - LIBS.extend(['Sketcher','ShHealOper','Partition','NMTTools',\ - 'NMTDS','GEOM','GEOMImpl', - 'GEOMAlgo','Archimede']) + LIBS.extend(['GEOMSketcher','ShHealOper','NMTTools',\ + 'NMTDS','GEOM','GEOMimpl', + 'GEOMAlgo','GEOMArchimede']) # # OpenCascade wrapper extensions # Index: README =================================================================== --- README (révision 649) +++ README (copie de travail) @@ -20,14 +20,15 @@ Step 1: extract the content of pythonOCC-0.3 -Step 2: +Step 2: +export SALOME_GEOM_LIB=/pathToSalomeGeomLibraries cd /pythonOCC/src python setup.py build -cmsvc (Windows) -sudo python setup.y build (Linux) +sudo python setup.py build (Linux) Step 3: python setup.py build install (Windows) -sudo setup.py build install (Linux) +sudo python setup.py build install (Linux) Step 4: check installation. From a python prompt, just enter 'from OCC import *'. You should not get any error. Index: src/wrapper/SWIG/linux_darwin/GEOMImpl_dependencies.i =================================================================== --- src/wrapper/SWIG/linux_darwin/GEOMImpl_dependencies.i (révision 649) +++ src/wrapper/SWIG/linux_darwin/GEOMImpl_dependencies.i (copie de travail) @@ -117,21 +117,21 @@ #include <Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeState.hxx> #include <Handle_GEOMAlgo_ListNodeOfListOfCoupleOfShapes.hxx> #include <Handle_GEOMAlgo_ListNodeOfListOfPnt.hxx> -#include <Handle_SGEOM_Application.hxx> -#include <Handle_SGEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx> -#include <SGEOM_Application.hxx> -#include <SGEOM_DataMapIteratorOfDataMapOfAsciiStringTransient.hxx> -#include <SGEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx> -#include <SGEOM_DataMapOfAsciiStringTransient.hxx> -#include <SGEOM_Engine.hxx> -#include <SGEOM_Function.hxx> -#include <SGEOM_IOperations.hxx> -#include <SGEOM_ISubShape.hxx> -#include <SGEOM_Object.hxx> +#include <Handle_GEOM_Application.hxx> +#include <Handle_GEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx> +#include <GEOM_Application.hxx> +#include <GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient.hxx> +#include <GEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx> +#include <GEOM_DataMapOfAsciiStringTransient.hxx> +#include <GEOM_Engine.hxx> +#include <GEOM_Function.hxx> +#include <GEOM_IOperations.hxx> +#include <GEOM_ISubShape.hxx> +#include <GEOM_Object.hxx> #include <SGEOM_Parameter.hxx> -#include <SGEOM_PythonDump.hxx> -#include <SGEOM_Solver.hxx> -#include <SGEOM_SubShapeDriver.hxx> +#include <GEOM_PythonDump.hxx> +#include <GEOM_Solver.hxx> +#include <GEOM_SubShapeDriver.hxx> #include <Handle_Standard_AbortiveTransaction.hxx> #include <Handle_Standard_ConstructionError.hxx> #include <Handle_Standard_DimensionError.hxx>
_______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users