Arthur Magill a écrit :
> Hi Thomas,
>
> Congratulation! V138 compiles here without incident (using setup.py).

Perfect! At last!

>
> I've started looking at setup.py. For a quick portability change, 
> would it make sense to change
>
>   OCC_INC = '/usr/local/occ63/inc'
>   OCC_LIB = '/usr/local/occ63/lib'
>
> to
>
>   OCC_INC = OCC_ROOT + '/inc'
>   OCC_LIB = OCC_ROOT + '/lib'

To be as portable as possible, it's better to use the os.path.join method:
OCC_INC = os.path.join(OCC_ROOT,'inc')
OCC_LIB = os.path.join(OCC_ROOT,'lib')

>
> in environment.py? I think that should work on all Linux installations.

As far as I know, according to the OpenCascade package you choose to 
install (whether it is under Ubuntu or OpenSuse), /inc and /lib 
directories are not always located in the same folder.

>
> I've also been looking at this section in setup.py:
>
> #
> # OCC header file TopOpeBRepDS_tools.hxx maybe missing, causing a 
> gccxml error.
> #
> if not os.path.isfile(os.path.join(OCC_INC,'TopOpeBRepDS_tools.hxx')):
>     try:
>         f = open(os.path.join(OCC_INC,'TopOpeBRepDS_tools.hxx'),'w')
>         f.close()
>         print "TopOpeBRepDS_tools.hxx created in %s"%OCC_INC
>     except:
>         print "You don't have write acces to %s directory. Please use 
> 'sudo python setup.py build'."%OCC_INC
>         sys.exit(0)
>
> As this is the only section requiring root access as part of the 
> build, I'd like to find a way around it. What's happening here? Why 
> does SWIG need to find TopOpeBRepDS_tools.hxx? The only reference to 
> this header I could find in occ is in TopOpeBRep_tools.hxx.

Here is the answer: SWIG_generator.py uses GCCXML to parse OpenCascade 
headers and check all classes/methods to wrap. GCCXML performs a 
*recursive* parse of all headers. When processing the TopOpeBRep_* 
headers, I noticed that GCCXML didn't find the file 
TopOpeBRepDS_tools.hxx and the process fails. The 
'TopOpeBRepDS_tools.hxx' is simply missing from the /inc OCC directory. 
I think it's a bug of OpenCascade but I didn't send any feedback to the 
Opencascade team. I just 'added' an empty TopOpeBRepDS_tools.hxx to the 
/inc directory so that GCCXML parsing is ok (note that SWIG does not 
need this file).

The problem is that it requires, on Linux, root privileges since it 
modifies a directory that may have read only access for common user. 
It's a thing I didn't think about when hacking on Windows. Another 
soultion (Linux compliant) would be to:
- create the missing header TopOpeBRepDS_tools.hxx in the 
SWIG_modular_linux_darwin directory
- add this directory to the list of include paths so that g++ find the 
header.
We could then remove all that weird lines from setup.py

>
> As a quick and dirty workaround, I guess we could change the print 
> statement to instruct the user:
>
> if not os.path.isfile(os.path.join(OCC_INC,'TopOpeBRepDS_tools.hxx')):
>   print "OCC header file missing (TopOpeBRepDS_tools.hxx)."
>   print "Please type 'sudo touch %s/inc/TopOpeBRepDS_tools.hxx' and 
> then restart the build"%OCC_ROOT
>   sys.exit(0)
>
> It requires a bit more effort from the user (well, a copy and paste), 
> but it means building without root privilege, which is the Unix custom.
>
> What do you think?

I think that you pointed out the bad way I used to solve this issue!

>
>     Arthur

Cheers,

Thomas
>
>
>
> Thomas Paviot wrote:
>> Hello all,
>>
>> I just added many more (40) OCC modules to pythonOCC for Linux/Darw 
>> platforms. These are mostly related to IGES and STEP data handle.
>>
>> Both Windows and Linux built of pythonOCC covers now 85% of the 
>> OpenCascade API. The 15% left are, to me, unusefull modules (at least 
>> in a first step), and I consider I'm done with pythonOCC scope. I 
>> will now focus on the scons build script in order to make all that 
>> stuff really platform independant.
>>
>> If some Windows users want to test the current state of pythonOCC, 
>> you can find a pre-build binary for python25 at: 
>> http://www.pythonocc.org/Releases/daily
>>
>> Best Regards,
>>
>> 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

Reply via email to