From: prascle Date: Tue, 29 May 2007 16:08:03 +0000 (+0000) Subject: mergefrom_V4_0 X-Git-Tag: BR_For40_DSC_20070622~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=651fd965ca6b119baf4570f6934755f9d2bd1ce3;p=modules%2Fkernel.git mergefrom_V4_0 --- diff --git a/COPYING b/COPYING index d60c31a97..b1e3f5a26 100644 --- a/COPYING +++ b/COPYING @@ -1,221 +1,397 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 - Copyright (C) 1989, 1991 Free Software Foundation, Inc. + Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. The precise terms and conditions for copying, distribution and -modification follow. +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. - GNU GENERAL PUBLIC LICENSE + GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: - a) You must cause the modified files to carry prominent notices + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, +identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of +on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. +entire whole, and thus to each and every part regardless of who wrote +it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or -collective works based on the Program. +collective works based on the Library. -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are +distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying -the Program or works based on it. +the Library or works based on it. - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to +You are not responsible for enforcing compliance by third parties with this License. - - 7. If, as a consequence of a court judgment or allegation of patent + + 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. +refrain entirely from distribution of the Library. -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is +integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that @@ -225,116 +401,104 @@ impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in + + 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. NO WARRANTY - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. END OF TERMS AND CONDITIONS - How to Apply These Terms to Your New Programs + How to Apply These Terms to Your New Libraries - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. - + Copyright (C) - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Also add information on how to contact you by electronic and paper mail. -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if +school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. - , 1 April 1989 + , 1 April 1990 Ty Coon, President of Vice -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. +That's all there is to it! + + diff --git a/bin/addToKillList.py b/bin/addToKillList.py index 390ac2aaa..f29cccef7 100755 --- a/bin/addToKillList.py +++ b/bin/addToKillList.py @@ -20,6 +20,7 @@ # import os, sys, pickle, string, signal +from launchConfigureParser import verbose ########## adds to the kill list of SALOME one more process ########## @@ -43,7 +44,7 @@ def findFileDict(): except: pass pass - print "myport = ", my_port + if verbose(): print "myport = ", my_port return my_port def addToKillList(command_pid, command): @@ -60,7 +61,7 @@ def addToKillList(command_pid, command): already_in=0 for process_id in process_ids: - print process_id + if verbose(): print process_id for pid, cmd in process_id.items(): #print "see process %s : %s"% (pid, cmd[0]) if pid == command_pid: @@ -111,5 +112,5 @@ def killList(): if __name__ == "__main__": - print sys.argv + if verbose(): print sys.argv addToKillList(sys.argv[1], sys.argv[2]) diff --git a/bin/envSalome.py b/bin/envSalome.py index f0dcd7b3a..9ea098c10 100755 --- a/bin/envSalome.py +++ b/bin/envSalome.py @@ -28,8 +28,13 @@ sys.path[:0]=[kernel_root+"/bin/salome"] #import runSalome -argv=sys.argv[1:] -sys.argv=[] +argv = sys.argv[1:] + +#sys.argv = [sys.argv[0]] +#if len(argv) > 3: +# sys.argv += argv[3:] +if len(argv) > 2: + sys.argv = argv[2:] args, modules_list, modules_root_dir = setenv.get_config() #runSalome.set_env(args, modules_list, modules_root_dir) diff --git a/bin/killSalome.py b/bin/killSalome.py index 2d93685ef..9e65ae4ce 100755 --- a/bin/killSalome.py +++ b/bin/killSalome.py @@ -33,5 +33,21 @@ def killAllPorts(): killMyPort(mo.groups()[0]) pass + cmd = "pid=`ps -fea | grep '"+os.getenv('USER')+"' | grep 'ghs3d' | grep 'f /tmp/GHS3D_' | grep -v 'grep' | awk '{print $2}'` ; echo $pid > /tmp/logs/"+os.getenv('USER')+"/_"+"Pid_ghs3d.log" + a = os.system(cmd) + try: + fpidomniNames=open('/tmp/logs/'+os.getenv('USER')+"/_"+"Pid_ghs3d.log") + prc = fpidomniNames.read() + fpidomniNames.close() + if prc != None : + for field in prc.split(" ") : + field = field.strip() + if field != None and len(field) != 0: + os.system('kill -9 '+field) + except: + pass + pass + if __name__ == "__main__": killAllPorts() + diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index 45ffd89c7..86d112af8 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -20,6 +20,7 @@ # import os, sys, pickle, signal, commands +from launchConfigureParser import verbose def getPiDict(port,appname='salome',full=True): from Utils_Identity import getShortHostName @@ -99,11 +100,12 @@ def killMyPort(port): for field in prc.split(" ") : if field == "omniNames" : if pidfield != "egrep" : - print 'stop process '+pidfield+' : omniNames' if sys.platform == "win32": import win32pm + print 'stop process '+pidfield+' : omniNames' win32pm.killpid(int(pidfield),0) else: + if verbose(): print 'stop process '+pidfield+' : omniNames' os.system('kill -9 '+pidfield) pidfield = field except: @@ -115,7 +117,7 @@ def killMyPort(port): for process_id in process_ids: for pid, cmd in process_id.items(): - print "stop process %s : %s"% (pid, cmd[0]) + if verbose(): print "stop process %s : %s"% (pid, cmd[0]) try: if sys.platform == "win32": import win32pm @@ -123,7 +125,7 @@ def killMyPort(port): else: os.kill(int(pid),signal.SIGKILL) except: - print " ------------------ process %s : %s not found"% (pid, cmd[0]) + if verbose(): print " ------------------ process %s : %s not found"% (pid, cmd[0]) pass pass except: diff --git a/bin/launchConfigureParser.py b/bin/launchConfigureParser.py index a91e3033d..e34150400 100755 --- a/bin/launchConfigureParser.py +++ b/bin/launchConfigureParser.py @@ -19,6 +19,8 @@ import os, glob, string, sys, re import xml.sax +import optparse +import types # names of tags in XML configuration file doc_tag = "document" @@ -42,13 +44,11 @@ killall_nam = "killall" modules_nam = "modules" embedded_nam = "embedded" standalone_nam = "standalone" -containers_nam = "containers" key_nam = "key" terminal_nam = "terminal" interp_nam = "interp" except_nam = "noexcepthandler" terminal_nam = "terminal" -case_nam = "test" # values in XML configuration file giving specific module parameters ( section) # which are stored in opts with key _ (eg SMESH_plugins) @@ -57,15 +57,16 @@ plugins_nam = "plugins" # values passed as arguments, NOT read from XML config file, but set from within this script appname_nam = "appname" port_nam = "port" -appname = "SalomeApp" +salomeappname = "SalomeApp" script_nam = "pyscript" # values of boolean type (must be '0' or '1'). # xml_parser.boolValue() is used for correct setting -boolKeys = ( gui_nam, splash_nam, logger_nam, file_nam, xterm_nam, portkill_nam, killall_nam, interp_nam, except_nam ) +boolKeys = ( gui_nam, splash_nam, logger_nam, file_nam, xterm_nam, portkill_nam, killall_nam, except_nam ) +intKeys = ( interp_nam, ) # values of list type -listKeys = ( containers_nam, embedded_nam, key_nam, modules_nam, standalone_nam, plugins_nam ) +listKeys = ( embedded_nam, key_nam, modules_nam, standalone_nam, plugins_nam ) ### # Get the application version @@ -117,7 +118,7 @@ def version_id( fname ): ### # Get user configuration file name ### -def userFile(): +def userFile(appname): v = version() if not v: return "" # not unknown version @@ -147,6 +148,30 @@ def userFile(): last_file = file return last_file +# -- + +_verbose = None + +def verbose(): + global _verbose + # verbose has already been called + if _verbose is not None: + return _verbose + # first time + try: + from os import getenv + _verbose = int(getenv('SALOME_VERBOSE')) + except: + _verbose = 0 + pass + # + return _verbose + +def setVerbose(level): + global _verbose + _verbose = level + return + # ----------------------------------------------------------------------------- ### @@ -157,7 +182,7 @@ section_to_skip = "" class xml_parser: def __init__(self, fileName, _opts ): - print "Configure parser: processing %s ..." % fileName + if verbose(): print "Configure parser: processing %s ..." % fileName self.space = [] self.opts = _opts self.section = section_to_skip @@ -167,12 +192,31 @@ class xml_parser: pass def boolValue( self, str ): - if str in ("yes", "y", "1"): - return 1 - elif str in ("no", "n", "0"): - return 0 - else: - return str + strloc = str + if isinstance(strloc, types.UnicodeType): + strloc = strloc.encode().strip() + if isinstance(strloc, types.StringType): + strlow = strloc.lower() + if strlow in ("1", "yes", "y", "on", "true", "ok"): + return True + elif strlow in ("0", "no", "n", "off", "false", "cancel"): + return False + return strloc + pass + + def intValue( self, str ): + strloc = str + if isinstance(strloc, types.UnicodeType): + strloc = strloc.encode().strip() + if isinstance(strloc, types.StringType): + strlow = strloc.lower() + if strlow in ("1", "yes", "y", "on", "true", "ok"): + return 1 + elif strlow in ("0", "no", "n", "off", "false", "cancel"): + return 0 + else: + return string.atoi(strloc) + return strloc pass def startElement(self, name, attrs): @@ -207,6 +251,8 @@ class xml_parser: key = self.section + "_" + nam if nam in boolKeys: self.opts[key] = self.boolValue( val ) # assign boolean value: 0 or 1 + elif nam in intKeys: + self.opts[key] = self.intValue( val ) # assign integer value elif nam in listKeys: self.opts[key] = val.split( ',' ) # assign list value: [] else: @@ -240,43 +286,243 @@ class xml_parser: # ----------------------------------------------------------------------------- -### -# Command line options parser -### -def options_parser(line): - source = line - list = [] - for delimiter in [" ", ",", "="]: - for o in source: - list += string.split(o, delimiter) - pass - source = list - list = [] - pass - - result = {} - i = 0 - while i < len(source): - if source[i][0] != '-': - key = None - elif source[i][1] == '-': - key = source[i][2:] - else: - key = source[i][1:] - pass +booleans = { '1': True , 'yes': True , 'y': True , 'on' : True , 'true' : True , 'ok' : True, + '0': False, 'no' : False, 'n': False, 'off': False, 'false': False, 'cancel' : False } - if key is None and not result: - raise Exception() - result[key] = [] - if key: - i += 1 - pass - while i < len(source) and source[i][0] != '-': - result[key].append(source[i]) - i += 1 - pass - pass - return result +boolean_choices = booleans.keys() + +def store_boolean (option, opt, value, parser, *args): + if isinstance(value, types.StringType): + try: + value_conv = booleans[value.strip().lower()] + for attribute in args: + setattr(parser.values, attribute, value_conv) + except KeyError: + raise optparse.OptionValueError( + "option %s: invalid boolean value: %s (choose from %s)" + % (opt, value, boolean_choices)) + else: + for attribute in args: + setattr(parser.values, attribute, value) + +def CreateOptionParser (theAdditionalOptions=[]): + # GUI/Terminal. Default: GUI + help_str = "Launch without GUI (in the terminal mode)." + o_t = optparse.Option("-t", + "--terminal", + action="store_false", + dest="gui", + help=help_str) + + help_str = "Launch in GUI mode [default]." + o_g = optparse.Option("-g", + "--gui", + action="store_true", + dest="gui", + help=help_str) + + # Show Desktop (inly in GUI mode). Default: True + help_str = "1 to activate GUI desktop [default], " + help_str += "0 to not activate GUI desktop (Session_Server starts, but GUI is not shown). " + help_str += "Ignored in the terminal mode." + o_d = optparse.Option("-d", + "--show-desktop", + metavar="<1/0>", + #type="choice", choices=boolean_choices, + type="string", + action="callback", callback=store_boolean, callback_args=('desktop',), + dest="desktop", + help=help_str) + help_str = "Do not activate GUI desktop (Session_Server starts, but GUI is not shown). " + help_str += "The same as --show-desktop=0." + o_o = optparse.Option("-o", + "--hide-desktop", + action="store_false", + dest="desktop", + help=help_str) + + # Use logger or log-file. Default: nothing. + help_str = "Redirect messages to the CORBA collector." + #o4 = optparse.Option("-l", "--logger", action="store_true", dest="logger", help=help_str) + o_l = optparse.Option("-l", + "--logger", + action="store_const", const="CORBA", + dest="log_file", + help=help_str) + help_str = "Redirect messages to the " + o_f = optparse.Option("-f", + "--log-file", + metavar="", + type="string", + action="store", + dest="log_file", + help=help_str) + + # Execute python scripts. Default: None. + help_str = "Python script(s) to be imported. Python scripts are imported " + help_str += "in the order of their appearance. In GUI mode python scripts " + help_str += "are imported in the embedded python interpreter of current study, " + help_str += "otherwise in an external python interpreter" + o_u = optparse.Option("-u", + "--execute", + metavar="", + type="string", + action="append", + dest="py_scripts", + help=help_str) + + # Configuration XML file. Default: $(HOME)/.SalomeApprc.$(version). + help_str = "Parse application settings from the " + help_str += "instead of default $(HOME)/.SalomeApprc.$(version)" + o_r = optparse.Option("-r", + "--resources", + metavar="", + type="string", + action="store", + dest="resources", + help=help_str) + + # Use own xterm for each server. Default: False. + help_str = "Launch each SALOME server in own xterm console" + o_x = optparse.Option("-x", + "--xterm", + action="store_true", + dest="xterm", + help=help_str) + + # Modules. Default: Like in configuration files. + help_str = "SALOME modules list (where , are the names " + help_str += "of SALOME modules which should be available in the SALOME session)" + o_m = optparse.Option("-m", + "--modules", + metavar="", + type="string", + action="append", + dest="modules", + help=help_str) + + # Embedded servers. Default: Like in configuration files. + help_str = "CORBA servers to be launched in the Session embedded mode. " + help_str += "Valid values for : registry, study, moduleCatalog, " + help_str += "cppContainer [by default the value from the configuration files is used]" + o_e = optparse.Option("-e", + "--embedded", + metavar="", + type="string", + action="append", + dest="embedded", + help=help_str) + + # Standalone servers. Default: Like in configuration files. + help_str = "CORBA servers to be launched in the standalone mode (as separate processes). " + help_str += "Valid values for : registry, study, moduleCatalog, " + help_str += "cppContainer, pyContainer, [by default the value from the configuration files is used]" + o_s = optparse.Option("-s", + "--standalone", + metavar="", + type="string", + action="append", + dest="standalone", + help=help_str) + + # Kill with port. Default: False. + help_str = "Kill SALOME with the current port" + o_p = optparse.Option("-p", + "--portkill", + action="store_true", + dest="portkill", + help=help_str) + + # Kill all. Default: False. + help_str = "Kill all running SALOME sessions" + o_k = optparse.Option("-k", + "--killall", + action="store_true", + dest="killall", + help=help_str) + + # Additional python interpreters. Default: 0. + help_str = "The number of additional external python interpreters to run. " + help_str += "Each additional python interpreter is run in separate " + help_str += "xterm session with properly set SALOME environment" + o_i = optparse.Option("-i", + "--interp", + metavar="", + type="int", + action="store", + dest="interp", + help=help_str) + + # Splash. Default: True. + help_str = "1 to display splash screen [default], " + help_str += "0 to disable splash screen. " + help_str += "This option is ignored in the terminal mode. " + help_str += "It is also ignored if --show-desktop=0 option is used." + o_z = optparse.Option("-z", + "--splash", + metavar="<1/0>", + #type="choice", choices=boolean_choices, + type="string", + action="callback", callback=store_boolean, callback_args=('splash',), + dest="splash", + help=help_str) + + # Catch exceptions. Default: True. + help_str = "1 (yes,true,on,ok) to enable centralized exception handling [default], " + help_str += "0 (no,false,off,cancel) to disable centralized exception handling." + o_c = optparse.Option("-c", + "--catch-exceptions", + metavar="<1/0>", + #type="choice", choices=boolean_choices, + type="string", + action="callback", callback=store_boolean, callback_args=('catch_exceptions',), + dest="catch_exceptions", + help=help_str) + + # Print free port and exit + help_str = "Print free port and exit" + o_a = optparse.Option("--print-port", + action="store_true", + dest="print_port", default=False, + help=help_str) + + # Do not relink ${HOME}/.omniORB_last.cfg + help_str = "Do not save current configuration ${HOME}/.omniORB_last.cfg" + o_n = optparse.Option("--nosave-config", + action="store_false", + dest="save_config", default=True, + help=help_str) + + # All options + opt_list = [o_t,o_g, # GUI/Terminal + o_d,o_o, # Desktop + o_l,o_f, # Use logger or log-file + o_u, # Execute python scripts + o_r, # Configuration XML file + o_x, # xterm + o_m, # Modules + o_e, # Embedded servers + o_s, # Standalone servers + o_p, # Kill with port + o_k, # Kill all + o_i, # Additional python interpreters + o_z, # Splash + o_c, # Catch exceptions + o_a, # Print free port and exit + o_n] # --nosave-config + + #std_options = ["gui", "desktop", "log_file", "py_scripts", "resources", + # "xterm", "modules", "embedded", "standalone", + # "portkill", "killall", "interp", "splash", + # "catch_exceptions", "print_port", "save_config"] + + opt_list += theAdditionalOptions + + a_usage = "%prog [options] [STUDY_FILE]" + version_str = "Salome %s" % version() + pars = optparse.OptionParser(usage=a_usage, version=version_str, option_list=opt_list) + + return pars # ----------------------------------------------------------------------------- @@ -286,7 +532,9 @@ def options_parser(line): # this attribute is obsolete args = {} -def get_env(): +#def get_env(): +#args = [] +def get_env(theAdditionalOptions=[], appname="SalomeApp"): ### # Collect launch configuration files: # - The environment variable "Config" (SalomeAppConfig) which can @@ -295,7 +543,7 @@ def get_env(): # ${GUI_ROOT_DIR}/share/salome/resources/gui is inspected # - ${GUI_ROOT_DIR}/share/salome/resources/gui directory is always inspected # so it is not necessary to put it in the "Config" variable - # - The directories which are inspected are checked for files ".xml" + # - The directories which are inspected are checked for files ".xml" # (SalomeApp.xml) which define SALOME configuration # - These directories are analyzed beginning from the last one in the list, # so the first directory listed in "Config" environment variable @@ -315,8 +563,32 @@ def get_env(): if os.sys.platform == 'win32': separator = ";" + # check KERNEL_ROOT_DIR + try: + kernel_root_dir=os.environ["KERNEL_ROOT_DIR"] + except: + print """ + For each SALOME module, the environment variable _ROOT_DIR must be set. + KERNEL_ROOT_DIR is mandatory. + """ + sys.exit(1) + pass + + ############################ + # parse command line options + pars = CreateOptionParser(theAdditionalOptions) + (cmd_opts, cmd_args) = pars.parse_args(sys.argv[1:]) + ############################ + + # Process --print-port option + if cmd_opts.print_port: + from runSalome import searchFreePort + searchFreePort({}) + print "port:%s"%(os.environ['NSPORT']) + sys.exit(0) + pass - # set resources variable SaloemAppConfig if it is not set yet + # set resources variable SalomeAppConfig if it is not set yet dirs = [] if os.getenv(config_var): if sys.platform == 'win32': @@ -330,11 +602,17 @@ def get_env(): dirs.reverse() # reverse order, like in "path" variable - FILO-style processing + try: + dirs.remove('') # to remove empty dirs if the variable terminate by ":" or if there are "::" inside + except: + pass + _opts = {} # associative array of options to be filled # parse SalomeApp.xml files in directories specified by SalomeAppConfig env variable for dir in dirs: - filename = dir+'/'+appname+'.xml' + #filename = dir+'/'+appname+'.xml' + filename = dir+'/'+salomeappname+'.xml' if not os.path.exists(filename): print "Configure parser: Warning : could not find configuration file %s" % filename else: @@ -345,20 +623,28 @@ def get_env(): print "Configure parser: Error : can not read configuration file %s" % filename pass - # parse .SalomeApprc. file in user's home directory if it exists - # if user file for the current version is not found the nearest to it is used - filename = userFile() - if not filename or not os.path.exists(filename): + # parse user configuration file + # It can be set via --resources= command line option + # or is given by default from ${HOME}/.rc. + # If user file for the current version is not found the nearest to it is used + user_config = cmd_opts.resources + if not user_config: + user_config = userFile(appname) + if not user_config or not os.path.exists(user_config): print "Configure parser: Warning : could not find user configuration file" else: try: - p = xml_parser(filename, _opts) + p = xml_parser(user_config, _opts) _opts = p.opts except: print 'Configure parser: Error : can not read user configuration file' + user_config = "" args = _opts + args['user_config'] = user_config + #print "User Configuration file: ", args['user_config'] + # set default values for options which are NOT set in config files for aKey in listKeys: if not args.has_key( aKey ): @@ -391,143 +677,104 @@ def get_env(): args[port_nam] = my_port - # read command-line options + #################################################### + # apply command-line options to the arguments # each option given in command line overrides the option from xml config file - cmd_opts = {} - try: - cmd_opts = options_parser(sys.argv[1:]) - kernel_root_dir=os.environ["KERNEL_ROOT_DIR"] - except: - cmd_opts["h"] = 1 - pass - - # check if all command line options are correct - short_opts = ("h","g","l","f","x","m","e","s","c","p","k","t","i","r","z") - long_opts = (help_nam,gui_nam,logger_nam,file_nam,xterm_nam,modules_nam, - embedded_nam,standalone_nam,containers_nam,portkill_nam, - killall_nam,terminal_nam,interp_nam,except_nam,splash_nam, - case_nam) - opterror=0 - for opt in cmd_opts: - if opt not in short_opts and opt not in long_opts: - print "Configure parser: Error : command line error : -%s" % opt - opterror=1 - - if opterror == 1: - cmd_opts["h"] = 1 - - if cmd_opts.has_key("h") or cmd_opts.has_key(help_nam): - print """ - USAGE: runSalome.py [options] - - Command line options: - - --gui (-g) Launch in GUI mode [default]. - --terminal (-t) Launching without GUI (in the terminal mode). - --terminal=[,...] Launching without GUI (in the terminal mode) and - (-t=[,...]) additionally import python script(s). - --logger (-l) Redirect messages to the CORBA collector. - --file= (-f=) Redirect messages to the log file. - --xterm (-x) Launch each SALOME server in own xterm console. - --modules=,,... SALOME module list (where , - (-m=,,...) are the names of SALOME modules which should be - available in the SALOME session). - --embedded=,,... CORBA servers to be launched in the Session - (-e=,,...) embedded mode. - Valid values for : registry, study, - moduleCatalog, cppContainer - [default: all mentioned]. - --standalone=,,... CORBA servers to be launched in the standalone - (-s=,,...) mode (as separate processes). - Valid values for : registry, study, - moduleCatalog, cppContainer, pyContainer, - supervContainer - [default: pyContainer,supervContainer]. - --containers=,... [obsolete] SALOME containers to be launched. - (-c=,...) Valid values: cpp, python, superv - [default: use --embedded and --standalone - parameters]. - --portkill (-p) Kill SALOME with the current port. - --killall (-k) Kill all running SALOME sessions. - --interp= (-i=) The number of additional xterm sessions to open. - In each xterm session SALOME environment is set - properly. - --splash (-z) Display splash screen. - --noexcepthandler (-r) Disable centralized exception handling - mechanism. - --test= HDF file to be opened on GUI starting and/or - Python script(s) to be imported in the GUI - study. The files can appear in arbitrary order. - If the HDF file is given it is opened, otherwise - the new empty study is created. - Python scripts are imported in the order of - their appearance. - This option is avaiable only in GUI mode, - for batch mode use --terminal(-t) option. - --help (-h) Print this help info + # + # Options: gui, desktop, log_file, py_scripts, resources, + # xterm, modules, embedded, standalone, + # portkill, killall, interp, splash, + # catch_exceptions + + # GUI/Terminal, Desktop, Splash, STUDY_HDF + args["session_gui"] = False + args["study_hdf"] = None + if cmd_opts.gui is not None: + args[gui_nam] = cmd_opts.gui + if args[gui_nam]: + args["session_gui"] = True + if cmd_opts.desktop is not None: + args["session_gui"] = cmd_opts.desktop + args[splash_nam] = cmd_opts.desktop + if args["session_gui"]: + if cmd_opts.splash is not None: + args[splash_nam] = cmd_opts.splash + if len(cmd_args) > 0: + args["study_hdf"] = cmd_args[0] + else: + args["session_gui"] = False + args[splash_nam] = False - For each SALOME module, the environment variable _ROOT_DIR must be set. - KERNEL_ROOT_DIR is mandatory. - """ - sys.exit(1) - pass + # Logger/Log file + if cmd_opts.log_file is not None: + if cmd_opts.log_file == 'CORBA': + args[logger_nam] = True + else: + args[file_nam] = [cmd_opts.log_file] - # apply command-line options to the arguments - BATCHMODE_FORCED = False - NO_SPLASH_FORCED = False + # Python scripts args[script_nam] = [] - for opt in cmd_opts: - if opt in [ 'g', gui_nam ] : - if not BATCHMODE_FORCED: args[gui_nam] = 1 - if cmd_opts[opt] == ['0']: - args["session_gui"] = 0 - NO_SPLASH_FORCED = True - pass - elif opt in [ 't', terminal_nam ] : - args[gui_nam] = 0 - args[script_nam] = cmd_opts[opt] - BATCHMODE_FORCED = True - elif opt in [ 'z', splash_nam ] : - if not NO_SPLASH_FORCED: - args[splash_nam] = 1 - if cmd_opts[opt] == ['0']: - args[splash_nam] = 0 - pass - pass + if cmd_opts.py_scripts is not None: + listlist = cmd_opts.py_scripts + for listi in listlist: + args[script_nam] += re.split( "[:;,]", listi) + + # xterm + if cmd_opts.xterm is not None: args[xterm_nam] = cmd_opts.xterm + + # Modules + if cmd_opts.modules is not None: + args[modules_nam] = [] + listlist = cmd_opts.modules + for listi in listlist: + args[modules_nam] += re.split( "[:;,]", listi) + else: + # if --modules (-m) command line option is not given + # try SALOME_MODULES environment variable + if os.getenv( "SALOME_MODULES" ): + args[modules_nam] = re.split( "[:;,]", os.getenv( "SALOME_MODULES" ) ) pass - elif opt in [ 'r', except_nam ] : - args[except_nam] = 1 - elif opt in [ 'l', logger_nam ] : - args[logger_nam] = 1 - elif opt in [ 'f', file_nam ] : - args[file_nam] = cmd_opts[opt] - elif opt in [ 'x', xterm_nam ] : - args[xterm_nam] = 1 - elif opt in [ 'i', interp_nam ] : - args[interp_nam] = cmd_opts[opt] - elif opt in [ 'm', modules_nam ] : - args[modules_nam] = cmd_opts[opt] - elif opt in [ 'e', embedded_nam ] : - args[embedded_nam] = cmd_opts[opt] - elif opt in [ 's', standalone_nam ] : - args[standalone_nam] = cmd_opts[opt] - elif opt in [ 'c', containers_nam ] : - args[containers_nam] = cmd_opts[opt] - elif opt in [ 'p', portkill_nam ] : - args[portkill_nam] = 1 - elif opt in [ 'k', killall_nam ] : - args[killall_nam] = 1 - elif opt in [ case_nam ] : - args[case_nam] = cmd_opts[opt] - pass - # if --modules (-m) command line option is not given - # try SALOME_MODULES environment variable - if not cmd_opts.has_key( "m" ) and \ - not cmd_opts.has_key( modules_nam ) and \ - os.getenv( "SALOME_MODULES" ): - args[modules_nam] = re.split( "[:;,]", os.getenv( "SALOME_MODULES" ) ) - pass + # Embedded + if cmd_opts.embedded is not None: + args[embedded_nam] = [] + listlist = cmd_opts.embedded + for listi in listlist: + args[embedded_nam] += re.split( "[:;,]", listi) + + # Standalone + if cmd_opts.standalone is not None: + args[standalone_nam] = [] + listlist = cmd_opts.standalone + standalone = [] + for listi in listlist: + standalone += re.split( "[:;,]", listi) + for serv in standalone: + if args[embedded_nam].count(serv) <= 0: + args[standalone_nam].append(serv) + + # Kill + if cmd_opts.portkill is not None: args[portkill_nam] = cmd_opts.portkill + if cmd_opts.killall is not None: args[killall_nam] = cmd_opts.killall + + # Interpreter + if cmd_opts.interp is not None: + args[interp_nam] = cmd_opts.interp + + # Exceptions + if cmd_opts.catch_exceptions is not None: + args[except_nam] = not cmd_opts.catch_exceptions + + # Relink config file + if cmd_opts.save_config is not None: + args['save_config'] = cmd_opts.save_config + + #################################################### + # Add values to args + for add_opt in theAdditionalOptions: + cmd = "args[\"%s\"] = cmd_opts.%s"%(add_opt.dest,add_opt.dest) + exec(cmd) + #################################################### # disable signals handling if args[except_nam] == 1: @@ -544,11 +791,14 @@ def get_env(): if m not in ["KERNEL", "GUI", ""] and os.getenv("%s_ROOT_DIR"%m): d1 = os.getenv("%s_ROOT_DIR"%m) + "/share/salome/resources/" + m.lower() d2 = os.getenv("%s_ROOT_DIR"%m) + "/share/salome/resources" - if os.path.exists( "%s/%s.xml"%(d1, appname) ): + #if os.path.exists( "%s/%s.xml"%(d1, appname) ): + if os.path.exists( "%s/%s.xml"%(d1, salomeappname) ): dirs.append( d1 ) - elif os.path.exists( "%s/%s.xml"%(d2, appname) ): + #elif os.path.exists( "%s/%s.xml"%(d2, appname) ): + elif os.path.exists( "%s/%s.xml"%(d2, salomeappname) ): dirs.append( d2 ) # return arguments os.environ[config_var] = separator.join(dirs) + #print "Args: ", args return args diff --git a/bin/runSalome b/bin/runSalome index a898c8df3..fdb94657b 100755 --- a/bin/runSalome +++ b/bin/runSalome @@ -1,7 +1,7 @@ #!/bin/bash if [ $# -ne 0 ] ; then - python -i ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py $* + ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python -i ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py $* else python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py fi diff --git a/bin/runSalome.py b/bin/runSalome.py index 00278fe96..69f974aff 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -23,6 +23,7 @@ import sys, os, string, glob, time, pickle import orbmodule import setenv from server import * +from launchConfigureParser import verbose #process_id = {} move to server.py # ----------------------------------------------------------------------------- @@ -240,26 +241,30 @@ class SessionServer(Server): self.SCMD2+=['CPP'] if 'pyContainer' in self.args['standalone'] or 'pyContainer' in self.args['embedded']: self.SCMD2+=['PY'] - if 'supervContainer' in self.args['containers'] or 'supervContainer' in self.args['standalone']: + if 'supervContainer' in self.args['standalone']: self.SCMD2+=['SUPERV'] if self.args['gui']: - try: + session_gui = True + if self.args.has_key('session_gui'): session_gui = self.args['session_gui'] - except KeyError: - session_gui = 1 - pass if session_gui: self.SCMD2+=['GUI'] + if self.args['splash']: + self.SCMD2+=['SPLASH'] + pass + if self.args['study_hdf'] is not None: + self.SCMD2+=['--study-hdf=%s'%self.args['study_hdf']] + pass pass pass - if self.args['splash'] and self.args['gui']: - self.SCMD2+=['SPLASH'] if self.args['noexcepthandler']: self.SCMD2+=['noexcepthandler'] + if self.args.has_key('user_config'): + self.SCMD2+=['--resources=%s'%self.args['user_config']] if self.args.has_key('modules'): self.SCMD2+=['--modules (%s)'%":".join(self.args['modules'])] - if self.args.has_key('test') and len(args['test']) > 0: - self.SCMD2+=['--test=%s'%(",".join(args['test']))] + if self.args.has_key('pyscript') and len(self.args['pyscript']) > 0: + self.SCMD2+=['--pyscript=%s'%(",".join(self.args['pyscript']))] def setpath(self,modules_list,modules_root_dir): cata_path=[] @@ -332,12 +337,12 @@ class ContainerManagerServer(Server): module_cata)): cata_path.extend( glob.glob(os.path.join(module_root_dir,"share", - self.args['appname'],"resources", + setenv.salome_subdir,"resources", module.lower(),module_cata))) else: cata_path.extend( glob.glob(os.path.join(module_root_dir,"share", - self.args['appname'],"resources", + setenv.salome_subdir,"resources", module_cata))) pass pass @@ -382,7 +387,7 @@ def startSalome(args, modules_list, modules_root_dir): """Launch all SALOME servers requested by args""" init_time = os.times() - print "startSalome ", args + if verbose(): print "startSalome ", args # # Initialisation ORB et Naming Service @@ -402,6 +407,7 @@ def startSalome(args, modules_list, modules_root_dir): # Notify Server launch # + if verbose(): print "Notify Server to launch" if sys.platform != "win32": print "Notify Server to launch" @@ -492,7 +498,7 @@ def startSalome(args, modules_list, modules_root_dir): # attente de la disponibilite du Container C++ local dans le Naming Service # - if 'cppContainer' in args['standalone']: + if ('cppContainer' in args['standalone']) | (args["gui"] == 0): myServer=ContainerCPPServer(args) myServer.run() if sys.platform == "win32": @@ -547,7 +553,7 @@ def startSalome(args, modules_list, modules_root_dir): else: session=clt.waitNSPID("/Kernel/Session",mySessionServ.PID,SALOME.Session) end_time = os.times() - print + if verbose(): print print "Start SALOME, elapsed time : %5.1f seconds"% (end_time[4] - init_time[4]) @@ -562,8 +568,7 @@ def startSalome(args, modules_list, modules_root_dir): try: if 'interp' in args: - if args['interp']: - nbaddi = int(args['interp'][0]) + nbaddi = args['interp'] except: import traceback traceback.print_exc() @@ -618,7 +623,7 @@ def useSalome(args, modules_list, modules_root_dir): pickle.dump(process_ids,fpid) fpid.close() - print """ + if verbose(): print """ Saving of the dictionary of Salome processes in %s To kill SALOME processes from a console (kill all sessions from all ports): python killSalome.py @@ -637,12 +642,18 @@ def useSalome(args, modules_list, modules_root_dir): # if clt != None: - print - print " --- registered objects tree in Naming Service ---" - clt.showNS() - - # run python scripts, passed via -t option - toimport = args['pyscript'] + if verbose(): + print + print " --- registered objects tree in Naming Service ---" + clt.showNS() + pass + + # run python scripts, passed via --execute option + toimport = [] + if args.has_key('pyscript'): + if args.has_key('gui') and args.has_key('session_gui'): + if not args['gui'] or not args['session_gui']: + toimport = args['pyscript'] i = 0 while i < len( toimport ) : if toimport[ i ] == 'killall': @@ -650,9 +661,15 @@ def useSalome(args, modules_list, modules_root_dir): import sys sys.exit(0) else: - print 'importing',toimport[ i ] - doimport = 'import ' + toimport[ i ] - exec doimport + scrname = toimport[ i ] + if len(scrname) > 2 and (len(scrname) - string.rfind(scrname, ".py") == 3): + print 'executing',scrname + doexec = 'execfile(\"%s\")'%scrname + exec doexec + else: + print 'importing',scrname + doimport = 'import ' + scrname + exec doimport i = i + 1 return clt @@ -758,26 +775,11 @@ def no_main(): def main(): """Salome launch as a main application""" import sys - if len(sys.argv) == 2: - if sys.argv[1] == "-nothing": - searchFreePort({}) - import os - print "port:%s"%(os.environ['NSPORT']) - import sys - sys.exit(0) - pass - pass - save_config = 1 - import sys - if len(sys.argv) > 1: - if sys.argv[1] == "--nosave-config": - save_config = 0 - sys.argv[1:2] = [] - pass - pass - # args, modules_list, modules_root_dir = setenv.get_config() kill_salome(args) + save_config = True + if args.has_key('save_config'): + save_config = args['save_config'] searchFreePort(args, save_config) setenv.main() clt = useSalome(args, modules_list, modules_root_dir) diff --git a/bin/setenv.py b/bin/setenv.py index 4edecbfbf..b401b3709 100755 --- a/bin/setenv.py +++ b/bin/setenv.py @@ -1,6 +1,27 @@ #!/usr/bin/env python +# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG +# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + import sys, os, string, glob, time, pickle +import orbmodule +from launchConfigureParser import verbose # this file is extraction of set_env from runSalome.py # for reusage in automated tests @@ -26,18 +47,15 @@ def add_path(directory, variable_name): newpath=[] for _dir in os.environ[variable_name].split(splitsym): if os.path.exists(_dir): - try: - if not os.path.samefile(_dir, directory): - newpath.append(_dir) - except: - if _dir != directory: + if sys.platform != "win32": + if not os.path.samefile(_dir, directory): + newpath.append(_dir) + else: newpath.append(_dir) - else: if os.path.abspath(_dir) != os.path.abspath(directory): newpath.append(_dir) - - pass + pass import string newpath[:0] = [ directory ] newpath = string.join(newpath, splitsym) @@ -46,13 +64,17 @@ def add_path(directory, variable_name): sys.path[:0] = [directory] # ----------------------------------------------------------------------------- + __lib__dir__ = None def get_lib_dir(): global __lib__dir__ if __lib__dir__: return __lib__dir__ import platform if platform.architecture()[0] == "64bit": - __lib__dir__ = "lib64" + if platform.machine() == "ia64": + __lib__dir__ = "lib" + else: + __lib__dir__ = "lib64" else: __lib__dir__ = "lib" return get_lib_dir() @@ -69,10 +91,19 @@ def get_config(): """ # read args from launch configure xml file and command line options - + + #*** Test additional option + #*** import optparse + #*** help_str = "Test options addition." + #*** o_j = optparse.Option("-j", "--join", action="store_true", dest="join", help=help_str) + import launchConfigureParser args = launchConfigureParser.get_env() - + + #*** Test additional option + #*** args = launchConfigureParser.get_env([o_j]) + #*** if args.has_key("join"): print args["join"] + # Check variables _ROOT_DIR # and set list of used modules (without KERNEL) @@ -183,7 +214,7 @@ def set_env(args, modules_list, modules_root_dir): os.environ["SMESH_MeshersList"]="StdMeshers" if not os.environ.has_key("SALOME_StdMeshersResources"): os.environ["SALOME_StdMeshersResources"] \ - = modules_root_dir["SMESH"]+"/share/"+args["appname"]+"/resources/smesh" + = modules_root_dir["SMESH"]+"/share/"+salome_subdir+"/resources/smesh" pass if args.has_key("SMESH_plugins"): for plugin in args["SMESH_plugins"]: @@ -201,7 +232,7 @@ def set_env(args, modules_list, modules_root_dir): = os.environ["SMESH_MeshersList"]+":"+plugin if not os.environ.has_key("SALOME_"+plugin+"Resources"): os.environ["SALOME_"+plugin+"Resources"] \ - = plugin_root+"/share/"+args["appname"]+"/resources/"+plugin.lower() + = plugin_root+"/share/"+salome_subdir+"/resources/"+plugin.lower() add_path(os.path.join(plugin_root,get_lib_dir(),python_version, "site-packages",salome_subdir), "PYTHONPATH") @@ -227,8 +258,7 @@ def set_env(args, modules_list, modules_root_dir): # set resources variables if not yet set # Done now by launchConfigureParser.py #if os.getenv("GUI_ROOT_DIR"): - #if not os.getenv("SUITRoot"): os.environ["SUITRoot"] = os.getenv("GUI_ROOT_DIR") + "/share/salome" - #if not os.getenv("SalomeAppConfig"): os.environ["SalomeAppConfig"] = os.getenv("GUI_ROOT_DIR") + "/share/salome/resources" + #if not os.getenv("SalomeAppConfig"): os.environ["SalomeAppConfig"] = os.getenv("GUI_ROOT_DIR") + "/share/salome/resources/gui" # set CSF_PluginDefaults variable only if it is not customized # by the user @@ -241,11 +271,11 @@ def set_env(args, modules_list, modules_root_dir): salome_subdir,"resources","kernel") if "GEOM" in modules_list: - print "GEOM OCAF Resources" + if verbose(): print "GEOM OCAF Resources" os.environ["CSF_GEOMDS_ResourcesDefaults"] \ = os.path.join(modules_root_dir["GEOM"],"share", salome_subdir,"resources","geom") - print "GEOM Shape Healing Resources" + if verbose(): print "GEOM Shape Healing Resources" os.environ["CSF_ShHealingDefaults"] \ = os.path.join(modules_root_dir["GEOM"],"share", salome_subdir,"resources","geom") diff --git a/bin/virtual_salome.py b/bin/virtual_salome.py index f77e6bfc3..44cb0b8a2 100644 --- a/bin/virtual_salome.py +++ b/bin/virtual_salome.py @@ -81,7 +81,10 @@ def get_lib_dir(): if __lib__dir__: return __lib__dir__ import platform if platform.architecture()[0] == "64bit": - __lib__dir__ = "lib64" + if platform.machine() == "ia64": + __lib__dir__ = "lib" + else: + __lib__dir__ = "lib64" else: __lib__dir__ = "lib" return get_lib_dir() diff --git a/configure.ac b/configure.ac index 61a80e169..8480a5e5f 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ # #AC_PREREQ(2.59) #AC_INIT(src) -AC_INIT([Salome2 Project], [3.2.2], [paul.rascle@edf.fr], [salome]) +AC_INIT([Salome2 Project], [4.0.0], [paul.rascle@edf.fr], [salome]) # AC_CONFIG_AUX_DIR defines an alternative directory where to find the auxiliary # scripts such as config.guess, install-sh, ... @@ -18,8 +18,8 @@ AM_INIT_AUTOMAKE([tar-pax]) PACKAGE=salome AC_SUBST(PACKAGE) -VERSION=3.2.2 -XVERSION=0x030202 +VERSION=4.0.0 +XVERSION=0x040000 AC_SUBST(VERSION) AC_SUBST(XVERSION) diff --git a/doc/salome/version.texi b/doc/salome/version.texi deleted file mode 100644 index 7256abc85..000000000 --- a/doc/salome/version.texi +++ /dev/null @@ -1,4 +0,0 @@ -@set UPDATED 2 June 2006 -@set UPDATED-MONTH June 2006 -@set EDITION 3.2.2 -@set VERSION 3.2.2 diff --git a/idl/Makefile.am b/idl/Makefile.am index 06d198355..8ddeafd24 100644 --- a/idl/Makefile.am +++ b/idl/Makefile.am @@ -29,6 +29,8 @@ include $(top_srcdir)/salome_adm/unix/make_common_starter.am # To avoid problems with parallel compilation. MAKEFLAGS = -j1 +AM_CXXFLAGS = -fPIC + BASEIDL_FILES = \ SALOME_Exception.idl \ SALOME_Comm.idl \ diff --git a/salome_adm/unix/DEPRECATED/make_conclude.in b/salome_adm/unix/DEPRECATED/make_conclude.in index 7a75995dc..bbecd612d 100644 --- a/salome_adm/unix/DEPRECATED/make_conclude.in +++ b/salome_adm/unix/DEPRECATED/make_conclude.in @@ -14,14 +14,14 @@ @CORBA@ # transform idl reference in appropriate obj file -LIB_CLIENT_SRC = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX)) +LIB_CLIENT_SRC = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX)) $(LIB_CLIENT_IDL:%.idl=%DynSK.cc) LIB_SERVER_SRC = $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_CXX)) LIB_MOC_SRC = $(LIB_MOC:%.h=%_moc.cxx) LIB_SRC+=$(LIB_MOC_SRC) LIB_SWIG_SRC = $(SWIG_DEF:%.i=%_wrap.cxx) LIB_DEP= $(LIB_SRC) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(LIB_SWIG_SRC) -LIB_CLIENT_OBJ = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ)) +LIB_CLIENT_OBJ = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ)) $(LIB_CLIENT_IDL:%.idl=%DynSK.o) LIB_SERVER_OBJ = $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_OBJ)) @@ -75,13 +75,13 @@ $(LIB): $(LIB_OBJ) @$(LT) --mode=link $(CXX) -shared -rpath $(libdir) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) # transform idl reference in appropriate obj file -BIN_CLIENT_SRC = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX)) +BIN_CLIENT_SRC = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX)) $(BIN_CLIENT_IDL:%.idl=%DynSK.cc) BIN_SERVER_SRC = $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_CXX)) BIN_MOC_SRC = $(BIN_MOC:%.h=%_moc.cxx) BIN_SRC+=$(BIN_MOC_SRC) BIN_DEP=$(BIN:%=%.cxx) $(BIN_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC) -BIN_CLIENT_OBJ = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ)) +BIN_CLIENT_OBJ = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ)) $(BIN_CLIENT_IDL:%.idl=%DynSK.o) BIN_SERVER_OBJ = $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_OBJ)) # transform c file in appropriate libtool obj file (.c) BIN_OBJ_C = $(patsubst %.c, %.o, $(filter %.c, $(BIN_SRC))) diff --git a/salome_adm/unix/config_files/ac_cxx_depend_flag.m4 b/salome_adm/unix/config_files/ac_cxx_depend_flag.m4 index 9849f3653..d316f83c6 100644 --- a/salome_adm/unix/config_files/ac_cxx_depend_flag.m4 +++ b/salome_adm/unix/config_files/ac_cxx_depend_flag.m4 @@ -72,8 +72,8 @@ case $host_os in linux*) if test x"$linux64" = x"true"; then \ MACHINE="PCLINUX64${SUFFIXES}"; - CFLAGS=" -m64 ${CXXFLAGS}"; - CXXFLAGS=" -m64 ${CXXFLAGS}";\ + CFLAGS=" -m64 -D_OCC64 ${CXXFLAGS}"; + CXXFLAGS=" -m64 -D_OCC64 ${CXXFLAGS}";\ else \ MACHINE=PCLINUX; \ fi diff --git a/salome_adm/unix/config_files/check_omniorb.m4 b/salome_adm/unix/config_files/check_omniorb.m4 index 392a70aa0..b59b6caea 100644 --- a/salome_adm/unix/config_files/check_omniorb.m4 +++ b/salome_adm/unix/config_files/check_omniorb.m4 @@ -187,7 +187,7 @@ fi if test "x$omniORB_ok" = "xyes" then - OMNIORB_IDLCXXFLAGS="-nf -I${OMNIORB_ROOT}/idl" + OMNIORB_IDLCXXFLAGS="-Wba -nf -I${OMNIORB_ROOT}/idl" OMNIORB_IDLPYFLAGS_1='-bpythonbe -p ${top_srcdir}/salome_adm/unix' OMNIORB_IDLPYFLAGS_2=" -I${OMNIORB_ROOT}/idl" OMNIORB_IDLPYFLAGS=${OMNIORB_IDLPYFLAGS_1}${OMNIORB_IDLPYFLAGS_2} diff --git a/src/Communication/SALOME_Matrix_i.cxx b/src/Communication/SALOME_Matrix_i.cxx index 49271c046..1ea94aff2 100644 --- a/src/Communication/SALOME_Matrix_i.cxx +++ b/src/Communication/SALOME_Matrix_i.cxx @@ -35,7 +35,7 @@ SALOME_Matrix_i::~SALOME_Matrix_i() SALOME::SenderDouble_ptr SALOME_Matrix_i::getData() { - return SenderFactory::buildSender(_type,_tabToSend,_nbOfRow*_nbOfColumn,_ownTabToSend); + return SenderFactory::buildSender(_type,_tabToSend,_nbOfRow*_nbOfColumn,false); } CORBA::Long SALOME_Matrix_i::getSizeOfColumn() diff --git a/src/Container/Component_i.cxx b/src/Container/Component_i.cxx index 8c647e700..558275659 100644 --- a/src/Container/Component_i.cxx +++ b/src/Container/Component_i.cxx @@ -65,7 +65,7 @@ bool Engines_Component_i::_isMultiInstance = false; Engines_Component_i::Engines_Component_i() { //ASSERT(0); - INFOS("Default Constructor..."); + MESSAGE("Default Constructor, not for normal use..."); } //============================================================================= diff --git a/src/Container/Makefile.am b/src/Container/Makefile.am index bf0b79045..4e7c0d619 100644 --- a/src/Container/Makefile.am +++ b/src/Container/Makefile.am @@ -86,10 +86,11 @@ COMMON_LIBS =\ ../SALOMELocalTrace/libSALOMELocalTrace.la \ ../Basics/libSALOMEBasics.la \ $(top_builddir)/idl/libSalomeIDLKernel.la\ - @PYTHON_LIBS@ \ @MPI_LIBS@ \ @CORBA_LIBS@ +# @PYTHON_LIBS@ + # # =============================================================== # Libraries targets @@ -112,6 +113,7 @@ libSalomeContainer_la_LDFLAGS =\ @LDEXPDYNFLAGS@ libSalomeContainer_la_LIBADD =\ + $(PYTHON_LIBS) \ $(COMMON_LIBS) if WITH_PACO_PARALLEL diff --git a/src/Container/SALOME_ComponentPy.py b/src/Container/SALOME_ComponentPy.py index 2124d6737..8a3d80d41 100755 --- a/src/Container/SALOME_ComponentPy.py +++ b/src/Container/SALOME_ComponentPy.py @@ -72,6 +72,7 @@ class SALOME_ComponentPy_i (Engines__POA.Component): self._myConnexionToRegistry = 0 self._graphName = '' self._nodeName = '' + self._serviceName = '' self._ThreadId = 0 self._StartUsed = 0 self._ThreadCpuUsed = 0 diff --git a/src/Container/SALOME_Container.py b/src/Container/SALOME_Container.py index 026b9b7da..362f077e4 100644 --- a/src/Container/SALOME_Container.py +++ b/src/Container/SALOME_Container.py @@ -43,6 +43,7 @@ from SALOME_ComponentPy import * from SALOME_utilities import * from Utils_Identity import getShortHostName +from launchConfigureParser import verbose #============================================================================= @@ -61,7 +62,7 @@ class SALOME_Container_i: self._orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID) self._poa = self._orb.resolve_initial_references("RootPOA") self._containerName = containerName - print "SALOME_Container.SALOME_Container_i : _containerName ",self._containerName + if verbose(): print "SALOME_Container.SALOME_Container_i : _containerName ",self._containerName #self._naming_service = SALOME_NamingServicePy_i(self._orb) self._container = self._orb.string_to_object(containerIORStr) diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 027ca7dce..7642e5ae8 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -355,7 +355,11 @@ FindOrStartParallelContainer(const Engines::MachineParameters& params_const, for (int i = 0; i < params.nb_component_nodes; i++) { char buffer [5]; - snprintf(buffer,5,"%d",i); +#ifndef WNT + snprintf(buffer,5,"%d",i); +#else + _snprintf(buffer,5,"%d",i); +#endif string name_cont = name + string(buffer); string theNodeMachine(CORBA::string_dup(params.hostname)); @@ -580,7 +584,12 @@ SALOME_ContainerManager::LaunchParallelContainer(const std::string& command, // Name of the node char buffer [5]; +#ifndef WNT snprintf(buffer,5,"%d",i); +#else + _snprintf(buffer,5,"%d",i); +#endif + string name_cont = name + string(buffer); // I don't like this... diff --git a/src/Container/SALOME_ContainerPy.py b/src/Container/SALOME_ContainerPy.py index 0de0f3454..cc59382eb 100755 --- a/src/Container/SALOME_ContainerPy.py +++ b/src/Container/SALOME_ContainerPy.py @@ -42,6 +42,7 @@ from SALOME_ComponentPy import * from SALOME_utilities import * from Utils_Identity import getShortHostName +from launchConfigureParser import verbose #============================================================================= @@ -63,7 +64,7 @@ class SALOME_ContainerPy_i (Engines__POA.Container): Container_path = "/Containers/" + myMachine + "/" + containerName #self._containerName = containerName self._containerName = Container_path - print "container name ",self._containerName + if verbose(): print "container name ",self._containerName naming_service = SALOME_NamingServicePy_i(self._orb) self._naming_service = naming_service @@ -172,9 +173,9 @@ class SALOME_ContainerPy_i (Engines__POA.Container): MESSAGE( "SALOME_Container_i::import_component" ) ret=0 try: - print "try import ",componentName + if verbose(): print "try import ",componentName __import__(componentName) - print "import ",componentName," successful" + if verbose(): print "import ",componentName," successful" ret=1 except: import traceback diff --git a/src/DSC/DSC_Basic/ConnectionManager_i.cxx b/src/DSC/DSC_Basic/ConnectionManager_i.cxx index 260c88c7f..59f3b2624 100644 --- a/src/DSC/DSC_Basic/ConnectionManager_i.cxx +++ b/src/DSC/DSC_Basic/ConnectionManager_i.cxx @@ -73,7 +73,7 @@ throw (Engines::DSC::PortNotDefined, } void -ConnectionManager_i::disconnect(const Engines::ConnectionManager::connectionId id, +ConnectionManager_i::disconnect(Engines::ConnectionManager::connectionId id, Engines::DSC::Message message) throw (Engines::ConnectionManager::BadId) { diff --git a/src/DSC/DSC_Basic/ConnectionManager_i.hxx b/src/DSC/DSC_Basic/ConnectionManager_i.hxx index 185b77aee..c0459f482 100644 --- a/src/DSC/DSC_Basic/ConnectionManager_i.hxx +++ b/src/DSC/DSC_Basic/ConnectionManager_i.hxx @@ -26,6 +26,8 @@ #ifndef _CONNECTION_MANAGER_I_HXX_ #define _CONNECTION_MANAGER_I_HXX_ +#include + #include #include #include @@ -36,7 +38,7 @@ /*! \class ConnectionManager_i * \brief This class implements the interface Engines::ConnectionManager. */ -class ConnectionManager_i : +class DSC_BASIC_EXPORT ConnectionManager_i : public virtual POA_Engines::ConnectionManager { public : @@ -61,7 +63,7 @@ class ConnectionManager_i : * * \see Engines::ConnectionManager::disconnect */ - void disconnect(const Engines::ConnectionManager::connectionId id, + void disconnect(Engines::ConnectionManager::connectionId id, Engines::DSC::Message message) throw (Engines::ConnectionManager::BadId); diff --git a/src/DSC/DSC_Basic/DSC_Basic.hxx b/src/DSC/DSC_Basic/DSC_Basic.hxx new file mode 100755 index 000000000..0c94e55e6 --- /dev/null +++ b/src/DSC/DSC_Basic/DSC_Basic.hxx @@ -0,0 +1,47 @@ +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : DSC_Basic.hxx +// Author : Natalia ERMOLAYEVA +// Module : SALOME + +#ifndef _DSC_Basic_HXX_ +#define _DSC_Basic_HXX_ + +#ifdef WNT + #if defined DSC_BASIC_EXPORTS + #if defined WIN32 + #define DSC_BASIC_EXPORT __declspec( dllexport ) + #else + #define DSC_BASIC_EXPORT + #endif + #else + #if defined WIN32 + #define DSC_BASIC_EXPORT __declspec( dllimport ) + #else + #define DSC_BASIC_EXPORT + #endif + #endif +#else + #define DSC_BASIC_EXPORT +#endif + +#endif \ No newline at end of file diff --git a/src/DSC/DSC_Basic/DSC_Callbacks.hxx b/src/DSC/DSC_Basic/DSC_Callbacks.hxx index e37dd60e8..ffdf57d76 100644 --- a/src/DSC/DSC_Basic/DSC_Callbacks.hxx +++ b/src/DSC/DSC_Basic/DSC_Callbacks.hxx @@ -26,6 +26,8 @@ #ifndef _DSC_CALLBACKS_HXX_ #define _DSC_CALLBACKS_HXX_ +#include + #include #include CORBA_SERVER_HEADER(DSC_Engines) @@ -34,7 +36,7 @@ * uses to prevent the component user code that the state of the component has changed. * Currently only port's connection modifications are signaled. */ -class DSC_Callbacks +class DSC_BASIC_EXPORT DSC_Callbacks { public: DSC_Callbacks() {} diff --git a/src/DSC/DSC_Basic/DSC_i.hxx b/src/DSC/DSC_Basic/DSC_i.hxx index 80ececc4b..6a495f9ce 100644 --- a/src/DSC/DSC_Basic/DSC_i.hxx +++ b/src/DSC/DSC_Basic/DSC_i.hxx @@ -26,6 +26,8 @@ #ifndef _DSC_I_HXX_ #define _DSC_I_HXX_ +#include + #include #include #include @@ -39,7 +41,7 @@ * * The implementation of methods are performed by the class Engines_DSC_interface. */ -class Engines_DSC_i: +class DSC_BASIC_EXPORT Engines_DSC_i: public Engines_Component_i, // keyword virtual is not use to be able to // call the right Engines_Component_i constructor. // If virtual is used, a derived class of Engines_DSC_i diff --git a/src/DSC/DSC_Basic/DSC_interface.cxx b/src/DSC/DSC_Basic/DSC_interface.cxx index d96b2c545..b32d69bfd 100644 --- a/src/DSC/DSC_Basic/DSC_interface.cxx +++ b/src/DSC/DSC_Basic/DSC_interface.cxx @@ -23,6 +23,7 @@ // Author : André RIBES (EDF) // Module : KERNEL +#include #include "DSC_interface.hxx" Engines_DSC_interface::Engines_DSC_interface() {} diff --git a/src/DSC/DSC_Basic/Makefile.am b/src/DSC/DSC_Basic/Makefile.am index 3272b3e24..07946f3c1 100644 --- a/src/DSC/DSC_Basic/Makefile.am +++ b/src/DSC/DSC_Basic/Makefile.am @@ -35,7 +35,8 @@ salomeinclude_HEADERS = ConnectionManager_i.hxx \ DSC_Callbacks.hxx \ DSC_i.hxx \ DSC_interface.hxx \ - PortProperties_i.hxx + PortProperties_i.hxx \ + DSC_Basic.hxx # # =============================================================== # Local definitions diff --git a/src/DSC/DSC_Basic/PortProperties_i.hxx b/src/DSC/DSC_Basic/PortProperties_i.hxx index a6e713b58..90d2132ce 100644 --- a/src/DSC/DSC_Basic/PortProperties_i.hxx +++ b/src/DSC/DSC_Basic/PortProperties_i.hxx @@ -26,13 +26,15 @@ #ifndef _PORTPROPERTIES_I_HXX_ #define _PORTPROPERTIES_I_HXX_ +#include + #include #include CORBA_SERVER_HEADER(SALOME_Ports) /*! \class PortProperties_i * \brief This class implements the interface Ports::PortProperties. */ -class PortProperties_i: +class DSC_BASIC_EXPORT PortProperties_i: public virtual POA_Ports::PortProperties { public: diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.hxx index 2a2ce9828..e64db491f 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.hxx @@ -29,11 +29,11 @@ #include #include -#include #include "DisplayPair.hxx" #include "CouplingPolicy.hxx" #include "AdjacentFunctor.hxx" +#include #include "CalciumTypes.hxx" #include "CalciumException.hxx" diff --git a/src/DSC/DSC_User/Datastream/Calcium/Makefile.am b/src/DSC/DSC_User/Datastream/Calcium/Makefile.am index 144095e2b..aaba3dfe7 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/Makefile.am +++ b/src/DSC/DSC_User/Datastream/Calcium/Makefile.am @@ -72,8 +72,7 @@ COMMON_CPPFLAGS= -I$(top_srcdir)/src/DSC/DSC_User \ -I$(top_srcdir)/src/Utils \ -I$(top_builddir)/salome_adm/unix \ -I$(top_builddir)/idl \ - @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ \ - @BOOST_CPPFLAGS@ + @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @BOOST_CPPFLAGS@ # This local variable defines the list of dependant libraries common to all target in this package. COMMON_LIBS = @CORBA_LIBS@ diff --git a/src/DSC/DSC_User/Datastream/Makefile.am b/src/DSC/DSC_User/Datastream/Makefile.am index 1f6d0a12e..3b092508f 100644 --- a/src/DSC/DSC_User/Datastream/Makefile.am +++ b/src/DSC/DSC_User/Datastream/Makefile.am @@ -52,7 +52,7 @@ salomeinclude_HEADERS = GenericPort.hxx \ # # This local variable defines the list of CPPFLAGS common to all target in this package. -COMMON_CPPFLAGS= -I$(top_srcdir)/src/DSC/DSC_User +COMMON_CPPFLAGS= @BOOST_CPPFLAGS@ -I$(top_srcdir)/src/DSC/DSC_User # This local variable defines the list of dependant libraries common to all target in this package. COMMON_LIBS = $(top_builddir)/src/DSC/DSC_User/Datastream/Palm/libSalomePalm.la \ diff --git a/src/DSC/DSC_User/Makefile.am b/src/DSC/DSC_User/Makefile.am index 7ea4dca88..ec9ce2fbc 100644 --- a/src/DSC/DSC_User/Makefile.am +++ b/src/DSC/DSC_User/Makefile.am @@ -58,7 +58,8 @@ COMMON_CPPFLAGS= -I$(srcdir)/Basic \ -I$(top_srcdir)/src/Utils \ -I$(top_builddir)/salome_adm/unix \ -I$(top_builddir)/idl \ - @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ + @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @BOOST_CPPFLAGS@ + # This local variable defines the list of dependant libraries common to all target in this package. COMMON_LIBS = diff --git a/src/HDFPersist/HDFdatasetWrite.c b/src/HDFPersist/HDFdatasetWrite.c index 3dea8c5f5..625b316cb 100644 --- a/src/HDFPersist/HDFdatasetWrite.c +++ b/src/HDFPersist/HDFdatasetWrite.c @@ -23,6 +23,7 @@ SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) ----------------------------------------------------------------------------*/ #include "hdfi.h" +#include /* * - Name : _MEDdatasetWrite @@ -55,7 +56,7 @@ hdf_err HDFdatasetWrite(hdf_idt id, void *val) if(ndim < 0) return -1; hdf_size *dim = (hdf_size *) malloc(sizeof(hdf_size)*ndim); - if ((ret == HDFdatasetGetDim(id, dim)) < 0) return -1; + if ((ret = HDFdatasetGetDim(id, dim)) < 0) return -1; for(i=0; i +#define MESSAGE(msg) printf(msg); +//__FILE__,":[",__LINE__,"]: ", + int main() { hdf_idt fid,gid,did,atid; hdf_err ret; diff --git a/src/KERNEL_PY/salome_shared_modules.py b/src/KERNEL_PY/salome_shared_modules.py index a10ea5233..892b1085f 100755 --- a/src/KERNEL_PY/salome_shared_modules.py +++ b/src/KERNEL_PY/salome_shared_modules.py @@ -80,7 +80,10 @@ if sys.platform == "win32": path=salome_path.split(splitter) import platform if platform.architecture()[0] == "64bit": - libdir = "lib64" + if platform.machine() == "ia64": + libdir = "lib" + else: + libdir = "lib64" else: libdir = "lib" for rep in path: diff --git a/src/KERNEL_PY/salome_study.py b/src/KERNEL_PY/salome_study.py index b96a77434..468c93258 100644 --- a/src/KERNEL_PY/salome_study.py +++ b/src/KERNEL_PY/salome_study.py @@ -27,6 +27,7 @@ import salome_kernel import SALOMEDS import salome_iapp +from launchConfigureParser import verbose #-------------------------------------------------------------------------- @@ -244,21 +245,21 @@ salome_study_ID = -1 def getActiveStudy(theStudyId=0): global salome_study_ID - print "getActiveStudy" + if verbose(): print "getActiveStudy" if salome_study_ID == -1: if salome_iapp.hasDesktop(): - print "---in gui" + if verbose(): print "---in gui" salome_study_ID = salome_iapp.sg.getActiveStudyId() else: - print "---outside gui" + if verbose(): print "---outside gui" if theStudyId: aStudy=myStudyManager.GetStudyByID(theStudyId) if aStudy: - print "connection to existing study ", theStudyId + if verbose(): print "connection to existing study ", theStudyId salome_study_ID = theStudyId if salome_study_ID == -1: salome_study_ID = createNewStudy() - print"--- Study Id ", salome_study_ID + if verbose(): print"--- Study Id ", salome_study_ID return salome_study_ID #-------------------------------------------------------------------------- @@ -307,14 +308,14 @@ def salome_study_init(theStudyId=0): orb, lcc, naming_service, cm = salome_kernel.salome_kernel_init() # get Study Manager reference - print "looking for studyManager ..." + if verbose(): print "looking for studyManager ..." obj = naming_service.Resolve('myStudyManager') myStudyManager = obj._narrow(SALOMEDS.StudyManager) - print "studyManager found" + if verbose(): print "studyManager found" # get active study Id, ref and name myStudyId = getActiveStudy(theStudyId) - print "myStudyId",myStudyId + if verbose(): print "myStudyId",myStudyId myStudy = myStudyManager.GetStudyByID(myStudyId) myStudyName = myStudy._get_Name() diff --git a/src/ModuleGenerator/IDLparser.py b/src/ModuleGenerator/IDLparser.py index 96ccd6c37..0b74eb3af 100644 --- a/src/ModuleGenerator/IDLparser.py +++ b/src/ModuleGenerator/IDLparser.py @@ -430,6 +430,7 @@ class Component(Tree): self.addNamedChild('component-version', common_data["VERSION"]) self.addNamedChild('component-comment', 'unknown') self.addNamedChild('component-multistudy', common_data["COMP_MULT"]) + self.addNamedChild('component-impltype', common_data["COMP_IMPL"]) self.addNamedChild('component-icone', common_data["ICON"]) self.addNamedChild('constraint') self.addNamedChild('component-interface-list') @@ -447,7 +448,7 @@ class Component(Tree): for i in ['component-username', 'component-author', 'component-type', 'component-icone', 'component-version', - 'component-multistudy', 'constraint']: + 'component-multistudy', 'component-impltype', 'constraint']: ext = C.getChild(i) int = self.getChild(i) if int is None: @@ -733,7 +734,7 @@ def run(tree, args): if __name__ == "__main__": print - print "Usage : omniidl -bIDLparser [-I]* -Wbcatalog=[,icon=][,version=][,author=][,name=][,username=][,multistudy=] " + print "Usage : omniidl -bIDLparser [-I]* -Wbcatalog=[,icon=][,version=][,author=][,name=][,username=][,multistudy=][,impltype=] " print diff --git a/src/NOTIFICATION_SWIG/Makefile.am b/src/NOTIFICATION_SWIG/Makefile.am index 521f13d6d..42f570e11 100644 --- a/src/NOTIFICATION_SWIG/Makefile.am +++ b/src/NOTIFICATION_SWIG/Makefile.am @@ -53,8 +53,9 @@ _libNOTIFICATION_la_CPPFLAGS =\ _libNOTIFICATION_la_LDFLAGS = -module -_libNOTIFICATION_la_LIBADD = ../Notification/libSalomeNotification.la \ - @PYTHON_LIBS@ +_libNOTIFICATION_la_LIBADD = ../Notification/libSalomeNotification.la + +# @PYTHON_LIBS@ swig_wrap.cpp : $(SWIG_SOURCES) $(SWIG) $(SWIG_FLAGS) -o $@ $< diff --git a/src/NOTIFICATION_SWIG/NOTIFICATION.i b/src/NOTIFICATION_SWIG/NOTIFICATION.i index af90cd8ee..ccd684c2f 100644 --- a/src/NOTIFICATION_SWIG/NOTIFICATION.i +++ b/src/NOTIFICATION_SWIG/NOTIFICATION.i @@ -29,7 +29,7 @@ %{ -#define __declspec(a) +//#define __declspec(a) #include "NOTIFICATION_Swig.hxx" %} diff --git a/src/NamingService/SALOME_NamingService.cxx b/src/NamingService/SALOME_NamingService.cxx index 49a6c0088..22fbc3c7d 100644 --- a/src/NamingService/SALOME_NamingService.cxx +++ b/src/NamingService/SALOME_NamingService.cxx @@ -380,7 +380,7 @@ CORBA::Object_ptr SALOME_NamingService::Resolve(const char* Path) CosNaming::Name n = ex.rest_of_name; if (ex.why == CosNaming::NamingContext::missing_node) - INFOS("Resolve() : " << (char *) n[0].id + MESSAGE("Resolve() : " << (char *) n[0].id << " (" << (char *) n[0].kind << ") not found"); if (ex.why == CosNaming::NamingContext::not_context) @@ -846,7 +846,7 @@ throw(ServiceUnreachable) CosNaming::Name n = ex.rest_of_name; if (ex.why == CosNaming::NamingContext::missing_node) - INFOS( "Change_Directory() : " << (char *) n[0].id + MESSAGE( "Change_Directory() : " << (char *) n[0].id << " (" << (char *) n[0].kind << ") not found"); if (ex.why == CosNaming::NamingContext::not_context) INFOS("Change_Directory() : " << (char *) n[0].id diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index f47b37ace..3552c1128 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -650,6 +650,8 @@ SALOME_ResourcesManager::BuildCommand command += containerName; command += "_"; command += machine; + command += "_"; + command += getenv( "USER" ) ; command += ".log 2>&1 &" ; SCRUTE( command ); @@ -922,6 +924,8 @@ SALOME_ResourcesManager::BuildTempFileToLaunchRemoteContainer command += _NS->ContainerName(params); command += "_"; command += machine; + command += "_"; + command += getenv( "USER" ) ; command += ".log 2>&1 &"; SCRUTE(command); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index 99c152a94..7c9225a3f 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -343,44 +343,19 @@ Handle(TColStd_HSequenceOfTransient) SALOMEDSImpl_Study::FindObjectByName(const Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_Study::FindObjectIOR(const TCollection_AsciiString& anObjectIOR) { _errorCode = ""; - - // firstly searching in the datamap for optimization + + Handle(SALOMEDSImpl_SObject) aResult = NULL; + + // searching in the datamap for optimization if (myIORLabels.IsBound(anObjectIOR)) { - Handle(SALOMEDSImpl_SObject) aResult = GetSObject(myIORLabels.Find(anObjectIOR)); + aResult = GetSObject(myIORLabels.Find(anObjectIOR)); // 11 oct 2002: forbidden attributes must be checked here - if (!aResult->GetLabel().IsAttribute(SALOMEDSImpl_AttributeIOR::GetID())) { + if (!aResult->GetLabel().IsAttribute(SALOMEDSImpl_AttributeIOR::GetID())) myIORLabels.UnBind(anObjectIOR); - } else - return aResult; - } - // Iterate to all components defined in the study - // After testing the component name, iterate in all objects defined under - // components (function _FindObject) - bool _find = false; - Handle(SALOMEDSImpl_SObject) RefSO = NULL; - - SALOMEDSImpl_SComponentIterator it = NewComponentIterator(); - Handle(SALOMEDSImpl_SComponent) SC; - for (; it.More();it.Next()){ - if(!_find) - { - SC = it.Value(); - TCollection_AsciiString ior = SC->GetIOR(); - if (ior != "") - { - if (ior == anObjectIOR) - { - _find = true; - RefSO = SC; - } - } - if (!_find) - RefSO = _FindObjectIOR(SC, anObjectIOR, _find); - } } - - if(RefSO.IsNull()) _errorCode = "No object was found"; - return RefSO; + + if(aResult.IsNull()) _errorCode = "No object was found"; + return aResult; } //============================================================================ diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx index bc23ce57b..423052a77 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx @@ -33,13 +33,16 @@ using namespace std; #include "SALOMEDSImpl_SComponent.hxx" #include "SALOMEDSImpl_Tool.hxx" +#include + #include #include #include #include -#include #include +#include + #include #include @@ -297,6 +300,7 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const Handle(SALOMEDSImpl_SComponent)& if (aLocked) anSCO->GetStudy()->GetProperties()->SetLocked(false); TCollection_ExtendedString Res(Att->Value()); + TCollection_AsciiString aHDFPath(Res); Handle(SALOMEDSImpl_AttributeComment) type; TCollection_ExtendedString DataType; @@ -318,8 +322,6 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const Handle(SALOMEDSImpl_SComponent)& DefineComponentInstance (anSCO, aDriver->GetIOR()); - TCollection_AsciiString aHDFPath(Res); - TCollection_AsciiString aHDFUrl; bool isASCII = false; if (HDFascii::isASCII(aHDFPath.ToCString())) { @@ -367,18 +369,20 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const Handle(SALOMEDSImpl_SComponent)& ascii_hdf_dataset->ReadFromDisk(ASCIIfileState); // set path without file name from URL - int aFileNameSize = Res.Length(); - char* aDir = new char[aFileNameSize]; - memcpy(aDir, TCollection_AsciiString(Res).ToCString(), aFileNameSize); - for(int aCounter = aFileNameSize-1; aCounter>=0; aCounter--) - if (aDir[aCounter] == '/') { - aDir[aCounter+1] = 0; - break; - } + //int aFileNameSize = Res.Length(); + //char* aDir = new char[aFileNameSize]; + //memcpy(aDir, TCollection_AsciiString(Res).ToCString(), aFileNameSize); + //for(int aCounter = aFileNameSize-1; aCounter>=0; aCounter--) + //if (aDir[aCounter] == '/') { + // aDir[aCounter+1] = 0; + // break; + //} + // Above code was working wrong for paths without '/' inside. + TCollection_AsciiString aDir = SALOMEDSImpl_Tool::GetDirFromPath(Res); bool aResult = (ASCIIfileState[0]=='A')? - aDriver->LoadASCII(anSCO, aStreamFile, aStreamSize, aDir, aMultifileState[0]=='M'): - aDriver->Load(anSCO, aStreamFile, aStreamSize, aDir, aMultifileState[0]=='M'); + aDriver->LoadASCII(anSCO, aStreamFile, aStreamSize, aDir.ToCString(), aMultifileState[0]=='M'): + aDriver->Load(anSCO, aStreamFile, aStreamSize, aDir.ToCString(), aMultifileState[0]=='M'); if(aStreamFile != NULL) delete []aStreamFile; @@ -389,7 +393,7 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const Handle(SALOMEDSImpl_SComponent)& throw HDFexception("Unable to load component"); } - if(aDir != NULL) delete []aDir; + //if(aDir != NULL) delete []aDir; multifile_hdf_dataset->CloseOnDisk(); multifile_hdf_dataset = 0; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx index 17bad0e6a..e1059aeab 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx @@ -500,7 +500,7 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const TCollection_AsciiString& aUrl, if (aLocked) aStudy->GetProperties()->SetLocked(false); Handle(SALOMEDSImpl_StudyBuilder) SB= aStudy->NewBuilder(); - map aMapTypeDriver; + map aMapTypeDriver; if(aStudy.IsNull()) { _errorCode = "Study is null"; diff --git a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx index 06726877c..f41e57593 100644 --- a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx +++ b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2004 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// copyright (C) 2004 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // // This library is free software; you can redistribute it and/or @@ -93,17 +93,9 @@ LocalTraceBufferPool* LocalTraceBufferPool::instance() // --- start a trace Collector - char* traceKind; - bool isNotDefined = false; - if ( getenv("SALOME_trace") ) - traceKind = getenv("SALOME_trace"); - else - isNotDefined = true; // mkr : 27.11.2006 : PAL13967 - Distributed supervision graphs - Problem with "SALOME_trace" - - assert(traceKind); - //cerr<<"SALOME_trace="<