Closed skoudoro closed 5 months ago
@jmarcio and @edecenciere
I think it was I who wrote that piece of code but after a quick search, I don't think it's used anymore anywhere else in the code. If I recall what was my goal, I planned on optimizing SIMD and multithreading based on CPU architecture, but OpenMP does a better job when left alone. Maybe this piece of code should be disabled or moved to Addons. It seems hard to maintain anyway.
Maybe this piece of code should be disabled or moved to Addons. It seems hard to maintain anyway.
make sense, I will try to remove and restart the compilation. Thanks @chabardt !
Thanks Théo. I never knew the purpose of this code.
Sometime ago I took a look into this code and it seemed to me that it's useless, but some definitions are used at many places and I didn't change anything.
As you said, OpenMP does a good job and they update their code as new CPU models arrive. So, don't need to maintain.
And the better is that OpenMP may take care of SIMD since release around 3.6 or 4.0, if my memory doesn't fail.
I think just removing these files won't work. But I don't have time now : I'm on holidays.
On 5/8/24 23:40, Théodore Chabardès wrote:
I think it was I who wrote that piece of code but after a quick search, I don't think it's used anymore anywhere else in the code. If I recall what was my goal, I planned on optimizing SIMD and multithreading based on CPU architecture, but OpenMP does a better job when left alone. Maybe this piece of code should be disabled or moved to Addons. It seems hard to maintain anyway.
— Reply to this email directly, view it on GitHub https://github.com/MinesParis-MorphoMath/smil/issues/1#issuecomment-2101526657, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQE4AGKAPSASQK6AXN66Q3ZBKLVRAVCNFSM6AAAAABHNS4MIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBRGUZDMNRVG4. You are receiving this because you were mentioned.Message ID: @.***>
--
Openmp 4.0 does handle SIMD but uou have to use a specific macro: #pragma omp simd We had solely relied on the compiler optimization.
Hello Serge,
Please try the branch feature/cpuid and tell me.
https://github.com/MinesParis-MorphoMath/smil/tree/feature/cpuid
If it works I'll do some clean-up and merge it into the mainstream.
Regards
On 5/9/24 00:04, Serge Koudoro wrote:
Maybe this piece of code should be disabled or moved to Addons. It seems hard to maintain anyway.
make sense, I will try to remove and restart the compilation. Thanks @chabardt https://github.com/chabardt !
— Reply to this email directly, view it on GitHub https://github.com/MinesParis-MorphoMath/smil/issues/1#issuecomment-2101579287, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQE4ADYIPIBP73GAZPLHI3ZBKOO5AVCNFSM6AAAAABHNS4MIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBRGU3TSMRYG4. You are receiving this because you were mentioned.Message ID: @.***>
--
Hi @jmarcio,
Thank you for working on this.
After switching to this branch, I confirm that the compilation go further. So it seems to work but I encounter a new issue that you can see below.
Not sure yet what is this issue. Maybe the code generated by swig is strange. is there a maximal version to respect for swig ? I use swig 4.2.1. I can downgrade if necessary.
Thank you for the feedback
Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111892:10: error: use of undeclared identifier 'T'
111892 | Image< T > *arg2 = 0 ;
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111912:35: error: use of undeclared identifier 'T'
111912 | arg2 = reinterpret_cast< Image< T > * >(argp2);
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111915:29: error: use of undeclared identifier 'T'
111915 | (arg1)->clone((Image< T > const &)*arg2);
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111935:10: error: use of undeclared identifier 'T'
111935 | Image< T > result;
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111956:46: error: use of undeclared identifier 'T'
111956 | resultobj = SWIG_NewPointerObj((new Image< T >(result)), SWIGTYPE_p_smil__Image, SWIG_POINTER_OWN | 0 );
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111968:10: error: use of undeclared identifier 'T'
111968 | Image< T > result;
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111984:46: error: use of undeclared identifier 'T'
111984 | resultobj = SWIG_NewPointerObj((new Image< T >(result)), SWIGTYPE_p_smil__Image, SWIG_POINTER_OWN | 0 );
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112658:10: error: use of undeclared identifier 'T'
112658 | Image< T > *arg2 = 0 ;
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112678:35: error: use of undeclared identifier 'T'
112678 | arg2 = reinterpret_cast< Image< T > * >(argp2);
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112681:29: error: use of undeclared identifier 'T'
112681 | (arg1)->clone((Image< T > const &)*arg2);
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112701:10: error: use of undeclared identifier 'T'
112701 | Image< T > result;
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112722:46: error: use of undeclared identifier 'T'
112722 | resultobj = SWIG_NewPointerObj((new Image< T >(result)), SWIGTYPE_p_smil__Image, SWIG_POINTER_OWN | 0 );
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112734:10: error: use of undeclared identifier 'T'
112734 | Image< T > result;
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112750:46: error: use of undeclared identifier 'T'
112750 | resultobj = SWIG_NewPointerObj((new Image< T >(result)), SWIGTYPE_p_smil__Image, SWIG_POINTER_OWN | 0 );
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:113424:10: error: use of undeclared identifier 'T'
113424 | Image< T > *arg2 = 0 ;
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:113444:35: error: use of undeclared identifier 'T'
113444 | arg2 = reinterpret_cast< Image< T > * >(argp2);
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:113447:29: error: use of undeclared identifier 'T'
113447 | (arg1)->clone((Image< T > const &)*arg2);
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:113467:10: error: use of undeclared identifier 'T'
113467 | Image< T > result;
| ^
/Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:113488:46: error: use of undeclared identifier 'T'
113488 | resultobj = SWIG_NewPointerObj((new Image< T >(result)), SWIGTYPE_p_smil__Image, SWIG_POINTER_OWN | 0 );
Hi,
I'm using cmake 4.0.2 here.
It seems that is the
Please open the file /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx and tell me at which function is the problem.
Is it SWIGINTERN PyObject _wrap_Image_RGB_neg(PyObject SWIGUNUSEDPARM(self), PyObject *args) ?
Had you enabled RGB type images and the Color plugin ? If not, enable them and try again.
On 5/13/24 17:52, Serge Koudoro wrote:
Hi @jmarcio https://github.com/jmarcio,
Thank you for working on this.
After switching to this branch, I confirm that the compilation go further. So it seems to work but I encounter a new issue that you can see below.
Not sure yet what is this issue. Maybe the code generated by swig is strange. is there a maximal version to respect for swig ? I use swig 4.2.1. I can downgrade if necessary.
Thank you for the feedback
Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111892:10: error:use of undeclared identifier 'T' 111892 |Image< T > arg2 = 0 ; | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111912:35: error:use of undeclared identifier 'T' 111912 |arg2 = reinterpret_cast< Image< T > >(argp2); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111915:29: error:use of undeclared identifier 'T' 111915 | (arg1)->clone((Image< T > const &)arg2); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111935:10: error:use of undeclared identifier 'T' 111935 |Image< T > result; | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111956:46: error:use of undeclared identifier 'T' 111956 |resultobj = SWIG_NewPointerObj((new Image< T >(result)),SWIGTYPE_p_smil__Image,SWIG_POINTER_OWN |0 ); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111968:10: error:use of undeclared identifier 'T' 111968 |Image< T > result; | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111984:46: error:use of undeclared identifier 'T' 111984 |resultobj = SWIG_NewPointerObj((new Image< T >(result)),SWIGTYPE_p_smil__Image,SWIG_POINTER_OWN |0 ); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112658:10: error:use of undeclared identifier 'T' 112658 |Image< T > arg2 = 0 ; | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112678:35: error:use of undeclared identifier 'T' 112678 |arg2 = reinterpret_cast< Image< T > >(argp2); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112681:29: error:use of undeclared identifier 'T' 112681 | (arg1)->clone((Image< T > const &)arg2); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112701:10: error:use of undeclared identifier 'T' 112701 |Image< T > result; | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112722:46: error:use of undeclared identifier 'T' 112722 |resultobj = SWIG_NewPointerObj((new Image< T >(result)),SWIGTYPE_p_smilImage,SWIG_POINTER_OWN |0 ); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112734:10: error:use of undeclared identifier 'T' 112734 |Image< T > result; | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112750:46: error:use of undeclared identifier 'T' 112750 |resultobj = SWIG_NewPointerObj((new Image< T >(result)),SWIGTYPE_p_smil__Image,SWIG_POINTER_OWN |0 ); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:113424:10: error:use of undeclared identifier 'T' 113424 |Image< T > arg2 = 0 ; | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:113444:35: error:use of undeclared identifier 'T' 113444 |arg2 = reinterpret_cast< Image< T > >(argp2); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:113447:29: error:use of undeclared identifier 'T' 113447 | (arg1)->clone((Image< T > const &)*arg2); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:113467:10: error:use of undeclared identifier 'T' 113467 |Image< T > result; | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:113488:46: error:use of undeclared identifier 'T' 113488 |resultobj = SWIG_NewPointerObj((new Image< T >(result)),SWIGTYPE_p_smilImage,SWIG_POINTER_OWN |0 );
— Reply to this email directly, view it on GitHub https://github.com/MinesParis-MorphoMath/smil/issues/1#issuecomment-2108080442, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQE4AFEHWXJKYONIC3Q5MDZCDOVNAVCNFSM6AAAAABHNS4MIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBYGA4DANBUGI. You are receiving this because you were mentioned.Message ID: @.***>
--
Well...
I tried to use a newer release of swig, 4.2.1 and I got the same errors than you.
Please try to downgrade to 4.0.2 or older.
On 5/13/24 17:52, Serge Koudoro wrote:
Hi @jmarcio https://github.com/jmarcio,
Thank you for working on this.
After switching to this branch, I confirm that the compilation go further. So it seems to work but I encounter a new issue that you can see below.
Not sure yet what is this issue. Maybe the code generated by swig is strange. is there a maximal version to respect for swig ? I use swig 4.2.1. I can downgrade if necessary.
Thank you for the feedback
Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111892:10: error:use of undeclared identifier 'T' 111892 |Image< T > arg2 = 0 ; | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111912:35: error:use of undeclared identifier 'T' 111912 |arg2 = reinterpret_cast< Image< T > >(argp2); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111915:29: error:use of undeclared identifier 'T' 111915 | (arg1)->clone((Image< T > const &)arg2); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111935:10: error:use of undeclared identifier 'T' 111935 |Image< T > result; | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111956:46: error:use of undeclared identifier 'T' 111956 |resultobj = SWIG_NewPointerObj((new Image< T >(result)),SWIGTYPE_p_smil__Image,SWIG_POINTER_OWN |0 ); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111968:10: error:use of undeclared identifier 'T' 111968 |Image< T > result; | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:111984:46: error:use of undeclared identifier 'T' 111984 |resultobj = SWIG_NewPointerObj((new Image< T >(result)),SWIGTYPE_p_smil__Image,SWIG_POINTER_OWN |0 ); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112658:10: error:use of undeclared identifier 'T' 112658 |Image< T > arg2 = 0 ; | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112678:35: error:use of undeclared identifier 'T' 112678 |arg2 = reinterpret_cast< Image< T > >(argp2); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112681:29: error:use of undeclared identifier 'T' 112681 | (arg1)->clone((Image< T > const &)arg2); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112701:10: error:use of undeclared identifier 'T' 112701 |Image< T > result; | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112722:46: error:use of undeclared identifier 'T' 112722 |resultobj = SWIG_NewPointerObj((new Image< T >(result)),SWIGTYPE_p_smilImage,SWIG_POINTER_OWN |0 ); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112734:10: error:use of undeclared identifier 'T' 112734 |Image< T > result; | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:112750:46: error:use of undeclared identifier 'T' 112750 |resultobj = SWIG_NewPointerObj((new Image< T >(result)),SWIGTYPE_p_smil__Image,SWIG_POINTER_OWN |0 ); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:113424:10: error:use of undeclared identifier 'T' 113424 |Image< T > arg2 = 0 ; | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:113444:35: error:use of undeclared identifier 'T' 113444 |arg2 = reinterpret_cast< Image< T > >(argp2); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:113447:29: error:use of undeclared identifier 'T' 113447 | (arg1)->clone((Image< T > const &)*arg2); | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:113467:10: error:use of undeclared identifier 'T' 113467 |Image< T > result; | ^ /Users/skoudoro/devel/smil/build/lib/smilPython/smilCorePYTHON_wrap.cxx:113488:46: error:use of undeclared identifier 'T' 113488 |resultobj = SWIG_NewPointerObj((new Image< T >(result)),SWIGTYPE_p_smilImage,SWIG_POINTER_OWN |0 );
— Reply to this email directly, view it on GitHub https://github.com/MinesParis-MorphoMath/smil/issues/1#issuecomment-2108080442, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQE4AFEHWXJKYONIC3Q5MDZCDOVNAVCNFSM6AAAAABHNS4MIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBYGA4DANBUGI. You are receiving this because you were mentioned.Message ID: @.***>
--
Great! thank you ! I have downgraded swig.
Getting closer in the compilation (84%) but I still have some issues. Can you merge your branch with the dcpuid
fix into master ?
Then, when I find time, I will try to fix the new errors :
In file included from /Users/skoudoro/devel/smil/build/lib/smilPython/smilPathOpeningPYTHON_wrap.cxx:3297:
In file included from /Users/skoudoro/devel/smil/Addons/PathOpening/include/DPathOpening.h:19:
In file included from /Users/skoudoro/devel/smil/Addons/PathOpening/include/DFastAreaOpening.h:200:
/Users/skoudoro/devel/smil/Addons/PathOpening/include/FastAreaOpening/AreaOpeningPixelQueue.hpp:149:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
149 | register int i, j, curneigh, pixel, px, gval, curlab = 1;
/Users/skoudoro/devel/smil/Addons/Dendrogram/include/private/Dendrogram.hpp:1588:17: error: no matching function for call to 'pow'
1588 | pow(1 - (childLeftVol + childRightVol) / totalVolume, nParam);
I am trying this on macbook pro ARM1 with clang version 14.0.0. and python 3.9.
Thanks again for the help
Hi,
Nice !!! Happy to hear about it.
But these Addons are just some code migrated from Morph-M. Not tested and not sure they work. Dendogram surely not. And the other... Keyword "register" doesn't exist anymore...
Just disable them. They will be removed in the next official release. And some other too...
Also, if you're using an architecture we don't have... Does /proc/cpuinfo exists in your machine ? What is the content type ?
Thanks
José-Marcio
On 5/13/24 19:54, Serge Koudoro wrote:
Great! thank you ! I have downgraded swig.
Getting closer in the compilation (84%) but I still have some issues. Can you merge your branch with the |dcpuid| fix into master ?
Then, when I find time, I will try to fix the new errors :
In file included from /Users/skoudoro/devel/smil/build/lib/smilPython/smilPathOpeningPYTHON_wrap.cxx:3297: In file included from /Users/skoudoro/devel/smil/Addons/PathOpening/include/DPathOpening.h:19: In file included from /Users/skoudoro/devel/smil/Addons/PathOpening/include/DFastAreaOpening.h:200: /Users/skoudoro/devel/smil/Addons/PathOpening/include/FastAreaOpening/AreaOpeningPixelQueue.hpp:149:5:error:ISO C++17 does not allow 'register' storage class specifier [-Wregister] 149 |register int i,j,curneigh,pixel,px,gval,curlab = 1;
/Users/skoudoro/devel/smil/Addons/Dendrogram/include/private/Dendrogram.hpp:1588:17: error:no matching function for call to 'pow' 1588 |pow(1 - (childLeftVol + childRightVol) /totalVolume,nParam);
I am trying this on macbook pro ARM1 with clang version 14.0.0. and python 3.9.
Thanks again for the help
— Reply to this email directly, view it on GitHub https://github.com/MinesParis-MorphoMath/smil/issues/1#issuecomment-2108438104, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQE4ADKJBSCPIGNB5H6U2LZCD44PAVCNFSM6AAAAABHNS4MIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBYGQZTQMJQGQ. You are receiving this because you were mentioned.Message ID: @.***>
--
ok, Thanks for info.
For now, closing this issue since this is a compilation and installation success.
Still need to figure out why I get a segfault when I try to import smilPython
but it is not related to this issue.
❯ python
Python 3.9.18 | packaged by conda-forge | (main, Aug 30 2023, 03:53:08)
[Clang 15.0.7 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>> import smilPython as sp
[1] 76320 segmentation fault python
Hi,
Is there a way to compile smil on macOS ?
I encounter the following error:
which kind of make sense. Thank you for the feedback