From ana.diazcastro at alum.uca.es Sat May 1 11:43:54 2021 From: ana.diazcastro at alum.uca.es (AnaCastro) Date: Sat, 1 May 2021 02:43:54 -0700 (MST) Subject: [Scilab-users] Code optimization by avoiding Xcos recompilation and others Message-ID: <1619862234288-0.post@n3.nabble.com> Hi everyone! I'm an aerospace engineering student and my professors and I are working on a project to addapt a subject's assignments to Scilab, so that students have easier access to the software. Now we are trying to reproduce the actuation of an aircraft depending on some variables. This is my first time using this software so there are many things I ignore. And here is the question: How could I optimize this code? Currently it's way too slow and we need to make it a bit faster. I tried using /scicos_simulate()/ and saving the Xcos compilation information to a /list()/ called /Info /in order to avoid recompiling the diagram every time - since the code calls the Xcos diagram nine times and that takes a while - but I don't know if there is a better way or even if it worked properly. Also the values for /u_ini, w_ini/ and /pospalanca /change depending on the compilation. Is there a way to make this part run faster? Any help is greatly appreciated! Here's the code: // Scilab code loadXcosLibs(); loadScicos(); importXcosDiagram("Trabajo.zcos"); controltotal = 0; preci = 1 ; while controltotal == 0 controlV = 0; V1 = 1 ; V = V1 ; u_ini = V*cos(alfa); w_ini = V*sin(alfa); Context.Tf=0.1; Info = scicos_simulate(scs_m, list(), Context, 'nw'); Fuerzas=FuerzasStruct.values; Fz1 = Fuerzas(3); V2 = 340 ; V = V2 ; u_ini = V*cos(alfa); w_ini = V*sin(alfa); Context.Tf=0.1; scicos_simulate(scs_m, Info, Context, 'nw'); Fuerzas=FuerzasStruct.values; Fz2 = Fuerzas(3); while controlV == 0 peso1 = 1-abs(Fz1)/abs(Fz2-Fz1); peso2 = 1-abs(Fz2)/abs(Fz2-Fz1); V_med = sqrt(V1*V1*peso1 + V2*V2*peso2) ; V = V_med; u_ini = V*cos(alfa); w_ini = V*sin(alfa); Context.Tf=0.1; scicos_simulate(scs_m, Info, Context, 'nw'); Fuerzas=FuerzasStruct.values; Fz_med = Fuerzas(3); if abs(Fz_med) < preci controlV = 1; elseif Fz_med*Fz1<0 V2 = V_med; Fz2 = Fz_med; elseif Fz_med*Fz2<0 V1 = V_med; Fz1 = Fz_med; end end V = V_med ; controlpospalanca=0; pospalanca1 = 0 ; pospalanca = pospalanca1 ; Context.Tf=0.1; scicos_simulate(scs_m, Info, Context, 'nw'); Fuerzas=FuerzasStruct.values; Fx1 = Fuerzas(1); pospalanca2 = 1 ; pospalanca = pospalanca2 ; Context.Tf=0.1; scicos_simulate(scs_m, Info, Context, 'nw'); Fuerzas=FuerzasStruct.values; Fx2 = Fuerzas(1); while controlpospalanca == 0 peso1 = 1-abs(Fx1)/abs(Fx2-Fx1); peso2 = 1-abs(Fx2)/abs(Fx2-Fx1); pospalanca_med = (pospalanca1*peso1 + pospalanca2*peso2) ; pospalanca = pospalanca_med; Context.Tf=0.1; scicos_simulate(scs_m, Info, Context, 'nw'); Fuerzas=FuerzasStruct.values; Fx_med = Fuerzas(1); if abs(Fx_med) < preci controlpospalanca = 1; elseif Fx_med*Fx1<0 pospalanca2 = pospalanca_med; Fx2 = Fx_med; elseif Fx_med*Fx2<0 pospalanca1 = pospalanca_med; Fx1 = Fx_med; end end pospalanca = pospalanca_med ; controldelta=0; delta1 = -30*%pi/180 ; delta = delta1 ; Context.Tf=0.1; scicos_simulate(scs_m, Info, Context, 'nw'); Fuerzas=FuerzasStruct.values; My1 = Fuerzas(2); delta2 = 30*%pi/180 ; delta = delta2 ; Context.Tf=0.1; scicos_simulate(scs_m, Info, Context, 'nw'); Fuerzas=FuerzasStruct.values; My2 = Fuerzas(2); while controldelta == 0 peso1 = 1-abs(My1)/abs(My2-My1); peso2 = 1-abs(My2)/abs(My2-My1); delta_med = (delta1*peso1 + delta2*peso2) ; delta = delta_med; Context.Tf=0.1; scicos_simulate(scs_m, Info, Context, 'nw'); Fuerzas=FuerzasStruct.values; My_med = Fuerzas(2); if abs(My_med) < preci controldelta = 1; elseif(My_med*My1<0) delta2 = delta_med; My2 = My_med; elseif(My_med*My2<0) delta1 = delta_med; My1 = My_med; end end delta = delta_med ; Fuerzas=FuerzasStruct.values; if (abs(Fuerzas(1)) < preci) & (abs(Fuerzas(2)) < preci) & (abs(Fuerzas(3)) < preci) controltotal = 1; end end // while controltotal V pospalanca delta deltagrados = delta*180/%pi Thank you all so much for your help and time! -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From johan.lafitte at gmail.com Sat May 1 13:04:18 2021 From: johan.lafitte at gmail.com (johan64) Date: Sat, 1 May 2021 04:04:18 -0700 (MST) Subject: [Scilab-users] Code optimization by avoiding Xcos recompilation and others In-Reply-To: <1619862234288-0.post@n3.nabble.com> References: <1619862234288-0.post@n3.nabble.com> Message-ID: <1619867058051-0.post@n3.nabble.com> Hi, I meet similar difficulties, i 'm a beginner too. You can use tic() then toc() to know steps which waste simulation time. You can have a look at : http://mailinglists.scilab.org/Scilab-users-xcos-simulate-tp4041308p4041434.html -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From ana.diazcastro at alum.uca.es Sun May 2 13:15:11 2021 From: ana.diazcastro at alum.uca.es (AnaCastro) Date: Sun, 2 May 2021 04:15:11 -0700 (MST) Subject: [Scilab-users] Code optimization by avoiding Xcos recompilation and others In-Reply-To: <1619867058051-0.post@n3.nabble.com> References: <1619862234288-0.post@n3.nabble.com> <1619867058051-0.post@n3.nabble.com> Message-ID: <1619954111380-0.post@n3.nabble.com> Hi! I've been trying the methods you used for your simulations and the tic() toc() functions and it helped a lot. Now I understand all much better. Thank you so much. -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From fmiyara at fceia.unr.edu.ar Mon May 3 03:40:13 2021 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Sun, 2 May 2021 22:40:13 -0300 Subject: [Scilab-users] plot2d3() In-Reply-To: References: <4975d334-413e-517b-9e3f-35e66033e143@fceia.unr.edu.ar> <3b8c6824-f1b6-61b7-fbf6-c400c5f2a33e@free.fr> Message-ID: Christophe: Thank you for making me aware of xpolys(), a new addition to my bag of tools. A good alternative workaround. Regards, Federico Miyara On 26/04/2021 04:42, Dang Ngoc Chan, Christophe wrote: > Hello, > >> De : fmiyara >> I'm trying to get a plot like this: > [...] > > Maybe you should try with xpolys(), e.g. > > ---------- > > [n, ybase] = (10, -12); > > y = ybase + 9*grand(1,n,"def"); > > x=1:n; > > Y=[y ; ybase*ones(y)]; > > X=[x ; x] > > scf(0); > > clf(); > > xpolys(X, Y, ones(y)); > > plot(x, y, "o"); > > gcf().children.data_bounds(1, 2) = ybase; > > ---------- > > But it mays have some drawbacks. > > HTH > > > -- > Christophe Dang Ngoc Chan > Mechanical calculation engineer > > > General > This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > -- El software de antivirus Avast ha analizado este correo electr?nico en busca de virus. https://www.avast.com/antivirus -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Tue May 4 15:00:55 2021 From: sgougeon at free.fr (Samuel Gougeon) Date: Tue, 4 May 2021 15:00:55 +0200 Subject: [Scilab-users] How to list the content of the recursion stack? Message-ID: <455855f4-b0ae-e920-5d6f-c595d93821d4@free.fr> Dear all, When we get a Recursion limit reached (1000) message, does anyone know how to know more about which recursive calls are filling and overflowing the recursion stack? Noticeably, the message does not tell anything about the last instruction that yielded the error. This makes debugging quite hard. Using debug() to follow 1000 nested calls is just not possible. The debug page says "launch execution with stop on error". But then, in debug mode,? "e whereami" does not display anything, as in normal mode. Thanks Regards Samuel From sgougeon at free.fr Tue May 4 15:44:55 2021 From: sgougeon at free.fr (Samuel Gougeon) Date: Tue, 4 May 2021 15:44:55 +0200 Subject: [Scilab-users] Java String.format(format, value) within Scilab Message-ID: Dear all, May be the question is only about Java, or may be about how Scilab implements it. In order to do some tests to fix the regression brought by Scilab 6 and reported as the major bug 16376 about how datatips display (big or) small values (all displayed as 0 instead of using an exponential notation), i am trying to use the java.lang.String class and its .format() method , in Scilab language. Indeed, the java.text.DecimalFormat class used for datatips has no /self-adaptative format similar to the "%g" printf one/ (that automatically chooses the normal or exponential numerical notation according to the magnitude of the absolute value to display), while the String class provides this .format() method, with all printf formatting conventions , including the "%g" one. Now, even about only the Java side, something is unclear to me: The official documentation of the String class presents .format() as a String method, not as a String constructor. If so, then .format should be applied to a predefined String. But which one? What is done with it? It could be the String format, but this one is provided as an explicit input of the method... --> jimport java.lang.String --> s = String.new() ?s? = --> s.length()?? // OK, this works ?ans? = ? 0 --> s.format("%6.2f", -3.1415926) Undefined operation for the given operands. check or define function %eo_e for overloading. --> s = String.new("%6.1f") ?s? = %6.1f --> s.format(-3.1415926) Undefined operation for the given operands. check or define function %eo_e for overloading. Yet, the .format method is actually listed among all String's methods: --> or(jgetmethods(String)=="format") ?ans? = ? T Using the java.text.DecimalFormat class to fix the bug will anyway be possible, with explicit conditions on the magnitude of the value to display. But i would like to understand this error about String.format(). Any hint is welcome. Regards Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.mottelet at utc.fr Tue May 4 16:13:55 2021 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Tue, 4 May 2021 16:13:55 +0200 Subject: [Scilab-users] Java String.format(format, value) within Scilab In-Reply-To: References: Message-ID: <8d552a2b-54be-ad38-69d0-c110449e0d01@utc.fr> Hi, format() is a? class method, not an instance method. However, the following does not work either: --> String.format("%6.2f", -3.1415926) Undefined operation for the given operands. check or define function %eo_e for overloading. S. Le 04/05/2021 ? 15:44, Samuel Gougeon a ?crit?: > > Dear all, > > May be the question is only about Java, or may be about how Scilab > implements it. > > In order to do some tests to fix the regression brought by Scilab 6 > and reported as the major bug 16376 > > about how datatips display (big or) small values (all displayed as 0 > instead of using an exponential notation), i am trying to use the > java.lang.String > > class and its .format() method > , > in Scilab language. > > Indeed, the java.text.DecimalFormat class used for datatips has no > /self-adaptative format similar to the "%g" printf one/ (that > automatically chooses the normal or exponential numerical notation > according to the magnitude of the absolute value to display), while > the String class provides this .format() method, with all printf > formatting conventions > , > including the "%g" one. > > Now, even about only the Java side, something is unclear to me: > The official documentation of the String class presents .format() as a > String method, not as a String constructor. > If so, then .format should be applied to a predefined String. But > which one? What is done with it? It could be the String format, but > this one is provided as an explicit input of the method... > > --> jimport java.lang.String > --> s = String.new() > ?s? = > > --> s.length()?? // OK, this works > ?ans? = > ? 0 > > --> s.format("%6.2f", -3.1415926) > Undefined operation for the given operands. > check or define function %eo_e for overloading. > > --> s = String.new("%6.1f") > ?s? = > %6.1f > > --> s.format(-3.1415926) > Undefined operation for the given operands. > check or define function %eo_e for overloading. > > Yet, the .format method is actually listed among all String's methods: > --> or(jgetmethods(String)=="format") > ?ans? = > ? T > > Using the java.text.DecimalFormat class to fix the bug will anyway be > possible, with explicit conditions on the magnitude of the value to > display. But i would like to understand this error about String.format(). > > Any hint is welcome. > > Regards > Samuel > > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet -------------- next part -------------- An HTML attachment was scrubbed... URL: From antoine.monmayrant at laas.fr Tue May 4 16:27:59 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Tue, 4 May 2021 16:27:59 +0200 Subject: [Scilab-users] spec can crash scilab Message-ID: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> Hello all, I've been fighting during the last few days to nail down a segmentation fault in scilab, that seems to plague linux but not windows. Could you try to reproduce it? Just save the two attached file in a folder, cd to it and run the script. On my machine?, the call to spec with one output argument is OK, but the second one with two output arguments leads to a seg fault. Can you let me know how it goes on your system? Here ?scilab 6.1.0 on Linux Ubuntu 18.04 64bits -------------- next part -------------- A non-text attachment was scrubbed... Name: A_kills_spec.sod Type: application/octet-stream Size: 2544 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: bug_spec.sce Type: application/x-scilab-sce Size: 215 bytes Desc: not available URL: From stephane.mottelet at utc.fr Tue May 4 16:32:24 2021 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Tue, 4 May 2021 16:32:24 +0200 Subject: [Scilab-users] spec can crash scilab In-Reply-To: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> References: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> Message-ID: <3dd65e10-dd2c-9197-a29e-1c25d4695252@utc.fr> Hi, it? seems to be the same bug as https://bugzilla.scilab.org/show_bug.cgi?id=15330 S. Le 04/05/2021 ? 16:27, Antoine Monmayrant a ?crit?: > Hello all, > > I've been fighting during the last few days to nail down a > segmentation fault in scilab, that seems to plague linux but not windows. > > Could you try to reproduce it? > Just save the two attached file in a folder, cd to it and run the script. > On my machine?, the call to spec with one output argument is OK, but > the second one with two output arguments leads to a seg fault. > > Can you let me know how it goes on your system? > > Here > ?scilab 6.1.0 on Linux Ubuntu 18.04 64bits > > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet -------------- next part -------------- An HTML attachment was scrubbed... URL: From antoine.monmayrant at laas.fr Tue May 4 16:38:41 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Tue, 4 May 2021 16:38:41 +0200 Subject: [Scilab-users] spec can crash scilab In-Reply-To: <3dd65e10-dd2c-9197-a29e-1c25d4695252@utc.fr> References: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> <3dd65e10-dd2c-9197-a29e-1c25d4695252@utc.fr> Message-ID: Yes, it does the same So this bug is still a problem, at least on Ubuntu. Can you guys try to run spec.tst on his machine and comment on https://bugzilla.scilab.org/show_bug.cgi?id=15330 ? Antoine On 04/05/2021 16:32, St?phane Mottelet wrote: > > Hi, > > it? seems to be the same bug as > > https://bugzilla.scilab.org/show_bug.cgi?id=15330 > > S. > > Le 04/05/2021 ? 16:27, Antoine Monmayrant a ?crit?: >> Hello all, >> >> I've been fighting during the last few days to nail down a >> segmentation fault in scilab, that seems to plague linux but not >> windows. >> >> Could you try to reproduce it? >> Just save the two attached file in a folder, cd to it and run the >> script. >> On my machine?, the call to spec with one output argument is OK, but >> the second one with two output arguments leads to a seg fault. >> >> Can you let me know how it goes on your system? >> >> Here >> ?scilab 6.1.0 on Linux Ubuntu 18.04 64bits >> >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users > -- > St?phane Mottelet > Ing?nieur de recherche > EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable > D?partement G?nie des Proc?d?s Industriels > Sorbonne Universit?s - Universit? de Technologie de Compi?gne > CS 60319, 60203 Compi?gne cedex > Tel : +33(0)344234688 > http://www.utc.fr/~mottelet > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Tue May 4 23:35:57 2021 From: sgougeon at free.fr (Samuel Gougeon) Date: Tue, 4 May 2021 23:35:57 +0200 Subject: [Scilab-users] Java String.format(format, value) within Scilab In-Reply-To: <8d552a2b-54be-ad38-69d0-c110449e0d01@utc.fr> References: <8d552a2b-54be-ad38-69d0-c110449e0d01@utc.fr> Message-ID: <3fd73f92-e289-bc9f-942a-d7d9f20c2058@free.fr> Le 04/05/2021 ? 16:13, St?phane Mottelet a ?crit?: > > Hi, > > format() is a? class method, not an instance method. > Thanks for the tip. However, distinguishing both types of methods in the java documentation (list of methods) is not trivial to me.. > However, the following does not work either: > --> String.format("%6.2f", -3.1415926) > > Undefined operation for the given operands. > check or define function %eo_e for overloading. > So, still to be explored.. Samuel From sgougeon at free.fr Wed May 5 00:09:58 2021 From: sgougeon at free.fr (Samuel Gougeon) Date: Wed, 5 May 2021 00:09:58 +0200 Subject: [Scilab-users] spec can crash scilab In-Reply-To: References: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> <3dd65e10-dd2c-9197-a29e-1c25d4695252@utc.fr> Message-ID: <5400650e-5666-83a1-1cbc-1c33d6a447b6@free.fr> Le 04/05/2021 ? 16:38, Antoine Monmayrant a ?crit?: > > Yes, it does the same > > So this bug is still a problem, at least on Ubuntu. > Can you guys try to run spec.tst on his machine and comment on > https://bugzilla.scilab.org/show_bug.cgi?id=15330 ? > Besides, how confusing and messy the notations on the spec () documentation page are! ... * R defined twice but differently among arguments * L defined among arguments but not used in syntaxes * Q and Z used in syntaxes but not described among arguments * al, be used in descriptions, instead of alpha and beta listed in arguments * E used in the description, but not in arguments nor in syntaxes... and so on.. In addition, notations differ from a language version to another one... Some clarification is urgently required. In next release, eigs() -- mainly based on the former Arnoldi module, that becomes internal -- is listed in the same help section. Have you tried it? Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From antoine.monmayrant at laas.fr Wed May 5 08:22:24 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Wed, 5 May 2021 08:22:24 +0200 Subject: [Scilab-users] spec can crash scilab In-Reply-To: <5400650e-5666-83a1-1cbc-1c33d6a447b6@free.fr> References: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> <3dd65e10-dd2c-9197-a29e-1c25d4695252@utc.fr> <5400650e-5666-83a1-1cbc-1c33d6a447b6@free.fr> Message-ID: <416a2084-0a27-8604-595d-9c06defcb7a3@laas.fr> On 05/05/2021 00:09, Samuel Gougeon wrote: > Le 04/05/2021 ? 16:38, Antoine Monmayrant a ?crit?: >> >> Yes, it does the same >> >> So this bug is still a problem, at least on Ubuntu. >> Can you guys try to run spec.tst on his machine and comment on >> https://bugzilla.scilab.org/show_bug.cgi?id=15330 ? >> > Hello Samuel, > > Besides, how confusing and messy the notations on the spec () > documentation page are! ... > > * R defined twice but differently among arguments > * L defined among arguments but not used in syntaxes > * Q and Z used in syntaxes but not described among arguments > * al, be used in descriptions, instead of alpha and beta listed in > arguments > * E used in the description, but not in arguments nor in syntaxes... > > and so on.. > In addition, notations differ from a language version to another one... > Some clarification is urgently required. Indeed. It is also a big problem for portability to get such a basic functionality (solving eigenvalue problems in a linear algebra software!) only working on some platforms! > > In next release, eigs() -- mainly based on the former Arnoldi module, > that becomes internal -- is listed in the same help section. Have you > tried it? Well, I might be a bit far from my field of expertise, but it does not seem that eigs can compute all the eigenvalues/eigenvectors, does it? It seems that by default it computes the 6 biggest ones and can go up to rank(A)-2. In my use case, I need all the eigenvalues... Antoine > > Samuel > > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From antoine.monmayrant at laas.fr Wed May 5 09:23:25 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Wed, 5 May 2021 09:23:25 +0200 Subject: [Scilab-users] spec can crash scilab In-Reply-To: <416a2084-0a27-8604-595d-9c06defcb7a3@laas.fr> References: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> <3dd65e10-dd2c-9197-a29e-1c25d4695252@utc.fr> <5400650e-5666-83a1-1cbc-1c33d6a447b6@free.fr> <416a2084-0a27-8604-595d-9c06defcb7a3@laas.fr> Message-ID: <40068fc0-3af3-e2ea-1d9b-795b46576d90@laas.fr> Hello all, I might have found a workaround, but I still need to ensure that I get exactly the same end results in my code. It seems that I can replace: [W2, gammas] = spec(A); //crashes by [al,be,W2]=spec(A,eye(A)); //fine gammas=diag(al./be); If anyone has a solution with eigs, I'll take it. Could my workaround help investigate where the bug is in the gateway between scilab and lapack? Cheers, Antoine On 05/05/2021 08:22, Antoine Monmayrant wrote: > > > On 05/05/2021 00:09, Samuel Gougeon wrote: >> Le 04/05/2021 ? 16:38, Antoine Monmayrant a ?crit?: >>> >>> Yes, it does the same >>> >>> So this bug is still a problem, at least on Ubuntu. >>> Can you guys try to run spec.tst on his machine and comment on >>> https://bugzilla.scilab.org/show_bug.cgi?id=15330 ? >>> >> > Hello Samuel, >> >> Besides, how confusing and messy the notations on the spec () >> documentation page are! ... >> >> * R defined twice but differently among arguments >> * L defined among arguments but not used in syntaxes >> * Q and Z used in syntaxes but not described among arguments >> * al, be used in descriptions, instead of alpha and beta listed in >> arguments >> * E used in the description, but not in arguments nor in syntaxes... >> >> and so on.. >> In addition, notations differ from a language version to another one... >> Some clarification is urgently required. > Indeed. > It is also a big problem for portability to get such a basic > functionality (solving eigenvalue problems in a linear algebra > software!) only working on some platforms! >> >> In next release, eigs() -- mainly based on the former Arnoldi module, >> that becomes internal -- is listed in the same help section. Have you >> tried it? > Well, I might be a bit far from my field of expertise, but it does not > seem that eigs can compute all the eigenvalues/eigenvectors, does it? > It seems that by default it computes the 6 biggest ones and can go up > to rank(A)-2. > > In my use case, I need all the eigenvalues... > > Antoine > >> >> Samuel >> >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> http://lists.scilab.org/mailman/listinfo/users > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From antoine.monmayrant at laas.fr Wed May 5 10:13:39 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Wed, 5 May 2021 10:13:39 +0200 Subject: [Scilab-users] spec can crash scilab In-Reply-To: <40068fc0-3af3-e2ea-1d9b-795b46576d90@laas.fr> References: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> <3dd65e10-dd2c-9197-a29e-1c25d4695252@utc.fr> <5400650e-5666-83a1-1cbc-1c33d6a447b6@free.fr> <416a2084-0a27-8604-595d-9c06defcb7a3@laas.fr> <40068fc0-3af3-e2ea-1d9b-795b46576d90@laas.fr> Message-ID: Hello all, Well, my workaround works up to a certain point. When I increase the size of the matrix under study, I face another blocking issue: free(): corrupted unsorted chunks Antoine On 05/05/2021 09:23, Antoine Monmayrant wrote: > > Hello all, > > I might have found a workaround, but I still need to ensure that I get > exactly the same end results in my code. > It seems that I can replace: > > [W2, gammas] = spec(A); //crashes > > by > > [al,be,W2]=spec(A,eye(A)); //fine > gammas=diag(al./be); > > If anyone has a solution with eigs, I'll take it. > Could my workaround help investigate where the bug is in the gateway > between scilab and lapack? > > Cheers, > > Antoine > > On 05/05/2021 08:22, Antoine Monmayrant wrote: >> >> >> On 05/05/2021 00:09, Samuel Gougeon wrote: >>> Le 04/05/2021 ? 16:38, Antoine Monmayrant a ?crit?: >>>> >>>> Yes, it does the same >>>> >>>> So this bug is still a problem, at least on Ubuntu. >>>> Can you guys try to run spec.tst on his machine and comment on >>>> https://bugzilla.scilab.org/show_bug.cgi?id=15330 ? >>>> >>> >> Hello Samuel, >>> >>> Besides, how confusing and messy the notations on the spec () >>> documentation page are! ... >>> >>> * R defined twice but differently among arguments >>> * L defined among arguments but not used in syntaxes >>> * Q and Z used in syntaxes but not described among arguments >>> * al, be used in descriptions, instead of alpha and beta listed in >>> arguments >>> * E used in the description, but not in arguments nor in syntaxes... >>> >>> and so on.. >>> In addition, notations differ from a language version to another one... >>> Some clarification is urgently required. >> Indeed. >> It is also a big problem for portability to get such a basic >> functionality (solving eigenvalue problems in a linear algebra >> software!) only working on some platforms! >>> >>> In next release, eigs() -- mainly based on the former Arnoldi >>> module, that becomes internal -- is listed in the same help section. >>> Have you tried it? >> Well, I might be a bit far from my field of expertise, but it does >> not seem that eigs can compute all the eigenvalues/eigenvectors, does it? >> It seems that by default it computes the 6 biggest ones and can go up >> to rank(A)-2. >> >> In my use case, I need all the eigenvalues... >> >> Antoine >> >>> >>> Samuel >>> >>> >>> _______________________________________________ >>> users mailing list >>> users at lists.scilab.org >>> http://lists.scilab.org/mailman/listinfo/users >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> http://lists.scilab.org/mailman/listinfo/users > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From Clement.David at esi-group.com Thu May 6 09:23:44 2021 From: Clement.David at esi-group.com (=?utf-8?B?Q2zDqW1lbnQgRGF2aWQ=?=) Date: Thu, 6 May 2021 07:23:44 +0000 Subject: [Scilab-users] How to list the content of the recursion stack? In-Reply-To: <455855f4-b0ae-e920-5d6f-c595d93821d4@free.fr> References: <455855f4-b0ae-e920-5d6f-c595d93821d4@free.fr> Message-ID: Hello Samuel, If I remember correctly, this message comes without any information as this is a regular Scilab error and should be trap through debug(). However on the latest Scilab dev build it seems to crash my Scilab. Could you post a bug on that please ? Thanks, Cl?ment -----Original Message----- From: users On Behalf Of Samuel Gougeon Sent: Tuesday, May 4, 2021 3:01 PM To: International users mailing list for Scilab. Subject: [Scilab-users] How to list the content of the recursion stack? Dear all, When we get a Recursion limit reached (1000) message, does anyone know how to know more about which recursive calls are filling and overflowing the recursion stack? Noticeably, the message does not tell anything about the last instruction that yielded the error. This makes debugging quite hard. Using debug() to follow 1000 nested calls is just not possible. The debug page says "launch execution with stop on error". But then, in debug mode,? "e whereami" does not display anything, as in normal mode. Thanks Regards Samuel _______________________________________________ users mailing list users at lists.scilab.org http://lists.scilab.org/mailman/listinfo/users From Jean-Yves.Baudais at insa-rennes.fr Thu May 6 11:13:23 2021 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Thu, 6 May 2021 11:13:23 +0200 (CEST) Subject: [Scilab-users] How to list the content of the recursion stack? In-Reply-To: References: <455855f4-b0ae-e920-5d6f-c595d93821d4@free.fr> Message-ID: <568702546.100157.1620292403542.JavaMail.zimbra@insa-rennes.fr> Hi, > [...] When we get a Recursion limit reached (1000) message [...] I'm not a wizard on programming, not at all, and recursion call it's all the time complex for me to use. Anyway, I tested two different recursions and I'm really far from the "Recursion limit"! Here the examples: function out=test_l(in) if in==0 then out=in; return end out=in+test_l(in-1); endfunction //calling sequence // test_l(n); // max n=41 function out=test_ll(in,acc) if in<=1 out=acc; return end out=test_ll(in-1,acc+in); endfunction //calling sequence //test_ll(n,1); // max n=140 test_ll improves a bit test_l because it uses tail call, but the max without seg.fault is far from 1000. Where does this limit of 1000 come from? -- Jean-Yves From sgougeon at free.fr Thu May 6 13:16:39 2021 From: sgougeon at free.fr (Samuel Gougeon) Date: Thu, 6 May 2021 13:16:39 +0200 Subject: [Scilab-users] How to list the content of the recursion stack? In-Reply-To: <568702546.100157.1620292403542.JavaMail.zimbra@insa-rennes.fr> References: <455855f4-b0ae-e920-5d6f-c595d93821d4@free.fr> <568702546.100157.1620292403542.JavaMail.zimbra@insa-rennes.fr> Message-ID: Hello Jean-Yves, Le 06/05/2021 ? 11:13, Jean-Yves Baudais a ?crit?: > .../... > test_ll improves a bit test_l because it uses tail call, but the max > without seg.fault is far from 1000. Where does this limit of 1000 come > from? from --> currentMaxDepth = recursionlimit() ?currentMaxDepth? = ?? 1000. set by default in the user's preferences: https://help.scilab.org/docs/6.1.0/en_US/recursionlimit.html A recursion can be triggered in a involontary way according to a quite indirect and complex path. That was the case i have met. I have fixed it with a lot of spying pause() and disp(). But it's not really a way of working... Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jean-Yves.Baudais at insa-rennes.fr Thu May 6 16:36:19 2021 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Thu, 6 May 2021 16:36:19 +0200 (CEST) Subject: [Scilab-users] How to list the content of the recursion stack? In-Reply-To: References: <455855f4-b0ae-e920-5d6f-c595d93821d4@free.fr> <568702546.100157.1620292403542.JavaMail.zimbra@insa-rennes.fr> Message-ID: <186233661.149511.1620311779385.JavaMail.zimbra@insa-rennes.fr> Hi, > from > --> currentMaxDepth = recursionlimit() > currentMaxDepth = > 1000. Thanks Samuel, I didn't know this function. So I face a problem (a bug?): Scilab cratches with segfault but without reaching the recursionlimit. Here the used three functions function out=test_l(in) if in==0 then out=in; return end out=in+test_l(in-1); endfunction function out=test_ll(in,acc) if in<=1 out=acc; return end out=test_ll(in-1,acc+in); endfunction function l_test(in) i=1; while 1 mprintf("\n%d: ",i) sleep(.5,"s"); select in case 1 out=test_l(i); case 2 out=test_ll(i,1); end mprintf("%d\n",out) i=i+1; end endfunction There is no problem with > recursionlimit(20) > l_test(1) The program stops as expected with the message "Limite de r?cursion atteinte (20)" when i=19 and > recursionlimit(20) > l_test(2) stops when i=20 (I was wrong when I talked about tail call in my previous email!). But, with > recursionlimit(1000) > l_test(1) Scilab cratches at i=41 with segfault and with > recursionlimit(1000) > l_test(2) Scilab cratches at i=140. Is this cratch a know bug? (It's quite far from the recursion limit!) (Subsidiary question: while l_test(2) stop 1 iteration after l_test(1) with low recursion limit, l_test(2) allows around 100 iterations more than l_test(1) before cratch with recursionlimit(1000)! Where does it comes from?) --Jean-Yves From fmiyara at fceia.unr.edu.ar Fri May 7 08:57:40 2021 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Fri, 7 May 2021 03:57:40 -0300 Subject: [Scilab-users] Problem with ascii() Message-ID: <17d3ffd6-e250-8275-804d-b7874625f068@fceia.unr.edu.ar> Dear all, If I run this simple code ascii([ascii("hello"), 13,10, ascii("world")]) Scilab crashes. I should get something like this: "hello world" Is it a bug? Regards, Federico Miyara -- El software de antivirus Avast ha analizado este correo electr?nico en busca de virus. https://www.avast.com/antivirus -------------- next part -------------- An HTML attachment was scrubbed... URL: From antoine.monmayrant at laas.fr Fri May 7 09:21:41 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Fri, 7 May 2021 09:21:41 +0200 Subject: [Scilab-users] Problem with ascii() In-Reply-To: <17d3ffd6-e250-8275-804d-b7874625f068@fceia.unr.edu.ar> References: <17d3ffd6-e250-8275-804d-b7874625f068@fceia.unr.edu.ar> Message-ID: <25bd45a9-66b1-e3e0-e8c0-0991d7345f19@laas.fr> Hello, On 07/05/2021 08:57, Federico Miyara wrote: > > Dear all, > > If I run this simple code > > ascii([ascii("hello"), 13,10, ascii("world")]) > > Scilab crashes. I should get something like this: > > "hello > world" > > Is it a bug? > Well, when Scilab crashes, it's always a bug! :-) On my system it does not crash: --> ascii([ascii("hello"), 13, 10, ascii("world")]) ?ans? = world" Antoine > Regards, > > Federico Miyara > > > Libre de virus. www.avast.com > > > > <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jean-Yves.Baudais at insa-rennes.fr Fri May 7 09:26:48 2021 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Fri, 7 May 2021 09:26:48 +0200 (CEST) Subject: [Scilab-users] Problem with ascii() In-Reply-To: <17d3ffd6-e250-8275-804d-b7874625f068@fceia.unr.edu.ar> References: <17d3ffd6-e250-8275-804d-b7874625f068@fceia.unr.edu.ar> Message-ID: <1164700571.180400.1620372408024.JavaMail.zimbra@insa-rennes.fr> Hello, > ascii ( [ ascii ( " hello " ) , 13 , 10 , ascii ( " world " ) ] ) On Scilab 6.1.0.1582621796 I get --> ascii([ascii("hello"), 13, 10, ascii("world")]) ans = world" What is your Scilab version? -- Jean-Yves From sgougeon at free.fr Fri May 7 10:44:30 2021 From: sgougeon at free.fr (Samuel Gougeon) Date: Fri, 7 May 2021 10:44:30 +0200 Subject: [Scilab-users] Problem with ascii() In-Reply-To: <17d3ffd6-e250-8275-804d-b7874625f068@fceia.unr.edu.ar> References: <17d3ffd6-e250-8275-804d-b7874625f068@fceia.unr.edu.ar> Message-ID: Hello, Le 07/05/2021 ? 08:57, Federico Miyara a ?crit?: > > Dear all, > > If I run this simple code > > ascii([ascii("hello"), 13,10, ascii("world")]) > > Scilab crashes. Do you get a crash if you prevent displaying the result with a final semi-colon? Le 07/05/2021 ? 09:26, Jean-Yves Baudais a ?crit?: > On Scilab 6.1.0.1582621796 IMHO, that's the question. Some things were fixed for the last year about /the display/ of ascii(13), that actually sometimes crashed. In the nightly built version, i get the expected display: --> ascii([ascii("hello"), 13, 10, ascii("world")]) ?ans? = ? "hello world" Regards Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From fmiyara at fceia.unr.edu.ar Fri May 7 15:37:11 2021 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Fri, 7 May 2021 10:37:11 -0300 Subject: [Scilab-users] Problem with ascii() In-Reply-To: <1164700571.180400.1620372408024.JavaMail.zimbra@insa-rennes.fr> References: <17d3ffd6-e250-8275-804d-b7874625f068@fceia.unr.edu.ar> <1164700571.180400.1620372408024.JavaMail.zimbra@insa-rennes.fr> Message-ID: <9ff9da91-5d8e-b114-71f6-5fb3ab404c4a@fceia.unr.edu.ar> Jean-Yves, Typing ver yields --> ver ?ans? = ???????? column 1 ? "Scilab Version: " ? "Operating System: " ? "Java version: " ? "Java runtime information: " ? "Java Virtual Machine information: " ? "Vendor specification: " ???????? column 2 ? "6.1.0.1582621796" ? "Windows 7 6.1" ? "1.8.0_151" ? "Java(TM) SE Runtime Environment (build 1.8.0_151-b12)" ? "Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)" ? "Oracle Corporation" Regards, Federico On 07/05/2021 04:26, Jean-Yves Baudais wrote: > Hello, > >> ascii ( [ ascii ( " hello " ) , 13 , 10 , ascii ( " world " ) ] ) > > On Scilab 6.1.0.1582621796 I get > > > --> ascii([ascii("hello"), 13, 10, ascii("world")]) > ans = > > > world" > > > What is your Scilab version? > > > -- Jean-Yves > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > -- El software de antivirus Avast ha analizado este correo electr?nico en busca de virus. https://www.avast.com/antivirus From antoine.monmayrant at laas.fr Fri May 7 17:39:43 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Fri, 7 May 2021 17:39:43 +0200 Subject: [Scilab-users] Scilab compilation from scratch (was Re: spec can crash scilab) In-Reply-To: References: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> <3dd65e10-dd2c-9197-a29e-1c25d4695252@utc.fr> <5400650e-5666-83a1-1cbc-1c33d6a447b6@free.fr> <416a2084-0a27-8604-595d-9c06defcb7a3@laas.fr> <40068fc0-3af3-e2ea-1d9b-795b46576d90@laas.fr> Message-ID: Hello all, In order to try to mitigate bug 15330, I try to compile scilab from source on Linux Ubuntu 18.04 64bits. I follow the explanations from https://wiki.scilab.org/Compilation%20of%20Scilab [Linux x86_64 cheat sheet]. Sadly, I don't go really far as the prebuild of java fails: ??? Makefile:756: recipe for target 'java' failed Am I missing something? Are there other infos somewhere, in particular concerning the dependencies ? Is there a more detailed tutorial for building scilab? Cheers, Antoine From Clement.David at esi-group.com Fri May 7 18:18:35 2021 From: Clement.David at esi-group.com (=?utf-8?B?Q2zDqW1lbnQgRGF2aWQ=?=) Date: Fri, 7 May 2021 16:18:35 +0000 Subject: [Scilab-users] Scilab compilation from scratch (was Re: spec can crash scilab) In-Reply-To: References: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> <3dd65e10-dd2c-9197-a29e-1c25d4695252@utc.fr> <5400650e-5666-83a1-1cbc-1c33d6a447b6@free.fr> <416a2084-0a27-8604-595d-9c06defcb7a3@laas.fr> <40068fc0-3af3-e2ea-1d9b-795b46576d90@laas.fr> Message-ID: Hello Antoine, This issue might comes from a wrong jdk version, you should have openjdk8 installed on your machine and it should be listed at configure time. Could you post the config.log file for further investigation ? Thanks, Cl?ment -----Original Message----- From: users On Behalf Of Antoine Monmayrant Sent: Friday, May 7, 2021 5:40 PM To: users at lists.scilab.org Subject: [Scilab-users] Scilab compilation from scratch (was Re: spec can crash scilab) Hello all, In order to try to mitigate bug 15330, I try to compile scilab from source on Linux Ubuntu 18.04 64bits. I follow the explanations from https://wiki.scilab.org/Compilation%20of%20Scilab [Linux x86_64 cheat sheet]. Sadly, I don't go really far as the prebuild of java fails: ??? Makefile:756: recipe for target 'java' failed Am I missing something? Are there other infos somewhere, in particular concerning the dependencies ? Is there a more detailed tutorial for building scilab? Cheers, Antoine _______________________________________________ users mailing list users at lists.scilab.org http://lists.scilab.org/mailman/listinfo/users From fmiyara at fceia.unr.edu.ar Sat May 8 00:06:47 2021 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Fri, 7 May 2021 19:06:47 -0300 Subject: [Scilab-users] Problem with ascii() In-Reply-To: References: <17d3ffd6-e250-8275-804d-b7874625f068@fceia.unr.edu.ar> Message-ID: Samuel, I've found that the crash is not consistent. Sometimes it crashes, sometimes not. I actually discovered the problem in a much longer text read from a text file using mgetl() and inserting manually the line feed and cariage return characters (13 and 10). The problem appears indeed when displaying, not creating, so it seems thar the problem is not with ascii() but, as you say, with the display feature (filename is any plain text file): fid = mopen(filename, 'rt'); text1 = mgetl(fid, -1); mclose(fid); text = []; for k=1:size(text1,1) ??? text = [text, ascii(text1(k)), 13, 10]; end text = ascii(text); My first example ctrashes sometimes Scilab. Displaying this one either just entering the variable text or using disp(text) ctrashes it always (with a file with 3200 characters and 3 paragraphs) Regards, Federico On 07/05/2021 05:44, Samuel Gougeon wrote: > Hello, > > Le 07/05/2021 ? 08:57, Federico Miyara a ?crit?: >> >> Dear all, >> >> If I run this simple code >> >> ascii([ascii("hello"), 13,10, ascii("world")]) >> >> Scilab crashes. > > Do you get a crash if you prevent displaying the result with a final > semi-colon? > > Le 07/05/2021 ? 09:26, Jean-Yves Baudais a ?crit?: >> On Scilab 6.1.0.1582621796 > > IMHO, that's the question. Some things were fixed for the last year > about /the display/ of ascii(13), that actually sometimes crashed. > In the nightly built version, i get the expected display: > > --> ascii([ascii("hello"), 13, 10, ascii("world")]) > ?ans? = > ? "hello > world" > > Regards > Samuel > > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -- El software de antivirus Avast ha analizado este correo electr?nico en busca de virus. https://www.avast.com/antivirus -------------- next part -------------- An HTML attachment was scrubbed... URL: From antoine.monmayrant at laas.fr Sun May 9 16:39:05 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Sun, 9 May 2021 16:39:05 +0200 Subject: [Scilab-users] Scilab compilation from scratch (was Re: spec can crash scilab) In-Reply-To: References: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> <3dd65e10-dd2c-9197-a29e-1c25d4695252@utc.fr> <5400650e-5666-83a1-1cbc-1c33d6a447b6@free.fr> <416a2084-0a27-8604-595d-9c06defcb7a3@laas.fr> <40068fc0-3af3-e2ea-1d9b-795b46576d90@laas.fr> Message-ID: <22328739-ff89-7f43-c677-f418a8358ab7@laas.fr> Hello all, Just a quick update: (1) I installed & configured as default : openjdk-8 gcc-8 g++8 (2) I had to rm everything and restart from scratch: somehow, my first try at compiling with openjdk-11 had left some *.class files behind (with the wrong version) that make clean is not removing (3) Now I am stuck at libscigfortran not being found. I'm pretty sure I miss some mystery -lrandomlibame flag or someLD_* stuff... : ??? /usr/bin/ld: warning: libscigfortran.so.5, needed by /home/amonmayr/softs/scilab-recompile/scilab_master/scilab/usr/lib/liblapack.so, not found (try using -rpath or -rpath-link) If anyone who knows more than me about ld flags wants to chime in, I could do with a bit of help... Cheers, Antoine PS: I tried to join config.log but the email got too big for the mailing list... On 07/05/2021 18:18, Cl?ment David wrote: > Hello Antoine, > > This issue might comes from a wrong jdk version, you should have > openjdk8 installed on your machine and it should be listed at > configure time. Could you post the config.log file for further > investigation ? > > Thanks, > > Cl?ment > > -----Original Message----- > From: users On Behalf Of Antoine > Monmayrant > Sent: Friday, May 7, 2021 5:40 PM > To: users at lists.scilab.org > Subject: [Scilab-users] Scilab compilation from scratch (was Re: spec > can crash scilab) > > Hello all, > > In order to try to mitigate bug 15330, I try to compile scilab from > source on Linux Ubuntu 18.04 64bits. > I follow the explanations from > https://wiki.scilab.org/Compilation%20of%20Scilab [Linux x86_64 cheat > sheet]. > Sadly, I don't go really far as the prebuild of java fails: > > > ??? Makefile:756: recipe for target 'java' failed > > Am I missing something? > Are there other infos somewhere, in particular concerning the > dependencies ? > Is there a more detailed tutorial for building scilab? > > Cheers, > > Antoine > > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > From antoine.monmayrant at laas.fr Mon May 10 06:09:29 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Mon, 10 May 2021 06:09:29 +0200 Subject: [Scilab-users] Scilab compilation from scratch (was Re: spec can crash scilab) In-Reply-To: <22328739-ff89-7f43-c677-f418a8358ab7@laas.fr> References: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> <3dd65e10-dd2c-9197-a29e-1c25d4695252@utc.fr> <5400650e-5666-83a1-1cbc-1c33d6a447b6@free.fr> <416a2084-0a27-8604-595d-9c06defcb7a3@laas.fr> <40068fc0-3af3-e2ea-1d9b-795b46576d90@laas.fr> <22328739-ff89-7f43-c677-f418a8358ab7@laas.fr> Message-ID: <7dc37c80-3051-88f8-89ae-aba0ca003e8a@laas.fr> Hello all, Here is another update: success! After a lot of LD_PATH, ln & -lrandomstuff dark magic that I don't really understand I managed to compile scilab under linux ubuntu 18.04. Se below what I've done for those interested. A bit of warning: I tried to remove all the intermediate failures and only keep the changes/installs that help me compile scilab. Maybe there are some bits missing or useless. I'll be happy to get a feedback from someone trying to build it on a vanilla 18.04 vm to see whether this can be reproduced. If you see some obvious mistake or simplification, do not hesitate to let me know... Hope it helps, Cheers, Antoine ############ # In order to get build-dep scilab software-properties-gtk ??? tick option "Source code" sudo apt update sudo apt-get build-dep scilab # In order to successfully build java stuff with the right jdk sudo apt install openjdk-8-jdk sudo update-alternatives --config java ??? * 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java?? 1081????? manual mode export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 #??? if you tried and failed at compiling with the default jdk (openjdk-11-jdk), there are some compiled *.class left behind, even after 'make clean' #??? and you'll get ??? [javac]?? bad class file:? ... class file has wrong version 55.0, should be 52.0 #??? rm -rf your build folder and start again # getting scilab source code and deps git clone -b master --depth=1 https://github.com/scilab/scilab.git scilab_master cd scilab_master/scilab/ svn --force checkout https://github.com/scilab/scilab-prerequirements.git/trunk/linux_x64/ . # In order to build using a more modern c/fortran/c++ compiler (default is version 7) sudo apt install gcc-8 g++-8 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 80 # ??? I switch to gcc-8 g++-8? to get past this compile error: #??? src/cpp/fullpath.cpp:16:10: fatal error: filesystem: No such file or directory #??? #include # Somehow libscigfortran does not seem to have the right name for ld to be happy: sudo ln -s /home/myhome/softs/scilab-recompile/scilab_master/scilab/lib/thirdparty/redist/libscigfortran.so.5 /home/myhome/softs/scilab-recompile/scilab_master/scilab/lib/thirdparty/redist/libscigfortran.so #??? The ln -s above is to get past this error: #??? /usr/bin/ld: warning: libscigfortran.so.5, needed by /home/myhome/softs/scilab-recompile/scilab_master/scilab/usr/lib/liblapack.so, not found (try using -rpath or -rpath-link) # Populating LDFLAGS and LD_LIBRARY_PATH using random walk and fuzzy (really fuzzy) logic. Here be dragons! ./configure LDFLAGS="-L`pwd`/usr/lib/ -L`pwd`/lib/thirdparty -L/usr/lib/gcc/x86_64-linux-gnu/8" LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:`pwd`/lib/thirdparty/:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:`pwd`/lib/thirdparty/:`pwd`/lib/thirdparty/redist/:$LD_LIBRARY_PATH ; make ########## From Clement.David at esi-group.com Mon May 10 09:12:22 2021 From: Clement.David at esi-group.com (=?utf-8?B?Q2zDqW1lbnQgRGF2aWQ=?=) Date: Mon, 10 May 2021 07:12:22 +0000 Subject: [Scilab-users] Scilab compilation from scratch (was Re: spec can crash scilab) In-Reply-To: <22328739-ff89-7f43-c677-f418a8358ab7@laas.fr> References: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> <3dd65e10-dd2c-9197-a29e-1c25d4695252@utc.fr> <5400650e-5666-83a1-1cbc-1c33d6a447b6@free.fr> <416a2084-0a27-8604-595d-9c06defcb7a3@laas.fr> <40068fc0-3af3-e2ea-1d9b-795b46576d90@laas.fr> <22328739-ff89-7f43-c677-f418a8358ab7@laas.fr> Message-ID: This one is less obvious and will require more explanation. In Scilab 6, we use modern C++ (C++11 and later) on our codebase which requires to have modern compilers and runtime libraries (libstdc++ libgfortran). For the compilation chain, we build gcc 8 on an old centos 6 distribution so runtimes are available. For people using Scilab, to avoid clashing between the system libstdc++/libgfortran and Scilab libstdc++/libgfortran, the Scilab runtime libraries are renamed to libscistdc++/libscigfortran. For building toolboxes against the Scilab runtime libraries and their libstdc++.so and libgfortran.so development libraries are provided on the Prerequirements. This is the source of your issue as the Prerequirements LDFLAGS are detected and used at configure-time. To fix, remove libstdc++.so and libgfortran.so on the Prerequirements; this will make your Scilab-build tied to your system; this is good for development purposes. Regards, Cl?ment > -----Original Message----- > From: users On Behalf Of Antoine > Monmayrant > Sent: Sunday, May 9, 2021 4:39 PM > To: users at lists.scilab.org > Subject: Re: [Scilab-users] Scilab compilation from scratch (was Re: spec can > crash scilab) > > Hello all, > > Just a quick update: > (1) I installed & configured as default : openjdk-8 gcc-8 g++8 > (2) I had to rm everything and restart from scratch: somehow, my first try at > compiling with openjdk-11 had left some *.class files behind (with the wrong > version) that make clean is not removing > (3) Now I am stuck at libscigfortran not being found. I'm pretty sure I miss > some mystery -lrandomlibame flag or someLD_* stuff... : > ??? /usr/bin/ld: warning: libscigfortran.so.5, needed by > /home/amonmayr/softs/scilab- > recompile/scilab_master/scilab/usr/lib/liblapack.so, > not found (try using -rpath or -rpath-link) > > If anyone who knows more than me about ld flags wants to chime in, I could > do with a bit of help... > > Cheers, > > > Antoine > PS: I tried to join config.log but the email got too big for the mailing list... > > On 07/05/2021 18:18, Cl?ment David wrote: > > Hello Antoine, > > > > This issue might comes from a wrong jdk version, you should have > > openjdk8 installed on your machine and it should be listed at > > configure time. Could you post the config.log file for further > > investigation ? > > > > Thanks, > > > > Cl?ment > > > > -----Original Message----- > > From: users On Behalf Of Antoine > > Monmayrant > > Sent: Friday, May 7, 2021 5:40 PM > > To: users at lists.scilab.org > > Subject: [Scilab-users] Scilab compilation from scratch (was Re: spec > > can crash scilab) > > > > Hello all, > > > > In order to try to mitigate bug 15330, I try to compile scilab from > > source on Linux Ubuntu 18.04 64bits. > > I follow the explanations from > > https://wiki.scilab.org/Compilation%20of%20Scilab [Linux x86_64 cheat > > sheet]. > > Sadly, I don't go really far as the prebuild of java fails: > > > > > > ??? Makefile:756: recipe for target 'java' failed > > > > Am I missing something? > > Are there other infos somewhere, in particular concerning the > > dependencies ? > > Is there a more detailed tutorial for building scilab? > > > > Cheers, > > > > Antoine > > > > > > _______________________________________________ > > users mailing list > > users at lists.scilab.org > > http://lists.scilab.org/mailman/listinfo/users > > _______________________________________________ > > users mailing list > > users at lists.scilab.org > > http://lists.scilab.org/mailman/listinfo/users > > > > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users From stephane.mottelet at utc.fr Mon May 10 10:25:25 2021 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Mon, 10 May 2021 10:25:25 +0200 Subject: [Scilab-users] Scilab compilation from scratch (was Re: spec can crash scilab) In-Reply-To: References: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> <3dd65e10-dd2c-9197-a29e-1c25d4695252@utc.fr> <5400650e-5666-83a1-1cbc-1c33d6a447b6@free.fr> <416a2084-0a27-8604-595d-9c06defcb7a3@laas.fr> <40068fc0-3af3-e2ea-1d9b-795b46576d90@laas.fr> <22328739-ff89-7f43-c677-f418a8358ab7@laas.fr> Message-ID: Hi, I added also 'F77=gfortran-8' in the configure. S. Le 10/05/2021 ? 09:12, Cl?ment David a ?crit?: > This one is less obvious and will require more explanation. > In Scilab 6, we use modern C++ (C++11 and later) on our codebase which requires to have modern compilers and runtime libraries (libstdc++ libgfortran). For the compilation chain, we build gcc 8 on an old centos 6 distribution so runtimes are available. For people using Scilab, to avoid clashing between the system libstdc++/libgfortran and Scilab libstdc++/libgfortran, the Scilab runtime libraries are renamed to libscistdc++/libscigfortran. > > For building toolboxes against the Scilab runtime libraries and their libstdc++.so and libgfortran.so development libraries are provided on the Prerequirements. This is the source of your issue as the Prerequirements LDFLAGS are detected and used at configure-time. To fix, remove libstdc++.so and libgfortran.so on the Prerequirements; this will make your Scilab-build tied to your system; this is good for development purposes. > > Regards, > > Cl?ment > >> -----Original Message----- >> From: users On Behalf Of Antoine >> Monmayrant >> Sent: Sunday, May 9, 2021 4:39 PM >> To: users at lists.scilab.org >> Subject: Re: [Scilab-users] Scilab compilation from scratch (was Re: spec can >> crash scilab) >> >> Hello all, >> >> Just a quick update: >> (1) I installed & configured as default : openjdk-8 gcc-8 g++8 >> (2) I had to rm everything and restart from scratch: somehow, my first try at >> compiling with openjdk-11 had left some *.class files behind (with the wrong >> version) that make clean is not removing >> (3) Now I am stuck at libscigfortran not being found. I'm pretty sure I miss >> some mystery -lrandomlibame flag or someLD_* stuff... : >> ??? /usr/bin/ld: warning: libscigfortran.so.5, needed by >> /home/amonmayr/softs/scilab- >> recompile/scilab_master/scilab/usr/lib/liblapack.so, >> not found (try using -rpath or -rpath-link) >> >> If anyone who knows more than me about ld flags wants to chime in, I could >> do with a bit of help... >> >> Cheers, >> >> >> Antoine >> PS: I tried to join config.log but the email got too big for the mailing list... >> >> On 07/05/2021 18:18, Cl?ment David wrote: >>> Hello Antoine, >>> >>> This issue might comes from a wrong jdk version, you should have >>> openjdk8 installed on your machine and it should be listed at >>> configure time. Could you post the config.log file for further >>> investigation ? >>> >>> Thanks, >>> >>> Cl?ment >>> >>> -----Original Message----- >>> From: users On Behalf Of Antoine >>> Monmayrant >>> Sent: Friday, May 7, 2021 5:40 PM >>> To: users at lists.scilab.org >>> Subject: [Scilab-users] Scilab compilation from scratch (was Re: spec >>> can crash scilab) >>> >>> Hello all, >>> >>> In order to try to mitigate bug 15330, I try to compile scilab from >>> source on Linux Ubuntu 18.04 64bits. >>> I follow the explanations from >>> https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/wiki.scilab.org/Compilation%20of%20Scilab [Linux x86_64 cheat >>> sheet]. >>> Sadly, I don't go really far as the prebuild of java fails: >>> >>> >>> ??? Makefile:756: recipe for target 'java' failed >>> >>> Am I missing something? >>> Are there other infos somewhere, in particular concerning the >>> dependencies ? >>> Is there a more detailed tutorial for building scilab? >>> >>> Cheers, >>> >>> Antoine >>> >>> >>> _______________________________________________ >>> users mailing list >>> users at lists.scilab.org >>> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users >>> _______________________________________________ >>> users mailing list >>> users at lists.scilab.org >>> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users >>> >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From antoine.monmayrant at laas.fr Mon May 10 13:01:48 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Mon, 10 May 2021 13:01:48 +0200 Subject: [Scilab-users] Scilab compilation from scratch (was Re: spec can crash scilab) In-Reply-To: References: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> <3dd65e10-dd2c-9197-a29e-1c25d4695252@utc.fr> <5400650e-5666-83a1-1cbc-1c33d6a447b6@free.fr> <416a2084-0a27-8604-595d-9c06defcb7a3@laas.fr> <40068fc0-3af3-e2ea-1d9b-795b46576d90@laas.fr> <22328739-ff89-7f43-c677-f418a8358ab7@laas.fr> Message-ID: Le 10/05/2021 ? 09:12, Cl?ment David a ?crit?: > To fix, remove libstdc++.so and libgfortran.so on the Prerequirements; Er, OK, I'm glad to do that, but I don't see what you are talking about. Where are those 'Prerequirements' defined? (I'm really not versed into compiling, I just barely know the basics...) Antoine From antoine.monmayrant at laas.fr Mon May 10 13:04:01 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Mon, 10 May 2021 13:04:01 +0200 Subject: [Scilab-users] Scilab compilation from scratch (was Re: spec can crash scilab) In-Reply-To: References: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> <3dd65e10-dd2c-9197-a29e-1c25d4695252@utc.fr> <5400650e-5666-83a1-1cbc-1c33d6a447b6@free.fr> <416a2084-0a27-8604-595d-9c06defcb7a3@laas.fr> <40068fc0-3af3-e2ea-1d9b-795b46576d90@laas.fr> <22328739-ff89-7f43-c677-f418a8358ab7@laas.fr> Message-ID: Le 10/05/2021 ? 10:25, St?phane Mottelet a ?crit?: > I added also 'F77=gfortran-8' in the configure. What do you mean? As a command line option to configure? Antoine From Clement.David at esi-group.com Mon May 10 15:35:46 2021 From: Clement.David at esi-group.com (=?utf-8?B?Q2zDqW1lbnQgRGF2aWQ=?=) Date: Mon, 10 May 2021 13:35:46 +0000 Subject: [Scilab-users] Scilab compilation from scratch (was Re: spec can crash scilab) In-Reply-To: References: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> <3dd65e10-dd2c-9197-a29e-1c25d4695252@utc.fr> <5400650e-5666-83a1-1cbc-1c33d6a447b6@free.fr> <416a2084-0a27-8604-595d-9c06defcb7a3@laas.fr> <40068fc0-3af3-e2ea-1d9b-795b46576d90@laas.fr> <22328739-ff89-7f43-c677-f418a8358ab7@laas.fr> Message-ID: > -----Original Message----- > From: users On Behalf Of Antoine > Monmayrant > Sent: Monday, May 10, 2021 1:02 PM > To: users at lists.scilab.org > Subject: Re: [Scilab-users] Scilab compilation from scratch (was Re: spec can > crash scilab) > > > Le 10/05/2021 ? 09:12, Cl?ment David a ?crit?: > > To fix, remove libstdc++.so and libgfortran.so on the Prerequirements; > Er, OK, I'm glad to do that, but I don't see what you are talking about. > Where are those 'Prerequirements' defined? > > (I'm really not versed into compiling, I just barely know the basics...) What we called Prerequirements (or thirdparties) are binaries used for the Scilab compilation but coming from external sources (for example, libxml2 or curl). At configure time, a detection is performed to use them rather than using the system's ones. If you used the cheatsheet, they are delivered with the svn command and should be located on the "usr" directory. Cl?ment From antoine.monmayrant at laas.fr Mon May 10 15:45:54 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Mon, 10 May 2021 15:45:54 +0200 Subject: [Scilab-users] Scilab compilation from scratch (was Re: spec can crash scilab) In-Reply-To: References: <7c3a0a6e-581f-4486-8bf7-7507f69120cc@laas.fr> <3dd65e10-dd2c-9197-a29e-1c25d4695252@utc.fr> <5400650e-5666-83a1-1cbc-1c33d6a447b6@free.fr> <416a2084-0a27-8604-595d-9c06defcb7a3@laas.fr> <40068fc0-3af3-e2ea-1d9b-795b46576d90@laas.fr> <22328739-ff89-7f43-c677-f418a8358ab7@laas.fr> Message-ID: <06f9f32b-b003-4b68-1ff4-8f98d358b25f@laas.fr> Le 10/05/2021 ? 15:35, Cl?ment David a ?crit?: >> -----Original Message----- >> From: users On Behalf Of Antoine >> Monmayrant >> Sent: Monday, May 10, 2021 1:02 PM >> To: users at lists.scilab.org >> Subject: Re: [Scilab-users] Scilab compilation from scratch (was Re: spec can >> crash scilab) >> >> >> Le 10/05/2021 ? 09:12, Cl?ment David a ?crit?: >>> To fix, remove libstdc++.so and libgfortran.so on the Prerequirements; >> Er, OK, I'm glad to do that, but I don't see what you are talking about. >> Where are those 'Prerequirements' defined? >> >> (I'm really not versed into compiling, I just barely know the basics...) > What we called Prerequirements (or thirdparties) are binaries used for the Scilab compilation but coming from external sources (for example, libxml2 or curl). At configure time, a detection is performed to use them rather than using the system's ones. If you used the cheatsheet, they are delivered with the svn command and should be located on the "usr" directory. Ah, OK, so I should just get rid of them after the svn command to rely on the binaries provided by my system. Thanks. Antoine > > Cl?ment > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > From sgougeon at free.fr Mon May 10 17:28:15 2021 From: sgougeon at free.fr (Samuel Gougeon) Date: Mon, 10 May 2021 17:28:15 +0200 Subject: [Scilab-users] Curing scf() & figure() slowliness: a good target for Scilab 6.0.1 In-Reply-To: <0b84b337-7106-a05e-66db-c728778cc762@free.fr> References: <0b84b337-7106-a05e-66db-c728778cc762@free.fr> Message-ID: <8d04ed67-62b9-41cc-8091-bf0d74822b9c@free.fr> Le 25/02/2017 ? 18:05, Samuel Gougeon a ?crit?: > Hello, > > Opening a new empty figure (without drawing anything) is a so common > elementary task and it has become so long that i have built a short > benchmark about it from Scilab 4.1.2 to Scilab 6.0. > Detailed results are here-below. The main conclusions are the following: > > 1. with no pre-existing figure,*scf**() is **20 times slower in **5.5 > and 6.0 than in *its best performances in *5.3.0*. On my computer, > it takes 0.062 s with 5.3.0 and 1.3 s now (5.5.2|6.0). > Scilab 5.4.0, 5.4.1 and 5.5.0 have dramatically damaged performances. > The loss is even 10x bigger with figure(): it is ~200 times slower > with Scilab 5.5 & 6.0 than with Scilab 4.1.2 > > 2. Since Scilab 5.5.0, the time taken to open a new figure increases > linearly with the number of already opened figures. On my > computer, opening the first one (after loading scf()) takes 1.8 s, > and opening the 20th one takes almost 10 s. This is still the case > with Scilab 6.0. > > *Detailled results: * > > 1. Opening the first figure : > Only 2 tests are reported with figure() instead of scf(). > ?t=0; for i=1:50, tic(); scf(); t=t+toc(); xdel(); end; t, t/50 > [s] [s] 4.1.2 base figure() > 6.0.0 : 62.39/50 1.248 18.5 2.32 > 5.5.2 : 73.62/50 1.4723 21.8 > 5.5.0 : 69.94/50 1.3988 20.8 > 5.4.1 : 37.33/50 0.7466 11.1 > 5.4.0 : 24.07/50 0.4814 7.14 > 5.3.0 : 3.102/50 0.0620 0.92 > 5.1.0 : 4.069/50 0.0814 1.21 > 4.1.2 : 3.370/50 0.0674 1.00 0.014 > 2. Opening 20 figures : > t=[]; for i=1:20, tic(); scf(); t(i)=toc(); end; sum(t)/20 > > 6.0.0 : 5.30 [1.35 => 9.51] > 5.5.2 : 5.68 [1.77 => 9.92] > 5.5.0 : 5.66 [1.82 => 9.85] range from the #1 to #20 > 5.4.1 : 1.18 > 5.4.0 : 0.923 > 5.3.0 : 0.110 > 5.1.0 : > 4.1.2 : 0.0774 > > Samuel This issue is fixed in Scilab 6.1.0, on Windows 10. Fortunately. Here are the current Scilab 6.1.0 performances (on another computer than in 2017): It is still ~5x slower than with Scilab 4.1.2 (on the same computer), but it no longer depends on the number or figures currently opened. Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: jcodlckpmnenjjdp.png Type: image/png Size: 7754 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: jgdmiphdjmkceaap.png Type: image/png Size: 8579 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: gmafflebljgnpgfe.png Type: image/png Size: 9621 bytes Desc: not available URL: From sgougeon at free.fr Mon May 10 21:41:00 2021 From: sgougeon at free.fr (Samuel Gougeon) Date: Mon, 10 May 2021 21:41:00 +0200 Subject: [Scilab-users] Variable scope in Scilab In-Reply-To: References: Message-ID: <5fd84c58-e869-e379-867e-773f88cb66f2@free.fr> Hello, Le 26/02/2021 ? 14:38, St?phane Mottelet a ?crit?: > Hi all, > > In Scilab the scope of variables is quite permissive but even in Julia > (really strict rules) we can have the following behavior: > > function y=f(x) > ?y=x+a; > end > > a=1; > f(2) > a=2; > f(3) > > -> a=1; > > --> f(2) > ?ans? = > > ?? 3. > > --> a=2; > > --> f(3) > ?ans? = > > ?? 5. > > Yesterday afternoon I was my students for a Scilab beginners tutorial, > and by accident one of them had "x" defined before in the main > workspace and tried to call f without arguments. I reproduce the > experiment here by explicitely defining x before the call: > > x=1; > f > > --> x=1; > > --> f > ?ans? = > > ?? 3. > > Allowing the function inner scope to see variables of the outer scope > is one thing, you may or may not agree this is not the point here, but > allowing to call f without arguments just because the formal input > parameter has the same symbol as an outer scope symbol is another > thing. I knew this was possible even if i never used such a feature, > but my students were so puzzled by this, particularly those who > already learned other low-level languages, that I decided to propose > the suppression of this, that I consider as a serious potential source > of many bugs. Don't tell me that this would break some user code > because I frankly have no consideration for this kind of crappy > shortcut and, sorry if it may sound rude, for programmers who use it... If low-level languages would be mandatory references imposing all their constrains, Scilab and other high level languages would not exist. Most often, the same people knowing "only" low level languages do not understand vectorized syntaxes and prefer to write as many explicit (nested) /for/ loops as needed. Very nice... :-/ About the topic: likely, i would not consider input and output arguments in the same way: * Input arguments*: As soon as external variables can be seen from the function, i do not see fundamental differences between an input argument -- that technically speaking can always be optional --, and any other internal variable. /It's the author's responsibility to properly test and initialize input arguments as is. We can't replace this responsability with an exception to a general scoping rule./ Accepting that the result can be built from external objects out of the list of input arguments.. already weakens the specific role of these ones (by the way as in object oriented programming, where operands are most often class attributes "in an external context" out of the list of input arguments). You propose to "reinforce" the strictness of their role, but without weakening the accessibility of external objects. Doesn't it look? a bit arbitrary, and vain? I don't think it would make programming neither easier nor really more "reliable". *Output arguments*: they are more clearly expected to be products of the function, not of anything else.? Initializing them from outside looks more awkward and tricky. My two cents.. Regards Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Mon May 10 21:56:55 2021 From: sgougeon at free.fr (Samuel Gougeon) Date: Mon, 10 May 2021 21:56:55 +0200 Subject: [Scilab-users] Variable scope in Scilab In-Reply-To: <5fd84c58-e869-e379-867e-773f88cb66f2@free.fr> References: <5fd84c58-e869-e379-867e-773f88cb66f2@free.fr> Message-ID: <0fdcbb49-14f9-9a2f-8fd1-9162fc59354a@free.fr> Anyway, to me this topic looks (very) much less critical than the (bug or intentional?) disabling of funcprot() in Scilab 6. In Scilab 6, on one hand all "control" keywords select/if/then/else/return/ etc are now protected. On the other hand, funcprot() no longer works and makes fragile all native macros and builtin symbols... A very inconsistent and impacting roadmap. Putting Scilab in students hands is much more prone to errors due to this unprotection, than due to external initializations.. Samuel Le 10/05/2021 ? 21:41, Samuel Gougeon a ?crit?: > Hello, > > Le 26/02/2021 ? 14:38, St?phane Mottelet a ?crit?: >> Hi all, >> >> In Scilab the scope of variables is quite permissive but even in >> Julia (really strict rules) we can have the following behavior: >> .../... From david.cheze at cea.fr Tue May 11 18:00:27 2021 From: david.cheze at cea.fr (CHEZE David 227480) Date: Tue, 11 May 2021 16:00:27 +0000 Subject: [Scilab-users] find and locate local maxima In-Reply-To: References: <9dce5c0e-4d74-6966-0e94-e8658cb50f9e@gmail.com> Message-ID: <47ed2fa3b67c4edab735c8bbb9e26493@cea.fr> Dear all, I used this new feature, set of sgolayfilter functions, to filter my experimental data (several days records , ) without attenuating the signal level, very practical and straightforward use. Then, applying findpeaks() (introduced below ) worked like a charm to draw figures like the one attached, what was the original aim. Help files for sgolayfilter functions are well documented. Thank you all ! David WIN10-64bits, Scilab 6.1.0 De : users De la part de Cl?ment David Envoy? : jeudi 18 mars 2021 15:08 ? : Users mailing list for Scilab Objet : Re: [Scilab-users] find and locate local maxima Hello David, I merged the change, it is now available on Scilab nightly build and on all CI builds after scilab-6.1-windows-64 #4595 [Jenkins] . Feel free to open bugs or reply on this thread if you have comments on this new feature. Thanks, Cl?ment From: users > On Behalf Of CHEZE David 227480 Sent: Thursday, March 18, 2021 12:44 PM To: Users mailing list for Scilab > Subject: Re: [Scilab-users] find and locate local maxima Hi all, I?d be glad obviously to download the whole package to test it and report my experience : I?m not use with the ?review interface? is there any way to download the whole package or I just retrieve files one by one ? Thanks, David De : users > De la part de St?phane Mottelet Envoy? : mercredi 17 mars 2021 10:40 ? : users at lists.scilab.org Objet : Re: [Scilab-users] find and locate local maxima Thanks Cl?ment. Interested users can readily download the files if they want to test the implementation even if it has not been reviewed. Particularly, it has not been discussed if we want to stick to the Matlab's implementation and API for this particular feature. Comments are welcome. S. Le 17/03/2021 ? 10:19, Cl?ment David a ?crit : Hello all, I take your question as a way to explain / remind how we validate user contributions into the Scilab source code. Any change to the source code should be pushed to the codereview.scilab.org website (this is a gerrit instant, a git server that help reviewing changes). This help testing on multiple machines/OS/compilers and review the content ; any user can comment and give +1/-1 on a change. After there is no disagreement, we merge it into the Scilab source code. The ?Cannot merge? error is an alert to the reviewer, this commit need to be rebase (refreshed) against the latest source code ; this is not a blocker for the review but rather for a one-click merge ?. Regards, Cl?ment From: users On Behalf Of Claus Futtrup Sent: Tuesday, March 16, 2021 7:40 PM To: users at lists.scilab.org Subject: Re: [Scilab-users] find and locate local maxima Hi St?phane It looks very nice and I hope it will be added to Scilab as proposed by your code review. Why does it say in red print "Cannot Merge" ? /Claus On 16-03-2021 17:45, St?phane Mottelet wrote: Hi For real life signals you should rather use something like this (Savitsky-Golay filters) https://codereview.scilab.org/#/c/21499/ S. Le 16/03/2021 ? 17:09, CHEZE David 227480 a ?crit : Hi Cl?ment, Thank you for your quick reply and solution ! Actually it?s working for simple data but with noisy experimental timeseries, some filtering is required to get perfect regular signal (between the ?true? extrema) that could be then managed by the routine. I suppose this is something the Matlab/Octave is handling internally, with some parameters as function?s argument to tune it, maybe it?s not the case . Regards, David De : users De la part de Cl?ment David Envoy? : mardi 16 mars 2021 16:27 ? : Users mailing list for Scilab Objet : Re: [Scilab-users] find and locate local maxima Hello David, After reading the Matlab documentation page, it seems pretty simple to implement using Scilab : and $ symbols: function [pks, locs]=findpeaks(data) ii = find(d(1:$-2) < d(2:$-1) & d(2:$-1) >= d(3:$)); pks = data(ii+2); locs = ii + 2; endfunction data = [25 8 15 5 6 10 10 3 1 20 7]; plot(data) [pks,locs] = findpeaks(data); plot(locs, pks, 'xr'); Note: using oct2py and pims might also be an option for simple cases but these wrappers are complex to use and data need to be copied at language boundaries. Regards, Cl?ment From: users > On Behalf Of CHEZE David 227480 Sent: Tuesday, March 16, 2021 2:53 PM To: Users mailing list for Scilab > Subject: [Scilab-users] find and locate local maxima Hi all, I?m looking for function that could find and locate every local maxima of any discrete time signal (timeseries), similar to Matlab or Octave function findpeaks(), scipy find_peaks(). Is anyone aware if something similar is already available in Scilab ? (I already browsed a little bit and it don?t seem so?) If not in Scilab macros, any hint to use the Octave or scipy function directly from Scilab? More globally it seems that Octave Forge could be linked with Python (from oct2py import octave # Load the Octage-Forge signal package. octave.eval("pkg load signal")), does someone ever tried to bridge similarly in Scilab ? oct2sci Kind regards, David _______________________________________________ users mailing list users at lists.scilab.org https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet _______________________________________________ users mailing list users at lists.scilab.org http://lists.scilab.org/mailman/listinfo/users _______________________________________________ users mailing list users at lists.scilab.org https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: figSgolayf&findpeak.png Type: image/png Size: 12071 bytes Desc: figSgolayf&findpeak.png URL: From stephane.mottelet at utc.fr Tue May 11 19:36:07 2021 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Tue, 11 May 2021 19:36:07 +0200 Subject: [Scilab-users] find and locate local maxima In-Reply-To: <47ed2fa3b67c4edab735c8bbb9e26493@cea.fr> References: <9dce5c0e-4d74-6966-0e94-e8658cb50f9e@gmail.com> <47ed2fa3b67c4edab735c8bbb9e26493@cea.fr> Message-ID: <553c526e-8884-f470-70ce-31fd2de77823@utc.fr> Hi, Great to hear that these new features (thanks to Serge Steer) were usefull for you. S. Le 11/05/2021 ? 18:00, CHEZE David 227480 a ?crit?: > > Dear all, > > I used this new feature, set of sgolayfilter functions, to filter my > experimental data (several days records , ) without attenuating the > signal level, very practical and straightforward use. Then, applying > findpeaks() (introduced below ) worked like a charm to draw figures > like the one attached, what was the original aim. > > Help files for sgolayfilter functions are well documented. > > Thank you all ! > > David > > WIN10-64bits, Scilab 6.1.0 > > *De?:* users *De la part de* Cl?ment > David > *Envoy??:* jeudi 18 mars 2021 15:08 > *??:* Users mailing list for Scilab > *Objet?:* Re: [Scilab-users] find and locate local maxima > > Hello David, > > I merged the change, it is now available on Scilab nightly build and > on all CI builds after scilab-6.1-windows-64 #4595 [Jenkins] > > . Feel free to open bugs or reply on this thread if you have comments > on this new feature. > > Thanks, > > Cl?ment > > *From:*users > *On Behalf Of *CHEZE David 227480 > *Sent:* Thursday, March 18, 2021 12:44 PM > *To:* Users mailing list for Scilab > > *Subject:* Re: [Scilab-users] find and locate local maxima > > Hi all, > > I?d be glad obviously to download the whole package to test it and > report my experience :? I?m not use with the ?review interface? is > there any way to download the whole package or I just retrieve files > one by one ? > > Thanks, > > David > > *De?:* users > *De la part de* St?phane Mottelet > *Envoy??:* mercredi 17 mars 2021 10:40 > *??:* users at lists.scilab.org > *Objet?:* Re: [Scilab-users] find and locate local maxima > > Thanks Cl?ment. > > Interested users can readily download the files if they want to test > the implementation even if it has not been reviewed. Particularly, it > has not been discussed if we want to stick to the Matlab's > implementation and API for this particular feature. Comments are welcome. > > S. > > Le 17/03/2021 ? 10:19, Cl?ment David a ?crit?: > > Hello all, > > I take your question as a way to explain / remind how we validate > user contributions into the Scilab source code. Any change to the > source code should be pushed to the codereview.scilab.org website > (this is a gerrit instant, a git server that help reviewing > changes). This help testing on multiple machines/OS/compilers and > review the content ; any user can comment and give +1/-1 on a > change. After there is no disagreement, we merge it into the > Scilab source code. > > The ?Cannot merge? error is an alert to the reviewer, this commit > need to be rebase (refreshed) against the latest source code ; > this is not a blocker for the review but rather for a one-click > merge ?. > > Regards, > > Cl?ment > > *From:* users > *On Behalf Of *Claus Futtrup > *Sent:* Tuesday, March 16, 2021 7:40 PM > *To:* users at lists.scilab.org > *Subject:* Re: [Scilab-users] find and locate local maxima > > Hi St?phane > > It looks very nice and I hope it will be added to Scilab as > proposed by your code review. Why does it say in red print "Cannot > Merge" ? > > /Claus > > On 16-03-2021 17:45, St?phane Mottelet wrote: > > Hi > > For real life signals you should rather use something like > this (Savitsky-Golay filters) > > https://codereview.scilab.org/#/c/21499/ > > > S. > > Le 16/03/2021 ? 17:09, CHEZE David 227480 a ?crit?: > > Hi Cl?ment, > > Thank you for your quick reply and solution ! Actually > it?s working for simple data but with noisy experimental > timeseries, some filtering is required to get perfect > regular signal (between the ?true? extrema) that could be > then managed by the routine. I suppose this is something > the Matlab/Octave is handling internally, with some > parameters as function?s argument to tune it, maybe it?s > not the case . > > Regards, > > David > > *De?:* users > *De la part de* > Cl?ment David > *Envoy??:* mardi 16 mars 2021 16:27 > *??:* Users mailing list for Scilab > > *Objet?:* Re: [Scilab-users] find and locate local maxima > > Hello David, > > After reading the Matlab documentation page, it seems > pretty simple to implement using Scilab : and $ symbols: > > function[*pks*, *locs*]=_findpeaks_(*data*) > > ii = find(d(1:$-2) < d(2:$-1) & d(2:$-1) >= d(3:$)); > > *pks* = *data*(ii+2); > > *locs* = ii + 2; > > endfunction > > data= [25 8 15 5 6 10 10 3 1 20 7]; > > _plot_(data) > > [pks,locs]= _findpeaks_(data); > > _plot_(locs,pks, 'xr'); > > Note: using oct2py and pims might also be an option for > simple cases but these wrappers are complex to use and > data need to be copied at language boundaries. > > Regards, > > Cl?ment > > *From:* users > *On Behalf Of > *CHEZE David 227480 > *Sent:* Tuesday, March 16, 2021 2:53 PM > *To:* Users mailing list for Scilab > > > *Subject:* [Scilab-users] find and locate local maxima > > Hi all, > > I?m looking for function that could find and locate every > local maxima of any discrete time signal (timeseries), > similar to Matlab or Octave function findpeaks(), scipy > find_peaks(). Is anyone aware if something similar is > already available in Scilab ? (I already browsed a little > bit and it don?t seem so?) > > If not in Scilab macros, any hint to use the Octave or > scipy function directly from Scilab? > > More globally it seems that Octave Forge could be linked > with Python (from oct2py import octave > > # Load the Octage-Forge signal package. > > octave.eval("pkg load signal")), does someone ever tried > to bridge similarly in Scilab ? oct2sci > > Kind regards, > > David > > _______________________________________________ > > users mailing list > > users at lists.scilab.org > > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users > > > -- > > St?phane Mottelet > > Ing?nieur de recherche > > EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable > > D?partement G?nie des Proc?d?s Industriels > > Sorbonne Universit?s - Universit? de Technologie de Compi?gne > > CS 60319, 60203 Compi?gne cedex > > Tel : +33(0)344234688 > > http://www.utc.fr/~mottelet > > > _______________________________________________ > > users mailing list > > users at lists.scilab.org > > http://lists.scilab.org/mailman/listinfo/users > > > _______________________________________________ > > users mailing list > > users at lists.scilab.org > > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users > > -- > St?phane Mottelet > Ing?nieur de recherche > EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable > D?partement G?nie des Proc?d?s Industriels > Sorbonne Universit?s - Universit? de Technologie de Compi?gne > CS 60319, 60203 Compi?gne cedex > Tel : +33(0)344234688 > http://www.utc.fr/~mottelet > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jean-Yves.Baudais at insa-rennes.fr Wed May 19 10:18:48 2021 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Wed, 19 May 2021 10:18:48 +0200 Subject: [Scilab-users] Why modified help file are not updated on the help window witout Scilab exit and restart Message-ID: <097aacd0-d280-37f8-edbf-d6ae1b06068c@insa-rennes.fr> Hello, The problem is: I don't want to restart Scilab each time I modify one help file, to take it into account. Now the details. When I modify the help file, let say "myfunction.xml" in "mylibrary" toolbox, I do (current directory is the toolbox root directory) fist I close the help window if it is opened, and > exec unloader.sce; > exec cleaner.sce; > exec builder.sce; > exec loader.sce; > help myfunction But, the modification is not updated in the help window. I should exit and restart Scilab to see the modification. Am I doing something wrong? In short (only for the help part), 1) unloader does > del_help_chapter("mylibrary", %F); and it works, "mylibrary" is removed from the help; 2) clearner does > rmdir(root_tlbx + "/jar/", "s"); and it works, the ./jar/scilab_fr_FR_help.jar file is deleted; 3) builder does > tbx_builder_help(toolbox_dir); that is > xmltojar(path, moduletitle, directory_language, default_language); and it works, the ./jar/scilab_fr_FR_help.jar is created and all the ./help/fr_FR/scilab_fr_FR_help/* files are created (updated here). If I open the file ./help/fr_FR/scilab_fr_FR_help/myfunction.html I see the modification. But I can see the modification with > help myfunction unless I quite Scilab It looks like the first call of the help upload the help documentation in memory (and create %helps global variable), and if the files of the documentation are removed from help, modified and re-added, the next call of the help function consider only what has been uploaded first and don't read the modified jar nor html files! Is Scilab operate like that? If yes, it's a bug. If not why > help myfunction is not updated while all the files are! Thanks for your insight, --Jean-Yves From Jean-Yves.Baudais at insa-rennes.fr Wed May 19 13:25:43 2021 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Wed, 19 May 2021 13:25:43 +0200 Subject: [Scilab-users] Why modified help file are not updated on the help window witout Scilab exit and restart In-Reply-To: <097aacd0-d280-37f8-edbf-d6ae1b06068c@insa-rennes.fr> References: <097aacd0-d280-37f8-edbf-d6ae1b06068c@insa-rennes.fr> Message-ID: Sorry, I forgot 4) loader does > add_help_chapter(TOOLBOX_NAME, path_addchapter, %F); and it works, "mylibrary" is added as a chapter in the help. But I can see... Le 19/05/2021 ? 10:18, Jean-Yves Baudais a ?crit?: > Hello, > > The problem is: I don't want to restart Scilab each time I modify one > help file, to take it into account. Now the details. > > ? When I modify the help file, let say "myfunction.xml" in "mylibrary" > toolbox, I do (current directory is the toolbox root directory) > > fist I close the help window if it is opened, and > > > exec unloader.sce; > > exec cleaner.sce; > > exec builder.sce; > > exec loader.sce; > > help myfunction > > But, the modification is not updated in the help window. I should exit > and restart Scilab to see the modification. Am I doing something wrong? > > In short (only for the help part), > 1) unloader does > > del_help_chapter("mylibrary", %F); > and it works, "mylibrary" is removed from the help; > > 2) clearner does > > rmdir(root_tlbx + "/jar/", "s"); > and it works, the ./jar/scilab_fr_FR_help.jar file is deleted; > > 3) builder does > > tbx_builder_help(toolbox_dir); > that is > > xmltojar(path, moduletitle, directory_language, default_language); > and it works, the ./jar/scilab_fr_FR_help.jar is created and all the > ./help/fr_FR/scilab_fr_FR_help/* files are created (updated here). If I > open the file ./help/fr_FR/scilab_fr_FR_help/myfunction.html I see the > modification. > > But I can see the modification with > > help myfunction > unless I quite Scilab > > It looks like the first call of the help upload the help documentation > in memory (and create %helps global variable), and if the files of the > documentation are removed from help, modified and re-added, the next > call of the help function consider only what has been uploaded first and > don't read the modified jar nor html files! > > Is Scilab operate like that? If yes, it's a bug. If not why > > help myfunction > is not updated while all the files are! > > Thanks for your insight, > > --Jean-Yves