libccp4-8.0.0/CHANGES0000644000000000000000000000022614242731033012157 0ustar 00000000000000A non exhausive list of changes: [Apr-2021] MSVC port (C.Ballard) [Mar-2021] cmake distro (C.Ballard) [Nov-2021] big mtz files (C.Flensburg - GPL) libccp4-8.0.0/CMakeLists.txt0000644000000000000000000001027014242731033013724 0ustar 00000000000000cmake_minimum_required(VERSION 3.4) project(libccp4 C Fortran) include(GNUInstallDirs) option(BUILD_SHARED_LIBS "build shared libs (true)" TRUE) option(FORTRAN_LIB "build fortran library (true)" TRUE) include(${CMAKE_SOURCE_DIR}/cmake/source.cmake) set(PACKAGE "libccp4") set(VERSION "8.0") add_library(ccp4c ${ccp4c_SOURCES} ${ccp4c_HEADERS}) add_library(ccp4::ccp4c ALIAS ccp4c) target_include_directories(ccp4c PRIVATE . ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ) set_target_properties(ccp4c PROPERTIES SOVERSION ${VERSION}) set_target_properties(ccp4c PROPERTIES PUBLIC_HEADER "${ccp4c_HEADERS}") if(MSVC) set_target_properties(ccp4c PROPERTIES DEFINE_SYMBOL "DLL_EXPORT") endif() install(TARGETS ccp4c ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ccp4 ) if(FORTRAN_LIB) message(STATUS "Check for M4 macro processor") find_program(M4 NAMES "m4" "m4${CMAKE_EXECUTABLE_SUFFIX}" DOC "Location of the M4 macro processor" ) if(NOT M4) message(FATAL_ERROR "The `m4' macro processor was not found. " "You must install `m4' before you can to compile libccp4.") endif(NOT M4) message(STATUS "Check for M4 macro processor: found ${M4}") message(STATUS "Check for mmdb2 library") find_library(MMDB2 mmdb2) if(NOT MMDB2) message(FATAL_ERROR "The mmdb2 library was not found. " "You must install mmdb2 before you can to compile libccp4f.") endif(NOT MMDB2) message(STATUS "Check for mmdb2 library: found ${MMDB2}") if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) set(M4_ARGS -D_ifc=8) add_compile_options(-DIFC) elseif(CMAKE_Fortran_COMPILER_ID STREQUAL GNU) # Gfortran set(M4_ARGS -D_gfort=1) add_compile_options(-DGFORTRAN) endif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) if(WIN32) set(M4_ARGS ${M4_ARGS} -Dwindows=1) endif(WIN32) if(${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU" AND ${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER 9.9) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w -fallow-argument-mismatch") message(STATUS "Adjusting CMAKE_Fortran_FLAGS for gfortran-10 compatibility: '${CMAKE_Fortran_FLAGS}'") endif() add_custom_command( OUTPUT unix.f COMMAND m4 ${M4_ARGS} ${CMAKE_SOURCE_DIR}/fortran/unix.m4 > ${CMAKE_CURRENT_BINARY_DIR}/unix.f DEPENDS ${CMAKE_SOURCE_DIR}/fortran/unix.m4 ) add_library(ccp4f ${ccp4f_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/unix.f) target_link_libraries(ccp4f PRIVATE ccp4::ccp4c ${MMDB2} ) target_include_directories(ccp4f PRIVATE . ${CMAKE_SOURCE_DIR}/ccp4 ${CMAKE_BINARY_DIR} ) set_target_properties(ccp4f PROPERTIES SOVERSION ${VERSION}) install(TARGETS ccp4f ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) endif(FORTRAN_LIB) if(BUILD_SHARED_LIBS) set(prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix ${CMAKE_INSTALL_PREFIX}) set(libdir ${CMAKE_INSTALL_PREFIX}/lib) set(includedir ${CMAKE_INSTALL_PREFIX}/include) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ccp4c.pc.cmakein ${CMAKE_CURRENT_BINARY_DIR}/ccp4c.pc.in @ONLY) file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ccp4c.pc INPUT ${CMAKE_CURRENT_BINARY_DIR}/ccp4c.pc.in) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ccp4c.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) if(FORTRAN_LIB) set(CCP4F_REQUIRED mmdb2) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ccp4f.pc.cmakein ${CMAKE_CURRENT_BINARY_DIR}/ccp4f.pc.in @ONLY) file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ccp4f.pc INPUT ${CMAKE_CURRENT_BINARY_DIR}/ccp4f.pc.in) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ccp4f.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif(FORTRAN_LIB) endif(BUILD_SHARED_LIBS) install(FILES data/atomsf_neutron.lib data/atomsf_electron.lib data/atomsf.lib data/syminfo.lib data/symop.lib DESTINATION ${CMAKE_INSTALL_LIBDIR}/data ) install(FILES ${CMAKE_SOURCE_DIR}/ccp4-config.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ccp4 ) if(FORTRAN_LIB) install(FILES data/font84.ascii DESTINATION ${CMAKE_INSTALL_LIBDIR}/data ) endif(FORTRAN_LIB) libccp4-8.0.0/COPYING0000644000000000000000000010531214242731033012221 0ustar 00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. 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 them 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. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. 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. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey 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; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If 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 convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU 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 that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. Section 15 has been amended in accordance with Section 7a) above to address the requirements of UK law. 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 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. 16. Limitation of Liability. Section 16 has been replaced in accordance with Section 7a) above to address the requirements of UK law. THE LICENSOR OR ANY THIRD PARTIES FROM WHOM IT HAS LICENSED ANY CODE WILL NOT BE LIABLE FOR: ANY LOSS OF PROFITS, LOSS OF REVENUE, LOSS OR CORRUPTION OF DATA, LOSS OF CONTRACTS OR OPPORTUNITY, LOSS OF SAVINGS OR THIRD PARTY CLAIMS (IN EACH CASE WHETHER DIRECT OR INDIRECT), ANY DIRECT OR INDIRECT LOSS OR DAMAGE ARISING OUT OF OR IN CONNECTION WITH THE PROGRAM, IN EACH CASE, WHETHER THAT LOSS ARISES AS A RESULT OF LICENSOR"S NEGLIGENCE, OR IN ANY OTHER WAY, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF THAT LOSS ARISING, OR IF IT WAS WITHIN LICENSOR'S CONTEMPLATION. NONE OF THESE PROVISION LIMITS OR EXCLUDES THE LICENSOR"S LIABILITY FOR DEATH OR PERSONAL INJURY CAUSED BY ITS NEGLIGENCE OR FOR ANY FRAUD, OR FOR ANY SORT OF LIABILITY THAT, BY LAW, CANNOT BE LIMITED OR EXCLUDED 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs 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. 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 state 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 3 of the License, or (at your option) any later version. This program 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. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program 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, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU 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 Lesser General Public License instead of this License. But first, please read . libccp4-8.0.0/COPYING.LESSER0000644000000000000000000001672714242731033013230 0ustar 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. 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 that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU 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 as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. libccp4-8.0.0/INSTALL0000644000000000000000000003633214242731033012224 0ustar 00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. libccp4-8.0.0/Makefile.am0000644000000000000000000000607314242731033013226 0ustar 00000000000000ACLOCAL_AMFLAGS = -I m4 lib_LTLIBRARIES = ccp4/libccp4c.la if FORTRAN_LIB lib_LTLIBRARIES += fortran/libccp4f.la endif if GNU_FORTRAN AM_FFLAGS = -fno-second-underscore endif ccp4datadir = $(datarootdir)/ccp4 ccp4includedir = $(includedir)/ccp4 pkgconfigdir = $(libdir)/pkgconfig ccp4_libccp4c_la_SOURCES = \ ccp4/ccp4_array.c ccp4/cmap_data.c ccp4/cmtzlib.c ccp4/ccp4_general.c \ ccp4/cmap_header.c ccp4/csymlib.c ccp4/ccp4_parser.c ccp4/cmap_labels.c \ ccp4/cvecmat.c ccp4/ccp4_program.c ccp4/cmap_open.c ccp4/library_err.c \ ccp4/ccp4_unitcell.c ccp4/cmap_skew.c ccp4/library_file.c \ ccp4/cmap_accessor.c ccp4/cmap_stats.c ccp4/library_utils.c ccp4/cmap_close.c \ ccp4/cmap_symop.c ccp4/pack_c.c # FIXME: is ccp4/w32mvs.h needed here? # is cmaplib_f.h a public header? ccp4include_HEADERS = \ ccp4/ccp4_file_err.h ccp4/ccp4_program.h ccp4/ccp4_unitcell.h \ ccp4/cmap_errno.h ccp4/cmap_stats.h ccp4/csymlib.h \ ccp4/library_file.h ccp4/w32mvs.h ccp4/ccp4_fortran.h \ ccp4/ccp4_spg.h ccp4/ccp4_utils.h ccp4/cmap_header.h \ ccp4/cmaplib.h ccp4/cvecmat.h ccp4/mtzdata.h \ ccp4/ccp4_array.h ccp4/ccp4_general.h ccp4/ccp4_sysdep.h \ ccp4/ccp4_vars.h ccp4/cmap_labels.h ccp4/cmaplib_f.h \ ccp4/overview.h ccp4/ccp4_errno.h ccp4/ccp4_parser.h \ ccp4/ccp4_types.h ccp4/cmap_data.h ccp4/cmap_skew.h \ ccp4/cmtzlib.h ccp4/pack_c.h fortran_libccp4f_la_SOURCES = \ fortran/ccp4_diskio_f.c fortran/ccp4_parser_f.c fortran/cmaplib_f.c \ fortran/csymlib_f.c fortran/ccp4_general_f.c fortran/ccp4_unitcell_f.c \ fortran/cmtzlib_f.c fortran/library_f.c \ \ fortran/ccplib.f fortran/fftlib.f fortran/modlib.f fortran/parser.f \ fortran/rwbrook.f fortran/libhtml.f fortran/keyparse.f \ fortran/dna_output.f fortran/pack_f.f fortran/pxxml.f fortran/lgglib.f \ fortran/plot84lib.f fortran/plotsubs.f fortran/sorting_main.f \ fortran/dna_header.fh nodist_fortran_libccp4f_la_SOURCES = fortran/unix.f fortran_libccp4f_la_CPPFLAGS = -I$(srcdir)/ccp4 fortran_libccp4f_la_LIBADD = ccp4/libccp4c.la -lmmdb2 BUILT_SOURCES = fortran/unix.f CLEANFILES = fortran/unix.f fortran/unix.f: fortran/unix.m4 Makefile m4 $(M4_ARG) $< > $@ ccp4_libccp4c_la_LDFLAGS = -no-undefined fortran_libccp4f_la_LDFLAGS = -no-undefined # Files default.def and environ.def are not part of libccp4. # They are included in CCP4 and may be needed for running programs # compiled with libccp4 (see http://www.ccp4.ac.uk/dist/html/ccp4.html) dist_ccp4data_DATA = ccp4-config.cmake dist_data_DATA = data/atomsf_neutron.lib data/atomsf_electron.lib \ data/atomsf.lib data/syminfo.lib data/symop.lib pkgconfig_DATA = ccp4c.pc if FORTRAN_LIB dist_data_DATA += data/font84.ascii pkgconfig_DATA += ccp4f.pc endif # FIXME: all files but the first are unused now, should they be distributed? EXTRA_DIST = fortran/unix.m4 \ ccp4/w32mvs.c ccp4/vmslibrary.c \ fortran/vmsdiskio.for fortran/vms.for \ fortran/testlib.f fortran/mthlib.for fortran/w32mvs.f # Clean up Fortran modules. clean-local: clean-modules clean-modules: $(RM) *.mod libccp4-8.0.0/Makefile.in0000644000000000000000000015326514242731033013245 0ustar 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @FORTRAN_LIB_TRUE@am__append_1 = fortran/libccp4f.la @FORTRAN_LIB_TRUE@am__append_2 = data/font84.ascii @FORTRAN_LIB_TRUE@am__append_3 = ccp4f.pc subdir = . DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/config.h.in $(srcdir)/ccp4c.pc.in \ $(srcdir)/ccp4f.pc.in $(top_srcdir)/build-aux/depcomp \ $(dist_ccp4data_DATA) $(am__dist_data_DATA_DIST) \ $(ccp4include_HEADERS) COPYING COPYING.LESSER INSTALL \ build-aux/ar-lib build-aux/config.guess build-aux/config.sub \ build-aux/depcomp build-aux/install-sh build-aux/missing \ build-aux/ltmain.sh $(top_srcdir)/build-aux/ar-lib \ $(top_srcdir)/build-aux/config.guess \ $(top_srcdir)/build-aux/config.sub \ $(top_srcdir)/build-aux/install-sh \ $(top_srcdir)/build-aux/ltmain.sh \ $(top_srcdir)/build-aux/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = ccp4c.pc ccp4f.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(ccp4datadir)" \ "$(DESTDIR)$(datadir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(ccp4includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) ccp4_libccp4c_la_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp am_ccp4_libccp4c_la_OBJECTS = ccp4/ccp4_array.lo ccp4/cmap_data.lo \ ccp4/cmtzlib.lo ccp4/ccp4_general.lo ccp4/cmap_header.lo \ ccp4/csymlib.lo ccp4/ccp4_parser.lo ccp4/cmap_labels.lo \ ccp4/cvecmat.lo ccp4/ccp4_program.lo ccp4/cmap_open.lo \ ccp4/library_err.lo ccp4/ccp4_unitcell.lo ccp4/cmap_skew.lo \ ccp4/library_file.lo ccp4/cmap_accessor.lo ccp4/cmap_stats.lo \ ccp4/library_utils.lo ccp4/cmap_close.lo ccp4/cmap_symop.lo \ ccp4/pack_c.lo ccp4_libccp4c_la_OBJECTS = $(am_ccp4_libccp4c_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = ccp4_libccp4c_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(ccp4_libccp4c_la_LDFLAGS) $(LDFLAGS) \ -o $@ fortran_libccp4f_la_DEPENDENCIES = ccp4/libccp4c.la am_fortran_libccp4f_la_OBJECTS = \ fortran/fortran_libccp4f_la-ccp4_diskio_f.lo \ fortran/fortran_libccp4f_la-ccp4_parser_f.lo \ fortran/fortran_libccp4f_la-cmaplib_f.lo \ fortran/fortran_libccp4f_la-csymlib_f.lo \ fortran/fortran_libccp4f_la-ccp4_general_f.lo \ fortran/fortran_libccp4f_la-ccp4_unitcell_f.lo \ fortran/fortran_libccp4f_la-cmtzlib_f.lo \ fortran/fortran_libccp4f_la-library_f.lo fortran/ccplib.lo \ fortran/fftlib.lo fortran/modlib.lo fortran/parser.lo \ fortran/rwbrook.lo fortran/libhtml.lo fortran/keyparse.lo \ fortran/dna_output.lo fortran/pack_f.lo fortran/pxxml.lo \ fortran/lgglib.lo fortran/plot84lib.lo fortran/plotsubs.lo \ fortran/sorting_main.lo nodist_fortran_libccp4f_la_OBJECTS = fortran/unix.lo fortran_libccp4f_la_OBJECTS = $(am_fortran_libccp4f_la_OBJECTS) \ $(nodist_fortran_libccp4f_la_OBJECTS) fortran_libccp4f_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=F77 \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(F77LD) \ $(AM_FFLAGS) $(FFLAGS) $(fortran_libccp4f_la_LDFLAGS) \ $(LDFLAGS) -o $@ @FORTRAN_LIB_TRUE@am_fortran_libccp4f_la_rpath = -rpath $(libdir) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = F77COMPILE = $(F77) $(AM_FFLAGS) $(FFLAGS) LTF77COMPILE = $(LIBTOOL) $(AM_V_lt) --tag=F77 $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) AM_V_F77 = $(am__v_F77_@AM_V@) am__v_F77_ = $(am__v_F77_@AM_DEFAULT_V@) am__v_F77_0 = @echo " F77 " $@; am__v_F77_1 = F77LD = $(F77) F77LINK = $(LIBTOOL) $(AM_V_lt) --tag=F77 $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(F77LD) $(AM_FFLAGS) $(FFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_F77LD = $(am__v_F77LD_@AM_V@) am__v_F77LD_ = $(am__v_F77LD_@AM_DEFAULT_V@) am__v_F77LD_0 = @echo " F77LD " $@; am__v_F77LD_1 = SOURCES = $(ccp4_libccp4c_la_SOURCES) $(fortran_libccp4f_la_SOURCES) \ $(nodist_fortran_libccp4f_la_SOURCES) DIST_SOURCES = $(ccp4_libccp4c_la_SOURCES) \ $(fortran_libccp4f_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__dist_data_DATA_DIST = data/atomsf_neutron.lib data/atomsf_electron.lib \ data/atomsf.lib data/syminfo.lib data/symop.lib data/font84.ascii DATA = $(dist_ccp4data_DATA) $(dist_data_DATA) $(pkgconfig_DATA) HEADERS = $(ccp4include_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope AM_RECURSIVE_TARGETS = cscope DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ M4 = @M4@ M4_ARG = @M4_ARG@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 lib_LTLIBRARIES = ccp4/libccp4c.la $(am__append_1) @GNU_FORTRAN_TRUE@AM_FFLAGS = -fno-second-underscore ccp4datadir = $(datarootdir)/ccp4 ccp4includedir = $(includedir)/ccp4 pkgconfigdir = $(libdir)/pkgconfig ccp4_libccp4c_la_SOURCES = \ ccp4/ccp4_array.c ccp4/cmap_data.c ccp4/cmtzlib.c ccp4/ccp4_general.c \ ccp4/cmap_header.c ccp4/csymlib.c ccp4/ccp4_parser.c ccp4/cmap_labels.c \ ccp4/cvecmat.c ccp4/ccp4_program.c ccp4/cmap_open.c ccp4/library_err.c \ ccp4/ccp4_unitcell.c ccp4/cmap_skew.c ccp4/library_file.c \ ccp4/cmap_accessor.c ccp4/cmap_stats.c ccp4/library_utils.c ccp4/cmap_close.c \ ccp4/cmap_symop.c ccp4/pack_c.c # FIXME: is ccp4/w32mvs.h needed here? # is cmaplib_f.h a public header? ccp4include_HEADERS = \ ccp4/ccp4_file_err.h ccp4/ccp4_program.h ccp4/ccp4_unitcell.h \ ccp4/cmap_errno.h ccp4/cmap_stats.h ccp4/csymlib.h \ ccp4/library_file.h ccp4/w32mvs.h ccp4/ccp4_fortran.h \ ccp4/ccp4_spg.h ccp4/ccp4_utils.h ccp4/cmap_header.h \ ccp4/cmaplib.h ccp4/cvecmat.h ccp4/mtzdata.h \ ccp4/ccp4_array.h ccp4/ccp4_general.h ccp4/ccp4_sysdep.h \ ccp4/ccp4_vars.h ccp4/cmap_labels.h ccp4/cmaplib_f.h \ ccp4/overview.h ccp4/ccp4_errno.h ccp4/ccp4_parser.h \ ccp4/ccp4_types.h ccp4/cmap_data.h ccp4/cmap_skew.h \ ccp4/cmtzlib.h ccp4/pack_c.h fortran_libccp4f_la_SOURCES = \ fortran/ccp4_diskio_f.c fortran/ccp4_parser_f.c fortran/cmaplib_f.c \ fortran/csymlib_f.c fortran/ccp4_general_f.c fortran/ccp4_unitcell_f.c \ fortran/cmtzlib_f.c fortran/library_f.c \ \ fortran/ccplib.f fortran/fftlib.f fortran/modlib.f fortran/parser.f \ fortran/rwbrook.f fortran/libhtml.f fortran/keyparse.f \ fortran/dna_output.f fortran/pack_f.f fortran/pxxml.f fortran/lgglib.f \ fortran/plot84lib.f fortran/plotsubs.f fortran/sorting_main.f \ fortran/dna_header.fh nodist_fortran_libccp4f_la_SOURCES = fortran/unix.f fortran_libccp4f_la_CPPFLAGS = -I$(srcdir)/ccp4 fortran_libccp4f_la_LIBADD = ccp4/libccp4c.la -lmmdb2 BUILT_SOURCES = fortran/unix.f CLEANFILES = fortran/unix.f ccp4_libccp4c_la_LDFLAGS = -no-undefined fortran_libccp4f_la_LDFLAGS = -no-undefined # Files default.def and environ.def are not part of libccp4. # They are included in CCP4 and may be needed for running programs # compiled with libccp4 (see http://www.ccp4.ac.uk/dist/html/ccp4.html) dist_ccp4data_DATA = ccp4-config.cmake dist_data_DATA = data/atomsf_neutron.lib data/atomsf_electron.lib \ data/atomsf.lib data/syminfo.lib data/symop.lib $(am__append_2) pkgconfig_DATA = ccp4c.pc $(am__append_3) # FIXME: all files but the first are unused now, should they be distributed? EXTRA_DIST = fortran/unix.m4 \ ccp4/w32mvs.c ccp4/vmslibrary.c \ fortran/vmsdiskio.for fortran/vms.for \ fortran/testlib.f fortran/mthlib.for fortran/w32mvs.f all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .f .lo .o .obj am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 ccp4c.pc: $(top_builddir)/config.status $(srcdir)/ccp4c.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ ccp4f.pc: $(top_builddir)/config.status $(srcdir)/ccp4f.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } ccp4/$(am__dirstamp): @$(MKDIR_P) ccp4 @: > ccp4/$(am__dirstamp) ccp4/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ccp4/$(DEPDIR) @: > ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/ccp4_array.lo: ccp4/$(am__dirstamp) \ ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/cmap_data.lo: ccp4/$(am__dirstamp) ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/cmtzlib.lo: ccp4/$(am__dirstamp) ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/ccp4_general.lo: ccp4/$(am__dirstamp) \ ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/cmap_header.lo: ccp4/$(am__dirstamp) \ ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/csymlib.lo: ccp4/$(am__dirstamp) ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/ccp4_parser.lo: ccp4/$(am__dirstamp) \ ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/cmap_labels.lo: ccp4/$(am__dirstamp) \ ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/cvecmat.lo: ccp4/$(am__dirstamp) ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/ccp4_program.lo: ccp4/$(am__dirstamp) \ ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/cmap_open.lo: ccp4/$(am__dirstamp) ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/library_err.lo: ccp4/$(am__dirstamp) \ ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/ccp4_unitcell.lo: ccp4/$(am__dirstamp) \ ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/cmap_skew.lo: ccp4/$(am__dirstamp) ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/library_file.lo: ccp4/$(am__dirstamp) \ ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/cmap_accessor.lo: ccp4/$(am__dirstamp) \ ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/cmap_stats.lo: ccp4/$(am__dirstamp) \ ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/library_utils.lo: ccp4/$(am__dirstamp) \ ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/cmap_close.lo: ccp4/$(am__dirstamp) \ ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/cmap_symop.lo: ccp4/$(am__dirstamp) \ ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/pack_c.lo: ccp4/$(am__dirstamp) ccp4/$(DEPDIR)/$(am__dirstamp) ccp4/libccp4c.la: $(ccp4_libccp4c_la_OBJECTS) $(ccp4_libccp4c_la_DEPENDENCIES) $(EXTRA_ccp4_libccp4c_la_DEPENDENCIES) ccp4/$(am__dirstamp) $(AM_V_CCLD)$(ccp4_libccp4c_la_LINK) -rpath $(libdir) $(ccp4_libccp4c_la_OBJECTS) $(ccp4_libccp4c_la_LIBADD) $(LIBS) fortran/$(am__dirstamp): @$(MKDIR_P) fortran @: > fortran/$(am__dirstamp) fortran/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) fortran/$(DEPDIR) @: > fortran/$(DEPDIR)/$(am__dirstamp) fortran/fortran_libccp4f_la-ccp4_diskio_f.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/fortran_libccp4f_la-ccp4_parser_f.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/fortran_libccp4f_la-cmaplib_f.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/fortran_libccp4f_la-csymlib_f.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/fortran_libccp4f_la-ccp4_general_f.lo: \ fortran/$(am__dirstamp) fortran/$(DEPDIR)/$(am__dirstamp) fortran/fortran_libccp4f_la-ccp4_unitcell_f.lo: \ fortran/$(am__dirstamp) fortran/$(DEPDIR)/$(am__dirstamp) fortran/fortran_libccp4f_la-cmtzlib_f.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/fortran_libccp4f_la-library_f.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/ccplib.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/fftlib.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/modlib.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/parser.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/rwbrook.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/libhtml.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/keyparse.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/dna_output.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/pack_f.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/pxxml.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/lgglib.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/plot84lib.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/plotsubs.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/sorting_main.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/unix.lo: fortran/$(am__dirstamp) \ fortran/$(DEPDIR)/$(am__dirstamp) fortran/libccp4f.la: $(fortran_libccp4f_la_OBJECTS) $(fortran_libccp4f_la_DEPENDENCIES) $(EXTRA_fortran_libccp4f_la_DEPENDENCIES) fortran/$(am__dirstamp) $(AM_V_F77LD)$(fortran_libccp4f_la_LINK) $(am_fortran_libccp4f_la_rpath) $(fortran_libccp4f_la_OBJECTS) $(fortran_libccp4f_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ccp4/*.$(OBJEXT) -rm -f ccp4/*.lo -rm -f fortran/*.$(OBJEXT) -rm -f fortran/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/ccp4_array.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/ccp4_general.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/ccp4_parser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/ccp4_program.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/ccp4_unitcell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/cmap_accessor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/cmap_close.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/cmap_data.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/cmap_header.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/cmap_labels.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/cmap_open.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/cmap_skew.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/cmap_stats.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/cmap_symop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/cmtzlib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/csymlib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/cvecmat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/library_err.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/library_file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/library_utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ccp4/$(DEPDIR)/pack_c.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@fortran/$(DEPDIR)/fortran_libccp4f_la-ccp4_diskio_f.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@fortran/$(DEPDIR)/fortran_libccp4f_la-ccp4_general_f.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@fortran/$(DEPDIR)/fortran_libccp4f_la-ccp4_parser_f.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@fortran/$(DEPDIR)/fortran_libccp4f_la-ccp4_unitcell_f.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@fortran/$(DEPDIR)/fortran_libccp4f_la-cmaplib_f.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@fortran/$(DEPDIR)/fortran_libccp4f_la-cmtzlib_f.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@fortran/$(DEPDIR)/fortran_libccp4f_la-csymlib_f.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@fortran/$(DEPDIR)/fortran_libccp4f_la-library_f.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< fortran/fortran_libccp4f_la-ccp4_diskio_f.lo: fortran/ccp4_diskio_f.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fortran_libccp4f_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fortran/fortran_libccp4f_la-ccp4_diskio_f.lo -MD -MP -MF fortran/$(DEPDIR)/fortran_libccp4f_la-ccp4_diskio_f.Tpo -c -o fortran/fortran_libccp4f_la-ccp4_diskio_f.lo `test -f 'fortran/ccp4_diskio_f.c' || echo '$(srcdir)/'`fortran/ccp4_diskio_f.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) fortran/$(DEPDIR)/fortran_libccp4f_la-ccp4_diskio_f.Tpo fortran/$(DEPDIR)/fortran_libccp4f_la-ccp4_diskio_f.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fortran/ccp4_diskio_f.c' object='fortran/fortran_libccp4f_la-ccp4_diskio_f.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fortran_libccp4f_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fortran/fortran_libccp4f_la-ccp4_diskio_f.lo `test -f 'fortran/ccp4_diskio_f.c' || echo '$(srcdir)/'`fortran/ccp4_diskio_f.c fortran/fortran_libccp4f_la-ccp4_parser_f.lo: fortran/ccp4_parser_f.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fortran_libccp4f_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fortran/fortran_libccp4f_la-ccp4_parser_f.lo -MD -MP -MF fortran/$(DEPDIR)/fortran_libccp4f_la-ccp4_parser_f.Tpo -c -o fortran/fortran_libccp4f_la-ccp4_parser_f.lo `test -f 'fortran/ccp4_parser_f.c' || echo '$(srcdir)/'`fortran/ccp4_parser_f.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) fortran/$(DEPDIR)/fortran_libccp4f_la-ccp4_parser_f.Tpo fortran/$(DEPDIR)/fortran_libccp4f_la-ccp4_parser_f.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fortran/ccp4_parser_f.c' object='fortran/fortran_libccp4f_la-ccp4_parser_f.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fortran_libccp4f_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fortran/fortran_libccp4f_la-ccp4_parser_f.lo `test -f 'fortran/ccp4_parser_f.c' || echo '$(srcdir)/'`fortran/ccp4_parser_f.c fortran/fortran_libccp4f_la-cmaplib_f.lo: fortran/cmaplib_f.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fortran_libccp4f_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fortran/fortran_libccp4f_la-cmaplib_f.lo -MD -MP -MF fortran/$(DEPDIR)/fortran_libccp4f_la-cmaplib_f.Tpo -c -o fortran/fortran_libccp4f_la-cmaplib_f.lo `test -f 'fortran/cmaplib_f.c' || echo '$(srcdir)/'`fortran/cmaplib_f.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) fortran/$(DEPDIR)/fortran_libccp4f_la-cmaplib_f.Tpo fortran/$(DEPDIR)/fortran_libccp4f_la-cmaplib_f.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fortran/cmaplib_f.c' object='fortran/fortran_libccp4f_la-cmaplib_f.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fortran_libccp4f_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fortran/fortran_libccp4f_la-cmaplib_f.lo `test -f 'fortran/cmaplib_f.c' || echo '$(srcdir)/'`fortran/cmaplib_f.c fortran/fortran_libccp4f_la-csymlib_f.lo: fortran/csymlib_f.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fortran_libccp4f_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fortran/fortran_libccp4f_la-csymlib_f.lo -MD -MP -MF fortran/$(DEPDIR)/fortran_libccp4f_la-csymlib_f.Tpo -c -o fortran/fortran_libccp4f_la-csymlib_f.lo `test -f 'fortran/csymlib_f.c' || echo '$(srcdir)/'`fortran/csymlib_f.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) fortran/$(DEPDIR)/fortran_libccp4f_la-csymlib_f.Tpo fortran/$(DEPDIR)/fortran_libccp4f_la-csymlib_f.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fortran/csymlib_f.c' object='fortran/fortran_libccp4f_la-csymlib_f.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fortran_libccp4f_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fortran/fortran_libccp4f_la-csymlib_f.lo `test -f 'fortran/csymlib_f.c' || echo '$(srcdir)/'`fortran/csymlib_f.c fortran/fortran_libccp4f_la-ccp4_general_f.lo: fortran/ccp4_general_f.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fortran_libccp4f_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fortran/fortran_libccp4f_la-ccp4_general_f.lo -MD -MP -MF fortran/$(DEPDIR)/fortran_libccp4f_la-ccp4_general_f.Tpo -c -o fortran/fortran_libccp4f_la-ccp4_general_f.lo `test -f 'fortran/ccp4_general_f.c' || echo '$(srcdir)/'`fortran/ccp4_general_f.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) fortran/$(DEPDIR)/fortran_libccp4f_la-ccp4_general_f.Tpo fortran/$(DEPDIR)/fortran_libccp4f_la-ccp4_general_f.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fortran/ccp4_general_f.c' object='fortran/fortran_libccp4f_la-ccp4_general_f.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fortran_libccp4f_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fortran/fortran_libccp4f_la-ccp4_general_f.lo `test -f 'fortran/ccp4_general_f.c' || echo '$(srcdir)/'`fortran/ccp4_general_f.c fortran/fortran_libccp4f_la-ccp4_unitcell_f.lo: fortran/ccp4_unitcell_f.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fortran_libccp4f_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fortran/fortran_libccp4f_la-ccp4_unitcell_f.lo -MD -MP -MF fortran/$(DEPDIR)/fortran_libccp4f_la-ccp4_unitcell_f.Tpo -c -o fortran/fortran_libccp4f_la-ccp4_unitcell_f.lo `test -f 'fortran/ccp4_unitcell_f.c' || echo '$(srcdir)/'`fortran/ccp4_unitcell_f.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) fortran/$(DEPDIR)/fortran_libccp4f_la-ccp4_unitcell_f.Tpo fortran/$(DEPDIR)/fortran_libccp4f_la-ccp4_unitcell_f.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fortran/ccp4_unitcell_f.c' object='fortran/fortran_libccp4f_la-ccp4_unitcell_f.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fortran_libccp4f_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fortran/fortran_libccp4f_la-ccp4_unitcell_f.lo `test -f 'fortran/ccp4_unitcell_f.c' || echo '$(srcdir)/'`fortran/ccp4_unitcell_f.c fortran/fortran_libccp4f_la-cmtzlib_f.lo: fortran/cmtzlib_f.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fortran_libccp4f_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fortran/fortran_libccp4f_la-cmtzlib_f.lo -MD -MP -MF fortran/$(DEPDIR)/fortran_libccp4f_la-cmtzlib_f.Tpo -c -o fortran/fortran_libccp4f_la-cmtzlib_f.lo `test -f 'fortran/cmtzlib_f.c' || echo '$(srcdir)/'`fortran/cmtzlib_f.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) fortran/$(DEPDIR)/fortran_libccp4f_la-cmtzlib_f.Tpo fortran/$(DEPDIR)/fortran_libccp4f_la-cmtzlib_f.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fortran/cmtzlib_f.c' object='fortran/fortran_libccp4f_la-cmtzlib_f.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fortran_libccp4f_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fortran/fortran_libccp4f_la-cmtzlib_f.lo `test -f 'fortran/cmtzlib_f.c' || echo '$(srcdir)/'`fortran/cmtzlib_f.c fortran/fortran_libccp4f_la-library_f.lo: fortran/library_f.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fortran_libccp4f_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fortran/fortran_libccp4f_la-library_f.lo -MD -MP -MF fortran/$(DEPDIR)/fortran_libccp4f_la-library_f.Tpo -c -o fortran/fortran_libccp4f_la-library_f.lo `test -f 'fortran/library_f.c' || echo '$(srcdir)/'`fortran/library_f.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) fortran/$(DEPDIR)/fortran_libccp4f_la-library_f.Tpo fortran/$(DEPDIR)/fortran_libccp4f_la-library_f.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fortran/library_f.c' object='fortran/fortran_libccp4f_la-library_f.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fortran_libccp4f_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fortran/fortran_libccp4f_la-library_f.lo `test -f 'fortran/library_f.c' || echo '$(srcdir)/'`fortran/library_f.c .f.o: $(AM_V_F77)$(F77COMPILE) -c -o $@ $< .f.obj: $(AM_V_F77)$(F77COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .f.lo: $(AM_V_F77)$(LTF77COMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf ccp4/.libs ccp4/_libs -rm -rf fortran/.libs fortran/_libs distclean-libtool: -rm -f libtool config.lt install-dist_ccp4dataDATA: $(dist_ccp4data_DATA) @$(NORMAL_INSTALL) @list='$(dist_ccp4data_DATA)'; test -n "$(ccp4datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(ccp4datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(ccp4datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(ccp4datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(ccp4datadir)" || exit $$?; \ done uninstall-dist_ccp4dataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_ccp4data_DATA)'; test -n "$(ccp4datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(ccp4datadir)'; $(am__uninstall_files_from_dir) install-dist_dataDATA: $(dist_data_DATA) @$(NORMAL_INSTALL) @list='$(dist_data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dist_dataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) install-ccp4includeHEADERS: $(ccp4include_HEADERS) @$(NORMAL_INSTALL) @list='$(ccp4include_HEADERS)'; test -n "$(ccp4includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(ccp4includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(ccp4includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(ccp4includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(ccp4includedir)" || exit $$?; \ done uninstall-ccp4includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(ccp4include_HEADERS)'; test -n "$(ccp4includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(ccp4includedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(ccp4datadir)" "$(DESTDIR)$(datadir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(ccp4includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ccp4/$(DEPDIR)/$(am__dirstamp) -rm -f ccp4/$(am__dirstamp) -rm -f fortran/$(DEPDIR)/$(am__dirstamp) -rm -f fortran/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf ccp4/$(DEPDIR) fortran/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-ccp4includeHEADERS install-dist_ccp4dataDATA \ install-dist_dataDATA install-pkgconfigDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf ccp4/$(DEPDIR) fortran/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-ccp4includeHEADERS uninstall-dist_ccp4dataDATA \ uninstall-dist_dataDATA uninstall-libLTLIBRARIES \ uninstall-pkgconfigDATA .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \ clean-cscope clean-generic clean-libLTLIBRARIES clean-libtool \ clean-local cscope cscopelist-am ctags ctags-am dist dist-all \ dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-ccp4includeHEADERS install-data install-data-am \ install-dist_ccp4dataDATA install-dist_dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-pkgconfigDATA install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-ccp4includeHEADERS uninstall-dist_ccp4dataDATA \ uninstall-dist_dataDATA uninstall-libLTLIBRARIES \ uninstall-pkgconfigDATA fortran/unix.f: fortran/unix.m4 Makefile m4 $(M4_ARG) $< > $@ # Clean up Fortran modules. clean-local: clean-modules clean-modules: $(RM) *.mod # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libccp4-8.0.0/aclocal.m40000644000000000000000000012117514242731033013033 0ustar 00000000000000# generated automatically by aclocal 1.13.4 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.13' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.13.4], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.13.4])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Copyright (C) 2011-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_AR([ACT-IF-FAIL]) # ------------------------- # Try to determine the archiver interface, and trigger the ar-lib wrapper # if it is needed. If the detection of archiver interface fails, run # ACT-IF-FAIL (default is to abort configure with a proper error message). AC_DEFUN([AM_PROG_AR], [AC_BEFORE([$0], [LT_INIT])dnl AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([ar-lib])dnl AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) : ${AR=ar} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], [am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a ]) ]) case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) m4_default([$1], [AC_MSG_ERROR([could not determine $AR interface])]) ;; esac AC_SUBST([AR])dnl ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/m4_ax_check_compile_flag.m4]) libccp4-8.0.0/build-aux/0000755000000000000000000000000014242731033013056 5ustar 00000000000000libccp4-8.0.0/ccp4/0000755000000000000000000000000014242731033012015 5ustar 00000000000000libccp4-8.0.0/ccp4-config.cmake0000644000000000000000000002677314242731033014301 0ustar 00000000000000# - Find CCP4 libraries # Find one or more of CCP4 libraries: ccp4c, ccp4f, mmdb, ccif, # clipper-core, clipper-ccp4, clipper-contrib, clipper-minimol, clipper-mmdb, # or cctbx. # # Once done this will define # CCP4_INCLUDE_DIRS - all include directories # _LIBRARY - library, name is one of CCP4C, CCP4F, MMDB, MMDB2, CCIF, # SSM, CCP4SRS, # CLIPPER-CORE, CLIPPER-CCP4, CLIPPER-CONTRIB, # CLIPPER-MINIMOL, CLIPPER-MMDB, CLIPPER-CIF, # RFFTW2, FFTW2, # HKLFILE, CCTBX # CCIF_LIBRARIES - CCIF_LIBRARY with (if needed) regex library # CCP4SRS_LIBRARIES - CCP4SRS_LIBRARY with (if needed) mmdb and zlib libraries # CLIPPER-CORE_LIBRARIES - CLIPPER-CORE_LIBRARY with (if needed) # fftw2 and thread library # CCP4_LIBRARIES - all requested libraries with necessary dependencies # _FOUND - TRUE if library and header files are found. # # CCP4_PY2_DIR - when building the CCP4 suite, CCP4_PY2_DIR is set to # preferred installation directory for Python2 modules. # (defaults to ${LIB_INSTALL_DIR}/py2) # # You need to name libraries that you will use as components: # FIND_PACKAGE(CCP4 COMPONENTS mmdb ccp4c) # or # FIND_PACKAGE(CCP4 REQUIRED mmdb ccp4c) # # Checking for ccp4srs in some cases (static linking) sets also ZLIB_LIBRARY. # # Checking for clipper-core sets also variables for FFTW2 library used # by clipper: FFTW2_LIBRARY, RFFTW2_LIBRARY, FFTW2_INCLUDE_DIRS, # and if fftw2 is prefixed with 's' FFTW2_DEFINITIONS=-DFFTW2_PREFIX_S. # # Sample usage: # FIND_PACKAGE(CCP4 REQUIRED mmdb ccp4) # INCLUDE_DIRECTORIES(${CCP4_INCLUDE_DIRS}) # TARGET_LINK_LIBRARIES( ${CCP4_LIBRARIES}) if(NOT CCP4_FIND_COMPONENTS) message(FATAL_ERROR "Please specify CCP4 libraries/components.") endif() include(FindPackageHandleStandardArgs) include(CheckFunctionExists) include(CheckCSourceCompiles) include(CheckCXXSourceCompiles) set(_ccp4 $ENV{CCP4}) if(_ccp4) set(_clib "${_ccp4}/lib") set(_cincl "${_ccp4}/include") endif() foreach(_component ${CCP4_FIND_COMPONENTS}) string(TOUPPER ${_component} _upper) string(TOLOWER ${_component} _lower) set(_lib_var "${_upper}_LIBRARY") find_library(${_lib_var} NAMES ${_lower} HINTS ${LIB_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX}/lib PATHS ${_clib}) #message("DEBUG: ${_lib_var} (${_lower}) = ${${_upper}_LIBRARY}") if (${_upper} STREQUAL "MMDB") set(_header "mmdb/mmdb_defs.h") elseif (${_upper} STREQUAL "MMDB2") set(_header "mmdb2/mmdb_defs.h") elseif (${_upper} STREQUAL "CCP4C") set(_header "ccp4/ccp4_general.h") elseif (${_upper} STREQUAL "CCP4F") # fortran library, no headers set(_header) elseif (${_upper} STREQUAL "CCIF") set(_header "ccif/ccif_defines.h") elseif (${_upper} STREQUAL "SSM") set(_header "ssm/ssm_vxedge.h") elseif (${_upper} STREQUAL "CCP4SRS") set(_header "ccp4srs/ccp4srs_manager.h") elseif (${_upper} STREQUAL "CLIPPER-CORE") find_package(Threads) set(_header "clipper/clipper.h") elseif (${_upper} STREQUAL "CLIPPER-CCP4") set(_header "clipper/clipper-ccp4.h") elseif (${_upper} STREQUAL "CLIPPER-CONTRIB") set(_header "clipper/clipper-contrib.h") elseif (${_upper} STREQUAL "CLIPPER-MINIMOL") set(_header "clipper/clipper-minimol.h") elseif (${_upper} STREQUAL "CLIPPER-MMDB") set(_header "clipper/clipper-mmdb.h") elseif (${_upper} STREQUAL "CLIPPER-CIF") set(_header "clipper/clipper-cif.h") elseif (${_upper} STREQUAL "HKLFILE") set(_header "hklfile/columngroups.hh") elseif (${_upper} STREQUAL "CCTBX") set(_header "cctbx/crystal/symmetry.h") else() message(FATAL_ERROR "'${_component}' is not a valid CCP4 library.") endif() if (_header) set(_incl_var "${_upper}_INCLUDE_DIR") find_path(${_incl_var} ${_header} HINTS ${CMAKE_INSTALL_PREFIX}/include HINTS ${CMAKE_INSTALL_PREFIX}/include/cctbx PATHS ${_cincl}) message(STATUS "Looking for ${_header} - ${${_incl_var}}") find_package_handle_standard_args(CCP4 DEFAULT_MSG ${_lib_var} ${_incl_var}) set(CCP4_INCLUDE_DIRS ${CCP4_INCLUDE_DIRS} ${${_incl_var}}) else() find_package_handle_standard_args(CCP4 DEFAULT_MSG ${_lib_var}) endif() # check if libccif needs -lregex if (${_upper} STREQUAL "CCIF") set(_CCIF_SRC "void zzs_undump(int,int,int); int main() {zzs_undump(0,0,0);}") foreach (_REGEX_LIB "" regex pcreposix) message (STATUS "Trying _REGEX_LIB=${_REGEX_LIB}") if (${CMAKE_C_COMPILER_ID} STREQUAL "MSVC") set(CMAKE_REQUIRED_LIBRARIES ${CCIF_LIBRARY} ${_REGEX_LIB}) else() set(CMAKE_REQUIRED_LIBRARIES ${CCIF_LIBRARY} ${_REGEX_LIB} m) endif() set(_VAR _LINKING_WITH_CCIF_${_REGEX_LIB}) check_c_source_compiles("${_CCIF_SRC}" ${_VAR}) if (${_VAR}) if (${CMAKE_C_COMPILER_ID} STREQUAL "MSVC") set(CCIF_LIBRARIES ${CCIF_LIBRARY} ${_REGEX_LIB}) else() set(CCIF_LIBRARIES ${CCIF_LIBRARY} ${_REGEX_LIB} m) endif() break() endif() endforeach() if (NOT ${_VAR}) message(FATAL_ERROR "Linking with libccif failed.") endif() endif() # check if libccp4srs needs mmdb and zlib if (${_upper} STREQUAL "CCP4SRS") set(_SAVE ${CMAKE_REQUIRED_INCLUDES}) set(CMAKE_REQUIRED_INCLUDES "${_SAVE};${CCP4SRS_INCLUDE_DIR}") set(_SRS_SRC "#include \n" "int main() { ccp4srs::MemIO m; m.read(\"f\");}") set(CMAKE_REQUIRED_LIBRARIES ${CCP4SRS_LIBRARY}) set(_VAR _LINKING_WITH_CCP4SRS) check_cxx_source_compiles("${_SRS_SRC}" ${_VAR}) if (${_VAR}) set(CCP4SRS_LIBRARIES ${CCP4SRS_LIBRARY}) else() find_library(ZLIB_LIBRARY NAMES z zlib zlib1 zdll HINTS ${LIB_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX}/lib PATHS ${_clib} c:/MinGW/lib) if (NOT ZLIB_LIBRARY) message(FATAL_ERROR "Linking with ccp4srs fails. zlib not found.") endif() if (NOT MMDB2_LIBRARY) find_library(MMDB2_LIBRARY NAMES mmdb2 HINTS ${LIB_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX}/lib PATHS ${_clib}) endif() set(_ADD_LIBS ${MMDB2_LIBRARY} ${ZLIB_LIBRARY}) set(CMAKE_REQUIRED_LIBRARIES ${CCP4SRS_LIBRARY} ${_ADD_LIBS}) set(_VAR _LINKING_WITH_CCP4SRS_MMDB_AND_ZLIB) check_cxx_source_compiles("${_SRS_SRC}" ${_VAR}) if (NOT ${_VAR}) message(FATAL_ERROR "Linking with ccp4srs failed.") endif() set(CCP4SRS_LIBRARIES ${CCP4SRS_LIBRARY} ${_ADD_LIBS}) endif() SET(CMAKE_REQUIRED_INCLUDES ${_SAVE}) endif() # check if clipper-core needs rfftw fftw if (${_upper} STREQUAL "CLIPPER-CORE") set(_fftw_names sfftw fftw) if (${${_lib_var}} MATCHES ".a$") # fftw should also be static set(_fftw_names libsfftw.a libfftw.a ${_fftw_names}) endif() # first search in the install path, then in system and $CCP4 find_library(FFTW2_LIBRARY NAMES ${_fftw_names} HINTS ${LIB_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX}/lib NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH) find_library(FFTW2_LIBRARY NAMES ${_fftw_names} PATHS ${_clib}) message(STATUS "FFTW2 libraries - ${FFTW2_LIBRARY}") if (${FFTW2_LIBRARY} MATCHES "sfftw") set (_fftw_prefix s) set(FFTW2_DEFINITIONS "-DFFTW2_PREFIX_S") endif() set(_rfftw_names ${_fftw_prefix}rfftw) if (${FFTW2_LIBRARY} MATCHES ".a$") set(_rfftw_names lib${_fftw_prefix}rfftw.a ${_rfftw_names}) else() endif() find_library(RFFTW2_LIBRARY NAMES ${_rfftw_names} HINTS ${LIB_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX}/lib PATHS ${_clib}) message(STATUS " - ${RFFTW2_LIBRARY}") find_path(FFTW2_INCLUDE_DIRS ${_fftw_prefix}rfftw.h HINTS ${CMAKE_INSTALL_PREFIX}/include PATHS ${_cincl}) message(STATUS "FFTW2 header directory - ${FFTW2_INCLUDE_DIRS}") set(_SAVE ${CMAKE_REQUIRED_INCLUDES}) set(CMAKE_REQUIRED_INCLUDES "${_SAVE};${CLIPPER-CORE_INCLUDE_DIR}") set(_CLIP_SRC "#include \n" "int main() {clipper::FFTmap().fft_h_to_x();}") set(CMAKE_REQUIRED_LIBRARIES ${CLIPPER-CORE_LIBRARY}) set(_VAR _LINKING_WITH_CLIPPER_CORE) check_cxx_source_compiles("${_CLIP_SRC}" ${_VAR}) if (NOT ${_VAR}) set(_ADD_LIBS ${CMAKE_THREAD_LIBS_INIT}) set(CMAKE_REQUIRED_LIBRARIES ${CLIPPER-CORE_LIBRARY} ${_ADD_LIBS}) set(_VAR _LINKING_WITH_CLIPPER_CORE_AND_THREADS) check_cxx_source_compiles("${_CLIP_SRC}" ${_VAR}) endif() if ((NOT ${_VAR}) AND FFTW2_LIBRARY) set(_ADD_LIBS ${RFFTW2_LIBRARY} ${FFTW2_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) set(CMAKE_REQUIRED_LIBRARIES ${CLIPPER-CORE_LIBRARY} ${_ADD_LIBS}) set(_VAR _LINKING_WITH_CLIPPER_CORE_AND_FFTW) check_cxx_source_compiles("${_CLIP_SRC}" ${_VAR}) endif() if (NOT ${_VAR}) message(FATAL_ERROR "Linking with clipper-core failed.") endif() set(CLIPPER-CORE_LIBRARIES ${CLIPPER-CORE_LIBRARY} ${_ADD_LIBS}) SET(CMAKE_REQUIRED_INCLUDES ${_SAVE}) endif() endforeach() set(CCP4_LIBRARIES ${CCTBX_LIBRARY} ${HKLFILE_LIBRARY} ${CLIPPER-CCP4_LIBRARY} ${CLIPPER-CIF_LIBRARY} ${CLIPPER-CONTRIB_LIBRARY} ${CLIPPER-MINIMOL_LIBRARY} ${CLIPPER-MMDB_LIBRARY} ${CLIPPER-CORE_LIBRARIES} ${CCP4SRS_LIBRARIES} ${SSM_LIBRARY} ${CCIF_LIBRARIES} ${CCP4F_LIBRARY} ${CCP4C_LIBRARY} ${MMDB2_LIBRARY} ${MMDB_LIBRARY}) if(CCP4_INCLUDE_DIRS) list(REMOVE_DUPLICATES CCP4_INCLUDE_DIRS) endif() message(STATUS "CCP4 include directory: ${CCP4_INCLUDE_DIRS}") if(CCP4_LIBRARIES) # reverse twice, because REMOVE_DUPLICATES leaves the first list(REVERSE CCP4_LIBRARIES) list(REMOVE_DUPLICATES CCP4_LIBRARIES) list(REVERSE CCP4_LIBRARIES) endif() if(DEFINED LIB_INSTALL_DIR) set(CCP4_PY2_DIR ${LIB_INSTALL_DIR}/py2) elseif(DEFINED CMAKE_INSTALL_PREFIX) set(CCP4_PY2_DIR ${CMAKE_INSTALL_PREFIX}/lib/py2) endif() mark_as_advanced(CCP4C_INCLUDE_DIR MMDB_INCLUDE_DIR MMDB2_INCLUDE_DIR CCIF_INCLUDE_DIR SSM_INCLUDE_DIR CCP4SRS_INCLUDE_DIR CLIPPER-CORE_INCLUDE_DIR CLIPPER-CCP4_INCLUDE_DIR CLIPPER-CIF_INCLUDE_DIR CLIPPER-CONTRIB_INCLUDE_DIR CLIPPER-MINIMOL_INCLUDE_DIR CLIPPER-MMDB_INCLUDE_DIR FFTW2_INCLUDE_DIRS CCTBX_INCLUDE_DIR HKLFILE_INCLUDE_DIR CCP4_PY2_DIR) libccp4-8.0.0/ccp4c.pc.cmakein0000644000000000000000000000040514242731033014111 0ustar 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libccp4c Description: ccp4 c library Version: @VERSION@ Requires: @CCP4C_REQUIRES@ Libs: -L${libdir} -l$ Libs.private: Cflags: -I${includedir} libccp4-8.0.0/ccp4c.pc.in0000644000000000000000000000032414242731033013110 0ustar 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libccp4c Description: CCP4 core C libraries Version: @VERSION@ Requires: Libs: -L${libdir} -lccp4c Cflags: -I${includedir} libccp4-8.0.0/ccp4f.pc.cmakein0000644000000000000000000000041514242731033014115 0ustar 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libccp4c Description: ccp4 f library Version: @VERSION@ Requires: @CCP4F_REQUIRES@ Libs: -L${libdir} -l$ Libs.private: -lmmdb2 Cflags: -I${includedir} libccp4-8.0.0/ccp4f.pc.in0000644000000000000000000000036114242731033013114 0ustar 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libccp4f Description: CCP4 core FORTRAN libraries Version: @VERSION@ Requires.private: libccp4c mmdb2 Libs: -L${libdir} -lccp4f Cflags: -I${includedir} libccp4-8.0.0/cmake/0000755000000000000000000000000014242731033012244 5ustar 00000000000000libccp4-8.0.0/config.h.in0000644000000000000000000000341114242731033013206 0ustar 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* using g77 compiler */ #undef G77 /* using gfortran compiler */ #undef GFORTRAN /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* using intel fortran compiler */ #undef IFC /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* package install directory */ #undef PACKAGE_ROOT /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION libccp4-8.0.0/configure0000755000000000000000000253703114242731033013106 0ustar 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for libccp4 8.0.0. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libccp4' PACKAGE_TARNAME='libccp4' PACKAGE_VERSION='8.0.0' PACKAGE_STRING='libccp4 8.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="ccp4/cmtzlib.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS M4_ARG GNU_FORTRAN_FALSE GNU_FORTRAN_TRUE M4 ac_ct_F77 FFLAGS F77 FORTRAN_LIB_FALSE FORTRAN_LIB_TRUE MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL OBJDUMP DLLTOOL AS am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC ac_ct_AR AR AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock enable_maintainer_mode enable_fortran ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC CXXCPP F77 FFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures libccp4 8.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/libccp4] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of libccp4 8.0.0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=no] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-fortran do not compile fortran API Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF libccp4 configure 8.0.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_f77_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_f77_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_f77_try_compile # ac_fn_f77_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_f77_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_f77_try_link cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libccp4 $as_me 8.0.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # keep version in sync with ccp4/ccp4_program.h ac_aux_dir= for ac_dir in build-aux "$srcdir"/build-aux; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ac_config_headers="$ac_config_headers config.h" am__api_version='1.13' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='libccp4' VERSION='8.0.0' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} { $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 $as_echo_n "checking the archiver ($AR) interface... " >&6; } if ${am_cv_ar_interface+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 $as_echo "$am_cv_ar_interface" >&6; } case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) as_fn_error $? "could not determine $AR interface" "$LINENO" 5 ;; esac case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=no fi enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump enable_dlopen=no # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" //link //DLL //IMPLIB:"$tool_output_objdir$libname.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,ifort*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec_CXX='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" //link //DLL //IMPLIB:"$tool_output_objdir$libname.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown $as_echo_n "host os $host_os $cc_basename " >&6; case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,ifort*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink || test "$inherit_rpath_CXX" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Check whether --enable-fortran was given. if test "${enable_fortran+set}" = set; then : enableval=$enable_fortran; fi if test "x$enable_fortran" != xno ; then FORTRAN_LIB_TRUE= FORTRAN_LIB_FALSE='#' else FORTRAN_LIB_TRUE='#' FORTRAN_LIB_FALSE= fi if test "x$enable_fortran" != "xno"; then # sorting_main.f (mix of F77 and F90) cannot be compiled with g77 ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_F77+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $F77" >&5 $as_echo "$F77" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_F77+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_F77="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_F77" >&5 $as_echo "$ac_ct_F77" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_F77" && break done if test "x$ac_ct_F77" = x; then F77="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac F77=$ac_ct_F77 fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran 77 compiler" >&5 $as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; } if ${ac_cv_f77_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_compiler_gnu" >&5 $as_echo "$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -g" >&5 $as_echo_n "checking whether $F77 accepts -g... " >&6; } if ${ac_cv_prog_f77_g+:} false; then : $as_echo_n "(cached) " >&6 else FFLAGS=-g cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : ac_cv_prog_f77_g=yes else ac_cv_prog_f77_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_g" >&5 $as_echo "$ac_cv_prog_f77_g" >&6; } if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi if test $ac_compiler_gnu = yes; then G77=yes else G77= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_direct_absolute_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no inherit_rpath_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds reload_flag_F77=$reload_flag reload_cmds_F77=$reload_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` GCC=$G77 if test -n "$compiler"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } GCC_F77="$G77" LD_F77="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_F77='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_F77= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_F77='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl_F77='-Xlinker ' if test -n "$lt_prog_compiler_pic_F77"; then lt_prog_compiler_pic_F77="-Xcompiler $lt_prog_compiler_pic_F77" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fPIC' lt_prog_compiler_static_F77='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='--shared' lt_prog_compiler_static_F77='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl_F77='-Wl,-Wl,,' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-qpic' lt_prog_compiler_static_F77='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fPIC' lt_prog_compiler_static_F77='-static' ;; *Portland\ Group*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_F77='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; rdos*) lt_prog_compiler_static_F77='-non_shared' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_F77+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_F77=$lt_prog_compiler_pic_F77 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_F77" >&5 $as_echo "$lt_cv_prog_compiler_pic_F77" >&6; } lt_prog_compiler_pic_F77=$lt_cv_prog_compiler_pic_F77 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; } if ${lt_cv_prog_compiler_pic_works_F77+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_F77=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_F77" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_F77" >&6; } if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_F77+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_F77=yes fi else lt_cv_prog_compiler_static_works_F77=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_F77" >&5 $as_echo "$lt_cv_prog_compiler_static_works_F77" >&6; } if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_F77+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_F77=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5 $as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_F77+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_F77=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5 $as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag_F77= always_export_symbols_F77=no archive_cmds_F77= archive_expsym_cmds_F77= compiler_needs_object_F77=no enable_shared_with_static_runtimes_F77=no export_dynamic_flag_spec_F77= export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic_F77=no hardcode_direct_F77=no hardcode_direct_absolute_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported inherit_rpath_F77=no link_all_deplibs_F77=unknown module_cmds_F77= module_expsym_cmds_F77= old_archive_from_new_cmds_F77= old_archive_from_expsyms_cmds_F77= thread_safe_flag_spec_F77= whole_archive_flag_spec_F77= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='' ;; m68k) archive_cmds_F77='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' export_dynamic_flag_spec_F77='${wl}--export-all-symbols' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_F77='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_F77=no fi ;; haiku*) archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs_F77=yes ;; interix[3-9]*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec_F77= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_F77=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_F77=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_F77='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec_F77='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_F77='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs_F77=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_direct_absolute_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes file_list_spec_F77='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec_F77='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__F77+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__F77=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__F77"; then lt_cv_aix_libpath__F77=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__F77"; then lt_cv_aix_libpath__F77="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__F77 fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__F77+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__F77=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__F77"; then lt_cv_aix_libpath__F77=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__F77"; then lt_cv_aix_libpath__F77="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__F77 fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_F77='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' fi archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='' ;; m68k) archive_cmds_F77='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | ifort*) # Native MSVC hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes file_list_spec_F77='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" //link //DLL //IMPLIB:"$tool_output_objdir$libname.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, F77)='true' enable_shared_with_static_runtimes_F77=yes exclude_expsyms_F77='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds_F77='chmod 644 $oldlib' postlink_cmds_F77='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes_F77=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec_F77='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' compiler_needs_object_F77=yes else whole_archive_flag_spec_F77='' fi link_all_deplibs_F77=yes allow_undefined_flag_F77="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_F77="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_F77="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs_F77=no fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds_F77='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes hardcode_direct_absolute_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes hardcode_direct_absolute_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat > conftest.$ac_ext <<_ACEOF subroutine foo end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc_F77='no' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: inherit_rpath_F77=yes link_all_deplibs_F77=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no hardcode_direct_absolute_F77=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs_F77=no fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc_F77='no' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi archive_cmds_need_lc_F77='no' hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds_F77='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_F77='${wl}-z,text' allow_undefined_flag_F77='${wl}-z,nodefs' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-R,$libdir' hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec_F77='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_F77" >&5 $as_echo "$ld_shlibs_F77" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no with_gnu_ld_F77=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_F77+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_F77 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_F77 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_F77=no else lt_cv_archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_F77" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_F77" >&6; } archive_cmds_need_lc_F77=$lt_cv_archive_cmds_need_lc_F77 ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,ifort*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME2: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_F77\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_F77\"" cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || test -n "$runpath_var_F77" || test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_F77" >&5 $as_echo "$hardcode_action_F77" >&6; } if test "$hardcode_action_F77" = relink || test "$inherit_rpath_F77" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # AC_PROG_F77 doesn't fail if compiler is not found, test it explicitely ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu cat > conftest.$ac_ext <<_ACEOF program main write(*,*) 'hello' end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : else as_fn_error $? "Fortran compiler not found." "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Extract the first word of "m4", so it can be a program name with args. set dummy m4; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_M4+:} false; then : $as_echo_n "(cached) " >&6 else case $M4 in [\\/]* | ?:[\\/]*) ac_cv_path_M4="$M4" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_M4="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi M4=$ac_cv_path_M4 if test -n "$M4"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $M4" >&5 $as_echo "$M4" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$M4" = "x"; then as_fn_error $? "m4 program not found." "$LINENO" 5 fi # TODO: it'd be better to check for features rather than compilers, # but I'm afraid of changing this and unix.m4. cc_basename=`$ECHO "X$compiler_F77" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in linux*|mingw* ) case $cc_basename,$host_cpu in ifort*) M4_ARG=${M4_ARG:-"-D_ifc=8"} $as_echo "#define IFC 8" >>confdefs.h ;; ifc*) M4_ARG=${M4_ARG:-"-D_efc=1"} $as_echo "#define IFC 1" >>confdefs.h ;; g77*) M4_ARG=${M4_ARG:-"-D_g77=1"} $as_echo "#define G77 1" >>confdefs.h ;; gfortran*) M4_ARG=${M4_ARG-"-D_gfort=1"} $as_echo "#define GFORTRAN 1" >>confdefs.h ;; xlf*) M4_ARG=${M4_ARG-"-D_xlf=1"} ;; pgf*) ;; esac ;; darwin* ) case $cc_basename,$host_cpu in ifort*) M4_ARG=${M4_ARG:-"-D_ifc=8"} $as_echo "#define IFC 8" >>confdefs.h ;; ifc*) M4_ARG=${M4_ARG:-"-D_ifc=1"} $as_echo "#define IFC 1" >>confdefs.h ;; g77*) M4_ARG=${M4_ARG:-"-D_g77=1"} $as_echo "#define G77 1" >>confdefs.h ;; gfortran*) M4_ARG=${M4_ARG-"-D_gfort=1"} $as_echo "#define GFORTRAN 1" >>confdefs.h ;; xlf*) M4_ARG=${M4_ARG-"-D_xlf=1"} ;; esac ;; irix* ) case $cc_basename,$host_cpu in f77* ) M4_ARG=${M4_ARG:-"-D_sgi=1"} ;; f90*) M4_ARG=${M4_ARG:-"-D_sgi=1 -D_f90=1"} ;; esac esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return _WIN32; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : M4_ARG="$M4_ARG -D_windows=1" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: fortran/unix.m4 will be processed with m4 $M4_ARG" >&5 $as_echo "$as_me: fortran/unix.m4 will be processed with m4 $M4_ARG" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing cos" >&5 $as_echo_n "checking for library containing cos... " >&6; } if ${ac_cv_search_cos+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cos (); int main () { return cos (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_cos=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_cos+:} false; then : break fi done if ${ac_cv_search_cos+:} false; then : else ac_cv_search_cos=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_cos" >&5 $as_echo "$ac_cv_search_cos" >&6; } ac_res=$ac_cv_search_cos if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else as_fn_error $? "math library not found." "$LINENO" 5 fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MMDB_CCIF_Init in -lmmdb2" >&5 $as_echo_n "checking for MMDB_CCIF_Init in -lmmdb2... " >&6; } if ${ac_cv_lib_mmdb2_MMDB_CCIF_Init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmmdb2 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char MMDB_CCIF_Init (); int main () { return MMDB_CCIF_Init (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_mmdb2_MMDB_CCIF_Init=yes else ac_cv_lib_mmdb2_MMDB_CCIF_Init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mmdb2_MMDB_CCIF_Init" >&5 $as_echo "$ac_cv_lib_mmdb2_MMDB_CCIF_Init" >&6; } if test "x$ac_cv_lib_mmdb2_MMDB_CCIF_Init" = xyes; then : : else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: mmdb2 library not found." >&5 $as_echo "$as_me: WARNING: mmdb2 library not found." >&2;} fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Fortran 77 compiler accepts -fallow-argument-mismatch" >&5 $as_echo_n "checking whether Fortran 77 compiler accepts -fallow-argument-mismatch... " >&6; } if ${ax_cv_check_f77flags__Werror__fallow_argument_mismatch+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$FFLAGS FFLAGS="$FFLAGS -Werror -fallow-argument-mismatch" cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : ax_cv_check_f77flags__Werror__fallow_argument_mismatch=yes else ax_cv_check_f77flags__Werror__fallow_argument_mismatch=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext FFLAGS=$ax_check_save_flags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_f77flags__Werror__fallow_argument_mismatch" >&5 $as_echo "$ax_cv_check_f77flags__Werror__fallow_argument_mismatch" >&6; } if test "x$ax_cv_check_f77flags__Werror__fallow_argument_mismatch" = xyes; then : FFLAGS="$AM_FFLAGS -fallow-argument-mismatch" else : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi #dnl fortran API elements if test "x$G77" = "xyes"; then GNU_FORTRAN_TRUE= GNU_FORTRAN_FALSE='#' else GNU_FORTRAN_TRUE='#' GNU_FORTRAN_FALSE= fi # TODO: prefix or pkgdatadir can be changed after configure is run, # setting PACKAGE_ROOT here can fail, it would be better to set: # ccp4_libccp4c_la_CPPFLAGS= -DDATA_DIR=\"$(pkgdatadir)\" PACKAGE_ROOT=$prefix test "x$PACKAGE_ROOT" = xNONE && PACKAGE_ROOT=$ac_default_prefix cat >>confdefs.h <<_ACEOF #define PACKAGE_ROOT "$PACKAGE_ROOT" _ACEOF ac_config_files="$ac_config_files Makefile ccp4c.pc ccp4f.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${FORTRAN_LIB_TRUE}" && test -z "${FORTRAN_LIB_FALSE}"; then as_fn_error $? "conditional \"FORTRAN_LIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GNU_FORTRAN_TRUE}" && test -z "${GNU_FORTRAN_FALSE}"; then as_fn_error $? "conditional \"GNU_FORTRAN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by libccp4 $as_me 8.0.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ libccp4 config.status 8.0.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' LD_F77='`$ECHO "$LD_F77" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_F77='`$ECHO "$reload_flag_F77" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_F77='`$ECHO "$reload_cmds_F77" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_F77='`$ECHO "$old_archive_cmds_F77" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' compiler_F77='`$ECHO "$compiler_F77" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' GCC_F77='`$ECHO "$GCC_F77" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_F77='`$ECHO "$lt_prog_compiler_no_builtin_flag_F77" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_F77='`$ECHO "$lt_prog_compiler_pic_F77" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_F77='`$ECHO "$lt_prog_compiler_wl_F77" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_F77='`$ECHO "$lt_prog_compiler_static_F77" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_F77='`$ECHO "$lt_cv_prog_compiler_c_o_F77" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_F77='`$ECHO "$archive_cmds_need_lc_F77" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_F77='`$ECHO "$enable_shared_with_static_runtimes_F77" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_F77='`$ECHO "$export_dynamic_flag_spec_F77" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_F77='`$ECHO "$whole_archive_flag_spec_F77" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_F77='`$ECHO "$compiler_needs_object_F77" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_F77='`$ECHO "$old_archive_from_new_cmds_F77" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_F77='`$ECHO "$old_archive_from_expsyms_cmds_F77" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_F77='`$ECHO "$archive_cmds_F77" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_F77='`$ECHO "$archive_expsym_cmds_F77" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_F77='`$ECHO "$module_cmds_F77" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_F77='`$ECHO "$module_expsym_cmds_F77" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_F77='`$ECHO "$with_gnu_ld_F77" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_F77='`$ECHO "$allow_undefined_flag_F77" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_F77='`$ECHO "$no_undefined_flag_F77" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_F77='`$ECHO "$hardcode_libdir_flag_spec_F77" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_F77='`$ECHO "$hardcode_libdir_separator_F77" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_F77='`$ECHO "$hardcode_direct_F77" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_F77='`$ECHO "$hardcode_direct_absolute_F77" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_F77='`$ECHO "$hardcode_minus_L_F77" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_F77='`$ECHO "$hardcode_shlibpath_var_F77" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_F77='`$ECHO "$hardcode_automatic_F77" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_F77='`$ECHO "$inherit_rpath_F77" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_F77='`$ECHO "$link_all_deplibs_F77" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_F77='`$ECHO "$always_export_symbols_F77" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_F77='`$ECHO "$export_symbols_cmds_F77" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_F77='`$ECHO "$exclude_expsyms_F77" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_F77='`$ECHO "$include_expsyms_F77" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_F77='`$ECHO "$prelink_cmds_F77" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_F77='`$ECHO "$postlink_cmds_F77" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_F77='`$ECHO "$file_list_spec_F77" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_F77='`$ECHO "$hardcode_action_F77" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_F77='`$ECHO "$compiler_lib_search_dirs_F77" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_F77='`$ECHO "$predep_objects_F77" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_F77='`$ECHO "$postdep_objects_F77" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' predeps_F77='`$ECHO "$predeps_F77" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_F77='`$ECHO "$postdeps_F77" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_F77='`$ECHO "$compiler_lib_search_path_F77" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ LD_F77 \ reload_flag_CXX \ reload_flag_F77 \ compiler_CXX \ compiler_F77 \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_no_builtin_flag_F77 \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_static_CXX \ lt_prog_compiler_static_F77 \ lt_cv_prog_compiler_c_o_CXX \ lt_cv_prog_compiler_c_o_F77 \ export_dynamic_flag_spec_CXX \ export_dynamic_flag_spec_F77 \ whole_archive_flag_spec_CXX \ whole_archive_flag_spec_F77 \ compiler_needs_object_CXX \ compiler_needs_object_F77 \ with_gnu_ld_CXX \ with_gnu_ld_F77 \ allow_undefined_flag_CXX \ allow_undefined_flag_F77 \ no_undefined_flag_CXX \ no_undefined_flag_F77 \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_separator_CXX \ hardcode_libdir_separator_F77 \ exclude_expsyms_CXX \ exclude_expsyms_F77 \ include_expsyms_CXX \ include_expsyms_F77 \ file_list_spec_CXX \ file_list_spec_F77 \ compiler_lib_search_dirs_CXX \ compiler_lib_search_dirs_F77 \ predep_objects_CXX \ predep_objects_F77 \ postdep_objects_CXX \ postdep_objects_F77 \ predeps_CXX \ predeps_F77 \ postdeps_CXX \ postdeps_F77 \ compiler_lib_search_path_CXX \ compiler_lib_search_path_F77; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ reload_cmds_CXX \ reload_cmds_F77 \ old_archive_cmds_CXX \ old_archive_cmds_F77 \ old_archive_from_new_cmds_CXX \ old_archive_from_new_cmds_F77 \ old_archive_from_expsyms_cmds_CXX \ old_archive_from_expsyms_cmds_F77 \ archive_cmds_CXX \ archive_cmds_F77 \ archive_expsym_cmds_CXX \ archive_expsym_cmds_F77 \ module_cmds_CXX \ module_cmds_F77 \ module_expsym_cmds_CXX \ module_expsym_cmds_F77 \ export_symbols_cmds_CXX \ export_symbols_cmds_F77 \ prelink_cmds_CXX \ prelink_cmds_F77 \ postlink_cmds_CXX \ postlink_cmds_F77; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "ccp4c.pc") CONFIG_FILES="$CONFIG_FILES ccp4c.pc" ;; "ccp4f.pc") CONFIG_FILES="$CONFIG_FILES ccp4f.pc" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="CXX F77 " # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: F77 # The linker used to build libraries. LD=$lt_LD_F77 # How to create reloadable object files. reload_flag=$lt_reload_flag_F77 reload_cmds=$lt_reload_cmds_F77 # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_F77 # A language specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU compiler? with_gcc=$GCC_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_F77 # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_F77 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_F77 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_F77 # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_F77 # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_F77 # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_F77 # Specify filename containing input files. file_list_spec=$lt_file_list_spec_F77 # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77 # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_F77 postdep_objects=$lt_postdep_objects_F77 predeps=$lt_predeps_F77 postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # ### END LIBTOOL TAG CONFIG: F77 _LT_EOF ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi libccp4-8.0.0/configure.ac0000644000000000000000000000777114242731033013466 0ustar 00000000000000 AC_INIT(libccp4, 8.0.0) # keep version in sync with ccp4/ccp4_program.h AC_CONFIG_AUX_DIR(build-aux) AC_CONFIG_MACRO_DIR(m4) AC_CONFIG_SRCDIR(ccp4/cmtzlib.c) AC_CONFIG_HEADERS(config.h) AM_INIT_AUTOMAKE([1.11 foreign subdir-objects silent-rules -Wall]) m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) LT_INIT([disable-shared win32-dll]) AC_PROG_CC dnl fortran/rwbrook.f provides interface to fortran mmdb interface dnl (mmdb/mmdb_rwbrook.h/cpp). CXX is used only to test linking with mmdb. AC_PROG_CXX AC_PROG_INSTALL AM_MAINTAINER_MODE dnl disable (by default) maintainer mode AC_ARG_ENABLE(fortran, AS_HELP_STRING([--disable-fortran], [do not compile fortran API])) AM_CONDITIONAL([FORTRAN_LIB], [ test "x$enable_fortran" != xno ]) if test "x$enable_fortran" != "xno"; then # sorting_main.f (mix of F77 and F90) cannot be compiled with g77 AC_PROG_F77([_AC_F90_FC _AC_F95_FC _AC_F77_FC]) # AC_PROG_F77 doesn't fail if compiler is not found, test it explicitely AC_LANG_PUSH(Fortran 77) AC_LINK_IFELSE([AC_LANG_PROGRAM([], [ write(*,*) 'hello' ])], [], [AC_MSG_ERROR([Fortran compiler not found.])]) AC_LANG_POP(Fortran 77) AC_PATH_PROG(M4,m4) if test x"$M4" = "x"; then AC_MSG_ERROR([m4 program not found.]) fi # TODO: it'd be better to check for features rather than compilers, # but I'm afraid of changing this and unix.m4. cc_basename=`$ECHO "X$compiler_F77" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in linux*|mingw* ) case $cc_basename,$host_cpu in ifort*) M4_ARG=${M4_ARG:-"-D_ifc=8"} AC_DEFINE([IFC],[8],[using intel fortran compiler]) ;; ifc*) M4_ARG=${M4_ARG:-"-D_efc=1"} AC_DEFINE([IFC],[1],[using intel fortran compiler]) ;; g77*) M4_ARG=${M4_ARG:-"-D_g77=1"} AC_DEFINE([G77],[1],[using g77 compiler]) ;; gfortran*) M4_ARG=${M4_ARG-"-D_gfort=1"} AC_DEFINE([GFORTRAN],[1],[using gfortran compiler]) ;; xlf*) M4_ARG=${M4_ARG-"-D_xlf=1"} ;; pgf*) ;; esac ;; darwin* ) case $cc_basename,$host_cpu in ifort*) M4_ARG=${M4_ARG:-"-D_ifc=8"} AC_DEFINE([IFC],[8],[using intel fortran compiler]) ;; ifc*) M4_ARG=${M4_ARG:-"-D_ifc=1"} AC_DEFINE([IFC],[1],[using intel fortran compiler]) ;; g77*) M4_ARG=${M4_ARG:-"-D_g77=1"} AC_DEFINE([G77],[1],[using g77 compiler]) ;; gfortran*) M4_ARG=${M4_ARG-"-D_gfort=1"} AC_DEFINE([GFORTRAN],[1],[using gfortran compiler]) ;; xlf*) M4_ARG=${M4_ARG-"-D_xlf=1"} ;; esac ;; irix* ) case $cc_basename,$host_cpu in f77* ) M4_ARG=${M4_ARG:-"-D_sgi=1"} ;; f90*) M4_ARG=${M4_ARG:-"-D_sgi=1 -D_f90=1"} ;; esac esac AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return _WIN32;])], [M4_ARG="$M4_ARG -D_windows=1"], []) AC_MSG_NOTICE([fortran/unix.m4 will be processed with m4 $M4_ARG]) AC_SEARCH_LIBS(cos, m, , AC_MSG_ERROR([math library not found.])) AC_LANG_PUSH([C++]) AC_CHECK_LIB(mmdb2, MMDB_CCIF_Init, :, AC_MSG_WARN([mmdb2 library not found.])) AC_LANG_POP([C++]) AC_LANG_PUSH(Fortran 77) AX_CHECK_COMPILE_FLAG([-fallow-argument-mismatch],[FFLAGS="$AM_FFLAGS -fallow-argument-mismatch"],, [-Werror]) AC_LANG_POP(Fortran 77) fi #dnl fortran API elements AM_CONDITIONAL([GNU_FORTRAN], [test "x$G77" = "xyes"]) # TODO: prefix or pkgdatadir can be changed after configure is run, # setting PACKAGE_ROOT here can fail, it would be better to set: # ccp4_libccp4c_la_CPPFLAGS= -DDATA_DIR=\"$(pkgdatadir)\" PACKAGE_ROOT=$prefix test "x$PACKAGE_ROOT" = xNONE && PACKAGE_ROOT=$ac_default_prefix AC_DEFINE_UNQUOTED([PACKAGE_ROOT],["$PACKAGE_ROOT"],[package install directory]) AC_SUBST(M4_ARG) AC_OUTPUT(Makefile ccp4c.pc ccp4f.pc) libccp4-8.0.0/data/0000755000000000000000000000000014242731033012075 5ustar 00000000000000libccp4-8.0.0/fortran/0000755000000000000000000000000014242731033012637 5ustar 00000000000000libccp4-8.0.0/m4/0000755000000000000000000000000014242731033011504 5ustar 00000000000000libccp4-8.0.0/build-aux/ar-lib0000755000000000000000000001330214242731033014151 0ustar 00000000000000#! /bin/sh # Wrapper for Microsoft lib.exe me=ar-lib scriptversion=2012-03-01.08; # UTC # Copyright (C) 2010-2013 Free Software Foundation, Inc. # Written by Peter Rosin . # # 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, or (at your option) # any later version. # # This program 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. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # func_error message func_error () { echo "$me: $1" 1>&2 exit 1 } file_conv= # func_file_conv build_file # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv in mingw) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin) file=`cygpath -m "$file" || echo "$file"` ;; wine) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_at_file at_file operation archive # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE # for each of them. # When interpreting the content of the @FILE, do NOT use func_file_conv, # since the user would need to supply preconverted file names to # binutils ar, at least for MinGW. func_at_file () { operation=$2 archive=$3 at_file_contents=`cat "$1"` eval set x "$at_file_contents" shift for member do $AR -NOLOGO $operation:"$member" "$archive" || exit $? done } case $1 in '') func_error "no command. Try '$0 --help' for more information." ;; -h | --h*) cat <. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; or1k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libccp4-8.0.0/build-aux/config.sub0000755000000000000000000010531514242731033015046 0ustar 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-04-24' # This file 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 3 of the License, or # (at your option) any later version. # # This program 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. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or1k-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libccp4-8.0.0/build-aux/depcomp0000755000000000000000000005601614242731033014443 0ustar 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # 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, or (at your option) # any later version. # This program 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. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libccp4-8.0.0/build-aux/install-sh0000755000000000000000000003325514242731033015072 0ustar 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libccp4-8.0.0/build-aux/ltmain.sh0000644000000000000000000107447214242731033014715 0ustar 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.2 TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; -LIBPATH:*) func_stripname "-LIBPATH:" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-LIBPATH:' and \`$1'" else func_fatal_error "need path for \`-LIBPATH:' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "* | *" /LIBPATH:$dir "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories #case $dir in # [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; # *) func_append deplibs " /LIBPATH:$dir" ;; #esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; /LIBPATH:*) func_stripname "/LIBPATH:" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`/LIBPATH:' and \`$1'" else func_fatal_error "need path for \`/LIBPATH:' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "* | *" /LIBPATH:$dir"*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories #case $dir in # [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; # *) func_append deplibs " /LIBPATH:$dir" ;; #esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; *32.lib|*32.dll) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -link | /link) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$compile_deplibs $deplib" finalize_deplibs="$finalize_deplibs $deplib" else deplibs="$deplibs $deplib" test "$linkmode" = lib && newdependency_libs="$newdependency_libs $deplib" fi ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; /LIBPATH:*) case $linkmode in lib) #deplibs="$deplibs -link x1 $deplib" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '/LIBPATH:' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplibs -link y $deplib" continue fi if test "$pass" = scan; then deplibs="$deplibs $deplib" else compile_deplibs="$compile_deplibs $deplib" finalize_deplibs="$finalize_deplibs $deplib" fi func_stripname '/LIBPATH:' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`/LIBPATH' is ignored for archives/objects" ;; esac # linkmode continue ;; # LIBPATH -LIBPATH:*) case $linkmode in lib) func_stripname '-LIBPATH:' '' "$deplib" #deplibs="$deplibs -link x /LIBPATH:$func_stripname_result" test "$pass" = conv && continue newdependency_libs="$newdependency_libs /LIBPATH:$func_stripname_result" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) func_stripname '-LIBPATH:' '' "$deplib" if test "$pass" = conv; then deplibs="$deplibs /LIBPATH:$func_stripname_result" continue fi if test "$pass" = scan; then deplibs="$deplibs /LIBPATH:$func_stripname_result" else compile_deplibs="$compile_deplibs /LIBPATH:$func_stripname_result" finalize_deplibs="$finalize_deplibs /LIBPATH:$func_stripname_result" fi func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-LIBPATH' is ignored for archives/objects" ;; esac # linkmode continue ;; # LIBPATH -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; file_magic*) set dummy $deplibs_check_method; shift test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do if test "$want_nocaseglob" = yes; then shopt -s nocaseglob potlibs=`ls $i/$deplib 2>/dev/null` $nocaseglob else potential_libs=`ls $i/$deplib 2>/dev/null` fi if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then valid_a_lib=yes break 1 fi done ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *.lib) name=$a_deplib if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` if test -n "$file_magic_glob"; then libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` else libnameglob=$libname fi test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do if test "$want_nocaseglob" = yes; then shopt -s nocaseglob potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 file_magic*) echo "$deplibs_check_method" set dummy $deplibs_check_method; shift test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do if test "$want_nocaseglob" = yes; then shopt -s nocaseglob potlibs=`ls $i/$deplib 2>/dev/null` $nocaseglob else potential_libs=`ls $i/$deplib 2>/dev/null` fi if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then valid_a_lib=yes break 1 fi done ;; libccp4-8.0.0/build-aux/missing0000755000000000000000000001533114242731033014460 0ustar 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2012-06-26.16; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # 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, or (at your option) # any later version. # This program 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. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'automa4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libccp4-8.0.0/ccp4/ccp4_array.c0000644000000000000000000001161014242731033014207 0ustar 00000000000000/* ccp4_array.c: implementation file for resizable array implementation. Copyright (C) 2002 Kevin Cowtan This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file ccp4_array.c * implementation file for resizable array implementation. * Kevin Cowtan */ #include "ccp4_array.h" /* rcsid[] = "$Id$" */ ccp4_ptr ccp4array_new_(ccp4_ptr *p) { ccp4array_base *v; v = (ccp4array_base *)malloc(sizeof(ccp4array_base)); v->size = v->capacity = 0; *p = (ccp4_ptr *)((ccp4_byteptr)(v)+sizeof(ccp4array_base)); return *p; } ccp4_ptr ccp4array_new_size_(ccp4_ptr *p, const int size, const size_t reclen) { ccp4array_base *v; int capacity = (size * 12) / 10 + 2; v = (ccp4array_base *)malloc(sizeof(ccp4array_base) + capacity * reclen); v->size = size; v->capacity = capacity; *p = (ccp4_ptr *)((ccp4_byteptr)(v)+sizeof(ccp4array_base)); return *p; } void ccp4array_resize_(ccp4_ptr *p, const int size, const size_t reclen) { ccp4array_base *v; v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base)); if (size > v->capacity) { v->capacity = (size * 12) / 10 + 2; v = (ccp4array_base *)realloc(v, sizeof(ccp4array_base) + v->capacity * reclen); *p = (ccp4_ptr *)((ccp4_byteptr)(v)+sizeof(ccp4array_base)); } v->size = size; } void ccp4array_reserve_(ccp4_ptr *p, const int size, const size_t reclen) { ccp4array_base *v; v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base)); v->capacity = size; if ( v->size > size ) v->size = size; v = (ccp4array_base *)realloc(v, sizeof(ccp4array_base) + v->capacity * reclen); *p = (ccp4_ptr *)((ccp4_byteptr)(v)+sizeof(ccp4array_base)); } void ccp4array_append_(ccp4_ptr *p, ccp4_constptr data, const size_t reclen) { ccp4array_base *v; int osize; v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base)); osize = v->size; ccp4array_resize_(p, osize+1, reclen); memcpy((ccp4_byteptr)(*p)+osize*reclen, data, reclen); } void ccp4array_append_n_(ccp4_ptr *p, ccp4_constptr data, const int n, const size_t reclen) { ccp4array_base *v; ccp4_byteptr newdata; int osize, i; v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base)); osize = v->size; ccp4array_resize_(p, osize+n, reclen); newdata = (ccp4_byteptr)(*p)+osize*reclen; for ( i = 0; i < n; i++ ) { memcpy(newdata, data, reclen); newdata += reclen; } } void ccp4array_append_list_(ccp4_ptr *p, ccp4_constptr data, const int n, const size_t reclen) { ccp4array_base *v; int osize; v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base)); osize = v->size; ccp4array_resize_(p, osize+n, reclen); memcpy((ccp4_byteptr)(*p)+osize*reclen, data, n * reclen); } void ccp4array_insert_(ccp4_ptr *p, const int i, ccp4_constptr data, const size_t reclen) { ccp4array_base *v; int osize; v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base)); osize = v->size; ccp4array_resize_(p, osize+1, reclen); memmove((ccp4_byteptr)(*p)+(i+1)*reclen, (ccp4_byteptr)(*p)+i*reclen, (osize-i)*reclen); memcpy((ccp4_byteptr)(*p)+i*reclen, data, reclen); } void ccp4array_delete_ordered_(ccp4_ptr *p, const int i, const size_t reclen) { ccp4array_base *v; int nsize; v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base)); nsize = v->size - 1; memmove((ccp4_byteptr)(*p)+i*reclen, (ccp4_byteptr)(*p)+(i+1)*reclen, (nsize-i)*reclen); v->size--; /* ccp4array_resize_(p, nsize, reclen); */ } void ccp4array_delete_(ccp4_ptr *p, const int i, const size_t reclen) { ccp4array_base *v; int nsize; v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base)); nsize = v->size - 1; memcpy((ccp4_byteptr)(*p)+i*reclen, (ccp4_byteptr)(*p)+nsize*reclen, reclen); v->size--; /* ccp4array_resize_(p, size, reclen); */ } void ccp4array_delete_last_(ccp4_ptr *p, const size_t reclen) { ccp4array_base *v; v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base)); v->size--; /* ccp4array_resize_(p, v->size-1, reclen); */ } int ccp4array_size_(ccp4_constptr *p) { ccp4array_base *v; v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base)); return v->size; } void ccp4array_free_(ccp4_ptr *p) { ccp4array_base *v; v = (ccp4array_base *)((ccp4_byteptr)(*p)-sizeof(ccp4array_base)); free(v); } libccp4-8.0.0/ccp4/ccp4_array.h0000644000000000000000000002011114242731033014210 0ustar 00000000000000/* ccp4_array.h: header file for resizable array implementation. Copyright (C) 2002 Kevin Cowtan This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file ccp4_array.h * header file for resizable array implementation. * Kevin Cowtan */ /* CCP4 resizable array implementation. This defines an object and methods which looks just like a simple C array, but can be resized at will without incurring excessive overheads. A pointer to the desired type is created. Array elements are accessed from this pointer as normal. Other operations depend on macros which extract the stored type from the type of the pointer. The array is managed with a header, which is positioned before the beginning of the array. The malloc'ed memory area starts at the beginning of this header. However the pointer to the header is not stored, but rather derived from the array pointer whenever it is required. Arrays have a size and a capacity. The size is the number of elements in use, and the capacity is the number of elements available before a new memory allocation is required. When new memory is required, an excess is reqested to allow the array to grow further before performing another malloc. If the precise amount of memory is known, the capacity can be controlled directly using the 'reserve' macro. Example: to handle an array of type mytype: \code int i; mytype x,y; mytype *array; ccp4array_new(array); ccp4array_append_n(array, x, 3); for ( i = 0; i < 3; i++ ) y = array[i]; ccp4array_free(array); \endcode */ #ifndef __CCP4_ARRAY_INC #define __CCP4_ARRAY_INC #ifdef __cplusplus extern "C" { #endif #include #include /* rcsidha[] = "$Id$" */ /*! constant pointer type */ typedef const void *ccp4_constptr; /*! byte pointer type */ typedef char *ccp4_byteptr; /*! pointer type */ typedef void *ccp4_ptr; /*! struct definition for the array pre-header */ typedef struct ccp4array_base_ { int size, capacity; } ccp4array_base; /*! Macro to allocate a new array. The array is allocated with a size and capacity of 0 \param v The array pointer \return The new array pointer (redundent) */ #define ccp4array_new(v) ccp4array_new_((ccp4_ptr*)(&v)) /*! Macro to allocate a new array with non-zero size. The array is allocated with a size of s and capacity of at least s \param v The array pointer \param s The new size \return The new array pointer (redundent) */ #define ccp4array_new_size(v,s) ccp4array_new_size_((ccp4_ptr*)(&v),s,sizeof(*v)) /*! Macro to resize an array. This changes the size. Memory allocation only takes place if the new size is greater than the capacity. If that occurs, the new capacity will be slightly greater than the requested size, to allow room for expansion. \param v The array pointer \param s The new size */ #define ccp4array_resize(v,s) ccp4array_resize_((ccp4_ptr*)(&v),s,sizeof(*v)) /*! Macro to reserve space for an array. This forces a memory reallocation. The size of the array is unchanged, unless the new capacity is less than the current size, in which case the size is set to the new capacity. Unlike resize, the new allocation will be exactly the size of the array. \param v The array pointer \param s The new capacity */ #define ccp4array_reserve(v,s) ccp4array_reserve_((ccp4_ptr*)(&v),s,sizeof(*v)) /*! Macro to append an element to an array. This increments the size. Memory allocation only takes place if the new size is greater than the capacity. \param v The array pointer \param d The new element (may not be a literal) */ #define ccp4array_append(v,d) ccp4array_append_((ccp4_ptr*)(&v),(ccp4_constptr)(&d),sizeof(*v)) /*! Macro to append n copies of an element to an array. This increments the size by n. Memory allocation only takes place if the new size is greater than the capacity. \param v The array pointer \param d The new element (may not be a literal) \param n The number of copies to append */ #define ccp4array_append_n(v,d,n) ccp4array_append_n_((ccp4_ptr*)(&v),(ccp4_constptr)(&d),n,sizeof(*v)) /*! Macro to append n elements from another list to an array. This increment the size by n. Memory allocation only takes place if the new size is greater than the capacity. \param v The array pointer \param l Pointer to the list \param n The number of copies to append */ #define ccp4array_append_list(v,l,n) ccp4array_append_list_((ccp4_ptr*)(&v),(ccp4_constptr)l,n,sizeof(*v)) /*! Macro to insert an element before the element[i] of an array. This increments the size. All subsequent elements are moved up. As a result this method is slow. \param v The array pointer \param d The new element (may not be a literal) \param i The element before which the insertion is to be made. */ #define ccp4array_insert(v,i,d) ccp4array_insert_((ccp4_ptr*)(&v),i,(ccp4_constptr)(&d),sizeof(*v)) /*! Macro to delete element[i] of an array, preserving order. This decrements the size. All subsequent elements are moved down. As a result this method is slow. \param v The array pointer \param i The element to be deleted */ #define ccp4array_delete_ordered(v,i) ccp4array_delete_ordered_((ccp4_ptr*)(&v),i,sizeof(*v)) /*! Macro to delete element[i] of an array without preserving order. The last element is moved into the gap, and the size is decremented. \param v The array pointer \param i The element to be deleted */ #define ccp4array_delete(v,i) ccp4array_delete_((ccp4_ptr*)(&v),i,sizeof(*v)) /*! Macro to delete the last element of an array. This decrements the size. \param v The array pointer */ #define ccp4array_delete_last(v) ccp4array_delete_last_((ccp4_ptr*)(&v),sizeof(*v)) /*! Macro to return the size of the array. \param v The array pointer \return The size (int) */ #define ccp4array_size(v) ccp4array_size_((ccp4_constptr*)(&v)) /*! Macro free the array. All memory, including the header, is freed. \param v The array pointer */ #define ccp4array_free(v) ccp4array_free_((ccp4_ptr*)(&v)) /** * See macro ccp4array_new */ ccp4_ptr ccp4array_new_(ccp4_ptr *p); /** * See macro ccp4array_new_size */ ccp4_ptr ccp4array_new_size_(ccp4_ptr *p, const int size, const size_t reclen); /** * See macro ccp4array_resize */ void ccp4array_resize_(ccp4_ptr *p, const int size, const size_t reclen); /** * See macro ccp4array_reserve */ void ccp4array_reserve_(ccp4_ptr *p, const int size, const size_t reclen); /** * See macro ccp4array_append */ void ccp4array_append_(ccp4_ptr *p, ccp4_constptr data, const size_t reclen); /** * See macro ccp4array_append_n */ void ccp4array_append_n_(ccp4_ptr *p, ccp4_constptr data, const int n, const size_t reclen); /** * See macro ccp4array_append_list */ void ccp4array_append_list_(ccp4_ptr *p, ccp4_constptr data, const int n, const size_t reclen); /** * See macro ccp4array_insert */ void ccp4array_insert_(ccp4_ptr *p, const int i, ccp4_constptr data, const size_t reclen); /** * See macro ccp4array_delete_ordered */ void ccp4array_delete_ordered_(ccp4_ptr *p, const int i, const size_t reclen); /** * See macro ccp4array_delete */ void ccp4array_delete_(ccp4_ptr *p, const int i, const size_t reclen); /** * See macro ccp4array_delete_last */ void ccp4array_delete_last_(ccp4_ptr *p, const size_t reclen); /** * See macro ccp4array_size */ int ccp4array_size_(ccp4_constptr *p); /** * See macro ccp4array_free */ void ccp4array_free_(ccp4_ptr *p); #ifdef __cplusplus } #endif #endif /* __CCP4_ARRAY_INC */ libccp4-8.0.0/ccp4/ccp4_errno.h0000644000000000000000000001167214242731033014233 0ustar 00000000000000/* ccp4_errno.h: Header file for error handling routines Copyright (C) 2001 CCLRC, Charles Ballard and Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file ccp4_errno.h * Header file for error handling routines * base error codes on system errors. */ #ifndef __CCP4_ERROR_GUARD #define __CCP4_ERROR_GUARD #include #include "ccp4_sysdep.h" /* rcsidhe[] = "$Id$" */ #ifndef CCP4_ERRSYSTEM #define CCP4_ERRSYSTEM(x) (((x)&0xfff)<<24) #endif #ifndef CCP4_ERRLEVEL #define CCP4_ERRLEVEL(x) (((x)&0xf)<<16) #endif #ifndef CCP4_ERRSETLEVEL #define CCP4_ERRSETLEVEL(y,x) ((y) & (~CCP4_ERRLEVEL(0xf)) | CCP4_ERRLEVEL(x))) #endif #ifndef CCP4_ERRGETSYS #define CCP4_ERRGETSYS(x) (((x)>>24)&0xfff) #endif #ifndef CCP4_ERRGETLEVEL #define CCP4_ERRGETLEVEL(x) (((x)>>16)&0xf) #endif #ifndef CCP4_ERRGETCODE #define CCP4_ERRGETCODE(x) ((x)&0xffff) #endif #define CCP4_ERR_SYS CCP4_ERRSYSTEM(0x0) #define CCP4_ERR_FILE CCP4_ERRSYSTEM(0x1) #define CCP4_ERR_COORD CCP4_ERRSYSTEM(0x2) #define CCP4_ERR_MTZ CCP4_ERRSYSTEM(0x3) #define CCP4_ERR_MAP CCP4_ERRSYSTEM(0x4) #define CCP4_ERR_UTILS CCP4_ERRSYSTEM(0x5) #define CCP4_ERR_PARS CCP4_ERRSYSTEM(0x6) #define CCP4_ERR_SYM CCP4_ERRSYSTEM(0x7) #define CCP4_ERR_GEN CCP4_ERRSYSTEM(0x8) #define CCP4_COUNT(x) sizeof(x)/sizeof(x[0]) /** @global ccp4_errno: global variable that stores the error last error * code from the ccp4 libraries * | 12 bits - library | 4 bits - level | 16 bits - code | * * associated macros * CCP4_ERR_SYS 0 OS error * CCP4_ERR_FILE 1 io library * CCP4_ERR_COORD 2 mmdb * CCP4_ERR_MTZ 3 cmtz * CCP4_ERR_MAP 4 map io * CCP4_ERR_UTILS 5 utility routines * CCP4_ERR_PARS 6 parser routines * CCP4_ERR_SYM 7 csymlib * * and bit manipulation * CCP4_ERRSYSTEM system mask for setting * CCP4_ERRLEVEL error level mask * CCP4_ERRSETLEVEL error level mask for setting error level * CCP4_ERRGETSYS mask for returning system * CCP4_ERRGETLEVEL mask for returning level * CCP4_ERRGETCODE mask for returning the code * * error levels * 0 Success * 1 Informational * 2 Warning * 3 Error * 4 Fatal */ #ifdef __cplusplus extern "C" { #endif extern CCP4_DL_IMPORT(int) ccp4_errno; #ifdef __cplusplus } #endif #ifdef __cplusplus namespace CCP4 { extern "C" { #endif /** Print out passed message and internal message based upon * ccp4_errno * "message : error message " * @param message (const char *) * @return void */ void ccp4_error( const char *); /** Obtain character string based upon error code. * Typical use ccp4_strerror(ccp4_errno) * The returned string is statically allocated in the * library_err.c file and should not be freed. * @param error code (int) * @return const pointer to error message (const char *) */ const char *ccp4_strerror( int); /** Wrapper for ccp4_error which also calls exit(1) * @param message (const char *) * @return void */ void ccp4_fatal(const char *); /** Function to set verbosity level for messages from * ccp4_signal. Currently just off (0) and on (1). * It should be generalised to be able to switch * individual components on and off, i.e. replace 1 by * a mask. * cf. ccp4VerbosityLevel which sets the verbosity level * for ccp4printf These are separate as they may be used * differently. * @param iverb If >= 0 then set the verbosity level to the * value of iverb. If < 0 (by convention -1) then report * current level. * @return current verbosity level */ int ccp4_liberr_verbosity(int iverb); /** Routine to set ccp4_errno and print out message for * error tracing. This should be the only way in * which ccp4_errno is set. * See error codes above for levels and systems. * A callback with prototype void function(void) * may also be passed to the routine. * Note: FATAL calls exit(1). * If ccp4_liberr_verbosity returns 0, then ccp4_signal sets * ccp4_errno and returns without doing anything else. * @param error code (int) * @param message (const char * const) * @param callback (point to routine void (*)(void) ) * @return void */ void ccp4_signal(const int, const char *const, void (*)()); int cfile_perror(const char *); #ifdef __cplusplus } } #endif #endif /*!CCP4_ERROR_GUARD */ libccp4-8.0.0/ccp4/ccp4_file_err.h0000644000000000000000000000232714242731033014672 0ustar 00000000000000/* ccp4_file_err.h: header file with file handling error codes Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #ifndef _GUARD_FILE_ERR #define _GUARD_FILE_ERR #define CCP4_ERRNO(y) (CCP4_ERR_FILE | (y)) #define CIO_Ok 0 #define CIO_BadMode 1 #define CIO_CantOpenFile 2 #define CIO_MaxFile 3 #define CIO_ReadFail 4 #define CIO_WriteFail 5 #define CIO_CloseFail 6 #define CIO_SeekFail 7 #define CIO_NullPtr 8 #define CIO_EOF 9 #define CIO_NoFile 10 #define CIO_NotOpen 11 #define CIO_UnlinkFail 12 #endif libccp4-8.0.0/ccp4/ccp4_fortran.h0000644000000000000000000003012514242731033014553 0ustar 00000000000000/* ccp4_fortran.h: header file for Fortran APIs Copyright (C) 2001 Eugene Krissinel This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file ccp4_fortran.h * header file for Fortran APIs * Eugene Krissinel */ #ifndef __CCP4_FORTRAN #define __CCP4_FORTRAN #include "ccp4_types.h" /* rcsidhh[] = "$Id$" */ /* stardent is now obsolete, but we retain this category in case it is useful later */ #ifdef CALL_LIKE_STARDENT /* SStrParam is used in Ardent-like machines' fortran calls */ /* for passing a string parameter */ DefineStructure(SStrPar) struct SStrPar { pstr S; int len; int id; }; #endif #define _LVTOB(l) ((long) ((l) == 0 ? 0 : 1)) #define _BTOLV(l) ((int) ((l) == 0 ? 0 : 1)) #if defined (__OSF1__) || defined (__osf__) #undef _BTOLV #define _BTOLV(l) ((int) ((l) == 0 ? 0 : -1)) #endif /* Macro FORTRAN_SUBR(NAME,name,p_send,p_sstruct,p_sflw) makes function header statements that allow for linking with programs written in FORTRAN. Parameters: NAME name of the FORTRAN subroutine in capital letters name name of the FORTRAN subroutine in small letters p_send parameter list (in brackets) with string lengths attached to the end of it (see below) p_sstruct parameter list (in brackets) with strings passed as complex parameters, or structures p_sflw parameter list (in brackets) with string lengths following immediately the string parameters (see below) All non-string parameters must be passed as pointers, in the same order as they enter the FORTRAN call. Rules for the string parameters are as follows. 1. All strings should be specified as of 'fpstr' type. The 'fpstr' type is defined below and depends on the platform: a) whenever length of string is passed as a separate parameter ( CALL_LIKE_SUN, CALL_LIKE_HPUX, CALL_LIKE_MVS ) 'fpstr' is identical to 'pstr'. You may choose arbitrary name for the string, but you MUST use the same name, appended with suffix '_len', for its length (see example below). b) whenever string and its length are passed as complex parameter, 'fpstr' is identical to the pointer on the corresponding structure: CALL_LIKE_STARDENT : 'fpstr' is identical to 'PSStrPar' CALL_LIKE_VMS : 'fpstr' is identical to 'dsc$descriptor_s *' With 'fpstr' type, two important macro definition come: i) FTN_STR(s) - returns pointer to fortran-passed string s. This pointer is always of 'pstr' type ii) FTN_LEN(s) - returns integer length of fortran- passed string s. For this macro to work properly with SUN- and MVS-like machines, always use suffix '_len' for the string length parameters as described in a) above. 2. Three parameter lists, each enclosed in brackets, should be given. These lists retain the general order of parameters in the corresponding fortran call. Non-string parameters are passed as pointers. String parameters and their lengths are passed differently in different lists: p_send strings enter their place in the list as in the corresponding FORTRAN call, having 'fpstr' parameter type. Their lengths are appended as 'int' to the end of the list. They should retain the order in which the strings appear in the list. p_sstruct strings enter their place in the list as in the corresponding FORTRAN call, having 'fpstr' parameter type. p_sflw strings enter their place in the list as in the corresponding FORTRAN call, having 'fpstr' type and being immediately followed by their lengths as 'int' parameters. Example: FORTRAN statement subroutine SomeSub ( k,s1,a,s2,m ) integer k,m real a character*(*) s1,s2 is translated to FORTRAN_SUBR ( SOMESUB, somesub, ( int * k, fpstr s1, float * a, fpstr s2, int * m, int s1_len, int s2_len ), ( int * k, fpstr s1, float * a, fpstr s2, int * m ), ( int * k, fpstr s1, int s1_len, float * a, fpstr s2, int s2_len, int * m ) ) The macro should replace ordinary function header statements to assure compatibility with FORTRAN links. In header files, do not forget to add semicolumn: FORTRAN_SUBR ( .... ); while in source files use simply FORTRAN_SUBR ( .... ) { } Macro FORTRAN_CALL(NAME,name,p_send,p_sstruct,p_sflw) calls function defined with macro FORTRAN_SUBR(...), from a C/C++ application. Its parameters and their meaning are exactly identical to those of FORTRAN_SUBR(...). FORTRAN_CALL(...) should be followed by semicolon. */ #if defined(CALL_LIKE_SUN) typedef pstr fpstr; #if __GNUC__ > 7 || __clang_major__ > 10 typedef size_t fpstr_size_t; #else typedef int fpstr_size_t; #endif #define FTN_STR(s) s #define FTN_LEN(s) s##_len #define char_struct(s) \ pstr s; \ int s##_len; #define fill_char_struct(s,str) \ s = str; \ s##_len = strlen(str); #define init_char_struct(s,str,size) \ s = str; \ s##_len = size; #define FORTRAN_SUBR(NAME,name,p_sun,p_stardent,p_mvs) \ void name##_ p_sun #define FORTRAN_CALL(NAME,name,p_sun,p_stardent,p_mvs) \ name##_ p_sun #define FORTRAN_FUN(val,NAME,name,p_sun,p_stardent,p_mvs) \ val name##_ p_sun #elif defined(CALL_LIKE_HPUX) typedef pstr fpstr; typedef int fpstr_size_t; # define FTN_STR(s) s # define FTN_LEN(s) s##_len # define char_struct(s) \ pstr s; \ int s##_len; # define fill_char_struct(s,str) \ s = str; \ s##_len = strlen(str); # define init_char_struct(s,str,size) \ s = str; \ s##_len = size; # define FORTRAN_SUBR(NAME,name,p_sun,p_stardent,p_mvs) \ void name p_sun # define FORTRAN_CALL(NAME,name,p_sun,p_stardent,p_mvs) \ name p_sun # define FORTRAN_FUN(val,NAME,name,p_sun,p_stardent,p_mvs) \ val name p_sun #elif defined(CALL_LIKE_STARDENT) typedef PStrPar fpstr; typedef int fpstr_size_t; # define FTN_STR(s) s->Str_pointer # define FTN_LEN(s) s->Str_length # define char_struct(s) \ SStrPar s; # define fill_char_struct(s,str) \ s.S = str; \ s.len = strlen(FName); \ s.id = 0; # define init_char_struct(s,str,size) \ s.S = str; \ s.len = size; \ s.id = 0; # define FORTRAN_SUBR(NAME,name,p_send,p_sstruct,p_sflw) \ void NAME p_stardent # define FORTRAN_CALL(NAME,name,p_send,p_sstruct,p_sflw) \ NAME p_stardent # define FORTRAN_FUN(val,NAME,name,p_send,p_sstruct,p_sflw) \ val NAME p_stardent #elif defined(CALL_LIKE_VMS) typedef dsc$descriptor_s * fpstr; # define FTN_STR(s) s->dsc$a_pointer; # define FTN_LEN(s) s->dsc$w_length; # define char_struct(s) \ dsc$descriptor_s s; # define fill_char_struct(s,str) \ s.dsc$a_pointer = str; \ s.dsc$w_length = strlen(str); \ s.dsc$b_dtype = DSC$K_DTYPE_T; \ s.dsc$b_class = DSC$K_CLASS_S; # define init_char_struct(s,str,size) \ s.dsc$a_pointer = str; \ s.dsc$w_length = size; \ s.dsc$b_dtype = DSC$K_DTYPE_T; \ s.dsc$b_class = DSC$K_CLASS_S; # define FORTRAN_SUBR(NAME,name,p_sun,p_stardent,p_mvs) \ void NAME p_stardent # define FORTRAN_CALL(NAME,name,p_sun,p_stardent,p_mvs) \ NAME p_stardent # define FORTRAN_FUN(val,NAME,name,p_sun,p_stardent,p_mvs) \ val NAME p_stardent #elif defined(CALL_LIKE_MVS) #if (CALL_LIKE_MVS == 2) typedef pstr fpstr; typedef int fpstr_size_t; #define FTN_STR(s) s #define FTN_LEN(s) s##_len #define char_struct(s) \ pstr s; \ int s##_len; #define fill_char_struct(s,str) \ s = str; \ s##_len = strlen(str); #define init_char_struct(s,str,size) \ s = str; \ s##_len = size; #define FORTRAN_SUBR(NAME,name,p_sun,p_stardent,p_mvs) \ void NAME p_sun #define FORTRAN_CALL(NAME,name,p_sun,p_stardent,p_mvs) \ NAME p_sun #define FORTRAN_FUN(val,NAME,name,p_sun,p_stardent,p_mvs) \ val NAME p_sun #else typedef pstr fpstr; typedef int fpstr_size_t; # define FTN_STR(s) s # define FTN_LEN(s) s##_len # define char_struct(s) \ pstr s; \ int s##_len; # define fill_char_struct(s,str) \ s = str; \ s##_len = strlen(str); # define init_char_struct(s,str,size) \ s = str; \ s##_len = size; # define FORTRAN_SUBR(NAME,name,p_sun,p_stardent,p_mvs) \ void __stdcall NAME p_mvs # define FORTRAN_CALL(NAME,name,p_sun,p_stardent,p_mvs) \ NAME p_mvs # define FORTRAN_FUN(val,NAME,name,p_sun,p_stardent,p_mvs) \ val __stdcall NAME p_mvs # endif #else # error Unknown machine!!! typedef pstr fpstr; typedef int fpstr_size_t; # define FTN_STR(s) s # define FTN_LEN(s) s##_len # define char_struct(s) \ pstr s; \ int s##_len; # define fill_char_struct(s,str) \ s = str; \ s##_len = strlen(str); # define init_char_struct(s,str,size) \ s = str; \ s##_len = size; /** Macro to define a function such that it is callable as * a Fortran subroutine. * @param NAME Subroutine name in upper case * @param name Subroutine name in lower case * @param p_sun Argument list in Sun style * @param p_stardent Argument list in Stardent style * @param p_mvs Argument list in MVS style */ # define FORTRAN_SUBR(NAME,name,p_sun,p_stardent,p_mvs) \ void name##_ p_sun /** Macro to call a Fortran subroutine from a C function. * @param NAME Subroutine name in upper case * @param name Subroutine name in lower case * @param p_sun Argument list in Sun style * @param p_stardent Argument list in Stardent style * @param p_mvs Argument list in MVS style */ # define FORTRAN_CALL(NAME,name,p_sun,p_stardent,p_mvs) \ name##_ p_sun /** Macro to define a function such that it is callable as * a Fortran function. * @param val Data type of return value. * @param NAME Function name in upper case * @param name Function name in lower case * @param p_sun Argument list in Sun style * @param p_stardent Argument list in Stardent style * @param p_mvs Argument list in MVS style */ # define FORTRAN_FUN(val,NAME,name,p_sun,p_stardent,p_mvs) \ val name##_ p_sun #endif /* Define Fortran logical */ typedef unsigned int ftn_logical; #define FORTRAN_LOGICAL_TRUE 1 #define FORTRAN_LOGICAL_FALSE 0 #if defined (__OSF1__) || defined (__osf__) # undef FORTRAN_LOGICAL_TRUE # define FORTRAN_LOGICAL_TRUE -1 #endif char *ccp4_FtoCString(fpstr str1, int str1_len); void ccp4_CtoFString(fpstr str1, int str1_len, const char *cstring); #endif /* __CCP4_FORTRAN */ libccp4-8.0.0/ccp4/ccp4_general.c0000644000000000000000000014252114242731033014514 0ustar 00000000000000/* ccp4_general.c: General library functions and utilities. Copyright (C) 2001 CCLRC, Peter Briggs et al This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file ccp4_general.c * General library functions and utilities. * Peter Briggs et al */ /* ccp4_general.c Peter Briggs CCP4 May 2001/Feb 2003 General library functions and utilities ccperror(level,message) Error reporting and program termination ccp4printf(level,format,printargs) A wrapper for vprintf - acts like printf with an additional argument which is checked against the reference verbosity level. ccp4fyp(argc,argv) Initialise environment for CCP4 programs and parse the command line arguments ccp4setenv(logical_name,value,envname,envtype,envext,ienv, no_overwrt) Set up file names and associate with logical_name in environment ccpexists(filename) Check if file exists and can be opened for reading ccpputenv(logical_name,file_name) Set environment variable logical_name to have value file_name */ /*------------------------------------------------------------------*/ /* CCP4 library clones */ #include #include #include #include #ifdef HAVE_CONFIG_H #include /* PACKAGE_ROOT */ #endif /* Library header files */ #include "ccp4_fortran.h" #include "ccp4_utils.h" #include "ccp4_parser.h" #include "ccp4_general.h" #include "ccp4_program.h" #include "cmtzlib.h" #include "csymlib.h" #include "ccp4_errno.h" /* rcsid[] = "$Id$" */ /*------------------------------------------------------------------*/ /* ccperror Error reporting and program termination ccperror is called with a message level ierr and a message string The exact behaviour is determined by the value of ierr: 0 : normal termination and stop 1 : fatal error and stop 2 : report severe warning 3 : report information 4 : report from library ierr=-1 also reports last system error and terminates. The text in message is sent to standard output, and to standard error for ierr=1 (or -1). */ int ccperror(int ierr, const char *message) { /* Execute user-defined function callback */ ccp4InvokeCallback(ierr,message); /* Do messaging */ ccperror_noexit(ierr, message); /* Exit if necessary */ if (ierr==0) { exit(0); } else if (ierr==1 || ierr==-1) { exit(1); } return 0; } /* ccperror_noexit As above, but doesn't call exit() */ int ccperror_noexit(int ierr, const char *message) { char *prog_name=NULL; /* Get the program name */ prog_name = ccp4ProgramName(NULL); if (!prog_name) prog_name = strdup("CCP4"); if (ierr==0) { /* Level 0 : normal termination */ ccp4printf(0," %s: %s\n",prog_name,message); /* Get the amount of time elapsed since start of program. Initialised by ccp4fyp */ ccp4ProgramTime(0); /* closing tags - these are simplified w.r.t. Fortranic versions for this special case */ if (html_log_output(-1)) { printf("\n"); printf("\n"); } if (summary_output(-1)) { if (html_log_output(-1)) { printf("\n"); } else { printf("\n"); } } } else if (ierr==1 || ierr==-1) { /* Level 1 (-1) : fatal error */ /* If ierr=-1 then print last system error N.B. Use of perror in this context is untested by me */ if (ierr < 0) perror("Last system error message"); /* Send the message to the standard error */ fprintf(stderr," %s: %s\n",prog_name,message); /* Also to the standard out */ ccp4printf(0," %s: %s\n",prog_name,message); /* Get the amount of time elapsed since start of program. Initialised by ccp4fyp */ ccp4ProgramTime(0); /* closing tags - these are simplified w.r.t. Fortranic versions for this special case */ if (html_log_output(-1)) { printf("\n"); printf("\n"); } if (summary_output(-1)) { if (html_log_output(-1)) { printf("\n"); } else { printf("\n"); } } } else if (ierr==2) { /* Level 2 : severe warning */ ccp4printf(0," \n $TEXT:Warning: $$ comment $$ \n WARNING: %s\n $$\n", message); } else if (ierr>2) { /* Levels higher than 2 : report information */ ccp4printf(0,"%s\n",message); } return 0; } /*------------------------------------------------------------------*/ /* ccp4printf This is a wrapper for vprintf If the supplied message is less than or equal to the reference verbosity level then the format string and remaining arguments are passed to vprintf to be printed on stdout. Otherwise nothing is printed. The format string has the same format as the format strings passed to printf, with the remaining arguments being the values (if any) to be inserted into placeholders in the format string. Returns the number of bytes printed, or zero if no printing was performed, or a negative number for an error from vprintf. */ int ccp4printf(int level, char *format, ...) { int nbytes=0; va_list args; /* Check the level against the refence verbosity level */ if (level <= ccp4VerbosityLevel(-1)) { /* Use the vprint function to print */ va_start(args,format); nbytes = vprintf(format,args); va_end(args); } /* Return to calling function */ return nbytes; } /*------------------------------------------------------------------*/ /* return parent of directory that contains arg, e.g. * /foo/bin/prog -> /foo (actually /foo/bin/..) * C:\CCP4\bin\prog.exe -> C:\CCP4 (actually C:\CCP4\bin\..) * foo/prog -> . (actually foo/..) * prog -> .. * ../prog -> ../.. */ static const char* get_parent_directory(const char* arg) { const char *last_sep = strrchr(arg, PATH_SEPARATOR); const char *basename = last_sep != NULL ? last_sep + 1 : arg; int dir_len = basename - arg; char* parent_dir = (char*) ccp4_utils_malloc(dir_len + 3); strncpy(parent_dir, arg, dir_len); strcpy(parent_dir+dir_len, ".."); return parent_dir; } /*------------------------------------------------------------------*/ /* ccp4fyp Initialise environment for CCP4 programs and parse the command line arguments Background: This function processes the command line arguments supplied via the argv array, and performs initialisations of the CCP4 environment within the program based on these arguments. CCP4 programs which use ccp4fyp should be called with the following syntax: [switches] ... The command switches all start with a hyphen (-) and immediately follow the program name. The remainer of the arguments are logical name-value pairs. On successful completion ccp4fyp returns 0 (zero). On encountering an error, ccp4fyp registers the error condition via ccp4_signal and returns a non-zero value. */ int ccp4fyp(int argc, char **argv) { /* Diagnostics/debug output */ int diag=0; int i,iarg=1,arg_end=0,ienv=0; char *envname[CCP4_MAXNAMES],*envtype[CCP4_MAXNAMES],*envext[CCP4_MAXNAMES]; /* Flags for processing command line switches */ int info=0,ihelp=1,idefault=0,ienviron=0,nohtml=0,nosummary=0; char *testarg=NULL; /* Filenames, directories etc */ #ifdef PACKAGE_ROOT const char *pkgroot=PACKAGE_ROOT; #else const char *pkgroot=get_parent_directory(argv[0]); #endif char *basename=NULL,*cinclude=NULL,*home=NULL; char *dir=NULL,*std_dir=NULL,*tmpstr=NULL; /* Decoding environ/defaults files */ char line[CCP4_MAXLINE]; char *logical_name=NULL,*file_name=NULL,*file_type=NULL,*file_ext=NULL; CCP4PARSERARRAY *parser=NULL; /* Environ.def file */ int env_init=1; char *env_file=NULL; char *env_logical_name=NULL,*env_file_type=NULL,*env_file_ext=NULL; FILE *envfp; /* Default.def file */ int def_init=1; char *def_file=NULL; char *def_logical_name=NULL,*def_file_name=NULL; FILE *deffp; /* Used for error messages from ccp4setenv */ int ierr; /* Begin */ if (diag) printf("CCP4FYP: starting\n"); if (diag) for (i = 0; i < argc; ++i) printf("ccp4fyp: comand line argument %d %s\n",i,argv[i]); /* ------------------------------------------------------ */ /* Initialise program name and timing information */ /* ------------------------------------------------------ */ ccp4ProgramTime(1); /*ccp4ProgramName(ccp4_utils_basename(argv[0])); */ basename = ccp4_utils_basename(argv[0]); ccp4ProgramName(basename); free(basename); basename = NULL; /* ------------------------------------------------------ */ /* Process command line option switches */ /* ------------------------------------------------------ */ /* Nb ignore the first argument (iarg=0), because this is just the executable name */ while (iarg < argc && !arg_end) { if (diag) printf("CCP4FYP: command line argument %d = \"%s\"\n",iarg,argv[iarg]); if (argv[iarg][0] == '-') { /* An argument of the form -option */ if (diag) printf("--> This is an option switch\n"); /* Remove the leading hyphen */ testarg = (char *) ccp4_utils_realloc(testarg,(strlen(argv[iarg])+1)*sizeof(char)); strtoupper(testarg,&(argv[iarg][1])); if (diag) printf("--> Truncated and uppercased it is now \"%s\"\n",testarg); /* Test for each possible option: -v(erbose) 0-9 verbose output level -h(elp) 0-9 (alias for -v) -n don't read environ.def and default.def -d use instead of default.def -e use instead of environ.def -i print CCP4 library version, program name and program version to standard output, and exit. -nohtml suppress printing of html tags -nosummary suppress printing of summary tags */ if (testarg[0] == 'V' || testarg[0] == 'H') { /* -v|h <0-9>: Verbose option */ if (diag) printf("--> Identified -v option:"); /* Set ihelp to point to the argument which should hold the verbosity level, and process later */ ihelp = ++iarg; } else if (testarg[0] == 'N') { /* -n, -nohtml, -nosummary */ if (strlen(testarg) == 1) { /* -n: Don't read environ.def and default.def */ if (diag) printf("--> Identified -n option\n"); def_init = 0; env_init = 0; } else if (strncmp("NOHTML",testarg,3)==0) { /* -nohtml: Don't write html tags into logfile */ nohtml = -1; } else if (strncmp("NOSUMMARY",testarg,3)==0) { /* -nosummary: Don't write summary tags into logfile */ nosummary = -1; } } else if (testarg[0] == 'D') { /* -d : Use non-default default.def file */ if (diag) printf("--> Identified -d option:"); /* Set idefault to point to the argument which should hold the default.def file, and process later */ idefault = ++iarg; } else if (testarg[0] == 'E') { /* -e : Use non-default environ.def file */ if (diag) printf("--> Identified -e option:"); /* Set ienviron to point to the argument which should hold the environ.def file, and process later */ ienviron = ++iarg; } else if (testarg[0] == 'I') { /* -i(nfo): Info option */ if (diag) printf("--> Identified -i(nfo) option\n"); info = 1; /* Unrecognised switch */ } else { ccp4printf(1,"Ignoring unrecognised switch \"%s\"\n",argv[iarg]); } /* Next argument */ iarg++; } else { /* Found an argument which doesn't start with a "-" This is the end of the command line switches */ if (diag) printf("CCP4FYP: end of command line switches\n"); arg_end = 1; } } /* Release the memory associated with the temporary argument pointer */ if (testarg) { free(testarg); testarg = NULL; } /* ------------------------------------------------------ */ /* Finished processing command line options */ /* ------------------------------------------------------ */ /* At this point we may need to perform some actions based on the switches supplied by the user */ /* Program information requested by -i(nfo) option */ if (info) { /* Print program information and stop */ ccp4_prog_info(); exit(0); } /* Initialise debug (verbosity) level Level 0 switches off all output (silent mode) Level 9 prints everything Level 1 is normal I guess It is not clear from documentation precisely what is/is not output for the levels between 0 and 9 */ if (ihelp > 0) { /* Extract the level from the argument list - ihelp points to which argument should hold it */ if (ihelp < argc) { if (strlen(argv[ihelp]) == 1 && isdigit(argv[ihelp][0])) { ihelp = atoi(argv[ihelp]); } else { ihelp = 1; } if (diag) printf("Verbose level %d\n",ihelp); } else { ihelp = 1; if (diag) puts("No verbose level - defaulting to 1."); } } ccp4VerbosityLevel(ihelp); /* ------------------------------------------------------ */ /* Initialise HTML and SUMMARY tags */ /* ------------------------------------------------------ */ /* Initialise html, summary tags by setting environment variables for Fortran html library to pick up. No direct call, as C programs may not link to Fortran library. */ if (nohtml) ccpputenv("CCP_SUPPRESS_HTML","1"); if (nosummary) ccpputenv("CCP_SUPPRESS_SUMMARY","1"); /* ------------------------------------------------------ */ /* Get useful directories (CINCL and HOME) */ /* ------------------------------------------------------ */ /* Get value of CINCL variable - Note that (1) getenv returns a null pointer if no name is found, (2) we should not free the resulting address */ cinclude = (char *) getenv("CINCL"); if (!cinclude) { if (diag) printf("--> CINCL env var has no value assigned\n"); } else { if (diag) printf("--> CINCL is \"%s\"\n",cinclude); } /* Get value of HOME variable (same notes apply as for CINCL) */ home = (char *) getenv("HOME"); if (!home) { if (diag) printf("--> HOME env var has no value assigned\n"); } else { if (diag) printf("--> HOME is \"%s\"\n",home); } /* ------------------------------------------------------ */ /* Environ.def file */ /* ------------------------------------------------------ */ /* ------------------------------------------------------ */ /* Use non-standard environ.def file */ /* ------------------------------------------------------ */ /* The search logic is: 1. If a directory is specified as part of the filename, then use the filename as is, otherwise 2. if the HOME variable is defined, then use $HOME/filename, otherwise 3. use the filename as is (in current directory). */ if (ienviron > 0) { /* Non-standard environ.def was specified */ if (ienviron < argc) { if (env_file) free(env_file); env_file = (char *) ccp4_utils_malloc(sizeof(char)*(strlen(argv[ienviron])+1)); if (!env_file) { /* Couldn't allocate memory to store filename Do clean up and exit */ ccp4fyp_cleanup(ienv,envname,envtype,envext,logical_name,file_name, file_type,file_ext,env_file,def_file,dir,parser); ccp4_signal(CCP4_ERRLEVEL(3) | CGEN_ERRNO(CGENERR_AllocFail),"ccp4fyp",NULL); return 1; } strcpy(env_file,argv[ienviron]); if (diag) printf("CCP4FYP: env file is \"%s\"\n",env_file); env_init = 1; /* Check whether this includes the path */ if (dir) free(dir); dir = ccp4_utils_pathname(env_file); if (dir && dir[0] == '\0') { /* No path name - try and use $HOME/file_name */ if (diag) puts("CCP4FYP: env file has no path."); if (home) { tmpstr = ccp4_utils_joinfilenames(home,env_file); if (diag) printf("CCP4FYP: HOME exists, joined filename \"%s\"\n",tmpstr); if (tmpstr) { if (env_file) free(env_file); env_file = tmpstr; } else { /* Failed to make complete filename Do clean up and exit */ ccp4fyp_cleanup(ienv,envname,envtype,envext,logical_name,file_name, file_type,file_ext,env_file,def_file,dir,parser); ccp4_signal(CCP4_ERRLEVEL(3) | CGEN_ERRNO(CGENERR_EnvPathFail),"ccp4fyp",NULL); return 1; } } } if (diag) printf(" environ.def file is \"%s\"\n",env_file); } else { /* Not enough arguments in the arg list Do clean up and exit */ if (diag) printf(" no filename found\n"); ccp4fyp_cleanup(ienv,envname,envtype,envext,logical_name,file_name, file_type,file_ext,env_file,def_file,dir,parser); ccp4_signal(CCP4_ERRLEVEL(3) | CGEN_ERRNO(CGENERR_EOptionUseError),"ccp4fyp",NULL); return 1; } } /* ------------------------------------------------------ */ /* Use standard environ.def file */ /* ------------------------------------------------------ */ /* The search logic is: 1. If the CINCL variable is defined, then use $CINCL/filename, otherwise 2. if the HOME variable is defined, then use $HOME/filename, otherwise 3. use the filename as is (in current directory). */ if (!env_file) { /* Use the standard environ.def file in CINCL */ if (diag) printf("--> use standard environ.def file\n"); std_dir = NULL; if (cinclude) { std_dir = cinclude; } else if (home) { std_dir = home; } /* Set the full path for the environ.def file */ if (env_file) free(env_file); if (std_dir) { if (diag) printf("--> leading directory is \"%s\"\n",std_dir); env_file = ccp4_utils_joinfilenames(std_dir,"environ.def"); } else { env_file = ccp4_utils_joinfilenames(".","environ.def"); } if (!env_file) { /* Failed to make full path name for environ.def Do clean up and exit */ ccp4fyp_cleanup(ienv,envname,envtype,envext,logical_name,file_name, file_type,file_ext,env_file,def_file,dir,parser); ccp4_signal(CCP4_ERRLEVEL(3) | CGEN_ERRNO(CGENERR_EnvPathFail),"ccp4fyp",NULL); return 1; } if (diag) printf("--> Full path for environ.def is \"%s\"\n",env_file); } /* ------------------------------------------------------ */ /* Read in environ.def */ /* ------------------------------------------------------ */ /* environ.def contains lines of the form LOGICALNAME=type.ext # comments where type is "in", "out" or "inout" and ext is the default extension, e.g. "mtz" or "scr" */ if (env_init && env_file) { if (diag) printf("CCP4FYP: reading environ.def file\n"); if (diag) printf("--> Full path for environ.def is \"%s\"\n",env_file); /* Open the environ.def file as read-only*/ ccp4printf(2,"Opening file \"%s\"\n",env_file); envfp = fopen(env_file,"r"); /* did not find the environ.def file in std_dir so try "PACKAGE_ROOT" */ if (!envfp) { free(env_file); env_file = ccp4_utils_joinfilenames(ccp4_utils_joinfilenames( ccp4_utils_joinfilenames(pkgroot,"share"),"ccp4"),"environ.def"); if (diag) printf("CCP4FYP: reading environ.def file\n"); if (diag) printf("--> Full path for environ.def is \"%s\"\n",env_file); /* Open the environ.def file as read-only*/ ccp4printf(2,"Opening file \"%s\"\n",env_file); envfp = fopen(env_file,"r"); } /* multiple failures */ if (!envfp) { /* Failed to open the file Do clean up and exit */ ccp4fyp_cleanup(ienv,envname,envtype,envext,logical_name,file_name, file_type,file_ext,env_file,def_file,dir,parser); ccp4_signal(CCP4_ERRLEVEL(3) | CGEN_ERRNO(CGENERR_CantOpenEnvFile),"ccp4fyp",NULL); return 1; } else { /* Set up a ccp4_parser array to deal with the contents of environ.def */ parser = (CCP4PARSERARRAY *) ccp4_parse_start(CCP4_MAXTOKS); /* Set the delimiters to whitespace, = and . This should split lines into the three components */ ccp4_parse_delimiters(parser," \t=.",NULL); /* Read from the file until EOF*/ while (fgets(line,CCP4_MAXLINE,envfp)) { /* Remove the trailing newline from fgets */ line[strlen(line)-1] = '\0'; /* Use ccp4_parse to get the tokens on each line */ ccp4_parse_reset(parser); if (ccp4_parse(line,parser) == 3) { env_logical_name = parser->token[0].fullstring; env_file_type = parser->token[1].fullstring; env_file_ext = parser->token[2].fullstring; /* Check that we have values for all three components */ if (!env_logical_name || !env_file_type || !env_file_ext) { /* Error parsing the line Do clean up and exit */ ccp4fyp_cleanup(ienv,envname,envtype,envext,logical_name,file_name, file_type,file_ext,env_file,def_file,dir,parser); if (envfp) fclose(envfp); ccp4_signal(CCP4_ERRLEVEL(3) | CGEN_ERRNO(CGENERR_ParseEnvFail),"ccp4fyp",NULL); return -1; } else { /* Store in arrays for use when decoding default.def and logical names on command line */ if (ienv+1 == CCP4_MAXNAMES) { /* Exceeded the allowed number of logical names Do clean up and exit */ ccp4fyp_cleanup(ienv,envname,envtype,envext,logical_name,file_name, file_type,file_ext,env_file,def_file,dir,parser); if (envfp) fclose(envfp); ccp4_signal(CCP4_ERRLEVEL(3) | CGEN_ERRNO(CGENERR_MaxNamesExceeded),"ccp4fyp",NULL); return 1; } else { /* Store logical name in envname */ envname[ienv] = (char *) ccp4_utils_malloc(sizeof(char)*(strlen(env_logical_name)+1)); strcpy(envname[ienv],env_logical_name); /* Store file type in envtype */ envtype[ienv] = (char *) ccp4_utils_malloc(sizeof(char)*(strlen(env_file_type)+1)); strcpy(envtype[ienv],env_file_type); /* File extension in envext */ envext[ienv] = (char *) ccp4_utils_malloc(sizeof(char)*(strlen(env_file_ext)+1)); strcpy(envext[ienv],env_file_ext); if (diag) printf("Decoded line: %s = %s.%s\n",envname[ienv], envtype[ienv],envext[ienv]); /* Increment ienv counter for number of name-pairs read in */ ienv++; } } /* Reset number of tokens before reading next line */ ccp4_parse_reset(parser); } /* End of loop over lines in file */ } /* Close the environ.def file and free memory storing the filename*/ fclose(envfp); if (env_file) { free(env_file); env_file = NULL; } /* Finished with the parser array */ ccp4_parse_end(parser); parser = NULL; } } /* ------------------------------------------------------ */ /* Default.def file */ /* ------------------------------------------------------ */ /* ------------------------------------------------------ */ /* Non-standard default.def file */ /* ------------------------------------------------------ */ /* The search logic is: 1. If a directory is specified as part of the filename, then use the filename as is, otherwise 2. if the HOME variable is defined, then use $HOME/filename, otherwise 3. use the filename as is (in current directory). */ if (idefault > 0) { /* Extract the filename from the argument list - idefault points to which argument should hold it */ if (idefault < argc) { if (def_file) free(def_file); def_file = (char *) ccp4_utils_malloc(sizeof(char)*(strlen(argv[idefault])+1)); if (!def_file) { /* Couldn't allocate memory to store filename Do clean up and exit */ ccp4fyp_cleanup(ienv,envname,envtype,envext,logical_name,file_name, file_type,file_ext,env_file,def_file,dir,parser); ccp4_signal(CCP4_ERRLEVEL(3) | CGEN_ERRNO(CGENERR_AllocFail),"ccp4fyp",NULL); return 1; } strcpy(def_file,argv[idefault]); def_init = 1; if (diag) printf("CCP4FYP: def file is \"%s\"\n",def_file); /* Check whether this includes the path */ if (dir) free(dir); dir = ccp4_utils_pathname(def_file); if (dir && dir[0] == '\0') { /* No path name - try and use $HOME/file_name */ if (diag) puts("CCP4FYP: def file has no path."); if (home) { tmpstr = ccp4_utils_joinfilenames(home,def_file); if (diag) printf("CCP4FYP: HOME exists, joined filename \"%s\"\n",tmpstr); if (tmpstr) { if (def_file) free(def_file); def_file = tmpstr; } else { /* Failed to make complete filename Do clean up and exit */ ccp4fyp_cleanup(ienv,envname,envtype,envext,logical_name,file_name, file_type,file_ext,env_file,def_file,dir,parser); ccp4_signal(CCP4_ERRLEVEL(3) | CGEN_ERRNO(CGENERR_DefPathFail),"ccp4fyp",NULL); return 1; } } } if (diag) printf(" default.def file is \"%s\"\n",def_file); } else { /* Not enough arguments in the arg list Do clean up and exit */ if (diag) printf(" no filename found\n"); ccp4fyp_cleanup(ienv,envname,envtype,envext,logical_name,file_name, file_type,file_ext,env_file,def_file,dir,parser); ccp4_signal(CCP4_ERRLEVEL(3) | CGEN_ERRNO(CGENERR_DOptionUseError),"ccp4fyp",NULL); return 1; } } /* ------------------------------------------------------ */ /* Standard default.def file */ /* ------------------------------------------------------ */ /* The search logic is: 1. If the CINCL variable is defined, then use $CINCL/filename, otherwise 2. if the HOME variable is defined, then use $HOME/filename, otherwise 3. use the filename as is (in current directory). */ if (!def_file) { /* Use the standard default.def */ if (diag) printf("--> use standard default.def file\n"); std_dir = NULL; if (cinclude) { std_dir = cinclude; } else if (home) { std_dir = home; } /* Set the full path for the default.def file */ if (def_file) free(def_file); if (std_dir) { if (diag) printf("--> leading directory is \"%s\"\n",std_dir); def_file = ccp4_utils_joinfilenames(std_dir,"default.def"); } else { def_file = ccp4_utils_joinfilenames(".","default.def"); } if (!def_file) { /* Unable to set the filename Do clean up and exit */ ccp4fyp_cleanup(ienv,envname,envtype,envext,logical_name,file_name, file_type,file_ext,env_file,def_file,dir,parser); ccp4_signal(CCP4_ERRLEVEL(3) | CGEN_ERRNO(CGENERR_DefPathFail),"ccp4fyp",NULL); return 1; } if (diag) printf("--> Full path for default.def is \"%s\"\n",def_file); } /* ------------------------------------------------------ */ /* Read in default.def */ /* ------------------------------------------------------ */ /* default.def contains lines of the form LOGICALNAME=FILENAME # comments */ if (def_init && def_file) { if (diag) printf("CCP4FYP: reading default.def file\n"); if (diag) printf("--> Full path for default.def is \"%s\"\n",def_file); /* Open the default.def file as read-only*/ ccp4printf(2,"Opening file \"%s\"\n",def_file); deffp = fopen(def_file,"r"); /* did not find the default.def file in std_dir so try "PACKAGE_ROOT" */ if (!deffp) { free(def_file); def_file = ccp4_utils_joinfilenames(ccp4_utils_joinfilenames( ccp4_utils_joinfilenames(pkgroot,"share"),"ccp4"),"default.def"); if (diag) printf("CCP4FYP: reading default.def file\n"); if (diag) printf("--> Full path for default.def is \"%s\"\n",def_file); /* Open the default.def file as read-only*/ ccp4printf(2,"Opening file \"%s\"\n",def_file); deffp = fopen(def_file,"r"); } /* multiple failures */ if (!deffp) { /* Failed to open the file Do clean up and exit */ ccp4fyp_cleanup(ienv,envname,envtype,envext,logical_name,file_name, file_type,file_ext,env_file,def_file,dir,parser); ccp4_signal(CCP4_ERRLEVEL(3) | CGEN_ERRNO(CGENERR_CantOpenDefFile),"ccp4fyp",NULL); return 1; } /* Set a ccp4_parser array to deal with the contents of default.def */ parser = (CCP4PARSERARRAY *) ccp4_parse_start(CCP4_MAXTOKS); /* Set the delimiters to whitespace and = This should split lines into the two components */ ccp4_parse_delimiters(parser," \t=",NULL); /* Read from the file until EOF*/ while (fgets(line,CCP4_MAXLINE,deffp)) { /* Remove the trailing newline from fgets */ line[strlen(line)-1] = '\0'; /* Use ccp4_parse to get the tokens on each line */ ccp4_parse_reset(parser); if (ccp4_parse(line,parser) == 2) { def_logical_name = parser->token[0].fullstring; def_file_name = parser->token[1].fullstring; if (!def_logical_name || !def_file_name) { /* Failed to parse the line - do clean up and exit */ ccp4fyp_cleanup(ienv,envname,envtype,envext,logical_name,file_name, file_type,file_ext,env_file,def_file,dir,parser); if (deffp) fclose(deffp); ccp4_signal(CCP4_ERRLEVEL(3) | CGEN_ERRNO(CGENERR_ParseDefFail),"ccp4fyp",NULL); return -1; } if (diag) printf("Decoded line: %s = %s\n",def_logical_name,def_file_name); /* Set up the environment for this pair Don't overwrite any existing logical name */ ierr = ccp4setenv(def_logical_name,def_file_name, envname,envtype,envext,&ienv,1); if (ierr) { /* An error from ccp4setenv Clean up and exit */ if (deffp) fclose(deffp); ccp4fyp_cleanup(ienv,envname,envtype,envext,logical_name,file_name, file_type,file_ext,env_file,def_file,dir,parser); return ierr; } /* Reset number of tokens before reading next line */ ccp4_parse_reset(parser); } } /* Close the default.def file */ fclose(deffp); if (def_file) { free(def_file); def_file = NULL; } /* Finished with the parser array */ ccp4_parse_end(parser); parser = NULL; } /* ------------------------------------------------------ */ /* Process remaining command line arguments */ /* ------------------------------------------------------ */ /* Read in the rest of the command line arguments These should consist of pairs of arguments i.e. */ ccp4printf(2,"Processing Command Line Arguments\n"); while (iarg < argc) { /* Get logical name and uppercase it */ if (logical_name) free(logical_name); logical_name = (char *) ccp4_utils_malloc((strlen(argv[iarg])+1)*sizeof(char)); if (diag) printf("--> Raw logical name: \"%s\"\n",argv[iarg]); strtoupper(logical_name,argv[iarg]); logical_name[strlen(argv[iarg])] = '\0'; if (diag) printf("--> Logical name: \"%s\"",logical_name); iarg++; /* Get associated filename */ if (iarg < argc) { if (file_name) free(file_name); file_name = (char *) ccp4_utils_malloc((strlen(argv[iarg])+1)*sizeof(char)); strcpy(file_name,argv[iarg]); if (diag) printf(" file name: \"%s\"\n",file_name); /* Set up the environment for this pair Do overwrite any existing logical name */ ierr = ccp4setenv(logical_name,file_name,envname,envtype,envext,&ienv,0); if (diag) printf("CCP4FYP: returned from ccp4setenv, ierr = %d\n",ierr); if (ierr) { /* An error from ccp4setenv Clean up and exit */ ccp4fyp_cleanup(ienv,envname,envtype,envext,logical_name,file_name, file_type,file_ext,env_file,def_file,dir,parser); return ierr; } iarg++; } else { /* No associated filename Do clean up and exit with error */ if (diag) printf(" no associated file name\n"); ccp4fyp_cleanup(ienv,envname,envtype,envext,logical_name,file_name, file_type,file_ext,env_file,def_file,dir,parser); ccp4_signal(CCP4_ERRLEVEL(3) | CGEN_ERRNO(CGENERR_LogicalNameUseError),"ccp4fyp",NULL); return 1; } /* Next pair of arguments */ } ccp4printf(2,"End of pre-processing stage\n"); /* ------------------------------------------------------ */ /* Finished processing - do local clean up */ /* ------------------------------------------------------ */ ccp4fyp_cleanup(ienv,envname,envtype,envext,logical_name,file_name, file_type,file_ext,env_file,def_file,dir,parser); if (diag) printf("CCP4FYP: ending\n"); return 0; } /*------------------------------------------------------------------*/ /* ccp4fyp_cleanup Internal function. Called on exit from ccp4fyp - free memory associated with pointers used inside ccp4fyp. */ int ccp4fyp_cleanup(int ienv, char **envname, char **envtype, char **envext, char *logical_name, char *file_name, char *file_type, char *file_ext, char *env_file, char *def_file, char *dir, CCP4PARSERARRAY *parser) { int i; /* Parser */ if (parser) ccp4_parse_end(parser); /* Free single valued pointers, if set */ if (file_type) free(file_type); if (file_ext) free(file_ext); if (env_file) free(env_file); if (def_file) free(def_file); if (logical_name) free(logical_name); if (file_name) free(file_name); if (dir) free(dir); /* Free arrays of pointers */ if (ienv > 0) { for (i=0; i/_. */ /* Fetch CCP4_SCR */ cscr = (char *) getenv("CCP4_SCR"); if (cscr) { if (diag) printf("CCP4SETENV: CCP4_SCR = \"%s\"\n",cscr); /* Store in file_path */ lpath = strlen(cscr); if (file_path) free(file_path); file_path = (char *) ccp4_utils_malloc(sizeof(char)*(lpath+1)); strncpy(file_path,cscr,(lpath+1)); if (diag) printf("CCP4SETENV: set file path to CCP4_SCR = \"%s\"\n",file_path); } else { /* Couldn't get CCP4_SCR Clean up, set message and return an error */ ccp4setenv_cleanup(file_ext,file_root,file_path,file_name); ccp4_signal(CCP4_ERRLEVEL(3) | CGEN_ERRNO(CGENERR_CantGetCcp4Scr),"ccp4setenv",NULL); return 1; } /* Replace with _ */ lprognam = strlen(ccp4ProgramName(NULL)); tmpstr1 = ccp4_utils_malloc(sizeof(char)*(lprognam + lroot + 2)); strncpy(tmpstr1,ccp4ProgramName(NULL),lprognam); tmpstr1[lprognam] = '\0'; strncat(tmpstr1,"_",1); strncat(tmpstr1,file_root,lroot); if (file_root) free(file_root); file_root = tmpstr1; lroot = strlen(file_root); if (diag) printf("CCP4SETENV: updated file_root = \"%s\"\n",file_root); /* Replace scr extension with the process id In fact to guarantee that it is always 5 characters, take the id number modulo 100,000 */ procid = (int) getpid(); if (diag) printf("CCP4SETENV: initial procid = %d\n",procid); procid = procid % CCP4_MODULO; if (diag) printf("CCP4SETENV: procid = %d",procid); if (file_ext) free(file_ext); file_ext = (char*) ccp4_utils_malloc(sizeof(char)*6); sprintf(file_ext,"%05d",procid); lext = 5; if (diag) printf(" giving file extension \"%s\"\n",file_ext); } /* No special path for this particular extension */ } } else { if (diag) printf("CCP4SETENV: detected dev-null\n"); } /* Build the filename */ lname = lpath + 1; file_name = (char *) ccp4_utils_realloc(file_name,sizeof(char)*(lname + 1)); if (lpath < 0) { file_name[0] = '\0'; } else if (lpath == 0) { file_name[0] = PATH_SEPARATOR; file_name[1] = '\0'; } else { strncpy(file_name,file_path,lname); file_name[lpath] = PATH_SEPARATOR; file_name[lpath+1] = '\0'; } if (diag) printf("CCP4SETENV: building filename = \"%s\"\n",file_name); lname = lname + lroot; file_name = (char *) ccp4_utils_realloc(file_name,sizeof(char)*(lname + 1)); if (lroot) { strcat(file_name,file_root); } if (diag) printf("CCP4SETENV: building filename = \"%s\"\n",file_name); if (lext > 0) { lname = lname + lext + 1; file_name = (char *) ccp4_utils_realloc(file_name,sizeof(char)*(lname + 1)); strcat(file_name,"."); if (lext) { strcat(file_name,file_ext); } file_name[lname] = '\0'; } if (diag) printf("CCP4SETENV: building filename = \"%s\"\n",file_name); /* Test that (non-default) input files exist */ if (icount < *ienv) { if (strmatch(envtype[icount],"in") && !no_overwrt) { /* Does the file exist? */ if (diag) printf("CCP4SETENV: checking for existence of input file\n"); if (ccpexists(file_name)) { if (diag) printf("CCP4SETENV: \"%s\" can be opened for reading\n",file_name); } else { /* File doesn't exist/cannot be opened for reading Clean up, set message and return an error */ if (diag) printf("CCP4SETENV: \"%s\" cannot be opened for reading\n",file_name); printf("File: \"%s\"\nCannot be opened for reading\n",file_name); ccp4setenv_cleanup(file_ext,file_root,file_path,file_name); ccp4_signal(CCP4_ERRLEVEL(3) | CGEN_ERRNO(CGENERR_CantFindInFile),"ccp4setenv",NULL); return -1; } } } else { if (diag) printf("CCP4SETENV: cannot determine file type (input or output)\n"); } /* Set the environment variable */ if (ccpputenv(logical_name,file_name)) { if (diag) printf("CCP4SETENV: ccpputenv returned okay\n"); } else { /* Unable to set environment variable Clean up and exit the program */ ccp4setenv_cleanup(file_ext,file_root,file_path,file_name); ccp4_signal(CCP4_ERRLEVEL(3) | CGEN_ERRNO(CGENERR_CantSetEnvironment),"ccp4setenv",NULL); printf("Cannot create environment variable: \"%s\"\n",logical_name); return -1; } if (diag) { tmpstr1 = (char *) getenv(logical_name); if (tmpstr1) { printf("CCP4SETENV: logical name %s has value \"%s\"\n",logical_name,tmpstr1); } else { printf("CCP4SETENV: failed to fetch value for logical_name \"%s\"\n",logical_name); } } /* Free dynamically allocated memory before returning */ ccp4setenv_cleanup(file_ext,file_root,file_path,file_name); return 0; } /*------------------------------------------------------------------*/ /* ccp4setenv_cleanup Internal function. Called on exit from ccp4setenv - free memory associated with pointers used inside ccp4setenv. */ int ccp4setenv_cleanup(char *file_ext, char *file_root, char *file_path, char *file_name) { if (file_ext) free(file_ext); if (file_root) free(file_root); if (file_path) free(file_path); if (file_name) free(file_name); return 1; } /*------------------------------------------------------------------*/ /* ccpexists Check if named file exists The check is performed by attempting to fopen the file for read only, then immediately closing the file. If this method proves to be unsatisfactory then it may be necessary to investigate using access or stat instead. Returns 1 if the file can be opened for read (=exists), 0 otherwise. */ int ccpexists(char *filename) { FILE *fp; if (filename) { fp = fopen(filename,"r"); if (fp) { fclose(fp); return 1; } } return 0; } /*------------------------------------------------------------------*/ /* ccpputenv This is a wrapper for the ccp4_utils_setenv command. It must be supplied with a logical name (the name of a variable which will be set in the environment) and a file name (the value which will be assigned to that variable). Returns 1 if successful and 0 otherwise. Notes: 1. Platform-dependency is encoded in ccp4_utils_setenv. 2. Dynamically allocated strings passed to ccpputenv should be freed by the calling subprogram to avoid memory leaks. */ int ccpputenv(char *logical_name, char *file_name) { int ltmpstr,diag=0; char *tmpstr; if (logical_name && file_name) { /* Allocate memory for temporary string */ ltmpstr = strlen(logical_name) + strlen(file_name) + 1; tmpstr = (char *) ccp4_utils_malloc(sizeof(char)*(ltmpstr+1)); /* putenv requires a string of the form "logical_name=file_name" */ if (tmpstr) { strcpy(tmpstr,logical_name); strcat(tmpstr,"="); strcat(tmpstr,file_name); tmpstr[ltmpstr] = '\0'; if (diag) printf("CCPPUTENV: string going into ccp4_utils_setenv is \"%s\"\n",tmpstr); /* ccp4_utils_setenv returns 0 on success */ if (ccp4_utils_setenv(tmpstr) == 0) { /* free tmpstr here as ccp4_utils_setenv does separate malloc */ free (tmpstr); return 1; } } } return 0; } /*------------------------------------------------------------------*/ /* ccp4_banner Write CCP4 banner to standard output. */ void ccp4_banner(void) { int diag=0,i,npad; char date[11],time[9],prog_vers_str[19],infoline[100]; char prog_vers_full[MAXLEN_PROGVERSION]; if (diag) printf("Entering ccp4_banner \n"); /* Program version number */ strcpy(prog_vers_full,ccp4_prog_vers(NULL)); if (strlen(prog_vers_full)) { strcpy(prog_vers_str,"version "); strncpy(prog_vers_str+8,prog_vers_full,10); prog_vers_str[18] = '\0'; } else { /* If no program version available then use the major library version number */ sprintf(prog_vers_str,"version %-10s",ccp4_vers_no()); } /* Trim back the spaces in this string */ i = strlen(prog_vers_str); while (prog_vers_str[--i] == ' ') { prog_vers_str[i] = '\0'; } printf(" \n"); printf(" ###############################################################\n"); printf(" ###############################################################\n"); printf(" ###############################################################\n"); /* Information line This has information on the version numbers, names and RCS date Originally it was printed using the line: printf(" ### CCP4 %3s: %-17s %-18s: %-8s##\n", ccp4_vers_no(),ccp4ProgramName(NULL),prog_vers_str,ccp4RCSDate(NULL)); If the CCP4 version number exceeded three characters this would lead to the tail of the line being misaligned. This version tries to account for components of the line being longer than expected (nb it is still possible to run out of space). */ sprintf(infoline," ### CCP4 %3s: %-17s",ccp4_vers_no(),ccp4ProgramName(NULL)); /* Trim back spaces in this string */ i = strlen(infoline); while ( i != 0 && infoline[--i] == ' ') { infoline[i] = '\0'; } /* Determine how much padding we need based on length of the program version number plus what's already been printed*/ npad = 51 - strlen(infoline) - strlen(prog_vers_str); i = strlen(infoline); while (npad > 0) { infoline[i++] = ' '; infoline[i] = '\0'; --npad; } sprintf(infoline+i,"%s : %-8s##",prog_vers_str,ccp4RCSDate(NULL)); printf("%s\n",infoline); /* Rest of the banner */ printf(" ###############################################################\n"); printf(" User: %s Run date: %s Run time: %s \n\n\n", ccp4_utils_username(),ccp4_utils_date(date),ccp4_utils_time(time)); printf(" Please reference: Collaborative Computational Project, Number 4. 2011.\n"); printf(" \"Overview of the CCP4 suite and current developments\". Acta Cryst. D67, 235-242.\n"); printf(" as well as any specific reference in the program write-up.\n\n"); if (diag) printf("Leaving ccp4_banner \n"); } libccp4-8.0.0/ccp4/ccp4_general.h0000644000000000000000000000717614242731033014527 0ustar 00000000000000/* ccp4_general.h: header for general library functions and utilities. Copyright (C) 2001 CCLRC, Peter Briggs et al This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /* ccp4_general.c Header file for CCP4 library clones Peter Briggs et al CCP4 April 2001 */ /*------------------------------------------------------------------*/ /* Macro definitions */ /*------------------------------------------------------------------*/ #ifndef __CCPGeneral__ #define __CCPGeneral__ /* rcsidhl[] = "$Id$" */ /* note order: this must be outside CCP4 namespace */ #include "ccp4_parser.h" #ifdef __cplusplus namespace CCP4 { extern "C" { #endif /* MAXLINE = maximum number of characters in lines read from environ.def and default.def files (ccp4fyp) MAXTOKS = maximum number of tokens in lines read from environ.def and default.def files (ccp4fyp) MAXNAMES = maximum number of logical names that can be read and stored from environ.def (ccp4fyp) */ #define CCP4_MAXLINE 200 #define CCP4_MAXTOKS 3 #define CCP4_MAXNAMES 150 #define CCP4_MODULO 100000 /* stuff for error reporting */ #define CGEN_ERRNO(n) (CCP4_ERR_GEN | (n)) /* error defs */ #define CGENERR_Ok 0 #define CGENERR_AllocFail 1 #define CGENERR_CantSetEnvironment 2 #define CGENERR_MaxNamesExceeded 3 #define CGENERR_EOptionUseError 4 #define CGENERR_DOptionUseError 5 #define CGENERR_LogicalNameUseError 6 #define CGENERR_CantOpenEnvFile 7 #define CGENERR_CantOpenDefFile 8 #define CGENERR_ParseEnvFail 9 #define CGENERR_ParseDefFail 10 #define CGENERR_CantFindInFile 11 #define CGENERR_EnvPathFail 12 #define CGENERR_DefPathFail 13 #define CGENERR_CantGetClibd 14 #define CGENERR_CantGetCcp4Scr 15 /*------------------------------------------------------------------*/ /* Structures and typedefs */ /*------------------------------------------------------------------*/ /* */ /*------------------------------------------------------------------*/ /* Function Prototypes */ /*------------------------------------------------------------------*/ void ccp4f_mem_tidy(void); int ccperror(int ierr, const char *message); int ccperror_noexit(int ierr, const char *message); int ccp4printf(int level, char *format, ...); int ccp4fyp(int argc, char **argv); int ccp4fyp_cleanup(int ienv, char **envname, char **envtype, char **envext, char *logical_name, char *file_name, char *file_type, char *file_ext, char *env_file, char *def_file, char *dir, CCP4PARSERARRAY *parser); int ccp4setenv(char *logical_name, char* value, char **envname, char **envtype, char **envext, int *ienv, int no_overwrt); int ccp4setenv_cleanup(char *file_ext, char *file_root, char *file_path, char *file_name); int ccpexists(char *filename); int ccpputenv(char *logical_name, char *file_name); void ccp4_banner(void); #ifdef __cplusplus } } #endif #endif /* __CCPGeneral__ */ libccp4-8.0.0/ccp4/ccp4_parser.c0000644000000000000000000014701414242731033014375 0ustar 00000000000000/* ccp4_parser.c: Functions to read in and "parse" CCP4 keyworded input. Copyright (C) 2001 CCLRC, Peter Briggs This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file ccp4_parser.c * * @brief Functions to read in and "parse" CCP4-style keyworded input. * * @author Peter Briggs * @date April 2001 */ /* ccp4_parser.c Peter Briggs CCP4 April 2001 Functions to read in and "parse" (scan, in reality) CCP4-style "keyworded" input, plus utility routines. ccp4_parse_start(maxtokens) initialise a CCP4PARSERARRAY to be used in subsequent calls to ccp4_parser routines. ccp4_parse_end(parser) clean up CCP4PARSERARRAY parser after use ccp4_parse_init_token(parser,itok) initialise a single token in CCP4PARSERARRAY before use ccp4_parse_reset(parser) initialise CCP4PARSERARRAY before use (includes calls to ccp4_parse_init_token to initialise all tokens) ccp4_parse_delimiters(parser,delimiters,nulldelimiters) set up or restore non-default delimiters int ccp4_parse_comments(parser,comment_chars) set up or restore non-default comment characters ccp4_parse_maxmin(parser,max_exp,min_exp) set non-default maximum and minimum values for numerical tokens ccp4_parse(line,parser) given a string "line", break up into tokens and store in CCP4PARSERARRAY "parser" ccp4_parser(line,parser,print) read input from stdin or external file, break up into tokens and store in CCP4PARSERARRAY "parser" ccp4_keymatch(keyin1,keyin2) compare input strings to see if they match as CCP4-style keywords strtoupper(str1,str2) convert string to uppercase strmatch(str1,str2) check if strings are identical charmatch(character,charlist) check if character appears in a list of possibilities doublefromstr(str,....) convert a string representation of a number into the number, also checks for exponent over/underflow, returns numbers of digits and values of "components" (integer and fractional parts, and base-10 exponent) */ /* Header files */ #include #include #include #ifndef __FLOAT_H__ # include #endif #include #include "ccp4_parser.h" #include "ccp4_errno.h" #include "ccp4_sysdep.h" /* rcsid[] = "$Id$" */ /* stuff for error reporting */ #define CPARSER_ERRNO(n) (CCP4_ERR_PARS | (n)) /* error defs */ #define CPARSERR_Ok 0 #define CPARSERR_MaxTokExceeded 1 #define CPARSERR_AllocFail 2 #define CPARSERR_NullPointer 3 #define CPARSERR_LongLine 4 #define CPARSERR_CantOpenFile 5 #define CPARSERR_NoName 6 #define CPARSERR_ExpOverflow 7 #define CPARSERR_ExpUnderflow 8 #define CPARSERR_MatToSymop 9 #define CPARSERR_SymopToMat 10 /*------------------------------------------------------------------*/ /* Parser Functions */ /*------------------------------------------------------------------*/ /* ccp4_parse_start This initialises a CCP4PARSERARRAY to be used with the ccp4_parse/ ccp4_parser functions. The calling function must supply the maximum number of tokens. */ CCP4PARSERARRAY* ccp4_parse_start(const int maxtokens) { int itok,diag=0; CCP4PARSERARRAY *parsePtr; if (diag) printf("CCP4_PARSE_START: ccp4_parse_start starting\n"); /* Initial check for sensible values */ if (maxtokens < 1) return NULL; /* Return a pointer to a CCP4PARSERARRAY */ parsePtr = (CCP4PARSERARRAY *) ccp4_utils_malloc(sizeof(CCP4PARSERARRAY)); if (parsePtr) { if (diag) printf("CCP4_PARSE_START: allocated parsePtr\n"); parsePtr->token = (CCP4PARSERTOKEN *) ccp4_utils_malloc(sizeof(CCP4PARSERTOKEN)*maxtokens); if (!parsePtr->token) { free(parsePtr); parsePtr = NULL; } else { if (diag) printf("CCP4_PARSE_START: allocated parsePtr->token\n"); parsePtr->maxtokens = maxtokens; parsePtr->fp = NULL; /* Explicitly ensure that each token's fullstring member is set to NULL before calling ccp4_parse_reset (which tries to free memory associated with non-NULL fullstrings) since we can't rely on them being created with a NULL value */ for (itok = 0; itok < maxtokens; itok++) parsePtr->token[itok].fullstring = NULL; ccp4_parse_reset(parsePtr); if (diag) printf("CCP4_PARSE_START: fullstring set to NULL\n"); /* Initialise the default maximum and minimum allowed exponents for numerical tokens */ ccp4_parse_maxmin(parsePtr,DBL_MAX_10_EXP,DBL_MIN_10_EXP); if (diag) printf("CCP4_PARSE_START: max and min set\n"); /* Initialise the default delimiter and null delimiter characters with a call to ccp4_parse_delimiters */ parsePtr->delim=NULL; parsePtr->nulldelim=NULL; if (!ccp4_parse_delimiters(parsePtr,NULL,NULL)) { ccp4_parse_end(parsePtr); parsePtr = NULL; } if (diag) printf("CCP4_PARSE_START: delimiters set\n"); /* Initialise the default comment characters with a call to ccp4_parse_comments */ parsePtr->comment=NULL; if (!ccp4_parse_comments(parsePtr,NULL)) { ccp4_parse_end(parsePtr); parsePtr = NULL; } if (diag) printf("CCP4_PARSE_START: comments set\n"); } } if (diag) printf("CCP4_PARSE_START: Returning from ccp4_parse_start\n"); return parsePtr; } /*------------------------------------------------------------------*/ /* ccp4_parse_end This cleans up a CCP4PARSEARRAY after being used by ccp4_parse/ ccp4_parser functions. */ int ccp4_parse_end(CCP4PARSERARRAY *parsePtr) { int i,maxtokens; /* Anything to do? */ if (parsePtr) { /* Free memory for each token */ maxtokens = parsePtr->maxtokens; if (parsePtr->token && parsePtr->maxtokens > 0) { for (i=0; itoken[i].fullstring) free(parsePtr->token[i].fullstring); free(parsePtr->token); } /* Free memory for lists of comments and delimiters */ if (parsePtr->comment) free(parsePtr->comment); if (parsePtr->delim) free(parsePtr->delim); if (parsePtr->nulldelim) free(parsePtr->nulldelim); /* Free memory for rest of parserarray structure */ free(parsePtr); } /* All done */ return 0; } /*------------------------------------------------------------------*/ /* ccp4_parse_init_token Initialise a token in a parser array This sets all string members of the specified token to NULL and all numerical values (including flags) to zero */ int ccp4_parse_init_token(const CCP4PARSERARRAY *parsePtr, const int itok) { if (parsePtr) { if (itok < parsePtr->maxtokens) { /* Full string is dynamically allocated - free the associated memory, if assigned */ if (parsePtr->token[itok].fullstring) { free(parsePtr->token[itok].fullstring); parsePtr->token[itok].fullstring = NULL; } /* Set fixed string tokens to empty string */ strcpy(parsePtr->token[itok].word,""); /* Set numerical value to zero */ parsePtr->token[itok].value = 0.0; /* Set flags to zero */ parsePtr->token[itok].isstring = 0; parsePtr->token[itok].isnumber = 0; parsePtr->token[itok].isquoted = 0; parsePtr->token[itok].isnull = 0; /* Set start and end positions to zero */ parsePtr->token[itok].ibeg = 0; parsePtr->token[itok].iend = 0; } } return 0; } /*------------------------------------------------------------------*/ /* ccp4_parse_reset Reinitialise a parser array before calling ccp4_parse An application using ccp4_parse (rather than ccp4_parser, which also calls this function) can call this function to reset the parser array, rather than reinitialising the structure members explicitly */ int ccp4_parse_reset(CCP4PARSERARRAY *parsePtr) { int itok; if (parsePtr) { /* Initialise the tokens to have null values */ for (itok=0; itokmaxtokens; itok++) ccp4_parse_init_token(parsePtr,itok); /* Initialise number of tokens to zero */ parsePtr->ntokens = 0; } return 0; } /*------------------------------------------------------------------*/ /* ccp4_parse_delimiters This allows the application to set its own delimiter characters to be used in the ccp4_parser routines. If a NULL pointer is supplied for either of the two lists then then the default delimiters are (re)set. Returns 1 on success, 0 if there was an error. In the event of an error the delimiter lists will be unchanged. */ int ccp4_parse_delimiters(CCP4PARSERARRAY *parsePtr, const char *delim, const char *nulldelim) { const char defdelim[]=" \t,=\r",defnulldelim[]=",="; char *delimPtr=NULL,*nulldelimPtr=NULL; int ldelim,lnulldelim,istatus=1; if (parsePtr) { /* If supplied delim is NULL then set to the default */ if (!delim) { ldelim = strlen(defdelim) + 1; } else { ldelim = strlen(delim) + 1; } delimPtr = (char *) ccp4_utils_malloc(sizeof(char)*ldelim); if (delimPtr) { ldelim--; if (!delim) { strncpy(delimPtr,defdelim,ldelim+1); } else { strncpy(delimPtr,delim,ldelim+1); } delimPtr[ldelim] = '\0'; } /* If supplied nulldelim is NULL then set to the default */ if (!nulldelim) { lnulldelim = strlen(defnulldelim) + 1; } else { lnulldelim = strlen(nulldelim) + 1; } nulldelimPtr = (char *) ccp4_utils_malloc(sizeof(char)*lnulldelim); if (nulldelimPtr) { lnulldelim--; if (!nulldelim) { strncpy(nulldelimPtr,defnulldelim,lnulldelim+1); } else { strncpy(nulldelimPtr,nulldelim,lnulldelim+1); } nulldelimPtr[lnulldelim] = '\0'; } /* Assign new delimiters in parser array */ if (delimPtr && nulldelimPtr) { if (parsePtr->delim) free(parsePtr->delim); parsePtr->delim = delimPtr; if (parsePtr->nulldelim) free(parsePtr->nulldelim); parsePtr->nulldelim = nulldelimPtr; } else { /* There is an error - don't reset the parser array */ if (delimPtr) free(delimPtr); if (nulldelimPtr) free(nulldelimPtr); istatus = 0; } } else { istatus = 0; } return istatus; } /*------------------------------------------------------------------*/ /* ccp4_parse_comments This allows the application to set its own comment characters to be used in the ccp4_parser routines. If a NULL pointer is supplied for the list of comment characters then the default comment characters are (re)set. Returns 1 on success, 0 if there was an error. In the event of an error the comment lists will be unchanged. */ int ccp4_parse_comments(CCP4PARSERARRAY *parsePtr, const char *comment_chars) { const char def_comment_chars[]="#!"; char *commentPtr=NULL; int lcomment,istatus=1; if (parsePtr) { /* If the supplied comment list is NULL then set to the default */ if (!comment_chars) { lcomment = strlen(def_comment_chars) + 1; } else { lcomment = strlen(comment_chars) + 1; } commentPtr = (char *) ccp4_utils_malloc(sizeof(char)*lcomment); if (commentPtr) { if (!comment_chars) { strncpy(commentPtr,def_comment_chars,lcomment); } else { strncpy(commentPtr,comment_chars,lcomment); } lcomment--; commentPtr[lcomment] = '\0'; } /* Assign the new comments in the parser array */ if (commentPtr) { if (parsePtr->comment) free(parsePtr->comment); parsePtr->comment = commentPtr; } else { /* There was an error - don't reset the parser array */ istatus = 0; } } else { /* The parser was unset on entry - also an error */ istatus = 0; } return istatus; } /*------------------------------------------------------------------*/ /* ccp4_parse_maxmin This allows the application to set its own maximum and minimum exponent values, which are used as limits when evaluating the values of numerical tokens in order to avoid over/underflow. */ int ccp4_parse_maxmin(CCP4PARSERARRAY *parsePtr, const double max_exponent, const double min_exponent) { if (parsePtr) { parsePtr->max_exponent = (double) max_exponent; parsePtr->min_exponent = (double) min_exponent; } return 1; } /*------------------------------------------------------------------*/ /* ccp4_parse This is a scanner based on the old CCP4 Fortranic PARSE routine. It takes an input string ("line") and returns the number of tokens ("ntokens") which are delimited by certain characters (defaulted to space, tab, comma, equals - these can be changed by the application using a call to ccp4_parse_delimiters). Information about the tokens themselves is returned as members of elements in an array ("tokens") of type CCP4PARSERTOKEN (see header file for definition and members). Substrings can be delimited by single- or double-quotes but must be surrounded by delimiters to be recognised. An unquoted comment character (defaulted to ! or #) in the input line introduces a trailing comment which is ignored. The comment characters can be changed using a call to ccp4_parse_comments. Null fields are denoted by two adjacent null delimiters (defaulted to comma and equals - these can be changed by the application using a call to ccp4_parse_delimiters). ccp4_parse returns the number of tokens found in the line. The tokens are returned via the CCP4PARSERARRAY parser. Arguments: line = pointer to a null-terminated string of characters, forming the input to be processed. Unaltered on output. parser = pointer to a CCP4PARSERARRAY structure which will be used to hold the results of processing the input line. */ int ccp4_parse(const char *line, CCP4PARSERARRAY *parser) { int quotedstring,starttoken,endtoken; char this_char,next_char,matchquote; int llen,ich,lword,diag=0; int token,nulltoken,isquote,iscommt=0,isdelim; double value; char *delim,*nulldelim,*comm; char quot[]="\"\'"; int ibeg,iend,start; double intvalue,frcvalue,expvalue; int intdigits,frcdigits,expdigits; /* Local parser variables */ int ntok,maxtok; CCP4PARSERTOKEN *tokenarray; /* Begin */ /* Set diag = 1 and recompile to switch on diagnostic output */ if (diag) printf("CCP4_PARSE: ccp4_parse starting\n"); maxtok = parser->maxtokens; ntok = parser->ntokens; if (ntok < 0) ntok = 0; /* Initialise pointer for local version of the token array */ tokenarray = parser->token; /* Initialise pointers for lists of comments and delimiters */ comm = parser->comment; delim = parser->delim; nulldelim = parser->nulldelim; /* Don't process any tokens already dealt with */ if (ntok > 0) { start = tokenarray[ntok-1].iend + 1; /* Special case: if the last token was quoted then in fact the character at this position will be a quote - if so then step on another character */ if (charmatch(line[start],quot)) { if (diag) printf("CCP4_PARSE: start character is a quote, stepping on\n"); start++; } } else { start = 0; } /* Don't process empty lines */ llen = strlen(line); if (diag) printf("CCP4_PARSE: Line is: \"%s\"\nLength of line is %d\n",line,llen); if (llen > 0) { /* Initialise flags and counters */ quotedstring = 0; token = 0; nulltoken = 0; /* Process the line two characters at a time */ if (diag) printf("CCP4_PARSE: Start position for parsing line is %d\n",start); for (ich=start-1; ichntokens = ntok; return ntok; } if (diag) printf("CCP4_PARSE: This is the start of token %d\n",ntok); } /* End of new token */ /* End of current token */ if (endtoken) { token = 0; /* Exclude trailing quote from the token? */ if (tokenarray[ntok].isquoted) { iend = ich - 1; } else { iend = ich; } if (diag) printf("CCP4_PARSE: End of a token... iend = %d\n",iend); /* Store the full token in the array */ lword = iend - ibeg + 1; if (diag) printf("CCP4_PARSE: lword = %d - start char = %c, end char = %c\n", lword,line[ibeg],line[iend]); tokenarray[ntok].fullstring = (char *) ccp4_utils_malloc(sizeof(char)*(lword+1)); if (tokenarray[ntok].fullstring) { strncpy(tokenarray[ntok].fullstring,&line[ibeg],lword); tokenarray[ntok].fullstring[lword] = '\0'; if (diag) printf("CCP4_PARSE: Token is \"%s\"\n",tokenarray[ntok].fullstring); } else { ccp4_signal(CPARSER_ERRNO(CPARSERR_AllocFail),"ccp4_parse",NULL); } tokenarray[ntok].ibeg = ibeg; tokenarray[ntok].iend = iend; /* Store the 4 character token in the array */ if (lword > 4) lword = 4; strncpy(tokenarray[ntok].word,&line[ibeg],lword); tokenarray[ntok].word[lword] = '\0'; /* Determine numerical value (if any) */ if (doublefromstr(tokenarray[ntok].fullstring,parser->max_exponent, parser->min_exponent,&value,&intvalue,&intdigits, &frcvalue,&frcdigits,&expvalue,&expdigits)) { if (diag) printf("CCP4_PARSE: This has a numerical value of %lf\n",value); tokenarray[ntok].value = value; tokenarray[ntok].isnumber = 1; tokenarray[ntok].intdigits = intdigits; tokenarray[ntok].frcdigits = frcdigits; } else { if (diag) printf("CCP4_PARSE: There is no numerical value for this token\n"); tokenarray[ntok].isstring = 1; tokenarray[ntok].strlength = strlen(tokenarray[ntok].fullstring); } /* Reset flags etc ready for next token*/ token = 0; value = 0.0; /* Increment number of tokens */ ntok++; if (diag) printf("CCP4_PARSE: This is the end of a token\n"); } /* Don't do any more processing after a comment */ if (iscommt) { parser->ntokens = ntok; if (diag) printf("CCP4_PARSE: returning after a comment\n"); return ntok; } /* Check the next pair of characters */ } /* Reset the number of tokens in the parser array */ parser->ntokens = ntok; if (diag) printf("CCP4_PARSE: ntokens = %d, and ntok = %d\n",parser->ntokens,ntok); } if (diag) printf("CCP4_PARSE: returning at function end\n"); return ntok; } /*------------------------------------------------------------------*/ /* ccp4_parser This is based on the old CCP4 Fortranic PARSER routine. The normal behaviour is to read "keyworded" data from the input stream, and interpret it. Stdin is the default, but a line starting with @ starts reading from file until eof. Each input line may be continued on the next line by the continuation characters `&', `-' or `\' at the end of the input line. This character is dropped from the list returned to the calling application. Pass in a zero length line to force reading from the command line. nchars is the maximum number of characters which will be read into the line. (If line is not blank then it will be processed and more input read in if it ends in a continuation character, or forces reading from an external file.) The "print" argument should be supplied as 0 to suppress echoing of the input lines to standard output. ccp4_parser returns the number of tokens parsed in the input line. The results of the parsing are stored as members of the CCP4PARSEARRAY structure "parser" and can be accessed by the application program. The function returns the number of tokens, or 0 on reaching end of file. On encountering an unrecoverable error ccp4_parser returns -1. Arguments: line = pointer to a null-terminated string of characters, forming the input to be processed. On input can either be an empty string ("") or contain characters to be processed (see above for description). On output "line" will be overwritten with the actual input line, up to nchar characters. nchars = maximum number of characters that can be read into "line" i.e. the size of "line" in memory. parser = pointer to a CCP4PARSERARRAY structure which will be used to hold the results of processing the input line. print = flag controlling echoing of input lines to stdout. print=0: suppress echoing of lines to stdout Otherwise echoing is turned on. */ int ccp4_parser(char *line, const int nchars, CCP4PARSERARRAY *parser, const int print) { int fromstdin=0,fromfile=0,fromapp=0,diag=0; int nch,nold,continuation,first,trunc,llen,buflen; char *linein=NULL,filename[200]; /* Local parser variables */ int ntok; FILE *filein; CCP4PARSERTOKEN *tokenarray; /* Undocumented feature - if print < 0 then also print out diagnostic info */ if (print < 0) { /*print = 1;*/ diag = 1; } /* Begin */ if (diag) printf("CCP4_PARSER: ccp4_parser starting\n"); /* Abort if parser is a NULL pointer */ if (!parser) { ccp4_signal(CPARSER_ERRNO(CPARSERR_NullPointer),"ccp4_parser",NULL); return -1; } /* Abort if line is NULL pointer */ if (!line) { ccp4_signal(CPARSER_ERRNO(CPARSERR_NullPointer),"ccp4_parser",NULL); return -1; } /* Reset the parser array for this sweep This will prevent phantom values from an earlier call to ccp4_parser persisting in the parser array */ ccp4_parse_reset(parser); /* Blank the keyword */ strcpy(parser->keyword,""); /* Initialise local variables and pointers */ tokenarray = parser->token; ntok = parser->ntokens; filein = parser->fp; if (diag) printf("CCP4_PARSER: parser->ntokens = %d, ntok = %d\n", parser->ntokens,ntok); /* Set up an internal buffer for input The buffer is over-allocated (twice as long as the max string length allocated for line by the calling application) */ buflen = (nchars*2)+1; linein = (char *) ccp4_utils_malloc(buflen*sizeof(char)); if (!linein) { ccp4_signal(CPARSER_ERRNO(CPARSERR_AllocFail),"ccp4_parser",NULL); return 0; } /* Use nch as a count of the number of remaining characters in line */ nch = nchars; /* If line is empty then read from the standard input Otherwise process the line from the application first */ if (strlen(line)==0) { if (!filein) { if (diag) printf("CCP4_PARSER: Reading from stdin\n"); fromstdin = 1; } else { if (diag) printf("CCP4_PARSER: Reading from file\n"); fromfile = 1; } } else { if (diag) printf("CCP4_PARSER: Reading line supplied by the application program\n"); fromapp = 1; } /* Set flag for first line of input */ first = 1; /* Set flag for line continuation */ continuation = 1; /* Start the input loop */ while (continuation) { if (diag) printf("CCP4_PARSER: starting loop\n"); /* Read input from stdin a line at a time */ if (fromstdin) { if (diag) printf("CCP4_PARSER: reading from stdin...\n"); if (!fgets(linein,buflen,stdin)) { /* Jump out at this point if eof is reached from stdin */ return 0; } } else if (fromfile) { if (diag) printf("CCP4_PARSER: reading from external file...\n"); if (!fgets(linein,buflen,filein)) { /* Return to input from stdin if eof is read from the external file */ if (diag) printf("CCP4_PARSER: End of external file reached\n"); fclose(filein); filein = NULL; fromfile = 0; fromstdin = 1; /* Blank the line and reset the first flag to force reading from standard input immediately */ linein[0] = '\0'; ntok = 0; parser->ntokens = ntok; first = 1; } } else if (fromapp) { if (diag) printf("CCP4_PARSER: reading from application...\n"); /* If this line contains a continuation mark then read from stdin next time around */ strncpy(linein,line,nchars); linein[nchars]='\0'; } /* Strip any trailing newline e.g. from fgets */ llen = strlen(linein); if (llen > 0) if (linein[llen-1] == '\n') { linein[llen-1] = '\0'; llen--; } /* If previous line ended with a continuation character then append this one to it Check that we don't overflow the number of characters specified by the application */ if (llen > nch) { ccp4_signal(CPARSER_ERRNO(CPARSERR_LongLine),"ccp4_parser",NULL); } if (first) { strncpy(line,linein,nch); first = 0; } else { strncat(line,linein,nch); } nch = nchars - llen; if (diag) { printf("CCP4_PARSER: line = \"%s\"\n",line); printf("CCP4_PARSER: remaining available characters = %d\n",nch); } /* Use ccp4_parse to break the input line up into tokens Only parse the latest chunk - ccp4_parse will append new tokens onto the tokenarray */ nold = ntok; ntok = ccp4_parse(line,parser); if (diag) printf("CCP4_PARSER: ntok = %d, nold = %d\n",ntok,nold); /* Have we found more tokens since last time? */ if (ntok != nold) { /* Check first token to see if it is an instruction to read from an external file */ if (!fromfile && tokenarray[0].word[0] == '@') { if (diag) printf("CCP4_PARSER: Instruction to read from external file\n"); /* Get filename and attempt to open file */ if (tokenarray[0].fullstring) { llen = strlen(tokenarray[0].fullstring); strncpy(filename,&tokenarray[0].fullstring[1],llen); if (diag) printf("CCP4_PARSER: External file name is \"%s\"\n",filename); /* Open the external file as read-only */ filein = fopen(filename,"r"); if (!filein) { ccp4_signal(CPARSER_ERRNO(CPARSERR_CantOpenFile),"ccp4_parser",NULL); } else { fromstdin = 0; fromfile = 1; } } else { /* Token with file name is null */ ccp4_signal(CPARSER_ERRNO(CPARSERR_NoName),"ccp4_parser",NULL); } /* Blank the line and reset the number of tokens to force reading from the external file immediately */ line[0] = '\0'; ntok = 0; parser->ntokens = ntok; /* Check last token to see if it is continuation character */ } else if (ntok > 0 && (strmatch("&",tokenarray[ntok-1].word) || strmatch("\\",tokenarray[ntok-1].word) || strmatch("-",tokenarray[ntok-1].word))) { if (diag) printf("CCP4_PARSER: Detected continuation character\n"); /* It's a continuation mark Set flag to indicate this fact in later rounds */ continuation = 1; /* Truncate the line to remove the continuation character */ if (ntok > 1) trunc = tokenarray[ntok-1].ibeg; else trunc = 0; if (diag) printf("CCP4_PARSER: Continuation character should be at position %d\n\"%c\" is the character at this position\n",trunc,line[trunc]); line[trunc] = '\0'; /* Lose the last token */ ntok--; parser->ntokens = ntok; } else { /* Not a continuation character */ continuation = 0; } } else { /* Didn't get any more tokens from the last pass Check if it is a blank line or comment line */ if (ntok == 0) { /* Echo comment line to stdout and blank the line */ if (strlen(line) > 0) { if (print) printf(" Comment line--- %s\n",line); line[0] = '\0'; nch = nchars; } if (fromapp) continuation = 0; } } if (diag) printf("CCP4_PARSER: Continuation = %d\n",continuation); /* If the line was supplied by the application but is now being continued then make sure we read from stdin next time */ if (continuation && fromapp) { if (diag) printf("CCP4_PARSER: switching to stdin\n"); fromapp = 0; fromstdin = 1; } } /* Fetch and uppercase keyword */ if (ntok > 0) { strtoupper(parser->keyword,tokenarray[0].word); parser->keyword[strlen(tokenarray[0].word)] = '\0'; if (diag) printf("CCP4_PARSER: Keyword is %s\n",parser->keyword); /*Echo the line to standard output */ if (print) printf(" Data line--- %s\n",line); } else { parser->keyword[0] = '\0'; } free(linein); /* Update the returned variables */ parser->fp = filein; if (diag) printf("CCP4_PARSER: Returning from ccp4_parser\n"); return ntok; } /*------------------------------------------------------------------*/ /* ccp4_keymatch Returns 1 if keywords keyin1 and keyin2 are "identical", 0 otherwise. Keywords are identical if they are the same up to the first four characters, independent of case. */ int ccp4_keymatch(const char *keyin1, const char *keyin2) { int len1,len2; char key1[5],key2[5],keyup1[5],keyup2[5]; /* Initial check */ if (!keyin1 || !keyin2) return 0; /* Compare truncated lengths */ len1 = strlen(keyin1); if (len1 > 4) len1 = 4; len2 = strlen(keyin2); if (len2 > 4) len2 = 4; /* If lengths don't match then keywords can't be identical */ if (len1 != len2) return 0; /* If supplied words are longer than four characters then truncate them after the fourth character */ strncpy(key1,keyin1,len1); key1[len1] = '\0'; strncpy(key2,keyin2,4); key2[len2] = '\0'; /* Convert strings to uppercase */ strtoupper(keyup1,key1); keyup1[len1] = '\0'; strtoupper(keyup2,key2); keyup2[len2] = '\0'; /* Compare using strmatch */ return strmatch(keyup1,keyup2); } char *strtoupper (char *str1, const char *str2) { int len2,i; if (!str2) return NULL; len2 = strlen(str2); if (len2 > 0) for (i=0; i 0) for (i=0; i -1) return 0; point = ichar; is_int = 0; is_frc = 1; } else if (toupper(this_char) == 'E') { char next_char = (ichar+1 < lstr ) ? str[ichar+1] : '\0'; if ( next_char == '+' || next_char == '-') next_char = (ichar+2 < lstr ) ? str[ichar+2] : '\0'; /* require the next active character after E to be a digit */ if ( !isdigit(next_char) ) return 0; /* Exponent? i.e. e or E There can only be one exponent */ if (exponent > -1) return 0; exponent = ichar; is_int = 0; is_frc = 0; is_exp = 1; } else { /* Not a permissible character This is not a number so get out now */ if (diag) printf("DOUBLEFROMSTR: Not a permitted character - exiting\n"); return 0; } } else { /* It is a digit Build up the value of each component */ if (diag) printf(" is a digit ...\n"); this_str[0] = this_char; this_str[1] = '\0'; char_value = atoi(this_str); if (is_int) { /* Integer part of the number */ n_int_digits++; int_value = int_value * 10.0 + (double) char_value; if (diag) printf("DOUBLEFROMSTR: Processing integer component: value = %lf, #digits = %d\n",int_value,n_int_digits); } else if (is_frc) { /* Decimal part of the number */ n_frc_digits++; frc_value = frc_value + ((double) char_value)/pow(10.0,(double) n_frc_digits); if (diag) printf("DOUBLEFROMSTR: Processing decimal component: value = %lf, #digits = %d\n",frc_value,n_frc_digits); } else if (is_exp) { /* Exponent */ n_exp_digits++; exp_value = exp_value * 10.0 + (double) char_value; if (diag) printf("DOUBLEFROMSTR: Processing exponential component: value = %lf, #digits = %d\n",exp_value,n_exp_digits); } } /* Next character */ ichar++; } /* Done loop over characters - if we have got this far then it must be a number */ /* Set component values */ int_value = int_value * (double) sign; frc_value = frc_value * (double) sign; exp_value = exp_value * (double) expsign; /* Export component values */ *intvaluePtr = int_value; *frcvaluePtr = frc_value; *expvaluePtr = exp_value; /* Export numbers of 'digits' */ *intdigitsPtr = n_int_digits; *frcdigitsPtr = n_frc_digits; *expdigitsPtr = n_exp_digits; /* Is the exponent out-of-range? */ /* There are two considerations: (i) can pow(10.0,exp_value) actually be evaluated? (ii) can int_part * pow(10.0,exp_value) be evaluated? This second is an issue for numbers with int_part > 0. */ if ( (exp_value + (double) (n_int_digits - 1) > max_exp) && (n_int_digits || n_frc_digits) ) { ccp4_signal(CPARSER_ERRNO(CPARSERR_ExpOverflow),"doublefromstr",NULL); printf("DOUBLEFROMSTR: Token is \"%s\"\n",str); *valuePtr = 0.0; } else if ( (exp_value < min_exp) && (n_int_digits || n_frc_digits) ) { ccp4_signal(CPARSER_ERRNO(CPARSERR_ExpUnderflow),"doublefromstr",NULL); printf("DOUBLEFROMSTR: Token is \"%s\"\n",str); *valuePtr = 0.0; } else { /* Evaluate the number to get a value */ *valuePtr = int_value + frc_value; if (is_exp) *valuePtr = (*valuePtr)*pow(10.0,exp_value); } if (diag) printf("DOUBLEFROMSTR: Integer component = %lf, (%d digits)\n", *intvaluePtr,*intdigitsPtr); if (diag) printf("DOUBLEFROMSTR: Decimal component = %lf, (%d digits)\n", *frcvaluePtr,*frcdigitsPtr); if (diag) printf("DOUBLEFROMSTR: Exponent component = %lf, (%d digits)\n", *expvaluePtr,*expdigitsPtr); if (diag) printf("DOUBLEFROMSTR: Finished - value is determined to be %lf\n",*valuePtr); return 1; } ccp4_symop symop_to_rotandtrn(const char *symchs_begin, const char *symchs_end) { float rsm[4][4]; symop_to_mat4(symchs_begin, symchs_end, rsm[0]); return (mat4_to_rotandtrn((const float (*)[4])rsm)); } /*------------------------------------------------------------------*/ /* symop_to_mat4 Translates a single symmetry operator string into a 4x4 quine matrix representation NB Uses a utility function (symop_to_mat4_err) when reporting failures. Syntax of possible symop strings: real space symmetry operations, e.g. X+1/2,Y-X,Z reciprocal space operations, e.g. h,l-h,-k reciprocal axis vectors, e.g. a*+c*,c*,-b* real space axis vectors, e.g. a,c-a,-b The strings can contain spaces, and the coordinate and translation parts may be in either order. The function returns 1 on success, 0 if there was a failure to generate a matrix representation. */ const char *symop_to_mat4(const char *symchs_begin, const char *symchs_end, float *rot) { int no_real =0, no_recip = 0, no_axis = 0; /* counters */ int col = 3, nops = 0; int nsym = 0, init_array = 1; float sign = 1.0f, value = 0.0f, value2; char *cp, ch; const char *ptr_symchs = symchs_begin; int j,k; /* loop variables */ int Isep = 0; /* parsed seperator? */ while (ptr_symchs < symchs_end) { ch = *ptr_symchs; /* Parse symop */ if (isspace(ch)) { /* Have to allow symop strings to contain spaces for compatibility with older MTZ files Ignore and step on to next character */ ++ptr_symchs; continue; } else if (ch == ',' || ch == '*') { ++ptr_symchs; if (value == 0.0f && col == 3) { /* nothing set, this is a problem */ ccp4_signal(CPARSER_ERRNO(CPARSERR_SymopToMat),"symop_to_mat4",NULL); return NULL ; } else { Isep = 1; /* drop through to evaluation*/ } } else if (ch == 'X' || ch == 'x') { no_real++, col = 0; if (value == 0.0f) value = sign * 1.0f; ++ptr_symchs; continue; } else if (ch == 'Y' || ch == 'y') { no_real++, col = 1; if (value == 0.0f) value = sign * 1.0f; ++ptr_symchs; continue; } else if (ch == 'Z' || ch == 'z') { no_real++, col = 2; if (value == 0.0f) value = sign * 1.0f; ++ptr_symchs; continue; } else if (ch == 'H' || ch == 'h') { no_recip++, col = 0; if (value == 0.0f) value = sign * 1.0f; ++ptr_symchs; continue; } else if (ch == 'K' || ch == 'k') { no_recip++, col = 1; if (value == 0.0f) value = sign * 1.0f; ++ptr_symchs; continue; } else if (ch == 'L' || ch == 'l') { no_recip++, col = 2; if (value == 0.0f) value = sign * 1.0f; ++ptr_symchs; continue; } else if (ch == 'A' || ch == 'a') { no_axis++, col = 0; if (value == 0.0f) value = sign * 1.0f; if (*++ptr_symchs == '*' && ( no_axis != 3 || no_recip )) ++ptr_symchs; continue; } else if (ch == 'B' || ch == 'b') { no_axis++, col = 1; if (value == 0.0f) value = sign * 1.0f; if (*++ptr_symchs == '*' && ( no_axis != 3 || no_recip )) ++ptr_symchs; continue; } else if (ch == 'C' || ch == 'c') { no_axis++, col = 2; if (value == 0.0f) value = sign * 1.0f; if (*++ptr_symchs == '*' && ( no_axis != 3 || no_recip )) ++ptr_symchs; continue; } else if (ch == '+' || ch == '-') { sign = ((ch == '+')? 1.0f : -1.0f) ; ++ptr_symchs; if ( value == 0.0f && col == 3) continue; /* drop through to evaluation */ } else if ( ch == '/') { ++ptr_symchs; if (value == 0.0f) { /* error */ symop_to_mat4_err(symchs_begin); return NULL; } value2 = strtod(ptr_symchs, &cp); if (!value2) { /* error */ symop_to_mat4_err(symchs_begin); return NULL; } /* Nb don't apply the sign to value here It will already have been applied in the previous round */ value = (float) value/value2; ptr_symchs = cp; continue; } else if ( isdigit(ch) || ch == '.') { value = sign*strtod(ptr_symchs, &cp); ptr_symchs = cp; continue; } else { ++ptr_symchs; continue; } /* initialise and clear the relevant array (init_array == 1)*/ /* use knowledge that we are using a [4][4] for rot */ if (init_array) { init_array = 0; for (j = 0 ; j !=4 ; ++j) for (k = 0; k !=4 ; ++k) rot[(((nsym << 2) + k ) << 2) +j] = 0.0f; rot[(((nsym << 2 ) + 3 ) << 2) +3] = 1.0f; } /* value to be entered in rot */ rot[(((nsym << 2) + nops) << 2) + col] = value; /* have we passed a operator seperator */ if (Isep) { Isep = 0; ++nops; sign = 1.0f; if (nops == 3 ) { ++nsym; nops=0 ; init_array = 1; } } /* reset for next cycle */ col = 3; value = 0.0f; no_recip = 0, no_axis = 0, no_real = 0; } /* Tidy up last value */ if (value) rot[(((nsym << 2) + nops) << 2) + col] = value; if (nops<2) { /* Processed fewer than 3 operators, raise an error */ symop_to_mat4_err(symchs_begin); return NULL; } /* Return with success */ return ptr_symchs; } /* Internal function: report error from symop_to_mat4_err */ int symop_to_mat4_err(const char *symop) { printf("\n **SYMMETRY OPERATOR ERROR**\n\n Error in interpreting symop \"%s\"\n\n", symop); ccp4_signal(CPARSER_ERRNO(CPARSERR_SymopToMat),"symop_to_mat4",NULL); return 1; } ccp4_symop mat4_to_rotandtrn(const float rsm[4][4]) { int i,j; ccp4_symop symop; for (i = 0; i < 3; ++i) { for (j = 0; j < 3; ++j) symop.rot[i][j]=rsm[i][j]; symop.trn[i]=rsm[i][3]; } return (symop); } char *rotandtrn_to_symop(char *symchs_begin, char *symchs_end, const ccp4_symop symop) { float rsm[4][4]; rotandtrn_to_mat4(rsm,symop); return(mat4_to_symop(symchs_begin,symchs_end,(const float (*)[4])rsm)); } void rotandtrn_to_mat4(float rsm[4][4], const ccp4_symop symop) { int i,j; for (i = 0; i < 3; ++i) { for (j = 0; j < 3; ++j) rsm[i][j]=symop.rot[i][j]; rsm[i][3]=symop.trn[i]; rsm[3][i]=0.0; } rsm[3][3]=1.0; } char *mat4_to_symop(char *symchs_begin, char *symchs_end, const float rsm[4][4]) { static char axiscr[] = {'X','Y','Z'}; static char numb[] = {'0','1','2','3','4','5','6','7','8','9'}; static int npntr1[12] = { 0,1,1,1,0,1,0,2,3,5,0,0 }; static int npntr2[12] = { 0,6,4,3,0,2,0,3,4,6,0,0 }; int jdo10, jdo20, irsm, itr, ist; register char *ich; int debug=0; if (debug) for (jdo20 = 0; jdo20 != 4; ++jdo20) printf("Input matrix: %f %f %f %f \n",rsm[jdo20][0],rsm[jdo20][1], rsm[jdo20][2],rsm[jdo20][3]); /* blank output string */ for (ich = symchs_begin; ich < symchs_end; ++ich) *ich = ' '; ich = symchs_begin; for (jdo20 = 0; jdo20 != 3; ++jdo20) { *ich = '0'; ist = 0; /* ---- Ist is flag for first character of operator */ for (jdo10 = 0; jdo10 != 4; ++jdo10) { if (rsm[jdo20][jdo10] != 0.f) { irsm = (int) rint(fabs(rsm[jdo20][jdo10])); if ( rsm[jdo20][jdo10] > 0. && ist) { if (ich >= symchs_end) { ccp4_signal(CCP4_ERRLEVEL(3) | CPARSER_ERRNO(CPARSERR_MatToSymop), "mat4_to_symop 1", NULL); return NULL; } *ich++ = '+'; } else if ( rsm[jdo20][jdo10] < 0.f ) { if (ich >= symchs_end) { ccp4_signal(CCP4_ERRLEVEL(3) | CPARSER_ERRNO(CPARSERR_MatToSymop), "mat4_to_symop 2", NULL); return NULL; } if (jdo10 != 3) { *ich++ = '-'; } else { /* translation part is forced to be positive, see below */ *ich++ = '+'; } ist = 1; } if (jdo10 != 3) { /* rotation part */ if (ich+1 >= symchs_end) { ccp4_signal(CCP4_ERRLEVEL(3) | CPARSER_ERRNO(CPARSERR_MatToSymop), "mat4_to_symop 3", NULL); return NULL; } if (irsm != 1) { *ich++ = numb[irsm]; *ich++ = axiscr[jdo10]; } else { *ich++ = axiscr[jdo10]; } ist = 1; } else { /* translation part */ itr = (int) rint(rsm[jdo20][3]*12.0); while (itr < 0) itr += 12; itr = (itr - 1) % 12; if (npntr1[itr] > 0) { if (ich+2 >= symchs_end) { ccp4_signal(CCP4_ERRLEVEL(3) | CPARSER_ERRNO(CPARSERR_MatToSymop), "mat4_to_symop 4", NULL); return NULL; } *ich++ = numb[npntr1[itr]]; *ich++ = '/'; *ich++ = numb[npntr2[itr]]; } else { *--ich = ' '; } } } } if (jdo20 != 2) { if (*ich == '0') ++ich; if (ich+2 >= symchs_end) { ccp4_signal(CCP4_ERRLEVEL(3) | CPARSER_ERRNO(CPARSERR_MatToSymop), "mat4_to_symop 5", NULL); return NULL; } *ich++ = ','; *ich++ = ' '; *ich++ = ' '; } } return symchs_begin; } char *mat4_to_recip_symop(char *symchs_begin, char *symchs_end, const float rsm[4][4]) { char *symop; size_t lsymop; register char *ich, *ich_out; lsymop = symchs_end-symchs_begin; symop = (char *) ccp4_utils_malloc(lsymop*sizeof(char)); mat4_to_symop(symop, symop+lsymop, rsm); ich_out = symchs_begin; for (ich = symop; ich < symop+lsymop; ++ich) { if (*ich == 'X') { if (ich_out == symchs_begin || (ich_out > symchs_begin && *(ich_out-1) != '-' && *(ich_out-1) != '+')) *ich_out++ = '+'; *ich_out++ = 'h'; } else if (*ich == 'Y') { if (ich_out == symchs_begin || (ich_out > symchs_begin && *(ich_out-1) != '-' && *(ich_out-1) != '+')) *ich_out++ = '+'; *ich_out++ = 'k'; } else if (*ich == 'Z') { if (ich_out == symchs_begin || (ich_out > symchs_begin && *(ich_out-1) != '-' && *(ich_out-1) != '+')) *ich_out++ = '+'; *ich_out++ = 'l'; } else if (*ich == ' ') { /* skip */ } else { *ich_out++ = *ich; } } while (ich_out < symchs_end) *ich_out++ = ' '; free (symop); return symchs_begin; } libccp4-8.0.0/ccp4/ccp4_parser.h0000644000000000000000000002423014242731033014374 0ustar 00000000000000/* ccp4_parser.h: Headers for functions to read in and "parse" CCP4 keyworded input. Copyright (C) 2001 CCLRC, Peter Briggs This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @page cparser_page CParser library * * @verbatim @endverbatim * * @section cparser_file_list File list
  • ccp4_parser.h - contains details of the C/C++ API
* @section cparser_overview Overview These functions do CCP4-style parsing, as used for processing keywords of CCP4 programs, MTZ header records, etc. * @section cparser_usage Usage The following code snippets illustrate how the functions might be used to read from stdin:

int           ntok=0;
char          line[201],*key;
CCP4PARSERTOKEN * token=NULL;
CCP4PARSERARRAY * parser;

  parser = (CCP4PARSERARRAY *) ccp4_parse_start(20);
  key   = parser->keyword;
  token = parser->token;

  RC   = 0;
  while (!RC) {

    line[0] = '\0';
    ntok = ccp4_parser(line,200,parser,1);

    if (ntok < 1) {

      RC = 111;

    } else {      

      if (ccp4_keymatch("MINDIST",key))  {
	if (ntok != 2) {
	  ccperror ( 1,"MINDIST requires a single numerical argument" );
	  RC = -100;
	} else {
	  minDist = token[1].value;
        }
      }	else  {
	printf ( "Unrecognised keyword \"%s\"\n",token[0].fullstring );
	RC = -118;
      }
    }
  }

  ccp4_parse_end ( parser );

* @section cparser_examples Examples See the distributed programs NCONT and PDBCUR. */ /** @file ccp4_parser.h * * @brief Functions to read in and "parse" CCP4-style keyworded input. * * @author Peter Briggs * @date April 2001 */ /*------------------------------------------------------------------*/ /* Macro definitions */ /*------------------------------------------------------------------*/ #ifndef __CCP4_Parser__ #define __CCP4_Parser__ /* rcsidhhh[] = "$Id$" */ /* note order: these must be outside CCP4 namespace */ #include #include"ccp4_utils.h" #include"ccp4_spg.h" /* Macro to make C functions callable from C++ */ #ifdef __cplusplus namespace CCP4 { extern "C" { typedef CSym::ccp4_symop ccp4_symop; #endif /*------------------------------------------------------------------*/ /* Structures and typedefs */ /*------------------------------------------------------------------*/ /* CCP4 Parser token Construct to hold the information about a single token */ typedef struct { char *fullstring; /* Full string containing all of token */ char word[5]; /* First four characters of token */ double value; /* Equivalent numerical value */ int isstring; /* Flag: true if token is character string */ int strlength; /* Number of characters in whole token (strings only) */ int isnumber; /* Flag: true if token is number */ int intdigits; /* Number of 'digits' preceeding the decimal point (numbers only) */ int frcdigits; /* Number of 'digits' after the decimal point (numbers only) */ int isquoted; /* Flag: true if token is contained in quotes */ int isnull; /* Flag: true if token is null field */ int ibeg,iend; /* Begin and end character positions of token in input line */ } CCP4PARSERTOKEN; /* CCP4 Parser array Construct to hold the information about a parsed line */ typedef struct { /* "Public" members */ char keyword[5]; /* Keyword (=token[1].token, uppercased) */ int ntokens; /* Number of tokens */ CCP4PARSERTOKEN *token; /* Array of tokens */ /* "Private" members */ FILE *fp; /* Pointer to an external command file */ int maxtokens; /* Maximum number of tokens allowed */ char *delim; /* List of delimiter characters */ char *nulldelim; /* List of null delimiter characters */ char *comment; /* List of comment characters */ double max_exponent; /* Largest allowed exponent for numerical tokens */ double min_exponent; /* Smallest allowed exponent for numerical tokens */ } CCP4PARSERARRAY; /*------------------------------------------------------------------*/ /* Function Prototypes */ /*------------------------------------------------------------------*/ /* Core cparser functions */ /** Initialise a CCP4PARSERARRAY to be used in subsequent calls to * ccp4_parser routines. The calling function must supply the maximum * number of tokens on a line (including continuation lines). * @param maxtokens maximum number of tokens on a line * @return pointer to a new CCP4PARSERARRAY structure */ CCP4PARSERARRAY* ccp4_parse_start(const int maxtokens); /** Cleans up a CCP4PARSEARRAY after being used by ccp4_parse/ ccp4_parser functions. * @param parsePtr pointer to a CCP4PARSERARRAY structure * @return 0 on completion */ int ccp4_parse_end(CCP4PARSERARRAY *parsePtr); int ccp4_parse_init_token(const CCP4PARSERARRAY *parsePtr, const int itok); int ccp4_parse_delimiters(CCP4PARSERARRAY *parsePtr, const char *delim, const char *nulldelim); int ccp4_parse_comments(CCP4PARSERARRAY *parsePtr, const char *comment_chars); int ccp4_parse_maxmin(CCP4PARSERARRAY *parsePtr, const double max_exponent, const double min_exponent); int ccp4_parse_reset(CCP4PARSERARRAY *parsePtr); int ccp4_parse(const char *line, CCP4PARSERARRAY *parser); /** The main function for parsing lines, either supplied or read * from stdin. * @param line pointer to a null-terminated string of characters, * forming the input to be processed. On input can either be an empty * string ("") which forces reading from stdin, or contain characters * to be processed. On output "line" will be overwritten with the actual * input line. * @param n maximum number of characters that can be read into * "line" i.e. the size of "line" in memory. * @param parser pointer to a CCP4PARSERARRAY structure which will * be used to hold the results of processing the input line. * @param print flag controlling echoing of input lines to stdout. * print=0: suppress echoing of lines to stdout. Otherwise echoing is * turned on. * @return Number of tokens found. */ int ccp4_parser(char *line, const int n, CCP4PARSERARRAY *parser, const int print); /* External utility functions */ /** Test whether two keywords are identical. Keywords are identical if * they are the same up to the first four characters, independent of case. * @param keyin1 keyword 1. * @param keyin2 keyword 2. * @return 1 if keywords keyin1 and keyin2 are "identical", 0 otherwise. */ int ccp4_keymatch(const char *keyin1, const char *keyin2); /* Internal utility functions */ /** Convert string to uppercase. * @param str1 On exit str1 will contain uppercased copy of str2 * @param str2 Input string * @return str1 */ char *strtoupper (char *str1, const char *str2); /** Convert string to lowercase. * @param str1 On exit str1 will contain lowercased copy of str2 * @param str2 Input string * @return str1 */ char *strtolower (char *str1, const char *str2); int strmatch (const char *str1, const char *str2); int charmatch(const char character, const char *charlist); int doublefromstr(const char *str, const double max_exp, const double min_exp, double *valuePtr, double *intvaluePtr, int *intdigitsPtr, double *frcvaluePtr, int *frcdigitsPtr, double *expvaluePtr, int *expdigitsPtr); /** Convert symmetry operator as string to ccp4_symop struct. * @param symchs_begin pointer to beginning of string * @param symchs_end pointer to end of string (i.e. last character * is *(symchs_end-1) ) * @return pointer to ccp4_symop struct */ ccp4_symop symop_to_rotandtrn(const char *symchs_begin, const char *symchs_end); /** Convert symmetry operator as string to matrix. * This is Charles' version of symfr. Note that translations * are held in elements [*][3] and [3][3] is set to 1.0 * @param symchs_begin pointer to beginning of string * @param symchs_end pointer to end of string (i.e. last character * is *(symchs_end-1) ) * @param rot 4 x 4 matrix operator * @return NULL on error, final position pointer on success */ const char * symop_to_mat4(const char *symchs_begin, const char *symchs_end, float *rot); int symop_to_mat4_err(const char *symop); ccp4_symop mat4_to_rotandtrn(const float rsm[4][4]); /* This is Charles' version of symtr */ char *rotandtrn_to_symop(char *symchs_begin, char *symchs_end, const ccp4_symop symop); void rotandtrn_to_mat4(float rsm[4][4], const ccp4_symop symop); /** Convert symmetry operator as matrix to string. * This is Charles' version of symtr. Note that translations * are held in elements [*][3] and [3][3] is set to 1.0 * @param symchs_begin pointer to beginning of string * @param symchs_end pointer to end of string (i.e. last character * is *(symchs_end-1) ) * @param rsm 4 x 4 matrix operator * @return pointer to beginning of string */ char *mat4_to_symop(char *symchs_begin, char *symchs_end, const float rsm[4][4]); /** Convert symmetry operator as matrix to string in reciprocal space notation. * This is Charles' version of symtr. Note that translations * are held in elements [*][3] and [3][3] is set to 1.0 * @param symchs_begin pointer to beginning of string * @param symchs_end pointer to end of string (i.e. last character * is *(symchs_end-1) ) * @param rsm 4 x 4 matrix operator * @return pointer to beginning of string */ char *mat4_to_recip_symop(char *symchs_begin, char *symchs_end, const float rsm[4][4]); #ifdef __cplusplus } } #endif #endif /* __CCP4_Parser__ */ libccp4-8.0.0/ccp4/ccp4_program.c0000644000000000000000000002200514242731033014540 0ustar 00000000000000/* ccp4_program.c: Utilies to set and fetch program information. Copyright (C) 2001 CCLRC, Peter Briggs This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file ccp4_program.c * Utilies to set and fetch program information. * Peter Briggs CCP4 May 2001 */ #include #include #include #include #include "ccp4_program.h" #include "ccp4_parser.h" #include "ccp4_utils.h" #include "ccp4_general.h" /* rcsid[] = "$Id$" */ static char ccp4version[MAXLEN_PROGVERSION]; char *ccp4_prog_vers(const char *progvers) { static char programversion[MAXLEN_PROGVERSION]=""; if (progvers) { strncpy(programversion, progvers, MAXLEN_PROGVERSION); programversion[MAXLEN_PROGVERSION-1] = '\0'; } return programversion; } char *ccp4_vers_no(void) { static int init=0; char *filepath=NULL, *filename=NULL; char *vfile="/lib/ccp4/MAJOR_MINOR"; FILE *cfile; int i; if (!init) { strcpy(ccp4version,CCP4_VERSION_NO); filepath = (char *) getenv("CCP4"); if (filepath) { filename = (char *) ccp4_utils_malloc(sizeof(char)*(strlen(filepath)+strlen(vfile))+1); strcpy(filename,filepath); strcat(filename,vfile); if (ccpexists(filename)) { cfile=fopen(filename,"r"); if (cfile) { fgets(ccp4version,MAXLEN_PROGVERSION,cfile); i = strlen(ccp4version)-1; while (isspace(ccp4version[i]) ) { ccp4version[i--]='\0'; } } } /* Make sure that we clean up */ if (filename) free(filename); } init=1; } return ccp4version; } /*------------------------------------------------------------------*/ /* ccp4ProgramName Set or return program name Always returns a pointer to the program name If progname is not NULL then set the program name to progname. NB Default program name will be returned as "CCP4", until reset by the calling subprogram. */ char *ccp4ProgramName(const char *progname) { static char programname[MAXLEN_PROGNAME]="CCP4"; int i; if (progname) { i = 0; while (progname[i] != '\0' && i < MAXLEN_PROGNAME) { programname[i] = progname[i]; ++i; } if (i == MAXLEN_PROGNAME) { programname[MAXLEN_PROGNAME-1] = '\0'; } else { programname[i] = '\0'; } } return programname; } /* ccp4_prog_info Print program info for -i option. */ void ccp4_prog_info(void) { printf("CCP4 software suite: library version %s\n",ccp4_vers_no()); printf("CCP4 software suite: patch level %s\n",ccp4_vers_no()); printf("Program: %s",ccp4ProgramName(NULL)); if (ccp4_prog_vers(NULL) && strlen(ccp4_prog_vers(NULL))) printf("; version %s",ccp4_prog_vers(NULL)); printf("\n"); } /* ccp4RCSDate Set or return program RCS date If the input string is not a NULL pointer then it is assumed to be an RCS string This is processed to extract a date string in the form "DD/MM/YY" (day/month/year), which is then stored. ccp4RCSDate always returns the currently stored date string. */ char *ccp4RCSDate(const char *rcs_string) { static char RCSDate[MAXLEN_RCSDATE]=""; char tmpstr1[8],tmpstr2[3]; /* Deconstruct the RCS string passed to this function */ if (rcs_string) { /* Extract useful data from RCS string for examination */ strncpy(tmpstr1,rcs_string,7); tmpstr1[7] = '\0'; strncpy(tmpstr2,rcs_string,2); tmpstr2[2] = '\0'; if (strncmp(tmpstr1,"$Date: ",7) == 0) { /* Raw form of RCS string (not exported) i.e.: "$Date$" */ /* Build the date string in the form DD/MM/YY */ strncpy(RCSDate,rcs_string+15,2); strncat(RCSDate,"/",1); strncat(RCSDate,rcs_string+12,2); strncat(RCSDate,"/",1); strncat(RCSDate,rcs_string+9,2); } else if (strlen(rcs_string) > 10 && (strncmp(tmpstr2,"19",2) == 0 || strncmp(tmpstr2,"20",2)) ) { /* RCS string after export i.e.: "2003/05/14 11:45:13 ..." */ /* Build the date string in the form DD/MM/YY */ strncpy(RCSDate,rcs_string+8,2); strncat(RCSDate,"/",1); strncat(RCSDate,rcs_string+5,2); strncat(RCSDate,"/",1); strncat(RCSDate,rcs_string+2,2); } else { /* Fallback */ strncpy(RCSDate,"",1); } } /* Always return the stored date */ return RCSDate; } /* ccp4ProgramTime Set or print program time information */ void ccp4ProgramTime(int init) { static int elaps0=0; static float tarray0[2]; int elaps; float tarray[2]; if (init || !elaps0 ) { elaps0 = time(NULL); ccp4_utils_etime(tarray0); } else { elaps = time(NULL) - elaps0; ccp4_utils_etime(tarray); printf("Times: User: %9.1fs System: %6.1fs Elapsed: %5d:%2.2d \n", tarray[0]-tarray0[0],tarray[1]-tarray0[1],elaps/60,elaps%60); } } /* ccp4VerbosityLevel Set or return the reference verbosity level Always return the verbosity level - if verboselevel is between 0 and 9 then reset the verbosity level to verboselevel */ int ccp4VerbosityLevel(int level) { /* The default level is 1 */ static int verbositylevel=1; if (level > -1 && level < 10) verbositylevel = level; return verbositylevel; } /*------------------------------------------------------------------*/ /* Callback functionality */ /* ccp4Callback Set or invoke a user-defined callback function. Internal function: applications should use the API functions ccp4SetCallback and ccp4InvokeCallback */ int ccp4Callback(CCP4INTFUNCPTR mycallback, char *mode, int ierr, const char *message) { static CCP4INTFUNCPTR callback=ccp4NullCallback; if (strncmp(mode,"set",3) == 0) { /* Set callback Store the pointer to the callback function */ callback=mycallback; return 1; } else if (strncmp(mode,"invoke",3) == 0) { /* Invoke callback Execute the callback function */ return callback(ierr,message); } /* Unrecognised mode */ return 0; } /* ccp4SetCallback Store a pointer to a user-defined callback function of the form "int func(int, char *)" This is a wrapper to ccp4Callback in "set" mode. */ int ccp4SetCallback(CCP4INTFUNCPTR mycallback) { return ccp4Callback(mycallback,"set",-1,"No message"); } /* ccp4InvokeCallback Execute the user-defined callback function (previously set up using ccp4SetCallback) with the supplied arguments. This is a wrapper to ccp4Callback in "invoke" mode. */ int ccp4InvokeCallback(int ierr, const char *message) { return ccp4Callback(ccp4NullCallback,"invoke",ierr,message); } /* Default null callback function Internal function: this is the default callback function used by ccp4Callback if no user-defined function has been specified. */ int ccp4NullCallback(int level, const char *message) { /* This is the default callback function which takes no action */ return 1; } /*------------------------------------------------------------------*/ /* check existence of licence agreement */ int ccp4_licence_exists(const char *name) { int sue=1,lpath; char *filepath=NULL,*filename=NULL,tmp_string[20]; strtoupper(tmp_string,name); if (strmatch(tmp_string,"CCP4")) { filepath = (char *) getenv("CCP4"); if (filepath) { lpath = strlen(filepath); filename = (char *) ccp4_utils_malloc(sizeof(char)*(lpath+12)); strcpy(filename,filepath); strcpy(filename+lpath,"/.agree2ccp4"); if (ccpexists(filename)) sue = 0; /* Make sure that we clean up */ if (filename) free(filename); } if (sue == 1) { filepath = (char *) getenv("HOME"); if (filepath) { lpath = strlen(filepath); filename = (char *) ccp4_utils_malloc(sizeof(char)*(lpath+12)); strcpy(filename,filepath); strcpy(filename+lpath,"/.agree2ccp4"); if (ccpexists(filename)) sue = 0; /* Make sure that we clean up */ if (filename) free(filename); } } if (sue == 1) { ccperror(1,"Cannot find required license agreements!"); return 0; } } return 1; } /* html_log_output and summary_output currently only used by ccperror to tidy up Fortran program output. Defaults are 0 for C programs. */ int html_log_output(int ihtml_in) { static int ihtml=0; if (ihtml_in >= 0) ihtml = ihtml_in; return ihtml; } int summary_output(int isumm_in) { static int isumm=0; if (isumm_in >= 0) isumm = isumm_in; return isumm; } libccp4-8.0.0/ccp4/ccp4_program.h0000644000000000000000000001306314242731033014551 0ustar 00000000000000/* ccp4_program.h: Headers to utilies to set and fetch program information. Copyright (C) 2001 CCLRC, Peter Briggs This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file ccp4_program.h * Utilies to set and fetch program information. * Peter Briggs CCP4 May 2001 */ /*------------------------------------------------------------------*/ /* Macro definitions */ /*------------------------------------------------------------------*/ #ifndef __CCP4Program__ #define __CCP4Program__ /* rcsidhp[] = "$Id$" */ #ifdef __cplusplus namespace CCP4 { extern "C" { #endif #define CCP4_VERSION_NO "8.0" #define CCP4_PATCH_LEVEL "8.0.0" /* Maximum lengths of strings holding program names and versions */ #define MAXLEN_PROGNAME 80 #define MAXLEN_PROGVERSION 80 #define MAXLEN_RCSDATE 80 /*------------------------------------------------------------------*/ /* Type Definitions */ /*------------------------------------------------------------------*/ /* Define a type which is a pointer to a function taking an integer and a pointer to character, and returning an integer */ typedef int (*CCP4INTFUNCPTR)(int, const char *); /*------------------------------------------------------------------*/ /* Function Prototypes */ /*------------------------------------------------------------------*/ /** Register or query program version. * @param progvers Program version string, or NULL to query existing value. * @return Program version string. */ char *ccp4_prog_vers(const char *progvers); /** Query ccp4 version. * @return CCP4 version string. */ char *ccp4_vers_no(void); /** Set or return program name. * @param progname Program name, or NULL to query existing value. * @return Program name */ char *ccp4ProgramName(const char *progname); /** Print program info for -i option. */ void ccp4_prog_info(void); /** Set or return program RCS date * @param rcs_string Date string, or NULL to query existing value. * @return Date string */ char *ccp4RCSDate(const char *rcs_string); /** Set or print program time information * @param init */ void ccp4ProgramTime(int init); /** Set or return the reference verbosity level * Always return the verbosity level - if verboselevel is * between 0 and 9 then reset the verbosity level to * verboselevel * @param level Verbosity level, or -1 to query existing value. * @return Verbosity level */ int ccp4VerbosityLevel(int level); /** Set or invoke a user-defined callback function * The callback must be of the form "function(const int, const char *)" * This is essentially an internal function which operates in one of two * modes - in "set" mode the named function is stored and the remaining * arguments are discarded; in "invoke" mode the stored function is * executed with the supplied values (the supplied name is discarded). * @param mycallback Callback function (discarded in "invoke" mode) * @param mode Either "set" or "invoke" * @param ierr An error level equivalent to that used in ccperror * @param message A message string equivalent to that used in ccperror * @return Result of the executed function (invoke mode) */ int ccp4Callback(CCP4INTFUNCPTR mycallback, char *mode, int ierr, const char *message); /** Set a user-defined callback function * This is a wrapper to ccp4Callback - it stores a user-defined * callback function which must be of the form * "function(const int, const char *)" * @param mycallback Callback function * @return 1 (if the function is stored), 0 (if it is not) */ int ccp4SetCallback(CCP4INTFUNCPTR mycallback); /** Invoke the user-defined callback function * This is a wrapper to ccp4Callback - it executes the user-defined * callback function previously stored. * @param ierr An error level equivalent to that used in ccperror * @param message A message string equivalent to that used in ccperror * @return Result of the executed function */ int ccp4InvokeCallback(int ierr, const char *message); /** A dummy callback function used by default in ccp4CallOnExit * Internal function. This function does nothing. * @param level Severity level supplied from ccperror * @param message Message text supplied from ccperror * @return Always returns 1 */ int ccp4NullCallback(int level, const char *message); /** Check existence of licence agreement * @param name Name of licence, e.g. "CCP4". * @return 1 for licence exists, else 0. */ int ccp4_licence_exists(const char *name); /** Register or query html output level. * @param ihtml_in 0 = turn off html output, 1 = turn on html output, -1 = query existing value * @return 0 = no html output, 1 = html output */ int html_log_output(int ihtml_in); /** Register or query summary output level. * @param isumm_in 0 = turn off summary output, 1 = turn on summary output, -1 = query existing value * @return 0 = no summary output, 1 = summary output */ int summary_output(int isumm_in); #ifdef __cplusplus } } #endif #endif /* __CCP4Program__ */ libccp4-8.0.0/ccp4/ccp4_spg.h0000644000000000000000000000622614242731033013676 0ustar 00000000000000/* ccp4_spg.h: Data structure for symmetry information Copyright (C) 2001 CCLRC, Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file ccp4_spg.h * * @brief Data structure for symmetry information. * * A data structure for spacegroup information and related * quantities. Some items are loaded from syminfo.lib while * others are calculated on the fly. * * There is also a struct for symop rotation matrices and translation * vectors. This can be converted to other representations using * functions in ccp4_parser. * * @author Martyn Winn */ #ifndef __CCP4_SPG__ #define __CCP4_SPG__ /* rcsidhsp[] = "$Id$" */ #ifdef __cplusplus namespace CSym { extern "C" { #endif /* Kevin's symmetry operator */ typedef struct ccp4_symop_ { float rot[3][3]; float trn[3]; } ccp4_symop; typedef struct ccp4_spacegroup_ { int spg_num; /* true spacegroup number */ int spg_ccp4_num; /* CCP4 spacegroup number */ char symbol_Hall[40]; /* Hall symbol */ char symbol_xHM[20]; /* Extended Hermann Mauguin symbol */ char symbol_old[20]; /* old spacegroup name */ char point_group[20]; /* point group name */ char crystal[20]; /* crystal system e.g. MONOCLINIC */ int nlaue; /* CCP4 Laue class number, inferred from asu_descr */ char laue_name[20]; /* Laue class name */ int laue_sampling[3]; /* sampling factors for FFT */ int npatt; /* Patterson spacegroup number, inferred from asu_descr */ char patt_name[40]; /* Patterson spacegroup name */ int nsymop; /* total number of symmetry operations */ int nsymop_prim; /* number of primitive symmetry operations */ ccp4_symop *symop; /* symmetry matrices */ ccp4_symop *invsymop; /* inverse symmetry matrices */ float chb[3][3]; /* change of basis matrix from file */ char asu_descr[80]; /* asu description from file */ int (*asufn)(const int, const int, const int); /* pointer to ASU function */ int centrics[12]; /* symop which generates centric zone, 0 if none */ int epsilon[13]; /* flag which epsilon zones are applicable */ char mapasu_zero_descr[80]; /* origin-based map asu: description from file */ float mapasu_zero[3]; /* origin-based map asu: upper limits */ char mapasu_ccp4_descr[80]; /* CCP4 map asu: defaults to mapasu_zero */ float mapasu_ccp4[3]; /* CCP4 map asu: upper limits */ } CCP4SPG; #ifdef __cplusplus } } #endif #endif /*!__CCP4_SPG__ */ libccp4-8.0.0/ccp4/ccp4_sysdep.h0000644000000000000000000001726614242731033014422 0ustar 00000000000000/* ccp4_sysdep.h: System-dependent definitions Copyright (C) 2001 CCLRC This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file ccp4_sysdep.h * * @brief System-dependent definitions. * * @author Charles Ballard, based in part on earlier versions */ #ifndef __CCP4_BITS #define __CCP4_BITS #ifdef __sgi /* in ANSI mode */ # ifndef sgi # define sgi # endif #endif #ifndef VMS # if defined (vms) || defined (__vms) || defined (__VMS) # define VMS # endif #endif #if defined (sun) || defined (__sun) # if !defined(__STDC__) || defined(__GNUC__) # if !defined(G77) extern char *sys_errlist []; # define strerror(i) sys_errlist[i] /* k&r compiler doesn't have it */ # endif # endif #endif #if defined (_AIX) || defined(___AIX) || defined (__hpux) # define CALL_LIKE_HPUX 1 #elif defined (VMS) # define CALL_LIKE_VMS 1 #elif defined (_MSC_VER) && (_MSC_VER >= 800) # define CALL_LIKE_MVS 2 #elif defined (_MSC_VER) || (defined (_WIN32) && !defined(__MINGW32__)) # define CALL_LIKE_MVS 1 #else # define CALL_LIKE_SUN 1 #endif #ifndef _POSIX_SOURCE #define _POSIX_SOURCE #endif #include #if defined (VMS) # include /* non-POSIX */ # define NOUNISTD #else # include # include # if !defined (_WIN32) && !defined (_MSC_VER) # include # endif # ifdef _MSC_VER # define NOUNISTD # endif #endif #include #include #ifndef NOUNISTD # include #else # ifndef VMS # ifndef _MSC_VER # include /* ESV, old Concentrix */ /* non-POSIX */ # endif # endif #endif #ifndef NOSTDLIB /* for TitanOS 4.2, at least? */ # include #endif #include #include #if defined(_AIX) || defined (__hpux) || defined(F2C) ||\ defined(G77) || defined(_WIN32) || defined (sun) /* would do no harm on others, though */ # include #endif #include #include #if defined (F2C) # define Skip_f2c_Undefs # include "f2c.h" #endif #if defined (G77) # define Skip_f2c_Undefs /* g2c.h infelicity... */ # if defined (HAVE_G2C_H) # include "g2c.h" # endif #endif /* Using MSVC need __declspec */ #if defined(__WIN32__) || defined(_WIN32) # if defined(_MSC_VER) && defined(DLL_EXPORT) # define CCP4_DL_IMPORT(type) __declspec(dllexport) type # define CCP4_DL_EXPORT __declspec(dllexport) # elif defined(_MSC_VER) # define CCP4_DL_IMPORT(type) __declspec(dllimport) type # define CCP4_DL_EXPORT # else # define CCP4_DL_IMPORT(type) type # define CCP4_DL_EXPORT # endif #else # define CCP4_DL_IMPORT(type) type # define CCP4_DL_EXPORT #endif /* defined in library_utils.c */ #if defined (_MSC_VER) && _MSC_VER < 1800 double rint(double x); #endif #ifdef _MSC_VER #define M_PI 3.14159265358979323846 #endif #ifdef _WIN32 # define PATH_SEPARATOR '\\' # define EXT_SEPARATOR '.' #else # define PATH_SEPARATOR '/' # define EXT_SEPARATOR '.' #endif #define MAXFLEN 512 /**< the maximum length of a filename in CCP4 */ #define MAXFILES 16 /**< maximum number of files open symultaneously */ #define DEFMODE 2 /**< default mode access for random access files */ #define IRRELEVANT_OP 0 #define READ_OP 1 #define WRITE_OP 2 #include #ifndef SEEK_SET # define SEEK_SET 0 # define SEEK_CUR 1 # define SEEK_END 2 #endif /* ! SEEK_SET */ #ifndef O_WRONLY #define O_RDONLY 0x0000 /**< i/o mode: read-only */ #define O_WRONLY 0x0001 /**< i/o mode: write-only */ #define O_RDWR 0x0002 /**< i/o mode: read and write */ #define O_APPEND 0x0008 /**< i/o mode: append to existing file */ #define O_CREAT 0x0200 /**< i/o mode: create file */ #define O_TRUNC 0x0400 /**< i/o mode: truncate existing file */ #endif #define O_TMP 0x0010 /**< i/o mode: scratch file */ /* Before version 6.3 we defined BYTE, INT16 and INT32 (without the CCP4_ * prefix). The prefix has been added to avoid name conflicts. */ #define CCP4_BYTE 0 #define CCP4_INT16 1 #define CCP4_INT32 6 #define CCP4_INT64 5 #define FLOAT32 2 #define COMP32 3 #define COMP64 4 #define DFNTI_MBO 1 /**< Motorola byte order 2's compl */ #define DFNTI_IBO 4 /**< Intel byte order 2's compl */ #define DFNTF_BEIEEE 1 /**< big endian IEEE (canonical) */ #define DFNTF_VAX 2 /**< Vax format */ #define DFNTF_CONVEXNATIVE 5 /**< Convex native floats */ #define DFNTF_LEIEEE 4 /**< little-endian IEEE format */ #if defined (VAX) || defined (vax) /* gcc seems to use vax */ # define NATIVEFT DFNTF_VAX # define NATIVEIT DFNTI_IBO #endif #if defined(MIPSEL) || defined(i386) || defined(i860) || defined(__ia64__) || defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64) # define NATIVEIT DFNTI_IBO # define NATIVEFT DFNTF_LEIEEE #endif #if defined (powerpc) || defined (__powerpc__) || defined (__ppc__) || \ defined __PPC || defined (__s390__) || defined (__s390x__) || \ defined (__hppa__) # define NATIVEIT DFNTI_MBO # define NATIVEFT DFNTF_BEIEEE #endif #ifdef __alpha # ifdef VMS # if __IEEE_FLOAT == 1 # define NATIVEFT DFNTF_LEIEEE # else # define NATIVEFT DFNTF_VAX # endif # else /* assume OSF/1 */ # define NATIVEFT DFNTF_LEIEEE # endif # define NATIVEIT DFNTI_IBO #endif #if defined(MIPSEB) || defined(__hpux) || defined(_AIX) || defined(m68k) || defined(mc68000) || defined(sparc) || defined (__sparc__) # define NATIVEIT DFNTI_MBO # define NATIVEFT DFNTF_BEIEEE #endif #if defined(__ARM__) || defined(__arm__) || defined(__aarch64__) # if defined(__ARMEB__) || defined (__AARCH64EB__) # define NATIVEIT DFNTI_MBO # define NATIVEFT DFNTF_BEIEEE # elif defined(__ARMEL__) || defined (__AARCH64EL__) # define NATIVEIT DFNTI_IBO # define NATIVEFT DFNTF_LEIEEE # endif #endif /* From time to time new architectures are added here, often because Linux * packagers want to build it on all platforms supported by their distro. * Here we try to catch machines not listed explicitely above, under * assumption that endianness is the same for floating point numbers * as for integers. Which is safe assumption on modern standard computers * (not embedded systems), according to * http://en.wikipedia.org/wiki/Endianness#Floating-point_and_endianness */ #if !defined(NATIVEIT) && !defined(NATIVEFT) && defined(__BYTE_ORDER) # if __BYTE_ORDER == __LITTLE_ENDIAN # define NATIVEIT DFNTI_IBO # define NATIVEFT DFNTF_LEIEEE # elif __BYTE_ORDER == __BIG_ENDIAN # define NATIVEIT DFNTI_MBO # define NATIVEFT DFNTF_BEIEEE # endif #endif #ifndef NATIVEFT # error "Can't determine machine number format" #endif #define DFNT_UINT 0 /**< unsigned int */ #define DFNT_SINT 1 /**< short int */ #define DFNT_INT 2 /**< int */ #define DFNT_UCHAR 3 /**< unsigned char */ #define DFNT_CHAR 4 /**< char */ #define DFNT_FLOAT 5 /**< float */ #define DFNT_DOUBLE 6 /**< double */ #endif /* __CCP4_BITS */ libccp4-8.0.0/ccp4/ccp4_types.h0000644000000000000000000000363214242731033014247 0ustar 00000000000000/* ccp4_types.h: CCP4 library.c macro definitions etc Copyright (C) 2001 CCLRC This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #ifndef __CCP4_TYPES #define __CCP4_TYPES #include "ccp4_sysdep.h" typedef unsigned short uint16; #ifdef SIXTEENBIT typedef unsigned long uint32; #else typedef unsigned int uint32; #endif typedef float float32; typedef unsigned char uint8; union float_uint_uchar { float32 f; uint32 i; uint8 c[4]; }; typedef char * pstr; /* CCP4 library.c macro definitions */ #ifndef FALSE #define FALSE 0 #define TRUE 1 #endif typedef struct { double r; /* radial and */ double phi; /* angular component of */ } POLAR; /* a complex number */ /* some simple macros, which may exist anyway */ #ifndef SQR #define SQR(x) ((x)*(x)) #endif #ifndef DEGREE #define DEGREE(x) ((((x < 0)?(x)+2*M_PI:(x))*360)/(2*M_PI)) #endif #ifndef RADIAN #define RADIAN(x) ((((x<0)?(x)+360:(x))*2*M_PI)/360) #endif #ifndef MAX #define MAX(x, y) (((x)>(y))?(x):(y)) #endif #ifndef MIN #define MIN(x, y) (((x)<(y))?(x):(y)) #endif #ifndef ABS #define ABS(x) (((x)<0)?-(x):(x)) #endif #ifndef SIGN #define SIGN(x) (((x)<0)?-1:1) #endif #endif /* __CCP4_TYPES */ libccp4-8.0.0/ccp4/ccp4_unitcell.c0000644000000000000000000002202114242731033014706 0ustar 00000000000000/* ccp4_unitcell.c: C library for manipulations based on cell parameters. Copyright (C) 2001 CCLRC, Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file ccp4_unitcell.c * C library for manipulations based on cell parameters. * Martyn Winn */ #include #include "ccp4_unitcell.h" #include "cvecmat.h" #include "ccp4_errno.h" /* rcsid[] = "$Id$" */ /* from input cell and orthogonalisation code, find orthogonalisation and fractionalisation matrices. Returns cell volume. */ double ccp4uc_frac_orth_mat(const double cell[6], const int ncode, double ro[3][3], double rf[3][3]) { int i,j; double conv,alph,bet,gamm,sina,cosa,sinb,cosb,sing,cosg, sinas,cosas,sinbs,cosbs,sings,cosgs,a,b,c; conv = atan(1.0)*4.0/180.0; alph = cell[3]*conv; bet = cell[4]*conv; gamm = cell[5]*conv; sina = sin(alph); cosa = cos(alph); sinb = sin(bet); cosb = cos(bet); sing = sin(gamm); cosg = cos(gamm); cosas = (cosg*cosb-cosa)/ (sinb*sing); sinas = sqrt(1.0-cosas*cosas); cosbs = (cosa*cosg-cosb)/ (sina*sing); sinbs = sqrt(1.0-cosbs*cosbs); cosgs = (cosa*cosb-cosg)/ (sina*sinb); sings = sqrt(1.0-cosgs*cosgs); a = cell[0]; b = cell[1]; c = cell[2]; /* calculate ro */ for ( i = 0; i < 3; i++ ) for ( j = 0; j < 3; j++ ) ro[i][j] = 0.0; /* ncode 1 - xo along a zo along c* */ switch (ncode) { case 1: ro[0][0] = a; ro[0][1] = b*cosg; ro[0][2] = c*cosb; ro[1][1] = b*sing; ro[1][2] = -c*sinb*cosas; ro[2][2] = c*sinb*sinas; break; /* ncode 2 - xo along b zo along a* */ case 2: ro[0][0] = a*cosg; ro[0][1] = b; ro[0][2] = c*cosa; ro[1][0] = -a*sing*cosbs; ro[1][2] = c*sina; ro[2][0] = a*sing*sinbs; break; /* ncode 3 - xo along c zo along b* */ case 3: ro[0][0] = a*cosb; ro[0][1] = b*cosa; ro[0][2] = c; ro[1][0] = a*sinb; ro[1][1] = -b*sina*cosgs; ro[2][1] = b*sina*sings; break; /* ncode 4 - trigonal only - xo along a+b yo alon a-b zo along c* */ case 4: ro[0][0] = a/2.0; ro[0][1] = a/2.0; ro[1][0] = -a*sing; ro[1][1] = a*sing; ro[2][2] = c; break; /* ncode 5 - xo along a* zo along c */ case 5: ro[0][0] = a*sinb*sings; ro[1][0] = -a*sinb*cosgs; ro[1][1] = b*sina; ro[2][0] = a*cosb; ro[2][1] = b*cosa; ro[2][2] = c; break; /* ncode 6 - grr*! to gerard bricogne - his setting for p1 in skew. xo along a yo along b* */ case 6: ro[0][0] = a; ro[0][1] = b*cosg; ro[0][2] = c*cosb; ro[1][1] = b*sing*sinas; ro[2][1] = -b*sing*cosas; ro[2][2] = c*sinb; break; } /* now calculate rf from ro, determinant gives cell volume */ return invert3matrix((const double (*)[3]) ro, rf); } /* from input cell, find dimensions of reciprocal cell. Returns reciprocal cell volume. */ double ccp4uc_calc_rcell(const double cell[6], double rcell[6]) { double conv,alph,bet,gamm,vol,sina,cosa,sinb,cosb,sing,cosg, sinas,cosas,sinbs,cosbs,sings,cosgs,a,b,c; conv = 3.14159/180.0; alph = cell[3]*conv; bet = cell[4]*conv; gamm = cell[5]*conv; vol = ccp4uc_calc_cell_volume(cell); sina = sin(alph); cosa = cos(alph); sinb = sin(bet); cosb = cos(bet); sing = sin(gamm); cosg = cos(gamm); cosas = (cosg*cosb-cosa)/ (sinb*sing); sinas = sqrt(1.0-cosas*cosas); cosbs = (cosa*cosg-cosb)/ (sina*sing); sinbs = sqrt(1.0-cosbs*cosbs); cosgs = (cosa*cosb-cosg)/ (sina*sinb); sings = sqrt(1.0-cosgs*cosgs); a = cell[0]; b = cell[1]; c = cell[2]; rcell[0] = b*c*sina/vol; rcell[1] = c*a*sinb/vol; rcell[2] = a*b*sing/vol; rcell[3] = atan2(sinas,cosas)/conv; rcell[4] = atan2(sinbs,cosbs)/conv; rcell[5] = atan2(sings,cosgs)/conv; return (1.0 / vol); } /* Convert orthogonal to fractional coordinates. Translation only if deliberate origin shift - does this ever happen? Leave it to the application. */ void ccp4uc_orth_to_frac(const double rf[3][3], const double xo[3], double xf[3]) { xf[0] = rf[0][0]*xo[0] + rf[0][1]*xo[1] + rf[0][2]*xo[2]; xf[1] = rf[1][0]*xo[0] + rf[1][1]*xo[1] + rf[1][2]*xo[2]; xf[2] = rf[2][0]*xo[0] + rf[2][1]*xo[1] + rf[2][2]*xo[2]; } /* Convert fractional to orthogonal coordinates. */ void ccp4uc_frac_to_orth(const double ro[3][3], const double xf[3], double xo[3]) { xo[0] = ro[0][0]*xf[0] + ro[0][1]*xf[1] + ro[0][2]*xf[2]; xo[1] = ro[1][0]*xf[0] + ro[1][1]*xf[1] + ro[1][2]*xf[2]; xo[2] = ro[2][0]*xf[0] + ro[2][1]*xf[1] + ro[2][2]*xf[2]; } /* Convert orthogonal to fractional u matrix. */ void ccp4uc_orthu_to_fracu(const double rf[3][3], const double uo[6], double uf[6]) { int i,j; double uomat[3][3], ufmat[3][3], rft[3][3], temp[3][3]; uomat[0][0] = uo[0]; uomat[0][1] = uo[3]; uomat[0][2] = uo[4]; uomat[1][0] = uo[3]; uomat[1][1] = uo[1]; uomat[1][2] = uo[5]; uomat[2][0] = uo[4]; uomat[2][1] = uo[5]; uomat[2][2] = uo[2]; for ( i = 0; i < 3; i++ ) for ( j = 0; j < 3; j++ ) rft[i][j] = rf[j][i]; ccp4_3matmul(temp,(const double (*)[3]) uomat,(const double (*)[3]) rft); ccp4_3matmul(ufmat,rf,(const double (*)[3]) temp); uf[0] = ufmat[0][0]; uf[1] = ufmat[1][1]; uf[2] = ufmat[2][2]; uf[3] = ufmat[0][1]; uf[4] = ufmat[0][2]; uf[5] = ufmat[1][2]; } /* Convert fractional to orthogonal u matrix. */ void ccp4uc_fracu_to_orthu(const double ro[3][3], const double uf[6], double uo[6]) { int i,j; double uomat[3][3], ufmat[3][3], rot[3][3], temp[3][3]; ufmat[0][0] = uf[0]; ufmat[0][1] = uf[3]; ufmat[0][2] = uf[4]; ufmat[1][0] = uf[3]; ufmat[1][1] = uf[1]; ufmat[1][2] = uf[5]; ufmat[2][0] = uf[4]; ufmat[2][1] = uf[5]; ufmat[2][2] = uf[2]; for ( i = 0; i < 3; i++ ) for ( j = 0; j < 3; j++ ) rot[i][j] = ro[j][i]; ccp4_3matmul(temp,(const double (*)[3]) ufmat,(const double (*)[3]) rot); ccp4_3matmul(uomat,ro,(const double (*)[3]) temp); uo[0] = uomat[0][0]; uo[1] = uomat[1][1]; uo[2] = uomat[2][2]; uo[3] = uomat[0][1]; uo[4] = uomat[0][2]; uo[5] = uomat[1][2]; } /* Calculate cell volume from cell parameters */ double ccp4uc_calc_cell_volume(const double cell[6]) { double conv,alph,bet,gamm,sum,v; conv = 3.14159/180.0; alph = cell[3]*conv; bet = cell[4]*conv; gamm = cell[5]*conv; sum = (alph+bet+gamm)*0.5; v = sqrt(sin(sum-alph)*sin(sum-bet)*sin(sum-gamm)*sin(sum)); return (2.0*cell[0]*cell[1]*cell[2]*v); } /* Check cells agree within tolerance */ int ccp4uc_cells_differ(const double cell1[6], const double cell2[6], const double tolerance) { int i; double vol1, vol2, acheck; vol1 = ccp4uc_calc_cell_volume(cell1); vol2 = ccp4uc_calc_cell_volume(cell2); /* check cell volumes */ acheck = fabs(0.5*(vol1 - vol2))/(vol1 + vol2); if (acheck > tolerance) { if (ccp4_liberr_verbosity(-1)) { printf("Difference in cell volumes detected.\n"); printf(" vol1 = %lf vol2 = %lf \n",vol1,vol2); } return 1; } /* check cell parameters */ acheck = 0.0; for ( i = 0; i < 6; i++ ) acheck += fabs(0.5*(cell2[i]-cell1[i]))/(cell2[i]+cell1[i]); if (acheck > 3.0*tolerance) { if (ccp4_liberr_verbosity(-1)) { printf("Large difference in cell parameters detected.\n"); printf(" cell1 = %lf %lf %lf %lf %lf %lf \n", cell1[0],cell1[1],cell1[2],cell1[3],cell1[4],cell1[5]); printf(" cell2 = %lf %lf %lf %lf %lf %lf \n", cell2[0],cell2[1],cell2[2],cell2[3],cell2[4],cell2[5]); } return 1; } else if (acheck > tolerance) { if (ccp4_liberr_verbosity(-1)) { printf("Small difference in cell parameters detected.\n"); printf(" cell1 = %lf %lf %lf %lf %lf %lf \n", cell1[0],cell1[1],cell1[2],cell1[3],cell1[4],cell1[5]); printf(" cell2 = %lf %lf %lf %lf %lf %lf \n", cell2[0],cell2[1],cell2[2],cell2[3],cell2[4],cell2[5]); } return 1; } return 0; } int ccp4uc_is_rhombohedral(const float cell[6], const float tolerance) { double acheck; acheck = fabs(cell[0]-cell[1]); acheck += fabs(cell[1]-cell[2]); acheck += fabs(cell[0]-cell[2]); acheck += fabs(cell[3]-cell[4]); acheck += fabs(cell[3]-cell[5]); acheck += fabs(cell[4]-cell[5]); if (acheck > (double) tolerance) return 0; return 1; } int ccp4uc_is_hexagonal(const float cell[6], const float tolerance) { double acheck; acheck = fabs(cell[0]-cell[1]); acheck += fabs(cell[3]-90.0); acheck += fabs(cell[4]-90.0); acheck += fabs(cell[5]-120.0); if (acheck > (double) tolerance) return 0; return 1; } libccp4-8.0.0/ccp4/ccp4_unitcell.h0000644000000000000000000000676614242731033014735 0ustar 00000000000000/* ccp4_unitcell.h: headers for C library for ccp4_unitcell.c Copyright (C) 2001 CCLRC, Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file ccp4_unitcell.h * C library for manipulations based on cell parameters. * Martyn Winn */ #ifndef __CCP4_UNITCELL #define __CCP4_UNITCELL #ifdef __cplusplus namespace CCP4uc { extern "C" { #endif #include /** From input cell and orthogonalisation code, find orthogonalisation and fractionalisation matrices. * @param cell * @param ncode * @param ro * @param rf * @return Cell volume */ double ccp4uc_frac_orth_mat(const double cell[6], const int ncode, double ro[3][3], double rf[3][3]); /** From input cell, find dimensions of reciprocal cell. * @param cell * @param rcell * @return Reciprocal cell volume */ double ccp4uc_calc_rcell(const double cell[6], double rcell[6]); /** Convert orthogonal to fractional coordinates. Translation only if deliberate origin shift - does this ever happen? Leave it to the application. * @param rf * @param xo * @param xf * @return void */ void ccp4uc_orth_to_frac(const double rf[3][3], const double xo[3], double xf[3]); /** Convert fractional to orthogonal coordinates. * @param ro * @param xf * @param xo * @return void */ void ccp4uc_frac_to_orth(const double ro[3][3], const double xf[3], double xo[3]); /** Convert orthogonal to fractional u matrix. * @param rf * @param uo * @param uf * @return void */ void ccp4uc_orthu_to_fracu(const double rf[3][3], const double uo[6], double uf[6]); /** Convert fractional to orthogonal u matrix. * @param ro * @param uf * @param uo * @return void */ void ccp4uc_fracu_to_orthu(const double ro[3][3], const double uf[6], double uo[6]); /** Calculate cell volume from cell parameters. * @param cell * @return Cell volume. */ double ccp4uc_calc_cell_volume(const double cell[6]); /** Check cells agree within tolerance. * @param cell1 First cell. * @param cell2 Second cell. * @param tolerance A tolerance for agreement. * @return 1 if cells differ by more than tolerance, 0 otherwise. */ int ccp4uc_cells_differ(const double cell1[6], const double cell2[6], const double tolerance); /** Check if cell parameters conform to a rhombohedral setting. * @param cell Cell parameters. Angles are assumed to be in degrees. * @param tolerance A tolerance for agreement. * @return 1 if cell parameters conform, 0 otherwise. */ int ccp4uc_is_rhombohedral(const float cell[6], const float tolerance); /** Check if cell parameters conform to a hexagonal setting. * @param cell Cell parameters. Angles are assumed to be in degrees. * @param tolerance A tolerance for agreement. * @return 1 if cell parameters conform, 0 otherwise. */ int ccp4uc_is_hexagonal(const float cell[6], const float tolerance); #ifdef __cplusplus } } #endif #endif /*!CCP4_UNITCELL */ libccp4-8.0.0/ccp4/ccp4_utils.h0000644000000000000000000000567714242731033014256 0ustar 00000000000000/* ccp4_utils.h: headers for utility functions. Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file ccp4_utils.h * @brief Utility functions. * @author Charles Ballard */ #ifndef __CCP4_UTILS #define __CCP4_UTILS #include #include "ccp4_types.h" #include "library_file.h" /* rcsidh[] = "$Id$" */ #ifdef __cplusplus namespace CCP4 { extern "C" { #endif /**************************************************************************** * Function prototypes * ****************************************************************************/ size_t ccp4_utils_flength (char *, int); int ccp4_utils_translate_mode_float(float *, const void *, int, int); void ccp4_utils_fatal (const char *); void ccp4_utils_print (const char *message); int ccp4_utils_setenv (char *); /* turn on line buffering for stdout */ int ccp4_utils_outbuf (void); /* turn off any buffering on stdin */ int ccp4_utils_noinpbuf (void); union float_uint_uchar ccp4_nan (); int ccp4_utils_isnan (const union float_uint_uchar *); void ccp4_utils_bml (int, union float_uint_uchar *); void ccp4_utils_wrg (int, union float_uint_uchar *, float *); void ccp4_utils_hgetlimits (int *, float *); int ccp4_utils_mkdir (const char *, const char *); int ccp4_utils_chmod (const char *, const char *); void *ccp4_utils_malloc(size_t); void *ccp4_utils_realloc(void *, size_t); void *ccp4_utils_calloc(size_t, size_t); int ccp4_file_size(const char *); char *ccp4_utils_username(void); char *ccp4_utils_basename(const char *filename); char *ccp4_utils_pathname(const char *filename); char *ccp4_utils_extension(const char *filename); char *ccp4_utils_joinfilenames(const char *dir, const char *file); void ccp4_utils_idate (int *); char *ccp4_utils_date(char *); void ccp4_utils_itime (int *); char *ccp4_utils_time(char *); float ccp4_utils_etime (float *); #if defined (_MSC_VER) double ccp4_erfc( double x ); #endif /**************************************************************************** * End of prototypes * *****************************************************************************/ #ifdef __cplusplus } } #endif #endif /* __CCP4_UTILS */ libccp4-8.0.0/ccp4/ccp4_vars.h0000644000000000000000000000326614242731033014061 0ustar 00000000000000/* ccp4_vars.h: Standard strings for certain quantites Copyright (C) 2002 CCLRC, Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /* */ /* Author: Martyn Winn */ /* Standard strings for certain quantites - for future use */ #ifndef __CCP4_VARS__ #define __CCP4_VARS__ #define MTZFILENAME "data::mtzfile::filename" #define MTZTITLE "data::mtzfile::title" #define MTZSPACEGROUP "data::mtzfile::spacegroup_num" #define MTZNUMREFLS "data::mtzfile::num_reflections" #define MTZMNF "data::mtzfile::missing_number_flag" #define MTZSORTORDER "data::mtzfile::sort_order" #define CRYSTALXTALNAME "data::crystal::crystal_name" #define CRYSTALPNAME "data::crystal::project_name" #define CRYSTALCELL "data::crystal::cell" #define DATASETDNAME "data::crystal::dataset::dataset_name" #define DATASETWAVELENGTH "data::crystal::dataset::wavelength" #define COLUMNLABEL "data::crystal_i::dataset_i::column_i::label" #define COLUMNTYPE "data::crystal_i::dataset_i::column_i::type" #endif /*!__CCP4_VARS__ */ libccp4-8.0.0/ccp4/cmap_accessor.c0000644000000000000000000002045114242731033014765 0ustar 00000000000000/* cmap_accessor.c: get and set map header information Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #include #include "cmaplib.h" #include "cmap_errno.h" /* accessors */ /*! Get the cell parameters \param mfile (const CMMFile *) \param cell (float *) contains the cell parameter on exit (dim 6) */ void ccp4_cmap_get_cell(const CMMFile *mfile, float *cell) { cell[0] = mfile->cell[0]; cell[1] = mfile->cell[1]; cell[2] = mfile->cell[2]; cell[3] = mfile->cell[3]; cell[4] = mfile->cell[4]; cell[5] = mfile->cell[5]; } /*! Set the cell parameters. Only allowed when file is opened in write mode. \param mfile (CMMFile *) \param cell (const float *) the cell parameters */ void ccp4_cmap_set_cell(CMMFile *mfile, const float *cell) { if (ccp4_file_is_write(mfile->stream)) { mfile->cell[0] = cell[0]; mfile->cell[1] = cell[1]; mfile->cell[2] = cell[2]; mfile->cell[3] = cell[3]; mfile->cell[4] = cell[4]; mfile->cell[5] = cell[5]; } } /*! Get the grid for the complete cell (X,Y,Z) ordering \param mfile (const CMMFile *) \param grid (int *) contains the grid dimension on exit (dim 3) */ void ccp4_cmap_get_grid(const CMMFile *mfile, int *grid) { grid[0] = mfile->cell_grid[0]; grid[1] = mfile->cell_grid[1]; grid[2] = mfile->cell_grid[2]; } /*! Set the cell grid dimension. Only allowed when file is opened in write mode. \param mfile (CMMFile *) \param grid (const int *) the cell grid dimension (X,Y,Z) */ void ccp4_cmap_set_grid(CMMFile *mfile, const int *grid) { if (ccp4_file_is_write(mfile->stream)) { mfile->cell_grid[0] = grid[0]; mfile->cell_grid[1] = grid[1]; mfile->cell_grid[2] = grid[2]; } } /*! Get the stored map origin (rows,sections,columns) \param mfile (const CMMFile *) \param origin (int *) contains the origin on exit (dim 3) */ void ccp4_cmap_get_origin(const CMMFile *mfile, int *origin) { origin[0] = mfile->origin[0]; origin[1] = mfile->origin[1]; origin[2] = mfile->origin[2]; } /*! Set the stored map origin (rows,sections,columns) Only allowed when file is opened in write mode. \param mfile (CMMFile *) \param origin (const int *) the origin */ void ccp4_cmap_set_origin(CMMFile *mfile, const int *origin) { if (ccp4_file_is_write(mfile->stream)) { mfile->origin[0] = origin[0]; mfile->origin[1] = origin[1]; mfile->origin[2] = origin[2]; } } /*! Get the stored map axes order (rows,sections,columns) where 1=X, 2=Y, 3=Z \param mfile (const CMMFile *) \param axes_order (float *) contains the ordering on exit (dim 3) */ void ccp4_cmap_get_order(const CMMFile *mfile, int *axes_order) { axes_order[0] = mfile->axes_order[0]; axes_order[1] = mfile->axes_order[1]; axes_order[2] = mfile->axes_order[2]; } /*! Set the stored map axes order (rows,sections,columns) where 1=X, 2=Y, 3=Z. Only allowed when file is opened in write mode. \param mfile (CMMFile *) \param axes_order (const float *) the axes ordering */ void ccp4_cmap_set_order(CMMFile *mfile, const int *axes_order) { if (ccp4_file_is_write(mfile->stream)) { mfile->axes_order[0] = axes_order[0]; mfile->axes_order[1] = axes_order[1]; mfile->axes_order[2] = axes_order[2]; } } /*! Get the stored map dimension (rows,sections,columns) \param mfile (const CMMFile *) \param map_dim (int *) contains the map dimension on exit (dim 3) */ void ccp4_cmap_get_dim(const CMMFile *mfile, int *map_dim) { map_dim[0] = mfile->map_dim[0]; map_dim[1] = mfile->map_dim[1]; map_dim[2] = mfile->map_dim[2]; } /*! Set the stored map dimension (rows,sections,columns) Only allowed when file is opened in write mode before any data is written. Note: the row dimension will be overridden during writing \param mfile (CMMFile *) \param map_dim (const int *) the map dimension */ void ccp4_cmap_set_dim(CMMFile *mfile, const int *map_dim) { if (ccp4_file_is_write(mfile->stream) && !mfile->data.number) { mfile->map_dim[0] = map_dim[0]; mfile->map_dim[1] = map_dim[1]; mfile->map_dim[2] = map_dim[2]; mfile->data.section_size = map_dim[0]*map_dim[1]* ccp4_file_itemsize(mfile->stream); mfile->data.block_size = mfile->data.section_size + mfile->data.header_size; } } /*! Return the spacegroup listed in the map header. This is overriden by the symops. \param mfile (CMMFile *) \return spacegroup number */ int ccp4_cmap_get_spacegroup(const CMMFile *mfile) { return mfile->spacegroup; } /*! Set the spacegroup listed in the map header. Only allowed when file is opened in write mode. \param mfile (CMMFile *) \param spacegroup (int) spacegroup number */ void ccp4_cmap_set_spacegroup(CMMFile *mfile, int spacegroup) { if (ccp4_file_is_write(mfile->stream)) mfile->spacegroup = spacegroup; } /*! Return the datamode \param mfile (const CMMFile *) \return datamode */ unsigned int ccp4_cmap_get_datamode(const CMMFile *mfile) { return mfile->data_mode; } /*! Set the datamode. This is only allowed if the file is opened in write mode, and no data has been written. \param mfile (CMMFile *) \param datamode (unsigned int) major mode of map */ void ccp4_cmap_set_datamode(CMMFile *mfile, unsigned int datamode) { if (ccp4_file_is_write(mfile->stream) && !mfile->data.number && datamode <= 6 && datamode != 5) { mfile->data_mode = datamode; ccp4_file_setmode(mfile->stream, datamode); mfile->data.section_size = mfile->map_dim[0]*mfile->map_dim[1]* ccp4_file_itemsize(mfile->stream); mfile->data.block_size = mfile->data.section_size + mfile->data.header_size; } } /*! Get the map statistics, including maximum, minimum, mean and standard deviation. This is only meaningful for datamode FLOAT32. \param mfile (const CMMFile *) \param min (float *) \param max (float *) \param mean (double *) \param rms (double *) */ void ccp4_cmap_get_mapstats(const CMMFile *mfile, float *min, float* max, double *mean, double *rms) { double f1,f2,f3; *min = mfile->stats.min; *max = mfile->stats.max; if (ccp4_file_is_write(mfile->stream) && mfile->close_mode == 0) { f1 = (mfile->stats.total != 0) ? mfile->stats.mean / mfile->stats.total : 0; f2 = (mfile->stats.total != 0) ? mfile->stats.rms / mfile->stats.total : 0; f3 = f2 - f1*f1; *rms = (f3 > 0) ? sqrt(f3) : 0; *mean = f1 - (double) mfile->stats.offset; } else { *mean = mfile->stats.mean; *rms = mfile->stats.rms; } } /*! Set the map statistics, including maximum, minimum, mean and standard deviation. This is only meaningful for datamode FLOAT32 and the file open in write mode. \param mfile (CMMFile *) \param min (float) \param max (float) \param mean (double) \param rms (double) */ void ccp4_cmap_set_mapstats(CMMFile *mfile, const float min, const float max, const double mean, const double rms) { if (ccp4_file_is_write(mfile->stream)) { mfile->stats.min = min; mfile->stats.max = max; mfile->stats.mean = mean; mfile->stats.rms = rms; } } /*! Set the local header size (in bytes) \param mfile (CMMFile *) \param size (size_t) header size associated with each section (in bytes) */ void ccp4_cmap_set_local_header(CMMFile *mfile, size_t size) { if (ccp4_file_is_write(mfile->stream) && mfile->data.number == 0) { mfile->data.header_size = size; mfile->data.block_size = mfile->data.section_size + mfile->data.header_size; } return; } /*! Return the local header size \param mfile (CMMFile *) \return header size associated with each section (in bytes) */ size_t ccp4_cmap_get_local_header(CMMFile *mfile) { return mfile->data.header_size; } libccp4-8.0.0/ccp4/cmap_close.c0000644000000000000000000000465514242731033014300 0ustar 00000000000000/* cmap_close.c: close map file Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #include #include #include #include "cmaplib.h" #include "cmap_header.h" #include "cmap_labels.h" #include "cmap_errno.h" /*! Close the file. In write mode the header is output, along with the machine stamp. In read mode the file is just closed. Write mode supports ways of updating the map statistics ( only active for FLOAT32). /param mfile (CMMFile *) /return void */ void ccp4_cmap_close(CMMFile *mfile) { int i; if ( mfile == NULL) return; if (ccp4_file_is_write(mfile->stream) ) { if ( mfile->data_mode == FLOAT32) { switch (mfile->close_mode) { case 1: break; case 2: mfile->stats.offset = 0.0f; case 0: default: if (mfile->stats.total != 0) { mfile->stats.mean /= mfile->stats.total; mfile->stats.rms /= mfile->stats.total; mfile->stats.rms -= mfile->stats.mean*mfile->stats.mean; mfile->stats.rms = (mfile->stats.rms > 0) ? sqrt(mfile->stats.rms) : 0; mfile->stats.mean += (double) mfile->stats.offset; } break; } } write_mapheader(mfile); write_maplabels(mfile); ccp4_file_warch(mfile->stream); } ccp4_file_close(mfile->stream); for (i=0 ; i != mfile->labels.number ; i++) if (mfile->labels.labels[i] != NULL) free(mfile->labels.labels[i]); free(mfile); } /*! Set the close mode: 0: calculate based on stored values (default) 1: just dump the current values /param mfile (CMMFile *) /param mask (unsigned int) close mode /return void */ void ccp4_cmap_closemode(CMMFile *mfile, unsigned int mask) { mfile->close_mode = mask; } libccp4-8.0.0/ccp4/cmap_data.c0000644000000000000000000004011714242731033014075 0ustar 00000000000000/* cmap_data.c: read and write map sections. Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #include #include #include #include "cmaplib.h" #include "cmap_data.h" #include "cmap_stats.h" #include "cmap_errno.h" /*! Internal: return the an estimate of the number of sections in the map file based upon the length. Update mfile->data.number as a side effect. \param mfile (CMMFile *) \return number of sections according to length-data/section_size */ int number_sections(CMMFile *mfile) { div_t sections; sections = div(ccp4_file_length(mfile->stream)-mfile->data.offset, mfile->data.block_size); return mfile->data.number = sections.quot; } /*! seek among the map sections. The units are of size block_size. \param mfile (CMMFile *) \param sec (int) section number \param whence (unsigned int) SEEK_SET, SEEK_CUR or SEEK_END \return offset in file, or EOF */ int ccp4_cmap_seek_section(CMMFile *mfile, int sec, unsigned int whence) { size_t curr_posn; div_t secs; int result = EOF; if ( mfile == NULL ) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_NoChannel), "ccp4_cmap_seekdata",NULL); return EOF; } switch (whence) { case SEEK_SET: if ( ccp4_file_is_read(mfile->stream) && ( sec < 0 || sec > mfile->data.number) ) ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_ParamError), "ccp4_cmap_seek_section",NULL); else result = ccp4_file_raw_seek(mfile->stream, mfile->data.offset + sec * mfile->data.block_size, SEEK_SET); break; case SEEK_END: if ( ccp4_file_is_read(mfile->stream) && ( sec > 0 || abs(sec) > mfile->data.number) ) ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_ParamError), "ccp4_cmap_seek_section",NULL); else result = ccp4_file_raw_seek(mfile->stream, sec * mfile->data.block_size, SEEK_END); break; case SEEK_CUR: curr_posn = ccp4_file_tell(mfile->stream); secs = div(curr_posn - mfile->data.offset,mfile->data.block_size); if ( ccp4_file_is_read(mfile->stream) && ( (secs.quot + sec) < 0 || (secs.quot + sec) >= mfile->data.number) ) ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_ParamError), "ccp4_cmap_seek_section",NULL); else result = ccp4_file_raw_seek(mfile->stream, (sec > 0) ? (mfile->data.block_size - secs.rem + (sec - 1)*mfile->data.block_size) : (sec*mfile->data.block_size - secs.rem), SEEK_CUR); } return (result == EOF) ? EOF : ((result - mfile->data.offset)/mfile->data.block_size); } /*! write map section to file. Note: this wraps a raw write, with no location checking. It is therefore the responsibility of the calling program to ensure that everything is correct. Effectively assume appending to file. \param mfile (CMMFile *) \param section (const void *) \return 1 on success, 0 on failure */ int ccp4_cmap_write_section(CMMFile *mfile, const void *section) { int result=0; size_t write_dim; if (mfile == NULL || section == NULL) { ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_NoChannel), "ccp4_cmap_write_section",NULL); return 0; } if (!ccp4_file_is_write(mfile->stream)) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_WriteFail), "ccp4_cmap_write_section",NULL); return 0; } write_dim = mfile->map_dim[0] * mfile->map_dim[1]; result = ccp4_file_write(mfile->stream, section, write_dim); /* note that we have started writing */ mfile->data.number++; if (result != write_dim) ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_WriteFail), "ccp4_cmap_write_section",NULL); else if (mfile->data_mode == FLOAT32) stats_update(&mfile->stats, (float *)section, (float *)section+write_dim); return (result == write_dim) ? 1 : 0; } /*! read current map section from file to section. Some checking is performed to ensure we are at the start of a legitimate map section. \param mfile (CMMFile *) \param section (void *) array large enough to hold the map section \return 1 on success, 0 on failure */ int ccp4_cmap_read_section(CMMFile *mfile, void *section) { int result = 0; div_t secs; off_t curr_posn; const off_t data_offset = 0; size_t read_dim; if (mfile == NULL ) { ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_NoChannel), "ccp4_cmap_read_section",NULL); return 0; } if (!ccp4_file_is_read(mfile->stream)) { ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_ReadFail), "ccp4_cmap_read_section",NULL); return 0; } curr_posn = ccp4_file_tell(mfile->stream); secs = div(curr_posn - mfile->data.offset, mfile->data.block_size); /* ensure legit section (although rely upon EOF ) */ if (secs.quot < 0 || secs.rem < 0) { ccp4_file_raw_seek(mfile->stream, mfile->data.offset, SEEK_SET); secs.quot = 0; } else if( secs.rem > data_offset && secs.rem < mfile->data.section_size ) ccp4_file_raw_seek(mfile->stream, - secs.rem, SEEK_CUR); else if ( secs.rem >= mfile->data.section_size ) { ccp4_file_raw_seek(mfile->stream, (mfile->data.block_size-secs.rem), SEEK_CUR); secs.quot++; } read_dim = mfile->map_dim[0] * mfile->map_dim[1]; /* do not read if at end */ if (secs.quot < 0 || secs.quot < mfile->data.number) result = ccp4_file_read(mfile->stream, section, read_dim); if (result != read_dim) ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_ReadFail), "ccp4_cmap_read_section",NULL); return (result == read_dim) ? 1 : 0; } /*! read current section header (character array) After reading we are at the end of the local header \param mfile (CMMFile *) \param header (char *) character array large enough to hold the local header (raw read so not string) \return 1 on success, 0 on failure */ int ccp4_cmap_read_section_header(const CMMFile *mfile, char *header) { int result; div_t secs; if (mfile == NULL || header == NULL) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_NoChannel), "ccp4_cmap_read_section_header",NULL); return EOF; } if (!ccp4_file_is_read(mfile->stream)) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_ReadFail), "ccp4_cmap_read_section header",NULL); return EOF; } if ( mfile->data.header_size == 0) return (0); result = ccp4_file_tell(mfile->stream); secs = div(result - mfile->data.offset, mfile->data.block_size); if ( secs.quot < 0 || secs.quot >= mfile->data.number ) return (0); /* navigate to nearest header */ if ( secs.rem != mfile->data.section_size) ccp4_file_raw_seek(mfile->stream,(mfile->data.section_size - secs.rem), SEEK_CUR); if ( (result = ccp4_file_readchar( mfile->stream, (uint8 *) header, mfile->data.header_size)) != mfile->data.header_size) ccp4_signal(ccp4_errno, "ccp4_cmap_read_section_header", NULL); return (result == mfile->data.header_size) ? 1 : 0; } /*! write the local section header to the file. This must be of size mfile->data.header.size. Note: no checking is done so it is up to the calling program to ensure that the file is in the correct location. As seeking is turned off, this assumes we are appending to the file. \param mfile (CMMFile *) \param header (const char *) the local header character array (not necessarily a string) \return number of bytes written or EOF */ int ccp4_cmap_write_section_header(CMMFile *mfile, const char *header) { char *output; int result; if (mfile == NULL ) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_NoChannel), "ccp4_cmap_write_section_header",NULL); return EOF; } if (!ccp4_file_is_write(mfile->stream)) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_NoChannel), "ccp4_cmap_write_section_header",NULL); return EOF; } if ( mfile->data.header_size == 0) return (0); output = (char *) malloc(mfile->data.header_size); memset(output,' ', mfile->data.header_size); if (header) memcpy(output, header,mfile->data.header_size); if ( (result = ccp4_file_writechar( mfile->stream, (uint8 *) output, mfile->data.header_size)) != mfile->data.header_size) ccp4_signal(ccp4_errno, "ccp4_cmap_write_section_header", NULL); return (result == mfile->data.header_size) ? 1 : 0; } /*! seek a row within a map section \param mfile (CMMFile *) \param row (int) \param whence (unsigned int) SEEK_SET, SEEK_END, SEEK_CUR \return offset in file or EOF */ int ccp4_cmap_seek_row(CMMFile *mfile, int row, unsigned int whence) { size_t curr_posn; div_t secs, rows; int result = EOF; size_t item_size; if ( mfile == NULL ) { ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_NoChannel), "ccp4_cmap_seek_row",NULL); return EOF; } item_size = ccp4_file_itemsize(mfile->stream); curr_posn = ccp4_file_tell(mfile->stream); secs = div(curr_posn - mfile->data.offset,mfile->data.block_size); switch (whence) { case SEEK_SET: if ( row < 0 || row >= mfile->map_dim[1]) ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_ParamError), "ccp4_cmap_seek_row",NULL); else result = ccp4_file_raw_seek(mfile->stream, mfile->data.offset + (secs.quot * mfile->data.block_size + row * mfile->map_dim[0]*item_size), SEEK_SET); break; case SEEK_END: if ( row >= 0 || abs(row) > mfile->map_dim[1]) ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_ParamError), "ccp4_cmap_seek_row",NULL); else result = ccp4_file_raw_seek(mfile->stream, mfile->data.offset + (secs.quot * mfile->data.block_size + mfile->data.section_size + row * mfile->map_dim[0]*item_size), SEEK_SET); break; case SEEK_CUR: rows = div(secs.rem,mfile->map_dim[0]*item_size); if ( (rows.quot + row) < 0 || (rows.quot + row) >= mfile->data.number) ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_ParamError), "ccp4_cmap_seek_row",NULL); else result = ccp4_file_raw_seek(mfile->stream, ( row > 0) ? (mfile->map_dim[0]*item_size - rows.rem + (row-1)*mfile->map_dim[0]*item_size) : ( row*mfile->map_dim[0]*item_size - rows.rem), SEEK_CUR); } return (result); } /*! write map row to file. Note: this wraps a raw write, with no location checking. It is therefore the responsibility of the calling program to ensure that everything is correct. Effectively assume appending to file. \param mfile (CMMFile *) \param row (const void *) data to be written \return 1 on success, 0 on failure */ int ccp4_cmap_write_row(CMMFile *mfile, const void *row) { int result=0; if (mfile == NULL || row == NULL) { ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_NoChannel), "ccp4_cmap_write_row",NULL); return EOF; } if (!ccp4_file_is_write(mfile->stream)) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_WriteFail), "ccp4_cmap_write_row",NULL); return EOF; } result = ccp4_file_write(mfile->stream, row, mfile->map_dim[0]); /* note that we have started writing */ mfile->data.number++; if (result != mfile->map_dim[0]) ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_WriteFail), "ccp4_cmap_write_row",NULL); else if (mfile->data_mode == FLOAT32) stats_update(&mfile->stats, (float *)row, (float *)row+mfile->map_dim[0]); return (result == mfile->map_dim[0]) ? 1 : 0; } /*! read current map section from file to section. Some checking is performed to ensure we are at the start of a legitimate map row. \param mfile (CMMFile *) \param row (void *) array large enough to hold the map row \return 1 on success, 0 on failure */ int ccp4_cmap_read_row(CMMFile *mfile, void *row) { int result = 0, item_size; div_t secs, rows; off_t curr_posn; if (mfile == NULL) { ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_NoChannel), "ccp4_cmap_read_row",NULL); return EOF; } if (!ccp4_file_is_read(mfile->stream) || row == NULL) { ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_ReadFail), "ccp4_cmap_read_row",NULL); return EOF; } item_size = ccp4_file_itemsize(mfile->stream); curr_posn = ccp4_file_tell(mfile->stream); secs = div(curr_posn - mfile->data.offset, mfile->data.block_size); rows = div(secs.rem, mfile->map_dim[0]*item_size); if (secs.quot < 0 || secs.rem < 0) ccp4_file_raw_seek(mfile->stream, mfile->data.offset, SEEK_SET); else if(rows.quot >= mfile->map_dim[1] ) ccp4_file_raw_seek(mfile->stream, (mfile->data.block_size - secs.rem), SEEK_CUR); else if( rows.rem != 0) ccp4_file_raw_seek(mfile->stream, ( - secs.rem), SEEK_CUR); result = ccp4_file_read(mfile->stream, row, mfile->map_dim[0]); if (result != mfile->map_dim[0]) ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_ReadFail), "ccp4_cmap_read_row",NULL); return (result == mfile->map_dim[0]) ? 1 : 0; } /*! raw seek in items \param mfile (CMMFile *) \param offset (int) number of items \param whence (unsigned int) SEEK_SET, SEEK_CUR, SEEK_END; \return 0 on success, EOF on failure */ int ccp4_cmap_seek_data(CMMFile *mfile, int offset, unsigned int whence) { int result = EOF; if ( mfile == NULL ) { ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_NoChannel), "ccp4_cmap_seekdata",NULL); return (result); } if ((result = ccp4_file_seek( mfile->stream, offset, whence)) == -1) ccp4_signal(ccp4_errno, "ccp4_cmap_seek_data",NULL); return (result); } /*! raw write of nelements items to file, according to the datamode, at current location \param mfile (const CMMFile *) \param section (void *) values written, should contain at least nelements items \param n_items (int) number of items to be written \return number of items written or EOF */ int ccp4_cmap_write_data(CMMFile *mfile, const void *items, int n_items) { int result=0; if (mfile == NULL || items == NULL) { ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_NoChannel), "ccp4_cmap_write_data",NULL); return EOF; } if (ccp4_file_is_write(mfile->stream)) { result = ccp4_file_write(mfile->stream, (uint8 *) items, n_items); if (result != n_items) ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_WriteFail), "ccp4_cmap_write_data",NULL); else if (mfile->data_mode == FLOAT32) stats_update(&mfile->stats, (float *)items, (float *)items+result); } return (result); } /*! raw read of nelements items from file according to the datamode at current location \param mfile (const CMMFile *) \param items (void *) values read to here, so should have enough space for nelements items \param n_items (int) number of items to be read \return number of items read or EOF */ int ccp4_cmap_read_data(const CMMFile *mfile, void *items, int n_items) { int result=0; if (mfile == NULL || items == NULL) { ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_NoChannel), "ccp4_cmap_read_data",NULL); return EOF; } if (ccp4_file_is_read(mfile->stream)) result = ccp4_file_read(mfile->stream, (uint8 *) items, n_items); return (result); } libccp4-8.0.0/ccp4/cmap_data.h0000644000000000000000000000177414242731033014110 0ustar 00000000000000/* cmap_data.h: header for cmap_data.c Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #ifndef __GUARD_MAPLIB_DATA #define __GUARD_MAPLIB_DATA #ifdef __cplusplus extern "C" { #endif int number_sections(CMMFile *mfile); #ifdef __cplusplus } #endif #endif /* __GUARD_MAPLIB_DATA */ libccp4-8.0.0/ccp4/cmap_errno.h0000644000000000000000000000315514242731033014317 0ustar 00000000000000/* cmap_errno.h: error codes for map handling functions Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #ifndef __GUARD_MAPLIB_ERR #define __GUARD_MAPLIB_ERR #include "ccp4_errno.h" #ifdef __cplusplus extern "C" { #endif #define CMAP_ERRNO(n) (CCP4_ERR_MAP | (n)) /* error defs */ #define CMERR_Ok 0 #define CMERR_NoChannel 1 #define CMERR_NoFile 2 #define CMERR_NoLogicalName 3 #define CMERR_CantOpenFile 4 #define CMERR_NoHeader 5 #define CMERR_ReadFail 6 #define CMERR_WriteFail 7 #define CMERR_ParamError 8 #define CMERR_UnrecognK 9 #define CMERR_FileStamp 10 #define CMERR_SymErr 11 #define CMERR_AllocFail 12 #define CMERR_MaxFile 13 #define CMERR_SeekFail 14 #ifdef __cplusplus } #endif #endif /* __GUARD_MAPLIB_ERR */ libccp4-8.0.0/ccp4/cmap_header.c0000644000000000000000000001640314242731033014415 0ustar 00000000000000/* cmap_header.c: read and write map file headers Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #include #include #include #include "cmaplib.h" #include "cmap_errno.h" #include "cmap_skew.h" /*! Internal: read header from file and fill CMMFile struct. Called after file is opened for read. \param mfile (CMMFile *) \return 1 on success, EOF on failure*/ int parse_mapheader(CMMFile *mfile) { const int read_total = 77; const size_t header_size = 1024U, n_byt_symop = 80U; unsigned char buffer[224]; int result; float fmean,frms; ccp4_file_rewind(mfile->stream); memset(buffer,'\0',224); result = ccp4_file_readint(mfile->stream, &buffer[0], 10) ; result += ccp4_file_readfloat(mfile->stream, &buffer[40], 6); result += ccp4_file_readint(mfile->stream, &buffer[64], 3); result += ccp4_file_readfloat(mfile->stream, &buffer[76], 3); result += ccp4_file_readint(mfile->stream, &buffer[88], 3); /* skew matrix and translation */ result += ccp4_file_readfloat(mfile->stream, &buffer[100], 12); /* reserved */ result += ccp4_file_readint(mfile->stream, &buffer[148], 8); /* user access */ result += ccp4_file_readchar(mfile->stream, &buffer[180], 28); /* map and machine stamp */ result += ccp4_file_readint(mfile->stream, &buffer[208], 2); /* ARMS */ result += ccp4_file_readfloat(mfile->stream, &buffer[216], 1); result += ccp4_file_readint(mfile->stream, &buffer[220], 1); if (result != read_total) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_ReadFail), "parse_header", NULL); return EOF; } memcpy(&mfile->map_dim[0],&buffer[0],sizeof(mfile->map_dim)); memcpy(&mfile->data_mode,&buffer[12],sizeof(int)); memcpy(&mfile->origin[0],&buffer[16],sizeof(mfile->origin)); memcpy(&mfile->cell_grid[0],&buffer[28],sizeof(mfile->cell_grid)); memcpy(&mfile->cell[0],&buffer[40],sizeof(mfile->cell)); memcpy(&mfile->axes_order[0],&buffer[64],sizeof(mfile->axes_order)); memcpy(&mfile->stats.min,&buffer[76],sizeof(float)); memcpy(&mfile->stats.max,&buffer[80],sizeof(float)); memcpy(&fmean,&buffer[84],sizeof(float)); mfile->stats.mean = (double) fmean; memcpy(&mfile->spacegroup,&buffer[88],sizeof(int)); /* Additions for EM support. Define contents as image, image stack, volume or volume stack. In latter case, allows for 400+ispg convention. */ mfile->EM_spacegroup = mfile->spacegroup; strncpy(mfile->EM_contents,"VOLU",4); if (mfile->spacegroup > 400 && mfile->spacegroup < 631) { mfile->spacegroup = mfile->spacegroup - 400; strncpy(mfile->EM_contents,"VLST",4); } if (mfile->spacegroup == 0) { if (mfile->map_dim[2] == 1) strncpy(mfile->EM_contents,"IMAG",4); if (mfile->map_dim[2] > 1) strncpy(mfile->EM_contents,"IMST",4); } memcpy(&mfile->symop.size,&buffer[92],sizeof(int)); memcpy(&mfile->user_access,&buffer[180],sizeof(mfile->user_access)); /* memcpy(&mfile->data.header_size,&buffer[204],sizeof(int)); */ memcpy(&frms,&buffer[216],sizeof(float)); mfile->stats.rms = (double) frms; memcpy(&mfile->labels.number,&buffer[220],sizeof(int)); memcpy(&result,&buffer[96],sizeof(int)); if (result !=0) { memcpy(&mfile->skew.rotation[0][0],&buffer[100],sizeof(mfile->skew.rotation)); memcpy(&mfile->skew.translation[0],&buffer[136],sizeof(mfile->skew.translation)); } ccp4_file_setmode(mfile->stream, mfile->data_mode); /* may go to seperate function */ mfile->symop.offset = header_size; mfile->data.offset = mfile->symop.offset + mfile->symop.size; mfile->data.section_size = mfile->map_dim[0]*mfile->map_dim[1] *ccp4_file_itemsize(mfile->stream); mfile->data.block_size = mfile->data.section_size + mfile->data.header_size; mfile->data.number = mfile->map_dim[2]; mfile->symop.number = mfile->symop.size / n_byt_symop; return 1; } /*! Internal: write summary of current CMMFile struct to file. Called when file is opened write, and closed write. \param mfile (CMMFile *) \return 1 on success, EOF on failure */ int write_mapheader(CMMFile *mfile) { const int write_total = 77; unsigned char buffer[224]; int result; float fmean,frms; memset(buffer,'\0',224); memcpy(&buffer[0],&mfile->map_dim[0],sizeof(mfile->map_dim)); memcpy(&buffer[12],&mfile->data_mode,sizeof(int)); memcpy(&buffer[16],&mfile->origin[0],sizeof(mfile->origin)); memcpy(&buffer[28],&mfile->cell_grid[0],sizeof(mfile->cell_grid)); memcpy(&buffer[40],&mfile->cell[0],sizeof(mfile->cell)); memcpy(&buffer[64],&mfile->axes_order[0],sizeof(mfile->axes_order)); memcpy(&buffer[76],&mfile->stats.min,sizeof(float)); memcpy(&buffer[80],&mfile->stats.max,sizeof(float)); fmean = (float) mfile->stats.mean; memcpy(&buffer[84],&fmean,sizeof(float)); /* additions for EM support */ if (!strncmp(mfile->EM_contents,"VLST",4)) { memcpy(&buffer[88],&mfile->EM_spacegroup,sizeof(int)); } else { memcpy(&buffer[88],&mfile->spacegroup,sizeof(int)); } memcpy(&buffer[92],&mfile->symop.size,sizeof(int)); memcpy(&buffer[180],&mfile->user_access,sizeof(mfile->user_access)); /* memcpy(&buffer[204],&mfile->data.header_size,sizeof(int)); */ memcpy(&buffer[208],"MAP ",4U); frms = (float) mfile->stats.rms; memcpy(&buffer[216],&frms,sizeof(float)); memcpy(&buffer[220],&mfile->labels.number,sizeof(int)); if (skew_set(&mfile->skew) == TRUE) { result = 1; memcpy(&buffer[96],&result, sizeof(int)); memcpy(&buffer[100],&mfile->skew.rotation[0][0],sizeof(mfile->skew.rotation)); memcpy(&buffer[148],&mfile->skew.translation[0],sizeof(mfile->skew.translation)); } ccp4_file_seek(mfile->stream, 0L, SEEK_SET); result = ccp4_file_writeint(mfile->stream, &buffer[0], 10); result += ccp4_file_writefloat(mfile->stream, &buffer[40], 6); result += ccp4_file_writeint(mfile->stream, &buffer[64], 3); result += ccp4_file_writefloat(mfile->stream, &buffer[76], 3); result += ccp4_file_writeint(mfile->stream, &buffer[88], 3); result += ccp4_file_writefloat(mfile->stream, &buffer[100], 12); result += ccp4_file_writeint(mfile->stream, &buffer[148], 8); result += ccp4_file_writechar(mfile->stream, &buffer[180], 28); result += ccp4_file_writeint(mfile->stream, &buffer[208], 2); result += ccp4_file_writefloat(mfile->stream, &buffer[216], 1); result += ccp4_file_writeint(mfile->stream, &buffer[220], 1); if (result != write_total) ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_WriteFail), "write_header", NULL); return ( (result == write_total) ? 1 : EOF); } libccp4-8.0.0/ccp4/cmap_header.h0000644000000000000000000000205714242731033014422 0ustar 00000000000000/* cmap_header.h: header file for cmap_header.c Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #ifndef __GUARD_MAPLIB_HEADER #define __GUARD_MAPLIB_HEADER #ifdef __cplusplus extern "C" { #endif int parse_mapheader(CMMFile *mfile); int write_mapheader(CMMFile *mfile); #ifdef __cplusplus } #endif #endif /* __GUARD_MAPLIB_HEADER */ libccp4-8.0.0/ccp4/cmap_labels.c0000644000000000000000000001272114242731033014426 0ustar 00000000000000/* cmap_labels.c: read and write map header labels Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #include #include "cmaplib.h" #include "cmap_labels.h" #include "cmap_errno.h" /*! Internal: read the labels from file header and copy into char * array Called when the file is opened in read mode. \param mfile (CMMFile *) \return 1 on succes */ int parse_maplabels(CMMFile *mfile) { char buffer[81], *cptr; const unsigned int n_byt_label = 80U, max_label = 10U; /* const unsigned int labels_offset = 224U; */ int i; /* ccp4_file_seek(mfile->stream,labels_offset,SEEK_SET); */ for (i=0 ; i!=mfile->labels.number ; i++) { ccp4_file_readchar(mfile->stream,(uint8 *) buffer,n_byt_label); cptr = buffer+n_byt_label; while (cptr> buffer && *--cptr == ' '); *(++cptr) = '\0'; mfile->labels.labels[i] = strdup(buffer); } ccp4_file_raw_seek(mfile->stream,(max_label-mfile->labels.number) *n_byt_label, SEEK_CUR); return 1; } /*! Internal: dump the labels char * array to file, offset at 224 bytes. Called when the file is opened or closed in write mode, immediately after the header is written. \param mfile (const CMMFile *) \return 1 on success, 0 on failure */ int write_maplabels(const CMMFile *mfile) { char buffer[80]; /* const unsigned int labels_offset = 224U; */ int i, result = 0; size_t slen; /* ccp4_file_seek(mfile->stream,labels_offset,SEEK_SET); */ for (i=0 ; i != mfile->labels.number ; i++) { memset(buffer,' ',80U); slen = strlen(mfile->labels.labels[i]); if (slen > 80U) slen = 80U; strncpy(buffer,mfile->labels.labels[i],slen); result += ccp4_file_writechar(mfile->stream,(uint8 *) buffer,80U); } memset(buffer,' ',80U); while(i != 10) { result += ccp4_file_writechar(mfile->stream,(uint8 *) buffer,80U); i++; } return (result == 800) ? 1 : 0 ; } /*! Set the label in the map header. Headers are 80 characters long. The labels are written to the file when it is closed. Therefore, the file must be in write mode. If label == NULL the element corresponding to posn is removed. The number of labels is recalculated on each call. \param mfile (CMMFile *) \param label (const char *) the C-style character array \param posn (int) the label number (C-style, 0 -> 9) \return number of label effected, or EOF */ int ccp4_cmap_set_label(CMMFile *mfile, const char *label, int posn) { int i,j; if (mfile == NULL) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_NoChannel), "ccp4_cmap_set_label",NULL); return (EOF);} if (ccp4_file_is_write(mfile->stream) == 0) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_WriteFail), "ccp4_cmap_label_set",NULL); return (EOF);} /*posn must be between 0 and 9 */ if (posn < 0) { posn = 0; } else if (posn > mfile->labels.number) { posn = mfile->labels.number; } if (mfile->labels.labels[posn] != NULL) free(mfile->labels.labels[posn]); /* if label == NULL reset the value and compress set */ if (label == NULL) { mfile->labels.labels[posn] = NULL; for ( i=posn ; i!=10 ; i++) if (mfile->labels.labels[i] == NULL) for ( j=i+1 ; j!=10; j++) if (mfile->labels.labels[j] != NULL) { mfile->labels.labels[i] = mfile->labels.labels[j]; mfile->labels.labels[j] = NULL; break; } } else mfile->labels.labels[posn] = strdup(label); /* recalculate number */ for ( i=0 ; i!=10 ; i++) if (mfile->labels.labels[i] == NULL) break; mfile->labels.number = i; return posn; } /*! Get the label corresponding to position posn \param mfile (const CMMFile *) \param posn (int) desired label number \return pointer to label posn */ char *ccp4_cmap_get_label(const CMMFile *mfile, int posn) { char *label; if (mfile == NULL) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_NoChannel), "ccp4_cmap_get_label",NULL); return (NULL);} if (posn < 0 || posn >= mfile->labels.number) label = NULL; else label = mfile->labels.labels[posn]; return label; } /*! Return the number of labels. \param mfile (CMMFile *) \return the number of labels */ int ccp4_cmap_number_label(const CMMFile *mfile) { return mfile->labels.number; } /*! Get the label corresponding to the title wrapping ccp4_cmap_get_label. \param mfile (const CMMFile *) \return pointer to label 0, or NULL */ char *ccp4_cmap_get_title(const CMMFile *mfile) { return ccp4_cmap_get_label(mfile, 0); } /*! Set the label corresponding to the title, wrapping ccp4_cmap_set_label \param mfile (CMMFile *) \param label \return 0 or EOF on failure */ int ccp4_cmap_set_title(CMMFile *mfile, const char *title) { return ccp4_cmap_set_label(mfile, title, 0); } libccp4-8.0.0/ccp4/cmap_labels.h0000644000000000000000000000205714242731033014434 0ustar 00000000000000/* cmap_labels.h: header for cmap_labels.c Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #ifndef __GUARD_MAPLIB_LABEL #define __GUARD_MAPLIB_LABEL #ifdef __cplusplus extern "C" { #endif int parse_maplabels(CMMFile *mfile); int write_maplabels(const CMMFile *mfile); #ifdef __cplusplus } #endif #endif /* __GUARD_MAPLIB_LABEL */ libccp4-8.0.0/ccp4/cmap_open.c0000644000000000000000000000665414242731033014135 0ustar 00000000000000/* cmap_open.c: Opening CCP4-format map files. Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file cmap_open.c * * @brief Opening CCP4-format map files. * * @author Charles Ballard */ #include #include #include #include #include "cmaplib.h" #include "cmap_header.h" #include "cmap_labels.h" #include "cmap_errno.h" /*! Internal: malloc CMMFile struct for reading into \return CMMFile */ CMMFile *init_cmap_read(void) { CMMFile *mfile = (CMMFile *) malloc(sizeof(CMMFile)); if (mfile) memset(mfile,'\0',sizeof(CMMFile)); return mfile; } /*! Internal: malloc CMMFile struct for writing \return CMMFile */ CMMFile *init_cmap_write(void) { CMMFile *mfile = (CMMFile *) malloc(sizeof(CMMFile)); if (mfile) { memset(mfile,'\0',sizeof(CMMFile)); mfile->data_mode = DEFMODE; mfile->symop.offset = 1024U; mfile->data.offset = 1024U; } return mfile; } /*! Internal: Identify file as a ccp4 format map \param file The (CCP4File *) struct representing the file. \return non-zero on true, 0 on false */ int is_cmap(CCP4File *file) { char buffer[4]; const unsigned int map_offset = 208U; if (file == NULL) return 0; if ( ccp4_file_raw_seek(file,map_offset,SEEK_SET) == EOF) return 0; if (ccp4_file_readchar(file,(uint8 *) buffer,4U) != 4U) return 0; ccp4_file_rewind(file); return !strncmp(buffer,"MAP ",4); } /*! The file is opened. \param filename (char *) the filename \param mode (int) the i/o mode , possible values are O_RDONLY, O_WRONLY, O_RDWR, O_APPEND, O_TMP, O_CREAT, O_TRUNC - see ccp4_sysdep.h \return (void *) CMMFile structure */ void *ccp4_cmap_open(const char *filename, int mode) { CMMFile *mfile; CCP4File *cfile; const size_t stamp_offset = 212U; if ((cfile = ccp4_file_open(filename, mode)) == NULL) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_CantOpenFile), "ccp4_cmap_open",NULL); return (NULL); } ccp4_file_raw_setstamp(cfile, stamp_offset); /* read or write only */ if (cfile->read) { if (!is_cmap(cfile) || cfile->length < 1025) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_NoHeader), "ccp4_cmap_open",NULL); ccp4_file_close(cfile); return NULL; } ccp4_file_rarch(cfile); mfile = init_cmap_read(); mfile->stream = cfile; mfile->file_name = cfile->name; parse_mapheader(mfile); parse_maplabels(mfile); } else if (cfile->write) { mfile = init_cmap_write(); mfile->stream = cfile; mfile->file_name = cfile->name; write_mapheader(mfile); write_maplabels(mfile); } else { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_CantOpenFile), "ccp4_cmap_open",NULL); return (NULL); } return (mfile); } libccp4-8.0.0/ccp4/cmap_skew.c0000644000000000000000000000710414242731033014134 0ustar 00000000000000/* cmap_skew.c: set and fetch the skew matrix Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #include #include "cmaplib.h" #include "cmap_skew.h" #include "cmap_errno.h" /*! Set the values of the translation and rotation elements of the skew matrix. Note: the stored file is in FORTRAN order mat[fastest][slowest] \param mfile (CMMFile *) \param skew_mat (const float *) the skew translation vestor \param skew_trans (const float *) the skew rotation matrix (C ordering) \return 1 if either skew_trans or skew_mat is non-NULL */ int ccp4_cmap_set_mask(CMMFile *mfile, const float *skew_mat, const float *skew_trans) { int ictr, jctr; if (!mfile) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_NoChannel), "ccp4_cmap_set_mask",NULL); return (EOF);} if (skew_trans) for(ictr = 0; ictr < 3 ; ++ictr) mfile->skew.translation[ictr] = *(skew_trans + ictr); else for(ictr = 0; ictr < 3 ; ++ictr) mfile->skew.translation[ictr] = 0.0F; if (skew_mat) for(ictr = 0; ictr < 3 ; ++ictr) for (jctr = 0 ; jctr < 3 ; ++jctr) mfile->skew.rotation[jctr][ictr] = *(skew_mat + (3*ictr) + jctr); else for(ictr = 0; ictr < 3 ; ++ictr) for (jctr = 0 ; jctr < 3 ; ++jctr) mfile->skew.rotation[jctr][ictr] = 0.0F; return (skew_trans != NULL || skew_mat != NULL ); } /*! Get the values of the translation and rotation elements of the skew matrix. Note: the stored file is in FORTRAN order mat[fastest][slowest], the returned values are in C mat[slowest][fastest] ordering \param mfile (CMMFile *) \param skew_mat (const float *) the skew translation vestor \param skew_trans (const float *) the skew rotation matrix (C ordering) \return 1 if mask is set */ int ccp4_cmap_get_mask(const CMMFile *mfile, float *skew_mat, float *skew_trans) { int ictr, jctr; if (!mfile || !skew_mat || !skew_trans) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_NoChannel), "ccp4_cmap_get_mask",NULL); return (EOF);} for(ictr = 0; ictr < 3 ; ++ictr) *(skew_trans + ictr) = mfile->skew.translation[ictr]; for(ictr = 0; ictr < 3 ; ++ictr) for (jctr = 0 ; jctr < 3 ; ++jctr) *(skew_mat + (3*ictr) + jctr) = mfile->skew.rotation[jctr][ictr]; return skew_set(&mfile->skew); } /*! Internal: test whether values are set in the skew matrices \param skew (CMMFile_Skew *) \return TRUE or FALSE */ int skew_set(const CMMFile_Skew *skew) { return skew->translation[0] != 0.0F || skew->translation[1] != 0.0F || skew->translation[2] != 0.0F || skew->rotation[0][0] != 0.0F || skew->rotation[0][1] != 0.0F || skew->rotation[0][2] != 0.0F || skew->rotation[1][0] != 0.0F || skew->rotation[1][1] != 0.0F || skew->rotation[1][2] != 0.0F || skew->rotation[2][0] != 0.0F || skew->rotation[2][1] != 0.0F || skew->rotation[2][2] != 0.0F; } libccp4-8.0.0/ccp4/cmap_skew.h0000644000000000000000000000200414242731033014133 0ustar 00000000000000/* cmap_skew.h: header file for cmap_skew.c Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #ifndef __GUARD_MAPLIB_SKEW #define __GUARD_MAPLIB_SKEW #ifdef __cplusplus extern "C" { #endif int skew_set(const CMMFile_Skew *skew); #ifdef __cplusplus } #endif #endif /* __GUARD_MAPLIB_SKEW */ libccp4-8.0.0/ccp4/cmap_stats.c0000644000000000000000000000340514242731033014321 0ustar 00000000000000/* cmap_stats.c: deal with map statistics. Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #include #include "cmaplib.h" #include "cmap_stats.h" #include "cmap_errno.h" /*! Internal: use floats in range section_begin to section_end to update the map statistics. \param stats (CMMFile_Stats *) \param section_begin (void *) start of section \param section_end (void *) one past end-of-section \return total of map elements so far */ int stats_update(CMMFile_Stats *stats, void *section_begin, void *section_end) { float *ufp = (float *) section_begin; double val; if (stats->total == 0 && *ufp < -1.0e10 ) { stats->offset = *ufp; } while (ufp < (float *) section_end) { val = (double) (*ufp - stats->offset); stats->mean += val; stats->rms += val * val; stats->min = MIN( stats->min, *ufp); stats->max = MAX( stats->max, *ufp); ufp++; } stats->total += (float *)section_end - (float *)section_begin; return (stats->total); } libccp4-8.0.0/ccp4/cmap_stats.h0000644000000000000000000000211114242731033014317 0ustar 00000000000000/* cmap_stats.h: header file for cmap_stats.c Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #ifndef __GUARD_MAPLIB_STATS #define __GUARD_MAPLIB_STATS #ifdef __cplusplus extern "C" { #endif int stats_update(CMMFile_Stats *stats, void *section_begin, void *section_end); #ifdef __cplusplus } #endif #endif /* __GUARD_MAPLIB_STATS */ libccp4-8.0.0/ccp4/cmap_symop.c0000644000000000000000000001212114242731033014325 0ustar 00000000000000/* cmap_symop.c: set and fetch symmetry operations in map header Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #include #include "cmaplib.h" #include "cmap_errno.h" /*! Return the number of symops (estimated as the size/80) \param mfile (const CMMFile *) \return number of symops */ int ccp4_cmap_num_symop(const CMMFile *mfile) { if (mfile == NULL) return 0; return (mfile->symop.number); } /*! navigate around the symops, seeking in 80 byte units The result must lie within the symop strings in the file. \param mfile (CMMFile *) \param isymop (int) the number of the symop "string" of interest \param whence (unsigned int) mode of seek \return symop string number or EOF */ int ccp4_cmap_seek_symop(CMMFile *mfile, int isymop, unsigned int whence) { const int n_byt_symop = 80; div_t symops; int result = EOF; if (ccp4_file_is_read(mfile->stream) == 0) return EOF; switch (whence) { case SEEK_SET: if (isymop < 0 || isymop > mfile->symop.number) ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_ParamError), "ccp4_cmap_seek_symop", NULL); else result = ccp4_file_raw_seek(mfile->stream, mfile->symop.offset + isymop*n_byt_symop, whence); break; case SEEK_END: if (isymop > 0 || abs(isymop) > mfile->symop.number ) ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_ParamError), "ccp4_cmap_seek_symop", NULL); else result = ccp4_file_raw_seek(mfile->stream, mfile->symop.offset + mfile->symop.size + isymop*n_byt_symop, SEEK_SET); break; case SEEK_CUR: symops = div(ccp4_file_tell(mfile->stream) - mfile->symop.offset,n_byt_symop); if (symops.quot < 0 || symops.quot >= mfile->symop.number || symops.quot + isymop < 0 || symops.quot + isymop >= mfile->symop.number) ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_ParamError), "ccp4_cmap_seek_symop", NULL); else result = ccp4_file_raw_seek(mfile->stream,(isymop > 0) ? (n_byt_symop - symops.rem + n_byt_symop * (isymop-1)) : (n_byt_symop * isymop -symops.rem), SEEK_CUR); } return (result == EOF) ? EOF : (result - mfile->symop.offset)/n_byt_symop; } /*! get a symop string of 80 characters \param mfile (CMMFile *) \param buffer (char *) array of bytes which will contain the symop string. This must be at least 81 characters long (including space for null terminator). \return 1 on success, 0 if no symops, EOF on failure */ int ccp4_cmap_get_symop(CMMFile *mfile, char *buffer) { const int n_byt_symop = 80; off_t file_posn; if ( mfile->symop.size == 0) { ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_SymErr), "cmap_get_symop",NULL); return (0);} file_posn = ccp4_file_tell(mfile->stream); if (file_posn < mfile->symop.offset || file_posn > mfile->symop.offset + mfile->symop.size) { ccp4_signal( CCP4_ERRLEVEL(2) | CMAP_ERRNO(CMERR_SymErr), "cmap_get_symop",NULL); return (EOF);} if (ccp4_file_readchar(mfile->stream, (uint8 *) buffer, n_byt_symop) != n_byt_symop) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_ReadFail), "cmap_get_symop",NULL); return (EOF); } buffer[n_byt_symop] = '\0'; return (1); } /*! write symops to file. This wraps a raw write. It is up to the calling program to ensure the positioning (effectively assume appends). Writing is blocked if data has alread been written to the file. 80 bytes of continuous memory is written to the file. \param mfile (CMMFile *) \param symop (const char *) character array containing the symop string (at least 80 characters in length \return 1 on success, EOF on failure */ int ccp4_cmap_set_symop(CMMFile *mfile, const char *symop) { const int n_byt_symop = 80; char buffer[80]; memset(buffer,' ',80U); memcpy(buffer, symop, (strlen(symop) > n_byt_symop) ? n_byt_symop : strlen(symop) ); if (ccp4_file_is_write(mfile->stream) && mfile->data.number == 0) { if (ccp4_file_writechar(mfile->stream, (uint8 *) buffer, n_byt_symop) != n_byt_symop) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_WriteFail), "cmap_set_symop",NULL); return (EOF); } mfile->symop.number++; mfile->symop.size += n_byt_symop; mfile->data.offset = mfile->symop.offset + mfile->symop.size; } return (1); } libccp4-8.0.0/ccp4/cmaplib.h0000644000000000000000000001632514242731033013604 0ustar 00000000000000/* cmaplib.h: C/C++ level API for accessing CCP4 map files Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @page cmap_page CMAP library * * @verbatim @endverbatim * * @section cmap_file_list File list
  • cmaplib.h - contains details of the C/C++ API
  • cmap_data.h
  • cmap_header.h
  • cmap_skew.h
  • cmap_errno.h
  • cmap_labels.h
  • cmap_stats.h
* @section cmap_overview Overview Functions defining the C-level API for accessing CCP4 map files. */ /** @file cmaplib.h * * @brief ccp4 map i/o user-level library header file * * Functions defining the C-level API for accessing CCP4 map files. * * @author Charles Ballard */ #ifndef __GUARD_MAPLIB #define __GUARD_MAPLIB #include "ccp4_utils.h" #ifdef __cplusplus namespace CMap_io { typedef CCP4::CCP4File CCP4File; extern "C" { #endif typedef struct _CMMFile_Skew CMMFile_Skew; typedef struct _CMMFile_Labels CMMFile_Labels; typedef struct _CMMFile_Symop CMMFile_Symop; typedef struct _CMMFile_Data CMMFile_Data; typedef struct _CMMFile_Stats CMMFile_Stats; typedef struct _CMMFile CMMFile; struct _CMMFile_Labels { unsigned int number; char *labels[10]; }; struct _CMMFile_Skew { float rotation[3][3]; float translation[3]; }; struct _CMMFile_Symop { unsigned int offset; unsigned int size; unsigned int number; }; struct _CMMFile_Data { size_t offset; size_t section_size; size_t header_size; size_t block_size; unsigned int number; }; struct _CMMFile_Stats { float offset; /* pseudo zero value */ float min; /* minimum density value */ float max; /* maximum density value */ double mean; /* sum of densities (less offset) */ double rms; /* sum of square of densities (less offset) */ int total; /* number of summed densities */ }; struct _CMMFile { CCP4File *stream; char *file_name; unsigned int data_mode; unsigned int close_mode; float cell[6]; int spacegroup; int EM_spacegroup; char EM_exthead_type[5]; char EM_contents[5]; int map_dim[3]; int origin[3]; int cell_grid[3]; int axes_order[3]; CMMFile_Symop symop; CMMFile_Data data; CMMFile_Stats stats; CMMFile_Labels labels; CMMFile_Skew skew; int reserved[8]; char user_access[28]; }; /* open a file for read/write */ void *ccp4_cmap_open(const char *filename, int mode); /* close a file for read/write (dumping the header if write) */ void ccp4_cmap_close(CMMFile *mfile); /* set the close mode (calculation of map statistics) */ void ccp4_cmap_closemode(CMMFile *mfile, unsigned int closemode); /* seek to a section in the map (read mode only)*/ int ccp4_cmap_seek_section(CMMFile *mfile, int offset, unsigned int seek_mode); /* seek to a row in a section (read mode only)*/ int ccp4_cmap_seek_row(CMMFile *, int offset, unsigned int seek_mode); /* raw seek (read mode only)*/ int ccp4_cmap_seek_data(CMMFile *, int offset, unsigned int seek_mode); /* read a map section from file to memory */ int ccp4_cmap_read_section(CMMFile *mfile, void *section); /* read a row from file to memory */ int ccp4_cmap_read_row(CMMFile *mfile, void *row); /* read n_items from file to memory (item determined by data mode) */ int ccp4_cmap_read_data(const CMMFile *mfile, void *items, int n_items); /* write a map section from memory to file */ int ccp4_cmap_write_section(CMMFile *mfile, const void *section); /* write a map row from memory to file */ int ccp4_cmap_write_row(CMMFile *mfile, const void *row); /* write n_items from memory to file (item determined by data mode) */ int ccp4_cmap_write_data(CMMFile *mfile, const void *items, int n_items); /* read the section header corresponding to the current section */ int ccp4_cmap_read_section_header(const CMMFile *mfile, char *header); /* write the section header corresponding to the current section */ int ccp4_cmap_write_section_header(CMMFile *mfile, const char *header); /* get the header parameters */ void ccp4_cmap_get_cell(const CMMFile *mfile, float *cell); void ccp4_cmap_get_grid(const CMMFile *mfile, int *grid); void ccp4_cmap_get_origin(const CMMFile *mfile, int *origin); void ccp4_cmap_get_order(const CMMFile *mfile, int *axes_order); void ccp4_cmap_get_dim(const CMMFile *mfile, int *map_dim); int ccp4_cmap_get_spacegroup(const CMMFile *mfile); void ccp4_cmap_get_mapstats(const CMMFile *mfile, float *min, float* max, double *mean, double *rms); /* set the header parameters */ void ccp4_cmap_set_cell(CMMFile *mfile, const float *cell); void ccp4_cmap_set_grid(CMMFile *mfile, const int *grid); void ccp4_cmap_set_origin(CMMFile *mfile, const int *origin); void ccp4_cmap_set_order(CMMFile *mfile, const int *axes_order); void ccp4_cmap_set_dim(CMMFile *mfile, const int *map_dim); void ccp4_cmap_set_spacegroup(CMMFile *mfile, int spacegroup); void ccp4_cmap_set_mapstats(CMMFile *mfile, const float min, const float max, const double mean, const double rms); /* get map file datamode */ unsigned int ccp4_cmap_get_datamode(const CMMFile *mfile); /* set map file datamode */ void ccp4_cmap_set_datamode(CMMFile *mfile, unsigned int datamode); /* get the local header size */ size_t ccp4_cmap_get_local_header(CMMFile *mfile); /* set the local header size (before data writing begins) */ void ccp4_cmap_set_local_header(CMMFile *mfile, size_t size); /* get the number of symops in the file */ int ccp4_cmap_num_symop(const CMMFile *mfile); /* seek among the symops strings */ int ccp4_cmap_seek_symop(CMMFile *mfile, int isymop, unsigned int whence); /* read a symop string of 80 characters */ int ccp4_cmap_get_symop(CMMFile *mfile, char *buffer); /* write a symop string of 80 characters */ int ccp4_cmap_set_symop(CMMFile *mfile, const char *buffer); /* get the mask */ int ccp4_cmap_get_mask(const CMMFile *mfile, float *skew_mat, float *skew_trans); /* set the mask */ int ccp4_cmap_set_mask(CMMFile *mfile, const float *skew_mat, const float *skew_trans); /* the number of labels used */ int ccp4_cmap_number_label(const CMMFile *mfile); /* set label at posn from C-string */ int ccp4_cmap_set_label(CMMFile *mfile, const char *label, int posn); /* return label at posn as C-string */ char *ccp4_cmap_get_label(const CMMFile *mfile, int posn); /* set title (label=0) */ int ccp4_cmap_set_title(CMMFile *mfile, const char *label); /* get title (label=0) */ char *ccp4_cmap_get_title(const CMMFile *mfile); #ifdef __cplusplus } } #endif #endif /* __GUARD_MAPLIB */ libccp4-8.0.0/ccp4/cmaplib_f.h0000644000000000000000000000207414242731033014105 0ustar 00000000000000/* cmaplib_f.h: header files for cmaplib_f.c Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #ifndef __GUARD_MAPLIB_FORTRAN #define __GUARD_MAPLIB_FORTRAN #include "cmaplib.h" #define MAXMAP MAXFILES typedef struct _IOConvMap IOConvMap; struct _IOConvMap { int ipc; char *logname; CMMFile *mapfile; }; #endif /* __GUARD_MAPLIB_FORTRAN */ libccp4-8.0.0/ccp4/cmtzlib.c0000644000000000000000000035360414242731033013640 0ustar 00000000000000/* cmtzlib.c: functions for handling MTZ files Copyright (C) 2001 CCLRC, Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /* DO NOT put Doxygen comments here - put in cmtzlib.h */ /* See cmtzlib.h for descriptions of functions */ #include #include #include #ifdef _MSC_VER #include #endif #include #include "cmtzlib.h" #include "ccp4_types.h" #include "ccp4_array.h" #include "ccp4_parser.h" #include "ccp4_vars.h" #include "ccp4_errno.h" #include "ccp4_unitcell.h" /* "$Id$" */ /* stuff for error reporting */ #define CMTZ_ERRNO(n) (CCP4_ERR_MTZ | (n)) /* error defs */ #define CMTZERR_Ok 0 #define CMTZERR_NoChannel 1 #define CMTZERR_NoFile 2 #define CMTZERR_NoLogicalName 3 #define CMTZERR_CantOpenFile 4 #define CMTZERR_NoHeader 5 #define CMTZERR_ReadFail 6 #define CMTZERR_WriteFail 7 #define CMTZERR_ParamError 8 #define CMTZERR_Cellerr 9 #define CMTZERR_FileStamp 10 #define CMTZERR_SymErr 11 #define CMTZERR_AllocFail 12 #define CMTZERR_MaxFile 13 #define CMTZERR_ParserFail 14 #define CMTZERR_NotMTZ 15 #define CMTZERR_DatasetIncomplete 16 #define CMTZERR_NoArch 17 #define CMTZERR_NullDataset 18 #define CMTZERR_BadVersion 19 #define CMTZERR_SYMINFIncomplete 20 #define CMTZERR_COLUMNIncomplete 21 #define CMTZERR_BadBatchHeader 22 #define CMTZERR_DifferentVersion 23 #define CMTZERR_ColTypeMismatch 24 #define CMTZERR_ColGroupError 25 #define CMTZERR_ColSourceError 26 MTZ *MtzGet(const char *logname, int read_refs) { return MtzGetUserCellTolerance(logname, read_refs, 0.002); } MTZ *MtzGetUserCellTolerance(const char *logname, int read_refs, const double cell_tolerance) { MTZ *mtz; CCP4File *filein; int istat, newproj, cset_warn=0, length; MTZCOL *colin[MCOLUMNS], *newcol; char *filename; char crysin[MXTALS][65],projin[MXTALS][65],crystal[65],project[65]; double cellin[MXTALS][6],cell[6]; int jxtalin[MSETS]; char mkey[4], keyarg[76], hdrrec[MTZRECORDLENGTH+1], label[31], type[3]; int i, j, ntotcol, nref, ntotset=0, nbat, nhist=0, icolin; int ixtal, jxtal, iset, iiset, icset, nxtal=0, nset[MXTALS]={0}, isym=0; int indhigh[3],indlow[3],isort[5],ind_xtal,ind_set,ind_col[3],debug=0; float min,max,totcell[6],minres,maxres; float *refldata; double coefhkl[6]; int k; long xmllen; int32_t tmp_hdrst; int64_t hdrst; /* For cparser */ CCP4PARSERARRAY *parser; CCP4PARSERTOKEN *token=NULL; char *key; int ntok,iprint=0; /* For batches */ int ibat,nintegers,nreals; float buf[NBATCHWORDS]; int *intbuf = (int *) buf; float *fltbuf = buf + NBATCHINTEGERS; MTZBAT *batch; /* known headers */ char known_headers[][5] = { "PROJ","DATA","DCEL","DRES","DWAV","VERS","TITL","CELL", "SORT","SYMI","SYMM","COLU","VALM","RESO","COLS","COLG", "NCOL","NDIF","CRYS","MTZH","MTZB","BH" }; int n_known_headers = sizeof(known_headers)/sizeof(known_headers[0]); if (debug) printf(" Entering MtzGet \n"); /* check input */ if (!logname) return NULL; /* Open the mtz file: */ if (getenv(logname) != NULL) { filename = strdup(getenv(logname)); } else { filename = strdup(logname); } if (debug) printf(" Opening file %s \n",filename); filein = ccp4_file_open(filename,O_RDONLY); if (! filein ) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_CantOpenFile),"MtzGet",NULL); free(filename); return NULL; } if (debug) printf(" File opened successfully \n"); /* specify location of stamp as 2*sizeof(float), where float is default mode */ ccp4_file_setstamp(filein, 2); /* Read architecture */ istat = ccp4_file_rarch (filein); if (!istat) { ccp4_signal(CCP4_ERRLEVEL(2) | CMTZ_ERRNO(CMTZERR_NoArch), "MtzGet", NULL); } parser = ccp4_parse_start(20); if (parser == NULL) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_ParserFail),"MtzGet",NULL); free(filename); ccp4_file_close(filein); return NULL; } /* Set some convenient pointers to members of the parser array */ key = parser->keyword; token = parser->token; /* return to beginning of the file */ ccp4_file_seek (filein, 0, SEEK_SET); /* set reading characters */ ccp4_file_setmode(filein,0); istat = ccp4_file_readchar(filein, (uint8 *) hdrrec, 4); /* We don't test all reads, but this one should trap for e.g. truncated files */ if (istat == EOF || hdrrec[0] == '\0') { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_ReadFail),"MtzGet",NULL); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return NULL; } hdrrec[4] = '\0'; ntok = ccp4_parser(hdrrec, MTZRECORDLENGTH, parser, iprint); if (!ccp4_keymatch(key,"MTZ")) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_NotMTZ),"MtzGet",NULL); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return(NULL); } if (debug) printf(" MTZ file confirmed \n"); /* set reading integers */ ccp4_file_setmode(filein,6); istat = ccp4_file_read(filein, (uint8 *) &tmp_hdrst, 1); if (debug) printf(" tmp_hdrst read as %d \n", tmp_hdrst); if (tmp_hdrst == -1) { // read the real header offset in bytes 13-20 i.e. a double-word after the third word if ( ccp4_file_seek(filein, 3, SEEK_SET) ) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_ReadFail),"MtzGet",NULL); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return NULL; } /* set reading double integers*/ ccp4_file_setmode(filein,5); istat = ccp4_file_read(filein, (uint8 *) &hdrst, 1); if (debug) printf(" hdrst read as %ld \n", hdrst); /* switch back to reading integers */ ccp4_file_setmode(filein,6); } else { hdrst = (int64_t) tmp_hdrst; } /* 1st Pass: Read ntotcol, nref, nbat and dataset info. nxtal and nset are used to assign memory for MTZ structure. Position at top of header */ /* We don't test all seeks, but this one might trap duff files */ if ( ccp4_file_seek(filein, (long) (hdrst-1), SEEK_SET) ) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_ReadFail),"MtzGet",NULL); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return NULL; } /* set up base dataset in case it is in not in file */ iiset = 0; nxtal = 1; jxtalin[0]=0; strcpy(projin[0],"HKL_base"); strcpy(crysin[0],"HKL_base"); nset[0] = 1; if (debug) printf(" Start first pass \n"); strcpy(project,"dummy"); strcpy(crystal,"dummy"); ccp4_file_setmode(filein,0); istat = ccp4_file_readchar(filein, (uint8 *) hdrrec, MTZRECORDLENGTH); if (debug) printf(" Read first header record with istat = %d \n",istat); /* We don't test all reads, but this one should trap for e.g. truncated files */ if (istat == EOF || hdrrec[0] == '\0') { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_ReadFail),"MtzGet",NULL); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return NULL; } hdrrec[MTZRECORDLENGTH] = '\0'; ntok = ccp4_parser(hdrrec, MTZRECORDLENGTH, parser, iprint); while (!ccp4_keymatch(key,"END")) { /* read total number of columns, reflections and batches */ if (ccp4_keymatch(key, "NCOL")) { ntotcol = (int) token[1].value; nref = (int) token[2].value; nbat = (int) token[3].value; } /* read total number of datasets over all projects/crystals */ else if (ccp4_keymatch(key, "NDIF")) { ntotset = (int) token[1].value; if (debug) printf(" MtzGet: NDIF is %d\n",ntotset); } /* PROJECT line. Projects are not part of data structure, but may imply new crystal in hierarchy. */ else if (ccp4_keymatch(key, "PROJ")) { ++iiset; if (iiset >= MSETS) { if (ccp4_liberr_verbosity(-1)) printf("MtzGet: Maximum number of datasets exceeded! \n"); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return NULL; } strcpy(project,"dummy"); if (ntok > 2) strcpy(project,token[2].fullstring); strcpy(crystal,project); jxtal = -1; for (ixtal = 0; ixtal < nxtal; ++ixtal) { if (strcmp(projin[ixtal],project) == 0) { jxtal = ixtal; jxtalin[iiset] = jxtal; } } /* New project implies new crystal */ newproj=0; if (jxtal == -1) { ++nxtal; if (nxtal > MXTALS) { if (ccp4_liberr_verbosity(-1)) printf("MtzGet: Maximum number of crystals exceeded! \n"); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return NULL; } jxtalin[iiset]=nxtal-1; strcpy(projin[nxtal-1],project); strcpy(crysin[nxtal-1],crystal); newproj=1; } } /* CRYSTAL line. This will be missing in old files! If the line is present but incomplete we treat it as missing. */ else if (ccp4_keymatch(key, "CRYS")) { if (ntok >= 3) { strcpy(crystal,token[2].fullstring); if (newproj == 1) { strcpy(crysin[nxtal-1],crystal); } else { jxtal = -1; for (ixtal = 0; ixtal < nxtal; ++ixtal) { if (strcmp(crysin[ixtal],crystal) == 0) { jxtal = ixtal; jxtalin[iiset] = jxtal; } } if (jxtal == -1) { ++nxtal; if (nxtal > MXTALS) { if (ccp4_liberr_verbosity(-1)) printf("MtzGet: Maximum number of crystals exceeded! \n"); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return NULL; } jxtalin[iiset]=nxtal-1; strcpy(projin[nxtal-1],project); strcpy(crysin[nxtal-1],crystal); } } } } /* DATASET line. This should present for every dataset so use to increment dataset count. However, if this is the base dataset, don't increment as we already have it. */ else if (ccp4_keymatch(key, "DATA")) { if ( ntok <= 2 || (ntok > 2 && strcmp(token[2].fullstring,"HKL_base")) ) ++nset[jxtalin[iiset]]; } /* DCELL line. */ else if (ccp4_keymatch(key, "DCEL")) { for (i = 0; i < 6; ++i) cell[i] = token[i+2].value; /* If old crystal but cell dimensions differ, make new crystal. This is primarily for old files with no CRYSTAL cards. This test doesn't apply to base dataset. Chosen tolerance is arbitrary - there is no single correct value! */ if (jxtal > 0 && iiset > 0 && ccp4uc_cells_differ(cellin[jxtal], cell, cell_tolerance)) { if (debug) { printf(" MtzGet: Old crystal %d but new cell dimensions. \n",jxtal); for (i = 0; i < 6; ++i) printf(" %lf %lf \n",cellin[jxtal][i],cell[i]); } ++nxtal; if (nxtal > MXTALS) { if (ccp4_liberr_verbosity(-1)) printf("MtzGet: Maximum number of crystals exceeded! \n"); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return NULL; } strcpy(projin[nxtal-1],project); strcpy(crysin[nxtal-1],crystal); /* Try to make crystal name unique */ sprintf(crysin[nxtal-1]+strlen(crystal),"%d",nxtal); /* correct DATASET increment */ --nset[jxtalin[iiset]]; jxtalin[iiset]=nxtal-1; ++nset[jxtalin[iiset]]; } for (i = 0; i < 6; ++i) cellin[jxtalin[iiset]][i] = cell[i]; } istat = ccp4_file_readchar(filein, (uint8 *) hdrrec, MTZRECORDLENGTH); hdrrec[MTZRECORDLENGTH] = '\0'; ntok = ccp4_parser(hdrrec, MTZRECORDLENGTH, parser, iprint); } if (debug) { printf(" MtzGet: Found %d crystals \n",nxtal); for (i = 0; i < nxtal; ++i) printf(" MtzGet: Crystal %d has %d datasets \n",i+1,nset[i]); } if (debug) printf(" MtzGet: end of 1st pass \n"); /* Allocate memory for input MTZ file */ if (! (mtz = MtzMalloc(nxtal, nset))) { ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return NULL; } if (debug) printf(" MtzGet: created mtz \n"); mtz->filein = filein; mtz->nref_filein = nref; mtz->nref = nref; mtz->ncol_read = ntotcol; mtz->n_orig_bat = nbat; mtz->batch = NULL; mtz->refs_in_memory = read_refs; /* set up base dataset in case it is in not in file */ nset[0] = 0; for (i = 1; i < nxtal; ++i) nset[i] = -1; iiset = 0; strcpy(mtz->xtal[0]->pname,"HKL_base"); strcpy(mtz->xtal[0]->xname,"HKL_base"); mtz->xtal[0]->xtalid = 0; mtz->xtal[0]->cell[0] = 0.0; mtz->xtal[0]->set[0]->setid = 0; strcpy(mtz->xtal[0]->set[0]->dname,"HKL_base"); mtz->xtal[0]->set[0]->wavelength = 0.0; if (debug) printf(" MtzGet: starting 2nd pass \n"); /* 2nd Pass: Copy dataset information to MTZ structure. Position at top of header */ ccp4_file_setmode(filein,6); ccp4_file_seek(filein, (long) (hdrst-1), SEEK_SET); /* Read dataset information */ ccp4_file_setmode(filein,0); istat = ccp4_file_readchar(filein, (uint8 *) hdrrec, MTZRECORDLENGTH); hdrrec[MTZRECORDLENGTH] = '\0'; ntok = ccp4_parser(hdrrec, MTZRECORDLENGTH, parser, iprint); while (strncmp((strncpy(mkey,hdrrec,4)),"END",3) != 0) { if (strncmp (mkey, "PROJ",4) == 0) { ++iiset; strcpy(mtz->xtal[jxtalin[iiset]]->pname,projin[jxtalin[iiset]]); strcpy(mtz->xtal[jxtalin[iiset]]->xname,crysin[jxtalin[iiset]]); mtz->xtal[jxtalin[iiset]]->xtalid = jxtalin[iiset] + 1; } else if (strncmp (mkey, "DATA",4) == 0) { if ( ntok <= 2 || (ntok > 2 && strcmp(token[2].fullstring,"HKL_base")) ) { iset = (int) token[1].value; ++nset[jxtalin[iiset]]; /* Test that dataset exists (i.e. pointer is non-NULL) */ if (!mtz->xtal[jxtalin[iiset]]->set[nset[jxtalin[iiset]]]) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_NullDataset),"MtzGet",NULL); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return NULL; } mtz->xtal[jxtalin[iiset]]->set[nset[jxtalin[iiset]]]->setid = iset; strcpy(mtz->xtal[jxtalin[iiset]]->set[nset[jxtalin[iiset]]]->dname,"dummy"); if (ntok > 2) strcpy(mtz->xtal[jxtalin[iiset]]->set[nset[jxtalin[iiset]]]->dname, token[2].fullstring); } } else if (strncmp (mkey, "DCEL",4) == 0) { for (i = 0; i < 6; ++i) mtz->xtal[jxtalin[iiset]]->cell[i] = (float) token[i+2].value; } /* this keyword not in use yet */ else if (strncmp (mkey, "DRES",4) == 0) { for (i = 0; i < 3; ++i) { indhigh[i] = (int) token[i+2].value; indlow[i] = (int) token[i+5].value; } MtzHklcoeffs(mtz->xtal[jxtalin[iiset]]->cell, coefhkl); mtz->xtal[jxtalin[iiset]]->resmax = MtzInd2reso(indhigh, coefhkl); mtz->xtal[jxtalin[iiset]]->resmin = MtzInd2reso(indlow, coefhkl); } else if (strncmp (mkey, "DWAV",4) == 0) { mtz->xtal[jxtalin[iiset]]->set[nset[jxtalin[iiset]]]->wavelength = (float) token[2].value; } istat = ccp4_file_readchar(filein, (uint8 *) hdrrec, MTZRECORDLENGTH); if (istat == EOF) { /* Unexpected end-of-file */ ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_ReadFail),"MtzGet",NULL); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return NULL; } hdrrec[MTZRECORDLENGTH] = '\0'; ntok = ccp4_parser(hdrrec, MTZRECORDLENGTH, parser, iprint); } if (debug) printf(" MtzGet: end of 2nd pass \n"); /* 3rd Pass: Position at top of header */ ccp4_file_setmode(filein,6); ccp4_file_seek(filein, (long) (hdrst-1), SEEK_SET); icolin = -1; ccp4_file_setmode(filein,0); istat = ccp4_file_readchar(filein, (uint8 *) hdrrec, MTZRECORDLENGTH); hdrrec[MTZRECORDLENGTH] = '\0'; ntok = ccp4_parser(hdrrec, MTZRECORDLENGTH, parser, iprint); while (strncmp((strncpy(mkey,hdrrec,4)),"END",3) != 0) { if (debug) printf(" MtzGet: header line %s \n",hdrrec); if (strncmp (mkey, "VERS",4) == 0) { if (atoi(hdrrec+10) != MTZ_MAJOR_VERSN) { if (ccp4_liberr_verbosity(-1)) printf("Input MTZ file has major version %d and minor version %d \n", atoi(hdrrec+10),atoi(hdrrec+12)); ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_BadVersion),"MtzGet",NULL); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return(NULL); } if (atoi(hdrrec+12) != MTZ_MINOR_VERSN) { if (ccp4_liberr_verbosity(-1)) printf("Input MTZ file has major version %d and minor version %d \n", atoi(hdrrec+10),atoi(hdrrec+12)); ccp4_signal(CCP4_ERRLEVEL(2) | CMTZ_ERRNO(CMTZERR_DifferentVersion),"MtzGet",NULL); } } else if (strncmp (mkey, "TITL",4) == 0) { strncpy(mtz->title,hdrrec+6,70); length = 70; while ((--length >= 0) && (mtz->title[length] == ' ')); mtz->title[length+1] = '\0'; } else if (strncmp (mkey, "CELL",4) == 0) { for (i = 0; i < 6; ++i) totcell[i] = (float) token[i+1].value; for (i = 0; i < mtz->nxtal; ++i) { if (mtz->xtal[i]->cell[0] < 0.01) { mtz->xtal[i]->cell[0] = totcell[0]; mtz->xtal[i]->cell[1] = totcell[1]; mtz->xtal[i]->cell[2] = totcell[2]; mtz->xtal[i]->cell[3] = totcell[3]; mtz->xtal[i]->cell[4] = totcell[4]; mtz->xtal[i]->cell[5] = totcell[5]; } } } else if (strncmp (mkey, "SORT",4) == 0) { for (i = 0; i < 5; ++i) isort[i] = (int) token[i+1].value; } else if (strncmp (mkey, "SYMI",4) == 0) { /* Check that there are enough tokens in the header record */ if (ntok < 7) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_SYMINFIncomplete), "MtzGet", NULL); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return(NULL); } mtz->mtzsymm.nsym = (int) token[1].value; mtz->mtzsymm.nsymp = (int) token[2].value; mtz->mtzsymm.symtyp = token[3].fullstring[0]; mtz->mtzsymm.spcgrp = (int) token[4].value; strcpy(mtz->mtzsymm.spcgrpname,token[5].fullstring); strcpy(mtz->mtzsymm.pgname,token[6].fullstring); if (ntok > 7) { mtz->mtzsymm.spg_confidence = token[7].fullstring[0]; } else { mtz->mtzsymm.spg_confidence = 'X'; } } else if (strncmp (mkey, "SYMM",4) == 0) { symop_to_mat4(hdrrec+4,hdrrec+MTZRECORDLENGTH,mtz->mtzsymm.sym[isym++][0]); } else if (strncmp (mkey, "COLU",4) == 0) { /* Check that there are enough tokens in the header record */ if (ntok < 5) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_COLUMNIncomplete), "MtzGet", NULL); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return(NULL); } ++icolin; if (icolin >= MCOLUMNS) { if (ccp4_liberr_verbosity(-1)) printf("MtzGet: Maximum number of columns exceeded! \n"); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return NULL; } strcpy(label,token[1].fullstring); strcpy(type,token[2].fullstring); min = (float) token[3].value; max = (float) token[4].value; /* Dataset id for this column Very old MTZ files may not have this value */ if (ntok < 6) { if (!cset_warn) { if (ccp4_liberr_verbosity(-1)) { printf("\nWARNING: Dataset id missing from COLUMN records in MTZ header. \n"); printf("WARNING: Making default dataset assignments. \n"); } ccp4_signal(CCP4_ERRLEVEL(2) | CMTZ_ERRNO(CMTZERR_DatasetIncomplete), "MtzGet", NULL); cset_warn = 1; } icset = 0; } else { icset = (int) token[5].value; } /* Special trap for M/ISYM */ if (type[0] == 'Y' && strncmp (label,"M/ISYM",6) == 0) strcpy(label,"M_ISYM"); /* Find dataset corresponding to this column */ ixtal = 0; iset = 0; for (i = 0; i < mtz->nxtal; ++i) { for (j = 0; j < mtz->xtal[i]->nset; ++j) { if (mtz->xtal[i]->set[j]->setid == icset) { ixtal = i; iset = j; break; } } } /* Create column. */ newcol = MtzAddColumn(mtz, mtz->xtal[ixtal]->set[iset], label, type); newcol->source = icolin + 1; newcol->min = min; newcol->max = max; colin[icolin] = newcol; } else if (strncmp (mkey, "VALM",4) == 0) { strcpy(keyarg,token[1].fullstring); if (strncmp (keyarg, "NAN",3) == 0) { sprintf(mtz->mnf.amnf,"NAN"); } else { mtz->mnf.fmnf = (float) token[1].value; } } else if (strncmp (mkey, "RESO",4) == 0) { minres = (float) token[1].value; maxres = (float) token[2].value; for (i = 0; i < mtz->nxtal; ++i) { if (mtz->xtal[i]->resmax == 0.0) mtz->xtal[i]->resmax = maxres; if (mtz->xtal[i]->resmin == 100.0) mtz->xtal[i]->resmin = minres; } } istat = ccp4_file_readchar(filein, (uint8 *) hdrrec, MTZRECORDLENGTH); hdrrec[MTZRECORDLENGTH] = '\0'; ntok = ccp4_parser(hdrrec, MTZRECORDLENGTH, parser, iprint); } /* 4th Pass: Column group and source extensions and unknown keywords */ /* 4th Pass: Position at top of header */ ccp4_file_setmode(filein,6); ccp4_file_seek(filein, (long) (hdrst-1), SEEK_SET); ccp4_file_setmode(filein,0); istat = ccp4_file_readchar(filein, (uint8 *) hdrrec, MTZRECORDLENGTH); hdrrec[MTZRECORDLENGTH] = '\0'; ntok = ccp4_parser(hdrrec, MTZRECORDLENGTH, parser, iprint); while (strncmp((strncpy(mkey,hdrrec,4)),"END",3) != 0) { if (strncmp (mkey, "COLS",4) == 0 ) { strcpy(label,token[1].fullstring); /* Special trap for M/ISYM */ if (strncmp (label,"M/ISYM",6) == 0) strcpy(label,"M_ISYM"); icset = (int) token[3].value; newcol = NULL; for (i = 0; i < mtz->nxtal; ++i) { for (j = 0; j < mtz->xtal[i]->nset; ++j) { if (mtz->xtal[i]->set[j]->setid == icset) { for ( k = 0; k < mtz->xtal[i]->set[j]->ncol; k++ ) { if (strcmp(mtz->xtal[i]->set[j]->col[k]->label,label) == 0) { newcol = mtz->xtal[i]->set[j]->col[k]; break; } } } } } if ( newcol == NULL ) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_ColSourceError), "MtzGet", NULL); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return(NULL); } strncpy( newcol->colsource, token[2].fullstring, 36 ); newcol->colsource[36] = '\0'; } else if (strncmp (mkey, "COLG",4) == 0 ) { strcpy(label,token[1].fullstring); /* Special trap for M/ISYM */ if (strncmp (label,"M/ISYM",6) == 0) strcpy(label,"M_ISYM"); icset = (int) token[5].value; newcol = NULL; for (i = 0; i < mtz->nxtal; ++i) { for (j = 0; j < mtz->xtal[i]->nset; ++j) { if (mtz->xtal[i]->set[j]->setid == icset) { for ( k = 0; k < mtz->xtal[i]->set[j]->ncol; k++ ) { if (strcmp(mtz->xtal[i]->set[j]->col[k]->label,label) == 0) { newcol = mtz->xtal[i]->set[j]->col[k]; break; } } } } } if ( newcol == NULL ) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_ColGroupError), "MtzGet", NULL); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return(NULL); } strncpy( newcol->grpname, token[2].fullstring, 30 ); newcol->grpname[30] = '\0'; strncpy( newcol->grptype, token[3].fullstring, 4 ); newcol->grptype[4] = '\0'; newcol->grpposn = (int) token[4].value; } istat = ccp4_file_readchar(filein, (uint8 *) hdrrec, MTZRECORDLENGTH); hdrrec[MTZRECORDLENGTH] = '\0'; ntok = ccp4_parser(hdrrec, MTZRECORDLENGTH, parser, iprint); } /* 5th Pass: Deal with unknown headers */ /* 5th Pass: Position at top of header */ ccp4_file_setmode(filein,6); ccp4_file_seek(filein, (long) (hdrst-1), SEEK_SET); ccp4_file_setmode(filein,0); istat = ccp4_file_readchar(filein, (uint8 *) hdrrec, MTZRECORDLENGTH); hdrrec[MTZRECORDLENGTH] = '\0'; ntok = ccp4_parser(hdrrec, MTZRECORDLENGTH, parser, iprint); while (strncmp((strncpy(mkey,hdrrec,4)),"END",3) != 0) { for ( i = 0; i < n_known_headers; ++i ) if (strncmp (mkey,known_headers[i],4) == 0 ) break; if ( i == n_known_headers ) { mtz->unknown_headers = ccp4_utils_realloc( mtz->unknown_headers, mtz->n_unknown_headers*MTZRECORDLENGTH+MTZRECORDLENGTH ); // if null, malloc memcpy( mtz->unknown_headers+mtz->n_unknown_headers*MTZRECORDLENGTH, hdrrec, MTZRECORDLENGTH ); mtz->n_unknown_headers++; } istat = ccp4_file_readchar(filein, (uint8 *) hdrrec, MTZRECORDLENGTH); hdrrec[MTZRECORDLENGTH] = '\0'; ntok = ccp4_parser(hdrrec, MTZRECORDLENGTH, parser, iprint); } /* copy sort order */ for (i = 0; i < 5; ++i) { if (isort[i] > 0) mtz->order[i] = colin[isort[i]-1]; } if (debug) printf(" MtzGet: end of 3rd pass \n"); /* Now read history if any */ istat = ccp4_file_readchar(filein, (uint8 *) hdrrec, MTZRECORDLENGTH); hdrrec[MTZRECORDLENGTH] = '\0'; ntok = ccp4_parser(hdrrec, MTZRECORDLENGTH, parser, iprint); while (!ccp4_keymatch(key,"MTZE")) { if (ccp4_keymatch(key, "MTZH")) { nhist = (int) token[1].value; /* allocate memory for nhist lines */ mtz->hist = MtzCallocHist(nhist); mtz->histlines = nhist; for (i = 0; i < nhist; ++i) { istat = ccp4_file_readchar(filein, (uint8 *) hdrrec, MTZRECORDLENGTH); strncpy(mtz->hist + MTZRECORDLENGTH*i,hdrrec,MTZRECORDLENGTH); } } else if (ccp4_keymatch(key, "MTZB")) { for (ibat = 0; ibat < nbat; ++ibat) { istat = ccp4_file_readchar(filein, (uint8 *) hdrrec, MTZRECORDLENGTH); hdrrec[MTZRECORDLENGTH] = '\0'; ntok = ccp4_parser(hdrrec, MTZRECORDLENGTH, parser, iprint); if (!ccp4_keymatch(key, "BH")) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_BadBatchHeader), "MtzGet", NULL); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return(NULL); } /* allocate memory for this batch */ if (ibat == 0) { mtz->batch = MtzMallocBatch(); batch = mtz->batch; } else { batch->next = MtzMallocBatch(); batch = batch->next; } batch->next = NULL; batch->num = (int) token[1].value; /* nwords = (int) token[2].value; */ nintegers = (int) token[3].value; nreals = (int) token[4].value; /* read batch title */ istat = ccp4_file_readchar(filein, (uint8 *) hdrrec, MTZRECORDLENGTH); strncpy(batch->title,hdrrec+6,70); batch->title[70]='\0'; ccp4_file_setmode(filein,6); istat = ccp4_file_read(filein, (uint8 *) intbuf, nintegers); ccp4_file_setmode(filein,2); istat = ccp4_file_read(filein, (uint8 *) fltbuf, nreals); MtzArrayToBatch(intbuf, fltbuf, batch); ccp4_file_setmode(filein,0); istat = ccp4_file_readchar(filein, (uint8 *) hdrrec, MTZRECORDLENGTH); hdrrec[MTZRECORDLENGTH] = '\0'; ntok = ccp4_parser(hdrrec, MTZRECORDLENGTH, parser, iprint); if (ntok == 4) { strcpy(batch->gonlab[0],token[1].fullstring); strcpy(batch->gonlab[1],token[2].fullstring); strcpy(batch->gonlab[2],token[3].fullstring); batch->gonlab[0][8] = batch->gonlab[1][8] = batch->gonlab[2][8] = '\0'; } else if (ntok == 2) { strcpy(batch->gonlab[0],token[1].fullstring); batch->gonlab[0][8] = '\0'; batch->gonlab[1][0] = batch->gonlab[2][0] = '\0'; } else { batch->gonlab[0][0] = batch->gonlab[1][0] = batch->gonlab[2][0] = '\0'; } } } istat = ccp4_file_readchar(filein, (uint8 *) hdrrec, MTZRECORDLENGTH); hdrrec[MTZRECORDLENGTH] = '\0'; ntok = ccp4_parser(hdrrec, MTZRECORDLENGTH, parser, iprint); } /* Finished with the parser array */ ccp4_parse_end(parser); if (debug) printf(" MtzGet: end of batch pass \n"); /* Read XML datablock */ xmllen = ccp4_file_length(filein) - ccp4_file_tell(filein); if ( xmllen > 0 ) { mtz->xml = (char *)ccp4_utils_malloc( xmllen+1 ); if ( mtz->xml != NULL ) { istat = ccp4_file_readchar(filein, (uint8 *) mtz->xml, xmllen); mtz->xml[xmllen] = '\0'; } } /* Position at start of reflections */ ccp4_file_setmode(filein,6); ccp4_file_seek(filein, SIZE1, SEEK_SET); if (read_refs) { refldata = (float *) ccp4_utils_malloc(ntotcol*sizeof(float)); /* Read all reflections into memory - make this optional? */ for (i = 0; i < mtz->nref_filein; ++i) { MtzRrefl(filein, ntotcol, refldata); for (j = 0; j < ntotcol; ++j) colin[j]->ref[i] = refldata[j]; } free(refldata); /* Recalculate resolution limits */ /* Find dataset of indices */ MtzFindInd(mtz,&ind_xtal,&ind_set,ind_col); for (i = 0; i < mtz->nxtal; ++i) { MtzHklcoeffs(mtz->xtal[i]->cell, coefhkl); for (j = 0; j < mtz->nref; ++j) { indhigh[0] = (int) mtz->xtal[ind_xtal]->set[ind_set]->col[ind_col[0]]->ref[j]; indhigh[1] = (int) mtz->xtal[ind_xtal]->set[ind_set]->col[ind_col[1]]->ref[j]; indhigh[2] = (int) mtz->xtal[ind_xtal]->set[ind_set]->col[ind_col[2]]->ref[j]; maxres = MtzInd2reso(indhigh, coefhkl); if (maxres > mtz->xtal[i]->resmax) mtz->xtal[i]->resmax = maxres; if (maxres < mtz->xtal[i]->resmin) mtz->xtal[i]->resmin = maxres; } } /* And close the mtz file: */ ccp4_file_close(filein); mtz->filein = NULL; } free(filename); return(mtz);} int MtzArrayToBatch(const int *intbuf, const float *fltbuf, MTZBAT *batch) { int i; batch->iortyp = intbuf[3]; for (i = 0; i < 6; ++i) batch->lbcell[i] = intbuf[4 + i]; batch->misflg = intbuf[10]; batch->jumpax = intbuf[11]; batch->ncryst = intbuf[12]; batch->lcrflg = intbuf[13]; batch->ldtype = intbuf[14]; batch->jsaxs = intbuf[15]; batch->nbscal = intbuf[16]; batch->ngonax = intbuf[17]; batch->lbmflg = intbuf[18]; batch->ndet = intbuf[19]; batch->nbsetid = intbuf[20]; for (i = 0; i < 6; ++i) batch->cell[i] = fltbuf[i]; for (i = 0; i < 9; ++i) batch->umat[i] = fltbuf[6 + i]; for (i = 0; i < 3; ++i) batch->phixyz[0][i] = fltbuf[15 + i]; for (i = 0; i < 3; ++i) batch->phixyz[1][i] = fltbuf[18 + i]; for (i = 0; i < 12; ++i) batch->crydat[i] = fltbuf[21 + i]; for (i = 0; i < 3; ++i) batch->datum[i] = fltbuf[33 + i]; batch->phistt = fltbuf[36]; batch->phiend = fltbuf[37]; for (i = 0; i < 3; ++i) batch->scanax[i] = fltbuf[38 + i]; batch->time1 = fltbuf[41]; batch->time2 = fltbuf[42]; batch->bscale = fltbuf[43]; batch->bbfac = fltbuf[44]; batch->sdbscale = fltbuf[45]; batch->sdbfac = fltbuf[46]; batch->phirange = fltbuf[47]; for (i = 0; i < 3; ++i) batch->e1[i] = fltbuf[59 + i]; for (i = 0; i < 3; ++i) batch->e2[i] = fltbuf[62 + i]; for (i = 0; i < 3; ++i) batch->e3[i] = fltbuf[65 + i]; for (i = 0; i < 3; ++i) batch->source[i] = fltbuf[80 + i]; for (i = 0; i < 3; ++i) batch->so[i] = fltbuf[83 + i]; batch->alambd = fltbuf[86]; batch->delamb = fltbuf[87]; batch->delcor = fltbuf[88]; batch->divhd = fltbuf[89]; batch->divvd = fltbuf[90]; for (i = 0; i < 2; ++i) { batch->dx[i] = fltbuf[111 + (i * 6)]; batch->theta[i] = fltbuf[112 + (i * 6)]; batch->detlm[i][0][0] = fltbuf[113 + (i * 6)]; batch->detlm[i][0][1] = fltbuf[114 + (i * 6)]; batch->detlm[i][1][0] = fltbuf[115 + (i * 6)]; batch->detlm[i][1][1] = fltbuf[116 + (i * 6)];} return 1; } int MtzRrefl(CCP4File *filein, int ncol, float *refldata) { int istat; ccp4_file_setmode(filein,2); istat = ccp4_file_read(filein, (uint8 *) refldata, ncol); /* This will return EOF if end-of-file is reached. But by then you will have read the MTZ file header, so not so useful. */ return istat; } int MtzFindInd(const MTZ *mtz, int *ind_xtal, int *ind_set, int ind_col[3]) { int i,j,k; /* default to first 3 columns of 1st datset */ *ind_xtal = 0; *ind_set = 0; ind_col[0] = 0; ind_col[1] = 1; ind_col[2] = 2; for (i = 0; i < mtz->nxtal; ++i) for (j = 0; j < mtz->xtal[i]->nset; ++j) for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) { if (mtz->xtal[i]->set[j]->col[k]->label[0] == 'H' && mtz->xtal[i]->set[j]->col[k]->type[0] == 'H') { *ind_xtal = i; *ind_set = j; ind_col[0] = k; } if (mtz->xtal[i]->set[j]->col[k]->label[0] == 'K' && mtz->xtal[i]->set[j]->col[k]->type[0] == 'H') ind_col[1] = k; if (mtz->xtal[i]->set[j]->col[k]->label[0] == 'L' && mtz->xtal[i]->set[j]->col[k]->type[0] == 'H') ind_col[2] = k; } return 1; } float MtzInd2reso(const int in[3], const double coefhkl[6]) { int ih,ik,il; float reso; ih = in[0]; ik = in[1]; il = in[2]; reso = (float) 4.0 * (ih*ih*coefhkl[0] + ih*ik*coefhkl[1] + ih*il*coefhkl[2] + ik*ik*coefhkl[3] + ik*il*coefhkl[4] + il*il*coefhkl[5]); return reso; } int MtzHklcoeffs(const float cell[6], double coefhkl[6]) { /* generate coefhkl coefficients from given cell parameters */ int i; double alpha,beta,gamma,degtorad,denom; double ax,bx,by,cx,cy,cz; double axst,ayst,azst,byst,bzst,czst; /* sanity clause (but there ain't no sanity clause!) */ for (i = 0; i < 6; ++i) coefhkl[i] = 0.0; for (i = 0; i < 6; ++i) if (cell[i] < 0.001) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_Cellerr),"MtzHklcoeffs",NULL); return 0; } degtorad = atan(1.0)/45.0; alpha = degtorad*cell[3]; beta = degtorad*cell[4]; gamma = degtorad*cell[5]; /* orthogonal frame for calculation a along x, b in x-y plane */ ax = cell[0]; bx = cell[1] * cos(gamma); by = cell[1] * sin(gamma); cx = cell[2] * cos(beta); cy = (cell[1]*cell[2]*cos(alpha) - bx*cx)/by; cz = sqrt(cell[2]*cell[2] - cx*cx - cy*cy); /* find reciprocal vectors in orthogonal frame */ denom = ax*by*cz; axst = 1.0/ax; ayst = -bx*cz/denom; azst = (bx*cy - by*cx)/denom; byst = 1.0/by; bzst = -ax*cy/denom; czst = 1.0/cz; coefhkl[0] = 0.25*(axst*axst + ayst*ayst + azst*azst); coefhkl[1] = 0.5*(ayst*byst + azst*bzst); coefhkl[2] = 0.5*(azst*czst); coefhkl[3] = 0.25*(byst*byst + bzst*bzst); coefhkl[4] = 0.5*(bzst*czst); coefhkl[5] = 0.25*(czst*czst); return 1; } int ccp4_lrtitl(const MTZ *mtz, char *title) { int length; length = (int) strlen(strcpy(title, mtz->title)); if (length > 0) { while ((--length >= 0) && (title[length] == ' ')); ++length; } return(length); } int ccp4_lrhist(const MTZ *mtz, char history[][MTZRECORDLENGTH], int nlines) { int i,nhist; if (nlines < mtz->histlines) nhist = nlines; else nhist = mtz->histlines; for (i = 0; i < nhist; ++i) { strncpy(history[i],mtz->hist + MTZRECORDLENGTH*i,MTZRECORDLENGTH); } return nhist; } int ccp4_lrsort(const MTZ *mtz, int isort[5]) { int i,j,k,l,icol; icol = 0; for (i = 0; i < 5; ++i) isort[i] = 0; /* Loop over crystals */ for (i = 0; i < mtz->nxtal; ++i) { /* Loop over datasets for each crystal */ for (j = 0; j < mtz->xtal[i]->nset; ++j) { /* Loop over columns for each dataset */ for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) { ++icol; for (l = 0; l < 5; ++l) { if (mtz->order[l] == mtz->xtal[i]->set[j]->col[k]) isort[l] = icol; } } } } return 1; } int ccp4_lrbats(const MTZ *mtz, int *nbatx, int batchx[]) { int i=0; MTZBAT *batch; *nbatx = mtz->n_orig_bat; batch = mtz->batch; while (batch != NULL) { batchx[i++] = batch->num; batch = batch->next; } return i; } void MtzDebugHierarchy(const MTZ *mtz) { int i,j,k; if (mtz->filein) printf("MtzDebugHierarchy: input file = %s \n",mtz->filein->name); if (mtz->fileout) printf("MtzDebugHierarchy: output file = %s \n",mtz->fileout->name); printf("MtzDebugHierarchy: nxtal = %d \n",mtz->nxtal); for (i = 0; i < mtz->nxtal; ++i) { printf("MtzDebugHierarchy: xtal = %s, cell = %f %f %f %f %f %f \n", mtz->xtal[i]->xname, mtz->xtal[i]->cell[0],mtz->xtal[i]->cell[1],mtz->xtal[i]->cell[2], mtz->xtal[i]->cell[3],mtz->xtal[i]->cell[4],mtz->xtal[i]->cell[5]); printf("MtzDebugHierarchy: xtal = %s, nset = %d \n",mtz->xtal[i]->xname, mtz->xtal[i]->nset); for (j = 0; j < mtz->xtal[i]->nset; ++j) { printf("MtzDebugHierarchy: xtal = %s, set = %s, setid = %d, ncol = %d \n", mtz->xtal[i]->xname,mtz->xtal[i]->set[j]->dname, mtz->xtal[i]->set[j]->setid,mtz->xtal[i]->set[j]->ncol); for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) { printf("MtzDebugHierarchy: col = %s (in: %d) (out: %d) \n", mtz->xtal[i]->set[j]->col[k]->label, mtz->xtal[i]->set[j]->col[k]->source, mtz->xtal[i]->set[j]->col[k]->active); } } } } /* List of column information: label, type, dataset. Returns number of columns in current structure. */ int MtzListColumn(const MTZ *mtz, char clabs[][31], char ctyps[][3], int csetid[]) { int i,j,k,icol=0; /* Loop over crystals */ for (i = 0; i < mtz->nxtal; ++i) { /* Loop over datasets for each crystal */ for (j = 0; j < mtz->xtal[i]->nset; ++j) { /* Loop over columns for each dataset */ for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) { if (strcmp(mtz->xtal[i]->set[j]->col[k]->type,"Y") == 0 && strcmp(mtz->xtal[i]->set[j]->col[k]->label,"M_ISYM") == 0) { strcpy(clabs[icol],"M/ISYM"); } else { strcpy(clabs[icol],mtz->xtal[i]->set[j]->col[k]->label); } strcpy(ctyps[icol],mtz->xtal[i]->set[j]->col[k]->type); csetid[icol] = mtz->xtal[i]->set[j]->setid; ++icol; } } } return icol; } /* List of column information from input file: label, type, dataset. Returns number of columns in input file. */ int MtzListInputColumn(const MTZ *mtz, char clabs[][31], char ctyps[][3], int csetid[]) { int i,j,k,colin,icol=0; /* Loop over crystals */ for (i = 0; i < mtz->nxtal; ++i) { /* Loop over datasets for each crystal */ for (j = 0; j < mtz->xtal[i]->nset; ++j) { /* Loop over columns for each dataset */ for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) { if ((colin = mtz->xtal[i]->set[j]->col[k]->source) != 0) { if (strcmp(mtz->xtal[i]->set[j]->col[k]->type,"Y") == 0 && strcmp(mtz->xtal[i]->set[j]->col[k]->label,"M_ISYM") == 0) { strcpy(clabs[colin - 1],"M/ISYM"); } else { strcpy(clabs[colin - 1],mtz->xtal[i]->set[j]->col[k]->label); } strcpy(ctyps[colin - 1],mtz->xtal[i]->set[j]->col[k]->type); csetid[colin - 1] = mtz->xtal[i]->set[j]->setid; ++icol; } } } } return icol; } int ccp4_lrcell(const MTZXTAL *xtl, float cell[]) { int i; for (i = 0; i < 6; ++i) { cell[i] = xtl->cell[i]; } return 1; } int MtzResLimits(const MTZ *mtz, float *minres, float *maxres) { int i; *maxres = 0.0; *minres = 100.0; /* Loop over crystals */ for (i = 0; i < mtz->nxtal; ++i) { if (mtz->xtal[i]->resmax > *maxres) *maxres = mtz->xtal[i]->resmax; if (mtz->xtal[i]->resmin < *minres) *minres = mtz->xtal[i]->resmin; } return 1; } int ccp4_lrsymi(const MTZ *mtz, int *nsympx, char *ltypex, int *nspgrx, char *spgrnx, char *pgnamx) { char spgconf_temp[2]; return ccp4_lrsymi_c(mtz,nsympx,ltypex,nspgrx,spgrnx,pgnamx,spgconf_temp); } int ccp4_lrsymi_c(const MTZ *mtz, int *nsympx, char *ltypex, int *nspgrx, char *spgrnx, char *pgnamx, char *spgconf) { *nsympx = mtz->mtzsymm.nsymp; *nspgrx = mtz->mtzsymm.spcgrp; ltypex[0] = mtz->mtzsymm.symtyp; ltypex[1] = '\0'; strcpy(spgrnx,mtz->mtzsymm.spcgrpname); strcpy(pgnamx,mtz->mtzsymm.pgname); spgconf[0] = mtz->mtzsymm.spg_confidence; spgconf[1] = '\0'; return *nspgrx; } int MtzSpacegroupNumber(const MTZ *mtz) /* get the spacegroup number (likely CCP4 convention) */ { if (!mtz) return 0; return mtz->mtzsymm.spcgrp; } int ccp4_lrsymm(const MTZ *mtz, int *nsymx, float rsymx[192][4][4]) { int i,j,k; *nsymx = mtz->mtzsymm.nsym; for (i = 0; i < *nsymx; ++i) { for (j = 0; j < 4; ++j) { for (k = 0; k < 4; ++k) { rsymx[i][j][k] = mtz->mtzsymm.sym[i][j][k]; } } } return *nsymx; } int MtzParseLabin(char *labin_line, const char prog_labels[][31], const int nlprgi, char user_labels[][2][31]) { int i,j,imatch,nlabels=0,err=0; char label1[31],label2[31]; /* For cparser */ CCP4PARSERARRAY *parser=NULL; CCP4PARSERTOKEN *token=NULL; char *key; int ntok,iprint=0; parser = ccp4_parse_start(strlen(labin_line)); if (parser == NULL) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_ParserFail),"MtzParseLabin",NULL); return -1; } /* Set some convenient pointers to members of the parser array */ key = parser->keyword; token = parser->token; ntok = ccp4_parser(labin_line, strlen(labin_line), parser, iprint); if (ccp4_keymatch(key,"LABI")) { if (iprint) printf("Interpreting LABIN line.\n"); } else if (ccp4_keymatch(key,"LABO")) { if (iprint) printf("Interpreting LABOUT line.\n"); } else if (ccp4_keymatch(key,"COMP")) { if (iprint) printf("Interpreting COMPLETE line (freerflag).\n"); } else { printf("Warning in MtzParseLabin: Input is not LABIN or LABOUT line !!\n"); } /* initialise user labels */ for (j = 0; j < nlprgi; ++j) { strcpy(user_labels[j][0],""); strcpy(user_labels[j][1],""); } for (i = 1; i < ntok; i += 2) { strcpy(label1,token[i].fullstring); if (strlen(label1)>30) { printf("MtzParseLabin: labels cannot be longer than 30 characters: \"%s\"\n",label1); err++; break; } /* Trap against trying to access tokens that don't exist */ if (i+1 < ntok) { strcpy(label2,token[i+1].fullstring); if (strlen(label2)>30) { printf("MtzParseLabin: labels cannot be longer than 30 characters: \"%s\"\n",label2); err++; break; } /* check first label against program labels */ imatch = 0; for (j = 0; j < nlprgi; ++j) { if (strcmp(label1,prog_labels[j]) == 0) { strcpy(user_labels[j][0],label1); strcpy(user_labels[j][1],label2); imatch = 1; ++nlabels; break; } } if (imatch == 0) { /* check second label against program labels */ for (j = 0; j < nlprgi; ++j) { if (strcmp(label2,prog_labels[j]) == 0) { strcpy(user_labels[j][0],label2); strcpy(user_labels[j][1],label1); imatch = 1; ++nlabels; break; } } } } else { printf("MtzParseLabin: run out of labels trying to match \"%s\"\n",label1); /* Stop here - there are no more labels to process */ err++; break; } if (imatch == 0) { /* no match */ printf("MtzParseLabin: neither label recognised: %s %s \n",label1,label2); err++; } } /* Finished with the parser array */ ccp4_parse_end(parser); return err ? -1 : nlabels; } MTZCOL **ccp4_lrassn(const MTZ *mtz, const char labels[][31], const int nlabels, char types[][3]) { int ilab; char label[31]; MTZCOL *col, **lookup; lookup = (MTZCOL **) ccp4_utils_malloc(nlabels*sizeof(MTZCOL *)); /* Loop over labels */ for (ilab = 0; ilab < nlabels; ++ilab) { strcpy(label,labels[ilab]); /* column not assigned */ if (label[0] == '\0') { lookup[ilab] = NULL; } else { /* Special trap for M/ISYM */ if (strcmp(types[ilab],"Y") == 0 && strcmp(label,"M/ISYM") == 0) strcpy(label,"M_ISYM"); col = MtzColLookup(mtz,label); if (col != NULL) { /* if requested type is blank, return actual type */ if (!strcmp(types[ilab],"")) { if (strcmp(col->type,"")) { strcpy(types[ilab],col->type); } else { strcpy(types[ilab],"R"); } /* check requested column type against file type. */ } else if (strncmp(col->type,types[ilab],1)) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_ColTypeMismatch),"ccp4_lrassn",NULL); printf(" From ccp4_lrassn: expected type %s does not match file type %s for column %s\n", types[ilab],col->type,col->label); if (!strcmp(types[ilab],"R") || !strcmp(types[ilab],"I")) printf(" (This may be intended for generic types R/I.) \n"); } } lookup[ilab] = col; } } return lookup; } int ccp4_lridx(const MTZ *mtz, const MTZSET *set, char crystal_name[64], char dataset_name[64], char project_name[64], int *isets, float datcell[6], float *datwave) { int i; MTZXTAL *xtl; /* find which crystal this dataset belongs to */ xtl = MtzSetXtal(mtz, set); /* copy crystal and dataset information */ strncpy(crystal_name,xtl->xname,63); crystal_name[63] = '\0'; strncpy(dataset_name,set->dname,63); dataset_name[63] = '\0'; strncpy(project_name,xtl->pname,63); project_name[63] = '\0'; *isets = set->setid; for (i = 0; i < 6; ++i) datcell[i] = xtl->cell[i]; *datwave = set->wavelength; return 1; } /* Return MTZ record in file order */ int ccp4_lrrefl(const MTZ *mtz, float *resol, float adata[], int logmss[], int iref) { int i,j,k; int ind[3],ixtal; unsigned int colin; float *refldata; double coefhkl[6]; /* If we are past the last reflection, indicate this with return value. */ if (iref > mtz->nref_filein) return 1; /* If reflections not in memory, read next record from file. */ if (!mtz->refs_in_memory) { refldata = (float *) ccp4_utils_malloc(mtz->ncol_read*sizeof(float)); if (MtzRrefl( mtz->filein, mtz->ncol_read, refldata) == EOF) { free(refldata); return 1; } } /* Loop over all columns in the MTZ struct, and select those which derive from the input file. */ for (i = 0; i < mtz->nxtal; ++i) { for (j = 0; j < mtz->xtal[i]->nset; ++j) { for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) { if ((colin = mtz->xtal[i]->set[j]->col[k]->source) != 0) { if (mtz->refs_in_memory) { adata[colin - 1] = mtz->xtal[i]->set[j]->col[k]->ref[iref-1]; } else { adata[colin - 1] = refldata[colin - 1]; } logmss[colin - 1] = ccp4_ismnf(mtz, adata[colin - 1]); if (mtz->xtal[i]->set[j]->col[k]->type[0] == 'H') { if (strcmp(mtz->xtal[i]->set[j]->col[k]->label,"H") == 0) ind[0] = (int) adata[colin - 1]; if (strcmp(mtz->xtal[i]->set[j]->col[k]->label,"K") == 0) ind[1] = (int) adata[colin - 1]; if (strcmp(mtz->xtal[i]->set[j]->col[k]->label,"L") == 0) ind[2] = (int) adata[colin - 1]; } } } } } /* calculate resolution of this reflection, based on cell of first crystal with non-zero cell dimensions */ for (ixtal = 0; ixtal < mtz->nxtal; ++ixtal) if (mtz->xtal[ixtal]->cell[0] > 0.001) { MtzHklcoeffs(mtz->xtal[ixtal]->cell, coefhkl); break; } *resol = MtzInd2reso(ind, coefhkl); /* kludge taken from mtzlib.f */ if (*resol > mtz->xtal[ixtal]->resmax) *resol = mtz->xtal[ixtal]->resmax; if (*resol < mtz->xtal[ixtal]->resmin) *resol = mtz->xtal[ixtal]->resmin; free(refldata); return 0; } /* Return MTZ record in lookup order */ int ccp4_lrreff(const MTZ *mtz, float *resol, float adata[], int logmss[], const MTZCOL *lookup[], const int ncols, const int iref) { int icol,l; int ind[3],ixtal,ind_xtal,ind_set,ind_col[3]; unsigned int colin; float *refldata; double coefhkl[6]; union float_uint_uchar uf; /* If we are past the last reflection, indicate this with return value. */ if (iref > mtz->nref_filein) return 1; /* If reflections not in memory, read next record from file. */ if (!mtz->refs_in_memory) { refldata = (float *) ccp4_utils_malloc(mtz->ncol_read*sizeof(float)); if (MtzRrefl( mtz->filein, mtz->ncol_read, refldata) == EOF) { free(refldata); return 1; } } if (strncmp (mtz->mnf.amnf,"NAN",3) == 0) { uf = ccp4_nan(); } else { uf.f = mtz->mnf.fmnf; } /* loop over columns requested in lookup array. */ for (icol=0; icol < ncols; icol++) { logmss[icol] = 1; if (lookup[icol]) { if (mtz->refs_in_memory) { adata[icol] = lookup[icol]->ref[iref-1]; logmss[icol] = ccp4_ismnf(mtz, adata[icol]); } else { if ((colin = lookup[icol]->source) != 0) { adata[icol] = refldata[colin - 1]; logmss[icol] = ccp4_ismnf(mtz, adata[icol]); } else { adata[icol] = uf.f; logmss[icol] = 1; } } } } /* Check if HKL are first 3 columns */ if (lookup[0]->type[0] == 'H' && lookup[1]->type[0] == 'H' && lookup[2]->type[0] == 'H') { ind[0] = (int) adata[0]; ind[1] = (int) adata[1]; ind[2] = (int) adata[2]; } else { MtzFindInd(mtz,&ind_xtal,&ind_set,ind_col); for (l = 0; l < ncols; ++l) { if (lookup[l] == mtz->xtal[ind_xtal]->set[ind_set]->col[ind_col[0]]) ind[0] = (int) adata[l]; if (lookup[l] == mtz->xtal[ind_xtal]->set[ind_set]->col[ind_col[1]]) ind[1] = (int) adata[l]; if (lookup[l] == mtz->xtal[ind_xtal]->set[ind_set]->col[ind_col[2]]) ind[2] = (int) adata[l]; } } /* calculate resolution of this reflection, based on cell of first crystal with non-zero cell dimensions */ for (ixtal = 0; ixtal < mtz->nxtal; ++ixtal) if (mtz->xtal[ixtal]->cell[0] > 0.001) { MtzHklcoeffs(mtz->xtal[ixtal]->cell, coefhkl); break; } *resol = MtzInd2reso(ind, coefhkl); /* kludge taken from mtzlib.f */ if (*resol > mtz->xtal[ixtal]->resmax) *resol = mtz->xtal[ixtal]->resmax; if (*resol < mtz->xtal[ixtal]->resmin) *resol = mtz->xtal[ixtal]->resmin; free(refldata); return 0; } void MtzRewdInput(MTZ *mtz) { if (mtz->filein) { ccp4_file_seek(mtz->filein, SIZE1, SEEK_SET); } else { printf("MtzRewdInput: No associated file. Was MtzGet called with read_refs option?\n"); } } int ccp4_ismnf(const MTZ *mtz, const float datum) { if (strncmp (mtz->mnf.amnf,"NAN",3) == 0) { return ccp4_utils_isnan((union float_uint_uchar *) &datum); } else { if (datum == mtz->mnf.fmnf) return 1; } return 0; } int ccp4_lhprt(const MTZ *mtz, int iprint) { int i,j,k,numbat,isort[5],base_set_exists=0; float maxres=0.0,minres=100.0; char buffer[MTZRECORDLENGTH+1],symline[81]; MTZSET *baseset=NULL; if (iprint <= 0) return 2; printf(" * Title:\n\n"); printf(" %s\n\n",mtz->title); if ((baseset = MtzSetLookup(mtz,"HKL_base/HKL_base")) != NULL) { if ( MtzNumActiveColsInSet(baseset) || MtzNbatchesInSet(mtz,baseset) ) { printf(" * Base dataset:\n\n"); printf(" %8d %s\n",baseset->setid,"HKL_base"); printf(" %s\n","HKL_base"); printf(" %s\n","HKL_base"); base_set_exists=1; } } printf("\n * Number of Datasets = %d\n\n",MtzNumActiveSet(mtz)-base_set_exists); printf(" * Dataset ID, project/crystal/dataset names, cell dimensions, wavelength:\n\n"); /* Loop over crystals */ for (i = 0; i < mtz->nxtal; ++i) { /* Loop over datasets for each crystal */ for (j = 0; j < mtz->xtal[i]->nset; ++j) { /* is this the base dataset? */ if (mtz->xtal[i]->set[j] == baseset) continue; /* check if dataset contains any active columns */ if ( (MtzNumActiveColsInSet(mtz->xtal[i]->set[j]) == 0) && (MtzNbatchesInSet(mtz,mtz->xtal[i]->set[j]) == 0) ) continue; printf(" %8d %s\n",mtz->xtal[i]->set[j]->setid,mtz->xtal[i]->pname); printf(" %s\n",mtz->xtal[i]->xname); printf(" %s\n",mtz->xtal[i]->set[j]->dname); printf(" %10.4f%10.4f%10.4f%10.4f%10.4f%10.4f\n", mtz->xtal[i]->cell[0],mtz->xtal[i]->cell[1],mtz->xtal[i]->cell[2], mtz->xtal[i]->cell[3],mtz->xtal[i]->cell[4],mtz->xtal[i]->cell[5]); printf(" %10.5f\n",mtz->xtal[i]->set[j]->wavelength); } } printf("\n * Number of Columns = %d\n\n",MtzNumActiveCol(mtz)); printf(" * Number of Reflections = %d\n\n",mtz->nref); if (strncmp (mtz->mnf.amnf,"NAN",3) == 0) { printf(" * Missing value set to NaN in input mtz file\n\n"); } else { printf(" * Missing value set to %f in input mtz file\n\n",mtz->mnf.fmnf); } /* if new batch headers have been written, lose the old ones */ if (MtzNbat(mtz) > mtz->n_orig_bat) { numbat = MtzNbat(mtz) - mtz->n_orig_bat; } else { numbat = mtz->n_orig_bat; } if (numbat > 0) printf(" * Number of Batches = %d\n\n",numbat); if (iprint == 2 || iprint == 3) { printf(" * HISTORY for current MTZ file :\n\n"); for (i = 0; i < mtz->histlines; ++i) { strncpy(buffer,mtz->hist + MTZRECORDLENGTH*i,MTZRECORDLENGTH); buffer[MTZRECORDLENGTH] = '\0'; printf(" %s\n",buffer); } printf("\n"); } if (iprint == 1 || iprint == 2 || iprint >=4 ) { printf(" * Column Labels :\n\n"); /* Loop over crystals */ for (i = 0; i < mtz->nxtal; ++i) { /* Loop over datasets for each crystal */ for (j = 0; j < mtz->xtal[i]->nset; ++j) { /* Loop over columns for each dataset */ for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) { if (mtz->xtal[i]->set[j]->col[k]->active) { if (strcmp(mtz->xtal[i]->set[j]->col[k]->type,"Y") == 0 && strcmp(mtz->xtal[i]->set[j]->col[k]->label,"M_ISYM") == 0) { printf(" M/ISYM"); } else { printf(" %s",mtz->xtal[i]->set[j]->col[k]->label); } } } } } printf("\n\n * Column Types :\n\n"); /* Loop over crystals */ for (i = 0; i < mtz->nxtal; ++i) { /* Loop over datasets for each crystal */ for (j = 0; j < mtz->xtal[i]->nset; ++j) { /* Loop over columns for each dataset */ for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) { if (mtz->xtal[i]->set[j]->col[k]->active) printf(" %s",mtz->xtal[i]->set[j]->col[k]->type); } } } printf("\n\n * Associated datasets :\n\n"); /* Loop over crystals */ for (i = 0; i < mtz->nxtal; ++i) { /* Loop over datasets for each crystal */ for (j = 0; j < mtz->xtal[i]->nset; ++j) { /* Loop over columns for each dataset */ for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) { if (mtz->xtal[i]->set[j]->col[k]->active) printf(" %d",mtz->xtal[i]->set[j]->setid); } } } } else if ( iprint == 3 ) { printf(" * Column Labels, Types, Ranges [and Dataset IDs] :\n\n"); /* Loop over crystals/datasets/columns */ for (i = 0; i < mtz->nxtal; ++i) { for (j = 0; j < mtz->xtal[i]->nset; ++j) { for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) { if (mtz->xtal[i]->set[j]->col[k]->active) { if (strcmp(mtz->xtal[i]->set[j]->col[k]->type,"Y") == 0 && strcmp(mtz->xtal[i]->set[j]->col[k]->label,"M_ISYM") == 0) { printf(" M/ISYM %2s %19.4f %19.4f %8d \n", mtz->xtal[i]->set[j]->col[k]->type, mtz->xtal[i]->set[j]->col[k]->min,mtz->xtal[i]->set[j]->col[k]->max, mtz->xtal[i]->set[j]->setid); } else { printf(" %-30s %2s %19.4f %19.4f %8d \n", mtz->xtal[i]->set[j]->col[k]->label,mtz->xtal[i]->set[j]->col[k]->type, mtz->xtal[i]->set[j]->col[k]->min,mtz->xtal[i]->set[j]->col[k]->max, mtz->xtal[i]->set[j]->setid); } } } } } } /* write overall cell - just for scripts which grep for this */ printf("\n\n * Cell Dimensions : (obsolete - refer to dataset cell dimensions above)\n\n"); for (i = 0; i < mtz->nxtal; ++i) if (mtz->xtal[i]->cell[0] > 0.001) { printf(" %9.4f %9.4f %9.4f %9.4f %9.4f %9.4f \n\n", mtz->xtal[i]->cell[0],mtz->xtal[i]->cell[1],mtz->xtal[i]->cell[2], mtz->xtal[i]->cell[3],mtz->xtal[i]->cell[4],mtz->xtal[i]->cell[5]); break; } /* Calculate overall resolution limits. Two cases: If we have written some reflections to file, we probably want to know the resolution limits for these. In this case, mtz->resmax_out and mtz->resmin_out have been set and we use those. Otherwise, we use the resolution limits of the crystals in memory. */ if (mtz->resmax_out > 0.0001) { maxres = mtz->resmax_out; minres = mtz->resmin_out; } else { for (i = 0; i < mtz->nxtal; ++i) { if (mtz->xtal[i]->resmax > maxres) maxres = mtz->xtal[i]->resmax; if (mtz->xtal[i]->resmin < minres) minres = mtz->xtal[i]->resmin; } } printf(" * Resolution Range :\n\n"); if (maxres > 0.0 && minres > 0.0) { printf(" %10.5f %10.5f ( %10.3f - %10.3f A )\n\n", minres,maxres,1.0/sqrt(minres),1.0/sqrt(maxres)); } else if (maxres > 0.0) { printf(" %10.5f %10.5f ( inf - %10.3f A )\n\n", minres,maxres,1.0/sqrt(maxres)); } else { printf(" Not set - no crystals or reflections? \n\n"); } ccp4_lrsort(mtz, isort); printf(" * Sort Order :\n\n %5d %5d %5d %5d %5d\n\n",isort[0],isort[1],isort[2], isort[3],isort[4]); if (iprint == 3 || iprint == 4 ) { printf(" * Number of Symmetry Operations = %d \n",mtz->mtzsymm.nsym); printf(" * Number of Primitive Operations = %d \n",mtz->mtzsymm.nsymp); printf(" * Space Group = %d \'%s\' \n",mtz->mtzsymm.spcgrp,mtz->mtzsymm.spcgrpname); printf(" * Lattice Type = %c \n",mtz->mtzsymm.symtyp); printf(" * Point Group Name = %s \n",mtz->mtzsymm.pgname); printf("\n * Symmetry Operations : \n\n"); for (i = 0; i < mtz->mtzsymm.nsym; ++i) { mat4_to_symop(symline,symline+80,(const float (*)[4])mtz->mtzsymm.sym[i]); symline[60] = '\0'; printf(" Symmetry %d %s\n",i+1,symline); for (j = 0; j < 4; ++j) printf(" %5.2f %5.2f %5.2f %5.2f \n",mtz->mtzsymm.sym[i][j][0], mtz->mtzsymm.sym[i][j][1],mtz->mtzsymm.sym[i][j][2], mtz->mtzsymm.sym[i][j][3]); } printf("\n"); } else { printf(" * Space group = \'%s\' (number %d)\n\n",mtz->mtzsymm.spcgrpname, mtz->mtzsymm.spcgrp); } if (mtz->mtzsymm.spg_confidence == 'L') { printf(" (only Bravais lattice is fixed so far)\n\n"); } else if (mtz->mtzsymm.spg_confidence == 'P') { printf(" (only pointgroup is fixed so far)\n\n"); } else if (mtz->mtzsymm.spg_confidence == 'E') { printf(" (one of pair of enantiomorphic spacegroups)\n\n"); } else if (mtz->mtzsymm.spg_confidence == 'S') { printf(" (spacegroup is known)\n\n"); } return 1; } int ccp4_lhprt_adv(const MTZ *mtz, int iprint) { int i,j,k; char buffer[MTZRECORDLENGTH+1]; printf(" HEADER INFORMATION FROM MTZ FILE \n\n"); printf(" * File information :\n\n"); printf("%s %s\n",MTZTITLE,mtz->title); printf("%s %d\n",MTZSPACEGROUP,mtz->mtzsymm.spcgrp); printf("%s %d\n",MTZNUMREFLS,mtz->nref); if (strncmp (mtz->mnf.amnf,"NAN",3) == 0) { printf("%s %s\n",MTZMNF,"NaN"); } else { printf("%s %f\n",MTZMNF,mtz->mnf.fmnf); } printf("%s %s\n",MTZSORTORDER,"(not implemented)"); printf("\n * Crystals, datasets :\n"); /* Loop over crystals */ for (i = 0; i < mtz->nxtal; ++i) { printf("\n%s %s\n",CRYSTALXTALNAME,mtz->xtal[i]->xname); printf("%s %s\n",CRYSTALPNAME,mtz->xtal[i]->pname); printf("%s %10.4f%10.4f%10.4f%10.4f%10.4f%10.4f\n",CRYSTALCELL, mtz->xtal[i]->cell[0],mtz->xtal[i]->cell[1],mtz->xtal[i]->cell[2], mtz->xtal[i]->cell[3],mtz->xtal[i]->cell[4],mtz->xtal[i]->cell[5]); /* Loop over datasets for each crystal */ for (j = 0; j < mtz->xtal[i]->nset; ++j) { printf("\n %s %s\n",DATASETDNAME,mtz->xtal[i]->set[j]->dname); printf(" %s %10.5f\n",DATASETWAVELENGTH,mtz->xtal[i]->set[j]->wavelength); if (mtz->xtal[i]->set[j]->ncol > 0) { printf("\n %s %s\n",COLUMNLABEL,COLUMNTYPE); /* Loop over columns for each dataset */ for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) { printf(" %-31s %-3s\n",mtz->xtal[i]->set[j]->col[k]->label, mtz->xtal[i]->set[j]->col[k]->type); } } } } printf("\n * HISTORY for current MTZ file :\n\n"); for (i = 0; i < mtz->histlines; ++i) { strncpy(buffer,mtz->hist + MTZRECORDLENGTH*i,MTZRECORDLENGTH); buffer[MTZRECORDLENGTH] = '\0'; printf(" %s\n",buffer); } return 1; } int ccp4_lrbat(MTZBAT *batch, float *buf, char *charbuf, int iprint) { int nwords=NBATCHWORDS,nintegers=NBATCHINTEGERS,nreals=NBATCHREALS; int *intbuf = (int *) buf; float *fltbuf = buf + NBATCHINTEGERS; if (!batch) return 0; MtzBatchToArray(batch,intbuf,fltbuf); intbuf[0] = nwords; intbuf[1] = nintegers; intbuf[2] = nreals; strncpy(charbuf,batch->title,70); strncpy(charbuf+70,batch->gonlab[0],8); strncpy(charbuf+78,batch->gonlab[1],8); strncpy(charbuf+86,batch->gonlab[2],8); if (iprint == 1) { printf(" Batch number: \n %6d %s\n",batch->num,batch->title); } else if (iprint > 1) { MtzPrintBatchHeader(batch); } return 1; } int MtzPrintBatchHeader(const MTZBAT *batch) { int i; char labtype[26],axes[5],string1[40],string2[40]; switch (batch->ldtype) { case 1: strcpy(labtype,"oscillation data"); break; case 2: strcpy(labtype,"area detector data"); break; case 3: strcpy(labtype,"Laue data"); break; default: strcpy(labtype,"*** unknown data type ***"); } switch (batch->jumpax) { case 1: strcpy(axes,"a*"); break; case 2: strcpy(axes,"b*"); break; case 3: strcpy(axes,"c*"); break; default: strcpy(axes,"none"); } printf(" Batch number: \n"); printf(" %6d %s\n",batch->num,batch->title); printf("\n %s \n\n %s %7d %s \n\n %s %7d\n %s %7d\n %s %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n %s %7d %7d %7d %7d %7d %7d \n", "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", "Orientation data for batch",batch->num,labtype, " Crystal number ...................",batch->ncryst, " Associated dataset ID ............",batch->nbsetid, " Cell dimensions ..................", batch->cell[0],batch->cell[1],batch->cell[2], batch->cell[3],batch->cell[4],batch->cell[5], " Cell fix flags ...................", batch->lbcell[0],batch->lbcell[1],batch->lbcell[2], batch->lbcell[3],batch->lbcell[4],batch->lbcell[5]); if (!batch->misflg) { strcpy(string1,"Orientation matrix U ............."); strcpy(string2," (including setting angles) "); } else { strcpy(string1,"Standard orientation matrix U ...."); strcpy(string2," "); } printf(" %s %9.4f %9.4f %9.4f \n %s %9.4f %9.4f %9.4f \n %s %9.4f %9.4f %9.4f \n", string1,batch->umat[0],batch->umat[3],batch->umat[6], string2,batch->umat[1],batch->umat[4],batch->umat[7], " ",batch->umat[2],batch->umat[5],batch->umat[8]); if (batch->misflg == 1) { printf(" %s %6.2f %6.2f %6.2f\n", "Missetting angles PhiX PhiY PhiZ..", batch->phixyz[0][0],batch->phixyz[0][1],batch->phixyz[0][2]); } else if (batch->misflg > 1) { printf(" %s %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f\n", "Missetting angles PhiX PhiY PhiZ..", batch->phixyz[0][0],batch->phixyz[0][1],batch->phixyz[0][2], batch->phixyz[1][0],batch->phixyz[1][1],batch->phixyz[1][2]); } printf(" %s%s%s %s\n", "Reciprocal axis nearest ",batch->gonlab[batch->ngonax-1],"..",axes); if (!batch->lcrflg) { printf(" %s %6.3f \n", "Mosaicity ........................",batch->crydat[0]); } else { printf(" %s %6.3f %6.3f \n", "Mosaicity (horizontal, vertical)..",batch->crydat[0],batch->crydat[1]); } printf(" Datum goniostat angles (degrees).."); for (i = 0; i < batch->ngonax; ++i) printf(" %8.3f",batch->datum[i]); printf("\n"); if (batch->jsaxs > 0 && batch->jsaxs <= batch->ngonax) printf(" %s %s \n", "Scan axis ........................",batch->gonlab[batch->jsaxs-1]); printf(" %s %8.3f %8.3f \n %s %8.3f \n %s %8.2f %8.2f \n", "Start & stop Phi angles (degrees).",batch->phistt,batch->phiend, "Range of Phi angles (degrees).....",batch->phirange, "Start & stop time (minutes).......",batch->time1,batch->time2); if (batch->nbscal == 4) { printf(" %s %9.4f %9.4f \n %s %9.4f %9.4f \n", " Batch scale & SD .................",batch->bscale,batch->sdbscale, " Batch B-factor & SD ..............",batch->bbfac,batch->sdbfac); } printf(" %s \n %s %7d \n %s %s %s %9.4f %9.4f %9.4f \n %s %s %s %9.4f %9.4f %9.4f \n %s %s %s %9.4f %9.4f %9.4f \n", " Crystal goniostat information :-", " Number of goniostat axes..........",batch->ngonax, " Goniostat vectors.....",batch->gonlab[0],"....",batch->e1[0],batch->e1[1],batch->e1[2], " .....",batch->gonlab[1],"....",batch->e2[0],batch->e2[1],batch->e2[2], " .....",batch->gonlab[2],"....",batch->e3[0],batch->e3[1],batch->e3[2]); printf(" %s \n %s %9.4f %9.4f %9.4f \n %s %9.4f %9.4f %9.4f \n", " Beam information :-", " Idealized X-ray beam vector.......",batch->source[0],batch->source[1],batch->source[2], " X-ray beam vector with tilts......",batch->so[0],batch->so[1],batch->so[2]); if (batch->lbmflg == 0) { printf(" %s %9.5f %9.5f \n", " Wavelength and dispersion ........",batch->alambd,batch->delamb); } else if (batch->lbmflg == 1) { printf(" %s %9.5f %9.5f %9.5f \n %s %7.3f %7.3f \n", " Wavelength and dispersion ........",batch->alambd,batch->delamb,batch->delcor, " Divergence .......................",batch->divhd,batch->divvd); } printf(" Detector information :-\n Number of detectors...............%7d \n",batch->ndet); printf(" %s%9.3f\n%s%9.3f\n%s%7.1f%7.1f%7.1f%7.1f\n", " Crystal to Detector distance (mm).",batch->dx[0], " Detector swing angle..............",batch->theta[0], " Pixel limits on detector..........",batch->detlm[0][0][0],batch->detlm[0][0][1],batch->detlm[0][1][0],batch->detlm[0][1][1]); printf(" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\n"); return 1; } int ccp4_lwtitl(MTZ *mtz, const char *ftitle, int flag) { int length; if (flag == 0) { strncpy(mtz->title,ftitle,70); } else { /* Append ftitle to existing title. BEWARE this has been fixed a few times for special cases. There is often a reaons behind numbers such as 69, so don't change it lightly */ length = (int) strlen(mtz->title); /* this shouldn't happen if title is NULL terminated */ if (length > 70) length = 70; while ((--length >= 0) && mtz->title[length] == ' '); /* if there is an existing title and it doesn't take up all 70 chars, then add a space before appending new title */ if (length >= 0 && length < 69) mtz->title[++length] = ' '; strncpy(mtz->title+length+1,ftitle,69-length); } mtz->title[70] = '\0'; return 1; } int MtzSetSortOrder(MTZ *mtz, MTZCOL *colsort[5]) { int i; for (i = 0; i < 5; ++i) mtz->order[i] = colsort[i]; return 1; } int MtzAddHistory(MTZ *mtz, const char history[][MTZRECORDLENGTH], const int nlines) { int i,j,numlines=0; char *newhist; newhist = MtzCallocHist(mtz->histlines + nlines); /* write new history lines */ for (i = 0; i < nlines; ++i) { for (j = 0; j < MTZRECORDLENGTH; ++j) { /* remove leading blanks and blank lines */ if ( *(history[i]+j) != ' ') { strncpy(newhist + MTZRECORDLENGTH*i,history[i]+j,MTZRECORDLENGTH-j); ++numlines; break; } } } /* copy old history lines */ for (i = 0; i < mtz->histlines; ++i) { strncpy(newhist + MTZRECORDLENGTH*numlines + MTZRECORDLENGTH*i, mtz->hist + MTZRECORDLENGTH*i,MTZRECORDLENGTH); } MtzFreeHist(mtz->hist); mtz->hist = newhist; mtz->histlines += numlines; return mtz->histlines; } int ccp4_lwidx(MTZ *mtz, const char crystal_name[], const char dataset_name[], const char project_name[], const float datcell[6], const float *datwave) { MTZXTAL *xtl; MTZSET *set; int i; char path1[200]; /* Is it a new crystal? */ if ((xtl = MtzXtalLookup(mtz,crystal_name)) == NULL) { xtl = MtzAddXtal(mtz,crystal_name,project_name,datcell); MtzAddDataset(mtz,xtl,dataset_name,*datwave); } else { /* Existing crystal - update parameters */ if (project_name && strlen(project_name) > 0) { strncpy(xtl->pname,project_name,64); xtl->pname[64] = '\0'; } if (datcell[0] > 0.0) for (i = 0; i < 6; ++i) xtl->cell[i] = datcell[i]; strcpy( path1, "/" ); strcat( path1, xtl->xname ); strcat( path1, "/" ); strcat( path1, dataset_name ); /* Is it a new dataset? */ if ((set = MtzSetLookup(mtz,path1)) == NULL) { MtzAddDataset(mtz,xtl,dataset_name,*datwave); } else { if (*datwave > 0.0) set->wavelength = *datwave; } } return 1; } int MtzAssignHKLtoBase(MTZ *mtz) { int i,j,k,l=0; MTZSET *baseset=NULL; MTZCOL *colarray[3]; /* get base dataset if it exists */ baseset = MtzSetLookup(mtz,"HKL_base/HKL_base"); if (baseset) { for (i = 0; i < mtz->nxtal; ++i) for (j = 0; j < mtz->xtal[i]->nset; ++j) for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) if ( strcmp(mtz->xtal[i]->set[j]->col[k]->type,"H") == 0 ) { colarray[l++] = mtz->xtal[i]->set[j]->col[k]; if (l == 3) goto assign; } assign: for (l = 0; l < 3; ++l) if (colarray[l]) MtzAssignColumn(mtz, colarray[l], "HKL_base","HKL_base"); } return 1; } int MtzAssignColumn(MTZ *mtz, MTZCOL *col, const char crystal_name[], const char dataset_name[]) { MTZXTAL *xtl; MTZSET *set, *oldset; int i,j; float datcell[6] = {0.0}, datwave = 0.0; char path1[200], *path2; if ( !mtz || !col || !crystal_name || !dataset_name || !strcmp(crystal_name,"") || !strcmp(dataset_name,"") ) ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_ParamError),"MtzAssignColumn",NULL); /* if column already belongs in this dataset, do nothing and return */ oldset = MtzColSet(mtz, col); path2 = MtzSetPath(mtz, oldset); strcpy( path1, "/" ); strcat( path1, crystal_name ); strcat( path1, "/" ); strcat( path1, dataset_name ); if ( MtzPathMatch( path1, path2 ) ) { free (path2); return 1; } free (path2); /* remove column from existing set */ for (i = 0; i < oldset->ncol; ++i) { if ( oldset->col[i] == col ) { for (j = i; j < oldset->ncol - 1; ++j) oldset->col[j] = oldset->col[j+1]; oldset->col[--oldset->ncol] = NULL; break; } } /* Does the requested new dataset exist? If not, create it. */ if ( !(set = MtzSetLookup(mtz,path1)) ) { if ( !(xtl = MtzXtalLookup(mtz,crystal_name)) ) xtl = MtzAddXtal(mtz,crystal_name,crystal_name,datcell); set = MtzAddDataset(mtz,xtl,dataset_name,datwave); } /* Add column to new dataset */ if ( ++set->ncol > ccp4array_size(set->col)) ccp4array_resize(set->col, set->ncol + 9); set->col[set->ncol - 1] = col; return 1; } int ccp4_lwsymconf(MTZ *mtz, char spgconf[]) { if (spgconf[0] != ' ' && spgconf[0] != '\0') mtz->mtzsymm.spg_confidence = spgconf[0]; return 1; } int ccp4_lwsymm(MTZ *mtz, int nsymx, int nsympx, float rsymx[192][4][4], char ltypex[], int nspgrx, char spgrnx[], char pgnamx[]) { /* Could set this to "X" but beware of legacy programs where lwsymm still used. Don't want to overwrite flag in newer file. */ char spgconf_temp[2]=""; return ccp4_lwsymm_c(mtz, nsymx, nsympx, rsymx, ltypex, nspgrx, spgrnx, pgnamx, spgconf_temp); } int ccp4_lwsymm_c(MTZ *mtz, int nsymx, int nsympx, float rsymx[192][4][4], char ltypex[], int nspgrx, char spgrnx[], char pgnamx[], char spgconf[]) { int i,j,k,length; if (nsymx > 0) { mtz->mtzsymm.nsym = nsymx; mtz->mtzsymm.nsymp = nsympx; for (i = 0; i < nsymx; ++i) { for (j = 0; j < 4; ++j) { for (k = 0; k < 4; ++k) { mtz->mtzsymm.sym[i][j][k] = rsymx[i][j][k]; } } } } if (ltypex[0] != ' ' && ltypex[0] != '\0') mtz->mtzsymm.symtyp = ltypex[0]; if (nspgrx != 0) mtz->mtzsymm.spcgrp = nspgrx; if (spgconf[0] != ' ' && spgconf[0] != '\0') mtz->mtzsymm.spg_confidence = spgconf[0]; if (strcmp(spgrnx,"")) { length = ( strlen(spgrnx) < MAXSPGNAMELENGTH ) ? strlen(spgrnx) : MAXSPGNAMELENGTH; strncpy(mtz->mtzsymm.spcgrpname,spgrnx,length); mtz->mtzsymm.spcgrpname[length] = '\0'; } if (strcmp(pgnamx,"")) { length = ( strlen(pgnamx) < MAXPGNAMELENGTH ) ? strlen(pgnamx) : MAXPGNAMELENGTH; strncpy(mtz->mtzsymm.pgname,pgnamx,length); mtz->mtzsymm.pgname[length] = '\0'; } return 1; } MTZCOL **ccp4_lwassn(MTZ *mtz, const char labels[][31], const int nlabels, const char types[][3], const int iappnd) { int i,j,k,ilab; MTZCOL *col, **lookup; MTZSET *defaultset; lookup = (MTZCOL **) ccp4_utils_malloc(nlabels*sizeof(MTZCOL *)); /* if iappnd = 0, deactivate existing columns */ if (iappnd == 0) { /* Loop over crystals */ for (i = 0; i < mtz->nxtal; ++i) { /* Loop over datasets for each crystal */ for (j = 0; j < mtz->xtal[i]->nset; ++j) { /* Loop over columns for each dataset */ for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) { mtz->xtal[i]->set[j]->col[k]->active = 0; } } } } /* new columns need to be assigned to a dataset. Set this as the base dataset if it exists, else the first dataset. */ if ( !(defaultset = MtzSetLookup(mtz,"HKL_base/HKL_base")) ) defaultset = mtz->xtal[0]->set[0]; /* Loop over labels */ for (ilab = 0; ilab < nlabels; ++ilab) { if (strcmp(types[ilab],"Y") == 0 && strcmp(labels[ilab],"M/ISYM") == 0) { col = MtzColLookup(mtz,"M_ISYM"); } else { col = MtzColLookup(mtz,labels[ilab]); } if (col) { col->active = 1; lookup[ilab] = col; } else { /* add new column to first dataset - MtzAssignColumn corrects this */ if (strcmp(types[ilab],"Y") == 0 && strcmp(labels[ilab],"M/ISYM") == 0) { lookup[ilab] = MtzAddColumn(mtz, defaultset, "M/ISYM", types[ilab]); } else { lookup[ilab] = MtzAddColumn(mtz, defaultset, labels[ilab], types[ilab]); } } } return lookup; } int ccp4_lwbat(MTZ *mtz, MTZBAT *batch, const int batno, const float *buf, const char *charbuf) { int *intbuf = (int *) buf; const float *fltbuf = buf + NBATCHINTEGERS; char cbatch[95]=" "; int i,cbatch_len; MTZBAT *otherbat; if (batch == NULL) { /* add new batch at end of list */ batch = mtz->batch; /* is this the first ever batch? */ if (batch == NULL) { mtz->batch = MtzMallocBatch(); batch = mtz->batch; batch->num = batno; batch->next = NULL; } else { /* first, skip over n_orig_bat batches if some were read in */ for (i=0; i < mtz->n_orig_bat - 1; ++i) batch = batch->next; if (mtz->n_orig_bat == 0 && batch->num == batno) { printf("From ccp4_lwbat: warning: attempt to add new batch with existing batch number %d!\n",batno); return 0; } while (batch->next != NULL) { batch = batch->next; if (batch->num == batno) { printf("From ccp4_lwbat: warning: attempt to add new batch with existing batch number %d!\n",batno); return 0; } } batch->next = MtzMallocBatch(); batch = batch->next; batch->num = batno; batch->next = NULL; } } else { if (batch->num != batno) { /* renumbering - check unique */ otherbat = mtz->batch; while (otherbat != NULL) { if (otherbat->num == batno && otherbat != batch) { printf("From ccp4_lwbat: warning: attempt to change batch number to existing batch number %d!\n",batno); return 0; } otherbat = otherbat->next; } batch->num = batno; } } MtzArrayToBatch(intbuf,fltbuf,batch); cbatch_len = ( strlen(charbuf) < 94 ) ? strlen(charbuf) : 94; strncpy(cbatch,charbuf,cbatch_len); strncpy(batch->title,cbatch,70); strncpy(batch->gonlab[0],cbatch+70,8); strncpy(batch->gonlab[1],cbatch+78,8); strncpy(batch->gonlab[2],cbatch+86,8); batch->gonlab[0][8] = batch->gonlab[1][8] = batch->gonlab[2][8] = '\0'; return 1; } int ccp4_lwbsetid(MTZ *mtz, MTZBAT *batch, const char xname[], const char dname[]) { MTZXTAL *xtl; MTZSET *set; char path1[200]; if ((xtl = MtzXtalLookup(mtz,xname)) != NULL) { strcpy( path1, "/" ); strcat( path1, xtl->xname ); strcat( path1, "/" ); strcat( path1, dname ); if ((set = MtzSetLookup(mtz,path1)) != NULL) { batch->nbsetid = set->setid; return 1; } } printf("From ccp4_lwbsetid: warning: dataset id not found!\n"); return 0; } int MtzDeleteRefl(MTZ *mtz, int iref) { int i,j,k; /* only possible if reflections in memory */ if (mtz->refs_in_memory) { for (i = 0; i < mtz->nxtal; ++i) for (j = 0; j < mtz->xtal[i]->nset; ++j) for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) ccp4array_delete_ordered(mtz->xtal[i]->set[j]->col[k]->ref,iref); --mtz->nref; } return 1; } int ccp4_lwrefl(MTZ *mtz, const float adata[], MTZCOL *lookup[], const int ncol, const int iref) { int i,j,k,l,icol,ind[3],ind_xtal,ind_set,ind_col[3]; float refldata[MCOLUMNS],res; double coefhkl[6]; /* if this is extra reflection, check memory for in-memory mode */ if (mtz->refs_in_memory && iref > mtz->nref) { if (iref > ccp4array_size(lookup[0]->ref)) { /* Loop over crystals */ for (i = 0; i < mtz->nxtal; ++i) { /* Loop over datasets for each crystal */ for (j = 0; j < mtz->xtal[i]->nset; ++j) { /* Loop over columns for each dataset */ for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) { ccp4array_resize(mtz->xtal[i]->set[j]->col[k]->ref, iref); } } } } } /* update variables held in memory */ icol = -1; for (i = 0; i < ncol; ++i) { if (lookup[i]) { /* update reflection for in-memory mode */ if (mtz->refs_in_memory) { lookup[i]->ref[iref-1] = adata[i]; } /* update column ranges */ if (iref == 1) { lookup[i]->min = FLT_MAX; lookup[i]->max = -FLT_MAX; } if (!ccp4_ismnf(mtz, adata[i])) { if (adata[i] < lookup[i]->min) lookup[i]->min = adata[i]; if (adata[i] > lookup[i]->max) lookup[i]->max = adata[i]; } } } /* write reflection for on-disk mode */ if (!mtz->refs_in_memory) { icol = -1; /* Loop over all active columns */ for (i = 0; i < mtz->nxtal; ++i) for (j = 0; j < mtz->xtal[i]->nset; ++j) for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) if (mtz->xtal[i]->set[j]->col[k]->active) { ++icol; /* for each active column, see if value to write */ for (l = 0; l < ncol; ++l) if (lookup[l] == mtz->xtal[i]->set[j]->col[k]) { refldata[icol] = adata[l]; break; } } if (MtzWrefl(mtz->fileout, icol+1, refldata) != icol+1 ) return 0; /* Update resolution limits. For in-memory mode, this is done in MtzPut. */ /* Check if HKL are first 3 columns */ if (lookup[0]->type[0] == 'H' && lookup[1]->type[0] == 'H' && lookup[2]->type[0] == 'H') { ind[0] = (int) adata[0]; ind[1] = (int) adata[1]; ind[2] = (int) adata[2]; } else { MtzFindInd(mtz,&ind_xtal,&ind_set,ind_col); for (l = 0; l < ncol; ++l) { if (lookup[l] == mtz->xtal[ind_xtal]->set[ind_set]->col[ind_col[0]]) ind[0] = (int) adata[l]; if (lookup[l] == mtz->xtal[ind_xtal]->set[ind_set]->col[ind_col[1]]) ind[1] = (int) adata[l]; if (lookup[l] == mtz->xtal[ind_xtal]->set[ind_set]->col[ind_col[2]]) ind[2] = (int) adata[l]; } } for (i = 0; i < mtz->nxtal; ++i) { if (mtz->xtal[i]->cell[0] > 0.001) { MtzHklcoeffs(mtz->xtal[i]->cell, coefhkl); res = MtzInd2reso(ind, coefhkl); if (res > 0.0) { if (res > mtz->xtal[i]->resmax) mtz->xtal[i]->resmax = res; if (res < mtz->xtal[i]->resmin) mtz->xtal[i]->resmin = res; if (res > mtz->resmax_out) mtz->resmax_out = res; if (res < mtz->resmin_out) mtz->resmin_out = res; } } } } /* increment nref if we are adding new reflections */ if (iref > mtz->nref) mtz->nref = iref; return 1; } int MtzPut(MTZ *mtz, const char *logname) { char hdrrec[81],symline[81],spgname[MAXSPGNAMELENGTH+3]; CCP4File *fileout; int i, j, k, l, icol, numbat, isort[5], debug=0; int ind[3],ind_xtal,ind_set,ind_col[3],length,glob_cell_written=0; double coefhkl[6]; float res,refldata[MCOLUMNS]; int nwords=NBATCHWORDS,nintegers=NBATCHINTEGERS,nreals=NBATCHREALS; float buf[NBATCHWORDS]; int *intbuf = (int *) buf; float *fltbuf = buf + NBATCHINTEGERS; MTZBAT *batch, *lastoldbatch; MTZXTAL *xtl; char colsource[37], *taskenv; int date3[3], time3[3]; int32_t tmp_hdrst; int64_t hdrst; if (debug) printf(" MtzPut: entering \n"); /* get data to fill out column source information */ taskenv = getenv( "CCP4_TASK_ID" ); if ( taskenv != NULL ) { strncpy( colsource, taskenv, 36 ); colsource[36] = '\0'; } else { ccp4_utils_idate( date3 ); ccp4_utils_itime( time3 ); sprintf( colsource, "CREATED_%02d/%02d/%04d_%02d:%02d:%02d", date3[0],date3[1],date3[2],time3[0],time3[1],time3[2] ); } for ( i = 0; i < strlen(colsource); i++ ) if ( colsource[i] == ' ' ) colsource[i] = '_'; for (i = 0; i < mtz->nxtal; ++i) for (j = 0; j < mtz->xtal[i]->nset; ++j) for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) if ( mtz->xtal[i]->set[j]->col[k]->source == 0 ) strncpy(mtz->xtal[i]->set[j]->col[k]->colsource,colsource,36); if (!mtz->fileout) { if ( !(fileout = MtzOpenForWrite(logname)) ) return 0; if (debug) printf(" MtzPut: file opened \n"); } else { fileout = mtz->fileout; } if (mtz->refs_in_memory) { /* Write all reflections from memory - make this optional? */ for (l = 0; l < mtz->nref; ++l) { icol = 0; /* Loop over crystals */ for (i = 0; i < mtz->nxtal; ++i) { /* Loop over datasets for each crystal */ for (j = 0; j < mtz->xtal[i]->nset; ++j) { /* Loop over columns for each dataset */ for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) { if (mtz->xtal[i]->set[j]->col[k]->active) { refldata[icol++] = mtz->xtal[i]->set[j]->col[k]->ref[l]; } } } } if (MtzWrefl(fileout, icol, refldata) != icol ) return 0; } if (debug) printf(" MtzPut: reflections written \n"); } ccp4_file_setmode(fileout,0); /* Write header */ sprintf(hdrrec,"VERS MTZ:V%d.%d",MTZ_MAJOR_VERSN,MTZ_MINOR_VERSN); /* if MTZ_MAJOR_VERSN,MTZ_MINOR_VERSN get into double figures, adjust following call to MtzWhdrLine */ MtzWhdrLine(fileout,13,hdrrec); strcpy(hdrrec,"TITLE "); strncpy(hdrrec+6,mtz->title,70); MtzWhdrLine(fileout,76,hdrrec); /* if new batch headers have been written, lose the old ones */ /* mtz->n_orig_bat is original number of batches, MtzNbat(mtz) the current */ if (MtzNbat(mtz) == mtz->n_orig_bat) { numbat = mtz->n_orig_bat; } else { numbat = MtzNbat(mtz) - mtz->n_orig_bat; } sprintf(hdrrec,"NCOL %8d %12d %8d",MtzNumActiveCol(mtz),mtz->nref,numbat); MtzWhdrLine(fileout,35,hdrrec); if (debug) printf(" MtzPut: NCOL just written \n"); /* Purely for backwards compatibility: output first non-zero cell as global cell. Also update base dataset cell. */ for (i = 0; i < mtz->nxtal; ++i) { if ( !strcmp(mtz->xtal[i]->xname,"HKL_base") ) continue; if ( (MtzNumActiveSetsInXtal(mtz,mtz->xtal[i]) == 0) ) continue; if (mtz->xtal[i]->cell[0] > 0.001) { sprintf(hdrrec,"CELL %9.4f %9.4f %9.4f %9.4f %9.4f %9.4f",mtz->xtal[i]->cell[0], mtz->xtal[i]->cell[1],mtz->xtal[i]->cell[2],mtz->xtal[i]->cell[3], mtz->xtal[i]->cell[4],mtz->xtal[i]->cell[5]); MtzWhdrLine(fileout,65,hdrrec); if ((xtl = MtzXtalLookup(mtz,"HKL_base")) != NULL) for (j = 0; j < 6; ++j) xtl->cell[j] = mtz->xtal[i]->cell[j]; glob_cell_written=1; break; } } /* if no suitable cell found, then try HKL_base cell */ if (!glob_cell_written) { if ((xtl = MtzXtalLookup(mtz,"HKL_base")) != NULL) { sprintf(hdrrec,"CELL %9.4f %9.4f %9.4f %9.4f %9.4f %9.4f",xtl->cell[0], xtl->cell[1],xtl->cell[2],xtl->cell[3],xtl->cell[4],xtl->cell[5]); MtzWhdrLine(fileout,65,hdrrec); glob_cell_written=1; } } if (debug) printf(" MtzPut: CELL just written \n"); ccp4_lrsort(mtz, isort); sprintf(hdrrec,"SORT %3d %3d %3d %3d %3d",isort[0],isort[1],isort[2], isort[3],isort[4]); MtzWhdrLine(fileout,25,hdrrec); if (debug) printf(" MtzPut: SORT just written \n"); spgname[0] = '\''; length = strlen(mtz->mtzsymm.spcgrpname); while ((--length >= 0) && mtz->mtzsymm.spcgrpname[length] == ' '); strncpy(spgname+1,mtz->mtzsymm.spcgrpname,length+1); spgname[length+2] = '\''; spgname[length+3] = '\0'; sprintf(hdrrec,"SYMINF %3d %2d %c %5d %22s %5s %c",mtz->mtzsymm.nsym, mtz->mtzsymm.nsymp,mtz->mtzsymm.symtyp,mtz->mtzsymm.spcgrp,spgname, mtz->mtzsymm.pgname,mtz->mtzsymm.spg_confidence); MtzWhdrLine(fileout,52,hdrrec); if (debug) printf(" MtzPut: SYMINF just written \n"); for (i = 0; i < mtz->mtzsymm.nsym; ++i) { mat4_to_symop(symline,symline+74,(const float (*)[4])mtz->mtzsymm.sym[i]); symline[74] = '\0'; sprintf(hdrrec,"SYMM %74s",symline); MtzWhdrLine(fileout,79,hdrrec); } if (debug) printf(" MtzPut: symmetry just written \n"); if (mtz->refs_in_memory) { /* Find dataset of indices */ MtzFindInd(mtz,&ind_xtal,&ind_set,ind_col); /* Recalculate crystal resolution limits */ for (i = 0; i < mtz->nxtal; ++i) { mtz->xtal[i]->resmax = 0.0; mtz->xtal[i]->resmin = 100.0; MtzHklcoeffs(mtz->xtal[i]->cell, coefhkl); for (j = 0; j < mtz->nref; ++j) { ind[0] = (int) mtz->xtal[ind_xtal]->set[ind_set]->col[ind_col[0]]->ref[j]; ind[1] = (int) mtz->xtal[ind_xtal]->set[ind_set]->col[ind_col[1]]->ref[j]; ind[2] = (int) mtz->xtal[ind_xtal]->set[ind_set]->col[ind_col[2]]->ref[j]; res = MtzInd2reso(ind, coefhkl); /* crystal limits */ if (res > 0.0) { if (res > mtz->xtal[i]->resmax) mtz->xtal[i]->resmax = res; if (res < mtz->xtal[i]->resmin) mtz->xtal[i]->resmin = res; if (res > mtz->resmax_out) mtz->resmax_out = res; if (res < mtz->resmin_out) mtz->resmin_out = res; } } } } /* print enough digits to retain precision. C. Flensburg 20080227 */ sprintf(hdrrec,"RESO %-20.16f %-20.16f",mtz->resmin_out,mtz->resmax_out); MtzWhdrLine(fileout,46,hdrrec); if (debug) printf(" MtzPut: resolution limts just written \n"); if (strncmp (mtz->mnf.amnf,"NAN",3) == 0) { sprintf(hdrrec,"VALM NAN"); MtzWhdrLine(fileout,8,hdrrec); } else { sprintf(hdrrec,"VALM %-20f",mtz->mnf.fmnf); MtzWhdrLine(fileout,25,hdrrec); } if (debug) printf(" MtzPut: VALM just written \n"); /* Loop over crystals */ for (i = 0; i < mtz->nxtal; ++i) { /* Loop over datasets for each crystal */ for (j = 0; j < mtz->xtal[i]->nset; ++j) { /* Loop over columns for each dataset */ for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) { if (mtz->xtal[i]->set[j]->col[k]->active) { if (strcmp(mtz->xtal[i]->set[j]->col[k]->type,"Y") == 0 && strcmp(mtz->xtal[i]->set[j]->col[k]->label,"M_ISYM") == 0) { sprintf(hdrrec,"COLUMN %-30s ","M/ISYM"); } else { sprintf(hdrrec,"COLUMN %-30s ",mtz->xtal[i]->set[j]->col[k]->label); } /* Check that the column type is set If it is blank then the COLUMN record will be incomplete */ if (mtz->xtal[i]->set[j]->col[k]->type[0] == '\0') { if (ccp4_liberr_verbosity(-1)) printf("From MtzPut: column type for %s is not set, assume type R\n", mtz->xtal[i]->set[j]->col[k]->label); strncpy(mtz->xtal[i]->set[j]->col[k]->type,"R",2); } /* catch case when min and max have not been set*/ if ( mtz->xtal[i]->set[j]->col[k]->min == FLT_MAX ) mtz->xtal[i]->set[j]->col[k]->min = 0.0f; if ( mtz->xtal[i]->set[j]->col[k]->max == -FLT_MAX ) mtz->xtal[i]->set[j]->col[k]->max = 0.0f; sprintf(hdrrec+38,"%c %17.9g %17.9g %4d", mtz->xtal[i]->set[j]->col[k]->type[0], mtz->xtal[i]->set[j]->col[k]->min, mtz->xtal[i]->set[j]->col[k]->max, mtz->xtal[i]->set[j]->setid); MtzWhdrLine(fileout,MTZRECORDLENGTH,hdrrec); if ( mtz->xtal[i]->set[j]->col[k]->colsource[0] != '\0' ) { if (strcmp(mtz->xtal[i]->set[j]->col[k]->type,"Y") == 0 && strcmp(mtz->xtal[i]->set[j]->col[k]->label,"M_ISYM") == 0) { sprintf(hdrrec,"COLSRC %-30s %-36s %4d","M/ISYM",mtz->xtal[i]->set[j]->col[k]->colsource,mtz->xtal[i]->set[j]->setid); } else { sprintf(hdrrec,"COLSRC %-30s %-36s %4d",mtz->xtal[i]->set[j]->col[k]->label,mtz->xtal[i]->set[j]->col[k]->colsource,mtz->xtal[i]->set[j]->setid); } MtzWhdrLine(fileout,MTZRECORDLENGTH,hdrrec); } if ( mtz->xtal[i]->set[j]->col[k]->grpname[0] != '\0' && mtz->xtal[i]->set[j]->col[k]->grptype[0] != '\0' && mtz->xtal[i]->set[j]->col[k]->grpposn >= 0 ) { if (strcmp(mtz->xtal[i]->set[j]->col[k]->type,"Y") == 0 && strcmp(mtz->xtal[i]->set[j]->col[k]->label,"M_ISYM") == 0) { sprintf(hdrrec,"COLGRP %-30s %-30s %-4s %1X %4d","M/ISYM",mtz->xtal[i]->set[j]->col[k]->grpname,mtz->xtal[i]->set[j]->col[k]->grptype,mtz->xtal[i]->set[j]->col[k]->grpposn,mtz->xtal[i]->set[j]->setid); } else { sprintf(hdrrec,"COLGRP %-30s %-30s %-4s %1X %4d",mtz->xtal[i]->set[j]->col[k]->label,mtz->xtal[i]->set[j]->col[k]->grpname,mtz->xtal[i]->set[j]->col[k]->grptype,mtz->xtal[i]->set[j]->col[k]->grpposn,mtz->xtal[i]->set[j]->setid); } MtzWhdrLine(fileout,MTZRECORDLENGTH,hdrrec); } } } } } if (debug) printf(" MtzPut: column info just written \n"); sprintf(hdrrec,"NDIF %8d",MtzNumActiveSet(mtz)); MtzWhdrLine(fileout,13,hdrrec); if (debug) printf(" MtzPut: about to write dataset info \n"); /* Loop over crystals */ for (i = 0; i < mtz->nxtal; ++i) { /* Loop over datasets for each crystal */ for (j = 0; j < mtz->xtal[i]->nset; ++j) { /* check if dataset contains any active columns or batches */ if ( (MtzNumActiveColsInSet(mtz->xtal[i]->set[j]) == 0) && (MtzNbatchesInSet(mtz,mtz->xtal[i]->set[j]) == 0) ) continue; sprintf(hdrrec,"PROJECT %7d %-64s",mtz->xtal[i]->set[j]->setid, mtz->xtal[i]->pname); MtzWhdrLine(fileout,MTZRECORDLENGTH,hdrrec); sprintf(hdrrec,"CRYSTAL %7d %-64s",mtz->xtal[i]->set[j]->setid, mtz->xtal[i]->xname); MtzWhdrLine(fileout,MTZRECORDLENGTH,hdrrec); sprintf(hdrrec,"DATASET %7d %-64s",mtz->xtal[i]->set[j]->setid, mtz->xtal[i]->set[j]->dname); MtzWhdrLine(fileout,MTZRECORDLENGTH,hdrrec); sprintf(hdrrec,"DCELL %7d %10.4f%10.4f%10.4f%10.4f%10.4f%10.4f", mtz->xtal[i]->set[j]->setid,mtz->xtal[i]->cell[0], mtz->xtal[i]->cell[1],mtz->xtal[i]->cell[2], mtz->xtal[i]->cell[3],mtz->xtal[i]->cell[4], mtz->xtal[i]->cell[5]); MtzWhdrLine(fileout,76,hdrrec); sprintf(hdrrec,"DWAVEL %7d %10.5f",mtz->xtal[i]->set[j]->setid, mtz->xtal[i]->set[j]->wavelength); MtzWhdrLine(fileout,26,hdrrec); } } if (MtzNbat(mtz) > 0) { batch = mtz->batch; /* if new batch headers have been written, lose the old ones */ if (MtzNbat(mtz) > mtz->n_orig_bat) { for (i=0; i < mtz->n_orig_bat; ++i) { lastoldbatch = batch; batch = batch->next; } numbat = MtzNbat(mtz) - mtz->n_orig_bat; batch = sort_batches(batch,numbat); if (mtz->n_orig_bat > 0) { lastoldbatch->next = batch; } else { mtz->batch = batch; } } else { numbat = mtz->n_orig_bat; } if (debug) { printf(" MtzPut: original number of batches %d \n",mtz->n_orig_bat); printf(" MtzPut: total number of batches %d \n",MtzNbat(mtz)); printf(" MtzPut: number of batches to be written %d \n",numbat); } for (i = 0; i < numbat; i += 12) { sprintf(hdrrec,"BATCH "); l = 6; for (j = 0; j < 12 && i+j < numbat; ++j) { sprintf(hdrrec+6+6*j,"%6d",batch->num); l += 6; batch = batch->next; } MtzWhdrLine(fileout,l,hdrrec); } } /* write out unrecognized headers */ if ( mtz->unknown_headers ) for (i = 0; i < mtz->n_unknown_headers; ++i) MtzWhdrLine(fileout,MTZRECORDLENGTH,mtz->unknown_headers+i*MTZRECORDLENGTH); sprintf(hdrrec,"END "); MtzWhdrLine(fileout,4,hdrrec); if (debug) printf(" MtzPut: main header written \n"); if (mtz->histlines > 0) { sprintf(hdrrec,"MTZHIST %3d",mtz->histlines); MtzWhdrLine(fileout,11,hdrrec); for (i = 0; i < mtz->histlines; ++i) { strncpy(hdrrec,mtz->hist + MTZRECORDLENGTH*i,MTZRECORDLENGTH); MtzWhdrLine(fileout,MTZRECORDLENGTH,hdrrec); } } if (MtzNbat(mtz) > 0) { batch = mtz->batch; /* if new batch headers have been written, lose the old ones */ if (MtzNbat(mtz) > mtz->n_orig_bat) for (i=0; i < mtz->n_orig_bat; ++i) batch = batch->next; sprintf(hdrrec,"MTZBATS"); MtzWhdrLine(fileout,7,hdrrec); while (batch != NULL) { sprintf(hdrrec,"BH %8d%8d%8d%8d",batch->num,nwords,nintegers,nreals); MtzWhdrLine(fileout,35,hdrrec); strcpy(hdrrec,"TITLE "); strncpy(hdrrec+6,batch->title,70); MtzWhdrLine(fileout,76,hdrrec); MtzBatchToArray(batch,intbuf,fltbuf); intbuf[0] = nwords; intbuf[1] = nintegers; intbuf[2] = nreals; ccp4_file_setmode(fileout,2); ccp4_file_write(fileout, (uint8 *) buf, nwords); ccp4_file_setmode(fileout,0); if (batch->gonlab[0][0] != '\0') { sprintf(hdrrec,"BHCH %8s%8s%8s",batch->gonlab[0],batch->gonlab[1],batch->gonlab[2]); } else { sprintf(hdrrec,"BHCH "); } MtzWhdrLine(fileout,29,hdrrec); batch = batch->next; } } if (debug) printf(" MtzPut: batch headers written \n"); sprintf(hdrrec,"MTZENDOFHEADERS "); MtzWhdrLine(fileout,16,hdrrec); /* write XML data block */ if ( mtz->xml != NULL ) { ccp4_file_setmode(fileout,0); ccp4_file_writechar(fileout,(const uint8 *)mtz->xml,strlen(mtz->xml)); } /* go back and correct hdrst */ ccp4_file_setmode(fileout,0); ccp4_file_seek(fileout, 4, SEEK_SET); hdrst = (int64_t) mtz->nref * (int64_t) MtzNumActiveCol(mtz) + SIZE1 + 1; if (hdrst > INT_MAX) { tmp_hdrst = -1; } else { tmp_hdrst = (int32_t) hdrst; hdrst = 0; } ccp4_file_setmode(fileout, 2); ccp4_file_write(fileout,(uint8 *) &tmp_hdrst, 1); if (hdrst > 0) { ccp4_file_seek(fileout, 3, SEEK_SET); ccp4_file_setmode(fileout, 5); ccp4_file_write(fileout,(uint8 *) &hdrst, 1); ccp4_file_setmode(fileout, 2); } /* And close the mtz file: */ if (!mtz->fileout) ccp4_file_close(fileout); if (debug) printf(" MtzPut: bye bye \n"); return 1; } MTZBAT *sort_batches(MTZBAT *batch, int numbat) { int debug=0; int i,max_num_bat,isort=0,nmerges,sublistsize=1,sublist1,sublist2; MTZBAT *cur_batch1, *cur_batch2, *sorted_batch, *tail; MTZBAT *tmp; /* first check if already in order */ cur_batch1 = batch; max_num_bat = cur_batch1->num; for (i=0; i < numbat; ++i) { cur_batch1 = cur_batch1->next; /* reached end of list */ if (!cur_batch1) return batch; if (cur_batch1->num < max_num_bat) { isort=1; break; } else { max_num_bat = cur_batch1->num; } } if (!isort) return batch; if (ccp4_liberr_verbosity(-1)) printf("\n Note: Sorting batch headers prior to writing to file... \n\n"); /* Sort */ /* This is Simon Tatham's algorithm, implemented for batches. */ if (debug) { tmp = batch; for (i=0; i < numbat; ++i) { printf(" %d",tmp->num); tmp = tmp->next; } printf(" \n"); } while (1) { if (debug) printf(" sort_batches: pass with sublist size %d \n",sublistsize); cur_batch1 = batch; tail = NULL; batch = NULL; nmerges = 0; while (cur_batch1) { ++nmerges; cur_batch2 = cur_batch1; sublist1 = 0; while (cur_batch2 && sublist1 < sublistsize) { ++sublist1; cur_batch2 = cur_batch2->next; } sublist2 = sublistsize; while (sublist1 > 0 || (sublist2 > 0 && cur_batch2)) { /* decide whether next batch comes from cur_batch1 or cur_batch2 */ if (sublist1 == 0) { /* cur_batch1 is empty; batch must come from cur_batch2. */ sorted_batch = cur_batch2; cur_batch2 = cur_batch2->next; sublist2--; } else if (sublist2 == 0 || !cur_batch2) { /* cur_batch2 is empty; batch must come from cur_batch1. */ sorted_batch = cur_batch1; cur_batch1 = cur_batch1->next; sublist1--; } else if (cur_batch1->num <= cur_batch2->num ) { /* cur_batch1 number is lower (or same); batch must come from cur_batch1. */ sorted_batch = cur_batch1; cur_batch1 = cur_batch1->next; sublist1--; } else { /* cur_batch2 number is lower; batch must come from cur_batch2. */ sorted_batch = cur_batch2; cur_batch2 = cur_batch2->next; sublist2--; } /* add the next element to the merged list */ if (tail) { tail->next = sorted_batch; } else { batch = sorted_batch; } tail = sorted_batch; } /* sorted this sub-list - move to next */ cur_batch1 = cur_batch2; } tail->next = NULL; if (debug) { tmp = batch; for (i=0; i < numbat; ++i) { printf(" %d",tmp->num); tmp = tmp->next; } printf(" \n"); } /* If we have done only one merge, we're finished. */ if (nmerges <= 1) /* allow for nmerges==0, the empty list case */ return batch; /* Otherwise repeat, merging lists twice the size */ sublistsize *= 2; } } CCP4File *MtzOpenForWrite(const char *logname) { CCP4File *fileout; int debug=0; int32_t hdrst; char *filename; if (debug) printf(" MtzOpenForWrite: entering \n"); /* Open the mtz file: */ if (getenv(logname) != NULL) { filename = strdup(getenv(logname)); } else { filename = strdup(logname); } fileout = ccp4_file_open(filename,O_RDWR | O_TRUNC); if (! fileout ) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_CantOpenFile),"MtzOpenForWrite",NULL); return NULL; } if (debug) printf(" MtzOpenForWrite: file opened \n"); /* Write initial info */ ccp4_file_setmode(fileout,0); ccp4_file_writechar(fileout, (uint8 *) "MTZ ",4); ccp4_file_setmode(fileout,2); hdrst = SIZE1 + 1; ccp4_file_write(fileout,(uint8 *) &hdrst,1); ccp4_file_setstamp(fileout,2); /* Write architecture */ ccp4_file_warch(fileout); if (debug) printf(" MtzOpenForWrite: stamp written \n"); /* Position at start of reflections - intervening gap should be filled with zeros */ ccp4_file_seek(fileout, SIZE1, SEEK_SET); free(filename); if (debug) printf(" MtzOpenForWrite: bye bye \n"); return fileout; } int MtzBatchToArray(MTZBAT *batch, int *intbuf, float *fltbuf) { int i; if (!batch) return 0; for (i = 0; i < NBATCHINTEGERS; ++i) intbuf[i] = 0; for (i = 0; i < NBATCHREALS; ++i) fltbuf[i] = 0.0; intbuf[3] = batch->iortyp; for (i = 0; i < 6; ++i) intbuf[4+i] = batch->lbcell[i]; intbuf[10] = batch->misflg; intbuf[11] = batch->jumpax; intbuf[12] = batch->ncryst; intbuf[13] = batch->lcrflg; intbuf[14] = batch->ldtype; intbuf[15] = batch->jsaxs; intbuf[16] = batch->nbscal; intbuf[17] = batch->ngonax; intbuf[18] = batch->lbmflg; intbuf[19] = batch->ndet; intbuf[20] = batch->nbsetid; for (i = 0; i < 6; ++i) fltbuf[i] = batch->cell[i]; for (i = 0; i < 9; ++i) fltbuf[6 + i] = batch->umat[i]; for (i = 0; i < 3; ++i) fltbuf[15 + i] = batch->phixyz[0][i]; for (i = 0; i < 3; ++i) fltbuf[18 + i] = batch->phixyz[1][i]; for (i = 0; i < 12; ++i) fltbuf[21 + i] = batch->crydat[i]; for (i = 0; i < 3; ++i) fltbuf[33 + i] = batch->datum[i]; fltbuf[36] = batch->phistt; fltbuf[37] = batch->phiend; for (i = 0; i < 3; ++i) fltbuf[38 + i] = batch->scanax[i]; fltbuf[41] = batch->time1; fltbuf[42] = batch->time2; fltbuf[43] = batch->bscale; fltbuf[44] = batch->bbfac; fltbuf[45] = batch->sdbscale; fltbuf[46] = batch->sdbfac; fltbuf[47] = batch->phirange; for (i = 0; i < 3; ++i) fltbuf[59 + i] = batch->e1[i]; for (i = 0; i < 3; ++i) fltbuf[62 + i] = batch->e2[i]; for (i = 0; i < 3; ++i) fltbuf[65 + i] = batch->e3[i]; for (i = 0; i < 3; ++i) fltbuf[80 + i] = batch->source[i]; for (i = 0; i < 3; ++i) fltbuf[83 + i] = batch->so[i]; fltbuf[86] = batch->alambd; fltbuf[87] = batch->delamb; fltbuf[88] = batch->delcor; fltbuf[89] = batch->divhd; fltbuf[90] = batch->divvd; for (i = 0; i < batch->ndet; ++i) { fltbuf[111 + (i * 6)] = batch->dx[i]; fltbuf[112 + (i * 6)] = batch->theta[i]; fltbuf[113 + (i * 6)] = batch->detlm[i][0][0]; fltbuf[114 + (i * 6)] = batch->detlm[i][0][1]; fltbuf[115 + (i * 6)] = batch->detlm[i][1][0]; fltbuf[116 + (i * 6)] = batch->detlm[i][1][1];} return 1; } int MtzWhdrLine(CCP4File *fileout, int nitems, char buffer[]) { /* write header record to fileout. Record is filled from nitems to MTZRECORDLENGTH by blanks. If a C-style null terminator is encountered before nitems are copied then the null terminator character is not copied and the string is padded with blanks from that point onwards */ char hdrrec[MTZRECORDLENGTH]; int i,j; for (i = 0; i < nitems; ++i) { /* Trap for C-style null character */ if (buffer[i] == '\0') { break; } hdrrec[i] = buffer[i]; } for (j = i; j < MTZRECORDLENGTH; ++j) hdrrec[j] = ' '; return (ccp4_file_writechar(fileout, (uint8 *) hdrrec,MTZRECORDLENGTH)); } int MtzWrefl(CCP4File *fileout, int ncol, float *refldata) { if (!fileout) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_NoFile),"MtzWrefl",NULL); return 0; } return (ccp4_file_write(fileout, (uint8 *) refldata, ncol)); } MTZ *MtzMalloc(int nxtal, int nset[]) { MTZ *mtz; int i,j,itime[3]; float zerocell[6]={0.0}; char dummy_xname[17]; ccp4_utils_itime(itime); sprintf(dummy_xname,"NULL_xname%2.2d%2.2d%2.2d",itime[0],itime[1],itime[2]); dummy_xname[16]='\0'; /* Allocate main header and symmetry */ mtz = (MTZ *) ccp4_utils_malloc(sizeof(MTZ)); if (mtz == NULL) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_AllocFail),"MtzMalloc",NULL); return NULL; } memset(mtz,'\0',sizeof(MTZ)); mtz->nxtal=0; ccp4array_new_size(mtz->xtal,5); /* Allocate crystals and datasets. */ if (nxtal == 0) { mtz->xtal[0] = NULL; } else { for (i = 0; i < nxtal; ++i) { /* This adds mtz->xtal[i] */ if ( ! MtzAddXtal(mtz,dummy_xname,"NULL_pname",zerocell) ) return NULL; mtz->xtal[i]->nset = 0; for (j = 0; j < nset[i]; ++j) { /* This adds mtz->xtal[i]->set[j] */ if ( ! MtzAddDataset(mtz,mtz->xtal[i],"NULL_dname",0.0) ) return NULL; } } } /* initialise main header */ mtz->filein = NULL; mtz->fileout = NULL; mtz->title[0] = '\0'; mtz->hist = NULL; mtz->histlines = 0; mtz->nxtal = nxtal; mtz->ncol_read = 0; mtz->nref = 0; mtz->nref_filein = 0; mtz->refs_in_memory = 1; mtz->n_orig_bat = 0; mtz->resmax_out = 0.0f; mtz->resmin_out = 999.0f; sprintf(mtz->mnf.amnf,"NAN"); mtz->mtzsymm.spcgrp = 0; mtz->mtzsymm.spcgrpname[0] = '\0'; mtz->mtzsymm.nsym = 0; mtz->mtzsymm.nsymp = 0; mtz->mtzsymm.symtyp = '\0'; mtz->mtzsymm.pgname[0] = '\0'; mtz->mtzsymm.spg_confidence = '\0'; mtz->batch = NULL; for (i = 0; i < 5; ++i) { mtz->order[i] = NULL; } mtz->xml = NULL; mtz->unknown_headers = NULL; mtz->n_unknown_headers = 0; return(mtz); } int MtzFree(MTZ *mtz) /* Frees the memory reserved for 'mtz' */ { int i,j,k; /* Close attached mtz files */ if (mtz->filein) { ccp4_file_close(mtz->filein); mtz->filein = NULL; } if (mtz->fileout) { ccp4_file_close(mtz->fileout); mtz->fileout = NULL; } /* Loop over crystals */ for (i = 0; i < mtz->nxtal; ++i) { /* Loop over datasets for each crystal */ for (j = 0; j < mtz->xtal[i]->nset; ++j) { /* Loop over columns for each dataset */ for (k = 0; k < mtz->xtal[i]->set[j]->ncol; ++k) { MtzFreeCol(mtz->xtal[i]->set[j]->col[k]); } ccp4array_free(mtz->xtal[i]->set[j]->col); free((void *) mtz->xtal[i]->set[j]); } ccp4array_free(mtz->xtal[i]->set); free((void *) mtz->xtal[i]); } ccp4array_free(mtz->xtal); if (mtz->batch) { MtzFreeBatch(mtz->batch); mtz->batch = NULL; } if (mtz->hist != NULL) MtzFreeHist(mtz->hist); if (mtz->xml != NULL) free(mtz->xml); if (mtz->unknown_headers != NULL) free(mtz->unknown_headers); free((void *) mtz); return 1; } MTZBAT *MtzMallocBatch() /* Allocates memory for a single batch header */ { MTZBAT *batch; batch = (MTZBAT *) ccp4_utils_malloc(sizeof(MTZBAT)); if (batch == NULL) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_AllocFail),"MtzMallocBatch",NULL); return NULL; } memset(batch,'\0',sizeof(MTZBAT)); batch->next = NULL; return(batch); } int MtzFreeBatch(MTZBAT *batch) /* Frees the memory reserved for 'batch' */ { MTZBAT* cbatch = batch; while (cbatch != NULL) { MTZBAT* pbatch = cbatch; cbatch = cbatch->next; free(pbatch); pbatch = NULL; } return 1; } MTZCOL *MtzMallocCol(MTZ *mtz, int nref) { MTZCOL *col; col = (MTZCOL *) ccp4_utils_malloc(sizeof(MTZCOL)); if (col == NULL) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_AllocFail),"MtzMallocCol",NULL); return NULL; } memset(col,'\0',sizeof(MTZCOL)); col->ref = NULL; if (mtz->refs_in_memory) { ccp4array_new_size(col->ref,nref); if (col->ref == NULL) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_AllocFail),"MtzMallocCol",NULL); return NULL; } } return(col); } int MtzFreeCol(MTZCOL *col) { if (col->ref) ccp4array_free(col->ref); free((void *) col); return 1; } char *MtzCallocHist(int nhist) /* Allocates memory for the mtz history with 'nhist' lines */ { char *hist; hist = (char *) ccp4_utils_calloc(nhist, sizeof(char)*MTZRECORDLENGTH); return(hist); } int MtzFreeHist(char *hist) /* Frees the memory reserved for 'hist' */ { free((void *) hist); return 1; } MTZXTAL *MtzAddXtal(MTZ *mtz, const char *xname, const char *pname, const float cell[6]) { /* add a new crystal to the mtz */ int i,x; MTZXTAL *xtal; xtal = (MTZXTAL *) ccp4_utils_malloc( sizeof(MTZXTAL) ); if (! xtal ) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_AllocFail),"MtzAddXtal",NULL); return NULL; } memset(xtal,'\0',sizeof(MTZXTAL)); /* fill out the data */ strncpy( xtal->xname, xname, 64 ); xtal->xname[64] = '\0'; strncpy( xtal->pname, pname, 64 ); xtal->pname[64] = '\0'; xtal->resmin = 100.0; xtal->resmax = 0.0; for (i = 0; i < 6; i++) xtal->cell[i] = cell[i]; /* make new xtalid */ for (i = x = 0; x < mtz->nxtal; x++) if (mtz->xtal[x]->xtalid > i) i = mtz->xtal[x]->xtalid; xtal->xtalid = ++i; xtal->nset = 0; /* create initial array of 10 pointers to datasets */ ccp4array_new_size(xtal->set,10); /* add pointer to mtz */ if ( ++mtz->nxtal > ccp4array_size(mtz->xtal)) ccp4array_resize(mtz->xtal, mtz->nxtal + 2); mtz->xtal[ mtz->nxtal - 1 ] = xtal; return xtal; } MTZSET *MtzAddDataset(MTZ *mtz, MTZXTAL *xtl, const char *dname, const float wavelength) { /* add a new dataset to the xtal */ int i,x,s; MTZSET *set; set = (MTZSET *) ccp4_utils_malloc( sizeof(MTZSET) ); if ( ! set ) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_AllocFail),"MtzAddDataset",NULL); return NULL; } memset(set,'\0',sizeof(MTZSET)); /* fill out the data */ strncpy( set->dname, dname, 64 ); set->dname[64] = '\0'; set->wavelength = wavelength; /* New setid is one more than greatest current setid. It must be at least 1, unless it is the base dataset setid=0. */ if (!strcmp(set->dname,"HKL_base")) { set->setid = 0; } else { i = 0; for (x = 0; x < mtz->nxtal; x++) for (s = 0; s < mtz->xtal[x]->nset; s++) if (mtz->xtal[x]->set[s]->setid > i) i = mtz->xtal[x]->set[s]->setid; set->setid = ++i; } set->ncol = 0; /* create initial array of 20 pointers to columns */ ccp4array_new_size(set->col,20); /* add pointer to xtal */ if ( ++xtl->nset > ccp4array_size(xtl->set)) ccp4array_resize(xtl->set, xtl->nset + 4); xtl->set[ xtl->nset - 1 ] = set; return set; } MTZCOL *MtzAddColumn(MTZ *mtz, MTZSET *set, const char *label, const char *type) { /* add a new column to the dataset */ int i,nref; union float_uint_uchar uf; MTZCOL *col; if (set->ncol == MCOLUMNS) { printf("MtzAddColumn: No more columns! \n"); return NULL; } /* allocate some memory for first column */ if (!mtz->refs_in_memory) { nref = 0; } else if (mtz->nref == 0) { nref = 2000; } else { nref = mtz->nref; } col = MtzMallocCol(mtz, nref); if (col == NULL) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_AllocFail),"MtzAddColumn",NULL); return NULL; } /* fill out the data */ strncpy( col->label, label, 30 ); col->label[30] = '\0'; strncpy( col->type, type, 2); col->type[2] = '\0'; col->active = 1; col->source = 0; col->min = 1.e06; col->max = -1.e06; col->colsource[0] = '\0'; col->grpname[0] = '\0'; col->grptype[0] = '\0'; col->grpposn = -1; /* add pointer to set */ if ( ++set->ncol > ccp4array_size(set->col)) ccp4array_resize(set->col, set->ncol + 9); set->col[ set->ncol - 1 ] = col; /* initialise column to MNF */ if (strncmp (mtz->mnf.amnf,"NAN",3) == 0) { uf = ccp4_nan(); } else { uf.f = mtz->mnf.fmnf; } for (i=0; i < nref; i++) col->ref[i] = uf.f; return col; } int MtzToggleColumn(MTZCOL *col) { /* Toggle active flag of column */ if (col->active) { col->active = 0; } else { col->active = 1; } return col->active; } MTZSET *MtzColSet(const MTZ *mtz, const MTZCOL *col) { int x,s,c; for (x=0; x < mtz->nxtal; x++) for (s=0; s < mtz->xtal[x]->nset; s++) for (c=0; c < mtz->xtal[x]->set[s]->ncol; c++) if (mtz->xtal[x]->set[s]->col[c] == col) return mtz->xtal[x]->set[s]; printf ("MtzColSet: no such column. \n"); return NULL; } MTZXTAL *MtzSetXtal(const MTZ *mtz, const MTZSET *set) { int x,s; for (x=0; x < mtz->nxtal; x++) for (s=0; s < mtz->xtal[x]->nset; s++) if (mtz->xtal[x]->set[s] == set) return mtz->xtal[x]; printf ("MtzSetXtal: no such dataset. \n"); return NULL; } int MtzNxtal(const MTZ *mtz) { return mtz->nxtal; } int MtzNumActiveXtal(const MTZ *mtz) { int k,ixtal=0; for (k=0; k < mtz->nxtal; k++) if (MtzNumActiveSetsInXtal(mtz,mtz->xtal[k])) ++ixtal; return ixtal; } MTZXTAL **MtzXtals(MTZ *mtz) { return mtz->xtal; } MTZXTAL *MtzIxtal(const MTZ *mtz, const int ixtal) { return mtz->xtal[ixtal]; } int MtzNsetsInXtal(const MTZXTAL *xtal) { return xtal->nset; } int MtzNumActiveSetsInXtal(const MTZ *mtz, const MTZXTAL *xtal) { int k,iset=0; for (k=0; k < xtal->nset; k++) if (MtzNumActiveColsInSet(xtal->set[k]) || MtzNbatchesInSet(mtz, xtal->set[k])) ++iset; return iset; } MTZSET **MtzSetsInXtal(MTZXTAL *xtal) { return xtal->set; } MTZSET *MtzIsetInXtal(const MTZXTAL *xtal, const int iset) { return xtal->set[iset]; } int MtzNcolsInSet(const MTZSET *set) { return set->ncol; } int MtzNumActiveColsInSet(const MTZSET *set) { int k,icol=0; for (k=0; k < set->ncol; k++) icol += set->col[k]->active; return icol; } int MtzNumSourceColsInSet(const MTZSET *set) { int k,icol=0; for (k=0; k < set->ncol; k++) if (set->col[k]->source) ++icol; return icol; } int MtzNbatchesInSet(const MTZ *mtz, const MTZSET *set) { int i,ibatch=0; MTZBAT *batch; batch = mtz->batch; /* if new batch headers have been written, lose the old ones */ if (MtzNbat(mtz) > mtz->n_orig_bat) for (i=0; i < mtz->n_orig_bat; ++i) batch = batch->next; while (batch) { if (batch->nbsetid == set->setid) ++ibatch; batch = batch->next; } return ibatch; } MTZCOL **MtzColsInSet(MTZSET *set) { return set->col; } MTZCOL *MtzIcolInSet(const MTZSET *set, const int icol) { return set->col[icol]; } char *MtzColType(MTZCOL *col) { return col->type; } int MtzNset(const MTZ *mtz) { int x,iset=0; for (x=0; x < mtz->nxtal; x++) iset += MtzNsetsInXtal(mtz->xtal[x]); return iset; } int MtzNumActiveSet(const MTZ *mtz) { int x,iset=0; for (x=0; x < mtz->nxtal; x++) iset += MtzNumActiveSetsInXtal(mtz,mtz->xtal[x]); return iset; } int MtzNcol(const MTZ *mtz) { int x,s,icol=0; for (x=0; x < mtz->nxtal; x++) for (s=0; s < mtz->xtal[x]->nset; s++) icol += MtzNcolsInSet(mtz->xtal[x]->set[s]); return icol; } int MtzNumActiveCol(const MTZ *mtz) { int x,s,icol=0; for (x=0; x < mtz->nxtal; x++) for (s=0; s < mtz->xtal[x]->nset; s++) icol += MtzNumActiveColsInSet(mtz->xtal[x]->set[s]); return icol; } int MtzNumSourceCol(const MTZ *mtz) { int x,s,icol=0; for (x=0; x < mtz->nxtal; x++) for (s=0; s < mtz->xtal[x]->nset; s++) icol += MtzNumSourceColsInSet(mtz->xtal[x]->set[s]); return icol; } int MtzNref(const MTZ *mtz) { /* get the number of reflections in the mtz */ return mtz->nref; } int MtzNbat(const MTZ *mtz) { /* get the number of batches in the mtz */ int cnt=0; MTZBAT *batch; for (batch = mtz->batch ; batch != NULL ; batch = batch->next ) ++cnt; return cnt; } char *MtzXtalPath(const MTZXTAL *xtal) { /* Return the full path name of a crystal */ char *path; size_t length; length = strlen(xtal->xname)+2; path = (char *) ccp4_utils_malloc(length*sizeof(char)); strcpy( path, "/" ); strcat( path, xtal->xname ); path[length-1] = '\0'; return ( path ); } char *MtzSetPath(const MTZ *mtz, const MTZSET *set) { /* Return the full path name of a dataset */ char *path, *path1; size_t length; path1 = MtzXtalPath( MtzSetXtal( mtz, set ) ); length = strlen(path1)+strlen(set->dname)+2; path = ccp4_utils_malloc(length*sizeof(char)); strcpy( path, path1 ); free (path1); strcat( path, "/" ); strcat( path, set->dname ); path[length-1] = '\0'; return ( path ); } char *MtzColPath(const MTZ *mtz, const MTZCOL *col) { /* Return the full path name of a column */ char *path, *path1; size_t length; path1 = MtzSetPath( mtz, MtzColSet( mtz, col ) ); length = strlen(path1)+strlen(col->label)+2; path = (char *) ccp4_utils_malloc(length*sizeof(char)); strcpy( path, path1 ); free (path1); strcat( path, "/" ); strcat( path, col->label ); path[length-1] = '\0'; return ( path ); } int MtzRJustPath(char *path, const char *partial, const int njust) { /* Complete a right-justified path by prefixing with wildcards */ int i, j; /* count the slashes */ for ( i = j = 0; i < strlen(partial); i++ ) if ( partial[i] == '/' ) j++; strcpy( path, ""); if ( j++ < njust ) strcat( path, "/" ); while ( j++ < njust ) strcat( path, "*/" ); strcat( path, partial ); return 1; } int MtzPathMatch(const char *path1, const char *path2) { /* test for match between two paths, including wildcards */ /* this version only handles wildcards at the end of name components */ int p1 = 0, p2 = 0; while ( path1[p1] != '\0' && path2[p2] != '\0' ) { /* search both paths */ if ( path1[p1] != path2[p2] ) { if ( path1[p1] != '*' && path2[p2] != '*' ) return FALSE; /* non-wild mismatch is terminal */ while ( path1[p1] != '/' && path1[p1] != '\0' ) p1++; /* skip compnt */ while ( path2[p2] != '/' && path2[p2] != '\0' ) p2++; /* skip compnt */ } else { p1++; p2++; } } return (path1[p1] == path2[p2]); /* true only if both paths ended */ } MTZCOL *MtzColLookup(const MTZ *mtz, const char *label) { /* Returns a pointer to the column of mtz with the given `label`, or NULL */ int x,s,c; char *path1, path2[200]; /* complete the right-justified path */ MtzRJustPath( path2, label, 3 ); /* now find the matching column */ for (x=0; x < mtz->nxtal; x++) /* not much point in optimising this */ for (s=0; s < mtz->xtal[x]->nset; s++) for (c=0; c < mtz->xtal[x]->set[s]->ncol; c++) { path1 = MtzColPath(mtz, mtz->xtal[x]->set[s]->col[c]); if ( MtzPathMatch( path1, path2 ) ) { free (path1); return mtz->xtal[x]->set[s]->col[c]; } free (path1); } return NULL; } MTZSET *MtzSetLookup(const MTZ *mtz, const char *label) { int x,s; char *path1, path2[200]; /* complete the right-justified path */ MtzRJustPath( path2, label, 2 ); /* now find the matching column */ for (x=0; x < mtz->nxtal; x++) for (s=0; s < mtz->xtal[x]->nset; s++) { path1 = MtzSetPath(mtz, mtz->xtal[x]->set[s]); if ( MtzPathMatch( path1, path2 ) ) { free (path1); return mtz->xtal[x]->set[s]; } free (path1); } return NULL; } MTZXTAL *MtzXtalLookup(const MTZ *mtz, const char *label) { /* Returns a pointer to the crystal of mtz with the given `label`, or NULL */ int x; char *path1, path2[200]; /* complete the right-justified path */ MtzRJustPath( path2, label, 1 ); /* now find the matching column */ for (x=0; x < mtz->nxtal; x++) { path1 = MtzXtalPath(mtz->xtal[x]); if ( MtzPathMatch( path1, path2 ) ) { free (path1); return mtz->xtal[x]; } free (path1); } return NULL; } libccp4-8.0.0/ccp4/cmtzlib.h0000644000000000000000000011760414242731033013643 0ustar 00000000000000/* cmtzlib.h: header file for cmtzlib.c Copyright (C) 2001 CCLRC, Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @page cmtz_page CMTZ library * * @verbatim @endverbatim * * @section cmtz_file_list File list
  • cmtzlib.h - contains details of the C/C++ API
  • mtzdata.h - contains details of the MTZ data structure
* @section cmtz_overview Overview The CMTZ library is centred around a data structure, defined in mtzdata.h Reading an MTZ file causes a data structure to be created and populated from the MTZ header. There are a variety of functions for manipulating the data structure, for example adding crystals, datasets or columns. The data structure can be dumped to an output MTZ data file.

The library operates in two modes with respect to the reflection data. If mtz->refs_in_memory = 1 (as set e.g. by the argument to MtzGet), then all reflection data is read into memory from the file, and can be manipulated in memory. Else if mtz->refs_in_memory = 0 then explicit calls to ccp4_lrrefl, ccp4_lrreff and ccp4_lwrefl are required to read and write reflections from/to disk.

Information on the data structure is given in mtzdata.h * @section cmtz_princ_func Principal Functions * @subsection cmtz_reading Reading MTZ files Start by looking at MtzGet and ccp4_lrrefl / ccp4_lrreff. * @subsection cmtz_writing Writing MTZ files If you have a structure in memory already, use MtzPut followed by MtzFree to release the memory.

If you need to create a structure from scratch (i.e. without reading from an input file) then use MtzMalloc, MtzOpenForWrite, ccp4_lwsymm, MtzAddXtal, MtzAddDataset, MtzAddColumn and ccp4_lwrefl. * @section cmtz_symmetry Symmetry Information All reflection data in an MTZ file is assumed to belong to the same spacegroup. The spacegroup is identified in the MTZ file by SYMINF and SYMM records in the file header. This information is copied into the in-memory data structure. The list of symmetry operators (copied from the SYMM header records) is taken to be the definitive indicator of the spacegroup.

The functions ccp4_lrsymi, ccp4_lrsymm and ccp4_lwsymm read from and write to the symmetry sections of the data structure. No symmetry manipulations are done within the CMTZ library itself. Within CCP4, the CSYM library provides appropriate functions, but other symmetry libraries could be used. * @section cmtz_examples Examples See examples on ftp area */ /** @file cmtzlib.h * * @brief C-level library for input, output and manipulation of MTZ files. * * Functions defining the C-level API for accessing MTZ files. * MtzGet and MtzPut read and write MTZ files to/from a data * structure defined in mtzdata.h Other functions allow one * to access data structure members, and to manipulate the structure * and the values of structure members. Functions with names * beginning ccp4_lr or ccp4_lw are primarily * to support the Fortran API. * * @author Martyn Winn */ #ifndef __CMTZLib__ #define __CMTZLib__ /* rcsidhm[100] = "$Id$" */ /* defines CCP4::CCP4File */ #include "ccp4_utils.h" #ifdef __cplusplus namespace CMtz { extern "C" { typedef CCP4::CCP4File CCP4File; #endif /* needs to be here for C++ to use CCP4File typedef */ #include "mtzdata.h" /**** MTZ i/o ****/ /** Reads the contents of the MTZ file into an MTZ structure. * @param logname (I) Logical name of MTZ file * @param read_refs (I) Whether to read reflections into memory (non-zero) or * to read later from file (zero) * @return Pointer to MTZ struct */ MTZ *MtzGet(const char *logname, int read_refs); /** Reads the contents of the MTZ file into an MTZ structure. As for function * MtzGet except for extra argument cell_tolerance. * @param logname (I) Logical name of MTZ file * @param read_refs (I) Whether to read reflections into memory (non-zero) or * to read later from file (zero) * @param cell_tolerance (I) User-defined tolerance for ccp4uc_cells_differ. * Setting this to zero means that a new crystal is generated whenever * dataset cell dimensions are different. MtzGet allows for a certain * variation within a single crystal. * @return Pointer to MTZ struct */ MTZ *MtzGetUserCellTolerance(const char *logname, int read_refs, const double cell_tolerance); /** Reads reflection data from MTZ file. * @param filein pointer to input file * @param ncol number of columns to read * @param refldata array of reflection data * @return istat from ccp4_file_read */ int MtzRrefl(CCP4File *filein, int ncol, float *refldata); /** Writes an MTZ data structure to disk. If file is already open, MtzPut * uses file pointer in mtz struct, else uses logical name of file. * @param mtz pointer to MTZ struct. * @param logname logical name for output file or blank. * @return 1 on success, 0 on failure */ int MtzPut(MTZ *mtz, const char *logname); /** Opens a new MTZ file for writing. The output file can be specified * either with a true filename, or more likely as a logical name * corresponding to an environment variable or a CCP4 command line * argument such as HKLOUT. * @param logname logical name or filename for output file. * @return pointer to file or NULL on failure */ CCP4File *MtzOpenForWrite(const char *logname); /** Write header record to fileout. Record is filled from * buffer and padded by blanks to a total length of MTZRECORDLENGTH. * @param fileout Pointer to output file. * @param nitems Number of characters in buffer. * @param buffer Character buffer containing MTZ header line. * @return Number of bytes written on success, EOF on failure. */ int MtzWhdrLine(CCP4File *fileout, int nitems, char buffer[]); /** Write ncol column entries to fileout from refldata. * @param fileout pointer to output MTZ file. * @param ncol number of reflection data items to write. * @param refldata array of reflection data items. * @return Number of items written. If this is less than ncol, then * that indicates a write error. */ int MtzWrefl(CCP4File *fileout, int ncol, float *refldata); /** Delete a reflection from the data structure. Beware, there * is no going back! * @param mtz pointer to MTZ struct. * @param iref index of reflection * @return 0 if successful, 1 otherwise */ int MtzDeleteRefl(MTZ *mtz, int iref); /** Position input file at start of reflections. Useful if you need * to read the reflections a second time. * @param mtz pointer to MTZ struct. */ void MtzRewdInput(MTZ *mtz); /**** Memory allocation ****/ /** Allocates memory for an MTZ header structure. The structure can * contain 0, 1 or more crystals, and for each crystal 0, 1 or more * datasets. Crystals have a name based on the time "NULL_xnameHHMMSS" * to ensure uniqueness (compared to crystals defined elsewhere - all * new crystals created here will (probably) have the same name). * Crystals have the project name "NULL_pname", and datasets have the * name "NULL_dname". * @param nxtal Number of crystals to allocate. * @param nset Number of datasets for each crystal to allocate. * @return pointer to MTZ header struct */ MTZ *MtzMalloc(int nxtal, int nset[]); /** Frees the memory reserved for the MTZ header struct. * @param mtz pointer to MTZ header struct. * @return 1 on success, 0 on failure */ int MtzFree(MTZ *mtz); /** Allocates memory for an MTZ column. Space is allocated for * the reflection data if and only if mtz->refs_in_memory is set. * @param mtz pointer to MTZ header struct. * @param nref number of reflections in column. * @return pointer to MTZ column. */ MTZCOL *MtzMallocCol(MTZ *mtz, int nref); /** Frees the memory reserved for 'col' * @param col pointer to MTZ column. * @return 1 on success, 0 on failure */ int MtzFreeCol(MTZCOL *col); /** Allocates memory for a single batch header. * @return pointer to batch */ MTZBAT *MtzMallocBatch(void); /** Frees the memory reserved for 'batch'. * @param batch * @return 1 on success, 0 on failure */ int MtzFreeBatch(MTZBAT *batch); /** Allocates memory for the mtz history with 'nhist' lines. * @param nhist * @return pointer to history */ char *MtzCallocHist(int nhist); /** Frees the memory reserved for 'hist'. * @param hist * @return 1 on success, 0 on failure */ int MtzFreeHist(char *hist); /** Free all memory malloc'd from static pointers. * To be called before program exit. The function can be * registered with atexit. * @return void */ void MtzMemTidy(void); /**** Header operations ****/ /** Get the number of batches in the mtz. * @param mtz pointer to MTZ struct * @return Number of batches. */ int MtzNbat(const MTZ *mtz); /** Get the number of reflections in the mtz. * @param mtz pointer to MTZ struct * @return Number of reflections. */ int MtzNref(const MTZ *mtz); /** Get the spacegroup number (likely CCP4 convention). * @param mtz pointer to MTZ struct * @return Spacegroup number. */ int MtzSpacegroupNumber(const MTZ *mtz); /** Return the overall resolution limits of the MTZ structure. * These are the widest limits over all crystals present. * @param mtz pointer to MTZ struct * @param minres minimum resolution * @param maxres maximum resolution * @return 1 on success, 0 on failure */ int MtzResLimits(const MTZ *mtz, float *minres, float *maxres); /**** Crystal operations ****/ /** Get the total number of crystals in the MTZ structure * @param mtz pointer to MTZ struct * @return number of active crystals */ int MtzNxtal(const MTZ *mtz); /** Get the number of active crystals in the MTZ structure * @param mtz pointer to MTZ struct * @return number of active crystals */ int MtzNumActiveXtal(const MTZ *mtz); /** Return array of pointers to crystals. * @param mtz pointer to MTZ struct * @return array of pointers to crystals */ MTZXTAL **MtzXtals(MTZ *mtz); /** Return pointer to the ixtal'th crystal. * @param mtz pointer to MTZ struct * @param ixtal number of the particular crystal (ixtal = 0 ... MtzNxtal(xtal) -1 * @return pointer to the specified crystal */ MTZXTAL *MtzIxtal(const MTZ *mtz, const int ixtal); /** Return the full path name of a crystal as "/xname" * Memory for the path name is assigned with malloc, and can * be free'd by the calling function. * @param xtal pointer to the crystal struct * @return pointer to string containing path name */ char *MtzXtalPath(const MTZXTAL *xtal); /** Returns a pointer to the crystal of mtz with the given `label`, or NULL. * @param mtz pointer to MTZ struct * @param label * @return pointer to crystal */ MTZXTAL *MtzXtalLookup(const MTZ *mtz, const char *label); /** Add a crystal to header mtz. * @param mtz pointer to MTZ struct * @param xname Crystal name. * @param pname Name of associated project. * @param cell Cell dimensions of crystal. * @return Pointer to crystal. */ MTZXTAL *MtzAddXtal(MTZ *mtz, const char *xname, const char *pname, const float cell[6]); /** For a given crystal, return number of datasets in that crystal. * @param xtal pointer to the crystal struct * @return number of datasets */ int MtzNsetsInXtal(const MTZXTAL *xtal); /** For a given crystal, return number of active datasets in that crystal. * @param xtal pointer to the crystal struct * @return number of datasets */ int MtzNumActiveSetsInXtal(const MTZ *mtz, const MTZXTAL *xtal); /** For a given crystal, return array of pointers to datasets * in that crystal. * @param xtal pointer to the crystal struct * @return array of pointers to datasets */ MTZSET **MtzSetsInXtal(MTZXTAL *xtal); /** For a given crystal, return pointer to the iset'th dataset * in that crystal. * @param xtal pointer to the crystal struct * @param iset number of the particular dataset (iset = 0 ... MtzNsetsInXtal(xtal) -1 * @return pointer to specified dataset */ MTZSET *MtzIsetInXtal(const MTZXTAL *xtal, const int iset); /**** Dataset operations ****/ /** Get the number of datasets in the MTZ structure * @param mtz pointer to MTZ struct * @return total number of datasets */ int MtzNset(const MTZ *mtz); /** Get the number of active datasets in the MTZ structure * @param mtz pointer to MTZ struct * @return total number of datasets */ int MtzNumActiveSet(const MTZ *mtz); /** Get the crystal associated with a dataset * The pointer to MTZ is required to do reverse lookup of xname. * @param mtz pointer to MTZ struct * @param set pointer to dataset * @return pointer to parent crystal, or NULL if "set" is * not present in "mtz". */ MTZXTAL *MtzSetXtal(const MTZ *mtz, const MTZSET *set); /** Return the full path name of a dataset as "/xname/dname" * The pointer to MTZ is required to do reverse lookup of xname. * Memory for the path name is assigned with malloc, and can * be free'd by the calling function. * @param mtz pointer to MTZ struct * @param set pointer to dataset * @return pointer to string containing path name */ char *MtzSetPath(const MTZ *mtz, const MTZSET *set); /** Returns a pointer to the dataset of MTZ with the given label. * @param mtz pointer to MTZ struct. * @param label Label of desired set. This could be or * /. * @return pointer to set or NULL if not found */ MTZSET *MtzSetLookup(const MTZ *mtz, const char *label); /** Add a dataset to crystal xtl * @param mtz pointer to MTZ struct. * @param xtl pointer to crystal struct. * @param dname Dataset name * @param wavelength X-ray wavelength of dataset * @return pointer to set */ MTZSET *MtzAddDataset(MTZ *mtz, MTZXTAL *xtl, const char *dname, const float wavelength); /** For a given dataset, return number of columns in that dataset. * This is simply set->ncol and so includes all columns irrespective * of col->active * @param set pointer to dataset * @return number of columns */ int MtzNcolsInSet(const MTZSET *set); /** For a given dataset, return number of active columns in that dataset. * @param set pointer to dataset * @return number of active columns */ int MtzNumActiveColsInSet(const MTZSET *set); /** For a given dataset, return number of columns in that dataset * which have a source in an input file (i.e. non-zero source attribute). * @param set pointer to dataset * @return number of source columns */ int MtzNumSourceColsInSet(const MTZSET *set); /** For a given dataset, return number of batches in that dataset. * @param mtz pointer to MTZ struct * @param set pointer to dataset * @return number of batches */ int MtzNbatchesInSet(const MTZ *mtz, const MTZSET *set); /** For a given dataset, return array of pointers to columns * in that dataset. * @param set pointer to dataset * @return array of pointers to columns */ MTZCOL **MtzColsInSet(MTZSET *set); /** For a given dataset, return pointer to the icol'th column * in that dataset. * @param set pointer to dataset * @param icol number of * the particular column (icol = 0 ... MtzNcolsInSet(set) -1 * @return pointer to specified column */ MTZCOL *MtzIcolInSet(const MTZSET *set, const int icol); /**** Column operations ****/ /** Add a column to dataset set and create + fill with NAN * @param mtz pointer to MTZ struct * @param set pointer to dataset * @param label Column label * @param type Column type * @return pointer to column */ MTZCOL *MtzAddColumn(MTZ *mtz, MTZSET *set, const char *label, const char *type); /** Assigns HKL columns to the base dataset. * @param mtz pointer to MTZ struct * @return 1 on success, 0 on failure */ int MtzAssignHKLtoBase(MTZ *mtz); /** Assigns a column to a dataset identified by crystal_name and * dataset_name. First, the function checks whether the * column already belongs to this dataset, in which case it does nothing. * Then it checks if the requested dataset exists. If not, it is created, * though it is better to explicitly create it beforehand. Finally, the column * is assigned to the dataset. * @param mtz pointer to MTZ struct * @param col pointer to column * @param crystal_name name of crystal containing dataset * @param dataset_name name of dataset * @return 1 on success, 0 on failure */ int MtzAssignColumn(MTZ *mtz, MTZCOL *col, const char crystal_name[], const char dataset_name[]); /** Toggle active flag of column. A value of 0 means inactive and will * not be written out, whereas a value of 1 means active and will * be written out. * @param col pointer to column * @return New value of col->active. */ int MtzToggleColumn(MTZCOL *col); /** Get the dataset associated with a column. * @param mtz pointer to MTZ struct * @param col pointer to column of interest * @return pointer to set containing column of interest, or NULL * if "col" is not contained in "mtz". */ MTZSET *MtzColSet(const MTZ *mtz, const MTZCOL *col); /** Get the number of columns in the MTZ data structure. * @param mtz pointer to MTZ struct * @return number of columns */ int MtzNcol(const MTZ *mtz); /** Get the number of active columns in the MTZ data structure. * @param mtz pointer to MTZ struct * @return number of columns */ int MtzNumActiveCol(const MTZ *mtz); /** Get the number of columns in the MTZ data structure which have * a source in an input file (i.e. non-zero source attribute). * @param mtz pointer to MTZ struct * @return number of columns */ int MtzNumSourceCol(const MTZ *mtz); /** Return the full path name of a column as "/xname/dname/label" * Memory for the path name is assigned with malloc, and can * be free'd by the calling function. * @param mtz pointer to MTZ struct * @param col pointer to MTZ column. * @return full path name of column */ char *MtzColPath(const MTZ *mtz, const MTZCOL *col); /** Complete a right-justified path by prefixing with wildcards * @param path Completed path. * @param partial Partial right-justified path * @param njust * @return 1 on success, 0 on failure. */ int MtzRJustPath(char *path, const char *partial, const int njust); /** Test for match between two paths, including wildcards * @param path1 First path * @param path2 Second path * @return 1 if paths match, else 0. */ int MtzPathMatch(const char *path1, const char *path2); /** Returns a pointer to the column of mtz with the given `label`, or NULL * @param mtz pointer to MTZ struct * @param label Column label. * @return pointer to column */ MTZCOL *MtzColLookup(const MTZ *mtz, const char *label); /** Get the MTZ column type of a particular column. * @param col pointer to MTZ column. * @return column type */ char *MtzColType(MTZCOL *col); /** Print summary of current crystal/dataset/column hierarchy. This * is designed for debugging purposes rather than for the user. * @param mtz pointer to MTZ struct * @return void */ void MtzDebugHierarchy(const MTZ *mtz); /** List of column information: label, type, dataset. * @param mtz pointer to MTZ struct * @param clabs List of labels (output). * @param ctyps List of column types (output). * @param csetid List of dataset IDs (output). * @return number of columns in current structure. */ int MtzListColumn(const MTZ *mtz, char clabs[][31], char ctyps[][3], int csetid[]); /** List of column information from input file: label, type, dataset. * @param mtz pointer to MTZ struct * @param clabs List of labels (output). * @param ctyps List of column types (output). * @param csetid List of dataset IDs (output). * @return number of columns in input file. */ int MtzListInputColumn(const MTZ *mtz, char clabs[][31], char ctyps[][3], int csetid[]); /**** helper functions ****/ /** Find where indices h, k, l are in MTZ structure. Usually, they * will be first 3 columns of 1st dataset, but safest not to assume this. * @param mtz pointer to MTZ struct * @param ind_xtal crystal containing indices * @param ind_set dataset containing indices * @param ind_col 3 columns containing indices * @return 1 on success, 0 on failure */ int MtzFindInd(const MTZ *mtz, int *ind_xtal, int *ind_set, int ind_col[3]); /** Calculate resolution from indices and coefhkl. * coefhkl is obtained from MtzHklcoeffs. * @param in integer array of 3 indices * @param coefhkl double array of 6 coefficients * @return resolution */ float MtzInd2reso(const int in[3], const double coefhkl[6]); /** Generate coefhkl coefficients from given cell parameters. * @param cell cell dimensions to be used for resolution calculation. * @param coefhkl double array of 6 coefficients * @return 1 on success, 0 on failure */ int MtzHklcoeffs(const float cell[6], double coefhkl[6]); /** Reads batch arrays into data structure. * @param intbuf pointer to integer batch array * @param fltbuf pointer to float batch array * @param batch pointer to batch structure * @return 1 on success, 0 on failure */ int MtzArrayToBatch(const int *intbuf, const float *fltbuf, MTZBAT *batch); /** Writes data structure to batch arrays. * @param batch pointer to batch structure * @param intbuf pointer to integer batch array * @param fltbuf pointer to float batch array * @return 1 on success, 0 on failure */ int MtzBatchToArray(MTZBAT *batch, int *intbuf, float *fltbuf); /** Sort a linked list of batches on batch number. The function * first checks whether batches are already in order, as they * will usually be. * @param batch pointer to beginning of batch list * @param numbat number of batches to be sorted * @return Sorted list if batches sorted, original list if batches * already in order */ MTZBAT *sort_batches(MTZBAT *batch, int numbat); /**** pseudo-mtzlib routines ****/ /** Returns title of MTZ structure 'mtz' * @param mtz pointer to MTZ struct * @param title MTZ title as character string * @return length of title excluding trailing blanks and terminating null * character. */ int ccp4_lrtitl(const MTZ *mtz, char *title); /** Get history lines from MTZ structure. * @param mtz Pointer to MTZ struct. * @param history Returned history lines. * @param nlines Requested number of history lines. * @return Actual number of history lines returned. */ int ccp4_lrhist(const MTZ *mtz, char history[][MTZRECORDLENGTH], int nlines); /** Get sort order from MTZ structure. * @param mtz Pointer to MTZ struct. * @param isort Returned sort order. * @return 1 on success, 0 on failure */ int ccp4_lrsort(const MTZ *mtz, int isort[5]); /** Get batch numbers from MTZ structure. * @param mtz Pointer to MTZ struct. * @param nbatx Number of batches in input file. * @param batchx Returned array of batch numbers. * @return Number of batches. */ int ccp4_lrbats(const MTZ *mtz, int *nbatx, int batchx[]); /** Get cell dimensions for a particular crystal. * @param xtl Pointer to crystal. * @param cell Output cell dimensions. * @return 1 on success, 0 on failure. */ int ccp4_lrcell(const MTZXTAL *xtl, float cell[]); /** Get spacegroup information as held in MTZ header. * @param mtz Pointer to MTZ struct. * @param nsympx Number of primitive symmetry operators. * @param ltypex Lattice type (P,A,B,C,I,F,R). * @param nspgrx Spacegroup number. * @param spgrnx Spacegroup name. * @param pgnamx Pointgroup name. * @return Spacegroup number. */ int ccp4_lrsymi(const MTZ *mtz, int *nsympx, char *ltypex, int *nspgrx, char *spgrnx, char *pgnamx); /** Get spacegroup information as held in MTZ header. Extended version of * ccp4_lrsymi to return confidence flag as well. * @param mtz Pointer to MTZ struct. * @param nsympx Number of primitive symmetry operators. * @param ltypex Lattice type (P,A,B,C,I,F,R). * @param nspgrx Spacegroup number. * @param spgrnx Spacegroup name. * @param pgnamx Pointgroup name. * @param spgconf One-character flag indicating confidence in nominal spacegroup. * @return Spacegroup number. */ int ccp4_lrsymi_c(const MTZ *mtz, int *nsympx, char *ltypex, int *nspgrx, char *spgrnx, char *pgnamx, char *spgconf); /** Get symmetry matrices from MTZ structure. Note: ordering of matrices * in rsymx was changed in April 2004. * @param mtz Pointer to MTZ struct. * @param nsymx Number of symmetry operators held in MTZ header. * @param rsymx Symmetry operators as 4 x 4 matrices, in the order they * are held in the MTZ header. Each matrix has translations in * elements [*][3]. * @return Number of symmetry operators. */ int ccp4_lrsymm(const MTZ *mtz, int *nsymx, float rsymx[192][4][4]); /** Uses LABIN or LABOUT line to convert program labels to user labels. * This is a helper function, but does not access reflection structure at all. * @param labin_line (I) LABIN/LABOUT line from Parser. * @param prog_labels (I) Progam labels. * @param nlprgi (I) Number of program labels. * @param user_labels (O) On output, user-supplied file labels in corresponding * positions. For unassigned program labels, user_labels is empty string. * @return Number of program labels matched, or -1 if there was an error. */ int MtzParseLabin(char *labin_line, const char prog_labels[][31], const int nlprgi, char user_labels[][2][31]); /** Finds columns in an MTZ struct according to column labels. Column types * are checked for agreement between requested type (in argument 'types') * and file type. If requested type is blank, file type is returned in * argument 'types'. Note, this function is different from Fortranic LRASSN, * in that any conversion from program labels to user labels should have been done * previously. * @param mtz Pointer to MTZ struct. * @param labels Input array of column labels to be found in MTZ struct. * @param nlabels Number of columns to be found. * @param types Input array of column types of columns to be found. * @return Array of pointers to columns in MTZ struct. Array element is * NULL if column not found. */ MTZCOL **ccp4_lrassn(const MTZ *mtz, const char labels[][31], const int nlabels, char types[][3]); /** Report information on a particular dataset. This represents the * collection of data held in one series of dataset records in the MTZ header. * It is mainly useful for supporting old Fortran calls. * @param mtz pointer to MTZ struct * @param set pointer to dataset * @param crystal_name Crystal name * @param dataset_name Dataset name * @param project_name Project name * @param isets Dataset ID. * @param datcell Cell dimensions of crystal that dataset belongs to. * @param datwave X-ray wavelength associated with dataset. * @return 1 on success, 0 on failure */ int ccp4_lridx(const MTZ *mtz, const MTZSET *set, char crystal_name[64], char dataset_name[64], char project_name[64], int *isets, float datcell[6], float *datwave); /** Returns iref'th reflection from file held in MTZ struct mtz. Returns * data for all columns held in input file, in the order that they are * held in the source file. The value of col->source can be used to find * particular columns. * In "in-memory" mode, reflection data is taken from arrays held in * memory. In the traditional file-based mode, a reflection record is * read from the input file. * @param mtz pointer to MTZ struct * @param resol resolution of reflection (output). * @param adata array of requested values (output). * @param logmss array of flags for missing data (output). A value of 1 indicates * a Missing Number Flag, and a value of 0 indicates usable data. * @param iref index of requested reflection (starting at 1). * @return 1 if past last reflection, else 0 */ int ccp4_lrrefl(const MTZ *mtz, float *resol, float adata[], int logmss[], int iref); /** Returns iref'th reflection from file held in MTZ struct mtz. Returns * data for certain columns held in input file, as specified by the * column pointers held in lookup. * In "in-memory" mode, reflection data is taken from arrays held in * memory. In the traditional file-based mode, a reflection record is * read from the input file. * @param mtz pointer to MTZ struct * @param resol resolution of reflection (output). * @param adata array of requested values (output). * @param logmss array of flags for missing data (output). A value of 1 indicates * a Missing Number Flag, and a value of 0 indicates usable data. * @param lookup array of pointers to requested columns * @param ncols number of requested columns * @param iref index of requested reflection (starting at 1). * @return 1 if past last reflection, else 0 */ int ccp4_lrreff(const MTZ *mtz, float *resol, float adata[], int logmss[], const MTZCOL *lookup[], const int ncols, const int iref); /** Checks whether a particular reflection value represents missing data. * @param mtz Pointer to the MTZ struct, which holds the value representing * missing data (the Missing Number Flag) against which the input datum * is compared. * @param datum Reflection value to be checked. * @return Returns 1 is datum is the MNF, and 0 otherwise. */ int ccp4_ismnf(const MTZ *mtz, const float datum); /** Function to print header information in traditional format. * @param mtz Pointer to MTZ struct * @param iprint Print level * @return 1 on success, 0 on failure */ int ccp4_lhprt(const MTZ *mtz, int iprint); /** Function to print header information in format appropriate * to data structure hierarchy. * @param mtz Pointer to MTZ struct * @param iprint Print level * @return 1 on success, 0 on failure */ int ccp4_lhprt_adv(const MTZ *mtz, int iprint); /** Function to return batch header data for a specified batch. * @param batch Pointer to requested batch. * @param buf On return, real and integer batch data. * @param charbuf On return, character batch data (title and axes names). * @param iprint =0 no printing, =1 print title only, >1 print full header. * @return 1 on success, 0 on failure */ int ccp4_lrbat(MTZBAT *batch, float *buf, char *charbuf, int iprint); /** Function to print batch header data for a specified batch to stdout. * @param batch Pointer to requested batch. * @return 1 on success, 0 on failure */ int MtzPrintBatchHeader(const MTZBAT *batch); /** Write header title for later output to file. * @param mtz Pointer to MTZ struct. * @param ftitle Title string. * @param flag If 0 overwrite existing title, else append to * existing title. * @return 1 on success, 0 on failure */ int ccp4_lwtitl(MTZ *mtz, const char *ftitle, int flag); /** Sets the sort order in the MTZ header. The sort order is * a list of columns to be used for sorting, to be applied in * the order they appear in the list, i.e. sort first on * colsort[0], then on colsort[1], etc. If there are less than * 5 columns to be used for sorting, some of colsort[] may be NULL. * @param mtz Pointer to MTZ struct * @param colsort Array of pointers to columns. * @return 1 on success, 0 on failure */ int MtzSetSortOrder(MTZ *mtz, MTZCOL *colsort[5]); /** Adds history lines to the MTZ header in front of existing history lines. * @param mtz pointer to MTZ struct * @param history lines to be added * @param nlines number of lines to be added * @return total number of history lines */ int MtzAddHistory(MTZ *mtz, const char history[][MTZRECORDLENGTH], const int nlines); /** Write or update symmetry information for MTZ header. This provides support * for the Fortran API, and is not particularly convenient for C programs. * Note: ordering of matrices in rsymx was changed in November 2003. * @param mtz Pointer to MTZ struct * @param nsymx Number of symmetry operators. If zero, symmetry operations * are not updated. * @param nsympx Number of primitive symmetry operators. * @param rsymx Array of symmetry operators (dimensions ordered in C convention, * with translations in elements [*][3]) * @param ltypex Lattice type. If blank, not updated. * @param nspgrx Spacegroup number. If zero, not updated. * @param spgrnx Spacegroup name. If blank, not updated. * @param pgnamx Point group name. If blank, not updated. * @return 1 on success, 0 on failure */ int ccp4_lwsymm(MTZ *mtz, int nsymx, int nsympx, float rsymx[192][4][4], char ltypex[], int nspgrx, char spgrnx[], char pgnamx[]); /** Write or update symmetry information for MTZ header. This provides support * for the Fortran API, and is not particularly convenient for C programs. Extended * version of ccp4_lwsymm to set confidence flag as well. * Note: ordering of matrices in rsymx was changed in November 2003. * @param mtz Pointer to MTZ struct * @param nsymx Number of symmetry operators. If zero, symmetry operations * are not updated. * @param nsympx Number of primitive symmetry operators. * @param rsymx Array of symmetry operators (dimensions ordered in C convention, * with translations in elements [*][3]) * @param ltypex Lattice type. If blank, not updated. * @param nspgrx Spacegroup number. If zero, not updated. * @param spgrnx Spacegroup name. If blank, not updated. * @param pgnamx Point group name. If blank, not updated. * @param spgconf One-character flag indicating confidence in nominal spacegroup. * @return 1 on success, 0 on failure */ int ccp4_lwsymm_c(MTZ *mtz, int nsymx, int nsympx, float rsymx[192][4][4], char ltypex[], int nspgrx, char spgrnx[], char pgnamx[], char spgconf[]); /** Write or update symmetry confidence information for MTZ header. * @param mtz Pointer to MTZ struct * @param spgconf One-character flag indicating confidence in nominal spacegroup. * @return 1 on success, 0 on failure */ int ccp4_lwsymconf(MTZ *mtz, char spgconf[]); /* Assign columns for writing. Check to see if columns already exist, * else create them. New columns are assigned to the base dataset if it * exists, else the first dataset. * @param mtz pointer to MTZ struct * @param labels Input array of column labels to be assigned. * @param nlabels Number of columns. * @param types Input array of column types of columns. * @param iappnd If iappnd = 0, then deactivate columns which are * not selected (allows one to write out a subset of columns). Else * if iappnd = 1, append these columns to existing ones. * @return Array of pointers to columns in MTZ struct. */ MTZCOL **ccp4_lwassn(MTZ *mtz, const char labels[][31], const int nlabels, const char types[][3], const int iappnd); /* Add or update a dataset in the MTZ structure. If the crystal name is * not recognised, then a new crystal is created containing a single * dataset. If the crystal name is recognised, then the parameters of * the crystal are updated. The child dataset is then created if necessary * or an existing dataset updated. * Note that this function is used to update crystal parameters, as well * as add crystals. If a duplicate crystal name is used by mistake, then * the old crystal parameters are lost. * @param mtz pointer to MTZ struct * @param crystal_name Crystal name * @param dataset_name Dataset name * @param project_name Project name * @param datcell Cell dimensions of crystal that dataset belongs to. * @param datwave X-ray wavelength associated with dataset. * @return 1 on success, 0 on failure */ int ccp4_lwidx(MTZ *mtz, const char crystal_name[], const char dataset_name[], const char project_name[], const float datcell[6], const float *datwave); /** Function to output reflection values for iref'th reflection. * The reflection values are provided in an array "adata". The value * in adata[i] will be assigned to the MTZ column pointed to by lookup[i]. * Typically, lookup[i] is a pointer returned from an earlier call to * MtzAddColumn(). * In "in-memory" mode, values are added/updated to column data held * in memory. In the traditional file-based mode, a reflection record is * written to file. * This function will also update the column ranges and the crystal/file * resolution limits. * @param mtz pointer to MTZ struct * @param adata array of reflection column values. * @param lookup array of pointers to columns. * @param ncol number of columns. * @param iref Reflection number such that 1st reflection is iref=1. * @return 1 on success, 0 on failure */ int ccp4_lwrefl(MTZ *mtz, const float adata[], MTZCOL *lookup[], const int ncol, const int iref); /** Write new batch information to 'batch' or if 'batch' is NULL create * new batch header with batch number 'batno'. If you try to create more * than one new batch header with the same batch number, the function will * complain and return. It is OK to create a new batch with the same * number as one read from file - this is the mechanism for changing * batch headers. * @param mtz pointer to MTZ struct * @param batch pointer to batch * @param batno batch number * @param buf pointer to batch array * @param charbuf pointer to character batch array * @return 1 on success, 0 on failure */ int ccp4_lwbat(MTZ *mtz, MTZBAT *batch, const int batno, const float *buf, const char *charbuf); int ccp4_lwbsetid(MTZ *mtz, MTZBAT *batch, const char xname[], const char dname[]); /* -- Below here there are no implementations -- */ /* COMPLEX HLToSF(float hla, float hlb, float hlc, float hld, BOOLEAN centric); */ /* Returns the mean structure factor as a complex number from a structure factor probability distribution described by Hendrickson/Lattman coefficients. If `centric == TRUE`, the coefficients describe a centric distribution. */ /* MTZ *MtzSort(MTZ *mtz, char *ident); */ /* Sorts `mtz` using the identifiers (separated by spaces) in `ident` as keys. Sorting can be done on up to 200 columns. A pointer to `*mtz` is returned. */ /* MTZ *HLCombine (MTZ *to, float toscale, MTZ *frm, float frmscale); */ /* Combines extra phase information for common reflections between 'frm' and 'to' into the phase information of 'to'. The phase probabilities are described by Hendrickson Lattman coefficients, with the identifiers "HLA", "HLB", HLC", and "HLD", the indices are identified by "H", "K" and "L". HL-coeffs from 'to' are scaled by 'toscale', the coeffs from 'frm' are scaled by 'frmscale'. A pointer to `to` is returned. */ /* void MtzPhiFom(MTZ *mtz); */ /* Calculates the best phase and the figure of from Hendrickson Lattman coefficients. The following columns should be present in `mtz`: "H", "K" & "L" (indices); "PHIB" & "FOM" (best phase (degrees) and figure of merit); "HLA", "HLB", "HLC" & "HLD" (Hendrickson Lattman coefficients). */ /* MTZ *MtzCopy(MTZ *frm); */ /* Produces an exact copy of `frm` and returns a pointer to it. */ /* MTZ *MtzColAppend(MTZ *mtz, char *ident, char type); */ /* Appends a column to `*mtz` with identity `ident` and type `type`, provided no column with identity `ident` exists. */ /* MTZ *MtzColRemove(MTZ *mtz, char *ident); */ /* Removes a column from `*mtz` with identity `ident`. */ /* MTZ *MtzUpdateRanges(MTZ *mtz); */ /* Updates ranges of all columns in `mtz` and returns `mtz`. */ /* MTZCOL *MtzColNewRange(MTZCOL *col, int nref); */ /* Updates the minimum & maximum values in `col` and returns `col`. */ /* int *MtzUnique(MTZ *mtz, char *ident); */ /* Returns an array (k) of indices: k[j] returns the first occurrence of a set of idents, eg. MtzUnique(mtz, "H K L") returns an array from which all the unique reflections can be determined by indexing with k: k[i] is the index of the last relection of a set which all have the same hkl indices. It is assumed that `mtz` is sorted, using `ident` as keys. */ /* float PhaseProb(float phase, float hla, float hlb, float hlc, float hld, BOOLEAN centric); */ /* Returns the probability of `phase` (expressed in radians) as determined by the Hendrickson-Lattman coefficients `hla`, `hlb`, `hlc` and `hld`. If `centric == TRUE`, the coefficients describe a centric distribution. */ #ifdef __cplusplus } } #endif #endif libccp4-8.0.0/ccp4/csymlib.c0000644000000000000000000020052214242731033013624 0ustar 00000000000000/* csymlib.c: C-level library for symmetry information. Copyright (C) 2001 CCLRC, Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /* DO NOT put Doxygen comments here - put in csymlib.h */ /* See csymlib.h for descriptions of functions */ #include #include #include #include #include "ccp4_parser.h" #include "ccp4_types.h" #include "ccp4_utils.h" #include "csymlib.h" #include "cvecmat.h" #include "ccp4_errno.h" #include "ccp4_unitcell.h" #include "ccp4_general.h" /* rcsid[] = "$Id$" */ /* stuff for error reporting */ #define CSYM_ERRNO(n) (CCP4_ERR_SYM | (n)) /* error defs */ #define CSYMERR_Ok 0 #define CSYMERR_ParserFail 1 #define CSYMERR_NoSyminfoFile 2 #define CSYMERR_NullSpacegroup 3 #define CSYMERR_NoAsuDefined 4 #define CSYMERR_NoLaueCodeDefined 5 #define CSYMERR_SyminfoTokensMissing 6 /* copy of constants from fortran/csymlib_f.c */ #define MAXSYMOPS 20 #define MAXLENSYMOPSTR 80 CCP4SPG *ccp4spg_load_by_standard_num(const int numspg) { return ccp4spg_load_spacegroup(numspg, 0, NULL, NULL, 0, NULL); } CCP4SPG *ccp4spg_load_by_ccp4_num(const int ccp4numspg) { return ccp4spg_load_spacegroup(0, ccp4numspg, NULL, NULL, 0, NULL); } CCP4SPG *ccp4spg_load_by_spgname(const char *spgname) { return ccp4spg_load_spacegroup(0, 0, spgname, NULL, 0, NULL); } CCP4SPG *ccp4spg_load_by_ccp4_spgname(const char *ccp4spgname) { return ccp4spg_load_spacegroup(0, 0, NULL, ccp4spgname, 0, NULL); } CCP4SPG *ccp4_spgrp_reverse_lookup(const int nsym1, const ccp4_symop *op1) { return ccp4spg_load_spacegroup(0, 0, NULL, NULL, nsym1, op1); } CCP4SPG *ccp4spg_load_spacegroup(const int numspg, const int ccp4numspg, const char *spgname, const char *ccp4spgname, const int nsym1, const ccp4_symop *op1) { CCP4SPG *spacegroup; int i,j,k,l,debug=0,nsym2,symops_provided=0,ierr,ilaue; float sg_chb[4][4],limits[2],rot1[4][4],rot2[4][4],det; FILE *filein; char *symopfile, *ccp4dir, filerec[80]; ccp4_symop *op2,*op3,opinv; /* spacegroup variables */ int sg_num, sg_ccp4_num, sg_nsymp, sg_num_cent; float cent_ops[4][4]; char sg_symbol_old[20],sg_symbol_Hall[40],sg_symbol_xHM[20], sg_point_group[20],sg_patt_group[40]; char sg_basisop[80],sg_symop[192][80],sg_cenop[4][80]; char sg_asu_descr[80], map_asu_x[12], map_asu_y[12], map_asu_z[12]; char map_asu_ccp4_x[12], map_asu_ccp4_y[12], map_asu_ccp4_z[12]; /* For cparser */ CCP4PARSERARRAY *parser; CCP4PARSERTOKEN *token=NULL; char *key; int iprint=0; /* initialisations */ sg_nsymp=0; sg_num_cent=0; if (nsym1) symops_provided=1; spacegroup = (CCP4SPG *) ccp4_utils_malloc(sizeof(CCP4SPG)); if (debug) { printf(" Entering ccp4spg_load_spacegroup, with arguments %d %d %d \n", numspg,ccp4numspg,nsym1); if (spgname) printf(" spgname = %s \n",spgname); if (ccp4spgname) printf(" ccp4spgname = %s \n",ccp4spgname); for (i = 0; i < nsym1; ++i) { printf(" %f %f %f \n",op1[i].rot[0][0],op1[i].rot[0][1],op1[i].rot[0][2]); printf(" %f %f %f \n",op1[i].rot[1][0],op1[i].rot[1][1],op1[i].rot[1][2]); printf(" %f %f %f \n",op1[i].rot[2][0],op1[i].rot[2][1],op1[i].rot[2][2]); printf(" %f %f %f \n\n",op1[i].trn[0],op1[i].trn[1],op1[i].trn[2]); } } /* if we are searching with symops, make sure translations are modulo 1 */ if (symops_provided) { op3 = (ccp4_symop *) ccp4_utils_malloc(nsym1*sizeof(ccp4_symop)); for (i = 0; i < nsym1; ++i) { for (k = 0; k < 3; ++k) { for (l = 0; l < 3; ++l) { op3[i].rot[k][l]=op1[i].rot[k][l]; } op3[i].trn[k] = op1[i].trn[k]; } ccp4spg_norm_trans(&op3[i]); } } /* Open the symop file: */ if (!(symopfile = getenv("SYMINFO"))) { if (debug) printf("Environment variable SYMINFO not set ... guessing location of symmetry file. \n"); if (!(ccp4dir = getenv("CLIBD"))) { printf("Environment variable CLIBD not set ... big trouble! \n"); return NULL; } symopfile = ccp4_utils_malloc((strlen(ccp4dir)+22)*sizeof(char)); strcpy(symopfile,ccp4_utils_joinfilenames(ccp4dir,"syminfo.lib")); symopfile[strlen(ccp4dir)+21] = '\0'; ccp4printf(1," SYMINFO file set to %s \n",symopfile); } else { if (debug) { ccp4printf(1,"\n Spacegroup information obtained from library file: \n"); ccp4printf(1," Logical Name: SYMINFO Filename: %s\n\n",symopfile); } } filein = fopen(symopfile,"r"); if (!filein) { ccp4_signal(CSYM_ERRNO(CSYMERR_NoSyminfoFile),"ccp4spg_load_spacegroup",NULL); return NULL; } if (!(getenv("SYMINFO"))) free(symopfile); parser = ccp4_parse_start(20); if (parser == NULL) ccp4_signal(CSYM_ERRNO(CSYMERR_ParserFail),"ccp4spg_load_spacegroup",NULL); /* "=" is used in map asu fields, so remove it as delimiter */ ccp4_parse_delimiters(parser," \t,",","); /* Set some convenient pointers to members of the parser array */ key = parser->keyword; token = parser->token; if (debug) printf(" parser initialised \n"); while (fgets(filerec,80,filein)) { /* If syminfo.lib comes from a DOS platform, and we are on unix, need to strip spurious \r character. Note this is necessary because we have removed \r as parser delimiter. */ if (strlen(filerec) > 1){ if (filerec[strlen(filerec)-2]=='\r') { filerec[strlen(filerec)-2]='\n'; filerec[strlen(filerec)-1]='\0'; } } if (strlen(filerec) > 1) { ccp4_parser(filerec, 80, parser, iprint); if (ccp4_keymatch(key, "number")) { if (parser->ntokens < 2) { printf("Current SYMINFO line = %s\n",filerec); ccp4_signal(CCP4_ERRLEVEL(2) | CSYM_ERRNO(CSYMERR_SyminfoTokensMissing),"ccp4spg_load_spacegroup",NULL); } else { sg_num = (int) token[1].value; } } if (ccp4_keymatch(key, "basisop")) { strcpy(sg_basisop,filerec+8); } if (ccp4_keymatch(key, "symbol")) { if (parser->ntokens < 3) { printf("Current SYMINFO line = %s\n",filerec); ccp4_signal(CCP4_ERRLEVEL(2) | CSYM_ERRNO(CSYMERR_SyminfoTokensMissing),"ccp4spg_load_spacegroup",NULL); } else { if (strcmp(token[1].fullstring,"ccp4") == 0) sg_ccp4_num = (int) token[2].value; if (strcmp(token[1].fullstring,"Hall") == 0) strcpy(sg_symbol_Hall,token[2].fullstring); if (strcmp(token[1].fullstring,"xHM") == 0) strcpy(sg_symbol_xHM,token[2].fullstring); if (strcmp(token[1].fullstring,"old") == 0) strcpy(sg_symbol_old,token[2].fullstring); if (strcmp(token[1].fullstring,"patt") == 0) strcpy(sg_patt_group,token[3].fullstring); if (strcmp(token[1].fullstring,"pgrp") == 0) strcpy(sg_point_group,token[3].fullstring); } } if (ccp4_keymatch(key, "hklasu")) { if (parser->ntokens < 3) { printf("Current SYMINFO line = %s\n",filerec); ccp4_signal(CCP4_ERRLEVEL(2) | CSYM_ERRNO(CSYMERR_SyminfoTokensMissing),"ccp4spg_load_spacegroup",NULL); } else { if (strcmp(token[1].fullstring,"ccp4") == 0) strcpy(sg_asu_descr,token[2].fullstring); } } if (ccp4_keymatch(key, "mapasu")) { if (parser->ntokens < 5) { printf("Current SYMINFO line = %s\n",filerec); ccp4_signal(CCP4_ERRLEVEL(2) | CSYM_ERRNO(CSYMERR_SyminfoTokensMissing),"ccp4spg_load_spacegroup",NULL); } else { if (strcmp(token[1].fullstring,"zero") == 0) { strcpy(map_asu_x,token[2].fullstring); strcpy(map_asu_y,token[3].fullstring); strcpy(map_asu_z,token[4].fullstring); } else if (strcmp(token[1].fullstring,"ccp4") == 0) { strcpy(map_asu_ccp4_x,token[2].fullstring); strcpy(map_asu_ccp4_y,token[3].fullstring); strcpy(map_asu_ccp4_z,token[4].fullstring); } } } if (ccp4_keymatch(key, "symop")) { strcpy(sg_symop[sg_nsymp++],filerec+6); } if (ccp4_keymatch(key, "cenop")) { strcpy(sg_cenop[sg_num_cent++],filerec+6); } if (ccp4_keymatch(key, "end_spacegroup")) { /* end of spacegroup block, so check if right one */ if (numspg) { if (sg_num == numspg) break; } else if (ccp4numspg) { if (sg_ccp4_num == ccp4numspg) break; } else if (spgname) { if (ccp4spg_name_equal_to_lib(sg_symbol_xHM,spgname)) break; } else if (ccp4spgname) { if (ccp4spg_name_equal_to_lib(sg_symbol_old,ccp4spgname)) break; if (ccp4spg_name_equal_to_lib(sg_symbol_xHM,ccp4spgname)) break; } else if (symops_provided) { nsym2 = sg_nsymp*sg_num_cent; if (nsym2 == nsym1) { op2 = (ccp4_symop *) ccp4_utils_malloc(nsym2*sizeof(ccp4_symop)); for (i = 0; i < sg_num_cent; ++i) { symop_to_mat4(sg_cenop[i],sg_cenop[i]+strlen(sg_cenop[i]),cent_ops[0]); for (j = 0; j < sg_nsymp; ++j) { symop_to_mat4(sg_symop[j],sg_symop[j]+strlen(sg_symop[j]),rot2[0]); ccp4_4matmul(rot1,(const float (*)[4])cent_ops,(const float (*)[4])rot2); op2[i*sg_nsymp+j] = mat4_to_rotandtrn((const float (*)[4])rot1); /* combination of primitive and centering operators can produce translations greater than one. */ ccp4spg_norm_trans(&op2[i*sg_nsymp+j]); } } /* op3 are requested operators and op2 are from SYMINFO file */ if (ccp4_spgrp_equal(nsym1,op3,nsym2,op2)) { if (debug) printf(" ops match for sg %d ! \n",sg_num); free(op2); break; } free(op2); } } sg_nsymp = 0; sg_num_cent = 0; sg_symbol_xHM[0]='\0'; sg_symbol_old[0]='\0'; } } } if (symops_provided) free(op3); if (debug) printf(" parser finished \n"); /* Finished with the parser array */ ccp4_parse_end(parser); fclose(filein); if (!sg_nsymp) { ccp4printf(0," Failed to find spacegroup in SYMINFO! \n"); return NULL; } /* extract various symbols for spacegroup */ spacegroup->spg_num = sg_num; spacegroup->spg_ccp4_num = sg_ccp4_num; strcpy(spacegroup->symbol_Hall,sg_symbol_Hall); strcpy(spacegroup->symbol_xHM,sg_symbol_xHM); strcpy(spacegroup->symbol_old,sg_symbol_old); strcpy(spacegroup->point_group,"PG"); strcpy(spacegroup->point_group+2,sg_point_group); if (sg_num <= 2) { strcpy(spacegroup->crystal,"TRICLINIC"); } else if (sg_num >= 3 && sg_num <= 15) { strcpy(spacegroup->crystal,"MONOCLINIC"); } else if (sg_num >= 16 && sg_num <= 74) { strcpy(spacegroup->crystal,"ORTHORHOMBIC"); } else if (sg_num >= 75 && sg_num <= 142) { strcpy(spacegroup->crystal,"TETRAGONAL"); } else if (sg_num >= 143 && sg_num <= 167) { strcpy(spacegroup->crystal,"TRIGONAL"); } else if (sg_num >= 168 && sg_num <= 194) { strcpy(spacegroup->crystal,"HEXAGONAL"); } else if (sg_num >= 195 && sg_num <= 230) { strcpy(spacegroup->crystal,"CUBIC"); } else { strcpy(spacegroup->crystal," "); } if (debug) printf(" Read in details of spacegroup %d %d \n",sg_num,sg_ccp4_num); /* change of basis */ if (debug) printf(" Change of basis %s \n",sg_basisop); symop_to_mat4(sg_basisop,sg_basisop+strlen(sg_basisop),sg_chb[0]); for (i = 0; i < 3; ++i) { for (j = 0; j < 3; ++j) { spacegroup->chb[i][j] = sg_chb[i][j]; } } if (debug) for (k = 0; k < 3; ++k) printf("chb: %f %f %f\n",spacegroup->chb[k][0], spacegroup->chb[k][1],spacegroup->chb[k][2]); /* symmetry operators */ spacegroup->nsymop_prim = sg_nsymp; spacegroup->nsymop = sg_nsymp*sg_num_cent; spacegroup->symop = (ccp4_symop *) ccp4_utils_malloc(spacegroup->nsymop*sizeof(ccp4_symop)); spacegroup->invsymop = (ccp4_symop *) ccp4_utils_malloc(spacegroup->nsymop*sizeof(ccp4_symop)); if (symops_provided) { for (i = 0; i < nsym1; ++i) { opinv = ccp4_symop_invert(op1[i]); for (k = 0; k < 3; ++k) { for (l = 0; l < 3; ++l) { spacegroup->symop[i].rot[k][l]=op1[i].rot[k][l]; spacegroup->invsymop[i].rot[k][l]=opinv.rot[k][l]; } spacegroup->symop[i].trn[k] = op1[i].trn[k]; spacegroup->invsymop[i].trn[k] = opinv.trn[k]; } } } else { for (i = 0; i < sg_num_cent; ++i) { symop_to_mat4(sg_cenop[i],sg_cenop[i]+strlen(sg_cenop[i]),cent_ops[0]); for (j = 0; j < sg_nsymp; ++j) { strncpy(filerec,sg_symop[j],80); /* symop_to_mat4 overwrites later sg_symop */ symop_to_mat4(filerec,filerec+strlen(filerec),rot2[0]); ccp4_4matmul(rot1,(const float (*)[4])cent_ops,(const float (*)[4])rot2); det=invert4matrix((const float (*)[4])rot1,rot2); if (debug) printf("symop determinant: %f\n",det); for (k = 0; k < 3; ++k) { for (l = 0; l < 3; ++l) { spacegroup->symop[i*sg_nsymp+j].rot[k][l]=rot1[k][l]; spacegroup->invsymop[i*sg_nsymp+j].rot[k][l]=rot2[k][l]; } spacegroup->symop[i*sg_nsymp+j].trn[k] = rot1[k][3]; spacegroup->invsymop[i*sg_nsymp+j].trn[k] = rot2[k][3]; } /* unless symops have been provided, store normalised operators */ ccp4spg_norm_trans(&spacegroup->symop[i*sg_nsymp+j]); ccp4spg_norm_trans(&spacegroup->invsymop[i*sg_nsymp+j]); } } } if (debug) for (i = 0; i < sg_num_cent; ++i) for (j = 0; j < sg_nsymp; ++j) { for (k = 0; k < 3; ++k) printf("rot/trn: %f %f %f %f\n",spacegroup->symop[i*sg_nsymp+j].rot[k][0], spacegroup->symop[i*sg_nsymp+j].rot[k][1], spacegroup->symop[i*sg_nsymp+j].rot[k][2], spacegroup->symop[i*sg_nsymp+j].trn[k]); for (k = 0; k < 3; ++k) printf("inv rot/trn: %f %f %f %f\n",spacegroup->invsymop[i*sg_nsymp+j].rot[k][0], spacegroup->invsymop[i*sg_nsymp+j].rot[k][1], spacegroup->invsymop[i*sg_nsymp+j].rot[k][2], spacegroup->invsymop[i*sg_nsymp+j].trn[k]); } /* reciprocal asymmetric unit */ strcpy(spacegroup->asu_descr,sg_asu_descr); /* Select ASU function (referred to default basis) from asu desc */ /* Also infer Laue and Patterson groups. This uses additional information from spacegroup name. In general, we use Hall symbol because syminfo.lib is missing a few xHM symbols. However, we need to use the latter for R vs. H settings. */ ierr = 1; ilaue = 1; if ( strcmp( sg_asu_descr, "l>0 or (l==0 and (h>0 or (h==0 and k>=0)))" ) == 0 ) { spacegroup->asufn = &ASU_1b; ilaue = ccp4spg_load_laue(spacegroup,3); spacegroup->npatt = 2; strcpy(spacegroup->patt_name,"P-1"); ierr = 0; } if ( strcmp( sg_asu_descr, "k>=0 and (l>0 or (l=0 and h>=0))" ) == 0 ) { spacegroup->asufn = &ASU_2_m; ilaue = ccp4spg_load_laue(spacegroup,4); if (strchr(spacegroup->symbol_Hall,'P')) { spacegroup->npatt = 10; strcpy(spacegroup->patt_name,"P2/m"); } else if (strchr(spacegroup->symbol_Hall,'C')) { spacegroup->npatt = 12; strcpy(spacegroup->patt_name,"C2/m"); } ierr = 0; } if ( strcmp( sg_asu_descr, "h>=0 and k>=0 and l>=0" ) == 0 ) { spacegroup->asufn = &ASU_mmm; ilaue = ccp4spg_load_laue(spacegroup,6); if (strchr(spacegroup->symbol_Hall,'P')) { spacegroup->npatt = 47; strcpy(spacegroup->patt_name,"Pmmm"); } else if (strchr(spacegroup->symbol_Hall,'C')) { spacegroup->npatt = 65; strcpy(spacegroup->patt_name,"Cmmm"); } else if (strchr(spacegroup->symbol_Hall,'I')) { spacegroup->npatt = 71; strcpy(spacegroup->patt_name,"Immm"); } else if (strchr(spacegroup->symbol_Hall,'F')) { spacegroup->npatt = 69; strcpy(spacegroup->patt_name,"Fmmm"); } ierr = 0; } if ( strcmp( sg_asu_descr, "l>=0 and ((h>=0 and k>0) or (h=0 and k=0))" ) == 0 && strcmp( sg_patt_group, "4/m" ) == 0 ) { spacegroup->asufn = &ASU_4_m; ilaue = ccp4spg_load_laue(spacegroup,7); spacegroup->nlaue = 7; strcpy(spacegroup->laue_name,"4/m"); spacegroup->laue_sampling[0] = 4; spacegroup->laue_sampling[1] = 4; spacegroup->laue_sampling[2] = 8; if (strchr(spacegroup->symbol_Hall,'P')) { spacegroup->npatt = 83; strcpy(spacegroup->patt_name,"P4/m"); } else if (strchr(spacegroup->symbol_Hall,'I')) { spacegroup->npatt = 87; strcpy(spacegroup->patt_name,"I4/m"); } ierr = 0; } if ( strcmp( sg_asu_descr, "h>=k and k>=0 and l>=0" ) == 0 && strcmp( sg_patt_group, "4/mmm" ) == 0 ) { spacegroup->asufn = &ASU_4_mmm; ilaue = ccp4spg_load_laue(spacegroup,8); if (strchr(spacegroup->symbol_Hall,'P')) { spacegroup->npatt = 123; strcpy(spacegroup->patt_name,"P4/mmm"); } else if (strchr(spacegroup->symbol_Hall,'I')) { spacegroup->npatt = 139; strcpy(spacegroup->patt_name,"I4/mmm"); } ierr = 0; } if ( strcmp( sg_asu_descr, "(h>=0 and k>0) or (h=0 and k=0 and l>=0)" ) == 0 ) { spacegroup->asufn = &ASU_3b; ilaue = ccp4spg_load_laue(spacegroup,9); if (strchr(spacegroup->symbol_Hall,'P')) { spacegroup->npatt = 147; strcpy(spacegroup->patt_name,"P-3"); } else if (strchr(spacegroup->symbol_xHM,'H')) { /* this is special case, as Hall doesn't specify H */ spacegroup->npatt = 148; strcpy(spacegroup->patt_name,"H-3"); } else if (strchr(spacegroup->symbol_Hall,'R')) { spacegroup->npatt = 1148; strcpy(spacegroup->patt_name,"R-3"); } ierr = 0; } if ( strcmp( sg_asu_descr, "h>=k and k>=0 and (k>0 or l>=0)" ) == 0 ) { spacegroup->asufn = &ASU_3bm; ilaue = ccp4spg_load_laue(spacegroup,10); spacegroup->npatt = 162; strcpy(spacegroup->patt_name,"P-31m"); ierr = 0; } if ( strcmp( sg_asu_descr, "h>=k and k>=0 and (h>k or l>=0)" ) == 0 ) { spacegroup->asufn = &ASU_3bmx; ilaue = ccp4spg_load_laue(spacegroup,11); if (strchr(spacegroup->symbol_Hall,'P')) { spacegroup->npatt = 164; strcpy(spacegroup->patt_name,"P-3m1"); } else if (strchr(spacegroup->symbol_xHM,'H')) { /* this is special case, as Hall doesn't specify H */ spacegroup->npatt = 166; strcpy(spacegroup->patt_name,"H-3m"); } else if (strchr(spacegroup->symbol_Hall,'R')) { spacegroup->npatt = 1166; strcpy(spacegroup->patt_name,"R-3m"); } ierr = 0; } if ( strcmp( sg_asu_descr, "l>=0 and ((h>=0 and k>0) or (h=0 and k=0))" ) == 0 && strcmp( sg_patt_group, "6/m" ) == 0 ) { spacegroup->asufn = &ASU_6_m; ilaue = ccp4spg_load_laue(spacegroup,12); spacegroup->npatt = 175; strcpy(spacegroup->patt_name,"P6/m"); ierr = 0; } if ( strcmp( sg_asu_descr, "h>=k and k>=0 and l>=0" ) == 0 && strcmp( sg_patt_group, "6/mmm" ) == 0 ) { spacegroup->asufn = &ASU_6_mmm; ilaue = ccp4spg_load_laue(spacegroup,13); spacegroup->nlaue = 13; strcpy(spacegroup->laue_name,"6/mmm"); spacegroup->laue_sampling[0] = 6; spacegroup->laue_sampling[1] = 6; spacegroup->laue_sampling[2] = 12; spacegroup->npatt = 191; strcpy(spacegroup->patt_name,"P6/mmm"); ierr = 0; } if ( strcmp( sg_asu_descr, "h>=0 and ((l>=h and k>h) or (l=h and k=h))" ) == 0 ) { spacegroup->asufn = &ASU_m3b; ilaue = ccp4spg_load_laue(spacegroup,14); if (strchr(spacegroup->symbol_Hall,'P')) { spacegroup->npatt = 200; strcpy(spacegroup->patt_name,"Pm-3"); } else if (strchr(spacegroup->symbol_Hall,'I')) { spacegroup->npatt = 204; strcpy(spacegroup->patt_name,"Im-3"); } else if (strchr(spacegroup->symbol_Hall,'F')) { spacegroup->npatt = 202; strcpy(spacegroup->patt_name,"Fm-3"); } ierr = 0; } if ( strcmp( sg_asu_descr, "k>=l and l>=h and h>=0" ) == 0 ) { spacegroup->asufn = &ASU_m3bm; ilaue = ccp4spg_load_laue(spacegroup,15); if (strchr(spacegroup->symbol_Hall,'P')) { spacegroup->npatt = 221; strcpy(spacegroup->patt_name,"Pm-3m"); } else if (strchr(spacegroup->symbol_Hall,'I')) { spacegroup->npatt = 229; strcpy(spacegroup->patt_name,"Im-3m"); } else if (strchr(spacegroup->symbol_Hall,'F')) { spacegroup->npatt = 225; strcpy(spacegroup->patt_name,"Fm-3m"); } ierr = 0; } /* Raise an error if failed to match the ASU description */ if (ierr) { ccp4_signal(CSYM_ERRNO(CSYMERR_NoAsuDefined),"ccp4spg_load_spacegroup",NULL); if (spacegroup) free(spacegroup); return NULL; } /* Raise an error if failed to match the Laue code */ if (ilaue) { ccp4_signal(CSYM_ERRNO(CSYMERR_NoLaueCodeDefined),"ccp4spg_load_spacegroup",NULL); if (spacegroup) free(spacegroup); return NULL; } /* real asymmetric unit */ /* origin-based choice */ sprintf(spacegroup->mapasu_zero_descr,"%s %s %s",map_asu_x,map_asu_y,map_asu_z); range_to_limits(map_asu_x, limits); spacegroup->mapasu_zero[0] = limits[1]; range_to_limits(map_asu_y, limits); spacegroup->mapasu_zero[1] = limits[1]; range_to_limits(map_asu_z, limits); spacegroup->mapasu_zero[2] = limits[1]; /* CCP4 choice a la SETLIM - defaults to origin-based choice */ range_to_limits(map_asu_ccp4_x, limits); if (limits[1] > 0) { sprintf(spacegroup->mapasu_ccp4_descr,"%s %s %s",map_asu_ccp4_x,map_asu_ccp4_y,map_asu_ccp4_z); spacegroup->mapasu_ccp4[0] = limits[1]; range_to_limits(map_asu_ccp4_y, limits); spacegroup->mapasu_ccp4[1] = limits[1]; range_to_limits(map_asu_ccp4_z, limits); spacegroup->mapasu_ccp4[2] = limits[1]; } else { strcpy(spacegroup->mapasu_ccp4_descr,spacegroup->mapasu_zero_descr); spacegroup->mapasu_ccp4[0] = spacegroup->mapasu_zero[0]; spacegroup->mapasu_ccp4[1] = spacegroup->mapasu_zero[1]; spacegroup->mapasu_ccp4[2] = spacegroup->mapasu_zero[2]; } if (debug) { printf(" mapasu limits %f %f %f \n",spacegroup->mapasu_zero[0], spacegroup->mapasu_zero[1],spacegroup->mapasu_zero[2]); printf(" CCP4 mapasu limits %f %f %f \n",spacegroup->mapasu_ccp4[0], spacegroup->mapasu_ccp4[1],spacegroup->mapasu_ccp4[2]); } /* set up centric and epsilon zones for this spacegroup */ ccp4spg_set_centric_zones(spacegroup); ccp4spg_set_epsilon_zones(spacegroup); if (debug) printf(" Leaving ccp4spg_load_spacegroup \n"); return spacegroup; } /* symfr_driver Convert one or more symop description strings into 4x4 matrix representations via multiple calls to symop_to_mat4. "line" is a string containing one or more symop description strings to be translated into matrix representations. Multiple symmetry operations can be specified in a single input line, and must be separated by * (with spaces either side). "rot" is an array of 4x4 matrices in which the symops are returned. On success, symfr returns the number of symops translated and stored; on failure -1 is returned. See comments for SYMFR2 for description of the symop formats. */ int symfr_driver (const char *line, float rot[MAXSYMOPS][4][4]) { CCP4PARSERARRAY *symops=NULL; int i,j,k,got_symop=0; int ns=0,nsym=0,maxsymops=MAXSYMOPS; char *symop=NULL,symopbuf[MAXLENSYMOPSTR]; float tmp_rot[4][4]; //CSYMLIB_DEBUG(puts("CSYMLIB: symfr_driver");) /* Set up a parser structure to break the line up into individual symop strings */ if ((symops = ccp4_parse_start(maxsymops)) == NULL) { /* Couldn't set up a parser structure - abort */ printf(" symfr_driver: failed to set up parser structure for reading symops.\n"); return -1; } /* Tokenise the line, splitting on spaces */ ccp4_parse_delimiters(symops," ",""); if ((ns = ccp4_parse(line,symops)) > 0) { /* Initialise */ got_symop = 0; symopbuf[0] = '\0'; /* Loop over tokens and reconstruct symop strings */ for (i=0; itoken[i].fullstring; /* If there are multiple symop strings then these will be delimited by asterisks */ if (strlen(symop) == 1 && symop[0] == '*') { /* End of symop */ got_symop = 1; } else { /* Append token to symop */ if (strlen(symopbuf)+strlen(symop)+1 <= MAXLENSYMOPSTR) { strcat(symopbuf,symop); } else { /* Error - symop string is too long */ printf("SYMFR: symmetry operator string is too long!\n"); if (symops) ccp4_parse_end(symops); return -1; } /* Check if this is the last token, in which case flag it to be processed */ if ((i+1)==ns) got_symop = 1; } /* Process a complete symop */ if (got_symop && strlen(symopbuf) > 0) { /* Translate */ if (!symop_to_mat4(&(symopbuf[0]),&(symopbuf[0])+strlen(symopbuf),tmp_rot[0])) { /* Error */ if (symops) ccp4_parse_end(symops); return -1; } /* Load result into the appropriate array location */ for (j = 0; j < 4; ++j) for (k = 0; k < 4; ++k) rot[nsym][j][k] = tmp_rot[j][k]; nsym++; /* Reset for next symop */ got_symop = 0; symopbuf[0] = '\0'; } } } /* Tidy up and return the number of symops */ if (symops) ccp4_parse_end(symops); return nsym; } void ccp4spg_free(CCP4SPG **sp) { free ((*sp)->symop); free ((*sp)->invsymop); free (*sp); *sp=NULL; } int ccp4_spg_get_centering(const char *symbol_Hall, float cent_ops[4][3]) { int debug=0; int i,j; for (i = 0; i < 4; ++i) for (j = 0; j < 3; ++j) cent_ops[i][j] = 0.0; if (strchr(symbol_Hall,'P')) { if (debug) printf("Primitive \n"); return 1; } else if (strchr(symbol_Hall,'A')) { if (debug) printf("A centering \n"); cent_ops[1][1] = 0.5; cent_ops[1][2] = 0.5; return 2; } else if (strchr(symbol_Hall,'B')) { if (debug) printf("B centering \n"); cent_ops[1][0] = 0.5; cent_ops[1][2] = 0.5; return 2; } else if (strchr(symbol_Hall,'C')) { if (debug) printf("C centering \n"); cent_ops[1][0] = 0.5; cent_ops[1][1] = 0.5; return 2; } else if (strchr(symbol_Hall,'F')) { if (debug) printf("F centering \n"); cent_ops[1][1] = 0.5; cent_ops[1][2] = 0.5; cent_ops[2][0] = 0.5; cent_ops[2][2] = 0.5; cent_ops[3][0] = 0.5; cent_ops[3][1] = 0.5; return 4; } else if (strchr(symbol_Hall,'I')) { if (debug) printf("I centering \n"); cent_ops[1][0] = 0.5; cent_ops[1][1] = 0.5; cent_ops[1][2] = 0.5; return 2; } else if (strchr(symbol_Hall,'H')) { /* fixme: Hall doesn't specify H, whereas xHM does */ if (debug) printf("H centering \n"); cent_ops[1][0] = 2.0/3.0; cent_ops[1][1] = 1.0/3.0; cent_ops[1][2] = 1.0/3.0; cent_ops[2][0] = 1.0/3.0; cent_ops[2][1] = 2.0/3.0; cent_ops[2][2] = 2.0/3.0; return 3; } else if (strchr(symbol_Hall,'R')) { if (debug) printf("R centering \n"); return 1; } return 0; } /* standard asu tests for 11 Laue classes */ int ASU_1b (const int h, const int k, const int l) { return (l>0 || (l==0 && (h>0 || (h==0 && k>=0)))); } int ASU_2_m (const int h, const int k, const int l) { return (k>=0 && (l>0 || (l==0 && h>=0))); } int ASU_mmm (const int h, const int k, const int l) { return (h>=0 && k>=0 && l>=0); } int ASU_4_m (const int h, const int k, const int l) { return (l>=0 && ((h>=0 && k>0) || (h==0 && k==0))); } int ASU_4_mmm(const int h, const int k, const int l) { return (h>=k && k>=0 && l>=0); } int ASU_3b (const int h, const int k, const int l) { return (h>=0 && k>0) || (h==0 && k==0 && l >= 0); } int ASU_3bm (const int h, const int k, const int l) { return (h>=k && k>=0 && (k>0 || l>=0)); } int ASU_3bmx (const int h, const int k, const int l) { return (h>=k && k>=0 && (h>k || l>=0)); } int ASU_6_m (const int h, const int k, const int l) { return (l>=0 && ((h>=0 && k>0) || (h==0 && k==0))); } int ASU_6_mmm(const int h, const int k, const int l) { return (h>=k && k>=0 && l>=0); } int ASU_m3b (const int h, const int k, const int l) { return (h>=0 && ((l>=h && k>h) || (l==h && k==h))); } int ASU_m3bm (const int h, const int k, const int l) { return (h>=0 && k>=l && l>=h); } char *ccp4spg_symbol_Hall(CCP4SPG* sp) { if (!sp) { ccp4_signal(CSYM_ERRNO(CSYMERR_NullSpacegroup),"ccp4spg_symbol_Hall",NULL); return NULL; } return sp->symbol_Hall; } ccp4_symop ccp4_symop_invert( const ccp4_symop op1 ) { float rot1[4][4],rot2[4][4]; rotandtrn_to_mat4(rot1,op1); invert4matrix((const float (*)[4])rot1,rot2); return (mat4_to_rotandtrn((const float (*)[4])rot2)); } int ccp4spg_name_equal(const char *spgname1, const char *spgname2) { char *ch1, *ch2, *spgname1_upper, *spgname2_upper; /* create copies of input strings, and convert to upper case */ spgname1_upper = strdup(spgname1); strtoupper(spgname1_upper,spgname1); spgname2_upper = strdup(spgname2); strtoupper(spgname2_upper,spgname2); ch1 = spgname1_upper; ch2 = spgname2_upper; while (*ch1 == *ch2) { if (*ch1 == '\0' && *ch2 == '\0') { free(spgname1_upper); free(spgname2_upper); return 1; } ++ch1; ++ch2; } free(spgname1_upper); free(spgname2_upper); return 0; } int ccp4spg_name_equal_to_lib(const char *spgname_lib, const char *spgname_match) { char *ch1, *ch2, *spgname1_upper, *spgname2_upper, *tmpstr; int have_one_1=0, have_one_2=0; /* create copies of input strings, convert to upper case, and deal with colons */ spgname1_upper = strdup(spgname_lib); strtoupper(spgname1_upper,spgname_lib); ccp4spg_name_de_colon(spgname1_upper); spgname2_upper = strdup(spgname_match); strtoupper(spgname2_upper,spgname_match); ccp4spg_name_de_colon(spgname2_upper); /* see if strings are equal, except for spaces */ ch1 = spgname1_upper; ch2 = spgname2_upper; while (*ch1 == *ch2) { if (*ch1 == '\0' && *ch2 == '\0') { free(spgname1_upper); free(spgname2_upper); return 1; } while (*(++ch1) == ' ') ; while (*(++ch2) == ' ') ; } /* if that didn't work, and spgname_match is a short name, try removing " 1 " from spgname_lib, and matching again. This would match P21 to 'P 1 21 1' for instance. */ /* try to identify if "short names" are being used. */ if (strstr(spgname1_upper," 1 ")) have_one_1 = 1; if (strstr(spgname2_upper," 1 ")) have_one_2 = 1; /* if spgname_lib has " 1 " and spgname_match doesn't, then strip out " 1" to do "short" comparison */ if (have_one_1 && ! have_one_2) { tmpstr = strdup(spgname1_upper); ccp4spg_to_shortname(tmpstr,spgname1_upper); strcpy(spgname1_upper,tmpstr); free(tmpstr); } /* see if strings are equal, except for spaces */ ch1 = spgname1_upper; ch2 = spgname2_upper; while (*ch1 == *ch2) { if (*ch1 == '\0' && *ch2 == '\0') { free(spgname1_upper); free(spgname2_upper); return 1; } while (*(++ch1) == ' ') ; while (*(++ch2) == ' ') ; } free(spgname1_upper); free(spgname2_upper); return 0; } char *ccp4spg_to_shortname(char *shortname, const char *longname) { const char *ch1; char *ch2; int trigonal=0; ch1 = longname; ch2 = shortname; /* "P 1" is an exception */ if (!strcmp(ch1,"P 1")) { strcpy(ch2,"P1"); return ch2; } /* trigonal are another exception, don't want to lose significant " 1" */ if (!strncmp(ch1,"P 3",3) || !strncmp(ch1,"P -3",4) || !strncmp(ch1,"R 3",3) || !strncmp(ch1,"R -3",4)) trigonal=1; while (*ch1 != '\0') { if (!trigonal && !strncmp(ch1," 1",2)) { ch1 += 2; } else { /* take out blanks - note check for " 1" takes precedence */ while (*ch1 == ' ') ++ch1; if (*ch1 != '\0') { *ch2 = *ch1; ++ch2; ++ch1; } } } *ch2 = '\0'; return ch2; } void ccp4spg_name_de_colon(char *name) { char *ch1; /* various spacegroup names have settings specified by colon. We'll deal with these on a case-by-case basis. */ if ((ch1 = strstr(name,":R")) != NULL) { /* :R spacegroup should be R already so just replace with blanks */ *ch1 = ' '; *(ch1+1) = ' '; } else if ((ch1 = strstr(name,":H")) != NULL) { /* :H spacegroup should be R so change to H */ *ch1 = ' '; *(ch1+1) = ' '; ch1 = strstr(name,"R"); if (ch1 != NULL) *ch1 = 'H'; } return; } int ccp4spg_pgname_equal(const char *pgname1, const char *pgname2) { char *ch1, *ch2, *pgname1_upper, *pgname2_upper; pgname1_upper = strdup(pgname1); strtoupper(pgname1_upper,pgname1); pgname2_upper = strdup(pgname2); strtoupper(pgname2_upper,pgname2); ch1 = pgname1_upper; if (pgname1_upper[0] == 'P' && pgname1_upper[1] == 'G') ch1 += 2; ch2 = pgname2_upper; if (pgname2_upper[0] == 'P' && pgname2_upper[1] == 'G') ch2 += 2; while (*ch1 == *ch2) { if (*ch1 == '\0' && *ch2 == '\0') { free(pgname1_upper); free(pgname2_upper); return 1; } while (*(++ch1) == ' ') ; while (*(++ch2) == ' ') ; } free(pgname1_upper); free(pgname2_upper); return 0; } ccp4_symop *ccp4spg_norm_trans(ccp4_symop *op) { int i; for ( i = 0; i < 3; i++ ) { while (op->trn[i] < 0.0) op->trn[i] += 1.0; while (op->trn[i] >= 1.0) op->trn[i] -= 1.0; } return op; } int ccp4_spgrp_equal( int nsym1, const ccp4_symop *op1, int nsym2, const ccp4_symop *op2 ) { int i, n; int *symcode1, *symcode2; /* first check that we have equal number of symops */ if ( nsym1 != nsym2 ) return 0; n = nsym1; /* now make the sym code arrays */ symcode1 = ccp4_utils_malloc( n * sizeof(int) ); symcode2 = ccp4_utils_malloc( n * sizeof(int) ); for ( i = 0; i < n; i++ ) { symcode1[i] = ccp4_symop_code( op1[i] ); symcode2[i] = ccp4_symop_code( op2[i] ); } /* sort the symcodes */ /* Kevin suggests maybe just compare all pairs rather than sort */ qsort( symcode1, n, sizeof(int), &ccp4_int_compare ); qsort( symcode2, n, sizeof(int), &ccp4_int_compare ); /* compare the symcodes */ for ( i = 0; i < n; i++ ) { if ( symcode1[i] != symcode2[i] ) break; } /* delete the symcodes */ free(symcode1); free(symcode2); /* return true if they are equal */ return ( i == n ); } int ccp4_spgrp_equal_order( int nsym1, const ccp4_symop *op1, int nsym2, const ccp4_symop *op2 ) { int i; /* first check that we have equal number of symops */ if ( nsym1 != nsym2 ) return 0; /* compare the symcodes */ for ( i = 0; i < nsym1; i++ ) { if ( ccp4_symop_code( op1[i] ) != ccp4_symop_code( op2[i] ) ) break; } /* return true if they are equal */ return ( i == nsym1 ); } int ccp4_symop_code(ccp4_symop op) { int i, j, code=0; for ( i=0; i<3; i++ ) for ( j=0; j<3; j++ ) code = ( code << 2 ) | ( (int) rint( op.rot[i][j] ) & 0x03 ) ; for ( i=0; i<3; i++ ) code = ( code << 4 ) | ( (int) rint( op.trn[i]*12.0 ) & 0x0f ) ; return code; } int ccp4_int_compare( const void *p1, const void *p2 ) { return ( *((int*)p1) - *((int*)p2) ); } int ccp4spg_is_in_pm_asu(const CCP4SPG* sp, const int h, const int k, const int l) { if (ccp4spg_is_in_asu(sp,h,k,l)) return (1); if (ccp4spg_is_in_asu(sp,-h,-k,-l)) return (-1); return 0; } int ccp4spg_is_in_asu(const CCP4SPG* sp, const int h, const int k, const int l) { if (!sp) { ccp4_signal(CSYM_ERRNO(CSYMERR_NullSpacegroup),"ccp4spg_is_in_asu",NULL); return 0; } if ( ccp4spg_do_chb(sp->chb) ) return sp->asufn( (int) rint( h*sp->chb[0][0] + k*sp->chb[1][0] + l*sp->chb[2][0] ), (int) rint( h*sp->chb[0][1] + k*sp->chb[1][1] + l*sp->chb[2][1] ), (int) rint( h*sp->chb[0][2] + k*sp->chb[1][2] + l*sp->chb[2][2] ) ); else return sp->asufn( h, k, l ); } int ccp4spg_put_in_asu(const CCP4SPG* sp, const int hin, const int kin, const int lin, int *hout, int *kout, int *lout ) { int i, isign; if (!sp) { ccp4_signal(CSYM_ERRNO(CSYMERR_NullSpacegroup),"ccp4spg_put_in_asu",NULL); return 0; } /* cycle through all primitive symmetry operations until in asu */ for (i = 0; i < sp->nsymop_prim; ++i) { *hout = (int) rint( hin*sp->symop[i].rot[0][0] + kin*sp->symop[i].rot[1][0] + lin*sp->symop[i].rot[2][0] ); *kout = (int) rint( hin*sp->symop[i].rot[0][1] + kin*sp->symop[i].rot[1][1] + lin*sp->symop[i].rot[2][1] ); *lout = (int) rint( hin*sp->symop[i].rot[0][2] + kin*sp->symop[i].rot[1][2] + lin*sp->symop[i].rot[2][2] ); if ((isign = ccp4spg_is_in_pm_asu(sp,*hout,*kout,*lout)) != 0) { *hout = *hout * isign; *kout = *kout * isign; *lout = *lout * isign; return ( (isign > 0) ? 2*i+1 : 2*i+2 ); } } printf ("Can't put in asu ! \n"); return 0; } /* Generate indices according to symmetry operation isym */ void ccp4spg_generate_indices(const CCP4SPG* sp, const int isym, const int hin, const int kin, const int lin, int *hout, int *kout, int *lout ) { int jsym, isign; if (!sp) { ccp4_signal(CSYM_ERRNO(CSYMERR_NullSpacegroup),"ccp4spg_generate_indices",NULL); return; } jsym = (isym - 1) / 2; isign = (isym % 2) ? 1 : -1 ; *hout = isign * (int) rint(hin*sp->invsymop[jsym].rot[0][0] + kin*sp->invsymop[jsym].rot[1][0] + lin*sp->invsymop[jsym].rot[2][0]); *kout = isign * (int) rint(hin*sp->invsymop[jsym].rot[0][1] + kin*sp->invsymop[jsym].rot[1][1] + lin*sp->invsymop[jsym].rot[2][1]); *lout = isign * (int) rint(hin*sp->invsymop[jsym].rot[0][2] + kin*sp->invsymop[jsym].rot[1][2] + lin*sp->invsymop[jsym].rot[2][2]); } /* shift phase value associated with hin,kin,lin according to translation and optional sign change. Return in range 0,360 */ float ccp4spg_phase_shift(const int hin, const int kin, const int lin, const float phasin, const float trans[3], const int isign) { double phasout; phasout = (double) phasin; if (isign == -1) phasout = - phasout; phasout += (hin*trans[0] + kin*trans[1] + lin*trans[2]) * 360.0; phasout = fmod(phasout,360.0); if (phasout < 0.0) phasout += 360.0; return ((float) phasout); } int ccp4spg_do_chb(const float chb[3][3]) { return ( chb[0][0] != 1 || chb[1][1] != 1 || chb[2][2] != 1 || chb[0][1] != 0 || chb[0][2] != 0 || chb[1][2] != 0 || chb[1][0] != 0 || chb[2][0] != 0 || chb[2][1] != 0 ); } /* functions to identify centrics - based on Randy's method */ void ccp4spg_set_centric_zones(CCP4SPG* sp) { int i,j,hnew,knew,lnew; int ihkl[12][3]; if (!sp) { ccp4_signal(CSYM_ERRNO(CSYMERR_NullSpacegroup),"ccp4spg_set_centric_zones",NULL); return; } ihkl[0][0] = 0; ihkl[0][1] = 1; ihkl[0][2] = 2; ihkl[1][0] = 1; ihkl[1][1] = 0; ihkl[1][2] = 2; ihkl[2][0] = 1; ihkl[2][1] = 2; ihkl[2][2] = 0; ihkl[3][0] = 1; ihkl[3][1] = 1; ihkl[3][2] = 10; ihkl[4][0] = 1; ihkl[4][1] = 10; ihkl[4][2] = 1; ihkl[5][0] = 10; ihkl[5][1] = 1; ihkl[5][2] = 1; ihkl[6][0] = 1; ihkl[6][1] = -1; ihkl[6][2] = 10; ihkl[7][0] = 1; ihkl[7][1] = 10; ihkl[7][2] = -1; ihkl[8][0] = 10; ihkl[8][1] = 1; ihkl[8][2] = -1; ihkl[9][0] = -1; ihkl[9][1] = 2; ihkl[9][2] = 10; ihkl[10][0] = 2; ihkl[10][1] = -1; ihkl[10][2] = 10; ihkl[11][0] = 1; ihkl[11][1] = 4; ihkl[11][2] = 8; /* loop over all possible centric zones */ for (i = 0; i < 12; ++i) { sp->centrics[i] = 0; for (j = 0; j < sp->nsymop; ++j) { hnew = (int) rint( ihkl[i][0]*sp->symop[j].rot[0][0] + ihkl[i][1]*sp->symop[j].rot[1][0] + ihkl[i][2]*sp->symop[j].rot[2][0] ); if (hnew == -ihkl[i][0]) { knew = (int) rint( ihkl[i][0]*sp->symop[j].rot[0][1] + ihkl[i][1]*sp->symop[j].rot[1][1] + ihkl[i][2]*sp->symop[j].rot[2][1] ); if (knew == -ihkl[i][1]) { lnew = (int) rint( ihkl[i][0]*sp->symop[j].rot[0][2] + ihkl[i][1]*sp->symop[j].rot[1][2] + ihkl[i][2]*sp->symop[j].rot[2][2] ); if (lnew == -ihkl[i][2]) { sp->centrics[i] = j+1; break; } } } } } } int ccp4spg_is_centric(const CCP4SPG* sp, const int h, const int k, const int l) { int i; if (!sp) { ccp4_signal(CSYM_ERRNO(CSYMERR_NullSpacegroup),"ccp4spg_is_centric",NULL); return -1; } /* loop over all possible centric zones */ for (i = 0; i < 12; ++i) if (sp->centrics[i]) if (ccp4spg_check_centric_zone(i+1,h,k,l) == 0) return 1; return 0; } /* check indices against centric zones - return 0 if in zone "nzone" */ int ccp4spg_check_centric_zone(const int nzone, const int h, const int k, const int l) { switch (nzone) { case 1: return h; case 2: return k; case 3: return l; case 4: return h - k; case 5: return h - l; case 6: return k - l; case 7: return h + k; case 8: return h + l; case 9: return k + l; case 10: return 2*h + k; case 11: return h + 2*k; case 12: return 0; } printf ("Invalid nzone ! \n"); return 0; } float ccp4spg_centric_phase(const CCP4SPG* sp, const int h, const int k, const int l) { int i,isym; float centric_phase; if (!sp) { ccp4_signal(CSYM_ERRNO(CSYMERR_NullSpacegroup),"ccp4spg_centric_phase",NULL); return 0.0; } /* loop over all possible centric zones */ for (i = 0; i < 12; ++i) if (sp->centrics[i]) if (ccp4spg_check_centric_zone(i+1,h,k,l) == 0) { isym = sp->centrics[i]; centric_phase = h*sp->symop[isym-1].trn[0] + k*sp->symop[isym-1].trn[1] + l*sp->symop[isym-1].trn[2]; centric_phase = 180.0*(centric_phase - rint(centric_phase)); if (centric_phase < 0.0) centric_phase = centric_phase + 180.0; return centric_phase; } return 0; } void ccp4spg_print_centric_zones(const CCP4SPG* sp) { int i,j=0; char centric_zone[8]; if (!sp) { ccp4_signal(CSYM_ERRNO(CSYMERR_NullSpacegroup),"ccp4spg_print_centric_zones",NULL); return; } printf("\n ****** CENTRIC ZONES ****** \n\n"); /* loop over all possible centric zones */ for (i = 0; i < 12; ++i) if (sp->centrics[i]) { printf(" CENTRIC Zone %d\n",++j); printf(" Reflections of type %s \n\n", ccp4spg_describe_centric_zone(i+1,centric_zone)); } if (!j) printf(" (no centric zones for this spacegroup) \n\n"); } char *ccp4spg_describe_centric_zone(const int nzone, char *centric_zone) { switch (nzone) { case 1: return ( strcpy(centric_zone,"0kl") ); case 2: return ( strcpy(centric_zone,"h0l") ); case 3: return ( strcpy(centric_zone,"hk0") ); case 4: return ( strcpy(centric_zone,"hhl") ); case 5: return ( strcpy(centric_zone,"hkh") ); case 6: return ( strcpy(centric_zone,"hkk") ); case 7: return ( strcpy(centric_zone,"h -hl") ); case 8: return ( strcpy(centric_zone,"hk -h") ); case 9: return ( strcpy(centric_zone,"hk -k") ); case 10: return ( strcpy(centric_zone,"-h 2h l") ); case 11: return ( strcpy(centric_zone,"2h -h l") ); case 12: return ( strcpy(centric_zone,"hkl") ); } printf ("Invalid nzone ! \n"); return "null"; } /* functions to identify epsilon zones - based on Randy's method */ void ccp4spg_set_epsilon_zones(CCP4SPG* sp) { int i,j,hnew,knew,lnew,neps; int ihkl[13][3]; if (!sp) { ccp4_signal(CSYM_ERRNO(CSYMERR_NullSpacegroup),"ccp4spg_set_epsilon_zones",NULL); return; } ihkl[0][0] = 1; ihkl[0][1] = 0; ihkl[0][2] = 0; ihkl[1][0] = 0; ihkl[1][1] = 2; ihkl[1][2] = 0; ihkl[2][0] = 0; ihkl[2][1] = 0; ihkl[2][2] = 2; ihkl[3][0] = 1; ihkl[3][1] = 1; ihkl[3][2] = 0; ihkl[4][0] = 1; ihkl[4][1] = 0; ihkl[4][2] = 1; ihkl[5][0] = 0; ihkl[5][1] = 1; ihkl[5][2] = 1; ihkl[6][0] = 1; ihkl[6][1] = -1; ihkl[6][2] = 0; ihkl[7][0] = 1; ihkl[7][1] = 0; ihkl[7][2] = -1; ihkl[8][0] = 0; ihkl[8][1] = 1; ihkl[8][2] = -1; ihkl[9][0] = -1; ihkl[9][1] = 2; ihkl[9][2] = 0; ihkl[10][0] = 2; ihkl[10][1] = -1; ihkl[10][2] = 0; ihkl[11][0] = 1; ihkl[11][1] = 1; ihkl[11][2] = 1; ihkl[12][0] = 1; ihkl[12][1] = 2; ihkl[12][2] = 3; /* Loop over all possible epsilon zones, except the catch-all 13th. For each zone, "neps" counts the number of symmetry operators that map a representative reflection "ihkl" to itself. At least the identity will do this. If any more do, then this is a relevant epsilon zone. */ for (i = 0; i < 12; ++i) { sp->epsilon[i] = 0; neps = 0; for (j = 0; j < sp->nsymop_prim; ++j) { hnew = (int) rint( ihkl[i][0]*sp->symop[j].rot[0][0] + ihkl[i][1]*sp->symop[j].rot[1][0] + ihkl[i][2]*sp->symop[j].rot[2][0] ); if (hnew == ihkl[i][0]) { knew = (int) rint( ihkl[i][0]*sp->symop[j].rot[0][1] + ihkl[i][1]*sp->symop[j].rot[1][1] + ihkl[i][2]*sp->symop[j].rot[2][1] ); if (knew == ihkl[i][1]) { lnew = (int) rint( ihkl[i][0]*sp->symop[j].rot[0][2] + ihkl[i][1]*sp->symop[j].rot[1][2] + ihkl[i][2]*sp->symop[j].rot[2][2] ); if (lnew == ihkl[i][2]) { ++neps; } } } } if (neps > 1) sp->epsilon[i] = neps * (sp->nsymop/sp->nsymop_prim); } /* hkl zone covers all with neps of 1 */ sp->epsilon[12] = sp->nsymop/sp->nsymop_prim; } int ccp4spg_get_multiplicity(const CCP4SPG* sp, const int h, const int k, const int l) { int i; if (!sp) { ccp4_signal(CSYM_ERRNO(CSYMERR_NullSpacegroup),"ccp4spg_get_multiplicity",NULL); return 0; } /* loop over all possible epsilon zones */ for (i = 0; i < 13; ++i) if (sp->epsilon[i]) if (ccp4spg_check_epsilon_zone(i+1,h,k,l) == 0) return sp->epsilon[i]; return 0; } int ccp4spg_check_epsilon_zone(const int nzone, const int h, const int k, const int l) { int bigfac=1000; /* this needs to be big enough to prevent accidental zeros */ switch (nzone) { case 1: return bigfac*k + l; case 2: return h + bigfac*l; case 3: return h + bigfac*k; case 4: return h - k + bigfac*l; case 5: return h + bigfac*k - l; case 6: return bigfac*h + k - l; case 7: return h + k + bigfac*l; case 8: return h + bigfac*k + l; case 9: return bigfac*h + k + l; case 10: return 2*h + k + bigfac*l; case 11: return h + 2*k + bigfac*l; case 12: return h + bigfac*k - (bigfac+1)*l; case 13: return 0; } printf ("Invalid nzone ! \n"); return 0; } void ccp4spg_print_epsilon_zones(const CCP4SPG* sp) { int i,j=0; char epsilon_zone[8]; if (!sp) { ccp4_signal(CSYM_ERRNO(CSYMERR_NullSpacegroup),"ccp4spg_print_epsilon_zones",NULL); return; } printf("\n ****** EPSILON ZONES - Reflection Classes and their multiplicity ****** \n"); /* loop over all possible epsilon zones */ for (i = 0; i < 13; ++i) if (sp->epsilon[i]) { printf("\n EPSILON Zone %d\n",++j); printf(" Reflections of type %s \n", ccp4spg_describe_epsilon_zone(i+1,epsilon_zone)); printf(" Multiplicity %d\n",sp->epsilon[i]); } } char *ccp4spg_describe_epsilon_zone(const int nzone, char *epsilon_zone) { switch (nzone) { case 1: return ( strcpy(epsilon_zone,"h00") ); case 2: return ( strcpy(epsilon_zone,"0k0") ); case 3: return ( strcpy(epsilon_zone,"00l") ); case 4: return ( strcpy(epsilon_zone,"hh0") ); case 5: return ( strcpy(epsilon_zone,"h0h") ); case 6: return ( strcpy(epsilon_zone,"0kk") ); case 7: return ( strcpy(epsilon_zone,"h -h0") ); case 8: return ( strcpy(epsilon_zone,"h0 -h") ); case 9: return ( strcpy(epsilon_zone,"0k -k") ); case 10: return ( strcpy(epsilon_zone,"-h 2h 0") ); case 11: return ( strcpy(epsilon_zone,"2h -h 0") ); case 12: return ( strcpy(epsilon_zone,"hhh") ); case 13: return ( strcpy(epsilon_zone,"hkl") ); } printf ("Invalid nzone ! \n"); return "null"; } int ccp4spg_is_sysabs(const CCP4SPG* sp, const int h, const int k, const int l) { int j,hnew,knew,lnew; float del_phas; if (!sp) { ccp4_signal(CSYM_ERRNO(CSYMERR_NullSpacegroup),"ccp4spg_is_sysabs",NULL); return -1; } if (sp->nsymop > 1) { for (j = 1; j < sp->nsymop; ++j) { hnew = (int) rint( h*sp->invsymop[j].rot[0][0] + k*sp->invsymop[j].rot[1][0] + l*sp->invsymop[j].rot[2][0] ); if (hnew == h) { knew = (int) rint( h*sp->invsymop[j].rot[0][1] + k*sp->invsymop[j].rot[1][1] + l*sp->invsymop[j].rot[2][1] ); if (knew == k) { lnew = (int) rint( h*sp->invsymop[j].rot[0][2] + k*sp->invsymop[j].rot[1][2] + l*sp->invsymop[j].rot[2][2] ); if (lnew == l) { /* phase shift from translational component of sym op */ del_phas = h*sp->symop[j].trn[0] + k*sp->symop[j].trn[1] + l*sp->symop[j].trn[2]; if ( fabs(del_phas - rint( del_phas )) > 0.05 ) return (1); } } } } } return (0); } int ccp4spg_generate_origins(const char *namspg, const int nsym, const float rsym[][4][4], float origins[][3], int *polarx, int *polary, int *polarz, const int iprint) { int i,j,k,norigins,k1,k2,k3,alt_orig,ichk; int id[6]={0,6,4,8,3,9},is[3]; float xin=0.13,yin=0.17,zin=0.19,xout,yout,zout,rsymd[3][3]; *polarx = *polary = *polarz = 1; for (i = 1; i < nsym; ++i) { xout = rsym[i][0][0]*xin + rsym[i][0][1]*yin + rsym[i][0][2]*zin; if (fabs(xout-xin) > 0.01) *polarx = 0; yout = rsym[i][1][0]*xin + rsym[i][1][1]*yin + rsym[i][1][2]*zin; if (fabs(yout-yin) > 0.01) *polary = 0; zout = rsym[i][2][0]*xin + rsym[i][2][1]*yin + rsym[i][2][2]*zin; if (fabs(zout-zin) > 0.01) *polarz = 0; } /* First origin is 0,0,0 */ norigins=1; origins[0][0]=0.0; origins[0][1]=0.0; origins[0][2]=0.0; /* check which points can be an alternate origin. only six possibilities which are 0 1/2 1/3 2/3 1/4 3/4 is/id expressed as twelfths */ for (k1 = 0; k1 < 6; ++k1) { for (k2 = 0; k2 < 6; ++k2) { for (k3 = 0; k3 < 6; ++k3) { if (k1==0 && k2 == 0 && k3 ==0) continue; is[0]=id[k1]; is[1]=id[k2]; is[2]=id[k3]; if ( *polarx && is[0] ) continue; if ( *polary && is[1] ) continue; if ( *polarz && is[2] ) continue; /* Let [Si] =[RSYMi] be (3x4) symmetry operator. Need to Check if the symmetry operator shifts of each alternate origin [ORx,ORy,ORz) are preserved for each symmetry operator. Origin (0,0,0) shifts to Ti(1), Ti(2) Ti(3) == RSYMi(1,4),RSYMi(2,4),RSYMi(3,4) [RSYMi] [OR] = [OR] + [Ti] + n[I] = [1 0 0 RSYMi(1,4)] [OR1] + n[I] [0 1 0 RSYMi(2,4)] [OR2] [0 0 1 RSYMi(3,4)] [OR3] Hence [RSYMi(1,1) -1 RSYMi(1,2) RSYMi(1,3) 0] [OR1] = n[I] [RSYMi(2,1) RSYMi(2,2) -1 RSYMi(2,3) 0] [OR2] [RSYMi(3,1) RSYMi(3,2) RSYMi(3,3) -1 0] [OR3] [ 0 0 0 1] [1 ] Use RSYM(..1) to respresent indentity.. Enough to use 3x3 matrix.. */ alt_orig=1; for (i = 1; i < nsym && alt_orig; ++i) { for (j = 0; j < 3; ++j) for (k = 0; k < 3; ++k) rsymd[j][k] = rsym[i][j][k] - rsym[0][j][k]; for (j = 0; j < 3; ++j) { ichk = (int) rint( rsymd[j][0]*is[0]+rsymd[j][1]*is[1]+rsymd[j][2]*is[2] ); if ( ichk % 12 ) { alt_orig=0; break; } } } if (alt_orig) { norigins+=1; origins[norigins-1][0]=is[0]/12.0; origins[norigins-1][1]=is[1]/12.0; origins[norigins-1][2]=is[2]/12.0; } } } } if (iprint) { if( *polarx && *polary && *polarz) { printf(" this is p1: origin anywhere"); printf("\n %s %s %s \n", "Number of alternate origins for spacegroup: ",namspg," is infinite."); } else if( *polarx && *polary) { printf(" this is a polar+ spacegroup: origin anywhere in a b plane"); printf("\n %s %s %s %d \n", "Number of alternate origin containing planes for spacegroup:", namspg, " is:",norigins); } else if( *polarx && *polarz) { printf(" this is a polar+ spacegroup: origin anywhere in a c plane"); printf("\n %s %s %s %d \n", "Number of alternate origin containing planes for spacegroup:", namspg, " is:",norigins); } else if( *polary && *polarz) { printf(" this is a polar+ spacegroup: origin anywhere in b c plane"); printf("\n %s %s %s %d \n", "Number of alternate origin containing planes for spacegroup:", namspg, " is:",norigins); } else if( *polarx) { printf(" this is a polar spacegroup: origin is not fixed along a axis"); printf("\n %s %s %s %d \n", "Number of alternate origin containing lines for spacegroup: ", namspg, " is:",norigins); } else if( *polary) { printf(" this is a polar spacegroup: origin is not fixed along b axis"); printf("\n %s %s %s %d \n", "Number of alternate origin containing lines for spacegroup: ", namspg, " is:",norigins); } else if( *polarz) { printf(" this is a polar spacegroup: origin is not fixed along c axis"); printf("\n %s %s %s %d \n", "Number of alternate origin containing lines for spacegroup: ", namspg, " is:",norigins); } else { printf("\n %s %s %s %d \n", "Number of alternate origins for spacegroup: ",namspg, " is:",norigins); } printf("\n Norigin Ox Oy Oz\n\n"); for (i = 0; i < norigins; ++i) { if (*polary && *polarz && *polarx) { printf("%8d ?? ?? ?? \n", i+1); } else if(*polarx && *polary) { printf("%8d ?? ?? %8.4f\n", i+1,origins[i][2]); } else if(*polarx && *polarz) { printf("%8d ?? %8.4f ?? \n", i+1,origins[i][1]); } else if(*polary && *polarz) { printf("%8d%8.4f ?? ?? \n", i+1,origins[i][0]); } else if( *polarx) { printf("%8d ?? %8.4f%8.4f\n", i+1,origins[i][1],origins[i][2]); } else if(*polary) { printf("%8d%8.4f ?? %8.4f\n", i+1,origins[i][0],origins[i][2]); } else if(*polarz) { printf("%8d%8.4f%8.4f ?? \n", i+1,origins[i][0],origins[i][1]); } else { printf("%8d%8.4f%8.4f%8.4f\n", i+1,origins[i][0],origins[i][1],origins[i][2]); } } } return norigins; } void ccp4spg_print_recip_spgrp(const CCP4SPG* sp) { if (!sp) { ccp4_signal(CSYM_ERRNO(CSYMERR_NullSpacegroup),"ccp4spg_print_recip_spgrp",NULL); return; } printf("Reciprocal space symmetry: \n"); printf("Space group: \"%s\" Point group: \"%s\" Laue group: \"%s\" \n", sp->symbol_xHM,sp->point_group,sp->laue_name); printf("Reference asymmetric unit: \"%s\" \n",sp->asu_descr); printf(" (change of basis may be applied) \n"); ccp4spg_print_recip_ops(sp); } void ccp4spg_print_recip_ops(const CCP4SPG* sp) { int i,j,k,l,nrow, n_in_last_row,rsymop_len=80; float tmp_symop[4][4]; char rsymop[80]; if (!sp) { ccp4_signal(CSYM_ERRNO(CSYMERR_NullSpacegroup),"ccp4spg_print_recip_ops",NULL); return; } nrow = (sp->nsymop_prim + 3)/ 4; n_in_last_row = sp->nsymop_prim % 4; if (n_in_last_row == 0) n_in_last_row = 4; printf("\n Spacegroup %d \"%s\" \n",sp->spg_ccp4_num,sp->symbol_xHM); printf(" Original indices for reflection hkl with symmetry number ISYM \n"); printf("\n Bijvoet positive \n"); printf(" %-18s%-18s%-18s%-18s\n","ISYM","ISYM","ISYM","ISYM"); for (i = 0 ; i < nrow-1 ; ++i) { printf(" ISYM"); for (j = 0 ; j < 4 ; ++j) { for (k = 0; k < 3; ++k) { /* note we use the transpose for reciprocal space operators */ for (l = 0; l < 3; ++l) tmp_symop[k][l] = sp->invsymop[4*i+j].rot[l][k]; tmp_symop[k][3] = 0.0; tmp_symop[3][k] = 0.0; } tmp_symop[3][3] = 1.0; mat4_to_recip_symop(rsymop,rsymop+rsymop_len,(const float (*)[4])tmp_symop); rsymop[12] = '\0'; printf(" %3d %-12s",2*(4*i+j)+1,rsymop); } printf("\n"); } printf(" ISYM"); for (j = 0 ; j < n_in_last_row ; ++j) { for (k = 0; k < 3; ++k) { for (l = 0; l < 3; ++l) tmp_symop[k][l] = sp->invsymop[4*i+j].rot[l][k]; tmp_symop[k][3] = 0.0; tmp_symop[3][k] = 0.0; } tmp_symop[3][3] = 1.0; mat4_to_recip_symop(rsymop,rsymop+rsymop_len,(const float (*)[4])tmp_symop); rsymop[12] = '\0'; printf(" %3d %-12s",2*(4*(nrow-1)+j)+1,rsymop); } printf("\n"); printf("\n Bijvoet negative \n"); printf(" %-18s%-18s%-18s%-18s\n","ISYM","ISYM","ISYM","ISYM"); for (i = 0 ; i < nrow-1 ; ++i) { printf(" ISYM"); for (j = 0 ; j < 4 ; ++j) { for (k = 0; k < 3; ++k) { for (l = 0; l < 3; ++l) tmp_symop[k][l] = - sp->invsymop[4*i+j].rot[l][k]; tmp_symop[k][3] = 0.0; tmp_symop[3][k] = 0.0; } tmp_symop[3][3] = 1.0; mat4_to_recip_symop(rsymop,rsymop+rsymop_len,(const float (*)[4])tmp_symop); rsymop[12] = '\0'; printf(" %3d %-12s",2*(4*i+j)+2,rsymop); } printf("\n"); } printf(" ISYM"); for (j = 0 ; j < n_in_last_row ; ++j) { for (k = 0; k < 3; ++k) { for (l = 0; l < 3; ++l) tmp_symop[k][l] = - sp->invsymop[4*i+j].rot[l][k]; tmp_symop[k][3] = 0.0; tmp_symop[3][k] = 0.0; } tmp_symop[3][3] = 1.0; mat4_to_recip_symop(rsymop,rsymop+rsymop_len,(const float (*)[4])tmp_symop); rsymop[12] = '\0'; printf(" %3d %-12s",2*(4*(nrow-1)+j)+2,rsymop); } printf("\n"); } int range_to_limits(const char *range, float limits[2]) { int i,in_value=1,neg=0,frac=0,equal=0; float value1,value2; float delta=0.00001; char ch; char buf[2]; buf[1] = 0; for (i = 0 ; i < strlen(range) ; ++i) { ch = range[i]; if (ch == '<') { if (in_value) { /* finishing lower value */ limits[0] = value1; if (frac) limits[0] = value1/value2; if (neg) limits[0] = - limits[0]; limits[0] += delta; neg = 0; frac = 0; in_value = 0; } else { /* starting upper value */ in_value = 1; } } else if (ch == '-') { neg = 1; } else if (ch == '/') { frac = 1; } else if (ch == '=') { if (in_value) { equal = 1; } else { limits[0] -= 2.0*delta; } } else if (ch == ';' || ch == ' ') { ; } else { if (in_value) { buf[0] = ch; if (frac) { value2 = (float) atoi(buf); } else { value1 = (float) atoi(buf); } } } } /* finishing upper value */ limits[1] = value1; if (frac) limits[1] = value1/value2; if (neg) limits[1] = - limits[1]; limits[1] -= delta; if (equal) limits[1] += 2.0*delta; return 0; } void set_fft_grid(CCP4SPG* sp, const int nxmin, const int nymin, const int nzmin, const float sample, int *nx, int *ny, int *nz) { if (!sp) { ccp4_signal(CSYM_ERRNO(CSYMERR_NullSpacegroup),"set_fft_grid",NULL); return; } *nx = get_grid_sample(nxmin, sp->laue_sampling[0], sample); *ny = get_grid_sample(nymin, sp->laue_sampling[1], sample); *nz = get_grid_sample(nzmin, sp->laue_sampling[2], sample); } int all_factors_le_19(const int n) { int i,ifact[8]={2,3,5,7,11,13,17,19}; int nn = n; for (i = 0 ; i < 8 ; ++i) { while (nn % ifact[i] == 0) { /* factor found, divide & continue if required */ nn = nn/ifact[i]; /* success */ if (nn == 1) return 1; } } return 0; } int get_grid_sample(const int minsmp, const int nmul, const float sample) { int n; float r1min=1.0, r1max=1.6, r2min=1.4, r2max=4.0; /* check minsmp <= 0, if so set nsampl = nmul */ if (minsmp <= 0) return nmul; /* set search limits */ if (sample >= 1.0) { r1max = sample; r2min = sample*0.95 < 1.0 ? 1.0 : sample*0.95; } /* start with multiple of nmul */ n = (int) rint((r1max*minsmp)/nmul)*nmul; while (n > (int) rint(r1min*minsmp)) { /* suitable sample interval found, accept it */ if (all_factors_le_19(n)) return n; /* decrement trial value & continue if still in range */ n -= nmul; } /* now try 2nd search if 1st unsuccesful */ n = (int) rint((r2min*minsmp)/nmul)*nmul; while (n < (int) rint(r2max*minsmp)) { /* suitable sample interval found, accept it */ if (all_factors_le_19(n)) return n; /* increment trial value & continue if still in range */ n += nmul; } /* failed */ return -1; } int ccp4spg_load_laue(CCP4SPG *spacegroup, const int nlaue) { int ierr = 1; if (!spacegroup) return ierr; if ( nlaue == 3 ) { spacegroup->asufn = &ASU_1b; spacegroup->nlaue = 3; strcpy(spacegroup->laue_name,"-1"); spacegroup->laue_sampling[0] = 2; spacegroup->laue_sampling[1] = 2; spacegroup->laue_sampling[2] = 2; ierr = 0; } if ( nlaue == 4 ) { spacegroup->nlaue = 4; strcpy(spacegroup->laue_name,"2/m"); spacegroup->laue_sampling[0] = 2; spacegroup->laue_sampling[1] = 4; spacegroup->laue_sampling[2] = 2; ierr = 0; } if ( nlaue == 5 ) { spacegroup->nlaue = 5; strcpy(spacegroup->laue_name,"2/m"); spacegroup->laue_sampling[0] = 2; spacegroup->laue_sampling[1] = 8; spacegroup->laue_sampling[2] = 4; ierr = 0; } if ( nlaue == 6 ) { spacegroup->nlaue = 6; strcpy(spacegroup->laue_name,"mmm"); spacegroup->laue_sampling[0] = 4; spacegroup->laue_sampling[1] = 4; spacegroup->laue_sampling[2] = 4; ierr = 0; } if ( nlaue == 7 ) { spacegroup->nlaue = 7; strcpy(spacegroup->laue_name,"4/m"); spacegroup->laue_sampling[0] = 4; spacegroup->laue_sampling[1] = 4; spacegroup->laue_sampling[2] = 8; ierr = 0; } if ( nlaue == 8 ) { spacegroup->nlaue = 8; strcpy(spacegroup->laue_name,"4/mmm"); spacegroup->laue_sampling[0] = 4; spacegroup->laue_sampling[1] = 4; spacegroup->laue_sampling[2] = 8; ierr = 0; } if ( nlaue == 9 ) { spacegroup->nlaue = 9; strcpy(spacegroup->laue_name,"-3"); spacegroup->laue_sampling[0] = 6; spacegroup->laue_sampling[1] = 6; spacegroup->laue_sampling[2] = 6; ierr = 0; } if ( nlaue == 10 ) { spacegroup->nlaue = 10; strcpy(spacegroup->laue_name,"3bar1m"); spacegroup->laue_sampling[0] = 6; spacegroup->laue_sampling[1] = 6; spacegroup->laue_sampling[2] = 6; ierr = 0; } if ( nlaue == 11 ) { spacegroup->nlaue = 11; strcpy(spacegroup->laue_name,"3barm"); spacegroup->laue_sampling[0] = 6; spacegroup->laue_sampling[1] = 6; spacegroup->laue_sampling[2] = 6; ierr = 0; } if ( nlaue == 12 ) { spacegroup->nlaue = 12; strcpy(spacegroup->laue_name,"6/m"); spacegroup->laue_sampling[0] = 6; spacegroup->laue_sampling[1] = 6; spacegroup->laue_sampling[2] = 12; ierr = 0; } if ( nlaue == 13 ) { spacegroup->nlaue = 13; strcpy(spacegroup->laue_name,"6/mmm"); spacegroup->laue_sampling[0] = 6; spacegroup->laue_sampling[1] = 6; spacegroup->laue_sampling[2] = 12; ierr = 0; } if ( nlaue == 14 ) { spacegroup->nlaue = 14; strcpy(spacegroup->laue_name,"m3bar"); spacegroup->laue_sampling[0] = 4; spacegroup->laue_sampling[1] = 4; spacegroup->laue_sampling[2] = 4; ierr = 0; } if ( nlaue == 15 ) { spacegroup->nlaue = 15; strcpy(spacegroup->laue_name,"m3barm"); spacegroup->laue_sampling[0] = 8; spacegroup->laue_sampling[1] = 8; spacegroup->laue_sampling[2] = 8; ierr = 0; } return ierr; } int ccp4spg_check_symm_cell(int nsym, float rsym[][4][4], float cell[6]) { CCP4SPG *spacegroup; int i,k,l,status=1; ccp4_symop *op1; if (nsym <= 0) return 0; /* identify spacegroup from supplied symops */ op1 = (ccp4_symop *) ccp4_utils_malloc(nsym*sizeof(ccp4_symop)); for (i = 0; i < nsym; ++i) { for (k = 0; k < 3; ++k) { for (l = 0; l < 3; ++l) { op1[i].rot[k][l] = rsym[i][k][l]; } op1[i].trn[k] = rsym[i][k][3]; } } spacegroup = ccp4_spgrp_reverse_lookup(nsym,op1); /* test cell against symmetry on case-by-case basis */ if (strstr(spacegroup->symbol_xHM,":R")) { status = ccp4uc_is_rhombohedral(cell,0.01F); } else if (strstr(spacegroup->symbol_xHM,":H")) { status = ccp4uc_is_hexagonal(cell,0.01F); } else if (spacegroup->spg_num >= 168 && spacegroup->spg_num <= 194) { status = ccp4uc_is_hexagonal(cell,0.01F); } free(op1); return status; } libccp4-8.0.0/ccp4/csymlib.h0000644000000000000000000005567414242731033013651 0ustar 00000000000000/* csymlib.h: header file for csymlib.c Copyright (C) 2001 CCLRC, Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @page csym_page CSYM library * * @verbatim @endverbatim * * @section csym_file_list File list

  • csymlib.h - contains details of the C/C++ API
  • ccp4_spg.h - contains details of the spacegroup data structure
* * @section csym_overview Overview The CSYM library is centred around a data file syminfo.lib which is auto-generated from sgtbx (the Space Group Toolbox of cctbx). A description of the contents of this file is given in the documentation of the Fortran API.

A particular spacegroup in a particular setting is loaded into an in-memory data structure by requesting a particular spacegroup name, number, or set of operators. See the functions ccp4spg_load_by_standard_num, ccp4spg_load_by_ccp4_num, ccp4spg_load_by_spgname, ccp4spg_load_by_ccp4_spgname and ccp4_spgrp_reverse_lookup. Information on the in-memory data structure is given in ccp4_spg.h The memory can be freed by the function ccp4spg_free.

Functions are provided to:

  • Query the data structure, e.g. ccp4spg_symbol_Hall, etc. (members of the structure can of course be obtained directly)
  • Check reciprocal space indices for a particular spacegroup, e.g. ccp4spg_is_in_asu, ccp4spg_is_centric, ccp4spg_get_multiplicity, ccp4spg_is_sysabs, etc.
  • Set appropriate grids for FFT, e.g. set_fft_grid
* * @section csym_operators Symmetry operators Symmetry operators are expressed in a variety of ways:
  • Using the struct ccp4_symop, which consists of a 3 x 3 rotation matrix and a translation vector.
  • As a 4 x 4 matrix, in which the rotation matrix is in the top-left-hand corner and the translation vector is in elements [*][3]. Element [3][3] is set to 1.0
  • As a string, such as "-x+1/2,-y,z+1/2"
Check the function description for which form is expected. Often, there are alternative functions if you wish to supply the operators in a different form. There are also the following conversion functions:
  • rotandtrn_to_mat4
  • rotandtrn_to_symop
  • mat4_to_rotandtrn
  • mat4_to_symop
  • mat4_to_recip_symop
  • symop_to_rotandtrn
  • symop_to_mat4
Note that the order of symmetry operators may be important in some cases, for example in MTZ files with a M/ISYM column where ISYM encodes the symmetry operation used. * @section csym_examples Examples See examples on ftp area */ /** @file csymlib.h * * @brief C-level library for symmetry information. * * Functions defining the C-level API for accessing spacegroup properties. * The primary spacegroup information comes from the data file syminfo.lib * * @author Martyn Winn */ #ifndef __CSymLib__ #define __CSymLib__ /* rcsidhs[] = "$Id$" */ /* note that definitions in ccp4_spg.h are within the CSym namespace */ #include "ccp4_spg.h" #ifdef __cplusplus namespace CSym { extern "C" { #endif /** Look up spacegroup in standard setting by number, and load properties. * Allocates memory for the spacegroup structure. This can be freed * later by ccp4spg_free(). * @param numspg spacegroup number * @return pointer to spacegroup */ CCP4SPG *ccp4spg_load_by_standard_num(const int numspg); /** Look up spacegroup by CCP4 number, and load properties. * Allocates memory for the spacegroup structure. This can be freed * later by ccp4spg_free(). * @param ccp4numspg CCP4 spacegroup number * @return pointer to spacegroup */ CCP4SPG *ccp4spg_load_by_ccp4_num(const int ccp4numspg); /** Look up spacegroup by the extended Hermann Mauguin symbol. * Allocates memory for the spacegroup structure. This can be freed * later by ccp4spg_free(). * @param spgname Spacegroup name in form of extended Hermann Mauguin symbol. * @return pointer to spacegroup */ CCP4SPG *ccp4spg_load_by_spgname(const char *spgname); /** Look up spacegroup by name. This is for use by CCP4 programs * and is more complicated than ccp4spg_load_by_spgname. For each * spacegroup in syminfo.lib it checks the CCP4 spacegroup name * first, and then the extended Hermann Mauguin symbol. * Allocates memory for the spacegroup structure. This can be freed * later by ccp4spg_free(). * @param ccp4spgname Spacegroup name. * @return pointer to spacegroup */ CCP4SPG *ccp4spg_load_by_ccp4_spgname(const char *ccp4spgname); /** Look up spacegroup by symmetry operators and load properties. * Allocates memory for the spacegroup structure. This can be freed * later by ccp4spg_free(). * @param nsym1 number of operators (including non-primitive) * @param op1 pointer to array of operators * @return pointer to spacegroup */ CCP4SPG * ccp4_spgrp_reverse_lookup(const int nsym1, const ccp4_symop *op1); /** Look up spacegroup from SYMOP. * This would not normally be called directly, but via one of * the wrapping functions. * Allocates memory for the spacegroup structure. This can be freed * later by ccp4spg_free(). * @param numspg spacegroup number * @param ccp4numspg CCP4 spacegroup number * @param spgname Spacegroup name. * @param ccp4spgname Spacegroup name. * @param nsym1 number of operators (including non-primitive) * @param op1 pointer to array of operators * @return pointer to spacegroup */ CCP4SPG *ccp4spg_load_spacegroup(const int numspg, const int ccp4numspg, const char *spgname, const char *ccp4spgname, const int nsym1, const ccp4_symop *op1); /** Free all memory malloc'd from static pointers. * To be called before program exit. The function can be * registered with atexit. */ void ccp4spg_mem_tidy(void); /** Generate symop matrices from description strings * This would not normally be called directly, but via one of * the wrapping functions SYMFR2 and SYMFR3 in the Fortran API. * @param line null-terminated string containing symop descriptions * @param rot array of 4x4 matrices * @return number of symops read, or -1 on failure */ int symfr_driver (const char *line, float rot[][4][4]); /** Free memory associated with spacegroup. * @param sp pointer to spacegroup */ void ccp4spg_free(CCP4SPG **sp); /** Look up spacegroup in standard setting by number and load into * static storage of csymlib_f. * @param numspg spacegroup number * @return void */ void ccp4spg_register_by_ccp4_num(int numspg); /** Look up spacegroup by set of symmetry operators and load into * static storage of csymlib_f. * @param nops number of symops * @param rsm symmetry operators * @return void */ void ccp4spg_register_by_symops(int nops, float rsm[][4][4]); /** Derive centering operators from Hall symbol (deprecated). * Centering operators are now read from syminfo.lib * @param symbol_Hall Hall symbol for spacegroup * @param cent_ops centering operators * @return number of centering operators (0 if none found) */ int ccp4_spg_get_centering(const char *symbol_Hall, float cent_ops[4][3]); /** Load Laue data into spacegroup structure. * @param nlaue CCP4 code for Laue group * @param spacegroup Pointer to CCP4 spacegroup structure * @return 0 on success, 1 on failure to load Laue data */ int ccp4spg_load_laue(CCP4SPG* spacegroup, const int nlaue); /** Test if reflection is in asu of Laue group 1bar. * @return 1 if in asu else 0 */ int ASU_1b (const int h, const int k, const int l); /** Test if reflection is in asu of Laue group 2/m. * @return 1 if in asu else 0 */ int ASU_2_m (const int h, const int k, const int l); /** Test if reflection is in asu of Laue group mmm. * @return 1 if in asu else 0 */ int ASU_mmm (const int h, const int k, const int l); /** Test if reflection is in asu of Laue group 4/m. * @return 1 if in asu else 0 */ int ASU_4_m (const int h, const int k, const int l); /** Test if reflection is in asu of Laue group 4/mmm. * @return 1 if in asu else 0 */ int ASU_4_mmm(const int h, const int k, const int l); /** Test if reflection is in asu of Laue group 3bar. * @return 1 if in asu else 0 */ int ASU_3b (const int h, const int k, const int l); /** Test if reflection is in asu of Laue group 3bar1m. * @return 1 if in asu else 0 */ int ASU_3bm (const int h, const int k, const int l); /** Test if reflection is in asu of Laue group 3barm. * @return 1 if in asu else 0 */ int ASU_3bmx (const int h, const int k, const int l); /** Test if reflection is in asu of Laue group 6/m. * @return 1 if in asu else 0 */ int ASU_6_m (const int h, const int k, const int l); /** Test if reflection is in asu of Laue group 6/mmm. * @return 1 if in asu else 0 */ int ASU_6_mmm(const int h, const int k, const int l); /** Test if reflection is in asu of Laue group m3bar. * @return 1 if in asu else 0 */ int ASU_m3b (const int h, const int k, const int l); /** Test if reflection is in asu of Laue group m3barm. * @return 1 if in asu else 0 */ int ASU_m3bm (const int h, const int k, const int l); /** Function to return Hall symbol for spacegroup. * @param sp pointer to spacegroup * @return pointer to Hall symbol for spacegroup */ char *ccp4spg_symbol_Hall(CCP4SPG* sp); /** inverts a symmetry operator. The input operator is * converted to a 4 x 4 matrix, inverted, and converted back. * @param ccp4_symop input symmetry operator * @return inverted symmetry operator */ ccp4_symop ccp4_symop_invert( const ccp4_symop op1 ); /** Compare two spacegroup names. Strings are converted to upper * case before making the comparison, but otherwise match must be * exact. * @param spgname1 First spacegroup name. * @param spgname2 Second spacegroup name. * @return 1 if they are equal else 0. */ int ccp4spg_name_equal(const char *spgname1, const char *spgname2); /** Try to match a spacegroup name to one from SYMINFO. Blanks are * removed when making the comparison. Strings are converted to upper * case before making the comparison. If spgname_lib has " 1 " and * spgname_match doesn't, then strip out " 1" to do "short" comparison. * @param spgname1 First spacegroup name, assumed to be a standard one * obtained at some point from SYMINFO * @param spgname2 Second spacegroup name that you are trying to match * to a standard SYMINFO one. E.g. it might have been provided by the * user. * @return 1 if they are equal else 0. */ int ccp4spg_name_equal_to_lib(const char *spgname_lib, const char *spgname_match); /** Function to create "short" name of spacegroup. Blanks * are removed, as are " 1" elements (except for the special case * of "P 1"). * @param shortname String long enough to hold short name. * @param longname Long version of spacegroup name. * @return Pointer to shortname. */ char *ccp4spg_to_shortname(char *shortname, const char *longname); /** Function to deal with colon-specified spacegroup settings. * E.g. 'R 3 :H' is converted to 'H 3 '. Note that spaces are * returned and should be dealt with by the calling function. * @param name Spacegroup name. * @return void */ void ccp4spg_name_de_colon(char *name); /** Compare two point group names. Blanks are removed when * making the comparison. Strings are converted to upper * case before making the comparison. Any initial "PG" is ignored. * @param pgname1 First point group name. * @param pgname2 Second point group name. * @return 1 if they are equal else 0. */ int ccp4spg_pgname_equal(const char *pgname1, const char *pgname2); /** Function to normalise translations of a symmetry operator, * i.e. to ensure 0.0 <= op.trn[i] < 1.0. * @param op pointer to symmetry operator. * @return Pointer to normalised symmetry operator. */ ccp4_symop *ccp4spg_norm_trans(ccp4_symop *op); /** Sort and compare two symmetry operator lists. * Kevin's code. The lists are coded as ints, which are then sorted and compared. * Note that no changes are made to the input operators, so that operators * differing by an integral number of unit cell translations are considered * unequal. If this is not what you want, normalise the operators with * ccp4spg_norm_trans first. * @param nsym1 number of symmetry operators in first list * @param op1 first list of symmetry operators * @param nsym2 number of symmetry operators in second list * @param op2 second list of symmetry operators * @return 1 if they are equal else 0. */ int ccp4_spgrp_equal( int nsym1, const ccp4_symop *op1, int nsym2, const ccp4_symop *op2); /** Compare two symmetry operator lists. * Kevin's code. The lists are coded as ints, which are compared. * Unlike ccp4_spgrp_equal, the lists are not sorted, so the same operators * in a different order will be considered unequal. * @param nsym1 number of symmetry operators in first list * @param op1 first list of symmetry operators * @param nsym2 number of symmetry operators in second list * @param op2 second list of symmetry operators * @return 1 if they are equal else 0. */ int ccp4_spgrp_equal_order( int nsym1, const ccp4_symop *op1, int nsym2, const ccp4_symop *op2); /** Make an integer coding of a symmetry operator. * The coding takes 30 bits: 18 for the rotation and 12 for the translation. * @param op symmetry operator * @return int code. */ int ccp4_symop_code(ccp4_symop op); /** Comparison of symmetry operators encoded as integers. * In ccp4_spgrp_equal, this is passed to the stdlib qsort. * @param p1 pointer to first integer * @param p1 pointer to second integer * @return difference between integers */ int ccp4_int_compare( const void *p1, const void *p2 ); /** Test whether reflection or it's Friedel mate is in asu. * @param sp pointer to spacegroup * @param h reflection index * @param k reflection index * @param l reflection index * @return 1 if in asu, -1 if -h -k -l is in asu, 0 otherwise */ int ccp4spg_is_in_pm_asu(const CCP4SPG* sp, const int h, const int k, const int l); /** Test whether reflection is in asu. * @param sp pointer to spacegroup * @param h reflection index * @param k reflection index * @param l reflection index * @return 1 if in asu, 0 otherwise */ int ccp4spg_is_in_asu(const CCP4SPG* sp, const int h, const int k, const int l); /** Place reflection (hin,kin,lin) in the asymmetric unit of spacegroup "sp". * Resultant indices are placed in (hout,kout,lout). * @param sp pointer to spacegroup * @param hin input reflection index * @param kin input reflection index * @param lin input reflection index * @param hout output reflection index * @param kout output reflection index * @param lout output reflection index * @return "isym" if successful, 0 otherwise. "isym" = 2*isymop - 1 for * reflections placed in the positive asu, i.e. I+ of a Friedel pair, and * "isym" = 2*isymop for reflections placed in the negative asu, i.e. I- of * a Friedel pair. Here "isymop" is the number of the symmetry operator used. */ int ccp4spg_put_in_asu(const CCP4SPG* sp, const int hin, const int kin, const int lin, int *hout, int *kout, int *lout ); /** Transform reflection (hin,kin,lin) according to spacegroup "sp" and * operation "isym". Resultant indices are placed in (hout,kout,lout). * @param sp pointer to spacegroup * @param isym required operation, see ccp4spg_put_in_asu * @param hin input reflection index * @param kin input reflection index * @param lin input reflection index * @param hout output reflection index * @param kout output reflection index * @param lout output reflection index * @return void */ void ccp4spg_generate_indices(const CCP4SPG* sp, const int isym, const int hin, const int kin, const int lin, int *hout, int *kout, int *lout ); /** Shift phase value associated with hin,kin,lin according to translation and optional sign change. Return in range 0,360. * @param hin reflection index * @param kin reflection index * @param lin reflection index * @param phasin Input phase. * @param trans Requested translation * @param isign If -1, change sign of phase * @return shifted phase */ float ccp4spg_phase_shift(const int hin, const int kin, const int lin, const float phasin, const float trans[3], const int isign); /** Check whether change of basis is necessary, i.e. whether the * change of basis matrix is not the identity. * @param chb change of basis matrix * @return 1 if change of basis is necessary, 0 otherwise */ int ccp4spg_do_chb(const float chb[3][3]); /** Set up centric zones for a given spacegroup. This is called * upon loading a spacegroup. * @param sp pointer to spacegroup * @return void */ void ccp4spg_set_centric_zones(CCP4SPG* sp); /** Function to determine whether or not h,k,l is a centric reflection * in spacegroup "sp". * @param sp pointer to spacegroup * @param h input reflection index * @param k input reflection index * @param l input reflection index * @return 1 if h,k,l is centric, 0 if not centric, and -1 if there is * an error. */ int ccp4spg_is_centric(const CCP4SPG* sp, const int h, const int k, const int l); /** Check indices against a centric zone for a given spacegroup. * @param nzone index of centric zone * @param h reflection index * @param k reflection index * @param l reflection index * @return 0 if in zone "nzone", non-zero otherwise */ int ccp4spg_check_centric_zone(const int nzone, const int h, const int k, const int l); /** Return phase of a centric reflection in the range 0.0 <= phase < 180.0. * You should first check that reflection really is centric. * @param sp pointer to spacegroup * @param h reflection index * @param k reflection index * @param l reflection index * @return phase of a centric reflection */ float ccp4spg_centric_phase(const CCP4SPG* sp, const int h, const int k, const int l); /** Print a summary of the centric zones of a spacegroup. * @param sp pointer to spacegroup * @return void */ void ccp4spg_print_centric_zones(const CCP4SPG* sp); /** Obtain string description of centric zone. * @param nzone index of centric zone * @param centric_zone string description of centric zone * @return string description of centric zone */ char *ccp4spg_describe_centric_zone(const int nzone, char *centric_zone); /** Set up epsilon zones for a given spacegroup. This is called * upon loading a spacegroup. * @param sp pointer to spacegroup * @return void */ void ccp4spg_set_epsilon_zones(CCP4SPG* sp); /** Return reflection multiplicity factor for a given hkl in a given * spacegroup. * @param sp pointer to spacegroup * @param h reflection index * @param k reflection index * @param l reflection index * @return reflection multiplicity factor */ int ccp4spg_get_multiplicity(const CCP4SPG* sp, const int h, const int k, const int l); /** Check indices against an epsilon zone for a given spacegroup. * @param nzone index of epsilon zone (runs from 1 to 13) * @param h reflection index * @param k reflection index * @param l reflection index * @return 0 if in zone "nzone", non-zero otherwise */ int ccp4spg_check_epsilon_zone(const int nzone, const int h, const int k, const int l); /** Print a summary of the epsilon zones of a spacegroup. * @param sp pointer to spacegroup * @return void */ void ccp4spg_print_epsilon_zones(const CCP4SPG* sp); /** Obtain string description of epsilon zone. * @param nzone index of epsilon zone * @param epsilon_zone string description of epsilon zone * @return string description of epsilon zone */ char *ccp4spg_describe_epsilon_zone(const int nzone, char *epsilon_zone); /** Check if reflection is a systematic absence. * @param sp pointer to spacegroup * @param h reflection index * @param k reflection index * @param l reflection index * @return 1 if reflection is a systematic absence, 0 otherwise. */ int ccp4spg_is_sysabs(const CCP4SPG* sp, const int h, const int k, const int l); /** Translated from Alexei Vagin's CALC_ORIG_PS. * @param namspg Spacegroup name for printing only. * @param nsym Input number of symmetry operators. * @param rsym Input symmetry operators. * @param origins Array containing alternative origins on output. * @param polarx Return whether polar along x axis. * @param polary Return whether polar along y axis. * @param polarz Return whether polar along z axis. * @param iprint If true, print out list of alternative origins. * @return Number of alternate origins for spacegroup. */ int ccp4spg_generate_origins(const char *namspg, const int nsym, const float rsym[][4][4], float origins[][3], int *polarx, int *polary, int *polarz, const int iprint); /** Print details on reciprocal spacegroup. * @param sp pointer to spacegroup * @return void */ void ccp4spg_print_recip_spgrp(const CCP4SPG* sp); /** Print reciprocal symops. * @param sp pointer to spacegroup * @return void */ void ccp4spg_print_recip_ops(const CCP4SPG* sp); /** Convert string of type 0<=y<=1/4 to 0.0-delta, 0.25+delta, where * delta is set to 0.00001 Makes many assumptions about string. * @param range input string. * @param limits output range limits. * @return 0 on success */ int range_to_limits(const char *range, float limits[2]); /** Sets an FFT grid for a spacegroup. * @param sp pointer to spacegroup * @param nxmin minimum sampling on x * @param nymin minimum sampling on y * @param nzmin minimum sampling on z * @param sample default fineness of sample * @param nx returns sampling intervals along x * @param ny returns sampling intervals along y * @param nz returns sampling intervals along z * @return void */ void set_fft_grid(CCP4SPG* sp, const int nxmin, const int nymin, const int nzmin, const float sample, int *nx, int *ny, int *nz); /** Checks whether all factors of a number n are less than or * equal to 19. * @param n Number to be tested. * @return 1 on success, O on failure. */ int all_factors_le_19(const int n); /** Sets a grid sample greater than minsmp, which has no prime * factors greater than 19, and contains the factor nmul. * @param minsmp * @param nmul * @param sample * @return Grid sample or -1 on failure. */ int get_grid_sample(const int minsmp, const int nmul, const float sample); /** Check for consistency between cell dimensions and spacegroup. Latter * is identified from symmetry operators. * @param nsym No. of symmetry operators. * @param rsym Symmetry operators. * @param cell Cell dimensions. * @return 1 if they are consistent, 0 if there is a problem. */ int ccp4spg_check_symm_cell(int nsym, float rsym[][4][4], float cell[6]); #ifdef __cplusplus } } #endif #endif libccp4-8.0.0/ccp4/cvecmat.c0000644000000000000000000000677014242731033013615 0ustar 00000000000000/* cvecmat.c: C library for vector and matrix manipulations Copyright (C) 2001 CCLRC, Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file cvecmat.c * C library for vector and matrix manipulations. * Martyn Winn */ #include #include "cvecmat.h" /* rcsid[] = "$Id$" */ /* c = a X b */ void ccp4_dcross(const double a[3], const double b[3], double c[3]) { c[0] = a[1]*b[2] - b[1]*a[2]; c[1] = a[2]*b[0] - b[2]*a[0]; c[2] = a[0]*b[1] - b[0]*a[1]; } void ccp4_3matmul(double c[3][3], const double a[3][3], const double b[3][3]) { int i,j,k; for ( i = 0; i < 3; i++ ) for ( j = 0; j < 3; j++ ) { c[i][j] = 0.0; for ( k = 0; k < 3; k++ ) c[i][j] += a[i][k]*b[k][j]; } } void ccp4_4matmul( float c[4][4], const float a[4][4], const float b[4][4]) { int i,j,k; for ( i = 0; i < 4; i++ ) for ( j = 0; j < 4; j++ ) { c[i][j] = 0.0; for ( k = 0; k < 4; k++ ) c[i][j] += a[i][k]*b[k][j]; } } /* A (I) 3*3 matrix to be inverted */ /* AI (O) inverse matrix */ /* returns determinant */ double invert3matrix(const double a[3][3], double ai[3][3]) { int i,j; double c[3][3],d; ccp4_dcross(a[1],a[2],c[0]); ccp4_dcross(a[2],a[0],c[1]); ccp4_dcross(a[0],a[1],c[2]); d = a[0][0]*c[0][0] + a[0][1]*c[0][1] + a[0][2]*c[0][2]; if (fabs(d) > 1.0e-30) { for ( i = 0; i < 3; i++ ) for ( j = 0; j < 3; j++ ) ai[i][j] = c[j][i] / d; } else { return 0.0; } return d; } /* A (I) 4*4 matrix to be inverted */ /* AI (O) inverse matrix */ /* returns determinant */ float invert4matrix(const float a[4][4], float ai[4][4]) { double c[4][4], d; int i, j; double x[3][3]; int i1, j1, i2 ; double am, q; int ii, jj; /* Function Body */ for (ii = 0; ii < 4; ++ii) { for (jj = 0; jj < 4; ++jj) { ai[ii][jj] = 0.0; i = -1; for (i1 = 0; i1 < 4; ++i1) { if (i1 != ii) { ++i; j = -1; for (j1 = 0; j1 < 4; ++j1) { if (j1 != jj) { ++j; x[i][j] = a[i1][j1]; } } } } am = x[0][0]*x[1][1]*x[2][2] - x[0][0]*x[1][2]*x[2][1] + x[0][1]*x[1][2]*x[2][0] - x[0][1]*x[1][0]*x[2][2] + x[0][2]*x[1][0]*x[2][1] - x[0][2]*x[1][1]*x[2][0]; i2 = ii + jj; c[ii][jj] = ccp4_pow_ii(-1.0, i2) * am; } } /* ---- Calculate determinant */ d = 0.0; for (i = 0; i < 4; ++i) { d = a[i][0] * c[i][0] + d; } /* ---- Get inverse matrix */ if (fabs(d) > 1.0e-30) { q = 1.0/d; for (i = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) { ai[i][j] = (float) (c[j][i] * q); } } } else { return 0.0; } return ((float) d); } float ccp4_pow_ii(const float base, const int power) { int i = 0; float pow = 1; while (++i <= power) pow *= base; return pow; } libccp4-8.0.0/ccp4/cvecmat.h0000644000000000000000000000255014242731033013612 0ustar 00000000000000/* cvecmat.h: header file for cvecmat.c Copyright (C) 2001 CCLRC, Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #ifndef __CCP4_VECMAT #define __CCP4_VECMAT #ifdef __cplusplus extern "C" { #endif /* rcsidhv[] = "$Id$" */ void ccp4_dcross(const double a[3], const double b[3], double c[3]); void ccp4_3matmul(double c[3][3], const double a[3][3], const double b[3][3]); void ccp4_4matmul( float c[4][4], const float a[4][4], const float b[4][4]); double invert3matrix(const double a[3][3], double ai[3][3]); float invert4matrix(const float a[4][4], float ai[4][4]); float ccp4_pow_ii(const float base, const int power); #ifdef __cplusplus } #endif #endif /*!CCP4_VECMAT */ libccp4-8.0.0/ccp4/library_err.c0000644000000000000000000003213314242731033014477 0ustar 00000000000000/* library_err.c: Error handling library Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file library_err.c * Error handling library. * Charles Ballard */ #include #include #include #include "ccp4_errno.h" /* rcsid[] = "$Id$" */ /** @global ccp4_errno: global to store data */ int ccp4_errno = 0; /* error_levels: error level descriptions */ static const char * const error_levels[] = { "Success", /* 0 */ "Informational", /* 1 */ "Warning", /* 2 */ "Error", /* 3 */ "FATAL ERROR" /* 4 */ }; /* file io errors */ static const char *const cfile_errlist[] = { "Error 0", /* 0 = CIO_Ok */ "Bad mode", /* 1 = CIO_BadMode */ "Cannot open file", /* 2 = CIO_CantOpenFile */ "Too many open files", /* 3 = CIO_MaxFile */ "Read failed", /* 4 = CIO_ReadFail */ "Write failed", /* 5 = CIO_WriteFail */ "Close fail", /* 6 = CIO_CloseFail */ "Seek fail", /* 7 = CIO_SeekFail */ "Null pointer passed", /* 8 = CIO_NullPtr */ "End of File", /* 9 = CIO_EOF */ "No file" /* 10 = CIO_NoFile */ "File not open", /* 11 = CIO_NotOpen */ "Unlink failed" /* 12 = CIO_UnlinkFail */ }; /* map library errors */ static const char *const cmap_errlist[] = { "Error 0", /* 0 = CMERR_Ok */ "Unassigned unit", /* 1 = CMERR_NoChannel */ "Unassigned unit or disposed file", /* 2 = CMERR_NoFile */ "Logical name does not exist", /* 3 = CMERR_NoLogicalName */ "Cannot open file", /* 4 = CMERR_CantOpenFile */ "No associated header", /* 5 = CMERR_NoHeader */ "Read failed", /* 6 = CMERR_ReadFail */ "Write failed", /* 7 = CMERR_WriteFail */ "Parameter or dimension is incorrect ", /* 8 = CMERR_ParamError */ "Unrecognised keyword", /* 9 = CMERR_UnrecognK */ "File stamp error", /* 10 = CMERR_FileStamp */ "Symmetry", /* 11 = CMERR_SymErr */ "Cannot allocate memory", /* 12 = CMERR_AllocFail */ "Too many open files", /* 13 = CMERR_MaxFile */ }; /* mtz library errrors */ static const char *const cmtz_errlist[] = { "Error 0", /* 0 = CMTZERR_Ok */ "Unassigned unit", /* 1 = CMTZERR_NoChannel */ "Null file handle, file not opened", /* 2 = CMTZERR_NoFile */ "Logical name does not exist", /* 3 = CMTZERR_NoLogicalName */ "Cannot open file", /* 4 = CMTZERR_CantOpenFile */ "No associated header", /* 5 = CMTZERR_NoHeader */ "Read failed", /* 6 = CMTZERR_ReadFail */ "Write failed", /* 7 = CMTZERR_WriteFail */ "Function parameter is incorrect", /* 8 = CMTZERR_ParamError */ "Invalid cell dimensions", /* 9 = CMTZERR_Cellerr */ "File stamp error", /* 10 = CMTZERR_FileStamp */ "Symmetry", /* 11 = CMTZERR_SymErr */ "Cannot allocate memory", /* 12 = CMTZERR_AllocFail */ "Too many open files", /* 13 = CMTZERR_MaxFile */ "Failed to initialise parser", /* 14 = CMTZERR_ParserFail */ "File not identified as MTZ", /* 15 = CMTZERR_NotMTZ */ "Missing or incomplete dataset information in input file.", /* 16 = CMTZERR_DatasetIncomplete */ "No architecture information in file.", /* 17 = CMTZERR_NoArch */ "Attempt to access unallocated dataset", /* 18 = CMTZERR_NullDataset */ "Input MTZ file has incorrect major version for current library", /* 19 = CMTZERR_BadVersion */ "MTZ header is corrupted: missing tokens in SYMINF record", /* 20 = CMTZERR_SYMINFIncomplete */ "MTZ header is corrupted: missing tokens in COLUMN record", /* 21 = CMTZERR_COLUMNIncomplete */ "Batch headers corrupted", /* 22 = CMTZERR_BadBatchHeader */ "Input MTZ file has different minor version to that supported by current library", /* 23 = CMTZERR_DifferentVersion */ "File column type different from type expected by program", /* 24 = CMTZERR_ColTypeMismatch */ "MTZ header: error in column group specification", /* 25 = CMTZERR_ColGroupError */ "MTZ header: error in column source specification", /* 26 = CMTZERR_ColSourceError */ }; /* parser library errors */ static const char *const cpars_errlist[] = { "Error 0", /* 0 = CPARSERR_Ok */ "Maximum number of tokens exceeded", /* 1 = CPARSERR_MaxTokExceeded */ "Cannot allocate memory", /* 2 = CPARSERR_AllocFail */ "Null pointer", /* 3 = CPARSERR_NullPointer */ "Line is longer than allocated length, so truncated", /* 4 = CPARSERR_LongLine */ "Failed to open external command file", /* 5 = CPARSERR_CantOpenFile */ "Failed to get name for external file", /* 6 = CPARSERR_NoName */ "Overflow - exponent is too big to be evaluated", /* 7 = CPARSERR_ExpOverflow */ "Underflow - exponent is too small to be evaluated", /* 8 = CPARSERR_ExpUnderflow */ "Problem in mat4_to_symop", /* 9 = CPARSERR_MatToSymop */ "Failed to interpret symop string", /* 10 = CPARSERR_SymopToMat */ }; /* symmetry library errors */ static const char *const csym_errlist[] = { "Error 0", /* 0 = CSYMERR_Ok */ "Failed to initialise parser", /* 1 = CSYMERR_ParserFail */ "Cannot find SYMINFO file - no symmetry information", /* 2 = CSYMERR_NoSyminfoFile */ "Pointer to spacegroup structure is NULL", /* 3 = CSYMERR_NullSpacegroup */ "ASU definition not found for this spacegroup", /* 4 = CSYMERR_NoAsuDefined */ "Undefined Laue code for this spacegroup", /* 5 = CSYMERR_NoLaueCodeDefined */ "Not enough tokens on SYMINFO line", /* 6 = CSYMERR_SyminfoTokensMissing */ }; static const char *const cgen_errlist[] = { "Error 0", /* 0 = CGENERR_Ok */ "Cannot allocate memory", /* 1 = CGENERR_AllocFail */ "Cannot set environment variable", /* 2 = CGENERR_CantSetEnvironment */ "Maximum number of logical names exceeded", /* 3 = CGENERR_MaxNamesExceeded */ "Use: -e filename", /* 4 = CGENERR_EOptionUseError */ "Use: -d filename", /* 5 = CGENERR_DOptionUseError */ "Use: ", /* 6 = CGENERR_LogicalNameUseError */ "Cannot open environ.def", /* 7 = CGENERR_CantOpenEnvFile */ "Cannot open default.def", /* 8 = CGENERR_CantOpenDefFile */ "Cannot parse environ.def file", /* 9 = CGENERR_ParseEnvFail */ "Cannot parse default.def file", /* 10= CGENERR_ParseDefFail */ "Cannot find input file", /* 11= CGENERR_CantFindInFile */ "Failed to set path for environ.def file", /* 12= CGENERR_EnvPathFail */ "Failed to set path for default.def file", /* 13= CGENERR_DefPathFail */ "Cannot get CLIBD from environment", /* 14= CGENERR_CantGetClibd */ "Cannot get CCP4_SCR from environment", /* 15= CGENERR_CantGetCcp4Scr */ }; struct error_system { char system[32]; int system_nerr; const char * const *error_list; }; /* construct error list */ static const struct error_system ccp4_errlist[] = { {"system", 0, 0, }, {"library_file", CCP4_COUNT(cfile_errlist), cfile_errlist,}, {"mmdb", 0, 0,}, {"mtz", CCP4_COUNT(cmtz_errlist), cmtz_errlist,}, {"ccp4_map", CCP4_COUNT(cmap_errlist), cmap_errlist,}, {"utils", 0, 0}, {"ccp4_parser", CCP4_COUNT(cpars_errlist), cpars_errlist,}, {"csym", CCP4_COUNT(csym_errlist), csym_errlist,}, {"ccp4_general", CCP4_COUNT(cgen_errlist), cgen_errlist,} }; static const int ccp4_system_nerr = CCP4_COUNT(ccp4_errlist); /* Obtain character string based upon error code. Typical use ccp4_strerror(ccp4_errno) The returned string is statically allocated in the library_err.c file and should not be freed. param error code (int) returns const pointer to error message. */ const char *ccp4_strerror(int error) { int system = CCP4_ERRGETSYS(error); /* int level = CCP4_ERRGETLEVEL(error); */ int code = CCP4_ERRGETCODE(error); if (error == -1 || system == 0) return strerror(errno); if (system >= ccp4_system_nerr) return ("bad system error"); if (code >= ccp4_errlist[system].system_nerr) return ("bad error code"); return (ccp4_errlist[system].error_list[code]); } /* Print out passed message and internal message based upon ccp4_errno "message : error message " param message (const char *) return void */ void ccp4_error (const char *msg) { const char *colon; if (msg == 0 || *msg == '\0') colon = ""; else colon = ": "; fprintf (stderr, "%s%s%s\n", msg, colon, ccp4_strerror(ccp4_errno)); if(ccp4_errno != -1 && CCP4_ERRGETSYS(ccp4_errno)) { fprintf (stderr, "System: %s\nLevel: %d\n", ccp4_errlist[CCP4_ERRGETSYS(ccp4_errno)].system, CCP4_ERRGETLEVEL(ccp4_errno)); if (errno) fprintf (stderr, "%s%s\n", "Last system message: ",strerror(errno)); } } /* Wrapper for ccp4_error which also calls exit(1) param message (const char *) */ void ccp4_fatal (const char *message) { ccp4_error(message); exit(1); } int CFile_Perror(const char *msg) { const char * colon; int error = CCP4_ERRGETCODE(ccp4_errno); int cfile_nerr = ccp4_errlist[4].system_nerr; if (msg == NULL || msg == '\0') colon = ""; else colon = ": "; if (error > 0 && error <= cfile_nerr) { fprintf(stderr,"%s%s%s \n", msg,colon,cfile_errlist[error]); return error; } fprintf(stderr,"Unknown error code"); return -1; } int ccp4_liberr_verbosity(int iverb) { static int verbosity_level=1; if (iverb >= 0) verbosity_level = iverb; return verbosity_level; } /* Routine to set ccp4_errno and print out message for error tracing. This should be the only way in which ccp4_errno is set. See error codes above for levels and systems. A callback with prototype void function(void) may also be passed to the routine. Note: FATAL calls exit(1). param error code (int) param message (const char * const) param callback (point to routine) */ void ccp4_signal(const int code, const char * const msg, void (*callback) ()) { int severity = CCP4_ERRGETLEVEL(code), system = CCP4_ERRGETSYS(code), msg_no = CCP4_ERRGETCODE(code), fatal_err = (severity == 4); static const char msg_fmt[] = ">>>>>> CCP4 library signal %s:%s (%s)\n\t raised in %s <<<<<<\n"; static const char sys_fmt[] = ">>>>>> System signal %d:%s (%s)\n\t raised in %s <<<<<<\n"; ccp4_errno = code; /* use this function to control whether error messages are printed */ if (!ccp4_liberr_verbosity(-1)) return; if (system == 0) { if (msg) printf(sys_fmt, errno, strerror(errno), error_levels[severity], msg); else printf(">>>>>> System signal %d:%s (%s) <<<<<<", errno, strerror(errno), error_levels[severity]); ccp4_errno = errno; } else if (msg) printf(msg_fmt, ccp4_errlist[system].system, ccp4_errlist[system].error_list[msg_no], error_levels[severity], msg); else printf(">>>>>> CCP4 library signal %s:%s (%s) <<<<<<\n", ccp4_errlist[system].system, ccp4_errlist[system].error_list[msg_no], error_levels[severity]); if (callback) (*callback)(); if (fatal_err) exit(1); } libccp4-8.0.0/ccp4/library_file.c0000644000000000000000000020107314242731033014627 0ustar 00000000000000/* library_file.c: functions for file i/o Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file library_file.c * Functions for file i/o. * Charles Ballard */ #include #include #include #if defined _MSC_VER #include #endif #include "library_file.h" #include "ccp4_errno.h" #include "ccp4_file_err.h" /* rcsid[] = "$Id: library_file.c,v 1.26 2012/08/20 12:21:16 gxg60988 Exp $" */ static uint16 nativeIT = NATIVEIT; /* machine integer type */ static uint16 nativeFT = NATIVEFT; /* machine float type */ static int _item_sizes[] = { (int) sizeof (char), /* 0: bytes */ (int) sizeof (short int), /* 1: (integer) half words */ (int) sizeof (float), /* 2: reals/words */ (int) sizeof (int), /* 3: `short complex' (pairs of half words). NB int rather than 2*short since must fit into fortran integer */ (int) 2*sizeof (float), /* 4: complex (pairs of words) */ (int) 2*sizeof (int), /* 5: double integers */ (int) sizeof (int) /* 6: integers */ }; static int (*_read_mode[])(CCP4File *, uint8 *, size_t) = { ccp4_file_readchar, ccp4_file_readshort, ccp4_file_readfloat, ccp4_file_readshortcomp, ccp4_file_readcomp, ccp4_file_readint64, ccp4_file_readint }; static int (*_write_mode[])(CCP4File *, const uint8 *, size_t) = { ccp4_file_writechar, ccp4_file_writeshort, ccp4_file_writefloat, ccp4_file_writeshortcomp, ccp4_file_writecomp, ccp4_file_writeint64, ccp4_file_writeint }; /** * vaxF2ieeeF: * @param buffer (float_uint_uchar *) vax order float array * @param size (unsigned int) number of items * * Translation from Vax floating point format to ieee. * */ static void vaxF2ieeeF(union float_uint_uchar *buffer, const unsigned int size) { union float_uint_uchar out; unsigned char exp; unsigned int i; if ( buffer == NULL || size == 0) return; for (i = 0; i < size; i++) { exp = (buffer[i].c[1] << 1) | (buffer[i].c[0] >> 7); /* extract exponent */ if (!exp && !buffer[i].c[1]) /* zero value */ out.c[0] = out.c[1] = out.c[2] = out.c[3] = 0; else if (exp > 2) { /* normal value */ out.c[0] = buffer[i].c[1] - (uint8)1; /* subtracts 2 from exponent */ /* copy mantissa, LSB of exponent */ out.c[1] = buffer[i].c[0]; out.c[2] = buffer[i].c[3]; out.c[3] = buffer[i].c[2]; } else if (exp) { /* denormalized number */ int shft; out.c[0] = buffer[i].c[1] & 0x80; /* keep sign, zero exponent */ shft = 3 - exp; /* shift original mant by 1 or 2 to get denormalized mant */ /* prefix mantissa with '1'b or '01'b as appropriate */ out.c[1] = (uint8)((buffer[i].c[0] & 0x7f) >> shft) | (uint8)(0x10 << exp); out.c[2] = (uint8)(buffer[i].c[0] << (8-shft)) | (uint8)(buffer[i].c[3] >> shft); out.c[3] = (uint8)(buffer[i].c[3] << (8-shft)) | (uint8)(buffer[i].c[2] >> shft); } else { /* sign=1 -> infinity or NaN */ out.c[0] = 0xff; /* set exp to 255 */ /* copy mantissa */ out.c[1] = buffer[i].c[0] | (uint8)0x80; /* LSB of exp = 1 */ out.c[2] = buffer[i].c[3]; out.c[3] = buffer[i].c[2]; } buffer[i] = out; /* copy back result */ } } /** * ieeeF2vaxF: * @param buffer (float_uint_uchar *) big endian order float array * @param size (unsigned int) number of items * * Translation from ieee floating point format to vax. * */ static void ieeeF2vaxF(union float_uint_uchar *buffer, const unsigned int size) { union float_uint_uchar out; unsigned char exp; unsigned int i; if ( buffer == NULL || size == 0) return; for (i=0; i>7); /* extract exponent */ if (exp) { /* non-zero exponent */ /* copy mantissa, last bit of exponent */ out.c[0] = buffer[i].c[1]; out.c[2] = buffer[i].c[3]; out.c[3] = buffer[i].c[2]; if (exp < 254) /* normal value */ out.c[1] = buffer[i].c[0] + (uint8)1; /* actually adds two to exp */ else { /* infinity or NaN */ if (exp == 254) /* unrepresentable - OFL */ /* set mant=0 for overflow */ out.c[0] = out.c[1] = out.c[2] = out.c[3] = 0; out.c[0] &= 0x7f; /* set last bit of exp to 0 */ out.c[1] = 0x80; /* sign=1 exp=0 -> OFL or NaN. this will raise a reserved operand exception if used. */ } } else if (buffer[i].c[1] & 0x60) { /* denormalized value */ int shft; shft = (buffer[i].c[1] & 0x40) ? 1 : 2; /* shift needed to normalize */ /* shift mantissa */ /* note last bit of exp set to 1 implicitly */ out.c[0] = (uint8)(buffer[i].c[1] << shft) | (uint8)(buffer[i].c[2] >> (8-shft)); out.c[3] = (uint8)(buffer[i].c[2] << shft) | (uint8)(buffer[i].c[3] >> (8-shft)); out.c[2] = (uint8)(buffer[i].c[3] << shft); out.c[1] = (uint8)(buffer[i].c[0] & 0x80); /* sign */ if (shft==1) { /* set exp to 2 */ out.c[1] |= 0x01; out.c[0] &= 0x7f; /* set LSB of exp to 0 */ } } else /* zero */ out.c[0] = out.c[1] = out.c[2] = out.c[3] = 0; buffer[i] = out; /* copy back the result */ } } /** * convexF2ieeeF: * @param buffer (float_uint_uchar *) float array with convex byte ordering * @param size (unsigned int) number of items * * Translation from convex floating point format to ieee. * */ static void convexF2ieeeF(union float_uint_uchar *buffer, const unsigned int size) { union float_uint_uchar out; unsigned char exp; unsigned int i; if ( buffer == NULL || size == 0) return; for (i = 0; i < size; i++) { exp = (buffer[i].c[0]<<1) | (buffer[i].c[1]>>7); /* extract exponent */ if (!exp && !buffer[i].c[0]) /* zero value */ out.c[0] = out.c[1] = out.c[2] = out.c[3] = 0; else if (exp > 2) { /* normal value */ out.c[0] = buffer[i].c[0] - (uint8)1; /* subtracts 2 from exponent */ /* copy mantissa, LSB of exponent */ out.c[1] = buffer[i].c[1]; out.c[2] = buffer[i].c[2]; out.c[3] = buffer[i].c[3]; } else if (exp) { /* denormalized number */ int shft; out.c[0] = buffer[i].c[0] & 0x80; /* keep sign, zero exponent */ shft = 3 - exp; /* shift original mant by 1 or 2 to get denormalized mant */ /* prefix mantissa with '1'b or '01'b as appropriate */ out.c[1] = (uint8)((buffer[i].c[1] & 0x7f) >> shft) | (uint8)(0x10 << exp); out.c[2] = (uint8)(buffer[i].c[1] << (8-shft)) | (uint8)(buffer[i].c[2] >> shft); out.c[3] = (uint8)(buffer[i].c[2] << (8-shft)) | (uint8)(buffer[i].c[3] >> shft); } else { /* sign=1 -> infinity or NaN */ out.c[0] = 0xff; /* set exp to 255 */ /* copy mantissa */ out.c[1] = buffer[i].c[1] | (uint8)0x80; /* LSB of exp = 1 */ out.c[2] = buffer[i].c[2]; out.c[3] = buffer[i].c[3]; } buffer[i] = out; /* copy back result */ } } /** * ieeeF2convexF: * @param buffer (float_uint_uchar *) float array with big endian byte ordering * @param size (const unsigned int) numnber of items * * Translation from ieee floating point format to convex. * */ static void ieeeF2convexF(union float_uint_uchar *buffer, const unsigned int size) { union float_uint_uchar out; unsigned char exp; unsigned int i; if ( buffer == NULL || size == 0) return; for (i=0; i < size; i++) { exp = (uint8)(buffer[i].c[0] << 1) | (uint8)(buffer[i].c[1] >> 7); /* extract exponent */ if (exp) { /* non-zero exponent */ /* copy mantissa, last bit of exponent */ out.c[1] = buffer[i].c[1]; out.c[3] = buffer[i].c[3]; out.c[2] = buffer[i].c[2]; if (exp < 254) /* normal value */ out.c[0] = buffer[i].c[0] + (uint8)1; /* actually adds two to exp */ else { /* infinity or NaN */ if (exp == 254) /* unrepresentable - OFL */ /* set mant=0 for overflow */ out.c[0] = out.c[1] = out.c[2] = out.c[3] = 0; out.c[1] &= 0x7f; /* set last bit of exp to 0 */ out.c[0] = 0x80; /* sign=1 exp=0 -> OFL or NaN. this will raise a reserved operand exception if used. */ } } else if (buffer[i].c[1] & 0x60) { /* denormalized value */ int shft; shft = (buffer[i].c[1] & 0x40) ? 1 : 2; /* shift needed to normalize */ /* shift mantissa */ /* note last bit of exp set to 1 implicitly */ out.c[1] = (uint8)(buffer[i].c[1] << shft) | (uint8)(buffer[i].c[2] >> (8-shft)); out.c[2] = (uint8)(buffer[i].c[2] << shft) | (uint8)(buffer[i].c[3] >> (8-shft)); out.c[3] = (uint8)(buffer[i].c[3] << shft); out.c[0] = (uint8)(buffer[i].c[0] & 0x80); /* sign */ if (shft==1) { /* set exp to 2 */ out.c[0] |= 0x01; out.c[1] &= 0x7f; /* set LSB of exp to 0 */ } } else /* zero */ out.c[0] = out.c[1] = out.c[2] = out.c[3] = 0; buffer[i] = out; /* copy back the result */ } } /** * ccp4_file_raw_read: * @param cfile * (CCP4File *) * @param buffer * (char *) input array * @param n_items (size_t) number of items * * reads block of n_items bytes from cfile to buffer via * FILE struct cfile->stream(fread) or file desc cfile->fd * read/_read). Increments location value cfile->loc. The * cfile->iostat flag is set on failure. * @return number of bytes read. */ int ccp4_file_raw_read(CCP4File *cfile, char *buffer, size_t n_items) { int result; if (cfile->buffered && cfile->stream) { result = fread (buffer, (size_t) sizeof(char), n_items, cfile->stream); if (result != n_items && feof(cfile->stream)) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_EOF), "ccp4_file_raw_read", NULL); cfile->iostat = CIO_EOF; result = EOF; } else if (result != n_items && ferror(cfile->stream)) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_raw_read", NULL); cfile->iostat = CIO_ReadFail; result = 0; } } else { #if defined _MSC_VER result = _read (cfile->fd, buffer, n_items); #else result = read (cfile->fd, buffer, n_items); #endif if (n_items && result <= 0) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_ReadFail), "ccp4_file_raw_read", NULL); cfile->iostat = CIO_ReadFail; result = 0; } } cfile->last_op = READ_OP; cfile->loc += result; cfile->getbuff = 0; return result; } /** * ccp4_file_raw_write: * @param cfile (CCP4File *) * @param buffer (char *) output array * @param n_items (size_t) number of items * * writes block of @n_items bytes from @buffer to @cfile via FILE struct * @cfile->stream(fwrite) or file desc @cfile->fd(write/_write). Increments * @cfile->loc on success, or resets on failure, which is then used to * determine the file length. On failure @cfile->iostat is set. * @return number of bytes written. */ int ccp4_file_raw_write(CCP4File *cfile, const char *buffer, size_t n_items) { int result; if (cfile->buffered && cfile->stream) result = fwrite (buffer, (size_t) sizeof(char), n_items, cfile->stream); else #if defined _MSC_VER result = _write (cfile->fd, buffer, n_items); #else result = write (cfile->fd, buffer, n_items); #endif cfile->last_op = WRITE_OP; if (result == n_items) cfile->loc += n_items; else { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_WriteFail), "ccp4_file_raw_write", NULL); cfile->iostat = CIO_WriteFail; ccp4_file_tell(cfile); } cfile->length = MAX(cfile->loc,cfile->length); cfile->getbuff = 0; return result; } /** * ccp4_file_raw_seek: * @param cfile (CCP4File *) * @param offset (long) offset in bytes * @param whence (int) SEEK_SET, SEEK_CUR, or SEEK_END * * if the file is "seekable" (not stdin) the function * seeks on @cfile by offset bytes using fseek/ftell (@cfile->stream) * or lseek (@cfile->fd). %SEEK_SET is relative * to start of file, %SEEK_CUR to current, %SEEK_END to * end. * @return offset in bytes on success, -1 on failure. */ int ccp4_file_raw_seek(CCP4File *cfile, long offset, int whence) { int result = -1; if (!cfile->direct) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_raw_seek", NULL); return result; } if (cfile->buffered) { #if defined (__alpha) && defined (vms) (void) fflush (cfile->stream); #endif if (!(result = (fseek (cfile->stream,offset,whence)))) result = ftell(cfile->stream); } else { #if defined _MSC_VER result = _lseek(cfile->fd,offset,whence); #else result = lseek(cfile->fd, offset, whence); #endif } cfile->last_op = IRRELEVANT_OP; if (result == -1) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_SeekFail), "ccp4_file_raw_seek", NULL); cfile->iostat = CIO_SeekFail; } else cfile->loc = result; cfile->getbuff = 0; return (result); } /** * _file_free: * @param cfile (CCP4File *) * * free up @cfile */ static void _file_free(CCP4File *cfile) { if(cfile->name) free(cfile->name); cfile->name = NULL; free(cfile); } /** * _file_init: * @param cfile () * * initialise cfile struct * @return cfile struct */ static CCP4File *_file_init() { CCP4File *cfile = (CCP4File *) malloc(sizeof(CCP4File)); char *foreign = getenv ("CONVERT_FROM"); char *native = getenv ("NATIVEMTZ"); memset(cfile,'\0',sizeof(CCP4File)); cfile->fd = -1; cfile->buffered = 1; cfile->binary = 1; cfile->last_op = IRRELEVANT_OP; cfile->mode = DEFMODE; cfile->itemsize = _item_sizes[DEFMODE]; if (native == NULL && foreign != NULL) { if (strcmp (foreign, "BEIEEE") == 0) { cfile->fconvert = DFNTF_BEIEEE ; cfile->iconvert = DFNTI_MBO ; } else if (strcmp (foreign, "LEIEEE") == 0) { cfile->fconvert = DFNTF_LEIEEE; cfile->iconvert = DFNTI_IBO ; } else if (strcmp (foreign, "VAX") == 0) { cfile->fconvert = DFNTF_VAX ; cfile->iconvert = DFNTI_IBO ; } else if (strcmp (foreign, "CONVEXNATIVE") == 0) { cfile->fconvert = DFNTF_CONVEXNATIVE ; cfile->iconvert = DFNTI_MBO ; } } else { cfile->fconvert = nativeFT; cfile->iconvert = nativeIT; } cfile->_read=_read_mode[DEFMODE]; cfile->_write=_write_mode[DEFMODE]; return (cfile); } /** * _file_open_mode: * @param cfile (CCP4File *) * @param flag (const int) mode flag * * set file open mode elements of @cfile (see ccp4_sysdep.h) * O_TMP = 0x0010 * O_RDONLY = 0x0000 * O_WRONLY = 0x0001 * O_RDWR = 0x0002 * O_APPEND = 0x0008 */ static void _file_open_mode(CCP4File * cfile, const int flag) { if (flag & O_TMP) cfile->scratch = 1; if (flag & (O_WRONLY | O_RDWR | O_APPEND) ) { cfile->write = 1; if (flag & O_RDWR) cfile->read = 1; if (flag & O_APPEND) cfile->append = 1; } else cfile->read = 1; } /** * _file_close: * @param cfile (CCP4File *) * * close @cfile if it is "owned" (@cfile->own) using fclose or close. * Reset @cfile to some safe value. Note: flush anyway. * @return 0 on success, -1 on failure. */ static int _file_close (CCP4File *cfile) { int result = 0; if(cfile->buffered && cfile->stream) { if (cfile->own) result = fclose (cfile->stream); else result = fflush(cfile->stream); } else { if (cfile->own) #if defined _MSC_VER result = _close(cfile->fd); #else result = close (cfile->fd); #endif } if (result == EOF) cfile->iostat = CIO_CloseFail; else cfile->stream = NULL; return (result); } /** * ccp4_file_is_write: * @param cfile (CCP4File *) * * is the @cfile writeable * @return 1 if true */ int ccp4_file_is_write(const CCP4File *cfile) { return (cfile->write); } /** * ccp4_file_is_read: * @param cfile (CCP4File *) * * is the @cfile readable * @return 1 if true. */ int ccp4_file_is_read(const CCP4File *cfile) { return (cfile->read); } /** * ccp4_file_is_append: * @param cfile (CCP4File *) * * is the @cfile in append mode * @return 1 if true. */ int ccp4_file_is_append(const CCP4File *cfile) { return (cfile->append); } /** * ccp4_file_is_scratch: * @param cfile (CCP4File *) * * is scratch file * @return 1 if true. */ int ccp4_file_is_scratch(const CCP4File *cfile) { return (cfile->scratch); } /** * ccp4_file_is_buffered: * @param cfile (CCP4File *) * * is the file buffered * @return 1 if true */ int ccp4_file_is_buffered(const CCP4File *cfile) { return (cfile->buffered); } /** * ccp4_file_status: * @param cfile (CCP4File *) * * @return @cfile error status */ int ccp4_file_status(const CCP4File *cfile) { return (cfile->iostat); } int ccp4_file_raw_setstamp(CCP4File *cfile, const size_t offset) { cfile->stamp_loc = offset; return 0; } /** * ccp4_file_setstamp: * @param cfile (CCP4File *) * @param stamp_loc (size_t) offset in items * * set the machine stamp offset in CCP4 items determined * by the mode of @cfile. See ccp4_file_setmode(). * @return 0 on success, %EOF on failure */ int ccp4_file_setstamp(CCP4File *cfile, const size_t offset) { if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3)| CCP4_ERRNO(CIO_NullPtr), "ccp4_file_setstamp", NULL); return EOF; } return ccp4_file_raw_setstamp(cfile, offset*cfile->itemsize); } /** * ccp4_file_setmode: * @param cfile (CCP4File *) * @param mode (int) io_mode * * set the data mode of cfile to mode * (CCP4_BYTE (8 bit) = 0, * CCP4_INT16 (16 bit) = 1, * CCP4_INT64 (64 bit) = 5, * CCP4_INT32 (32 bit) = 6, * FLOAT32 (32 bit) = 2, * COMP32 (2*16 bit) = 3, * COMP64 (2*32 bit) = 4). * @return 0 on success, EOF on failure. */ int ccp4_file_setmode (CCP4File *cfile, const int mode) { if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3)| CCP4_ERRNO(CIO_NullPtr), "ccp4_file_mode", NULL); return EOF; } if (mode >= 0 && mode <= 6) { cfile->mode = mode; cfile->itemsize = _item_sizes[mode]; cfile->_read=_read_mode[mode]; cfile->_write=_write_mode[mode]; } else { ccp4_signal(CCP4_ERRLEVEL(3)| CCP4_ERRNO(CIO_BadMode), "ccp4_file_mode", NULL); return EOF; } return 0; } /** * ccp4_file_mode: * @param cfile (CCP4File *) * * get data mode of @cfile (CCP4_BYTE =0, CCP4_INT16 =1, CCP4_INT64 =5, CCP4_INT32 =6, * FLOAT32 =2, COMP32 =3, COMP64 =4) * @return %mode */ int ccp4_file_mode (const CCP4File *cfile) { if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3)| CCP4_ERRNO(CIO_NullPtr), "ccp4_file_mode", NULL); return EOF; } return (cfile->mode); } /** * ccp4_file_itemsize: * @param cfile (CCP4File *) * * @return %itemsize of @cfile. */ int ccp4_file_itemsize(const CCP4File *cfile) { if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3)| CCP4_ERRNO(CIO_BadMode), "ccp4_file_itemsize", NULL); return EOF; } return (cfile->itemsize); } /** * ccp4_file_name: * @param cfile (CCP4File *) * * strdup @cfile->name * @return name of file as char * */ char *ccp4_file_name( CCP4File *cfile) { #if defined _MSC_VER return ( cfile == NULL ? NULL : _strdup(cfile->name)); #else return ( cfile == NULL ? NULL : strdup(cfile->name)); #endif } /** * ccp4_file_setbyte: * @param cfile (CCP4File *) * @param byte_order (int) * * set byte ordering for file * Return: */ int ccp4_file_setbyte(CCP4File *cfile, const int byte_order) { int result = (cfile->fconvert | (cfile->iconvert<<8)); switch (byte_order) { case DFNTF_BEIEEE: cfile->fconvert = DFNTF_BEIEEE; cfile->iconvert = DFNTI_MBO; break; case DFNTF_LEIEEE: cfile->fconvert = DFNTF_LEIEEE; cfile->iconvert = DFNTI_IBO ; break; case DFNTF_VAX: cfile->fconvert = DFNTF_VAX ; cfile->iconvert = DFNTI_IBO ; break; case DFNTF_CONVEXNATIVE: cfile->fconvert = DFNTF_CONVEXNATIVE ; cfile->iconvert = DFNTI_MBO ; break; default: ccp4_signal(CCP4_ERRLEVEL(3)| CCP4_ERRNO(CIO_BadMode), "ccp4_file_setbyte", NULL); result = 0; } return result; } /** * ccp4_file_byte: * @param cfile (CCP4File *) * * get byte ordering for file * @return byte ordering information */ int ccp4_file_byte(CCP4File *cfile) { return (cfile->fconvert | (cfile->iconvert<<8)); } /** * ccp4_file_open_file: * @param file (const FILE *) FILE struct * @param flag (const int) io mode (O_RDONLY =0, O_WRONLY =1, O_RDWR =2, * O_TMP =, O_APPEND =) * * open @cfile with existing handle FILE struct file and mode @flag. * The struct stat is check to determine if file is a regular file, * if it is, and is not stdin, it is assumed to be direct access. * @return (CCP4File *) on success, NULL on failure */ CCP4File *ccp4_file_open_file (const FILE *file, const int flag) { CCP4File *cfile; #if defined _MSC_VER struct _stat st; #else struct stat st; #endif if (!file) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_open_file", NULL); return NULL; } if (!(cfile = _file_init() ) ) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_open_file", NULL); return NULL; } /* set values in structure */ _file_open_mode(cfile,flag); cfile->stream = (FILE *) file; cfile->buffered = 1; cfile->open = 1; #if defined _MSC_VER _fstat(_fileno(cfile->stream), &st); if ( !(st.st_mode & S_IFREG) || file == stdin) { #else fstat(fileno(cfile->stream), &st); if ( !S_ISREG(st.st_mode) || file == stdin ) { #endif cfile->length = INT_MAX; cfile->direct = 0; } else { cfile->length = st.st_size; cfile->direct = 1; } cfile->loc = ftell( (FILE *)file); return cfile; } /** * ccp4_file_open_fd: * @param fd (const int) file descriptor * @param flag (const int) io mode (O_RDONLY =0, O_WRONLY =1, O_RDWR =2, * O_TMP =, O_APPEND =) * * initialise CCP4File struct with file descriptor @fd and mode @flag * The struct stat is check to determine if file is a regular file, * if it is, and is not stdin, it is assumed to be direct access. * @return (CCP4File *) on success, NULL on failure */ CCP4File *ccp4_file_open_fd (const int fd, const int flag) { CCP4File * cfile; #if defined _MSC_VER struct _stat st; #else struct stat st; #endif if (!(cfile = _file_init() ) ) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_open_fd", NULL); return NULL; } _file_open_mode(cfile, flag); cfile->fd = fd; cfile->open = 1; cfile->buffered = 0; #if defined _MSC_VER _fstat(fd, &st); if ( !(st.st_mode & S_IFREG) || fd == 0) { #else fstat(fd, &st); if ( !S_ISREG(st.st_mode) || fd == 0 ) { #endif cfile->length = INT_MAX; cfile->direct = 0; cfile->loc = 0; } else { cfile->length = st.st_size; cfile->direct = 1; #if defined _MSC_VER cfile->loc = _lseek(fd, 0L, SEEK_CUR); #else cfile->loc = lseek(fd, 0L, SEEK_CUR); #endif } return cfile; } /** * ccp4_file_open: * @param filename (const char *) filename * @param flag (const int) i/o mode, possible values are O_RDONLY, O_WRONLY, * O_RDWR, O_APPEND, O_TMP, O_CREAT, O_TRUNC - see ccp4_sysdep.h * * initialise CCP4File struct for file filename with mode @flag. * If !buffered use open(), otherwise fopen() * The struct stat is check to determine if file is a regular file, * if it is, and is not stdin, it is assumed to be direct access. * * @return (CCP4File *) on success, NULL on failure */ CCP4File *ccp4_file_open (const char *filename, const int flag) { CCP4File *cfile; int openflags = O_RDONLY; char fmode[5]; #if defined _MSC_VER struct _stat st; #else struct stat st; #endif if (!(cfile = _file_init())) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_open", NULL); return NULL; } _file_open_mode(cfile, flag); if (!cfile->buffered) { if (cfile->read && cfile->write) openflags = (O_RDWR | O_CREAT); else if (cfile->write) openflags = (O_WRONLY | O_CREAT); if (cfile->append) openflags |= O_APPEND; if (flag & O_TRUNC) openflags |= O_TRUNC; #if defined _MSC_VER if (cfile->scratch) openflags |= O_TEMPORARY; #endif #if defined(__DECC) && defined(VMS) || defined (_MSC_VER) openflags |= O_BINARY; #endif #if defined _MSC_VER cfile->fd = _open(filename, openflags); #else cfile->fd = open(filename, openflags); #endif if (cfile->fd == -1) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_CantOpenFile), "ccp4_file_open1", NULL); return NULL; } else { #if defined _MSC_VER _fstat(cfile->fd, &st); } #else fstat(cfile->fd, &st); } #endif } else { char *mptr = fmode; if (cfile->append) { *mptr++ = 'a'; if (cfile->read) *mptr++ = '+'; } else { if (cfile->read && cfile->write) { if (flag & O_TRUNC) {*mptr++ = 'w'; } else *mptr++ = 'r'; *mptr++ = '+'; } else if (cfile->write) *mptr++ = 'w'; else *mptr++ = 'r'; } #if defined(__DECC) && defined(VMS) || defined (_WIN32) *mptr++ = 'b'; #endif *mptr++ = '\0'; #ifdef VMS if (cfile->scratch) cfile->stream = fopen (filename, fmode, "mbc=16", /* bigger blocksize */ "fop=tmd"); /* temporary, delete on close */ else cfile->stream = fopen (filename, fmode, "mbc=16", /* bigger blocksize */ "ctx=stm", "mrs=0", "rat=cr", "rfm=stmlf"); #elif defined(_WIN32) if (cfile->scratch) { cfile->stream = tmpfile(); if (!cfile->stream) { ccp4_signal(CCP4_ERRLEVEL(2) | CCP4_ERRNO(CIO_CantOpenFile), "tmpfile() failed, opening normal file instead.", NULL); cfile->stream = fopen (filename, fmode); } } else cfile->stream = fopen (filename, fmode); #else cfile->stream = fopen (filename, fmode); if (cfile->stream) if (cfile->scratch && unlink (filename)!=0) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_UnlinkFail), "ccp4_file_open(unlink)", NULL); cfile->iostat = CIO_UnlinkFail; return NULL; } #endif if (!cfile->stream) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_CantOpenFile), "ccp4_file_open2", NULL); cfile->iostat = CIO_CantOpenFile; free(cfile); return NULL; } #if defined (__alpha) && defined (vms) (void) fflush (cfile->stream); #endif #if defined _MSC_VER _fstat(_fileno(cfile->stream), &st); #else fstat(fileno(cfile->stream), &st); #endif } #if defined _MSC_VER cfile->name = _strdup(filename); #else cfile->name = strdup(filename); #endif cfile->open = 1; cfile->own = 1; #if defined _MSC_VER if ( !(st.st_mode & S_IFREG) ) { #else if ( !cfile->scratch && !S_ISREG(st.st_mode) ) { #endif cfile->length = INT_MAX; cfile->direct = 0; } else { cfile->length = st.st_size; cfile->direct = 1; } cfile->loc = cfile->append ? cfile->length : 0; return cfile; } /** * ccp4_file_close: * @param cfile (CCP4File *) * * close @cfile if owned, close (non-buffered) or * fclose (buffered), or fflush if stream not owned. * Free resources. * @return 0 on success, EOF on failure */ int ccp4_file_close (CCP4File *cfile) { if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3)| CCP4_ERRNO(CIO_NullPtr), "ccp4_file_close", NULL); return EOF; } if (_file_close (cfile) == EOF) { ccp4_signal(CCP4_ERRLEVEL(3),"ccp4_file_close", NULL); return EOF; } _file_free(cfile); return (0); } /** * ccp4_file_rarch: * @param cfile (CCP4File *) * * read machine stamp from file @cfile->stream. * The machine stamp is at @cfile->stamp_loc items, set * by ccp4_file_setstamp() (default 0). * NB. these values may be overrriden with the environmental * variable CONVERT_FROM. * @return fileFT | (fileIT<<8) */ int ccp4_file_rarch (CCP4File *cfile) { unsigned char mtstring[4]; /* machine stamp */ char *native = getenv ("NATIVEMTZ"); char *foreign = getenv ("CONVERT_FROM"); if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3)| CCP4_ERRNO(CIO_NullPtr), "ccp4_file_rarch", NULL); return EOF; } if (native != NULL) return (nativeFT | (nativeIT<<8)); if (foreign == NULL) { if (ccp4_file_raw_seek(cfile, cfile->stamp_loc, SEEK_SET) == -1) { ccp4_signal(CCP4_ERRLEVEL(3),"ccp4_file_rarch", NULL); return EOF; } if (ccp4_file_raw_read(cfile, (char *) mtstring, 4UL) != 4) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_rarch", NULL); return EOF; } cfile->iconvert = (mtstring[1]>>4) & 0x0f; cfile->fconvert = (mtstring[0]>>4) & 0x0f; /* iconvert and fconvert should be one of the DFNTI/DFNTF values listed in ccp4_sysdep.h and hence non-zero. Some machine stamps can be corrupted (e.g. mrc files from chimera). We try to trap for this, and revert to native. */ if (cfile->iconvert == 0 || cfile->fconvert == 0) { if (ccp4_liberr_verbosity(-1)) printf("Warning: Machine stamp corrupted? Assuming native format. \n"); cfile->iconvert = nativeIT; cfile->fconvert = nativeFT; } } return (cfile->fconvert | (cfile->iconvert<<8)); } /** * ccp4_file_warch: * @param cfile (CCP4File *) * * write machine stamp to file @cfile->stream. * The machine stamp is placed at @cfile->stamp_loc items, * set by ccp4_file_setstamp() (defaults to 0). * * @return 0 on success, EOF on failure */ int ccp4_file_warch (CCP4File *cfile) { unsigned char mtstring[4]; /* machine stamp */ if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3)| CCP4_ERRNO(CIO_NullPtr), "ccp4_file_warch", NULL); return EOF; } if (ccp4_file_raw_seek(cfile, cfile->stamp_loc, SEEK_SET) == -1) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_warch", NULL); return EOF; } mtstring[0] = cfile->fconvert | (cfile->fconvert << 4); mtstring[1] = 1 | (cfile->iconvert << 4); mtstring[2] = mtstring[3] = 0; if (ccp4_file_raw_write(cfile, (const char *) mtstring, 4) != 4) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_warch", NULL); return EOF; } return 0; } /** * ccp4_file_read: * @param cfile (CCP4File *) * @param buffer (uint8 *) buffer * @param nitems (size_t) number of items * * mode dependent read function. Reads @nitems items from stream * @cfile->stream to @buffer as determined by cfile->mode. * * @return number of items read on success, EOF on failure */ int ccp4_file_read (CCP4File *cfile, uint8 *buffer, size_t nitems) { int result; result = cfile->_read(cfile,(uint8 *) buffer,nitems); if (result != nitems) ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_read", NULL); return (result); } /** * ccp4_file_readcomp: * @param cfile (CCP4File *) * @param buffer (uint8 *) buffer * @param nitems (size_t) number of items * * float complex {float,float} read function. Reads @nitems complex from stream * @cfile->stream to @buffer. Allows short count when eof is detected ( * buffered input only). * * @return number of complex read on success, EOF on failure */ int ccp4_file_readcomp (CCP4File *cfile, uint8 *buffer, size_t nitems) { int i, n, result; if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_readcomp", NULL); return EOF; } if ( !cfile->read || cfile->iostat) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_readcomp", NULL); return EOF; } if (cfile->last_op == WRITE_OP) if (ccp4_file_raw_seek(cfile,0L,SEEK_CUR) == -1) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_readcomp", NULL); return EOF; } n = _item_sizes[COMP64] * nitems; if ( (result = ccp4_file_raw_read (cfile, (char *) buffer, n)) != n) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_readcomp", NULL); if (cfile->stream && !feof(cfile->stream)) return EOF; } /* short count on stream is OK if EOF */ result /= _item_sizes[COMP64]; n = result; if (cfile->fconvert != nativeFT) { n *= 2; /* pairs of reals */ switch (cfile->fconvert) { /* get to BE IEEE */ case DFNTF_VAX : vaxF2ieeeF((union float_uint_uchar *) buffer, n); break; case DFNTF_CONVEXNATIVE : convexF2ieeeF((union float_uint_uchar *) buffer, n); break; case DFNTF_BEIEEE : break; case DFNTF_LEIEEE : { char j; for (i=0; i < n*4; i+=4) { j = buffer[i]; buffer[i] = buffer[i+3]; buffer[i+3] = j; j = buffer[i+1]; buffer[i+1] = buffer[i+2]; buffer[i+2] =j; } } break; default : ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_readcomp", NULL); return EOF; } switch (nativeFT) { /* get to Native if not BE IEEE */ case DFNTF_BEIEEE : break; case DFNTF_LEIEEE : { char j; for (i=0; i < n*4; i+=4) { j = buffer[i]; buffer[i] = buffer[i+3]; buffer[i+3] = j; j = buffer[i+1]; buffer[i+1] = buffer[i+2]; buffer[i+2] =j; } } break; case DFNTF_CONVEXNATIVE : ieeeF2convexF((union float_uint_uchar *) buffer, n); break; case DFNTF_VAX : ieeeF2vaxF((union float_uint_uchar *) buffer, n); break; default : ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_readcomp", NULL); return EOF; } } return (result); } /** * ccp4_file_readshortcomp: * @param cfile (CCP4File *) * @param buffer (uint8 *) buffer * @param nitems (size_t) number of items * * short complex {short,short} read function. Reads @nitems complex from stream * @cfile->stream to @buffer. Allows short count when eof is detected ( * buffered input only). * * @return number of complex read on success, EOF on failure */ int ccp4_file_readshortcomp (CCP4File *cfile, uint8 *buffer, size_t nitems) { int i, n, result; if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_readshortcomp", NULL); return EOF; } if ( !cfile->read || cfile->iostat) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_readshortcomp", NULL); return EOF; } if (cfile->last_op == WRITE_OP) if (ccp4_file_raw_seek(cfile,0L,SEEK_CUR) == -1) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_readshortcomp", NULL); return EOF; } n = _item_sizes[COMP32] * nitems; if ( (result = ccp4_file_raw_read (cfile, (char *) buffer, n)) != n) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_readshortcomp", NULL); if (cfile->stream && !feof(cfile->stream)) return EOF; } result /= _item_sizes[COMP32]; n = result; if (cfile->iconvert != nativeIT) { n *= 2; /* pairs of ints */ { if ((cfile->iconvert==DFNTI_MBO && nativeIT==DFNTI_IBO) || (cfile->iconvert==DFNTI_IBO && nativeIT==DFNTI_MBO)) { char j; for (i=0; i < n*2; i+=2) { j = buffer[i]; buffer[i] = buffer[i+1]; buffer[i+1] = j; } } else { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_readshortcomp", NULL); return EOF; } } } return (result); } /** * ccp4_file_readfloat: * @param cfile (CCP4File *) * @param buffer (uint8 *) buffer * @param nitems (size_t) number of items * * float read function. Reads @nitems floats from stream * @cfile->stream to @buffer. * * @return number of floats read on success, EOF on failure */ int ccp4_file_readfloat (CCP4File *cfile, uint8 *buffer, size_t nitems) { int i, n, result; if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_readfloat", NULL); return EOF; } if (!cfile->read || cfile->iostat) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_readfloat", NULL); return EOF; } if (cfile->last_op == WRITE_OP) if (ccp4_file_raw_seek(cfile,0L,SEEK_CUR) == -1) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_readfloat", NULL); return EOF; } n = _item_sizes[FLOAT32] * nitems; if ( (result = ccp4_file_raw_read (cfile, (char *) buffer, n)) != n) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_readfloat", NULL); if (cfile->stream && !feof(cfile->stream)) return EOF; } result /= _item_sizes[FLOAT32]; n = result; if (cfile->fconvert != nativeFT) { switch (cfile->fconvert) { /* get to BE IEEE */ case DFNTF_VAX : vaxF2ieeeF((union float_uint_uchar *) buffer, n); break; case DFNTF_CONVEXNATIVE : convexF2ieeeF((union float_uint_uchar *) buffer, n); break; case DFNTF_BEIEEE : break; case DFNTF_LEIEEE : { char j; for (i=0; i < n*4; i+=4) { j = buffer[i]; buffer[i] = buffer[i+3]; buffer[i+3] = j; j = buffer[i+1]; buffer[i+1] = buffer[i+2]; buffer[i+2] =j; } } break; default : ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_readfloat", NULL); return EOF; } switch (nativeFT) { case DFNTF_BEIEEE : break; /* done enough */ case DFNTF_LEIEEE : { char j; for (i=0; i < n*4; i+=4) { j = buffer[i]; buffer[i] = buffer[i+3]; buffer[i+3] = j; j = buffer[i+1]; buffer[i+1] = buffer[i+2]; buffer[i+2] =j; } } break; case DFNTF_CONVEXNATIVE : ieeeF2convexF((union float_uint_uchar *) buffer, n); break; case DFNTF_VAX : ieeeF2vaxF((union float_uint_uchar *) buffer, n); break; default : ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_readfloat", NULL); return EOF; } } return (result); } /** * ccp4_file_readint64: * @param cfile (CCP4File *) * @param buffer (uint8 *) buffer * @param nitems (size_t) number of items * * integer read function. Reads @nitems int64 from stream * @cfile->stream to @buffer. * * @return number of int64 read on success, EOF on failure */ int ccp4_file_readint64 (CCP4File *cfile, uint8 *buffer, size_t nitems) { int n, result; if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_readint64", NULL); return EOF; } if ( !cfile->read || cfile->iostat) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_readint64", NULL); return EOF; } if (cfile->last_op == WRITE_OP) if (ccp4_file_raw_seek(cfile,0L,SEEK_CUR) == -1) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_readint64", NULL); return EOF; } n = _item_sizes[CCP4_INT64] * nitems; if ( (result = ccp4_file_raw_read (cfile, (char *) buffer, n)) != n) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_readint64", NULL); if (cfile->stream && !feof(cfile->stream)) return EOF; } result /= _item_sizes[CCP4_INT64]; n = result; if (cfile->iconvert != nativeIT) { if ((cfile->iconvert==DFNTI_MBO && nativeIT==DFNTI_IBO) || (cfile->iconvert==DFNTI_IBO && nativeIT==DFNTI_MBO)) { char j; int i; for (i=0; i < n*8; i+=8) { j = buffer[i]; buffer[i] = buffer[i+7]; buffer[i+7] = j; j = buffer[i+1]; buffer[i+1] = buffer[i+6]; buffer[i+6] = j; j = buffer[i+2]; buffer[i+2] = buffer[i+5]; buffer[i+5] = j; j = buffer[i+3]; buffer[i+3] = buffer[i+4]; buffer[i+4] = j; } } else { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_readint64", NULL); return EOF; } } return (result); } /** * ccp4_file_readint: * @param cfile (CCP4File *) * @param buffer (uint8 *) buffer * @param nitems (size_t) number of items * * integer read function. Reads @nitems int from stream * @cfile->stream to @buffer. * * @return number of int read on success, EOF on failure */ int ccp4_file_readint (CCP4File *cfile, uint8 *buffer, size_t nitems) { int n, result; if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_readint", NULL); return EOF; } if ( !cfile->read || cfile->iostat) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_readint", NULL); return EOF; } if (cfile->last_op == WRITE_OP) if (ccp4_file_raw_seek(cfile,0L,SEEK_CUR) == -1) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_readint", NULL); return EOF; } n = _item_sizes[CCP4_INT32] * nitems; if ( (result = ccp4_file_raw_read (cfile, (char *) buffer, n)) != n) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_readint", NULL); if (cfile->stream && !feof(cfile->stream)) return EOF; } result /= _item_sizes[CCP4_INT32]; n = result; if (cfile->iconvert != nativeIT) { if ((cfile->iconvert==DFNTI_MBO && nativeIT==DFNTI_IBO) || (cfile->iconvert==DFNTI_IBO && nativeIT==DFNTI_MBO)) { char j; int i; for (i=0; i < n*4; i+=4) { j = buffer[i]; buffer[i] = buffer[i+3]; buffer[i+3] = j; j = buffer[i+1]; buffer[i+1] = buffer[i+2]; buffer[i+2] =j; } } else { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_readint", NULL); return EOF; } } return (result); } /** * ccp4_file_readshort: * @param cfile (CCP4File *) * @param buffer (uint8 *) buffer * @param nitems (size_t) number of items * * short read function. Reads @nitems shorts from stream * @cfile->stream to @buffer. * * @return number of shorts read on success, EOF on failure */ int ccp4_file_readshort (CCP4File *cfile, uint8 *buffer, size_t nitems) { int n, result; if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_readshort", NULL); return EOF; } if (!cfile->read || cfile->iostat) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_readshort", NULL); return EOF; } if (cfile->last_op == WRITE_OP) if (ccp4_file_raw_seek(cfile,0L,SEEK_CUR) == -1) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_readshort", NULL); return EOF; } n = _item_sizes[CCP4_INT16] * nitems; if ( (result = ccp4_file_raw_read (cfile, (char *) buffer, n)) != n) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_readshort", NULL); if (cfile->stream && !feof(cfile->stream)) return EOF; } result /= _item_sizes[CCP4_INT16]; n = result; if (cfile->iconvert != nativeIT) { if ((cfile->iconvert==DFNTI_MBO && nativeIT==DFNTI_IBO) || (cfile->iconvert==DFNTI_IBO && nativeIT==DFNTI_MBO)) { char j; int i; for (i=0; i < n*2; i+=2) { j = buffer[i]; buffer[i] = buffer[i+1]; buffer[i+1] = j; } } else { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_readshort", NULL); return EOF; } } return (result); } /** * ccp4_file_readchar: * @param cfile (CCP4File *) * @param buffer (uint8 *) buffer * @param nitems (size_t) number of items * * character read function. Reads @nitems characters from stream * @cfile->stream to @buffer. * * @return number of characters read on success, EOF on failure */ int ccp4_file_readchar (CCP4File *cfile, uint8 *buffer, size_t nitems) { size_t result; if (! cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_readchar", NULL); return EOF; } if (!cfile->read || cfile->iostat) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_readchar", NULL); return EOF; } if (cfile->last_op == WRITE_OP) if (ccp4_file_raw_seek(cfile,0L,SEEK_CUR) == -1) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_readchar", NULL); return EOF; } if ( (result = ccp4_file_raw_read (cfile, (char *) buffer, nitems)) != nitems) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_readchar", NULL); if (cfile->stream && !feof(cfile->stream)) return EOF; } return (result); } /** * ccp4_file_write: * @param cfile (CCP4File *) * @param buffer (uint8 *) buffer * @param nitems (size_t) number of items * * mode dependent write function. Write @nitems items from @buffer * to @cfile->stream as determined by cfile->mode. * * @return number of items written on success, EOF on failure */ int ccp4_file_write (CCP4File *cfile, const uint8 *buffer, size_t nitems) { size_t result; result = cfile->_write(cfile, buffer, nitems); if ( result != nitems) ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_write", NULL); return (result); } /** * ccp4_file_writecomp: * @param cfile (CCP4File *) * @param buffer (uint8 *) buffer * @param nitems (size_t) number of items * * complex {float,float} write function. Write @nitems items from @buffer * to @cfile->stream. * * @return number of complex items written on success, EOF on failure */ int ccp4_file_writecomp (CCP4File *cfile, const uint8 *buffer, size_t nitems) { size_t result = 0, n; if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_writecomp", NULL); return EOF; } if (!cfile->write ||cfile->iostat) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_writecomp", NULL); return EOF;} if (cfile->last_op == READ_OP) if (ccp4_file_raw_seek(cfile,0L,SEEK_CUR) == -1) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_writecomp", NULL); return EOF; } n = nitems * _item_sizes[COMP64]; if (cfile->fconvert != nativeFT) { char out_buffer[8]; const char *out_ptr = (char *) buffer; size_t i; for (i = 0; i != nitems; i++) { switch (nativeFT) { case DFNTF_BEIEEE : memcpy(out_buffer, out_ptr, _item_sizes[COMP64]); out_ptr += _item_sizes[COMP64]; break; case DFNTF_LEIEEE : out_buffer[3] = *out_ptr++; out_buffer[2] = *out_ptr++; out_buffer[1] = *out_ptr++; out_buffer[0] = *out_ptr++; out_buffer[7] = *out_ptr++; out_buffer[6] = *out_ptr++; out_buffer[5] = *out_ptr++; out_buffer[4] = *out_ptr++; break; case DFNTF_CONVEXNATIVE : memcpy(out_buffer, out_ptr, _item_sizes[COMP64]); out_ptr += _item_sizes[COMP64]; ieeeF2convexF((union float_uint_uchar *) out_buffer, 2); break; case DFNTF_VAX : memcpy(out_buffer, out_ptr, _item_sizes[COMP64]); out_ptr += _item_sizes[COMP64]; ieeeF2vaxF((union float_uint_uchar *) out_buffer, 2); break; default : ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "CCP4_File::writecomp", NULL); } switch (cfile->fconvert) { case DFNTF_VAX : vaxF2ieeeF((union float_uint_uchar *) out_buffer, 2); break; case DFNTF_CONVEXNATIVE : convexF2ieeeF((union float_uint_uchar *) out_buffer, 2); break; case DFNTF_BEIEEE : break; case DFNTF_LEIEEE : { char j; j = out_buffer[0]; out_buffer[0] = out_buffer[3]; out_buffer[3] = j; j = out_buffer[1]; out_buffer[1] = out_buffer[2]; out_buffer[2] =j; j = out_buffer[4]; out_buffer[4] = out_buffer[7]; out_buffer[7] = j; j = out_buffer[5]; out_buffer[5] = out_buffer[6]; out_buffer[6] =j; } break; default : ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_writecomp", NULL); return EOF; } result += ccp4_file_raw_write (cfile, out_buffer, _item_sizes[COMP64]); } } else { result = ccp4_file_raw_write (cfile, (char *) buffer, n); } if (result != n) ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_writecomp", NULL); return (result / _item_sizes[COMP64]); } /** * ccp4_file_writeshortcomp: * @param cfile (CCP4File *) * @param buffer (uint8 *) buffer * @param nitems (size_t) number of items * * short complex {short,short} write function. Write @nitems items from @buffer * to @cfile->stream. * * @return number of complex items written on success, EOF on failure */ int ccp4_file_writeshortcomp (CCP4File *cfile, const uint8 *buffer, size_t nitems) { size_t result = 0, n; if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_writeshortcomp", NULL); return EOF; } if (!cfile->write ||cfile->iostat) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_writeshortcomp", NULL); return EOF;} if (cfile->last_op == READ_OP) if (ccp4_file_raw_seek(cfile,0L,SEEK_CUR) == -1) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_writeshortcomp", NULL); return EOF; } n = nitems * _item_sizes[COMP32]; if (cfile->iconvert != nativeIT) { char out_buffer[4]; const char *out_ptr = (char *) buffer; size_t i; for (i = 0; i != nitems; i++) { if ((cfile->iconvert==DFNTI_MBO && nativeIT==DFNTI_IBO) || (cfile->iconvert==DFNTI_IBO && nativeIT==DFNTI_MBO)) { out_buffer[1] = *out_ptr++; out_buffer[0] = *out_ptr++; out_buffer[3] = *out_ptr++; out_buffer[2] = *out_ptr++; } else { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_writeshortcomp", NULL); return EOF; } result += ccp4_file_raw_write (cfile, out_buffer, _item_sizes[COMP32]); } } else { result = ccp4_file_raw_write (cfile, (char *) buffer, n); } if ( result != n) ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_writeshortcomp", NULL); return (result / _item_sizes[COMP32]); } /** * ccp4_file_writefloat: * @param cfile (CCP4File *) * @param buffer (uint8 *) buffer * @param nitems (size_t) number of items * * float write function. Write @nitems items from @buffer * to @cfile->stream. * * Returns number of floats written on success, EOF on failure */ int ccp4_file_writefloat (CCP4File *cfile, const uint8 *buffer, size_t nitems) { size_t result = 0, n; if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_writefloat", NULL); return EOF; } if (!cfile->write ||cfile->iostat) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_writefloat", NULL); return EOF;} if (cfile->last_op == READ_OP) if (ccp4_file_raw_seek(cfile,0L,SEEK_CUR) == -1) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_writefloat", NULL); return EOF; } n = nitems * _item_sizes[FLOAT32]; if (cfile->fconvert != nativeFT) { char out_buffer[4]; const char *out_ptr = (char *) buffer; size_t i; for (i = 0; i != nitems; i++) { switch (nativeFT) { case DFNTF_BEIEEE : memcpy(out_buffer, out_ptr, _item_sizes[FLOAT32]); out_ptr += _item_sizes[FLOAT32]; break; case DFNTF_LEIEEE : out_buffer[3] = *out_ptr++; out_buffer[2] = *out_ptr++; out_buffer[1] = *out_ptr++; out_buffer[0] = *out_ptr++; break; case DFNTF_CONVEXNATIVE : memcpy(out_buffer, out_ptr, _item_sizes[FLOAT32]); out_ptr += _item_sizes[FLOAT32]; ieeeF2convexF((union float_uint_uchar *) out_buffer, 1); break; case DFNTF_VAX : memcpy(out_buffer, out_ptr, _item_sizes[FLOAT32]); out_ptr += _item_sizes[FLOAT32]; ieeeF2vaxF((union float_uint_uchar *) out_buffer, 1); break; default : ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "CCP4_File::writefloat", NULL); } switch (cfile->fconvert) { case DFNTF_VAX : vaxF2ieeeF((union float_uint_uchar *) out_buffer, 1); break; case DFNTF_CONVEXNATIVE : convexF2ieeeF((union float_uint_uchar *) out_buffer, 1); break; case DFNTF_BEIEEE : break; case DFNTF_LEIEEE : { char j; j = out_buffer[0]; out_buffer[0] = out_buffer[3]; out_buffer[3] = j; j = out_buffer[1]; out_buffer[1] = out_buffer[2]; out_buffer[2] =j; } break; default : ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_writefloat", NULL); return EOF; } result += ccp4_file_raw_write (cfile, out_buffer, _item_sizes[FLOAT32]); } } else { result = ccp4_file_raw_write (cfile, (char *) buffer, n); } if (result != n) ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_writefloat", NULL); return (result / _item_sizes[FLOAT32]); } /** * ccp4_file_writeint64: * @param cfile (CCP4File *) * @param buffer (uint8 *) buffer * @param nitems (size_t) number of items * * int64 write function. Write @nitems items from @buffer * to @cfile->stream. * * @return number of int64 written on success, EOF on failure */ int ccp4_file_writeint64 (CCP4File *cfile, const uint8 *buffer, size_t nitems) { size_t result = 0, n; if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_writeint64", NULL); return EOF; } if (!cfile->write ||cfile->iostat) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_writeint64", NULL); return EOF;} if (cfile->last_op == READ_OP) if (ccp4_file_raw_seek(cfile,0L,SEEK_CUR) == -1) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_writeint64", NULL); return EOF; } n = nitems * _item_sizes[CCP4_INT64]; if (cfile->iconvert != nativeIT) { char out_buffer[8]; const char *out_ptr = (char *) buffer; size_t i; for (i = 0; i != nitems; i++) { if ((cfile->iconvert==DFNTI_MBO && nativeIT==DFNTI_IBO) || (cfile->iconvert==DFNTI_IBO && nativeIT==DFNTI_MBO)) { out_buffer[7] = *out_ptr++; out_buffer[6] = *out_ptr++; out_buffer[5] = *out_ptr++; out_buffer[4] = *out_ptr++; out_buffer[3] = *out_ptr++; out_buffer[2] = *out_ptr++; out_buffer[1] = *out_ptr++; out_buffer[0] = *out_ptr++; } else { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_writeint64", NULL); return EOF; } result += ccp4_file_raw_write (cfile, out_buffer, _item_sizes[CCP4_INT64]); } } else { result = ccp4_file_raw_write (cfile, (char *) buffer, n); } if ( result != n) ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_writeint64", NULL); return (result / _item_sizes[CCP4_INT64]); } /** * ccp4_file_writeint: * @param cfile (CCP4File *) * @param buffer (uint8 *) buffer * @param nitems (size_t) number of items * * int write function. Write @nitems items from @buffer * to @cfile->stream. * * @return number of int written on success, EOF on failure */ int ccp4_file_writeint (CCP4File *cfile, const uint8 *buffer, size_t nitems) { size_t result = 0, n; if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_writeint", NULL); return EOF; } if (!cfile->write ||cfile->iostat) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_writeint", NULL); return EOF;} if (cfile->last_op == READ_OP) if (ccp4_file_raw_seek(cfile,0L,SEEK_CUR) == -1) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_writeint", NULL); return EOF; } n = nitems * _item_sizes[CCP4_INT32]; if (cfile->iconvert != nativeIT) { char out_buffer[4]; const char *out_ptr = (char *) buffer; size_t i; for (i = 0; i != nitems; i++) { if ((cfile->iconvert==DFNTI_MBO && nativeIT==DFNTI_IBO) || (cfile->iconvert==DFNTI_IBO && nativeIT==DFNTI_MBO)) { out_buffer[3] = *out_ptr++; out_buffer[2] = *out_ptr++; out_buffer[1] = *out_ptr++; out_buffer[0] = *out_ptr++; } else { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_writeint", NULL); return EOF; } result += ccp4_file_raw_write (cfile, out_buffer, _item_sizes[CCP4_INT32]); } } else { result = ccp4_file_raw_write (cfile, (char *) buffer, n); } if ( result != n) ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_writeint", NULL); return (result / _item_sizes[CCP4_INT32]); } /** * ccp4_file_writeshort: * @param cfile (CCP4File *) * @param buffer (uint8 *) buffer * @param nitems (size_t) number of items * * short write function. Write @nitems items from @buffer * to @cfile->stream. * * @return number of short written on success, EOF on failure */ int ccp4_file_writeshort (CCP4File *cfile, const uint8 *buffer, size_t nitems) { size_t result = 0, n; if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_writeshort", NULL); return EOF; } if (!cfile->write ||cfile->iostat) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_writeshort", NULL); return EOF;} if (cfile->last_op == READ_OP) if (ccp4_file_raw_seek(cfile,0L,SEEK_CUR) == -1) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_writeshort", NULL); return EOF; } n = nitems * _item_sizes[CCP4_INT16]; if (cfile->iconvert != nativeIT) { char out_buffer[2]; const char *out_ptr = (char *) buffer; size_t i; for (i = 0; i != nitems; i++) { if ((cfile->iconvert==DFNTI_MBO && nativeIT==DFNTI_IBO) || (cfile->iconvert==DFNTI_IBO && nativeIT==DFNTI_MBO)) { out_buffer[1] = *out_ptr++; out_buffer[0] = *out_ptr++; } else { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_readint", NULL); return EOF; } result += ccp4_file_raw_write (cfile, out_buffer, _item_sizes[CCP4_INT16]); } } else { result = ccp4_file_raw_write (cfile, (char *) buffer, n); } if ( result != n) ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_writeshort", NULL); return (result / _item_sizes[CCP4_INT16]); } /** * ccp4_file_writechar: * @param cfile (CCP4File *) * @param buffer (uint8 *) buffer * @param nitems (size_t) number of items * * char write function. Write @nitems items from @buffer * to @cfile->stream. * * @return number of bytes written on success, EOF on failure */ int ccp4_file_writechar (CCP4File *cfile, const uint8 *buffer, size_t nitems) { size_t result; if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_writechar", NULL); return EOF; } if (!cfile->write ||cfile->iostat) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_BadMode), "ccp4_file_writechar", NULL); return EOF;} if (cfile->last_op == READ_OP) if (ccp4_file_raw_seek(cfile,0L,SEEK_CUR) == -1) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_writechar", NULL); return EOF; } if ( (result = ccp4_file_raw_write (cfile, (char *) buffer, nitems)) != nitems) ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_writechar", NULL); return (result); } /** * ccp4_file_seek: * @param cfile (CCP4File *) * @param offset (long) offset in items * @param whence (int) SEEK_SET, SEEK_CUR, or SEEK_END * * seeks on file by offset items. SEEK_SET is relative * to start of file, SEEK_CUR to current, SEEK_END to * end. * * @return 0 on success, -1 on failure */ int ccp4_file_seek (CCP4File *cfile, long offset, int whence) { int result; if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_seek", NULL); return -1; } result = ccp4_file_raw_seek(cfile, offset*cfile->itemsize, whence); if (result != -1) ccp4_file_clearerr(cfile); return ((result == -1) ? -1 : 0); } /** * ccp4_file_rewind: * @param cfile (CCP4File *) * * Seek to start of file. Clear error status. * * @return 0 on success, EOF on failure */ void ccp4_file_rewind (CCP4File *cfile) { if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_rewind", NULL); return ; } if (ccp4_file_raw_seek(cfile, 0, SEEK_SET)) { ccp4_signal(CCP4_ERRLEVEL(3), "ccp4_file_rewind", NULL); } else { ccp4_file_clearerr(cfile); } } /** * ccp4_file_length: * @param cfile (CCP4File *) * * Length of file on disk. * @return length of @cfile on success, EOF on failure */ long ccp4_file_length (CCP4File *cfile) { #if defined _MSC_VER struct _stat st; #else struct stat st; #endif if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_length", NULL); return EOF; } cfile->last_op = IRRELEVANT_OP; if (cfile->buffered && cfile->stream) fflush (cfile->stream); #if defined _MSC_VER _fstat(cfile->stream ? _fileno(cfile->stream) : cfile->fd, &st); #else fstat(cfile->stream ? fileno(cfile->stream) : cfile->fd, &st); #endif cfile->length = st.st_size; return (st.st_size); } /** * ccp4_file_tell: * @param cfile (CCP4File *) * * Current location in file, uses either ftell or lseek. * @return current offset of @cfile in bytes. */ long ccp4_file_tell (CCP4File *cfile) { long result; if (! cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_tell", NULL); return EOF; } cfile->last_op = IRRELEVANT_OP; if (cfile->buffered && cfile->stream) { #if !defined (_MSC_VER) if ( cfile->last_op == WRITE_OP ) fflush (cfile->stream); #endif result = (long) ftell(cfile->stream); } else #if defined _MSC_VER result = _lseek(cfile->fd, 0L, SEEK_CUR); #else result = lseek(cfile->fd, 0L, SEEK_CUR); #endif cfile->loc = result; return (result); } /** * ccp4_file_feof: * @param cfile (CCP4File *) * * @return true if @cfile is at EoF. * */ int ccp4_file_feof(CCP4File *cfile) { if (!cfile) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_feof", NULL); return EOF; } return (cfile->stream) ? feof(cfile->stream) : cfile->loc >= cfile->length; } /** * ccp4_file_clearerr: * @param cfile (CCP4File *) * * Clears error status of @cfile. * */ void ccp4_file_clearerr(CCP4File *cfile) { if (!cfile || !cfile->stream) return; cfile->iostat = CIO_Ok; clearerr(cfile->stream); } /** * ccp4_file_fatal: * @param cfile (CCP4File *) * * Die with error message based on @cfile error status. */ void ccp4_file_fatal (CCP4File *cfile, char *message) { char *buff; size_t l; if (!cfile) ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_NullPtr), "ccp4_file_fatal", NULL); l = strlen (message) + strlen (cfile->name) + 1; if ( !(buff = malloc(l))) ccp4_signal(CCP4_ERRLEVEL(4), "ccp4_file_fatal", NULL); buff[0] = '\0'; strcat (buff, message); strcat (buff, cfile->name); ccp4_fatal(buff); } /** * ccp4_file_error: * @param cfile (CCP4File *) * * print error mesage. * @return associated error code */ int ccp4_file_error(CCP4File *cfile) { if (!cfile->iostat) return 0; fprintf(stderr,"%s %s \n", cfile->name,ccp4_strerror(cfile->iostat)); return CCP4_ERRGETCODE(cfile->iostat); } /** * ccp4_file_flush: * @param cfile (CCP4File *) * * flush buffer contents of @cfile */ void ccp4_file_flush(CCP4File *cfile) { if (cfile && cfile->stream && cfile->buffered) fflush(cfile->stream); } /** * ccp4_file_print: * @param cfile (CCP4File *) * * @return @cfile information in char array for printing. */ char *ccp4_file_print(CCP4File *cfile, char *msg_start, char *msg_end) { char *msg_curr = msg_start; if (!cfile) return msg_start; if (cfile->name) if ((msg_end - msg_curr) > strlen(cfile->name)) { strcpy(msg_curr,cfile->name); msg_curr = strrchr(msg_curr,'\0'); } if (cfile->open) { if ((msg_end - msg_curr) > 6 ) { strcat(msg_start, " opened"); msg_curr = strrchr(msg_curr,'\0'); } } else { if ((msg_end - msg_curr) > 7 ) { strcat(msg_start, " closed"); msg_curr = strrchr(msg_curr,'\0'); } } if (cfile->append) { if ((msg_end - msg_curr) > 13 ) { strcat(msg_start, ", append mode"); msg_curr = strrchr(msg_curr,'\0'); } } else if (cfile->read && cfile->write) { if ((msg_end - msg_curr) > 17 ) { strcat(msg_start, ", read-write mode"); msg_curr = strrchr(msg_curr,'\0'); } } else if (cfile->write) { if ((msg_end - msg_curr) > 12 ) { strcat(msg_start, ", write mode"); msg_curr = strrchr(msg_curr,'\0'); } } else { if ((msg_end - msg_curr) > 11 ) { strcat(msg_start, ", read mode"); msg_curr = strrchr(msg_curr,'\0'); } } return msg_curr; } libccp4-8.0.0/ccp4/library_file.h0000644000000000000000000001023514242731033014632 0ustar 00000000000000/* library_file.h: header file for library_file.c Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file library_file.h * Functions for file i/o. * Charles Ballard */ #ifndef __CCP4_LIB_FILE #define __CCP4_LIB_FILE #include "ccp4_sysdep.h" #include "ccp4_types.h" #ifdef __cplusplus namespace CCP4 { extern "C" { #endif /** Generic CCP4 file. */ typedef struct _CFileStruct CCP4File; struct _CFileStruct { char *name; FILE *stream; int fd; unsigned int read : 1; unsigned int write : 1; unsigned int append : 1; unsigned int binary : 1; unsigned int scratch : 1 , : 3; unsigned int buffered : 1; unsigned int sync : 1, : 6; unsigned int direct : 1, : 7; unsigned int open : 1; unsigned int own : 1; unsigned int last_op : 2; unsigned int getbuff : 1, : 4; int iostat; unsigned int mode : 8; unsigned int itemsize : 8; unsigned int iconvert : 8; unsigned int fconvert: 8; off_t length; off_t loc; size_t stamp_loc; int (*_read) (CCP4File *, uint8 *, size_t); int (*_write) (CCP4File *, const uint8 *, size_t); char buff[8]; void *priv; }; CCP4File *ccp4_file_open (const char *, const int); CCP4File *ccp4_file_open_file (const FILE *, const int); CCP4File *ccp4_file_open_fd (const int, const int); int ccp4_file_rarch ( CCP4File*); int ccp4_file_warch ( CCP4File*); int ccp4_file_close ( CCP4File*); int ccp4_file_mode ( const CCP4File*); int ccp4_file_setmode ( CCP4File*, const int); int ccp4_file_setstamp( CCP4File *, const size_t); int ccp4_file_itemsize( const CCP4File*); int ccp4_file_setbyte( CCP4File *, const int); int ccp4_file_byteorder( CCP4File *); int ccp4_file_is_write(const CCP4File *); int ccp4_file_is_read(const CCP4File *); int ccp4_file_is_append(const CCP4File *); int ccp4_file_is_scratch(const CCP4File *); int ccp4_file_is_buffered(const CCP4File *); int ccp4_file_status(const CCP4File *); char *ccp4_file_name( CCP4File *); int ccp4_file_read ( CCP4File*, uint8 *, size_t); int ccp4_file_readcomp ( CCP4File*, uint8 *, size_t); int ccp4_file_readshortcomp ( CCP4File*, uint8 *, size_t); int ccp4_file_readfloat ( CCP4File*, uint8 *, size_t); int ccp4_file_readint64 ( CCP4File*, uint8 *, size_t); int ccp4_file_readint ( CCP4File*, uint8 *, size_t); int ccp4_file_readshort ( CCP4File*, uint8 *, size_t); int ccp4_file_readchar ( CCP4File*, uint8 *, size_t); int ccp4_file_write ( CCP4File*, const uint8 *, size_t); int ccp4_file_writecomp ( CCP4File*, const uint8 *, size_t); int ccp4_file_writeshortcomp ( CCP4File*, const uint8 *, size_t); int ccp4_file_writefloat ( CCP4File*, const uint8 *, size_t); int ccp4_file_writeint ( CCP4File*, const uint8 *, size_t); int ccp4_file_writeint64 ( CCP4File*, const uint8 *, size_t); int ccp4_file_writeshort ( CCP4File*, const uint8 *, size_t); int ccp4_file_writechar ( CCP4File*, const uint8 *, size_t); int ccp4_file_seek ( CCP4File*, long, int); void ccp4_file_rewind ( CCP4File*); void ccp4_file_flush (CCP4File *); long ccp4_file_length ( CCP4File*); long ccp4_file_tell ( CCP4File*); int ccp4_file_feof(CCP4File *); void ccp4_file_clearerr(CCP4File *); void ccp4_file_fatal (CCP4File *, char *); char *ccp4_file_print(CCP4File *, char *, char *); int ccp4_file_raw_seek( CCP4File *, long, int); int ccp4_file_raw_read ( CCP4File*, char *, size_t); int ccp4_file_raw_write ( CCP4File*, const char *, size_t); int ccp4_file_raw_setstamp( CCP4File *, const size_t); #ifdef __cplusplus } } #endif #endif /* __CCP4_LIB_FILE */ libccp4-8.0.0/ccp4/library_utils.c0000644000000000000000000003607514242731033015060 0ustar 00000000000000/* library_utils.c: CCP4 Library Utilities Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @page utilities_page CCP4 Library Utilities * * @section utilities_list File list
  • library_utils.c
  • ccp4_general.c
  • ccp4_parser.c
  • ccp4_program.c
* @section utilities_overview Overview The CCP4 C-library provides many utility functions which either give specific CCP4 functionality (e.g. traditional keyword parsing) or are just generally useful (platform independent date). */ /** @file library_utils.c * @brief Utility functions. * @author Charles Ballard */ #include "ccp4_sysdep.h" #include #include #include "ccp4_utils.h" #include "ccp4_errno.h" #if defined (_WIN32) #define WIN32_LEAN_AND_MEAN #include #endif #define CCP4_ERRNO(y) (CCP4_ERR_UTILS | (y)) /* rcsid[] = "$Id$" */ /* static uint16 nativeIT = NATIVEIT; */ /* machine integer type - currently unused here */ static uint16 nativeFT = NATIVEFT; /* machine float type */ /** . * * @return */ int ccp4_utils_translate_mode_float(float *out, const void *buffer, int dim, int mode) { unsigned char *ucp; unsigned short *usp; float *fp = out, *ufp, tmp1, tmp2; register int ctr=0; switch(mode) { case 0: ucp = (unsigned char *)buffer; for(ctr = 0; ctr < dim ; ++ctr) *fp++ = (float) *ucp++; break; case 1: usp = (unsigned short *)buffer; for(ctr = 0; ctr < dim ; ++ctr) *fp++ = (float) *usp++; break; case 3: /* complex short (define type ?) */ usp = (unsigned short *)buffer; for(ctr = 0; ctr < dim ; ++ctr) { tmp1 = (float) *usp++; tmp2 = (float) *usp++; *fp++ = (float) sqrt(tmp1*tmp1 + tmp2*tmp2); } break; case 4: /* complex real (define type ?) */ ufp = (float *)buffer; for(ctr = 0; ctr < dim ; ++ctr) { tmp1 = *ufp++; tmp2 = *ufp++; *fp++ = (float) sqrt(tmp1*tmp1 + tmp2*tmp2); } break; case 2: default: break; } return (ctr); } /** Gets the length of a Fortran string with trailing blanks removed. * * @return length of string */ size_t ccp4_utils_flength (char *s, int len) { if (len <= 0 ) return 0; while (s[--len] == ' ') if (len == 0) return 0; return (++len); } /** . * * @return */ void ccp4_utils_print (const char *message) { printf ("%s\n",message); } #if ! defined (VMS) /** . * * @return */ int ccp4_utils_setenv (char *str) { #if defined (sgi) || defined (sun) || defined (__hpux) || \ defined(_AIX) || defined (__OSF1__) || \ defined (__osf__) || defined (__FreeBSD__) || defined (linux) || \ defined (_WIN32) || defined __linux__ /* putenv is the POSIX.1, draft 3 proposed mechanism */ #if !(defined(__hpux) && defined(__HP_cc)) int putenv (); #endif char *param; if ( (param = (char *) ccp4_utils_malloc( (strlen(str)+1)*sizeof(char) )) == NULL) { ccp4_errno = CCP4_ERRNO(errno); return -1; } strcpy(param,str); return (putenv (param)); /* note the necessary lack of free() */ #else /* setenv is not POSIX, BSD might have to use `index' */ int setenv (); char *param1,*param2; if ( (param1 = (char *) ccp4_utils_malloc( (strlen(str)+1)*sizeof(char) )) == NULL) { ccp4_errno = CCP4_ERRNO(errno); return -1; } strcpy(param1,str); if ((param2 = (char *) strchr(param1, '=')) == NULL) { ccp4_errno = CCP4_ERRNO(errno); return -1; } *param2++ = '\0'; return (setenv (param1, param2, 1)); #endif } #endif #if ! defined (VMS) /** . * * @return */ int ccp4_utils_outbuf(void) { #if defined (sgi) || defined (sun) || \ defined (__OSF1__) || \ defined (__FreeBSD__) return setlinebuf(stdout); #else #if defined(_MSC_VER) return setvbuf(stdout, NULL, _IONBF, 80); #else # if defined (_AIX) return -1; # else /* Windows requires size argument, though 0 works on unix */ return setvbuf(stdout, NULL, _IOLBF, 80); # endif #endif #endif } /** . * * @return */ int ccp4_utils_noinpbuf(void) { return setvbuf(stdin, NULL, _IONBF, 0); } #endif union float_uint_uchar ccp4_nan () #if NATIVEFT == DFNTF_BEIEEE || NATIVEFT == DFNTF_LEIEEE # define CCP4_NAN 0xfffa5a5a #endif /* For \idx{Convex} native mode and \idx{VAX} use a \idx{Rop} value: */ /* */ /* = */ #if NATIVEFT == DFNTF_CONVEXNATIVE # define CCP4_NAN 0x80000000 #endif #if NATIVEFT == DFNTF_VAX # define CCP4_NAN 0x00008000 #endif #ifndef CCP4_NAN # error "CCP4_NAN isn't defined (needs NATIVEFT)" #endif { union float_uint_uchar realnum; realnum.i = CCP4_NAN; return (realnum); } /** . * * @return */ int ccp4_utils_isnan (const union float_uint_uchar *realnum) { switch (nativeFT) { case DFNTF_BEIEEE : case DFNTF_LEIEEE : return ((realnum->i & 0x7f800000) == 0x7f800000); /* exponent all 1s */ case DFNTF_CONVEXNATIVE : return ((realnum->i & 0xff800000) == 0x80000000); case DFNTF_VAX : return ((realnum->i & 0x0000ff80) == 0x00008000); default : ccp4_fatal("CCP4_UTILS_ISNAN: bad nativeFT"); return 0; /* avoid compiler warning */ } } #define MDFBIG -1.0E10 /* BIOMOL absence flag value */ /** . * * @return */ void ccp4_utils_bml (int ncols, union float_uint_uchar cols[]) { int i; for (i=0; i MDFBIG) { if (cols[i].f < wminmax[2*i]) wminmax[2*i] = cols[i].f; if (cols[i].f > wminmax[1+2*i]) wminmax[1+2*i] = cols[i].f; } } /** . * * @return */ void ccp4_utils_hgetlimits (int *IValueNotDet, float *ValueNotDet) { *IValueNotDet = INT_MAX; *ValueNotDet = FLT_MAX; } #ifndef _WIN32 static unsigned parse_mode(const char *cmode) { unsigned mode = 0; #if defined (__APPLE__) static const unsigned TBM = 0x07; switch (strlen(cmode)) { case 4: mode |= (*cmode & TBM) << 9 ; mode |= (*(cmode+1) & TBM) << 6 ; mode |= (*(cmode+2) & TBM) << 3 ; mode |= (*(cmode+3) & TBM) ; break; case 3: mode |= (*cmode & TBM) << 6 ; mode |= (*(cmode+1) & TBM) << 3 ; mode |= (*(cmode+2) & TBM) ; break; case 2: mode |= (*cmode & TBM) << 3 ; mode |= (*(cmode+1) & TBM) ; break; case 1: mode |= (*cmode & TBM) ; break; default: mode = 0x0fff ; } #else /* Possible modes (see stat.h) Currently pass 3-character string and interpret as octal. Try also S_IRWXU, S_IRWXG, etc. */ sscanf(cmode,"%o",&mode); #endif return mode; } #endif /** . * * @return */ int ccp4_utils_mkdir (const char *path, const char *cmode) { int result; #if defined(_WIN32) result = mkdir(path); #else unsigned mode = parse_mode(cmode); result = mkdir(path, (mode_t) mode); #endif if (result == -1) { if (errno == EEXIST) { result = 1; } } return (result); } /** . * * @return */ int ccp4_utils_chmod (const char *path, const char *cmode) { #if defined(_WIN32) return (chmod(path,0x0fff)); #else unsigned mode = parse_mode(cmode); return (chmod(path, (mode_t) mode)); #endif } /** This is a wrapper for the malloc function, which adds some * error trapping. * * @return void */ void *ccp4_utils_malloc(size_t size) { void *val; val = malloc (size); if (!val && size) { perror ("Failure in ccp4_utils_malloc"); abort (); } return val;} /** This is a wrapper for the realloc function, which adds some * error trapping. * * @return */ void *ccp4_utils_realloc(void *ptr, size_t size) { void *val; val = realloc (ptr, size); if (!val && size) { perror ("Failure in ccp4_utils_realloc"); abort (); } return val;} /** This is a wrapper for the calloc function, which adds some * error trapping. * * @return */ void *ccp4_utils_calloc(size_t nelem , size_t elsize) { void *val; val = calloc (nelem, elsize); if (!val && elsize) { perror ("Failure in ccp4_utils_calloc"); abort (); } return val;} /** Return the user's login name. * Note that getlogin only works for processes attached to * a terminal (and hence won't work from the GUI). * @return pointer to character string containing login name. */ char *ccp4_utils_username(void) { static char userid_unknown[] = "unknown"; char *userid = NULL; #if defined(_WIN32) static char windows_username[512]; DWORD bufsize = sizeof(windows_username); if (GetUserName(windows_username, &bufsize)) userid = windows_username; #else userid = getlogin(); #endif return userid ? userid : userid_unknown; } static int is_sep(char c) { #ifdef _WIN32 /* allow alternative separator for Windows (for MSYS, Cygwin, Wine) */ return c == PATH_SEPARATOR || c == '/'; #else return c == PATH_SEPARATOR; #endif } /** Extracts the basename from a full file name. * Separators for directories and extensions are OS-specific. * @param filename full file name string. * @return pointer to basename */ char *ccp4_utils_basename(const char *filename) { int i, indx1=-1, length; char *basename; for ( i = strlen(filename)-1; i >= 0; i-- ) { if (is_sep(filename[i])) { indx1 = i; break; } } length = strlen(filename) - indx1; /* Search for extension separators must be performed backwards in case filename has multiple extension separators */ for ( i = strlen(filename)-1; i >= (indx1 < 0 ? 0 : indx1) ; i-- ) { if (filename[i] == EXT_SEPARATOR) { length = i - indx1; break; } } basename = ccp4_utils_malloc(length*sizeof(char)); strncpy(basename,filename+indx1+1,length-1); basename[length-1]='\0'; return basename; } /** Extracts the pathname from a full file name. * Separators for directories and extensions are OS-specific. * @param filename full file name string. * @return pointer to pathname with trailing separator. */ char *ccp4_utils_pathname(const char *filename) { int i, indx1=-1, length; char *pathname; for ( i = strlen(filename)-1; i >= 0; i-- ) { if (is_sep(filename[i])) { indx1 = i; break; } } length = indx1+2; pathname = ccp4_utils_malloc(length*sizeof(char)); strncpy(pathname,filename,length-1); pathname[length-1]='\0'; return pathname; } /** Extracts the extension from a full file name. * Separators for directories and extensions are OS-specific. * @param filename full file name string. * @return pointer to extension */ char *ccp4_utils_extension(const char *filename) { int i, indx1=-1, length=1; char *extension; for ( i = strlen(filename)-1; i >= 0; i-- ) { if (filename[i] == EXT_SEPARATOR) { indx1 = i; length = strlen(filename) - indx1; break; } else if (is_sep(filename[i])) { indx1 = i; length = 1; break; } } extension = ccp4_utils_malloc(length*sizeof(char)); strncpy(extension,filename+indx1+1,length-1); extension[length-1]='\0'; return extension; } /** Joins a leading directory with a filename. * Separators for directories and extensions are OS-specific. * @param dir directory path. * @param file file name string. * @return pointer to joined directory-filename path. */ char *ccp4_utils_joinfilenames(const char *dir, const char *file) { char *join=NULL; int lendir,lenfile,lenjoin; lendir = strlen(dir); lenfile = strlen(file); lenjoin = lendir + lenfile + 2; join = (char *) ccp4_utils_malloc(sizeof(char)*lenjoin); if (!join) { return NULL; } strncpy(join,dir,lendir); join[lendir] = PATH_SEPARATOR; join[lendir+1] = '\0'; strncat(join,file,lenfile); join[lenjoin-1] = '\0'; return join; } /** . * * @return */ void ccp4_utils_idate (int iarray[3]) { struct tm *lt=NULL; time_t tim; tim = time(NULL); lt = localtime(&tim); iarray[0] = lt->tm_mday; iarray[1] = lt->tm_mon+1; /* need range 1-12 */ iarray[2] = lt->tm_year + 1900; } /** . * * @return */ char *ccp4_utils_date(char *date) { int iarray[3]; ccp4_utils_idate(iarray); sprintf(date,"%2d/%2d/%4d",iarray[0],iarray[1],iarray[2]); date[10] = '\0'; return (date); } /** Function to obtain current time. * @param iarray Array containing hours, minutes and seconds. * @return void. */ void ccp4_utils_itime (int iarray[3]) { struct tm *lt; time_t tim; tim = time(NULL); lt = localtime(&tim); iarray[0] = lt->tm_hour; iarray[1] = lt->tm_min; iarray[2] = lt->tm_sec; } /** Alternative to ccp4_utils_itime with time as character string. * @param time Character string of form HH:MM:SS * @return pointer to character string. */ char *ccp4_utils_time(char *time) { int iarray[3]; ccp4_utils_itime(iarray); sprintf(time,"%2.2d:%2.2d:%2.2d",iarray[0],iarray[1],iarray[2]); time[8] = '\0'; return (time); } /** Function to obtain User and System times. * @param tarray Array containing User and System times. * @return Sum of User and System times. */ float ccp4_utils_etime (float tarray[2]) { #ifdef _WIN32 tarray[0] = tarray[1] = 0.; #else static long clk_tck = 0; struct tms buffer; if (! clk_tck) clk_tck = sysconf(_SC_CLK_TCK); (void) times(&buffer); tarray[0] = (float) buffer.tms_utime / (float)clk_tck; tarray[1] = (float) buffer.tms_stime / (float)clk_tck; #endif return (tarray[0]+tarray[1]); } #if defined(_MSC_VER) double ccp4_erfc( double x ) { double t,z,ans; z=fabs(x); t=1.0/(1.0+0.5*z); ans=t*exp(-z*z-1.26551223+t*(1.00002368+t*(0.37409196+t*(0.09678418+ t*(-0.18628806+t*(0.27886807+t*(-1.13520398+t*(1.48851587+ t*(-0.82215223+t*0.17087277))))))))); return x >= 0.0 ? ans : 2.0-ans; } #endif #if defined (__APPLE__) && defined (__GNUC__) && ( __GNUC__ < 3 ) void _carbon_init(int argc, char **argv) {} void _objcInit(void) {} #endif #if defined (__APPLE__) && defined (__GNUC__) && ( __GNUC__ == 3 ) && (__GNUC_MINOR__ == 1) float acosf(float x) { return (float) acos( (double) x); } float atanf(float x) { return (float) atan( (double) x); } float asinf(float x) { return (float) asin( (double) x); } #endif #if defined(_MSC_VER) && _MSC_VER < 1800 double rint(double x) { if (x >= 0.) { return (double)(int)(x+.5); } return (double)(int)(x-.5); } #endif libccp4-8.0.0/ccp4/mtzdata.h0000644000000000000000000002241314242731033013634 0ustar 00000000000000/* mtzdata.h: Definition of MTZ data structure. Copyright (C) 2001 CCLRC, Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file mtzdata.h * * @brief Definition of MTZ data structure. * * The file defines a hierarchy of structs which hold the * MTZ data structure. * * @author Martyn Winn */ #ifndef __CMTZData__ #define __CMTZData__ #define MTZVERSN "MTZ:V1.1" /**< traditional version number! */ #define MTZ_MAJOR_VERSN 1 /**< MTZ file major version - keep to single digit */ #define MTZ_MINOR_VERSN 1 /**< MTZ file minor version - keep to single digit */ #define CCP4_MTZDATA 20100630 /**< Date stamp for the cmtz data structure (update if there are changes to the structs in this file) */ /** defines for sizes in MTZ structure */ #define SIZE1 20 /**< size of pre-reflection block */ #define MTZRECORDLENGTH 80 /**< length of records */ #define MAXSPGNAMELENGTH 20 /**< max length of a spacegroup name */ #define MAXPGNAMELENGTH 10 /**< max length of a pointgroup name */ #define NBATCHWORDS 185 /**< total size of batch header buffer */ #define NBATCHINTEGERS 29 /**< size of integer section of batch header buffer */ #define NBATCHREALS 156 /**< size of float section of batch header buffer */ /* cctbx uses smaller values for these three */ #ifndef MXTALS #define MXTALS 100 /**< maximum number of crystals (for a few arrays - to be removed!) */ #endif #ifndef MSETS #define MSETS 1000 /**< maximum number of datasets (for a few arrays - to be removed!) */ #endif #ifndef MCOLUMNS #define MCOLUMNS 10000 /**< maximum number of columns (for a few arrays - to be removed!) */ #endif /** MTZ column struct. */ typedef struct { char label[31]; /**< column name as given by user */ char type[3]; /**< column type */ int active; /**< whether column in active list */ unsigned int source; /**< column index in input file */ float min; /**< minimum data element */ float max; /**< maximum data element */ float *ref; /**< data array */ char colsource[37]; /**< column source - originating job */ char grpname[31]; /**< column group name */ char grptype[5]; /**< column group type */ int grpposn; /**< column group position in group */ } MTZCOL; /** MTZ dataset struct. */ typedef struct { int setid; /**< Dataset id */ char dname[65]; /**< Dataset name */ float wavelength; /**< Dataset wavelength */ int ncol; /**< number of columns */ MTZCOL **col; /**< columns */ } MTZSET; /** MTZ crystal struct. */ typedef struct { int xtalid; /**< Crystal id */ char xname[65]; /**< Crystal name */ char pname[65]; /**< Project name */ float cell[6]; /**< Crystal cell */ float resmin; /**< Low resolution limit */ float resmax; /**< High resolution limit */ int nset; /**< number of datasets */ MTZSET **set; /**< datasets */ } MTZXTAL; /** MTZ batch struct. */ typedef struct bathead { int num; /**< batch number */ char title[71]; /**< batch title */ char gonlab[3][9]; /**< names of the three axes */ int iortyp; /**< type of orientation block (for possible future use, now = 0) */ int lbcell[6]; /**< refinement flags for cell */ int misflg; /**< number of phixyz used (0, 1, or 2) */ int jumpax; /**< reciprocal axis closest to rotation axis */ int ncryst; /**< crystal number */ int lcrflg; /**< mosaicity model: 0 = isotropic, 1 = anisotropic */ int ldtype; /**< type of data: 2D (1), 3D (2), or Laue (3) */ int jsaxs; /**< goniostat scan axis number */ int nbscal; /**< number of batch scales & Bfactors (0 if unset) */ int ngonax; /**< number of goniostat axes */ int lbmflg; /**< flag for type of beam info: = 0 for alambd, delamb = 1 also delcor, divhd, divvd */ int ndet; /**< number of detectors (current maximum 2) */ int nbsetid; /**< dataset id - should be pointer? */ float cell[6]; /**< cell dimensions */ float umat[9]; /**< orientation matrix U in Fortranic order, i.e. U(1,1), U(2,1) ... */ float phixyz[2][3]; /**< missetting angles at beginning and end of oscillation */ float crydat[12]; /**< mosaicity */ float datum[3]; /**< datum values of goniostat axes */ float phistt; /**< start of phi relative to datum */ float phiend; /**< end of phi relative to datum */ float scanax[3]; /**< rotation axis in lab frame */ float time1; /**< start time */ float time2; /**< stop time */ float bscale; /**< batch scale */ float bbfac; /**< batch temperature factor */ float sdbscale; /**< sd bscale */ float sdbfac; /**< sd bbfac */ float phirange; /**< phi range */ float e1[3]; /**< vector 1 ("Cambridge" laboratory axes) defining ngonax goniostat axes */ float e2[3]; /**< vector 2 ("Cambridge" laboratory axes) defining ngonax goniostat axes */ float e3[3]; /**< vector 3 ("Cambridge" laboratory axes) defining ngonax goniostat axes */ float source[3]; /**< idealised source vector */ float so[3]; /**< source vector */ float alambd; /**< wavelength (A) */ float delamb; /**< dispersion (deltalambda / lambda) */ float delcor; /**< correlated component */ float divhd; /**< horizontal beam divergence */ float divvd; /**< vertical beam divergence */ float dx[2]; /**< xtal to detector distance */ float theta[2]; /**< detector tilt angle */ float detlm[2][2][2]; /**< min & max values of detector coords (pixels) */ struct bathead *next; /**< next batch in list */ } MTZBAT; /** MTZ symmetry struct. */ typedef struct { int spcgrp; /**< spacegroup number */ char spcgrpname[MAXSPGNAMELENGTH+1]; /**< spacegroup name */ int nsym; /**< number of symmetry operations */ float sym[192][4][4]; /**< symmetry operations (translations in [*][3]) */ int nsymp; /**< number of primitive symmetry ops. */ char symtyp; /**< lattice type (P,A,B,C,I,F,R) */ char pgname[MAXPGNAMELENGTH+1]; /**< pointgroup name */ char spg_confidence; /**< L => Bravais lattice correct P => pointgroup correct E => spacegroup or enantiomorph S => spacegroup is correct X => flag not set */ } SYMGRP; typedef union { char amnf[4]; float fmnf; } MNF; /** Top level of MTZ struct. */ typedef struct { CCP4File *filein; /**< file for reading */ CCP4File *fileout; /**< file for writing */ char title[71]; /**< title of mtz structure */ char *hist; /**< history of mtz file */ int histlines; /**< number of lines in hist */ int nxtal; /**< number of crystals */ int ncol_read; /**< number of columns from file */ int nref; /**< total number of reflections */ int nref_filein; /**< number of reflections from input file */ int refs_in_memory; /**< whether reflections are held in memory */ int n_orig_bat; /**< original number of batches */ float resmax_out; /**< output file max res */ float resmin_out; /**< output file min res */ MNF mnf; /**< value of missing number flag */ SYMGRP mtzsymm; /**< symmetry information */ MTZXTAL **xtal; /**< crystals */ MTZBAT *batch; /**< first batch header */ MTZCOL *order[5]; /**< sort order */ char *xml; /**< xml data block */ char *unknown_headers;/**< unknown header data */ int n_unknown_headers;/**< unknown header data */ } MTZ; #endif libccp4-8.0.0/ccp4/overview.h0000644000000000000000000000713414242731033014041 0ustar 00000000000000/* overview.h: overview of CINCH - Crystallography IN C Headers Copyright (C) 2003 CCLRC, Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @mainpage CINCH - Crystallography IN C Headers * * @note I'm fed up of the uninspiring "new library" and here's * my first attempt at a funky name. Alternatives welcome! * * @verbatim @endverbatim * * @section aims Aims The CCP4 software suite is based around a library of routines which cover common tasks, such as file opening, parsing keyworded input, reading and writing of standard data formats, applying symmetry operations, etc. Programs in the suite call these routines which, as well as saving the programmer some effort, ensure that the varied programs in the suite have a similar look-and-feel.

Since 2002, there has been a major effort to re-write much of the CCP4 library into C/C++. The aims are:

  • To implement a better representation of the underlying data model. For example, Eugene Krissinel's MMDB library acts on a data structure which represents the various levels of structure of a protein model. The new MTZ library encapsulates the crystal/dataset hierarchy that is increasingly being used by programs.
  • To maintain support for existing programs. In particular, the existing Fortran APIs will be maintained, although they will now often be only wrappers to functions in the new library. It is hoped that many existing programs will be migrated to using the new library directly.
  • To provide support for scripting. It is possible to generate APIs for Python, Tcl and Perl automatically from the core C code. Thus, much of the standard CCP4 functionality wil be available to scripts used e.g. in ccp4i or the molecular graphics project.
This incremental approach, maintaining the existing suite while improving the underlying code, puts constraints on what is possible, but is considered more appropriate for a collaborative project like CCP4. * @section start This documentation

This documentation is generated automatically by Doxygen from comment sections in the code. It is therefore detailed and extensive. The library divides roughly into the following sections:

CMTZ library
See the @ref cmtz_page page for C/C++ programmers, and the @ref cmtz_f_page page for Fortran programmers.
CMAP library
See the @ref cmap_page page for C/C++ programmers, and the @ref cmap_f_page page for Fortran programmers.
MMDB library
See Eugene's documentation.
CSYM library
See the @ref csym_page page for C/C++ programmers, and the @ref csym_f_page page for Fortran programmers.
CCP4 utility library
See the @ref utilities_page page for C/C++ programmers.
Low level disk i/o
See the @ref diskio_f_page page for Fortran programmers.
*/ libccp4-8.0.0/ccp4/pack_c.c0000644000000000000000000013602714242731033013412 0ustar 00000000000000/* pack_c.c: (de)compress diffraction image files Copyright (C) 1995 Jan P Abrahams This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #include #include #include #include "pack_c.h" /* pack_c.c, version 2 (backwards compatible with earlier versions)... JPA, 26 June 1995 jpa@mrc-lmb.cam.ac.uk This file contains functions capable of compressing and decompressing images. It is especially suited for X-ray diffraction patterns, or other image formats in which orthogonal pixels contain "grey-levels" and vary smoothly accross the image. Clean images measured by a MAR-research image plate scanner containing two bytes per pixel can be compressed by a factor of 3.5 to 4.5 . Since the images are encoded in a byte-stream, there should be no problem concerening big- or little ended machines: both will produce an identical packed image. Compression is achieved by first calculating the differences between every pixel and the truncated value of four of its neighbours. For example: the difference for a pixel at img[x, y] is: img[x, y] - (int) (img[x-1, y-1] + img[x-1, y] + img[x-1, y+1] + img[x, y-1]) / 4 After calculating the differences, they are encoded in a packed array. A packed array consists of consequitive chunks which have the following format: - Three bits containing the logarithm base 2 of the number of pixels encoded in the chunk. - Three bits defining the number of bits used to encode one element of the chunk. The value of these three bits is used as index in a lookup table to get the actual number of bits of the elements of the chunk. Note: in version 2, there are four bits in this position!! This allows more efficient packing of synchrotron data! The routines in this sourcefile are backwards compatible. JPA, 26 June 1995 - The truncated pixel differences. To compress an image, call pack_wordimage_c() or pack_longimage_c(). These will append the packed image to any header information already written to disk (take care that the file containing this information is closed before calling). To decompress an image, call readpack_word_c() or readpack_long_c(). These functions will find the start of the packed image themselves, irrespective of the header format. In order to provide an interface to fortran programs, the functions pack_wordimage_f(), pack_longimage_f(), read_wordimage_f() and read_long_image_f() are provided. They are called by the fortran subroutines PACK_WORDIMAGE, PACK_LONGIMAGE, READPACK_WORD, and READPACK_LONG, which can be found in the accompanying sourcefile "pack_f.f". Jan Pieter Abrahams, 6 Jan 1993 */ /******************************************************************************/ /* Some fortran compilers require c-functions to end with an underscore. */ #if defined(_AIX) || defined (___AIX) || defined(__hpux) /* no underscore by default */ #else # if defined (VMS) || defined (vms) || defined (__vms) || defined (__VMS) || defined(_MSC_VER) # define pack_wordimage_f PACK_WORDIMAGE_F # define v2pack_wordimage_f V2PACK_WORDIMAGE_F # define pack_longimage_f PACK_LONGIMAGE_F # define v2pack_longimage_f V2PACK_LONGIMAGE_F # define readpack_word_f READPACK_WORD_F # define readpack_long_f READPACK_LONG_F # define mirror_wordimage MIRROR_WORDIMAGE # define mirror_longimage MIRROR_LONGIMAGE # define imsiz_f IMSIZ_F # else # define pack_wordimage_f pack_wordimage_f_ # define v2pack_wordimage_f v2pack_wordimage_f_ # define pack_longimage_f pack_longimage_f_ # define v2pack_longimage_f v2pack_longimage_f_ # define readpack_word_f readpack_word_f_ # define readpack_long_f readpack_long_f_ # define mirror_wordimage mirror_wordimage_ # define mirror_longimage mirror_longimage_ # define imsiz_f imsiz_f_ # endif #endif /******************************************************************************/ /* Prototypes of the functions in this sourcefile, as required by the ANSI standard. The pack_c.h file contains the functions other routines might call. Here are functions which will are not really usefull for image processing programmes, and which are used locally in this file. Also front-end fortran callable C-functions are not included in the pack_c.h file. */ #if defined (PROTOTYPE) /* Functions required for packing: */ void pack_wordimage_f(WORD *img, LONG *x, LONG *y, LONG *filename); /* Fortran frontend of pack_wordimage_c. Because the way in which fortran passes strings is not defined, it passes the filename in which the packed image should be stored as an array of LONGs. */ void v2pack_wordimage_f(WORD *img, LONG *x, LONG *y, LONG *filename); /* Fortran frontend of pack_wordimage_c. Because the way in which fortran passes strings is not defined, it passes the filename in which the packed image should be stored as an array of LONGs. This function generates Version 2 images! */ void pack_longimage_f(LONG *img, LONG *x, LONG *y, LONG *filename); /* Fortran frontend of pack_longimage_c. Because the way in which fortran passes strings is not defined, it passes the filename in which the packed image should be stored as an array of LONGs. */ void v2pack_longimage_f(LONG *img, LONG *x, LONG *y, LONG *filename); /* Fortran frontend of pack_longimage_c. Because the way in which fortran passes strings is not defined, it passes the filename in which the packed image should be stored as an array of LONGs. This function generates Version 2 images! */ void pack_wordimage_c(WORD *img, int x, int y, char *filename); /* Pack image 'img', containing 'x * y' WORD-sized pixels into 'filename'. Opens file and wraps pack_wordimage_copen() */ void pack_wordimage_copen(WORD *img, int x, int y, FILE *packfile); /* Pack image 'img', containing 'x * y' WORD-sized pixels into open file 'packfile'. */ void pack_longimage_c(LONG *img, int x, int y, char *filename); /* Pack image 'img', containing 'x * y' LONG-sized pixels into 'filename'. Opens file and wraps pack_long_image_copen()*/ void pack_longimage_copen(LONG *img, int x, int y, FILE *packfile); /* Pack image 'img', containing 'x * y' LONG-sized pixels into open file 'packfile'. */ LONG *diff_words(WORD *img, int x, int y, LONG *diffs, LONG done); /* Calculates the difference of WORD-sized pixels of an image with the truncated mean value of four of its neighbours. 'x' is the number of fast coordinates of the image 'img', 'y' is the number of slow coordinates, 'diffs' will contain the differences, 'done' defines the index of the pixel where calculating the differences should start. A pointer to the last difference is returned. Maximally DIFFBUFSIZ differences are returned in 'diffs'.*/ LONG *diff_longs(LONG *img, int x, int y, LONG *diffs, LONG done); /* Calculates the difference of LONG-sized pixels of an image with the truncated mean value of four of its neighbours. 'x' is the number of fast coordinates of the image 'img', 'y' is the number of slow coordinates, 'diffs' will contain the differences, 'done' defines the index of the pixel where calculating the differences should start. A pointer to the last difference is returned. Maximally DIFFBUFSIZ differences are returned in 'diffs'.*/ int bits(LONG *chunk, int n); /* Returns the number of bits neccesary to encode the longword-array 'chunk' of size 'n' The size in bits of one encoded element can be 0, 4, 5, 6, 7, 8, 16 or 32. */ int v2bits(LONG *chunk, int n); /* Returns the number of bits neccesary to encode the longword-array 'chunk' of size 'n' The size in bits of one encoded element can be 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 or 32. */ void pack_chunk(LONG *lng, int nmbr, int bitsize, FILE *file); /* Packs 'nmbr' LONGs starting at 'lng[0]' into a packed array of 'bitsize' sized elements. If the internal buffer in which the array is packed is full, it is flushed to 'file', making room for more of the packed array. If ('lng == NULL'), the buffer is flushed aswell. */ void v2pack_chunk(LONG *lng, int nmbr, int bitsize, FILE *file); /* Packs 'nmbr' LONGs starting at 'lng[0]' into a packed array of 'bitsize' sized elements. If the internal buffer in which the array is packed is full, it is flushed to 'file', making room for more of the packed array. If ('lng == NULL'), the buffer is flushed aswell. This is a new function included in version 2, but not existing in version 1! */ void pack_longs(LONG *lng, int n, BYTE **target, int *bit, int size); /* Pack 'n' WORDS, starting with 'lng[0]' into the packed array 'target'. The elements of such a packed array do not obey BYTE-boundaries, but are put one behind the other without any spacing. Only the 'bitsiz' number of least significant bits are used, the rest is truncated. The starting bit of 'target' is 'bit' (bits range from 0 to 7). After completion of 'pack_words()', both '**target' and '*bit' are updated and define the next position in 'target' from where packing could continue. */ /* Functions required for unpacking: */ void readpack_word_f(WORD *img, LONG *filename); /* Fortran frontend of readpack_word_c. Because the way in which fortran passes strings is not defined, it passes the filename in which the packed image should be stored as an array of LONGs. */ void readpack_long_f(LONG *img, LONG *filename); /* Fortran frontend of readpack_long_c. Because the way in which fortran passes strings is not defined, it passes the filename in which the packed image should be stored as an array of LONGs. */ void unpack_word(FILE *packfile, int x, int y, WORD *img); /* Unpacks a packed image into the WORD-array 'img'. The image is stored in 'packfile'. The file should be properly positioned: the first BYTE read is assumed to be the first BYTE of the packed image. */ void v2unpack_word(FILE *packfile, int x, int y, WORD *img); /* Unpacks a packed image into the WORD-array 'img'. The image is stored in 'packfile'. The file should be properly positioned: the first BYTE read is assumed to be the first BYTE of the packed image. This function reads Version 2 packed images! */ void unpack_long(FILE *packfile, int x, int y, LONG *img); /* Unpacks a packed image into the LONG-array 'img'. The image is stored in 'packfile'. The file should be properly positioned: the first BYTE read is assumed to be the first BYTE of the packed image. */ void v2unpack_long(FILE *packfile, int x, int y, LONG *img); /* Unpacks a packed image into the LONG-array 'img'. The image is stored in 'packfile'. The file should be properly positioned: the first BYTE read is assumed to be the first BYTE of the packed image. This function reads Version 2 packed images! */ /* Function required to convert a WORD-array into a char array, required for both compression and decompression if called from fortran. */ char *long_to_char(LONG *lng, char *string); /* Shrinks an array of LONGs into an array of chars, used in order to translate an encoded string array passed by fortran into a c-type string. Returns 'string'. */ void imsiz_f(LONG *filename, LONG *x, LONG *y); /* Fortran frontend of imsiz_c. Because the way in which fortran passes strings is not defined, it passes the filename in which the packed image should be stored as an array of LONGs. */ /* Some other usefull functions for manipulating images. */ void mirror_wordimg(WORD *img, LONG *x, LONG *y); /* Replaces img with its mirror by interchanging rows. '*x' is the fast index, '*y' is the slow index. */ void mirror_longimg(LONG *img, LONG *x, LONG *y); /* Replaces img with its mirror by interchanging rows. '*x' is the fast index, '*y' is the slow index. */ #endif /* (PROTOTYPE) */ /******************************************************************************/ #if defined (PROTOTYPE) void pack_wordimage_f(WORD *img, LONG *x, LONG *y, LONG *filename) #else void pack_wordimage_f(img, x, y, filename) WORD *img; LONG *x, *y, *filename; #endif /* Fortran frontend of pack_wordimage_c. Because the way in which fortran passes strings is not defined, it passes the filename in which the packed image should be stored as an array of LONGs. */ { char c_filename[1024]; #if !defined (PROTOTYPE) void pack_wordimage_c(); char *long_to_char(); #endif pack_wordimage_c(img, (LONG) *x, (LONG) *y, long_to_char(filename, c_filename));} /******************************************************************************/ #if defined (PROTOTYPE) void v2pack_wordimage_f(WORD *img, LONG *x, LONG *y, LONG *filename) #else void v2pack_wordimage_f(img, x, y, filename) WORD *img; LONG *x, *y, *filename; #endif /* Fortran frontend of pack_wordimage_c. Because the way in which fortran passes strings is not defined, it passes the filename in which the packed image should be stored as an array of LONGs. This function generates Version 2 images!*/ { char c_filename[1024]; #if !defined (PROTOTYPE) void v2pack_wordimage_c(); char *long_to_char(); #endif v2pack_wordimage_c(img, (LONG) *x, (LONG) *y, long_to_char(filename, c_filename));} /******************************************************************************/ #if defined (PROTOTYPE) void pack_longimage_f(LONG *img, LONG *x, LONG *y, LONG *filename) #else void pack_longimage_f(img, x, y, filename) LONG *img, *x, *y, *filename; #endif /* Fortran frontend of pack_longimage_c. Because the way in which fortran passes strings is not defined, it passes the filename in which the packed image should be stored as an array of LONGs. */ { char c_filename[1024]; #if !defined (PROTOTYPE) void pack_longimage_c(); char *long_to_char(); #endif pack_longimage_c(img, (LONG) *x, (LONG) *y, long_to_char(filename, c_filename));} /******************************************************************************/ #if defined (PROTOTYPE) void v2pack_longimage_f(LONG *img, LONG *x, LONG *y, LONG *filename) #else void v2pack_longimage_f(img, x, y, filename) LONG *img, *x, *y, *filename; #endif /* Fortran frontend of pack_longimage_c. Because the way in which fortran passes strings is not defined, it passes the filename in which the packed image should be stored as an array of LONGs. */ { char c_filename[1024]; #if !defined (PROTOTYPE) void v2pack_longimage_c(); char *long_to_char(); #endif v2pack_longimage_c(img, (LONG) *x, (LONG) *y, long_to_char(filename, c_filename));} /******************************************************************************/ #if defined (PROTOTYPE) void pack_wordimage_copen(WORD *img, int x, int y, FILE *packfile) #else void pack_wordimage_copen(img, x, y, packfile) WORD *img; int x, y; FILE *packfile; #endif /* Pack image 'img', containing 'x * y' WORD-sized pixels into 'filename'. */ { int chunksiz, packsiz, nbits, next_nbits, tot_nbits; LONG buffer[DIFFBUFSIZ]; LONG *diffs = buffer; LONG *end = diffs - 1; LONG done = 0; #if !defined (PROTOTYPE) LONG *diff_words(); int bits(); void pack_chunk(); #endif fprintf(packfile, PACKIDENTIFIER, x, y); while (done < (x * y)) { end = diff_words(img, x, y, buffer, done); done += (end - buffer) + 1; diffs = buffer; while (diffs <= end) { packsiz = 0; chunksiz = 1; nbits = bits(diffs, 1); while (packsiz == 0) { if (end <= (diffs + chunksiz * 2)) packsiz = chunksiz; else { next_nbits = bits(diffs + chunksiz, chunksiz); tot_nbits = 2 * max(nbits, next_nbits); if (tot_nbits >= (nbits + next_nbits + 6)) packsiz = chunksiz; else { nbits = tot_nbits; if (chunksiz == 64) packsiz = 128; else chunksiz *= 2;}}} pack_chunk(diffs, packsiz, nbits / packsiz, packfile); diffs += packsiz;}} pack_chunk(NULL, 0, 0, packfile); } #if defined (PROTOTYPE) void pack_wordimage_c(WORD *img, int x, int y, char *filename) #else void pack_wordimage_c(img, x, y, filename) WORD *img; int x, y; char *filename; #endif { FILE *packfile = fopen(filename, "a"); if (packfile == NULL) { fprintf(stderr,"The file %s cannot be created!\n ...giving up...\n", filename); exit(1); } else { pack_wordimage_copen(img, x, y, packfile); fclose(packfile); } } /******************************************************************************/ #if defined (PROTOTYPE) void v2pack_wordimage_c(WORD *img, int x, int y, char *filename) #else void v2pack_wordimage_c(img, x, y, filename) WORD *img; int x, y; char *filename; #endif /* Pack image 'img', containing 'x * y' WORD-sized pixels into 'filename'. */ { int chunksiz, packsiz, nbits, next_nbits, tot_nbits; LONG buffer[DIFFBUFSIZ]; LONG *diffs = buffer; LONG *end = diffs - 1; LONG done = 0; FILE *packfile; #if !defined (PROTOTYPE) LONG *diff_words(); int v2bits(); void v2pack_chunk(); #endif packfile = fopen(filename, "a"); if (packfile == NULL) { fprintf(stderr,"The file %s cannot be created!\n ...giving up...\n", filename); exit(1);} else { fprintf(packfile, V2IDENTIFIER, x, y); while (done < (x * y)) { end = diff_words(img, x, y, buffer, done); done += (end - buffer) + 1; diffs = buffer; while (diffs <= end) { packsiz = 0; chunksiz = 1; nbits = v2bits(diffs, 1); while (packsiz == 0) { if (end <= (diffs + chunksiz * 2)) packsiz = chunksiz; else { next_nbits = v2bits(diffs + chunksiz, chunksiz); tot_nbits = 2 * max(nbits, next_nbits); if (tot_nbits >= (nbits + next_nbits + 7)) packsiz = chunksiz; else { nbits = tot_nbits; if (chunksiz == 64) packsiz = 128; else chunksiz *= 2;}}} v2pack_chunk(diffs, packsiz, nbits / packsiz, packfile); diffs += packsiz;}} v2pack_chunk(NULL, 0, 0, packfile); fclose(packfile);}} /******************************************************************************/ #if defined (PROTOTYPE) void pack_longimage_copen(LONG *img, int x, int y, FILE *packfile) #else void pack_longimage_copen(img, x, y, packfile) LONG *img; int x, y; FILE *packfile; #endif /* Pack image 'img', containing 'x * y' LONG-sized pixels into 'filename'. */ { int chunksiz, packsiz, nbits, next_nbits, tot_nbits; LONG buffer[DIFFBUFSIZ]; LONG *diffs = buffer; LONG *end = diffs - 1; LONG done = 0; #if !defined (PROTOTYPE) LONG *diff_longs(); int bits(); void pack_chunk(); #endif fprintf(packfile, PACKIDENTIFIER, x, y); while (done < (x * y)) { end = diff_longs(img, x, y, buffer, done); done += (end - buffer) + 1; diffs = buffer; while (diffs <= end) { packsiz = 0; chunksiz = 1; nbits = bits(diffs, 1); while (packsiz == 0) { if (end <= (diffs + chunksiz * 2)) packsiz = chunksiz; else { next_nbits = bits(diffs + chunksiz, chunksiz); tot_nbits = 2 * max(nbits, next_nbits); if (tot_nbits >= (nbits + next_nbits + 6)) packsiz = chunksiz; else { nbits = tot_nbits; if (chunksiz == 64) packsiz = chunksiz * 2; else chunksiz *= 2;}}} pack_chunk(diffs, packsiz, nbits / packsiz, packfile); diffs += packsiz;}} pack_chunk(NULL, 0, 0, packfile); } #if defined (PROTOTYPE) void pack_longimage_c(LONG *img, int x, int y, char *filename) #else void pack_longimage_c(img, x, y, filename) LONG *img; int x, y; char *filename; #endif /* Pack image 'img', containing 'x * y' LONG-sized pixels into 'filename'. */ { FILE *packfile = fopen(filename, "a"); if (packfile == NULL) { fprintf(stderr,"The file %s cannot be created!\n ...giving up...\n", filename); exit(1);} else { pack_longimage_copen(img, x, y, packfile); fclose(packfile); } } /******************************************************************************/ #if defined (PROTOTYPE) void v2pack_longimage_c(LONG *img, int x, int y, char *filename) #else void v2pack_longimage_c(img, x, y, filename) LONG *img; int x, y; char *filename; #endif /* Pack image 'img', containing 'x * y' LONG-sized pixels into 'filename'. */ { int chunksiz, packsiz, nbits, next_nbits, tot_nbits; LONG buffer[DIFFBUFSIZ]; LONG *diffs = buffer; LONG *end = diffs - 1; LONG done = 0; FILE *packfile; #if !defined (PROTOTYPE) LONG *diff_longs(); int v2bits(); void v2pack_chunk(); #endif packfile = fopen(filename, "a"); if (packfile == NULL) { fprintf(stderr,"The file %s cannot be created!\n ...giving up...\n", filename); exit(1);} else { fprintf(packfile, V2IDENTIFIER, x, y); while (done < (x * y)) { end = diff_longs(img, x, y, buffer, done); done += (end - buffer) + 1; diffs = buffer; while (diffs <= end) { packsiz = 0; chunksiz = 1; nbits = v2bits(diffs, 1); while (packsiz == 0) { if (end <= (diffs + chunksiz * 2)) packsiz = chunksiz; else { next_nbits = v2bits(diffs + chunksiz, chunksiz); tot_nbits = 2 * max(nbits, next_nbits); if (tot_nbits >= (nbits + next_nbits + 7)) packsiz = chunksiz; else { nbits = tot_nbits; if (chunksiz == 64) packsiz = chunksiz * 2; else chunksiz *= 2;}}} v2pack_chunk(diffs, packsiz, nbits / packsiz, packfile); diffs += packsiz;}} v2pack_chunk(NULL, 0, 0, packfile); fclose(packfile);}} /******************************************************************************/ #if defined (PROTOTYPE) LONG *diff_words(WORD *word, int x, int y, LONG *diffs, LONG done) #else LONG *diff_words(word, x, y, diffs, done) WORD *word; int x, y; LONG *diffs, done; #endif /* Calculates the difference of WORD-sized pixels of an image with the truncated mean value of four of its neighbours. 'x' is the number of fast coordinates of the image 'img', 'y' is the number of slow coordinates, 'diffs' will contain the differences, 'done' defines the index of the pixel where calculating the differences should start. A pointer to the last difference is returned. Maximally DIFFBUFSIZ differences are returned in 'diffs'.*/ { LONG i = 0; LONG tot = x * y; if (done == 0) { *diffs = word[0]; ++diffs; ++done; ++i;} while ((done <= x) && (i < DIFFBUFSIZ)) { *diffs = word[done] - word[done - 1]; ++diffs; ++done; ++i;} while ((done < tot) && (i < DIFFBUFSIZ)) { *diffs = word[done] - (word[done - 1] + word[done - x + 1] + word[done - x] + word[done - x - 1] + 2) / 4; ++diffs; ++done; ++i;} return(--diffs);} /******************************************************************************/ #if defined (PROTOTYPE) LONG *diff_longs(LONG *lng, int x, int y, LONG *diffs, LONG done) #else LONG *diff_longs(lng, x, y, diffs, done) LONG *lng, *diffs, done; int x, y; #endif /* Calculates the difference of LONG-sized pixels of an image with the truncated mean value of four of its neighbours. 'x' is the number of fast coordinates of the image 'img', 'y' is the number of slow coordinates, 'diffs' will contain the differences, 'done' defines the index of the pixel where calculating the differences should start. A pointer to the last difference is returned. Maximally DIFFBUFSIZ differences are returned in 'diffs'.*/ { LONG i = 0, d; LONG tot = x * y; LONG huge = shift_left(1, 30); if (done == 0) { *diffs = min(max(-huge, lng[0]), huge); ++diffs; ++done; ++i;} while ((done <= x) && (i < DIFFBUFSIZ)) { d = lng[done] - lng[done - 1]; *diffs = min(max(-huge, d), huge); ++diffs; ++done; ++i;} while ((done < tot) && (i < DIFFBUFSIZ)) { d = lng[done] - (lng[done - 1] + lng[done - x + 1] + lng[done - x] + lng[done - x - 1] + 2) / 4; *diffs = min(max(-huge, d), huge); ++diffs; ++done; ++i;} return(--diffs);} /******************************************************************************/ #if defined (PROTOTYPE) int bits(LONG *chunk, int n) #else int bits(chunk, n) LONG *chunk; int n; #endif /* Returns the number of bits neccesary to encode the longword-array 'chunk' of size 'n' The size in bits of one encoded element can be 0, 4, 5, 6, 7, 8, 16 or 32. */ { int size, maxsize, i; for (i = 1, maxsize = abs(chunk[0]); i < n; ++i) maxsize = max(maxsize, abs(chunk[i])); if (maxsize == 0) size = 0; else if (maxsize < 8) size = 4 * n; else if (maxsize < 16) size = 5 * n; else if (maxsize < 32) size = 6 * n; else if (maxsize < 64) size = 7 * n; else if (maxsize < 128) size = 8 * n; else if (maxsize < 32768) size = 16 * n; else size = 32 * n; return(size);} /******************************************************************************/ #if defined (PROTOTYPE) int v2bits(LONG *chunk, int n) #else int v2bits(chunk, n) LONG *chunk; int n; #endif /* Returns the number of bits neccesary to encode the longword-array 'chunk' of size 'n' The size in bits of one encoded element can be 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 or 32. */ { int size, maxsize, i; for (i = 1, maxsize = abs(chunk[0]); i < n; ++i) maxsize = max(maxsize, abs(chunk[i])); if (maxsize == 0) size = 0; else if (maxsize < 4) size = 3 * n; else if (maxsize < 8) size = 4 * n; else if (maxsize < 16) size = 5 * n; else if (maxsize < 32) size = 6 * n; else if (maxsize < 64) size = 7 * n; else if (maxsize < 128) size = 8 * n; else if (maxsize < 256) size = 9 * n; else if (maxsize < 512) size = 10 * n; else if (maxsize < 1024) size = 11 * n; else if (maxsize < 2048) size = 12 * n; else if (maxsize < 4096) size = 13 * n; else if (maxsize < 8192) size = 14 * n; else if (maxsize < 16384) size = 15 * n; else if (maxsize < 32768) size = 16 * n; else size = 32 * n; return(size);} /******************************************************************************/ #if defined (PROTOTYPE) void pack_chunk(LONG *lng, int nmbr, int bitsize, FILE *packfile) #else void pack_chunk(lng, nmbr, bitsize, packfile) LONG *lng; int nmbr, bitsize; FILE *packfile; #endif /* Packs 'nmbr' LONGs starting at 'lng[0]' into a packed array of 'bitsize' sized elements. If the internal buffer in which the array is packed is full, it is flushed to 'file', making room for more of the packed array. If ('lng == NULL'), the buffer is flushed aswell. */ { static LONG bitsize_encode[33] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7}; LONG descriptor[2], i, j; static BYTE *buffer = NULL; static BYTE *buffree = NULL; static int bitmark; #if !defined (PROTOTYPE) void pack_longs(); #endif if (buffer == NULL) { buffree = buffer = (BYTE *) malloc(PACKBUFSIZ); bitmark = 0;} if (lng != NULL) { for (i = nmbr, j = 0; i > 1; i /= 2, ++j); descriptor[0] = j; descriptor[1] = bitsize_encode[bitsize]; if ((buffree - buffer) > (PACKBUFSIZ - (130 * 4))) { fwrite(buffer, sizeof(BYTE), buffree - buffer, packfile); buffer[0] = buffree[0]; buffree = buffer;} pack_longs(descriptor, 2, &buffree, &bitmark, 3); pack_longs(lng, nmbr, &buffree, &bitmark, bitsize);} else { int len=buffree-buffer; if (bitmark!=0) len++; fwrite(buffer, sizeof(BYTE), len, packfile); free((void *) buffer); buffer = NULL;}} /******************************************************************************/ #if defined (PROTOTYPE) void v2pack_chunk(LONG *lng, int nmbr, int bitsize, FILE *packfile) #else void v2pack_chunk(lng, nmbr, bitsize, packfile) LONG *lng; int nmbr, bitsize; FILE *packfile; #endif /* Packs 'nmbr' LONGs starting at 'lng[0]' into a packed array of 'bitsize' sized elements. If the internal buffer in which the array is packed is full, it is flushed to 'file', making room for more of the packed array. If ('lng == NULL'), the buffer is flushed aswell. This is a new function included in version 2, but not existing in version 1! */ { static LONG bitsize_encode[33] = {0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15}; LONG descriptor[2], i, j; static BYTE *buffer = NULL; static BYTE *buffree = NULL; static int bitmark; #if !defined (PROTOTYPE) void pack_longs(); #endif if (buffer == NULL) { buffree = buffer = (BYTE *) malloc(PACKBUFSIZ); bitmark = 0;} if (lng != NULL) { for (i = nmbr, j = 0; i > 1; i /= 2, ++j); descriptor[0] = j; descriptor[1] = bitsize_encode[bitsize]; if ((buffree - buffer) > (PACKBUFSIZ - (130 * 4))) { fwrite(buffer, sizeof(BYTE), buffree - buffer, packfile); buffer[0] = buffree[0]; buffree = buffer;} pack_longs(descriptor, 1, &buffree, &bitmark, 3); pack_longs(descriptor + 1, 1, &buffree, &bitmark, 4); pack_longs(lng, nmbr, &buffree, &bitmark, bitsize);} else { int len=buffree-buffer; if (bitmark!=0) len++; fwrite(buffer, sizeof(BYTE), len, packfile); free((void *) buffer); buffer = NULL;}} /******************************************************************************/ #if defined (PROTOTYPE) void pack_longs(LONG *lng, int n, BYTE **target, int *bit, int size) #else void pack_longs(lng, n, target, bit, size) LONG *lng; int n, *bit, size; BYTE **target; #endif /* Pack 'n' WORDS, starting with 'lng[0]' into the packed array 'target'. The elements of such a packed array do not obey BYTE-boundaries, but are put one behind the other without any spacing. Only the 'bitsiz' number of least significant bits are used. The starting bit of 'target' is 'bit' (bits range from 0 to 7). After completion of 'pack_words()', both '**target' and '*bit' are updated and define the next position in 'target' from which packing could continue. */ { LONG mask, window; int valids, i, temp; int temp_bit = *bit; BYTE *temp_target = *target; if (size > 0) { mask = setbits[size]; for (i = 0; i < n; ++i) { window = lng[i] & mask; valids = size; if (temp_bit == 0) *temp_target = (BYTE) window; else { temp = shift_left(window, temp_bit); *temp_target |= temp;} window = shift_right(window, 8 - temp_bit); valids = valids - (8 - temp_bit); if (valids < 0) temp_bit += size; else { while (valids > 0) { *++temp_target = (BYTE) window; window = shift_right(window, 8); valids -= 8;} temp_bit = 8 + valids;} if (valids == 0) { temp_bit = 0; ++temp_target;}} *target = temp_target; *bit = (*bit + (size * n)) % 8;}} /******************************************************************************/ #if defined (PROTOTYPE) void readpack_word_f(WORD *img, LONG *filename) #else void readpack_word_f(img, filename) WORD *img; LONG *filename; #endif /* Fortran frontend of readpack_word_c. Because the way in which fortran passes strings is not defined, it passes the filename in which the packed image should be stored as an array of LONGs. */ { char c_filename[1024]; #if !defined (PROTOTYPE) void readpack_word_c(); char *long_to_char(); #endif readpack_word_c(img, long_to_char(filename, c_filename));} /******************************************************************************/ #if defined (PROTOTYPE) void readpack_long_f(LONG *img, LONG *filename) #else void readpack_long_f(img, filename) LONG *img, *filename; #endif /* Fortran frontend of readpack_long_c. Because the way in which fortran passes strings is not defined, it passes the filename in which the packed image should be stored as an array of LONGs. */ { char c_filename[1024]; #if !defined (PROTOTYPE) void readpack_long_c(); char *long_to_char(); #endif readpack_long_c(img, long_to_char(filename, c_filename));} /******************************************************************************/ #if defined (PROTOTYPE) void readpack_word_c(WORD *img, char *filename) #else void readpack_word_c(img, filename) WORD *img; char *filename; #endif /* Unpacks packed image from 'filename' into the WORD-array 'img'. Scans the file defined by 'filename' until the PACKIDENTIFIER is found, then unpacks starting from there. */ { FILE *packfile; int x = 0, y = 0, i = 0, c = 0, version = 0; char header[BUFSIZ]; #if !defined (PROTOTYPE) void unpack_word(); void v2unpack_word(); #endif packfile = fopen(filename, "r"); if (packfile == NULL) printf("%s does not exist.\n", filename); else { header[0] = '\n'; header[1] = 0; while ((c != EOF) && ((x == 0) || (y == 0))) { c = i = x = y = 0; while ((++i < BUFSIZ) && (c != EOF) && (c != '\n') && (x==0) && (y==0)) if ((header[i] = c = getc(packfile)) == '\n') { if (sscanf(header, PACKIDENTIFIER, &x, &y) == 2) version = 1; else if (sscanf(header, V2IDENTIFIER, &x, &y) == 2) version = 2;}} if (version == 1) unpack_word(packfile, x, y, img); else if (version == 2) v2unpack_word(packfile, x, y, img); fclose(packfile);}} /******************************************************************************/ #if defined (PROTOTYPE) void readpack_long_c(LONG *img, char *filename) #else void readpack_long_c(img, filename) LONG *img; char *filename; #endif /* Unpacks packed image from 'filename' into the LONG-array 'img'. Scans the file defined by 'filename' until the PACKIDENTIFIER is found, then unpacks starting from there. */ { FILE *packfile; int x = 0, y = 0, i = 0, c = 0, version = 0; char header[BUFSIZ]; #if !defined (PROTOTYPE) void unpack_long(); void v2unpack_long(); #endif packfile = fopen(filename, "r"); if (packfile == NULL) printf("%s does not exist.", filename); else { header[0] = '\n'; header[1] = 0; while ((c != EOF) && ((x == 0) || (y == 0))) { c = i = x = y = 0; while ((++i < BUFSIZ) && (c != EOF) && (c != '\n') && (x==0) && (y==0)) if ((header[i] = c = getc(packfile)) == '\n') { if (sscanf(header, PACKIDENTIFIER, &x, &y) == 2) version = 1; else if (sscanf(header, V2IDENTIFIER, &x, &y) == 2) version = 2;}} if (version == 1) unpack_long(packfile, x, y, img); else if (version == 2) v2unpack_long(packfile, x, y, img); fclose(packfile);}} /******************************************************************************/ #if defined (PROTOTYPE) void unpack_word(FILE *packfile, int x, int y, WORD *img) #else void unpack_word(packfile, x, y, img) FILE *packfile; int x, y; WORD *img; #endif /* Unpacks a packed image into the WORD-array 'img'. The image is stored in 'packfile'. The file should be properly positioned: the first BYTE read is assumed to be the first BYTE of the packed image. */ { int valids = 0, spillbits = 0, usedbits, total = x * y; LONG window = 0L, spill = 0, pixel = 0, nextint, bitnum, pixnum; static int bitdecode[8] = {0, 4, 5, 6, 7, 8, 16, 32}; while (pixel < total) { if (valids < 6) { if (spillbits > 0) { window |= shift_left(spill, valids); valids += spillbits; spillbits = 0;} else { spill = (LONG) getc(packfile); spillbits = 8;}} else { pixnum = 1 << (window & setbits[3]); window = shift_right(window, 3); bitnum = bitdecode[window & setbits[3]]; window = shift_right(window, 3); valids -= 6; while ((pixnum > 0) && (pixel < total)) { if (valids < bitnum) { if (spillbits > 0) { window |= shift_left(spill, valids); if ((32 - valids) > spillbits) { valids += spillbits; spillbits = 0;} else { usedbits = 32 - valids; spill = shift_right(spill, usedbits); spillbits -= usedbits; valids = 32;}} else { spill = (LONG) getc(packfile); spillbits = 8;}} else { --pixnum; if (bitnum == 0) nextint = 0; else { nextint = window & setbits[bitnum]; valids -= bitnum; window = shift_right(window, bitnum); if ((nextint & (1 << (bitnum - 1))) != 0) nextint |= ~setbits[bitnum];} if (pixel > x) { img[pixel] = (WORD) (nextint + (img[pixel-1] + img[pixel-x+1] + img[pixel-x] + img[pixel-x-1] + 2) / 4); ++pixel;} else if (pixel != 0) { img[pixel] = (WORD) (img[pixel - 1] + nextint); ++pixel;} else img[pixel++] = (WORD) nextint;}}}}} /******************************************************************************/ #if defined (PROTOTYPE) void v2unpack_word(FILE *packfile, int x, int y, WORD *img) #else void v2unpack_word(packfile, x, y, img) FILE *packfile; int x, y; WORD *img; #endif /* Unpacks a packed image into the WORD-array 'img'. The image is stored in 'packfile'. The file should be properly positioned: the first BYTE read is assumed to be the first BYTE of the packed image. */ { int valids = 0, spillbits = 0, usedbits, total = x * y; LONG window = 0L, spill = 0, pixel = 0, nextint, bitnum, pixnum; static int bitdecode[16] = {0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 32}; while (pixel < total) { if (valids < 7) { if (spillbits > 0) { window |= shift_left(spill, valids); valids += spillbits; spillbits = 0;} else { spill = (LONG) getc(packfile); spillbits = 8;}} else { pixnum = 1 << (window & setbits[3]); window = shift_right(window, 3); bitnum = bitdecode[window & setbits[4]]; window = shift_right(window, 4); valids -= 7; while ((pixnum > 0) && (pixel < total)) { if (valids < bitnum) { if (spillbits > 0) { window |= shift_left(spill, valids); if ((32 - valids) > spillbits) { valids += spillbits; spillbits = 0;} else { usedbits = 32 - valids; spill = shift_right(spill, usedbits); spillbits -= usedbits; valids = 32;}} else { spill = (LONG) getc(packfile); spillbits = 8;}} else { --pixnum; if (bitnum == 0) nextint = 0; else { nextint = window & setbits[bitnum]; valids -= bitnum; window = shift_right(window, bitnum); if ((nextint & (1 << (bitnum - 1))) != 0) nextint |= ~setbits[bitnum];} if (pixel > x) { img[pixel] = (WORD) (nextint + (img[pixel-1] + img[pixel-x+1] + img[pixel-x] + img[pixel-x-1] + 2) / 4); ++pixel;} else if (pixel != 0) { img[pixel] = (WORD) (img[pixel - 1] + nextint); ++pixel;} else img[pixel++] = (WORD) nextint;}}}}} /******************************************************************************/ #if defined (PROTOTYPE) void unpack_long(FILE *packfile, int x, int y, LONG *img) #else void unpack_long(packfile, x, y, img) FILE *packfile; int x, y; LONG *img; #endif /* Unpacks a packed image into the LONG-array 'img'. The image is stored in 'packfile'. The file should be properly positioned: the first BYTE read is assumed to be the first BYTE of the packed image. */ { int valids = 0, spillbits = 0, usedbits, total = x * y; LONG window = 0L, spill = 0, pixel = 0, nextint, bitnum, pixnum; static int bitdecode[8] = {0, 4, 5, 6, 7, 8, 16, 32}; while (pixel < total) { if (valids < 6) { if (spillbits > 0) { window |= shift_left(spill, valids); valids += spillbits; spillbits = 0;} else { spill = (LONG) getc(packfile); spillbits = 8;}} else { pixnum = 1 << (window & setbits[3]); window = shift_right(window, 3); bitnum = bitdecode[window & setbits[3]]; window = shift_right(window, 3); valids -= 6; while ((pixnum > 0) && (pixel < total)) { if (valids < bitnum) { if (spillbits > 0) { window |= shift_left(spill, valids); if ((32 - valids) > spillbits) { valids += spillbits; spillbits = 0;} else { usedbits = 32 - valids; spill = shift_right(spill, usedbits); spillbits -= usedbits; valids = 32;}} else { spill = (LONG) getc(packfile); spillbits = 8;}} else { --pixnum; if (bitnum == 0) nextint = 0; else { nextint = window & setbits[bitnum]; valids -= bitnum; window = shift_right(window, bitnum); if ((nextint & (1 << (bitnum - 1))) != 0) nextint |= ~setbits[bitnum];} if (pixel > x) { img[pixel] = (LONG) (nextint + (img[pixel-1] + img[pixel-x+1] + img[pixel-x] + img[pixel-x-1] + 2) / 4); ++pixel;} else if (pixel != 0) { img[pixel] = (LONG) (img[pixel - 1] + nextint); ++pixel;} else img[pixel++] = (LONG) nextint;}}}}} /******************************************************************************/ #if defined (PROTOTYPE) void v2unpack_long(FILE *packfile, int x, int y, LONG *img) #else void v2unpack_long(packfile, x, y, img) FILE *packfile; int x, y; LONG *img; #endif /* Unpacks a packed image into the LONG-array 'img'. The image is stored in 'packfile'. The file should be properly positioned: the first BYTE read is assumed to be the first BYTE of the packed image. */ { int valids = 0, spillbits = 0, usedbits, total = x * y; LONG window = 0L, spill = 0, pixel = 0, nextint, bitnum, pixnum; static int bitdecode[16] = {0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 32}; while (pixel < total) { if (valids < 7) { if (spillbits > 0) { window |= shift_left(spill, valids); valids += spillbits; spillbits = 0;} else { spill = (LONG) getc(packfile); spillbits = 8;}} else { pixnum = 1 << (window & setbits[3]); window = shift_right(window, 3); bitnum = bitdecode[window & setbits[4]]; window = shift_right(window, 4); valids -= 7; while ((pixnum > 0) && (pixel < total)) { if (valids < bitnum) { if (spillbits > 0) { window |= shift_left(spill, valids); if ((32 - valids) > spillbits) { valids += spillbits; spillbits = 0;} else { usedbits = 32 - valids; spill = shift_right(spill, usedbits); spillbits -= usedbits; valids = 32;}} else { spill = (LONG) getc(packfile); spillbits = 8;}} else { --pixnum; if (bitnum == 0) nextint = 0; else { nextint = window & setbits[bitnum]; valids -= bitnum; window = shift_right(window, bitnum); if ((nextint & (1 << (bitnum - 1))) != 0) nextint |= ~setbits[bitnum];} if (pixel > x) { img[pixel] = (LONG) (nextint + (img[pixel-1] + img[pixel-x+1] + img[pixel-x] + img[pixel-x-1] + 2) / 4); ++pixel;} else if (pixel != 0) { img[pixel] = (LONG) (img[pixel - 1] + nextint); ++pixel;} else img[pixel++] = (LONG) nextint;}}}}} /******************************************************************************/ #if defined (PROTOTYPES) char *long_to_char(LONG *lng, char *string) #else char *long_to_char(lng, string) LONG *lng; char *string; #endif /* Shrinks an array of LONGs into an array of chars, used in order to translate an encoded string array passed by fortran into a c-type string. Returns 'string'. */ { char *s = string; do *(s++) = (char) *lng; while (*(lng++) != 0); return(string);} /******************************************************************************/ #if defined (PROTOTYPE) void imsiz_c(char *filename, LONG *x, LONG *y) #else void imsiz_c(filename, x, y) char *filename; LONG *x, *y; #endif /* Determines the size of the the packed image "filename" after unpacking. The dimensions are returned in x and y. */ { FILE *packfile; int i = 0, c = 0; char header[BUFSIZ]; packfile = fopen(filename, "r"); header[0] = '\n'; header[1] = 0; *x = *y = 0; if (packfile != NULL) { while ((c != EOF) && ((*x == 0) || (*y == 0))) { c = i = *x = *y = 0; while ((++i < BUFSIZ) && (c != EOF) && (c != '\n') && (*x==0) && (*y==0)) { if ((header[i] = c = getc(packfile)) == '\n') { if (sscanf(header, PACKIDENTIFIER, x, y) == 2) { /* version = 1; */ } else if (sscanf(header, V2IDENTIFIER, x, y) == 2) { /* version = 2; */ } } } } } fclose(packfile); } /******************************************************************************/ #if defined (PROTOTYPE) void imsiz_f(LONG *filename, LONG *x, LONG *y) #else void imsiz_f(filename, x, y) LONG *filename, *x, *y; #endif /* Fortran frontend of imsiz_c. Because the way in which fortran passes strings is not defined, it passes the filename in which the packed image should be stored as an array of LONGs. */ { char c_filename[1024]; #if !defined (PROTOTYPE) void imsiz_c(); char *long_to_char(); #endif imsiz_c(long_to_char(filename, c_filename), x, y);} /******************************************************************************/ #if defined (PROTOTYPE) void mirror_wordimg(WORD *img, LONG *x, LONG *y) #else void mirror_wordimg(img, x, y) WORD *img; LONG *x, *y; #endif /* Replaces img with its mirror by interchanging rows. 'x' is the fast index, 'y' is the slow index. */ { WORD *buff; int i, j; buff = (WORD *)malloc(sizeof(WORD) * *x); for (i = 0, j = *y - 1; i < j; ++i, --j) { memcpy(buff, img + (i * *x), sizeof(WORD) * *x); memcpy(img + (i * *x), img + (j * *x), sizeof(WORD) * *x); memcpy(img + (j * *x), buff, sizeof(WORD) * *x);} free((void *) buff);} /******************************************************************************/ #if defined (PROTOTYPE) void mirror_longimg(LONG *img, LONG *x, LONG *y) #else void mirror_longimg(img, x, y) LONG *img, *x, *y; #endif /* Replaces img with its mirror by interchanging rows. 'x' is the fast index, 'y' is the slow index. */ { LONG *buff; int i, j; buff = (LONG *)malloc(sizeof(LONG) * *x); for (i = 0, j = *y - 1; i < j; ++i, --j) { memcpy(buff, img + (i * *x), sizeof(LONG) * *x); memcpy(img + (i * *x), img + (j * *x), sizeof(LONG) * *x); memcpy(img + (j * *x), buff, sizeof(LONG) * *x);} free((void *) buff);} /******************************************************************************/ libccp4-8.0.0/ccp4/pack_c.h0000644000000000000000000001213614242731033013411 0ustar 00000000000000/* Some general defines: */ #define PACKIDENTIFIER "\nCCP4 packed image, X: %04d, Y: %04d\n" /* This string defines the start of a packed image. An image file is scanned until this string is encountered, the size of the unpacked image is determined from the values of X and Y (which are written out as formatted ascii numbers), and the packed image is expected to start immediately after the null-character ending the string. */ #define V2IDENTIFIER "\nCCP4 packed image V2, X: %04d, Y: %04d\n" /* This string defines the start of a packed image. An image file is scanned until this string is encountered, the size of the unpacked image is determined from the values of X and Y (which are written out as formatted ascii numbers), and the packed image is expected to start immediately after the null-character ending the string. */ #define PACKBUFSIZ BUFSIZ /* Size of internal buffer in which the packed array is stored during transit form an unpacked image to a packed image on disk. It is set to the size used by the buffered io-routines given in , but it could be anything. */ #define DIFFBUFSIZ 16384L /* Size of the internal buffer in which the differences between neighbouring pixels are stored prior to compression. The image is therefore compressed in DIFFBUFSIZ chunks. Decompression does not need to know what DIFFBUFSIZ was when the image was compressed. By increasing this value, the image can be compressed into a packed image which is a few bytes smaller. Do not decrease the value of DIFFBUFSIZ below 128L. */ #define BYTE char /* BYTE is a one byte integer. */ #define WORD short int /* WORD is a two-byte integer. */ #define LONG int /* LONG is a four byte integer. */ /* Dave Love 5/7/94: using `int' gets you 4 bytes on the 32-bit Unix (and VAX) systems I know of and also on (64-bit) OSF/1 Alphas which have 64-bit longs. (This definition previously used `long'.) */ /******************************************************************************/ /* Some usefull macros used in the code of this sourcefile: */ #define max(x, y) (((x) > (y)) ? (x) : (y)) /* Returns maximum of x and y. */ #define min(x, y) (((x) < (y)) ? (x) : (y)) /* Returns minimum of x and y. */ #undef abs /* avoid complaint from DEC C, at least */ #define abs(x) (((x) < 0) ? (-(x)) : (x)) /* Returns the absolute value of x. */ /* Used to be 'static const LONG' but const declaration gives trouble on HPs */ #ifndef SKIP_SETBITS static LONG setbits[33] = {0x00000000L, 0x00000001L, 0x00000003L, 0x00000007L, 0x0000000FL, 0x0000001FL, 0x0000003FL, 0x0000007FL, 0x000000FFL, 0x000001FFL, 0x000003FFL, 0x000007FFL, 0x00000FFFL, 0x00001FFFL, 0x00003FFFL, 0x00007FFFL, 0x0000FFFFL, 0x0001FFFFL, 0x0003FFFFL, 0x0007FFFFL, 0x000FFFFFL, 0x001FFFFFL, 0x003FFFFFL, 0x007FFFFFL, 0x00FFFFFFL, 0x01FFFFFFL, 0x03FFFFFFL, 0x07FFFFFFL, 0x0FFFFFFFL, 0x1FFFFFFFL, 0x3FFFFFFFL, 0x7FFFFFFFL, 0xFFFFFFFFL}; /* This is not a macro really, but I've included it here anyway. Upon indexing, it returns a LONG with the lower (index) number of bits set. It is equivalent to the following macro: #define setbits(n) (((n) == 32) : ((1L << (n)) - 1) : (-1L)) Indexing the const array should usually be slightly faster. */ #endif #define shift_left(x, n) (((x) & setbits[32 - (n)]) << (n)) /* This macro is included because the C standard does not properly define a left shift: on some machines the bits which are pushed out at the left are popped back in at the right. By masking, the macro prevents this behaviour. If you are sure that your machine does not pops bits back in, you can speed up the code insignificantly by taking out the masking. */ #define shift_right(x, n) (((x) >> (n)) & setbits[32 - (n)]) /* See comment on left shift. */ /******************************************************************************/ #if __STDC__ && !defined(PROTOTYPE) #define PROTOTYPE 1 #endif /* Functions required for packing: */ #if defined (PROTOTYPE) void v2pack_wordimage_c(WORD *img, int x, int y, char *filename); /* Pack image 'img', containing 'x * y' WORD-sized pixels into 'filename'. This function generates Version 2 images! */ void v2pack_longimage_c(LONG *img, int x, int y, char *filename); /* Pack image 'img', containing 'x * y' LONG-sized pixels into 'filename'. This function generates Version 2 images! */ /* Functions required for unpacking: */ void readpack_word_c(WORD *img, char *filename); /* Unpacks packed image from 'filename' into the WORD-array 'img'. Scans the file defined by 'filename' until the PACKIDENTIFIER is found, then unpacks starting from there. */ void readpack_long_c(LONG *img, char *filename); /* Unpacks packed image from 'filename' into the LONG-array 'img'. Scans the file defined by 'filename' until the PACKIDENTIFIER is found, then unpacks starting from there. */ void imsiz_c(char *filename, LONG *x, LONG *y); /* Determines the size of the the packed image "filename" after unpacking. The dimensions are returned in x and y. */ #endif /* (PROTOTYPE) */ libccp4-8.0.0/ccp4/vmslibrary.c0000644000000000000000000000622014242731033014353 0ustar 00000000000000/* vmslibrary.c Copyright (C) 1999 Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #include #include #include #include #include #include #include #include #include #define MAXFLEN 500 /* the maximum length of a filename in CCP4 */ /* prototype definitions */ void HGETLIMITS (int *IValueNotDet, float *ValueNotDet); static size_t flength (char *s, int len); void CMKDIR (struct dsc$descriptor_s *path, struct dsc$descriptor_s *cmode, int *result); void CCHMOD (struct dsc$descriptor_s *path, struct dsc$descriptor_s *cmode, int *result); void HGETLIMITS (int *IValueNotDet, float *ValueNotDet) { *IValueNotDet = INT_MAX; *ValueNotDet = FLT_MAX; } static size_t flength (char *s, int len) { while (s[--len] == ' '); return (++len); } /* Wrap-around for mkdir function. Returns 0 if successful, 1 if directory already exists, */ /* and -1 if other error. */ void CMKDIR (struct dsc$descriptor_s *path, struct dsc$descriptor_s *cmode, int *result) { size_t Length; char name[MAXFLEN]; mode_t mode; /* truncate path to MAXFLEN - 1 characters, MAXFLEN defined in library.h */ Length = flength (path->dsc$a_pointer, path->dsc$w_length); if (Length > (size_t) MAXFLEN) Length = (size_t) MAXFLEN - 1; (void) strncpy (name, path->dsc$a_pointer, Length); name[Length] = '\0'; /* Possible modes (see stat.h) Currently pass 3-character string and interpret as octal. Try also S_IRWXU, S_IRWXG, etc. */ sscanf(cmode->dsc$a_pointer,"%o",&mode); *result = mkdir(name,mode); if (*result == -1) { /* Distinguish directory-exists error from others, since usually not a problem. */ if (errno == EEXIST) { *result = 1; } } } void CCHMOD (struct dsc$descriptor_s *path, struct dsc$descriptor_s *cmode, int *result) { size_t Length; char name[MAXFLEN]; mode_t mode; /* truncate path to MAXFLEN - 1 characters, MAXFLEN defined in library.h */ Length = flength (path->dsc$a_pointer, path->dsc$w_length); if (Length > (size_t) MAXFLEN) Length = (size_t) MAXFLEN - 1; (void) strncpy (name, path->dsc$a_pointer, Length); name[Length] = '\0'; /* Possible modes (see stat.h) Currently pass 3-character string and interpret as octal. Try also S_IRWXU, S_IRWXG, etc. */ sscanf(cmode->dsc$a_pointer,"%o",&mode); *result = chmod(name,mode); } libccp4-8.0.0/ccp4/w32mvs.c0000644000000000000000000001731414242731033013330 0ustar 00000000000000/* w32mvs.c: functions required by MVS Copyright (C) 2003 Alun Ashton This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #ifdef _MSC_VER #include "w32mvs.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg = 0; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns EOF, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ int optind = 0; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Describe how to deal with options that follow non-option ARGV-elements. UNSPECIFIED means the caller did not specify anything; the default is then REQUIRE_ORDER if the environment variable _OPTIONS_FIRST is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options. Stop option processing when the first non-option is seen. This is what Unix does. PERMUTE is the default. We permute the contents of `argv' as we scan, so that eventually all the options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code zero. Using `-' as the first character of the list of option characters requests this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return EOF with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; static void exchange (char **argv) { int nonopts_size = (last_nonopt - first_nonopt) * sizeof (char *); char **temp = (char **) alloca (nonopts_size); /* Interchange the two blocks of data in argv. */ bcopy (&argv[first_nonopt], temp, nonopts_size); bcopy (&argv[last_nonopt], &argv[first_nonopt], (optind - last_nonopt) * sizeof (char *)); bcopy (temp, &argv[first_nonopt + optind - last_nonopt], nonopts_size); /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } int getopt (int argc,char **argv,char *optstring) { /* Initialize the internal data when the first call is made. Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ if (optind == 0) { first_nonopt = last_nonopt = optind = 1; nextchar = 0; /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') ordering = RETURN_IN_ORDER; else if (getenv ("_POSIX_OPTION_ORDER") != 0) ordering = REQUIRE_ORDER; else ordering = PERMUTE; } if (nextchar == 0 || *nextchar == 0) { if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange (argv); else if (last_nonopt != optind) first_nonopt = optind; /* Now skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && (argv[optind][0] != '-' || argv[optind][1] == 0)) optind++; last_nonopt = optind; } /* Special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange (argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return EOF; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (argv[optind][0] != '-' || argv[optind][1] == 0) { if (ordering == REQUIRE_ORDER) return EOF; optarg = argv[optind++]; return 0; } /* We have found another option-ARGV-element. Start decoding its characters. */ nextchar = argv[optind] + 1; } /* Look at and handle the next option-character. */ { char c = *nextchar++; char *temp = (char *) strchr (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == 0) optind++; if (temp == 0 || c == ':') { if (opterr != 0) { if (c < 040 || c >= 0177) fprintf (stderr, "%s: unrecognized option, character code 0%o\n", argv[0], c); else fprintf (stderr, "%s: unrecognized option `-%c'\n", argv[0], c); } return '?'; } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != 0) { optarg = nextchar; optind++; } else optarg = 0; nextchar = 0; } else { /* This is an option that requires an argument. */ if (*nextchar != 0) { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr != 0) fprintf (stderr, "%s: no argument for `-%c' option\n", argv[0], c); optarg = 0; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = 0; } } return c; } } #endif libccp4-8.0.0/ccp4/w32mvs.h0000644000000000000000000002222014242731033013325 0ustar 00000000000000/* w32mvs.h: function prototypes for w32mvs.c functions Copyright (C) 2003 Alun Ashton This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ #ifdef _MSC_VER #define WIN32_LEAN_AND_MEAN #include #include #include /* Getopt for GNU. Copyright (C) 1987 Free Software Foundation, Inc. NO WARRANTY BECAUSE THIS PROGRAM IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC, RICHARD M. STALLMAN AND/OR OTHER PARTIES PROVIDE THIS 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. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M. STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY WHO MAY MODIFY AND REDISTRIBUTE THIS PROGRAM AS PERMITTED BELOW, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) THIS PROGRAM, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY. GENERAL PUBLIC LICENSE TO COPY 1. You may copy and distribute verbatim copies of this source file as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy a valid copyright notice "Copyright (C) 1987 Free Software Foundation, Inc."; and include following the copyright notice a verbatim copy of the above disclaimer of warranty and of this License. You may charge a distribution fee for the physical act of transferring a copy. 2. You may modify your copy or copies of this source file or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains or is a derivative of this program or any part thereof, to be licensed at no charge to all third parties on terms identical to those contained in this License Agreement (except that you may choose to grant more extensive warranty protection to third parties, at your option). c) You may charge a distribution fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 3. You may copy and distribute this program or any portion of it in compiled, executable or object code form under the terms of Paragraphs 1 and 2 above provided that you do the following: a) cause each such copy to be accompanied by the corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) cause each such copy to be accompanied by a written offer, with no time limit, to give any third party free (except for a nominal shipping charge) a machine readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) in the case of a recipient of this program in compiled, executable or object code form (without the corresponding source code) you shall cause copies you distribute to be accompanied by a copy of the written offer of source code which you received along with the copy you received. 4. You may not copy, sublicense, distribute or transfer this program except as expressly provided under this License Agreement. Any attempt otherwise to copy, sublicense, distribute or transfer this program is void and your rights to use the program under this License agreement shall be automatically terminated. However, parties who have received computer software programs from you with this License Agreement will not have their licenses terminated so long as such parties remain in full compliance. 5. If you wish to incorporate parts of this program into other free programs whose distribution conditions are different, write to the Free Software Foundation at 675 Mass Ave, Cambridge, MA 02139. We have not yet worked out a simple rule that can be stated here, but we will often permit this. We 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. In other words, you are welcome to use, share and improve this program. You are forbidden to forbid anyone else to use, share and improve what you give them. Help stamp out software-hoarding! */ /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of `argv' so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable _POSIX_OPTION_ORDER disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include #include #include #define bcopy memmove /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ static void exchange (char **argv); /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of theoption characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns `EOF'. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. A colon in OPTSTRING means that the previous character is an option that wants an argument. The argument is taken from the rest of the current ARGV-element, or from the following ARGV-element, and returned in `optarg'. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg'. If OPTSTRING starts with `-', it requests a different method of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER, above. */ int getopt (int argc,char **argv,char *optstring); #endif libccp4-8.0.0/cmake/source.cmake0000644000000000000000000000561114242731033014551 0ustar 00000000000000set(ccp4c_SOURCES ${CMAKE_SOURCE_DIR}/ccp4/ccp4_array.c ${CMAKE_SOURCE_DIR}/ccp4/cmap_data.c ${CMAKE_SOURCE_DIR}/ccp4/cmtzlib.c ${CMAKE_SOURCE_DIR}/ccp4/ccp4_general.c ${CMAKE_SOURCE_DIR}/ccp4/cmap_header.c ${CMAKE_SOURCE_DIR}/ccp4/csymlib.c ${CMAKE_SOURCE_DIR}/ccp4/ccp4_parser.c ${CMAKE_SOURCE_DIR}/ccp4/cmap_labels.c ${CMAKE_SOURCE_DIR}/ccp4/cvecmat.c ${CMAKE_SOURCE_DIR}/ccp4/ccp4_program.c ${CMAKE_SOURCE_DIR}/ccp4/cmap_open.c ${CMAKE_SOURCE_DIR}/ccp4/library_err.c ${CMAKE_SOURCE_DIR}/ccp4/ccp4_unitcell.c ${CMAKE_SOURCE_DIR}/ccp4/cmap_skew.c ${CMAKE_SOURCE_DIR}/ccp4/library_file.c ${CMAKE_SOURCE_DIR}/ccp4/cmap_accessor.c ${CMAKE_SOURCE_DIR}/ccp4/cmap_stats.c ${CMAKE_SOURCE_DIR}/ccp4/library_utils.c ${CMAKE_SOURCE_DIR}/ccp4/cmap_close.c ${CMAKE_SOURCE_DIR}/ccp4/cmap_symop.c ${CMAKE_SOURCE_DIR}/ccp4/pack_c.c ) set(ccp4c_HEADERS ${CMAKE_SOURCE_DIR}/ccp4/ccp4_file_err.h ${CMAKE_SOURCE_DIR}/ccp4/ccp4_program.h ${CMAKE_SOURCE_DIR}/ccp4/ccp4_unitcell.h ${CMAKE_SOURCE_DIR}/ccp4/cmap_errno.h ${CMAKE_SOURCE_DIR}/ccp4/cmap_stats.h ${CMAKE_SOURCE_DIR}/ccp4/csymlib.h ${CMAKE_SOURCE_DIR}/ccp4/library_file.h ${CMAKE_SOURCE_DIR}/ccp4/w32mvs.h ${CMAKE_SOURCE_DIR}/ccp4/ccp4_fortran.h ${CMAKE_SOURCE_DIR}/ccp4/ccp4_spg.h ${CMAKE_SOURCE_DIR}/ccp4/ccp4_utils.h ${CMAKE_SOURCE_DIR}/ccp4/cmap_header.h ${CMAKE_SOURCE_DIR}/ccp4/cmaplib.h ${CMAKE_SOURCE_DIR}/ccp4/cvecmat.h ${CMAKE_SOURCE_DIR}/ccp4/mtzdata.h ${CMAKE_SOURCE_DIR}/ccp4/ccp4_array.h ${CMAKE_SOURCE_DIR}/ccp4/ccp4_general.h ${CMAKE_SOURCE_DIR}/ccp4/ccp4_vars.h ${CMAKE_SOURCE_DIR}/ccp4/cmap_labels.h ${CMAKE_SOURCE_DIR}/ccp4/cmaplib_f.h ${CMAKE_SOURCE_DIR}/ccp4/overview.h ${CMAKE_SOURCE_DIR}/ccp4/ccp4_errno.h ${CMAKE_SOURCE_DIR}/ccp4/ccp4_parser.h ${CMAKE_SOURCE_DIR}/ccp4/ccp4_types.h ${CMAKE_SOURCE_DIR}/ccp4/cmap_data.h ${CMAKE_SOURCE_DIR}/ccp4/cmap_skew.h ${CMAKE_SOURCE_DIR}/ccp4/cmtzlib.h ${CMAKE_SOURCE_DIR}/ccp4/pack_c.h ${CMAKE_SOURCE_DIR}/ccp4/ccp4_sysdep.h ) set(ccp4f_SOURCES ${CMAKE_SOURCE_DIR}/fortran/ccp4_diskio_f.c ${CMAKE_SOURCE_DIR}/fortran/ccp4_parser_f.c ${CMAKE_SOURCE_DIR}/fortran/cmaplib_f.c ${CMAKE_SOURCE_DIR}/fortran/csymlib_f.c ${CMAKE_SOURCE_DIR}/fortran/ccp4_general_f.c ${CMAKE_SOURCE_DIR}/fortran/ccp4_unitcell_f.c ${CMAKE_SOURCE_DIR}/fortran/cmtzlib_f.c ${CMAKE_SOURCE_DIR}/fortran/library_f.c ${CMAKE_SOURCE_DIR}/fortran/ccplib.f ${CMAKE_SOURCE_DIR}/fortran/fftlib.f ${CMAKE_SOURCE_DIR}/fortran/modlib.f ${CMAKE_SOURCE_DIR}/fortran/parser.f ${CMAKE_SOURCE_DIR}/fortran/rwbrook.f ${CMAKE_SOURCE_DIR}/fortran/libhtml.f ${CMAKE_SOURCE_DIR}/fortran/keyparse.f ${CMAKE_SOURCE_DIR}/fortran/dna_output.f ${CMAKE_SOURCE_DIR}/fortran/pack_f.f ${CMAKE_SOURCE_DIR}/fortran/pxxml.f ${CMAKE_SOURCE_DIR}/fortran/lgglib.f ${CMAKE_SOURCE_DIR}/fortran/plot84lib.f ${CMAKE_SOURCE_DIR}/fortran/plotsubs.f ${CMAKE_SOURCE_DIR}/fortran/sorting_main.f ${CMAKE_SOURCE_DIR}/fortran/dna_header.fh ) libccp4-8.0.0/data/README0000644000000000000000000000345114242731033012760 0ustar 00000000000000 * symop.lib: symmetry operators -- see symlib code. Contains symmetry operators for the 230 spacegroups listed in (and following the conventions of) the International Tables Vol A and non-standard settings used by various CCP4 programs. Each space group has a header line comprising space-separated values of: * SG number * number of lines of symmetry equivalents (`positions' in Int Tab) (N) * number of lines of primitive equivalents (P) * SG `short' name; subscripts are typed as-is and a prefix `-' represents an overbar e.g. P21/m, P-1 * point group name; the Int. Tab. name is prefixed by `PG'; contrary to the SG name, an overbar is represented by a trailing `bar' e.g. PG4bar3m * crystal system * possible comments about non-standard settings Following are N lines of symmetry equivalents, of which the first P are the primitive ones. * Layout: * The symmetry operator lines are limited to 80 characters * The elements of operator triplets are separated by commas, and triplets are separated by `*' or newline; the translations may be before or after the coordinate e.g. `1/2+X' or `X+1/2' * The header lines should start in the first column and the other lines be indented (for ease of locating the headers) * font84.ascii: Used directly by plot84lib.f. Previously: data for creating the binary plot84 font file in $CCP4/lib with fontpack. * atomsf.lib, atomsf_neutron.lib: formfactors for every known atom (for SFALL, MLPHARE, VECREF). The format of the atomsf.lib file is as follows. 1) atom type 2) atomic number, number of electrons, `c' constant for the scattering factor 3) a(1) ... a(4) 4) b(1) ... b(4) 5) f'(Cu) f"(Cu) f'(Mo) f"(Mo) See the sfall documentation for the equations containing the as, bs and c. libccp4-8.0.0/data/atomsf.lib0000644000000000000000000015021214242731033014057 0ustar 00000000000000AD - This file contains the following information: AD - BEWARE: This file has a FIXED FORMAT! AD This contains for each element: AD ID AD IWT IELEC C AD A(4) AD B(4) AD CU(2) MO(2) AD AD AD Formfactor: a1*exp(-b1*s*s) + a2*exp(-b2*s*s) + a3*exp(-b3*s*s) AD + a4*exp(-b4*s*s) + c AD This is applicable at CuKa wavelength. AD AD This is the 5 Gaussian approximation AD Ref: Int.Tab. vol 4 pp. 99-101 (Table 2.2B) for values a1-a4, b1-b4,c AD AD ID atom identifier AD IWT atomic weight AD IELEC number of electrons AD C coefficient for structure factor calculation AD A(4) coefficient for structure factor calculation AD B(4) coefficient for structure factor calculation AD CU(2) delta F' and delta F'' for Cu AD MO(2) delta F' and delta F'' for Mo AD Example: AD U+6 AD 92 86 13.166500 AD 34.850899 22.758400 14.009900 1.214570 AD 0.507079 2.890300 13.176700 25.201700 AD -5.359000 13.409000 -10.673000 9.653999 H 1 1 0.003038 0.493002 0.322912 0.140191 0.040810 10.510900 26.125700 3.142360 57.799698 0.000000 0.000000 0.000000 0.000000 D 1 1 0.003038 0.493002 0.322912 0.140191 0.040810 10.510900 26.125700 3.142360 57.799698 0.000000 0.000000 0.000000 0.000000 H-1 1 2 0.002389 0.897661 0.565616 0.415815 0.116973 53.136799 15.187000 186.575989 3.567090 0.000000 0.000000 0.000000 0.000000 He 2 2 0.006400 0.873400 0.630900 0.311200 0.178000 9.103700 3.356800 22.927601 0.982100 0.000000 0.000000 0.000000 0.000000 Li 3 3 0.037700 1.128200 0.750800 0.617500 0.465300 3.954600 1.052400 85.390503 168.261002 0.001000 0.000000 0.000000 0.000000 Li+1 3 2 0.016700 0.696800 0.788800 0.341400 0.156300 4.623700 1.955700 0.631600 10.095300 0.001000 0.000000 0.000000 0.000000 Be 4 4 0.038500 1.591900 1.127800 0.539100 0.702900 43.642700 1.862300 103.483002 0.542000 0.003000 0.001000 0.000000 0.000000 Be+2 4 2 -6.109200 6.260300 0.884900 0.799300 0.164700 0.002700 0.831300 2.275800 5.114600 0.003000 0.001000 0.000000 0.000000 B 5 5 -0.193200 2.054500 1.332600 1.097900 0.706800 23.218500 1.021000 60.349800 0.140300 0.008000 0.004000 0.000000 0.001000 C 6 6 0.215600 2.310000 1.020000 1.588600 0.865000 20.843899 10.207500 0.568700 51.651199 0.017000 0.009000 0.002000 0.002000 Cv 6 6 0.286977 2.260690 1.561650 1.050750 0.839259 22.690701 0.656665 9.756180 55.594898 0.017000 0.009000 0.002000 0.002000 N 7 7 -11.528999 12.212600 3.132200 2.012500 1.166300 0.005700 9.893300 28.997499 0.582600 0.029000 0.018000 0.004000 0.003000 O 8 8 0.250800 3.048500 2.286800 1.546300 0.867000 13.277100 5.701100 0.323900 32.908897 0.047000 0.032000 0.008000 0.006000 O-1 8 9 21.941200 4.191600 1.639690 1.526730 -20.306999 12.857300 4.172360 47.017899 -0.014040 0.047000 0.032000 0.008000 0.006000 F 9 9 0.277600 3.539200 2.641200 1.517000 1.024300 10.282499 4.294400 0.261500 26.147600 0.069000 0.053000 0.014000 0.010000 F-1 9 10 0.653396 3.632200 3.510570 1.260640 0.940706 5.277560 14.735300 0.442258 47.343700 0.069000 0.053000 0.014000 0.010000 Ne 10 10 0.351500 3.955300 3.112500 1.454600 1.125100 8.404200 3.426200 0.230600 21.718399 0.097000 0.083000 0.021000 0.016000 Na 11 11 0.676000 4.762600 3.173600 1.267400 1.112800 3.285000 8.842199 0.313600 129.423996 0.129000 0.124000 0.030000 0.025000 Na+1 11 10 0.404000 3.256500 3.936200 1.399800 1.003200 2.667100 6.115300 0.200100 14.039000 0.129000 0.124000 0.030000 0.025000 Mg 12 12 0.858400 5.420400 2.173500 1.226900 2.307300 2.827500 79.261101 0.380800 7.193700 0.165000 0.177000 0.042000 0.036000 Mg+2 12 10 0.485300 3.498800 3.837800 1.328400 0.849700 2.167600 4.754200 0.185000 10.141100 0.165000 0.177000 0.042000 0.036000 Al 13 13 1.115100 6.420200 1.900200 1.593600 1.964600 3.038700 0.742600 31.547199 85.088600 0.204000 0.246000 0.056000 0.052000 Al+3 13 10 0.706786 4.174480 3.387600 1.202960 0.528137 1.938160 4.145530 0.228753 8.285240 0.204000 0.246000 0.056000 0.052000 Si 14 14 1.140700 6.291500 3.035300 1.989100 1.541000 2.438600 32.333698 0.678500 81.693695 0.244000 0.330000 0.072000 0.071000 Siv 14 14 1.247070 5.662690 3.071640 2.624460 1.393200 2.665200 38.663399 0.916946 93.545799 0.244000 0.330000 0.072000 0.071000 Si+4 14 10 0.746297 4.439180 3.203450 1.194530 0.416530 1.641670 3.437570 0.214900 6.653650 0.244000 0.330000 0.072000 0.071000 P 15 15 1.114900 6.434500 4.179100 1.780000 1.490800 1.906700 27.157000 0.526000 68.164497 0.283000 0.434000 0.090000 0.095000 S 16 16 0.866900 6.905300 5.203400 1.437900 1.586300 1.467900 22.215099 0.253600 56.172001 0.319000 0.557000 0.110000 0.124000 Cl 17 17 -9.557400 11.460400 7.196400 6.255600 1.645500 0.010400 1.166200 18.519400 47.778400 0.348000 0.702000 0.132000 0.159000 Cl-1 17 18 -16.378000 18.291500 7.208400 6.533700 2.338600 0.006600 1.171700 19.542400 60.448601 0.348000 0.702000 0.132000 0.159000 Ar 18 18 1.444500 7.484500 6.772300 0.653900 1.644200 0.907200 14.840700 43.898300 33.392899 0.366000 0.872000 0.155000 0.201000 K 19 19 1.422800 8.218599 7.439800 1.051900 0.865900 12.794900 0.774800 213.186996 41.684097 0.365000 1.066000 0.179000 0.250000 K+1 19 18 -4.997800 7.957800 7.491700 6.359000 1.191500 12.633100 0.767400 -0.002000 31.912800 0.365000 1.066000 0.179000 0.250000 Ca 20 20 1.375100 8.626600 7.387300 1.589900 1.021100 10.442100 0.659900 85.748398 178.436996 0.341000 1.286000 0.203000 0.306000 Ca+2 20 18 -14.875000 15.634800 7.951800 8.437200 0.853700 -0.007400 0.608900 10.311600 25.990499 0.341000 1.286000 0.203000 0.306000 Sc 21 21 1.332900 9.189000 7.367900 1.640900 1.468000 9.021299 0.572900 136.108002 51.353100 0.285000 1.533000 0.226000 0.372000 Sc+3 21 18 -6.666700 13.400800 8.027300 1.659430 1.579360 0.298540 7.962900 -0.286040 16.066200 0.285000 1.533000 0.226000 0.372000 Ti 22 22 1.280700 9.759500 7.355800 1.699100 1.902100 7.850800 0.500000 35.633801 116.104996 0.189000 1.807000 0.248000 0.446000 Ti+2 22 20 0.897155 9.114230 7.621740 2.279300 0.087899 7.524300 0.457585 19.536100 61.655800 0.189000 1.807000 0.248000 0.446000 Ti+3 22 19 -14.652000 17.734400 8.738160 5.256910 1.921340 0.220610 7.047160 -0.157620 15.976800 0.189000 1.807000 0.248000 0.446000 Ti+4 22 18 -13.280000 19.511400 8.234730 2.013410 1.520800 0.178847 6.670180 -0.292630 12.946400 0.189000 1.807000 0.248000 0.446000 V 23 23 1.219900 10.297100 7.351100 2.070300 2.057100 6.865700 0.438500 26.893799 102.477997 0.035000 2.110000 0.267000 0.530000 V+2 23 21 1.229800 10.106000 7.354100 2.288400 0.022300 6.881800 0.440900 20.300400 115.122002 0.035000 2.110000 0.267000 0.530000 V+3 23 20 0.656565 9.431410 7.741900 2.153430 0.016865 6.395350 0.383349 15.190800 63.969002 0.035000 2.110000 0.267000 0.530000 V+5 23 18 1.714300 15.688700 8.142080 2.030810 -9.576000 0.679003 5.401350 9.972780 0.940464 0.035000 2.110000 0.267000 0.530000 Cr 24 24 1.183200 10.640600 7.353700 3.324000 1.492200 6.103800 0.392000 20.262600 98.739899 -0.198000 2.443000 0.284000 0.624000 Cr+2 24 22 0.616898 9.540340 7.750900 3.582740 0.509107 5.660780 0.344261 13.307500 32.422401 -0.198000 2.443000 0.284000 0.624000 Cr+3 24 21 0.518275 9.680900 7.811360 2.876030 0.113575 5.594630 0.334393 12.828800 32.876099 -0.198000 2.443000 0.284000 0.624000 Mn 25 25 1.089600 11.281900 7.357300 3.019300 2.244100 5.340900 0.343200 17.867399 83.754303 -0.568000 2.808000 0.295000 0.729000 Mn+2 25 23 1.087400 10.806100 7.362000 3.526800 0.218400 5.279600 0.343500 14.343000 41.323502 -0.568000 2.808000 0.295000 0.729000 Mn+3 25 22 0.393974 9.845210 7.871940 3.565310 0.323613 4.917970 0.294393 10.817100 24.128099 -0.568000 2.808000 0.295000 0.729000 Mn+4 25 21 0.251877 9.962530 7.970570 2.760670 0.054447 4.848500 0.283303 10.485200 27.573000 -0.568000 2.808000 0.295000 0.729000 Fe 26 26 1.036900 11.769500 7.357300 3.522200 2.304500 4.761100 0.307200 15.353500 76.880501 -1.179000 3.204000 0.301000 0.845000 Fe+2 26 24 1.009700 11.042400 7.374000 4.134600 0.439900 4.653800 0.305300 12.054600 31.280899 -1.179000 3.204000 0.301000 0.845000 Fe+3 26 23 0.970700 11.176400 7.386300 3.394800 0.072400 4.614700 0.300500 11.672900 38.556599 -1.179000 3.204000 0.301000 0.845000 Co 27 27 1.011800 12.284100 7.340900 4.003400 2.348800 4.279100 0.278400 13.535900 71.169197 -2.464000 3.608000 0.299000 0.973000 Co+2 27 25 0.932400 11.229600 7.388300 4.739300 0.710800 4.123100 0.272600 10.244300 25.646599 -2.464000 3.608000 0.299000 0.973000 Co+3 27 24 0.286667 10.337999 7.881730 4.767950 0.725591 3.909690 0.238668 8.355830 18.349100 -2.464000 3.608000 0.299000 0.973000 Ni 28 28 1.034100 12.837600 7.292000 4.443800 2.380000 3.878500 0.256500 12.176300 66.342102 -2.956000 0.509000 0.285000 1.113000 Ni+2 28 26 0.861400 11.416600 7.400500 5.344200 0.977300 3.676600 0.244900 8.873000 22.162600 -2.956000 0.509000 0.285000 1.113000 Ni+3 28 25 0.386044 10.780600 7.758680 5.227460 0.847114 3.547700 0.223140 7.644680 16.967300 -2.956000 0.509000 0.285000 1.113000 Cu 29 29 1.191000 13.337999 7.167600 5.615800 1.673500 3.582800 0.247000 11.396600 64.812599 -2.019000 0.589000 0.263000 1.266000 Cu+1 29 28 0.890000 11.947500 7.357300 6.245500 1.557800 3.366900 0.227400 8.662500 25.848700 -2.019000 0.589000 0.263000 1.266000 Cu+2 29 27 1.144310 11.816800 7.111810 5.781350 1.145230 3.374840 0.244078 7.987600 19.896999 -2.019000 0.589000 0.263000 1.266000 Zn 30 30 1.304100 14.074300 7.031800 5.165200 2.410000 3.265500 0.233300 10.316299 58.709702 -1.612000 0.678000 0.222000 1.431000 Zn+2 30 28 0.780700 11.971900 7.386200 6.466800 1.394000 2.994600 0.203100 7.082600 18.099499 -1.612000 0.678000 0.222000 1.431000 Ga 31 31 1.718900 15.235400 6.700600 4.359100 2.962300 3.066900 0.241200 10.780500 61.413498 -1.354000 0.777000 0.163000 1.609000 Ga+3 31 28 1.535450 12.691999 6.698830 6.066920 1.006600 2.812620 0.227890 6.364410 14.412200 -1.354000 0.777000 0.163000 1.609000 Ge 32 32 2.131300 16.081600 6.374700 3.706800 3.683000 2.850900 0.251600 11.446800 54.762501 -1.163000 0.886000 0.081000 1.801000 Ge+4 32 28 1.455720 12.917200 6.700030 6.067910 0.859041 2.537180 0.205855 5.479130 11.603000 -1.163000 0.886000 0.081000 1.801000 As 33 33 2.531000 16.672300 6.070100 3.431300 4.277900 2.634500 0.264700 12.947900 47.797199 -1.011000 1.006000 -0.030000 2.007000 Se 34 34 2.840900 17.000599 5.819600 3.973100 4.354300 2.409800 0.272600 15.237200 43.816299 -0.879000 1.139000 -0.178000 2.223000 Br 35 35 2.955700 17.178900 5.235800 5.637700 3.985100 2.172300 16.579599 0.260900 41.432800 -0.767000 1.283000 -0.374000 2.456000 Br-1 35 36 3.177600 17.171799 6.333800 5.575400 3.727200 2.205900 19.334499 0.287100 58.153500 -0.767000 1.283000 -0.374000 2.456000 Kr 36 36 2.825000 17.355499 6.728600 5.549300 3.537500 1.938400 16.562300 0.226100 39.397202 -0.665000 1.439000 -0.652000 2.713000 Rb 37 37 3.487300 17.178400 9.643499 5.139900 1.529200 1.788800 17.315100 0.274800 164.933990 -0.574000 1.608000 -1.044000 2.973000 Rb+1 37 36 2.078200 17.581600 7.659800 5.898100 2.781700 1.713900 14.795700 0.160300 31.208700 -0.574000 1.608000 -1.044000 2.973000 Sr 38 38 2.506400 17.566299 9.818399 5.422000 2.669400 1.556400 14.098800 0.166400 132.376007 -0.465000 1.820000 -1.657000 3.264000 Sr+2 38 36 41.402500 18.087400 8.137300 2.565400 -34.193001 1.490700 12.696300 24.565100 -0.013800 -0.465000 1.820000 -1.657000 3.264000 Y 39 39 1.912130 17.775999 10.294600 5.726290 3.265880 1.402900 12.800600 0.125599 104.353996 -0.386000 2.025000 -2.951000 3.542000 Y+3 39 36 40.260201 17.926800 9.153100 1.767950 -33.108002 1.354170 11.214500 22.659901 -0.013190 -0.386000 2.025000 -2.951000 3.542000 Zr 40 40 2.069290 17.876499 10.948000 5.417320 3.657210 1.276180 11.916000 0.117622 87.662697 -0.314000 2.245000 -2.965000 0.560000 Zr+4 40 36 9.414539 18.166800 10.056200 1.011180 -2.647900 1.214800 10.148300 21.605400 -0.102760 -0.314000 2.245000 -2.965000 0.560000 Nb 41 41 3.755910 17.614201 12.014400 4.041830 3.533460 1.188650 11.766000 0.204785 69.795700 -0.248000 2.482000 -2.197000 0.621000 Nb+3 41 38 -12.912000 19.881199 18.065300 11.017700 1.947150 0.019175 1.133050 10.162100 28.338900 -0.248000 2.482000 -2.197000 0.621000 Nb+5 41 36 -6.393400 17.916300 13.341700 10.799000 0.337905 1.124460 0.028781 9.282060 25.722799 -0.248000 2.482000 -2.197000 0.621000 Mo 42 42 4.387500 3.702500 17.235600 12.887600 3.742900 0.277200 1.095800 11.004000 61.658401 -0.191000 2.735000 -1.825000 0.688000 Mo+3 42 39 -14.421000 21.166401 18.201700 11.742300 2.309510 0.014734 1.030310 9.536590 26.630699 -0.191000 2.735000 -1.825000 0.688000 Mo+5 42 37 -14.316000 21.014900 18.099199 11.463200 0.740625 0.014345 1.022380 8.788090 23.345200 -0.191000 2.735000 -1.825000 0.688000 Mo+6 42 36 0.344941 17.887100 11.175000 6.578910 0.000000 1.036490 8.480610 0.058881 0.000000 -0.191000 2.735000 -1.825000 0.688000 Tc 43 43 5.404280 19.130100 11.094800 4.649010 2.712630 0.864132 8.144870 21.570700 86.847198 -0.145000 3.005000 -0.590000 0.759000 Ru 44 44 5.378740 19.267399 12.918200 4.863370 1.567560 0.808520 8.434669 24.799700 94.292801 -0.105000 3.296000 -1.420000 0.836000 Ru+3 44 41 -3.189200 18.563801 13.288500 9.326019 3.009640 0.847329 8.371640 0.017662 22.886999 -0.105000 3.296000 -1.420000 0.836000 Ru+4 44 40 1.423570 18.500299 13.178699 4.713040 2.185350 0.844582 8.125340 0.364950 20.850399 -0.105000 3.296000 -1.420000 0.836000 Rh 45 45 5.328000 19.295700 14.350100 4.734250 1.289180 0.751536 8.217580 25.874901 98.606201 -0.077000 3.605000 -1.287000 0.919000 Rh+3 45 42 11.867800 18.878500 14.125900 3.325150 -6.198900 0.764252 7.844380 21.248699 -0.010360 -0.077000 3.605000 -1.287000 0.919000 Rh+4 45 41 11.283500 18.854500 13.980600 2.534640 -5.652600 0.760825 7.624360 19.331699 -0.010200 -0.077000 3.605000 -1.287000 0.919000 Pd 46 46 5.265930 19.331900 15.501699 5.295370 0.605844 0.698655 7.989290 25.205200 76.898598 -0.059000 3.934000 -1.177000 1.007000 Pd+2 46 44 5.291600 19.170099 15.209600 4.322340 0.000000 0.696219 7.555730 22.505699 0.000000 -0.059000 3.934000 -1.177000 1.007000 Pd+4 46 42 13.017400 19.249300 14.790000 2.892890 -7.949200 0.683839 7.148330 17.914400 0.005127 -0.059000 3.934000 -1.177000 1.007000 Ag 47 47 5.179000 19.280800 16.688499 4.804500 1.046300 0.644600 7.472600 24.660500 99.815598 -0.060000 4.282000 -1.085000 1.101000 Ag+1 47 46 5.215720 19.181200 15.971900 5.274750 0.357534 0.646179 7.191230 21.732599 66.114700 -0.060000 4.282000 -1.085000 1.101000 Ag+2 47 45 5.214040 19.164299 16.245600 4.370900 0.000000 0.645643 7.185440 21.407200 0.000000 -0.060000 4.282000 -1.085000 1.101000 Cd 48 48 5.069400 19.221399 17.644400 4.461000 1.602900 0.594600 6.908900 24.700800 87.482498 -0.079000 4.653000 -1.005000 1.202000 Cd+2 48 46 5.119370 19.151400 17.253500 4.471280 0.000000 0.597922 6.806390 20.252100 0.000000 -0.079000 4.653000 -1.005000 1.202000 In 49 49 4.939100 19.162399 18.559601 4.294800 2.039600 0.547600 6.377600 25.849899 92.802902 -0.126000 5.045000 -0.936000 1.310000 In+3 49 46 4.996350 19.104500 18.110800 3.788970 0.000000 0.551522 6.324700 17.359501 0.000000 -0.126000 5.045000 -0.936000 1.310000 Sn 50 50 4.782100 19.188900 19.100500 4.458500 2.466300 5.830300 0.503100 26.890900 83.957100 -0.194000 5.459000 -0.873000 1.424000 Sn+2 50 48 4.786100 19.109400 19.054800 4.564800 0.487000 0.503600 5.837800 23.375200 62.206100 -0.194000 5.459000 -0.873000 1.424000 Sn+4 50 46 3.918200 18.933300 19.713100 3.418200 0.019300 5.764000 0.465500 14.004900 -0.758300 -0.194000 5.459000 -0.873000 1.424000 Sb 51 51 4.590900 19.641800 19.045500 5.037100 2.682700 5.303400 0.460700 27.907400 75.282501 -0.287000 5.894000 -0.816000 1.546000 Sb+3 51 48 4.696260 18.975500 18.932999 5.107890 0.288753 0.467196 5.221260 19.590200 55.511299 -0.287000 5.894000 -0.816000 1.546000 Sb+5 51 46 4.692630 19.868500 19.030199 2.412530 0.000000 5.448530 0.467973 14.125900 0.000000 -0.287000 5.894000 -0.816000 1.546000 Te 52 52 4.352000 19.964399 19.013800 6.144870 2.523900 4.817420 0.420885 28.528400 70.840302 -0.418000 6.352000 -0.772000 1.675000 I 53 53 4.071200 20.147200 18.994900 7.513800 2.273500 4.347000 0.381400 27.765999 66.877602 -0.579000 6.835000 -0.726000 1.812000 I-1 53 54 4.071400 20.233200 18.997000 7.806900 2.886800 4.357900 0.381500 29.525900 84.930397 -0.579000 6.835000 -0.726000 1.812000 Xe 54 54 3.711800 20.293301 19.029800 8.976700 1.990000 3.928200 0.344000 26.465900 64.265800 -0.783000 7.348000 -0.684000 1.958000 Cs 55 55 3.335200 20.389200 19.106199 10.662000 1.495300 3.569000 0.310700 24.387899 213.903992 -1.022000 7.904000 -0.644000 2.119000 Cs+1 55 54 3.279100 20.352400 19.127800 10.282100 0.961500 3.552000 0.308600 23.712799 59.456497 -1.022000 7.904000 -0.644000 2.119000 Ba 56 56 2.773100 20.336100 19.297001 10.888000 2.695900 3.216000 0.275600 20.207300 167.201996 -1.334000 8.460000 -0.613000 2.282000 Ba+2 56 54 3.029020 20.180700 19.113600 10.905399 0.776340 3.213670 0.283310 20.055799 51.745998 -1.334000 8.460000 -0.613000 2.282000 La 57 57 2.146780 20.577999 19.598999 11.372700 3.287190 2.948170 0.244475 18.772600 133.123993 -1.716000 9.035999 -0.588000 2.452000 La+3 57 54 2.408600 20.248899 19.376301 11.632299 0.336048 2.920700 0.250698 17.821100 54.945297 -1.716000 9.035999 -0.588000 2.452000 Ce 58 58 1.862640 21.167099 19.769501 11.851299 3.330490 2.812190 0.226836 17.608299 127.112999 -2.170000 9.648000 -0.564000 2.632000 Ce+3 58 55 2.090130 20.803600 19.559000 11.936900 0.612376 2.776910 0.231540 16.540800 43.169201 -2.170000 9.648000 -0.564000 2.632000 Ce+4 58 54 1.591800 20.323500 19.818600 12.123300 0.144583 2.659410 0.218850 15.799200 62.235500 -2.170000 9.648000 -0.564000 2.632000 Pr 59 59 2.058300 22.043999 19.669701 12.385600 2.824280 2.773930 0.222087 16.766899 143.643997 -2.939000 10.535000 -0.530000 2.845000 Pr+3 59 56 1.771320 21.372700 19.749100 12.132900 0.975180 2.645200 0.214299 15.323000 36.406502 -2.939000 10.535000 -0.530000 2.845000 Pr+4 59 55 1.242850 20.941299 20.053900 12.466800 0.296689 2.544670 0.202481 14.813700 45.464298 -2.939000 10.535000 -0.530000 2.845000 Nd 60 60 1.984860 22.684500 19.684700 12.774000 2.851370 2.662480 0.210628 15.885000 137.903000 -3.431000 10.933000 -0.535000 3.018000 Nd+3 60 57 1.475880 21.961000 19.933899 12.120000 1.510310 2.527220 0.199237 14.178300 30.871700 -3.431000 10.933000 -0.535000 3.018000 Pm 61 61 2.028760 23.340500 19.609501 13.123500 2.875160 2.562700 0.202088 15.100900 132.720993 -4.357000 11.614000 -0.530000 3.225000 Pm+3 61 58 1.194990 22.552700 20.110800 12.067100 2.074920 2.417400 0.185769 13.127500 27.449100 -4.357000 11.614000 -0.530000 3.225000 Sm 62 62 2.209630 24.004200 19.425800 13.439600 2.896040 2.472740 0.196451 14.399600 128.007004 -5.696000 12.320000 -0.533000 3.442000 Sm+3 62 59 0.954586 23.150400 20.259899 11.920200 2.714880 2.316410 0.174081 12.157100 24.824200 -5.696000 12.320000 -0.533000 3.442000 Eu 63 63 2.574500 24.627399 19.088600 13.760300 2.922700 2.387900 0.194200 13.754600 123.173996 -7.718000 11.276000 -0.542000 3.669000 Eu+2 63 61 1.363890 24.006300 19.950399 11.803400 3.872430 2.277830 0.173530 11.609600 26.515600 -7.718000 11.276000 -0.542000 3.669000 Eu+3 63 60 0.759344 23.749699 20.374500 11.850900 3.265030 2.222580 0.163940 11.311000 22.996599 -7.718000 11.276000 -0.542000 3.669000 Gd 64 64 2.419600 25.070900 19.079800 13.851800 3.545450 2.253410 0.181951 12.933100 101.397995 -9.242000 11.946000 -0.564000 3.904000 Gd+3 64 61 0.645089 24.346600 20.420799 11.870800 3.714900 2.135530 0.155525 10.578199 21.702900 -9.242000 11.946000 -0.564000 3.904000 Tb 65 65 3.582240 25.897600 18.218500 14.316700 2.953540 2.242560 0.196143 12.664800 115.362000 -9.498000 9.242000 -0.591000 4.151000 Tb+3 65 62 0.691967 24.955900 20.327099 12.247100 3.773000 2.056010 0.149525 10.049900 21.277300 -9.498000 9.242000 -0.591000 4.151000 Dy 66 66 4.297280 26.507000 17.638300 14.559600 2.965770 2.180200 0.202172 12.189899 111.874001 -10.423000 9.748000 -0.619000 4.410000 Dy+3 66 63 0.689690 25.539499 20.286100 11.981200 4.500730 1.980400 0.143384 9.349720 19.580999 -10.423000 9.748000 -0.619000 4.410000 Ho 67 67 4.567960 26.904900 17.293999 14.558300 3.638370 2.070510 0.197940 11.440700 92.656601 -12.255000 3.704000 -0.666000 4.678000 Ho+3 67 64 0.852795 26.129601 20.099400 11.978800 4.936760 1.910720 0.139358 8.800180 18.590799 -12.255000 3.704000 -0.666000 4.678000 Er 68 68 5.920460 27.656300 16.428499 14.977900 2.982330 2.073560 0.223545 11.360400 105.703003 -9.733000 3.937000 -0.723000 4.958000 Er+3 68 65 1.176130 26.722000 19.774799 12.150600 5.173790 1.846590 0.137290 8.362249 17.897400 -9.733000 3.937000 -0.723000 4.958000 Tm 69 69 6.756210 28.181900 15.885099 15.154200 2.987060 2.028590 0.238849 10.997499 102.960999 -8.488000 4.181000 -0.795000 5.248000 Tm+3 69 66 1.639290 27.308300 19.332001 12.333900 5.383480 1.787110 0.136974 7.967780 17.292200 -8.488000 4.181000 -0.795000 5.248000 Yb 70 70 7.566720 28.664101 15.434500 15.308700 2.989630 1.988900 0.257119 10.664700 100.417000 -7.701000 4.432000 -0.884000 5.548000 Yb+2 70 68 3.709830 28.120899 17.681700 13.333500 5.146570 1.785030 0.159970 8.183040 20.389999 -7.701000 4.432000 -0.884000 5.548000 Yb+3 70 67 2.260010 27.891700 18.761400 12.607200 5.476470 1.732720 0.138790 7.644120 16.815300 -7.701000 4.432000 -0.884000 5.548000 Lu 71 71 7.976280 28.947599 15.220800 15.100000 3.716010 1.901820 9.985189 0.261033 84.329803 -7.133000 4.693000 -0.988000 5.858000 Lu+3 71 68 2.975730 28.462799 18.121000 12.842899 5.594150 1.682160 0.142292 7.337270 16.353500 -7.133000 4.693000 -0.988000 5.858000 Hf 72 72 8.581540 29.143999 15.172600 14.758600 4.300130 1.832620 9.599899 0.275116 72.028999 -6.715000 4.977000 -1.118000 6.185000 Hf+4 72 68 2.396990 28.813099 18.460100 12.728500 5.599270 1.591360 0.128903 6.762320 14.036600 -6.715000 4.977000 -1.118000 6.185000 Ta 73 73 9.243540 29.202400 15.229300 14.513500 4.764920 1.773330 9.370460 0.295977 63.364399 -6.351000 5.271000 -1.258000 6.523000 Ta+5 73 68 1.785550 29.158699 18.840700 12.826799 5.386950 1.507110 0.116741 6.315240 12.424400 -6.351000 5.271000 -1.258000 6.523000 W 74 74 9.887500 29.081800 15.430000 14.432700 5.119820 1.720290 9.225900 0.321703 57.056000 -6.048000 5.577000 -1.421000 6.872000 W+6 74 68 1.010740 29.493599 19.376301 13.054399 5.064120 1.427550 0.104621 5.936670 11.197200 -6.048000 5.577000 -1.421000 6.872000 Re 75 75 10.472000 28.762100 15.718900 14.556400 5.441740 1.671910 9.092270 0.350500 52.086098 -5.790000 5.891000 -1.598000 7.232000 Os 76 76 11.000500 28.189400 16.154999 14.930500 5.675890 1.629030 8.979480 0.382661 48.164700 -5.581000 6.221000 -1.816000 7.605000 Os+4 76 72 6.498040 30.418999 15.263700 14.745800 5.067950 1.371130 6.847060 0.165191 18.003000 -5.581000 6.221000 -1.816000 7.605000 Ir 77 77 11.472200 27.304899 16.729599 15.611500 5.833770 1.592790 8.865530 0.417916 45.001099 -5.391000 6.566000 -2.066000 7.990000 Ir+3 77 74 8.279030 30.415600 15.862000 13.614500 5.820080 1.343230 7.109090 0.204633 20.325399 -5.391000 6.566000 -2.066000 7.990000 Ir+4 77 73 6.968240 30.705799 15.551200 14.232600 5.536720 1.309230 6.719830 0.167252 17.491100 -5.391000 6.566000 -2.066000 7.990000 Pt 78 78 11.688300 27.005899 17.763901 15.713100 5.783700 1.512930 8.811740 0.424593 38.610298 -5.233000 6.925000 -2.352000 8.388000 Pt+2 78 76 9.853290 29.842899 16.722401 13.215300 6.352340 1.329270 7.389790 0.263297 22.942600 -5.233000 6.925000 -2.352000 8.388000 Pt+4 78 74 7.395340 30.961201 15.982900 13.734800 5.920340 1.248130 6.608340 0.168640 16.939199 -5.233000 6.925000 -2.352000 8.388000 Au 79 79 12.065800 16.881901 18.591299 25.558201 5.860000 0.461100 8.621600 1.482600 36.395599 -5.096000 7.297000 -2.688000 8.798000 Au+1 79 78 11.229900 28.010899 17.820400 14.335899 6.580770 1.353210 7.739500 0.356752 26.404301 -5.096000 7.297000 -2.688000 8.798000 Au+3 79 76 9.096800 30.688599 16.902901 12.780100 6.523540 1.219900 6.828720 0.212867 18.659000 -5.096000 7.297000 -2.688000 8.798000 Hg 80 80 12.608900 20.680901 19.041700 21.657499 5.967600 0.545000 8.448400 1.572900 38.324600 -4.990000 7.686000 -3.084000 9.223000 Hg+1 80 79 12.020500 25.085300 18.497299 16.888300 6.482160 1.395070 7.651050 0.443378 28.226200 -4.990000 7.686000 -3.084000 9.223000 Hg+2 80 78 10.626800 29.564100 18.059999 12.837400 6.899120 1.211520 7.056390 0.284738 20.748199 -4.990000 7.686000 -3.084000 9.223000 Tl 81 81 13.174600 27.544600 19.158400 15.538000 5.525930 0.655150 8.707510 1.963470 45.814899 -4.883000 8.089000 -3.556000 9.659000 Tl+1 81 80 12.525800 21.398500 20.472300 18.747799 6.828470 1.471100 0.517394 7.434630 28.848200 -4.883000 8.089000 -3.556000 9.659000 Tl+3 81 78 9.802700 30.869499 18.384100 11.932800 7.005740 1.100800 6.538520 0.219074 17.211399 -4.883000 8.089000 -3.556000 9.659000 Pb 82 82 13.411800 31.061699 13.063700 18.441999 5.969600 0.690200 2.357600 8.618000 47.257900 -4.818000 8.505000 -4.133000 10.102000 Pb+2 82 80 12.473400 21.788601 19.568199 19.140600 7.011070 1.336600 0.488383 6.772700 23.813200 -4.818000 8.505000 -4.133000 10.102000 Pb+4 82 78 8.084280 32.124397 18.800301 12.017500 6.968860 1.005660 6.109260 0.147041 14.714000 -4.818000 8.505000 -4.133000 10.102000 Bi 83 83 13.578199 33.368900 12.951000 16.587700 6.469200 0.704000 2.923800 8.793700 48.009300 -4.776000 8.930000 -4.861000 10.559000 Bi+3 83 80 12.471100 21.805300 19.502600 19.105301 7.102950 1.235600 6.241490 0.469999 20.318501 -4.776000 8.930000 -4.861000 10.559000 Bi+5 83 78 -6.799400 33.536400 25.094601 19.249699 6.915550 0.916540 0.390420 5.714140 12.828500 -4.776000 8.930000 -4.861000 10.559000 Po 84 84 13.677000 34.672600 15.473300 13.113800 7.025880 0.700999 3.550780 9.556419 47.004501 -4.756000 9.382999 -5.924000 11.042000 At 85 85 13.710800 35.316299 19.021099 9.498870 7.425180 0.685870 3.974580 11.382400 45.471500 -4.772000 9.843000 -7.444000 9.961000 Rn 86 86 13.690500 35.563099 21.281601 8.003700 7.443300 0.663100 4.069100 14.042200 44.247299 -4.787000 10.316999 -8.862000 10.403000 Fr 87 87 13.724700 35.929901 23.054699 12.143900 2.112530 0.646453 4.176190 23.105200 150.644989 -4.833000 10.802999 -7.912000 7.754000 Ra 88 88 13.621099 35.763000 22.906399 12.473900 3.210970 0.616341 3.871350 19.988701 142.324997 -4.898000 11.296000 -7.620000 8.105000 Ra+2 88 86 13.543100 35.215000 21.670000 7.913420 7.650780 0.604909 3.576700 12.601000 29.843599 -4.898000 11.296000 -7.620000 8.105000 Ac 89 89 13.526600 35.659698 23.103199 12.597700 4.086550 0.589092 3.651550 18.598999 117.019997 -4.994000 11.799000 -7.725000 8.472000 Ac+3 89 86 13.463699 35.173599 22.111200 8.192160 7.055450 0.579689 3.414370 12.918700 25.944300 -4.994000 11.799000 -7.725000 8.472000 Th 90 90 13.431400 35.564499 23.421900 12.747300 4.807030 0.563359 3.462040 17.830900 99.172195 -5.091000 12.330000 -8.127000 8.870000 Th+4 90 86 13.375999 35.100700 22.441799 9.785540 5.294440 0.555054 3.244980 13.466100 23.953300 -5.091000 12.330000 -8.127000 8.870000 Pa 91 91 13.428699 35.884701 23.294800 14.189100 4.172870 0.547751 3.415190 16.923500 105.250999 -5.216000 12.868000 -8.960000 9.284000 U 92 92 13.396600 36.022800 23.412800 14.949100 4.188000 0.529300 3.325300 16.092699 100.612999 -5.359000 13.409000 -10.673000 9.653999 U+3 92 89 13.309200 35.574699 22.525900 12.216499 5.370730 0.520480 3.122930 12.714800 26.339399 -5.359000 13.409000 -10.673000 9.653999 U+4 92 88 13.267099 35.371498 22.532600 12.029100 4.798400 0.516598 3.050530 12.572300 23.458200 -5.359000 13.409000 -10.673000 9.653999 U+6 92 86 13.166500 34.850899 22.758400 14.009900 1.214570 0.507079 2.890300 13.176700 25.201700 -5.359000 13.409000 -10.673000 9.653999 Np 93 93 13.357300 36.187401 23.596399 15.640200 4.185500 0.511929 3.253960 15.362200 97.490799 -5.529000 13.967000 -11.158000 4.148000 Np+3 93 90 13.254400 35.707397 22.612999 12.989799 5.432270 0.502322 3.038070 12.144899 25.492800 -5.529000 13.967000 -11.158000 4.148000 Np+4 93 89 13.211599 35.510300 22.578699 12.776600 4.921590 0.498626 2.966270 11.948400 22.750200 -5.529000 13.967000 -11.158000 4.148000 Np+6 93 87 13.113000 35.013599 22.728600 14.388400 1.756690 0.489810 2.810990 12.330000 22.658100 -5.529000 13.967000 -11.158000 4.148000 Pu 94 94 13.381200 36.525398 23.808300 16.770700 3.479470 0.499384 3.263710 14.945499 105.979996 -5.712000 14.535999 -9.725000 4.330000 Pu+3 94 91 13.199100 35.840000 22.716900 13.580700 5.660160 0.484936 2.961180 11.533100 24.399200 -5.712000 14.535999 -9.725000 4.330000 Pu+4 94 90 13.155500 35.649300 22.646000 13.359500 5.188310 0.481422 2.890200 11.316000 21.830099 -5.712000 14.535999 -9.725000 4.330000 Pu+6 94 88 13.058200 35.173599 22.718100 14.763500 2.286780 0.473204 2.738480 11.552999 20.930300 -5.712000 14.535999 -9.725000 4.330000 Am 95 95 13.359200 36.670601 24.099199 17.341499 3.493310 0.483629 3.206470 14.313600 102.272995 -5.930000 15.087000 -8.926000 4.511000 Cm 96 96 13.288700 36.648800 24.409599 17.399000 4.216650 0.465154 3.089970 13.434600 88.483398 -6.176000 15.634000 -8.416000 4.697000 Bk 97 97 13.275400 36.788101 24.773600 17.891899 4.232840 0.451018 3.046190 12.894600 86.002998 -6.498000 16.316999 -7.990000 4.908000 Cf 98 98 13.267400 36.918499 25.199499 18.331699 4.243910 0.437533 3.007750 12.404400 83.788101 -6.798000 16.930000 -7.683000 5.107000 H 2 1 1 0.000000 0.793200 0.194900 0.000000 0.000000 24.215700 2.108900 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 C 2 6 6 0.000000 2.997200 2.979100 0.000000 0.000000 30.016701 2.888600 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 N 2 7 7 0.000000 2.992400 3.998600 0.000000 0.000000 25.376600 3.500400 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 O 2 8 8 0.000000 2.448500 5.558900 0.000000 0.000000 24.756199 4.137200 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 S 2 16 16 0.000000 5.548000 10.424100 0.000000 0.000000 33.710800 1.903400 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ano 2 1 1 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 1.000000 libccp4-8.0.0/data/atomsf_electron.lib0000644000000000000000000006471314242731033015764 0ustar 00000000000000AD - This file contains the following information: AD - BEWARE: This file has a FIXED FORMAT! AD This contains for each element: AD ID AD IWT IELEC C AD A(5) AD B(5) AD CU(2) MO(2) AD AD AD Formfactor: a1*exp(-b1*s*s) + a2*exp(-b2*s*s) + a3*exp(-b3*s*s) AD + a4*exp(-b4*s*s) + a5*exp(-b4*s*s) AD AD This is the 5 Gaussian approximation AD Ref: Int.Tab. vol C pp. 282-283 (Table 4.3.2.2) for values a1-a5, b1-b5 AD AD ID atom identifier AD IWT atomic weight AD IELEC number of electrons AD C it is 0 AD A(5) coefficient for structure factor calculation AD B(5) coefficient for structure factor calculation AD CU(2) these are 0-s AD MO(2) these are 0-s H 1 1 0.000000 0.034900 0.120100 0.197000 0.057300 0.119500 0.534700 3.586700 12.347100 18.952499 38.626900 0.000000 0.000000 0.000000 0.000000 He 2 2 0.000000 0.031700 0.083800 0.152600 0.133400 0.016400 0.250700 1.475100 4.493800 12.664600 31.165300 0.000000 0.000000 0.000000 0.000000 Li 3 3 0.000000 0.075000 0.224900 0.554800 1.495400 0.935400 0.386400 2.938300 15.382900 53.554501 138.733704 0.000000 0.000000 0.000000 0.000000 Be 4 4 0.000000 0.078000 0.221000 0.674000 1.386700 0.692500 0.313100 2.238100 10.151700 30.906099 78.327301 0.000000 0.000000 0.000000 0.000000 B 5 5 0.000000 0.090900 0.255100 0.773800 1.213600 0.460600 0.299500 2.115500 8.381600 24.129200 63.131401 0.000000 0.000000 0.000000 0.000000 C 6 6 0.000000 0.089300 0.256300 0.757000 1.048700 0.357500 0.246500 1.710000 6.409400 18.611300 50.252300 0.000000 0.000000 0.000000 0.000000 N 7 7 0.000000 0.102200 0.321900 0.798200 0.819700 0.171500 0.245100 1.748100 6.192500 17.389400 48.143101 0.000000 0.000000 0.000000 0.000000 O 8 8 0.000000 0.097400 0.292100 0.691000 0.699000 0.203900 0.206700 1.381500 4.694300 12.710500 32.472599 0.000000 0.000000 0.000000 0.000000 F 9 9 0.000000 0.108300 0.317500 0.648700 0.584600 0.142100 0.205700 1.343900 4.278800 11.393200 28.788099 0.000000 0.000000 0.000000 0.000000 Ne 10 10 0.000000 0.126900 0.353500 0.558200 0.467400 0.146000 0.220000 1.377900 4.020300 9.493400 23.127800 0.000000 0.000000 0.000000 0.000000 Na 11 11 0.000000 0.214200 0.685300 0.769200 1.658900 1.448200 0.333400 2.344600 10.083000 48.303699 138.270004 0.000000 0.000000 0.000000 0.000000 Mg 12 12 0.000000 0.231400 0.686600 0.967700 2.188200 1.133900 0.327800 2.272000 10.924100 39.289799 101.974800 0.000000 0.000000 0.000000 0.000000 Al 13 13 0.000000 0.239000 0.657300 1.201100 2.558600 1.231200 0.313800 2.106300 10.416300 34.455200 98.534401 0.000000 0.000000 0.000000 0.000000 Si 14 14 0.000000 0.251900 0.637200 1.379500 2.508200 1.050000 0.307500 2.017400 9.674600 29.374399 80.473198 0.000000 0.000000 0.000000 0.000000 P 15 15 0.000000 0.254800 0.610600 1.454100 2.320400 0.847700 0.290800 1.874000 8.517600 24.343399 63.299599 0.000000 0.000000 0.000000 0.000000 S 16 16 0.000000 0.249700 0.562800 1.389900 2.186500 0.771500 0.268100 1.671100 7.026700 19.537701 50.388802 0.000000 0.000000 0.000000 0.000000 Cl 17 17 0.000000 0.244300 0.539700 1.391900 2.019700 0.662100 0.246800 1.524200 6.153700 16.668699 42.308601 0.000000 0.000000 0.000000 0.000000 Ar 18 18 0.000000 0.238500 0.501700 1.342800 1.889900 0.607900 0.228900 1.369400 5.256100 14.092800 35.536098 0.000000 0.000000 0.000000 0.000000 K 19 19 0.000000 0.411500 1.403100 2.278400 2.674200 2.216200 0.370300 3.387400 13.102900 68.959198 194.432907 0.000000 0.000000 0.000000 0.000000 Ca 20 20 0.000000 0.405400 1.388000 2.160200 3.753200 2.206300 0.349900 3.099100 11.960800 53.935299 142.389206 0.000000 0.000000 0.000000 0.000000 Sc 21 21 0.000000 0.378700 1.218100 2.059400 3.261800 2.387000 0.313300 2.585600 9.581300 41.768799 116.728203 0.000000 0.000000 0.000000 0.000000 Ti 22 22 0.000000 0.382500 1.259800 2.000800 3.061700 2.069400 0.304000 2.486300 9.278300 39.075100 109.458298 0.000000 0.000000 0.000000 0.000000 V 23 23 0.000000 0.387600 1.275000 1.910900 2.831400 1.897900 0.296700 2.378000 8.798100 35.952801 101.720100 0.000000 0.000000 0.000000 0.000000 Cr 24 24 0.000000 0.404600 1.369600 1.894100 2.080000 1.219600 0.298600 2.395800 9.140600 37.470100 113.712097 0.000000 0.000000 0.000000 0.000000 Mn 25 25 0.000000 0.379600 1.209400 1.781500 2.542000 1.593700 0.269900 2.045500 7.472600 31.060400 91.562202 0.000000 0.000000 0.000000 0.000000 Fe 26 26 0.000000 0.394600 1.272500 1.703100 2.314000 1.479500 0.271700 2.044300 7.600700 29.971399 86.226501 0.000000 0.000000 0.000000 0.000000 Co 27 27 0.000000 0.411800 1.316100 1.649300 2.193000 1.283000 0.274200 2.037200 7.720500 29.968000 84.938301 0.000000 0.000000 0.000000 0.000000 Ni 28 28 0.000000 0.386000 1.176500 1.545100 2.073000 1.381400 0.247800 1.766000 6.310700 25.220400 74.314598 0.000000 0.000000 0.000000 0.000000 Cu 29 29 0.000000 0.431400 1.320800 1.523600 1.467100 0.856200 0.269400 1.922300 7.347400 28.989201 90.624603 0.000000 0.000000 0.000000 0.000000 Zn 30 30 0.000000 0.428800 1.264600 1.447200 1.829400 1.093400 0.259300 1.799800 6.750000 25.586000 73.528397 0.000000 0.000000 0.000000 0.000000 Ga 31 31 0.000000 0.481800 1.403200 1.656100 2.460500 1.105400 0.282500 1.978500 8.754600 32.523800 98.552299 0.000000 0.000000 0.000000 0.000000 Ge 32 32 0.000000 0.465500 1.301400 1.608800 2.699800 1.300300 0.264700 1.792600 7.607100 26.554100 77.523804 0.000000 0.000000 0.000000 0.000000 As 33 33 0.000000 0.451700 1.222900 1.585200 2.795800 1.263800 0.249300 1.643600 6.815400 22.368099 62.039001 0.000000 0.000000 0.000000 0.000000 Se 34 34 0.000000 0.447700 1.167800 1.584300 2.808700 1.195600 0.240500 1.544200 6.323100 19.461000 52.023300 0.000000 0.000000 0.000000 0.000000 Br 35 35 0.000000 0.479800 1.194800 1.869500 2.695300 0.820300 0.250400 1.596300 6.965300 19.849199 50.323299 0.000000 0.000000 0.000000 0.000000 Kr 36 36 0.000000 0.454600 1.099300 1.769600 2.706800 0.867200 0.230900 1.427900 5.944900 16.675200 42.224300 0.000000 0.000000 0.000000 0.000000 Rb 37 37 0.000000 1.016000 2.852800 3.546600 -7.780400 12.114800 0.485300 5.092500 25.785101 130.451508 138.677505 0.000000 0.000000 0.000000 0.000000 Sr 38 38 0.000000 0.670300 1.492600 3.336800 4.460000 3.150100 0.319000 2.228700 10.350400 52.329102 151.221603 0.000000 0.000000 0.000000 0.000000 Y 39 39 0.000000 0.689400 1.547400 3.245000 4.212600 2.976400 0.318900 2.290400 10.006200 44.077099 125.012001 0.000000 0.000000 0.000000 0.000000 Zr 40 40 0.000000 0.671900 1.468400 3.166800 3.955700 2.892000 0.303600 2.124900 8.923600 36.845798 108.204903 0.000000 0.000000 0.000000 0.000000 Nb 41 41 0.000000 0.612300 1.267700 3.034800 3.384100 2.368300 0.270900 1.768300 7.248900 27.946501 98.562401 0.000000 0.000000 0.000000 0.000000 Mo 42 42 0.000000 0.677300 1.479800 3.178800 3.082400 1.838400 0.292000 2.060600 8.112900 30.533600 100.065804 0.000000 0.000000 0.000000 0.000000 Tc 43 43 0.000000 0.708200 1.639200 3.199300 3.432700 1.871100 0.297600 2.210600 8.524600 33.145599 96.637703 0.000000 0.000000 0.000000 0.000000 Ru 44 44 0.000000 0.673500 1.493400 3.096600 2.725400 1.559700 0.277300 1.971600 7.324900 26.689100 90.558098 0.000000 0.000000 0.000000 0.000000 Rh 45 45 0.000000 0.641300 1.369000 2.985400 2.695200 1.543300 0.258000 1.772100 6.385400 23.254900 85.151703 0.000000 0.000000 0.000000 0.000000 Pd 46 46 0.000000 0.590400 1.177500 2.651900 2.287500 0.868900 0.232400 1.501900 5.159100 15.542800 46.821301 0.000000 0.000000 0.000000 0.000000 Ag 47 47 0.000000 0.637700 1.379000 2.829400 2.363100 1.455300 0.246600 1.697400 5.765600 20.094299 76.737198 0.000000 0.000000 0.000000 0.000000 Cd 48 48 0.000000 0.636400 1.424700 2.780200 2.597300 1.788600 0.240700 1.682300 5.658800 20.721901 69.110901 0.000000 0.000000 0.000000 0.000000 In 49 49 0.000000 0.676800 1.658900 2.774000 3.183500 2.132600 0.252200 1.854500 6.293600 25.145700 84.544800 0.000000 0.000000 0.000000 0.000000 Sn 50 50 0.000000 0.722400 1.961000 2.716100 3.560300 1.897200 0.265100 2.060400 7.301100 27.549299 81.334900 0.000000 0.000000 0.000000 0.000000 Sb 51 51 0.000000 0.710600 1.924700 2.614900 3.832200 1.889900 0.256200 1.964600 6.885200 24.764799 68.916801 0.000000 0.000000 0.000000 0.000000 Te 52 52 0.000000 0.694700 1.869000 2.535600 4.001300 1.895500 0.245900 1.854200 6.441100 22.173000 59.220600 0.000000 0.000000 0.000000 0.000000 I 53 53 0.000000 0.704700 1.948400 2.594000 4.152600 1.505700 0.245500 1.863800 6.763900 21.800699 56.439499 0.000000 0.000000 0.000000 0.000000 Xe 54 54 0.000000 0.673700 1.790800 2.412900 4.210000 1.705800 0.230500 1.689000 5.821800 18.392799 47.249599 0.000000 0.000000 0.000000 0.000000 Cs 55 55 0.000000 1.270400 3.801800 5.661800 0.920500 4.810500 0.435600 4.205800 23.434200 136.778305 171.756104 0.000000 0.000000 0.000000 0.000000 Ba 56 56 0.000000 0.904900 2.607600 4.849800 5.160300 4.738800 0.306600 2.436300 12.182100 54.613499 161.997803 0.000000 0.000000 0.000000 0.000000 La 57 57 0.000000 0.840500 2.386300 4.613900 5.151400 4.794900 0.279100 2.141000 10.340000 41.914799 132.020401 0.000000 0.000000 0.000000 0.000000 Ce 58 58 0.000000 0.855100 2.391500 4.577200 5.027800 4.511800 0.280500 2.120000 10.180800 42.063301 130.989304 0.000000 0.000000 0.000000 0.000000 Pr 59 59 0.000000 0.909600 2.531300 4.526600 4.637600 4.369000 0.293900 2.247100 10.826600 48.884201 147.602005 0.000000 0.000000 0.000000 0.000000 Nd 60 60 0.000000 0.880700 2.418300 4.444800 4.685800 4.172500 0.280200 2.083600 10.035700 47.450600 146.997604 0.000000 0.000000 0.000000 0.000000 Pm 61 61 0.000000 0.947100 2.546300 4.352300 4.478900 3.908000 0.297700 2.227600 10.576200 49.361900 145.358002 0.000000 0.000000 0.000000 0.000000 Sm 62 62 0.000000 0.969900 2.583700 4.277800 4.457500 3.598500 0.300300 2.244700 10.648700 50.799400 146.417892 0.000000 0.000000 0.000000 0.000000 Eu 63 63 0.000000 0.869400 2.241300 3.919600 3.969400 4.549800 0.265300 1.859000 8.399800 36.739700 125.708900 0.000000 0.000000 0.000000 0.000000 Gd 64 64 0.000000 0.967300 2.470200 4.114800 4.497200 3.209900 0.290900 2.101400 9.706700 43.426998 125.947403 0.000000 0.000000 0.000000 0.000000 Tb 65 65 0.000000 0.932500 2.367300 3.879100 3.967400 3.799600 0.276100 1.951100 8.929600 41.593700 131.012207 0.000000 0.000000 0.000000 0.000000 Dy 66 66 0.000000 0.950500 2.370500 3.821800 4.047100 3.445100 0.277300 1.946900 8.886200 43.093800 133.139603 0.000000 0.000000 0.000000 0.000000 Ho 67 67 0.000000 0.924800 2.242800 3.618200 3.791000 3.791200 0.266000 1.818300 7.965500 33.112900 101.813904 0.000000 0.000000 0.000000 0.000000 Er 68 68 0.000000 1.037300 2.482400 3.655800 3.892500 3.005600 0.294400 2.079700 9.415600 45.805599 132.772003 0.000000 0.000000 0.000000 0.000000 Tm 69 69 0.000000 1.007500 2.378700 3.544000 3.693200 3.175900 0.281600 1.948600 8.716200 41.841999 125.031998 0.000000 0.000000 0.000000 0.000000 Yb 70 70 0.000000 1.034700 2.391100 3.461900 3.655600 3.005200 0.285500 1.967900 8.761900 42.330399 125.649902 0.000000 0.000000 0.000000 0.000000 Lu 71 71 0.000000 0.992700 2.243600 3.355400 3.781300 3.099400 0.270100 1.807300 7.811200 34.484901 103.352600 0.000000 0.000000 0.000000 0.000000 Hf 72 72 0.000000 1.029500 2.291100 3.411000 3.949700 2.492500 0.276100 1.862500 8.096100 34.271198 98.529503 0.000000 0.000000 0.000000 0.000000 Ta 73 73 0.000000 1.019000 2.229100 3.409700 3.925200 2.267900 0.269400 1.796200 7.694400 31.094200 91.108902 0.000000 0.000000 0.000000 0.000000 W 74 74 0.000000 0.985300 2.116700 3.357000 3.798100 2.279800 0.256900 1.674500 7.009800 26.923401 81.390999 0.000000 0.000000 0.000000 0.000000 Re 75 75 0.000000 0.991400 2.085800 3.453100 3.881200 1.852600 0.254800 1.651800 6.884500 26.723400 81.721497 0.000000 0.000000 0.000000 0.000000 Os 76 76 0.000000 0.981300 2.032200 3.366500 3.623500 1.974100 0.248700 1.597300 6.473700 23.281700 70.925400 0.000000 0.000000 0.000000 0.000000 Ir 77 77 0.000000 1.019400 2.064500 3.442500 3.491400 1.697600 0.255400 1.647500 6.596600 23.226900 70.027199 0.000000 0.000000 0.000000 0.000000 Pt 78 78 0.000000 0.914800 1.809600 3.213400 3.295300 1.575400 0.226300 1.381300 5.324300 17.598700 60.017101 0.000000 0.000000 0.000000 0.000000 Au 79 79 0.000000 0.967400 1.891600 3.399300 3.052400 1.260700 0.235800 1.471200 5.675800 18.711901 61.528599 0.000000 0.000000 0.000000 0.000000 Hg 80 80 0.000000 1.003300 1.946900 3.439600 3.154800 1.418000 0.241300 1.529800 5.800900 19.452000 60.575298 0.000000 0.000000 0.000000 0.000000 Tl 81 81 0.000000 1.068900 2.103800 3.603900 3.492700 1.828300 0.254000 1.671500 6.350900 23.153099 78.709900 0.000000 0.000000 0.000000 0.000000 Pb 82 82 0.000000 1.089100 2.186700 3.616000 3.803100 1.899400 0.255200 1.717400 6.513100 23.917000 74.703903 0.000000 0.000000 0.000000 0.000000 Bi 83 83 0.000000 1.100700 2.230600 3.568900 4.154900 2.038200 0.254600 1.735100 6.494800 23.646400 70.377998 0.000000 0.000000 0.000000 0.000000 Po 84 84 0.000000 1.156800 2.435300 3.645900 4.406400 1.717900 0.264800 1.878600 7.174900 25.176600 69.282097 0.000000 0.000000 0.000000 0.000000 At 85 85 0.000000 1.090900 2.197600 3.383100 4.670000 2.127700 0.246600 1.670700 6.019700 20.765699 57.266300 0.000000 0.000000 0.000000 0.000000 Rn 86 86 0.000000 1.075600 2.163000 3.317800 4.885200 2.048900 0.240200 1.616900 5.764400 19.456800 52.500900 0.000000 0.000000 0.000000 0.000000 Fr 87 87 0.000000 1.428200 3.508100 5.676700 4.196400 3.894600 0.318300 2.688900 13.481600 54.386600 200.832108 0.000000 0.000000 0.000000 0.000000 Ra 88 88 0.000000 1.312700 3.124300 5.298800 5.389100 5.413300 0.288700 2.289700 10.827600 43.538898 145.610901 0.000000 0.000000 0.000000 0.000000 Ac 89 89 0.000000 1.312800 3.102100 5.338500 5.961100 4.756200 0.286100 2.250900 10.528700 41.779598 128.297302 0.000000 0.000000 0.000000 0.000000 Th 90 90 0.000000 1.255300 2.917800 5.086200 6.120600 4.712200 0.270100 2.063600 9.305100 34.597698 107.919998 0.000000 0.000000 0.000000 0.000000 Pa 91 91 0.000000 1.321800 3.144400 5.437100 5.644400 4.010700 0.282700 2.225000 10.245400 41.116199 124.444901 0.000000 0.000000 0.000000 0.000000 U 92 92 0.000000 1.338200 3.204300 5.455800 5.483900 3.634200 0.283800 2.245200 10.251900 41.725101 124.902298 0.000000 0.000000 0.000000 0.000000 Np 93 93 0.000000 1.519300 4.005300 6.532700 -0.140200 6.748900 0.321300 2.820600 14.887800 68.910301 81.725700 0.000000 0.000000 0.000000 0.000000 Pu 94 94 0.000000 1.351700 3.293700 5.321300 4.646600 3.571400 0.281300 2.241800 9.995200 42.793900 132.173904 0.000000 0.000000 0.000000 0.000000 Am 95 95 0.000000 1.213500 2.796200 4.754500 4.573100 4.478600 0.248300 1.843700 7.542100 29.384100 112.457901 0.000000 0.000000 0.000000 0.000000 Cm 96 96 0.000000 1.293700 3.110000 5.039300 4.754600 3.503100 0.263800 2.034100 8.710100 35.299198 109.497200 0.000000 0.000000 0.000000 0.000000 Bk 97 97 0.000000 1.291500 3.102300 4.930900 4.600900 3.466100 0.261100 2.002300 8.437700 34.155899 105.891098 0.000000 0.000000 0.000000 0.000000 Cf 98 98 0.000000 1.208900 2.739100 4.348200 4.004700 4.649700 0.242100 1.748700 6.726200 23.215300 80.310799 0.000000 0.000000 0.000000 0.000000 libccp4-8.0.0/data/atomsf_neutron.lib0000644000000000000000000013650614242731033015643 0ustar 00000000000000AD AD Form factors for neutron diffraction. These are also known as AD "bound coherent scattering length" AD These values have been taken from the website: AD https://www.ncnr.nist.gov/resources/n-lengths/list.html AD AD Varley F. Sears, Neutron scattering lengths and cross sections (1992) AD Vol. 3, No. 3, pp. 29-37 AD AD Note: not all atoms have formfactors. Hopefully they will not be needed AD in macromolecular crystallography AD H 1 1 0.000000 -0.374000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 D 1 1 0.000000 0.667000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 H-1 1 1 0.000000 -0.374000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 He 2 2 0.000000 0.326000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Li 3 3 0.000000 -0.190000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Li+1 3 2 0.000000 -0.190000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Be 4 4 0.00000 0.779000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Be+2 4 2 0.0000 0.779000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 B 5 5 0.0000 0.530000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.021300 0.000000 0.000000 C 6 6 0.000000 0.665000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Cv 6 6 0.000000 0.665000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 N 7 7 0.000000 0.936000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 O 8 8 0.000000 0.581000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 O-1 8 9 0.000000 0.581000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 F 9 9 0.0000 0.565400 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 F-1 9 10 0.0000 0.565400 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ne 10 10 0.000 0.456600 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Na 11 11 0.00000 0.363000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Na+1 11 10 0.0000 0.363000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Mg 12 12 0.0000 0.537500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Mg+2 12 10 0.0000 0.537500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Al 13 13 0.00000 0.344900 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Al+3 13 10 0.00000 0.344900 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Si 14 14 0.0000 0.414910 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Siv 14 14 0.00000 0.414910 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Si+4 14 10 0.00000 0.414910 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 P 15 15 0.000000 0.513000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 S 16 16 0.000000 0.284700 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Cl 17 17 0.0000 0.957700 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Cl-1 17 18 0.0000 0.957700 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ar 18 18 0.0000 0.190900 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 K 19 19 0.0000 0.367000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 K+1 19 18 0.0000 0.367000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ca 20 20 0.0000 0.470000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ca+2 20 18 0.00000 0.470000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Sc 21 21 0.00000 1.229000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Sc+3 21 18 0.0000 1.229000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ti 22 22 0.0000 -0.343800 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ti+2 22 20 0.00000 -0.343800 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ti+3 22 19 0.0000 -0.343800 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ti+4 22 18 0.0000 -0.343800 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 V 23 23 0.0000 -0.382400 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 V+2 23 21 0.0000 -0.382400 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 V+3 23 19 0.00000 -0.382400 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 V+5 23 18 0.0000 -0.382400 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Cr 24 24 0.0000 0.363500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Cr+2 24 22 0.00000 0.363500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Cr+3 24 21 0.000000 0.363500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Mn 25 25 0.00000 -0.373000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Mn+2 25 23 0.00000 -0.373000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Mn+3 25 22 0.00000 -0.373000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Mn+4 25 21 0.00000 -0.373000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Fe 26 26 0.00000 0.945000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Fe+2 26 24 0.00000 0.945000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Fe+3 26 23 0.00000 0.945000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Co 27 27 0.000000 0.249000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Co+2 27 25 0.000000 0.249000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Co+3 27 24 0.000000 0.249000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ni 28 28 0.000000 1.030000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ni+2 28 26 0.000000 1.030000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ni+3 28 25 0.000000 1.030000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Cu 29 29 0.0000 0.771800 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Cu+1 29 28 0.0000 0.771800 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Cu+2 29 27 0.0000 0.771800 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Zn 30 30 0.0000 0.578000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Zn+2 30 28 0.0000 0.578000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ga 31 31 0.0000 0.728800 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ga+3 31 28 0.0000 0.728800 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ge 32 32 0.0000 0.818500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ge+4 32 28 0.0000 0.818500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 As 33 33 0.0000 0.658000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Se 34 34 0.0000 0.797000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Br 35 35 0.0000 0.679500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Br-1 35 36 0.0000 0.679500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Rb 37 37 0.0000 0.709000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Rb+1 37 36 0.0000 0.709000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Sr 38 38 0.0000 0.702000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Sr+2 38 36 0.0000 0.702000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Y 39 39 0.0000 0.775000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Y+3 39 36 0.0000 0.775000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Zr 40 40 0.0000 0.716000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Zr+4 40 36 0.0000 0.716000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Nb 41 41 0.0000 0.795400 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Nb+3 41 38 0.0000 0.795400 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Nb+5 41 36 0.0000 0.795400 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Mo 42 42 0.0000 0.671500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Mo+3 42 39 0.0000 0.671500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Mo+5 42 37 0.0000 0.671500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Mo+6 42 36 0.0000 0.671500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Tc 43 43 0.0000 0.680000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ru 44 44 0.0000 0.703000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ru+3 44 41 0.0000 0.703000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ru+4 44 40 0.0000 0.703000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Rh 45 45 0.0000 0.588000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Rh+3 45 42 0.0000 0.588000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Rh+4 45 41 0.0000 0.588000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Pd 46 46 0.0000 0.591000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Pd+2 46 44 0.0000 0.591000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Pd+4 46 42 0.0000 0.592200 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ag 47 47 0.0000 0.591000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ag+1 47 46 0.0000 0.592200 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ag+2 47 45 0.0000 0.592200 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Cd 48 48 0.0000 0.487000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.070000 0.000000 0.000000 Cd+2 48 46 0.0000 0.487000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.070000 0.000000 0.000000 In 49 49 0.0000 0.406500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.005390 0.000000 0.000000 In+3 49 46 0.0000 0.406500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.005390 0.000000 0.000000 Sn 50 50 0.0000 0.622500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Sn+2 50 48 0.0000 0.622500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Sn+4 50 46 0.0000 0.622500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Sb 51 51 0.0000 0.557000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Sb+3 51 48 0.0000 0.557000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Sb+5 51 46 0.0000 0.557000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Te 52 52 0.0000 0.580000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 I 53 53 0.0000 0.528000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 I-1 53 54 0.0000 0.528000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Xe 54 54 0.0000 0.492000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Cs 55 55 0.0000 0.542000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Cs+1 55 54 0.0000 0.542000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ba 56 56 0.0000 0.507000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ba+2 56 54 0.0000 0.507000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 La 57 57 0.0000 0.824000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 La+3 57 54 0.0000 0.824000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ce 58 58 0.0000 0.484000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ce+3 58 55 0.0000 0.484000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ce+4 58 54 0.0000 0.484000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Pr 59 59 0.0000 0.458000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Pr+3 59 56 0.0000 0.458000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Pr+4 59 55 0.0000 0.458000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Nd 60 60 0.0000 0.769000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Nd+3 60 57 0.0000 0.769000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Pm 61 61 0.0000 1.260000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Pm+3 61 58 0.0000 1.260000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Sm 62 62 0.0000 0.08000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.165000 0.000000 0.000000 Sm+3 62 58 0.0000 0.080000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.165000 0.000000 0.000000 Eu 63 63 0.0000 0.722000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.126000 0.000000 0.000000 Eu+2 63 61 0.0000 0.722000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.126000 0.000000 0.000000 Eu+3 63 60 0.0000 0.722000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.126000 0.000000 0.000000 Gd 64 64 0.0000 0.650000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -1.382000 0.000000 0.000000 Gd+3 64 61 0.0000 0.650000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -1.382000 0.000000 0.000000 Tb 65 65 0.0000 0.738000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Tb+3 65 62 0.0000 0.738000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Dy 66 66 0.0000 1.690000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.027600 0.000000 0.000000 Dy+3 66 63 0.0000 1.690000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.027600 0.000000 0.000000 Ho 67 67 0.0000 0.801000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ho+3 67 64 0.0000 0.801000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Er 68 68 0.0000 0.779000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Er+3 68 65 0.0000 0.779000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Tm 69 69 0.0000 0.707000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Tm+3 69 66 0.0000 0.707000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Yb 70 70 0.0000 1.243000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Yb+2 70 68 0.0000 1.243000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Yb+3 70 67 0.0000 1.243000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Lu 71 71 0.0000 0.721000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Lu+3 71 68 0.0000 0.721000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Hf 72 72 0.0000 0.770000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Hf+4 72 68 0.0000 0.770000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ta 73 73 0.0000 0.691000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ta+5 73 68 0.0000 0.691000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 W 74 74 0.0000 0.486000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 W+6 74 68 0.0000 0.486000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Re 75 75 0.0000 0.920000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Os 76 76 0.0000 1.070000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Os+4 76 72 0.0000 1.070000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ir 77 77 0.0000 1.060000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ir+3 77 74 0.0000 1.060000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ir+4 77 73 0.0000 1.060000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Pt 78 78 0.0000 0.960000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Pt+2 78 76 0.0000 0.960000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Pt+4 78 74 0.0000 0.960000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Au 79 79 0.0000 0.763000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Au+1 79 78 0.0000 0.763000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Au+3 79 76 0.0000 0.763000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Hg 80 80 0.0000 1.269200 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Hg+1 80 79 0.0000 1.269200 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Hg+2 80 78 0.0000 1.269200 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Tl 81 81 0.0000 0.877600 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Tl+1 81 80 0.0000 0.877600 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Tl+3 81 78 0.0000 0.877600 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Pb 82 82 0.0000 0.940500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Pb+2 82 80 0.0000 0.940500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Pb+4 82 78 0.0000 0.940500 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Bi 83 83 0.0000 0.853200 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Bi+3 83 80 0.0000 0.853200 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Bi+5 83 78 0.0000 0.853200 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ra 88 88 0.0000 1.00000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Ra+2 88 86 0.0000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Th 90 90 0.0000 1.031000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Th+4 90 86 0.0000 1.031000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Pa 91 91 0.0000 0.910000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 U 92 92 0.0000 1.010000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 U+3 92 89 0.0000 1.010000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 U+4 92 88 0.0000 1.010000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 U+6 92 86 0.0000 1.010000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Np 93 93 0.0000 1.055000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Np+3 93 90 0.0000 1.055000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Np+4 93 89 0.0000 1.055000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Np+6 93 87 0.0000 1.055000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 Am 95 95 0.0000 0.830000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 libccp4-8.0.0/data/font84.ascii0000644000000000000000000100177014242731033014237 0ustar 00000000000000 0 1222 1259 1867 1833 1716 1742 1257 1279 1295 1275 1363 1198 1362 1194 1278 889 923 928 965 1004 1009 1038 1080 1101 1152 1204 1212 1394 1386 1396 1231 1785 1 7 40 68 90 100 108 138 147 151 165 174 180 190 197 235 254 308 339 369 377 392 397 405 412 420 1311 2132 1315 1445 2133 1475 428 459 482 506 530 555 569 617 631 639 656 665 669 693 707 737 761 784 797 825 835 849 854 862 869 881 1319 1359 1337 1425 0 1263 1355 1357 1360 1365 1371 1373 1377 1388 1391 1398 1402 1406 1449 1452 1455 1469 1475 1481 1487 1493 1497 1508 1519 1530 1541 1553 1558 1563 1568 1573 1611 1616 1620 1648 1692 1871 1909 1927 1961 1965 1993 2022 2041 2060 2094 2128 0 0 0 0 0 0 0 0 2033 2334 0 2194 0 2134 2329 2240 2264 2288 2313 1965 2309 1953 2236 1564 1612 1622 1662 1714 1721 1756 1807 1832 1902 1981 2005 0 2321 0 2055 0 1 15 59 94 129 159 185 230 257 270 299 323 340 364 379 425 455 517 559 597 615 641 654 677 695 714 0 0 0 0 2368 0 727 765 803 831 873 900 937 982 1007 1030 1063 1094 1110 1153 1183 1219 1263 1298 1320 1357 1372 1402 1425 1461 1502 1539 0 0 0 0 0 2344 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2102 2118 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1873 2047 0 1971 0 1922 2045 2005 2021 2037 2041 1850 2040 1846 2004 1543 1579 1586 1620 1662 1666 1695 1735 1755 1806 1856 1863 0 2043 0 1882 0 1 31 89 126 165 206 244 289 336 365 395 442 478 515 545 575 620 659 712 744 776 807 839 868 914 948 0 0 0 0 0 0 986 1011 1028 1046 1071 1090 1113 1143 1163 1176 1194 1213 1224 1257 1281 1306 1326 1353 1369 1385 1397 1416 1433 1459 1489 1513 0 0 0 0 0 2051 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1910 1916 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 256 0 0 0 0 477 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 305 1 4 145 24 27 128 22 34 58 0 59 62 64 68 74 94 37 97 107 111 113 147 161 71 0 31 0 0 0 0 0 0 176 196 496 234 541 572 221 290 330 0 337 350 355 370 403 419 553 426 589 459 463 506 522 380 0 271 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 4 4 34 26 43 2 16 16 3 2 6 1 4 1 34 5 37 39 5 29 42 21 51 42 8 10 2 2 2 26 48 6 33 28 22 10 8 30 9 4 14 9 6 10 7 38 19 54 31 30 8 15 5 8 7 8 8 4 1 4 4 1 6 31 23 24 24 25 14 48 14 8 17 9 4 24 14 30 24 23 13 28 10 14 5 8 7 12 8 18 1 18 20 0 12 2 2 2 3 2 4 9 3 3 4 4 19 3 3 14 6 6 6 6 4 11 11 11 11 12 5 5 5 5 38 5 4 28 44 24 38 18 34 4 28 29 19 19 34 34 4 0 0 0 0 0 0 0 0 22 10 0 42 0 60 5 24 24 21 8 16 4 12 4 48 10 40 52 7 35 51 25 70 51 24 28 0 8 0 47 0 14 44 35 35 30 26 45 27 13 29 24 17 24 15 46 30 62 42 38 18 26 13 23 18 19 13 0 0 0 0 1 0 38 38 28 42 27 37 45 25 23 33 31 16 43 30 36 44 35 22 37 15 30 23 36 41 37 25 0 0 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 16 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 4 0 33 0 49 2 16 16 3 2 6 1 4 1 36 7 34 42 4 29 40 20 51 40 7 10 0 2 0 28 0 30 58 37 39 41 38 45 47 29 30 47 36 37 30 30 45 39 53 32 32 31 32 29 46 34 38 0 0 0 0 0 0 25 17 18 25 19 23 30 20 13 18 19 11 33 24 25 20 27 16 16 12 19 17 26 30 24 30 0 0 0 0 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 0 0 0 0 19 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 25 3 18 2 3 4 17 2 3 1 0 3 2 4 3 20 3 21 10 4 2 15 14 15 3 0 3 0 0 0 0 0 0 20 25 10 22 12 17 13 15 7 0 13 5 15 10 16 7 19 17 14 4 14 16 19 23 0 19 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 3 3 3 3 3 3 4 3 3 4 4 4 4 2 3 6 3 3 2 3 3 3 3 3 4 4 4 4 4 3 3 1 2 3 2 2 2 3 2 2 2 2 2 2 2 3 2 3 2 3 2 2 1 1 1 1 3 4 2 3 3 -1 4 3 2 3 3 3 2 2 2 2 1 2 2 2 2 3 2 3 2 3 2 2 1 1 2 2 3 5 4 5 3 0 3 3 4 4 4 4 4 4 4 4 4 4 4 3 3 3 4 4 4 4 3 4 4 4 4 4 4 3 4 3 3 2 3 2 2 3 3 2 2 2 3 2 2 2 2 2 2 0 0 0 0 0 0 0 0 2 5 0 2 0 2 5 3 0 5 4 1 4 2 -2 3 7 1 2 2 2 3 4 2 3 2 1 0 4 0 6 0 -2 0 3 0 0 0 3 0 0 1 0 0 0 0 3 0 3 0 2 4 4 4 5 -1 4 1 0 0 0 0 -1 0 3 4 3 3 3 -2 1 2 1 -2 2 4 1 1 3 -1 3 1 2 3 1 1 1 1 1 3 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 5 0 2 0 2 5 3 0 5 4 1 4 2 -2 3 6 1 2 2 2 3 4 2 3 2 1 0 4 0 6 0 -1 1 2 1 2 1 2 0 0 1 0 -1 -2 -2 3 1 0 1 0 1 1 1 1 -1 2 0 0 0 0 0 0 0 1 0 1 1 1 -4 1 0 1 -7 0 0 0 0 1 -4 1 0 0 0 1 1 1 0 1 -1 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 4 3 1 4 3 4 4 4 0 4 1 4 4 3 4 3 4 2 1 2 2 3 2 0 3 0 0 0 0 0 0 3 -3 1 3 3 3 1 1 3 0 2 1 1 3 3 2 3 0 3 2 1 1 3 3 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -9 5 -16 -13 -9 -9 5 -16 -16 0 -9 -13 0 -9 -16 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -13 -9 -3 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -14 -9 -9 -9 -9 -9 -9 -9 -9 -9 -16 -16 -16 -2 -13 6 -9 -9 -9 -9 -9 -9 -16 -9 -9 -16 -9 -9 -9 -9 -9 -16 -16 -9 -9 -9 -9 -9 -9 -9 -16 -9 -16 -16 -16 -3 0 4 -16 -16 -16 -9 -7 -1 -9 -9 -5 -9 -9 -5 6 6 6 6 6 6 6 -9 -8 -8 -8 -8 -8 -5 -9 -5 -9 -9 -9 -9 -16 -16 -4 -16 -16 -16 -9 -9 -9 -9 -9 -9 -9 -9 0 0 0 0 0 0 0 0 -9 5 0 -13 0 -9 5 -16 -16 0 -8 -13 0 -9 -16 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -13 0 -4 0 -9 0 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -14 -9 -9 -9 -9 -9 -9 -9 -9 -9 0 0 0 0 -13 0 -9 -9 -9 -9 -9 -16 -16 -9 -9 -16 -9 -9 -9 -9 -9 -16 -16 -9 -9 -9 -9 -9 -9 -9 -16 -9 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -9 5 0 -13 0 -9 5 -16 -16 0 -9 -13 0 -9 -16 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -13 0 -3 0 -9 0 -9 -9 -9 -9 -9 -9 -9 -9 -9 -13 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 0 0 0 0 0 0 -9 -9 -9 -9 -9 -21 -21 -9 -9 -21 -9 -9 -9 -9 -9 -21 -21 -9 -9 -9 -9 -9 -9 -9 -21 -21 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -9 0 0 0 0 -16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 0 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 0 -9 0 0 0 0 0 0 -9 -16 -16 -9 -9 -16 -16 -16 -9 0 -9 -9 -16 -9 -9 -9 -9 -16 -13 -9 -9 -16 -9 -16 0 -16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 16 21 20 24 25 8 14 14 16 26 10 26 10 22 20 20 20 20 20 20 20 20 20 20 10 10 24 26 24 18 27 20 22 21 22 21 20 23 24 11 15 22 18 25 23 22 22 22 22 20 19 24 20 24 20 21 20 14 22 14 22 21 10 20 21 19 21 19 13 19 22 11 11 21 11 33 22 20 21 20 17 17 15 22 18 24 20 19 18 14 8 14 24 0 14 14 14 14 24 22 10 26 26 26 24 24 25 12 12 20 10 10 10 10 22 24 24 24 24 24 26 16 26 16 19 20 33 24 24 25 16 16 16 19 20 23 22 22 33 33 11 0 0 0 0 0 0 0 0 11 20 0 21 0 26 10 16 16 17 25 11 25 11 23 21 21 21 21 21 21 21 21 21 21 11 11 0 25 0 21 0 20 24 21 23 23 22 22 26 14 19 23 20 28 25 22 23 22 24 23 22 25 20 26 22 22 22 0 0 0 0 21 0 22 19 18 22 18 16 21 22 13 13 22 12 35 24 20 22 21 18 17 14 24 20 30 22 22 20 0 0 0 0 0 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 18 0 21 0 26 9 15 15 17 26 11 26 11 22 21 21 21 21 21 21 21 21 21 21 11 11 0 26 0 21 0 23 24 21 23 19 21 22 24 16 17 24 18 28 23 21 23 21 24 20 18 22 21 23 20 22 21 0 0 0 0 0 0 16 14 12 16 12 9 16 15 8 8 14 8 25 18 14 15 16 14 12 8 16 15 21 16 16 13 0 0 0 0 0 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 16 0 0 0 0 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 18 21 20 18 19 20 17 22 8 0 21 18 24 22 22 22 22 21 18 16 18 22 20 18 0 20 0 0 0 0 0 0 21 19 18 18 16 20 19 20 11 0 18 16 21 18 17 22 17 18 18 20 20 23 23 16 0 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 12 12 16 12 12 12 16 16 12 9 -7 0 -7 16 12 12 12 12 12 12 12 12 12 12 5 5 9 3 9 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 16 16 16 3 -13 12 5 12 5 12 5 12 5 12 12 12 12 12 5 5 5 5 5 5 5 12 5 5 5 5 5 5 16 16 16 3 0 12 16 16 16 8 7 1 9 9 5 12 12 5 12 12 12 12 12 12 12 16 8 8 8 8 8 5 9 5 9 12 12 24 16 16 4 12 12 12 12 9 12 12 12 12 12 5 0 0 0 0 0 0 0 0 12 12 0 16 0 12 12 16 16 12 9 -6 1 -6 16 12 12 12 12 12 12 12 12 12 12 5 5 0 5 0 12 0 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 0 0 0 0 -13 0 5 12 5 12 5 12 5 12 12 12 12 12 5 5 5 5 5 5 5 12 5 5 5 5 5 5 0 0 0 0 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 12 0 16 0 12 12 16 16 12 9 -7 0 -7 16 12 12 12 12 12 12 12 12 12 12 5 5 0 3 0 12 0 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 0 0 0 0 0 0 0 12 0 12 0 12 0 12 6 6 12 12 0 0 0 6 0 0 1 12 0 0 0 0 0 0 0 0 0 0 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 12 12 12 12 12 12 12 12 12 0 12 12 12 12 12 12 12 12 12 12 12 12 12 12 0 12 0 0 0 0 0 0 5 12 5 12 5 12 5 5 5 0 5 12 5 5 5 5 12 5 5 5 5 12 5 12 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 22 3 1 10 22 17 1 10 19 16 1 5 7 14 7 1 1 7 1 13 1 19 1 4 22 4 1 5 22 5 1 1 22 13 22 13 22 16 21 16 21 17 20 17 20 18 18 18 18 18 16 18 16 17 14 17 14 16 13 16 13 13 12 13 22 15 21 15 21 16 20 16 20 17 18 17 18 17 16 17 16 16 14 16 14 15 13 15 13 13 12 5 12 13 12 13 12 16 11 16 11 17 10 17 10 18 8 18 8 18 5 18 5 17 3 17 3 16 2 16 2 13 1 13 1 1 1 13 12 15 11 15 11 16 10 16 10 17 8 17 8 17 5 17 5 16 3 16 3 15 2 15 2 13 1 15 19 16 16 16 16 16 22 16 22 15 19 15 19 13 21 13 21 10 22 10 22 8 22 8 22 5 21 5 21 3 19 3 19 2 17 2 17 1 14 1 14 1 9 1 9 2 6 2 6 3 4 3 4 5 2 5 2 8 1 8 1 10 1 10 1 13 2 13 2 15 4 15 4 16 6 8 22 6 21 6 21 4 19 4 19 3 17 3 17 2 14 2 14 2 9 2 9 3 6 3 6 4 4 4 4 6 2 6 2 8 1 4 22 4 1 5 22 5 1 1 22 11 22 11 22 14 21 14 21 16 19 16 19 17 17 17 17 18 14 18 14 18 9 18 9 17 6 17 6 16 4 16 4 14 2 14 2 11 1 11 1 1 1 11 22 13 21 13 21 15 19 15 19 16 17 16 17 17 14 17 14 17 9 17 9 16 6 16 6 15 4 15 4 13 2 13 2 11 1 4 22 4 1 5 22 5 1 11 16 11 8 1 22 17 22 17 22 17 16 17 16 16 22 5 12 11 12 1 1 17 1 17 1 17 7 17 7 16 1 4 22 4 1 5 22 5 1 11 16 11 8 1 22 17 22 17 22 17 16 17 16 16 22 5 12 11 12 1 1 8 1 15 19 16 16 16 16 16 22 16 22 15 19 15 19 13 21 13 21 10 22 10 22 8 22 8 22 5 21 5 21 3 19 3 19 2 17 2 17 1 14 1 14 1 9 1 9 2 6 2 6 3 4 3 4 5 2 5 2 8 1 8 1 10 1 10 1 13 2 13 2 15 4 8 22 6 21 6 21 4 19 4 19 3 17 3 17 2 14 2 14 2 9 2 9 3 6 3 6 4 4 4 4 6 2 6 2 8 1 15 9 15 1 16 9 16 1 12 9 19 9 4 22 4 1 5 22 5 1 17 22 17 1 18 22 18 1 1 22 8 22 14 22 21 22 5 12 17 12 1 1 8 1 14 1 21 1 4 22 4 1 5 22 5 1 1 22 8 22 1 1 8 1 9 22 9 5 9 5 8 2 8 2 6 1 6 1 4 1 4 1 2 2 2 2 1 4 1 4 1 6 1 6 2 7 2 7 3 6 3 6 2 5 8 22 8 5 8 5 7 2 7 2 6 1 5 22 12 22 4 22 4 1 5 22 5 1 18 22 5 9 10 13 18 1 9 13 17 1 1 22 8 22 14 22 20 22 1 1 8 1 14 1 20 1 4 22 4 1 5 22 5 1 1 22 8 22 1 1 16 1 16 1 16 7 16 7 15 1 4 22 4 1 5 22 11 4 4 22 11 1 18 22 11 1 18 22 18 1 19 22 19 1 1 22 5 22 18 22 22 22 1 1 7 1 15 1 22 1 4 22 4 1 5 22 17 3 5 20 17 1 17 22 17 1 1 22 5 22 14 22 20 22 1 1 7 1 8 22 5 21 5 21 3 19 3 19 2 17 2 17 1 13 1 13 1 10 1 10 2 6 2 6 3 4 3 4 5 2 5 2 8 1 8 1 10 1 10 1 13 2 13 2 15 4 15 4 16 6 16 6 17 10 17 10 17 13 17 13 16 17 16 17 15 19 15 19 13 21 13 21 10 22 10 22 8 22 8 22 6 21 6 21 4 19 4 19 3 17 3 17 2 13 2 13 2 10 2 10 3 6 3 6 4 4 4 4 6 2 6 2 8 1 10 1 12 2 12 2 14 4 14 4 15 6 15 6 16 10 16 10 16 13 16 13 15 17 15 17 14 19 14 19 12 21 12 21 10 22 4 22 4 1 5 22 5 1 1 22 13 22 13 22 16 21 16 21 17 20 17 20 18 18 18 18 18 15 18 15 17 13 17 13 16 12 16 12 13 11 13 11 5 11 13 22 15 21 15 21 16 20 16 20 17 18 17 18 17 15 17 15 16 13 16 13 15 12 15 12 13 11 1 1 8 1 8 27 5 26 5 26 3 24 3 24 2 22 2 22 1 18 1 18 1 15 1 15 2 11 2 11 3 9 3 9 5 7 5 7 8 6 8 6 10 6 10 6 13 7 13 7 15 9 15 9 16 11 16 11 17 15 17 15 17 18 17 18 16 22 16 22 15 24 15 24 13 26 13 26 10 27 10 27 8 27 8 27 6 26 6 26 4 24 4 24 3 22 3 22 2 18 2 18 2 15 2 15 3 11 3 11 4 9 4 9 6 7 6 7 8 6 10 6 12 7 12 7 14 9 14 9 15 11 15 11 16 15 16 15 16 18 16 18 15 22 15 22 14 24 14 24 12 26 12 26 10 27 5 8 5 9 5 9 6 11 6 11 8 12 8 12 9 12 9 12 11 11 11 11 12 9 12 9 13 2 13 2 14 1 14 1 16 1 16 1 17 3 17 3 17 4 12 9 13 5 13 5 14 3 14 3 15 2 15 2 16 2 16 2 17 3 4 22 4 1 5 22 5 1 1 22 13 22 13 22 16 21 16 21 17 20 17 20 18 18 18 18 18 16 18 16 17 14 17 14 16 13 16 13 13 12 13 12 5 12 13 22 15 21 15 21 16 20 16 20 17 18 17 18 17 16 17 16 16 14 16 14 15 13 15 13 13 12 1 1 8 1 10 12 12 11 12 11 13 10 13 10 16 3 16 3 17 2 17 2 18 2 18 2 19 3 12 11 13 9 13 9 15 2 15 2 16 1 16 1 18 1 18 1 19 3 19 3 19 4 14 19 15 22 15 22 15 16 15 16 14 19 14 19 12 21 12 21 9 22 9 22 6 22 6 22 3 21 3 21 1 19 1 19 1 17 1 17 2 15 2 15 3 14 3 14 5 13 5 13 11 11 11 11 13 10 13 10 15 8 1 17 3 15 3 15 5 14 5 14 11 12 11 12 13 11 13 11 14 10 14 10 15 8 15 8 15 4 15 4 13 2 13 2 10 1 10 1 7 1 7 1 4 2 4 2 2 4 2 4 1 7 1 7 1 1 1 1 2 4 8 22 8 1 9 22 9 1 2 22 1 16 1 16 1 22 1 22 16 22 16 22 16 16 16 16 15 22 5 1 12 1 4 22 4 7 4 7 5 4 5 4 7 2 7 2 10 1 10 1 12 1 12 1 15 2 15 2 17 4 17 4 18 7 18 7 18 22 5 22 5 7 5 7 6 4 6 4 8 2 8 2 10 1 1 22 8 22 15 22 21 22 3 22 10 1 4 22 10 4 17 22 10 1 1 22 7 22 13 22 19 22 4 22 8 1 5 22 8 6 12 22 8 1 12 22 16 1 13 22 16 6 20 22 16 1 1 22 8 22 17 22 23 22 3 22 16 1 4 22 17 1 17 22 3 1 1 22 7 22 13 22 19 22 1 1 7 1 13 1 19 1 3 22 10 11 10 11 10 1 4 22 11 11 11 11 11 1 18 22 11 11 1 22 7 22 14 22 20 22 7 1 14 1 14 22 1 1 15 22 2 1 2 22 1 16 1 16 1 22 1 22 15 22 1 1 15 1 15 1 15 7 15 7 14 1 3 13 3 12 3 12 2 12 2 12 2 13 2 13 3 14 3 14 5 15 5 15 9 15 9 15 11 14 11 14 12 13 12 13 13 11 13 11 13 4 13 4 14 2 14 2 15 1 12 13 12 4 12 4 13 2 13 2 15 1 15 1 16 1 12 11 11 10 11 10 5 9 5 9 2 8 2 8 1 6 1 6 1 4 1 4 2 2 2 2 5 1 5 1 8 1 8 1 10 2 10 2 12 4 5 9 3 8 3 8 2 6 2 6 2 4 2 4 3 2 3 2 5 1 4 22 4 1 5 22 5 1 5 12 7 14 7 14 9 15 9 15 11 15 11 15 14 14 14 14 16 12 16 12 17 9 17 9 17 7 17 7 16 4 16 4 14 2 14 2 11 1 11 1 9 1 9 1 7 2 7 2 5 4 11 15 13 14 13 14 15 12 15 12 16 9 16 9 16 7 16 7 15 4 15 4 13 2 13 2 11 1 1 22 5 22 13 12 12 11 12 11 13 10 13 10 14 11 14 11 14 12 14 12 12 14 12 14 10 15 10 15 7 15 7 15 4 14 4 14 2 12 2 12 1 9 1 9 1 7 1 7 2 4 2 4 4 2 4 2 7 1 7 1 9 1 9 1 12 2 12 2 14 4 7 15 5 14 5 14 3 12 3 12 2 9 2 9 2 7 2 7 3 4 3 4 5 2 5 2 7 1 13 22 13 1 14 22 14 1 13 12 11 14 11 14 9 15 9 15 7 15 7 15 4 14 4 14 2 12 2 12 1 9 1 9 1 7 1 7 2 4 2 4 4 2 4 2 7 1 7 1 9 1 9 1 11 2 11 2 13 4 7 15 5 14 5 14 3 12 3 12 2 9 2 9 2 7 2 7 3 4 3 4 5 2 5 2 7 1 10 22 14 22 13 1 17 1 2 9 14 9 14 9 14 11 14 11 13 13 13 13 12 14 12 14 10 15 10 15 7 15 7 15 4 14 4 14 2 12 2 12 1 9 1 9 1 7 1 7 2 4 2 4 4 2 4 2 7 1 7 1 9 1 9 1 12 2 12 2 14 4 13 9 13 12 13 12 12 14 7 15 5 14 5 14 3 12 3 12 2 9 2 9 2 7 2 7 3 4 3 4 5 2 5 2 7 1 9 21 8 20 8 20 9 19 9 19 10 20 10 20 10 21 10 21 9 22 9 22 7 22 7 22 5 21 5 21 4 19 4 19 4 1 7 22 6 21 6 21 5 19 5 19 5 1 1 15 9 15 1 1 8 1 7 22 5 21 5 21 4 20 4 20 3 18 3 18 3 16 3 16 4 14 4 14 5 13 5 13 7 12 7 12 9 12 9 12 11 13 11 13 12 14 12 14 13 16 13 16 13 18 13 18 12 20 12 20 11 21 11 21 9 22 9 22 7 22 5 21 4 19 4 19 4 15 4 15 5 13 11 13 12 15 12 15 12 19 12 19 11 21 12 20 13 21 13 21 15 22 15 22 15 21 15 21 13 21 4 14 3 13 3 13 2 11 2 11 2 10 2 10 3 8 3 8 6 7 6 7 11 7 11 7 14 6 14 6 15 5 2 10 3 9 3 9 6 8 6 8 11 8 11 8 14 7 14 7 15 5 15 5 15 4 15 4 14 2 14 2 11 1 11 1 5 1 5 1 2 2 2 2 1 4 1 4 1 5 1 5 2 7 2 7 5 8 4 22 4 1 5 22 5 1 5 12 7 14 7 14 10 15 10 15 12 15 12 15 15 14 15 14 16 12 16 12 16 1 12 15 14 14 14 14 15 12 15 12 15 1 1 22 5 22 1 1 8 1 12 1 19 1 4 22 3 21 3 21 4 20 4 20 5 21 5 21 4 22 4 15 4 1 5 15 5 1 1 15 5 15 1 1 8 1 6 29 5 28 5 28 6 27 6 27 7 28 7 28 6 29 7 22 7 4 7 4 6 2 6 2 4 1 4 1 2 1 2 1 1 2 1 2 1 3 1 3 2 4 2 4 3 3 3 3 2 2 6 22 6 4 6 4 5 2 5 2 4 1 3 22 7 22 4 22 4 1 5 22 5 1 15 15 5 5 10 9 16 1 9 9 15 1 1 22 5 22 12 15 18 15 1 1 8 1 12 1 18 1 4 22 4 1 5 22 5 1 1 22 5 22 1 1 8 1 4 15 4 1 5 15 5 1 5 12 7 14 7 14 10 15 10 15 12 15 12 15 15 14 15 14 16 12 16 12 16 1 12 15 14 14 14 14 15 12 15 12 15 1 16 12 18 14 18 14 21 15 21 15 23 15 23 15 26 14 26 14 27 12 27 12 27 1 23 15 25 14 25 14 26 12 26 12 26 1 1 15 5 15 1 1 8 1 12 1 19 1 23 1 30 1 4 15 4 1 5 15 5 1 5 12 7 14 7 14 10 15 10 15 12 15 12 15 15 14 15 14 16 12 16 12 16 1 12 15 14 14 14 14 15 12 15 12 15 1 1 15 5 15 1 1 8 1 12 1 19 1 7 15 4 14 4 14 2 12 2 12 1 9 1 9 1 7 1 7 2 4 2 4 4 2 4 2 7 1 7 1 9 1 9 1 12 2 12 2 14 4 14 4 15 7 15 7 15 9 15 9 14 12 14 12 12 14 12 14 9 15 9 15 7 15 7 15 5 14 5 14 3 12 3 12 2 9 2 9 2 7 2 7 3 4 3 4 5 2 5 2 7 1 9 1 11 2 11 2 13 4 13 4 14 7 14 7 14 9 14 9 13 12 13 12 11 14 11 14 9 15 4 22 4 1 5 22 5 1 5 19 7 21 7 21 9 22 9 22 11 22 11 22 14 21 14 21 16 19 16 19 17 16 17 16 17 14 17 14 16 11 16 11 14 9 14 9 11 8 11 8 9 8 9 8 7 9 7 9 5 11 11 22 13 21 13 21 15 19 15 19 16 16 16 16 16 14 16 14 15 11 15 11 13 9 13 9 11 8 1 22 5 22 1 1 8 1 13 22 13 1 14 22 14 1 13 19 11 21 11 21 9 22 9 22 7 22 7 22 4 21 4 21 2 19 2 19 1 16 1 16 1 14 1 14 2 11 2 11 4 9 4 9 7 8 7 8 9 8 9 8 11 9 11 9 13 11 7 22 5 21 5 21 3 19 3 19 2 16 2 16 2 14 2 14 3 11 3 11 5 9 5 9 7 8 10 1 17 1 4 15 4 1 5 15 5 1 5 9 6 12 6 12 8 14 8 14 10 15 10 15 13 15 13 15 14 14 14 14 14 13 14 13 13 12 13 12 12 13 12 13 13 14 1 15 5 15 1 1 8 1 11 13 12 15 12 15 12 11 12 11 11 13 11 13 10 14 10 14 8 15 8 15 4 15 4 15 2 14 2 14 1 13 1 13 1 11 1 11 2 10 2 10 4 9 4 9 9 7 9 7 11 6 11 6 12 5 1 12 2 11 2 11 4 10 4 10 9 8 9 8 11 7 11 7 12 6 12 6 12 3 12 3 11 2 11 2 9 1 9 1 5 1 5 1 3 2 3 2 2 3 2 3 1 5 1 5 1 1 1 1 2 3 4 22 4 5 4 5 5 2 5 2 7 1 7 1 9 1 9 1 11 2 11 2 12 4 5 22 5 5 5 5 6 2 6 2 7 1 1 15 9 15 4 15 4 4 4 4 5 2 5 2 8 1 8 1 10 1 10 1 13 2 13 2 15 4 5 15 5 4 5 4 6 2 6 2 8 1 15 15 15 1 16 15 16 1 1 15 5 15 12 15 16 15 15 1 19 1 3 15 9 1 4 15 9 3 15 15 9 1 1 15 7 15 11 15 17 15 4 15 8 1 5 15 8 4 12 15 8 1 12 15 16 1 13 15 16 4 20 15 16 1 1 15 8 15 17 15 23 15 3 15 14 1 4 15 15 1 15 15 3 1 1 15 7 15 11 15 17 15 1 1 7 1 11 1 17 1 3 22 9 8 4 22 9 10 15 22 9 8 9 8 7 4 7 4 5 2 5 2 3 1 3 1 2 1 2 1 1 2 1 2 2 3 2 3 3 2 1 22 7 22 11 22 17 22 12 15 1 1 13 15 2 1 2 15 1 11 1 11 1 15 1 15 13 15 1 1 13 1 13 1 13 5 13 5 12 1 7 22 4 21 4 21 2 18 2 18 1 13 1 13 1 10 1 10 2 5 2 5 4 2 4 2 7 1 7 1 9 1 9 1 12 2 12 2 14 5 14 5 15 10 15 10 15 13 15 13 14 18 14 18 12 21 12 21 9 22 9 22 7 22 7 22 5 21 5 21 4 20 4 20 3 18 3 18 2 13 2 13 2 10 2 10 3 5 3 5 4 3 4 3 5 2 5 2 7 1 9 1 11 2 11 2 12 3 12 3 13 5 13 5 14 10 14 10 14 13 14 13 13 18 13 18 12 20 12 20 11 21 11 21 9 22 1 18 3 19 3 19 6 22 6 22 6 1 5 21 5 1 1 1 10 1 2 18 3 17 3 17 2 16 2 16 1 17 1 17 1 18 1 18 2 20 2 20 3 21 3 21 6 22 6 22 10 22 10 22 13 21 13 21 14 20 14 20 15 18 15 18 15 16 15 16 14 14 14 14 11 12 11 12 6 10 6 10 4 9 4 9 2 7 2 7 1 4 1 4 1 1 10 22 12 21 12 21 13 20 13 20 14 18 14 18 14 16 14 16 13 14 13 14 10 12 10 12 6 10 1 3 2 4 2 4 4 4 4 4 9 2 9 2 12 2 12 2 14 3 14 3 15 4 4 4 9 1 9 1 13 1 13 1 14 2 14 2 15 4 15 4 15 6 2 18 3 17 3 17 2 16 2 16 1 17 1 17 1 18 1 18 2 20 2 20 3 21 3 21 6 22 6 22 10 22 10 22 13 21 13 21 14 19 14 19 14 16 14 16 13 14 13 14 10 13 10 13 7 13 10 22 12 21 12 21 13 19 13 19 13 16 13 16 12 14 12 14 10 13 10 13 12 12 12 12 14 10 14 10 15 8 15 8 15 5 15 5 14 3 14 3 13 2 13 2 10 1 10 1 6 1 6 1 3 2 3 2 2 3 2 3 1 5 1 5 1 6 1 6 2 7 2 7 3 6 3 6 2 5 13 11 14 8 14 8 14 5 14 5 13 3 13 3 12 2 12 2 10 1 11 20 11 1 12 22 12 1 12 22 1 7 1 7 17 7 8 1 15 1 3 22 1 12 1 12 3 14 3 14 6 15 6 15 9 15 9 15 12 14 12 14 14 12 14 12 15 9 15 9 15 7 15 7 14 4 14 4 12 2 12 2 9 1 9 1 6 1 6 1 3 2 3 2 2 3 2 3 1 5 1 5 1 6 1 6 2 7 2 7 3 6 3 6 2 5 9 15 11 14 11 14 13 12 13 12 14 9 14 9 14 7 14 7 13 4 13 4 11 2 11 2 9 1 3 22 13 22 3 21 8 21 8 21 13 22 13 19 12 18 12 18 13 17 13 17 14 18 14 18 14 19 14 19 13 21 13 21 11 22 11 22 8 22 8 22 5 21 5 21 3 19 3 19 2 17 2 17 1 13 1 13 1 7 1 7 2 4 2 4 4 2 4 2 7 1 7 1 9 1 9 1 12 2 12 2 14 4 14 4 15 7 15 7 15 8 15 8 14 11 14 11 12 13 12 13 9 14 9 14 8 14 8 14 5 13 5 13 3 11 3 11 2 8 8 22 6 21 6 21 4 19 4 19 3 17 3 17 2 13 2 13 2 7 2 7 3 4 3 4 5 2 5 2 7 1 9 1 11 2 11 2 13 4 13 4 14 7 14 7 14 8 14 8 13 11 13 11 11 13 11 13 9 14 1 22 1 16 1 18 2 20 2 20 4 22 4 22 6 22 6 22 11 19 11 19 13 19 13 19 14 20 14 20 15 22 2 20 4 21 4 21 6 21 6 21 11 19 15 22 15 19 15 19 14 16 14 16 10 11 10 11 9 9 9 9 8 6 8 6 8 1 14 16 9 11 9 11 8 9 8 9 7 6 7 6 7 1 6 22 3 21 3 21 2 19 2 19 2 16 2 16 3 14 3 14 6 13 6 13 10 13 10 13 13 14 13 14 14 16 14 16 14 19 14 19 13 21 13 21 10 22 10 22 6 22 6 22 4 21 4 21 3 19 3 19 3 16 3 16 4 14 4 14 6 13 10 13 12 14 12 14 13 16 13 16 13 19 13 19 12 21 12 21 10 22 6 13 3 12 3 12 2 11 2 11 1 9 1 9 1 5 1 5 2 3 2 3 3 2 3 2 6 1 6 1 10 1 10 1 13 2 13 2 14 3 14 3 15 5 15 5 15 9 15 9 14 11 14 11 13 12 13 12 10 13 6 13 4 12 4 12 3 11 3 11 2 9 2 9 2 5 2 5 3 3 3 3 4 2 4 2 6 1 10 1 12 2 12 2 13 3 13 3 14 5 14 5 14 9 14 9 13 11 13 11 12 12 12 12 10 13 14 15 13 12 13 12 11 10 11 10 8 9 8 9 7 9 7 9 4 10 4 10 2 12 2 12 1 15 1 15 1 16 1 16 2 19 2 19 4 21 4 21 7 22 7 22 9 22 9 22 12 21 12 21 14 19 14 19 15 16 15 16 15 10 15 10 14 6 14 6 13 4 13 4 11 2 11 2 8 1 8 1 5 1 5 1 3 2 3 2 2 4 2 4 2 5 2 5 3 6 3 6 4 5 4 5 3 4 7 9 5 10 5 10 3 12 3 12 2 15 2 15 2 16 2 16 3 19 3 19 5 21 5 21 7 22 9 22 11 21 11 21 13 19 13 19 14 16 14 16 14 10 14 10 13 6 13 6 12 4 12 4 10 2 10 2 8 1 2 3 1 2 1 2 2 1 2 1 3 2 3 2 2 3 2 5 1 6 1 6 2 7 2 7 3 6 3 6 3 4 3 4 2 2 2 2 1 1 2 15 1 14 1 14 2 13 2 13 3 14 3 14 2 15 2 3 1 2 1 2 2 1 2 1 3 2 3 2 2 3 2 19 1 18 1 18 2 17 2 17 3 18 3 18 2 19 2 5 1 6 1 6 2 7 2 7 3 6 3 6 3 4 3 4 2 2 2 2 1 1 2 22 1 20 1 20 2 8 2 8 3 20 3 20 2 22 2 20 2 14 2 3 1 2 1 2 2 1 2 1 3 2 3 2 2 3 2 18 3 17 3 17 2 16 2 16 1 17 1 17 1 18 1 18 2 20 2 20 3 21 3 21 5 22 5 22 8 22 8 22 11 21 11 21 12 20 12 20 13 18 13 18 13 16 13 16 12 14 12 14 11 13 11 13 7 11 7 11 7 8 8 22 10 21 10 21 11 20 11 20 12 18 12 18 12 16 12 16 11 14 11 14 9 12 7 3 6 2 6 2 7 1 7 1 8 2 8 2 7 3 2 8 1 1 3 8 1 1 2 8 1 1 3 8 1 1 10 8 9 1 11 8 9 1 4 9 2 8 2 8 1 6 1 6 1 4 1 4 2 2 2 2 4 1 4 1 6 1 6 1 8 2 8 2 9 4 9 4 9 6 9 6 8 8 8 8 6 9 6 9 4 9 6 13 6 1 1 10 11 4 11 10 1 4 19 33 1 1 8 33 6 31 6 31 4 28 4 28 2 24 2 24 1 19 1 19 1 15 1 15 2 10 2 10 4 6 4 6 6 3 6 3 8 1 6 31 4 27 4 27 3 24 3 24 2 19 2 19 2 15 2 15 3 10 3 10 4 7 4 7 6 3 1 33 3 31 3 31 5 28 5 28 7 24 7 24 8 19 8 19 8 15 8 15 7 10 7 10 5 6 5 6 3 3 3 3 1 1 3 31 5 27 5 27 6 24 6 24 7 19 7 19 7 15 7 15 6 10 6 10 5 7 5 7 3 3 1 33 1 1 2 33 2 1 1 33 8 33 1 1 8 1 7 33 7 1 8 33 8 1 1 33 8 33 1 1 8 1 5 33 2 30 2 30 1 27 1 27 1 25 1 25 2 22 2 22 5 19 3 31 2 28 2 28 2 24 2 24 3 21 5 19 2 17 2 17 5 15 5 15 2 12 2 12 1 9 1 9 1 7 1 7 2 4 2 4 5 1 3 13 2 10 2 10 2 6 2 6 3 3 1 33 4 30 4 30 5 27 5 27 5 25 5 25 4 22 4 22 1 19 3 31 4 28 4 28 4 24 4 24 3 21 1 19 4 17 4 17 1 15 1 15 4 12 4 12 5 9 5 9 5 7 5 7 4 4 4 4 1 1 3 13 4 10 4 10 4 6 4 6 3 3 8 33 1 17 1 17 8 1 1 33 8 17 8 17 1 1 1 33 1 1 1 33 1 1 7 33 7 1 1 1 19 1 10 19 10 1 1 10 19 10 9 18 9 1 1 10 17 10 1 1 17 1 9 18 9 1 1 18 17 18 1 10 17 10 1 15 15 1 15 15 1 1 2 3 1 2 1 2 2 1 2 1 3 2 3 2 2 3 10 19 9 18 9 18 10 17 10 17 11 18 11 18 10 19 1 10 19 10 10 3 9 2 9 2 10 1 10 1 11 2 11 2 10 3 1 7 19 7 1 1 19 1 17 19 3 1 1 13 19 13 1 7 19 7 1 11 19 11 1 6 19 6 1 1 19 1 17 19 1 10 1 10 17 1 1 19 17 10 17 10 1 1 17 22 1 15 1 15 17 8 1 6 17 6 1 1 17 1 1 22 17 15 17 15 1 8 1 6 17 6 1 1 17 1 18 1 16 1 16 1 14 2 14 2 12 4 12 4 9 8 9 8 8 9 8 9 6 10 6 10 4 10 4 10 2 9 2 9 1 7 1 7 1 5 1 5 2 3 2 3 4 2 4 2 6 2 6 2 8 3 8 3 9 4 9 4 12 8 12 8 14 10 14 10 16 11 16 11 18 11 1 1 1 3 1 3 2 6 2 6 4 7 4 7 6 7 6 7 8 6 8 6 12 3 12 3 14 2 14 2 16 2 16 2 18 3 18 3 19 5 1 3 2 5 2 5 4 6 4 6 6 6 6 6 8 5 8 5 12 2 12 2 14 1 14 1 16 1 16 1 18 2 18 2 19 5 19 5 19 7 1 1 9 6 9 6 17 1 1 1 9 5 9 5 17 1 6 7 1 1 6 7 7 6 7 6 1 1 2 7 7 1 2 7 1 6 1 6 7 1 1 7 2 5 2 5 4 3 4 3 7 2 7 2 9 2 9 2 12 3 12 3 14 5 14 5 15 7 1 7 2 4 2 4 4 2 4 2 7 1 7 1 9 1 9 1 12 2 12 2 14 4 14 4 15 7 2 5 1 6 1 6 2 7 2 7 3 6 3 6 3 4 3 4 2 2 2 2 1 1 3 7 2 6 2 6 1 4 1 4 1 2 1 2 2 1 2 1 3 2 3 2 2 3 2 5 3 6 3 6 2 7 2 7 1 6 1 6 1 4 1 4 2 2 2 2 3 1 1 7 2 6 2 6 3 4 3 4 3 2 3 2 2 1 2 1 1 2 1 2 2 3 1 15 5 15 5 15 11 3 4 15 11 1 20 26 11 1 17 17 10 17 10 17 6 16 6 16 4 15 4 15 2 13 2 13 1 10 1 10 1 8 1 8 2 5 2 5 4 3 4 3 6 2 6 2 10 1 10 1 17 1 1 17 1 10 1 10 2 6 2 6 3 4 3 4 5 2 5 2 8 1 8 1 10 1 10 1 13 2 13 2 15 4 15 4 16 6 16 6 17 10 17 10 17 17 1 17 8 17 8 17 12 16 12 16 14 15 14 15 16 13 16 13 17 10 17 10 17 8 17 8 16 5 16 5 14 3 14 3 12 2 12 2 8 1 8 1 1 1 1 1 1 8 1 8 2 12 2 12 3 14 3 14 5 16 5 16 8 17 8 17 10 17 10 17 13 16 13 16 15 14 15 14 16 12 16 12 17 8 17 8 17 1 17 17 10 17 10 17 6 16 6 16 4 15 4 15 2 13 2 13 1 10 1 10 1 8 1 8 2 5 2 5 4 3 4 3 6 2 6 2 10 1 10 1 17 1 1 9 13 9 16 8 19 6 19 6 16 4 13 11 18 6 18 6 13 1 1 6 18 6 4 16 6 19 6 19 8 16 1 13 6 18 6 18 11 13 6 18 6 1 4 8 1 6 1 6 4 4 7 11 2 6 2 6 7 1 2 6 19 6 4 4 6 1 6 1 8 4 1 7 6 2 6 2 11 7 6 19 6 2 13 10 12 13 12 13 11 14 11 14 9 15 9 15 7 15 7 15 4 14 4 14 2 11 2 11 1 8 1 8 1 5 1 5 2 3 2 3 3 2 3 2 5 1 5 1 7 1 7 1 10 2 10 2 12 4 12 4 13 7 13 7 14 12 14 12 14 17 14 17 13 20 13 20 12 21 12 21 10 22 10 22 7 22 7 22 5 21 5 21 4 20 4 20 4 19 4 19 5 19 5 19 5 20 7 15 5 14 5 14 3 11 3 11 2 8 2 8 2 4 2 4 3 2 7 1 9 2 9 2 11 4 11 4 12 7 12 7 13 12 13 12 13 17 13 17 12 20 12 20 10 22 1 22 9 1 2 22 9 3 17 22 9 1 1 22 17 22 2 21 16 21 1 15 6 15 6 15 15 3 5 14 15 1 31 34 15 1 20 32 19 31 19 31 20 30 20 30 21 31 21 31 21 32 21 32 20 33 20 33 18 33 18 33 16 32 16 32 14 30 14 30 13 28 13 28 12 25 12 25 11 21 11 21 9 9 9 9 8 5 8 5 7 3 15 31 14 29 14 29 13 25 13 25 11 13 11 13 10 9 10 9 9 6 9 6 8 4 8 4 6 2 6 2 4 1 4 1 2 1 2 1 1 2 1 2 1 3 1 3 2 4 2 4 3 3 3 3 2 2 20 32 19 31 19 31 20 30 20 30 21 31 21 31 21 32 21 32 20 33 20 33 18 33 18 33 16 32 16 32 14 30 14 30 13 28 13 28 12 25 12 25 11 21 11 21 9 9 9 9 8 5 8 5 7 3 15 31 14 29 14 29 13 25 13 25 11 13 11 13 10 9 10 9 9 6 9 6 8 4 8 4 6 2 6 2 4 1 4 1 2 1 2 1 1 2 1 2 1 3 1 3 2 4 2 4 3 3 3 3 2 2 10 24 7 23 7 23 5 21 5 21 4 18 4 18 4 16 4 16 5 13 5 13 7 11 7 11 10 10 10 10 12 10 12 10 15 11 15 11 17 13 17 13 18 16 18 16 18 18 18 18 17 21 17 21 15 23 15 23 12 24 12 24 10 24 20 4 19 2 19 2 17 1 17 1 15 1 15 1 13 2 13 2 12 3 12 3 9 7 9 7 8 8 8 8 6 9 6 9 4 9 4 9 2 8 2 8 1 6 1 6 1 4 1 4 2 2 2 2 4 1 4 1 6 1 6 1 8 2 8 2 9 3 9 3 12 7 12 7 13 8 13 8 15 9 15 9 17 9 17 9 19 8 19 8 20 6 20 6 20 4 19 22 1 1 6 22 8 20 8 20 8 18 8 18 7 16 7 16 5 15 5 15 3 15 3 15 1 17 1 17 1 19 1 19 2 21 2 21 4 22 4 22 6 22 6 22 8 21 8 21 11 20 11 20 14 20 14 20 17 21 17 21 19 22 15 8 13 7 13 7 12 5 12 5 12 3 12 3 14 1 14 1 16 1 16 1 18 2 18 2 19 4 19 4 19 6 19 6 17 8 17 8 15 8 19 14 18 13 18 13 19 12 19 12 20 13 20 13 20 14 20 14 19 15 19 15 18 15 18 15 17 14 17 14 16 12 16 12 14 7 14 7 12 4 12 4 10 2 10 2 8 1 8 1 5 1 5 1 2 2 2 2 1 4 1 4 1 7 1 7 2 9 2 9 8 13 8 13 10 15 10 15 11 17 11 17 11 19 11 19 10 21 10 21 8 22 8 22 6 21 6 21 5 19 5 19 5 17 5 17 6 14 6 14 8 11 8 11 13 4 13 4 15 2 15 2 18 1 18 1 19 1 19 1 20 2 20 2 20 3 5 1 3 2 3 2 2 4 2 4 2 7 2 7 3 9 3 9 5 11 5 17 6 15 6 15 14 4 14 4 16 2 16 2 18 1 16 14 15 16 15 16 13 17 13 17 10 17 10 17 8 16 8 16 7 15 7 15 6 12 6 12 6 9 6 9 7 7 7 7 9 6 9 6 12 6 12 6 14 7 14 7 15 9 10 17 8 15 8 15 7 12 7 12 7 9 7 9 8 7 8 7 9 6 16 17 15 9 15 9 15 7 15 7 17 6 17 6 19 6 19 6 21 8 21 8 22 11 22 11 22 13 22 13 21 16 21 16 20 18 20 18 18 20 18 20 16 21 16 21 13 22 13 22 10 22 10 22 7 21 7 21 5 20 5 20 3 18 3 18 2 16 2 16 1 13 1 13 1 10 1 10 2 7 2 7 3 5 3 5 5 3 5 3 7 2 7 2 10 1 10 1 13 1 13 1 16 2 16 2 18 3 18 3 19 4 17 17 16 9 16 9 16 7 16 7 17 6 6 30 6 1 10 30 10 1 14 23 13 22 13 22 14 21 14 21 15 22 15 22 15 23 15 23 13 25 13 25 10 26 10 26 6 26 6 26 3 25 3 25 1 23 1 23 1 21 1 21 2 19 2 19 3 18 3 18 5 17 5 17 11 15 11 15 13 14 13 14 15 12 1 21 3 19 3 19 5 18 5 18 11 16 11 16 13 15 13 15 14 14 14 14 15 12 15 12 15 8 15 8 13 6 13 6 10 5 10 5 6 5 6 5 3 6 3 6 1 8 1 8 1 9 1 9 2 10 2 10 3 9 3 9 2 8 9 29 2 1 15 29 8 1 2 18 16 18 1 12 15 12 9 26 8 25 8 25 9 24 9 24 10 25 10 25 10 26 10 26 9 28 9 28 7 29 7 29 5 29 5 29 3 28 3 28 2 26 2 26 2 24 2 24 3 22 3 22 5 20 5 20 10 17 3 22 8 19 8 19 10 17 10 17 11 15 11 15 11 13 11 13 10 11 10 11 8 9 4 21 2 19 2 19 1 17 1 17 1 15 1 15 2 13 2 13 4 11 4 11 9 8 2 13 7 10 7 10 9 8 9 8 10 6 10 6 10 4 10 4 9 2 9 2 7 1 7 1 5 1 5 1 3 2 3 2 2 4 2 4 2 5 2 5 3 6 3 6 4 5 4 5 3 4 7 29 6 27 6 27 7 25 7 25 8 27 8 27 7 29 7 29 7 1 7 18 6 15 6 15 7 1 7 1 8 15 8 15 7 18 1 22 3 21 3 21 5 22 5 22 3 23 3 23 1 22 1 22 13 22 9 22 11 21 11 21 13 22 13 22 11 23 11 23 9 22 7 29 6 27 6 27 7 25 7 25 8 27 8 27 7 29 7 29 7 15 7 19 6 17 6 17 8 13 8 13 7 11 7 11 6 13 6 13 8 17 8 17 7 19 7 15 7 1 7 5 6 3 6 3 7 1 7 1 8 3 8 3 7 5 1 22 3 21 3 21 5 22 5 22 3 23 3 23 1 22 1 22 13 22 9 22 11 21 11 21 13 22 13 22 11 23 11 23 9 22 1 8 3 7 3 7 5 8 5 8 3 9 3 9 1 8 1 8 13 8 9 8 11 7 11 7 13 8 13 8 11 9 11 9 9 8 14 22 14 1 1 22 14 22 6 12 14 12 1 1 14 1 1 19 2 17 2 17 14 5 14 5 15 3 15 3 15 1 2 16 14 4 1 19 1 17 1 17 2 15 2 15 14 3 14 3 15 1 6 12 2 8 2 8 1 6 1 6 1 4 1 4 2 2 2 2 1 1 1 6 3 2 2 8 2 6 2 6 3 4 3 4 3 2 3 2 1 1 9 9 14 14 12 19 12 16 12 16 13 14 13 14 15 14 15 14 15 16 15 16 13 17 13 17 12 19 12 19 13 16 13 16 15 14 14 21 13 20 13 20 14 19 14 19 15 20 15 20 15 21 15 21 13 22 13 22 10 22 10 22 7 21 7 21 5 19 5 19 4 16 4 16 4 1 10 22 8 21 8 21 6 19 6 19 5 16 5 16 5 1 20 21 19 20 19 20 20 19 20 19 21 20 21 20 21 21 21 21 20 22 20 22 18 22 18 22 16 21 16 21 15 19 15 19 15 1 18 22 17 21 17 21 16 19 16 19 16 1 1 15 19 15 1 1 8 1 12 1 19 1 15 21 14 20 14 20 15 19 15 19 16 20 16 20 15 21 15 21 13 22 13 22 10 22 10 22 7 21 7 21 5 19 5 19 4 16 4 16 4 1 10 22 8 21 8 21 6 19 6 19 5 16 5 16 5 1 15 15 15 1 16 15 16 1 1 15 16 15 1 1 8 1 12 1 19 1 14 21 13 20 13 20 14 19 14 19 15 20 15 20 15 21 15 21 13 22 16 22 10 22 10 22 7 21 7 21 5 19 5 19 4 16 4 16 4 1 10 22 8 21 8 21 6 19 6 19 5 16 5 16 5 1 15 20 15 1 16 22 16 1 1 15 15 15 1 1 8 1 12 1 19 1 15 21 14 20 14 20 15 19 15 19 16 20 16 20 15 21 15 21 13 22 13 22 10 22 10 22 7 21 7 21 5 19 5 19 4 16 4 16 4 1 10 22 8 21 8 21 6 19 6 19 5 16 5 16 5 1 26 21 25 20 25 20 26 19 26 19 27 20 27 20 26 21 26 21 24 22 24 22 21 22 21 22 18 21 18 21 16 19 16 19 15 16 15 16 15 1 21 22 19 21 19 21 17 19 17 19 16 16 16 16 16 1 26 15 26 1 27 15 27 1 1 15 27 15 1 1 8 1 12 1 19 1 23 1 30 1 15 21 14 20 14 20 15 19 15 19 16 20 16 20 15 21 15 21 13 22 13 22 10 22 10 22 7 21 7 21 5 19 5 19 4 16 4 16 4 1 10 22 8 21 8 21 6 19 6 19 5 16 5 16 5 1 25 21 24 20 24 20 25 19 25 19 26 20 26 20 26 21 26 21 24 22 27 22 21 22 21 22 18 21 18 21 16 19 16 19 15 16 15 16 15 1 21 22 19 21 19 21 17 19 17 19 16 16 16 16 16 1 26 20 26 1 27 22 27 1 1 15 26 15 1 1 8 1 12 1 19 1 23 1 30 1 4 15 4 1 5 15 5 1 1 15 5 15 1 1 8 1 1 33 19 1 1 1 22 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 16 22 4 2 14 18 15 1 15 20 16 2 16 22 16 20 16 20 17 3 17 3 17 1 7 7 15 7 1 1 7 1 12 1 19 1 4 2 2 1 4 2 6 1 15 2 13 1 15 3 14 1 17 3 18 1 10 22 4 1 11 22 5 1 12 22 6 1 7 22 18 22 18 22 21 21 21 21 22 19 22 19 22 17 22 17 21 14 21 14 20 13 20 13 17 12 20 21 21 19 21 19 21 17 21 17 20 14 20 14 19 13 18 22 19 21 19 21 20 19 20 19 20 17 20 17 19 14 19 14 17 12 9 12 17 12 17 12 19 11 19 11 20 9 20 9 20 7 20 7 19 4 19 4 17 2 17 2 13 1 13 1 1 1 18 11 19 9 19 9 19 7 19 7 18 4 18 4 16 2 17 12 18 10 18 10 18 7 18 7 17 4 17 4 15 2 15 2 13 1 8 22 11 21 9 22 10 20 13 22 11 20 14 22 11 21 5 2 2 1 5 3 3 1 6 3 7 1 5 2 8 1 16 20 17 20 17 20 18 22 18 22 17 16 17 16 17 18 17 18 16 20 16 20 15 21 15 21 13 22 13 22 10 22 10 22 7 21 7 21 5 19 5 19 3 16 3 16 2 13 2 13 1 9 1 9 1 6 1 6 2 3 2 3 3 2 3 2 6 1 6 1 9 1 9 1 11 2 11 2 13 4 13 4 14 6 7 20 5 18 5 18 4 16 4 16 3 13 3 13 2 9 2 9 2 5 2 5 3 3 10 22 8 21 8 21 6 18 6 18 5 16 5 16 4 13 4 13 3 9 3 9 3 4 3 4 4 2 4 2 6 1 10 22 4 1 11 22 5 1 12 22 6 1 7 22 16 22 16 22 19 21 19 21 20 20 20 20 21 17 21 17 21 13 21 13 20 9 20 9 18 5 18 5 16 3 16 3 14 2 14 2 10 1 10 1 1 1 18 21 19 20 19 20 20 17 20 17 20 13 20 13 19 9 19 9 17 5 17 5 15 3 16 22 18 20 18 20 19 17 19 17 19 13 19 13 18 9 18 9 16 5 16 5 13 2 13 2 10 1 8 22 11 21 9 22 10 20 13 22 11 20 14 22 11 21 5 2 2 1 5 3 3 1 6 3 7 1 5 2 8 1 10 22 4 1 11 22 5 1 12 22 6 1 16 16 14 8 7 22 22 22 22 22 21 16 9 12 15 12 1 1 16 1 16 1 18 6 8 22 11 21 9 22 10 20 13 22 11 20 14 22 11 21 18 22 21 21 19 22 21 20 20 22 21 19 21 22 21 16 16 16 14 12 14 12 14 8 15 14 13 12 13 12 14 10 15 13 12 12 12 12 14 11 5 2 2 1 5 3 3 1 6 3 7 1 5 2 8 1 11 1 16 2 13 1 16 3 16 3 18 6 10 22 4 1 11 22 5 1 12 22 6 1 16 16 14 8 7 22 22 22 22 22 21 16 9 12 15 12 1 1 9 1 8 22 11 21 9 22 10 20 13 22 11 20 14 22 11 21 18 22 21 21 19 22 21 20 20 22 21 19 21 22 21 16 16 16 14 12 14 12 14 8 15 14 13 12 13 12 14 10 15 13 12 12 12 12 14 11 5 2 2 1 5 3 3 1 6 3 7 1 5 2 8 1 16 20 17 20 17 20 18 22 18 22 17 16 17 16 17 18 17 18 16 20 16 20 15 21 15 21 13 22 13 22 10 22 10 22 7 21 7 21 5 19 5 19 3 16 3 16 2 13 2 13 1 9 1 9 1 6 1 6 2 3 2 3 3 2 3 2 6 1 6 1 8 1 8 1 11 2 11 2 13 4 13 4 15 8 7 20 5 18 5 18 4 16 4 16 3 13 3 13 2 9 2 9 2 5 2 5 3 3 12 4 13 5 13 5 14 8 10 22 8 21 8 21 6 18 6 18 5 16 5 16 4 13 4 13 3 9 3 9 3 4 3 4 4 2 4 2 6 1 8 1 10 2 10 2 12 5 12 5 13 8 10 8 18 8 11 8 13 7 12 8 13 5 16 8 14 6 17 8 14 7 10 22 4 1 11 22 5 1 12 22 6 1 22 22 16 1 23 22 17 1 24 22 18 1 7 22 15 22 19 22 27 22 8 12 20 12 1 1 9 1 13 1 21 1 8 22 11 21 9 22 10 20 13 22 11 20 14 22 11 21 20 22 23 21 21 22 22 20 25 22 23 20 26 22 23 21 5 2 2 1 5 3 3 1 6 3 7 1 5 2 8 1 17 2 14 1 17 3 15 1 18 3 19 1 17 2 20 1 10 22 4 1 11 22 5 1 12 22 6 1 7 22 15 22 1 1 9 1 8 22 11 21 9 22 10 20 13 22 11 20 14 22 11 21 5 2 2 1 5 3 3 1 6 3 7 1 5 2 8 1 14 22 9 5 9 5 8 3 8 3 6 1 15 22 11 9 11 9 10 6 10 6 9 4 16 22 12 9 12 9 10 4 10 4 8 2 8 2 6 1 6 1 4 1 4 1 2 2 2 2 1 4 1 4 1 6 1 6 2 7 2 7 3 7 3 7 4 6 4 6 4 5 4 5 3 4 3 4 2 4 2 6 2 5 2 5 3 5 3 5 3 6 3 6 2 6 11 22 19 22 12 22 15 21 13 22 14 20 17 22 15 20 18 22 15 21 10 22 4 1 11 22 5 1 12 22 6 1 23 21 8 10 12 13 16 1 13 13 17 1 14 14 18 2 7 22 15 22 20 22 26 22 1 1 9 1 13 1 20 1 8 22 11 21 9 22 10 20 13 22 11 20 14 22 11 21 21 22 23 21 25 22 23 21 5 2 2 1 5 3 3 1 6 3 7 1 5 2 8 1 16 2 14 1 16 3 15 1 17 3 19 1 10 22 4 1 11 22 5 1 12 22 6 1 7 22 15 22 1 1 16 1 16 1 18 7 8 22 11 21 9 22 10 20 13 22 11 20 14 22 11 21 5 2 2 1 5 3 3 1 6 3 7 1 5 2 8 1 11 1 16 2 13 1 17 4 15 1 18 7 10 22 4 2 10 21 11 3 11 3 11 1 11 22 12 3 12 22 13 4 24 22 13 4 13 4 11 1 24 22 18 1 25 22 19 1 26 22 20 1 7 22 12 22 24 22 29 22 1 1 7 1 15 1 23 1 8 22 10 21 9 22 10 20 27 22 25 20 28 22 25 21 4 2 2 1 4 2 6 1 19 2 16 1 19 3 17 1 20 3 21 1 19 2 22 1 10 22 4 2 10 22 17 1 11 22 17 4 12 22 18 4 23 21 18 4 18 4 17 1 7 22 12 22 20 22 26 22 1 1 7 1 8 22 11 21 9 22 11 20 21 22 23 21 25 22 23 21 4 2 2 1 4 2 6 1 10 22 7 21 7 21 5 19 5 19 3 16 3 16 2 13 2 13 1 9 1 9 1 6 1 6 2 3 2 3 3 2 3 2 5 1 5 1 8 1 8 1 11 2 11 2 13 4 13 4 15 7 15 7 16 10 16 10 17 14 17 14 17 17 17 17 16 20 16 20 15 21 15 21 13 22 13 22 10 22 6 19 4 16 4 16 3 13 3 13 2 9 2 9 2 5 2 5 3 3 12 4 14 7 14 7 15 10 15 10 16 14 16 14 16 18 16 18 15 20 10 22 8 21 8 21 6 18 6 18 5 16 5 16 4 13 4 13 3 9 3 9 3 4 3 4 4 2 4 2 5 1 8 1 10 2 10 2 12 5 12 5 13 7 13 7 14 10 14 10 15 14 15 14 15 19 15 19 14 21 14 21 13 22 10 22 4 1 11 22 5 1 12 22 6 1 7 22 19 22 19 22 22 21 22 21 23 19 23 19 23 17 23 17 22 14 22 14 20 12 20 12 16 11 16 11 8 11 21 21 22 19 22 19 22 17 22 17 21 14 21 14 19 12 19 22 20 21 20 21 21 19 21 19 21 17 21 17 20 14 20 14 18 12 18 12 16 11 1 1 9 1 8 22 11 21 9 22 10 20 13 22 11 20 14 22 11 21 5 2 2 1 5 3 3 1 6 3 7 1 5 2 8 1 10 27 7 26 7 26 5 24 5 24 3 21 3 21 2 18 2 18 1 14 1 14 1 11 1 11 2 8 2 8 3 7 3 7 5 6 5 6 8 6 8 6 11 7 11 7 13 9 13 9 15 12 15 12 16 15 16 15 17 19 17 19 17 22 17 22 16 25 16 25 15 26 15 26 13 27 13 27 10 27 6 24 4 21 4 21 3 18 3 18 2 14 2 14 2 10 2 10 3 8 12 9 14 12 14 12 15 15 15 15 16 19 16 19 16 23 16 23 15 25 10 27 8 26 8 26 6 23 6 23 5 21 5 21 4 18 4 18 3 14 3 14 3 9 3 9 4 7 4 7 5 6 8 6 10 7 10 7 12 10 12 10 13 12 13 12 14 15 14 15 15 19 15 19 15 24 15 24 14 26 14 26 13 27 3 9 4 11 4 11 6 12 6 12 7 12 7 12 9 11 9 11 10 9 10 9 11 4 11 4 12 3 12 3 13 3 13 3 14 4 11 3 12 2 12 2 13 2 10 9 10 2 10 2 11 1 11 1 13 1 13 1 14 4 14 4 14 5 10 22 4 1 11 22 5 1 12 22 6 1 7 22 18 22 18 22 21 21 21 21 22 19 22 19 22 17 22 17 21 14 21 14 20 13 20 13 17 12 17 12 9 12 20 21 21 19 21 19 21 17 21 17 20 14 20 14 19 13 18 22 19 21 19 21 20 19 20 19 20 17 20 17 19 14 19 14 17 12 13 12 15 11 15 11 16 10 16 10 18 4 18 4 19 3 19 3 20 3 20 3 21 4 18 3 19 2 19 2 20 2 16 10 17 2 17 2 18 1 18 1 20 1 20 1 21 4 21 4 21 5 1 1 9 1 8 22 11 21 9 22 10 20 13 22 11 20 14 22 11 21 5 2 2 1 5 3 3 1 6 3 7 1 5 2 8 1 18 20 19 20 19 20 20 22 20 22 19 16 19 16 19 18 19 18 18 20 18 20 17 21 17 21 14 22 14 22 10 22 10 22 7 21 7 21 5 19 5 19 5 16 5 16 6 14 6 14 8 12 8 12 14 9 14 9 15 7 15 7 15 4 15 4 14 2 6 16 7 14 7 14 14 10 14 10 15 8 7 21 6 19 6 19 6 17 6 17 7 15 7 15 13 12 13 12 15 10 15 10 16 8 16 8 16 5 16 5 15 3 15 3 14 2 14 2 11 1 11 1 7 1 7 1 4 2 4 2 3 3 3 3 2 5 2 5 2 7 2 7 1 1 1 1 2 3 2 3 3 3 10 22 4 1 11 22 5 1 12 22 6 1 3 22 1 16 19 22 18 16 3 22 19 22 1 1 9 1 4 22 1 16 6 22 2 19 8 22 3 21 15 22 18 21 16 22 18 20 17 22 18 19 18 22 18 16 5 2 2 1 5 3 3 1 6 3 7 1 5 2 8 1 5 22 2 11 2 11 1 7 1 7 1 4 1 4 2 2 2 2 5 1 5 1 9 1 9 1 12 2 12 2 14 4 14 4 15 7 15 7 19 21 6 22 3 11 3 11 2 7 2 7 2 3 2 3 3 2 7 22 4 11 4 11 3 7 3 7 3 3 3 3 5 1 2 22 10 22 16 22 22 22 3 22 6 21 4 22 5 20 8 22 6 20 9 22 6 21 17 22 19 21 21 22 19 21 3 22 3 20 3 20 4 3 4 3 4 1 4 21 5 4 5 22 6 5 16 21 4 1 1 22 8 22 13 22 19 22 2 22 3 20 6 22 5 20 7 22 4 21 14 22 16 21 18 22 16 21 4 22 4 20 4 20 2 3 2 3 2 1 5 21 3 4 6 22 4 5 12 22 4 5 4 5 2 1 12 22 12 20 12 20 10 3 10 3 10 1 13 21 11 4 14 22 12 5 20 21 12 5 12 5 10 1 1 22 9 22 12 22 14 22 17 22 23 22 2 22 5 21 3 22 4 20 7 22 5 19 8 22 5 21 18 22 20 21 22 22 20 21 9 22 15 1 10 22 16 1 11 22 17 1 22 21 4 2 7 22 14 22 19 22 25 22 1 1 7 1 12 1 19 1 8 22 10 20 12 22 11 20 13 22 11 21 20 22 22 21 24 22 22 21 4 2 2 1 4 2 6 1 15 2 13 1 15 3 14 1 16 3 18 1 3 22 7 12 7 12 4 1 4 22 8 12 8 12 5 1 5 22 9 12 9 12 6 1 18 21 9 12 1 22 8 22 15 22 21 22 1 1 9 1 2 22 4 21 6 22 5 20 7 22 4 21 16 22 18 21 20 22 18 21 5 2 2 1 5 3 3 1 6 3 7 1 5 2 8 1 19 22 1 1 20 22 2 1 21 22 3 1 21 22 7 22 7 22 5 16 1 1 15 1 15 1 17 7 8 22 5 16 9 22 6 19 11 22 7 21 11 1 15 2 13 1 16 4 14 1 17 7 14 15 12 8 12 8 12 4 12 4 13 2 13 2 14 1 14 1 16 1 16 1 18 3 18 3 19 5 15 15 13 8 13 8 13 2 14 15 16 15 16 15 14 8 14 8 13 4 12 8 12 11 12 11 11 14 11 14 9 15 9 15 7 15 7 15 4 14 4 14 2 11 2 11 1 8 1 8 1 6 1 6 2 3 2 3 3 2 3 2 5 1 5 1 7 1 7 1 9 2 9 2 10 3 10 3 11 5 11 5 12 8 5 14 3 11 3 11 2 8 2 8 2 5 2 5 3 3 7 15 5 13 5 13 4 11 4 11 3 8 3 8 3 5 3 5 4 2 4 2 5 1 4 22 2 15 2 15 1 9 1 9 1 5 1 5 2 3 2 3 3 2 3 2 5 1 5 1 7 1 7 1 10 2 10 2 12 5 12 5 13 8 13 8 13 10 13 10 12 13 12 13 11 14 11 14 9 15 9 15 7 15 7 15 5 14 5 14 4 13 4 13 3 11 3 11 2 8 5 22 3 15 3 15 2 11 2 11 2 5 2 5 3 2 10 3 11 5 11 5 12 8 12 8 12 11 12 11 11 13 1 22 6 22 6 22 4 15 4 15 2 8 7 1 9 3 9 3 10 5 10 5 11 8 11 8 11 11 11 11 10 14 10 14 9 15 2 22 5 21 3 22 4 20 12 11 12 12 12 12 11 12 11 12 11 10 11 10 13 10 13 10 13 12 13 12 12 14 12 14 10 15 10 15 7 15 7 15 4 14 4 14 2 11 2 11 1 8 1 8 1 6 1 6 2 3 2 3 3 2 3 2 5 1 5 1 7 1 7 1 10 2 10 2 12 5 4 13 3 11 3 11 2 8 2 8 2 5 2 5 3 3 7 15 5 13 5 13 4 11 4 11 3 8 3 8 3 5 3 5 4 2 4 2 5 1 16 22 13 11 13 11 12 7 12 7 12 4 12 4 13 2 13 2 14 1 14 1 16 1 16 1 18 3 18 3 19 5 17 22 14 11 14 11 13 7 13 7 13 2 13 22 18 22 18 22 14 8 14 8 13 4 12 8 12 11 12 11 11 14 11 14 9 15 9 15 7 15 7 15 4 14 4 14 2 11 2 11 1 8 1 8 1 6 1 6 2 3 2 3 3 2 3 2 5 1 5 1 7 1 7 1 9 2 9 2 10 3 10 3 11 5 11 5 12 8 4 13 3 11 3 11 2 8 2 8 2 5 2 5 3 3 7 15 5 13 5 13 4 11 4 11 3 8 3 8 3 5 3 5 4 2 4 2 5 1 14 22 17 21 15 22 16 20 2 6 6 7 6 7 9 8 9 8 12 10 12 10 13 12 13 12 12 14 12 14 10 15 10 15 7 15 7 15 4 14 4 14 2 11 2 11 1 8 1 8 1 6 1 6 2 3 2 3 3 2 3 2 5 1 5 1 7 1 7 1 10 2 10 2 12 4 4 13 3 11 3 11 2 8 2 8 2 5 2 5 3 3 7 15 5 13 5 13 4 11 4 11 3 8 3 8 3 5 3 5 4 2 4 2 5 1 19 27 19 28 19 28 18 28 18 28 18 26 18 26 20 26 20 26 20 28 20 28 19 29 19 29 17 29 17 29 15 28 15 28 13 26 13 26 12 24 12 24 11 21 11 21 10 17 10 17 8 8 8 8 7 5 7 5 6 3 6 3 4 1 13 25 12 22 12 22 11 17 11 17 9 8 9 8 8 5 17 29 15 27 15 27 14 25 14 25 13 22 13 22 12 17 12 17 10 9 10 9 9 6 9 6 8 4 8 4 6 2 6 2 4 1 4 1 2 1 2 1 1 2 1 2 1 4 1 4 3 4 3 4 3 2 3 2 2 2 2 2 2 3 7 22 18 22 16 22 12 8 12 8 11 5 11 5 9 2 9 2 7 1 17 22 13 8 13 8 11 4 16 22 18 22 18 22 14 8 14 8 12 4 12 4 10 2 10 2 7 1 7 1 4 1 4 1 2 2 2 2 1 3 1 3 1 5 1 5 3 5 3 5 3 3 3 3 2 3 2 3 2 4 14 15 14 18 14 18 13 21 13 21 11 22 11 22 9 22 9 22 6 21 6 21 4 18 4 18 3 15 3 15 3 13 3 13 4 10 4 10 5 9 5 9 7 8 7 8 9 8 9 8 11 9 11 9 12 10 12 10 13 12 13 12 14 15 6 20 5 18 5 18 4 15 4 15 4 12 4 12 5 10 9 22 7 20 7 20 6 18 6 18 5 15 5 15 5 12 5 12 6 9 6 9 7 8 7 22 1 1 1 1 3 1 8 22 2 1 4 22 9 22 9 22 3 1 5 8 7 12 7 12 9 14 9 14 11 15 11 15 13 15 13 15 15 14 15 14 16 12 16 12 16 9 16 9 14 4 15 14 15 10 15 10 14 6 14 6 14 2 15 12 13 7 13 7 13 4 13 4 14 2 14 2 15 1 15 1 17 1 17 1 19 3 19 3 20 5 5 22 8 21 6 22 7 20 8 22 8 20 8 20 10 20 10 20 10 22 10 22 8 22 9 22 9 20 8 21 10 21 1 11 2 13 2 13 4 15 4 15 6 15 6 15 7 14 7 14 8 12 8 12 8 9 8 9 6 4 7 14 7 10 7 10 6 6 6 6 6 2 7 12 5 7 5 7 5 4 5 4 6 2 6 2 7 1 7 1 9 1 9 1 11 3 11 3 12 5 13 29 13 27 13 27 15 27 15 27 15 29 15 29 13 29 14 29 14 27 13 28 15 28 5 18 6 20 6 20 8 22 8 22 10 22 10 22 11 21 11 21 12 19 12 19 12 16 12 16 10 9 10 9 9 6 9 6 8 4 8 4 6 2 6 2 4 1 4 1 2 1 2 1 1 2 1 2 1 4 1 4 3 4 3 4 3 2 3 2 2 2 2 2 2 3 11 21 11 16 11 16 9 9 9 9 8 6 8 6 7 4 11 19 10 15 10 15 8 8 8 8 7 5 7 5 6 3 6 3 4 1 7 22 1 1 1 1 3 1 8 22 2 1 4 22 9 22 9 22 3 1 17 13 17 14 17 14 16 14 16 14 16 12 16 12 18 12 18 12 18 14 18 14 17 15 17 15 15 15 15 15 13 14 13 14 9 10 9 10 7 9 5 9 7 9 7 9 9 8 9 8 10 7 10 7 12 3 12 3 13 2 13 2 15 2 9 7 11 3 11 3 12 2 7 9 8 8 8 8 10 2 10 2 11 1 11 1 13 1 13 1 15 2 15 2 17 5 5 22 8 21 6 22 7 20 5 22 2 11 2 11 1 7 1 7 1 4 1 4 2 2 2 2 3 1 3 1 5 1 5 1 7 3 7 3 8 5 6 22 3 11 3 11 2 7 2 7 2 2 2 22 7 22 7 22 3 8 3 8 2 4 3 22 6 21 4 22 5 20 1 11 2 13 2 13 4 15 4 15 6 15 6 15 7 14 7 14 8 12 8 12 8 9 8 9 6 1 7 14 7 9 7 9 5 1 7 12 6 8 6 8 4 1 4 1 6 1 8 9 10 12 10 12 12 14 12 14 14 15 14 15 16 15 16 15 18 14 18 14 19 12 19 12 19 9 19 9 17 1 18 14 18 9 18 9 16 1 18 12 17 8 17 8 15 1 15 1 17 1 19 9 21 12 21 12 23 14 23 14 25 15 25 15 27 15 27 15 29 14 29 14 30 12 30 12 30 9 30 9 28 4 29 14 29 10 29 10 28 6 28 6 28 2 29 12 27 7 27 7 27 4 27 4 28 2 28 2 29 1 29 1 31 1 31 1 33 3 33 3 34 5 1 11 2 13 2 13 4 15 4 15 6 15 6 15 7 14 7 14 8 12 8 12 8 9 8 9 6 1 7 14 7 9 7 9 5 1 7 12 6 8 6 8 4 1 4 1 6 1 8 9 10 12 10 12 12 14 12 14 14 15 14 15 16 15 16 15 18 14 18 14 19 12 19 12 19 9 19 9 17 4 18 14 18 10 18 10 17 6 17 6 17 2 18 12 16 7 16 7 16 4 16 4 17 2 17 2 18 1 18 1 20 1 20 1 22 3 22 3 23 5 7 15 4 14 4 14 2 11 2 11 1 8 1 8 1 6 1 6 2 3 2 3 3 2 3 2 6 1 6 1 9 1 9 1 12 2 12 2 14 5 14 5 15 8 15 8 15 10 15 10 14 13 14 13 13 14 13 14 10 15 10 15 7 15 4 13 3 11 3 11 2 8 2 8 2 5 2 5 3 3 12 3 13 5 13 5 14 8 14 8 14 11 14 11 13 13 7 15 5 13 5 13 4 11 4 11 3 8 3 8 3 5 3 5 4 2 4 2 6 1 9 1 11 3 11 3 12 5 12 5 13 8 13 8 13 11 13 11 12 14 12 14 10 15 3 18 4 20 4 20 6 22 6 22 8 22 8 22 9 21 9 21 10 19 10 19 10 16 10 16 9 12 9 12 6 1 9 21 9 16 9 16 8 12 8 12 5 1 9 19 8 15 8 15 4 1 10 15 11 18 11 18 12 20 12 20 13 21 13 21 15 22 15 22 17 22 17 22 19 21 19 21 20 20 20 20 21 17 21 17 21 15 21 15 20 12 20 12 18 9 18 9 15 8 15 8 13 8 13 8 11 9 11 9 10 12 10 12 10 15 19 20 20 18 20 18 20 15 20 15 19 12 19 12 18 10 17 22 18 21 18 21 19 18 19 18 19 15 19 15 18 12 18 12 17 10 17 10 15 8 1 1 9 1 5 2 2 1 5 3 3 1 6 3 7 1 5 2 8 1 14 22 8 1 15 22 9 1 14 22 16 22 16 22 10 1 12 15 12 18 12 18 11 21 11 21 9 22 9 22 7 22 7 22 4 21 4 21 2 18 2 18 1 15 1 15 1 13 1 13 2 10 2 10 3 9 3 9 5 8 5 8 7 8 7 8 9 9 9 9 10 10 10 10 11 12 11 12 12 15 4 20 3 18 3 18 2 15 2 15 2 12 2 12 3 10 7 22 5 20 5 20 4 18 4 18 3 15 3 15 3 12 3 12 4 9 4 9 5 8 5 1 13 1 9 2 6 1 9 3 7 1 10 3 11 1 9 2 12 1 1 11 2 13 2 13 4 15 4 15 6 15 6 15 7 14 7 14 8 12 8 12 8 8 8 8 6 1 7 14 7 8 7 8 5 1 7 12 6 8 6 8 4 1 4 1 6 1 16 13 16 14 16 14 15 14 15 14 15 12 15 12 17 12 17 12 17 14 17 14 16 15 16 15 14 15 14 15 12 14 12 14 10 12 10 12 8 8 13 12 13 13 13 13 12 13 12 13 12 11 12 11 14 11 14 11 14 13 14 13 13 14 13 14 10 15 10 15 7 15 7 15 4 14 4 14 3 13 3 13 3 11 3 11 4 9 4 9 6 8 6 8 9 7 9 7 11 6 11 6 12 4 4 14 3 11 4 10 6 9 6 9 9 8 9 8 11 7 12 6 11 2 3 13 4 11 4 11 6 10 6 10 9 9 9 9 11 8 11 8 12 6 12 6 12 4 12 4 11 2 11 2 8 1 8 1 5 1 5 1 2 2 2 2 1 3 1 3 1 5 1 5 3 5 3 5 3 3 3 3 2 3 2 3 2 4 7 22 4 11 4 11 3 7 3 7 3 4 3 4 4 2 4 2 5 1 5 1 7 1 7 1 9 3 9 3 10 5 8 22 5 11 5 11 4 7 4 7 4 2 7 22 9 22 9 22 5 8 5 8 4 4 1 15 11 15 1 11 2 13 2 13 4 15 4 15 6 15 6 15 7 14 7 14 8 12 8 12 8 9 8 9 6 4 7 14 7 10 7 10 6 6 6 6 6 2 7 12 5 7 5 7 5 4 5 4 6 2 6 2 8 1 8 1 10 1 10 1 12 2 12 2 14 4 14 4 16 7 18 15 16 7 16 7 16 4 16 4 17 2 17 2 18 1 18 1 20 1 20 1 22 3 22 3 23 5 19 15 17 7 17 7 17 2 18 15 20 15 20 15 18 8 18 8 17 4 1 11 2 13 2 13 4 15 4 15 6 15 6 15 7 14 7 14 8 12 8 12 8 9 8 9 6 4 7 14 7 10 7 10 6 6 6 6 6 2 7 12 5 7 5 7 5 4 5 4 6 2 6 2 8 1 8 1 10 1 10 1 12 2 12 2 14 4 14 4 16 7 16 7 17 11 17 11 17 15 17 15 16 15 16 15 16 14 16 14 17 12 1 11 2 13 2 13 4 15 4 15 6 15 6 15 7 14 7 14 8 12 8 12 8 9 8 9 6 4 7 14 7 10 7 10 6 6 6 6 6 2 7 12 5 7 5 7 5 4 5 4 6 2 6 2 8 1 8 1 10 1 10 1 12 2 12 2 14 4 14 4 15 7 17 15 15 7 15 7 15 4 15 4 16 2 16 2 18 1 18 1 20 1 20 1 22 2 22 2 24 4 24 4 26 7 26 7 27 11 27 11 27 15 27 15 26 15 26 15 26 14 26 14 27 12 18 15 16 7 16 7 16 2 17 15 19 15 19 15 17 8 17 8 16 4 3 11 5 14 5 14 7 15 7 15 9 15 9 15 11 14 11 14 12 12 12 12 12 10 9 15 10 14 10 14 10 10 10 10 9 6 9 6 8 4 8 4 6 2 6 2 4 1 4 1 2 1 2 1 1 2 1 2 1 4 1 4 3 4 3 4 3 2 3 2 2 2 2 2 2 3 11 13 11 10 11 10 10 6 10 6 10 3 19 13 19 14 19 14 18 14 18 14 18 12 18 12 20 12 20 12 20 14 20 14 19 15 19 15 17 15 17 15 15 14 15 14 13 12 13 12 12 10 12 10 11 6 11 6 11 2 11 2 12 1 9 6 9 4 9 4 10 2 10 2 12 1 12 1 14 1 14 1 16 2 16 2 18 5 1 18 2 20 2 20 4 22 4 22 6 22 6 22 7 21 7 21 8 19 8 19 8 16 8 16 6 11 7 21 7 17 7 17 6 13 6 13 6 9 7 19 5 14 5 14 5 11 5 11 6 9 6 9 8 8 8 8 10 8 10 8 12 9 12 9 14 11 14 11 16 15 18 22 14 8 14 8 13 5 13 5 11 2 11 2 9 1 19 22 15 8 15 8 13 4 18 22 20 22 20 22 16 8 16 8 14 4 14 4 12 2 12 2 9 1 9 1 6 1 6 1 4 2 4 2 3 3 3 3 3 5 3 5 5 5 5 5 5 3 5 3 4 3 4 3 4 4 15 15 14 13 14 13 12 11 12 11 4 5 4 5 2 3 2 3 1 1 14 13 5 13 5 13 3 12 3 12 2 10 12 13 8 14 8 14 5 14 5 14 4 13 12 13 8 15 8 15 5 15 5 15 3 13 3 13 2 10 2 3 11 3 11 3 13 4 13 4 14 6 4 3 8 2 8 2 11 2 11 2 12 3 4 3 8 1 8 1 11 1 11 1 13 3 13 3 14 6 10 22 7 21 7 21 5 19 5 19 3 16 3 16 2 13 2 13 1 9 1 9 1 6 1 6 2 3 2 3 3 2 3 2 5 1 5 1 7 1 7 1 10 2 10 2 12 4 12 4 14 7 14 7 15 10 15 10 16 14 16 14 16 17 16 17 15 20 15 20 14 21 14 21 12 22 12 22 10 22 7 20 5 18 5 18 4 16 4 16 3 13 3 13 2 9 2 9 2 5 2 5 3 3 10 3 12 5 12 5 13 7 13 7 14 10 14 10 15 14 15 14 15 18 15 18 14 20 10 22 8 21 8 21 6 18 6 18 5 16 5 16 4 13 4 13 3 9 3 9 3 4 3 4 4 2 4 2 5 1 7 1 9 2 9 2 11 5 11 5 12 7 12 7 13 10 13 10 14 14 14 14 14 19 14 19 13 21 13 21 12 22 6 18 1 1 1 1 3 1 9 22 7 18 7 18 2 1 9 22 3 1 9 22 6 19 6 19 3 17 3 17 1 16 6 18 4 17 4 17 1 16 7 17 7 18 7 18 8 18 8 18 8 16 8 16 6 16 6 16 6 18 6 18 7 20 7 20 8 21 8 21 11 22 11 22 14 22 14 22 17 21 17 21 18 19 18 19 18 17 18 17 17 15 17 15 15 13 15 13 5 7 5 7 3 5 3 5 1 1 16 21 17 19 17 19 17 17 17 17 16 15 16 15 14 13 14 13 11 11 14 22 15 21 15 21 16 19 16 19 16 17 16 17 15 15 15 15 13 13 13 13 5 7 2 3 3 4 3 4 5 4 5 4 10 3 10 3 15 3 15 3 16 4 5 4 10 2 10 2 15 2 5 4 10 1 10 1 13 1 13 1 15 2 15 2 16 4 16 4 16 5 6 17 6 18 6 18 7 18 7 18 7 16 7 16 5 16 5 16 5 18 5 18 6 20 6 20 7 21 7 21 10 22 10 22 13 22 13 22 16 21 16 21 17 19 17 19 17 17 17 17 16 15 16 15 15 14 15 14 13 13 13 13 10 12 15 21 16 19 16 19 16 17 16 17 15 15 15 15 14 14 13 22 14 21 14 21 15 19 15 19 15 17 15 17 14 15 14 15 12 13 12 13 10 12 8 12 10 12 10 12 13 11 13 11 14 10 14 10 15 8 15 8 15 5 15 5 14 3 14 3 12 2 12 2 9 1 9 1 6 1 6 1 3 2 3 2 2 3 2 3 1 5 1 5 1 7 1 7 3 7 3 7 3 5 3 5 2 5 2 5 2 6 13 10 14 8 14 8 14 5 14 5 13 3 10 12 12 11 12 11 13 9 13 9 13 5 13 5 12 3 12 3 11 2 11 2 9 1 14 18 9 1 9 1 11 1 17 22 15 18 15 18 10 1 17 22 11 1 17 22 1 7 1 7 17 7 8 22 3 12 8 22 18 22 8 21 16 21 7 20 12 20 12 20 16 21 16 21 18 22 3 12 4 13 4 13 7 14 7 14 10 14 10 14 13 13 13 13 14 12 14 12 15 10 15 10 15 7 15 7 14 4 14 4 12 2 12 2 8 1 8 1 5 1 5 1 3 2 3 2 2 3 2 3 1 5 1 5 1 7 1 7 3 7 3 7 3 5 3 5 2 5 2 5 2 6 13 12 14 10 14 10 14 7 14 7 13 4 13 4 11 2 10 14 12 13 12 13 13 11 13 11 13 7 13 7 12 4 12 4 10 2 10 2 8 1 15 18 15 19 15 19 14 19 14 19 14 17 14 17 16 17 16 17 16 19 16 19 15 21 15 21 13 22 13 22 10 22 10 22 7 21 7 21 5 19 5 19 3 16 3 16 2 13 2 13 1 9 1 9 1 6 1 6 2 3 2 3 3 2 3 2 5 1 5 1 8 1 8 1 11 2 11 2 13 4 13 4 14 6 14 6 14 9 14 9 13 11 13 11 12 12 12 12 10 13 10 13 7 13 7 13 5 12 5 12 4 11 4 11 3 9 6 19 4 16 4 16 3 13 3 13 2 9 2 9 2 5 2 5 3 3 12 4 13 6 13 6 13 9 13 9 12 11 10 22 8 21 8 21 6 18 6 18 5 16 5 16 4 13 4 13 3 9 3 9 3 4 3 4 4 2 4 2 5 1 8 1 10 2 10 2 11 3 11 3 12 6 12 6 12 10 12 10 11 12 11 12 10 13 3 22 1 16 16 22 15 19 15 19 13 16 13 16 9 11 9 11 7 8 7 8 6 5 6 5 5 1 7 9 5 5 5 5 4 1 13 16 7 10 7 10 5 7 5 7 4 5 4 5 3 1 3 1 5 1 2 19 5 22 5 22 7 22 7 22 12 19 4 21 7 21 7 21 12 19 2 19 4 20 4 20 7 20 7 20 12 19 12 19 14 19 14 19 15 20 15 20 16 22 10 22 7 21 7 21 6 20 6 20 5 18 5 18 5 15 5 15 6 13 6 13 8 12 8 12 11 12 11 12 14 13 14 13 16 14 16 14 17 16 17 16 17 19 17 19 16 21 16 21 14 22 14 22 10 22 12 22 7 21 7 20 6 18 6 18 6 14 6 14 7 13 6 13 9 12 10 12 14 13 15 14 16 16 16 16 16 19 16 19 15 21 16 21 12 22 10 22 8 20 8 20 7 18 7 18 7 14 7 14 8 12 11 12 13 13 13 13 14 14 14 14 15 16 15 16 15 20 15 20 14 22 8 12 4 11 4 11 2 9 2 9 1 7 1 7 1 4 1 4 2 2 2 2 5 1 5 1 9 1 9 1 13 2 13 2 14 3 14 3 15 5 15 5 15 8 15 8 14 10 14 10 13 11 13 11 11 12 9 12 4 11 5 11 3 9 3 9 2 7 2 7 2 4 2 4 3 2 2 2 7 1 7 1 13 2 13 3 14 5 14 5 14 8 14 8 13 10 13 11 10 12 8 12 6 11 6 11 4 9 4 9 3 7 3 7 3 4 3 4 4 2 4 2 5 1 9 1 11 2 11 2 12 3 12 3 13 5 13 5 13 9 13 9 12 11 12 11 11 12 14 14 13 12 13 12 12 11 12 11 10 10 10 10 7 10 7 10 5 11 5 11 4 12 4 12 3 14 3 14 3 17 3 17 4 19 4 19 6 21 6 21 9 22 9 22 12 22 12 22 14 21 14 21 15 20 15 20 16 17 16 17 16 14 16 14 15 10 15 10 14 7 14 7 12 4 12 4 10 2 10 2 7 1 7 1 4 1 4 1 2 2 2 2 1 4 1 4 1 6 1 6 3 6 3 6 3 4 3 4 2 4 2 4 2 5 5 12 4 14 4 14 4 17 4 17 5 19 14 20 15 18 15 18 15 14 15 14 14 10 14 10 13 7 13 7 11 4 7 10 6 11 6 11 5 13 5 13 5 17 5 17 6 20 6 20 7 21 7 21 9 22 12 22 13 21 13 21 14 19 14 19 14 14 14 14 13 10 13 10 12 7 12 7 11 5 11 5 9 2 9 2 7 1 2 4 1 3 1 3 1 2 1 2 2 1 2 1 3 1 3 1 4 2 4 2 4 3 4 3 3 4 3 4 2 4 2 3 2 2 2 2 3 2 3 2 3 3 3 3 2 3 4 5 3 5 3 5 2 6 2 6 2 7 2 7 3 8 3 8 4 8 4 8 5 7 5 7 5 5 5 5 4 3 4 3 3 2 3 2 1 1 3 7 3 6 3 6 4 6 4 6 4 7 4 7 3 7 4 5 4 4 4 4 3 2 5 15 4 14 4 14 4 13 4 13 5 12 5 12 6 12 6 12 7 13 7 13 7 14 7 14 6 15 6 15 5 15 5 14 5 13 5 13 6 13 6 13 6 14 6 14 5 14 2 4 1 3 1 3 1 2 1 2 2 1 2 1 3 1 3 1 4 2 4 2 4 3 4 3 3 4 3 4 2 4 2 3 2 2 2 2 3 2 3 2 3 3 3 3 2 3 6 19 5 18 5 18 5 17 5 17 6 16 6 16 7 16 7 16 8 17 8 17 8 18 8 18 7 19 7 19 6 19 6 18 6 17 6 17 7 17 7 17 7 18 7 18 6 18 4 5 3 5 3 5 2 6 2 6 2 7 2 7 3 8 3 8 4 8 4 8 5 7 5 7 5 5 5 5 4 3 4 3 3 2 3 2 1 1 3 7 3 6 3 6 4 6 4 6 4 7 4 7 3 7 4 5 4 4 4 4 3 2 8 22 7 22 7 22 6 21 6 21 4 8 8 21 7 21 7 21 4 8 8 21 8 20 8 20 4 8 8 22 9 21 9 21 9 20 9 20 4 8 2 4 1 3 1 3 1 2 1 2 2 1 2 1 3 1 3 1 4 2 4 2 4 3 4 3 3 4 3 4 2 4 2 3 2 2 2 2 3 2 3 2 3 3 3 3 2 3 2 17 2 18 2 18 3 18 3 18 3 16 3 16 1 16 1 16 1 18 1 18 2 20 2 20 3 21 3 21 6 22 6 22 10 22 10 22 13 21 13 21 14 19 14 19 14 17 14 17 13 15 13 15 12 14 12 14 10 13 10 13 6 12 6 12 4 11 4 11 4 9 4 9 6 8 6 8 7 8 8 22 13 21 12 21 13 19 13 19 13 17 13 17 12 15 12 15 11 14 11 14 9 13 10 22 11 21 11 21 12 19 12 19 12 17 12 17 11 15 11 15 10 14 10 14 6 12 6 12 5 11 5 11 5 9 5 9 6 8 3 4 2 3 2 3 2 2 2 2 3 1 3 1 4 1 4 1 5 2 5 2 5 3 5 3 4 4 4 4 3 4 3 3 3 2 3 2 4 2 4 2 4 3 4 3 3 3 5 8 3 7 3 7 2 6 2 6 1 4 1 4 1 2 1 2 2 1 2 1 3 1 3 1 4 2 4 2 4 3 4 3 3 4 3 4 2 4 3 7 2 5 2 5 2 4 2 3 2 2 2 2 3 2 3 2 3 3 3 3 2 3 4 5 3 5 3 5 2 6 2 6 2 7 2 7 3 8 3 8 4 8 4 8 5 7 5 7 5 5 5 5 4 3 4 3 3 2 3 2 1 1 3 7 3 6 3 6 4 6 4 6 4 7 4 7 3 7 4 5 4 4 4 4 3 2 22 13 22 14 22 14 21 14 21 14 21 12 21 12 23 12 23 12 23 14 23 14 22 15 22 15 21 15 21 15 19 14 19 14 17 12 17 12 12 4 12 4 10 2 10 2 8 1 8 1 5 1 5 1 2 2 2 2 1 4 1 4 1 6 1 6 2 8 2 8 3 9 3 9 5 10 5 10 10 12 10 12 12 13 12 13 14 15 14 15 15 17 15 17 15 19 15 19 14 21 14 21 12 22 12 22 10 21 10 21 9 19 9 19 9 16 9 16 10 10 10 10 11 7 11 7 12 5 12 5 14 2 14 2 16 1 16 1 18 1 18 1 19 3 19 3 19 4 6 1 2 2 3 2 2 4 2 4 2 6 2 6 3 8 3 8 4 9 4 9 6 10 10 12 11 9 11 9 14 3 14 3 16 2 5 1 4 2 4 2 3 4 3 4 3 6 3 6 4 8 4 8 5 9 5 9 7 10 7 10 12 13 9 16 10 13 10 13 11 10 11 10 13 6 13 6 15 3 15 3 17 2 17 2 18 2 18 2 19 3 11 30 3 1 16 30 8 1 17 21 17 22 17 22 16 22 16 22 16 20 16 20 18 20 18 20 18 22 18 22 17 24 17 24 16 25 16 25 13 26 13 26 9 26 9 26 6 25 6 25 4 23 4 23 4 20 4 20 5 18 5 18 7 16 7 16 13 13 13 13 14 11 14 11 14 8 14 8 13 6 5 20 6 18 6 18 13 14 13 14 14 12 6 25 5 23 5 23 5 21 5 21 6 19 6 19 12 16 12 16 14 14 14 14 15 12 15 12 15 9 15 9 14 7 14 7 13 6 13 6 10 5 10 5 6 5 6 5 3 6 3 6 2 7 2 7 1 9 1 9 1 11 1 11 3 11 3 11 3 9 3 9 2 9 2 9 2 10 27 33 1 1 1 1 2 1 27 33 28 33 28 33 2 1 14 33 12 32 12 32 9 30 9 30 6 27 6 27 4 24 4 24 2 20 2 20 1 16 1 16 1 11 1 11 2 7 2 7 3 4 3 4 5 1 7 27 5 24 5 24 3 20 3 20 2 15 2 15 2 7 14 33 11 31 11 31 8 28 8 28 6 25 6 25 5 23 5 23 4 20 4 20 3 16 3 16 2 7 2 15 3 6 3 6 4 3 4 3 5 1 10 33 12 30 12 30 13 27 13 27 14 23 14 23 14 18 14 18 13 14 13 14 11 10 11 10 9 7 9 7 6 4 6 4 3 2 3 2 1 1 13 27 13 19 13 19 12 14 12 14 10 10 10 10 8 7 10 33 11 31 11 31 12 28 12 28 13 19 13 27 12 18 12 18 11 14 11 14 10 11 10 11 9 9 9 9 7 6 7 6 4 3 4 3 1 1 6 13 5 12 5 12 7 2 7 2 6 1 6 13 6 1 6 13 7 12 7 12 5 2 5 2 6 1 1 10 2 10 2 10 10 4 10 4 11 4 1 10 11 4 1 10 1 9 1 9 11 5 11 5 11 4 11 10 10 10 10 10 2 4 2 4 1 4 11 10 1 4 11 10 11 9 11 9 1 5 1 5 1 4 1 2 18 2 18 2 18 1 1 2 1 1 1 1 18 1 9 18 9 1 9 1 10 1 9 18 10 18 10 18 10 1 1 10 18 10 18 10 18 9 1 10 1 9 1 9 18 9 1 10 18 10 18 10 18 9 1 10 1 9 1 9 18 9 1 2 18 2 18 2 18 1 1 2 1 1 1 1 18 1 4 8 3 7 3 7 1 1 4 7 1 1 4 8 5 7 5 7 1 1 4 8 3 7 3 7 1 1 4 7 1 1 4 8 5 7 5 7 1 1 14 8 13 7 13 7 11 1 14 7 11 1 14 8 15 7 15 7 11 1 4 9 2 8 2 8 1 6 1 6 1 4 1 4 2 2 2 2 4 1 4 1 6 1 6 1 8 2 8 2 9 4 9 4 9 6 9 6 8 8 8 8 6 9 6 9 4 9 4 9 1 6 1 6 2 2 2 2 6 1 6 1 9 4 9 4 8 8 8 8 4 9 6 9 2 8 2 8 1 4 1 4 4 1 4 1 8 2 8 2 9 6 9 6 6 9 1 1 22 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 22 19 20 19 20 17 17 17 17 14 12 14 12 12 9 12 9 9 5 9 5 6 2 6 2 4 1 4 1 2 1 2 1 1 2 1 2 1 4 1 4 2 5 2 5 3 4 3 4 2 3 21 22 20 18 20 18 18 8 18 8 17 1 21 22 18 1 17 1 17 3 17 3 16 6 16 6 15 8 15 8 13 10 13 10 11 11 11 11 9 11 9 11 8 10 8 10 8 8 8 8 9 5 9 5 12 2 12 2 15 1 15 1 19 1 19 1 21 2 15 21 14 20 14 20 13 18 13 18 11 13 11 13 9 7 9 7 8 5 8 5 6 2 6 2 4 1 14 20 13 17 13 17 11 9 11 9 10 6 10 6 9 4 9 4 7 2 7 2 4 1 4 1 2 1 2 1 1 2 1 2 1 4 1 4 2 5 2 5 3 4 3 4 2 3 9 16 8 14 8 14 7 13 7 13 5 13 5 13 4 14 4 14 4 16 4 16 5 18 5 18 7 20 7 20 9 21 9 21 12 22 12 22 18 22 18 22 20 21 20 21 21 19 21 19 21 17 21 17 20 15 20 15 18 14 18 14 14 13 14 13 12 13 18 22 19 21 19 21 20 19 20 19 20 17 20 17 19 15 19 15 18 14 14 13 17 12 17 12 18 11 18 11 19 9 19 9 19 6 19 6 18 3 18 3 17 2 17 2 15 1 15 1 13 1 13 1 12 2 12 2 12 4 12 4 13 7 14 13 16 12 16 12 17 11 17 11 18 9 18 9 18 6 18 6 17 3 17 3 15 1 2 20 1 18 1 18 1 16 1 16 2 14 2 14 5 13 5 13 8 13 8 13 12 14 12 14 14 15 14 15 16 17 16 17 17 19 17 19 17 21 17 21 16 22 16 22 14 22 14 22 11 21 11 21 8 18 8 18 6 15 6 15 4 11 4 11 3 7 3 7 3 4 3 4 4 2 4 2 7 1 7 1 9 1 9 1 12 2 12 2 14 4 14 4 15 6 15 6 15 8 15 8 14 10 14 10 12 10 12 10 10 9 10 9 9 7 14 22 12 21 12 21 9 18 9 18 7 15 7 15 5 11 5 11 4 7 4 7 4 4 4 4 5 2 5 2 7 1 15 21 14 20 14 20 13 18 13 18 11 13 11 13 9 7 9 7 8 5 8 5 6 2 6 2 4 1 14 20 13 17 13 17 11 9 11 9 10 6 10 6 9 4 9 4 7 2 7 2 4 1 4 1 2 1 2 1 1 2 1 2 1 4 1 4 2 5 2 5 4 5 4 5 6 4 6 4 8 2 8 2 10 1 10 1 13 1 13 1 15 2 15 2 17 4 17 4 19 8 19 8 20 13 20 13 20 16 20 16 19 19 19 19 17 21 17 21 15 22 15 22 10 22 10 22 7 21 7 21 5 19 5 19 4 17 4 17 4 15 4 15 5 14 5 14 7 14 7 14 8 15 8 15 9 17 13 19 12 18 12 18 12 16 12 16 13 15 13 15 15 15 15 15 16 17 16 17 16 19 16 19 15 21 15 21 13 22 13 22 10 22 10 22 8 21 8 21 7 20 7 20 6 18 6 18 6 16 6 16 7 14 7 14 9 13 10 22 8 20 8 20 7 18 7 18 7 15 7 15 9 13 9 13 7 13 7 13 4 12 4 12 2 10 2 10 1 8 1 8 1 5 1 5 2 3 2 3 3 2 3 2 5 1 5 1 8 1 8 1 11 2 11 2 13 4 13 4 14 6 14 6 14 8 14 8 13 10 13 10 11 10 11 10 9 9 9 9 8 7 7 13 5 12 5 12 3 10 3 10 2 8 2 8 2 4 2 4 3 2 16 20 15 18 15 18 13 13 13 13 11 7 11 7 10 5 10 5 8 2 8 2 6 1 10 16 9 14 9 14 7 13 7 13 5 13 5 13 4 15 4 15 4 17 4 17 5 19 5 19 7 21 7 21 10 22 10 22 20 22 20 22 17 21 17 21 16 20 16 20 15 17 15 17 13 9 13 9 12 6 12 6 11 4 11 4 9 2 9 2 6 1 6 1 4 1 4 1 2 2 2 2 1 3 1 3 1 4 1 4 2 5 2 5 3 4 3 4 2 3 12 22 16 21 16 21 17 21 8 9 9 10 9 10 11 11 11 11 15 11 15 11 17 12 17 12 19 15 19 15 17 8 2 19 1 17 1 17 1 15 1 15 2 13 2 13 4 12 4 12 7 12 7 12 10 13 10 13 12 14 12 14 15 17 15 17 16 20 16 20 16 21 16 21 15 22 15 22 14 22 14 22 12 21 12 21 10 19 10 19 9 17 9 17 8 14 8 14 8 11 8 11 9 9 9 9 11 8 11 8 13 8 13 8 15 9 15 9 17 11 17 11 18 13 15 22 13 21 13 21 11 19 11 19 10 17 10 17 9 14 9 14 9 10 9 10 11 8 18 13 17 9 17 9 15 5 15 5 13 3 13 3 11 2 11 2 7 1 7 1 4 1 4 1 2 2 2 2 1 4 1 4 1 5 1 5 2 6 2 6 3 5 3 5 2 4 17 9 15 6 15 6 13 4 13 4 10 2 10 2 7 1 7 16 6 17 6 17 6 19 6 19 7 21 7 21 10 22 10 22 13 22 13 22 10 11 10 11 8 5 8 5 7 3 7 3 6 2 6 2 4 1 4 1 2 1 2 1 1 2 1 2 1 4 1 4 2 5 2 5 3 4 3 4 2 3 13 22 10 13 10 13 9 10 9 10 7 5 7 5 6 3 6 3 4 1 5 8 6 9 6 9 8 10 8 10 17 13 17 13 19 14 19 14 22 16 22 16 24 18 24 18 25 20 25 20 25 21 25 21 24 22 24 22 23 22 23 22 21 21 21 21 19 18 19 18 18 16 18 16 16 10 16 10 15 6 15 6 15 3 15 3 17 1 17 1 18 1 18 1 20 2 20 2 22 4 23 22 21 20 21 20 19 16 19 16 17 10 17 10 16 6 16 6 16 3 16 3 17 1 15 20 13 17 13 17 11 12 11 12 9 7 9 7 8 5 8 5 6 2 6 2 4 1 17 16 15 14 15 14 12 13 12 13 9 13 9 13 7 14 7 14 6 16 6 16 6 18 6 18 7 20 7 20 9 21 9 21 13 22 13 22 17 22 17 22 15 20 15 20 14 18 14 18 12 12 12 12 10 6 10 6 9 4 9 4 7 2 7 2 4 1 4 1 2 1 2 1 1 2 1 2 1 4 1 4 2 5 2 5 3 4 3 4 2 3 16 26 14 24 14 24 12 21 12 21 10 16 10 16 7 7 7 7 5 3 16 19 14 17 14 17 11 16 11 16 8 16 8 16 6 17 6 17 5 19 5 19 5 21 5 21 6 23 6 23 8 25 8 25 12 26 12 26 16 26 16 26 14 23 14 23 13 21 13 21 10 12 10 12 8 8 8 8 7 6 7 6 5 3 5 3 4 2 4 2 2 1 2 1 1 2 1 2 1 4 1 4 2 6 2 6 4 8 4 8 6 9 6 9 9 10 9 10 13 11 7 16 6 17 6 17 6 19 6 19 8 21 8 21 11 22 11 22 13 22 13 22 10 11 10 11 8 5 8 5 7 3 7 3 6 2 6 2 4 1 4 1 2 1 2 1 1 2 1 2 1 4 1 4 2 5 2 5 3 4 3 4 2 3 13 22 10 13 10 13 9 10 9 10 7 5 7 5 6 3 6 3 4 1 21 21 18 17 18 17 16 15 16 15 14 14 14 14 11 13 24 21 23 20 23 20 24 19 24 19 25 20 25 20 25 21 25 21 24 22 24 22 23 22 23 22 21 21 21 21 18 16 18 16 17 15 17 15 15 14 15 14 11 13 11 13 14 12 14 12 15 10 15 10 16 3 16 3 17 1 11 13 13 12 13 12 14 10 14 10 15 3 15 3 17 1 17 1 18 1 18 1 20 2 20 2 22 4 6 19 5 17 5 17 5 15 5 15 6 13 6 13 8 12 8 12 11 12 11 12 14 13 14 13 16 14 16 14 19 17 19 17 20 20 20 20 20 21 20 21 19 22 19 22 18 22 18 22 16 21 16 21 15 20 15 20 13 17 13 17 9 7 9 7 8 5 8 5 6 2 6 2 4 1 15 20 13 16 13 16 11 9 11 9 10 6 10 6 9 4 9 4 7 2 7 2 4 1 4 1 2 1 2 1 1 2 1 2 1 4 1 4 2 5 2 5 4 5 4 5 6 4 6 4 9 2 9 2 11 1 11 1 14 1 14 1 16 2 16 2 18 4 17 22 13 13 13 13 10 7 10 7 8 4 8 4 6 2 6 2 4 1 4 1 2 1 2 1 1 2 1 2 1 4 1 4 2 5 2 5 3 4 3 4 2 3 17 22 15 15 15 15 14 11 14 11 13 6 13 6 13 2 13 2 15 1 17 22 16 18 16 18 15 13 15 13 14 6 14 6 14 2 14 2 15 1 26 22 22 13 22 13 17 4 17 4 15 1 26 22 24 15 24 15 23 11 23 11 22 6 22 6 22 2 22 2 24 1 24 1 25 1 25 1 27 2 27 2 29 4 26 22 25 18 25 18 24 13 24 13 23 6 23 6 23 2 23 2 24 1 14 22 13 18 13 18 11 12 11 12 9 7 9 7 8 5 8 5 6 2 6 2 4 1 4 1 2 1 2 1 1 2 1 2 1 4 1 4 2 5 2 5 3 4 3 4 2 3 14 22 14 17 14 17 15 6 15 6 16 1 14 22 15 17 15 17 16 6 16 6 16 1 28 21 27 20 27 20 28 19 28 19 29 20 29 20 29 21 29 21 28 22 28 22 26 22 26 22 24 21 24 21 22 18 22 18 21 16 21 16 19 11 19 11 17 5 17 5 16 1 9 22 7 21 7 21 5 19 5 19 3 16 3 16 2 14 2 14 1 10 1 10 1 6 1 6 2 3 2 3 3 2 3 2 5 1 5 1 7 1 7 1 10 2 10 2 12 4 12 4 14 7 14 7 15 9 15 9 16 13 16 13 16 17 16 17 15 20 15 20 14 21 14 21 13 21 13 21 11 20 11 20 9 18 9 18 7 14 7 14 6 9 6 9 6 6 7 21 5 18 5 18 3 14 3 14 2 10 2 10 2 6 2 6 3 3 3 3 5 1 15 21 14 20 14 20 13 18 13 18 11 13 11 13 9 7 9 7 8 5 8 5 6 2 6 2 4 1 14 20 13 17 13 17 11 9 11 9 10 6 10 6 9 4 9 4 7 2 7 2 4 1 4 1 2 1 2 1 1 2 1 2 1 4 1 4 2 5 2 5 3 4 3 4 2 3 9 16 8 14 8 14 7 13 7 13 5 13 5 13 4 14 4 14 4 16 4 16 5 18 5 18 7 20 7 20 9 21 9 21 12 22 12 22 16 22 16 22 19 21 19 21 20 20 20 20 21 18 21 18 21 15 21 15 20 13 20 13 19 12 19 12 16 11 16 11 14 11 14 11 12 12 16 22 18 21 18 21 19 20 19 20 20 18 20 18 20 15 20 15 19 13 19 13 18 12 18 12 16 11 14 18 14 16 14 16 13 14 13 14 12 13 12 13 10 12 10 12 8 12 8 12 7 14 7 14 7 16 7 16 8 19 8 19 10 21 10 21 13 22 13 22 16 22 16 22 18 21 18 21 19 19 19 19 19 15 19 15 18 12 18 12 16 9 16 9 12 5 12 5 9 3 9 3 7 2 7 2 4 1 4 1 2 1 2 1 1 2 1 2 1 4 1 4 2 5 2 5 4 5 4 5 6 4 6 4 9 2 9 2 12 1 12 1 15 1 15 1 17 2 17 2 19 4 16 22 17 21 17 21 18 19 18 19 18 15 18 15 17 12 17 12 15 9 15 9 12 6 12 6 8 3 8 3 4 1 15 21 14 20 14 20 13 18 13 18 11 13 11 13 9 7 9 7 8 5 8 5 6 2 6 2 4 1 14 20 13 17 13 17 11 9 11 9 10 6 10 6 9 4 9 4 7 2 7 2 4 1 4 1 2 1 2 1 1 2 1 2 1 4 1 4 2 5 2 5 3 4 3 4 2 3 9 16 8 14 8 14 7 13 7 13 5 13 5 13 4 14 4 14 4 16 4 16 5 18 5 18 7 20 7 20 9 21 9 21 12 22 12 22 17 22 17 22 20 21 20 21 21 19 21 19 21 17 21 17 20 15 20 15 19 14 19 14 16 13 16 13 12 13 17 22 19 21 19 21 20 19 20 19 20 17 20 17 19 15 19 15 18 14 18 14 16 13 12 13 15 12 15 12 16 10 16 10 17 3 17 3 18 1 12 13 14 12 14 12 15 10 15 10 16 3 16 3 18 1 18 1 19 1 19 1 21 2 21 2 23 4 7 19 6 17 6 17 6 15 6 15 7 13 7 13 9 12 9 12 12 12 12 12 15 13 15 13 17 14 17 14 20 17 20 17 21 20 21 20 21 21 21 21 20 22 20 22 19 22 19 22 17 21 17 21 16 20 16 20 15 18 15 18 14 15 14 15 12 8 12 8 11 5 11 5 9 2 9 2 7 1 15 18 14 14 14 14 13 7 13 7 12 4 12 4 10 2 10 2 7 1 7 1 4 1 4 1 2 2 2 2 1 4 1 4 1 5 1 5 2 6 2 6 3 5 3 5 2 4 16 20 15 18 15 18 13 13 13 13 11 7 11 7 10 5 10 5 8 2 8 2 6 1 10 16 9 14 9 14 7 13 7 13 5 13 5 13 4 15 4 15 4 17 4 17 5 19 5 19 7 21 7 21 10 22 10 22 19 22 19 22 17 21 17 21 16 20 16 20 15 17 15 17 13 9 13 9 12 6 12 6 11 4 11 4 9 2 9 2 6 1 6 1 4 1 4 1 2 2 2 2 1 3 1 3 1 4 1 4 2 5 2 5 3 4 3 4 2 3 12 22 16 21 16 21 17 21 1 18 3 21 3 21 5 22 5 22 6 22 6 22 8 20 8 20 8 17 8 17 7 14 7 14 4 6 4 6 4 3 4 3 5 1 6 22 7 20 7 20 7 17 7 17 4 9 4 9 3 6 3 6 3 3 3 3 5 1 5 1 7 1 7 1 9 2 9 2 12 5 12 5 14 8 14 8 15 10 19 22 15 10 15 10 14 6 14 6 14 3 14 3 16 1 16 1 17 1 17 1 19 2 19 2 21 4 20 22 16 10 16 10 15 6 15 6 15 3 15 3 16 1 1 18 3 21 3 21 5 22 5 22 6 22 6 22 8 20 8 20 8 17 8 17 7 13 7 13 5 6 5 6 5 3 5 3 6 1 6 22 7 20 7 20 7 17 7 17 5 10 5 10 4 6 4 6 4 3 4 3 6 1 6 1 7 1 7 1 10 2 10 2 13 5 13 5 15 8 15 8 17 12 17 12 18 15 18 15 19 19 19 19 19 21 19 21 18 22 18 22 17 22 17 22 16 21 16 21 15 19 15 19 15 16 15 16 16 14 16 14 18 12 18 12 20 11 20 11 22 11 3 16 2 16 2 16 1 17 1 17 1 19 1 19 2 21 2 21 4 22 4 22 8 22 8 22 7 20 7 20 6 16 6 16 5 7 5 7 4 1 6 16 6 7 6 7 5 1 16 22 14 20 14 20 12 16 12 16 9 7 9 7 7 3 7 3 5 1 16 22 15 20 15 20 14 16 14 16 13 7 13 7 12 1 14 16 14 7 14 7 13 1 26 22 24 21 24 21 22 19 22 19 20 16 20 16 17 7 17 7 15 3 15 3 13 1 10 17 9 16 9 16 7 16 7 16 6 17 6 17 6 19 6 19 7 21 7 21 9 22 9 22 11 22 11 22 13 21 13 21 14 19 14 19 14 16 14 16 13 12 13 12 11 7 11 7 9 4 9 4 7 2 7 2 4 1 4 1 2 1 2 1 1 2 1 2 1 4 1 4 2 5 2 5 3 4 3 4 2 3 11 22 12 21 12 21 13 19 13 19 13 16 13 16 12 12 12 12 10 7 10 7 8 4 8 4 6 2 6 2 4 1 23 21 22 20 22 20 23 19 23 19 24 20 24 20 24 21 24 21 23 22 23 22 21 22 21 22 19 21 19 21 17 19 17 19 15 16 15 16 13 12 13 12 12 7 12 7 12 4 12 4 13 2 13 2 14 1 14 1 15 1 15 1 17 2 17 2 19 4 2 18 4 21 4 21 6 22 6 22 7 22 7 22 9 21 9 21 9 19 9 19 7 13 7 13 7 10 7 10 8 8 7 22 8 21 8 21 8 19 8 19 6 13 6 13 6 10 6 10 8 8 8 8 10 8 10 8 13 9 13 9 15 11 15 11 17 14 17 14 18 16 20 22 18 16 18 16 15 8 15 8 13 4 21 22 19 16 19 16 17 11 17 11 15 7 15 7 13 4 13 4 11 2 11 2 8 1 8 1 4 1 4 1 2 2 2 2 1 4 1 4 1 5 1 5 2 6 2 6 3 5 3 5 2 4 20 20 19 18 19 18 17 13 17 13 16 10 16 10 15 8 15 8 13 5 13 5 11 3 11 3 9 2 9 2 6 1 13 16 12 14 12 14 10 13 10 13 8 13 8 13 7 15 7 15 7 17 7 17 8 19 8 19 10 21 10 21 13 22 13 22 23 22 23 22 21 21 21 21 20 20 20 20 19 17 19 17 18 13 18 13 16 7 16 7 14 4 14 4 11 2 11 2 6 1 6 1 2 1 2 1 1 2 1 2 1 4 1 4 2 5 2 5 4 5 4 5 6 4 6 4 9 2 9 2 11 1 11 1 14 1 14 1 17 2 17 2 19 4 16 22 20 21 20 21 21 21 10 7 9 9 9 9 7 10 7 10 5 10 5 10 3 9 3 9 2 8 2 8 1 6 1 6 1 4 1 4 2 2 2 2 4 1 4 1 6 1 6 1 8 2 8 2 9 4 5 10 3 8 3 8 2 6 2 6 2 3 2 3 4 1 11 10 9 4 9 4 9 2 9 2 11 1 11 1 13 2 13 2 14 3 14 3 16 6 12 10 10 4 10 4 10 2 10 2 11 1 1 6 3 9 3 9 5 13 8 22 2 4 2 4 2 2 2 2 4 1 4 1 5 1 5 1 7 2 7 2 9 4 9 4 10 7 10 7 10 10 10 10 11 6 11 6 12 5 12 5 13 5 13 5 15 6 9 22 3 4 3 4 3 2 3 2 4 1 8 9 7 8 7 8 8 8 8 8 8 9 8 9 7 10 7 10 5 10 5 10 3 9 3 9 2 8 2 8 1 6 1 6 1 4 1 4 2 2 2 2 4 1 4 1 7 1 7 1 10 3 10 3 12 6 5 10 3 8 3 8 2 6 2 6 2 3 2 3 4 1 10 7 9 9 9 9 7 10 7 10 5 10 5 10 3 9 3 9 2 8 2 8 1 6 1 6 1 4 1 4 2 2 2 2 4 1 4 1 6 1 6 1 8 2 8 2 9 4 5 10 3 8 3 8 2 6 2 6 2 3 2 3 4 1 15 22 9 4 9 4 9 2 9 2 11 1 11 1 13 2 13 2 14 3 14 3 16 6 16 22 10 4 10 4 10 2 10 2 11 1 3 3 5 4 5 4 6 5 6 5 7 7 7 7 7 9 7 9 6 10 6 10 5 10 5 10 3 9 3 9 2 8 2 8 1 6 1 6 1 4 1 4 2 2 2 2 4 1 4 1 7 1 7 1 10 3 10 3 12 6 5 10 3 8 3 8 2 6 2 6 2 3 2 3 4 1 8 22 11 25 11 25 13 28 13 28 14 31 14 31 14 33 14 33 13 34 13 34 11 33 11 33 10 31 10 31 1 4 1 4 1 2 1 2 2 1 2 1 4 2 4 2 5 5 5 5 6 14 6 14 7 13 7 13 9 13 9 13 11 14 11 14 12 15 12 15 14 18 10 31 9 26 9 26 8 22 8 22 5 13 5 13 3 8 3 8 1 4 10 19 9 21 9 21 7 22 7 22 5 22 5 22 3 21 3 21 2 20 2 20 1 18 1 18 1 16 1 16 2 14 2 14 4 13 4 13 6 13 6 13 8 14 8 14 9 16 5 22 3 20 3 20 2 18 2 18 2 15 2 15 4 13 11 22 5 4 12 22 9 13 9 13 7 8 7 8 5 4 5 4 4 2 4 2 2 1 2 1 1 2 1 2 1 4 1 4 2 7 2 7 4 9 4 9 7 11 7 11 11 13 11 13 14 15 14 15 16 18 1 6 3 9 3 9 5 13 8 22 1 1 9 22 2 1 4 7 6 9 6 9 8 10 8 10 9 10 9 10 11 9 11 9 11 7 11 7 10 4 10 4 10 2 10 2 11 1 9 10 10 9 10 9 10 7 10 7 9 4 9 4 9 2 9 2 11 1 11 1 13 2 13 2 14 3 14 3 16 6 5 16 4 15 4 15 5 14 5 14 6 15 6 15 5 16 3 10 1 4 1 4 1 2 1 2 3 1 3 1 5 2 5 2 6 3 6 3 8 6 4 10 2 4 2 4 2 2 2 2 3 1 13 28 12 27 12 27 13 26 13 26 14 27 14 27 13 28 11 22 5 4 12 22 9 13 9 13 7 8 7 8 5 4 5 4 4 2 4 2 2 1 2 1 1 2 1 2 1 4 1 4 2 7 2 7 4 9 4 9 7 11 7 11 11 13 11 13 14 15 14 15 16 18 1 6 3 9 3 9 5 13 8 22 1 1 9 22 2 1 10 10 10 9 10 9 11 9 11 9 10 10 10 10 9 10 9 10 7 8 7 8 4 7 4 7 7 6 7 6 8 2 8 2 9 1 4 7 6 6 6 6 7 2 7 2 9 1 9 1 10 1 10 1 13 3 13 3 15 6 1 6 3 9 3 9 5 13 8 22 2 4 2 4 2 2 2 2 4 1 4 1 6 2 6 2 7 3 7 3 9 6 9 22 3 4 3 4 3 2 3 2 4 1 1 6 3 9 3 9 5 10 5 10 7 9 7 9 7 7 7 7 5 1 5 10 6 9 6 9 6 7 6 7 4 1 7 7 9 9 9 9 11 10 11 10 12 10 12 10 14 9 14 9 14 7 14 7 12 1 12 10 13 9 13 9 13 7 13 7 11 1 14 7 16 9 16 9 18 10 18 10 19 10 19 10 21 9 21 9 21 7 21 7 20 4 20 4 20 2 20 2 21 1 19 10 20 9 20 9 20 7 20 7 19 4 19 4 19 2 19 2 21 1 21 1 23 2 23 2 24 3 24 3 26 6 1 6 3 9 3 9 5 10 5 10 7 9 7 9 7 7 7 7 5 1 5 10 6 9 6 9 6 7 6 7 4 1 7 7 9 9 9 9 11 10 11 10 12 10 12 10 14 9 14 9 14 7 14 7 13 4 13 4 13 2 13 2 14 1 12 10 13 9 13 9 13 7 13 7 12 4 12 4 12 2 12 2 14 1 14 1 16 2 16 2 17 3 17 3 19 6 7 10 5 10 5 10 3 9 3 9 2 8 2 8 1 6 1 6 1 4 1 4 2 2 2 2 4 1 4 1 6 1 6 1 8 2 8 2 9 3 9 3 10 5 10 5 10 7 10 7 9 9 9 9 7 10 7 10 6 9 6 9 6 7 6 7 7 5 7 5 9 4 9 4 11 4 11 4 13 5 13 5 14 6 5 10 3 8 3 8 2 6 2 6 2 3 2 3 4 1 5 18 7 21 7 21 9 25 10 28 1 1 11 28 2 1 8 19 10 21 10 21 12 22 12 22 13 22 13 22 15 21 15 21 15 19 15 19 14 16 14 16 14 14 14 14 15 13 13 22 14 21 14 21 14 19 14 19 13 16 13 16 13 14 13 14 15 13 15 13 17 14 17 14 18 15 18 15 20 18 10 19 9 21 9 21 7 22 7 22 5 22 5 22 3 21 3 21 2 20 2 20 1 18 1 18 1 16 1 16 2 14 2 14 4 13 4 13 6 13 6 13 8 14 5 22 3 20 3 20 2 18 2 18 2 15 2 15 4 13 11 22 5 4 5 4 5 2 5 2 6 1 6 1 8 2 8 2 9 5 9 5 9 13 9 13 11 13 11 13 14 15 14 15 16 18 12 22 9 13 9 13 7 8 7 8 5 4 1 6 3 9 3 9 5 10 5 10 7 9 7 9 7 7 7 7 5 1 5 10 6 9 6 9 6 7 6 7 4 1 7 7 9 9 9 9 11 10 11 10 12 10 12 10 11 7 11 10 11 7 11 7 12 5 12 5 13 5 13 5 15 6 1 6 3 9 3 9 4 11 4 11 4 9 4 9 7 7 7 7 8 5 8 5 8 3 8 3 7 2 7 2 5 1 4 9 6 7 6 7 7 5 7 5 7 3 7 3 5 1 1 2 3 1 3 1 8 1 8 1 11 3 11 3 13 6 1 6 3 9 3 9 5 13 8 22 2 4 2 4 2 2 2 2 4 1 4 1 6 2 6 2 7 3 7 3 9 6 9 22 3 4 3 4 3 2 3 2 4 1 3 14 9 14 3 10 1 4 1 4 1 2 1 2 3 1 3 1 4 1 4 1 6 2 6 2 8 4 8 4 10 7 4 10 2 4 2 4 2 2 2 2 3 1 11 10 9 4 9 4 9 2 9 2 11 1 11 1 13 2 13 2 14 3 14 3 16 6 12 10 10 4 10 4 10 2 10 2 11 1 3 10 2 8 2 8 1 5 1 5 1 2 1 2 3 1 3 1 4 1 4 1 7 2 7 2 9 4 9 4 10 7 10 7 10 10 4 10 3 8 3 8 2 5 2 5 2 2 2 2 3 1 10 10 11 6 11 6 12 5 12 5 13 5 13 5 15 6 4 10 2 8 2 8 1 5 1 5 1 2 1 2 3 1 3 1 4 1 4 1 6 2 6 2 8 4 5 10 3 8 3 8 2 5 2 5 2 2 2 2 3 1 10 10 8 4 8 4 8 2 8 2 10 1 10 1 11 1 11 1 13 2 13 2 15 4 15 4 16 7 16 7 16 10 11 10 9 4 9 4 9 2 9 2 10 1 16 10 17 6 17 6 18 5 18 5 19 5 19 5 21 6 1 6 3 9 3 9 5 10 5 10 7 10 7 10 8 9 8 9 8 7 8 7 7 4 7 4 6 2 6 2 4 1 4 1 3 1 3 1 2 2 2 2 2 3 2 3 3 3 3 3 2 2 14 9 13 8 13 8 14 8 14 8 14 9 14 9 13 10 13 10 12 10 12 10 10 9 10 9 9 7 9 7 8 4 8 4 8 2 8 2 9 1 9 1 12 1 12 1 15 3 15 3 17 6 8 9 9 7 10 9 8 7 7 4 8 2 8 4 6 2 3 22 1 16 1 16 1 14 1 14 3 13 3 13 4 13 4 13 6 14 6 14 8 16 8 16 10 19 4 22 2 16 2 16 2 14 2 14 3 13 11 22 5 4 12 22 9 13 9 13 7 8 7 8 5 4 5 4 4 2 4 2 2 1 2 1 1 2 1 2 1 4 1 4 2 7 2 7 4 9 4 9 7 11 7 11 11 13 11 13 14 15 14 15 16 18 2 18 4 21 4 21 6 22 6 22 8 22 8 22 10 21 10 21 10 18 10 18 9 16 9 16 6 14 6 14 4 13 8 22 9 21 9 21 9 18 9 18 8 16 8 16 6 14 4 13 6 12 6 12 7 10 7 10 7 7 7 7 6 4 6 4 4 2 4 2 2 1 2 1 1 2 1 2 1 4 1 4 2 7 2 7 5 10 5 10 8 12 8 12 12 15 12 15 15 18 4 13 5 12 5 12 6 10 6 10 6 7 6 7 5 4 5 4 4 2 10 22 7 21 7 21 5 19 5 19 3 16 3 16 2 13 2 13 1 9 1 9 1 6 1 6 2 3 2 3 3 2 3 2 5 1 5 1 7 1 7 1 10 2 10 2 12 4 12 4 14 7 14 7 15 10 15 10 16 14 16 14 16 17 16 17 15 20 15 20 14 21 14 21 12 22 12 22 10 22 10 22 8 21 8 21 6 19 6 19 4 16 4 16 3 13 3 13 2 9 2 9 2 6 2 6 3 3 3 3 5 1 7 1 9 2 9 2 11 4 11 4 13 7 13 7 14 10 14 10 15 14 15 14 15 17 15 17 14 20 14 20 12 22 7 18 2 1 9 22 3 1 9 22 6 19 6 19 3 17 3 17 1 16 8 19 4 17 4 17 1 16 7 18 8 17 8 17 7 16 7 16 6 17 6 17 6 18 6 18 7 20 7 20 8 21 8 21 11 22 11 22 14 22 14 22 17 21 17 21 18 19 18 19 18 17 18 17 17 15 17 15 15 13 15 13 12 11 12 11 8 9 8 9 5 7 5 7 3 5 3 5 1 1 14 22 16 21 16 21 17 19 17 19 17 17 17 17 16 15 16 15 14 13 14 13 8 9 2 3 3 4 3 4 5 4 5 4 10 2 10 2 13 2 13 2 15 3 15 3 16 5 5 4 10 1 10 1 13 1 13 1 15 2 15 2 16 5 6 18 7 17 7 17 6 16 6 16 5 17 5 17 5 18 5 18 6 20 6 20 7 21 7 21 10 22 10 22 13 22 13 22 16 21 16 21 17 19 17 19 17 17 17 17 16 15 16 15 13 13 13 13 10 12 13 22 15 21 15 21 16 19 16 19 16 17 16 17 15 15 15 15 13 13 8 12 10 12 10 12 13 11 13 11 14 10 14 10 15 8 15 8 15 5 15 5 14 3 14 3 13 2 13 2 10 1 10 1 6 1 6 1 3 2 3 2 2 3 2 3 1 5 1 5 1 6 1 6 2 7 2 7 3 6 3 6 2 5 10 12 12 11 12 11 13 10 13 10 14 8 14 8 14 5 14 5 13 3 13 3 12 2 12 2 10 1 15 21 9 1 16 22 10 1 16 22 1 7 1 7 17 7 8 22 3 12 8 22 18 22 8 21 13 21 13 21 18 22 3 12 4 13 4 13 7 14 7 14 10 14 10 14 13 13 13 13 14 12 14 12 15 10 15 10 15 7 15 7 14 4 14 4 12 2 12 2 9 1 9 1 6 1 6 1 3 2 3 2 2 3 2 3 1 5 1 5 1 6 1 6 2 7 2 7 3 6 3 6 2 5 10 14 12 13 12 13 13 12 13 12 14 10 14 10 14 7 14 7 13 4 13 4 11 2 11 2 9 1 15 19 14 18 14 18 15 17 15 17 16 18 16 18 16 19 16 19 15 21 15 21 13 22 13 22 10 22 10 22 7 21 7 21 5 19 5 19 3 16 3 16 2 13 2 13 1 9 1 9 1 5 1 5 2 3 2 3 3 2 3 2 5 1 5 1 8 1 8 1 11 2 11 2 13 4 13 4 14 6 14 6 14 9 14 9 13 11 13 11 12 12 12 12 10 13 10 13 7 13 7 13 5 12 5 12 3 10 3 10 2 8 10 22 8 21 8 21 6 19 6 19 4 16 4 16 3 13 3 13 2 9 2 9 2 4 2 4 3 2 8 1 10 2 10 2 12 4 12 4 13 6 13 6 13 10 13 10 12 12 3 22 1 16 16 22 15 19 15 19 13 16 13 16 8 10 8 10 6 7 6 7 5 5 5 5 4 1 13 16 7 10 7 10 5 7 5 7 4 5 4 5 3 1 2 19 5 22 5 22 7 22 7 22 12 19 3 20 5 21 5 21 7 21 7 21 12 19 12 19 14 19 14 19 15 20 15 20 16 22 10 22 7 21 7 21 6 20 6 20 5 18 5 18 5 15 5 15 6 13 6 13 8 12 8 12 11 12 11 12 15 13 15 13 16 14 16 14 17 16 17 16 17 19 17 19 16 21 16 21 13 22 13 22 10 22 10 22 8 21 8 21 7 20 7 20 6 18 6 18 6 15 6 15 7 13 7 13 8 12 11 12 14 13 14 13 15 14 15 14 16 16 16 16 16 19 16 19 15 21 15 21 13 22 8 12 4 11 4 11 2 9 2 9 1 7 1 7 1 4 1 4 2 2 2 2 5 1 5 1 9 1 9 1 13 2 13 2 14 3 14 3 15 5 15 5 15 8 15 8 14 10 14 10 13 11 13 11 11 12 8 12 5 11 5 11 3 9 3 9 2 7 2 7 2 4 2 4 3 2 3 2 5 1 9 1 12 2 12 2 13 3 13 3 14 5 14 5 14 9 14 9 13 11 15 15 14 13 14 13 12 11 12 11 10 10 10 10 7 10 7 10 5 11 5 11 4 12 4 12 3 14 3 14 3 17 3 17 4 19 4 19 6 21 6 21 9 22 9 22 12 22 12 22 14 21 14 21 15 20 15 20 16 18 16 18 16 14 16 14 15 10 15 10 14 7 14 7 12 4 12 4 10 2 10 2 7 1 7 1 4 1 4 1 2 2 2 2 1 4 1 4 1 5 1 5 2 6 2 6 3 5 3 5 2 4 5 11 4 13 4 13 4 17 4 17 5 19 5 19 7 21 7 21 9 22 14 21 15 19 15 19 15 14 15 14 14 10 14 10 13 7 13 7 11 4 11 4 9 2 9 2 7 1 2 3 1 2 1 2 2 1 2 1 3 2 3 2 2 3 3 5 2 6 2 6 3 7 3 7 4 6 4 6 4 5 4 5 3 3 3 3 1 1 5 15 4 14 4 14 5 13 5 13 6 14 6 14 5 15 2 3 1 2 1 2 2 1 2 1 3 2 6 19 5 18 5 18 6 17 6 17 7 18 7 18 6 19 3 5 2 6 2 6 3 7 3 7 4 6 4 6 4 5 4 5 3 3 3 3 1 1 7 22 6 21 6 21 4 9 7 21 4 9 7 22 8 21 8 21 4 9 2 3 1 2 1 2 2 1 2 1 3 2 3 2 2 3 2 18 3 17 3 17 2 16 2 16 1 17 1 17 1 18 1 18 2 20 2 20 3 21 3 21 6 22 6 22 10 22 10 22 13 21 13 21 14 19 14 19 14 17 14 17 13 15 13 15 12 14 12 14 6 12 6 12 4 11 4 11 4 9 4 9 5 8 5 8 7 8 10 22 12 21 12 21 13 19 13 19 13 17 13 17 12 15 12 15 11 14 11 14 9 13 3 3 2 2 2 2 3 1 3 1 4 2 4 2 3 3 4 7 2 5 2 5 1 3 1 3 1 2 1 2 2 1 2 1 3 2 3 2 2 3 3 5 2 6 2 6 3 7 3 7 4 6 4 6 4 5 4 5 3 3 3 3 1 1 22 14 21 13 21 13 22 12 22 12 23 13 23 13 23 14 23 14 22 15 22 15 21 15 21 15 19 14 19 14 17 12 17 12 12 4 12 4 10 2 10 2 8 1 8 1 5 1 5 1 2 2 2 2 1 4 1 4 1 6 1 6 2 8 2 8 3 9 3 9 5 10 5 10 10 12 10 12 12 13 12 13 14 15 14 15 15 17 15 17 15 19 15 19 14 21 14 21 12 22 12 22 10 21 10 21 9 19 9 19 9 16 9 16 10 10 10 10 11 7 11 7 13 4 13 4 15 2 15 2 17 1 17 1 19 1 19 1 20 3 20 3 20 4 5 1 3 2 3 2 2 4 2 4 2 6 2 6 3 8 3 8 4 9 4 9 10 12 9 16 10 11 10 11 11 8 11 8 13 5 13 5 15 3 15 3 17 2 17 2 19 2 19 2 20 3 11 30 3 1 16 30 8 1 17 22 16 21 16 21 17 20 17 20 18 21 18 21 18 22 18 22 17 24 17 24 16 25 16 25 13 26 13 26 9 26 9 26 6 25 6 25 4 23 4 23 4 21 4 21 5 19 5 19 6 18 6 18 13 14 13 14 15 12 4 21 6 19 6 19 13 15 13 15 14 14 14 14 15 12 15 12 15 9 15 9 14 7 14 7 13 6 13 6 10 5 10 5 6 5 6 5 3 6 3 6 2 7 2 7 1 9 1 9 1 10 1 10 2 11 2 11 3 10 3 10 2 9 27 33 1 1 13 33 9 30 9 30 6 27 6 27 4 24 4 24 2 20 2 20 1 15 1 15 1 11 1 11 2 6 2 6 3 3 3 3 4 1 9 30 6 26 6 26 4 22 4 22 3 19 3 19 2 14 2 14 2 9 2 9 3 4 3 4 4 1 10 33 11 31 11 31 12 28 12 28 13 23 13 23 13 19 13 19 12 14 12 14 10 10 10 10 8 7 8 7 5 4 5 4 1 1 10 33 11 30 11 30 12 25 12 25 12 20 12 20 11 15 11 15 10 12 10 12 8 8 8 8 5 4 6 13 6 1 1 10 11 4 11 10 1 4 1 1 19 1 10 19 10 1 1 10 19 10 1 7 19 7 1 1 19 1 3 8 1 1 4 8 1 1 3 8 1 1 4 8 1 1 12 8 10 1 13 8 10 1 4 9 2 8 2 8 1 6 1 6 1 4 1 4 2 2 2 2 4 1 4 1 6 1 6 1 8 2 8 2 9 4 9 4 9 6 9 6 8 8 8 8 6 9 6 9 4 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 22 1 1 9 22 17 1 4 8 14 8 1 22 1 1 1 22 10 22 10 22 13 21 13 21 14 20 14 20 15 18 15 18 15 16 15 16 14 14 14 14 13 13 13 13 10 12 1 12 10 12 10 12 13 11 13 11 14 10 14 10 15 8 15 8 15 5 15 5 14 3 14 3 13 2 13 2 10 1 10 1 1 1 1 22 1 1 1 22 13 22 9 22 1 1 9 22 17 1 1 1 17 1 1 22 1 1 1 22 14 22 1 12 9 12 1 1 14 1 15 22 1 1 1 22 15 22 1 1 15 1 1 22 1 1 15 22 15 1 1 12 15 12 7 22 5 21 5 21 3 19 3 19 2 17 2 17 1 14 1 14 1 9 1 9 2 6 2 6 3 4 3 4 5 2 5 2 7 1 7 1 11 1 11 1 13 2 13 2 15 4 15 4 16 6 16 6 17 9 17 9 17 14 17 14 16 17 16 17 15 19 15 19 13 21 13 21 11 22 11 22 7 22 6 12 12 12 1 22 1 1 1 22 1 1 15 22 1 8 6 13 15 1 9 22 1 1 9 22 17 1 1 22 1 1 1 22 9 1 17 22 9 1 17 22 17 1 1 22 1 1 1 22 15 1 15 22 15 1 1 22 15 22 5 12 11 12 1 1 15 1 7 22 5 21 5 21 3 19 3 19 2 17 2 17 1 14 1 14 1 9 1 9 2 6 2 6 3 4 3 4 5 2 5 2 7 1 7 1 11 1 11 1 13 2 13 2 15 4 15 4 16 6 16 6 17 9 17 9 17 14 17 14 16 17 16 17 15 19 15 19 13 21 13 21 11 22 11 22 7 22 1 22 1 1 15 22 15 1 1 22 15 22 1 22 1 1 1 22 10 22 10 22 13 21 13 21 14 20 14 20 15 18 15 18 15 15 15 15 14 13 14 13 13 12 13 12 10 11 10 11 1 11 1 22 8 12 8 12 1 1 1 22 15 22 1 1 15 1 8 22 8 1 1 22 15 22 1 17 1 19 1 19 2 21 2 21 3 22 3 22 5 22 5 22 6 21 6 21 7 19 7 19 8 15 8 15 8 1 15 17 15 19 15 19 14 21 14 21 13 22 13 22 11 22 11 22 10 21 10 21 9 19 9 19 8 15 8 22 8 1 6 17 3 16 3 16 2 15 2 15 1 13 1 13 1 10 1 10 2 8 2 8 3 7 3 7 6 6 6 6 10 6 10 6 13 7 13 7 14 8 14 8 15 10 15 10 15 13 15 13 14 15 14 15 13 16 13 16 10 17 10 17 6 17 1 22 15 1 1 1 15 22 10 22 10 1 1 16 2 16 2 16 3 15 3 15 4 11 4 11 5 9 5 9 6 8 6 8 9 7 9 7 11 7 11 7 14 8 14 8 15 9 15 9 16 11 16 11 17 15 17 15 18 16 18 16 19 16 1 1 5 1 5 1 2 8 2 8 1 12 1 12 1 16 1 16 2 19 2 19 4 21 4 21 7 22 7 22 9 22 9 22 12 21 12 21 14 19 14 19 15 16 15 16 15 12 15 12 14 8 14 8 11 1 11 1 15 1 7 15 5 14 5 14 3 12 3 12 2 10 2 10 1 7 1 7 1 4 1 4 2 2 2 2 4 1 4 1 6 1 6 1 8 2 8 2 11 5 11 5 13 8 13 8 15 12 15 12 16 15 7 15 9 15 9 15 10 14 10 14 11 12 11 12 13 4 13 4 14 2 14 2 15 1 15 1 16 1 16 29 14 28 14 28 12 26 12 26 10 22 10 22 9 19 9 19 8 15 8 15 7 9 7 9 6 1 16 29 18 29 18 29 20 27 20 27 20 24 20 24 19 22 19 22 18 21 18 21 16 20 16 20 13 20 13 20 15 19 15 19 17 17 17 17 18 15 18 15 18 12 18 12 17 10 17 10 16 9 16 9 14 4 14 4 5 4 5 4 3 5 3 5 2 6 2 6 1 9 1 19 3 21 3 21 5 22 5 22 6 22 6 22 8 21 8 21 9 20 9 20 10 17 10 17 10 13 10 13 9 8 17 22 16 19 16 19 15 17 15 17 9 8 9 8 7 4 7 4 6 1 9 15 6 15 6 15 4 14 4 14 2 12 2 12 1 9 1 9 1 6 1 6 2 3 2 3 3 2 3 2 5 1 5 1 7 1 7 1 9 2 9 2 11 4 11 4 12 7 12 7 12 10 12 10 11 13 11 13 9 15 9 15 7 17 7 17 6 19 6 19 6 21 6 21 7 22 7 22 9 22 9 22 11 21 11 21 13 19 11 13 10 14 10 14 8 15 8 15 5 15 5 15 3 14 3 14 3 12 3 12 4 10 4 10 7 9 7 9 3 8 3 8 1 6 1 6 1 4 1 4 2 2 2 2 4 1 4 1 7 1 7 1 9 2 9 2 11 4 8 29 6 28 6 28 5 27 5 27 5 26 5 26 6 25 6 25 9 24 9 24 12 24 12 24 8 22 8 22 5 20 5 20 2 17 2 17 1 14 1 14 1 12 1 12 2 10 2 10 4 8 4 8 7 6 7 6 8 4 8 4 8 2 8 2 7 1 7 1 5 1 5 1 4 3 1 18 2 20 2 20 4 22 4 22 6 22 6 22 7 21 7 21 7 19 7 19 6 15 6 15 4 8 6 15 8 19 8 19 10 21 10 21 12 22 12 22 14 22 14 22 16 20 16 20 16 17 16 17 15 12 15 12 12 1 1 11 2 13 2 13 4 15 4 15 6 15 6 15 7 14 7 14 7 12 7 12 6 7 6 7 6 4 6 4 7 2 7 2 8 1 8 1 10 1 10 1 12 2 12 2 14 5 14 5 15 7 15 7 16 10 16 10 17 15 17 15 17 18 17 18 16 21 16 21 14 22 14 22 12 22 12 22 11 20 11 20 11 18 11 18 12 15 12 15 14 12 14 12 16 10 16 10 19 8 4 15 2 8 2 8 1 4 1 4 1 2 1 2 2 1 2 1 4 1 4 1 6 3 6 3 7 5 5 15 1 1 15 14 14 15 14 15 13 15 13 15 11 14 11 14 7 10 7 10 5 9 5 9 4 9 4 9 6 8 6 8 7 7 7 7 9 2 9 2 10 1 10 1 11 1 11 1 12 2 1 22 3 22 3 22 5 21 5 21 6 20 6 20 14 1 8 15 2 1 7 22 1 1 6 18 5 13 5 13 5 10 5 10 7 8 7 8 9 8 9 8 11 9 11 9 13 11 13 11 15 15 17 22 15 15 15 15 14 11 14 11 14 9 14 9 15 8 15 8 17 8 17 8 19 10 19 10 20 12 1 15 4 15 4 15 3 9 3 9 2 4 2 4 1 1 14 15 13 12 13 12 12 10 12 10 10 7 10 7 7 4 7 4 4 2 4 2 1 1 8 29 6 28 6 28 5 27 5 27 5 26 5 26 6 25 6 25 9 24 9 24 12 24 9 24 6 23 6 23 4 22 4 22 3 20 3 20 3 18 3 18 5 16 5 16 8 15 8 15 10 15 8 15 4 14 4 14 2 13 2 13 1 11 1 11 1 9 1 9 3 7 3 7 7 5 7 5 8 4 8 4 8 2 8 2 6 1 6 1 4 1 6 15 4 14 4 14 2 12 2 12 1 9 1 9 1 6 1 6 2 3 2 3 3 2 3 2 5 1 5 1 7 1 7 1 9 2 9 2 11 4 11 4 12 7 12 7 12 10 12 10 11 13 11 13 10 14 10 14 8 15 8 15 6 15 8 15 4 1 13 15 14 9 14 9 15 4 15 4 16 1 1 12 3 14 3 14 6 15 6 15 19 15 5 16 5 13 5 13 6 10 6 10 7 9 7 9 9 8 9 8 11 8 11 8 13 9 13 9 15 11 15 11 16 14 16 14 16 17 16 17 15 20 15 20 14 21 14 21 12 22 12 22 10 22 10 22 8 21 8 21 6 19 6 19 5 16 5 16 1 1 16 15 6 15 6 15 4 14 4 14 2 12 2 12 1 9 1 9 1 6 1 6 2 3 2 3 3 2 3 2 5 1 5 1 7 1 7 1 9 2 9 2 11 4 11 4 12 7 12 7 12 10 12 10 11 13 11 13 10 14 10 14 8 15 10 15 7 1 1 12 3 14 3 14 6 15 6 15 17 15 1 11 2 13 2 13 4 15 4 15 6 15 6 15 7 14 7 14 7 12 7 12 5 6 5 6 5 3 5 3 7 1 7 1 9 1 9 1 12 2 12 2 14 4 14 4 16 8 16 8 17 12 17 12 17 15 6 21 4 20 4 20 2 18 2 18 1 15 1 15 1 12 1 12 2 10 2 10 3 9 3 9 5 8 5 8 8 8 8 8 11 9 11 9 14 11 14 11 16 14 16 14 17 17 17 17 17 20 17 20 15 22 15 22 13 22 13 22 11 20 11 20 9 16 9 16 7 11 7 11 4 1 2 22 4 22 4 22 6 20 6 20 12 3 12 3 14 1 14 1 16 1 17 22 16 20 16 20 14 17 14 17 4 6 4 6 2 3 2 3 1 1 16 29 8 1 1 18 2 20 2 20 4 22 4 22 6 22 6 22 7 21 7 21 7 19 7 19 6 14 6 14 6 11 6 11 7 9 7 9 9 8 9 8 11 8 11 8 14 9 14 9 16 11 16 11 18 14 18 14 20 19 20 19 21 22 6 15 4 14 4 14 2 11 2 11 1 8 1 8 1 5 1 5 2 2 2 2 3 1 3 1 5 1 5 1 7 2 7 2 9 5 10 9 9 5 9 5 10 2 10 2 11 1 11 1 13 1 13 1 15 2 15 2 17 5 17 5 18 8 18 8 18 11 18 11 17 14 17 14 16 15 11 14 9 15 9 15 6 15 6 15 4 14 4 14 2 12 2 12 1 9 1 9 1 6 1 6 2 3 2 3 3 2 3 2 5 1 5 1 8 1 8 1 10 2 1 8 9 8 8 22 6 21 6 21 4 18 4 18 3 16 3 16 2 13 2 13 1 8 1 8 1 4 1 4 2 2 2 2 3 1 3 1 5 1 5 1 7 2 7 2 9 5 9 5 10 7 10 7 11 10 11 10 12 15 12 15 12 19 12 19 11 21 11 21 10 22 10 22 8 22 2 12 11 12 12 29 4 1 7 22 4 21 4 21 2 19 2 19 1 16 1 16 1 13 1 13 2 11 2 11 4 9 4 9 7 8 7 8 9 8 9 8 12 9 12 9 14 11 14 11 15 14 15 14 15 17 15 17 14 19 14 19 12 21 12 21 9 22 9 22 7 22 13 17 12 18 12 18 9 19 9 19 6 19 6 19 3 18 3 18 2 17 2 17 1 15 1 15 1 13 1 13 2 11 2 11 4 9 4 9 8 6 8 6 9 4 9 4 9 2 9 2 8 1 8 1 6 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 libccp4-8.0.0/data/fontpack.f0000644000000000000000000000100514242731033014045 0ustar 00000000000000 INTEGER*2 IFHT(150,4),IFSTRT(150,4),IFWID(150,4),IFX0(150,4), + IFY0(150,4),LENGF(150,4) INTEGER*1 NFONTS(4,3000,4) INTEGER IUNITF DATA IUNITF/11/ C C IFAIL = 0 ITEROP = -IUNITF CALL CCPDPN (-10,'font84.ascii','OLD','F',0,IFAIL) CALL CCPDPN (ITEROP,'font84.dat','NEW','U',80,IFAIL) READ(10,2000) IFSTRT,LENGF,IFX0,IFY0,IFWID,IFHT,NFONTS 2000 FORMAT(10I5) WRITE (IUNITF) IFSTRT,LENGF,IFX0,IFY0,IFWID,IFHT,NFONTS CLOSE (UNIT=IUNITF) END libccp4-8.0.0/data/fontunpack.for0000644000000000000000000000136314242731033014760 0ustar 00000000000000 INTEGER*2 IFHT,IFSTRT,IFWID,IFX0,IFY0,LENGF BYTE NFONTS INTEGER IUNITF COMMON /PINOUT/LUNIN,LUNOUT COMMON /PLT$FNT/IFSTRT(150,4),LENGF(150,4),IFX0(150,4), + IFY0(150,4),IFWID(150,4),IFHT(150,4),NFONTS(4,3000,4) DATA IUNITF/89/ C C IFAIL = 0 ITEROP = -IUNITF OPEN(UNIT=10,FILE='font84.ascii',STATUS='NEW') CALL CCPDPN (ITEROP,'font84.dat','OLD','U',80,IFAIL) IF (IFAIL.NE.0) THEN WRITE (6,FMT=6000) 6000 FORMAT (' Unable to read fonts - FILE=PUBLIC_FONT84') ELSE READ (IUNITF) IFSTRT,LENGF,IFX0,IFY0,IFWID,IFHT,NFONTS WRITE(10,2000) IFSTRT,LENGF,IFX0,IFY0,IFWID,IFHT,NFONTS 2000 FORMAT(10I10) CLOSE (UNIT=IUNITF) ENDIF END libccp4-8.0.0/data/syminfo.lib0000644000000000000000000116674614242731033014276 0ustar 00000000000000# This file contains a list of spacegroups, each in a # number of settings. Each setting is delimited by # begin_spacegroup / end_spacegroup records. For each # spacegroup setting, the following are listed: # number = standard spacegroup number # basisop = change of basis operator # symbol ccp4 = CCP4 spacegroup number e.g. 1003 # (0 if not a CCP4 group) # symbol Hall = Hall symbol # symbol xHM = extended Hermann Mauguin symbol # symbol old = CCP4 spacegroup name # (blank if not a CCP4 group) # symbol laue = Laue group symbol # symbol patt = Patterson group symbol # symbol pgrp = Point group symbol # hklasu ccp4 = reciprocal space asymmetric unit # (with respect to standard setting) # mapasu ccp4 = CCP4 real space asymmetric unit # (with respect to standard setting) # (negative ranges if not a CCP4 group) # mapasu zero = origin based real space asymmetric unit # (with respect to current setting) # mapasu nonz = non-origin based real space asymmetric unit # (with respect to current setting) # cheshire = Cheshire cell # (with respect to standard setting) # symop = list of primitive symmetry operators # cenop = list of centering operators # begin_spacegroup number 1 basisop x,y,z symbol ccp4 1 symbol Hall ' P 1' symbol xHM 'P 1' symbol old 'P 1' symbol laue '-P 1' '-1' symbol patt '-P 1' '-1' symbol pgrp ' P 1' '1' hklasu ccp4 'l>0 or (l==0 and (h>0 or (h==0 and k>=0)))' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<1 mapasu zero 0<=x<1; 0<=y<1; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<1; 0<=z<1 cheshire 0<=x<=0; 0<=y<=0; 0<=z<=0 symop x,y,z cenop x,y,z end_spacegroup begin_spacegroup number 2 basisop x,y,z symbol ccp4 2 symbol Hall '-P 1' symbol xHM 'P -1' symbol old 'P -1' symbol laue '-P 1' '-1' symbol patt '-P 1' '-1' symbol pgrp '-P 1' '-1' hklasu ccp4 'l>0 or (l==0 and (h>0 or (h==0 and k>=0)))' mapasu ccp4 0<=x<1; 0<=y<=1/2; 0<=z<1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,-z cenop x,y,z end_spacegroup begin_spacegroup number 3 basisop x,y,z symbol ccp4 3 symbol Hall ' P 2y' symbol xHM 'P 1 2 1' symbol old 'P 1 2 1' symbol laue '-P 2y' '2/m' symbol patt '-P 2y' '2/m' symbol pgrp ' P 2y' '2' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<=1/2; 0<=y<1; 0<=z<1 mapasu zero 0<=x<=1/2; 0<=y<1; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<1; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=0; 0<=z<=1/2 symop x,y,z symop -x,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 3 basisop z,x,y symbol ccp4 1003 symbol Hall ' P 2y (z,x,y)' symbol xHM 'P 1 1 2' symbol old 'P 1 1 2' symbol laue '-P 2' '2/m' symbol patt '-P 2' '2/m' symbol pgrp ' P 2' '2' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<=1/2; 0<=y<1; 0<=z<1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=0; 0<=z<=1/2 symop x,y,z symop -x,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 3 basisop y,z,x symbol ccp4 0 symbol Hall ' P 2y (y,z,x)' symbol xHM 'P 2 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-P 2x' '2/m' symbol pgrp ' P 2x' '2' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=0; 0<=z<=1/2 symop x,y,z symop x,-y,-z cenop x,y,z end_spacegroup begin_spacegroup number 4 basisop x,y,z symbol ccp4 4 symbol Hall ' P 2yb' symbol xHM 'P 1 21 1' symbol old 'P 1 21 1' symbol laue '-P 2y' '2/m' symbol patt '-P 2y' '2/m' symbol pgrp ' P 2y' '2' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<1; 0<=y<1/2; 0<=z<1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=0; 0<=z<=1/2 symop x,y,z symop -x,y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 4 basisop z,x,y symbol ccp4 1004 symbol Hall ' P 2yb (z,x,y)' symbol xHM 'P 1 1 21' symbol old 'P 1 1 21' symbol laue '-P 2' '2/m' symbol patt '-P 2' '2/m' symbol pgrp ' P 2' '2' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<1/2 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=0; 0<=z<=1/2 symop x,y,z symop -x,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 4 basisop y,z,x symbol ccp4 0 symbol Hall ' P 2yb (y,z,x)' symbol xHM 'P 21 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-P 2x' '2/m' symbol pgrp ' P 2x' '2' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=0; 0<=z<=1/2 symop x,y,z symop x+1/2,-y,-z cenop x,y,z end_spacegroup begin_spacegroup number 5 basisop x,y,z symbol ccp4 5 symbol Hall ' C 2y' symbol xHM 'C 1 2 1' symbol old 'C 1 2 1' symbol laue '-P 2y' '2/m' symbol patt '-C 2y' '2/m' symbol pgrp ' P 2y' '2' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<=1/2; 0<=y<1/2; 0<=z<1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=0; 0<=z<=1/2 symop x,y,z symop -x,y,-z cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 5 basisop z,y,-x symbol ccp4 2005 symbol Hall ' C 2y (z,y,-x)' symbol xHM 'A 1 2 1' symbol old 'A 1 2 1' 'A 2' symbol laue '-P 2y' '2/m' symbol patt '-A 2y' '2/m' symbol pgrp ' P 2y' '2' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=0; 0<=z<=1/2 symop x,y,z symop -x,y,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 5 basisop x,y,-x+z symbol ccp4 4005 symbol Hall ' C 2y (x,y,-x+z)' symbol xHM 'I 1 2 1' symbol old 'I 1 2 1' 'I 2' symbol laue '-P 2y' '2/m' symbol patt '-I 2y' '2/m' symbol pgrp ' P 2y' '2' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=0; 0<=z<=1/2 symop x,y,z symop -x,y,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 5 basisop z,x,y symbol ccp4 0 symbol Hall ' C 2y (z,x,y)' symbol xHM 'A 1 1 2' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-A 2' '2/m' symbol pgrp ' P 2' '2' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=0; 0<=z<=1/2 symop x,y,z symop -x,-y,z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 5 basisop -x,z,y symbol ccp4 1005 symbol Hall ' C 2y (-x,z,y)' symbol xHM 'B 1 1 2' symbol old 'B 1 1 2' 'B 2' symbol laue '-P 2' '2/m' symbol patt '-B 2' '2/m' symbol pgrp ' P 2' '2' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<1; 0<=y<=1/2; 0<=z<1/2 mapasu zero 0<=x<1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=0; 0<=z<=1/2 symop x,y,z symop -x,-y,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 5 basisop -x+z,x,y symbol ccp4 0 symbol Hall ' C 2y (-x+z,x,y)' symbol xHM 'I 1 1 2' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-I 2' '2/m' symbol pgrp ' P 2' '2' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=0; 0<=z<=1/2 symop x,y,z symop -x,-y,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 5 basisop y,z,x symbol ccp4 0 symbol Hall ' C 2y (y,z,x)' symbol xHM 'B 2 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-B 2x' '2/m' symbol pgrp ' P 2x' '2' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=0; 0<=z<=1/2 symop x,y,z symop x,-y,-z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 5 basisop y,-x,z symbol ccp4 0 symbol Hall ' C 2y (y,-x,z)' symbol xHM 'C 2 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-C 2x' '2/m' symbol pgrp ' P 2x' '2' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=0; 0<=z<=1/2 symop x,y,z symop x,-y,-z cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 5 basisop y,-x+z,x symbol ccp4 0 symbol Hall ' C 2y (y,-x+z,x)' symbol xHM 'I 2 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-I 2x' '2/m' symbol pgrp ' P 2x' '2' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=0; 0<=z<=1/2 symop x,y,z symop x,-y,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 6 basisop x,y,z symbol ccp4 6 symbol Hall ' P -2y' symbol xHM 'P 1 m 1' symbol old 'P 1 m 1' symbol laue '-P 2y' '2/m' symbol patt '-P 2y' '2/m' symbol pgrp ' P -2y' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 6 basisop z,x,y symbol ccp4 1006 symbol Hall ' P -2y (z,x,y)' symbol xHM 'P 1 1 m' symbol old 'P 1 1 m' symbol laue '-P 2' '2/m' symbol patt '-P 2' '2/m' symbol pgrp ' P -2' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<1; 0<=z<=1/2 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 6 basisop y,z,x symbol ccp4 0 symbol Hall ' P -2y (y,z,x)' symbol xHM 'P m 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-P 2x' '2/m' symbol pgrp ' P -2x' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<1; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,z cenop x,y,z end_spacegroup begin_spacegroup number 7 basisop x,y,z symbol ccp4 7 symbol Hall ' P -2yc' symbol xHM 'P 1 c 1' symbol old 'P 1 c 1' symbol laue '-P 2y' '2/m' symbol patt '-P 2y' '2/m' symbol pgrp ' P -2y' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 7 basisop x-z,y,z symbol ccp4 0 symbol Hall ' P -2yc (x-z,y,z)' symbol xHM 'P 1 n 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-P 2y' '2/m' symbol pgrp ' P -2y' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 7 basisop z,y,-x symbol ccp4 0 symbol Hall ' P -2yc (z,y,-x)' symbol xHM 'P 1 a 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-P 2y' '2/m' symbol pgrp ' P -2y' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 7 basisop z,x,y symbol ccp4 0 symbol Hall ' P -2yc (z,x,y)' symbol xHM 'P 1 1 a' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-P 2' '2/m' symbol pgrp ' P -2' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<1; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<1; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 7 basisop z,x-z,y symbol ccp4 0 symbol Hall ' P -2yc (z,x-z,y)' symbol xHM 'P 1 1 n' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-P 2' '2/m' symbol pgrp ' P -2' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 7 basisop -x,z,y symbol ccp4 1007 symbol Hall ' P -2yc (-x,z,y)' symbol xHM 'P 1 1 b' symbol old 'P 1 1 b' symbol laue '-P 2' '2/m' symbol patt '-P 2' '2/m' symbol pgrp ' P -2' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 7 basisop y,z,x symbol ccp4 0 symbol Hall ' P -2yc (y,z,x)' symbol xHM 'P b 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-P 2x' '2/m' symbol pgrp ' P -2x' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 7 basisop y,z,x-z symbol ccp4 0 symbol Hall ' P -2yc (y,z,x-z)' symbol xHM 'P n 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-P 2x' '2/m' symbol pgrp ' P -2x' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 7 basisop y,-x,z symbol ccp4 0 symbol Hall ' P -2yc (y,-x,z)' symbol xHM 'P c 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-P 2x' '2/m' symbol pgrp ' P -2x' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<1; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 8 basisop x,y,z symbol ccp4 8 symbol Hall ' C -2y' symbol xHM 'C 1 m 1' symbol old 'C 1 m 1' symbol laue '-P 2y' '2/m' symbol patt '-C 2y' '2/m' symbol pgrp ' P -2y' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,z cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 8 basisop z,y,-x symbol ccp4 0 symbol Hall ' C -2y (z,y,-x)' symbol xHM 'A 1 m 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-A 2y' '2/m' symbol pgrp ' P -2y' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 8 basisop x,y,-x+z symbol ccp4 0 symbol Hall ' C -2y (x,y,-x+z)' symbol xHM 'I 1 m 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-I 2y' '2/m' symbol pgrp ' P -2y' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 8 basisop z,x,y symbol ccp4 0 symbol Hall ' C -2y (z,x,y)' symbol xHM 'A 1 1 m' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-A 2' '2/m' symbol pgrp ' P -2' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<1/2; 0<=z<=1/2 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,y,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 8 basisop -x,z,y symbol ccp4 0 symbol Hall ' C -2y (-x,z,y)' symbol xHM 'B 1 1 m' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-B 2' '2/m' symbol pgrp ' P -2' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<1; 0<=z<=1/2 mapasu nonz 0<=x<1/2; 0<=y<1; 0<=z<=1/2 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,y,-z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 8 basisop -x+z,x,y symbol ccp4 0 symbol Hall ' C -2y (-x+z,x,y)' symbol xHM 'I 1 1 m' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-I 2' '2/m' symbol pgrp ' P -2' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<1/2; 0<=z<=1/2 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,y,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 8 basisop y,z,x symbol ccp4 0 symbol Hall ' C -2y (y,z,x)' symbol xHM 'B m 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-B 2x' '2/m' symbol pgrp ' P -2x' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 8 basisop y,-x,z symbol ccp4 0 symbol Hall ' C -2y (y,-x,z)' symbol xHM 'C m 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-C 2x' '2/m' symbol pgrp ' P -2x' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,z cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 8 basisop y,-x+z,x symbol ccp4 0 symbol Hall ' C -2y (y,-x+z,x)' symbol xHM 'I m 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-I 2x' '2/m' symbol pgrp ' P -2x' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 9 basisop x,y,z symbol ccp4 9 symbol Hall ' C -2yc' symbol xHM 'C 1 c 1' symbol old 'C 1 c 1' symbol laue '-P 2y' '2/m' symbol patt '-C 2y' '2/m' symbol pgrp ' P -2y' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 9 basisop z,y,-x+z symbol ccp4 0 symbol Hall ' C -2yc (z,y,-x+z)' symbol xHM 'A 1 n 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-A 2y' '2/m' symbol pgrp ' P -2y' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,-y,z+1/2 cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 9 basisop x+z,y,-x symbol ccp4 0 symbol Hall ' C -2yc (x+z,y,-x)' symbol xHM 'I 1 a 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-I 2y' '2/m' symbol pgrp ' P -2y' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,-y,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 9 basisop z,y,-x symbol ccp4 0 symbol Hall ' C -2yc (z,y,-x)' symbol xHM 'A 1 a 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-A 2y' '2/m' symbol pgrp ' P -2y' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,-y,z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 9 basisop x+1/4,y+1/4,z symbol ccp4 0 symbol Hall ' C -2yc (x+1/4,y+1/4,z)' symbol xHM 'C 1 n 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-C 2y' '2/m' symbol pgrp ' P -2y' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y+1/2,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 9 basisop x,y,-x+z symbol ccp4 0 symbol Hall ' C -2yc (x,y,-x+z)' symbol xHM 'I 1 c 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-I 2y' '2/m' symbol pgrp ' P -2y' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 9 basisop z,x,y symbol ccp4 0 symbol Hall ' C -2yc (z,x,y)' symbol xHM 'A 1 1 a' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-A 2' '2/m' symbol pgrp ' P -2' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,y,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 9 basisop -x+z,z,y symbol ccp4 0 symbol Hall ' C -2yc (-x+z,z,y)' symbol xHM 'B 1 1 n' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-B 2' '2/m' symbol pgrp ' P -2' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,y+1/2,-z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 9 basisop -x,x+z,y symbol ccp4 0 symbol Hall ' C -2yc (-x,x+z,y)' symbol xHM 'I 1 1 b' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-I 2' '2/m' symbol pgrp ' P -2' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,y+1/2,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 9 basisop -x,z,y symbol ccp4 1009 symbol Hall ' C -2yc (-x,z,y)' symbol xHM 'B 1 1 b' symbol old 'B 1 1 b' symbol laue '-P 2' '2/m' symbol patt '-B 2' '2/m' symbol pgrp ' P -2' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,y+1/2,-z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 9 basisop z,x-z,y symbol ccp4 0 symbol Hall ' C -2yc (z,x-z,y)' symbol xHM 'A 1 1 n' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-A 2' '2/m' symbol pgrp ' P -2' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,y+1/2,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 9 basisop -x+z,x,y symbol ccp4 0 symbol Hall ' C -2yc (-x+z,x,y)' symbol xHM 'I 1 1 a' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-I 2' '2/m' symbol pgrp ' P -2' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,y,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 9 basisop y,z,x symbol ccp4 0 symbol Hall ' C -2yc (y,z,x)' symbol xHM 'B b 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-B 2x' '2/m' symbol pgrp ' P -2x' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y+1/2,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 9 basisop y,-x+z,z symbol ccp4 0 symbol Hall ' C -2yc (y,-x+z,z)' symbol xHM 'C n 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-C 2x' '2/m' symbol pgrp ' P -2x' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 0<=y<1; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y+1/2,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 9 basisop y,-x,x+z symbol ccp4 0 symbol Hall ' C -2yc (y,-x,x+z)' symbol xHM 'I c 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-I 2x' '2/m' symbol pgrp ' P -2x' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 9 basisop y,-x,z symbol ccp4 0 symbol Hall ' C -2yc (y,-x,z)' symbol xHM 'C c 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-C 2x' '2/m' symbol pgrp ' P -2x' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 9 basisop y,z,x-z symbol ccp4 0 symbol Hall ' C -2yc (y,z,x-z)' symbol xHM 'B n 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-B 2x' '2/m' symbol pgrp ' P -2x' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y+1/2,z+1/2 cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 9 basisop y,-x+z,x symbol ccp4 0 symbol Hall ' C -2yc (y,-x+z,x)' symbol xHM 'I b 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-I 2x' '2/m' symbol pgrp ' P -2x' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 0<=y<1; 0<=z<1 cheshire 0<=x<=0; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y+1/2,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 10 basisop x,y,z symbol ccp4 10 symbol Hall '-P 2y' symbol xHM 'P 1 2/m 1' symbol old 'P 1 2/m 1' symbol laue '-P 2y' '2/m' symbol patt '-P 2y' '2/m' symbol pgrp '-P 2y' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z symop -x,-y,-z symop x,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 10 basisop z,x,y symbol ccp4 1010 symbol Hall '-P 2y (z,x,y)' symbol xHM 'P 1 1 2/m' symbol old 'P 1 1 2/m' symbol laue '-P 2' '2/m' symbol patt '-P 2' '2/m' symbol pgrp '-P 2' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop -x,-y,-z symop x,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 10 basisop y,z,x symbol ccp4 0 symbol Hall '-P 2y (y,z,x)' symbol xHM 'P 2/m 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-P 2x' '2/m' symbol pgrp '-P 2x' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z symop -x,-y,-z symop -x,y,z cenop x,y,z end_spacegroup begin_spacegroup number 11 basisop x,y,z symbol ccp4 11 symbol Hall '-P 2yb' symbol xHM 'P 1 21/m 1' symbol old 'P 1 21/m 1' symbol laue '-P 2y' '2/m' symbol patt '-P 2y' '2/m' symbol pgrp '-P 2y' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y+1/2,-z symop -x,-y,-z symop x,-y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 11 basisop z,x,y symbol ccp4 1011 symbol Hall '-P 2yb (z,x,y)' symbol xHM 'P 1 1 21/m' symbol old 'P 1 1 21/m' symbol laue '-P 2' '2/m' symbol patt '-P 2' '2/m' symbol pgrp '-P 2' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1; 0<=z<=1/4 mapasu nonz 0<=x<1; 0<=y<=1/2; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z+1/2 symop -x,-y,-z symop x,y,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 11 basisop y,z,x symbol ccp4 0 symbol Hall '-P 2yb (y,z,x)' symbol xHM 'P 21/m 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-P 2x' '2/m' symbol pgrp '-P 2x' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y,-z symop -x,-y,-z symop -x+1/2,y,z cenop x,y,z end_spacegroup begin_spacegroup number 12 basisop x,y,z symbol ccp4 12 symbol Hall '-C 2y' symbol xHM 'C 1 2/m 1' symbol old 'C 1 2/m 1' symbol laue '-P 2y' '2/m' symbol patt '-C 2y' '2/m' symbol pgrp '-P 2y' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z symop -x,-y,-z symop x,-y,z cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 12 basisop z,y,-x symbol ccp4 0 symbol Hall '-C 2y (z,y,-x)' symbol xHM 'A 1 2/m 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-A 2y' '2/m' symbol pgrp '-P 2y' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z symop -x,-y,-z symop x,-y,z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 12 basisop x,y,-x+z symbol ccp4 0 symbol Hall '-C 2y (x,y,-x+z)' symbol xHM 'I 1 2/m 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-I 2y' '2/m' symbol pgrp '-P 2y' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z symop -x,-y,-z symop x,-y,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 12 basisop z,x,y symbol ccp4 0 symbol Hall '-C 2y (z,x,y)' symbol xHM 'A 1 1 2/m' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-A 2' '2/m' symbol pgrp '-P 2' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop -x,-y,-z symop x,y,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 12 basisop -x,z,y symbol ccp4 1012 symbol Hall '-C 2y (-x,z,y)' symbol xHM 'B 1 1 2/m' symbol old 'B 1 1 2/m' symbol laue '-P 2' '2/m' symbol patt '-B 2' '2/m' symbol pgrp '-P 2' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<1/2; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop -x,-y,-z symop x,y,-z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 12 basisop -x+z,x,y symbol ccp4 0 symbol Hall '-C 2y (-x+z,x,y)' symbol xHM 'I 1 1 2/m' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-I 2' '2/m' symbol pgrp '-P 2' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop -x,-y,-z symop x,y,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 12 basisop y,z,x symbol ccp4 0 symbol Hall '-C 2y (y,z,x)' symbol xHM 'B 2/m 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-B 2x' '2/m' symbol pgrp '-P 2x' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z symop -x,-y,-z symop -x,y,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 12 basisop y,-x,z symbol ccp4 0 symbol Hall '-C 2y (y,-x,z)' symbol xHM 'C 2/m 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-C 2x' '2/m' symbol pgrp '-P 2x' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z symop -x,-y,-z symop -x,y,z cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 12 basisop y,-x+z,x symbol ccp4 0 symbol Hall '-C 2y (y,-x+z,x)' symbol xHM 'I 2/m 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-I 2x' '2/m' symbol pgrp '-P 2x' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z symop -x,-y,-z symop -x,y,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 13 basisop x,y,z symbol ccp4 13 symbol Hall '-P 2yc' symbol xHM 'P 1 2/c 1' symbol old 'P 1 2/c 1' symbol laue '-P 2y' '2/m' symbol patt '-P 2y' '2/m' symbol pgrp '-P 2y' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z+1/2 symop -x,-y,-z symop x,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 13 basisop x-z,y,z symbol ccp4 0 symbol Hall '-P 2yc (x-z,y,z)' symbol xHM 'P 1 2/n 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-P 2y' '2/m' symbol pgrp '-P 2y' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y,-z+1/2 symop -x,-y,-z symop x+1/2,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 13 basisop z,y,-x symbol ccp4 0 symbol Hall '-P 2yc (z,y,-x)' symbol xHM 'P 1 2/a 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-P 2y' '2/m' symbol pgrp '-P 2y' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<1; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y,-z symop -x,-y,-z symop x+1/2,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 13 basisop z,x,y symbol ccp4 0 symbol Hall '-P 2yc (z,x,y)' symbol xHM 'P 1 1 2/a' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-P 2' '2/m' symbol pgrp '-P 2' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y,z symop -x,-y,-z symop x+1/2,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 13 basisop z,x-z,y symbol ccp4 0 symbol Hall '-P 2yc (z,x-z,y)' symbol xHM 'P 1 1 2/n' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-P 2' '2/m' symbol pgrp '-P 2' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y+1/2,z symop -x,-y,-z symop x+1/2,y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 13 basisop -x,z,y symbol ccp4 1013 symbol Hall '-P 2yc (-x,z,y)' symbol xHM 'P 1 1 2/b' symbol old 'P 1 1 2/b' symbol laue '-P 2' '2/m' symbol patt '-P 2' '2/m' symbol pgrp '-P 2' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y+1/2,z symop -x,-y,-z symop x,y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 13 basisop y,z,x symbol ccp4 0 symbol Hall '-P 2yc (y,z,x)' symbol xHM 'P 2/b 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-P 2x' '2/m' symbol pgrp '-P 2x' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y+1/2,-z symop -x,-y,-z symop -x,y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 13 basisop y,z,x-z symbol ccp4 0 symbol Hall '-P 2yc (y,z,x-z)' symbol xHM 'P 2/n 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-P 2x' '2/m' symbol pgrp '-P 2x' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y+1/2,-z+1/2 symop -x,-y,-z symop -x,y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 13 basisop y,-x,z symbol ccp4 0 symbol Hall '-P 2yc (y,-x,z)' symbol xHM 'P 2/c 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-P 2x' '2/m' symbol pgrp '-P 2x' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z+1/2 symop -x,-y,-z symop -x,y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 14 basisop x,y,z symbol ccp4 14 symbol Hall '-P 2ybc' symbol xHM 'P 1 21/c 1' symbol old 'P 1 21/c 1' symbol laue '-P 2y' '2/m' symbol patt '-P 2y' '2/m' symbol pgrp '-P 2y' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y+1/2,-z+1/2 symop -x,-y,-z symop x,-y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 14 basisop x-z,y,z symbol ccp4 2014 symbol Hall '-P 2ybc (x-z,y,z)' symbol xHM 'P 1 21/n 1' symbol old 'P 1 21/n 1' symbol laue '-P 2y' '2/m' symbol patt '-P 2y' '2/m' symbol pgrp '-P 2y' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y+1/2,-z+1/2 symop -x,-y,-z symop x+1/2,-y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 14 basisop z,y,-x symbol ccp4 3014 symbol Hall '-P 2ybc (z,y,-x)' symbol xHM 'P 1 21/a 1' symbol old 'P 1 21/a 1' symbol laue '-P 2y' '2/m' symbol patt '-P 2y' '2/m' symbol pgrp '-P 2y' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y+1/2,-z symop -x,-y,-z symop x+1/2,-y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 14 basisop z,x,y symbol ccp4 0 symbol Hall '-P 2ybc (z,x,y)' symbol xHM 'P 1 1 21/a' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-P 2' '2/m' symbol pgrp '-P 2' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y,z+1/2 symop -x,-y,-z symop x+1/2,y,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 14 basisop z,x-z,y symbol ccp4 0 symbol Hall '-P 2ybc (z,x-z,y)' symbol xHM 'P 1 1 21/n' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-P 2' '2/m' symbol pgrp '-P 2' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y+1/2,z+1/2 symop -x,-y,-z symop x+1/2,y+1/2,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 14 basisop -x,z,y symbol ccp4 1014 symbol Hall '-P 2ybc (-x,z,y)' symbol xHM 'P 1 1 21/b' symbol old 'P 1 1 21/b' symbol laue '-P 2' '2/m' symbol patt '-P 2' '2/m' symbol pgrp '-P 2' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y+1/2,z+1/2 symop -x,-y,-z symop x,y+1/2,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 14 basisop y,z,x symbol ccp4 0 symbol Hall '-P 2ybc (y,z,x)' symbol xHM 'P 21/b 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-P 2x' '2/m' symbol pgrp '-P 2x' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y+1/2,-z symop -x,-y,-z symop -x+1/2,y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 14 basisop y,z,x-z symbol ccp4 0 symbol Hall '-P 2ybc (y,z,x-z)' symbol xHM 'P 21/n 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-P 2x' '2/m' symbol pgrp '-P 2x' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y+1/2,-z+1/2 symop -x,-y,-z symop -x+1/2,y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 14 basisop y,-x,z symbol ccp4 0 symbol Hall '-P 2ybc (y,-x,z)' symbol xHM 'P 21/c 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-P 2x' '2/m' symbol pgrp '-P 2x' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 0<=y<1; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y,-z+1/2 symop -x,-y,-z symop -x+1/2,y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 15 basisop x,y,z symbol ccp4 15 symbol Hall '-C 2yc' symbol xHM 'C 1 2/c 1' symbol old 'C 1 2/c 1' symbol laue '-P 2y' '2/m' symbol patt '-C 2y' '2/m' symbol pgrp '-P 2y' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z+1/2 symop -x,-y,-z symop x,-y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 15 basisop z,y,-x+z symbol ccp4 0 symbol Hall '-C 2yc (z,y,-x+z)' symbol xHM 'A 1 2/n 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-A 2y' '2/m' symbol pgrp '-P 2y' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y,-z+1/2 symop -x,-y,-z symop x+1/2,-y,z+1/2 cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 15 basisop x+z,y,-x symbol ccp4 0 symbol Hall '-C 2yc (x+z,y,-x)' symbol xHM 'I 1 2/a 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-I 2y' '2/m' symbol pgrp '-P 2y' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y,-z symop -x,-y,-z symop x+1/2,-y,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 15 basisop z,y,-x symbol ccp4 0 symbol Hall '-C 2yc (z,y,-x)' symbol xHM 'A 1 2/a 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-A 2y' '2/m' symbol pgrp '-P 2y' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y,-z symop -x,-y,-z symop x+1/2,-y,z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 15 basisop x+1/4,y-1/4,z symbol ccp4 0 symbol Hall '-C 2yc (x+1/4,y-1/4,z)' symbol xHM 'C 1 2/n 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-C 2y' '2/m' symbol pgrp '-P 2y' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y,-z+1/2 symop -x+1/2,-y+1/2,-z symop x,-y+1/2,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 15 basisop x,y,-x+z symbol ccp4 0 symbol Hall '-C 2yc (x,y,-x+z)' symbol xHM 'I 1 2/c 1' symbol old '' symbol laue '-P 2y' '2/m' symbol patt '-I 2y' '2/m' symbol pgrp '-P 2y' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z+1/2 symop -x,-y,-z symop x,-y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 15 basisop z,x,y symbol ccp4 0 symbol Hall '-C 2yc (z,x,y)' symbol xHM 'A 1 1 2/a' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-A 2' '2/m' symbol pgrp '-P 2' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y,z symop -x,-y,-z symop x+1/2,y,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 15 basisop -x+z,z,y symbol ccp4 0 symbol Hall '-C 2yc (-x+z,z,y)' symbol xHM 'B 1 1 2/n' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-B 2' '2/m' symbol pgrp '-P 2' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y+1/2,z symop -x,-y,-z symop x+1/2,y+1/2,-z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 15 basisop -x,x+z,y symbol ccp4 0 symbol Hall '-C 2yc (-x,x+z,y)' symbol xHM 'I 1 1 2/b' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-I 2' '2/m' symbol pgrp '-P 2' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y+1/2,z symop -x,-y,-z symop x,y+1/2,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 15 basisop -x,z,y symbol ccp4 1015 symbol Hall '-C 2yc (-x,z,y)' symbol xHM 'B 1 1 2/b' symbol old 'B 1 1 2/b' symbol laue '-P 2' '2/m' symbol patt '-B 2' '2/m' symbol pgrp '-P 2' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y+1/2,z symop -x,-y,-z symop x,y+1/2,-z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 15 basisop z,x-z,y symbol ccp4 0 symbol Hall '-C 2yc (z,x-z,y)' symbol xHM 'A 1 1 2/n' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-A 2' '2/m' symbol pgrp '-P 2' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y+1/2,z symop -x,-y,-z symop x+1/2,y+1/2,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 15 basisop -x+z,x,y symbol ccp4 0 symbol Hall '-C 2yc (-x+z,x,y)' symbol xHM 'I 1 1 2/a' symbol old '' symbol laue '-P 2' '2/m' symbol patt '-I 2' '2/m' symbol pgrp '-P 2' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y,z symop -x,-y,-z symop x+1/2,y,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 15 basisop y,z,x symbol ccp4 0 symbol Hall '-C 2yc (y,z,x)' symbol xHM 'B 2/b 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-B 2x' '2/m' symbol pgrp '-P 2x' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y+1/2,-z symop -x,-y,-z symop -x,y+1/2,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 15 basisop y,-x+z,z symbol ccp4 0 symbol Hall '-C 2yc (y,-x+z,z)' symbol xHM 'C 2/n 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-C 2x' '2/m' symbol pgrp '-P 2x' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y+1/2,-z+1/2 symop -x,-y,-z symop -x,y+1/2,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 15 basisop y,-x,x+z symbol ccp4 0 symbol Hall '-C 2yc (y,-x,x+z)' symbol xHM 'I 2/c 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-I 2x' '2/m' symbol pgrp '-P 2x' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z+1/2 symop -x,-y,-z symop -x,y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 15 basisop y,-x,z symbol ccp4 0 symbol Hall '-C 2yc (y,-x,z)' symbol xHM 'C 2/c 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-C 2x' '2/m' symbol pgrp '-P 2x' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z+1/2 symop -x,-y,-z symop -x,y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 15 basisop y,z,x-z symbol ccp4 0 symbol Hall '-C 2yc (y,z,x-z)' symbol xHM 'B 2/n 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-B 2x' '2/m' symbol pgrp '-P 2x' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y+1/2,-z+1/2 symop -x,-y,-z symop -x,y+1/2,z+1/2 cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 15 basisop y,-x+z,x symbol ccp4 0 symbol Hall '-C 2yc (y,-x+z,x)' symbol xHM 'I 2/b 1 1' symbol old '' symbol laue '-P 2x' '2/m' symbol patt '-I 2x' '2/m' symbol pgrp '-P 2x' '2/m' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1/2 mapasu nonz 1/4<=x<=3/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y+1/2,-z symop -x,-y,-z symop -x,y+1/2,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 16 basisop x,y,z symbol ccp4 16 symbol Hall ' P 2 2' symbol xHM 'P 2 2 2' symbol old 'P 2 2 2' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x,-y,-z symop -x,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 17 basisop x,y,z symbol ccp4 17 symbol Hall ' P 2c 2' symbol xHM 'P 2 2 21' symbol old 'P 2 2 21' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z+1/2 symop x,-y,-z symop -x,y,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 17 basisop z,x,y symbol ccp4 1017 symbol Hall ' P 2c 2 (z,x,y)' symbol xHM 'P 21 2 2' symbol old 'P 21 2 2' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<1; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y,-z symop -x,y,-z symop -x+1/2,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 17 basisop y,z,x symbol ccp4 2017 symbol Hall ' P 2c 2 (y,z,x)' symbol xHM 'P 2 21 2' symbol old 'P 2 21 2' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<1; 0<=z<=1/2 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y+1/2,-z symop -x,-y,z symop x,-y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 18 basisop x,y,z symbol ccp4 18 symbol Hall ' P 2 2ab' symbol xHM 'P 21 21 2' symbol old 'P 21 21 2' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x+1/2,-y+1/2,-z symop -x+1/2,y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 18 basisop z,x,y symbol ccp4 3018 symbol Hall ' P 2 2ab (z,x,y)' symbol xHM 'P 2 21 21' symbol old 'P 2 21 21' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/4 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z symop -x,y+1/2,-z+1/2 symop -x,-y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 18 basisop y,z,x symbol ccp4 2018 symbol Hall ' P 2 2ab (y,z,x)' symbol xHM 'P 21 2 21' symbol old 'P 21 2 21' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<=1/4; 0<=y<1; 0<=z<1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z symop -x+1/2,-y,z+1/2 symop x+1/2,-y,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 19 basisop x,y,z symbol ccp4 19 symbol Hall ' P 2ac 2ab' symbol xHM 'P 21 21 21' symbol old 'P 21 21 21' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/4 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y,z+1/2 symop x+1/2,-y+1/2,-z symop -x,y+1/2,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 20 basisop x,y,z symbol ccp4 20 symbol Hall ' C 2c 2' symbol xHM 'C 2 2 21' symbol old 'C 2 2 21' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z+1/2 symop x,-y,-z symop -x,y,-z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 20 basisop z,x,y symbol ccp4 0 symbol Hall ' C 2c 2 (z,x,y)' symbol xHM 'A 21 2 2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y,-z symop -x,y,-z symop -x+1/2,-y,z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 20 basisop y,z,x symbol ccp4 0 symbol Hall ' C 2c 2 (y,z,x)' symbol xHM 'B 2 21 2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y+1/2,-z symop -x,-y,z symop x,-y+1/2,-z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 21 basisop x,y,z symbol ccp4 21 symbol Hall ' C 2 2' symbol xHM 'C 2 2 2' symbol old 'C 2 2 2' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x,-y,-z symop -x,y,-z cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 21 basisop z,x,y symbol ccp4 0 symbol Hall ' C 2 2 (z,x,y)' symbol xHM 'A 2 2 2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z symop -x,y,-z symop -x,-y,z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 21 basisop y,z,x symbol ccp4 0 symbol Hall ' C 2 2 (y,z,x)' symbol xHM 'B 2 2 2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z symop -x,-y,z symop x,-y,-z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 22 basisop x,y,z symbol ccp4 22 symbol Hall ' F 2 2' symbol xHM 'F 2 2 2' symbol old 'F 2 2 2' symbol laue '-P 2 2' 'mmm' symbol patt '-F 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x,-y,-z symop -x,y,-z cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 23 basisop x,y,z symbol ccp4 23 symbol Hall ' I 2 2' symbol xHM 'I 2 2 2' symbol old 'I 2 2 2' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x,-y,-z symop -x,y,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 24 basisop x,y,z symbol ccp4 24 symbol Hall ' I 2b 2c' symbol xHM 'I 21 21 21' symbol old 'I 21 21 21' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y+1/2,z symop x,-y,-z+1/2 symop -x,y+1/2,-z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 25 basisop x,y,z symbol ccp4 25 symbol Hall ' P 2 -2' symbol xHM 'P m m 2' symbol old 'P m m 2' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop -x,y,z symop x,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 25 basisop z,x,y symbol ccp4 0 symbol Hall ' P 2 -2 (z,x,y)' symbol xHM 'P 2 m m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x,-y,z symop x,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 25 basisop y,z,x symbol ccp4 0 symbol Hall ' P 2 -2 (y,z,x)' symbol xHM 'P m 2 m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<1; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop x,y,-z symop -x,y,z cenop x,y,z end_spacegroup begin_spacegroup number 26 basisop x,y,z symbol ccp4 26 symbol Hall ' P 2c -2' symbol xHM 'P m c 21' symbol old 'P m c 21' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z+1/2 symop -x,y,z symop x,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 26 basisop y,-x,z symbol ccp4 0 symbol Hall ' P 2c -2 (y,-x,z)' symbol xHM 'P c m 21' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z+1/2 symop x,-y,z symop -x,y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 26 basisop z,x,y symbol ccp4 0 symbol Hall ' P 2c -2 (z,x,y)' symbol xHM 'P 21 m a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,-y,-z symop x,-y,z symop x+1/2,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 26 basisop z,y,-x symbol ccp4 0 symbol Hall ' P 2c -2 (z,y,-x)' symbol xHM 'P 21 a m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,-y,-z symop x,y,-z symop x+1/2,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 26 basisop y,z,x symbol ccp4 0 symbol Hall ' P 2c -2 (y,z,x)' symbol xHM 'P b 21 m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y+1/2,-z symop x,y,-z symop -x,y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 26 basisop -x,z,y symbol ccp4 0 symbol Hall ' P 2c -2 (-x,z,y)' symbol xHM 'P m 21 b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y+1/2,-z symop -x,y,z symop x,y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 27 basisop x,y,z symbol ccp4 27 symbol Hall ' P 2 -2c' symbol xHM 'P c c 2' symbol old 'P c c 2' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop -x,y,z+1/2 symop x,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 27 basisop z,x,y symbol ccp4 0 symbol Hall ' P 2 -2c (z,x,y)' symbol xHM 'P 2 a a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x+1/2,-y,z symop x+1/2,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 27 basisop y,z,x symbol ccp4 0 symbol Hall ' P 2 -2c (y,z,x)' symbol xHM 'P b 2 b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop x,y+1/2,-z symop -x,y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 28 basisop x,y,z symbol ccp4 28 symbol Hall ' P 2 -2a' symbol xHM 'P m a 2' symbol old 'P m a 2' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop -x+1/2,y,z symop x+1/2,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 28 basisop y,-x,z symbol ccp4 0 symbol Hall ' P 2 -2a (y,-x,z)' symbol xHM 'P b m 2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop x,-y+1/2,z symop -x,y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 28 basisop z,x,y symbol ccp4 0 symbol Hall ' P 2 -2a (z,x,y)' symbol xHM 'P 2 m b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x,-y+1/2,z symop x,y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 28 basisop z,y,-x symbol ccp4 0 symbol Hall ' P 2 -2a (z,y,-x)' symbol xHM 'P 2 c m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1; 0<=z<=1/4 mapasu nonz 0<=x<1; 0<=y<=1/2; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x,y,-z+1/2 symop x,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 28 basisop y,z,x symbol ccp4 0 symbol Hall ' P 2 -2a (y,z,x)' symbol xHM 'P c 2 m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<1; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop x,y,-z+1/2 symop -x,y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 28 basisop -x,z,y symbol ccp4 0 symbol Hall ' P 2 -2a (-x,z,y)' symbol xHM 'P m 2 a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop -x+1/2,y,z symop x+1/2,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 29 basisop x,y,z symbol ccp4 29 symbol Hall ' P 2c -2ac' symbol xHM 'P c a 21' symbol old 'P c a 21' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 0<=y<1; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z+1/2 symop -x+1/2,y,z+1/2 symop x+1/2,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 29 basisop y,-x,z symbol ccp4 0 symbol Hall ' P 2c -2ac (y,-x,z)' symbol xHM 'P b c 21' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z+1/2 symop x,-y+1/2,z+1/2 symop -x,y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 29 basisop z,x,y symbol ccp4 0 symbol Hall ' P 2c -2ac (z,x,y)' symbol xHM 'P 21 a b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,-y,-z symop x+1/2,-y+1/2,z symop x,y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 29 basisop z,y,-x symbol ccp4 0 symbol Hall ' P 2c -2ac (z,y,-x)' symbol xHM 'P 21 c a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,-y,-z symop x+1/2,y,-z+1/2 symop x,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 29 basisop y,z,x symbol ccp4 0 symbol Hall ' P 2c -2ac (y,z,x)' symbol xHM 'P c 21 b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y+1/2,-z symop x,y+1/2,-z+1/2 symop -x,y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 29 basisop -x,z,y symbol ccp4 0 symbol Hall ' P 2c -2ac (-x,z,y)' symbol xHM 'P b 21 a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y+1/2,-z symop -x+1/2,y+1/2,z symop x+1/2,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 30 basisop x,y,z symbol ccp4 30 symbol Hall ' P 2 -2bc' symbol xHM 'P n c 2' symbol old 'P n c 2' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop -x,y+1/2,z+1/2 symop x,-y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 30 basisop y,-x,z symbol ccp4 0 symbol Hall ' P 2 -2bc (y,-x,z)' symbol xHM 'P c n 2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 0<=y<1; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop x+1/2,-y,z+1/2 symop -x+1/2,y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 30 basisop z,x,y symbol ccp4 0 symbol Hall ' P 2 -2bc (z,x,y)' symbol xHM 'P 2 n a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x+1/2,-y,z+1/2 symop x+1/2,y,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 30 basisop z,y,-x symbol ccp4 0 symbol Hall ' P 2 -2bc (z,y,-x)' symbol xHM 'P 2 a n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x+1/2,y+1/2,-z symop x+1/2,-y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 30 basisop y,z,x symbol ccp4 0 symbol Hall ' P 2 -2bc (y,z,x)' symbol xHM 'P b 2 n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop x+1/2,y+1/2,-z symop -x+1/2,y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 30 basisop -x,z,y symbol ccp4 0 symbol Hall ' P 2 -2bc (-x,z,y)' symbol xHM 'P n 2 b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop -x,y+1/2,z+1/2 symop x,y+1/2,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 31 basisop x,y,z symbol ccp4 31 symbol Hall ' P 2ac -2' symbol xHM 'P m n 21' symbol old 'P m n 21' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x+1/2,-y,z+1/2 symop -x,y,z symop x+1/2,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 31 basisop y,-x,z symbol ccp4 0 symbol Hall ' P 2ac -2 (y,-x,z)' symbol xHM 'P n m 21' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y+1/2,z+1/2 symop x,-y,z symop -x,y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 31 basisop z,x,y symbol ccp4 0 symbol Hall ' P 2ac -2 (z,x,y)' symbol xHM 'P 21 m n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,-y+1/2,-z symop x,-y,z symop x+1/2,y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 31 basisop z,y,-x symbol ccp4 0 symbol Hall ' P 2ac -2 (z,y,-x)' symbol xHM 'P 21 n m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,-y,-z+1/2 symop x,y,-z symop x+1/2,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 31 basisop y,z,x symbol ccp4 0 symbol Hall ' P 2ac -2 (y,z,x)' symbol xHM 'P n 21 m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y+1/2,-z+1/2 symop x,y,-z symop -x,y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 31 basisop -x,z,y symbol ccp4 0 symbol Hall ' P 2ac -2 (-x,z,y)' symbol xHM 'P m 21 n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x+1/2,y+1/2,-z symop -x,y,z symop x+1/2,y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 32 basisop x,y,z symbol ccp4 32 symbol Hall ' P 2 -2ab' symbol xHM 'P b a 2' symbol old 'P b a 2' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop -x+1/2,y+1/2,z symop x+1/2,-y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 32 basisop z,x,y symbol ccp4 0 symbol Hall ' P 2 -2ab (z,x,y)' symbol xHM 'P 2 c b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x,-y+1/2,z+1/2 symop x,y+1/2,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 32 basisop y,z,x symbol ccp4 0 symbol Hall ' P 2 -2ab (y,z,x)' symbol xHM 'P c 2 a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop x+1/2,y,-z+1/2 symop -x+1/2,y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 33 basisop x,y,z symbol ccp4 33 symbol Hall ' P 2c -2n' symbol xHM 'P n a 21' symbol old 'P n a 21' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z+1/2 symop -x+1/2,y+1/2,z+1/2 symop x+1/2,-y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 33 basisop y,-x,z symbol ccp4 0 symbol Hall ' P 2c -2n (y,-x,z)' symbol xHM 'P b n 21' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z+1/2 symop x+1/2,-y+1/2,z+1/2 symop -x+1/2,y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 33 basisop z,x,y symbol ccp4 0 symbol Hall ' P 2c -2n (z,x,y)' symbol xHM 'P 21 n b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,-y,-z symop x+1/2,-y+1/2,z+1/2 symop x,y+1/2,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 33 basisop z,y,-x symbol ccp4 0 symbol Hall ' P 2c -2n (z,y,-x)' symbol xHM 'P 21 c n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,-y,-z symop x+1/2,y+1/2,-z+1/2 symop x,-y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 33 basisop y,z,x symbol ccp4 0 symbol Hall ' P 2c -2n (y,z,x)' symbol xHM 'P c 21 n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 0<=y<1; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y+1/2,-z symop x+1/2,y+1/2,-z+1/2 symop -x+1/2,y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 33 basisop -x,z,y symbol ccp4 0 symbol Hall ' P 2c -2n (-x,z,y)' symbol xHM 'P n 21 a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y+1/2,-z symop -x+1/2,y+1/2,z+1/2 symop x+1/2,y,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 34 basisop x,y,z symbol ccp4 34 symbol Hall ' P 2 -2n' symbol xHM 'P n n 2' symbol old 'P n n 2' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop -x+1/2,y+1/2,z+1/2 symop x+1/2,-y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 34 basisop z,x,y symbol ccp4 0 symbol Hall ' P 2 -2n (z,x,y)' symbol xHM 'P 2 n n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x+1/2,-y+1/2,z+1/2 symop x+1/2,y+1/2,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 34 basisop y,z,x symbol ccp4 0 symbol Hall ' P 2 -2n (y,z,x)' symbol xHM 'P n 2 n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop x+1/2,y+1/2,-z+1/2 symop -x+1/2,y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 35 basisop x,y,z symbol ccp4 35 symbol Hall ' C 2 -2' symbol xHM 'C m m 2' symbol old 'C m m 2' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop -x,y,z symop x,-y,z cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 35 basisop z,x,y symbol ccp4 0 symbol Hall ' C 2 -2 (z,x,y)' symbol xHM 'A 2 m m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x,-y,z symop x,y,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 35 basisop y,z,x symbol ccp4 0 symbol Hall ' C 2 -2 (y,z,x)' symbol xHM 'B m 2 m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<1; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop x,y,-z symop -x,y,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 36 basisop x,y,z symbol ccp4 36 symbol Hall ' C 2c -2' symbol xHM 'C m c 21' symbol old 'C m c 21' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z+1/2 symop -x,y,z symop x,-y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 36 basisop y,-x,z symbol ccp4 0 symbol Hall ' C 2c -2 (y,-x,z)' symbol xHM 'C c m 21' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z+1/2 symop x,-y,z symop -x,y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 36 basisop z,x,y symbol ccp4 0 symbol Hall ' C 2c -2 (z,x,y)' symbol xHM 'A 21 m a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,-y,-z symop x,-y,z symop x+1/2,y,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 36 basisop z,y,-x symbol ccp4 0 symbol Hall ' C 2c -2 (z,y,-x)' symbol xHM 'A 21 a m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x+1/2,-y,-z symop x,y,-z symop x+1/2,-y,z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 36 basisop y,z,x symbol ccp4 0 symbol Hall ' C 2c -2 (y,z,x)' symbol xHM 'B b 21 m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<1/2; 0<=z<=1/2 mapasu nonz 0<=x<1/2; 0<=y<1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y+1/2,-z symop x,y,-z symop -x,y+1/2,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 36 basisop -x,z,y symbol ccp4 0 symbol Hall ' C 2c -2 (-x,z,y)' symbol xHM 'B m 21 b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y+1/2,-z symop -x,y,z symop x,y+1/2,-z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 37 basisop x,y,z symbol ccp4 37 symbol Hall ' C 2 -2c' symbol xHM 'C c c 2' symbol old 'C c c 2' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop -x,y,z+1/2 symop x,-y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 37 basisop z,x,y symbol ccp4 0 symbol Hall ' C 2 -2c (z,x,y)' symbol xHM 'A 2 a a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x+1/2,-y,z symop x+1/2,y,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 37 basisop y,z,x symbol ccp4 0 symbol Hall ' C 2 -2c (y,z,x)' symbol xHM 'B b 2 b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop x,y+1/2,-z symop -x,y+1/2,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 38 basisop x,y,z symbol ccp4 38 symbol Hall ' A 2 -2' symbol xHM 'A m m 2' symbol old 'A m m 2' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop -x,y,z symop x,-y,z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 38 basisop y,-x,z symbol ccp4 0 symbol Hall ' A 2 -2 (y,-x,z)' symbol xHM 'B m m 2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop x,-y,z symop -x,y,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 38 basisop z,x,y symbol ccp4 0 symbol Hall ' A 2 -2 (z,x,y)' symbol xHM 'B 2 m m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<1/2; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x,-y,z symop x,y,-z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 38 basisop z,y,-x symbol ccp4 0 symbol Hall ' A 2 -2 (z,y,-x)' symbol xHM 'C 2 m m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x,y,-z symop x,-y,z cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 38 basisop y,z,x symbol ccp4 0 symbol Hall ' A 2 -2 (y,z,x)' symbol xHM 'C m 2 m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop x,y,-z symop -x,y,z cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 38 basisop -x,z,y symbol ccp4 0 symbol Hall ' A 2 -2 (-x,z,y)' symbol xHM 'A m 2 m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop -x,y,z symop x,y,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 39 basisop x,y,z symbol ccp4 39 symbol Hall ' A 2 -2b' symbol xHM 'A b m 2' symbol old 'A b m 2' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop -x,y+1/2,z symop x,-y+1/2,z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 39 basisop y,-x,z symbol ccp4 0 symbol Hall ' A 2 -2b (y,-x,z)' symbol xHM 'B m a 2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop x+1/2,-y,z symop -x+1/2,y,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 39 basisop z,x,y symbol ccp4 0 symbol Hall ' A 2 -2b (z,x,y)' symbol xHM 'B 2 c m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<=1/4 mapasu nonz 0<=x<1/2; 0<=y<=1/2; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x,-y,z+1/2 symop x,y,-z+1/2 cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 39 basisop z,y,-x symbol ccp4 0 symbol Hall ' A 2 -2b (z,y,-x)' symbol xHM 'C 2 m b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x,y+1/2,-z symop x,-y+1/2,z cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 39 basisop y,z,x symbol ccp4 0 symbol Hall ' A 2 -2b (y,z,x)' symbol xHM 'C m 2 a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop x+1/2,y,-z symop -x+1/2,y,z cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 39 basisop -x,z,y symbol ccp4 0 symbol Hall ' A 2 -2b (-x,z,y)' symbol xHM 'A c 2 m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop -x,y,z+1/2 symop x,y,-z+1/2 cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 40 basisop x,y,z symbol ccp4 40 symbol Hall ' A 2 -2a' symbol xHM 'A m a 2' symbol old 'A m a 2' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop -x+1/2,y,z symop x+1/2,-y,z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 40 basisop y,-x,z symbol ccp4 0 symbol Hall ' A 2 -2a (y,-x,z)' symbol xHM 'B b m 2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop x,-y+1/2,z symop -x,y+1/2,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 40 basisop z,x,y symbol ccp4 0 symbol Hall ' A 2 -2a (z,x,y)' symbol xHM 'B 2 m b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x,-y+1/2,z symop x,y+1/2,-z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 40 basisop z,y,-x symbol ccp4 0 symbol Hall ' A 2 -2a (z,y,-x)' symbol xHM 'C 2 c m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<=1/4 mapasu nonz 0<=x<1; 0<=y<=1/4; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x,y,-z+1/2 symop x,-y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 40 basisop y,z,x symbol ccp4 0 symbol Hall ' A 2 -2a (y,z,x)' symbol xHM 'C c 2 m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop x,y,-z+1/2 symop -x,y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 40 basisop -x,z,y symbol ccp4 0 symbol Hall ' A 2 -2a (-x,z,y)' symbol xHM 'A m 2 a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop -x+1/2,y,z symop x+1/2,y,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 41 basisop x,y,z symbol ccp4 41 symbol Hall ' A 2 -2ab' symbol xHM 'A b a 2' symbol old 'A b a 2' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop -x+1/2,y+1/2,z symop x+1/2,-y+1/2,z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 41 basisop y,-x,z symbol ccp4 0 symbol Hall ' A 2 -2ab (y,-x,z)' symbol xHM 'B b a 2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop x+1/2,-y+1/2,z symop -x+1/2,y+1/2,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 41 basisop z,x,y symbol ccp4 0 symbol Hall ' A 2 -2ab (z,x,y)' symbol xHM 'B 2 c b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x,-y+1/2,z+1/2 symop x,y+1/2,-z+1/2 cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 41 basisop z,y,-x symbol ccp4 0 symbol Hall ' A 2 -2ab (z,y,-x)' symbol xHM 'C 2 c b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x,y+1/2,-z+1/2 symop x,-y+1/2,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 41 basisop y,z,x symbol ccp4 0 symbol Hall ' A 2 -2ab (y,z,x)' symbol xHM 'C c 2 a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop x+1/2,y,-z+1/2 symop -x+1/2,y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 41 basisop -x,z,y symbol ccp4 0 symbol Hall ' A 2 -2ab (-x,z,y)' symbol xHM 'A c 2 a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop -x+1/2,y,z+1/2 symop x+1/2,y,-z+1/2 cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 42 basisop x,y,z symbol ccp4 42 symbol Hall ' F 2 -2' symbol xHM 'F m m 2' symbol old 'F m m 2' symbol laue '-P 2 2' 'mmm' symbol patt '-F 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop -x,y,z symop x,-y,z cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 42 basisop z,x,y symbol ccp4 0 symbol Hall ' F 2 -2 (z,x,y)' symbol xHM 'F 2 m m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-F 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x,-y,z symop x,y,-z cenop x,y,z cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 42 basisop y,z,x symbol ccp4 0 symbol Hall ' F 2 -2 (y,z,x)' symbol xHM 'F m 2 m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-F 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop x,y,-z symop -x,y,z cenop x,y,z cenop x+1/2,y+1/2,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 43 basisop x,y,z symbol ccp4 43 symbol Hall ' F 2 -2d' symbol xHM 'F d d 2' symbol old 'F d d 2' symbol laue '-P 2 2' 'mmm' symbol patt '-F 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/8; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/8; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop -x+1/4,y+1/4,z+1/4 symop x+3/4,-y+3/4,z+1/4 cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 43 basisop z,x,y symbol ccp4 0 symbol Hall ' F 2 -2d (z,x,y)' symbol xHM 'F 2 d d' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-F 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/8; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/8; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x+1/4,-y+1/4,z+1/4 symop x+1/4,y+3/4,-z+3/4 cenop x,y,z cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 43 basisop y,z,x symbol ccp4 0 symbol Hall ' F 2 -2d (y,z,x)' symbol xHM 'F d 2 d' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-F 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop x+1/4,y+1/4,-z+1/4 symop -x+3/4,y+1/4,z+3/4 cenop x,y,z cenop x+1/2,y+1/2,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 44 basisop x,y,z symbol ccp4 44 symbol Hall ' I 2 -2' symbol xHM 'I m m 2' symbol old 'I m m 2' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop -x,y,z symop x,-y,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 44 basisop z,x,y symbol ccp4 0 symbol Hall ' I 2 -2 (z,x,y)' symbol xHM 'I 2 m m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x,-y,z symop x,y,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 44 basisop y,z,x symbol ccp4 0 symbol Hall ' I 2 -2 (y,z,x)' symbol xHM 'I m 2 m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop x,y,-z symop -x,y,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 45 basisop x,y,z symbol ccp4 45 symbol Hall ' I 2 -2c' symbol xHM 'I b a 2' symbol old 'I b a 2' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop -x,y,z+1/2 symop x,-y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 45 basisop z,x,y symbol ccp4 0 symbol Hall ' I 2 -2c (z,x,y)' symbol xHM 'I 2 c b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x+1/2,-y,z symop x+1/2,y,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 45 basisop y,z,x symbol ccp4 0 symbol Hall ' I 2 -2c (y,z,x)' symbol xHM 'I c 2 a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop x,y+1/2,-z symop -x,y+1/2,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 46 basisop x,y,z symbol ccp4 46 symbol Hall ' I 2 -2a' symbol xHM 'I m a 2' symbol old 'I m a 2' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop -x+1/2,y,z symop x+1/2,-y,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 46 basisop y,-x,z symbol ccp4 0 symbol Hall ' I 2 -2a (y,-x,z)' symbol xHM 'I b m 2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp ' P 2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,-y,z symop x,-y+1/2,z symop -x,y+1/2,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 46 basisop z,x,y symbol ccp4 0 symbol Hall ' I 2 -2a (z,x,y)' symbol xHM 'I 2 m b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x,-y+1/2,z symop x,y+1/2,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 46 basisop z,y,-x symbol ccp4 0 symbol Hall ' I 2 -2a (z,y,-x)' symbol xHM 'I 2 c m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp ' P -2 2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<1; 0<=z<=1/4 mapasu nonz 0<=x<1; 0<=y<=1/4; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop x,-y,-z symop x,y,-z+1/2 symop x,-y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 46 basisop y,z,x symbol ccp4 0 symbol Hall ' I 2 -2a (y,z,x)' symbol xHM 'I c 2 m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop x,y,-z+1/2 symop -x,y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 46 basisop -x,z,y symbol ccp4 0 symbol Hall ' I 2 -2a (-x,z,y)' symbol xHM 'I m 2 a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp ' P -2 -2' 'mm2' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -x,y,-z symop -x+1/2,y,z symop x+1/2,y,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 47 basisop x,y,z symbol ccp4 47 symbol Hall '-P 2 2' symbol xHM 'P m m m' symbol old 'P 2/m 2/m 2/m' 'P m m m' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x,-y,-z symop -x,y,-z symop -x,-y,-z symop x,y,-z symop -x,y,z symop x,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 48 basisop x-1/4,y-1/4,z-1/4 symbol ccp4 48 symbol Hall '-P 2ab 2bc (x-1/4,y-1/4,z-1/4)' symbol xHM 'P n n n :1' symbol old 'P 2/n 2/n 2/n' 'P n n n' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x,-y,-z symop -x,y,-z symop -x+1/2,-y+1/2,-z+1/2 symop x+1/2,y+1/2,-z+1/2 symop -x+1/2,y+1/2,z+1/2 symop x+1/2,-y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 48 basisop x,y,z symbol ccp4 0 symbol Hall '-P 2ab 2bc' symbol xHM 'P n n n :2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y+1/2,z symop x,-y+1/2,-z+1/2 symop -x+1/2,y,-z+1/2 symop -x,-y,-z symop x+1/2,y+1/2,-z symop -x,y+1/2,z+1/2 symop x+1/2,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 49 basisop x,y,z symbol ccp4 49 symbol Hall '-P 2 2c' symbol xHM 'P c c m' symbol old 'P 2/c 2/c 2/m' 'P c c m' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x,-y,-z+1/2 symop -x,y,-z+1/2 symop -x,-y,-z symop x,y,-z symop -x,y,z+1/2 symop x,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 49 basisop z,x,y symbol ccp4 0 symbol Hall '-P 2 2c (z,x,y)' symbol xHM 'P m a a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z symop -x+1/2,y,-z symop -x+1/2,-y,z symop -x,-y,-z symop -x,y,z symop x+1/2,-y,z symop x+1/2,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 49 basisop y,z,x symbol ccp4 0 symbol Hall '-P 2 2c (y,z,x)' symbol xHM 'P b m b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z symop -x,-y+1/2,z symop x,-y+1/2,-z symop -x,-y,-z symop x,-y,z symop x,y+1/2,-z symop -x,y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 50 basisop x-1/4,y-1/4,z symbol ccp4 50 symbol Hall '-P 2ab 2b (x-1/4,y-1/4,z)' symbol xHM 'P b a n :1' symbol old 'P 2/b 2/a 2/n' 'P b a n' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x,-y,-z symop -x,y,-z symop -x+1/2,-y+1/2,-z symop x+1/2,y+1/2,-z symop -x+1/2,y+1/2,z symop x+1/2,-y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 50 basisop x,y,z symbol ccp4 0 symbol Hall '-P 2ab 2b' symbol xHM 'P b a n :2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y+1/2,z symop x,-y+1/2,-z symop -x+1/2,y,-z symop -x,-y,-z symop x+1/2,y+1/2,-z symop -x,y+1/2,z symop x+1/2,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 50 basisop z,x-1/4,y-1/4 symbol ccp4 0 symbol Hall '-P 2ab 2b (z,x-1/4,y-1/4)' symbol xHM 'P n c b :1' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z symop -x,y,-z symop -x,-y,z symop -x,-y+1/2,-z+1/2 symop -x,y+1/2,z+1/2 symop x,-y+1/2,z+1/2 symop x,y+1/2,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 50 basisop z,x,y symbol ccp4 0 symbol Hall '-P 2ab 2b (z,x,y)' symbol xHM 'P n c b :2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y+1/2,-z+1/2 symop -x,y,-z+1/2 symop -x,-y+1/2,z symop -x,-y,-z symop -x,y+1/2,z+1/2 symop x,-y,z+1/2 symop x,y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 50 basisop y-1/4,z,x-1/4 symbol ccp4 0 symbol Hall '-P 2ab 2b (y-1/4,z,x-1/4)' symbol xHM 'P c n a :1' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z symop -x,-y,z symop x,-y,-z symop -x+1/2,-y,-z+1/2 symop x+1/2,-y,z+1/2 symop x+1/2,y,-z+1/2 symop -x+1/2,y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 50 basisop y,z,x symbol ccp4 0 symbol Hall '-P 2ab 2b (y,z,x)' symbol xHM 'P c n a :2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y,-z+1/2 symop -x+1/2,-y,z symop x,-y,-z+1/2 symop -x,-y,-z symop x+1/2,-y,z+1/2 symop x+1/2,y,-z symop -x,y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 51 basisop x,y,z symbol ccp4 51 symbol Hall '-P 2a 2a' symbol xHM 'P m m a' symbol old 'P 21/m 2/m 2/a' 'P m m a' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y,z symop x+1/2,-y,-z symop -x,y,-z symop -x,-y,-z symop x+1/2,y,-z symop -x+1/2,y,z symop x,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 51 basisop y,-x,z symbol ccp4 0 symbol Hall '-P 2a 2a (y,-x,z)' symbol xHM 'P m m b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y+1/2,z symop -x,y+1/2,-z symop x,-y,-z symop -x,-y,-z symop x,y+1/2,-z symop x,-y+1/2,z symop -x,y,z cenop x,y,z end_spacegroup begin_spacegroup number 51 basisop z,x,y symbol ccp4 0 symbol Hall '-P 2a 2a (z,x,y)' symbol xHM 'P b m m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y+1/2,-z symop -x,y+1/2,-z symop -x,-y,z symop -x,-y,-z symop -x,y+1/2,z symop x,-y+1/2,z symop x,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 51 basisop z,y,-x symbol ccp4 0 symbol Hall '-P 2a 2a (z,y,-x)' symbol xHM 'P c m m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z+1/2 symop -x,-y,z+1/2 symop -x,y,-z symop -x,-y,-z symop -x,y,z+1/2 symop x,y,-z+1/2 symop x,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 51 basisop y,z,x symbol ccp4 0 symbol Hall '-P 2a 2a (y,z,x)' symbol xHM 'P m c m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z+1/2 symop -x,-y,z+1/2 symop x,-y,-z symop -x,-y,-z symop x,-y,z+1/2 symop x,y,-z+1/2 symop -x,y,z cenop x,y,z end_spacegroup begin_spacegroup number 51 basisop -x,z,y symbol ccp4 0 symbol Hall '-P 2a 2a (-x,z,y)' symbol xHM 'P m a m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<1; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y,-z symop x+1/2,-y,-z symop -x,-y,z symop -x,-y,-z symop x+1/2,-y,z symop -x+1/2,y,z symop x,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 52 basisop x,y,z symbol ccp4 52 symbol Hall '-P 2a 2bc' symbol xHM 'P n n a' symbol old 'P 2/n 21/n 2/a' 'P n n a' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y,z symop x,-y+1/2,-z+1/2 symop -x+1/2,y+1/2,-z+1/2 symop -x,-y,-z symop x+1/2,y,-z symop -x,y+1/2,z+1/2 symop x+1/2,-y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 52 basisop y,-x,z symbol ccp4 0 symbol Hall '-P 2a 2bc (y,-x,z)' symbol xHM 'P n n b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y+1/2,z symop -x+1/2,y,-z+1/2 symop x+1/2,-y+1/2,-z+1/2 symop -x,-y,-z symop x,y+1/2,-z symop x+1/2,-y,z+1/2 symop -x+1/2,y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 52 basisop z,x,y symbol ccp4 0 symbol Hall '-P 2a 2bc (z,x,y)' symbol xHM 'P b n n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y+1/2,-z symop -x+1/2,y,-z+1/2 symop -x+1/2,-y+1/2,z+1/2 symop -x,-y,-z symop -x,y+1/2,z symop x+1/2,-y,z+1/2 symop x+1/2,y+1/2,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 52 basisop z,y,-x symbol ccp4 0 symbol Hall '-P 2a 2bc (z,y,-x)' symbol xHM 'P c n n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z+1/2 symop -x+1/2,-y+1/2,z symop -x+1/2,y+1/2,-z+1/2 symop -x,-y,-z symop -x,y,z+1/2 symop x+1/2,y+1/2,-z symop x+1/2,-y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 52 basisop y,z,x symbol ccp4 0 symbol Hall '-P 2a 2bc (y,z,x)' symbol xHM 'P n c n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z+1/2 symop -x+1/2,-y+1/2,z symop x+1/2,-y+1/2,-z+1/2 symop -x,-y,-z symop x,-y,z+1/2 symop x+1/2,y+1/2,-z symop -x+1/2,y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 52 basisop -x,z,y symbol ccp4 0 symbol Hall '-P 2a 2bc (-x,z,y)' symbol xHM 'P n a n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y,-z symop x,-y+1/2,-z+1/2 symop -x+1/2,-y+1/2,z+1/2 symop -x,-y,-z symop x+1/2,-y,z symop -x,y+1/2,z+1/2 symop x+1/2,y+1/2,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 53 basisop x,y,z symbol ccp4 53 symbol Hall '-P 2ac 2' symbol xHM 'P m n a' symbol old 'P 2/m 2/n 21/a' 'P m n a' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y,z+1/2 symop x,-y,-z symop -x+1/2,y,-z+1/2 symop -x,-y,-z symop x+1/2,y,-z+1/2 symop -x,y,z symop x+1/2,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 53 basisop y,-x,z symbol ccp4 0 symbol Hall '-P 2ac 2 (y,-x,z)' symbol xHM 'P n m b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y+1/2,z+1/2 symop -x,y,-z symop x,-y+1/2,-z+1/2 symop -x,-y,-z symop x,y+1/2,-z+1/2 symop x,-y,z symop -x,y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 53 basisop z,x,y symbol ccp4 0 symbol Hall '-P 2ac 2 (z,x,y)' symbol xHM 'P b m n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y+1/2,-z symop -x,y,-z symop -x+1/2,-y+1/2,z symop -x,-y,-z symop -x+1/2,y+1/2,z symop x,-y,z symop x+1/2,y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 53 basisop z,y,-x symbol ccp4 0 symbol Hall '-P 2ac 2 (z,y,-x)' symbol xHM 'P c n m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/4; 0<=y<1; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y,-z+1/2 symop -x,-y,z symop -x+1/2,y,-z+1/2 symop -x,-y,-z symop -x+1/2,y,z+1/2 symop x,y,-z symop x+1/2,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 53 basisop y,z,x symbol ccp4 0 symbol Hall '-P 2ac 2 (y,z,x)' symbol xHM 'P n c m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y+1/2,-z+1/2 symop -x,-y,z symop x,-y+1/2,-z+1/2 symop -x,-y,-z symop x,-y+1/2,z+1/2 symop x,y,-z symop -x,y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 53 basisop -x,z,y symbol ccp4 0 symbol Hall '-P 2ac 2 (-x,z,y)' symbol xHM 'P m a n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y+1/2,-z symop x,-y,-z symop -x+1/2,-y+1/2,z symop -x,-y,-z symop x+1/2,-y+1/2,z symop -x,y,z symop x+1/2,y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 54 basisop x,y,z symbol ccp4 54 symbol Hall '-P 2a 2ac' symbol xHM 'P c c a' symbol old 'P 21/c 2/c 2/a' 'P c c a' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y,z symop x+1/2,-y,-z+1/2 symop -x,y,-z+1/2 symop -x,-y,-z symop x+1/2,y,-z symop -x+1/2,y,z+1/2 symop x,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 54 basisop y,-x,z symbol ccp4 0 symbol Hall '-P 2a 2ac (y,-x,z)' symbol xHM 'P c c b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y+1/2,z symop -x,y+1/2,-z+1/2 symop x,-y,-z+1/2 symop -x,-y,-z symop x,y+1/2,-z symop x,-y+1/2,z+1/2 symop -x,y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 54 basisop z,x,y symbol ccp4 0 symbol Hall '-P 2a 2ac (z,x,y)' symbol xHM 'P b a a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y+1/2,-z symop -x+1/2,y+1/2,-z symop -x+1/2,-y,z symop -x,-y,-z symop -x,y+1/2,z symop x+1/2,-y+1/2,z symop x+1/2,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 54 basisop z,y,-x symbol ccp4 0 symbol Hall '-P 2a 2ac (z,y,-x)' symbol xHM 'P c a a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z+1/2 symop -x+1/2,-y,z+1/2 symop -x+1/2,y,-z symop -x,-y,-z symop -x,y,z+1/2 symop x+1/2,y,-z+1/2 symop x+1/2,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 54 basisop y,z,x symbol ccp4 0 symbol Hall '-P 2a 2ac (y,z,x)' symbol xHM 'P b c b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z+1/2 symop -x,-y+1/2,z+1/2 symop x,-y+1/2,-z symop -x,-y,-z symop x,-y,z+1/2 symop x,y+1/2,-z+1/2 symop -x,y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 54 basisop -x,z,y symbol ccp4 0 symbol Hall '-P 2a 2ac (-x,z,y)' symbol xHM 'P b a b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y,-z symop x+1/2,-y+1/2,-z symop -x,-y+1/2,z symop -x,-y,-z symop x+1/2,-y,z symop -x+1/2,y+1/2,z symop x,y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 55 basisop x,y,z symbol ccp4 55 symbol Hall '-P 2 2ab' symbol xHM 'P b a m' symbol old 'P 21/b 21/a 2/m' 'P b a m' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x+1/2,-y+1/2,-z symop -x+1/2,y+1/2,-z symop -x,-y,-z symop x,y,-z symop -x+1/2,y+1/2,z symop x+1/2,-y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 55 basisop z,x,y symbol ccp4 0 symbol Hall '-P 2 2ab (z,x,y)' symbol xHM 'P m c b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z symop -x,y+1/2,-z+1/2 symop -x,-y+1/2,z+1/2 symop -x,-y,-z symop -x,y,z symop x,-y+1/2,z+1/2 symop x,y+1/2,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 55 basisop y,z,x symbol ccp4 0 symbol Hall '-P 2 2ab (y,z,x)' symbol xHM 'P c m a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z symop -x+1/2,-y,z+1/2 symop x+1/2,-y,-z+1/2 symop -x,-y,-z symop x,-y,z symop x+1/2,y,-z+1/2 symop -x+1/2,y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 56 basisop x,y,z symbol ccp4 56 symbol Hall '-P 2ab 2ac' symbol xHM 'P c c n' symbol old 'P 21/c 21/c 2/n' 'P c c n' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y+1/2,z symop x+1/2,-y,-z+1/2 symop -x,y+1/2,-z+1/2 symop -x,-y,-z symop x+1/2,y+1/2,-z symop -x+1/2,y,z+1/2 symop x,-y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 56 basisop z,x,y symbol ccp4 0 symbol Hall '-P 2ab 2ac (z,x,y)' symbol xHM 'P n a a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y+1/2,-z+1/2 symop -x+1/2,y+1/2,-z symop -x+1/2,-y,z+1/2 symop -x,-y,-z symop -x,y+1/2,z+1/2 symop x+1/2,-y+1/2,z symop x+1/2,y,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 56 basisop y,z,x symbol ccp4 0 symbol Hall '-P 2ab 2ac (y,z,x)' symbol xHM 'P b n b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y,-z+1/2 symop -x,-y+1/2,z+1/2 symop x+1/2,-y+1/2,-z symop -x,-y,-z symop x+1/2,-y,z+1/2 symop x,y+1/2,-z+1/2 symop -x+1/2,y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 57 basisop x,y,z symbol ccp4 57 symbol Hall '-P 2c 2b' symbol xHM 'P b c m' symbol old 'P 2/b 21/c 21/m' 'P b c m' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<=1/4 mapasu nonz 0<=x<1; 0<=y<=1/4; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z+1/2 symop x,-y+1/2,-z symop -x,y+1/2,-z+1/2 symop -x,-y,-z symop x,y,-z+1/2 symop -x,y+1/2,z symop x,-y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 57 basisop y,-x,z symbol ccp4 0 symbol Hall '-P 2c 2b (y,-x,z)' symbol xHM 'P c a m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/4; 0<=y<1; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z+1/2 symop -x+1/2,y,-z symop x+1/2,-y,-z+1/2 symop -x,-y,-z symop x,y,-z+1/2 symop x+1/2,-y,z symop -x+1/2,y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 57 basisop z,x,y symbol ccp4 0 symbol Hall '-P 2c 2b (z,x,y)' symbol xHM 'P m c a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y,-z symop -x,y,-z+1/2 symop -x+1/2,-y,z+1/2 symop -x,-y,-z symop -x+1/2,y,z symop x,-y,z+1/2 symop x+1/2,y,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 57 basisop z,y,-x symbol ccp4 0 symbol Hall '-P 2c 2b (z,y,-x)' symbol xHM 'P m a b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y,-z symop -x,-y+1/2,z symop -x+1/2,y+1/2,-z symop -x,-y,-z symop -x+1/2,y,z symop x,y+1/2,-z symop x+1/2,-y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 57 basisop y,z,x symbol ccp4 0 symbol Hall '-P 2c 2b (y,z,x)' symbol xHM 'P b m a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y+1/2,-z symop -x+1/2,-y,z symop x+1/2,-y+1/2,-z symop -x,-y,-z symop x,-y+1/2,z symop x+1/2,y,-z symop -x+1/2,y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 57 basisop -x,z,y symbol ccp4 0 symbol Hall '-P 2c 2b (-x,z,y)' symbol xHM 'P c m b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y+1/2,-z symop x,-y,-z+1/2 symop -x,-y+1/2,z+1/2 symop -x,-y,-z symop x,-y+1/2,z symop -x,y,z+1/2 symop x,y+1/2,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 58 basisop x,y,z symbol ccp4 58 symbol Hall '-P 2 2n' symbol xHM 'P n n m' symbol old 'P 21/n 21/n 2/m' 'P n n m' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x+1/2,-y+1/2,-z+1/2 symop -x+1/2,y+1/2,-z+1/2 symop -x,-y,-z symop x,y,-z symop -x+1/2,y+1/2,z+1/2 symop x+1/2,-y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 58 basisop z,x,y symbol ccp4 0 symbol Hall '-P 2 2n (z,x,y)' symbol xHM 'P m n n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z symop -x+1/2,y+1/2,-z+1/2 symop -x+1/2,-y+1/2,z+1/2 symop -x,-y,-z symop -x,y,z symop x+1/2,-y+1/2,z+1/2 symop x+1/2,y+1/2,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 58 basisop y,z,x symbol ccp4 0 symbol Hall '-P 2 2n (y,z,x)' symbol xHM 'P n m n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z symop -x+1/2,-y+1/2,z+1/2 symop x+1/2,-y+1/2,-z+1/2 symop -x,-y,-z symop x,-y,z symop x+1/2,y+1/2,-z+1/2 symop -x+1/2,y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 59 basisop x-1/4,y-1/4,z symbol ccp4 59 symbol Hall '-P 2ab 2a (x-1/4,y-1/4,z)' symbol xHM 'P m m n :1' symbol old 'P 21/m 21/m 2/n' 'P m m n' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x+1/2,-y+1/2,-z symop -x+1/2,y+1/2,-z symop -x+1/2,-y+1/2,-z symop x+1/2,y+1/2,-z symop -x,y,z symop x,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 59 basisop x,y,z symbol ccp4 1059 symbol Hall '-P 2ab 2a' symbol xHM 'P m m n :2' symbol old 'P 21/m 21/m 2/n a' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y+1/2,z symop x+1/2,-y,-z symop -x,y+1/2,-z symop -x,-y,-z symop x+1/2,y+1/2,-z symop -x+1/2,y,z symop x,-y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 59 basisop z,x-1/4,y-1/4 symbol ccp4 0 symbol Hall '-P 2ab 2a (z,x-1/4,y-1/4)' symbol xHM 'P n m m :1' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z symop -x,y+1/2,-z+1/2 symop -x,-y+1/2,z+1/2 symop -x,-y+1/2,-z+1/2 symop -x,y+1/2,z+1/2 symop x,-y,z symop x,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 59 basisop z,x,y symbol ccp4 0 symbol Hall '-P 2ab 2a (z,x,y)' symbol xHM 'P n m m :2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<=1/4; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y+1/2,-z+1/2 symop -x,y+1/2,-z symop -x,-y,z+1/2 symop -x,-y,-z symop -x,y+1/2,z+1/2 symop x,-y+1/2,z symop x,y,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 59 basisop y-1/4,z,x-1/4 symbol ccp4 0 symbol Hall '-P 2ab 2a (y-1/4,z,x-1/4)' symbol xHM 'P m n m :1' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z symop -x+1/2,-y,z+1/2 symop x+1/2,-y,-z+1/2 symop -x+1/2,-y,-z+1/2 symop x+1/2,-y,z+1/2 symop x,y,-z symop -x,y,z cenop x,y,z end_spacegroup begin_spacegroup number 59 basisop y,z,x symbol ccp4 0 symbol Hall '-P 2ab 2a (y,z,x)' symbol xHM 'P m n m :2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y,-z+1/2 symop -x,-y,z+1/2 symop x+1/2,-y,-z symop -x,-y,-z symop x+1/2,-y,z+1/2 symop x,y,-z+1/2 symop -x+1/2,y,z cenop x,y,z end_spacegroup begin_spacegroup number 60 basisop x,y,z symbol ccp4 60 symbol Hall '-P 2n 2ab' symbol xHM 'P b c n' symbol old 'P 21/b 2/c 21/n' 'P b c n' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y+1/2,z+1/2 symop x+1/2,-y+1/2,-z symop -x,y,-z+1/2 symop -x,-y,-z symop x+1/2,y+1/2,-z+1/2 symop -x+1/2,y+1/2,z symop x,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 60 basisop y,-x,z symbol ccp4 0 symbol Hall '-P 2n 2ab (y,-x,z)' symbol xHM 'P c a n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y+1/2,z+1/2 symop -x+1/2,y+1/2,-z symop x,-y,-z+1/2 symop -x,-y,-z symop x+1/2,y+1/2,-z+1/2 symop x+1/2,-y+1/2,z symop -x,y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 60 basisop z,x,y symbol ccp4 0 symbol Hall '-P 2n 2ab (z,x,y)' symbol xHM 'P n c a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y+1/2,-z+1/2 symop -x,y+1/2,-z+1/2 symop -x+1/2,-y,z symop -x,-y,-z symop -x+1/2,y+1/2,z+1/2 symop x,-y+1/2,z+1/2 symop x+1/2,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 60 basisop z,y,-x symbol ccp4 0 symbol Hall '-P 2n 2ab (z,y,-x)' symbol xHM 'P n a b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y+1/2,-z+1/2 symop -x,-y+1/2,z+1/2 symop -x+1/2,y,-z symop -x,-y,-z symop -x+1/2,y+1/2,z+1/2 symop x,y+1/2,-z+1/2 symop x+1/2,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 60 basisop y,z,x symbol ccp4 0 symbol Hall '-P 2n 2ab (y,z,x)' symbol xHM 'P b n a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y+1/2,-z+1/2 symop -x+1/2,-y,z+1/2 symop x,-y+1/2,-z symop -x,-y,-z symop x+1/2,-y+1/2,z+1/2 symop x+1/2,y,-z+1/2 symop -x,y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 60 basisop -x,z,y symbol ccp4 0 symbol Hall '-P 2n 2ab (-x,z,y)' symbol xHM 'P c n b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y+1/2,-z+1/2 symop x+1/2,-y,-z+1/2 symop -x,-y+1/2,z symop -x,-y,-z symop x+1/2,-y+1/2,z+1/2 symop -x+1/2,y,z+1/2 symop x,y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 61 basisop x,y,z symbol ccp4 61 symbol Hall '-P 2ac 2ab' symbol xHM 'P b c a' symbol old 'P 21/b 21/c 21/a' 'P b c a' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y,z+1/2 symop x+1/2,-y+1/2,-z symop -x,y+1/2,-z+1/2 symop -x,-y,-z symop x+1/2,y,-z+1/2 symop -x+1/2,y+1/2,z symop x,-y+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 61 basisop z,y,-x symbol ccp4 0 symbol Hall '-P 2ac 2ab (z,y,-x)' symbol xHM 'P c a b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y,-z+1/2 symop -x,-y+1/2,z+1/2 symop -x+1/2,y+1/2,-z symop -x,-y,-z symop -x+1/2,y,z+1/2 symop x,y+1/2,-z+1/2 symop x+1/2,-y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 62 basisop x,y,z symbol ccp4 62 symbol Hall '-P 2ac 2n' symbol xHM 'P n m a' symbol old 'P 21/n 21/m 21/a' 'P n m a' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y,z+1/2 symop x+1/2,-y+1/2,-z+1/2 symop -x,y+1/2,-z symop -x,-y,-z symop x+1/2,y,-z+1/2 symop -x+1/2,y+1/2,z+1/2 symop x,-y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 62 basisop y,-x,z symbol ccp4 0 symbol Hall '-P 2ac 2n (y,-x,z)' symbol xHM 'P m n b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y+1/2,z+1/2 symop -x+1/2,y+1/2,-z+1/2 symop x+1/2,-y,-z symop -x,-y,-z symop x,y+1/2,-z+1/2 symop x+1/2,-y+1/2,z+1/2 symop -x+1/2,y,z cenop x,y,z end_spacegroup begin_spacegroup number 62 basisop z,x,y symbol ccp4 0 symbol Hall '-P 2ac 2n (z,x,y)' symbol xHM 'P b n m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<=1/4 mapasu nonz 0<=x<1; 0<=y<=1/4; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y+1/2,-z symop -x+1/2,y+1/2,-z+1/2 symop -x,-y,z+1/2 symop -x,-y,-z symop -x+1/2,y+1/2,z symop x+1/2,-y+1/2,z+1/2 symop x,y,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 62 basisop z,y,-x symbol ccp4 0 symbol Hall '-P 2ac 2n (z,y,-x)' symbol xHM 'P c m n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y,-z+1/2 symop -x+1/2,-y+1/2,z+1/2 symop -x,y+1/2,-z symop -x,-y,-z symop -x+1/2,y,z+1/2 symop x+1/2,y+1/2,-z+1/2 symop x,-y+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 62 basisop y,z,x symbol ccp4 0 symbol Hall '-P 2ac 2n (y,z,x)' symbol xHM 'P m c n' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y+1/2,-z+1/2 symop -x+1/2,-y+1/2,z+1/2 symop x+1/2,-y,-z symop -x,-y,-z symop x,-y+1/2,z+1/2 symop x+1/2,y+1/2,-z+1/2 symop -x+1/2,y,z cenop x,y,z end_spacegroup begin_spacegroup number 62 basisop -x,z,y symbol ccp4 0 symbol Hall '-P 2ac 2n (-x,z,y)' symbol xHM 'P n a m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<1; 0<=z<=1/4 mapasu nonz 0<=x<1; 0<=y<=1/4; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y+1/2,-z symop x+1/2,-y+1/2,-z+1/2 symop -x,-y,z+1/2 symop -x,-y,-z symop x+1/2,-y+1/2,z symop -x+1/2,y+1/2,z+1/2 symop x,y,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 63 basisop x,y,z symbol ccp4 63 symbol Hall '-C 2c 2' symbol xHM 'C m c m' symbol old 'C 2/m 2/c 21/m' 'C m c m' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z+1/2 symop x,-y,-z symop -x,y,-z+1/2 symop -x,-y,-z symop x,y,-z+1/2 symop -x,y,z symop x,-y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 63 basisop y,-x,z symbol ccp4 0 symbol Hall '-C 2c 2 (y,-x,z)' symbol xHM 'C c m m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z+1/2 symop -x,y,-z symop x,-y,-z+1/2 symop -x,-y,-z symop x,y,-z+1/2 symop x,-y,z symop -x,y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 63 basisop z,x,y symbol ccp4 0 symbol Hall '-C 2c 2 (z,x,y)' symbol xHM 'A m m a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y,-z symop -x,y,-z symop -x+1/2,-y,z symop -x,-y,-z symop -x+1/2,y,z symop x,-y,z symop x+1/2,y,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 63 basisop z,y,-x symbol ccp4 0 symbol Hall '-C 2c 2 (z,y,-x)' symbol xHM 'A m a m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y,-z symop -x,-y,z symop -x+1/2,y,-z symop -x,-y,-z symop -x+1/2,y,z symop x,y,-z symop x+1/2,-y,z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 63 basisop y,z,x symbol ccp4 0 symbol Hall '-C 2c 2 (y,z,x)' symbol xHM 'B b m m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y+1/2,-z symop -x,-y,z symop x,-y+1/2,-z symop -x,-y,-z symop x,-y+1/2,z symop x,y,-z symop -x,y+1/2,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 63 basisop -x,z,y symbol ccp4 0 symbol Hall '-C 2c 2 (-x,z,y)' symbol xHM 'B m m b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y+1/2,-z symop x,-y,-z symop -x,-y+1/2,z symop -x,-y,-z symop x,-y+1/2,z symop -x,y,z symop x,y+1/2,-z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 64 basisop x,y,z symbol ccp4 64 symbol Hall '-C 2ac 2' symbol xHM 'C m c a' symbol old 'C 2/m 2/c 21/a' 'C m c a' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y,z+1/2 symop x,-y,-z symop -x+1/2,y,-z+1/2 symop -x,-y,-z symop x+1/2,y,-z+1/2 symop -x,y,z symop x+1/2,-y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 64 basisop y,-x,z symbol ccp4 0 symbol Hall '-C 2ac 2 (y,-x,z)' symbol xHM 'C c m b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y+1/2,z+1/2 symop -x,y,-z symop x,-y+1/2,-z+1/2 symop -x,-y,-z symop x,y+1/2,-z+1/2 symop x,-y,z symop -x,y+1/2,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 64 basisop z,x,y symbol ccp4 0 symbol Hall '-C 2ac 2 (z,x,y)' symbol xHM 'A b m a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y+1/2,-z symop -x,y,-z symop -x+1/2,-y+1/2,z symop -x,-y,-z symop -x+1/2,y+1/2,z symop x,-y,z symop x+1/2,y+1/2,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 64 basisop z,y,-x symbol ccp4 0 symbol Hall '-C 2ac 2 (z,y,-x)' symbol xHM 'A c a m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/4 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x+1/2,-y,-z+1/2 symop -x,-y,z symop -x+1/2,y,-z+1/2 symop -x,-y,-z symop -x+1/2,y,z+1/2 symop x,y,-z symop x+1/2,-y,z+1/2 cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 64 basisop y,z,x symbol ccp4 0 symbol Hall '-C 2ac 2 (y,z,x)' symbol xHM 'B b c m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<1/2; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y+1/2,-z+1/2 symop -x,-y,z symop x,-y+1/2,-z+1/2 symop -x,-y,-z symop x,-y+1/2,z+1/2 symop x,y,-z symop -x,y+1/2,z+1/2 cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 64 basisop -x,z,y symbol ccp4 0 symbol Hall '-C 2ac 2 (-x,z,y)' symbol xHM 'B m a b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y+1/2,-z symop x,-y,-z symop -x+1/2,-y+1/2,z symop -x,-y,-z symop x+1/2,-y+1/2,z symop -x,y,z symop x+1/2,y+1/2,-z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 65 basisop x,y,z symbol ccp4 65 symbol Hall '-C 2 2' symbol xHM 'C m m m' symbol old 'C 2/m 2/m 2/m' 'C m m m' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x,-y,-z symop -x,y,-z symop -x,-y,-z symop x,y,-z symop -x,y,z symop x,-y,z cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 65 basisop z,x,y symbol ccp4 0 symbol Hall '-C 2 2 (z,x,y)' symbol xHM 'A m m m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z symop -x,y,-z symop -x,-y,z symop -x,-y,-z symop -x,y,z symop x,-y,z symop x,y,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 65 basisop y,z,x symbol ccp4 0 symbol Hall '-C 2 2 (y,z,x)' symbol xHM 'B m m m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z symop -x,-y,z symop x,-y,-z symop -x,-y,-z symop x,-y,z symop x,y,-z symop -x,y,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 66 basisop x,y,z symbol ccp4 66 symbol Hall '-C 2 2c' symbol xHM 'C c c m' symbol old 'C 2/c 2/c 2/m' 'C c c m' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x,-y,-z+1/2 symop -x,y,-z+1/2 symop -x,-y,-z symop x,y,-z symop -x,y,z+1/2 symop x,-y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 66 basisop z,x,y symbol ccp4 0 symbol Hall '-C 2 2c (z,x,y)' symbol xHM 'A m a a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z symop -x+1/2,y,-z symop -x+1/2,-y,z symop -x,-y,-z symop -x,y,z symop x+1/2,-y,z symop x+1/2,y,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 66 basisop y,z,x symbol ccp4 0 symbol Hall '-C 2 2c (y,z,x)' symbol xHM 'B b m b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z symop -x,-y+1/2,z symop x,-y+1/2,-z symop -x,-y,-z symop x,-y,z symop x,y+1/2,-z symop -x,y+1/2,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 67 basisop x,y,z symbol ccp4 67 symbol Hall '-C 2a 2' symbol xHM 'C m m a' symbol old 'C 2/m 2/m 2/a' 'C m m a' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y,z symop x,-y,-z symop -x+1/2,y,-z symop -x,-y,-z symop x+1/2,y,-z symop -x,y,z symop x+1/2,-y,z cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 67 basisop x+1/4,y+1/4,z symbol ccp4 0 symbol Hall '-C 2a 2 (x+1/4,y+1/4,z)' symbol xHM 'C m m b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y+1/2,z symop x,-y+1/2,-z symop -x,y,-z symop -x+1/2,-y+1/2,-z symop x+1/2,y,-z symop -x+1/2,y,z symop x+1/2,-y+1/2,z cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 67 basisop z,x,y symbol ccp4 0 symbol Hall '-C 2a 2 (z,x,y)' symbol xHM 'A b m m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y+1/2,-z symop -x,y,-z symop -x,-y+1/2,z symop -x,-y,-z symop -x,y+1/2,z symop x,-y,z symop x,y+1/2,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 67 basisop z,y,-x symbol ccp4 0 symbol Hall '-C 2a 2 (z,y,-x)' symbol xHM 'A c m m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z+1/2 symop -x,-y,z symop -x,y,-z+1/2 symop -x,-y,-z symop -x,y,z+1/2 symop x,y,-z symop x,-y,z+1/2 cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 67 basisop y,z,x symbol ccp4 0 symbol Hall '-C 2a 2 (y,z,x)' symbol xHM 'B m c m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z+1/2 symop -x,-y,z symop x,-y,-z+1/2 symop -x,-y,-z symop x,-y,z+1/2 symop x,y,-z symop -x,y,z+1/2 cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 67 basisop -x,z,y symbol ccp4 0 symbol Hall '-C 2a 2 (-x,z,y)' symbol xHM 'B m a m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/4; 0<=y<=1/2; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y,-z symop x,-y,-z symop -x+1/2,-y,z symop -x,-y,-z symop x+1/2,-y,z symop -x,y,z symop x+1/2,y,-z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 68 basisop x-1/2,y-1/4,z+1/4 symbol ccp4 68 symbol Hall '-C 2a 2ac (x-1/2,y-1/4,z+1/4)' symbol xHM 'C c c a :1' symbol old 'C c c a' 'C 2/c 2/c 2/a' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y+1/2,z symop x+1/2,-y+1/2,-z symop -x,y,-z symop -x,-y+1/2,-z+1/2 symop x+1/2,y,-z+1/2 symop -x+1/2,y,z+1/2 symop x,-y+1/2,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 68 basisop x,y,z symbol ccp4 0 symbol Hall '-C 2a 2ac' symbol xHM 'C c c a :2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y,z symop x+1/2,-y,-z+1/2 symop -x,y,-z+1/2 symop -x,-y,-z symop x+1/2,y,-z symop -x+1/2,y,z+1/2 symop x,-y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 68 basisop x-1/2,y-1/4,z+1/4 symbol ccp4 0 symbol Hall '-C 2a 2ac (x-1/2,y-1/4,z+1/4)' symbol xHM 'C c c b :1' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y+1/2,z symop x+1/2,-y+1/2,-z symop -x,y,-z symop -x,-y+1/2,-z+1/2 symop x+1/2,y,-z+1/2 symop -x+1/2,y,z+1/2 symop x,-y+1/2,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 68 basisop x-1/4,y-1/4,z symbol ccp4 0 symbol Hall '-C 2a 2ac (x-1/4,y-1/4,z)' symbol xHM 'C c c b :2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y+1/2,z symop x+1/2,-y+1/2,-z+1/2 symop -x+1/2,y,-z+1/2 symop -x+1/2,-y+1/2,-z symop x+1/2,y,-z symop -x,y,z+1/2 symop x,-y+1/2,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 68 basisop z+1/4,x-1/2,y-1/4 symbol ccp4 0 symbol Hall '-C 2a 2ac (z+1/4,x-1/2,y-1/4)' symbol xHM 'A b a a :1' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y+1/2,-z+1/2 symop -x,y+1/2,-z+1/2 symop -x,-y,z symop -x+1/2,-y,-z+1/2 symop -x+1/2,y+1/2,z symop x+1/2,-y+1/2,z symop x+1/2,y,-z+1/2 cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 68 basisop z,x,y symbol ccp4 0 symbol Hall '-C 2a 2ac (z,x,y)' symbol xHM 'A b a a :2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y+1/2,-z symop -x+1/2,y+1/2,-z symop -x+1/2,-y,z symop -x,-y,-z symop -x,y+1/2,z symop x+1/2,-y+1/2,z symop x+1/2,y,-z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 68 basisop z+1/4,x-1/2,y-1/4 symbol ccp4 0 symbol Hall '-C 2a 2ac (z+1/4,x-1/2,y-1/4)' symbol xHM 'A c a a :1' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y+1/2,-z+1/2 symop -x,y+1/2,-z+1/2 symop -x,-y,z symop -x+1/2,-y,-z+1/2 symop -x+1/2,y+1/2,z symop x+1/2,-y+1/2,z symop x+1/2,y,-z+1/2 cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 68 basisop z,y,-x symbol ccp4 0 symbol Hall '-C 2a 2ac (z,y,-x)' symbol xHM 'A c a a :2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-A 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z+1/2 symop -x+1/2,-y,z+1/2 symop -x+1/2,y,-z symop -x,-y,-z symop -x,y,z+1/2 symop x+1/2,y,-z+1/2 symop x+1/2,-y,z cenop x,y,z cenop x,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 68 basisop y-1/4,z+1/4,x-1/2 symbol ccp4 0 symbol Hall '-C 2a 2ac (y-1/4,z+1/4,x-1/2)' symbol xHM 'B b c b :1' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y,-z+1/2 symop -x+1/2,-y,z+1/2 symop x,-y,-z symop -x+1/2,-y+1/2,-z symop x,-y+1/2,z+1/2 symop x,y+1/2,-z+1/2 symop -x+1/2,y+1/2,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 68 basisop y,z,x symbol ccp4 0 symbol Hall '-C 2a 2ac (y,z,x)' symbol xHM 'B b c b :2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z+1/2 symop -x,-y+1/2,z+1/2 symop x,-y+1/2,-z symop -x,-y,-z symop x,-y,z+1/2 symop x,y+1/2,-z+1/2 symop -x,y+1/2,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 68 basisop y-1/4,z+1/4,x-1/2 symbol ccp4 0 symbol Hall '-C 2a 2ac (y-1/4,z+1/4,x-1/2)' symbol xHM 'B b a b :1' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y,-z+1/2 symop -x+1/2,-y,z+1/2 symop x,-y,-z symop -x+1/2,-y+1/2,-z symop x,-y+1/2,z+1/2 symop x,y+1/2,-z+1/2 symop -x+1/2,y+1/2,z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 68 basisop -x,z,y symbol ccp4 0 symbol Hall '-C 2a 2ac (-x,z,y)' symbol xHM 'B b a b :2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-B 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y,-z symop x+1/2,-y+1/2,-z symop -x,-y+1/2,z symop -x,-y,-z symop x+1/2,-y,z symop -x+1/2,y+1/2,z symop x,y+1/2,-z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 69 basisop x,y,z symbol ccp4 69 symbol Hall '-F 2 2' symbol xHM 'F m m m' symbol old 'F 2/m 2/m 2/m' 'F m m m' symbol laue '-P 2 2' 'mmm' symbol patt '-F 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x,-y,-z symop -x,y,-z symop -x,-y,-z symop x,y,-z symop -x,y,z symop x,-y,z cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 70 basisop x+1/8,y+1/8,z+1/8 symbol ccp4 70 symbol Hall '-F 2uv 2vw (x+1/8,y+1/8,z+1/8)' symbol xHM 'F d d d :1' symbol old 'F 2/d 2/d 2/d' 'F d d d' symbol laue '-P 2 2' 'mmm' symbol patt '-F 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/8; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/8; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y+1/2,z symop x,-y+1/2,-z+1/2 symop -x+1/2,y,-z+1/2 symop -x+1/4,-y+1/4,-z+1/4 symop x+3/4,y+3/4,-z+1/4 symop -x+1/4,y+3/4,z+3/4 symop x+3/4,-y+1/4,z+3/4 cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 70 basisop x,y,z symbol ccp4 0 symbol Hall '-F 2uv 2vw' symbol xHM 'F d d d :2' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-F 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/8; 0<=z<1 mapasu nonz 0<=x<=1/8; 1/8<=y<=3/8; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/4,-y+1/4,z symop x,-y+1/4,-z+1/4 symop -x+1/4,y,-z+1/4 symop -x,-y,-z symop x+3/4,y+3/4,-z symop -x,y+3/4,z+3/4 symop x+3/4,-y,z+3/4 cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 71 basisop x,y,z symbol ccp4 71 symbol Hall '-I 2 2' symbol xHM 'I m m m' symbol old 'I 2/m 2/m 2/m' 'I m m m' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x,-y,-z symop -x,y,-z symop -x,-y,-z symop x,y,-z symop -x,y,z symop x,-y,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 72 basisop x,y,z symbol ccp4 72 symbol Hall '-I 2 2c' symbol xHM 'I b a m' symbol old 'I 2/b 2/a 2/m' 'I b a m' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x,-y,-z+1/2 symop -x,y,-z+1/2 symop -x,-y,-z symop x,y,-z symop -x,y,z+1/2 symop x,-y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 72 basisop z,x,y symbol ccp4 0 symbol Hall '-I 2 2c (z,x,y)' symbol xHM 'I m c b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z symop -x+1/2,y,-z symop -x+1/2,-y,z symop -x,-y,-z symop -x,y,z symop x+1/2,-y,z symop x+1/2,y,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 72 basisop y,z,x symbol ccp4 0 symbol Hall '-I 2 2c (y,z,x)' symbol xHM 'I c m a' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z symop -x,-y+1/2,z symop x,-y+1/2,-z symop -x,-y,-z symop x,-y,z symop x,y+1/2,-z symop -x,y+1/2,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 73 basisop x,y,z symbol ccp4 73 symbol Hall '-I 2b 2c' symbol xHM 'I b c a' symbol old 'I 21/b 21/c 21/a' 'I b c a' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y+1/2,z symop x,-y,-z+1/2 symop -x,y+1/2,-z+1/2 symop -x,-y,-z symop x,y+1/2,-z symop -x,y,z+1/2 symop x,-y+1/2,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 73 basisop x+1/4,y-1/4,z+1/4 symbol ccp4 0 symbol Hall '-I 2b 2c (x+1/4,y-1/4,z+1/4)' symbol xHM 'I c a b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y,z symop x,-y+1/2,-z symop -x+1/2,y+1/2,-z symop -x+1/2,-y+1/2,-z+1/2 symop x,y+1/2,-z+1/2 symop -x+1/2,y,z+1/2 symop x,-y,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 74 basisop x,y,z symbol ccp4 74 symbol Hall '-I 2b 2' symbol xHM 'I m m a' symbol old 'I 21/m 21/m 21/a' 'I m m a' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y+1/2,z symop x,-y,-z symop -x,y+1/2,-z symop -x,-y,-z symop x,y+1/2,-z symop -x,y,z symop x,-y+1/2,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 74 basisop x+1/4,y-1/4,z+1/4 symbol ccp4 0 symbol Hall '-I 2b 2 (x+1/4,y-1/4,z+1/4)' symbol xHM 'I m m b' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y,z symop x,-y+1/2,-z+1/2 symop -x+1/2,y+1/2,-z+1/2 symop -x+1/2,-y+1/2,-z+1/2 symop x,y+1/2,-z+1/2 symop -x+1/2,y,z symop x,-y,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 74 basisop z,x,y symbol ccp4 0 symbol Hall '-I 2b 2 (z,x,y)' symbol xHM 'I b m m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y,-z+1/2 symop -x,y,-z symop -x,-y,z+1/2 symop -x,-y,-z symop -x,y,z+1/2 symop x,-y,z symop x,y,-z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 74 basisop z,y,-x symbol ccp4 0 symbol Hall '-I 2b 2 (z,y,-x)' symbol xHM 'I c m m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/4 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop x,-y+1/2,-z symop -x,-y,z symop -x,y+1/2,-z symop -x,-y,-z symop -x,y+1/2,z symop x,y,-z symop x,-y+1/2,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 74 basisop y,z,x symbol ccp4 0 symbol Hall '-I 2b 2 (y,z,x)' symbol xHM 'I m c m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1; 0<=z<=1/4 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,y,-z symop -x,-y,z symop x+1/2,-y,-z symop -x,-y,-z symop x+1/2,-y,z symop x,y,-z symop -x+1/2,y,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 74 basisop -x,z,y symbol ccp4 0 symbol Hall '-I 2b 2 (-x,z,y)' symbol xHM 'I m a m' symbol old '' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp '-P 2 2' 'mmm' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<1; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 1/4<=z<=3/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,y,-z+1/2 symop x,-y,-z symop -x,-y,z+1/2 symop -x,-y,-z symop x,-y,z+1/2 symop -x,y,z symop x,y,-z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 75 basisop x,y,z symbol ccp4 75 symbol Hall ' P 4' symbol xHM 'P 4' symbol old 'P 4' symbol laue '-P 4' '4/m' symbol patt '-P 4' '4/m' symbol pgrp ' P 4' '4' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z cenop x,y,z end_spacegroup begin_spacegroup number 76 basisop x,y,z symbol ccp4 76 symbol Hall ' P 4w' symbol xHM 'P 41' symbol old 'P 41' symbol laue '-P 4' '4/m' symbol patt '-P 4' '4/m' symbol pgrp ' P 4' '4' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<1/4 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y,x,z+1/4 symop -x,-y,z+1/2 symop y,-x,z+3/4 cenop x,y,z end_spacegroup begin_spacegroup number 77 basisop x,y,z symbol ccp4 77 symbol Hall ' P 4c' symbol xHM 'P 42' symbol old 'P 42' symbol laue '-P 4' '4/m' symbol patt '-P 4' '4/m' symbol pgrp ' P 4' '4' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<=1/2; 0<=y<1; 0<=z<1/2 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y,x,z+1/2 symop -x,-y,z symop y,-x,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 78 basisop x,y,z symbol ccp4 78 symbol Hall ' P 4cw' symbol xHM 'P 43' symbol old 'P 43' symbol laue '-P 4' '4/m' symbol patt '-P 4' '4/m' symbol pgrp ' P 4' '4' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<1/4 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y,x,z+3/4 symop -x,-y,z+1/2 symop y,-x,z+1/4 cenop x,y,z end_spacegroup begin_spacegroup number 79 basisop x,y,z symbol ccp4 79 symbol Hall ' I 4' symbol xHM 'I 4' symbol old 'I 4' symbol laue '-P 4' '4/m' symbol patt '-I 4' '4/m' symbol pgrp ' P 4' '4' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 80 basisop x,y,z symbol ccp4 80 symbol Hall ' I 4bw' symbol xHM 'I 41' symbol old 'I 41' symbol laue '-P 4' '4/m' symbol patt '-I 4' '4/m' symbol pgrp ' P 4' '4' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<=1/2; 0<=y<1; 0<=z<1/4 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<1/4 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y,x+1/2,z+1/4 symop -x+1/2,-y+1/2,z+1/2 symop y+1/2,-x,z+3/4 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 81 basisop x,y,z symbol ccp4 81 symbol Hall ' P -4' symbol xHM 'P -4' symbol old 'P -4' symbol laue '-P 4' '4/m' symbol patt '-P 4' '4/m' symbol pgrp ' P -4' '-4' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop y,-x,-z symop -x,-y,z symop -y,x,-z cenop x,y,z end_spacegroup begin_spacegroup number 82 basisop x,y,z symbol ccp4 82 symbol Hall ' I -4' symbol xHM 'I -4' symbol old 'I -4' symbol laue '-P 4' '4/m' symbol patt '-I 4' '4/m' symbol pgrp ' P -4' '-4' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop y,-x,-z symop -x,-y,z symop -y,x,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 83 basisop x,y,z symbol ccp4 83 symbol Hall '-P 4' symbol xHM 'P 4/m' symbol old 'P 4/m' symbol laue '-P 4' '4/m' symbol patt '-P 4' '4/m' symbol pgrp '-P 4' '4/m' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop -x,-y,-z symop y,-x,-z symop x,y,-z symop -y,x,-z cenop x,y,z end_spacegroup begin_spacegroup number 84 basisop x,y,z symbol ccp4 84 symbol Hall '-P 4c' symbol xHM 'P 42/m' symbol old 'P 42/m' symbol laue '-P 4' '4/m' symbol patt '-P 4' '4/m' symbol pgrp '-P 4' '4/m' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z+1/2 symop -x,-y,z symop y,-x,z+1/2 symop -x,-y,-z symop y,-x,-z+1/2 symop x,y,-z symop -y,x,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 85 basisop x-1/4,y+1/4,z symbol ccp4 85 symbol Hall '-P 4a (x-1/4,y+1/4,z)' symbol xHM 'P 4/n :1' symbol old 'P 4/n' symbol laue '-P 4' '4/m' symbol patt '-P 4' '4/m' symbol pgrp '-P 4' '4/m' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x+1/2,z symop -x,-y,z symop y+1/2,-x+1/2,z symop -x+1/2,-y+1/2,-z symop y,-x,-z symop x+1/2,y+1/2,-z symop -y,x,-z cenop x,y,z end_spacegroup begin_spacegroup number 85 basisop x,y,z symbol ccp4 0 symbol Hall '-P 4a' symbol xHM 'P 4/n :2' symbol old '' symbol laue '-P 4' '4/m' symbol patt '-P 4' '4/m' symbol pgrp '-P 4' '4/m' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x,z symop -x+1/2,-y+1/2,z symop y,-x+1/2,z symop -x,-y,-z symop y+1/2,-x,-z symop x+1/2,y+1/2,-z symop -y,x+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 86 basisop x+1/4,y+1/4,z+1/4 symbol ccp4 86 symbol Hall '-P 4bc (x+1/4,y+1/4,z+1/4)' symbol xHM 'P 42/n :1' symbol old 'P 42/n' symbol laue '-P 4' '4/m' symbol patt '-P 4' '4/m' symbol pgrp '-P 4' '4/m' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x+1/2,z+1/2 symop -x,-y,z symop y+1/2,-x+1/2,z+1/2 symop -x+1/2,-y+1/2,-z+1/2 symop y,-x,-z symop x+1/2,y+1/2,-z+1/2 symop -y,x,-z cenop x,y,z end_spacegroup begin_spacegroup number 86 basisop x,y,z symbol ccp4 0 symbol Hall '-P 4bc' symbol xHM 'P 42/n :2' symbol old '' symbol laue '-P 4' '4/m' symbol patt '-P 4' '4/m' symbol pgrp '-P 4' '4/m' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x+1/2,z+1/2 symop -x+1/2,-y+1/2,z symop y+1/2,-x,z+1/2 symop -x,-y,-z symop y,-x+1/2,-z+1/2 symop x+1/2,y+1/2,-z symop -y+1/2,x,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 87 basisop x,y,z symbol ccp4 87 symbol Hall '-I 4' symbol xHM 'I 4/m' symbol old 'I 4/m' symbol laue '-P 4' '4/m' symbol patt '-I 4' '4/m' symbol pgrp '-P 4' '4/m' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop -x,-y,-z symop y,-x,-z symop x,y,-z symop -y,x,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 88 basisop x,y+1/4,z+1/8 symbol ccp4 88 symbol Hall '-I 4ad (x,y+1/4,z+1/8)' symbol xHM 'I 41/a :1' symbol old 'I 41/a' symbol laue '-P 4' '4/m' symbol patt '-I 4' '4/m' symbol pgrp '-P 4' '4/m' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x+1/2,z+1/4 symop -x+1/2,-y+1/2,z+1/2 symop y+1/2,-x,z+3/4 symop -x,-y+1/2,-z+1/4 symop y,-x,-z symop x+1/2,y,-z+3/4 symop -y+1/2,x+1/2,-z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 88 basisop x,y,z symbol ccp4 0 symbol Hall '-I 4ad' symbol xHM 'I 41/a :2' symbol old '' symbol laue '-P 4' '4/m' symbol patt '-I 4' '4/m' symbol pgrp '-P 4' '4/m' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+3/4,x+1/4,z+1/4 symop -x+1/2,-y,z+1/2 symop y+3/4,-x+3/4,z+3/4 symop -x,-y,-z symop y+1/4,-x+3/4,-z+3/4 symop x+1/2,y,-z+1/2 symop -y+1/4,x+1/4,-z+1/4 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 89 basisop x,y,z symbol ccp4 89 symbol Hall ' P 4 2' symbol xHM 'P 4 2 2' symbol old 'P 4 2 2' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P 4 2' '422' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop x,-y,-z symop y,x,-z symop -x,y,-z symop -y,-x,-z cenop x,y,z end_spacegroup begin_spacegroup number 90 basisop x,y,z symbol ccp4 90 symbol Hall ' P 4ab 2ab' symbol xHM 'P 4 21 2' symbol old 'P 4 21 2' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P 4 2' '422' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x+1/2,z symop -x,-y,z symop y+1/2,-x+1/2,z symop x+1/2,-y+1/2,-z symop y,x,-z symop -x+1/2,y+1/2,-z symop -y,-x,-z cenop x,y,z end_spacegroup begin_spacegroup number 91 basisop x,y,z symbol ccp4 91 symbol Hall ' P 4w 2c' symbol xHM 'P 41 2 2' symbol old 'P 41 2 2' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P 4 2' '422' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/8 mapasu zero 0<=x<1; 0<=y<1; 0<=z<=1/8 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; -1/8<=z<=3/8 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z+1/4 symop -x,-y,z+1/2 symop y,-x,z+3/4 symop x,-y,-z+1/2 symop y,x,-z+3/4 symop -x,y,-z symop -y,-x,-z+1/4 cenop x,y,z end_spacegroup begin_spacegroup number 92 basisop x,y,z symbol ccp4 92 symbol Hall ' P 4abw 2nw' symbol xHM 'P 41 21 2' symbol old 'P 41 21 2' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P 4 2' '422' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/8 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x+1/2,z+1/4 symop -x,-y,z+1/2 symop y+1/2,-x+1/2,z+3/4 symop x+1/2,-y+1/2,-z+3/4 symop y,x,-z symop -x+1/2,y+1/2,-z+1/4 symop -y,-x,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 93 basisop x,y,z symbol ccp4 93 symbol Hall ' P 4c 2' symbol xHM 'P 42 2 2' symbol old 'P 42 2 2' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P 4 2' '422' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<1; 0<=z<=1/4 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 1/4<=z<=3/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z+1/2 symop -x,-y,z symop y,-x,z+1/2 symop x,-y,-z symop y,x,-z+1/2 symop -x,y,-z symop -y,-x,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 94 basisop x,y,z symbol ccp4 94 symbol Hall ' P 4n 2n' symbol xHM 'P 42 21 2' symbol old 'P 42 21 2' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P 4 2' '422' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x+1/2,z+1/2 symop -x,-y,z symop y+1/2,-x+1/2,z+1/2 symop x+1/2,-y+1/2,-z+1/2 symop y,x,-z symop -x+1/2,y+1/2,-z+1/2 symop -y,-x,-z cenop x,y,z end_spacegroup begin_spacegroup number 95 basisop x,y,z symbol ccp4 95 symbol Hall ' P 4cw 2c' symbol xHM 'P 43 2 2' symbol old 'P 43 2 2' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P 4 2' '422' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/8 mapasu zero 0<=x<1; 0<=y<1; 0<=z<=1/8 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 1/8<=z<=5/8 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z+3/4 symop -x,-y,z+1/2 symop y,-x,z+1/4 symop x,-y,-z+1/2 symop y,x,-z+1/4 symop -x,y,-z symop -y,-x,-z+3/4 cenop x,y,z end_spacegroup begin_spacegroup number 96 basisop x,y,z symbol ccp4 96 symbol Hall ' P 4nw 2abw' symbol xHM 'P 43 21 2' symbol old 'P 43 21 2' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P 4 2' '422' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/8 mapasu zero 0<=x<=1/2; 0<=y<1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<1/2; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x+1/2,z+3/4 symop -x,-y,z+1/2 symop y+1/2,-x+1/2,z+1/4 symop x+1/2,-y+1/2,-z+1/4 symop y,x,-z symop -x+1/2,y+1/2,-z+3/4 symop -y,-x,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 97 basisop x,y,z symbol ccp4 97 symbol Hall ' I 4 2' symbol xHM 'I 4 2 2' symbol old 'I 4 2 2' symbol laue '-P 4 2' '4/mmm' symbol patt '-I 4 2' '4/mmm' symbol pgrp ' P 4 2' '422' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop x,-y,-z symop y,x,-z symop -x,y,-z symop -y,-x,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 98 basisop x,y,z symbol ccp4 98 symbol Hall ' I 4bw 2bw' symbol xHM 'I 41 2 2' symbol old 'I 41 2 2' symbol laue '-P 4 2' '4/mmm' symbol patt '-I 4 2' '4/mmm' symbol pgrp ' P 4 2' '422' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<1; 0<=z<=1/8 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/4 mapasu nonz 0<=x<=1/4; -1/4<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x+1/2,z+1/4 symop -x+1/2,-y+1/2,z+1/2 symop y+1/2,-x,z+3/4 symop x,-y+1/2,-z+1/4 symop y+1/2,x+1/2,-z+1/2 symop -x+1/2,y,-z+3/4 symop -y,-x,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 99 basisop x,y,z symbol ccp4 99 symbol Hall ' P 4 -2' symbol xHM 'P 4 m m' symbol old 'P 4 m m' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P 4 -2' '4mm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop -x,y,z symop -y,-x,z symop x,-y,z symop y,x,z cenop x,y,z end_spacegroup begin_spacegroup number 100 basisop x,y,z symbol ccp4 100 symbol Hall ' P 4 -2ab' symbol xHM 'P 4 b m' symbol old 'P 4 b m' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P 4 -2' '4mm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<3/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop -x+1/2,y+1/2,z symop -y+1/2,-x+1/2,z symop x+1/2,-y+1/2,z symop y+1/2,x+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 101 basisop x,y,z symbol ccp4 101 symbol Hall ' P 4c -2c' symbol xHM 'P 42 c m' symbol old 'P 42 c m' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P 4 -2' '4mm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y,x,z+1/2 symop -x,-y,z symop y,-x,z+1/2 symop -x,y,z+1/2 symop -y,-x,z symop x,-y,z+1/2 symop y,x,z cenop x,y,z end_spacegroup begin_spacegroup number 102 basisop x,y,z symbol ccp4 102 symbol Hall ' P 4n -2n' symbol xHM 'P 42 n m' symbol old 'P 42 n m' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P 4 -2' '4mm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<3/4; 1/4<=y<=1/2; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y+1/2,x+1/2,z+1/2 symop -x,-y,z symop y+1/2,-x+1/2,z+1/2 symop -x+1/2,y+1/2,z+1/2 symop -y,-x,z symop x+1/2,-y+1/2,z+1/2 symop y,x,z cenop x,y,z end_spacegroup begin_spacegroup number 103 basisop x,y,z symbol ccp4 103 symbol Hall ' P 4 -2c' symbol xHM 'P 4 c c' symbol old 'P 4 c c' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P 4 -2' '4mm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop -x,y,z+1/2 symop -y,-x,z+1/2 symop x,-y,z+1/2 symop y,x,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 104 basisop x,y,z symbol ccp4 104 symbol Hall ' P 4 -2n' symbol xHM 'P 4 n c' symbol old 'P 4 n c' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P 4 -2' '4mm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop -x+1/2,y+1/2,z+1/2 symop -y+1/2,-x+1/2,z+1/2 symop x+1/2,-y+1/2,z+1/2 symop y+1/2,x+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 105 basisop x,y,z symbol ccp4 105 symbol Hall ' P 4c -2' symbol xHM 'P 42 m c' symbol old 'P 42 m c' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P 4 -2' '4mm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y,x,z+1/2 symop -x,-y,z symop y,-x,z+1/2 symop -x,y,z symop -y,-x,z+1/2 symop x,-y,z symop y,x,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 106 basisop x,y,z symbol ccp4 106 symbol Hall ' P 4c -2ab' symbol xHM 'P 42 b c' symbol old 'P 42 b c' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P 4 -2' '4mm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1/2 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y,x,z+1/2 symop -x,-y,z symop y,-x,z+1/2 symop -x+1/2,y+1/2,z symop -y+1/2,-x+1/2,z+1/2 symop x+1/2,-y+1/2,z symop y+1/2,x+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 107 basisop x,y,z symbol ccp4 107 symbol Hall ' I 4 -2' symbol xHM 'I 4 m m' symbol old 'I 4 m m' symbol laue '-P 4 2' '4/mmm' symbol patt '-I 4 2' '4/mmm' symbol pgrp ' P 4 -2' '4mm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop -x,y,z symop -y,-x,z symop x,-y,z symop y,x,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 108 basisop x,y,z symbol ccp4 108 symbol Hall ' I 4 -2c' symbol xHM 'I 4 c m' symbol old 'I 4 c m' symbol laue '-P 4 2' '4/mmm' symbol patt '-I 4 2' '4/mmm' symbol pgrp ' P 4 -2' '4mm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<3/4; 0<=y<=1/4; 0<=z<1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop -x,y,z+1/2 symop -y,-x,z+1/2 symop x,-y,z+1/2 symop y,x,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 109 basisop x,y,z symbol ccp4 109 symbol Hall ' I 4bw -2' symbol xHM 'I 41 m d' symbol old 'I 41 m d' symbol laue '-P 4 2' '4/mmm' symbol patt '-I 4 2' '4/mmm' symbol pgrp ' P 4 -2' '4mm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y,x+1/2,z+1/4 symop -x+1/2,-y+1/2,z+1/2 symop y+1/2,-x,z+3/4 symop -x,y,z symop -y,-x+1/2,z+1/4 symop x+1/2,-y+1/2,z+1/2 symop y+1/2,x,z+3/4 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 110 basisop x,y,z symbol ccp4 110 symbol Hall ' I 4bw -2c' symbol xHM 'I 41 c d' symbol old 'I 41 c d' symbol laue '-P 4 2' '4/mmm' symbol patt '-I 4 2' '4/mmm' symbol pgrp ' P 4 -2' '4mm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=0 symop x,y,z symop -y,x+1/2,z+1/4 symop -x+1/2,-y+1/2,z+1/2 symop y+1/2,-x,z+3/4 symop -x,y,z+1/2 symop -y,-x+1/2,z+3/4 symop x+1/2,-y+1/2,z symop y+1/2,x,z+1/4 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 111 basisop x,y,z symbol ccp4 111 symbol Hall ' P -4 2' symbol xHM 'P -4 2 m' symbol old 'P -4 2 m' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P -4 2' '-4m2' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop y,-x,-z symop -x,-y,z symop -y,x,-z symop x,-y,-z symop -y,-x,z symop -x,y,-z symop y,x,z cenop x,y,z end_spacegroup begin_spacegroup number 112 basisop x,y,z symbol ccp4 112 symbol Hall ' P -4 2c' symbol xHM 'P -4 2 c' symbol old 'P -4 2 c' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P -4 2' '-4m2' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop y,-x,-z symop -x,-y,z symop -y,x,-z symop x,-y,-z+1/2 symop -y,-x,z+1/2 symop -x,y,-z+1/2 symop y,x,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 113 basisop x,y,z symbol ccp4 113 symbol Hall ' P -4 2ab' symbol xHM 'P -4 21 m' symbol old 'P -4 21 m' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P -4 2' '-4m2' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<3/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop y,-x,-z symop -x,-y,z symop -y,x,-z symop x+1/2,-y+1/2,-z symop -y+1/2,-x+1/2,z symop -x+1/2,y+1/2,-z symop y+1/2,x+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 114 basisop x,y,z symbol ccp4 114 symbol Hall ' P -4 2n' symbol xHM 'P -4 21 c' symbol old 'P -4 21 c' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P -4 2' '-4m2' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop y,-x,-z symop -x,-y,z symop -y,x,-z symop x+1/2,-y+1/2,-z+1/2 symop -y+1/2,-x+1/2,z+1/2 symop -x+1/2,y+1/2,-z+1/2 symop y+1/2,x+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 115 basisop x,y,z symbol ccp4 115 symbol Hall ' P -4 -2' symbol xHM 'P -4 m 2' symbol old 'P -4 m 2' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P -4 -2' '-42m' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop y,-x,-z symop -x,-y,z symop -y,x,-z symop -x,y,z symop y,x,-z symop x,-y,z symop -y,-x,-z cenop x,y,z end_spacegroup begin_spacegroup number 116 basisop x,y,z symbol ccp4 116 symbol Hall ' P -4 -2c' symbol xHM 'P -4 c 2' symbol old 'P -4 c 2' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P -4 -2' '-42m' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 1/4<=z<=3/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop y,-x,-z symop -x,-y,z symop -y,x,-z symop -x,y,z+1/2 symop y,x,-z+1/2 symop x,-y,z+1/2 symop -y,-x,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 117 basisop x,y,z symbol ccp4 117 symbol Hall ' P -4 -2ab' symbol xHM 'P -4 b 2' symbol old 'P -4 b 2' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P -4 -2' '-42m' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop y,-x,-z symop -x,-y,z symop -y,x,-z symop -x+1/2,y+1/2,z symop y+1/2,x+1/2,-z symop x+1/2,-y+1/2,z symop -y+1/2,-x+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 118 basisop x,y,z symbol ccp4 118 symbol Hall ' P -4 -2n' symbol xHM 'P -4 n 2' symbol old 'P -4 n 2' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P -4 -2' '-42m' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 1/4<=z<=3/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop y,-x,-z symop -x,-y,z symop -y,x,-z symop -x+1/2,y+1/2,z+1/2 symop y+1/2,x+1/2,-z+1/2 symop x+1/2,-y+1/2,z+1/2 symop -y+1/2,-x+1/2,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 119 basisop x,y,z symbol ccp4 119 symbol Hall ' I -4 -2' symbol xHM 'I -4 m 2' symbol old 'I -4 m 2' symbol laue '-P 4 2' '4/mmm' symbol patt '-I 4 2' '4/mmm' symbol pgrp ' P -4 -2' '-42m' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop y,-x,-z symop -x,-y,z symop -y,x,-z symop -x,y,z symop y,x,-z symop x,-y,z symop -y,-x,-z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 120 basisop x,y,z symbol ccp4 120 symbol Hall ' I -4 -2c' symbol xHM 'I -4 c 2' symbol old 'I -4 c 2' symbol laue '-P 4 2' '4/mmm' symbol patt '-I 4 2' '4/mmm' symbol pgrp ' P -4 -2' '-42m' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/4 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<=1/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop y,-x,-z symop -x,-y,z symop -y,x,-z symop -x,y,z+1/2 symop y,x,-z+1/2 symop x,-y,z+1/2 symop -y,-x,-z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 121 basisop x,y,z symbol ccp4 121 symbol Hall ' I -4 2' symbol xHM 'I -4 2 m' symbol old 'I -4 2 m' symbol laue '-P 4 2' '4/mmm' symbol patt '-I 4 2' '4/mmm' symbol pgrp ' P -4 2' '-4m2' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<3/4; 1/4<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop y,-x,-z symop -x,-y,z symop -y,x,-z symop x,-y,-z symop -y,-x,z symop -x,y,-z symop y,x,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 122 basisop x,y,z symbol ccp4 122 symbol Hall ' I -4 2bw' symbol xHM 'I -4 2 d' symbol old 'I -4 2 d' symbol laue '-P 4 2' '4/mmm' symbol patt '-I 4 2' '4/mmm' symbol pgrp ' P -4 2' '-4m2' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop y,-x,-z symop -x,-y,z symop -y,x,-z symop x,-y+1/2,-z+1/4 symop -y+1/2,-x,z+3/4 symop -x,y+1/2,-z+1/4 symop y+1/2,x,z+3/4 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 123 basisop x,y,z symbol ccp4 123 symbol Hall '-P 4 2' symbol xHM 'P 4/m m m' symbol old 'P 4/m 2/m 2/m' 'P4/m m m' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop x,-y,-z symop y,x,-z symop -x,y,-z symop -y,-x,-z symop -x,-y,-z symop y,-x,-z symop x,y,-z symop -y,x,-z symop -x,y,z symop -y,-x,z symop x,-y,z symop y,x,z cenop x,y,z end_spacegroup begin_spacegroup number 124 basisop x,y,z symbol ccp4 124 symbol Hall '-P 4 2c' symbol xHM 'P 4/m c c' symbol old 'P 4/m 2/c 2/c' 'P4/m c c' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop x,-y,-z+1/2 symop y,x,-z+1/2 symop -x,y,-z+1/2 symop -y,-x,-z+1/2 symop -x,-y,-z symop y,-x,-z symop x,y,-z symop -y,x,-z symop -x,y,z+1/2 symop -y,-x,z+1/2 symop x,-y,z+1/2 symop y,x,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 125 basisop x-1/4,y-1/4,z symbol ccp4 125 symbol Hall '-P 4a 2b (x-1/4,y-1/4,z)' symbol xHM 'P 4/n b m :1' symbol old 'P 4/n 2/b 2/m' 'P4/n b m' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<3/4; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop x,-y,-z symop y,x,-z symop -x,y,-z symop -y,-x,-z symop -x+1/2,-y+1/2,-z symop y+1/2,-x+1/2,-z symop x+1/2,y+1/2,-z symop -y+1/2,x+1/2,-z symop -x+1/2,y+1/2,z symop -y+1/2,-x+1/2,z symop x+1/2,-y+1/2,z symop y+1/2,x+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 125 basisop x,y,z symbol ccp4 0 symbol Hall '-P 4a 2b' symbol xHM 'P 4/n b m :2' symbol old '' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 1/4<=y<1; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x,z symop -x+1/2,-y+1/2,z symop y,-x+1/2,z symop x,-y+1/2,-z symop y,x,-z symop -x+1/2,y,-z symop -y+1/2,-x+1/2,-z symop -x,-y,-z symop y+1/2,-x,-z symop x+1/2,y+1/2,-z symop -y,x+1/2,-z symop -x,y+1/2,z symop -y,-x,z symop x+1/2,-y,z symop y+1/2,x+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 126 basisop x-1/4,y-1/4,z-1/4 symbol ccp4 126 symbol Hall '-P 4a 2bc (x-1/4,y-1/4,z-1/4)' symbol xHM 'P 4/n n c :1' symbol old 'P 4/n 2/n 2/c' 'P4/n n c' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop x,-y,-z symop y,x,-z symop -x,y,-z symop -y,-x,-z symop -x+1/2,-y+1/2,-z+1/2 symop y+1/2,-x+1/2,-z+1/2 symop x+1/2,y+1/2,-z+1/2 symop -y+1/2,x+1/2,-z+1/2 symop -x+1/2,y+1/2,z+1/2 symop -y+1/2,-x+1/2,z+1/2 symop x+1/2,-y+1/2,z+1/2 symop y+1/2,x+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 126 basisop x,y,z symbol ccp4 0 symbol Hall '-P 4a 2bc' symbol xHM 'P 4/n n c :2' symbol old '' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 1/4<=z<=3/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x,z symop -x+1/2,-y+1/2,z symop y,-x+1/2,z symop x,-y+1/2,-z+1/2 symop y,x,-z+1/2 symop -x+1/2,y,-z+1/2 symop -y+1/2,-x+1/2,-z+1/2 symop -x,-y,-z symop y+1/2,-x,-z symop x+1/2,y+1/2,-z symop -y,x+1/2,-z symop -x,y+1/2,z+1/2 symop -y,-x,z+1/2 symop x+1/2,-y,z+1/2 symop y+1/2,x+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 127 basisop x,y,z symbol ccp4 127 symbol Hall '-P 4 2ab' symbol xHM 'P 4/m b m' symbol old 'P 4/m 21/b 2/m' 'P4/m b m' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<3/4; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop x+1/2,-y+1/2,-z symop y+1/2,x+1/2,-z symop -x+1/2,y+1/2,-z symop -y+1/2,-x+1/2,-z symop -x,-y,-z symop y,-x,-z symop x,y,-z symop -y,x,-z symop -x+1/2,y+1/2,z symop -y+1/2,-x+1/2,z symop x+1/2,-y+1/2,z symop y+1/2,x+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 128 basisop x,y,z symbol ccp4 128 symbol Hall '-P 4 2n' symbol xHM 'P 4/m n c' symbol old 'P 4/m 21/n 2/c' 'P4/m n c' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop x+1/2,-y+1/2,-z+1/2 symop y+1/2,x+1/2,-z+1/2 symop -x+1/2,y+1/2,-z+1/2 symop -y+1/2,-x+1/2,-z+1/2 symop -x,-y,-z symop y,-x,-z symop x,y,-z symop -y,x,-z symop -x+1/2,y+1/2,z+1/2 symop -y+1/2,-x+1/2,z+1/2 symop x+1/2,-y+1/2,z+1/2 symop y+1/2,x+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 129 basisop x-1/4,y+1/4,z symbol ccp4 129 symbol Hall '-P 4a 2a (x-1/4,y+1/4,z)' symbol xHM 'P 4/n m m :1' symbol old 'P 4/n 21/m 2/m' 'P4/n m m' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x+1/2,z symop -x,-y,z symop y+1/2,-x+1/2,z symop x+1/2,-y+1/2,-z symop y,x,-z symop -x+1/2,y+1/2,-z symop -y,-x,-z symop -x+1/2,-y+1/2,-z symop y,-x,-z symop x+1/2,y+1/2,-z symop -y,x,-z symop -x,y,z symop -y+1/2,-x+1/2,z symop x,-y,z symop y+1/2,x+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 129 basisop x,y,z symbol ccp4 0 symbol Hall '-P 4a 2a' symbol xHM 'P 4/n m m :2' symbol old '' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x,z symop -x+1/2,-y+1/2,z symop y,-x+1/2,z symop x+1/2,-y,-z symop y+1/2,x+1/2,-z symop -x,y+1/2,-z symop -y,-x,-z symop -x,-y,-z symop y+1/2,-x,-z symop x+1/2,y+1/2,-z symop -y,x+1/2,-z symop -x+1/2,y,z symop -y+1/2,-x+1/2,z symop x,-y+1/2,z symop y,x,z cenop x,y,z end_spacegroup begin_spacegroup number 130 basisop x-1/4,y+1/4,z symbol ccp4 130 symbol Hall '-P 4a 2ac (x-1/4,y+1/4,z)' symbol xHM 'P 4/n c c :1' symbol old 'P 4/n 2/c 2/c' 'P4/n c c' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 1/4<=z<=3/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x+1/2,z symop -x,-y,z symop y+1/2,-x+1/2,z symop x+1/2,-y+1/2,-z+1/2 symop y,x,-z+1/2 symop -x+1/2,y+1/2,-z+1/2 symop -y,-x,-z+1/2 symop -x+1/2,-y+1/2,-z symop y,-x,-z symop x+1/2,y+1/2,-z symop -y,x,-z symop -x,y,z+1/2 symop -y+1/2,-x+1/2,z+1/2 symop x,-y,z+1/2 symop y+1/2,x+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 130 basisop x,y,z symbol ccp4 0 symbol Hall '-P 4a 2ac' symbol xHM 'P 4/n c c :2' symbol old '' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 1/4<=z<=3/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x,z symop -x+1/2,-y+1/2,z symop y,-x+1/2,z symop x+1/2,-y,-z+1/2 symop y+1/2,x+1/2,-z+1/2 symop -x,y+1/2,-z+1/2 symop -y,-x,-z+1/2 symop -x,-y,-z symop y+1/2,-x,-z symop x+1/2,y+1/2,-z symop -y,x+1/2,-z symop -x+1/2,y,z+1/2 symop -y+1/2,-x+1/2,z+1/2 symop x,-y+1/2,z+1/2 symop y,x,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 131 basisop x,y,z symbol ccp4 131 symbol Hall '-P 4c 2' symbol xHM 'P 42/m m c' symbol old 'P 42/m 2/m 2/c' 'P42/m m c' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z+1/2 symop -x,-y,z symop y,-x,z+1/2 symop x,-y,-z symop y,x,-z+1/2 symop -x,y,-z symop -y,-x,-z+1/2 symop -x,-y,-z symop y,-x,-z+1/2 symop x,y,-z symop -y,x,-z+1/2 symop -x,y,z symop -y,-x,z+1/2 symop x,-y,z symop y,x,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 132 basisop x,y,z symbol ccp4 132 symbol Hall '-P 4c 2c' symbol xHM 'P 42/m c m' symbol old 'P 42/m 2/c 2/m' 'P42/m c m' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z+1/2 symop -x,-y,z symop y,-x,z+1/2 symop x,-y,-z+1/2 symop y,x,-z symop -x,y,-z+1/2 symop -y,-x,-z symop -x,-y,-z symop y,-x,-z+1/2 symop x,y,-z symop -y,x,-z+1/2 symop -x,y,z+1/2 symop -y,-x,z symop x,-y,z+1/2 symop y,x,z cenop x,y,z end_spacegroup begin_spacegroup number 133 basisop x-1/4,y+1/4,z+1/4 symbol ccp4 133 symbol Hall '-P 4ac 2b (x-1/4,y+1/4,z+1/4)' symbol xHM 'P 42/n b c :1' symbol old 'P 42/n 2/b 2/c' 'P42/n b c' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x+1/2,z+1/2 symop -x,-y,z symop y+1/2,-x+1/2,z+1/2 symop x,-y,-z+1/2 symop y+1/2,x+1/2,-z symop -x,y,-z+1/2 symop -y+1/2,-x+1/2,-z symop -x+1/2,-y+1/2,-z+1/2 symop y,-x,-z symop x+1/2,y+1/2,-z+1/2 symop -y,x,-z symop -x+1/2,y+1/2,z symop -y,-x,z+1/2 symop x+1/2,-y+1/2,z symop y,x,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 133 basisop x,y,z symbol ccp4 0 symbol Hall '-P 4ac 2b' symbol xHM 'P 42/n b c :2' symbol old '' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/4 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 1/4<=z<=3/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x,z+1/2 symop -x+1/2,-y+1/2,z symop y,-x+1/2,z+1/2 symop x,-y+1/2,-z symop y,x,-z+1/2 symop -x+1/2,y,-z symop -y+1/2,-x+1/2,-z+1/2 symop -x,-y,-z symop y+1/2,-x,-z+1/2 symop x+1/2,y+1/2,-z symop -y,x+1/2,-z+1/2 symop -x,y+1/2,z symop -y,-x,z+1/2 symop x+1/2,-y,z symop y+1/2,x+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 134 basisop x-1/4,y+1/4,z-1/4 symbol ccp4 134 symbol Hall '-P 4ac 2bc (x-1/4,y+1/4,z-1/4)' symbol xHM 'P 42/n n m :1' symbol old 'P 42/n 2/n 2/m' 'P42/n n m' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x+1/2,z+1/2 symop -x,-y,z symop y+1/2,-x+1/2,z+1/2 symop x,-y,-z symop y+1/2,x+1/2,-z+1/2 symop -x,y,-z symop -y+1/2,-x+1/2,-z+1/2 symop -x+1/2,-y+1/2,-z+1/2 symop y,-x,-z symop x+1/2,y+1/2,-z+1/2 symop -y,x,-z symop -x+1/2,y+1/2,z+1/2 symop -y,-x,z symop x+1/2,-y+1/2,z+1/2 symop y,x,z cenop x,y,z end_spacegroup begin_spacegroup number 134 basisop x,y,z symbol ccp4 0 symbol Hall '-P 4ac 2bc' symbol xHM 'P 42/n n m :2' symbol old '' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x,z+1/2 symop -x+1/2,-y+1/2,z symop y,-x+1/2,z+1/2 symop x,-y+1/2,-z+1/2 symop y,x,-z symop -x+1/2,y,-z+1/2 symop -y+1/2,-x+1/2,-z symop -x,-y,-z symop y+1/2,-x,-z+1/2 symop x+1/2,y+1/2,-z symop -y,x+1/2,-z+1/2 symop -x,y+1/2,z+1/2 symop -y,-x,z symop x+1/2,-y,z+1/2 symop y+1/2,x+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 135 basisop x,y,z symbol ccp4 135 symbol Hall '-P 4c 2ab' symbol xHM 'P 42/m b c' symbol old 'P 42/m 21/b 2/c' 'P42/m b c' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/4 mapasu nonz 0<=x<1; 0<=y<=1/4; 0<=z<=1/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z+1/2 symop -x,-y,z symop y,-x,z+1/2 symop x+1/2,-y+1/2,-z symop y+1/2,x+1/2,-z+1/2 symop -x+1/2,y+1/2,-z symop -y+1/2,-x+1/2,-z+1/2 symop -x,-y,-z symop y,-x,-z+1/2 symop x,y,-z symop -y,x,-z+1/2 symop -x+1/2,y+1/2,z symop -y+1/2,-x+1/2,z+1/2 symop x+1/2,-y+1/2,z symop y+1/2,x+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 136 basisop x,y,z symbol ccp4 136 symbol Hall '-P 4n 2n' symbol xHM 'P 42/m n m' symbol old 'P 42/m 21/n 2/m' 'P42/m n m' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<3/4; 1/4<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x+1/2,z+1/2 symop -x,-y,z symop y+1/2,-x+1/2,z+1/2 symop x+1/2,-y+1/2,-z+1/2 symop y,x,-z symop -x+1/2,y+1/2,-z+1/2 symop -y,-x,-z symop -x,-y,-z symop y+1/2,-x+1/2,-z+1/2 symop x,y,-z symop -y+1/2,x+1/2,-z+1/2 symop -x+1/2,y+1/2,z+1/2 symop -y,-x,z symop x+1/2,-y+1/2,z+1/2 symop y,x,z cenop x,y,z end_spacegroup begin_spacegroup number 137 basisop x-1/4,y+1/4,z+1/4 symbol ccp4 137 symbol Hall '-P 4ac 2a (x-1/4,y+1/4,z+1/4)' symbol xHM 'P 42/n m c :1' symbol old 'P 42/n 21/m 2/c' 'P42/n m c' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x+1/2,z+1/2 symop -x,-y,z symop y+1/2,-x+1/2,z+1/2 symop x+1/2,-y+1/2,-z+1/2 symop y,x,-z symop -x+1/2,y+1/2,-z+1/2 symop -y,-x,-z symop -x+1/2,-y+1/2,-z+1/2 symop y,-x,-z symop x+1/2,y+1/2,-z+1/2 symop -y,x,-z symop -x,y,z symop -y+1/2,-x+1/2,z+1/2 symop x,-y,z symop y+1/2,x+1/2,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 137 basisop x,y,z symbol ccp4 0 symbol Hall '-P 4ac 2a' symbol xHM 'P 42/n m c :2' symbol old '' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 1/4<=y<=3/4; 1/4<=z<=3/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x,z+1/2 symop -x+1/2,-y+1/2,z symop y,-x+1/2,z+1/2 symop x+1/2,-y,-z symop y+1/2,x+1/2,-z+1/2 symop -x,y+1/2,-z symop -y,-x,-z+1/2 symop -x,-y,-z symop y+1/2,-x,-z+1/2 symop x+1/2,y+1/2,-z symop -y,x+1/2,-z+1/2 symop -x+1/2,y,z symop -y+1/2,-x+1/2,z+1/2 symop x,-y+1/2,z symop y,x,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 138 basisop x-1/4,y+1/4,z-1/4 symbol ccp4 138 symbol Hall '-P 4ac 2ac (x-1/4,y+1/4,z-1/4)' symbol xHM 'P 42/n c m :1' symbol old 'P 42/n 21/c 2/m' 'P42/n c m' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<3/4; 0<=y<=1/4; 1/4<=z<=3/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x+1/2,z+1/2 symop -x,-y,z symop y+1/2,-x+1/2,z+1/2 symop x+1/2,-y+1/2,-z symop y,x,-z+1/2 symop -x+1/2,y+1/2,-z symop -y,-x,-z+1/2 symop -x+1/2,-y+1/2,-z+1/2 symop y,-x,-z symop x+1/2,y+1/2,-z+1/2 symop -y,x,-z symop -x,y,z+1/2 symop -y+1/2,-x+1/2,z symop x,-y,z+1/2 symop y+1/2,x+1/2,z cenop x,y,z end_spacegroup begin_spacegroup number 138 basisop x,y,z symbol ccp4 0 symbol Hall '-P 4ac 2ac' symbol xHM 'P 42/n c m :2' symbol old '' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1/2 mapasu nonz 0=k and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop x,-y,-z symop y,x,-z symop -x,y,-z symop -y,-x,-z symop -x,-y,-z symop y,-x,-z symop x,y,-z symop -y,x,-z symop -x,y,z symop -y,-x,z symop x,-y,z symop y,x,z cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 140 basisop x,y,z symbol ccp4 140 symbol Hall '-I 4 2c' symbol xHM 'I 4/m c m' symbol old 'I 4/m 2/c 2/m' 'I4/m c m' symbol laue '-P 4 2' '4/mmm' symbol patt '-I 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<3/4; 0<=y<=1/4; 0<=z<=1/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop x,-y,-z+1/2 symop y,x,-z+1/2 symop -x,y,-z+1/2 symop -y,-x,-z+1/2 symop -x,-y,-z symop y,-x,-z symop x,y,-z symop -y,x,-z symop -x,y,z+1/2 symop -y,-x,z+1/2 symop x,-y,z+1/2 symop y,x,z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 141 basisop x-1/2,y+1/4,z+1/8 symbol ccp4 141 symbol Hall '-I 4bd 2 (x-1/2,y+1/4,z+1/8)' symbol xHM 'I 41/a m d :1' symbol old 'I 41/a 2/m 2/d' 'I41/a m d' symbol laue '-P 4 2' '4/mmm' symbol patt '-I 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x+1/2,z+1/4 symop -x+1/2,-y+1/2,z+1/2 symop y+1/2,-x,z+3/4 symop x,-y+1/2,-z+1/4 symop y+1/2,x+1/2,-z+1/2 symop -x+1/2,y,-z+3/4 symop -y,-x,-z symop -x,-y+1/2,-z+1/4 symop y,-x,-z symop x+1/2,y,-z+3/4 symop -y+1/2,x+1/2,-z+1/2 symop -x,y,z symop -y+1/2,-x,z+3/4 symop x+1/2,-y+1/2,z+1/2 symop y,x+1/2,z+1/4 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 141 basisop x,y,z symbol ccp4 0 symbol Hall '-I 4bd 2' symbol xHM 'I 41/a m d :2' symbol old '' symbol laue '-P 4 2' '4/mmm' symbol patt '-I 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; -1/8<=z<=3/8 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/4,x+3/4,z+1/4 symop -x+1/2,-y,z+1/2 symop y+1/4,-x+1/4,z+3/4 symop x,-y,-z symop y+1/4,x+3/4,-z+1/4 symop -x+1/2,y,-z+1/2 symop -y+1/4,-x+1/4,-z+3/4 symop -x,-y,-z symop y+3/4,-x+1/4,-z+3/4 symop x+1/2,y,-z+1/2 symop -y+3/4,x+3/4,-z+1/4 symop -x,y,z symop -y+3/4,-x+1/4,z+3/4 symop x+1/2,-y,z+1/2 symop y+3/4,x+3/4,z+1/4 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 142 basisop x-1/2,y+1/4,z-3/8 symbol ccp4 142 symbol Hall '-I 4bd 2c (x-1/2,y+1/4,z-3/8)' symbol xHM 'I 41/a c d :1' symbol old 'I41/a c d' 'I 41/a 2/c 2/d' symbol laue '-P 4 2' '4/mmm' symbol patt '-I 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/8 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 1/4<=z<=3/4 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x+1/2,z+1/4 symop -x+1/2,-y+1/2,z+1/2 symop y+1/2,-x,z+3/4 symop x,-y+1/2,-z+3/4 symop y+1/2,x+1/2,-z symop -x+1/2,y,-z+1/4 symop -y,-x,-z+1/2 symop -x,-y+1/2,-z+1/4 symop y,-x,-z symop x+1/2,y,-z+3/4 symop -y+1/2,x+1/2,-z+1/2 symop -x,y,z+1/2 symop -y+1/2,-x,z+1/4 symop x+1/2,-y+1/2,z symop y,x+1/2,z+3/4 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 142 basisop x,y,z symbol ccp4 0 symbol Hall '-I 4bd 2c' symbol xHM 'I 41/a c d :2' symbol old '' symbol laue '-P 4 2' '4/mmm' symbol patt '-I 4 2' '4/mmm' symbol pgrp '-P 4 2' '4/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/8 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 1/8<=z<=5/8 cheshire 0<=x<=1; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/4,x+3/4,z+1/4 symop -x+1/2,-y,z+1/2 symop y+1/4,-x+1/4,z+3/4 symop x,-y,-z+1/2 symop y+1/4,x+3/4,-z+3/4 symop -x+1/2,y,-z symop -y+1/4,-x+1/4,-z+1/4 symop -x,-y,-z symop y+3/4,-x+1/4,-z+3/4 symop x+1/2,y,-z+1/2 symop -y+3/4,x+3/4,-z+1/4 symop -x,y,z+1/2 symop -y+3/4,-x+1/4,z+1/4 symop x+1/2,-y,z symop y+3/4,x+3/4,z+3/4 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 143 basisop x,y,z symbol ccp4 143 symbol Hall ' P 3' symbol xHM 'P 3' symbol old 'P 3' symbol laue '-P 3' '-3' symbol patt '-P 3' '-3' symbol pgrp ' P 3' '3' hklasu ccp4 '(h>=0 and k>0) or (h=0 and k=0 and l>=0)' mapasu ccp4 0<=x<=2/3; 0<=y<=2/3; 0<=z<1 mapasu zero 0<=x<=2/3; 0<=y<=2/3; 0<=z<1 mapasu nonz 0<=x<=2/3; 0<=y<=2/3; 0<=z<1 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=0 symop x,y,z symop -y,x-y,z symop -x+y,-x,z cenop x,y,z end_spacegroup begin_spacegroup number 144 basisop x,y,z symbol ccp4 144 symbol Hall ' P 31' symbol xHM 'P 31' symbol old 'P 31' symbol laue '-P 3' '-3' symbol patt '-P 3' '-3' symbol pgrp ' P 3' '3' hklasu ccp4 '(h>=0 and k>0) or (h=0 and k=0 and l>=0)' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<1/3 mapasu zero 0<=x<1; 0<=y<1; 0<=z<1/3 mapasu nonz 0<=x<1; 0<=y<1; 0<=z<1/3 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=0 symop x,y,z symop -y,x-y,z+1/3 symop -x+y,-x,z+2/3 cenop x,y,z end_spacegroup begin_spacegroup number 145 basisop x,y,z symbol ccp4 145 symbol Hall ' P 32' symbol xHM 'P 32' symbol old 'P 32' symbol laue '-P 3' '-3' symbol patt '-P 3' '-3' symbol pgrp ' P 3' '3' hklasu ccp4 '(h>=0 and k>0) or (h=0 and k=0 and l>=0)' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<1/3 mapasu zero 0<=x<1; 0<=y<1; 0<=z<1/3 mapasu nonz 0<=x<1; 0<=y<1; 0<=z<1/3 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=0 symop x,y,z symop -y,x-y,z+2/3 symop -x+y,-x,z+1/3 cenop x,y,z end_spacegroup begin_spacegroup number 146 basisop x,y,z symbol ccp4 146 symbol Hall ' R 3' symbol xHM 'R 3 :H' symbol old 'H 3' symbol laue '-P 3' '-3' symbol patt '-R 3' '-3' symbol pgrp ' P 3' '3' hklasu ccp4 '(h>=0 and k>0) or (h=0 and k=0 and l>=0)' mapasu ccp4 0<=x<=2/3; 0<=y<=2/3; 0<=z<1/3 mapasu zero 0<=x<=1/3; 0<=y<=1/3; 0<=z<1 mapasu nonz 0<=x<=1/3; 0<=y<=1/3; 0<=z<1 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=0 symop x,y,z symop -y,x-y,z symop -x+y,-x,z cenop x,y,z cenop x+2/3,y+1/3,z+1/3 cenop x+1/3,y+2/3,z+2/3 end_spacegroup begin_spacegroup number 146 basisop -y+z,x+z,-x+y+z symbol ccp4 1146 symbol Hall ' R 3 (-y+z,x+z,-x+y+z)' symbol xHM 'R 3 :R' symbol old 'R 3' symbol laue '-P 3*' '-3' symbol patt '-P 3*' '-3' symbol pgrp ' P 3*' '3' hklasu ccp4 '(h>=0 and k>0) or (h=0 and k=0 and l>=0)' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<1; 0<=z<1 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=0 symop x,y,z symop z,x,y symop y,z,x cenop x,y,z end_spacegroup begin_spacegroup number 147 basisop x,y,z symbol ccp4 147 symbol Hall '-P 3' symbol xHM 'P -3' symbol old 'P -3' symbol laue '-P 3' '-3' symbol patt '-P 3' '-3' symbol pgrp '-P 3' '-3' hklasu ccp4 '(h>=0 and k>0) or (h=0 and k=0 and l>=0)' mapasu ccp4 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<1 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop -y,x-y,z symop -x+y,-x,z symop -x,-y,-z symop y,-x+y,-z symop x-y,x,-z cenop x,y,z end_spacegroup begin_spacegroup number 148 basisop x,y,z symbol ccp4 148 symbol Hall '-R 3' symbol xHM 'R -3 :H' symbol old 'H -3' symbol laue '-P 3' '-3' symbol patt '-R 3' '-3' symbol pgrp '-P 3' '-3' hklasu ccp4 '(h>=0 and k>0) or (h=0 and k=0 and l>=0)' mapasu ccp4 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/6 mapasu zero 0<=x<=1/3; 0<=y<=1/3; 0<=z<=1/2 mapasu nonz 0<=x<=1/3; -1/6<=y<=0; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop -y,x-y,z symop -x+y,-x,z symop -x,-y,-z symop y,-x+y,-z symop x-y,x,-z cenop x,y,z cenop x+2/3,y+1/3,z+1/3 cenop x+1/3,y+2/3,z+2/3 end_spacegroup begin_spacegroup number 148 basisop -y+z,x+z,-x+y+z symbol ccp4 1148 symbol Hall '-R 3 (-y+z,x+z,-x+y+z)' symbol xHM 'R -3 :R' symbol old 'R -3' symbol laue '-P 3*' '-3' symbol patt '-P 3*' '-3' symbol pgrp '-P 3*' '-3' hklasu ccp4 '(h>=0 and k>0) or (h=0 and k=0 and l>=0)' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop z,x,y symop y,z,x symop -x,-y,-z symop -z,-x,-y symop -y,-z,-x cenop x,y,z end_spacegroup begin_spacegroup number 149 basisop x,y,z symbol ccp4 149 symbol Hall ' P 3 2' symbol xHM 'P 3 1 2' symbol old 'P 3 1 2' symbol laue '-P 3 2' '-31m' symbol patt '-P 3 2' '-31m' symbol pgrp ' P 3 2' '312' hklasu ccp4 'h>=k and k>=0 and (k>0 or l>=0)' mapasu ccp4 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 mapasu zero 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 mapasu nonz 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 symop x,y,z symop -y,x-y,z symop -x+y,-x,z symop -y,-x,-z symop x,x-y,-z symop -x+y,y,-z cenop x,y,z end_spacegroup begin_spacegroup number 150 basisop x,y,z symbol ccp4 150 symbol Hall ' P 3 2"' symbol xHM 'P 3 2 1' symbol old 'P 3 2 1' symbol laue '-P 3 2"' '-3m1' symbol patt '-P 3 2"' '-3m1' symbol pgrp ' P 3 2"' '321' hklasu ccp4 'h>=k and k>=0 and (h>k or l>=0)' mapasu ccp4 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<1 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop -y,x-y,z symop -x+y,-x,z symop y,x,-z symop -x,-x+y,-z symop x-y,-y,-z cenop x,y,z end_spacegroup begin_spacegroup number 151 basisop x,y,z symbol ccp4 151 symbol Hall ' P 31 2 (x,y,z+1/3)' symbol xHM 'P 31 1 2' symbol old 'P 31 1 2' symbol laue '-P 3 2' '-31m' symbol patt '-P 3 2' '-31m' symbol pgrp ' P 3 2' '312' hklasu ccp4 'h>=k and k>=0 and (k>0 or l>=0)' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/6 mapasu zero 0<=x<1; 0<=y<1; 0<=z<=1/6 mapasu nonz 0<=x<1; 0<=y<1; 0<=z<=1/6 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 symop x,y,z symop -y,x-y,z+1/3 symop -x+y,-x,z+2/3 symop -y,-x,-z+2/3 symop x,x-y,-z symop -x+y,y,-z+1/3 cenop x,y,z end_spacegroup begin_spacegroup number 152 basisop x,y,z symbol ccp4 152 symbol Hall ' P 31 2"' symbol xHM 'P 31 2 1' symbol old 'P 31 2 1' symbol laue '-P 3 2"' '-3m1' symbol patt '-P 3 2"' '-3m1' symbol pgrp ' P 3 2"' '321' hklasu ccp4 'h>=k and k>=0 and (h>k or l>=0)' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/6 mapasu zero 0<=x<=1/2; 0<=y<1; 0<=z<=1/3 mapasu nonz 0<=x<=1/2; 0<=y<1; 0<=z<=1/3 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop -y,x-y,z+1/3 symop -x+y,-x,z+2/3 symop y,x,-z symop -x,-x+y,-z+1/3 symop x-y,-y,-z+2/3 cenop x,y,z end_spacegroup begin_spacegroup number 153 basisop x,y,z symbol ccp4 153 symbol Hall ' P 32 2 (x,y,z+1/6)' symbol xHM 'P 32 1 2' symbol old 'P 32 1 2' symbol laue '-P 3 2' '-31m' symbol patt '-P 3 2' '-31m' symbol pgrp ' P 3 2' '312' hklasu ccp4 'h>=k and k>=0 and (k>0 or l>=0)' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/6 mapasu zero 0<=x<1; 0<=y<1; 0<=z<=1/6 mapasu nonz 0<=x<1; 0<=y<1; 0<=z<=1/6 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 symop x,y,z symop -y,x-y,z+2/3 symop -x+y,-x,z+1/3 symop -y,-x,-z+1/3 symop x,x-y,-z symop -x+y,y,-z+2/3 cenop x,y,z end_spacegroup begin_spacegroup number 154 basisop x,y,z symbol ccp4 154 symbol Hall ' P 32 2"' symbol xHM 'P 32 2 1' symbol old 'P 32 2 1' symbol laue '-P 3 2"' '-3m1' symbol patt '-P 3 2"' '-3m1' symbol pgrp ' P 3 2"' '321' hklasu ccp4 'h>=k and k>=0 and (h>k or l>=0)' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/6 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<=1/3 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<=1/3 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop -y,x-y,z+2/3 symop -x+y,-x,z+1/3 symop y,x,-z symop -x,-x+y,-z+2/3 symop x-y,-y,-z+1/3 cenop x,y,z end_spacegroup begin_spacegroup number 155 basisop x,y,z symbol ccp4 155 symbol Hall ' R 3 2"' symbol xHM 'R 3 2 :H' symbol old 'H 3 2' symbol laue '-P 3 2"' '-3m1' symbol patt '-R 3 2"' '-3m' symbol pgrp ' P 3 2"' '321' hklasu ccp4 'h>=k and k>=0 and (h>k or l>=0)' mapasu ccp4 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/6 mapasu zero 0<=x<=1/3; 0<=y<=1/3; 0<=z<=1/2 mapasu nonz 0<=x<=1/3; 0<=y<=1/3; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop -y,x-y,z symop -x+y,-x,z symop y,x,-z symop -x,-x+y,-z symop x-y,-y,-z cenop x,y,z cenop x+2/3,y+1/3,z+1/3 cenop x+1/3,y+2/3,z+2/3 end_spacegroup begin_spacegroup number 155 basisop -y+z,x+z,-x+y+z symbol ccp4 1155 symbol Hall ' R 3 2" (-y+z,x+z,-x+y+z)' symbol xHM 'R 3 2 :R' symbol old 'R 3 2' symbol laue '-P 3* 2' '-3m' symbol patt '-P 3* 2' '-3m' symbol pgrp ' P 3* 2' '32' hklasu ccp4 'h>=k and k>=0 and (h>k or l>=0)' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop z,x,y symop y,z,x symop -y,-x,-z symop -z,-y,-x symop -x,-z,-y cenop x,y,z end_spacegroup begin_spacegroup number 156 basisop x,y,z symbol ccp4 156 symbol Hall ' P 3 -2"' symbol xHM 'P 3 m 1' symbol old 'P 3 m 1' symbol laue '-P 3 2"' '-3m1' symbol patt '-P 3 2"' '-3m1' symbol pgrp ' P 3 -2"' '3m1' hklasu ccp4 'h>=k and k>=0 and (h>k or l>=0)' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=2/3; 0<=z<1 mapasu nonz 0<=x<=2/3; 0<=y<=2/3; 0<=z<1 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=0 symop x,y,z symop -y,x-y,z symop -x+y,-x,z symop -y,-x,z symop x,x-y,z symop -x+y,y,z cenop x,y,z end_spacegroup begin_spacegroup number 157 basisop x,y,z symbol ccp4 157 symbol Hall ' P 3 -2' symbol xHM 'P 3 1 m' symbol old 'P 3 1 m' symbol laue '-P 3 2' '-31m' symbol patt '-P 3 2' '-31m' symbol pgrp ' P 3 -2' '31m' hklasu ccp4 'h>=k and k>=0 and (k>0 or l>=0)' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<1 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=0 symop x,y,z symop -y,x-y,z symop -x+y,-x,z symop y,x,z symop -x,-x+y,z symop x-y,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 158 basisop x,y,z symbol ccp4 158 symbol Hall ' P 3 -2"c' symbol xHM 'P 3 c 1' symbol old 'P 3 c 1' symbol laue '-P 3 2"' '-3m1' symbol patt '-P 3 2"' '-3m1' symbol pgrp ' P 3 -2"' '3m1' hklasu ccp4 'h>=k and k>=0 and (h>k or l>=0)' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=2/3; 0<=z<1/2 mapasu nonz 0<=x<=2/3; 0<=y<=2/3; 0<=z<1/2 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=0 symop x,y,z symop -y,x-y,z symop -x+y,-x,z symop -y,-x,z+1/2 symop x,x-y,z+1/2 symop -x+y,y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 159 basisop x,y,z symbol ccp4 159 symbol Hall ' P 3 -2c' symbol xHM 'P 3 1 c' symbol old 'P 3 1 c' symbol laue '-P 3 2' '-31m' symbol patt '-P 3 2' '-31m' symbol pgrp ' P 3 -2' '31m' hklasu ccp4 'h>=k and k>=0 and (k>0 or l>=0)' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<1 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=0 symop x,y,z symop -y,x-y,z symop -x+y,-x,z symop y,x,z+1/2 symop -x,-x+y,z+1/2 symop x-y,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 160 basisop x,y,z symbol ccp4 160 symbol Hall ' R 3 -2"' symbol xHM 'R 3 m :H' symbol old 'H 3 m' symbol laue '-P 3 2"' '-3m1' symbol patt '-R 3 2"' '-3m' symbol pgrp ' P 3 -2"' '3m1' hklasu ccp4 'h>=k and k>=0 and (h>k or l>=0)' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/3; 0<=y<1/3; 0<=z<1 mapasu nonz 0<=x<=5/12; 0<=y<1/4; 0<=z<1 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=0 symop x,y,z symop -y,x-y,z symop -x+y,-x,z symop -y,-x,z symop x,x-y,z symop -x+y,y,z cenop x,y,z cenop x+2/3,y+1/3,z+1/3 cenop x+1/3,y+2/3,z+2/3 end_spacegroup begin_spacegroup number 160 basisop -y+z,x+z,-x+y+z symbol ccp4 1160 symbol Hall ' R 3 -2" (-y+z,x+z,-x+y+z)' symbol xHM 'R 3 m :R' symbol old 'R 3 m' symbol laue '-P 3* 2' '-3m' symbol patt '-P 3* 2' '-3m' symbol pgrp ' P 3* -2' '3m' hklasu ccp4 'h>=k and k>=0 and (h>k or l>=0)' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<1; 0<=z<1 mapasu nonz 0<=x<1; 0<=y<1; 0<=z<1 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=0 symop x,y,z symop z,x,y symop y,z,x symop y,x,z symop z,y,x symop x,z,y cenop x,y,z end_spacegroup begin_spacegroup number 161 basisop x,y,z symbol ccp4 161 symbol Hall ' R 3 -2"c' symbol xHM 'R 3 c :H' symbol old 'H 3 c' symbol laue '-P 3 2"' '-3m1' symbol patt '-R 3 2"' '-3m' symbol pgrp ' P 3 -2"' '3m1' hklasu ccp4 'h>=k and k>=0 and (h>k or l>=0)' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/3; 0<=y<1/3; 0<=z<1/2 mapasu nonz 0<=x<=1/3; 0<=y<1/3; 0<=z<1/2 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=0 symop x,y,z symop -y,x-y,z symop -x+y,-x,z symop -y,-x,z+1/2 symop x,x-y,z+1/2 symop -x+y,y,z+1/2 cenop x,y,z cenop x+2/3,y+1/3,z+1/3 cenop x+1/3,y+2/3,z+2/3 end_spacegroup begin_spacegroup number 161 basisop -y+z,x+z,-x+y+z symbol ccp4 1161 symbol Hall ' R 3 -2"c (-y+z,x+z,-x+y+z)' symbol xHM 'R 3 c :R' symbol old 'R 3 c' symbol laue '-P 3* 2' '-3m' symbol patt '-P 3* 2' '-3m' symbol pgrp ' P 3* -2' '3m' hklasu ccp4 'h>=k and k>=0 and (h>k or l>=0)' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<1/2; 0<=z<1 mapasu nonz 0<=x<1/2; 0<=y<1/2; 0<=z<1 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=0 symop x,y,z symop z,x,y symop y,z,x symop y+1/2,x+1/2,z+1/2 symop z+1/2,y+1/2,x+1/2 symop x+1/2,z+1/2,y+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 162 basisop x,y,z symbol ccp4 162 symbol Hall '-P 3 2' symbol xHM 'P -3 1 m' symbol old 'P -3 1 2/m' 'P -3 1 m' symbol laue '-P 3 2' '-31m' symbol patt '-P 3 2' '-31m' symbol pgrp '-P 3 2' '-31m' hklasu ccp4 'h>=k and k>=0 and (k>0 or l>=0)' mapasu ccp4 0<=x<=2/3; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<=1/2 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop -y,x-y,z symop -x+y,-x,z symop -y,-x,-z symop x,x-y,-z symop -x+y,y,-z symop -x,-y,-z symop y,-x+y,-z symop x-y,x,-z symop y,x,z symop -x,-x+y,z symop x-y,-y,z cenop x,y,z end_spacegroup begin_spacegroup number 163 basisop x,y,z symbol ccp4 163 symbol Hall '-P 3 2c' symbol xHM 'P -3 1 c' symbol old 'P -3 1 2/c' 'P -3 1 c' symbol laue '-P 3 2' '-31m' symbol patt '-P 3 2' '-31m' symbol pgrp '-P 3 2' '-31m' hklasu ccp4 'h>=k and k>=0 and (k>0 or l>=0)' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=2/3; 0<=z<1/3 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 1/4<=z<=3/4 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop -y,x-y,z symop -x+y,-x,z symop -y,-x,-z+1/2 symop x,x-y,-z+1/2 symop -x+y,y,-z+1/2 symop -x,-y,-z symop y,-x+y,-z symop x-y,x,-z symop y,x,z+1/2 symop -x,-x+y,z+1/2 symop x-y,-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 164 basisop x,y,z symbol ccp4 164 symbol Hall '-P 3 2"' symbol xHM 'P -3 m 1' symbol old 'P -3 2/m 1' 'P -3 m 1' symbol laue '-P 3 2"' '-3m1' symbol patt '-P 3 2"' '-3m1' symbol pgrp '-P 3 2"' '-3m1' hklasu ccp4 'h>=k and k>=0 and (h>k or l>=0)' mapasu ccp4 0<=x<=2/3; 0<=y<=1/3; 0<=z<=1 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<1 mapasu nonz 0<=x<=1/2; -1/3<=y<=0; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop -y,x-y,z symop -x+y,-x,z symop y,x,-z symop -x,-x+y,-z symop x-y,-y,-z symop -x,-y,-z symop y,-x+y,-z symop x-y,x,-z symop -y,-x,z symop x,x-y,z symop -x+y,y,z cenop x,y,z end_spacegroup begin_spacegroup number 165 basisop x,y,z symbol ccp4 165 symbol Hall '-P 3 2"c' symbol xHM 'P -3 c 1' symbol old 'P -3 2/c 1' 'P -3 c 1' symbol laue '-P 3 2"' '-3m1' symbol patt '-P 3 2"' '-3m1' symbol pgrp '-P 3 2"' '-3m1' hklasu ccp4 'h>=k and k>=0 and (h>k or l>=0)' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<1/2 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 0<=z<1/2 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop -y,x-y,z symop -x+y,-x,z symop y,x,-z+1/2 symop -x,-x+y,-z+1/2 symop x-y,-y,-z+1/2 symop -x,-y,-z symop y,-x+y,-z symop x-y,x,-z symop -y,-x,z+1/2 symop x,x-y,z+1/2 symop -x+y,y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 166 basisop x,y,z symbol ccp4 166 symbol Hall '-R 3 2"' symbol xHM 'R -3 m :H' symbol old 'H -3 2/m' 'H -3 m' symbol laue '-P 3 2"' '-3m1' symbol patt '-R 3 2"' '-3m' symbol pgrp '-P 3 2"' '-3m1' hklasu ccp4 'h>=k and k>=0 and (h>k or l>=0)' mapasu ccp4 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/6 mapasu zero 0<=x<=1/3; 0<=y<=1/6; 0<=z<1 mapasu nonz 0<=x<=1/3; 0<=y<=1/6; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop -y,x-y,z symop -x+y,-x,z symop y,x,-z symop -x,-x+y,-z symop x-y,-y,-z symop -x,-y,-z symop y,-x+y,-z symop x-y,x,-z symop -y,-x,z symop x,x-y,z symop -x+y,y,z cenop x,y,z cenop x+2/3,y+1/3,z+1/3 cenop x+1/3,y+2/3,z+2/3 end_spacegroup begin_spacegroup number 166 basisop -y+z,x+z,-x+y+z symbol ccp4 1166 symbol Hall '-R 3 2" (-y+z,x+z,-x+y+z)' symbol xHM 'R -3 m :R' symbol old 'R -3 2/m' 'R -3 m' symbol laue '-P 3* 2' '-3m' symbol patt '-P 3* 2' '-3m' symbol pgrp '-P 3* 2' '-3m' hklasu ccp4 'h>=k and k>=0 and (h>k or l>=0)' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop z,x,y symop y,z,x symop -y,-x,-z symop -z,-y,-x symop -x,-z,-y symop -x,-y,-z symop -z,-x,-y symop -y,-z,-x symop y,x,z symop z,y,x symop x,z,y cenop x,y,z end_spacegroup begin_spacegroup number 167 basisop x,y,z symbol ccp4 167 symbol Hall '-R 3 2"c' symbol xHM 'R -3 c :H' symbol old 'H -3 2/c' 'H -3 c' symbol laue '-P 3 2"' '-3m1' symbol patt '-R 3 2"' '-3m' symbol pgrp '-P 3 2"' '-3m1' hklasu ccp4 'h>=k and k>=0 and (h>k or l>=0)' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=1/6; 0<=z<=1/3 mapasu nonz 0<=x<=1/3; -1/6<=y<=0; 1/12<=z<=7/12 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop -y,x-y,z symop -x+y,-x,z symop y,x,-z+1/2 symop -x,-x+y,-z+1/2 symop x-y,-y,-z+1/2 symop -x,-y,-z symop y,-x+y,-z symop x-y,x,-z symop -y,-x,z+1/2 symop x,x-y,z+1/2 symop -x+y,y,z+1/2 cenop x,y,z cenop x+2/3,y+1/3,z+1/3 cenop x+1/3,y+2/3,z+2/3 end_spacegroup begin_spacegroup number 167 basisop -y+z,x+z,-x+y+z symbol ccp4 1167 symbol Hall '-R 3 2"c (-y+z,x+z,-x+y+z)' symbol xHM 'R -3 c :R' symbol old 'R -3 2/c' 'R -3 c' symbol laue '-P 3* 2' '-3m' symbol patt '-P 3* 2' '-3m' symbol pgrp '-P 3* 2' '-3m' hklasu ccp4 'h>=k and k>=0 and (h>k or l>=0)' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; -1/4<=y<=1/4; 0<=z<3/4 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop z,x,y symop y,z,x symop -y+1/2,-x+1/2,-z+1/2 symop -z+1/2,-y+1/2,-x+1/2 symop -x+1/2,-z+1/2,-y+1/2 symop -x,-y,-z symop -z,-x,-y symop -y,-z,-x symop y+1/2,x+1/2,z+1/2 symop z+1/2,y+1/2,x+1/2 symop x+1/2,z+1/2,y+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 168 basisop x,y,z symbol ccp4 168 symbol Hall ' P 6' symbol xHM 'P 6' symbol old 'P 6' symbol laue '-P 6' '6/m' symbol patt '-P 6' '6/m' symbol pgrp ' P 6' '6' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<=2/3; 0<=y<=1/2; 0<=z<1 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<1 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=0 symop x,y,z symop x-y,x,z symop -y,x-y,z symop -x,-y,z symop -x+y,-x,z symop y,-x+y,z cenop x,y,z end_spacegroup begin_spacegroup number 169 basisop x,y,z symbol ccp4 169 symbol Hall ' P 61' symbol xHM 'P 61' symbol old 'P 61' symbol laue '-P 6' '6/m' symbol patt '-P 6' '6/m' symbol pgrp ' P 6' '6' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<1/6 mapasu zero 0<=x<1; 0<=y<1; 0<=z<1/6 mapasu nonz 0<=x<1; 0<=y<1; 0<=z<1/6 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=0 symop x,y,z symop x-y,x,z+1/6 symop -y,x-y,z+1/3 symop -x,-y,z+1/2 symop -x+y,-x,z+2/3 symop y,-x+y,z+5/6 cenop x,y,z end_spacegroup begin_spacegroup number 170 basisop x,y,z symbol ccp4 170 symbol Hall ' P 65' symbol xHM 'P 65' symbol old 'P 65' symbol laue '-P 6' '6/m' symbol patt '-P 6' '6/m' symbol pgrp ' P 6' '6' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<1/6 mapasu zero 0<=x<1; 0<=y<1; 0<=z<1/6 mapasu nonz 0<=x<1; 0<=y<1; 0<=z<1/6 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=0 symop x,y,z symop x-y,x,z+5/6 symop -y,x-y,z+2/3 symop -x,-y,z+1/2 symop -x+y,-x,z+1/3 symop y,-x+y,z+1/6 cenop x,y,z end_spacegroup begin_spacegroup number 171 basisop x,y,z symbol ccp4 171 symbol Hall ' P 62' symbol xHM 'P 62' symbol old 'P 62' symbol laue '-P 6' '6/m' symbol patt '-P 6' '6/m' symbol pgrp ' P 6' '6' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<1/3 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<1/3 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<1/3 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=0 symop x,y,z symop x-y,x,z+1/3 symop -y,x-y,z+2/3 symop -x,-y,z symop -x+y,-x,z+1/3 symop y,-x+y,z+2/3 cenop x,y,z end_spacegroup begin_spacegroup number 172 basisop x,y,z symbol ccp4 172 symbol Hall ' P 64' symbol xHM 'P 64' symbol old 'P 64' symbol laue '-P 6' '6/m' symbol patt '-P 6' '6/m' symbol pgrp ' P 6' '6' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<1/3 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<1/3 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<1/3 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=0 symop x,y,z symop x-y,x,z+2/3 symop -y,x-y,z+1/3 symop -x,-y,z symop -x+y,-x,z+2/3 symop y,-x+y,z+1/3 cenop x,y,z end_spacegroup begin_spacegroup number 173 basisop x,y,z symbol ccp4 173 symbol Hall ' P 6c' symbol xHM 'P 63' symbol old 'P 63' symbol laue '-P 6' '6/m' symbol patt '-P 6' '6/m' symbol pgrp ' P 6' '6' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<=2/3; 0<=y<=2/3; 0<=z<1/2 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<1 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=0 symop x,y,z symop x-y,x,z+1/2 symop -y,x-y,z symop -x,-y,z+1/2 symop -x+y,-x,z symop y,-x+y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 174 basisop x,y,z symbol ccp4 174 symbol Hall ' P -6' symbol xHM 'P -6' symbol old 'P -6' symbol laue '-P 6' '6/m' symbol patt '-P 6' '6/m' symbol pgrp ' P -6' '-6' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 mapasu nonz 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 symop x,y,z symop -x+y,-x,-z symop -y,x-y,z symop x,y,-z symop -x+y,-x,z symop -y,x-y,-z cenop x,y,z end_spacegroup begin_spacegroup number 175 basisop x,y,z symbol ccp4 175 symbol Hall '-P 6' symbol xHM 'P 6/m' symbol old 'P 6/m' symbol laue '-P 6' '6/m' symbol patt '-P 6' '6/m' symbol pgrp '-P 6' '6/m' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<=1/2 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop x-y,x,z symop -y,x-y,z symop -x,-y,z symop -x+y,-x,z symop y,-x+y,z symop -x,-y,-z symop -x+y,-x,-z symop y,-x+y,-z symop x,y,-z symop x-y,x,-z symop -y,x-y,-z cenop x,y,z end_spacegroup begin_spacegroup number 176 basisop x,y,z symbol ccp4 176 symbol Hall '-P 6c' symbol xHM 'P 63/m' symbol old 'P 63/m' symbol laue '-P 6' '6/m' symbol patt '-P 6' '6/m' symbol pgrp '-P 6' '6/m' hklasu ccp4 'l>=0 and ((h>=0 and k>0) or (h=0 and k=0))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=2/3; 0<=z<1/3 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 1/4<=z<=3/4 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop x-y,x,z+1/2 symop -y,x-y,z symop -x,-y,z+1/2 symop -x+y,-x,z symop y,-x+y,z+1/2 symop -x,-y,-z symop -x+y,-x,-z+1/2 symop y,-x+y,-z symop x,y,-z+1/2 symop x-y,x,-z symop -y,x-y,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 177 basisop x,y,z symbol ccp4 177 symbol Hall ' P 6 2' symbol xHM 'P 6 2 2' symbol old 'P 6 2 2' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp ' P 6 2' '622' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<=2/3; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<=1/2 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop x-y,x,z symop -y,x-y,z symop -x,-y,z symop -x+y,-x,z symop y,-x+y,z symop -y,-x,-z symop x-y,-y,-z symop x,x-y,-z symop y,x,-z symop -x+y,y,-z symop -x,-x+y,-z cenop x,y,z end_spacegroup begin_spacegroup number 178 basisop x,y,z symbol ccp4 178 symbol Hall ' P 61 2 (x,y,z+5/12)' symbol xHM 'P 61 2 2' symbol old 'P 61 2 2' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp ' P 6 2' '622' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/12 mapasu zero 0<=x<1; 0<=y<1; 0<=z<1/6 mapasu nonz 0<=x<1; 0<=y<=1/2; -1/12<=z<=1/12 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop x-y,x,z+1/6 symop -y,x-y,z+1/3 symop -x,-y,z+1/2 symop -x+y,-x,z+2/3 symop y,-x+y,z+5/6 symop -y,-x,-z+5/6 symop x-y,-y,-z symop x,x-y,-z+1/6 symop y,x,-z+1/3 symop -x+y,y,-z+1/2 symop -x,-x+y,-z+2/3 cenop x,y,z end_spacegroup begin_spacegroup number 179 basisop x,y,z symbol ccp4 179 symbol Hall ' P 65 2 (x,y,z+1/12)' symbol xHM 'P 65 2 2' symbol old 'P 65 2 2' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp ' P 6 2' '622' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/12 mapasu zero 0<=x<=1/2; 0<=y<1; 0<=z<1/3 mapasu nonz 0<=x<=1/2; 0<=y<1; 1/12<=z<=1/4 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop x-y,x,z+5/6 symop -y,x-y,z+2/3 symop -x,-y,z+1/2 symop -x+y,-x,z+1/3 symop y,-x+y,z+1/6 symop -y,-x,-z+1/6 symop x-y,-y,-z symop x,x-y,-z+5/6 symop y,x,-z+2/3 symop -x+y,y,-z+1/2 symop -x,-x+y,-z+1/3 cenop x,y,z end_spacegroup begin_spacegroup number 180 basisop x,y,z symbol ccp4 180 symbol Hall ' P 62 2 (x,y,z+1/3)' symbol xHM 'P 62 2 2' symbol old 'P 62 2 2' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp ' P 6 2' '622' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/6 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<=1/6 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<=1/6 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop x-y,x,z+1/3 symop -y,x-y,z+2/3 symop -x,-y,z symop -x+y,-x,z+1/3 symop y,-x+y,z+2/3 symop -y,-x,-z+2/3 symop x-y,-y,-z symop x,x-y,-z+1/3 symop y,x,-z+2/3 symop -x+y,y,-z symop -x,-x+y,-z+1/3 cenop x,y,z end_spacegroup begin_spacegroup number 181 basisop x,y,z symbol ccp4 181 symbol Hall ' P 64 2 (x,y,z+1/6)' symbol xHM 'P 64 2 2' symbol old 'P 64 2 2' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp ' P 6 2' '622' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/6 mapasu zero 0<=x<1; 0<=y<=1/2; 0<=z<=1/6 mapasu nonz 0<=x<1; 0<=y<=1/2; 0<=z<=1/6 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop x-y,x,z+2/3 symop -y,x-y,z+1/3 symop -x,-y,z symop -x+y,-x,z+2/3 symop y,-x+y,z+1/3 symop -y,-x,-z+1/3 symop x-y,-y,-z symop x,x-y,-z+2/3 symop y,x,-z+1/3 symop -x+y,y,-z symop -x,-x+y,-z+2/3 cenop x,y,z end_spacegroup begin_spacegroup number 182 basisop x,y,z symbol ccp4 182 symbol Hall ' P 6c 2c' symbol xHM 'P 63 2 2' symbol old 'P 63 2 2' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp ' P 6 2' '622' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/4 mapasu zero 0<=x<=2/3; 0<=y<=2/3; 0<=z<1/3 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 1/4<=z<=3/4 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1/2 symop x,y,z symop x-y,x,z+1/2 symop -y,x-y,z symop -x,-y,z+1/2 symop -x+y,-x,z symop y,-x+y,z+1/2 symop -y,-x,-z+1/2 symop x-y,-y,-z symop x,x-y,-z+1/2 symop y,x,-z symop -x+y,y,-z+1/2 symop -x,-x+y,-z cenop x,y,z end_spacegroup begin_spacegroup number 183 basisop x,y,z symbol ccp4 183 symbol Hall ' P 6 -2' symbol xHM 'P 6 m m' symbol old 'P 6 m m' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp ' P 6 -2' '6mm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<1 mapasu nonz 0<=x<=1/2; -1/3<=y<=0; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=0 symop x,y,z symop x-y,x,z symop -y,x-y,z symop -x,-y,z symop -x+y,-x,z symop y,-x+y,z symop y,x,z symop -x+y,y,z symop -x,-x+y,z symop -y,-x,z symop x-y,-y,z symop x,x-y,z cenop x,y,z end_spacegroup begin_spacegroup number 184 basisop x,y,z symbol ccp4 184 symbol Hall ' P 6 -2c' symbol xHM 'P 6 c c' symbol old 'P 6 c c' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp ' P 6 -2' '6mm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<1/2 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 0<=z<1/2 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=0 symop x,y,z symop x-y,x,z symop -y,x-y,z symop -x,-y,z symop -x+y,-x,z symop y,-x+y,z symop y,x,z+1/2 symop -x+y,y,z+1/2 symop -x,-x+y,z+1/2 symop -y,-x,z+1/2 symop x-y,-y,z+1/2 symop x,x-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 185 basisop x,y,z symbol ccp4 185 symbol Hall ' P 6c -2' symbol xHM 'P 63 c m' symbol old 'P 63 c m' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp ' P 6 -2' '6mm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<1/2 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 0<=z<1/2 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=0 symop x,y,z symop x-y,x,z+1/2 symop -y,x-y,z symop -x,-y,z+1/2 symop -x+y,-x,z symop y,-x+y,z+1/2 symop y,x,z symop -x+y,y,z+1/2 symop -x,-x+y,z symop -y,-x,z+1/2 symop x-y,-y,z symop x,x-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 186 basisop x,y,z symbol ccp4 186 symbol Hall ' P 6c -2c' symbol xHM 'P 63 m c' symbol old 'P 63 m c' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp ' P 6 -2' '6mm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<1 mapasu nonz 0<=x<=1/2; -1/3<=y<=0; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=0 symop x,y,z symop x-y,x,z+1/2 symop -y,x-y,z symop -x,-y,z+1/2 symop -x+y,-x,z symop y,-x+y,z+1/2 symop y,x,z+1/2 symop -x+y,y,z symop -x,-x+y,z+1/2 symop -y,-x,z symop x-y,-y,z+1/2 symop x,x-y,z cenop x,y,z end_spacegroup begin_spacegroup number 187 basisop x,y,z symbol ccp4 187 symbol Hall ' P -6 2' symbol xHM 'P -6 m 2' symbol old 'P -6 m 2' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp ' P -6 2' '-62m' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 mapasu nonz 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 symop x,y,z symop -x+y,-x,-z symop -y,x-y,z symop x,y,-z symop -x+y,-x,z symop -y,x-y,-z symop -y,-x,-z symop -x+y,y,z symop x,x-y,-z symop -y,-x,z symop -x+y,y,-z symop x,x-y,z cenop x,y,z end_spacegroup begin_spacegroup number 188 basisop x,y,z symbol ccp4 188 symbol Hall ' P -6c 2' symbol xHM 'P -6 c 2' symbol old 'P -6 c 2' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp ' P -6 2' '-62m' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=2/3; 0<=z<1/3 mapasu nonz 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/4 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 symop x,y,z symop -x+y,-x,-z+1/2 symop -y,x-y,z symop x,y,-z+1/2 symop -x+y,-x,z symop -y,x-y,-z+1/2 symop -y,-x,-z symop -x+y,y,z+1/2 symop x,x-y,-z symop -y,-x,z+1/2 symop -x+y,y,-z symop x,x-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 189 basisop x,y,z symbol ccp4 189 symbol Hall ' P -6 -2' symbol xHM 'P -6 2 m' symbol old 'P -6 2 m' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp ' P -6 -2' '-6m2' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<=1/2 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 0<=z<=1/2 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 symop x,y,z symop -x+y,-x,-z symop -y,x-y,z symop x,y,-z symop -x+y,-x,z symop -y,x-y,-z symop y,x,z symop x-y,-y,-z symop -x,-x+y,z symop y,x,-z symop x-y,-y,z symop -x,-x+y,-z cenop x,y,z end_spacegroup begin_spacegroup number 190 basisop x,y,z symbol ccp4 190 symbol Hall ' P -6c -2c' symbol xHM 'P -6 2 c' symbol old 'P -6 2 c' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp ' P -6 -2' '-6m2' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=2/3; 0<=z<1/3 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 1/4<=z<=3/4 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 symop x,y,z symop -x+y,-x,-z+1/2 symop -y,x-y,z symop x,y,-z+1/2 symop -x+y,-x,z symop -y,x-y,-z+1/2 symop y,x,z+1/2 symop x-y,-y,-z symop -x,-x+y,z+1/2 symop y,x,-z symop x-y,-y,z+1/2 symop -x,-x+y,-z cenop x,y,z end_spacegroup begin_spacegroup number 191 basisop x,y,z symbol ccp4 191 symbol Hall '-P 6 2' symbol xHM 'P 6/m m m' symbol old 'P 6/m 2/m 2/m' 'P 6/m m m' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp '-P 6 2' '6/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<=2/3; 0<=y<=1/3; 0<=z<=1/2 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; -1/3<=y<=0; 0<=z<=1/2 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 symop x,y,z symop x-y,x,z symop -y,x-y,z symop -x,-y,z symop -x+y,-x,z symop y,-x+y,z symop -y,-x,-z symop x-y,-y,-z symop x,x-y,-z symop y,x,-z symop -x+y,y,-z symop -x,-x+y,-z symop -x,-y,-z symop -x+y,-x,-z symop y,-x+y,-z symop x,y,-z symop x-y,x,-z symop -y,x-y,-z symop y,x,z symop -x+y,y,z symop -x,-x+y,z symop -y,-x,z symop x-y,-y,z symop x,x-y,z cenop x,y,z end_spacegroup begin_spacegroup number 192 basisop x,y,z symbol ccp4 192 symbol Hall '-P 6 2c' symbol xHM 'P 6/m c c' symbol old 'P 6/m 2/c 2/c' 'P 6/m c c' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp '-P 6 2' '6/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<1/3 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 0<=z<=1/4 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 symop x,y,z symop x-y,x,z symop -y,x-y,z symop -x,-y,z symop -x+y,-x,z symop y,-x+y,z symop -y,-x,-z+1/2 symop x-y,-y,-z+1/2 symop x,x-y,-z+1/2 symop y,x,-z+1/2 symop -x+y,y,-z+1/2 symop -x,-x+y,-z+1/2 symop -x,-y,-z symop -x+y,-x,-z symop y,-x+y,-z symop x,y,-z symop x-y,x,-z symop -y,x-y,-z symop y,x,z+1/2 symop -x+y,y,z+1/2 symop -x,-x+y,z+1/2 symop -y,-x,z+1/2 symop x-y,-y,z+1/2 symop x,x-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 193 basisop x,y,z symbol ccp4 193 symbol Hall '-P 6c 2' symbol xHM 'P 63/m c m' symbol old 'P 63/m 2/c 2/m' 'P 63/m c m' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp '-P 6 2' '6/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=1/3; 0<=z<1/3 mapasu nonz 0<=x<=2/3; 0<=y<=1/3; 0<=z<=1/4 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 symop x,y,z symop x-y,x,z+1/2 symop -y,x-y,z symop -x,-y,z+1/2 symop -x+y,-x,z symop y,-x+y,z+1/2 symop -y,-x,-z symop x-y,-y,-z+1/2 symop x,x-y,-z symop y,x,-z+1/2 symop -x+y,y,-z symop -x,-x+y,-z+1/2 symop -x,-y,-z symop -x+y,-x,-z+1/2 symop y,-x+y,-z symop x,y,-z+1/2 symop x-y,x,-z symop -y,x-y,-z+1/2 symop y,x,z symop -x+y,y,z+1/2 symop -x,-x+y,z symop -y,-x,z+1/2 symop x-y,-y,z symop x,x-y,z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 194 basisop x,y,z symbol ccp4 194 symbol Hall '-P 6c 2c' symbol xHM 'P 63/m m c' symbol old 'P 63/m 2/m 2/c' 'P 63/m m c' symbol laue '-P 6 2' '6/mmm' symbol patt '-P 6 2' '6/mmm' symbol pgrp '-P 6 2' '6/mmm' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=2/3; 0<=y<=2/3; 0<=z<1/3 mapasu nonz 0<=x<=1/2; -1/3<=y<=0; 1/4<=z<=3/4 cheshire 0<=x<=2/3; 0<=y<=2/3; 0<=z<=1/2 symop x,y,z symop x-y,x,z+1/2 symop -y,x-y,z symop -x,-y,z+1/2 symop -x+y,-x,z symop y,-x+y,z+1/2 symop -y,-x,-z+1/2 symop x-y,-y,-z symop x,x-y,-z+1/2 symop y,x,-z symop -x+y,y,-z+1/2 symop -x,-x+y,-z symop -x,-y,-z symop -x+y,-x,-z+1/2 symop y,-x+y,-z symop x,y,-z+1/2 symop x-y,x,-z symop -y,x-y,-z+1/2 symop y,x,z+1/2 symop -x+y,y,z symop -x,-x+y,z+1/2 symop -y,-x,z symop x-y,-y,z+1/2 symop x,x-y,z cenop x,y,z end_spacegroup begin_spacegroup number 195 basisop x,y,z symbol ccp4 195 symbol Hall ' P 2 2 3' symbol xHM 'P 2 3' symbol old 'P 2 3' symbol laue '-P 2 2 3' 'm-3' symbol patt '-P 2 2 3' 'm-3' symbol pgrp ' P 2 2 3' '23' hklasu ccp4 'h>=0 and ((l>=h and k>h) or (l=h and k=h))' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/2 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -x,-y,z symop x,-y,-z symop -x,y,-z symop z,x,y symop -z,-x,y symop z,-x,-y symop -z,x,-y symop y,z,x symop y,-z,-x symop -y,z,-x symop -y,-z,x cenop x,y,z end_spacegroup begin_spacegroup number 196 basisop x,y,z symbol ccp4 196 symbol Hall ' F 2 2 3' symbol xHM 'F 2 3' symbol old 'F 2 3' symbol laue '-P 2 2 3' 'm-3' symbol patt '-F 2 2 3' 'm-3' symbol pgrp ' P 2 2 3' '23' hklasu ccp4 'h>=0 and ((l>=h and k>h) or (l=h and k=h))' mapasu ccp4 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x,-y,-z symop -x,y,-z symop z,x,y symop -z,-x,y symop z,-x,-y symop -z,x,-y symop y,z,x symop y,-z,-x symop -y,z,-x symop -y,-z,x cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 197 basisop x,y,z symbol ccp4 197 symbol Hall ' I 2 2 3' symbol xHM 'I 2 3' symbol old 'I 2 3' symbol laue '-P 2 2 3' 'm-3' symbol patt '-I 2 2 3' 'm-3' symbol pgrp ' P 2 2 3' '23' hklasu ccp4 'h>=0 and ((l>=h and k>h) or (l=h and k=h))' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/2 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -x,-y,z symop x,-y,-z symop -x,y,-z symop z,x,y symop -z,-x,y symop z,-x,-y symop -z,x,-y symop y,z,x symop y,-z,-x symop -y,z,-x symop -y,-z,x cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 198 basisop x,y,z symbol ccp4 198 symbol Hall ' P 2ac 2ab 3' symbol xHM 'P 21 3' symbol old 'P 21 3' symbol laue '-P 2 2 3' 'm-3' symbol patt '-P 2 2 3' 'm-3' symbol pgrp ' P 2 2 3' '23' hklasu ccp4 'h>=0 and ((l>=h and k>h) or (l=h and k=h))' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz -1/4<=x<1/4; 0<=y<1/2; 0<=z<=3/4 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -x+1/2,-y,z+1/2 symop x+1/2,-y+1/2,-z symop -x,y+1/2,-z+1/2 symop z,x,y symop -z+1/2,-x,y+1/2 symop z+1/2,-x+1/2,-y symop -z,x+1/2,-y+1/2 symop y,z,x symop y+1/2,-z+1/2,-x symop -y,z+1/2,-x+1/2 symop -y+1/2,-z,x+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 199 basisop x,y,z symbol ccp4 199 symbol Hall ' I 2b 2c 3' symbol xHM 'I 21 3' symbol old 'I 21 3' symbol laue '-P 2 2 3' 'm-3' symbol patt '-I 2 2 3' 'm-3' symbol pgrp ' P 2 2 3' '23' hklasu ccp4 'h>=0 and ((l>=h and k>h) or (l=h and k=h))' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 0<=y<1/2; 0=0 and ((l>=h and k>h) or (l=h and k=h))' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -x,-y,z symop x,-y,-z symop -x,y,-z symop z,x,y symop -z,-x,y symop z,-x,-y symop -z,x,-y symop y,z,x symop y,-z,-x symop -y,z,-x symop -y,-z,x symop -x,-y,-z symop x,y,-z symop -x,y,z symop x,-y,z symop -z,-x,-y symop z,x,-y symop -z,x,y symop z,-x,y symop -y,-z,-x symop -y,z,x symop y,-z,x symop y,z,-x cenop x,y,z end_spacegroup begin_spacegroup number 201 basisop x-1/4,y-1/4,z-1/4 symbol ccp4 201 symbol Hall '-P 2ab 2bc 3 (x-1/4,y-1/4,z-1/4)' symbol xHM 'P n -3 :1' symbol old 'P 2/n -3' 'P n -3' symbol laue '-P 2 2 3' 'm-3' symbol patt '-P 2 2 3' 'm-3' symbol pgrp '-P 2 2 3' 'm-3' hklasu ccp4 'h>=0 and ((l>=h and k>h) or (l=h and k=h))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -x,-y,z symop x,-y,-z symop -x,y,-z symop z,x,y symop -z,-x,y symop z,-x,-y symop -z,x,-y symop y,z,x symop y,-z,-x symop -y,z,-x symop -y,-z,x symop -x+1/2,-y+1/2,-z+1/2 symop x+1/2,y+1/2,-z+1/2 symop -x+1/2,y+1/2,z+1/2 symop x+1/2,-y+1/2,z+1/2 symop -z+1/2,-x+1/2,-y+1/2 symop z+1/2,x+1/2,-y+1/2 symop -z+1/2,x+1/2,y+1/2 symop z+1/2,-x+1/2,y+1/2 symop -y+1/2,-z+1/2,-x+1/2 symop -y+1/2,z+1/2,x+1/2 symop y+1/2,-z+1/2,x+1/2 symop y+1/2,z+1/2,-x+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 201 basisop x,y,z symbol ccp4 0 symbol Hall '-P 2ab 2bc 3' symbol xHM 'P n -3 :2' symbol old '' symbol laue '-P 2 2 3' 'm-3' symbol patt '-P 2 2 3' 'm-3' symbol pgrp '-P 2 2 3' 'm-3' hklasu ccp4 'h>=0 and ((l>=h and k>h) or (l=h and k=h))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -x+1/2,-y+1/2,z symop x,-y+1/2,-z+1/2 symop -x+1/2,y,-z+1/2 symop z,x,y symop -z+1/2,-x+1/2,y symop z,-x+1/2,-y+1/2 symop -z+1/2,x,-y+1/2 symop y,z,x symop y,-z+1/2,-x+1/2 symop -y+1/2,z,-x+1/2 symop -y+1/2,-z+1/2,x symop -x,-y,-z symop x+1/2,y+1/2,-z symop -x,y+1/2,z+1/2 symop x+1/2,-y,z+1/2 symop -z,-x,-y symop z+1/2,x+1/2,-y symop -z,x+1/2,y+1/2 symop z+1/2,-x,y+1/2 symop -y,-z,-x symop -y,z+1/2,x+1/2 symop y+1/2,-z,x+1/2 symop y+1/2,z+1/2,-x cenop x,y,z end_spacegroup begin_spacegroup number 202 basisop x,y,z symbol ccp4 202 symbol Hall '-F 2 2 3' symbol xHM 'F m -3' symbol old 'F 2/m -3' 'F m -3' symbol laue '-P 2 2 3' 'm-3' symbol patt '-F 2 2 3' 'm-3' symbol pgrp '-P 2 2 3' 'm-3' hklasu ccp4 'h>=0 and ((l>=h and k>h) or (l=h and k=h))' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x,-y,z symop x,-y,-z symop -x,y,-z symop z,x,y symop -z,-x,y symop z,-x,-y symop -z,x,-y symop y,z,x symop y,-z,-x symop -y,z,-x symop -y,-z,x symop -x,-y,-z symop x,y,-z symop -x,y,z symop x,-y,z symop -z,-x,-y symop z,x,-y symop -z,x,y symop z,-x,y symop -y,-z,-x symop -y,z,x symop y,-z,x symop y,z,-x cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 203 basisop x+1/8,y+1/8,z+1/8 symbol ccp4 203 symbol Hall '-F 2uv 2vw 3 (x+1/8,y+1/8,z+1/8)' symbol xHM 'F d -3 :1' symbol old 'F 2/d -3' 'F d -3' symbol laue '-P 2 2 3' 'm-3' symbol patt '-F 2 2 3' 'm-3' symbol pgrp '-P 2 2 3' 'm-3' hklasu ccp4 'h>=0 and ((l>=h and k>h) or (l=h and k=h))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/8; 0<=y<=1/8; 0<=z<1 mapasu nonz 0<=x<=1/8; 0<=y<=1/8; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/2,-y+1/2,z symop x,-y+1/2,-z+1/2 symop -x+1/2,y,-z+1/2 symop z,x,y symop -z+1/2,-x+1/2,y symop z,-x+1/2,-y+1/2 symop -z+1/2,x,-y+1/2 symop y,z,x symop y,-z+1/2,-x+1/2 symop -y+1/2,z,-x+1/2 symop -y+1/2,-z+1/2,x symop -x+1/4,-y+1/4,-z+1/4 symop x+3/4,y+3/4,-z+1/4 symop -x+1/4,y+3/4,z+3/4 symop x+3/4,-y+1/4,z+3/4 symop -z+1/4,-x+1/4,-y+1/4 symop z+3/4,x+3/4,-y+1/4 symop -z+1/4,x+3/4,y+3/4 symop z+3/4,-x+1/4,y+3/4 symop -y+1/4,-z+1/4,-x+1/4 symop -y+1/4,z+3/4,x+3/4 symop y+3/4,-z+1/4,x+3/4 symop y+3/4,z+3/4,-x+1/4 cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 203 basisop x,y,z symbol ccp4 0 symbol Hall '-F 2uv 2vw 3' symbol xHM 'F d -3 :2' symbol old '' symbol laue '-P 2 2 3' 'm-3' symbol patt '-F 2 2 3' 'm-3' symbol pgrp '-P 2 2 3' 'm-3' hklasu ccp4 'h>=0 and ((l>=h and k>h) or (l=h and k=h))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/8; 0<=y<=1/8; 0<=z<1 mapasu nonz 0<=x<=1/8; 0<=y<=1/8; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -x+1/4,-y+1/4,z symop x,-y+1/4,-z+1/4 symop -x+1/4,y,-z+1/4 symop z,x,y symop -z+1/4,-x+1/4,y symop z,-x+1/4,-y+1/4 symop -z+1/4,x,-y+1/4 symop y,z,x symop y,-z+1/4,-x+1/4 symop -y+1/4,z,-x+1/4 symop -y+1/4,-z+1/4,x symop -x,-y,-z symop x+3/4,y+3/4,-z symop -x,y+3/4,z+3/4 symop x+3/4,-y,z+3/4 symop -z,-x,-y symop z+3/4,x+3/4,-y symop -z,x+3/4,y+3/4 symop z+3/4,-x,y+3/4 symop -y,-z,-x symop -y,z+3/4,x+3/4 symop y+3/4,-z,x+3/4 symop y+3/4,z+3/4,-x cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 204 basisop x,y,z symbol ccp4 204 symbol Hall '-I 2 2 3' symbol xHM 'I m -3' symbol old 'I 2/m -3' 'I m -3' symbol laue '-P 2 2 3' 'm-3' symbol patt '-I 2 2 3' 'm-3' symbol pgrp '-P 2 2 3' 'm-3' hklasu ccp4 'h>=0 and ((l>=h and k>h) or (l=h and k=h))' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -x,-y,z symop x,-y,-z symop -x,y,-z symop z,x,y symop -z,-x,y symop z,-x,-y symop -z,x,-y symop y,z,x symop y,-z,-x symop -y,z,-x symop -y,-z,x symop -x,-y,-z symop x,y,-z symop -x,y,z symop x,-y,z symop -z,-x,-y symop z,x,-y symop -z,x,y symop z,-x,y symop -y,-z,-x symop -y,z,x symop y,-z,x symop y,z,-x cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 205 basisop x,y,z symbol ccp4 205 symbol Hall '-P 2ac 2ab 3' symbol xHM 'P a -3' symbol old 'P 21/a -3' 'P a -3' symbol laue '-P 2 2 3' 'm-3' symbol patt '-P 2 2 3' 'm-3' symbol pgrp '-P 2 2 3' 'm-3' hklasu ccp4 'h>=0 and ((l>=h and k>h) or (l=h and k=h))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<1/2; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/4; -1/4<=z<1/4 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -x+1/2,-y,z+1/2 symop x+1/2,-y+1/2,-z symop -x,y+1/2,-z+1/2 symop z,x,y symop -z+1/2,-x,y+1/2 symop z+1/2,-x+1/2,-y symop -z,x+1/2,-y+1/2 symop y,z,x symop y+1/2,-z+1/2,-x symop -y,z+1/2,-x+1/2 symop -y+1/2,-z,x+1/2 symop -x,-y,-z symop x+1/2,y,-z+1/2 symop -x+1/2,y+1/2,z symop x,-y+1/2,z+1/2 symop -z,-x,-y symop z+1/2,x,-y+1/2 symop -z+1/2,x+1/2,y symop z,-x+1/2,y+1/2 symop -y,-z,-x symop -y+1/2,z+1/2,x symop y,-z+1/2,x+1/2 symop y+1/2,z,-x+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 206 basisop x,y,z symbol ccp4 206 symbol Hall '-I 2b 2c 3' symbol xHM 'I a -3' symbol old 'I 21/a -3' 'I a -3' symbol laue '-P 2 2 3' 'm-3' symbol patt '-I 2 2 3' 'm-3' symbol pgrp '-P 2 2 3' 'm-3' hklasu ccp4 'h>=0 and ((l>=h and k>h) or (l=h and k=h))' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1/2 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -x,-y+1/2,z symop x,-y,-z+1/2 symop -x,y+1/2,-z+1/2 symop z,x,y symop -z,-x+1/2,y symop z,-x,-y+1/2 symop -z,x+1/2,-y+1/2 symop y,z,x symop y,-z,-x+1/2 symop -y,z+1/2,-x+1/2 symop -y+1/2,-z,x+1/2 symop -x,-y,-z symop x,y+1/2,-z symop -x,y,z+1/2 symop x,-y+1/2,z+1/2 symop -z,-x,-y symop z,x+1/2,-y symop -z,x,y+1/2 symop z,-x+1/2,y+1/2 symop -y,-z,-x symop -y,z,x+1/2 symop y,-z+1/2,x+1/2 symop y+1/2,z,-x+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 207 basisop x,y,z symbol ccp4 207 symbol Hall ' P 4 2 3' symbol xHM 'P 4 3 2' symbol old 'P 4 3 2' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-P 4 2 3' 'm-3m' symbol pgrp ' P 4 2 3' '432' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<1; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop x,-y,-z symop y,x,-z symop -x,y,-z symop -y,-x,-z symop z,x,y symop -x,z,y symop -z,-x,y symop x,-z,y symop z,-x,-y symop x,z,-y symop -z,x,-y symop -x,-z,-y symop y,z,x symop y,-z,-x symop z,y,-x symop -y,z,-x symop -z,-y,-x symop -y,-z,x symop z,-y,x symop -z,y,x cenop x,y,z end_spacegroup begin_spacegroup number 208 basisop x,y,z symbol ccp4 208 symbol Hall ' P 4n 2 3' symbol xHM 'P 42 3 2' symbol old 'P 42 3 2' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-P 4 2 3' 'm-3m' symbol pgrp ' P 4 2 3' '432' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<=1/2; 0<=y<1; 0<=z<=1/4 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -y+1/2,x+1/2,z+1/2 symop -x,-y,z symop y+1/2,-x+1/2,z+1/2 symop x,-y,-z symop y+1/2,x+1/2,-z+1/2 symop -x,y,-z symop -y+1/2,-x+1/2,-z+1/2 symop z,x,y symop -x+1/2,z+1/2,y+1/2 symop -z,-x,y symop x+1/2,-z+1/2,y+1/2 symop z,-x,-y symop x+1/2,z+1/2,-y+1/2 symop -z,x,-y symop -x+1/2,-z+1/2,-y+1/2 symop y,z,x symop y,-z,-x symop z+1/2,y+1/2,-x+1/2 symop -y,z,-x symop -z+1/2,-y+1/2,-x+1/2 symop -y,-z,x symop z+1/2,-y+1/2,x+1/2 symop -z+1/2,y+1/2,x+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 209 basisop x,y,z symbol ccp4 209 symbol Hall ' F 4 2 3' symbol xHM 'F 4 3 2' symbol old 'F 4 3 2' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-F 4 2 3' 'm-3m' symbol pgrp ' P 4 2 3' '432' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop x,-y,-z symop y,x,-z symop -x,y,-z symop -y,-x,-z symop z,x,y symop -x,z,y symop -z,-x,y symop x,-z,y symop z,-x,-y symop x,z,-y symop -z,x,-y symop -x,-z,-y symop y,z,x symop y,-z,-x symop z,y,-x symop -y,z,-x symop -z,-y,-x symop -y,-z,x symop z,-y,x symop -z,y,x cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 210 basisop x,y,z symbol ccp4 210 symbol Hall ' F 4d 2 3' symbol xHM 'F 41 3 2' symbol old 'F 41 3 2' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-F 4 2 3' 'm-3m' symbol pgrp ' P 4 2 3' '432' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<=1/2; 0<=y<1; 0<=z<=1/8 mapasu zero 0<=x<=1/8; 0<=y<=1/8; 0<=z<1 mapasu nonz 0<=x<=1/8; 0<=y<=1/8; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/4,x+1/4,z+1/4 symop -x,-y+1/2,z+1/2 symop y+3/4,-x+1/4,z+3/4 symop x,-y,-z symop y+1/4,x+1/4,-z+1/4 symop -x,y+1/2,-z+1/2 symop -y+3/4,-x+1/4,-z+3/4 symop z,x,y symop -x+1/4,z+1/4,y+1/4 symop -z,-x+1/2,y+1/2 symop x+3/4,-z+1/4,y+3/4 symop z,-x,-y symop x+1/4,z+1/4,-y+1/4 symop -z,x+1/2,-y+1/2 symop -x+3/4,-z+1/4,-y+3/4 symop y,z,x symop y+1/2,-z,-x+1/2 symop z+1/4,y+3/4,-x+3/4 symop -y+1/2,z+1/2,-x symop -z+1/4,-y+1/4,-x+1/4 symop -y,-z,x symop z+1/4,-y+3/4,x+3/4 symop -z+3/4,y+3/4,x+1/4 cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 211 basisop x,y,z symbol ccp4 211 symbol Hall ' I 4 2 3' symbol xHM 'I 4 3 2' symbol old 'I 4 3 2' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-I 4 2 3' 'm-3m' symbol pgrp ' P 4 2 3' '432' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop x,-y,-z symop y,x,-z symop -x,y,-z symop -y,-x,-z symop z,x,y symop -x,z,y symop -z,-x,y symop x,-z,y symop z,-x,-y symop x,z,-y symop -z,x,-y symop -x,-z,-y symop y,z,x symop y,-z,-x symop z,y,-x symop -y,z,-x symop -z,-y,-x symop -y,-z,x symop z,-y,x symop -z,y,x cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 212 basisop x,y,z symbol ccp4 212 symbol Hall ' P 4acd 2ab 3' symbol xHM 'P 43 3 2' symbol old 'P 43 3 2' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-P 4 2 3' 'm-3m' symbol pgrp ' P 4 2 3' '432' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/8 mapasu zero 0<=x<1; 0<=y<=1/8; 0<=z<1 mapasu nonz 1/8<=x<=3/8; 1/8<=y<=3/8; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -y+3/4,x+1/4,z+3/4 symop -x+1/2,-y,z+1/2 symop y+3/4,-x+3/4,z+1/4 symop x+1/2,-y+1/2,-z symop y+1/4,x+3/4,-z+3/4 symop -x,y+1/2,-z+1/2 symop -y+1/4,-x+1/4,-z+1/4 symop z,x,y symop -x+3/4,z+1/4,y+3/4 symop -z+1/2,-x,y+1/2 symop x+3/4,-z+3/4,y+1/4 symop z+1/2,-x+1/2,-y symop x+1/4,z+3/4,-y+3/4 symop -z,x+1/2,-y+1/2 symop -x+1/4,-z+1/4,-y+1/4 symop y,z,x symop y+1/2,-z+1/2,-x symop z+1/4,y+3/4,-x+3/4 symop -y,z+1/2,-x+1/2 symop -z+1/4,-y+1/4,-x+1/4 symop -y+1/2,-z,x+1/2 symop z+3/4,-y+3/4,x+1/4 symop -z+3/4,y+1/4,x+3/4 cenop x,y,z end_spacegroup begin_spacegroup number 213 basisop x,y,z symbol ccp4 213 symbol Hall ' P 4bd 2ab 3' symbol xHM 'P 41 3 2' symbol old 'P 41 3 2' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-P 4 2 3' 'm-3m' symbol pgrp ' P 4 2 3' '432' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/8 mapasu zero 0<=x<1; 0<=y<=1/8; 0<=z<1 mapasu nonz 1/8<=x<=3/8; 1/8<=y<=3/8; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -y+1/4,x+3/4,z+1/4 symop -x+1/2,-y,z+1/2 symop y+1/4,-x+1/4,z+3/4 symop x+1/2,-y+1/2,-z symop y+3/4,x+1/4,-z+1/4 symop -x,y+1/2,-z+1/2 symop -y+3/4,-x+3/4,-z+3/4 symop z,x,y symop -x+1/4,z+3/4,y+1/4 symop -z+1/2,-x,y+1/2 symop x+1/4,-z+1/4,y+3/4 symop z+1/2,-x+1/2,-y symop x+3/4,z+1/4,-y+1/4 symop -z,x+1/2,-y+1/2 symop -x+3/4,-z+3/4,-y+3/4 symop y,z,x symop y+1/2,-z+1/2,-x symop z+3/4,y+1/4,-x+1/4 symop -y,z+1/2,-x+1/2 symop -z+3/4,-y+3/4,-x+3/4 symop -y+1/2,-z,x+1/2 symop z+1/4,-y+1/4,x+3/4 symop -z+1/4,y+3/4,x+1/4 cenop x,y,z end_spacegroup begin_spacegroup number 214 basisop x,y,z symbol ccp4 214 symbol Hall ' I 4bd 2c 3' symbol xHM 'I 41 3 2' symbol old 'I 41 3 2' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-I 4 2 3' 'm-3m' symbol pgrp ' P 4 2 3' '432' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<=1/2; 0<=y<1; 0<=z<=1/8 mapasu zero 0<=x<1; 0<=y<=1/8; 0<=z<1/2 mapasu nonz -1/8<=x<=1/8; 0<=y<=1/8; 0=l and l>=h and h>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop y,-x,-z symop -x,-y,z symop -y,x,-z symop x,-y,-z symop -y,-x,z symop -x,y,-z symop y,x,z symop z,x,y symop x,-z,-y symop -z,-x,y symop -x,z,-y symop z,-x,-y symop -x,-z,y symop -z,x,-y symop x,z,y symop y,z,x symop y,-z,-x symop -z,-y,x symop -y,z,-x symop z,y,x symop -y,-z,x symop -z,y,-x symop z,-y,-x cenop x,y,z end_spacegroup begin_spacegroup number 216 basisop x,y,z symbol ccp4 216 symbol Hall ' F -4 2 3' symbol xHM 'F -4 3 m' symbol old 'F -4 3 m' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-F 4 2 3' 'm-3m' symbol pgrp ' P -4 2 3' '-43m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop y,-x,-z symop -x,-y,z symop -y,x,-z symop x,-y,-z symop -y,-x,z symop -x,y,-z symop y,x,z symop z,x,y symop x,-z,-y symop -z,-x,y symop -x,z,-y symop z,-x,-y symop -x,-z,y symop -z,x,-y symop x,z,y symop y,z,x symop y,-z,-x symop -z,-y,x symop -y,z,-x symop z,y,x symop -y,-z,x symop -z,y,-x symop z,-y,-x cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 217 basisop x,y,z symbol ccp4 217 symbol Hall ' I -4 2 3' symbol xHM 'I -4 3 m' symbol old 'I -4 3 m' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-I 4 2 3' 'm-3m' symbol pgrp ' P -4 2 3' '-43m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop y,-x,-z symop -x,-y,z symop -y,x,-z symop x,-y,-z symop -y,-x,z symop -x,y,-z symop y,x,z symop z,x,y symop x,-z,-y symop -z,-x,y symop -x,z,-y symop z,-x,-y symop -x,-z,y symop -z,x,-y symop x,z,y symop y,z,x symop y,-z,-x symop -z,-y,x symop -y,z,-x symop z,y,x symop -y,-z,x symop -z,y,-x symop z,-y,-x cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 218 basisop x,y,z symbol ccp4 218 symbol Hall ' P -4n 2 3' symbol xHM 'P -4 3 n' symbol old 'P -4 3 n' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-P 4 2 3' 'm-3m' symbol pgrp ' P -4 2 3' '-43m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop y+1/2,-x+1/2,-z+1/2 symop -x,-y,z symop -y+1/2,x+1/2,-z+1/2 symop x,-y,-z symop -y+1/2,-x+1/2,z+1/2 symop -x,y,-z symop y+1/2,x+1/2,z+1/2 symop z,x,y symop x+1/2,-z+1/2,-y+1/2 symop -z,-x,y symop -x+1/2,z+1/2,-y+1/2 symop z,-x,-y symop -x+1/2,-z+1/2,y+1/2 symop -z,x,-y symop x+1/2,z+1/2,y+1/2 symop y,z,x symop y,-z,-x symop -z+1/2,-y+1/2,x+1/2 symop -y,z,-x symop z+1/2,y+1/2,x+1/2 symop -y,-z,x symop -z+1/2,y+1/2,-x+1/2 symop z+1/2,-y+1/2,-x+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 219 basisop x,y,z symbol ccp4 219 symbol Hall ' F -4a 2 3' symbol xHM 'F -4 3 c' symbol old 'F -4 3 c' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-F 4 2 3' 'm-3m' symbol pgrp ' P -4 2 3' '-43m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1/2 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop y+1/2,-x,-z symop -x+1/2,-y+1/2,z symop -y,x+1/2,-z symop x,-y,-z symop -y+1/2,-x,z symop -x+1/2,y+1/2,-z symop y,x+1/2,z symop z,x,y symop x+1/2,-z,-y symop -z+1/2,-x+1/2,y symop -x,z+1/2,-y symop z,-x,-y symop -x+1/2,-z,y symop -z+1/2,x+1/2,-y symop x,z+1/2,y symop y,z,x symop y,-z+1/2,-x+1/2 symop -z,-y,x+1/2 symop -y+1/2,z,-x+1/2 symop z+1/2,y,x symop -y,-z,x symop -z,y,-x+1/2 symop z+1/2,-y+1/2,-x+1/2 cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 220 basisop x,y,z symbol ccp4 220 symbol Hall ' I -4bd 2c 3' symbol xHM 'I -4 3 d' symbol old 'I -4 3 d' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-I 4 2 3' 'm-3m' symbol pgrp ' P -4 2 3' '-43m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz -1/8<=x<=1/8; 0<=y<=1/8; 0=l and l>=h and h>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu nonz 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop x,-y,-z symop y,x,-z symop -x,y,-z symop -y,-x,-z symop z,x,y symop -x,z,y symop -z,-x,y symop x,-z,y symop z,-x,-y symop x,z,-y symop -z,x,-y symop -x,-z,-y symop y,z,x symop y,-z,-x symop z,y,-x symop -y,z,-x symop -z,-y,-x symop -y,-z,x symop z,-y,x symop -z,y,x symop -x,-y,-z symop y,-x,-z symop x,y,-z symop -y,x,-z symop -x,y,z symop -y,-x,z symop x,-y,z symop y,x,z symop -z,-x,-y symop x,-z,-y symop z,x,-y symop -x,z,-y symop -z,x,y symop -x,-z,y symop z,-x,y symop x,z,y symop -y,-z,-x symop -y,z,x symop -z,-y,x symop y,-z,x symop z,y,x symop y,z,-x symop -z,y,-x symop z,-y,-x cenop x,y,z end_spacegroup begin_spacegroup number 222 basisop x-1/4,y-1/4,z-1/4 symbol ccp4 222 symbol Hall '-P 4a 2bc 3 (x-1/4,y-1/4,z-1/4)' symbol xHM 'P n -3 n :1' symbol old 'P 4/n -3 2/n' 'P n -3 n' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-P 4 2 3' 'm-3m' symbol pgrp '-P 4 2 3' 'm-3m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop x,-y,-z symop y,x,-z symop -x,y,-z symop -y,-x,-z symop z,x,y symop -x,z,y symop -z,-x,y symop x,-z,y symop z,-x,-y symop x,z,-y symop -z,x,-y symop -x,-z,-y symop y,z,x symop y,-z,-x symop z,y,-x symop -y,z,-x symop -z,-y,-x symop -y,-z,x symop z,-y,x symop -z,y,x symop -x+1/2,-y+1/2,-z+1/2 symop y+1/2,-x+1/2,-z+1/2 symop x+1/2,y+1/2,-z+1/2 symop -y+1/2,x+1/2,-z+1/2 symop -x+1/2,y+1/2,z+1/2 symop -y+1/2,-x+1/2,z+1/2 symop x+1/2,-y+1/2,z+1/2 symop y+1/2,x+1/2,z+1/2 symop -z+1/2,-x+1/2,-y+1/2 symop x+1/2,-z+1/2,-y+1/2 symop z+1/2,x+1/2,-y+1/2 symop -x+1/2,z+1/2,-y+1/2 symop -z+1/2,x+1/2,y+1/2 symop -x+1/2,-z+1/2,y+1/2 symop z+1/2,-x+1/2,y+1/2 symop x+1/2,z+1/2,y+1/2 symop -y+1/2,-z+1/2,-x+1/2 symop -y+1/2,z+1/2,x+1/2 symop -z+1/2,-y+1/2,x+1/2 symop y+1/2,-z+1/2,x+1/2 symop z+1/2,y+1/2,x+1/2 symop y+1/2,z+1/2,-x+1/2 symop -z+1/2,y+1/2,-x+1/2 symop z+1/2,-y+1/2,-x+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 222 basisop x,y,z symbol ccp4 0 symbol Hall '-P 4a 2bc 3' symbol xHM 'P n -3 n :2' symbol old '' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-P 4 2 3' 'm-3m' symbol pgrp '-P 4 2 3' 'm-3m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 1/4<=z<=3/4 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -y+1/2,x,z symop -x+1/2,-y+1/2,z symop y,-x+1/2,z symop x,-y+1/2,-z+1/2 symop y,x,-z+1/2 symop -x+1/2,y,-z+1/2 symop -y+1/2,-x+1/2,-z+1/2 symop z,x,y symop -x+1/2,z,y symop -z+1/2,-x+1/2,y symop x,-z+1/2,y symop z,-x+1/2,-y+1/2 symop x,z,-y+1/2 symop -z+1/2,x,-y+1/2 symop -x+1/2,-z+1/2,-y+1/2 symop y,z,x symop y,-z+1/2,-x+1/2 symop z,y,-x+1/2 symop -y+1/2,z,-x+1/2 symop -z+1/2,-y+1/2,-x+1/2 symop -y+1/2,-z+1/2,x symop z,-y+1/2,x symop -z+1/2,y,x symop -x,-y,-z symop y+1/2,-x,-z symop x+1/2,y+1/2,-z symop -y,x+1/2,-z symop -x,y+1/2,z+1/2 symop -y,-x,z+1/2 symop x+1/2,-y,z+1/2 symop y+1/2,x+1/2,z+1/2 symop -z,-x,-y symop x+1/2,-z,-y symop z+1/2,x+1/2,-y symop -x,z+1/2,-y symop -z,x+1/2,y+1/2 symop -x,-z,y+1/2 symop z+1/2,-x,y+1/2 symop x+1/2,z+1/2,y+1/2 symop -y,-z,-x symop -y,z+1/2,x+1/2 symop -z,-y,x+1/2 symop y+1/2,-z,x+1/2 symop z+1/2,y+1/2,x+1/2 symop y+1/2,z+1/2,-x symop -z,y+1/2,-x symop z+1/2,-y,-x cenop x,y,z end_spacegroup begin_spacegroup number 223 basisop x,y,z symbol ccp4 223 symbol Hall '-P 4n 2 3' symbol xHM 'P m -3 n' symbol old 'P 42/m -3 2/n' 'P m -3 n' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-P 4 2 3' 'm-3m' symbol pgrp '-P 4 2 3' 'm-3m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -y+1/2,x+1/2,z+1/2 symop -x,-y,z symop y+1/2,-x+1/2,z+1/2 symop x,-y,-z symop y+1/2,x+1/2,-z+1/2 symop -x,y,-z symop -y+1/2,-x+1/2,-z+1/2 symop z,x,y symop -x+1/2,z+1/2,y+1/2 symop -z,-x,y symop x+1/2,-z+1/2,y+1/2 symop z,-x,-y symop x+1/2,z+1/2,-y+1/2 symop -z,x,-y symop -x+1/2,-z+1/2,-y+1/2 symop y,z,x symop y,-z,-x symop z+1/2,y+1/2,-x+1/2 symop -y,z,-x symop -z+1/2,-y+1/2,-x+1/2 symop -y,-z,x symop z+1/2,-y+1/2,x+1/2 symop -z+1/2,y+1/2,x+1/2 symop -x,-y,-z symop y+1/2,-x+1/2,-z+1/2 symop x,y,-z symop -y+1/2,x+1/2,-z+1/2 symop -x,y,z symop -y+1/2,-x+1/2,z+1/2 symop x,-y,z symop y+1/2,x+1/2,z+1/2 symop -z,-x,-y symop x+1/2,-z+1/2,-y+1/2 symop z,x,-y symop -x+1/2,z+1/2,-y+1/2 symop -z,x,y symop -x+1/2,-z+1/2,y+1/2 symop z,-x,y symop x+1/2,z+1/2,y+1/2 symop -y,-z,-x symop -y,z,x symop -z+1/2,-y+1/2,x+1/2 symop y,-z,x symop z+1/2,y+1/2,x+1/2 symop y,z,-x symop -z+1/2,y+1/2,-x+1/2 symop z+1/2,-y+1/2,-x+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 224 basisop x+1/4,y+1/4,z+1/4 symbol ccp4 224 symbol Hall '-P 4bc 2bc 3 (x+1/4,y+1/4,z+1/4)' symbol xHM 'P n -3 m :1' symbol old 'P 42/n -3 2/m' 'P n -3 m' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-P 4 2 3' 'm-3m' symbol pgrp '-P 4 2 3' 'm-3m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -y+1/2,x+1/2,z+1/2 symop -x,-y,z symop y+1/2,-x+1/2,z+1/2 symop x,-y,-z symop y+1/2,x+1/2,-z+1/2 symop -x,y,-z symop -y+1/2,-x+1/2,-z+1/2 symop z,x,y symop -x+1/2,z+1/2,y+1/2 symop -z,-x,y symop x+1/2,-z+1/2,y+1/2 symop z,-x,-y symop x+1/2,z+1/2,-y+1/2 symop -z,x,-y symop -x+1/2,-z+1/2,-y+1/2 symop y,z,x symop y,-z,-x symop z+1/2,y+1/2,-x+1/2 symop -y,z,-x symop -z+1/2,-y+1/2,-x+1/2 symop -y,-z,x symop z+1/2,-y+1/2,x+1/2 symop -z+1/2,y+1/2,x+1/2 symop -x+1/2,-y+1/2,-z+1/2 symop y,-x,-z symop x+1/2,y+1/2,-z+1/2 symop -y,x,-z symop -x+1/2,y+1/2,z+1/2 symop -y,-x,z symop x+1/2,-y+1/2,z+1/2 symop y,x,z symop -z+1/2,-x+1/2,-y+1/2 symop x,-z,-y symop z+1/2,x+1/2,-y+1/2 symop -x,z,-y symop -z+1/2,x+1/2,y+1/2 symop -x,-z,y symop z+1/2,-x+1/2,y+1/2 symop x,z,y symop -y+1/2,-z+1/2,-x+1/2 symop -y+1/2,z+1/2,x+1/2 symop -z,-y,x symop y+1/2,-z+1/2,x+1/2 symop z,y,x symop y+1/2,z+1/2,-x+1/2 symop -z,y,-x symop z,-y,-x cenop x,y,z end_spacegroup begin_spacegroup number 224 basisop x,y,z symbol ccp4 0 symbol Hall '-P 4bc 2bc 3' symbol xHM 'P n -3 m :2' symbol old '' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-P 4 2 3' 'm-3m' symbol pgrp '-P 4 2 3' 'm-3m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -y,x+1/2,z+1/2 symop -x+1/2,-y+1/2,z symop y+1/2,-x,z+1/2 symop x,-y+1/2,-z+1/2 symop y+1/2,x+1/2,-z symop -x+1/2,y,-z+1/2 symop -y,-x,-z symop z,x,y symop -x,z+1/2,y+1/2 symop -z+1/2,-x+1/2,y symop x+1/2,-z,y+1/2 symop z,-x+1/2,-y+1/2 symop x+1/2,z+1/2,-y symop -z+1/2,x,-y+1/2 symop -x,-z,-y symop y,z,x symop y,-z+1/2,-x+1/2 symop z+1/2,y+1/2,-x symop -y+1/2,z,-x+1/2 symop -z,-y,-x symop -y+1/2,-z+1/2,x symop z+1/2,-y,x+1/2 symop -z,y+1/2,x+1/2 symop -x,-y,-z symop y,-x+1/2,-z+1/2 symop x+1/2,y+1/2,-z symop -y+1/2,x,-z+1/2 symop -x,y+1/2,z+1/2 symop -y+1/2,-x+1/2,z symop x+1/2,-y,z+1/2 symop y,x,z symop -z,-x,-y symop x,-z+1/2,-y+1/2 symop z+1/2,x+1/2,-y symop -x+1/2,z,-y+1/2 symop -z,x+1/2,y+1/2 symop -x+1/2,-z+1/2,y symop z+1/2,-x,y+1/2 symop x,z,y symop -y,-z,-x symop -y,z+1/2,x+1/2 symop -z+1/2,-y+1/2,x symop y+1/2,-z,x+1/2 symop z,y,x symop y+1/2,z+1/2,-x symop -z+1/2,y,-x+1/2 symop z,-y+1/2,-x+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 225 basisop x,y,z symbol ccp4 225 symbol Hall '-F 4 2 3' symbol xHM 'F m -3 m' symbol old 'F 4/m -3 2/m' 'F m -3 m' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-F 4 2 3' 'm-3m' symbol pgrp '-P 4 2 3' 'm-3m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/4; 0<=z<=1/4 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop x,-y,-z symop y,x,-z symop -x,y,-z symop -y,-x,-z symop z,x,y symop -x,z,y symop -z,-x,y symop x,-z,y symop z,-x,-y symop x,z,-y symop -z,x,-y symop -x,-z,-y symop y,z,x symop y,-z,-x symop z,y,-x symop -y,z,-x symop -z,-y,-x symop -y,-z,x symop z,-y,x symop -z,y,x symop -x,-y,-z symop y,-x,-z symop x,y,-z symop -y,x,-z symop -x,y,z symop -y,-x,z symop x,-y,z symop y,x,z symop -z,-x,-y symop x,-z,-y symop z,x,-y symop -x,z,-y symop -z,x,y symop -x,-z,y symop z,-x,y symop x,z,y symop -y,-z,-x symop -y,z,x symop -z,-y,x symop y,-z,x symop z,y,x symop y,z,-x symop -z,y,-x symop z,-y,-x cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 226 basisop x,y,z symbol ccp4 226 symbol Hall '-F 4a 2 3' symbol xHM 'F m -3 c' symbol old 'F 4/m -3 2/c' 'F m -3 c' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-F 4 2 3' 'm-3m' symbol pgrp '-P 4 2 3' 'm-3m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/4 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/4 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x,z symop -x+1/2,-y+1/2,z symop y,-x+1/2,z symop x,-y,-z symop y+1/2,x,-z symop -x+1/2,y+1/2,-z symop -y,-x+1/2,-z symop z,x,y symop -x+1/2,z,y symop -z+1/2,-x+1/2,y symop x,-z+1/2,y symop z,-x,-y symop x+1/2,z,-y symop -z+1/2,x+1/2,-y symop -x,-z+1/2,-y symop y,z,x symop y,-z+1/2,-x+1/2 symop z,y,-x+1/2 symop -y+1/2,z,-x+1/2 symop -z+1/2,-y,-x symop -y,-z,x symop z,-y,x+1/2 symop -z+1/2,y+1/2,x+1/2 symop -x,-y,-z symop y+1/2,-x,-z symop x+1/2,y+1/2,-z symop -y,x+1/2,-z symop -x,y,z symop -y+1/2,-x,z symop x+1/2,-y+1/2,z symop y,x+1/2,z symop -z,-x,-y symop x+1/2,-z,-y symop z+1/2,x+1/2,-y symop -x,z+1/2,-y symop -z,x,y symop -x+1/2,-z,y symop z+1/2,-x+1/2,y symop x,z+1/2,y symop -y,-z,-x symop -y,z+1/2,x+1/2 symop -z,-y,x+1/2 symop y+1/2,-z,x+1/2 symop z+1/2,y,x symop y,z,-x symop -z,y,-x+1/2 symop z+1/2,-y+1/2,-x+1/2 cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 227 basisop x+1/8,y+1/8,z+1/8 symbol ccp4 227 symbol Hall '-F 4vw 2vw 3 (x+1/8,y+1/8,z+1/8)' symbol xHM 'F d -3 m :1' symbol old 'F 41/d -3 2/m' 'F d -3 m' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-F 4 2 3' 'm-3m' symbol pgrp '-P 4 2 3' 'm-3m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/8; 0<=y<=1/8; 0<=z<1 mapasu nonz 0<=x<=1/8; 0<=y<=1/8; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/4,x+1/4,z+1/4 symop -x,-y+1/2,z+1/2 symop y+3/4,-x+1/4,z+3/4 symop x,-y+1/2,-z+1/2 symop y+3/4,x+1/4,-z+3/4 symop -x,y,-z symop -y+1/4,-x+1/4,-z+1/4 symop z,x,y symop -x+1/4,z+1/4,y+1/4 symop -z,-x+1/2,y+1/2 symop x+3/4,-z+1/4,y+3/4 symop z,-x+1/2,-y+1/2 symop x+3/4,z+1/4,-y+3/4 symop -z,x,-y symop -x+1/4,-z+1/4,-y+1/4 symop y,z,x symop y+1/2,-z,-x+1/2 symop z+1/4,y+3/4,-x+3/4 symop -y+1/2,z+1/2,-x symop -z+1/4,-y+3/4,-x+3/4 symop -y+1/2,-z+1/2,x symop z+1/4,-y+1/4,x+1/4 symop -z+3/4,y+1/4,x+3/4 symop -x+1/4,-y+1/4,-z+1/4 symop y,-x,-z symop x+1/4,y+3/4,-z+3/4 symop -y+1/2,x,-z+1/2 symop -x+1/4,y+3/4,z+3/4 symop -y+1/2,-x,z+1/2 symop x+1/4,-y+1/4,z+1/4 symop y,x,z symop -z+1/4,-x+1/4,-y+1/4 symop x,-z,-y symop z+1/4,x+3/4,-y+3/4 symop -x+1/2,z,-y+1/2 symop -z+1/4,x+3/4,y+3/4 symop -x+1/2,-z,y+1/2 symop z+1/4,-x+1/4,y+1/4 symop x,z,y symop -y+1/4,-z+1/4,-x+1/4 symop -y+3/4,z+1/4,x+3/4 symop -z,-y+1/2,x+1/2 symop y+3/4,-z+3/4,x+1/4 symop z,y+1/2,x+1/2 symop y+3/4,z+3/4,-x+1/4 symop -z,y,-x symop z+1/2,-y,-x+1/2 cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 227 basisop x,y,z symbol ccp4 0 symbol Hall '-F 4vw 2vw 3' symbol xHM 'F d -3 m :2' symbol old '' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-F 4 2 3' 'm-3m' symbol pgrp '-P 4 2 3' 'm-3m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/8; 0<=y<=1/8; 0<=z<1 mapasu nonz 0<=x<=1/8; 0<=y<=1/8; 0<=z<1 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y,x+1/4,z+1/4 symop -x+3/4,-y+1/4,z+1/2 symop y+3/4,-x,z+3/4 symop x,-y+1/4,-z+1/4 symop y+3/4,x+1/4,-z+1/2 symop -x+3/4,y,-z+3/4 symop -y,-x,-z symop z,x,y symop -x,z+1/4,y+1/4 symop -z+3/4,-x+1/4,y+1/2 symop x+3/4,-z,y+3/4 symop z,-x+1/4,-y+1/4 symop x+3/4,z+1/4,-y+1/2 symop -z+3/4,x,-y+3/4 symop -x,-z,-y symop y,z,x symop y+1/2,-z+3/4,-x+1/4 symop z+1/4,y+3/4,-x+1/2 symop -y+1/4,z+1/2,-x+3/4 symop -z,-y+1/2,-x+1/2 symop -y+1/4,-z+1/4,x symop z+1/4,-y,x+1/4 symop -z+1/2,y+1/4,x+3/4 symop -x,-y,-z symop y,-x+3/4,-z+3/4 symop x+1/4,y+3/4,-z+1/2 symop -y+1/4,x,-z+1/4 symop -x,y+3/4,z+3/4 symop -y+1/4,-x+3/4,z+1/2 symop x+1/4,-y,z+1/4 symop y,x,z symop -z,-x,-y symop x,-z+3/4,-y+3/4 symop z+1/4,x+3/4,-y+1/2 symop -x+1/4,z,-y+1/4 symop -z,x+3/4,y+3/4 symop -x+1/4,-z+3/4,y+1/2 symop z+1/4,-x,y+1/4 symop x,z,y symop -y,-z,-x symop -y+1/2,z+1/4,x+3/4 symop -z+3/4,-y+1/4,x+1/2 symop y+3/4,-z+1/2,x+1/4 symop z,y+1/2,x+1/2 symop y+3/4,z+3/4,-x symop -z+3/4,y,-x+3/4 symop z+1/2,-y+3/4,-x+1/4 cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 228 basisop x-1/8,y-1/8,z-1/8 symbol ccp4 228 symbol Hall '-F 4ud 2vw 3 (x-1/8,y-1/8,z-1/8)' symbol xHM 'F d -3 c :1' symbol old 'F d -3 c' 'F 41/d -3 2/c' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-F 4 2 3' 'm-3m' symbol pgrp '-P 4 2 3' 'm-3m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/8; 0<=y<=1/8; 0<=z<1/2 mapasu nonz 0<=x<=1/8; 0<=y<=1/8; 0<=z<1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/4,x+1/4,z+1/4 symop -x,-y+1/2,z+1/2 symop y+3/4,-x+1/4,z+3/4 symop x,-y,-z symop y+1/4,x+1/4,-z+1/4 symop -x,y+1/2,-z+1/2 symop -y+3/4,-x+1/4,-z+3/4 symop z,x,y symop -x+1/4,z+1/4,y+1/4 symop -z,-x+1/2,y+1/2 symop x+3/4,-z+1/4,y+3/4 symop z,-x,-y symop x+1/4,z+1/4,-y+1/4 symop -z,x+1/2,-y+1/2 symop -x+3/4,-z+1/4,-y+3/4 symop y,z,x symop y+1/2,-z,-x+1/2 symop z+1/4,y+3/4,-x+3/4 symop -y+1/2,z+1/2,-x symop -z+1/4,-y+1/4,-x+1/4 symop -y,-z,x symop z+1/4,-y+3/4,x+3/4 symop -z+3/4,y+3/4,x+1/4 symop -x+3/4,-y+3/4,-z+3/4 symop y+1/2,-x+1/2,-z+1/2 symop x+3/4,y+1/4,-z+1/4 symop -y,x+1/2,-z symop -x+3/4,y+3/4,z+3/4 symop -y+1/2,-x+1/2,z+1/2 symop x+3/4,-y+1/4,z+1/4 symop y,x+1/2,z symop -z+3/4,-x+3/4,-y+3/4 symop x+1/2,-z+1/2,-y+1/2 symop z+3/4,x+1/4,-y+1/4 symop -x,z+1/2,-y symop -z+3/4,x+3/4,y+3/4 symop -x+1/2,-z+1/2,y+1/2 symop z+3/4,-x+1/4,y+1/4 symop x,z+1/2,y symop -y+3/4,-z+3/4,-x+3/4 symop -y+1/4,z+3/4,x+1/4 symop -z+1/2,-y,x symop y+1/4,-z+1/4,x+3/4 symop z+1/2,y+1/2,x+1/2 symop y+3/4,z+3/4,-x+3/4 symop -z+1/2,y,-x symop z,-y,-x+1/2 cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 228 basisop x,y,z symbol ccp4 0 symbol Hall '-F 4ud 2vw 3' symbol xHM 'F d -3 c :2' symbol old '' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-F 4 2 3' 'm-3m' symbol pgrp '-P 4 2 3' 'm-3m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/8; 0<=y<=1/8; 0<=z<1/2 mapasu nonz 0<=x<=1/8; 0<=y<=1/8; 0<=z<1/2 cheshire 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 symop x,y,z symop -y+1/2,x+1/4,z+1/4 symop -x+1/4,-y+3/4,z+1/2 symop y+3/4,-x+1/2,z+3/4 symop x,-y+1/4,-z+1/4 symop y+1/4,x+1/4,-z+1/2 symop -x+1/4,y+1/2,-z+3/4 symop -y,-x+1/2,-z symop z,x,y symop -x+1/2,z+1/4,y+1/4 symop -z+1/4,-x+3/4,y+1/2 symop x+3/4,-z+1/2,y+3/4 symop z,-x+1/4,-y+1/4 symop x+1/4,z+1/4,-y+1/2 symop -z+1/4,x+1/2,-y+3/4 symop -x,-z+1/2,-y symop y,z,x symop y+1/2,-z+1/4,-x+3/4 symop z+1/4,y+3/4,-x symop -y+3/4,z+1/2,-x+1/4 symop -z+1/2,-y+1/2,-x+1/2 symop -y+1/4,-z+1/4,x symop z+1/4,-y,x+3/4 symop -z,y+3/4,x+1/4 symop -x,-y,-z symop y+1/2,-x+3/4,-z+3/4 symop x+3/4,y+1/4,-z+1/2 symop -y+1/4,x+1/2,-z+1/4 symop -x,y+3/4,z+3/4 symop -y+3/4,-x+3/4,z+1/2 symop x+3/4,-y+1/2,z+1/4 symop y,x+1/2,z symop -z,-x,-y symop x+1/2,-z+3/4,-y+3/4 symop z+3/4,x+1/4,-y+1/2 symop -x+1/4,z+1/2,-y+1/4 symop -z,x+3/4,y+3/4 symop -x+3/4,-z+3/4,y+1/2 symop z+3/4,-x+1/2,y+1/4 symop x,z+1/2,y symop -y,-z,-x symop -y+1/2,z+3/4,x+1/4 symop -z+3/4,-y+1/4,x symop y+1/4,-z+1/2,x+3/4 symop z+1/2,y+1/2,x+1/2 symop y+3/4,z+3/4,-x symop -z+3/4,y,-x+1/4 symop z,-y+1/4,-x+3/4 cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 229 basisop x,y,z symbol ccp4 229 symbol Hall '-I 4 2 3' symbol xHM 'I m -3 m' symbol old 'I 4/m -3 2/m' 'I m -3 m' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-I 4 2 3' 'm-3m' symbol pgrp '-P 4 2 3' 'm-3m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/4 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<=1/4; 0<=y<=1/4; 0<=z<=1/2 cheshire 0<=x<=1; 0<=y<=1; 0<=z<=1 symop x,y,z symop -y,x,z symop -x,-y,z symop y,-x,z symop x,-y,-z symop y,x,-z symop -x,y,-z symop -y,-x,-z symop z,x,y symop -x,z,y symop -z,-x,y symop x,-z,y symop z,-x,-y symop x,z,-y symop -z,x,-y symop -x,-z,-y symop y,z,x symop y,-z,-x symop z,y,-x symop -y,z,-x symop -z,-y,-x symop -y,-z,x symop z,-y,x symop -z,y,x symop -x,-y,-z symop y,-x,-z symop x,y,-z symop -y,x,-z symop -x,y,z symop -y,-x,z symop x,-y,z symop y,x,z symop -z,-x,-y symop x,-z,-y symop z,x,-y symop -x,z,-y symop -z,x,y symop -x,-z,y symop z,-x,y symop x,z,y symop -y,-z,-x symop -y,z,x symop -z,-y,x symop y,-z,x symop z,y,x symop y,z,-x symop -z,y,-x symop z,-y,-x cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 230 basisop x,y,z symbol ccp4 230 symbol Hall '-I 4bd 2c 3' symbol xHM 'I a -3 d' symbol old 'I 41/a -3 2/d' 'I a -3 d' symbol laue '-P 4 2 3' 'm-3m' symbol patt '-I 4 2 3' 'm-3m' symbol pgrp '-P 4 2 3' 'm-3m' hklasu ccp4 'k>=l and l>=h and h>=0' mapasu ccp4 0<=x<-1; 0<=y<-1; 0<=z<-1 mapasu zero 0<=x<=1/8; 0<=y<=1/8; 0<=z<1 mapasu nonz 0<=x<=1/8; -1/8<=y<=0; 1/8=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<1; 0<=y<1/2; 0<=z<1 mapasu zero 0<=x<=1/4; 0<=y<1; 0<=z<1 mapasu nonz 0<=x<-1; 0<=y<-1; 0<=z<-1 cheshire symop x,y,z symop -x+1/2,y,-z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 5 basisop x+1/4,y+1/4,z symbol ccp4 3005 symbol Hall ' C 2y (x+1/4,y+1/4,z)' symbol xHM 'C 1 21 1' symbol old 'C 1 21 1' symbol laue '-P 2y' '2/m' symbol patt '-C 2y' '2/m' symbol pgrp ' P 2y' '2' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<=1/4; 0<=y<1; 0<=z<1 mapasu zero 0<=x<1; 0<=y<1/2; 0<=z<=1/2 mapasu nonz 0<=x<-1; 0<=y<-1; 0<=z<-1 cheshire symop x,y,z symop -x+1/2,y,-z cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 8 basisop -x,z,y symbol ccp4 1008 symbol Hall ' B -2' symbol xHM 'B 1 1 m' symbol old 'B 1 1 m' symbol laue '-P 2' '2/m' symbol patt '-B 2' '2/m' symbol pgrp ' P -2' 'm' hklasu ccp4 'k>=0 and (l>0 or (l=0 and h>=0))' mapasu ccp4 0<=x<1; 0<=y<1/4; 0<=z<1 mapasu zero 0<=x<1/2; 0<=y<=1; 0<=z<1/2 mapasu nonz 0<=x<1/2; 0<=y<=1; 0<=z<1/2 cheshire symop x,y,z symop x,y,-z cenop x,y,z cenop x+1/2,y,z+1/2 end_spacegroup begin_spacegroup number 18 basisop x+1/4,y+1/4,z symbol ccp4 1018 symbol Hall ' P 2 2ab (x+1/4,y+1/4,z)' symbol xHM '' symbol old 'P 21 21 2 (a)' symbol laue '-P 2 2' 'mmm' symbol patt '-P 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<-1; 0<=y<-1; 0<=z<-1 cheshire symop x,y,z symop -x+1/2,-y+1/2,z symop x+1/2,-y,-z symop -x,y+1/2,-z cenop x,y,z end_spacegroup begin_spacegroup number 20 basisop x+1/4,y,z symbol ccp4 1020 symbol Hall ' C 2c 2 (x+1/4,y,z)' symbol xHM '' symbol old 'C 2 2 21a)' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 mapasu zero 0<=x<=1/4; 0<=y<=1/2; 0<=z<1 mapasu nonz 0<=x<-1; 0<=y<-1; 0<=z<-1 cheshire symop x,y,z symop -x+1/2,-y,z+1/2 symop x,-y,-z symop -x+1/2,y,-z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 21 basisop x+1/4,y+1/4,z symbol ccp4 1021 symbol Hall ' C 2 2 (x+1/4,y+1/4,z)' symbol xHM '' symbol old 'C 2 2 2a' symbol laue '-P 2 2' 'mmm' symbol patt '-C 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<=1/2 mapasu nonz 0<=x<-1; 0<=y<-1; 0<=z<-1 cheshire symop x,y,z symop -x+1/2,-y+1/2,z symop x,-y+1/2,-z symop -x+1/2,y,-z cenop x,y,z cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 22 basisop x,y,z+1/4 symbol ccp4 1022 symbol Hall ' F 2 2 (x,y,z+1/4)' symbol xHM '' symbol old 'F 2 2 2a' symbol laue '-P 2 2' 'mmm' symbol patt '-F 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<-1; 0<=y<-1; 0<=z<-1 cheshire symop x,y,z symop -x,-y,z symop x,-y,-z+1/2 symop -x,y,-z+1/2 cenop x,y,z cenop x,y+1/2,z+1/2 cenop x+1/2,y,z+1/2 cenop x+1/2,y+1/2,z end_spacegroup begin_spacegroup number 23 basisop x-1/4,y+1/4,z-1/4 symbol ccp4 1023 symbol Hall ' I 2 2 (x-1/4,y+1/4,z-1/4)' symbol xHM '' symbol old 'I 2 2 2a' symbol laue '-P 2 2' 'mmm' symbol patt '-I 2 2' 'mmm' symbol pgrp ' P 2 2' '222' hklasu ccp4 'h>=0 and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<1; 0<=z<=1/4 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<-1; 0<=y<-1; 0<=z<-1 cheshire symop x,y,z symop -x+1/2,-y+1/2,z symop x,-y+1/2,-z+1/2 symop -x+1/2,y,-z+1/2 cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup begin_spacegroup number 94 basisop x-1/4,y-1/4,z-1/4 symbol ccp4 1094 symbol Hall ' P 4n 2n (x-1/4,y-1/4,z-1/4)' symbol xHM '' symbol old 'P 42 21 2a' symbol laue '-P 4 2' '4/mmm' symbol patt '-P 4 2' '4/mmm' symbol pgrp ' P 4 2' '422' hklasu ccp4 'h>=k and k>=0 and l>=0' mapasu ccp4 0<=x<=1/2; 0<=y<=1/2; 0<=z<=1/2 mapasu zero 0<=x<1; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<-1; 0<=y<-1; 0<=z<-1 cheshire symop x,y,z symop -y,x+1/2,z+1/2 symop -x+1/2,-y+1/2,z symop y+1/2,-x,z+1/2 symop x+1/2,-y,-z symop y,x,-z+1/2 symop -x,y+1/2,-z symop -y+1/2,-x+1/2,-z+1/2 cenop x,y,z end_spacegroup begin_spacegroup number 197 basisop x+1/4,y+1/4,z+1/4 symbol ccp4 1197 symbol Hall ' I 2 2 3 (x+1/4,y+1/4,z+1/4)' symbol xHM '' symbol old 'I 2 3a' symbol laue '-P 2 2 3' 'm-3' symbol patt '-I 2 2 3' 'm-3' symbol pgrp ' P 2 2 3' '23' hklasu ccp4 'h>=0 and ((l>=h and k>h) or (l=h and k=h))' mapasu ccp4 0<=x<1; 0<=y<1; 0<=z<=1/2 mapasu zero 0<=x<=1/4; 0<=y<=1/4; 0<=z<1 mapasu nonz 0<=x<-1; 0<=y<-1; 0<=z<-1 cheshire symop x,y,z symop -x+1/2,-y+1/2,z symop x,-y+1/2,-z+1/2 symop -x+1/2,y,-z+1/2 symop z,x,y symop -z+1/2,-x+1/2,y symop z,-x+1/2,-y+1/2 symop -z+1/2,x,-y+1/2 symop y,z,x symop y,-z+1/2,-x+1/2 symop -y+1/2,z,-x+1/2 symop -y+1/2,-z+1/2,x cenop x,y,z cenop x+1/2,y+1/2,z+1/2 end_spacegroup libccp4-8.0.0/data/symop.lib0000644000000000000000000022353714242731033013750 0ustar 000000000000001 1 1 P1 PG1 TRICLINIC 'P 1' X,Y,Z 2 2 2 P-1 PG1bar TRICLINIC 'P -1' X,Y,Z -X,-Y,-Z 3 2 2 P2 PG2 MONOCLINIC 'P 1 2 1' X,Y,Z -X,Y,-Z 4 2 2 P21 PG2 MONOCLINIC 'P 1 21 1' X,Y,Z -X,Y+1/2,-Z 5 4 2 C2 PG2 MONOCLINIC 'C 1 2 1' X,Y,Z -X,Y,-Z 1/2+X,1/2+Y,Z 1/2-X,1/2+Y,-Z 6 2 2 Pm PGm MONOCLINIC 'P 1 m 1' X,Y,Z X,-Y,Z 7 2 2 Pc PGm MONOCLINIC 'P 1 c 1' X,Y,Z X,-Y,1/2+Z 8 4 2 Cm PGm MONOCLINIC 'C 1 m 1' X,Y,Z X,-Y,Z 1/2+X,1/2+Y,Z 1/2+X,1/2-Y,Z 9 4 2 Cc PGm MONOCLINIC 'C 1 c 1' X,Y,Z X,-Y,1/2+Z 1/2+X,1/2+Y,Z 1/2+X,1/2-Y,1/2+Z 10 4 4 P2/m PG2/m MONOCLINIC 'P 1 2/m 1' X,Y,Z X,-Y,Z -X,Y,-Z -X,-Y,-Z 11 4 4 P21/m PG2/m MONOCLINIC 'P 1 21/m 1' X,Y,Z -X,1/2+Y,-Z -X,-Y,-Z X,1/2-Y,Z 12 8 4 C2/m PG2/m MONOCLINIC 'C 1 2/m 1' X,Y,Z X,-Y,Z -X,Y,-Z -X,-Y,-Z 1/2+X,1/2+Y,Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,-Z 1/2-X,1/2-Y,-Z 13 4 4 P2/c PG2/m MONOCLINIC 'P 1 2/c 1' X,Y,Z -X,Y,1/2-Z -X,-Y,-Z X,-Y,1/2+Z 14 4 4 P21/c PG2/m MONOCLINIC 'P 1 21/c 1' X,Y,Z -X,-Y,-Z -X,1/2+Y,1/2-Z X,1/2-Y,1/2+Z 15 8 4 C2/c PG2/m MONOCLINIC 'C 1 2/c 1' X,Y,Z -X,Y,1/2-Z -X,-Y,-Z X,-Y,1/2+Z 1/2+X,1/2+Y,Z 1/2-X,1/2+Y,1/2-Z 1/2-X,1/2-Y,-Z 1/2+X,1/2-Y,1/2+Z 16 4 4 P222 PG222 ORTHORHOMBIC 'P 2 2 2' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z 17 4 4 P2221 PG222 ORTHORHOMBIC 'P 2 2 21' X,Y,Z -X,-Y,1/2+Z -X,Y,1/2-Z X,-Y,-Z 18 4 4 P21212 PG222 ORTHORHOMBIC 'P 21 21 2' X,Y,Z -X,-Y,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 19 4 4 P212121 PG222 ORTHORHOMBIC 'P 21 21 21' X,Y,Z 1/2-X,-Y,1/2+Z -X,1/2+Y,1/2-Z 1/2+X,1/2-Y,-Z 20 8 4 C2221 PG222 ORTHORHOMBIC 'C 2 2 21' X,Y,Z -X,-Y,1/2+Z -X,Y,1/2-Z X,-Y,-Z 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,-Z 21 8 4 C222 PG222 ORTHORHOMBIC 'C 2 2 2' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 22 16 4 F222 PG222 ORTHORHOMBIC 'F 2 2 2' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z X,1/2+Y,1/2+Z -X,1/2-Y,1/2+Z -X,1/2+Y,1/2-Z X,1/2-Y,1/2-Z 1/2+X,Y,1/2+Z 1/2-X,-Y,1/2+Z 1/2-X,Y,1/2-Z 1/2+X,-Y,1/2-Z 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 23 8 4 I222 PG222 ORTHORHOMBIC 'I 2 2 2' X,Y,Z -X,-Y,Z X,-Y,-Z -X,Y,-Z X+1/2,Y+1/2,Z+1/2 -X+1/2,-Y+1/2,Z+1/2 X+1/2,-Y+1/2,-Z+1/2 -X+1/2,Y+1/2,-Z+1/2 24 8 4 I212121 PG222 ORTHORHOMBIC 'I 21 21 21' X,Y,Z 1/2-X,-Y,1/2+Z -X,1/2+Y,1/2-Z 1/2+X,1/2-Y,-Z 1/2+X,1/2+Y,1/2+Z -X,1/2-Y,Z 1/2-X,Y,-Z X,-Y,1/2-Z 25 4 4 Pmm2 PGmm2 ORTHORHOMBIC 'P m m 2' X,Y,Z -X,-Y,Z X,-Y,Z -X,Y,Z 26 4 4 Pmc21 PGmm2 ORTHORHOMBIC 'P m c 21' X,Y,Z -X,-Y,1/2+Z X,-Y,1/2+Z -X,Y,Z 27 4 4 Pcc2 PGmm2 ORTHORHOMBIC 'P c c 2' X,Y,Z -X,-Y,Z X,-Y,1/2+Z -X,Y,1/2+Z 28 4 4 Pma2 PGmm2 ORTHORHOMBIC 'P m a 2' X,Y,Z -X,-Y,Z 1/2+X,-Y,Z 1/2-X,Y,Z 29 4 4 Pca21 PGmm2 ORTHORHOMBIC 'P c a 21' X,Y,Z -X,-Y,1/2+Z 1/2+X,-Y,Z 1/2-X,Y,1/2+Z 30 4 4 Pnc2 PGmm2 ORTHORHOMBIC 'P n c 2' X,Y,Z -X,-Y,Z X,1/2-Y,1/2+Z -X,1/2+Y,1/2+Z 31 4 4 Pmn21 PGmm2 ORTHORHOMBIC 'P m n 21' X,Y,Z 1/2-X,-Y,1/2+Z 1/2+X,-Y,1/2+Z -X,Y,Z 32 4 4 Pba2 PGmm2 ORTHORHOMBIC 'P b a 2' X,Y,Z -X,-Y,Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 33 4 4 Pna21 PGmm2 ORTHORHOMBIC 'P n a 21' X,Y,Z -X,-Y,1/2+Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,1/2+Z 34 4 4 Pnn2 PGmm2 ORTHORHOMBIC 'P n n 2' X,Y,Z -X,-Y,Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 35 8 4 Cmm2 PGmm2 ORTHORHOMBIC 'C m m 2' X,Y,Z -X,-Y,Z X,-Y,Z -X,Y,Z 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 36 8 4 Cmc21 PGmm2 ORTHORHOMBIC 'C m c 21' X,Y,Z -X,-Y,1/2+Z X,-Y,1/2+Z -X,Y,Z 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,1/2+Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,Z 37 8 4 Ccc2 PGmm2 ORTHORHOMBIC 'C c c 2' X,Y,Z -X,-Y,Z X,-Y,1/2+Z -X,Y,1/2+Z 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 38 8 4 Amm2 PGmm2 ORTHORHOMBIC 'A m m 2' X,Y,Z -X,-Y,Z X,-Y,Z -X,Y,Z X,1/2+Y,1/2+Z -X,1/2-Y,1/2+Z X,1/2-Y,1/2+Z -X,1/2+Y,1/2+Z 39 8 4 Abm2 PGmm2 ORTHORHOMBIC 'A b m 2' X,Y,Z -X,-Y,Z X,1/2-Y,Z -X,1/2+Y,Z X,1/2+Y,1/2+Z -X,1/2-Y,1/2+Z X,-Y,1/2+Z -X,Y,1/2+Z 40 8 4 Ama2 PGmm2 ORTHORHOMBIC 'A m a 2' X,Y,Z -X,-Y,Z 1/2+X,-Y,Z 1/2-X,Y,Z X,1/2+Y,1/2+Z -X,1/2-Y,1/2+Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 41 8 4 Aba2 PGmm2 ORTHORHOMBIC 'A b a 2' X,Y,Z -X,-Y,Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z X,1/2+Y,1/2+Z -X,1/2-Y,1/2+Z 1/2+X,-Y,1/2+Z 1/2-X,Y,1/2+Z 42 16 4 Fmm2 PGmm2 ORTHORHOMBIC 'F m m 2' X,Y,Z -X,-Y,Z X,-Y,Z -X,Y,Z X,1/2+Y,1/2+Z -X,1/2-Y,1/2+Z X,1/2-Y,1/2+Z -X,1/2+Y,1/2+Z 1/2+X,Y,1/2+Z 1/2-X,-Y,1/2+Z 1/2+X,-Y,1/2+Z 1/2-X,Y,1/2+Z 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 43 16 4 Fdd2 PGmm2 ORTHORHOMBIC 'F d d 2' X,Y,Z -X,-Y,Z 1/4+X,1/4-Y,1/4+Z 1/4-X,1/4+Y,1/4+Z X,1/2+Y,1/2+Z -X,1/2-Y,1/2+Z 1/4+X,3/4-Y,3/4+Z 1/4-X,3/4+Y,3/4+Z 1/2+X,Y,1/2+Z 1/2-X,-Y,1/2+Z 3/4+X,1/4-Y,3/4+Z 3/4-X,1/4+Y,3/4+Z 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 3/4+X,3/4-Y,1/4+Z 3/4-X,3/4+Y,1/4+Z 44 8 4 Imm2 PGmm2 ORTHORHOMBIC 'I m m 2' X,Y,Z -X,-Y,Z X,-Y,Z -X,Y,Z 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 45 8 4 Iba2 PGmm2 ORTHORHOMBIC 'I b a 2' X,Y,Z -X,-Y,Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z X,-Y,1/2+Z -X,Y,1/2+Z 46 8 4 Ima2 PGmm2 ORTHORHOMBIC 'I m a 2' X,Y,Z -X,-Y,Z 1/2+X,-Y,Z 1/2-X,Y,Z 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z X,1/2-Y,1/2+Z -X,1/2+Y,1/2+Z 47 8 8 Pmmm PGmmm ORTHORHOMBIC 'P 2/m 2/m 2/m' 'P m m m' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z -X,-Y,-Z X,Y,-Z X,-Y,Z -X,Y,Z 48 8 8 Pnnn PGmmm ORTHORHOMBIC 'P 2/n 2/n 2/n' 'P n n n' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z 1/2-X,1/2-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 49 8 8 Pccm PGmmm ORTHORHOMBIC 'P 2/c 2/c 2/m' 'P c c m' X,Y,Z -X,-Y,Z -X,Y,1/2-Z X,-Y,1/2-Z -X,-Y,-Z X,Y,-Z X,-Y,1/2+Z -X,Y,1/2+Z 50 8 8 Pban PGmmm ORTHORHOMBIC 'P 2/b 2/a 2/n' 'P b a n' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z 1/2-X,1/2-Y,-Z 1/2+X,1/2+Y,-Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 51 8 8 Pmma PGmmm ORTHORHOMBIC 'P 21/m 2/m 2/a' 'P m m a' X,Y,Z 1/2-X,-Y,Z -X,Y,-Z 1/2+X,-Y,-Z -X,-Y,-Z 1/2+X,Y,-Z X,-Y,Z 1/2-X,Y,Z 52 8 8 Pnna PGmmm ORTHORHOMBIC 'P 2/n 21/n 2/a' 'P n n a' X,Y,Z 1/2-X,-Y,Z 1/2-X,1/2+Y,1/2-Z X,1/2-Y,1/2-Z -X,-Y,-Z 1/2+X,Y,-Z 1/2+X,1/2-Y,1/2+Z -X,1/2+Y,1/2+Z 53 8 8 Pmna PGmmm ORTHORHOMBIC 'P 2/m 2/n 21/a' 'P m n a' X,Y,Z 1/2-X,-Y,1/2+Z 1/2-X,Y,1/2-Z X,-Y,-Z -X,-Y,-Z 1/2+X,Y,1/2-Z 1/2+X,-Y,1/2+Z -X,Y,Z 54 8 8 Pcca PGmmm ORTHORHOMBIC 'P 21/c 2/c 2/a' 'P c c a' X,Y,Z 1/2-X,-Y,Z -X,Y,1/2-Z 1/2+X,-Y,1/2-Z -X,-Y,-Z 1/2+X,Y,-Z X,-Y,1/2+Z 1/2-X,Y,1/2+Z 55 8 8 Pbam PGmmm ORTHORHOMBIC 'P 21/b 21/a 2/m' 'P b a m' X,Y,Z -X,-Y,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z -X,-Y,-Z X,Y,-Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 56 8 8 Pccn PGmmm ORTHORHOMBIC 'P 21/c 21/c 2/n' 'P c c n' X,Y,Z 1/2-X,1/2-Y,Z -X,1/2+Y,1/2-Z 1/2+X,-Y,1/2-Z -X,-Y,-Z 1/2+X,1/2+Y,-Z X,1/2-Y,1/2+Z 1/2-X,Y,1/2+Z 57 8 8 Pbcm PGmmm ORTHORHOMBIC 'P 2/b 21/c 21/m' 'P b c m' X,Y,Z -X,-Y,1/2+Z -X,1/2+Y,1/2-Z X,1/2-Y,-Z -X,-Y,-Z X,Y,1/2-Z X,1/2-Y,1/2+Z -X,1/2+Y,Z 58 8 8 Pnnm PGmmm ORTHORHOMBIC 'P 21/n 21/n 2/m' 'P n n m' X,Y,Z -X,-Y,Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2-Z -X,-Y,-Z X,Y,-Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 59 8 8 Pmmn PGmmm ORTHORHOMBIC 'P 21/m 21/m 2/n' 'P m m n' X,Y,Z -X,-Y,Z 1/2-X,Y+1/2,-Z X+1/2,1/2-Y,-Z 1/2-X,1/2-Y,-Z X+1/2,Y+1/2,-Z X,-Y,Z -X,Y,Z 60 8 8 Pbcn PGmmm ORTHORHOMBIC 'P 21/b 2/c 21/n' 'P b c n' X,Y,Z 1/2-X,1/2-Y,1/2+Z -X,Y,1/2-Z 1/2+X,1/2-Y,-Z -X,-Y,-Z 1/2+X,1/2+Y,1/2-Z X,-Y,1/2+Z 1/2-X,1/2+Y,Z 61 8 8 Pbca PGmmm ORTHORHOMBIC 'P 21/b 21/c 21/a' 'P b c a' X,Y,Z 1/2-X,-Y,1/2+Z -X,1/2+Y,1/2-Z 1/2+X,1/2-Y,-Z -X,-Y,-Z 1/2+X,Y,1/2-Z X,1/2-Y,1/2+Z 1/2-X,1/2+Y,Z 62 8 8 Pnma PGmmm ORTHORHOMBIC 'P 21/n 21/m 21/a' 'P n m a' X,Y,Z -X+1/2,-Y,Z+1/2 -X,Y+1/2,-Z X+1/2,-Y+1/2,-Z+1/2 -X,-Y,-Z X+1/2,Y,-Z+1/2 X,-Y+1/2,Z -X+1/2,Y+1/2,Z+1/2 63 16 8 Cmcm PGmmm ORTHORHOMBIC 'C 2/m 2/c 21/m' 'C m c m' X,Y,Z -X,-Y,1/2+Z -X,Y,1/2-Z X,-Y,-Z -X,-Y,-Z X,Y,1/2-Z X,-Y,1/2+Z -X,Y,Z 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,-Z 1/2-X,1/2-Y,-Z 1/2+X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,Z 64 16 8 Cmca PGmmm ORTHORHOMBIC 'C 2/m 2/c 21/a' 'C m c a' X,Y,Z -X,1/2-Y,1/2+Z -X,1/2+Y,1/2-Z X,-Y,-Z -X,-Y,-Z X,1/2+Y,1/2-Z X,1/2-Y,1/2+Z -X,Y,Z 1/2+X,1/2+Y,Z 1/2-X,-Y,1/2+Z 1/2-X,Y,1/2-Z 1/2+X,1/2-Y,-Z 1/2-X,1/2-Y,-Z 1/2+X,Y,1/2-Z 1/2+X,-Y,1/2+Z 1/2-X,1/2+Y,Z 65 16 8 Cmmm PGmmm ORTHORHOMBIC 'C 2/m 2/m 2/m' 'C m m m' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z -X,-Y,-Z X,Y,-Z X,-Y,Z -X,Y,Z 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 1/2-X,1/2-Y,-Z 1/2+X,1/2+Y,-Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 66 16 8 Cccm PGmmm ORTHORHOMBIC 'C 2/c 2/c 2/m' 'C c c m' X,Y,Z -X,-Y,Z -X,Y,1/2-Z X,-Y,1/2-Z -X,-Y,-Z X,Y,-Z X,-Y,1/2+Z -X,Y,1/2+Z 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2-Z 1/2-X,1/2-Y,-Z 1/2+X,1/2+Y,-Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 67 16 8 Cmma PGmmm ORTHORHOMBIC 'C 2/m 2/m 2/a' 'C m m a' X,Y,Z -X,1/2-Y,Z -X,1/2+Y,-Z X,-Y,-Z -X,-Y,-Z X,1/2+Y,-Z X,1/2-Y,Z -X,Y,Z 1/2+X,1/2+Y,Z 1/2-X,-Y,Z 1/2-X,Y,-Z 1/2+X,1/2-Y,-Z 1/2-X,1/2-Y,-Z 1/2+X,Y,-Z 1/2+X,-Y,Z 1/2-X,1/2+Y,Z 68 16 8 Ccca PGmmm ORTHORHOMBIC 'C 2/c 2/c 2/a' 'C c c a' X,Y,Z 1/2-X,1/2-Y,Z -X,Y,-Z 1/2+X,1/2-Y,-Z -X,1/2-Y,1/2-Z 1/2+X,Y,1/2-Z X,1/2-Y,1/2+Z 1/2-X,Y,1/2+Z 1/2+X,1/2+Y,Z -X,-Y,Z 1/2-X,1/2+Y,-Z X,-Y,-Z 1/2-X,-Y,1/2-Z X,1/2+Y,1/2-Z 1/2+X,-Y,1/2+Z -X,1/2+Y,1/2+Z 69 32 8 Fmmm PGmmm ORTHORHOMBIC 'F 2/m 2/m 2/m' 'F m m m' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z -X,-Y,-Z X,Y,-Z X,-Y,Z -X,Y,Z X,1/2+Y,1/2+Z -X,1/2-Y,1/2+Z -X,1/2+Y,1/2-Z X,1/2-Y,1/2-Z -X,1/2-Y,1/2-Z X,1/2+Y,1/2-Z X,1/2-Y,1/2+Z -X,1/2+Y,1/2+Z 1/2+X,Y,1/2+Z 1/2-X,-Y,1/2+Z 1/2-X,Y,1/2-Z 1/2+X,-Y,1/2-Z 1/2-X,-Y,1/2-Z 1/2+X,Y,1/2-Z 1/2+X,-Y,1/2+Z 1/2-X,Y,1/2+Z 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 1/2-X,1/2-Y,-Z 1/2+X,1/2+Y,-Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 70 32 8 Fddd PGmmm ORTHORHOMBIC 'F 2/d 2/d 2/d' 'F d d d' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z 1/4-X,1/4-Y,1/4-Z 1/4+X,1/4+Y,1/4-Z 1/4+X,1/4-Y,1/4+Z 1/4-X,1/4+Y,1/4+Z X,1/2+Y,1/2+Z -X,1/2-Y,1/2+Z -X,1/2+Y,1/2-Z X,1/2-Y,1/2-Z 1/4-X,3/4-Y,3/4-Z 1/4+X,3/4+Y,3/4-Z 1/4+X,3/4-Y,3/4+Z 1/4-X,3/4+Y,3/4+Z 1/2+X,Y,1/2+Z 1/2-X,-Y,1/2+Z 1/2-X,Y,1/2-Z 1/2+X,-Y,1/2-Z 3/4-X,1/4-Y,3/4-Z 3/4+X,1/4+Y,3/4-Z 3/4+X,1/4-Y,3/4+Z 3/4-X,1/4+Y,3/4+Z 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 3/4-X,3/4-Y,1/4-Z 3/4+X,3/4+Y,1/4-Z 3/4+X,3/4-Y,1/4+Z 3/4-X,3/4+Y,1/4+Z 71 16 8 Immm PGmmm ORTHORHOMBIC 'I 2/m 2/m 2/m' 'I m m m' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z -X,-Y,-Z X,Y,-Z X,-Y,Z -X,Y,Z 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2-Z 1/2-X,1/2-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 72 16 8 Ibam PGmmm ORTHORHOMBIC 'I 2/b 2/a 2/m' 'I b a m' X,Y,Z -X,-Y,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z -X,-Y,-Z X,Y,-Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z -X,Y,1/2-Z X,-Y,1/2-Z 1/2-X,1/2-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z X,-Y,1/2+Z -X,Y,1/2+Z 73 16 8 Ibca PGmmm ORTHORHOMBIC 'I 21/b 21/c 21/a' 'I b c a' X,Y,Z 1/2-X,-Y,1/2+Z -X,1/2+Y,1/2-Z 1/2+X,1/2-Y,-Z -X,-Y,-Z 1/2+X,Y,1/2-Z X,1/2-Y,1/2+Z 1/2-X,1/2+Y,Z 1/2+X,1/2+Y,1/2+Z -X,1/2-Y,Z 1/2-X,Y,-Z X,-Y,1/2-Z 1/2-X,1/2-Y,1/2-Z X,1/2+Y,-Z 1/2+X,-Y,Z -X,Y,1/2+Z 74 16 8 Imma PGmmm ORTHORHOMBIC 'I 21/m 21/m 21/a' 'I m m a' X,Y,Z -X,1/2-Y,Z -X,1/2+Y,-Z X,-Y,-Z -X,-Y,-Z X,1/2+Y,-Z X,1/2-Y,Z -X,Y,Z 1/2+X,1/2+Y,1/2+Z 1/2-X,-Y,1/2+Z 1/2-X,Y,1/2-Z 1/2+X,1/2-Y,1/2-Z 1/2-X,1/2-Y,1/2-Z 1/2+X,Y,1/2-Z 1/2+X,-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 75 4 4 P4 PG4 TETRAGONAL 'P 4' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z 76 4 4 P41 PG4 TETRAGONAL 'P 41' X,Y,Z -X,-Y,1/2+Z -Y,X,1/4+Z Y,-X,3/4+Z 77 4 4 P42 PG4 TETRAGONAL 'P 42' X,Y,Z -X,-Y,Z -Y,X,1/2+Z Y,-X,1/2+Z 78 4 4 P43 PG4 TETRAGONAL 'P 43' X,Y,Z -X,-Y,1/2+Z -Y,X,3/4+Z Y,-X,1/4+Z 79 8 4 I4 PG4 TETRAGONAL 'I 4' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-Y,1/2+X,1/2+Z 1/2+Y,1/2-X,1/2+Z 80 8 4 I41 PG4 TETRAGONAL 'I 41' X,Y,Z 1/2-X,1/2-Y,1/2+Z -Y,1/2+X,1/4+Z 1/2+Y,-X,3/4+Z 1/2+X,1/2+Y,1/2+Z -X,-Y,Z 1/2-Y,X,3/4+Z Y,1/2-X,1/4+Z 81 4 4 P-4 PG4bar TETRAGONAL 'P -4' X,Y,Z -X,-Y,Z Y,-X,-Z -Y,X,-Z 82 8 4 I-4 PG4bar TETRAGONAL 'I -4' X,Y,Z -X,-Y,Z Y,-X,-Z -Y,X,-Z 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2+Y,1/2-X,1/2-Z 1/2-Y,1/2+X,1/2-Z 83 8 8 P4/m PG4/m TETRAGONAL 'P 4/m' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z -X,-Y,-Z X,Y,-Z Y,-X,-Z -Y,X,-Z 84 8 8 P42/m PG4/m TETRAGONAL 'P 42/m' X,Y,Z -X,-Y,Z -Y,X,1/2+Z Y,-X,1/2+Z -X,-Y,-Z X,Y,-Z Y,-X,1/2-Z -Y,X,1/2-Z 85 8 8 P4/n PG4/m TETRAGONAL 'P 4/n' X,Y,Z -X,-Y,Z 1/2-Y,1/2+X,Z 1/2+Y,1/2-X,Z 1/2-X,1/2-Y,-Z 1/2+X,1/2+Y,-Z Y,-X,-Z -Y,X,-Z 86 8 8 P42/n PG4/m TETRAGONAL 'P 42/n' X,Y,Z -X,-Y,Z 1/2-Y,1/2+X,1/2+Z 1/2+Y,1/2-X,1/2+Z 1/2-X,1/2-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z Y,-X,-Z -Y,X,-Z 87 16 8 I4/m PG4/m TETRAGONAL 'I 4/m' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z -X,-Y,-Z X,Y,-Z Y,-X,-Z -Y,X,-Z 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-Y,1/2+X,1/2+Z 1/2+Y,1/2-X,1/2+Z 1/2-X,1/2-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z 1/2+Y,1/2-X,1/2-Z 1/2-Y,1/2+X,1/2-Z 88 16 8 I41/a PG4/m TETRAGONAL 'I 41/a' X,Y,Z 1/2-X,1/2-Y,1/2+Z -Y,1/2+X,1/4+Z 1/2+Y,-X,3/4+Z -X,1/2-Y,1/4-Z 1/2+X,Y,3/4-Z Y,-X,-Z 1/2-Y,1/2+X,1/2-Z 1/2+X,1/2+Y,1/2+Z -X,-Y,Z 1/2-Y,X,3/4+Z Y,1/2-X,1/4+Z 1/2-X,-Y,3/4-Z X,1/2+Y,1/4-Z 1/2+Y,1/2-X,1/2-Z -Y,X,-Z 89 8 8 P422 PG422 TETRAGONAL 'P 4 2 2' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z -X,Y,-Z X,-Y,-Z Y,X,-Z -Y,-X,-Z 90 8 8 P4212 PG422 TETRAGONAL 'P 4 21 2' X,Y,Z -X,-Y,Z 1/2-Y,1/2+X,Z 1/2+Y,1/2-X,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z Y,X,-Z -Y,-X,-Z 91 8 8 P4122 PG422 TETRAGONAL 'P 41 2 2' X,Y,Z -X,-Y,1/2+Z -Y,X,1/4+Z Y,-X,3/4+Z -X,Y,-Z X,-Y,1/2-Z Y,X,3/4-Z -Y,-X,1/4-Z 92 8 8 P41212 PG422 TETRAGONAL 'P 41 21 2' X,Y,Z -X,-Y,1/2+Z 1/2-Y,1/2+X,1/4+Z 1/2+Y,1/2-X,3/4+Z 1/2-X,1/2+Y,1/4-Z 1/2+X,1/2-Y,3/4-Z Y,X,-Z -Y,-X,1/2-Z 93 8 8 P4222 PG422 TETRAGONAL 'P 42 2 2' X,Y,Z -X,-Y,Z -Y,X,1/2+Z Y,-X,1/2+Z -X,Y,-Z X,-Y,-Z Y,X,1/2-Z -Y,-X,1/2-Z 94 8 8 P42212 PG422 TETRAGONAL 'P 42 21 2' X,Y,Z -X,-Y,Z 1/2-Y,1/2+X,1/2+Z 1/2+Y,1/2-X,1/2+Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2-Z Y,X,-Z -Y,-X,-Z 95 8 8 P4322 PG422 TETRAGONAL 'P 43 2 2' X,Y,Z -X,-Y,1/2+Z -Y,X,3/4+Z Y,-X,1/4+Z -X,Y,-Z X,-Y,1/2-Z Y,X,1/4-Z -Y,-X,3/4-Z 96 8 8 P43212 PG422 TETRAGONAL 'P 43 21 2' X,Y,Z -X,-Y,1/2+Z 1/2-Y,1/2+X,3/4+Z 1/2+Y,1/2-X,1/4+Z 1/2-X,1/2+Y,3/4-Z 1/2+X,1/2-Y,1/4-Z Y,X,-Z -Y,-X,1/2-Z 97 16 8 I422 PG422 TETRAGONAL 'I 4 2 2' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z -X,Y,-Z X,-Y,-Z Y,X,-Z -Y,-X,-Z 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-Y,1/2+X,1/2+Z 1/2+Y,1/2-X,1/2+Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2-Z 1/2+Y,1/2+X,1/2-Z 1/2-Y,1/2-X,1/2-Z 98 16 8 I4122 PG422 TETRAGONAL 'I 41 2 2' X,Y,Z 1/2-X,1/2-Y,1/2+Z -Y,1/2+X,1/4+Z 1/2+Y,-X,3/4+Z 1/2-X,Y,3/4-Z X,1/2-Y,1/4-Z 1/2+Y,1/2+X,1/2-Z -Y,-X,-Z 1/2+X,1/2+Y,1/2+Z -X,-Y,Z 1/2-Y,X,3/4+Z Y,1/2-X,1/4+Z -X,1/2+Y,1/4-Z 1/2+X,-Y,3/4-Z Y,X,-Z 1/2-Y,1/2-X,1/2-Z 99 8 8 P4mm PG4mm TETRAGONAL 'P 4 m m' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z X,-Y,Z -X,Y,Z -Y,-X,Z Y,X,Z 100 8 8 P4bm PG4mm TETRAGONAL 'P 4 b m' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 1/2-Y,1/2-X,Z 1/2+Y,1/2+X,Z 101 8 8 P42cm PG4mm TETRAGONAL 'P 42 c m' X,Y,Z -X,-Y,Z -Y,X,1/2+Z Y,-X,1/2+Z X,-Y,1/2+Z -X,Y,1/2+Z -Y,-X,Z Y,X,Z 102 8 8 P42nm PG4mm TETRAGONAL 'P 42 n m' X,Y,Z -X,-Y,Z 1/2-Y,1/2+X,1/2+Z 1/2+Y,1/2-X,1/2+Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z -Y,-X,Z Y,X,Z 103 8 8 P4cc PG4mm TETRAGONAL 'P 4 c c' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z X,-Y,1/2+Z -X,Y,1/2+Z -Y,-X,1/2+Z Y,X,1/2+Z 104 8 8 P4nc PG4mm TETRAGONAL 'P 4 n c' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2+X,1/2+Z 105 8 8 P42mc PG4mm TETRAGONAL 'P 42 m c' X,Y,Z -X,-Y,Z -Y,X,1/2+Z Y,-X,1/2+Z X,-Y,Z -X,Y,Z -Y,-X,1/2+Z Y,X,1/2+Z 106 8 8 P42bc PG4mm TETRAGONAL 'P 42 b c' X,Y,Z -X,-Y,Z -Y,X,1/2+Z Y,-X,1/2+Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2+X,1/2+Z 107 16 8 I4mm PG4mm TETRAGONAL 'I 4 m m' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z X,-Y,Z -X,Y,Z -Y,-X,Z Y,X,Z 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-Y,1/2+X,1/2+Z 1/2+Y,1/2-X,1/2+Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2+X,1/2+Z 108 16 8 I4cm PG4mm TETRAGONAL 'I 4 c m' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z X,-Y,1/2+Z -X,Y,1/2+Z -Y,-X,1/2+Z Y,X,1/2+Z 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-Y,1/2+X,1/2+Z 1/2+Y,1/2-X,1/2+Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 1/2-Y,1/2-X,Z 1/2+Y,1/2+X,Z 109 16 8 I41md PG4mm TETRAGONAL 'I 41 m d' X,Y,Z 1/2-X,1/2-Y,1/2+Z -Y,1/2+X,1/4+Z 1/2+Y,-X,3/4+Z X,-Y,Z 1/2-X,1/2+Y,1/2+Z -Y,1/2-X,1/4+Z 1/2+Y,X,3/4+Z 1/2+X,1/2+Y,1/2+Z -X,-Y,Z 1/2-Y,X,3/4+Z Y,1/2-X,1/4+Z 1/2+X,1/2-Y,1/2+Z -X,Y,Z 1/2-Y,-X,3/4+Z Y,1/2+X,1/4+Z 110 16 8 I41cd PG4mm TETRAGONAL 'I 41 c d' X,Y,Z 1/2-X,1/2-Y,1/2+Z -Y,1/2+X,1/4+Z 1/2+Y,-X,3/4+Z X,-Y,1/2+Z 1/2-X,1/2+Y,Z -Y,1/2-X,3/4+Z 1/2+Y,X,1/4+Z 1/2+X,1/2+Y,1/2+Z -X,-Y,Z 1/2-Y,X,3/4+Z Y,1/2-X,1/4+Z 1/2+X,1/2-Y,Z -X,Y,1/2+Z 1/2-Y,-X,1/4+Z Y,1/2+X,3/4+Z 111 8 8 P-42m PG4bar2m TETRAGONAL 'P -4 2 m' X,Y,Z -X,-Y,Z -Y,X,-Z Y,-X,-Z -X,Y,-Z X,-Y,-Z -Y,-X,Z Y,X,Z 112 8 8 P-42c PG4bar2m TETRAGONAL 'P -4 2 c' X,Y,Z -X,-Y,Z -Y,X,-Z Y,-X,-Z -X,Y,1/2-Z X,-Y,1/2-Z -Y,-X,1/2+Z Y,X,1/2+Z 113 8 8 P-421m PG4bar2m TETRAGONAL 'P -4 21 m' X,Y,Z -X,-Y,Z -Y,X,-Z Y,-X,-Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 1/2-Y,1/2-X,Z 1/2+Y,1/2+X,Z 114 8 8 P-421c PG4bar2m TETRAGONAL 'P -4 21 c' X,Y,Z -X,-Y,Z -Y,X,-Z Y,-X,-Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2-Z 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2+X,1/2+Z 115 8 8 P-4m2 PG4barm2 TETRAGONAL 'P -4 m 2' X,Y,Z -X,-Y,Z Y,-X,-Z -Y,X,-Z X,-Y,Z -X,Y,Z Y,X,-Z -Y,-X,-Z 116 8 8 P-4c2 PG4barm2 TETRAGONAL 'P -4 c 2' X,Y,Z -X,-Y,Z -Y,X,-Z Y,-X,-Z X,-Y,1/2+Z -X,Y,1/2+Z Y,X,1/2-Z -Y,-X,1/2-Z 117 8 8 P-4b2 PG4barm2 TETRAGONAL 'P -4 b 2' X,Y,Z -X,-Y,Z -Y,X,-Z Y,-X,-Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 1/2+Y,1/2+X,-Z 1/2-Y,1/2-X,-Z 118 8 8 P-4n2 PG4barm2 TETRAGONAL 'P -4 n 2' X,Y,Z -X,-Y,Z -Y,X,-Z Y,-X,-Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 1/2+Y,1/2+X,1/2-Z 1/2-Y,1/2-X,1/2-Z 119 16 8 I-4m2 PG4barm2 TETRAGONAL 'I -4 m 2' X,Y,Z -X,-Y,Z -Y,X,-Z Y,-X,-Z X,-Y,Z -X,Y,Z Y,X,-Z -Y,-X,-Z 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-Y,1/2+X,1/2-Z 1/2+Y,1/2-X,1/2-Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 1/2+Y,1/2+X,1/2-Z 1/2-Y,1/2-X,1/2-Z 120 16 8 I-4c2 PG4barm2 TETRAGONAL 'I -4 c 2' X,Y,Z -X,-Y,Z -Y,X,-Z Y,-X,-Z X,-Y,1/2+Z -X,Y,1/2+Z Y,X,1/2-Z -Y,-X,1/2-Z 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-Y,1/2+X,1/2-Z 1/2+Y,1/2-X,1/2-Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 1/2+Y,1/2+X,-Z 1/2-Y,1/2-X,-Z 121 16 8 I-42m PG4bar2m TETRAGONAL 'I -4 2 m' X,Y,Z -X,-Y,Z -Y,X,-Z Y,-X,-Z -X,Y,-Z X,-Y,-Z -Y,-X,Z Y,X,Z 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-Y,1/2+X,1/2-Z 1/2+Y,1/2-X,1/2-Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2-Z 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2+X,1/2+Z 122 16 8 I-42d PG4bar2m TETRAGONAL 'I -4 2 d' X,Y,Z -X,-Y,Z -Y,X,-Z Y,-X,-Z 1/2-X,Y,3/4-Z 1/2+X,-Y,3/4-Z 1/2-Y,-X,3/4+Z 1/2+Y,X,3/4+Z 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-Y,1/2+X,1/2-Z 1/2+Y,1/2-X,1/2-Z -X,1/2+Y,1/4-Z X,1/2-Y,1/4-Z -Y,1/2-X,1/4+Z Y,1/2+X,1/4+Z 123 16 16 P4/mmm PG4/mmm TETRAGONAL 'P 4/m 2/m 2/m' 'P4/m m m' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z -X,Y,-Z X,-Y,-Z Y,X,-Z -Y,-X,-Z -X,-Y,-Z X,Y,-Z Y,-X,-Z -Y,X,-Z X,-Y,Z -X,Y,Z -Y,-X,Z Y,X,Z 124 16 16 P4/mcc PG4/mmm TETRAGONAL 'P 4/m 2/c 2/c' 'P4/m c c' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z -X,Y,1/2-Z X,-Y,1/2-Z Y,X,1/2-Z -Y,-X,1/2-Z -X,-Y,-Z X,Y,-Z Y,-X,-Z -Y,X,-Z X,-Y,1/2+Z -X,Y,1/2+Z -Y,-X,1/2+Z Y,X,1/2+Z 125 16 16 P4/nbm PG4/mmm TETRAGONAL 'P 4/n 2/b 2/m' 'P4/n b m' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z -X,Y,-Z X,-Y,-Z Y,X,-Z -Y,-X,-Z 1/2-X,1/2-Y,-Z 1/2+X,1/2+Y,-Z 1/2+Y,1/2-X,-Z 1/2-Y,1/2+X,-Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 1/2-Y,1/2-X,Z 1/2+Y,1/2+X,Z 126 16 16 P4/nnc PG4/mmm TETRAGONAL 'P 4/n 2/n 2/c' 'P4/n n c' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z -X,Y,-Z X,-Y,-Z Y,X,-Z -Y,-X,-Z 1/2-X,1/2-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z 1/2+Y,1/2-X,1/2-Z 1/2-Y,1/2+X,1/2-Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2+X,1/2+Z 127 16 16 P4/mbm PG4/mmm TETRAGONAL 'P 4/m 21/b 2/m' 'P4/m b m' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 1/2+Y,1/2+X,-Z 1/2-Y,1/2-X,-Z -X,-Y,-Z X,Y,-Z Y,-X,-Z -Y,X,-Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 1/2-Y,1/2-X,Z 1/2+Y,1/2+X,Z 128 16 16 P4/mnc PG4/mmm TETRAGONAL 'P 4/m 21/n 2/c' 'P4/m n c' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2-Z 1/2+Y,1/2+X,1/2-Z 1/2-Y,1/2-X,1/2-Z -X,-Y,-Z X,Y,-Z Y,-X,-Z -Y,X,-Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2+X,1/2+Z 129 16 16 P4/nmm PG4/mmm TETRAGONAL 'P 4/n 21/m 2/m' 'P4/n m m' X,Y,Z -X,-Y,Z 1/2-Y,1/2+X,Z 1/2+Y,1/2-X,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z Y,X,-Z -Y,-X,-Z 1/2-X,1/2-Y,-Z 1/2+X,1/2+Y,-Z Y,-X,-Z -Y,X,-Z X,-Y,Z -X,Y,Z 1/2-Y,1/2-X,Z 1/2+Y,1/2+X,Z 130 16 16 P4/ncc PG4/mmm TETRAGONAL 'P 4/n 2/c 2/c' 'P4/n c c' X,Y,Z -X,-Y,Z 1/2-Y,1/2+X,Z 1/2+Y,1/2-X,Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2-Z Y,X,1/2-Z -Y,-X,1/2-Z 1/2-X,1/2-Y,-Z 1/2+X,1/2+Y,-Z Y,-X,-Z -Y,X,-Z X,-Y,1/2+Z -X,Y,1/2+Z 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2+X,1/2+Z 131 16 16 P42/mmc PG4/mmm TETRAGONAL 'P 42/m 2/m 2/c' 'P42/m m c' X,Y,Z -X,-Y,Z -Y,X,1/2+Z Y,-X,1/2+Z -X,Y,-Z X,-Y,-Z Y,X,1/2-Z -Y,-X,1/2-Z -X,-Y,-Z X,Y,-Z Y,-X,1/2-Z -Y,X,1/2-Z X,-Y,Z -X,Y,Z -Y,-X,1/2+Z Y,X,1/2+Z 132 16 16 P42/mcm PG4/mmm TETRAGONAL 'P 42/m 2/c 2/m' 'P42/m c m' X,Y,Z -X,-Y,Z -Y,X,1/2+Z Y,-X,1/2+Z -X,Y,1/2-Z X,-Y,1/2-Z Y,X,-Z -Y,-X,-Z -X,-Y,-Z X,Y,-Z Y,-X,1/2-Z -Y,X,1/2-Z X,-Y,1/2+Z -X,Y,1/2+Z -Y,-X,Z Y,X,Z 133 16 16 P42/nbc PG4/mmm TETRAGONAL 'P 42/n 2/b 2/c' 'P42/n b c' X,Y,Z -X,-Y,Z 1/2-Y,1/2+X,1/2+Z 1/2+Y,1/2-X,1/2+Z -X,Y,1/2-Z X,-Y,1/2-Z 1/2+Y,1/2+X,-Z 1/2-Y,1/2-X,-Z 1/2-X,1/2-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z Y,-X,-Z -Y,X,-Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z -Y,-X,1/2+Z Y,X,1/2+Z 134 16 16 P42/nnm PG4/mmm TETRAGONAL 'P 42/n 2/n 2/m' 'P42/n n m' X,Y,Z -X,-Y,Z 1/2-Y,1/2+X,1/2+Z 1/2+Y,1/2-X,1/2+Z -X,Y,-Z X,-Y,-Z 1/2+Y,1/2+X,1/2-Z 1/2-Y,1/2-X,1/2-Z 1/2-X,1/2-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z Y,-X,-Z -Y,X,-Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z -Y,-X,Z Y,X,Z 135 16 16 P42/mbc PG4/mmm TETRAGONAL 'P 42/m 21/b 2/c' 'P42/m b c' X,Y,Z -X,-Y,Z -Y,X,1/2+Z Y,-X,1/2+Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 1/2+Y,1/2+X,1/2-Z 1/2-Y,1/2-X,1/2-Z -X,-Y,-Z X,Y,-Z Y,-X,1/2-Z -Y,X,1/2-Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2+X,1/2+Z 136 16 16 P42/mnm PG4/mmm TETRAGONAL 'P 42/m 21/n 2/m' 'P42/m n m' X,Y,Z -X,-Y,Z 1/2-Y,X+1/2,Z+1/2 Y+1/2,1/2-X,Z+1/2 1/2-X,Y+1/2,1/2-Z X+1/2,1/2-Y,1/2-Z Y,X,-Z -Y,-X,-Z -X,-Y,-Z X,Y,-Z Y+1/2,1/2-X,1/2-Z 1/2-Y,X+1/2,1/2-Z X+1/2,1/2-Y,Z+1/2 1/2-X,Y+1/2,Z+1/2 -Y,-X,Z Y,X,Z 137 16 16 P42/nmc PG4/mmm TETRAGONAL 'P 42/n 21/m 2/c' 'P42/n m c' X,Y,Z -X,-Y,Z 1/2-Y,1/2+X,1/2+Z 1/2+Y,1/2-X,1/2+Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2-Z Y,X,-Z -Y,-X,-Z 1/2-X,1/2-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z Y,-X,-Z -Y,X,-Z X,-Y,Z -X,Y,Z 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2+X,1/2+Z 138 16 16 P42/ncm PG4/mmm TETRAGONAL 'P 42/n 21/c 2/m' 'P42/n c m' X,Y,Z -X,-Y,Z 1/2-Y,1/2+X,1/2+Z 1/2+Y,1/2-X,1/2+Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z Y,X,1/2-Z -Y,-X,1/2-Z 1/2-X,1/2-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z Y,-X,-Z -Y,X,-Z X,-Y,1/2+Z -X,Y,1/2+Z 1/2-Y,1/2-X,Z 1/2+Y,1/2+X,Z 139 32 16 I4/mmm PG4/mmm TETRAGONAL 'I 4/m 2/m 2/m' 'I4/m m m' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z -X,Y,-Z X,-Y,-Z Y,X,-Z -Y,-X,-Z -X,-Y,-Z X,Y,-Z Y,-X,-Z -Y,X,-Z X,-Y,Z -X,Y,Z -Y,-X,Z Y,X,Z 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-Y,1/2+X,1/2+Z 1/2+Y,1/2-X,1/2+Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2-Z 1/2+Y,1/2+X,1/2-Z 1/2-Y,1/2-X,1/2-Z 1/2-X,1/2-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z 1/2+Y,1/2-X,1/2-Z 1/2-Y,1/2+X,1/2-Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2+X,1/2+Z 140 32 16 I4/mcm PG4/mmm TETRAGONAL 'I 4/m 2/c 2/m' 'I4/m c m' X,Y,Z -X,-Y,Z -Y,X,Z Y,-X,Z -X,Y,1/2-Z X,-Y,1/2-Z Y,X,1/2-Z -Y,-X,1/2-Z -X,-Y,-Z X,Y,-Z Y,-X,-Z -Y,X,-Z X,-Y,1/2+Z -X,Y,1/2+Z -Y,-X,1/2+Z Y,X,1/2+Z 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-Y,1/2+X,1/2+Z 1/2+Y,1/2-X,1/2+Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 1/2+Y,1/2+X,-Z 1/2-Y,1/2-X,-Z 1/2-X,1/2-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z 1/2+Y,1/2-X,1/2-Z 1/2-Y,1/2+X,1/2-Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 1/2-Y,1/2-X,Z 1/2+Y,1/2+X,Z 141 32 16 I41/amd PG4/mmm TETRAGONAL 'I 41/a 2/m 2/d' 'I41/a m d' X,Y,Z 1/2-X,1/2-Y,1/2+Z -Y,1/2+X,1/4+Z 1/2+Y,-X,3/4+Z 1/2-X,Y,3/4-Z X,1/2-Y,1/4-Z 1/2+Y,1/2+X,1/2-Z -Y,-X,-Z -X,1/2-Y,1/4-Z 1/2+X,Y,3/4-Z Y,-X,-Z 1/2-Y,1/2+X,1/2-Z 1/2+X,1/2-Y,1/2+Z -X,Y,Z 1/2-Y,-X,3/4+Z Y,1/2+X,1/4+Z 1/2+X,1/2+Y,1/2+Z -X,-Y,Z 1/2-Y,X,3/4+Z Y,1/2-X,1/4+Z -X,1/2+Y,1/4-Z 1/2+X,-Y,3/4-Z Y,X,-Z 1/2-Y,1/2-X,1/2-Z 1/2-X,-Y,3/4-Z X,1/2+Y,1/4-Z 1/2+Y,1/2-X,1/2-Z -Y,X,-Z X,-Y,Z 1/2-X,1/2+Y,1/2+Z -Y,1/2-X,1/4+Z 1/2+Y,X,3/4+Z 142 32 16 I41/acd PG4/mmm TETRAGONAL 'I 41/a 2/c 2/d' 'I41/a c d' X,Y,Z 1/2-X,1/2-Y,1/2+Z -Y,1/2+X,1/4+Z 1/2+Y,-X,3/4+Z 1/2-X,Y,1/4-Z X,1/2-Y,3/4-Z 1/2+Y,1/2+X,-Z -Y,-X,1/2-Z -X,1/2-Y,1/4-Z 1/2+X,Y,3/4-Z Y,-X,-Z 1/2-Y,1/2+X,1/2-Z 1/2+X,1/2-Y,Z -X,Y,1/2+Z 1/2-Y,-X,1/4+Z Y,1/2+X,3/4+Z 1/2+X,1/2+Y,1/2+Z -X,-Y,Z 1/2-Y,X,3/4+Z Y,1/2-X,1/4+Z -X,1/2+Y,3/4-Z 1/2+X,-Y,1/4-Z Y,X,1/2-Z 1/2-Y,1/2-X,-Z 1/2-X,-Y,3/4-Z X,1/2+Y,1/4-Z 1/2+Y,1/2-X,1/2-Z -Y,X,-Z X,-Y,1/2+Z 1/2-X,1/2+Y,Z -Y,1/2-X,3/4+Z 1/2+Y,X,1/4+Z 143 3 3 P3 PG3 TRIGONAL 'P 3' X,Y,Z -Y,X-Y,Z Y-X,-X,Z 144 3 3 P31 PG3 TRIGONAL 'P 31' X,Y,Z -Y,X-Y,Z+1/3 Y-X,-X,Z+2/3 145 3 3 P32 PG3 TRIGONAL 'P 32' X,Y,Z -Y,X-Y,Z+2/3 Y-X,-X,Z+1/3 146 9 3 H3 PG3 TRIGONAL 'H 3' X,Y,Z -Y,X-Y,Z Y-X,-X,Z X+2/3,Y+1/3,Z+1/3 -Y+2/3,X-Y+1/3,Z+1/3 Y-X+2/3,-X+1/3,Z+1/3 X+1/3,Y+2/3,Z+2/3 -Y+1/3,X-Y+2/3,Z+2/3 Y-X+1/3,-X+2/3,Z+2/3 1146 3 3 R3 PG3 TRIGONAL 'R 3' X,Y,Z Z,X,Y Y,Z,X 147 6 6 P-3 PG3bar TRIGONAL 'P -3' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -X,-Y,-Z Y,Y-X,-Z X-Y,X,-Z 148 18 6 H-3 PG3bar TRIGONAL 'H -3' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -X,-Y,-Z Y,Y-X,-Z X-Y,X,-Z 2/3+X,1/3+Y,1/3+Z 2/3-Y,1/3+X-Y,1/3+Z 2/3+Y-X,1/3-X,1/3+Z 2/3-X,1/3-Y,1/3-Z 2/3+Y,1/3+Y-X,1/3-Z 2/3+X-Y,1/3+X,1/3-Z 1/3+X,2/3+Y,2/3+Z 1/3-Y,2/3+X-Y,2/3+Z 1/3+Y-X,2/3-X,2/3+Z 1/3-X,2/3-Y,2/3-Z 1/3+Y,2/3+Y-X,2/3-Z 1/3+X-Y,2/3+X,2/3-Z 1148 6 6 R-3 PG3bar TRIGONAL 'R -3' X,Y,Z Z,X,Y Y,Z,X -X,-Y,-Z -Z,-X,-Y -Y,-Z,-X 149 6 6 P312 PG312 TRIGONAL 'P 3 1 2' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -Y,-X,-Z Y-X,Y,-Z X,X-Y,-Z 150 6 6 P321 PG321 TRIGONAL 'P 3 2 1' X,Y,Z -Y,X-Y,Z Y-X,-X,Z Y,X,-Z X-Y,-Y,-Z -X,Y-X,-Z 151 6 6 P3112 PG312 TRIGONAL 'P 31 1 2' X,Y,Z -Y,X-Y,1/3+Z Y-X,-X,2/3+Z -Y,-X,2/3-Z Y-X,Y,1/3-Z X,X-Y,-Z 152 6 6 P3121 PG321 TRIGONAL 'P 31 2 1' X,Y,Z -Y,X-Y,Z+1/3 Y-X,-X,Z+2/3 Y,X,-Z X-Y,-Y,2/3-Z -X,Y-X,1/3-Z 153 6 6 P3212 PG312 TRIGONAL 'P 32 1 2' X,Y,Z -Y,X-Y,2/3+Z Y-X,-X,1/3+Z -Y,-X,1/3-Z Y-X,Y,2/3-Z X,X-Y,-Z 154 6 6 P3221 PG321 TRIGONAL 'P 32 2 1' X,Y,Z -Y,X-Y,Z+2/3 Y-X,-X,Z+1/3 Y,X,-Z X-Y,-Y,1/3-Z -X,Y-X,2/3-Z 155 18 6 H32 PG321 TRIGONAL 'H 3 2' X,Y,Z -Y,X-Y,Z Y-X,-X,Z Y,X,-Z X-Y,-Y,-Z -X,Y-X,-Z 2/3+X,1/3+Y,1/3+Z 2/3-Y,1/3+X-Y,1/3+Z 2/3+Y-X,1/3-X,1/3+Z 2/3+Y,1/3+X,1/3-Z 2/3+X-Y,1/3-Y,1/3-Z 2/3-X,1/3+Y-X,1/3-Z 1/3+X,2/3+Y,2/3+Z 1/3-Y,2/3+X-Y,2/3+Z 1/3+Y-X,2/3-X,2/3+Z 1/3+Y,2/3+X,2/3-Z 1/3+X-Y,2/3-Y,2/3-Z 1/3-X,2/3+Y-X,2/3-Z 1155 6 6 R32 PG32 TRIGONAL 'R 3 2' X,Y,Z Z,X,Y Y,Z,X -Y,-X,-Z -X,-Z,-Y -Z,-Y,-X 156 6 6 P3m1 PG3m1 TRIGONAL 'P 3 m 1' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -Y,-X,Z Y-X,Y,Z X,X-Y,Z 157 6 6 P31m PG31m TRIGONAL 'P 3 1 m' X,Y,Z -Y,X-Y,Z Y-X,-X,Z Y,X,Z X-Y,-Y,Z -X,Y-X,Z 158 6 6 P3c1 PG3m1 TRIGONAL 'P 3 c 1' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -Y,-X,1/2+Z Y-X,Y,1/2+Z X,X-Y,1/2+Z 159 6 6 P31c PG31m TRIGONAL 'P 3 1 c' X,Y,Z -Y,X-Y,Z Y-X,-X,Z Y,X,1/2+Z X-Y,-Y,1/2+Z -X,Y-X,1/2+Z 160 18 6 H3m PG3m TRIGONAL 'H 3 m' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -Y,-X,Z Y-X,Y,Z X,X-Y,Z 2/3+X,1/3+Y,1/3+Z 2/3-Y,1/3+X-Y,1/3+Z 2/3+Y-X,1/3-X,1/3+Z 2/3-Y,1/3-X,1/3+Z 2/3+Y-X,1/3+Y,1/3+Z 2/3+X,1/3+X-Y,1/3+Z 1/3+X,2/3+Y,2/3+Z 1/3-Y,2/3+X-Y,2/3+Z 1/3+Y-X,2/3-X,2/3+Z 1/3-Y,2/3-X,2/3+Z 1/3+Y-X,2/3+Y,2/3+Z 1/3+X,2/3+X-Y,2/3+Z 1160 6 6 R3m PG3m TRIGONAL 'R 3 m' X,Y,Z Z,X,Y Y,Z,X Y,X,Z X,Z,Y Z,Y,X 161 18 6 H3c PG3m TRIGONAL 'H 3 c' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -Y,-X,1/2+Z Y-X,Y,1/2+Z X,X-Y,1/2+Z 2/3+X,1/3+Y,1/3+Z 2/3-Y,1/3+X-Y,1/3+Z 2/3+Y-X,1/3-X,1/3+Z 2/3-Y,1/3-X,5/6+Z 2/3+Y-X,1/3+Y,5/6+Z 2/3+X,1/3+X-Y,5/6+Z 1/3+X,2/3+Y,2/3+Z 1/3-Y,2/3+X-Y,2/3+Z 1/3+Y-X,2/3-X,2/3+Z 1/3-Y,2/3-X,1/6+Z 1/3+Y-X,2/3+Y,1/6+Z 1/3+X,2/3+X-Y,1/6+Z 1161 6 6 R3c PG3m TRIGONAL 'R 3 c' X,Y,Z Z,X,Y Y,Z,X Y+1/2,X+1/2,Z+1/2 X+1/2,Z+1/2,Y+1/2 Z+1/2,Y+1/2,X+1/2 162 12 12 P-31m PG3bar1m TRIGONAL 'P -3 1 2/m' 'P -3 1 m' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -Y,-X,-Z Y-X,Y,-Z X,X-Y,-Z -X,-Y,-Z Y,Y-X,-Z X-Y,X,-Z Y,X,Z X-Y,-Y,Z -X,Y-X,Z 163 12 12 P-31c PG3bar1m TRIGONAL 'P -3 1 2/c' 'P -3 1 c' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -Y,-X,1/2-Z Y-X,Y,1/2-Z X,X-Y,1/2-Z -X,-Y,-Z Y,Y-X,-Z X-Y,X,-Z Y,X,1/2+Z X-Y,-Y,1/2+Z -X,Y-X,1/2+Z 164 12 12 P-3m1 PG3barm1 TRIGONAL 'P -3 2/m 1' 'P -3 m 1' X,Y,Z -Y,X-Y,Z Y-X,-X,Z Y,X,-Z X-Y,-Y,-Z -X,Y-X,-Z -X,-Y,-Z Y,Y-X,-Z X-Y,X,-Z -Y,-X,Z Y-X,Y,Z X,X-Y,Z 165 12 12 P-3c1 PG3barm1 TRIGONAL 'P -3 2/c 1' 'P -3 c 1' X,Y,Z -Y,X-Y,Z Y-X,-X,Z Y,X,1/2-Z X-Y,-Y,1/2-Z -X,Y-X,1/2-Z -X,-Y,-Z Y,Y-X,-Z X-Y,X,-Z -Y,-X,1/2+Z Y-X,Y,1/2+Z X,X-Y,1/2+Z 166 36 12 H-3m PG3barm TRIGONAL 'H -3 2/m' 'H -3 m' X,Y,Z -Y,X-Y,Z Y-X,-X,Z Y,X,-Z X-Y,-Y,-Z -X,Y-X,-Z -X,-Y,-Z Y,Y-X,-Z X-Y,X,-Z -Y,-X,Z Y-X,Y,Z X,X-Y,Z 2/3+X,1/3+Y,1/3+Z 2/3-Y,1/3+X-Y,1/3+Z 2/3+Y-X,1/3-X,1/3+Z 2/3+Y,1/3+X,1/3-Z 2/3+X-Y,1/3-Y,1/3-Z 2/3-X,1/3+Y-X,1/3-Z 2/3-X,1/3-Y,1/3-Z 2/3+Y,1/3+Y-X,1/3-Z 2/3+X-Y,1/3+X,1/3-Z 2/3-Y,1/3-X,1/3+Z 2/3+Y-X,1/3+Y,1/3+Z 2/3+X,1/3+X-Y,1/3+Z 1/3+X,2/3+Y,2/3+Z 1/3-Y,2/3+X-Y,2/3+Z 1/3+Y-X,2/3-X,2/3+Z 1/3+Y,2/3+X,2/3-Z 1/3+X-Y,2/3-Y,2/3-Z 1/3-X,2/3+Y-X,2/3-Z 1/3-X,2/3-Y,2/3-Z 1/3+Y,2/3+Y-X,2/3-Z 1/3+X-Y,2/3+X,2/3-Z 1/3-Y,2/3-X,2/3+Z 1/3+Y-X,2/3+Y,2/3+Z 1/3+X,2/3+X-Y,2/3+Z 1166 12 12 R-3m PG3barm TRIGONAL 'R -3 2/m' 'R -3 m' X,Y,Z Z,X,Y Y,Z,X -Y,-X,-Z -X,-Z,-Y -Z,-Y,-X -X,-Y,-Z -Z,-X,-Y -Y,-Z,-X Y,X,Z X,Z,Y Z,Y,X 167 36 12 H-3c PG3barm TRIGONAL 'H -3 2/c' 'H -3 c' X,Y,Z -Y,X-Y,Z Y-X,-X,Z Y,X,1/2-Z X-Y,-Y,1/2-Z -X,Y-X,1/2-Z -X,-Y,-Z Y,Y-X,-Z X-Y,X,-Z -Y,-X,1/2+Z Y-X,Y,1/2+Z X,X-Y,1/2+Z 2/3+X,1/3+Y,1/3+Z 2/3-Y,1/3+X-Y,1/3+Z 2/3+Y-X,1/3-X,1/3+Z 2/3+Y,1/3+X,5/6-Z 2/3+X-Y,1/3-Y,5/6-Z 2/3-X,1/3+Y-X,5/6-Z 2/3-X,1/3-Y,1/3-Z 2/3+Y,1/3+Y-X,1/3-Z 2/3+X-Y,1/3+X,1/3-Z 2/3-Y,1/3-X,5/6+Z 2/3+Y-X,1/3+Y,5/6+Z 2/3+X,1/3+X-Y,5/6+Z 1/3+X,2/3+Y,2/3+Z 1/3-Y,2/3+X-Y,2/3+Z 1/3+Y-X,2/3-X,2/3+Z 1/3+Y,2/3+X,1/6-Z 1/3+X-Y,2/3-Y,1/6-Z 1/3-X,2/3+Y-X,1/6-Z 1/3-X,2/3-Y,2/3-Z 1/3+Y,2/3+Y-X,2/3-Z 1/3+X-Y,2/3+X,2/3-Z 1/3-Y,2/3-X,1/6+Z 1/3+Y-X,2/3+Y,1/6+Z 1/3+X,2/3+X-Y,1/6+Z 1167 12 12 R-3c PG3barm TRIGONAL 'R -3 2/c' 'R -3 c' X,Y,Z Z,X,Y Y,Z,X -Y+1/2,-X+1/2,-Z+1/2 -X+1/2,-Z+1/2,-Y+1/2 -Z+1/2,-Y+1/2,-X+1/2 -X,-Y,-Z -Z,-X,-Y -Y,-Z,-X Y+1/2,X+1/2,Z+1/2 X+1/2,Z+1/2,Y+1/2 Z+1/2,Y+1/2,X+1/2 168 6 6 P6 PG6 HEXAGONAL 'P 6' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -X,-Y,Z Y,Y-X,Z X-Y,X,Z 169 6 6 P61 PG6 HEXAGONAL 'P 61' X,Y,Z -Y,X-Y,Z+1/3 Y-X,-X,Z+2/3 -X,-Y,Z+1/2 Y,Y-X,Z+5/6 X-Y,X,Z+1/6 170 6 6 P65 PG6 HEXAGONAL 'P 65' X,Y,Z -Y,X-Y,Z+2/3 Y-X,-X,Z+1/3 -X,-Y,Z+1/2 Y,Y-X,Z+1/6 X-Y,X,Z+5/6 171 6 6 P62 PG6 HEXAGONAL 'P 62' X,Y,Z -Y,X-Y,2/3+Z Y-X,-X,1/3+Z -X,-Y,Z Y,Y-X,2/3+Z X-Y,X,1/3+Z 172 6 6 P64 PG6 HEXAGONAL 'P 64' X,Y,Z -Y,X-Y,1/3+Z Y-X,-X,2/3+Z -X,-Y,Z Y,Y-X,1/3+Z X-Y,X,2/3+Z 173 6 6 P63 PG6 HEXAGONAL 'P 63' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -X,-Y,1/2+Z Y,Y-X,1/2+Z X-Y,X,1/2+Z 174 6 6 P-6 PG6bar HEXAGONAL 'P -6' X,Y,Z -Y,X-Y,Z Y-X,-X,Z X,Y,-Z -Y,X-Y,-Z Y-X,-X,-Z 175 12 12 P6/m PG6/m HEXAGONAL 'P 6/m' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -X,-Y,Z Y,Y-X,Z X-Y,X,Z -X,-Y,-Z Y,Y-X,-Z X-Y,X,-Z X,Y,-Z -Y,X-Y,-Z Y-X,-X,-Z 176 12 12 P63/m PG6/m HEXAGONAL 'P 63/m' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -X,-Y,1/2+Z Y,Y-X,1/2+Z X-Y,X,1/2+Z -X,-Y,-Z Y,Y-X,-Z X-Y,X,-Z X,Y,1/2-Z -Y,X-Y,1/2-Z Y-X,-X,1/2-Z 177 12 12 P622 PG622 HEXAGONAL 'P 6 2 2' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -X,-Y,Z Y,Y-X,Z X-Y,X,Z Y,X,-Z X-Y,-Y,-Z -X,Y-X,-Z -Y,-X,-Z Y-X,Y,-Z X,X-Y,-Z 178 12 12 P6122 PG622 HEXAGONAL 'P 61 2 2' X,Y,Z -Y,X-Y,1/3+Z Y-X,-X,2/3+Z -X,-Y,1/2+Z Y,Y-X,5/6+Z X-Y,X,1/6+Z Y,X,1/3-Z X-Y,-Y,-Z -X,Y-X,2/3-Z -Y,-X,5/6-Z Y-X,Y,1/2-Z X,X-Y,1/6-Z 179 12 12 P6522 PG622 HEXAGONAL 'P 65 2 2' X,Y,Z -Y,X-Y,2/3+Z Y-X,-X,1/3+Z -X,-Y,1/2+Z Y,Y-X,1/6+Z X-Y,X,5/6+Z Y,X,2/3-Z X-Y,-Y,-Z -X,Y-X,1/3-Z -Y,-X,1/6-Z Y-X,Y,1/2-Z X,X-Y,5/6-Z 180 12 12 P6222 PG622 HEXAGONAL 'P 62 2 2' X,Y,Z -Y,X-Y,2/3+Z Y-X,-X,1/3+Z -X,-Y,Z Y,Y-X,2/3+Z X-Y,X,1/3+Z Y,X,2/3-Z X-Y,-Y,-Z -X,Y-X,1/3-Z -Y,-X,2/3-Z Y-X,Y,-Z X,X-Y,1/3-Z 181 12 12 P6422 PG622 HEXAGONAL 'P 64 2 2' X,Y,Z -Y,X-Y,1/3+Z Y-X,-X,2/3+Z -X,-Y,Z Y,Y-X,1/3+Z X-Y,X,2/3+Z Y,X,1/3-Z X-Y,-Y,-Z -X,Y-X,2/3-Z -Y,-X,1/3-Z Y-X,Y,-Z X,X-Y,2/3-Z 182 12 12 P6322 PG622 HEXAGONAL 'P 63 2 2' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -X,-Y,1/2+Z Y,Y-X,1/2+Z X-Y,X,1/2+Z Y,X,-Z X-Y,-Y,-Z -X,Y-X,-Z -Y,-X,1/2-Z Y-X,Y,1/2-Z X,X-Y,1/2-Z 183 12 12 P6mm PG6mm HEXAGONAL 'P 6 m m' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -X,-Y,Z Y,Y-X,Z X-Y,X,Z -Y,-X,Z Y-X,Y,Z X,X-Y,Z Y,X,Z X-Y,-Y,Z -X,Y-X,Z 184 12 12 P6cc PG6mm HEXAGONAL 'P 6 c c' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -X,-Y,Z Y,Y-X,Z X-Y,X,Z -Y,-X,1/2+Z Y-X,Y,1/2+Z X,X-Y,1/2+Z Y,X,1/2+Z X-Y,-Y,1/2+Z -X,Y-X,1/2+Z 185 12 12 P63cm PG6mm HEXAGONAL 'P 63 c m' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -X,-Y,1/2+Z Y,Y-X,1/2+Z X-Y,X,1/2+Z -Y,-X,1/2+Z Y-X,Y,1/2+Z X,X-Y,1/2+Z Y,X,Z X-Y,-Y,Z -X,Y-X,Z 186 12 12 P63mc PG6mm HEXAGONAL 'P 63 m c' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -X,-Y,1/2+Z Y,Y-X,1/2+Z X-Y,X,1/2+Z -Y,-X,Z Y-X,Y,Z X,X-Y,Z Y,X,1/2+Z X-Y,-Y,1/2+Z -X,Y-X,1/2+Z 187 12 12 P-6m2 PG6barm2 HEXAGONAL 'P -6 m 2' X,Y,Z -Y,X-Y,Z Y-X,-X,Z X,Y,-Z -Y,X-Y,-Z Y-X,-X,-Z -Y,-X,Z Y-X,Y,Z X,X-Y,Z -Y,-X,-Z Y-X,Y,-Z X,X-Y,-Z 188 12 12 P-6c2 PG6barm2 HEXAGONAL 'P -6 c 2' X,Y,Z -Y,X-Y,Z Y-X,-X,Z X,Y,1/2-Z -Y,X-Y,1/2-Z Y-X,-X,1/2-Z -Y,-X,1/2+Z Y-X,Y,1/2+Z X,X-Y,1/2+Z -Y,-X,-Z Y-X,Y,-Z X,X-Y,-Z 189 12 12 P-62m PG6bar2m HEXAGONAL 'P -6 2 m' X,Y,Z -Y,X-Y,Z Y-X,-X,Z X,Y,-Z -Y,X-Y,-Z Y-X,-X,-Z Y,X,-Z X-Y,-Y,-Z -X,Y-X,-Z Y,X,Z X-Y,-Y,Z -X,Y-X,Z 190 12 12 P-62c PG6bar2m HEXAGONAL 'P -6 2 c' X,Y,Z -Y,X-Y,Z Y-X,-X,Z X,Y,1/2-Z -Y,X-Y,1/2-Z Y-X,-X,1/2-Z Y,X,-Z X-Y,-Y,-Z -X,Y-X,-Z Y,X,1/2+Z X-Y,-Y,1/2+Z -X,Y-X,1/2+Z 191 24 24 P6/mmm PG6/mmm HEXAGONAL 'P 6/m 2/m 2/m' 'P 6/m m m' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -X,-Y,Z Y,Y-X,Z X-Y,X,Z Y,X,-Z X-Y,-Y,-Z -X,Y-X,-Z -Y,-X,-Z Y-X,Y,-Z X,X-Y,-Z -X,-Y,-Z Y,Y-X,-Z X-Y,X,-Z X,Y,-Z Y-X,-X,-Z -Y,X-Y,-Z -Y,-X,Z Y-X,Y,Z X,X-Y,Z Y,X,Z X-Y,-Y,Z -X,Y-X,Z 192 24 24 P6/mcc PG6/mmm HEXAGONAL 'P 6/m 2/c 2/c' 'P 6/m c c' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -X,-Y,Z Y,Y-X,Z X-Y,X,Z Y,X,1/2-Z X-Y,-Y,1/2-Z -X,Y-X,1/2-Z -Y,-X,1/2-Z Y-X,Y,1/2-Z X,X-Y,1/2-Z -X,-Y,-Z Y,Y-X,-Z X-Y,X,-Z X,Y,-Z Y-X,-X,-Z -Y,X-Y,-Z -Y,-X,1/2+Z Y-X,Y,1/2+Z X,X-Y,1/2+Z Y,X,1/2+Z X-Y,-Y,1/2+Z -X,Y-X,1/2+Z 193 24 24 P63/mcm PG6/mmm HEXAGONAL 'P 63/m 2/c 2/m' 'P 63/m c m' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -X,-Y,1/2+Z Y,Y-X,1/2+Z X-Y,X,1/2+Z Y,X,1/2-Z X-Y,-Y,1/2-Z -X,Y-X,1/2-Z -Y,-X,-Z Y-X,Y,-Z X,X-Y,-Z -X,-Y,-Z Y,Y-X,-Z X-Y,X,-Z X,Y,1/2-Z Y-X,-X,1/2-Z -Y,X-Y,1/2-Z -Y,-X,1/2+Z Y-X,Y,1/2+Z X,X-Y,1/2+Z Y,X,Z X-Y,-Y,Z -X,Y-X,Z 194 24 24 P63/mmc PG6/mmm HEXAGONAL 'P 63/m 2/m 2/c' 'P 63/m m c' X,Y,Z -Y,X-Y,Z Y-X,-X,Z -X,-Y,1/2+Z Y,Y-X,1/2+Z X-Y,X,1/2+Z Y,X,-Z X-Y,-Y,-Z -X,Y-X,-Z -Y,-X,1/2-Z Y-X,Y,1/2-Z X,X-Y,1/2-Z -X,-Y,-Z Y,Y-X,-Z X-Y,X,-Z X,Y,1/2-Z Y-X,-X,1/2-Z -Y,X-Y,1/2-Z -Y,-X,Z Y-X,Y,Z X,X-Y,Z Y,X,1/2+Z X-Y,-Y,1/2+Z -X,Y-X,1/2+Z 195 12 12 P23 PG23 CUBIC 'P 2 3' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X 196 48 12 F23 PG23 CUBIC 'F 2 3' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X X,1/2+Y,1/2+Z -X,1/2-Y,1/2+Z -X,1/2+Y,1/2-Z X,1/2-Y,1/2-Z Z,1/2+X,1/2+Y Z,1/2-X,1/2-Y -Z,1/2-X,1/2+Y -Z,1/2+X,1/2-Y Y,1/2+Z,1/2+X -Y,1/2+Z,1/2-X Y,1/2-Z,1/2-X -Y,1/2-Z,1/2+X 1/2+X,Y,1/2+Z 1/2-X,-Y,1/2+Z 1/2-X,Y,1/2-Z 1/2+X,-Y,1/2-Z 1/2+Z,X,1/2+Y 1/2+Z,-X,1/2-Y 1/2-Z,-X,1/2+Y 1/2-Z,X,1/2-Y 1/2+Y,Z,1/2+X 1/2-Y,Z,1/2-X 1/2+Y,-Z,1/2-X 1/2-Y,-Z,1/2+X 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 1/2+Z,1/2+X,Y 1/2+Z,1/2-X,-Y 1/2-Z,1/2-X,Y 1/2-Z,1/2+X,-Y 1/2+Y,1/2+Z,X 1/2-Y,1/2+Z,-X 1/2+Y,1/2-Z,-X 1/2-Y,1/2-Z,X 197 24 12 I23 PG23 CUBIC 'I 2 3' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2-Z 1/2+Z,1/2+X,1/2+Y 1/2+Z,1/2-X,1/2-Y 1/2-Z,1/2-X,1/2+Y 1/2-Z,1/2+X,1/2-Y 1/2+Y,1/2+Z,1/2+X 1/2-Y,1/2+Z,1/2-X 1/2+Y,1/2-Z,1/2-X 1/2-Y,1/2-Z,1/2+X 198 12 12 P213 PG23 CUBIC 'P 21 3' X,Y,Z 1/2-X,-Y,1/2+Z -X,1/2+Y,1/2-Z 1/2+X,1/2-Y,-Z Z,X,Y 1/2+Z,1/2-X,-Y 1/2-Z,-X,1/2+Y -Z,1/2+X,1/2-Y Y,Z,X -Y,1/2+Z,1/2-X 1/2+Y,1/2-Z,-X 1/2-Y,-Z,1/2+X 199 24 12 I213 PG23 CUBIC 'I 21 3' X,Y,Z 1/2-X,-Y,1/2+Z -X,1/2+Y,1/2-Z 1/2+X,1/2-Y,-Z Z,X,Y 1/2+Z,1/2-X,-Y 1/2-Z,-X,1/2+Y -Z,1/2+X,1/2-Y Y,Z,X -Y,1/2+Z,1/2-X 1/2+Y,1/2-Z,-X 1/2-Y,-Z,1/2+X 1/2+X,1/2+Y,1/2+Z -X,1/2-Y,Z 1/2-X,Y,-Z X,-Y,1/2-Z 1/2+Z,1/2+X,1/2+Y Z,-X,1/2-Y -Z,1/2-X,Y 1/2-Z,X,-Y 1/2+Y,1/2+Z,1/2+X 1/2-Y,Z,-X Y,-Z,1/2-X -Y,1/2-Z,X 200 24 24 Pm-3 PGm3bar CUBIC 'P 2/m -3' 'P m -3' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X -X,-Y,-Z X,Y,-Z X,-Y,Z -X,Y,Z -Z,-X,-Y -Z,X,Y Z,X,-Y Z,-X,Y -Y,-Z,-X Y,-Z,X -Y,Z,X Y,Z,-X 201 24 24 Pn-3 PGm3bar CUBIC 'P 2/n -3' 'P n -3' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X 1/2-X,1/2-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 1/2-Z,1/2-X,1/2-Y 1/2-Z,1/2+X,1/2+Y 1/2+Z,1/2+X,1/2-Y 1/2+Z,1/2-X,1/2+Y 1/2-Y,1/2-Z,1/2-X 1/2+Y,1/2-Z,1/2+X 1/2-Y,1/2+Z,1/2+X 1/2+Y,1/2+Z,1/2-X 202 96 24 Fm-3 PGm3bar CUBIC 'F 2/m -3' 'F m -3' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X -X,-Y,-Z X,Y,-Z X,-Y,Z -X,Y,Z -Z,-X,-Y -Z,X,Y Z,X,-Y Z,-X,Y -Y,-Z,-X Y,-Z,X -Y,Z,X Y,Z,-X X,1/2+Y,1/2+Z -X,1/2-Y,1/2+Z -X,1/2+Y,1/2-Z X,1/2-Y,1/2-Z Z,1/2+X,1/2+Y Z,1/2-X,1/2-Y -Z,1/2-X,1/2+Y -Z,1/2+X,1/2-Y Y,1/2+Z,1/2+X -Y,1/2+Z,1/2-X Y,1/2-Z,1/2-X -Y,1/2-Z,1/2+X -X,1/2-Y,1/2-Z X,1/2+Y,1/2-Z X,1/2-Y,1/2+Z -X,1/2+Y,1/2+Z -Z,1/2-X,1/2-Y -Z,1/2+X,1/2+Y Z,1/2+X,1/2-Y Z,1/2-X,1/2+Y -Y,1/2-Z,1/2-X Y,1/2-Z,1/2+X -Y,1/2+Z,1/2+X Y,1/2+Z,1/2-X 1/2+X,Y,1/2+Z 1/2-X,-Y,1/2+Z 1/2-X,Y,1/2-Z 1/2+X,-Y,1/2-Z 1/2+Z,X,1/2+Y 1/2+Z,-X,1/2-Y 1/2-Z,-X,1/2+Y 1/2-Z,X,1/2-Y 1/2+Y,Z,1/2+X 1/2-Y,Z,1/2-X 1/2+Y,-Z,1/2-X 1/2-Y,-Z,1/2+X 1/2-X,-Y,1/2-Z 1/2+X,Y,1/2-Z 1/2+X,-Y,1/2+Z 1/2-X,Y,1/2+Z 1/2-Z,-X,1/2-Y 1/2-Z,X,1/2+Y 1/2+Z,X,1/2-Y 1/2+Z,-X,1/2+Y 1/2-Y,-Z,1/2-X 1/2+Y,-Z,1/2+X 1/2-Y,Z,1/2+X 1/2+Y,Z,1/2-X 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 1/2+Z,1/2+X,Y 1/2+Z,1/2-X,-Y 1/2-Z,1/2-X,Y 1/2-Z,1/2+X,-Y 1/2+Y,1/2+Z,X 1/2-Y,1/2+Z,-X 1/2+Y,1/2-Z,-X 1/2-Y,1/2-Z,X 1/2-X,1/2-Y,-Z 1/2+X,1/2+Y,-Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 1/2-Z,1/2-X,-Y 1/2-Z,1/2+X,Y 1/2+Z,1/2+X,-Y 1/2+Z,1/2-X,Y 1/2-Y,1/2-Z,-X 1/2+Y,1/2-Z,X 1/2-Y,1/2+Z,X 1/2+Y,1/2+Z,-X 203 96 24 Fd-3 PGm3bar CUBIC 'F 2/d -3' 'F d -3' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X 1/4-X,1/4-Y,1/4-Z 1/4+X,1/4+Y,1/4-Z 1/4+X,1/4-Y,1/4+Z 1/4-X,1/4+Y,1/4+Z 1/4-Z,1/4-X,1/4-Y 1/4-Z,1/4+X,1/4+Y 1/4+Z,1/4+X,1/4-Y 1/4+Z,1/4-X,1/4+Y 1/4-Y,1/4-Z,1/4-X 1/4+Y,1/4-Z,1/4+X 1/4-Y,1/4+Z,1/4+X 1/4+Y,1/4+Z,1/4-X X,1/2+Y,1/2+Z -X,1/2-Y,1/2+Z -X,1/2+Y,1/2-Z X,1/2-Y,1/2-Z Z,1/2+X,1/2+Y Z,1/2-X,1/2-Y -Z,1/2-X,1/2+Y -Z,1/2+X,1/2-Y Y,1/2+Z,1/2+X -Y,1/2+Z,1/2-X Y,1/2-Z,1/2-X -Y,1/2-Z,1/2+X 1/4-X,3/4-Y,3/4-Z 1/4+X,3/4+Y,3/4-Z 1/4+X,3/4-Y,3/4+Z 1/4-X,3/4+Y,3/4+Z 1/4-Z,3/4-X,3/4-Y 1/4-Z,3/4+X,3/4+Y 1/4+Z,3/4+X,3/4-Y 1/4+Z,3/4-X,3/4+Y 1/4-Y,3/4-Z,3/4-X 1/4+Y,3/4-Z,3/4+X 1/4-Y,3/4+Z,3/4+X 1/4+Y,3/4+Z,3/4-X 1/2+X,Y,1/2+Z 1/2-X,-Y,1/2+Z 1/2-X,Y,1/2-Z 1/2+X,-Y,1/2-Z 1/2+Z,X,1/2+Y 1/2+Z,-X,1/2-Y 1/2-Z,-X,1/2+Y 1/2-Z,X,1/2-Y 1/2+Y,Z,1/2+X 1/2-Y,Z,1/2-X 1/2+Y,-Z,1/2-X 1/2-Y,-Z,1/2+X 3/4-X,1/4-Y,3/4-Z 3/4+X,1/4+Y,3/4-Z 3/4+X,1/4-Y,3/4+Z 3/4-X,1/4+Y,3/4+Z 3/4-Z,1/4-X,3/4-Y 3/4-Z,1/4+X,3/4+Y 3/4+Z,1/4+X,3/4-Y 3/4+Z,1/4-X,3/4+Y 3/4-Y,1/4-Z,3/4-X 3/4+Y,1/4-Z,3/4+X 3/4-Y,1/4+Z,3/4+X 3/4+Y,1/4+Z,3/4-X 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 1/2+Z,1/2+X,Y 1/2+Z,1/2-X,-Y 1/2-Z,1/2-X,Y 1/2-Z,1/2+X,-Y 1/2+Y,1/2+Z,X 1/2-Y,1/2+Z,-X 1/2+Y,1/2-Z,-X 1/2-Y,1/2-Z,X 3/4-X,3/4-Y,1/4-Z 3/4+X,3/4+Y,1/4-Z 3/4+X,3/4-Y,Z+1/4 3/4-X,3/4+Y,Z+1/4 3/4-Z,3/4-X,1/4-Y 3/4-Z,3/4+X,1/4+Y 3/4+Z,3/4+X,1/4-Y 3/4+Z,3/4-X,1/4+Y 3/4-Y,3/4-Z,1/4-X 3/4+Y,3/4-Z,1/4+X 3/4-Y,3/4+Z,1/4+X 3/4+Y,3/4+Z,1/4-X 204 48 24 Im-3 PGm3bar CUBIC 'I 2/m -3' 'I m -3' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X -X,-Y,-Z X,Y,-Z X,-Y,Z -X,Y,Z -Z,-X,-Y -Z,X,Y Z,X,-Y Z,-X,Y -Y,-Z,-X Y,-Z,X -Y,Z,X Y,Z,-X 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2-Z 1/2+Z,1/2+X,1/2+Y 1/2+Z,1/2-X,1/2-Y 1/2-Z,1/2-X,1/2+Y 1/2-Z,1/2+X,1/2-Y 1/2+Y,1/2+Z,1/2+X 1/2-Y,1/2+Z,1/2-X 1/2+Y,1/2-Z,1/2-X 1/2-Y,1/2-Z,1/2+X 1/2-X,1/2-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 1/2-Z,1/2-X,1/2-Y 1/2-Z,1/2+X,1/2+Y 1/2+Z,1/2+X,1/2-Y 1/2+Z,1/2-X,1/2+Y 1/2-Y,1/2-Z,1/2-X 1/2+Y,1/2-Z,1/2+X 1/2-Y,1/2+Z,1/2+X 1/2+Y,1/2+Z,1/2-X 205 24 24 Pa-3 PGm3bar CUBIC 'P 21/a -3' 'P a -3' X,Y,Z 1/2-X,-Y,1/2+Z -X,1/2+Y,1/2-Z 1/2+X,1/2-Y,-Z Z,X,Y 1/2+Z,1/2-X,-Y 1/2-Z,-X,1/2+Y -Z,1/2+X,1/2-Y Y,Z,X -Y,1/2+Z,1/2-X 1/2+Y,1/2-Z,-X 1/2-Y,-Z,1/2+X -X,-Y,-Z 1/2+X,Y,1/2-Z X,1/2-Y,1/2+Z 1/2-X,1/2+Y,Z -Z,-X,-Y 1/2-Z,1/2+X,Y 1/2+Z,X,1/2-Y Z,1/2-X,1/2+Y -Y,-Z,-X Y,1/2-Z,1/2+X 1/2-Y,1/2+Z,X 1/2+Y,Z,1/2-X 206 48 24 Ia-3 PGm3bar CUBIC 'I 21/a -3' 'I a -3' X,Y,Z 1/2-X,-Y,1/2+Z -X,1/2+Y,1/2-Z 1/2+X,1/2-Y,-Z Z,X,Y 1/2+Z,1/2-X,-Y 1/2-Z,-X,1/2+Y -Z,1/2+X,1/2-Y Y,Z,X -Y,1/2+Z,1/2-X 1/2+Y,1/2-Z,-X 1/2-Y,-Z,1/2+X -X,-Y,-Z 1/2+X,Y,1/2-Z X,1/2-Y,1/2+Z 1/2-X,1/2+Y,Z -Z,-X,-Y 1/2-Z,1/2+X,Y 1/2+Z,X,1/2-Y Z,1/2-X,1/2+Y -Y,-Z,-X Y,1/2-Z,1/2+X 1/2-Y,1/2+Z,X 1/2+Y,Z,1/2-X 1/2+X,1/2+Y,1/2+Z -X,1/2-Y,Z 1/2-X,+Y,-Z X,-Y,1/2-Z 1/2+Z,1/2+X,1/2+Y Z,-X,1/2-Y -Z,1/2-X,Y 1/2-Z,X,-Y 1/2+Y,1/2+Z,1/2+X 1/2-Y,Z,-X Y,-Z,1/2-X -Y,1/2-Z,X 1/2-X,1/2-Y,1/2-Z X,1/2+Y,-Z 1/2+X,-Y,Z -X,Y,1/2+Z 1/2-Z,1/2-X,1/2-Y -Z,X,1/2+Y Z,1/2+X,-Y 1/2+Z,-X,Y 1/2-Y,1/2-Z,1/2-X 1/2+Y,-Z,X -Y,Z,1/2+X Y,1/2+Z,-X 207 24 24 P432 PG432 CUBIC 'P 4 3 2' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X Y,X,-Z -Y,-X,-Z Y,-X,Z -Y,X,Z X,Z,-Y -X,Z,Y -X,-Z,-Y X,-Z,Y Z,Y,-X Z,-Y,X -Z,Y,X -Z,-Y,-X 208 24 24 P4232 PG432 CUBIC 'P 42 3 2' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X 1/2+Y,1/2+X,1/2-Z 1/2-Y,1/2-X,1/2-Z 1/2+Y,1/2-X,1/2+Z 1/2-Y,1/2+X,1/2+Z 1/2+X,1/2+Z,1/2-Y 1/2-X,1/2+Z,1/2+Y 1/2-X,1/2-Z,1/2-Y 1/2+X,1/2-Z,1/2+Y 1/2+Z,1/2+Y,1/2-X 1/2+Z,1/2-Y,1/2+X 1/2-Z,1/2+Y,1/2+X 1/2-Z,1/2-Y,1/2-X 209 96 24 F432 PG432 CUBIC 'F 4 3 2' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X Y,X,-Z -Y,-X,-Z Y,-X,Z -Y,X,Z X,Z,-Y -X,Z,Y -X,-Z,-Y X,-Z,Y Z,Y,-X Z,-Y,X -Z,Y,X -Z,-Y,-X X,1/2+Y,1/2+Z -X,1/2-Y,1/2+Z -X,1/2+Y,1/2-Z X,1/2-Y,1/2-Z Z,1/2+X,1/2+Y Z,1/2-X,1/2-Y -Z,1/2-X,1/2+Y -Z,1/2+X,1/2-Y Y,1/2+Z,1/2+X -Y,1/2+Z,1/2-X Y,1/2-Z,1/2-X -Y,1/2-Z,1/2+X Y,1/2+X,1/2-Z -Y,1/2-X,1/2-Z Y,1/2-X,1/2+Z -Y,1/2+X,1/2+Z X,1/2+Z,1/2-Y -X,1/2+Z,1/2+Y -X,1/2-Z,1/2-Y X,1/2-Z,1/2+Y Z,1/2+Y,1/2-X Z,1/2-Y,1/2+X -Z,1/2+Y,1/2+X -Z,1/2-Y,1/2-X 1/2+X,Y,1/2+Z 1/2-X,-Y,1/2+Z 1/2-X,Y,1/2-Z 1/2+X,-Y,1/2-Z 1/2+Z,X,1/2+Y 1/2+Z,-X,1/2-Y 1/2-Z,-X,1/2+Y 1/2-Z,X,1/2-Y 1/2+Y,Z,1/2+X 1/2-Y,Z,1/2-X 1/2+Y,-Z,1/2-X 1/2-Y,-Z,1/2+X 1/2+Y,X,1/2-Z 1/2-Y,-X,1/2-Z 1/2+Y,-X,1/2+Z 1/2-Y,X,1/2+Z 1/2+X,Z,1/2-Y 1/2-X,Z,1/2+Y 1/2-X,-Z,1/2-Y 1/2+X,-Z,1/2+Y 1/2+Z,Y,1/2-X 1/2+Z,-Y,1/2+X 1/2-Z,Y,1/2+X 1/2-Z,-Y,1/2-X 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 1/2+Z,1/2+X,Y 1/2+Z,1/2-X,-Y 1/2-Z,1/2-X,Y 1/2-Z,1/2+X,-Y 1/2+Y,1/2+Z,X 1/2-Y,1/2+Z,-X 1/2+Y,1/2-Z,-X 1/2-Y,1/2-Z,X 1/2+Y,1/2+X,-Z 1/2-Y,1/2-X,-Z 1/2+Y,1/2-X,Z 1/2-Y,1/2+X,Z 1/2+X,1/2+Z,-Y 1/2-X,1/2+Z,Y 1/2-X,1/2-Z,-Y 1/2+X,1/2-Z,Y 1/2+Z,1/2+Y,-X 1/2+Z,1/2-Y,X 1/2-Z,1/2+Y,X 1/2-Z,1/2-Y,-X 210 96 24 F4132 PG432 CUBIC 'F 41 3 2' X,Y,Z -X,1/2-Y,1/2+Z 1/2-X,1/2+Y,-Z 1/2+X,-Y,1/2-Z Z,X,Y 1/2+Z,-X,1/2-Y -Z,1/2-X,1/2+Y 1/2-Z,1/2+X,-Y Y,Z,X 1/2-Y,1/2+Z,-X 1/2+Y,-Z,1/2-X -Y,1/2-Z,1/2+X 3/4+Y,1/4+X,3/4-Z 1/4-Y,1/4-X,1/4-Z 1/4+Y,3/4-X,3/4+Z 3/4-Y,3/4+X,1/4+Z 3/4+X,1/4+Z,3/4-Y 3/4-X,3/4+Z,1/4+Y 1/4-X,1/4-Z,1/4-Y 1/4+X,3/4-Z,3/4+Y 3/4+Z,1/4+Y,3/4-X 1/4+Z,3/4-Y,3/4+X 3/4-Z,3/4+Y,1/4+X 1/4-Z,1/4-Y,1/4-X X,1/2+Y,1/2+Z -X,-Y,Z 1/2-X,Y,1/2-Z 1/2+X,1/2-Y,-Z Z,1/2+X,1/2+Y 1/2+Z,1/2-X,-Y -Z,-X,Y 1/2-Z,X,1/2-Y Y,1/2+Z,1/2+X 1/2-Y,Z,1/2-X 1/2+Y,1/2-Z,-X -Y,-Z,X 3/4+Y,3/4+X,1/4-Z 1/4-Y,3/4-X,3/4-Z 1/4+Y,1/4-X,1/4+Z 3/4-Y,1/4+X,3/4+Z 3/4+X,3/4+Z,1/4-Y 3/4-X,1/4+Z,3/4+Y 1/4-X,3/4-Z,3/4-Y 1/4+X,1/4-Z,1/4+Y 3/4+Z,3/4+Y,1/4-X 1/4+Z,1/4-Y,1/4+X 3/4-Z,1/4+Y,3/4+X 1/4-Z,3/4-Y,3/4-X 1/2+X,Y,1/2+Z 1/2-X,1/2-Y,Z -X,1/2+Y,1/2-Z X,-Y,-Z 1/2+Z,X,1/2+Y Z,-X,-Y 1/2-Z,1/2-X,Y -Z,1/2+X,1/2-Y 1/2+Y,Z,1/2+X -Y,1/2+Z,1/2-X Y,-Z,-X 1/2-Y,1/2-Z,X 1/4+Y,1/4+X,1/4-Z 3/4-Y,1/4-X,3/4-Z 3/4+Y,3/4-X,1/4+Z 1/4-Y,3/4+X,3/4+Z 1/4+X,1/4+Z,1/4-Y 1/4-X,3/4+Z,3/4+Y 3/4-X,1/4-Z,3/4-Y 3/4+X,3/4-Z,1/4+Y 1/4+Z,1/4+Y,1/4-X 3/4+Z,3/4-Y,1/4+X 1/4-Z,3/4+Y,3/4+X 3/4-Z,1/4-Y,3/4-X 1/2+X,1/2+Y,Z 1/2-X,-Y,1/2+Z -X,Y,-Z X,1/2-Y,1/2-Z 1/2+Z,1/2+X,Y Z,1/2-X,1/2-Y 1/2-Z,-X,1/2+Y -Z,X,-Y 1/2+Y,1/2+Z,X -Y,Z,-X Y,1/2-Z,1/2-X 1/2-Y,-Z,1/2+X 1/4+Y,3/4+X,3/4-Z 3/4-Y,3/4-X,1/4-Z 3/4+Y,1/4-X,3/4+Z 1/4-Y,1/4+X,1/4+Z 1/4+X,3/4+Z,3/4-Y 1/4-X,1/4+Z,1/4+Y 3/4-X,3/4-Z,1/4-Y 3/4+X,1/4-Z,3/4+Y 1/4+Z,3/4+Y,3/4-X 3/4+Z,1/4-Y,3/4+X 1/4-Z,1/4+Y,1/4+X 3/4-Z,3/4-Y,1/4-X 211 48 24 I432 PG432 CUBIC 'I 4 3 2' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X Y,X,-Z -Y,-X,-Z Y,-X,Z -Y,X,Z X,Z,-Y -X,Z,Y -X,-Z,-Y X,-Z,Y Z,Y,-X Z,-Y,X -Z,Y,X -Z,-Y,-X 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2-Z 1/2+Z,1/2+X,1/2+Y 1/2+Z,1/2-X,1/2-Y 1/2-Z,1/2-X,1/2+Y 1/2-Z,1/2+X,1/2-Y 1/2+Y,1/2+Z,1/2+X 1/2-Y,1/2+Z,1/2-X 1/2+Y,1/2-Z,1/2-X 1/2-Y,1/2-Z,1/2+X 1/2+Y,1/2+X,1/2-Z 1/2-Y,1/2-X,1/2-Z 1/2+Y,1/2-X,1/2+Z 1/2-Y,1/2+X,1/2+Z 1/2+X,1/2+Z,1/2-Y 1/2-X,1/2+Z,1/2+Y 1/2-X,1/2-Z,1/2-Y 1/2+X,1/2-Z,1/2+Y 1/2+Z,1/2+Y,1/2-X 1/2+Z,1/2-Y,1/2+X 1/2-Z,1/2+Y,1/2+X 1/2-Z,1/2-Y,1/2-X 212 24 24 P4332 PG432 CUBIC 'P 43 3 2' X,Y,Z 1/2-X,-Y,1/2+Z -X,1/2+Y,1/2-Z 1/2+X,1/2-Y,-Z Z,X,Y 1/2+Z,1/2-X,-Y 1/2-Z,-X,1/2+Y -Z,1/2+X,1/2-Y Y,Z,X -Y,1/2+Z,1/2-X 1/2+Y,1/2-Z,-X 1/2-Y,-Z,1/2+X 1/4+Y,3/4+X,3/4-Z 1/4-Y,1/4-X,1/4-Z 3/4+Y,3/4-X,1/4+Z 3/4-Y,1/4+X,3/4+Z 1/4+X,3/4+Z,3/4-Y 3/4-X,1/4+Z,3/4+Y 1/4-X,1/4-Z,1/4-Y 3/4+X,3/4-Z,1/4+Y 1/4+Z,3/4+Y,3/4-X 3/4+Z,3/4-Y,1/4+X 3/4-Z,1/4+Y,3/4+X 1/4-Z,1/4-Y,1/4-X 213 24 24 P4132 PG432 CUBIC 'P 41 3 2' X,Y,Z 1/2-X,-Y,1/2+Z -X,1/2+Y,1/2-Z 1/2+X,1/2-Y,-Z Z,X,Y 1/2+Z,1/2-X,-Y 1/2-Z,-X,1/2+Y -Z,1/2+X,1/2-Y Y,Z,X -Y,1/2+Z,1/2-X 1/2+Y,1/2-Z,-X 1/2-Y,-Z,1/2+X 3/4+Y,1/4+X,1/4-Z 3/4-Y,3/4-X,3/4-Z 1/4+Y,1/4-X,3/4+Z 1/4-Y,3/4+X,1/4+Z 3/4+X,1/4+Z,1/4-Y 1/4-X,3/4+Z,1/4+Y 3/4-X,3/4-Z,3/4-Y 1/4+X,1/4-Z,3/4+Y 3/4+Z,1/4+Y,1/4-X 1/4+Z,1/4-Y,3/4+X 1/4-Z,3/4+Y,1/4+X 3/4-Z,3/4-Y,3/4-X 214 48 24 I4132 PG432 CUBIC 'I 41 3 2' X,Y,Z 1/2-X,-Y,1/2+Z -X,1/2+Y,1/2-Z 1/2+X,1/2-Y,-Z Z,X,Y 1/2+Z,1/2-X,-Y 1/2-Z,-X,1/2+Y -Z,1/2+X,1/2-Y Y,Z,X -Y,1/2+Z,1/2-X 1/2+Y,1/2-Z,-X 1/2-Y,-Z,1/2+X 3/4+Y,1/4+X,1/4-Z 3/4-Y,3/4-X,3/4-Z 1/4+Y,1/4-X,3/4+Z 1/4-Y,3/4+X,1/4+Z 3/4+X,1/4+Z,1/4-Y 1/4-X,3/4+Z,1/4+Y 3/4-X,3/4-Z,3/4-Y 1/4+X,1/4-Z,3/4+Y 3/4+Z,1/4+Y,1/4-X 1/4+Z,1/4-Y,3/4+X 1/4-Z,3/4+Y,1/4+X 3/4-Z,3/4-Y,3/4-X 1/2+X,1/2+Y,1/2+Z -X,1/2-Y,Z 1/2-X,Y,-Z X,-Y,1/2-Z 1/2+Z,1/2+X,1/2+Y Z,-X,1/2-Y -Z,1/2-X,Y 1/2-Z,X,-Y 1/2+Y,1/2+Z,1/2+X 1/2-Y,Z,-X Y,-Z,1/2-X -Y,1/2-Z,X 1/4+Y,3/4+X,3/4-Z 1/4-Y,1/4-X,1/4-Z 3/4+Y,3/4-X,1/4+Z 3/4-Y,1/4+X,3/4+Z 1/4+X,3/4+Z,3/4-Y 3/4-X,1/4+Z,3/4+Y 1/4-X,1/4-Z,1/4-Y 3/4+X,3/4-Z,1/4+Y 1/4+Z,3/4+Y,3/4-X 3/4+Z,3/4-Y,1/4+X 3/4-Z,1/4+Y,3/4+X 1/4-Z,1/4-Y,1/4-X 215 24 24 P-43m PG4bar3m CUBIC 'P -4 3 m' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X Y,X,Z -Y,-X,Z Y,-X,-Z -Y,X,-Z X,Z,Y -X,Z,-Y -X,-Z,Y X,-Z,-Y Z,Y,X Z,-Y,-X -Z,Y,-X -Z,-Y,X 216 96 24 F-43m PG4bar3m CUBIC 'F -4 3 m' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X Y,X,Z -Y,-X,Z Y,-X,-Z -Y,X,-Z X,Z,Y -X,Z,-Y -X,-Z,Y X,-Z,-Y Z,Y,X Z,-Y,-X -Z,Y,-X -Z,-Y,X X,1/2+Y,1/2+Z -X,1/2-Y,1/2+Z -X,1/2+Y,1/2-Z X,1/2-Y,1/2-Z Z,1/2+X,1/2+Y Z,1/2-X,1/2-Y -Z,1/2-X,1/2+Y -Z,1/2+X,1/2-Y Y,1/2+Z,1/2+X -Y,1/2+Z,1/2-X Y,1/2-Z,1/2-X -Y,1/2-Z,1/2+X Y,1/2+X,1/2+Z -Y,1/2-X,1/2+Z Y,1/2-X,1/2-Z -Y,1/2+X,1/2-Z X,1/2+Z,1/2+Y -X,1/2+Z,1/2-Y -X,1/2-Z,1/2+Y X,1/2-Z,1/2-Y Z,1/2+Y,1/2+X Z,1/2-Y,1/2-X -Z,1/2+Y,1/2-X -Z,1/2-Y,1/2+X 1/2+X,Y,1/2+Z 1/2-X,-Y,1/2+Z 1/2-X,Y,1/2-Z 1/2+X,-Y,1/2-Z 1/2+Z,X,1/2+Y 1/2+Z,-X,1/2-Y 1/2-Z,-X,1/2+Y 1/2-Z,X,1/2-Y 1/2+Y,Z,1/2+X 1/2-Y,Z,1/2-X 1/2+Y,-Z,1/2-X 1/2-Y,-Z,1/2+X 1/2+Y,X,1/2+Z 1/2-Y,-X,1/2+Z 1/2+Y,-X,1/2-Z 1/2-Y,X,1/2-Z 1/2+X,Z,1/2+Y 1/2-X,Z,1/2-Y 1/2-X,-Z,1/2+Y 1/2+X,-Z,1/2-Y 1/2+Z,Y,1/2+X 1/2+Z,-Y,1/2-X 1/2-Z,Y,1/2-X 1/2-Z,-Y,1/2+X 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 1/2+Z,1/2+X,Y 1/2+Z,1/2-X,-Y 1/2-Z,1/2-X,Y 1/2-Z,1/2+X,-Y 1/2+Y,1/2+Z,X 1/2-Y,1/2+Z,-X 1/2+Y,1/2-Z,-X 1/2-Y,1/2-Z,X 1/2+Y,1/2+X,Z 1/2-Y,1/2-X,Z 1/2+Y,1/2-X,-Z 1/2-Y,1/2+X,-Z 1/2+X,1/2+Z,Y 1/2-X,1/2+Z,-Y 1/2-X,1/2-Z,Y 1/2+X,1/2-Z,-Y 1/2+Z,1/2+Y,X 1/2+Z,1/2-Y,-X 1/2-Z,1/2+Y,-X 1/2-Z,1/2-Y,X 217 48 24 I-43m PG4bar3m CUBIC 'I -4 3 m' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X Y,X,Z -Y,-X,Z Y,-X,-Z -Y,X,-Z X,Z,Y -X,Z,-Y -X,-Z,Y X,-Z,-Y Z,Y,X Z,-Y,-X -Z,Y,-X -Z,-Y,X 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2-Z 1/2+Z,1/2+X,1/2+Y 1/2+Z,1/2-X,1/2-Y 1/2-Z,1/2-X,1/2+Y 1/2-Z,1/2+X,1/2-Y 1/2+Y,1/2+Z,1/2+X 1/2-Y,1/2+Z,1/2-X 1/2+Y,1/2-Z,1/2-X 1/2-Y,1/2-Z,1/2+X 1/2+Y,1/2+X,1/2+Z 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2-X,1/2-Z 1/2-Y,1/2+X,1/2-Z 1/2+X,1/2+Z,1/2+Y 1/2-X,1/2+Z,1/2-Y 1/2-X,1/2-Z,1/2+Y 1/2+X,1/2-Z,1/2-Y 1/2+Z,1/2+Y,1/2+X 1/2+Z,1/2-Y,1/2-X 1/2-Z,1/2+Y,1/2-X 1/2-Z,1/2-Y,1/2+X 218 24 24 P-43n PG4bar3m CUBIC 'P -4 3 n' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X 1/2+Y,1/2+X,1/2+Z 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2-X,1/2-Z 1/2-Y,1/2+X,1/2-Z 1/2+X,1/2+Z,1/2+Y 1/2-X,1/2+Z,1/2-Y 1/2-X,1/2-Z,1/2+Y 1/2+X,1/2-Z,1/2-Y 1/2+Z,1/2+Y,1/2+X 1/2+Z,1/2-Y,1/2-X 1/2-Z,1/2+Y,1/2-X 1/2-Z,1/2-Y,1/2+X 219 96 24 F-43c PG4bar3m CUBIC 'F -4 3 c' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X 1/2+Y,1/2+X,1/2+Z 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2-X,1/2-Z 1/2-Y,1/2+X,1/2-Z 1/2+X,1/2+Z,1/2+Y 1/2-X,1/2+Z,1/2-Y 1/2-X,1/2-Z,1/2+Y 1/2+X,1/2-Z,1/2-Y 1/2+Z,1/2+Y,1/2+X 1/2+Z,1/2-Y,1/2-X 1/2-Z,1/2+Y,1/2-X 1/2-Z,1/2-Y,1/2+X X,1/2+Y,1/2+Z -X,1/2-Y,1/2+Z -X,1/2+Y,1/2-Z X,1/2-Y,1/2-Z Z,1/2+X,1/2+Y Z,1/2-X,1/2-Y -Z,1/2-X,1/2+Y -Z,1/2+X,1/2-Y Y,1/2+Z,1/2+X -Y,1/2+Z,1/2-X Y,1/2-Z,1/2-X -Y,1/2-Z,1/2+X 1/2+Y,X,Z 1/2-Y,-X,Z 1/2+Y,-X,-Z 1/2-Y,X,-Z 1/2+X,Z,Y 1/2-X,Z,-Y 1/2-X,-Z,Y 1/2+X,-Z,-Y 1/2+Z,Y,X 1/2+Z,-Y,-X 1/2-Z,Y,-X 1/2-Z,-Y,X 1/2+X,Y,1/2+Z 1/2-X,-Y,1/2+Z 1/2-X,Y,1/2-Z 1/2+X,-Y,1/2-Z 1/2+Z,X,1/2+Y 1/2+Z,-X,1/2-Y 1/2-Z,-X,1/2+Y 1/2-Z,X,1/2-Y 1/2+Y,Z,1/2+X 1/2-Y,Z,1/2-X 1/2+Y,-Z,1/2-X 1/2-Y,-Z,1/2+X Y,1/2+X,Z -Y,1/2-X,Z Y,1/2-X,-Z -Y,1/2+X,-Z X,1/2+Z,Y -X,1/2+Z,-Y -X,1/2-Z,Y X,1/2-Z,-Y Z,1/2+Y,X Z,1/2-Y,-X -Z,1/2+Y,-X -Z,1/2-Y,X 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 1/2+Z,1/2+X,Y 1/2+Z,1/2-X,-Y 1/2-Z,1/2-X,Y 1/2-Z,1/2+X,-Y 1/2+Y,1/2+Z,X 1/2-Y,1/2+Z,-X 1/2+Y,1/2-Z,-X 1/2-Y,1/2-Z,X Y,X,1/2+Z -Y,-X,1/2+Z Y,-X,1/2-Z -Y,X,1/2-Z X,Z,1/2+Y -X,Z,1/2-Y -X,-Z,1/2+Y X,-Z,1/2-Y Z,Y,1/2+X Z,-Y,1/2-X -Z,Y,1/2-X -Z,-Y,1/2+X 220 48 24 I-43d PG4bar3m CUBIC 'I -4 3 d' X,Y,Z 1/2-X,-Y,1/2+Z -X,1/2+Y,1/2-Z 1/2+X,1/2-Y,-Z Z,X,Y 1/2+Z,1/2-X,-Y 1/2-Z,-X,1/2+Y -Z,1/2+X,1/2-Y Y,Z,X -Y,1/2+Z,1/2-X 1/2+Y,1/2-Z,-X 1/2-Y,-Z,1/2+X 1/4+Y,1/4+X,1/4+Z 1/4-Y,3/4-X,3/4+Z 3/4+Y,1/4-X,3/4-Z 3/4-Y,3/4+X,1/4-Z 1/4+X,1/4+Z,1/4+Y 3/4-X,3/4+Z,1/4-Y 1/4-X,3/4-Z,3/4+Y 3/4+X,1/4-Z,3/4-Y 1/4+Z,1/4+Y,1/4+X 3/4+Z,1/4-Y,3/4-X 3/4-Z,3/4+Y,1/4-X 1/4-Z,3/4-Y,3/4+X 1/2+X,1/2+Y,1/2+Z -X,1/2-Y,Z 1/2-X,Y,-Z X,-Y,1/2-Z 1/2+Z,1/2+X,1/2+Y Z,-X,1/2-Y -Z,1/2-X,Y 1/2-Z,X,-Y 1/2+Y,1/2+Z,1/2+X 1/2-Y,Z,-X Y,-Z,1/2-X -Y,1/2-Z,X 3/4+Y,3/4+X,3/4+Z 3/4-Y,1/4-X,1/4+Z 1/4+Y,3/4-X,1/4-Z 1/4-Y,1/4+X,3/4-Z 3/4+X,3/4+Z,3/4+Y 1/4-X,1/4+Z,3/4-Y 3/4-X,1/4-Z,1/4+Y 1/4+X,3/4-Z,1/4-Y 3/4+Z,3/4+Y,3/4+X 1/4+Z,3/4-Y,1/4-X 1/4-Z,1/4+Y,3/4-X 3/4-Z,1/4-Y,1/4+X 221 48 48 Pm-3m PGm3barm CUBIC 'P 4/m -3 2/m' 'P m -3 m' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X Y,X,-Z -Y,-X,-Z Y,-X,Z -Y,X,Z X,Z,-Y -X,Z,Y -X,-Z,-Y X,-Z,Y Z,Y,-X Z,-Y,X -Z,Y,X -Z,-Y,-X -X,-Y,-Z X,Y,-Z X,-Y,Z -X,Y,Z -Z,-X,-Y -Z,X,Y Z,X,-Y Z,-X,Y -Y,-Z,-X Y,-Z,X -Y,Z,X Y,Z,-X -Y,-X,Z Y,X,Z -Y,X,-Z Y,-X,-Z -X,-Z,Y X,-Z,-Y X,Z,Y -X,Z,-Y -Z,-Y,X -Z,Y,-X Z,-Y,-X Z,Y,X 222 48 48 Pn-3n PGm3barm CUBIC 'P 4/n -3 2/n' 'P n -3 n' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X Y,X,-Z -Y,-X,-Z Y,-X,Z -Y,X,Z X,Z,-Y -X,Z,Y -X,-Z,-Y X,-Z,Y Z,Y,-X Z,-Y,X -Z,Y,X -Z,-Y,-X 1/2-X,1/2-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 1/2-Z,1/2-X,1/2-Y 1/2-Z,1/2+X,1/2+Y 1/2+Z,1/2+X,1/2-Y 1/2+Z,1/2-X,1/2+Y 1/2-Y,1/2-Z,1/2-X 1/2+Y,1/2-Z,1/2+X 1/2-Y,1/2+Z,1/2+X 1/2+Y,1/2+Z,1/2-X 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2+X,1/2+Z 1/2-Y,1/2+X,1/2-Z 1/2+Y,1/2-X,1/2-Z 1/2-X,1/2-Z,1/2+Y 1/2+X,1/2-Z,1/2-Y 1/2+X,1/2+Z,1/2+Y 1/2-X,1/2+Z,1/2-Y 1/2-Z,1/2-Y,1/2+X 1/2-Z,1/2+Y,1/2-X 1/2+Z,1/2-Y,1/2-X 1/2+Z,1/2+Y,1/2+X 223 48 48 Pm-3n PGm3barm CUBIC 'P 42/m -3 2/n' 'P m -3 n' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X 1/2+Y,1/2+X,1/2-Z 1/2-Y,1/2-X,1/2-Z 1/2+Y,1/2-X,1/2+Z 1/2-Y,1/2+X,1/2+Z 1/2+X,1/2+Z,1/2-Y 1/2-X,1/2+Z,1/2+Y 1/2-X,1/2-Z,1/2-Y 1/2+X,1/2-Z,1/2+Y 1/2+Z,1/2+Y,1/2-X 1/2+Z,1/2-Y,1/2+X 1/2-Z,1/2+Y,1/2+X 1/2-Z,1/2-Y,1/2-X -X,-Y,-Z X,Y,-Z X,-Y,Z -X,Y,Z -Z,-X,-Y -Z,X,Y Z,X,-Y Z,-X,Y -Y,-Z,-X Y,-Z,X -Y,Z,X Y,Z,-X 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2+X,1/2+Z 1/2-Y,1/2+X,1/2-Z 1/2+Y,1/2-X,1/2-Z 1/2-X,1/2-Z,1/2+Y 1/2+X,1/2-Z,1/2-Y 1/2+X,1/2+Z,1/2+Y 1/2-X,1/2+Z,1/2-Y 1/2-Z,1/2-Y,1/2+X 1/2-Z,1/2+Y,1/2-X 1/2+Z,1/2-Y,1/2-X 1/2+Z,1/2+Y,1/2+X 224 48 48 Pn-3m PGm3barm CUBIC 'P 42/n -3 2/m' 'P n -3 m' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X 1/2+Y,1/2+X,1/2-Z 1/2-Y,1/2-X,1/2-Z 1/2+Y,1/2-X,1/2+Z 1/2-Y,1/2+X,1/2+Z 1/2+X,1/2+Z,1/2-Y 1/2-X,1/2+Z,1/2+Y 1/2-X,1/2-Z,1/2-Y 1/2+X,1/2-Z,1/2+Y 1/2+Z,1/2+Y,1/2-X 1/2+Z,1/2-Y,1/2+X 1/2-Z,1/2+Y,1/2+X 1/2-Z,1/2-Y,1/2-X 1/2-X,1/2-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 1/2-Z,1/2-X,1/2-Y 1/2-Z,1/2+X,1/2+Y 1/2+Z,1/2+X,1/2-Y 1/2+Z,1/2-X,1/2+Y 1/2-Y,1/2-Z,1/2-X 1/2+Y,1/2-Z,1/2+X 1/2-Y,1/2+Z,1/2+X 1/2+Y,1/2+Z,1/2-X -Y,-X,Z Y,X,Z -Y,X,-Z Y,-X,-Z -X,-Z,Y X,-Z,-Y X,Z,Y -X,Z,-Y -Z,-Y,X -Z,Y,-X Z,-Y,-X Z,Y,X 225 192 48 Fm-3m PGm3barm CUBIC 'F 4/m -3 2/m' 'F m -3 m' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X Y,X,-Z -Y,-X,-Z Y,-X,Z -Y,X,Z X,Z,-Y -X,Z,Y -X,-Z,-Y X,-Z,Y Z,Y,-X Z,-Y,X -Z,Y,X -Z,-Y,-X -X,-Y,-Z X,Y,-Z X,-Y,Z -X,Y,Z -Z,-X,-Y -Z,X,Y Z,X,-Y Z,-X,Y -Y,-Z,-X Y,-Z,X -Y,Z,X Y,Z,-X -Y,-X,Z Y,X,Z -Y,X,-Z Y,-X,-Z -X,-Z,Y X,-Z,-Y X,Z,Y -X,Z,-Y -Z,-Y,X -Z,Y,-X Z,-Y,-X Z,Y,X X,1/2+Y,1/2+Z -X,1/2-Y,1/2+Z -X,1/2+Y,1/2-Z X,1/2-Y,1/2-Z Z,1/2+X,1/2+Y Z,1/2-X,1/2-Y -Z,1/2-X,1/2+Y -Z,1/2+X,1/2-Y Y,1/2+Z,1/2+X -Y,1/2+Z,1/2-X Y,1/2-Z,1/2-X -Y,1/2-Z,1/2+X Y,1/2+X,1/2-Z -Y,1/2-X,1/2-Z Y,1/2-X,1/2+Z -Y,1/2+X,1/2+Z X,1/2+Z,1/2-Y -X,1/2+Z,1/2+Y -X,1/2-Z,1/2-Y X,1/2-Z,1/2+Y Z,1/2+Y,1/2-X Z,1/2-Y,1/2+X -Z,1/2+Y,1/2+X -Z,1/2-Y,1/2-X -X,1/2-Y,1/2-Z X,1/2+Y,1/2-Z X,1/2-Y,1/2+Z -X,1/2+Y,1/2+Z -Z,1/2-X,1/2-Y -Z,1/2+X,1/2+Y Z,1/2+X,1/2-Y Z,1/2-X,1/2+Y -Y,1/2-Z,1/2-X Y,1/2-Z,1/2+X -Y,1/2+Z,1/2+X Y,1/2+Z,1/2-X -Y,1/2-X,1/2+Z Y,1/2+X,1/2+Z -Y,1/2+X,1/2-Z Y,1/2-X,1/2-Z -X,1/2-Z,1/2+Y X,1/2-Z,1/2-Y X,1/2+Z,1/2+Y -X,1/2+Z,1/2-Y -Z,1/2-Y,1/2+X -Z,1/2+Y,1/2-X Z,1/2-Y,1/2-X Z,1/2+Y,1/2+X 1/2+X,Y,1/2+Z 1/2-X,-Y,1/2+Z 1/2-X,Y,1/2-Z 1/2+X,-Y,1/2-Z 1/2+Z,X,1/2+Y 1/2+Z,-X,1/2-Y 1/2-Z,-X,1/2+Y 1/2-Z,X,1/2-Y 1/2+Y,Z,1/2+X 1/2-Y,Z,1/2-X 1/2+Y,-Z,1/2-X 1/2-Y,-Z,1/2+X 1/2+Y,X,1/2-Z 1/2-Y,-X,1/2-Z 1/2+Y,-X,1/2+Z 1/2-Y,X,1/2+Z 1/2+X,Z,1/2-Y 1/2-X,Z,1/2+Y 1/2-X,-Z,1/2-Y 1/2+X,-Z,1/2+Y 1/2+Z,Y,1/2-X 1/2+Z,-Y,1/2+X 1/2-Z,Y,1/2+X 1/2-Z,-Y,1/2-X 1/2-X,-Y,1/2-Z 1/2+X,Y,1/2-Z 1/2+X,-Y,1/2+Z 1/2-X,Y,1/2+Z 1/2-Z,-X,1/2-Y 1/2-Z,X,1/2+Y 1/2+Z,X,1/2-Y 1/2+Z,-X,1/2+Y 1/2-Y,-Z,1/2-X 1/2+Y,-Z,1/2+X 1/2-Y,Z,1/2+X 1/2+Y,Z,1/2-X 1/2-Y,-X,1/2+Z 1/2+Y,X,1/2+Z 1/2-Y,X,1/2-Z 1/2+Y,-X,1/2-Z 1/2-X,-Z,1/2+Y 1/2+X,-Z,1/2-Y 1/2+X,Z,1/2+Y 1/2-X,Z,1/2-Y 1/2-Z,-Y,1/2+X 1/2-Z,Y,1/2-X 1/2+Z,-Y,1/2-X 1/2+Z,Y,1/2+X 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 1/2+Z,1/2+X,Y 1/2+Z,1/2-X,-Y 1/2-Z,1/2-X,Y 1/2-Z,1/2+X,-Y 1/2+Y,1/2+Z,X 1/2-Y,1/2+Z,-X 1/2+Y,1/2-Z,-X 1/2-Y,1/2-Z,X 1/2+Y,1/2+X,-Z 1/2-Y,1/2-X,-Z 1/2+Y,1/2-X,Z 1/2-Y,1/2+X,Z 1/2+X,1/2+Z,-Y 1/2-X,1/2+Z,Y 1/2-X,1/2-Z,-Y 1/2+X,1/2-Z,Y 1/2+Z,1/2+Y,-X 1/2+Z,1/2-Y,X 1/2-Z,1/2+Y,X 1/2-Z,1/2-Y,-X 1/2-X,1/2-Y,-Z 1/2+X,1/2+Y,-Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 1/2-Z,1/2-X,-Y 1/2-Z,1/2+X,Y 1/2+Z,1/2+X,-Y 1/2+Z,1/2-X,Y 1/2-Y,1/2-Z,-X 1/2+Y,1/2-Z,X 1/2-Y,1/2+Z,X 1/2+Y,1/2+Z,-X 1/2-Y,1/2-X,Z 1/2+Y,1/2+X,Z 1/2-Y,1/2+X,-Z 1/2+Y,1/2-X,-Z 1/2-X,1/2-Z,Y 1/2+X,1/2-Z,-Y 1/2+X,1/2+Z,Y 1/2-X,1/2+Z,-Y 1/2-Z,1/2-Y,X 1/2-Z,1/2+Y,-X 1/2+Z,1/2-Y,-X 1/2+Z,1/2+Y,X 226 192 48 Fm-3c PGm3barm CUBIC 'F 4/m -3 2/c' 'F m -3 c' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X 1/2+Y,1/2+X,1/2-Z 1/2-Y,1/2-X,1/2-Z 1/2+Y,1/2-X,1/2+Z 1/2-Y,1/2+X,1/2+Z 1/2+X,1/2+Z,1/2-Y 1/2-X,1/2+Z,1/2+Y 1/2-X,1/2-Z,1/2-Y 1/2+X,1/2-Z,1/2+Y 1/2+Z,1/2+Y,1/2-X 1/2+Z,1/2-Y,1/2+X 1/2-Z,1/2+Y,1/2+X 1/2-Z,1/2-Y,1/2-X -X,-Y,-Z X,Y,-Z X,-Y,Z -X,Y,Z -Z,-X,-Y -Z,X,Y Z,X,-Y Z,-X,Y -Y,-Z,-X Y,-Z,X -Y,Z,X Y,Z,-X 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2+X,1/2+Z 1/2-Y,1/2+X,1/2-Z 1/2+Y,1/2-X,1/2-Z 1/2-X,1/2-Z,1/2+Y 1/2+X,1/2-Z,1/2-Y 1/2+X,1/2+Z,1/2+Y 1/2-X,1/2+Z,1/2-Y 1/2-Z,1/2-Y,1/2+X 1/2-Z,1/2+Y,1/2-X 1/2+Z,1/2-Y,1/2-X 1/2+Z,1/2+Y,1/2+X X,1/2+Y,1/2+Z -X,1/2-Y,1/2+Z -X,1/2+Y,1/2-Z X,1/2-Y,1/2-Z Z,1/2+X,1/2+Y Z,1/2-X,1/2-Y -Z,1/2-X,1/2+Y -Z,1/2+X,1/2-Y Y,1/2+Z,1/2+X -Y,1/2+Z,1/2-X Y,1/2-Z,1/2-X -Y,1/2-Z,1/2+X 1/2+Y,X,-Z 1/2-Y,-X,-Z 1/2+Y,-X,Z 1/2-Y,X,Z 1/2+X,Z,-Y 1/2-X,Z,Y 1/2-X,-Z,-Y 1/2+X,-Z,Y 1/2+Z,Y,-X 1/2+Z,-Y,X 1/2-Z,Y,X 1/2-Z,-Y,-X -X,1/2-Y,1/2-Z X,1/2+Y,1/2-Z X,1/2-Y,1/2+Z -X,1/2+Y,1/2+Z -Z,1/2-X,1/2-Y -Z,1/2+X,1/2+Y Z,1/2+X,1/2-Y Z,1/2-X,1/2+Y -Y,1/2-Z,1/2-X Y,1/2-Z,1/2+X -Y,1/2+Z,1/2+X Y,1/2+Z,1/2-X 1/2-Y,-X,Z 1/2+Y,X,Z 1/2-Y,X,-Z 1/2+Y,-X,-Z 1/2-X,-Z,Y 1/2+X,-Z,-Y 1/2+X,Z,Y 1/2-X,Z,-Y 1/2-Z,-Y,X 1/2-Z,Y,-X 1/2+Z,-Y,-X 1/2+Z,Y,X 1/2+X,Y,1/2+Z 1/2-X,-Y,1/2+Z 1/2-X,Y,1/2-Z 1/2+X,-Y,1/2-Z 1/2+Z,X,1/2+Y 1/2+Z,-X,1/2-Y 1/2-Z,-X,1/2+Y 1/2-Z,X,1/2-Y 1/2+Y,Z,1/2+X 1/2-Y,Z,1/2-X 1/2+Y,-Z,1/2-X 1/2-Y,-Z,1/2+X Y,1/2+X,-Z -Y,1/2-X,-Z Y,1/2-X,Z -Y,1/2+X,Z X,1/2+Z,-Y -X,1/2+Z,Y -X,1/2-Z,-Y X,1/2-Z,Y Z,1/2+Y,-X Z,1/2-Y,X -Z,1/2+Y,X -Z,1/2-Y,-X 1/2-X,-Y,1/2-Z 1/2+X,Y,1/2-Z 1/2+X,-Y,1/2+Z 1/2-X,Y,1/2+Z 1/2-Z,-X,1/2-Y 1/2-Z,X,1/2+Y 1/2+Z,X,1/2-Y 1/2+Z,-X,1/2+Y 1/2-Y,-Z,1/2-X 1/2+Y,-Z,1/2+X 1/2-Y,Z,1/2+X 1/2+Y,Z,1/2-X -Y,1/2-X,Z Y,1/2+X,Z -Y,1/2+X,-Z Y,1/2-X,-Z -X,1/2-Z,Y X,1/2-Z,-Y X,1/2+Z,Y -X,1/2+Z,-Y -Z,1/2-Y,X -Z,1/2+Y,-X Z,1/2-Y,-X Z,1/2+Y,X 1/2+X,1/2+Y,Z 1/2-X,1/2-Y,Z 1/2-X,1/2+Y,-Z 1/2+X,1/2-Y,-Z 1/2+Z,1/2+X,Y 1/2+Z,1/2-X,-Y 1/2-Z,1/2-X,Y 1/2-Z,1/2+X,-Y 1/2+Y,1/2+Z,X 1/2-Y,1/2+Z,-X 1/2+Y,1/2-Z,-X 1/2-Y,1/2-Z,X Y,X,1/2-Z -Y,-X,1/2-Z Y,-X,1/2+Z -Y,X,1/2+Z X,Z,1/2-Y -X,Z,1/2+Y -X,-Z,1/2-Y X,-Z,1/2+Y Z,Y,1/2-X Z,-Y,1/2+X -Z,Y,1/2+X -Z,-Y,1/2-X 1/2-X,1/2-Y,-Z 1/2+X,1/2+Y,-Z 1/2+X,1/2-Y,Z 1/2-X,1/2+Y,Z 1/2-Z,1/2-X,-Y 1/2-Z,1/2+X,Y 1/2+Z,1/2+X,-Y 1/2+Z,1/2-X,Y 1/2-Y,1/2-Z,-X 1/2+Y,1/2-Z,X 1/2-Y,1/2+Z,X 1/2+Y,1/2+Z,-X -Y,-X,1/2+Z Y,X,1/2+Z -Y,X,1/2-Z Y,-X,1/2-Z -X,-Z,1/2+Y X,-Z,1/2-Y X,Z,1/2+Y -X,Z,1/2-Y -Z,-Y,1/2+X -Z,Y,1/2-X Z,-Y,1/2-X Z,Y,1/2+X 227 192 48 Fd-3m PGm3barm CUBIC 'F 41/d -3 2/m' 'F d -3 m' X,Y,Z -X,1/2-Y,1/2+Z 1/2-X,1/2+Y,-Z 1/2+X,-Y,1/2-Z Z,X,Y 1/2+Z,-X,1/2-Y -Z,1/2-X,1/2+Y 1/2-Z,1/2+X,-Y Y,Z,X 1/2-Y,1/2+Z,-X 1/2+Y,-Z,1/2-X -Y,1/2-Z,1/2+X 3/4+Y,1/4+X,3/4-Z 1/4-Y,1/4-X,1/4-Z 1/4+Y,3/4-X,3/4+Z 3/4-Y,3/4+X,1/4+Z 3/4+X,1/4+Z,3/4-Y 3/4-X,3/4+Z,1/4+Y 1/4-X,1/4-Z,1/4-Y 1/4+X,3/4-Z,3/4+Y 3/4+Z,1/4+Y,3/4-X 1/4+Z,3/4-Y,3/4+X 3/4-Z,3/4+Y,1/4+X 1/4-Z,1/4-Y,1/4-X 1/4-X,1/4-Y,1/4-Z 1/4+X,3/4+Y,3/4-Z 3/4+X,3/4-Y,1/4+Z 3/4-X,1/4+Y,3/4+Z 1/4-Z,1/4-X,1/4-Y 3/4-Z,1/4+X,3/4+Y 1/4+Z,3/4+X,3/4-Y 3/4+Z,3/4-X,1/4+Y 1/4-Y,1/4-Z,1/4-X 3/4+Y,3/4-Z,1/4+X 3/4-Y,1/4+Z,3/4+X 1/4+Y,3/4+Z,3/4-X 1/2-Y,-X,1/2+Z Y,X,Z -Y,1/2+X,1/2-Z 1/2+Y,1/2-X,-Z 1/2-X,-Z,1/2+Y 1/2+X,1/2-Z,-Y X,Z,Y -X,1/2+Z,1/2-Y 1/2-Z,-Y,1/2+X -Z,1/2+Y,1/2-X 1/2+Z,1/2-Y,-X Z,Y,X X,1/2+Y,1/2+Z -X,-Y,Z 1/2-X,Y,1/2-Z 1/2+X,1/2-Y,-Z Z,1/2+X,1/2+Y 1/2+Z,1/2-X,-Y -Z,-X,Y 1/2-Z,X,1/2-Y Y,1/2+Z,1/2+X 1/2-Y,Z,1/2-X 1/2+Y,1/2-Z,-X -Y,-Z,X 3/4+Y,3/4+X,1/4-Z 1/4-Y,3/4-X,3/4-Z 1/4+Y,1/4-X,1/4+Z 3/4-Y,1/4+X,3/4+Z 3/4+X,3/4+Z,1/4-Y 3/4-X,1/4+Z,3/4+Y 1/4-X,3/4-Z,3/4-Y 1/4+X,1/4-Z,1/4+Y 3/4+Z,3/4+Y,1/4-X 1/4+Z,1/4-Y,1/4+X 3/4-Z,1/4+Y,3/4+X 1/4-Z,3/4-Y,3/4-X 1/4-X,3/4-Y,3/4-Z 1/4+X,1/4+Y,1/4-Z 3/4+X,1/4-Y,3/4+Z 3/4-X,3/4+Y,1/4+Z 1/4-Z,3/4-X,3/4-Y 3/4-Z,3/4+X,1/4+Y 1/4+Z,1/4+X,1/4-Y 3/4+Z,1/4-X,3/4+Y 1/4-Y,3/4-Z,3/4-X 3/4+Y,1/4-Z,3/4+X 3/4-Y,3/4+Z,1/4+X 1/4+Y,1/4+Z,1/4-X 1/2-Y,1/2-X,Z Y,1/2+X,1/2+Z -Y,X,-Z 1/2+Y,-X,1/2-Z 1/2-X,1/2-Z,Y 1/2+X,-Z,1/2-Y X,1/2+Z,1/2+Y -X,Z,-Y 1/2-Z,1/2-Y,X -Z,Y,-X 1/2+Z,-Y,1/2-X Z,1/2+Y,1/2+X 1/2+X,Y,1/2+Z 1/2-X,1/2-Y,Z -X,1/2+Y,1/2-Z X,-Y,-Z 1/2+Z,X,1/2+Y Z,-X,-Y 1/2-Z,1/2-X,Y -Z,1/2+X,1/2-Y 1/2+Y,Z,1/2+X -Y,1/2+Z,1/2-X Y,-Z,-X 1/2-Y,1/2-Z,X 1/4+Y,1/4+X,1/4-Z 3/4-Y,1/4-X,3/4-Z 3/4+Y,3/4-X,1/4+Z 1/4-Y,3/4+X,3/4+Z 1/4+X,1/4+Z,1/4-Y 1/4-X,3/4+Z,3/4+Y 3/4-X,1/4-Z,3/4-Y 3/4+X,3/4-Z,1/4+Y 1/4+Z,1/4+Y,1/4-X 3/4+Z,3/4-Y,1/4+X 1/4-Z,3/4+Y,3/4+X 3/4-Z,1/4-Y,3/4-X 3/4-X,1/4-Y,3/4-Z 3/4+X,3/4+Y,1/4-Z 1/4+X,3/4-Y,3/4+Z 1/4-X,1/4+Y,1/4+Z 3/4-Z,1/4-X,3/4-Y 1/4-Z,1/4+X,1/4+Y 3/4+Z,3/4+X,1/4-Y 1/4+Z,3/4-X,3/4+Y 3/4-Y,1/4-Z,3/4-X 1/4+Y,3/4-Z,3/4+X 1/4-Y,1/4+Z,1/4+X 3/4+Y,3/4+Z,1/4-X -Y,-X,Z 1/2+Y,X,1/2+Z 1/2-Y,1/2+X,-Z Y,1/2-X,1/2-Z -X,-Z,Y X,1/2-Z,1/2-Y 1/2+X,Z,1/2+Y 1/2-X,1/2+Z,-Y -Z,-Y,X 1/2-Z,1/2+Y,-X Z,1/2-Y,1/2-X 1/2+Z,Y,1/2+X 1/2+X,1/2+Y,Z 1/2-X,-Y,1/2+Z -X,Y,-Z X,1/2-Y,1/2-Z 1/2+Z,1/2+X,Y Z,1/2-X,1/2-Y 1/2-Z,-X,1/2+Y -Z,X,-Y 1/2+Y,1/2+Z,X -Y,Z,-X Y,1/2-Z,1/2-X 1/2-Y,-Z,1/2+X 1/4+Y,3/4+X,3/4-Z 3/4-Y,3/4-X,1/4-Z 3/4+Y,1/4-X,3/4+Z 1/4-Y,1/4+X,1/4+Z 1/4+X,3/4+Z,3/4-Y 1/4-X,1/4+Z,1/4+Y 3/4-X,3/4-Z,1/4-Y 3/4+X,1/4-Z,3/4+Y 1/4+Z,3/4+Y,3/4-X 3/4+Z,1/4-Y,3/4+X 1/4-Z,1/4+Y,1/4+X 3/4-Z,3/4-Y,1/4-X 3/4-X,3/4-Y,1/4-Z 3/4+X,1/4+Y,3/4-Z 1/4+X,1/4-Y,1/4+Z 1/4-X,3/4+Y,3/4+Z 3/4-Z,3/4-X,1/4-Y 1/4-Z,3/4+X,3/4+Y 3/4+Z,1/4+X,3/4-Y 1/4+Z,1/4-X,1/4+Y 3/4-Y,3/4-Z,1/4-X 1/4+Y,1/4-Z,1/4+X 1/4-Y,3/4+Z,3/4+X 3/4+Y,1/4+Z,3/4-X -Y,1/2-X,1/2+Z 1/2+Y,1/2+X,Z 1/2-Y,X,1/2-Z Y,-X,-Z -X,1/2-Z,1/2+Y X,-Z,-Y 1/2+X,1/2+Z,Y 1/2-X,Z,1/2-Y -Z,1/2-Y,1/2+X 1/2-Z,Y,1/2-X Z,-Y,-X 1/2+Z,1/2+Y,X 228 192 48 Fd-3c PGm3barm CUBIC 'F 41/d -3 2/c' 'F d -3 c' X,Y,Z -X,1/2-Y,1/2+Z 1/2-X,1/2+Y,-Z 1/2+X,-Y,1/2-Z Z,X,Y 1/2+Z,-X,1/2-Y -Z,1/2-X,1/2+Y 1/2-Z,1/2+X,-Y Y,Z,X 1/2-Y,1/2+Z,-X 1/2+Y,-Z,1/2-X -Y,1/2-Z,1/2+X 3/4+Y,1/4+X,3/4-Z 1/4-Y,1/4-X,1/4-Z 1/4+Y,3/4-X,3/4+Z 3/4-Y,3/4+X,1/4+Z 3/4+X,1/4+Z,3/4-Y 3/4-X,3/4+Z,1/4+Y 1/4-X,1/4-Z,1/4-Y 1/4+X,3/4-Z,3/4+Y 3/4+Z,1/4+Y,3/4-X 1/4+Z,3/4-Y,3/4+X 3/4-Z,3/4+Y,1/4+X 1/4-Z,1/4-Y,1/4-X 3/4-X,3/4-Y,3/4-Z 3/4+X,1/4+Y,1/4-Z 1/4+X,1/4-Y,3/4+Z 1/4-X,3/4+Y,1/4+Z 3/4-Z,3/4-X,3/4-Y 1/4-Z,3/4+X,1/4+Y 3/4+Z,1/4+X,1/4-Y 1/4+Z,1/4-X,3/4+Y 3/4-Y,3/4-Z,3/4-X 1/4+Y,1/4-Z,3/4+X 1/4-Y,3/4+Z,1/4+X 3/4+Y,1/4+Z,1/4-X -Y,1/2-X,Z 1/2+Y,1/2+X,1/2+Z 1/2-Y,X,-Z Y,-X,1/2-Z -X,1/2-Z,Y X,-Z,1/2-Y 1/2+X,1/2+Z,1/2+Y 1/2-X,Z,-Y -Z,1/2-Y,X 1/2-Z,Y,-X Z,-Y,1/2-X 1/2+Z,1/2+Y,1/2+X X,1/2+Y,1/2+Z -X,-Y,Z 1/2-X,Y,1/2-Z 1/2+X,1/2-Y,-Z Z,1/2+X,1/2+Y 1/2+Z,1/2-X,-Y -Z,-X,Y 1/2-Z,X,1/2-Y Y,1/2+Z,1/2+X 1/2-Y,Z,1/2-X 1/2+Y,1/2-Z,-X -Y,-Z,X 3/4+Y,3/4+X,1/4-Z 1/4-Y,3/4-X,3/4-Z 1/4+Y,1/4-X,1/4+Z 3/4-Y,1/4+X,3/4+Z 3/4+X,3/4+Z,1/4-Y 3/4-X,1/4+Z,3/4+Y 1/4-X,3/4-Z,3/4-Y 1/4+X,1/4-Z,1/4+Y 3/4+Z,3/4+Y,1/4-X 1/4+Z,1/4-Y,1/4+X 3/4-Z,1/4+Y,3/4+X 1/4-Z,3/4-Y,3/4-X 3/4-X,1/4-Y,1/4-Z 3/4+X,3/4+Y,3/4-Z 1/4+X,3/4-Y,1/4+Z 1/4-X,1/4+Y,3/4+Z 3/4-Z,1/4-X,1/4-Y 1/4-Z,1/4+X,3/4+Y 3/4+Z,3/4+X,3/4-Y 1/4+Z,3/4-X,1/4+Y 3/4-Y,1/4-Z,1/4-X 1/4+Y,3/4-Z,1/4+X 1/4-Y,1/4+Z,3/4+X 3/4+Y,3/4+Z,3/4-X -Y,-X,1/2+Z 1/2+Y,X,Z 1/2-Y,1/2+X,1/2-Z Y,1/2-X,-Z -X,-Z,1/2+Y X,1/2-Z,-Y 1/2+X,Z,Y 1/2-X,1/2+Z,1/2-Y -Z,-Y,1/2+X 1/2-Z,1/2+Y,1/2-X Z,1/2-Y,-X 1/2+Z,Y,X 1/2+X,Y,1/2+Z 1/2-X,1/2-Y,Z -X,1/2+Y,1/2-Z X,-Y,-Z 1/2+Z,X,1/2+Y Z,-X,-Y 1/2-Z,1/2-X,Y -Z,1/2+X,1/2-Y 1/2+Y,Z,1/2+X -Y,1/2+Z,1/2-X Y,-Z,-X 1/2-Y,1/2-Z,X 1/4+Y,1/4+X,1/4-Z 3/4-Y,1/4-X,3/4-Z 3/4+Y,3/4-X,1/4+Z 1/4-Y,3/4+X,3/4+Z 1/4+X,1/4+Z,1/4-Y 1/4-X,3/4+Z,3/4+Y 3/4-X,1/4-Z,3/4-Y 3/4+X,3/4-Z,1/4+Y 1/4+Z,1/4+Y,1/4-X 3/4+Z,3/4-Y,1/4+X 1/4-Z,3/4+Y,3/4+X 3/4-Z,1/4-Y,3/4-X 1/4-X,3/4-Y,1/4-Z 1/4+X,1/4+Y,3/4-Z 3/4+X,1/4-Y,1/4+Z 3/4-X,3/4+Y,3/4+Z 1/4-Z,3/4-X,1/4-Y 3/4-Z,3/4+X,3/4+Y 1/4+Z,1/4+X,3/4-Y 3/4+Z,1/4-X,1/4+Y 1/4-Y,3/4-Z,1/4-X 3/4+Y,1/4-Z,1/4+X 3/4-Y,3/4+Z,3/4+X 1/4+Y,1/4+Z,3/4-X 1/2-Y,1/2-X,1/2+Z Y,1/2+X,Z -Y,X,1/2-Z 1/2+Y,-X,-Z 1/2-X,1/2-Z,1/2+Y 1/2+X,-Z,-Y X,1/2+Z,Y -X,Z,1/2-Y 1/2-Z,1/2-Y,1/2+X -Z,Y,1/2-X 1/2+Z,-Y,-X Z,1/2+Y,X 1/2+X,1/2+Y,Z 1/2-X,-Y,1/2+Z -X,Y,-Z X,1/2-Y,1/2-Z 1/2+Z,1/2+X,Y Z,1/2-X,1/2-Y 1/2-Z,-X,1/2+Y -Z,X,-Y 1/2+Y,1/2+Z,X -Y,Z,-X Y,1/2-Z,1/2-X 1/2-Y,-Z,1/2+X 1/4+Y,3/4+X,3/4-Z 3/4-Y,3/4-X,1/4-Z 3/4+Y,1/4-X,3/4+Z 1/4-Y,1/4+X,1/4+Z 1/4+X,3/4+Z,3/4-Y 1/4-X,1/4+Z,1/4+Y 3/4-X,3/4-Z,1/4-Y 3/4+X,1/4-Z,3/4+Y 1/4+Z,3/4+Y,3/4-X 3/4+Z,1/4-Y,3/4+X 1/4-Z,1/4+Y,1/4+X 3/4-Z,3/4-Y,1/4-X 1/4-X,1/4-Y,3/4-Z 1/4+X,3/4+Y,1/4-Z 3/4+X,3/4-Y,3/4+Z 3/4-X,1/4+Y,1/4+Z 1/4-Z,1/4-X,3/4-Y 3/4-Z,1/4+X,1/4+Y 1/4+Z,3/4+X,1/4-Y 3/4+Z,3/4-X,3/4+Y 1/4-Y,1/4-Z,3/4-X 3/4+Y,3/4-Z,3/4+X 3/4-Y,1/4+Z,1/4+X 1/4+Y,3/4+Z,1/4-X 1/2-Y,-X,Z Y,X,1/2+Z -Y,1/2+X,-Z 1/2+Y,1/2-X,1/2-Z 1/2-X,-Z,Y 1/2+X,1/2-Z,1/2-Y X,Z,1/2+Y -X,1/2+Z,-Y 1/2-Z,-Y,X -Z,1/2+Y,-X 1/2+Z,1/2-Y,1/2-X Z,Y,1/2+X 229 96 48 Im-3m PGm3barm CUBIC 'I 4/m -3 2/m' 'I m -3 m' X,Y,Z -X,-Y,Z -X,Y,-Z X,-Y,-Z Z,X,Y Z,-X,-Y -Z,-X,Y -Z,X,-Y Y,Z,X -Y,Z,-X Y,-Z,-X -Y,-Z,X Y,X,-Z -Y,-X,-Z Y,-X,Z -Y,X,Z X,Z,-Y -X,Z,Y -X,-Z,-Y X,-Z,Y Z,Y,-X Z,-Y,X -Z,Y,X -Z,-Y,-X -X,-Y,-Z X,Y,-Z X,-Y,Z -X,Y,Z -Z,-X,-Y -Z,X,Y Z,X,-Y Z,-X,Y -Y,-Z,-X Y,-Z,X -Y,Z,X Y,Z,-X -Y,-X,Z Y,X,Z -Y,X,-Z Y,-X,-Z -X,-Z,Y X,-Z,-Y X,Z,Y -X,Z,-Y -Z,-Y,X -Z,Y,-X Z,-Y,-X Z,Y,X 1/2+X,1/2+Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2-Z 1/2+Z,1/2+X,1/2+Y 1/2+Z,1/2-X,1/2-Y 1/2-Z,1/2-X,1/2+Y 1/2-Z,1/2+X,1/2-Y 1/2+Y,1/2+Z,1/2+X 1/2-Y,1/2+Z,1/2-X 1/2+Y,1/2-Z,1/2-X 1/2-Y,1/2-Z,1/2+X 1/2+Y,1/2+X,1/2-Z 1/2-Y,1/2-X,1/2-Z 1/2+Y,1/2-X,1/2+Z 1/2-Y,1/2+X,1/2+Z 1/2+X,1/2+Z,1/2-Y 1/2-X,1/2+Z,1/2+Y 1/2-X,1/2-Z,1/2-Y 1/2+X,1/2-Z,1/2+Y 1/2+Z,1/2+Y,1/2-X 1/2+Z,1/2-Y,1/2+X 1/2-Z,1/2+Y,1/2+X 1/2-Z,1/2-Y,1/2-X 1/2-X,1/2-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z 1/2+X,1/2-Y,1/2+Z 1/2-X,1/2+Y,1/2+Z 1/2-Z,1/2-X,1/2-Y 1/2-Z,1/2+X,1/2+Y 1/2+Z,1/2+X,1/2-Y 1/2+Z,1/2-X,1/2+Y 1/2-Y,1/2-Z,1/2-X 1/2+Y,1/2-Z,1/2+X 1/2-Y,1/2+Z,1/2+X 1/2+Y,1/2+Z,1/2-X 1/2-Y,1/2-X,1/2+Z 1/2+Y,1/2+X,1/2+Z 1/2-Y,1/2+X,1/2-Z 1/2+Y,1/2-X,1/2-Z 1/2-X,1/2-Z,1/2+Y 1/2+X,1/2-Z,1/2-Y 1/2+X,1/2+Z,1/2+Y 1/2-X,1/2+Z,1/2-Y 1/2-Z,1/2-Y,1/2+X 1/2-Z,1/2+Y,1/2-X 1/2+Z,1/2-Y,1/2-X 1/2+Z,1/2+Y,1/2+X 230 96 48 Ia-3d PGm3barm CUBIC 'I 41/a -3 2/d' 'I a -3 d' X,Y,Z 1/2-X,-Y,1/2+Z -X,1/2+Y,1/2-Z 1/2+X,1/2-Y,-Z Z,X,Y 1/2+Z,1/2-X,-Y 1/2-Z,-X,1/2+Y -Z,1/2+X,1/2-Y Y,Z,X -Y,1/2+Z,1/2-X 1/2+Y,1/2-Z,-X 1/2-Y,-Z,1/2+X 3/4+Y,1/4+X,1/4-Z 3/4-Y,3/4-X,3/4-Z 1/4+Y,1/4-X,3/4+Z 1/4-Y,3/4+X,1/4+Z 3/4+X,1/4+Z,1/4-Y 1/4-X,3/4+Z,1/4+Y 3/4-X,3/4-Z,3/4-Y 1/4+X,1/4-Z,3/4+Y 3/4+Z,1/4+Y,1/4-X 1/4+Z,1/4-Y,3/4+X 1/4-Z,3/4+Y,1/4+X 3/4-Z,3/4-Y,3/4-X -X,-Y,-Z 1/2+X,Y,1/2-Z X,1/2-Y,1/2+Z 1/2-X,1/2+Y,Z -Z,-X,-Y 1/2-Z,1/2+X,Y 1/2+Z,X,1/2-Y Z,1/2-X,1/2+Y -Y,-Z,-X Y,1/2-Z,1/2+X 1/2-Y,1/2+Z,X 1/2+Y,Z,1/2-X 1/4-Y,3/4-X,3/4+Z 1/4+Y,1/4+X,1/4+Z 3/4-Y,3/4+X,1/4-Z 3/4+Y,1/4-X,3/4-Z 1/4-X,3/4-Z,3/4+Y 3/4+X,1/4-Z,3/4-Y 1/4+X,1/4+Z,1/4+Y 3/4-X,3/4+Z,1/4-Y 1/4-Z,3/4-Y,3/4+X 3/4-Z,3/4+Y,1/4-X 3/4+Z,1/4-Y,3/4-X 1/4+Z,1/4+Y,1/4+X 1/2+X,1/2+Y,1/2+Z -X,1/2-Y,Z 1/2-X,Y,-Z X,-Y,1/2-Z 1/2+Z,1/2+X,1/2+Y Z,-X,1/2-Y -Z,1/2-X,Y 1/2-Z,X,-Y 1/2+Y,1/2+Z,1/2+X 1/2-Y,Z,-X Y,-Z,1/2-X -Y,1/2-Z,X 1/4+Y,3/4+X,3/4-Z 1/4-Y,1/4-X,1/4-Z 3/4+Y,3/4-X,1/4+Z 3/4-Y,1/4+X,3/4+Z 1/4+X,3/4+Z,3/4-Y 3/4-X,1/4+Z,3/4+Y 1/4-X,1/4-Z,1/4-Y 3/4+X,3/4-Z,1/4+Y 1/4+Z,3/4+Y,3/4-X 3/4+Z,3/4-Y,1/4+X 3/4-Z,1/4+Y,3/4+X 1/4-Z,1/4-Y,1/4-X 1/2-X,1/2-Y,1/2-Z X,1/2+Y,-Z 1/2+X,-Y,Z -X,Y,1/2+Z 1/2-Z,1/2-X,1/2-Y -Z,X,1/2+Y Z,1/2+X,-Y 1/2+Z,-X,Y 1/2-Y,1/2-Z,1/2-X 1/2+Y,-Z,X -Y,Z,1/2+X Y,1/2+Z,-X 3/4-Y,1/4-X,1/4+Z 3/4+Y,3/4+X,3/4+Z 1/4-Y,1/4+X,3/4-Z 1/4+Y,3/4-X,1/4-Z 3/4-X,1/4-Z,1/4+Y 1/4+X,3/4-Z,1/4-Y 3/4+X,3/4+Z,3/4+Y 1/4-X,1/4+Z,3/4-Y 3/4-Z,1/4-Y,1/4+X 1/4-Z,1/4+Y,3/4-X 1/4+Z,3/4-Y,1/4-X 3/4+Z,3/4+Y,3/4+X 1003 2 2 P112 PG2C MONOCLINIC 'P 1 1 2' !(dyad along z) X,Y,Z -X,-Y,Z 1004 2 2 P1121 PG2C MONOCLINIC 'P 1 1 21' !(unique axis c) X,Y,Z -X,-Y,1/2+Z 1005 4 2 B2 PG2C MONOCLINIC 'B 1 1 2' 'B 2' X,Y,Z -X,-Y,Z 1/2+X,+Y,1/2+Z 1/2-X,-Y,1/2+Z 2005 4 2 A2 PG2 MONOCLINIC 'A 1 2 1' X,Y,Z -X,Y,-Z X,1/2+Y,1/2+Z -X,1/2+Y,1/2-Z 3005 4 2 C21 PG2 MONOCLINIC 'C 1 21 1' ! (Origin on screw at 1/4X) X,Y,Z -X,1/2+Y,-Z 1/2+X,1/2+Y,Z 1/2-X,Y,-Z 4005 4 2 I2 PG2 MONOCLINIC 'I 1 2 1' 'I 2' !!! GJK @ 2003-06-02 X,Y,Z -X,Y,-Z X+1/2,Y+1/2,Z+1/2 -X+1/2,Y+1/2,-Z+1/2 5005 4 2 I21 PG2 MONOCLINIC 'I 1 21 1' X,Y,Z -X,1/2+Y,-Z X+1/2,Y+1/2,Z+1/2 -X+1/2,Y,1/2-Z 1006 2 2 P11m PGmC MONOCLINIC 'P 1 1 m' X,Y,Z X,Y,-Z 1007 2 2 P11b PGmC MONOCLINIC 'P 1 1 b' X,Y,Z X,1/2+Y,-Z 1008 4 2 B11m PGmC MONOCLINIC 'B 1 1 m' X,Y,Z X,Y,-Z 1/2+X,Y,1/2+Z 1/2+X,Y,1/2-Z 1009 4 2 B11b PGmC MONOCLINIC 'B 1 1 b' X,Y,Z X,1/2+Y,-Z 1/2+X,Y,1/2+Z 1/2+X,1/2+Y,1/2-Z 1010 4 4 P112/m PG2/mC MONOCLINIC 'P 1 1 2/m' X,Y,Z X,Y,-Z -X,-Y,Z -X,-Y,-Z 1011 4 4 P1121/m PG2/mC MONOCLINIC 'P 1 1 21/m' X,Y,Z -X,-Y,1/2+Z -X,-Y,-Z X,Y,1/2-Z 1012 8 4 B112/m PG2/mC MONOCLINIC 'B 1 1 2/m' X,Y,Z X,Y,-Z -X,-Y,Z -X,-Y,-Z 1/2+X,Y,1/2+Z 1/2+X,Y,1/2-Z 1/2-X,-Y,1/2+Z 1/2-X,-Y,1/2-Z 1013 4 4 P112/b PG2/mC MONOCLINIC 'P 1 1 2/b' X,Y,Z -X,1/2-Y,Z -X,-Y,-Z X,1/2+Y,-Z 1014 4 4 P1121/b PG2/mC MONOCLINIC 'P 1 1 21/b' X,Y,Z -X,-Y,-Z -X,1/2-Y,1/2+Z X,1/2+Y,1/2-Z 2014 4 4 P121/n1 PG2/m MONOCLINIC 'P 1 21/n 1' X,Y,Z -X+1/2,Y+1/2,-Z+1/2 -X,-Y,-Z X+1/2,-Y+1/2,Z+1/2 3014 4 4 P121/a1 PG2/m MONOCLINIC 'P 1 21/a 1' X,Y,Z -X+1/2,Y+1/2,-Z -X,-Y,-Z X+1/2,-Y+1/2,Z 1015 8 4 B112/b PG2/mC MONOCLINIC 'B 1 1 2/b' X,Y,Z -X,1/2-Y,Z -X,-Y,-Z X,1/2+Y,-Z 1/2+X,Y,1/2+Z 1/2-X,1/2-Y,1/2+Z 1/2-X,-Y,1/2-Z 1/2+X,1/2+Y,1/2-Z 1017 4 4 P2122 PG222 ORTHORHOMBIC 'P 21 2 2' !(unique axis a) X,Y,Z -X,Y,-Z 1/2+X,-Y,-Z 1/2-X,-Y,Z 2017 4 4 P2212 PG222 ORTHORHOMBIC 'P 2 21 2' !(unique axis b) X,Y,Z X,1/2-Y,-Z -X,1/2+Y,-Z -X,-Y,Z 1018 4 4 P21212a PG222 ORTHORHOMBIC 'P 21 21 2 (a)' ! origin on 21 21, shift (1/4,1/4,0) X,Y,Z 1/2-X,1/2-Y,Z X+1/2,-Y,-Z -X,Y+1/2,-Z 2018 4 4 P21221 PG222 ORTHORHOMBIC 'P 21 2 21' !(unique axis b) X,Y,Z -X,Y,-Z 1/2+X,-Y,1/2-Z 1/2-X,-Y,1/2+Z 3018 4 4 P22121 PG222 ORTHORHOMBIC 'P 2 21 21' !(unique axis a) X,Y,Z X,-Y,-Z -X,1/2+Y,1/2-Z -X,1/2-Y,1/2+Z 1020 8 4 C2221a PG222 ORTHORHOMBIC 'C 2 2 21a)' ! P212121 with C centring, shift(1/4,0,0) X,Y,Z 1/2-X,-Y,1/2+Z 1/2+X,1/2-Y,-Z -X,1/2+Y,1/2-Z 1/2+X,1/2+Y,Z -X,1/2-Y,1/2+Z X,-Y,-Z 1/2-X,Y,1/2-Z 1021 8 4 C222a PG222 ORTHORHOMBIC 'C 2 2 2a' ! C21212a origin on 21 21 X,Y,Z 1/2-X,1/2-Y,Z X+1/2,-Y,-Z -X,Y+1/2,-Z 1/2+ X,1/2+Y,Z -X,-Y,Z X,1/2-Y,-Z 1/2-X,Y,-Z 1022 16 4 F222a PG222 ORTHORHOMBIC 'F 2 2 2a' ! same as 1018 with face centring shift (1/4,0,0) X,Y,Z 1/2-X,1/2-Y,Z X+1/2,-Y,-Z -X,Y+1/2,-Z X,Y+1/2,Z+1/2 1/2-X,-Y,Z+1/2 X+1/2,-Y+1/2,-Z+1/2 -X,Y,-Z+1/2 X+1/2,Y,Z+1/2 -X,1/2-Y,Z+1/2 X,-Y,-Z+1/2 -X+1/2,Y+1/2,-Z+1/2 X+1/2,Y+1/2,Z -X,-Y,Z X,-Y+1/2,-Z -X+1/2,Y,-Z 1023 8 4 I222a PG222 ORTHORHOMBIC 'I 2 2 2a' ! as 1018 with origin shift (1/4,1/4,1/4) X,Y,Z 1/2-X,1/2-Y,Z X+1/2,-Y,-Z -X,Y+1/2,-Z 1/2+X,1/2+Y,1/2+Z -X,-Y,1/2+Z 1/2-X,Y,1/2-Z X,1/2-Y,1/2-Z 1059 8 8 Pmmn2 PGmmm ORTHORHOMBIC 'P 21/m 21/m 2/n a' X,Y,Z 1/2-X,1/2-Y,Z -X,1/2+Y,-Z 1/2+X,-Y,-Z -X,-Y,-Z X+1/2,Y+1/2,-Z X,1/2-Y,Z 1/2-X,Y,Z 1094 8 8 P42212a PG422 TETRAGONAL 'P 42 21 2a' ! (as P21212a) origin on 21 21 ie Shift 1/4,1/4,1/4 X,Y,Z 1/2-X,1/2-Y,Z -Y,X+1/2,1/2+Z Y+1/2,-X,1/2+Z -X,Y+1/2,-Z X+1/2,-Y,-Z Y,X,1/2-Z 1/2-Y,1/2-X,1/2-Z 1197 24 12 I23a PG23 CUBIC 'I 2 3a' ! Expansion of 1023 which is an expansion of 1018 X,Y,Z 1/2-X,1/2-Y,Z X+1/2,-Y,-Z -X,Y+1/2,-Z Y,Z,X 1/2-Y,1/2-Z,X Y+1/2,-Z,-X -Y,Z+1/2,-X Z,X,Y 1/2-Z,1/2-X,Y Z+1/2,-X,-Y -Z,X+1/2,-Y 1/2+X,1/2+Y,1/2+Z -X,-Y,1/2+Z X,1/2-Y,1/2-Z 1/2-X,Y,1/2-Z 1/2+Y,1/2+Z,1/2+X -Y,-Z,1/2+X Y,1/2-Z,1/2-X 1/2-Y,Z,1/2-X 1/2+Z,1/2+X,1/2+Y -Z,-X,1/2+Y Z,1/2-X,1/2-Y 1/2-Z,X,1/2-Y libccp4-8.0.0/fortran/binsort.h0000644000000000000000000000260214242731033014470 0ustar 00000000000000/* binsort.h: header for binary sorting functions This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /**************************************************************************** binsort.h Z130891 binsort - key data types definition. ****************************************************************************/ /*** Data types definition name begining with U means unsigned... ***/ #define CHAR (int)1 #define UCHAR (int)2 #define SHORT (int)3 #define USHORT (int)4 #define LONG (int)5 #define ULONG (int)6 #define FLOAT (int)7 #define DOUBLE (int)8 /*** Sorting order ***/ #define ASC (int)0 /* ascending */ #define DESC (int)1 /* descending */ libccp4-8.0.0/fortran/binsortint.c0000644000000000000000000002654214242731033015207 0ustar 00000000000000/* binsortint.c: binary sorting functions This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /************************************************************************* binsortint.c Z131093 IMPORTANT This version is compatible with binsort version Z130891 and later. Agains version Z080389 arguments of SRTBEG have been changed. Modify and recompile your programs. WHAT IS binsortint binsortint is a set of routines used as an interface to binsort mainly from FORTRAN programs. Link this module in form of object module with your program. CALLS: SRTBEG sort initialisation SRTRLS puts one record into sort SRTMRG finishes sequence of input records SRTRET gets one record from sort For information about key type values see binsortkey.h Good Luck J. Zelinka ***************************************************************************/ /* Probably, these function have never been used on Windows. */ #ifndef _WIN32 #include "binsort.h" #include #include #include #include #ifndef NOUNISTD /* ESV, for instance doesn't have it */ # include #endif #include #include #include #include /* necessary on Titan, at least, and for POSIX wait */ #if __STDC__ && !defined(PROTOTYPE) #define PROTOTYPE 1 #endif #define TRUE 1 #define FALSE 0 #ifndef EIO # define EIO 5 #endif static int fildesout[2], /* file descriptors for "r" & "w" access */ fildesin[2]; static FILE *filout, /* file pointers for fildesout, fildesin */ *filin; static int pid; /* child process id */ static int recl; /* record length (fixed) */ static int f_verbose = FALSE; /* verbose flag */ /*======================================================= SRTBEG: Sort initialisation INTEGER SRTBEG (function) returns 0 if O.K. errno ot -1 otherwise INTEGER NKYES number of keys INTEGER KEYBUF(at least # of keys * 5) keys description INTEGER LRECL (FIXED) length of record (BYTES) INTEGER MEMSIZE size of memory used by sort (BYTES) if .EQ. 0, default size I = SRTBEG(NKEYS,KEYBUF,LRECL,MEMSIZE) I.EQ.0 status O.K. KEYBUF consist of NKEYS entries, each of the form: INTEGER KEYTYP key type (see binsortproc.h) INTEGER ORDER sort order ( - || - ) INTEGER KEYPOS position within record (BYTES, 1st is position 0) INTEGER KEYLNG length (data units chars, shorts ...) INTEGER MASK mask applied to data element before comparison (if 0 no mask applied) =======================================================*/ /* F2C isn't disjoint with the rest, so be careful (also for other routines). */ #if defined (PROTOTYPE) #if defined (sgi) || \ defined(__OSF1__) || defined(__osf__) || defined(F2C) || \ defined(G77) || defined(linux) || defined(__linux__) || defined (sun) || \ defined(__APPLE__) int srtbeg_ (int *nkeys, int *keybuf, int *lrecl, int *memsize) #else #if defined (__hpux) || defined (_AIX) || defined (___AIX) int srtbeg (int *nkeys, int *keybuf, int *lrecl, int *memsize) #endif #endif /* no PROTOTYPE */ #else #if defined (sgi) || \ defined(__OSF1__) || defined(__osf__) || defined(F2C) || \ defined(G77) || defined(linux) || defined(__linux__) || defined (sun) || \ defined(__APPLE__) int srtbeg_ (nkeys, keybuf, lrecl, memsize) #else #if defined (__hpux) || defined (_AIX) || defined (___AIX) int srtbeg (nkeys, keybuf, lrecl, memsize) #endif #endif int *keybuf; /* keys description */ int *lrecl; /* length of record */ int *nkeys; /* number of keys */ int *memsize; /* size of memory (BYTES) used by sort */ #endif { char **argv, **pargv; int argc; char *binsortname; static char *rclswitch = "-r"; char lengthbuf [10]; static char *memswitch = "-m"; char memsizbuf [10]; int numkeys, i; static char *keyswitch = "-k"; char keydatatype; char sortorder; char *charvalue; if (charvalue = (char *) getenv ("BINSORT_VERB")) f_verbose = charvalue ? TRUE : FALSE; binsortname = "binsort"; if (charvalue = (char *) getenv ("BINSORT_NAME")) binsortname = charvalue; pipe(fildesin); pipe(fildesout); recl = *lrecl; if ((pid = fork()) == 0 ) { /* the child process */ /* create input and output pipes */ if ((close(0) != 0) || /* close stdin */ (dup(fildesout[0]) < 0) || (close(1) != 0) || (dup(fildesin[1]) < 0) || (close(fildesout[1]) != 0) || (close(fildesin[0]) != 0)) { perror("Binsort -- failed to handle I/O pipes to the parent process"); _exit(1); } /* prepare binsort command line */ argc = (*nkeys * 2) + 2 + 1 + 1; if (*memsize) argc += 2; argv = (char **)malloc(argc * sizeof(char *)); if (argv == NULL) { fprintf(stderr,"malloc failed in SRTBEG\n"); _exit(1); } argv [argc-1] = (char *)NULL; pargv = argv; *pargv++ = binsortname; *pargv++ = rclswitch; /* -r length */ sprintf(lengthbuf, "%d", recl); *pargv++ = lengthbuf; if (*memsize) { *pargv++ = memswitch; /* -m size */ sprintf(memsizbuf, "%d", *memsize); *pargv++ = memsizbuf; } for (numkeys = *nkeys; numkeys; --numkeys, keybuf += 5) { *pargv++ = keyswitch; /* -k keydescription */ *pargv = (char *)malloc(256); if (*pargv == NULL) { fprintf(stderr,"malloc failed in SRTBEG\n"); _exit(1); } switch (keybuf [0]) { case CHAR: keydatatype = 'c'; break; case UCHAR: keydatatype = 'C'; break; case SHORT: keydatatype = 's'; break; case USHORT: keydatatype = 'S'; break; case LONG: keydatatype = 'l'; break; case ULONG: keydatatype = 'L'; break; case FLOAT: keydatatype = 'f'; break; case DOUBLE: keydatatype = 'd'; break; } sortorder = (keybuf [1] == ASC) ? 'a' : 'd'; switch (keybuf [0]) { case UCHAR: case USHORT: case ULONG: sprintf(*pargv, "%c:%c:%d:%d:%x", keydatatype, sortorder, keybuf [2], keybuf [3], keybuf [4]); break; default: sprintf(*pargv, "%c:%c:%d:%d", keydatatype, sortorder, keybuf [2], keybuf [3]); } ++pargv; } if (f_verbose) fprintf(stderr, " binsortint -- calling program \"%s\"\n",binsortname); if (f_verbose) { for (i=0; i < argc ;++i) { fprintf(stderr, " binsortint -- argument #%d = \"%s\"\n",i,argv[i]); } } execvp(binsortname, argv); perror("Trying to execute binsort"); _exit(errno); } else if (pid == -1) { /* fork failed */ perror("Trying to fork for binsort"); return(errno); } else { /* THE PARENT */ close(fildesout[0]); close(fildesin[1]); if (!(filout = fdopen(fildesout[1], "w"))) return(EIO); } return(0); } /*======================================================= SRTRLS: Release one record into Sort INTEGER SRTRLS (function) CHARACTER*(at least length of the record) RECORD pointer to record I = SRTRLS(RECORD) I.EQ.0 status O.K. errno otherwise =======================================================*/ #if defined (PROTOTYPE) #if defined (sgi) || \ defined(__OSF1__) || defined(__osf__) || defined(F2C) || \ defined(G77) || defined(linux) || defined(__linux__) || defined (sun) || \ defined(__APPLE__) int srtrls_ (char *record) #else #if defined (__hpux) || defined (_AIX) || defined (___AIX) int srtrls (char *record) #endif #endif /* no PROTOTYPE */ #else #if defined (sgi) || \ defined(__OSF1__) || defined(__osf__) || defined(F2C) || \ defined(G77) || defined(linux) || defined(__linux__) || defined (sun) || \ defined(__APPLE__) int srtrls_ (record) #else #if defined (__hpux) || defined (_AIX) || defined (___AIX) int srtrls (record) #endif #endif char *record; #endif { register size_t ret; ret = fwrite(record, sizeof(char), recl, filout); return(ret == recl ? 0 : ferror(filout)); } /*======================================================= SRTMRG: Merge - finish release phase INTEGER SRTMRG (function) I = SRTMRG() I.EQ.0 status O.K. errno otherwise =======================================================*/ #if defined (sgi) || \ defined(__OSF1__) || defined(__osf__) || defined(F2C) || \ defined(G77) || defined(linux) || defined(__linux__) || defined (sun) || \ defined(__APPLE__) int srtmrg_ () #else #if defined (__hpux) || defined (_AIX) || defined (___AIX) int srtmrg () #endif #endif { fclose(filout); if (!(filin = fdopen(fildesin[0], "r"))) return(EIO); return(0); } /*======================================================= SRTRET: Return 1 record from sort INTEGER SRTRET (function) CHARACTER*(at least length of the record) RECORD pointer to record I = SRTRET(RECORD) I.EQ.0 status O.K. I.EQ. -1 End of records errno otherwise =======================================================*/ #if defined (PROTOTYPE) #if defined (sgi) || \ defined(__OSF1__) || defined(__osf__) || defined(F2C) || \ defined(G77) || defined(linux) || defined(__linux__) || defined (sun) || \ defined(__APPLE__) int srtret_ (char *record) #else #if defined (__hpux) || defined (_AIX) || defined (___AIX) int srtret (char *record) #endif #endif /* no PROTOTYPE */ #else #if defined (sgi) || \ defined(__OSF1__) || defined(__osf__) || defined(F2C) || \ defined(G77) || defined(linux) || defined(__linux__) || defined (sun) || \ defined(__APPLE__) int srtret_ (record) #else #if defined (__hpux) || defined (_AIX) || defined (___AIX) int srtret (record) #endif #endif char *record; #endif { register size_t ret; int reterr; int status=0; if ((ret = fread(record, sizeof(char), recl, filin)) == recl) { return(0); } /* else EOF or read error */ if ((int) wait (&status) < 0) { /* some error with sub-process */ fclose(filin); return (EIO); } if (feof(filin) && status == 0 && ret == 0) { /* ensure record not truncated */ fclose(filin); return(-1); /* normal EOF */ } reterr=ferror(filin); fclose(filin); if (status != 0) return (status); /* sub-process abended */ if (reterr != 0) { return (reterr); } else /* e.g. premature EOF */ return (EIO); } #endif /* _WIN32 */ libccp4-8.0.0/fortran/ccp4_diskio_f.c0000644000000000000000000006022414242731033015507 0ustar 00000000000000/* ccp4_diskio_f.c FORTRAN API for file i/o. Copyright (C) 2002 CCLRC, Charles Ballard and Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @page diskio_f_page Fortran API for low level input/output. * * @section diskio_f_file_list File list
  • ccp4_diskio_f.c
* @section diskio_f_overview Overview This library consists of a set of wrappers to C functions which perform random access input/output (I/O) on various data items, including bytes, to stream-mode files. */ /** @file ccp4_diskio_f.c * FORTRAN API for file i/o. * Charles Ballard and Martyn Winn */ /* FORTRAN API for library.c * * revisions: * (4/5/01) C.Ballard * respond to first steps to make library.c * more "C" like. * (21/8/01) C.Ballard * error catching from library.c * * * Portability and Code * * System dependent names are handled in the FORTRAN_SUBR, * FORTRAN_FUN, FORTRAN_CALL macros defined in the header file. * fpstr is a typedef which masks the intricacies of FORTRAN string * passing. */ #include #include "ccp4_utils.h" #include "ccp4_errno.h" #include "ccp4_fortran.h" #include "ccp4_file_err.h" /* rcsid[] = "$Id$" */ /** * _ioChannels: * structure to hold files */ typedef struct _CCP4IObj CCP4IObj; enum FILE_KLASS {NONE,CCP4_FILE,CCP4_MAP}; struct _CCP4IObj { enum FILE_KLASS klass; CCP4File *iobj; }; static CCP4IObj *_ioChannels[MAXFILES]; int _get_channel() { int i; for ( i = 1; i < MAXFILES ; i++) if (!_ioChannels[i]) return i; return -1; } CCP4IObj *_iobj_init() { return (CCP4IObj *) malloc(sizeof(CCP4IObj)); } static int file_attribute[] = { /* DISKIO file modes */ O_RDWR | O_TRUNC, /* 'UNKNOWN' open as 'OLD'/'NEW' check existence */ O_TMP | O_RDWR | O_TRUNC, /* 'SCRATCH' open as 'OLD' and delete on closing */ O_RDWR, /* 'OLD' file MUST exist or program halts */ O_RDWR | O_TRUNC, /* 'NEW' create (overwrite) new file */ O_RDONLY /* 'READONLY' self explanatory */ }; FORTRAN_SUBR ( QOPEN, qopen, (int *iunit, fpstr lognam, fpstr atbuta, fpstr_size_t lognam_len, fpstr_size_t atbuta_len), (int *iunit, fpstr lognam, fpstr atbuta), (int *iunit, fpstr lognam, fpstr_size_t lognam_len, fpstr atbuta, fpstr_size_t atbuta_len)) { char *atbut2, *temp_lognam, *fname; int istat; atbut2 = ccp4_FtoCString(FTN_STR(atbuta), FTN_LEN(atbuta)); switch (atbut2[0]) { case 'U': case 'u': istat = 0; break; case 'S': case 's': istat = 1; break; case 'O': case 'o': istat = 2; break; case 'N': case 'n': istat = 3; #ifndef _MSC_VER if (strcasecmp(getenv("CCP4_OPEN"),"UNKNOWN")) #else if (_stricmp(getenv("CCP4_OPEN"),"UNKNOWN")) #endif istat = 0; break; case 'R': case 'r': istat = 4; break; default: ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_BadMode), "QOPEN", NULL); } if (atbut2) free(atbut2); if ((*iunit = _get_channel()) == -1) ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_MaxFile), "COPEN1", NULL); _ioChannels[*iunit] = _iobj_init(); temp_lognam = ccp4_FtoCString(FTN_STR(lognam), FTN_LEN(lognam)); if (!(fname = getenv(temp_lognam))) fname = temp_lognam; if (!(_ioChannels[*iunit]->iobj = ccp4_file_open (fname, file_attribute[istat]) ) ) { printf(" Can't open file %s\n",fname); ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_CantOpenFile), "COPEN2", NULL); } _ioChannels[*iunit]->klass = CCP4_FILE; if(temp_lognam) free(temp_lognam); } FORTRAN_SUBR ( QQOPEN, qqopen, (int *iunit, fpstr lognam, const int *istat, fpstr_size_t lognam_len), (int *iunit, fpstr lognam, const int *istat), (int *iunit, fpstr lognam, fpstr_size_t lognam_len, const int *istat)) { char *fname, *temp_lognam; int jstat; temp_lognam = ccp4_FtoCString(FTN_STR(lognam), FTN_LEN(lognam)); if (*istat < 1 || *istat > 5) ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_BadMode), "QQOPEN (mode)", NULL); jstat = *istat; if (jstat == 4) #ifndef _MSC_VER if (strcasecmp(getenv("CCP4_OPEN"),"UNKNOWN")) #else if (_stricmp(getenv("CCP4_OPEN"),"UNKNOWN")) #endif jstat = 1; if (!(fname = getenv(temp_lognam))) fname = temp_lognam; if ((*iunit = _get_channel()) == -1) ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_MaxFile), "QQOPEN", NULL); _ioChannels[*iunit] = _iobj_init(); if (!(_ioChannels[*iunit]->iobj = ccp4_file_open (fname, file_attribute[jstat-1]) ) ) ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_MaxFile), "QQOPEN", NULL); _ioChannels[*iunit]->klass = CCP4_FILE; if(temp_lognam) free(temp_lognam); } /** * Opens filename on io stream iunit. istat corresponds to the open mode. * @param iunit iochannel number * @param filename fortran character array giving filename * @param istat file mode */ FORTRAN_SUBR ( COPEN, copen, (int *iunit, fpstr filename, int *istat, fpstr_size_t filename_len), (int *iunit, fpstr filename, int *istat), (int *iunit, fpstr filename, fpstr_size_t filename_len, int *istat)) { char *tempfile; tempfile = ccp4_FtoCString(FTN_STR(filename), FTN_LEN(filename)); if ((*iunit = _get_channel()) == -1) ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_MaxFile), "COPEN", NULL); _ioChannels[*iunit] = _iobj_init(); if (!(_ioChannels[*iunit]->iobj = ccp4_file_open (tempfile, file_attribute[*istat-1]) ) ) ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_MaxFile), "COPEN", NULL); _ioChannels[*iunit]->klass = CCP4_FILE; free(tempfile); } /** * qrarch: * @iunit: iochannel * @ipos: position in file * @ireslt: return value * * For binary files with a well-determined structure in terms of * [[float]]s and [[int]]s we may want to set up the connected stream to * do transparent reading of files written on a machine with a different * architecture. This is currently the case for map files and * MTZ files and this routine is called from mtzlib and maplib. * * qrarch reads the machine stamp at word ipos * for the diskio file on stream iunit and sets up the appropriate * bit-twiddling for subsequent qreads on that stream. The * information read from the file is returned in \meta{ireslt} in the * form fileFT+16fileIT. If the stamp is zero * (as it would be for files written with a previous version of the * library) we assume the file is in native format and needs no * conversion in qread; in this case ireslt will be zero and * the caller can issue a warning. Iconvert and Fconvert are * used by qread to determine the type of conversion (if any) to be * applied to integers and reals. * * Fudge:fudge Ian Tickle reports old VAX files which have a machine * stamp which is byte-flipped from the correct VAX value,although it should * always have been zero as far as I can see. To accommodate this, set the * logical NATIVEMTZ and the machine stamp won't be read for any * input files for which qrarch is called. * * Extra feature: logical/environment variable CONVERT_FROM may be set * to one of BEIEEE, LEIEEE, VAX or CONVEXNATIVE to avoid * reading the machine stamp and assume the file is from the stipulated * archictecture for all input MTZ and map files for which qrarch is * called. * * N.B.: leaves the stream positioned just after the machine stamp. * */ FORTRAN_SUBR ( QRARCH, qrarch, (int *iunit, int *ipos, int *ireslt), (int *iunit, int *ipos, int *ireslt), (int *iunit, int *ipos, int *ireslt)) { if (ccp4_file_setstamp(_ioChannels[*iunit]->iobj, *ipos)) ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_BadMode), "QRARCH", NULL); if ((*ireslt = ccp4_file_rarch (_ioChannels[*iunit]->iobj)) == -1) ccp4_signal(CCP4_ERRLEVEL(4), "QRARCH", NULL); } /** * qwarch * @iunit: io channel * @ipos: position * * This is the complement of qrarch, writing the native machine * architecture information machine stamp to diskio stream * iunit at word ipos. Currently called from mtzlib and maplib. * * The machine stamp in mtstring is four nibbles in order, indicating * complex and real format (must both be the same), integer format and * character format (currently irrelevant). The last two bytes of * mtstring are currently unused and always zero. * * N.B.: leaves the stream positioned just after the machine stamp. * */ FORTRAN_SUBR ( QWARCH, qwarch, (int *iunit, int *ipos), (int *iunit, int *ipos), (int *iunit, int *ipos)) { if (ccp4_file_setstamp(_ioChannels[*iunit]->iobj, *ipos)) ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_BadMode), "QWARCH", NULL); if (ccp4_file_warch (_ioChannels[*iunit]->iobj) == -1) ccp4_signal(CCP4_ERRLEVEL(4), "QWARCH", NULL); } /** * qclose: * @iunit: io channel * * Closes the file open on diskio stream iunit */ FORTRAN_SUBR ( QCLOSE, qclose, (int *iunit), (int *iunit), (int *iunit)) { if (ccp4_file_close (_ioChannels[*iunit]->iobj)) ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_CloseFail), "QCLOSE", NULL); free(_ioChannels[*iunit]); _ioChannels[*iunit]=NULL; } /** * qmode: * @iunit: io channel * @mode: access mode * @size: item size * * Changes the diskio access mode for stream @iunit to * @mode. The resulting size in bytes of items for transfer is * returned as @size * */ FORTRAN_SUBR ( QMODE, qmode, (int *iunit, int *mode, int *size), (int *iunit, int *mode, int *size), (int *iunit, int *mode, int *size)) { if ( (*size = ccp4_file_itemsize(_ioChannels[*iunit]->iobj)) == -1 || ccp4_file_setmode(_ioChannels[*iunit]->iobj,*mode) == -1) ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_BadMode), "QMODE", NULL); } /** * qread: * @iunit: io channel * @buffer: * @nitems: number of items * @result: return value * * Reads @nitems in the current mode qmode() from diskio * stream @iunit previously opened by qopen() and * returns @result which is %0 on success or %-1 at EOF. * It aborts on an i/o error. * Numbers written in a foreign format will be translated if necessary if * the stream is connected to an MTZ or map file. * */ FORTRAN_SUBR ( QREAD, qread, (int *iunit, uint8 *buffer, int *nitems, int *result), (int *iunit, uint8 *buffer, int *nitems, int *result), (int *iunit, uint8 *buffer, int *nitems, int *result)) { *result = 0; if ( ccp4_file_read (_ioChannels[*iunit]->iobj, buffer, *nitems) != *nitems){ if ( ccp4_file_feof(_ioChannels[*iunit]->iobj) ) *result = -1; else ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_ReadFail), "QREAD", NULL); } } /** * qreadi: * @iunit: io channel * @buffer: * @result: * * Fills INT buffer in int mode from diskio stream * @iunit previously opened by qopen() and returns * @result} which %0 on success or %-1 on EOF. * It aborts on an i/o failure. * Call it with a character substring if necessary to control the number * of bytes read. * */ FORTRAN_SUBR ( QREADI, qreadi, (int *iunit, uint8* buffer, int *nitems, int *result), (int *iunit, uint8* buffer, int *nitems, int *result), (int *iunit, uint8* buffer, int *nitems, int *result)) { *result = 0; if ( ccp4_file_readint (_ioChannels[*iunit]->iobj, buffer, *nitems) != *nitems) { if ( ccp4_file_feof(_ioChannels[*iunit]->iobj) ) *result = -1; else ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_ReadFail), "QREADI", NULL); } } /** * qreadi2: * @iunit: io channel * @buffer: * @result: * * Fills INT*2 buffer in int mode from diskio stream * @iunit previously opened by qopen() and returns * @result} which %0 on success or %-1 on EOF. * It aborts on an i/o failure. * Call it with a character substring if necessary to control the number * of bytes read. * */ FORTRAN_SUBR ( QREADI2, qreadi2, (int *iunit, uint8* buffer, int *nitems, int *result), (int *iunit, uint8* buffer, int *nitems, int *result), (int *iunit, uint8* buffer, int *nitems, int *result)) { *result = 0; if ( ccp4_file_readshort (_ioChannels[*iunit]->iobj, buffer, *nitems) != *nitems) { if ( ccp4_file_feof(_ioChannels[*iunit]->iobj) ) *result = -1; else ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_ReadFail), "QREADI2", NULL); } } /** * qreadr: * @iunit: * @buffer: * @result: * * Fills REAL] buffer in int mode from diskio stream * @iunit previously opened by qopen() and returns * @result which 0 on success or -1 on EOF. * It aborts on an i/o failure. * Call it with a character substring if necessary to control the number * of bytes read. * */ FORTRAN_SUBR ( QREADR, qreadr, (int *iunit, uint8* buffer, int *nitems, int *result), (int *iunit, uint8* buffer, int *nitems, int *result), (int *iunit, uint8* buffer, int *nitems, int *result)) { *result = 0; if ( ccp4_file_readfloat (_ioChannels[*iunit]->iobj, buffer, *nitems) != *nitems) { if ( ccp4_file_feof(_ioChannels[*iunit]->iobj) ) *result = -1; else ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_ReadFail), "QREADR", NULL); } } /** * qreadq: * @iunit: * @buffer: * i@result: * * Fills COMPLEX buffer in int mode from diskio stream * @iunit previously opened by qopen() and returns * @result which 0 on success or -1 on EOF. * It aborts on an i/o failure. * Call it with a character substring if necessary to control the number * of bytes read. * */ FORTRAN_SUBR ( QREADQ, qreadq, (int *iunit, uint8* buffer, int *nitems, int *result), (int *iunit, uint8* buffer, int *nitems, int *result), (int *iunit, uint8* buffer, int *nitems, int *result)) { *result = 0; if ( ccp4_file_readcomp (_ioChannels[*iunit]->iobj, buffer, *nitems) != *nitems) { if ( ccp4_file_feof(_ioChannels[*iunit]->iobj) ) *result = -1; else ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_ReadFail), "QREADQ", NULL); } } /** * qreadc:: * @iunit: * @buffer: * @result: * * Fills CHARACTER buffer in byte mode from diskio stream * @iunit previously opened by qopen() and returns * @result which is 0 on success or -1 on EOF. * It aborts on an i/o failure. * Call it with a character substring if necessary to control the number * of bytes read. * */ FORTRAN_SUBR ( QREADC, qreadc, (int *iunit, fpstr buffer, int *result, fpstr_size_t buffer_len), (int *iunit, fpstr buffer, int *result), (int *iunit, fpstr buffer, fpstr_size_t buffer_len, int *result)) { int n; n = FTN_LEN(buffer); if (ccp4_file_readchar (_ioChannels[*iunit]->iobj, (uint8 *) FTN_STR(buffer), (size_t) n) != n) ccp4_signal(CCP4_ERRLEVEL(4) | CCP4_ERRNO(CIO_ReadFail), "QREADC", NULL); *result = 0; } /** * qwrite: * @iunit: * @buffer: * @meta: * * This write @nitems items from @buffer to qopen() * stream \meta{iunit} using the current mode. * */ FORTRAN_SUBR ( QWRITE, qwrite, (int *iunit, uint8 * buffer, int *nitems), (int *iunit, uint8 * buffer, int *nitems), (int *iunit, uint8 * buffer, int *nitems)) { if ( ccp4_file_write (_ioChannels[*iunit]->iobj, buffer, *nitems) != *nitems) ccp4_signal(CCP4_ERRLEVEL(4), "QWRITE", NULL); } /** * qwriti: * @iunit: * @buffer: * @nitems: * * This write @nitems items from @buffer to qopen() * stream @iunit using the INT32 mode. * */ FORTRAN_SUBR ( QWRITI, qwriti, (int *iunit, uint8 * buffer, int *nitems), (int *iunit, uint8 * buffer, int *nitems), (int *iunit, uint8 * buffer, int *nitems)) { if ( ccp4_file_writeint (_ioChannels[*iunit]->iobj, buffer, *nitems) != *nitems) ccp4_signal(CCP4_ERRLEVEL(4), "QWRITI", NULL); } /** * qwritr: * @iunit: * @buffer: * @nitems: * * This write @nitems items from @buffer to qopen() * stream @iunit using the FLOAT32 mode. * */ FORTRAN_SUBR ( QWRITR, qwritr, (int *iunit, uint8 * buffer, int *nitems), (int *iunit, uint8 * buffer, int *nitems), (int *iunit, uint8 * buffer, int *nitems)) { if ( ccp4_file_writefloat (_ioChannels[*iunit]->iobj, buffer, *nitems) != *nitems) ccp4_signal(CCP4_ERRLEVEL(4), "QWRITR", NULL); } /** * qwrite: * @iunit: * @buffer: * @nitems: * * This write @nitems items from @buffer to qopen() * stream @iunit using the COMP64 mode. * */ FORTRAN_SUBR ( QWRITQ, qwritq, (int *iunit, uint8 * buffer, int *nitems), (int *iunit, uint8 * buffer, int *nitems), (int *iunit, uint8 * buffer, int *nitems)) { if ( ccp4_file_writecomp (_ioChannels[*iunit]->iobj, buffer, *nitems) != *nitems) ccp4_signal(CCP4_ERRLEVEL(4), "QWRITQ", NULL); } /* \subsection{{\tt subroutine qwritc (\meta{iunit}, \meta{buffer})}} */ /* */ /* Writes [[CHARACTER*(*)]] \meta{buffer} to [[qopen]]ed */ /* stream \meta{iunit} in byte mode. */ /* */ /* = */ FORTRAN_SUBR ( QWRITC, qwritc, (int *iunit, fpstr buffer, fpstr_size_t buffer_len), (int *iunit, fpstr buffer), (int *iunit, fpstr buffer, fpstr_size_t buffer_len)) { int n; n = FTN_LEN(buffer); if (ccp4_file_writechar (_ioChannels[*iunit]->iobj, (uint8 *) FTN_STR(buffer), (size_t) n) != n) ccp4_signal(CCP4_ERRLEVEL(4), "WWRITC", NULL); } /** * qseek: * @iunit: * @irec: * @iel: * @lrecl: * * Seeks to element @iel in record @irec in diskio stream * @iunit whose record length is @lrecl. * */ FORTRAN_SUBR ( QSEEK, qseek, (int *iunit, int *irec, int *iel, int *lrecl), (int *iunit, int *irec, int *iel, int *lrecl), (int *iunit, int *irec, int *iel, int *lrecl)) { /*switch from FORTRAN offset to C offset */ if (ccp4_file_seek (_ioChannels[*iunit]->iobj, (*irec-1)*(*lrecl)+(*iel-1),SEEK_SET) ) ccp4_signal(CCP4_ERRLEVEL(4), "QSEEK", NULL); } /** * qback: * @iunit: * @lrecl: * * Backspaces one record, of length @lrecl on diskio stream @iunit. * */ FORTRAN_SUBR ( QBACK, qback, (int *iunit, int *lrecl), (int *iunit, int *lrecl), (int *iunit, int *lrecl)) { if (ccp4_file_seek (_ioChannels[*iunit]->iobj, -(*lrecl), SEEK_CUR) ) ccp4_signal(CCP4_ERRLEVEL(4), "QBACK", NULL); } /** * qskip: * @iunit: * @lrecl: * * Skip forward 1 record of length @lrecl on diskio stream @iunit. * */ FORTRAN_SUBR ( QSKIP, qskip, (int *iunit, int *lrecl), (int *iunit, int *lrecl), (int *iunit, int *lrecl)) { if (ccp4_file_seek (_ioChannels[*iunit]->iobj, *lrecl, SEEK_CUR) ) ccp4_signal(CCP4_ERRLEVEL(4), "QSKIP", NULL); } /** * qqinq: * @istrm: * @filnam: * @length: * * Returns the name @filnam and @length of the file (if any) * open on diskio stream @istrm. * */ FORTRAN_SUBR ( QQINQ, qqinq, (int *istrm, fpstr logname, fpstr filename, int *length, fpstr_size_t logname_len, fpstr_size_t filename_len), (int *istrm, fpstr logname, fpstr filename, int *length), (int *istrm, fpstr logname, fpstr_size_t logname_len, fpstr filename, fpstr_size_t filename_len, int *length)) { char *log_name = NULL, *file_name; if ( *istrm < 1 || *istrm >= MAXFILES || !_ioChannels[*istrm]->iobj) { *length = -1; if (!(log_name = ccp4_FtoCString(FTN_STR(logname), FTN_LEN(logname)))) log_name = strdup("diskio.dft"); if (!(file_name = getenv(log_name))) file_name = log_name; for ( *istrm = 1; *istrm != MAXFILES; (*istrm)++) if (!strcmp(file_name,_ioChannels[*istrm]->iobj->name)) break; } if (*istrm != MAXFILES) { *length = ccp4_file_length(_ioChannels[*istrm]->iobj); strncpy(FTN_STR(filename), _ioChannels[*istrm]->iobj->name, MIN(strlen(_ioChannels[*istrm]->iobj->name), FTN_LEN(filename))); } if ( *length == -1) ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_SeekFail), "QINQ", NULL); if (log_name != NULL) free(log_name); } /** * qlocate: * @iunit: * @locate: * * Returns the current position \meta{locate} in the diskio stream @iunit. * */ FORTRAN_SUBR ( QLOCATE, qlocate, (int *iunit, int *locate), (int *iunit, int *locate), (int *iunit, int *locate)) { if ( (*locate = (int) ccp4_file_tell (_ioChannels[*iunit]->iobj) ) == -1) ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_SeekFail), "QLOCATE", NULL); } libccp4-8.0.0/fortran/ccp4_general_f.c0000644000000000000000000003376014242731033015647 0ustar 00000000000000/* ccp4_general_f.c: Fortran API to ccp4_general.c. Copyright (C) 2001 CCLRC, Martyn Winn et al This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file ccp4_general_f.c * Fortran API to ccp4_general.c. * Created Oct. 2001 by Martyn Winn */ #include #include #include #include #include #if HAVE_CONFIG_H # include "config.h" #endif #include "ccp4_errno.h" #include "ccp4_fortran.h" #include "ccp4_parser.h" #include "ccp4_program.h" #include "ccp4_utils.h" #include "ccp4_general.h" #include "cmtzlib.h" #include "csymlib.h" /* rcsid[] = "$Id$" */ /** Free all memory malloc'd from static pointers in Fortran interface. * To be called before program exit. The function can be * registered with atexit. */ void ccp4f_mem_tidy(void) { MtzMemTidy(); ccp4spg_mem_tidy(); } /* MVS was defaulting to assigning GETARG to be returning an int and it aint*/ #ifdef _MSC_VER #if (CALL_LIKE_MVS==2) void CCP4H_INIT(); void CCP4H_SUMMARY_BEG(); void CCP4H_SUMMARY_END(); void CCP4H_PRE_BEG(); #else int __stdcall IARGC(); void __stdcall GETARG(int *i,char *arg,int arg_len); void __stdcall CCP4H_INIT(); void __stdcall CCP4H_SUMMARY_BEG(); void __stdcall CCP4H_SUMMARY_END(); void __stdcall CCP4H_PRE_BEG(); #endif #else FORTRAN_SUBR(OUTBUF,outbuf,(),(),()); FORTRAN_SUBR(CCP4H_INIT, ccp4h_init, (), (), ()); FORTRAN_SUBR(CCP4H_SUMMARY_BEG, ccp4h_summary_beg, (), (), ()); FORTRAN_SUBR(CCP4H_SUMMARY_END, ccp4h_summary_end, (), (), ()); FORTRAN_SUBR (CCP4H_PRE_BEG, ccp4h_pre_beg, (), (), ()); #ifdef GFORTRAN FORTRAN_SUBR(CCP4_FFLUSH_STDOUT, ccp4_fflush_stdout, (), (), ()); #endif #endif #ifdef GFORTRAN extern int _gfortran_iargc(void); extern void _gfortran_getarg(int *i,char *arg,int arg_len); extern void _gfortran_getarg_i4(int *i,char *arg,int arg_len); #endif #if defined (_MSC_VER) && defined (IFC) extern int for_iargc(void); extern void for_getarg(int *i,char *arg, int *status, int arg_len); #endif FORTRAN_SUBR ( CCPFYP, ccpfyp, (), (), ()) { int argc, i, ierr, arg_len=500, debug=0; char **argv=NULL, arg[500]; /* turn on line buffering for stdout from C (don't think this affects Fortran side). This ensures we get library messages, but will slow things down. Is this what we want? */ /*if(ccp4_utils_outbuf()) ccp4_utils_print("OUTBUF:Can't turn off output buffering"); */ /* Turn off any buffering on input. This allows mized C and Fortran reading of stdin */ FORTRAN_CALL(OUTBUF,outbuf,(),(),()); if(ccp4_utils_noinpbuf()) ccp4_utils_print("NOINPBUF:Can't turn off input buffering"); if (debug) printf(" Entering CCPFYP \n"); /* couldn't find a C equivalent to this. In any case, since these functions are for Fortran programs, this may be the only way?? */ /* Note: for GFORTRAN iargc and getarg are intrinsics which do not follow the postpended underscore convention */ /* IARGC doesn't include argv[0] */ #if defined (GFORTRAN) argc = _gfortran_iargc() +1; #elif defined (_MSC_VER) && defined (IFC) argc = for_iargc() +1; #else argc = FORTRAN_CALL (IARGC, iargc, (), (), ()) + 1; #endif argv = (char **) ccp4_utils_malloc(argc*sizeof(char *)); if (debug) printf("Allocating memory for %d command line arguments \n",argc); memset(arg, ' ', arg_len); /* necessary for ccp4_FtoCString */ for (i = 0; i < argc; ++i) { #ifdef GFORTRAN _gfortran_getarg_i4(&i,arg,arg_len); #elif defined (_MSC_VER) && defined (IFC) for_getarg(&i,arg,&ierr,arg_len); #else FORTRAN_CALL (GETARG, getarg, (&i,arg,arg_len), (&i,arg), (&i,arg,arg_len)); #endif argv[i] = ccp4_FtoCString(arg,arg_len); if (debug) printf("CCPFYP: command line argument %d %s\n",i,argv[i]); } /* Do the preprocessing and return the error status */ ierr = ccp4fyp(argc, argv); /* Calls to ccp4_FtoCString allocate memory for argv[..] which needs to be explicitly freed before leaving this function */ for (i = 0; i < argc; i++) { if (argv[i]) { free(argv[i]); } } /* Also need to free argv itself */ if (argv) free(argv); /* Now act on any errors from ccp4fyp */ if (ierr) { /* Pass the error status and last error message to ccperror */ ccperror(ierr,(char*) ccp4_strerror(ccp4_errno)); } /* initialise html/summary stuff Note, command line switches dealt with in ccp4fyp */ FORTRAN_CALL (CCP4H_INIT, ccp4h_init, (), (), ()); if (debug) printf(" Leaving CCPFYP \n"); return; } /* pass html and summary flags to C level */ FORTRAN_SUBR ( CCP4H_INIT_CLIB, ccp4h_init_clib, (int *ihtml, int *isumm), (int *ihtml, int *isumm), (int *ihtml, int *isumm)) { html_log_output(*ihtml); summary_output(*isumm); } FORTRAN_SUBR ( CCPUPC, ccpupc, (fpstr string, fpstr_size_t string_len), (fpstr string), (fpstr string, fpstr_size_t string_len)) { char *string2, *string3; string2 = ccp4_FtoCString(FTN_STR(string), FTN_LEN(string)); if (!string2) return; string3 = (char *) ccp4_utils_malloc((strlen(string2)+1)*sizeof(char)); strtoupper(string3, string2); string3[strlen(string3)] = '\0'; ccp4_CtoFString(FTN_STR(string), FTN_LEN(string), string3); free((char *) string2); free((char *) string3); } FORTRAN_SUBR ( CCPLWC, ccplwc, (fpstr string, fpstr_size_t string_len), (fpstr string), (fpstr string, fpstr_size_t string_len)) { char *string2, *string3; string2 = ccp4_FtoCString(FTN_STR(string), FTN_LEN(string)); if (!string2) return; string3 = (char *) ccp4_utils_malloc((strlen(string2)+1)*sizeof(char)); strtolower(string3, string2); string3[strlen(string3)] = '\0'; ccp4_CtoFString(FTN_STR(string), FTN_LEN(string), string3); free((char *) string2); free((char *) string3); } #define TMP_LENGTH 128 /* this is defined outside the subroutine as some complers didn't like it insde. */ FORTRAN_SUBR ( CCPERR, ccperr, (const int *istat, const fpstr errstr, fpstr_size_t errstr_len), (const int *istat, const fpstr errstr), (const int *istat, const fpstr errstr, fpstr_size_t errstr_len)) { int length; char tmp_errstr[TMP_LENGTH]; length = (FTN_LEN(errstr) < TMP_LENGTH-1) ? FTN_LEN(errstr) : TMP_LENGTH-1 ; strncpy(tmp_errstr,errstr,length); tmp_errstr[length]='\0'; /* work around a buglet: gfortran-4.1.2 glibc-2.7-2 (2.6.23.1-37.fc8 x86_64 SMP) Flush stdout using a Fortran call before printing further. C. Flensburg 20071029. */ #ifdef GFORTRAN FORTRAN_CALL (CCP4_FFLUSH_STDOUT, ccp4_fflush_stdout, (), (), ()); #endif if (abs(*istat) <= 2) FORTRAN_CALL (CCP4H_SUMMARY_BEG, ccp4h_summary_beg, (), (), ()); if (*istat==0 || *istat==1) ccp4f_mem_tidy(); ccperror(*istat, tmp_errstr); /* in fact, doesn't return if istat 0 or 1 */ if (abs(*istat) <= 2) FORTRAN_CALL (CCP4H_SUMMARY_END, ccp4h_summary_end, (), (), ()); } FORTRAN_SUBR ( QPRINT, qprint, (const int *iflag, const fpstr msg, fpstr_size_t msg_len), (const int *iflag, const fpstr msg), (const int *iflag, const fpstr msg, fpstr_size_t msg_len)) { char *tmp_msg; tmp_msg = ccp4_FtoCString(FTN_STR(msg), FTN_LEN(msg)); ccp4printf(*iflag,"%s\n",tmp_msg); free((char *) tmp_msg); } /* switched back to ccplib.f FORTRAN_FUN ( int, LENSTR, lenstr, (fpstr string, fpstr_size_t string_len), (fpstr string), (fpstr string, fpstr_size_t string_len)) { return ( (int) ccp4_utils_flength (FTN_STR(string), FTN_LEN(string)) ); } */ /** Fortran wrapper to integer data function. * @param imonth Month (1-12). * @param iday Day (1-31). * @param iyear Year (4 digit). */ FORTRAN_SUBR ( UIDATE, uidate, (int *imonth, int *iday, int *iyear), (int *imonth, int *iday, int *iyear), (int *imonth, int *iday, int *iyear)) { int iarray[3]; ccp4_utils_idate (iarray); *imonth = iarray[1]; *iday = iarray[0]; *iyear = iarray[2]; } /** Fortran wrapper to string data function. * @param caldat Date string in format dd/mm/yy. */ FORTRAN_SUBR ( CCPDAT, ccpdat, (fpstr caldat, fpstr_size_t caldat_len), (fpstr caldat), (fpstr caldat, fpstr_size_t caldat_len)) { char date[11]; ccp4_utils_date(date); /* convert 4-digit year to old-style 2-digit year */ date[6] = date[8]; date[7] = date[9]; date[8] = '\0'; ccp4_CtoFString(FTN_STR(caldat),FTN_LEN(caldat),date); } FORTRAN_SUBR ( CCPTIM, ccptim, (int *iflag, float *cpu, float *elaps), (int *iflag, float *cpu, float *elaps), (int *iflag, float *cpu, float *elaps)) { static int tim0; static float tlast; float tarray[2]; if (*iflag == 0) { *elaps = 0.0; tim0 = time(NULL); *cpu = tlast = ccp4_utils_etime(tarray); } else { *elaps = time(NULL) - (float) tim0; *cpu = ccp4_utils_etime(tarray) - tlast; } } FORTRAN_SUBR ( UTIME, utime, (fpstr ctime, fpstr_size_t ctime_len), (fpstr ctime), (fpstr ctime, fpstr_size_t ctime_len)) { char time[9]; ccp4_CtoFString(FTN_STR(ctime),FTN_LEN(ctime),ccp4_utils_time(time)); } FORTRAN_SUBR ( UCPUTM, ucputm, (float *sec), (float *sec), (float *sec)) { static float tlast; float tarray[2]; if (*sec == 0.0) { *sec = tlast = ccp4_utils_etime(tarray); } else { *sec = ccp4_utils_etime(tarray) - tlast; } } FORTRAN_SUBR ( CCP4_VERSION, ccp4_version, (const fpstr version, fpstr_size_t version_len), (const fpstr version), (const fpstr version, fpstr_size_t version_len)) { ccp4_CtoFString(FTN_STR(version), FTN_LEN(version), CCP4_VERSION_NO); } FORTRAN_SUBR ( CCP4_PROG_VERSION, ccp4_prog_version, (const fpstr version, int *iflag, fpstr_size_t version_len), (const fpstr version, int *iflag), (const fpstr version, fpstr_size_t version_len, int *iflag)) { char *tmp_vers; if (*iflag) { ccp4_CtoFString(FTN_STR(version), FTN_LEN(version), ccp4_prog_vers(NULL)); } else { tmp_vers = ccp4_FtoCString(FTN_STR(version), FTN_LEN(version)); ccp4_prog_vers(tmp_vers); free((char *) tmp_vers); } } FORTRAN_SUBR ( CCPVRS, ccpvrs, (const int *ilp, const fpstr prog, const fpstr vdate, fpstr_size_t prog_len, fpstr_size_t vdate_len), (const int *ilp, const fpstr prog, const fpstr vdate), (const int *ilp, const fpstr prog, fpstr_size_t prog_len, const fpstr vdate, fpstr_size_t vdate_len)) { char *tmp_prog; FORTRAN_CALL (CCP4H_SUMMARY_BEG, ccp4h_summary_beg, (), (), ()); FORTRAN_CALL (CCP4H_PRE_BEG, ccp4h_pre_beg, (), (), ()); tmp_prog = ccp4_FtoCString(FTN_STR(prog), FTN_LEN(prog)); ccp4ProgramName(tmp_prog); ccp4_banner(); FORTRAN_CALL (CCP4H_SUMMARY_END, ccp4h_summary_end, (), (), ()); free((char *) tmp_prog); } FORTRAN_SUBR ( CCPRCS, ccprcs, (const int *ilp, const fpstr prog, const fpstr rcsdat, fpstr_size_t prog_len, fpstr_size_t rcsdat_len), (const int *ilp, const fpstr prog, const fpstr rcsdat), (const int *ilp, const fpstr prog, fpstr_size_t prog_len, const fpstr rcsdat, fpstr_size_t rcsdat_len)) { char *tmp_prog,*tmp_rcsdat; tmp_prog = ccp4_FtoCString(FTN_STR(prog), FTN_LEN(prog)); tmp_rcsdat = ccp4_FtoCString(FTN_STR(rcsdat), FTN_LEN(rcsdat)); FORTRAN_CALL (CCP4H_SUMMARY_BEG, ccp4h_summary_beg, (), (), ()); FORTRAN_CALL (CCP4H_PRE_BEG, ccp4h_pre_beg, (), (), ()); ccp4ProgramName(tmp_prog); ccp4RCSDate(tmp_rcsdat); ccp4_banner(); FORTRAN_CALL (CCP4H_SUMMARY_END, ccp4h_summary_end, (), (), ()); free((char *) tmp_prog); } FORTRAN_SUBR ( CCPPNM, ccppnm, (const fpstr pnm, fpstr_size_t pnm_len), (const fpstr pnm), (const fpstr pnm, fpstr_size_t pnm_len)) { ccp4_CtoFString(FTN_STR(pnm), FTN_LEN(pnm), ccp4ProgramName(NULL)); } FORTRAN_FUN ( ftn_logical, CCPEXS, ccpexs, (const fpstr name, fpstr_size_t name_len), (const fpstr name), (const fpstr name, fpstr_size_t name_len)) { char *string, *string1; string = ccp4_FtoCString(FTN_STR(name), FTN_LEN(name)); string1 = (char *) getenv(string); if (string1) { string = (char *) ccp4_utils_realloc(string,strlen(string1)+1); strcpy(string,string1); } return ( ccpexists(string) ? FORTRAN_LOGICAL_TRUE : FORTRAN_LOGICAL_FALSE ); } FORTRAN_FUN ( ftn_logical, CCPLIC, ccplic, (const fpstr name, fpstr_size_t name_len), (const fpstr name), (const fpstr name, fpstr_size_t name_len)) { char *string; string = ccp4_FtoCString(FTN_STR(name), FTN_LEN(name)); return ( ccp4_licence_exists(string) ? FORTRAN_LOGICAL_TRUE : FORTRAN_LOGICAL_FALSE ); } /** Print timing information to stdout * wraps ccp4ProgramTime */ FORTRAN_SUBR (GETELAPSED, getelapsed,(void) , (void) , (void)) { ccp4ProgramTime(0); } /* wrapper for ccp4VerbosityLevel */ FORTRAN_FUN ( int, CCP4VERBOSITYLEVEL, ccp4verbositylevel, (int *level), (int *level), (int *level)) { return ( ccp4VerbosityLevel(*level) ); } libccp4-8.0.0/fortran/ccp4_parser_f.c0000644000000000000000000004454314242731033015527 0ustar 00000000000000/* ccp4_parser_f.c: Fortran API to ccp4_parser.c Copyright (C) 2001 CCLRC, Peter Briggs This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @page cparser_f_page Fortran API to CParser * * @section cparser_f_file_list File list
  • ccp4_parser_f.c
* * @section cparser_f_overview Overview This library consists of a set of wrappers to the CParser library giving the same API as the original parser.f */ /** @file ccp4_parser_f.c * * @brief Fortran API to ccp4_parser.c. * * @author Peter Briggs */ /* ccp4_parser_f.c Peter Briggs CCP4 August 2001 This file contains Fortran API functions which provide the following functionality originally found in the parser.f file: PARSER read and interpret data from the input stream PARSE free format read routine PARSEDL change delimiters plus internal utility functions which should not be accessed directly from an application. */ /*#define FORTRAN_CALL_DEBUG 1*/ #if defined (FORTRAN_CALL_DEBUG) # define PARSER_DEBUG(x) x #else # define PARSER_DEBUG(x) #endif /* CCP4 header file for machine dependency */ #include "ccp4_sysdep.h" /* CCP4 header file for Fortran interfaces */ #include "ccp4_fortran.h" /* C parser header file */ #include "ccp4_parser.h" #include "ccp4_general.h" /* rcsid[] = "$Id$" */ /*------------------------------------------------------------------*/ /* Utility functions */ /*------------------------------------------------------------------*/ /* fparse_isblank Given a string and its length, returns 1 if the only characters are whitespace or newlines, and 0 if there are other characters. */ int fparse_isblank(const char *line, const int line_len) { int i; if (line_len > 0) { for (i=0; itoken; /* Loop over all tokens */ for (i=0; intokens; i++) { PARSER_DEBUG(printf("fparse_populate_arrays: Token %d\n",i);) /* Positions for first and last characters Add one on because Fortran numbers array elements from one */ ibeg[i] = token[i].ibeg+1; iend[i] = token[i].iend+1; PARSER_DEBUG(printf("fparse_populate_arrays: ibeg = %d, iend = %d\n",ibeg[i],iend[i]);) /* Token types 0 = null field 1 = character string 2 = number */ if (!token[i].isnull) { /* Either string or number */ if (token[i].isstring) { /* String token */ PARSER_DEBUG(printf("fparse_populate_arrays: string token\n");) ityp[i] = 1; PARSER_DEBUG(printf("fparse_populate_arrays: 4-letter version is \"%s\"\n",token[i].word);) if (token[i].strlength > 4) { idec[i] = 4; } else { idec[i] = token[i].strlength; } PARSER_DEBUG(printf(" ityp = %d\n",ityp[i]);) } else if (token[i].isnumber) { /* Numerical token */ PARSER_DEBUG(printf("fparse_populate_arrays: number token\n");) ityp[i] = 2; fvalue[i] = (float) token[i].value; if (token[i].frcdigits) { /* Real number */ idec[i] = (token[i].intdigits+1)*100 + token[i].frcdigits; } else { /* Integer number */ idec[i] = token[i].intdigits; } PARSER_DEBUG(printf(" ityp = %d\n",ityp[i]);) } else { /* Unrecognised token type */ PARSER_DEBUG(printf("fparse_populate_arrays: unrecognised token type - setting to null");) ityp[i] = 0; } /* cvalue is set for both string and numerical tokens It appears that Fortran allocates a block of memory for string arrays which is basically string(1) followed by string(2) etc, and then the length string_len is the number of characters in a single element. */ iindex = i*cvalue_len; pstr = &(cvalue[iindex]); PARSER_DEBUG({ printf("fparse_populate_arrays: token string stored as \"%s\"\n",token[i].word); printf("fparse_populate_arrays: initial value of cvalue[%d] is \"%s\"\n",i,pstr); }) /* Store the value and pad if necessary */ fparse_strncpypad(pstr,token[i].word,cvalue_len); PARSER_DEBUG(printf("fparse_populate_arrays: cvalue[%d] is now \"%s\"\n",i,pstr);) } else { /* Null token */ PARSER_DEBUG(printf("fparse_populate_arrays: null field");) ityp[i] = 0; PARSER_DEBUG(printf(" ityp = %d\n",ityp[i]);) } /* All assignments complete for this token */ } return 1; } /*------------------------------------------------------------------*/ /* fparse_delimiters Set and get delimiters for use in ccp4_parse(r). This should only be called internally (from PARSDL). If called with parser set to NULL, the lists of characters in new_delimiters and new_nulldelimiters are stored. When called with a valid pointer to a parser structure, the stored lists of characters form the new delimiter sets via a call to ccp4_parse_delimiters. NB: if delimiter strings are set with a call to fparse_delimiters then they persist in memory unless a subsequent call is made with all arguments set to NULL. This represents a potential memory leak. */ int fparse_delimiters(CCP4PARSERARRAY *parser, char *new_delimiters, char *new_nulldelimiters) { int ndelim; static char *delimiters=NULL, *nulldelimiters=NULL; PARSER_DEBUG(puts("fparse_delimiters: starting");) if (!parser) { PARSER_DEBUG({ puts("fparse_delimiters: setting local lists"); if (new_delimiters) printf("fparse_delimiters: new_delimiters = \"%s\"\n",new_delimiters); if (new_nulldelimiters) printf("fparse_delimiters: new_nulldelimiters = \"%s\"\n",new_nulldelimiters); }) /* Set the local lists of delimiters depending on the input */ /* Standard delimiters */ if (!new_delimiters) { if (delimiters) free(delimiters); delimiters = NULL; } else { ndelim = strlen(new_delimiters) + 1; delimiters = (char *) realloc(delimiters,ndelim*sizeof(char)); if (delimiters) { strncpy(delimiters,new_delimiters,ndelim); PARSER_DEBUG(printf("fparse_delimiters: delimiters set to \"%s\"\n",delimiters);) } else { ccperror(4,"fparse_delimiters: couldn't reallocate delimiters"); } } /* Null delimiters */ if (!new_nulldelimiters) { if (nulldelimiters) free(nulldelimiters); nulldelimiters = NULL; } else { ndelim = strlen(new_nulldelimiters) + 1; nulldelimiters = (char *) realloc(nulldelimiters,ndelim*sizeof(char)); if (nulldelimiters) { strncpy(nulldelimiters,new_nulldelimiters,ndelim); PARSER_DEBUG(printf("fparse_delimiters: nulldelimiters set to \"%s\"\n",nulldelimiters);) } else { ccperror(4,"fparse_delimiters: couldn't reallocate null delimiters"); } } } else { /* Set the parser array so that it uses the delimiters already stored */ PARSER_DEBUG({ puts("fparse_delimiters: setting parser to use stored delimiters"); }) if (!ccp4_parse_delimiters(parser,delimiters,nulldelimiters)) ccperror(4,"fparse_delimiters: couldn't reset delimiters"); PARSER_DEBUG(printf("fparse_delimiters: now set to \"%s\" and \"%s\"\n",parser->delim, parser->nulldelim);) return 0; } return 1; } /*------------------------------------------------------------------*/ /* PARSER This function implements the Fortran equivalent of: SUBROUTINE PARSER(KEY,LINE,IBEG,IEND,ITYP,FVALUE,CVALUE,IDEC,NTOK,LEND,PRINT) which is the original CCP4 keyword parser. The function wraps the ccp4_parser routines to mimic the behaviour of the original subroutine. */ FORTRAN_SUBR(PARSER,parser, (fpstr key, fpstr line, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int *idec, int *ntok, ftn_logical *lend, const ftn_logical *print, fpstr_size_t key_len, fpstr_size_t line_len, fpstr_size_t cvalue_len), (fpstr key, fpstr line, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int *idec, int *ntok, ftn_logical *lend, const ftn_logical *print), (fpstr key, fpstr_size_t key_len, fpstr line, fpstr_size_t line_len, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, fpstr_size_t cvalue_len, int *idec, int *ntok, ftn_logical *lend, const ftn_logical *print)) { static FILE *fparse_fp = NULL; int max_line_len,lline,cprint = 0; char *cline; CCP4PARSERARRAY *parser = NULL; PARSER_DEBUG(puts("PARSER: starting");) /* On input ntok is the maximum number of fields to be parsed If ntok < 20 then set to 20 */ if (*ntok < 20) *ntok = 20; /* also reset if ntok is silly - this is a trap for uninitialised ntok */ if (*ntok > 10000) *ntok = 10000; PARSER_DEBUG({ printf("PARSER: set maximum number of tokens to %d\n",*ntok); printf("PARSER: line is initially \"%s\"\n",line); }) /* copy to C string, but also allocate enough memory for return value */ cline = (char *) ccp4_utils_malloc((FTN_LEN(line)+1)*sizeof(char)); lline = ccp4_utils_flength(FTN_STR(line),FTN_LEN(line)); strncpy(cline,FTN_STR(line),lline); cline[lline] = '\0'; /* Get the maximum line length Use the FTN_LEN macro for this since we can't rely on getting the line_len argument on all systems */ max_line_len = FTN_LEN(line); PARSER_DEBUG(printf("PARSER: line length is %d\n",max_line_len);) /* Set up a parser array to handle ntok tokens */ parser = (CCP4PARSERARRAY *) ccp4_parse_start(*ntok); if (!parser) { PARSER_DEBUG(printf("PARSER: failed to allocate memory");) *lend = FORTRAN_LOGICAL_TRUE; return; } PARSER_DEBUG(puts("PARSER: parser array initialised");) /* Set up the delimiters */ PARSER_DEBUG(puts("PARSER: fetching delimiters");) fparse_delimiters(parser,NULL,NULL); PARSER_DEBUG(puts("PARSER: delimiters set");) /* Set up the maximum and minimum exponents used to avoid under/overflow Since Fortran REALs are equivalent to C floats, make sure these limits are appropriate for floats */ ccp4_parse_maxmin(parser,FLT_MAX_10_EXP,FLT_MIN_10_EXP); /* Silent or verbose output? */ PARSER_DEBUG(printf("PARSER: print set to %d\n",*print);) if (*print != FORTRAN_LOGICAL_FALSE) cprint = 1; PARSER_DEBUG({ if (cprint) { puts("PARSER: verbose output ON"); } else { puts("PARSER: verbose output OFF"); } }) /* Was ccp4_parser reading from an external file last time? */ if (fparse_fp) { PARSER_DEBUG(printf("PARSER: we were reading from an external file\n");) parser->fp = fparse_fp; } /* Call ccp4_parser to do the work */ PARSER_DEBUG({ printf("PARSER: line sent as \"%s\"\n",cline); }) *ntok = ccp4_parser(cline,max_line_len,parser,cprint); PARSER_DEBUG({ printf("PARSER: returned %d tokens from ccp4_parser\n",*ntok); printf("PARSER: line returned as \"%s\"\n",cline); }) /* Check for end-of-file */ if (!*ntok) { PARSER_DEBUG(puts("PARSER: reached end of file");) *lend = FORTRAN_LOGICAL_TRUE; } else { PARSER_DEBUG(puts("PARSER: end of file not reached yet");) *lend = FORTRAN_LOGICAL_FALSE; /* Keyword NB You need to pad the string with spaces before sending back to Fortran */ PARSER_DEBUG(printf("PARSER: ccp4_parser keyword is \"%s\"\n",parser->keyword);) ccp4_CtoFString(FTN_STR(key),FTN_LEN(key),parser->keyword); PARSER_DEBUG(printf("PARSER: PARSER keyword is \"%s\"\n",key);) PARSER_DEBUG(printf("PARSER: ccp4_parser line is \"%s\"\n",cline);) ccp4_CtoFString(FTN_STR(line),FTN_LEN(line),cline); PARSER_DEBUG(printf("PARSER: PARSER line is \"%s\"\n",line);) /* Populate the Fortranic arrays */ PARSER_DEBUG(printf("PARSER: about to populate the arrays\n");) fparse_populate_arrays(parser,ibeg,iend,ityp,fvalue,cvalue,FTN_LEN(cvalue),idec); PARSER_DEBUG(printf("PARSER: arrays populated\n");) } PARSER_DEBUG(puts("PARSER: finished assignments");) /* Check if ccp4_parser was reading from an external file which is still open */ if (parser->fp) { PARSER_DEBUG(printf("PARSER: reading from external file\n");) fparse_fp = parser->fp; } else { fparse_fp = NULL; } /* Free the parser array */ ccp4_parse_end(parser); PARSER_DEBUG(puts("PARSER: freed the memory, returning");) free(cline); return; } /*------------------------------------------------------------------*/ /* PARSE This function implements the Fortran equivalent of: SUBROUTINE PARSE(LINE,IBEG,IEND,ITYP,FVALUE,CVALUE,IDEC,N) */ FORTRAN_SUBR(PARSE,parse, (fpstr line, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int *idec, int *n, int line_len, int cvalue_len), (fpstr line, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int *idec, int *n), (fpstr line, int line_len, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int cvalue_len, int *idec, int *n)) { char *temp_line; static int maxtok = 0; CCP4PARSERARRAY *parser = NULL; temp_line = ccp4_FtoCString(FTN_STR(line), FTN_LEN(line)); PARSER_DEBUG({ puts("PARSE: starting"); printf("PARSE: line is initially \"%s\"\n",temp_line); }) /* Set a value for the maximum number of tokens When called for the first time n should be less than zero, and ABS(n) is the maximum number of tokens. When called subsequently, if n > 0 then this is the number of tokens already read in. To handle this, set maxtok only when a -ve value of n is input. */ if (*n < 0) { maxtok = -1*(*n); } /* If ntok is still zero then this is probably an error so return without any action */ if (maxtok == 0) { printf("PARSE: zero number of tokens specified - aborting\n"); return; } /* Set up a parser array to handle maxtok tokens */ parser = (CCP4PARSERARRAY *) ccp4_parse_start(maxtok); if (!parser) { PARSER_DEBUG(printf("PARSE: failed to allocate memory");) return; } PARSER_DEBUG(puts("PARSE: parser array initialised");) /* Set up the delimiters */ PARSER_DEBUG(puts("PARSER: fetching delimiters");) fparse_delimiters(parser,NULL,NULL); PARSER_DEBUG(puts("PARSER: delimiters set");) /* Call ccp4_parse to do the work */ *n = ccp4_parse(temp_line,parser); PARSER_DEBUG(printf("PARSE: returned %d tokens from ccp4_parse\n",*n);) /* Populate the Fortranic arrays */ PARSER_DEBUG(printf("PARSE: about to populate the arrays\n");) fparse_populate_arrays(parser,ibeg,iend,ityp,fvalue,cvalue,FTN_LEN(cvalue),idec); PARSER_DEBUG(printf("PARSE: arrays populated\n");) /* Free the parser array */ ccp4_parse_end(parser); PARSER_DEBUG(puts("PARSE: freed the memory, returning");) free(temp_line); return; } /*------------------------------------------------------------------*/ /* PARSDL Set delimiters for PARSE, PARSER SUBROUTINE PARSDL(NEWDLM,NNEWDL,NSPECD) */ FORTRAN_SUBR(PARSDL,parsdl, (fpstr newdlm, int *nnewdl, int *nspecd, fpstr_size_t newdlm_len), (fpstr newdlm, int *nnewdl, int *nspecd), (fpstr newdlm, fpstr_size_t newdlm_len, int *nnewdl, int *nspecd)) { int nnulldl; char *delim=NULL, *nulldelim=NULL; PARSER_DEBUG(puts("PARSDL: starting");) if (*nnewdl <= 0) { /* Reset the delimiters to the defaults */ PARSER_DEBUG(puts("PARSDL: resetting to default delimiters");) fparse_delimiters(NULL,NULL,NULL); } else { /* Check the number of new delimiters is no more than the number of characters actually supplied */ if (FTN_LEN(newdlm) < *nnewdl) { ccperror(4,"PARSDL: too few delimiter characters supplied"); return; } /* Extract the list of delimiter characters */ delim = (char *) malloc((*nnewdl+1)*sizeof(char)); if (delim) { strncpy(delim,newdlm,*nnewdl); delim[*nnewdl] = '\0'; } PARSER_DEBUG(printf("PARSDL: delimiters are \"%s\"\n",delim);) /* Extract the list of null delimiter characters (if any) */ nnulldl = *nnewdl - *nspecd; if (nnulldl > 0) { nulldelim = (char *) malloc((nnulldl+1)*sizeof(char)); if (nulldelim) { strncpy(nulldelim,&(newdlm[*nspecd]),nnulldl); nulldelim[nnulldl] = '\0'; } PARSER_DEBUG(printf("PARSDL: null delimiters are \"%s\"\n",nulldelim);) } else { nulldelim = (char *) malloc(sizeof(char)); if (nulldelim) { nulldelim[0] = '\0'; } } /* Store the delimiters for later reference */ fparse_delimiters(NULL,delim,nulldelim); } /* Free locally allocated memory */ if (delim) free(delim); if (nulldelim) free(nulldelim); PARSER_DEBUG(puts("PARSDL: finished");) return; } libccp4-8.0.0/fortran/ccp4_unitcell_f.c0000644000000000000000000001172314242731033016044 0ustar 00000000000000/* ccp4_unitcell_f.c: Fortran API to ccp4_unitcell.c Copyright (C) 2001 CCLRC, Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file ccp4_unitcell_f.c * Fortran API to ccp4_unitcell.c. * Martyn Winn */ #include "ccp4_fortran.h" #include "ccp4_unitcell.h" /* rcsid[] = "$Id$" */ /* from input cell and orthogonalisation code, find orthogonalisation and fractionalisation matrices. Returns cell volume. */ FORTRAN_SUBR ( CCP4UC_F_FRAC_ORTH_MAT, ccp4uc_f_frac_orth_mat, (const float cell[6], const int *ncode, float ro[3][3], float rf[3][3], float *volume), (const float cell[6], const int *ncode, float ro[3][3], float rf[3][3], float *volume), (const float cell[6], const int *ncode, float ro[3][3], float rf[3][3], float *volume)) { int i,j; double ro_cmat[3][3], rf_cmat[3][3], dcell[6]; for (i = 0; i < 6; ++i) dcell[i] = (double) cell[i]; *volume = (float) ccp4uc_frac_orth_mat(dcell, *ncode, ro_cmat, rf_cmat); for (i = 0; i < 3; ++i) { for (j = 0; j < 3; ++j) { ro[i][j] = (float) ro_cmat[j][i]; rf[i][j] = (float) rf_cmat[j][i]; } } } FORTRAN_SUBR ( CCP4UC_F_CALC_RCELL, ccp4uc_f_calc_rcell, (const float cell[6], float rcell[6], float *rvolume), (const float cell[6], float rcell[6], float *rvolume), (const float cell[6], float rcell[6], float *rvolume)) { int i; double dcell[6],drcell[6]; for (i = 0; i < 6; ++i) dcell[i] = (double) cell[i]; *rvolume = (float) ccp4uc_calc_rcell(dcell, drcell); for (i = 0; i < 6; ++i) rcell[i] = (float) drcell[i]; } FORTRAN_SUBR ( CCP4UC_F_ORTH_TO_FRAC, ccp4uc_f_orth_to_frac, (const float rf[3][3], const float xo[3], float xf[3]), (const float rf[3][3], const float xo[3], float xf[3]), (const float rf[3][3], const float xo[3], float xf[3])) { int i,j; double rf_cmat[3][3], dxo[3], dxf[3]; for (i = 0; i < 3; ++i) { dxo[i] = (double) xo[i]; for (j = 0; j < 3; ++j) rf_cmat[i][j] = (double) rf[j][i]; } ccp4uc_orth_to_frac((const double (*)[3])rf_cmat, dxo, dxf); for (i = 0; i < 3; ++i) xf[i] = (float) dxf[i]; } FORTRAN_SUBR ( CCP4UC_F_FRAC_TO_ORTH, ccp4uc_f_frac_to_orth, (const float ro[3][3], const float xf[3], float xo[3]), (const float ro[3][3], const float xf[3], float xo[3]), (const float ro[3][3], const float xf[3], float xo[3])) { int i,j; double ro_cmat[3][3], dxf[3], dxo[3]; for (i = 0; i < 3; ++i) { dxf[i] = (double) xf[i]; for (j = 0; j < 3; ++j) ro_cmat[i][j] = (double) ro[j][i]; } ccp4uc_orth_to_frac((const double (*)[3])ro_cmat, dxf, dxo); for (i = 0; i < 3; ++i) xo[i] = (float) dxo[i]; } FORTRAN_SUBR ( CCP4UC_F_ORTHU_TO_FRACU, ccp4uc_f_orthu_to_fracu, (const float rf[3][3], const float uo[3], float uf[3]), (const float rf[3][3], const float uo[3], float uf[3]), (const float rf[3][3], const float uo[3], float uf[3])) { int i,j; double rf_cmat[3][3], duo[3], duf[3]; for (i = 0; i < 3; ++i) { duo[i] = (double) uo[i]; for (j = 0; j < 3; ++j) rf_cmat[i][j] = (double) rf[j][i]; } ccp4uc_orthu_to_fracu((const double (*)[3])rf_cmat, duo, duf); for (i = 0; i < 3; ++i) uf[i] = (float) duf[i]; } FORTRAN_SUBR ( CCP4UC_F_FRACU_TO_ORTHU, ccp4uc_f_fracu_to_orthu, (const float ro[3][3], const float uf[3], float uo[3]), (const float ro[3][3], const float uf[3], float uo[3]), (const float ro[3][3], const float uf[3], float uo[3])) { int i,j; double ro_cmat[3][3], duf[3], duo[3]; for (i = 0; i < 3; ++i) { duf[i] = (double) uf[i]; for (j = 0; j < 3; ++j) ro_cmat[i][j] = (double) ro[j][i]; } ccp4uc_orthu_to_fracu((const double (*)[3])ro_cmat, duf, duo); for (i = 0; i < 3; ++i) uo[i] = (float) duo[i]; } FORTRAN_SUBR ( CELLCHK, cellchk, (const float cell1[6], const float cell2[6], const float *errfrc, int *ierr), (const float cell1[6], const float cell2[6], const float *errfrc, int *ierr), (const float cell1[6], const float cell2[6], const float *errfrc, int *ierr)) { int i; double dcell1[6], dcell2[6]; for (i = 0; i < 6; ++i) { dcell1[i] = (double) cell1[i]; dcell2[i] = (double) cell2[i]; } *ierr = ccp4uc_cells_differ(dcell1, dcell2, (double) *errfrc); } libccp4-8.0.0/fortran/ccplib.f0000644000000000000000000017614114242731033014254 0ustar 00000000000000C C ccplib.f: Pseudo-machine-independent low-level routines C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C C_BEGIN_CCPLIB C These are supposedly-machine-independent low-level routines. C They're actually machine-dependent at least insofar as some C contain non-standard code, but they do compile with the compilers C tried on unix as well as VMS. C C fixme: the bit-twiddling should be in library.c, not here. C amalgamate ccppsf and fdir/fext/froot. also add tests of these C routines to testlib. C C $Id$ C C CCFILL Set specified number of elements of byte array C CCPALC Call subroutine with allocated memory C CCPALE Call subroutine with allocated memory set from environment C CCPBYI Copy array of unsigned (or signed) bytes into integer array C CCPBYT Indicate whether byte handling is available C CCPCPI Copy array of BYTE or INTEGER*2 elements into integer array C CCPDEX Periodicity reduction of 1024 (for PROLSQ) C CCPDPN more friendly CCPOPN C CCPE2I read integer from logical name value C CCPGI2 Get unsigned integer*2 value from 0 to 65535 from N'th C unsigned integer*2 element of array. C CCPGTB Get unsigned byte value from 0 to 255 from N'th byte of C array. C CCPI2I Copy an array of INTEGER*2 elements into an integer array C CCPIBY Copy array of integers into array of bytes. C CCPII2 Copy array of integers into array of INTEGER*2 elements. C CCPMDE If byte handling available return nos. of bytes for map C modes C CCPMVB Move bytes from one non-character array to another if C byte handling is available C CCPMVI Move words from one integer array to another C CCPMVR Move words from one real array to another C CCPNUN Return an unconnected i/o unit number C CCPONL See if program is being run interactively C CCPPSF Parse file name into components C CSETNV Associate logical name with file name C CCPPAG Set paging parameters if available C CCPSI2 Set integer value from 0 to 65535 into the N'th C unsigned integer*2 element of an array. C CCPSTB Set integer value from 0 to 255 into N'th byte of array. C CCPSUM Sum the elements of an array C CCPTOI Convert n'th byte or I*2 in a non-character array to an C integer C CCPUFL Supress underflow messages C CCPZBI Sets an array of bytes to zero C CCPZI Set 'n' words of an integer array to zero using a simple loop C CCPZR Set 'n' words of a real array to zero using a simple loop C FDIR Returns the directory part of a file name C FEXTN Returns the extension of a file name C FROOT Returns the root of a file name C LITEND determine endianness C LENSTR length of string to last non-space ( C equiv C ccp4_utils_flength C LUNSTI Get logical unit number for input C LUNSTO Get logical unit number for output C NBITST Return the (unsigned) integer value held within a bit C field in a word C NOCRLF write line supressing cr/lf to standard output C STBITS Set a bit field within a word to a given (unsigned) C integer value C HKLEQ Are the reflection indices the equal C Subroutines for generating and accessing a hash table C CCP4_HASH_SETUP C CCP4_HASH_LOOKUP C CCP4_HASH_ZEROIT C C_END_CCPLIB C C C C_BEGIN_CCFILL SUBROUTINE CCFILL(ARR1,SCAL,NTIMES) C =================================== C C CCFILL Set NTIMES bytes array ARR1 to value SCAL C C Arguments: C ========== C C ARR1 (O) BYTE ARRAY (*): WHERE BYTES ARE TO BE COPIED C SCAL (I) BYTE: value to be copied into ARR1 C NTIMES (I) INTEGER: NUMBER OF BYTES TO BE COPIED C_END_CCFILL C C .. Scalar Arguments .. INTEGER NTIMES INTEGER*1 SCAL C .. C .. Array Arguments .. INTEGER*1 ARR1(*) C .. C .. Local Scalars .. INTEGER N C .. DO 10 N = 1,NTIMES ARR1(N) = SCAL 10 CONTINUE C END C C C_BEGIN_CCPALC SUBROUTINE CCPALC(ROUTNE, N, TYPE, LENGTH) C ========================================== C C Arrange to call subroutine ROUTNE with N array arguments each of C length LENGTH (i) and type indicated by TYPE (i): 'i' == integer, C 'r' == real, 'd' == double precision, 'c' == complex, 'b' == C "byte" (logical*1 or integer*1, unportable and deprecated) . TYPE C elements may have either case. C Consider `call ccpalc (fred, 3, types, lens)' with types = (/'i', C 'r', 'c'/) and lens = (/1000, 2000, 3000/). This effectively does C call fred (1000, arr1, 2000, arr2, 3000, arr3) C with C subroutine fred (n1, foo, n2, bar, n3, baz) C integer n1, n2, n3, foo (n1) C real bar (n2) C complex baz (n3) C ... C Obviously all communication with ROUTNE must be by COMMON (or, C possibly, extra ENTRYs). The allocated memory is freed on return C from ROUTNE. As a concession, it's initially filled with zeroed C bytes. C C Arguments: C ========== C C ROUTNE (I) EXTERNAL: routine to call C N (I) INTEGER: number of arguments to ROUTNE (<=12) C TYPE (I) CHARACTER*1 (*): type of arguments to ROUTNE: C 'I': INTEGER; 'R': REAL; 'D': DOUBLE PRECISION; C 'C': COMPLEX; 'B': LOGICAL*1 or INTEGER*1 C LENGTH (I) INTEGER*(*): number of elements in each (array) C argument of ROUTNE C_END_CCPALC C C .. Scalar Arguments .. INTEGER N C .. C .. Array Arguments .. CHARACTER TYPE (*) INTEGER LENGTH (*) C .. EXTERNAL ROUTNE, CCPAL1, CCPUPC INTEGER I, ITYPE (12) CHARACTER TTYPE (12) C .. IF (N.LT.1 .OR. N.GT.12) + CALL CCPERR (1, 'CCPALC: bad number of arguments') DO 10 I=1,N TTYPE (I) = TYPE (I) CALL CCPUPC (TTYPE (I)) ITYPE (I) = INDEX ('IRDCB', TTYPE (I)) IF (ITYPE (I) .EQ. 0) CALL CCPERR (1, 'CCPALC: bad TYPE: '// + TYPE (I)) IF (LENGTH (I).LE.0) CALL CCPERR (1, 'CCPALC: length <=0') 10 CONTINUE CALL CCPAL1 (ROUTNE, N, ITYPE, LENGTH) END C C C_BEGIN_CCPALE SUBROUTINE CCPALE(ROUTNE, N, TYPE, LENGTH, LENDEF, PRINT) C ================================================= C C Arrange to call subroutine ROUTNE with N array arguments each of C length LENGTH (i) and type indicated by TYPE (i): 'i' == integer, C 'r' == real, 'd' == double precision, 'c' == complex, 'b' == byte. C TYPE elements may have either case. LENGTH points to an array of C environment variable (logical) names from which integer values are C read. The lengths default to values from LENDEF. C This is a convenient interface to CCPALC to allow configuring of C the memory requirements on the command line where appropriate. C This may be useful if the memory requirements can't be determined C initially and it's necessary to guess. C C Arguments: C ========== C C ROUTNE (I) EXTERNAL: routine to call C N (I) INTEGER: number of arguments to ROUTNE (<=12) C TYPE (I) CHARACTER*1 (*): type of arguments to ROUTNE: C 'I': INTEGER; 'R': REAL; 'D': DOUBLE PRECISION; C 'C': COMPLEX; 'B': LOGICAL*1 or INTEGER*1 C LENGTH (I) CHARACTER *(*): logical names representing the number C of elements in each (array) argument of ROUTNE C LENDEF (I) INTEGER (*): default lengths for the argument arrays C used if the appropriate LENGTH argument doesn't represent a C defined logical C PRINT (I) LOGICAL: whether or not to print the values of the C array lengths C_END_CCPALE C C .. Scalar Arguments .. INTEGER N LOGICAL PRINT C .. C .. Array Arguments .. CHARACTER TYPE (*), LENGTH (*)*(*) INTEGER LENDEF (*) C .. EXTERNAL ROUTNE, CCPE2I, CCPALC, LUNSTO INTEGER I, LENG (12), CCPE2I, LUNSTO C .. DO 10 I=1,N LENG (I) = CCPE2I (LENGTH (I), LENDEF (I)) 10 CONTINUE IF (PRINT) THEN WRITE (LUNSTO(1), + '(/'' Memory allocation (logical name, type, elements):'')') WRITE (LUNSTO(1), '(3X, A, 1X, A, 3X, I10)') + (LENGTH (I), TYPE (I), LENG (I), I=1,N) ENDIF CALL CCPALC (ROUTNE, N, TYPE, LENG) END C C C C SUBROUTINE 'CCPBYI' C =================== C C_BEGIN_CCPBYI SUBROUTINE CCPBYI(IA,IBYT,NB) C ============================= C C COPY AN ARRAY OF UNSIGNED (OR SIGNED) BYTES INTO AN INTEGER ARRAY C C (MUST BE IMPLEMENTED IF CCPBYT FUNCTION RETURNS .TRUE.) C [added for LAUE] C C Arguments: C ========== C C IA (O) INTEGER ARRAY(*): TO RETURN INTEGER VALUES C IBYT (I) BYTE ARRAY(*): DATA (MAY BE AN INTEGER ARRAY FOR EXAMPLE C WITH DATA PACKED INTO ADJACENT BYTES C NB (I) INTEGER: IF >0, THE NUMBER OF UNSIGNED BYTES TO BE COPIED C IF <0, -THE NUMBER OF SIGNED BYTES TO BE COPIED C_END_CCPBYI C C SPECIFICATION STATEMENTS C ------------------------ C INTEGER IA(*) INTEGER*1 IBYT(*) INTEGER*1 JBYT(4) EQUIVALENCE (JA,JBYT(1)) LOGICAL CALLED, LITEND INTEGER IND EXTERNAL LITEND SAVE CALLED, IND DATA CALLED/.FALSE./ C IF (.NOT.CALLED) THEN CALLED=.TRUE. IF (LITEND(1)) THEN IND = 1 ELSE IND = 4 ENDIF ENDIF C C COPY DATA C --------- C NE = NB IF (NE.GT.0) THEN JA=0 DO 10 I=1,NE JBYT(IND)=IBYT(I) IA(I)=JA 10 CONTINUE ELSE NE = -NE DO 20 I=1,NE IA(I) = IBYT(I) 20 CONTINUE END IF END C C C C_BEGIN_CCPBYT LOGICAL FUNCTION CCPBYT(NBW) C ============================ C C---- This function indicates whether byte handling is available or not. C if a value of .true. is returned then the subroutines ccpmde and C ccpmvb must be fully implemented. C C Arguments: C ========== C C NBW (O) INTEGER: RETURNS THE NUMBER OF BYTES PER WORD OR A VALUE C OF 1 IF NO BYTE HANDLING IS AVAILABLE. C C RETURNS CCPBYT = .TRUE. BYTE HANDLING AND ASSOCIATED CCPLIB C ROUTINES AVAILABLE. C = .FALSE. NO BYTE HANDLING AVAILABLE. C_END_CCPBYT C C .. Scalar Arguments .. INTEGER NBW C .. CCPBYT = .TRUE. NBW = 4 END C C C SUBROUTINE 'CCPCPI' C =================== C_BEGIN_CCPCPI SUBROUTINE CCPCPI(IA,IB,MINEL,MAXEL,ITYP) C ========================================= C C Copy an array of BYTE or INTEGER*2 elements into an integer array C C (Must be implemented if ccpbyt function returns .TRUE.) C [for LAUE] C C Arguments: C ========== C C IA (O) INTEGER Array(*): to return values C IB (I) INTEGER Array(*): holding data with data packed into adjacant C BYTE or INTEGER*2 elements C MINEL (I) INTEGER: Minimum element to copy C MAXEL (I) INTEGER: Maximum element to copy C ITYP (I) INTEGER: Type =1 unsigned byte C =2 signed byte C =3 unsigned two byte integer C =4 signed two byte integer C C Note: if MINEL>MAXEL elements will be copied in reverse order C_END_CCPCPI C C====== Specification statements C INTEGER IA(*) INTEGER*1 IB(*) INTEGER*2 J2(2) INTEGER*1 JBYT(4) EQUIVALENCE (JA,J2(1),JBYT(1)) LOGICAL CALLED, LITEND EXTERNAL LITEND INTEGER IND1, IND2, INDB SAVE CALLED, IND1, IND2, INDB DATA CALLED/.FALSE./ C IF (.NOT.CALLED) THEN IF (LITEND(1)) THEN IND1 = 1 IND2 = 2 INDB = 1 ELSE IND1 = 3 IND2 = 4 INDB = 4 ENDIF CALLED=.TRUE. ENDIF C C====== Copy data C ISTEP = 1 IF (MINEL.GT.MAXEL) ISTEP=-1 IF (ITYP.EQ.1) THEN JA=0 J=0 DO 10 I=MINEL,MAXEL,ISTEP J=J+1 JBYT(INDB)=IB(I) IA(J)=JA 10 CONTINUE ELSE IF (ITYP.EQ.2) THEN J=0 DO 20 I=MINEL,MAXEL,ISTEP J=J+1 IA(J)=IB(I) 20 CONTINUE ELSE IF (ITYP.EQ.3) THEN JA=0 J=0 DO 30 I=MINEL,MAXEL,ISTEP J=J+1 JBYT(IND1)=IB(2*I-1) JBYT(IND2)=IB(2*I) IA(J)=JA 30 CONTINUE ELSE IF (ITYP.EQ.4) THEN J=0 DO 40 I=MINEL,MAXEL,ISTEP J=J+1 JBYT(1)=IB(2*I-1) JBYT(2)=IB(2*I) IA(J)=J2(1) 40 CONTINUE END IF RETURN END C C C C_BEGIN_CCPDEX SUBROUTINE CCPDEX(INDX,N) C ========================= C C---- This subroutine performs a periodicity reduction for a period C of 1024 for the elements of an array. written particularly for C 'prolsq' to allow for use of the 'and' function on the cray or C 'moveb' on the m28oh(iap). C These are much faster than the mod function used in C the standard fortran77 version. C C Arguments: C ========== C C INDX (I/O) INTEGER ARRAY(*): NUMBERS FOR PERIODICITY REDUCTION C N (I) INTEGER: NO. OF ELEMENTS IN INDX C C EXAMPLE OF FUNCTIONS: C C FORTRAN77 INDX(I)=MOD(INDX(I),1024)+1 C CRAY-1S INDX(I)=AND(INDX(I),1023)+1 C M280H(IAP) CALL MOVEB(INDX(I),1,0,1,22) C INDX(I)=INDX(I)+1 C_END_CCPDEX C C SPECIFICATION STATEMENTS AND CODE C C .. Scalar Arguments .. INTEGER N C .. C .. Array Arguments .. INTEGER INDX(N) C .. C .. Local Scalars .. INTEGER I C .. C .. Intrinsic Functions .. INTRINSIC MOD C .. DO 10 I = 1,N INDX(I) = MOD(INDX(I),1024) + 1 10 CONTINUE END C C_BEGIN_CCPDPN SUBROUTINE CCPDPN(IUN,LOGNAM,STATUS,TYPE,LREC,IFAIL) C ==================================================== C C---- Calls CCPOPN to open a file, but with mnemonic arguments C C Arguments: C ========== C C IUN (I) INTEGER: UNIT NUMBER C C LOGNAM (I) CHARACTER*(*): LOGICAL FILE NAME C C STATUS (I) CHARACTER*(*): FILE STATUS FLAG: C 'UNKNOWN' C 'SCRATCH' C 'OLD' C 'NEW' C 'READONLY' C 'PRINTER' C C TYPE (I) CHARACTER*(*): FILE TYPE FLAG: C ='F', 'SEQUENTIAL' 'FORMATTED' C ='U', 'SEQUENTIAL' 'UNFORMATTED' C ='DF', 'DIRECT' 'FORMATTED' C ='DU', 'DIRECT' 'UNFORMATTED' C [STATUS and TYPE are case-insensitive] C C LREC (I) INTEGER: RECORD LENGTH FOR DIRECT ACCESS FILE (NO. OF C CHARACTERS FOR A FORMATTED FILE OR WORDS FOR C AN UNFORMATTED FILE). NOT RELEVANT FOR A SEQUENTIAL C FILE C C IFAIL (I/O) INTEGER: ON INPUT =0, STOP ON OPEN FAILURE C =1, CONTINUE AFTER OPEN FAILURE C (only on file not found) C =2, CONTINUE SILENTLY AFTER OPEN FAILURE C =-1, As 0, but silent on success C (equivalent to negative IUN) C ON OUTPUT UNCHANGED IF FILE OPEN OK C =-1, ERROR IN OPENING FILE C_END_CCPDPN C C .. Scalar Arguments .. INTEGER IFAIL,IUN,IUN1,LREC CHARACTER LOGNAM* (*),STATUS* (*),TYPE* (*) C .. C .. Local Scalars .. INTEGER ISTAT,ITYPE CHARACTER ERRSTR*80 C .. C .. Local Arrays .. CHARACTER TYPES(4)*2,STATS(6)*8, STAT*8, TYP*2 C .. C .. External Functions .. INTEGER CCPNUN,LENSTR EXTERNAL CCPNUN,LENSTR C .. C .. External Subroutines .. EXTERNAL CCPOPN C .. C .. Data statements .. DATA STATS/'UNKNOWN','SCRATCH','OLD','NEW','READONLY','PRINTER'/ DATA TYPES/'F','U','DF','DU'/ C .. C IF (IUN .EQ. 0) IUN = CCPNUN() STAT = STATUS TYP = TYPE CALL CCPUPC(STAT) CALL CCPUPC(TYP) DO 10 ISTAT = 1,6 IF (STAT.EQ.STATS(ISTAT)) GO TO 20 10 CONTINUE ERRSTR = ' CCPDPN: illegal status : ' ERRSTR(LENSTR(ERRSTR)+2:) = STATUS CALL CCPERR(1,ERRSTR) C 20 DO 30 ITYPE = 1,4 IF (TYP.EQ.TYPES(ITYPE)) GO TO 40 30 CONTINUE ERRSTR = ' CCPDPN: illegal type: ' ERRSTR(LENSTR(ERRSTR)+2:) = TYPE CALL CCPERR(1,ERRSTR) C 40 CONTINUE IUN1 = IUN C If IFAIL lt 0 No open message from CCPOPN IF(IFAIL.LT.0 .AND. IUN.GT.0) THEN IUN1 = -IUN IFAIL = 0 ENDIF CALL CCPOPN(IUN1,LOGNAM,ISTAT,ITYPE,LREC,IFAIL) C END C C C_BEGIN_CCPE2I INTEGER FUNCTION CCPE2I (NAME, DEFVAL) C ====================================== C C Return an integer extracted from enviroment variable NAME. If C NAME isn't defined, use DEFVAL as the default. If the value of C NAME isn't a representation of an integer, abort. C C Arguments C ========= C C NAME (I) CHARACTER *(*) C DEFVAL (I) INTEGER C_END_CCPE2I CHARACTER *(*) NAME CHARACTER BUFFER*80, EMESS*100 INTEGER DEFVAL, LENSTR EXTERNAL UGTENV, LENSTR BUFFER = ' ' CALL UGTENV (NAME, BUFFER) IF (BUFFER.EQ.' ') THEN CCPE2I = DEFVAL RETURN ENDIF READ (BUFFER, '(BN,I80)', ERR=99) CCPE2I RETURN 99 EMESS = ' Logical name ' EMESS(LENSTR(EMESS)+2:) = NAME(1:LENSTR(NAME)) IF(LENSTR(EMESS) .LE. 99) THEN EMESS(LENSTR(EMESS)+1:) =' should represent an integer and is: ' IF(LENSTR(EMESS) .LE. 98) . EMESS(LENSTR(EMESS)+2:) = BUFFER(1:LENSTR(BUFFER)) ENDIF CALL CCPERR (1, EMESS) END C C C SUBROUTINE 'CCPGI2' C =================== C C_BEGIN_CCPGI2 SUBROUTINE CCPGI2(IVAL,IA,N) C ============================ C C GET AN UNSIGNED INTEGER*2 VALUE FROM 0 TO 65535 FROM THE N'TH unsigned C INTEGER*2 ELEMENT OF AN INTEGER (OR OTHER) ARRAY. C C (MUST BE IMPLEMENTED IF CCPBYT FUNCTION RETURNS .TRUE.) C [added for LAUE] C C Arguments: C ========== C C IVAL (O) INTEGER: THE RETURNED VALUE FROM 0 TO 65535 C IA (I/O) INTEGER*2 ARRAY(*): FROM WHICH THE UNSIGNED INTEGER*2 VALUE C IS TO BE RETRIEVED C N (I) INTEGER: POSITION IN 'IA' WHERE THE UNSIGNED INTEGER*2 VALUE C IS TO BE RETRIEVED C_END_CCPGI2 C C SPECIFICATION STATEMENTS C ------------------------ C INTEGER*2 IA(*) INTEGER*2 JBYT(2) EQUIVALENCE (JA,JBYT(1)) LOGICAL CALLED, LITEND EXTERNAL LITEND INTEGER IND SAVE CALLED, IND DATA CALLED/.FALSE./ C IF (.NOT.CALLED) THEN IF (LITEND(1)) THEN IND = 1 ELSE IND = 2 ENDIF CALLED=.TRUE. ENDIF C C GET UNSIGNED INTEGER*2 C ---------------------- C JA=0 JBYT(IND)=IA(N) IVAL=JA END C C C SUBROUTINE 'CCPGTB' C =================== C C_BEGIN_CCPGTB SUBROUTINE CCPGTB(IVAL,IA,N) C ============================ C C GET AN UNSIGNED BYTE VALUE FROM 0 TO 255 FROM THE N'TH BYTE OF AN INTEGER C (OR OTHER) ARRAY. C C (MUST BE IMPLEMENTED IF CCPBYT FUNCTION RETURNS .TRUE.) C [for LAUE] C C Arguments: C ========== C C IVAL (O) INTEGER: THE RETURNED VALUE FROM 0 TO 255 C IA (I/O) BYTE ARRAY(*): FROM WHICH THE BYTE VALUE IS TO BE RETRIEVED C N (I) INTEGER: THE POSITION IN 'IA' WHERE THE BYTE VALUE IS C TO BE RETRIEVED C_END_CCPGTB C C SPECIFICATION STATEMENTS C ------------------------ C INTEGER*1 IA(*) INTEGER*1 JBYT(4) EQUIVALENCE (JA,JBYT(1)) LOGICAL CALLED, LITEND EXTERNAL LITEND INTEGER IND SAVE CALLED, IND DATA CALLED/.FALSE./ C IF (.NOT.CALLED) THEN IF (LITEND(1)) THEN IND = 1 ELSE IND = 4 ENDIF CALLED=.TRUE. ENDIF C C GET BYTE C -------- C JA=0 JBYT(IND)=IA(N) IVAL=JA END C C C SUBROUTINE 'CCPI2I' C =================== C_BEGIN_CCPI2I SUBROUTINE CCPI2I(IA,I2,NE,SIGNED,SWAPB) C ======================================== C C Copy an array of INTEGER*2 elements into an integer array C C (Must be implemented if ccpbyt function returns .TRUE.) C [for LAUE] C C Arguments: C ========== C C IA (O) INTEGER Array(*): to return values C I2 (I) INTEGER*2 Array(*): holding data (may be an INTEGER array for C example with data packed into adjacant INTEGER*2 elements C NE (I) INTEGER: The number of elements to be copied C SIGNED (I) LOGICAL: =.TRUE. Copy as signed integer*2 values C =.FALSE. Copy as unsigned integer*2 values C SWAPB (I) LOGICAL: =.TRUE. Swap bytes in the integer*2 elements C =.FALSE. Do not swap bytes C_END_CCPI2I C C====== Specification statements C LOGICAL SIGNED, SWAPB INTEGER IA(*),JA INTEGER*2 I2(*) INTEGER*2 J2(2) INTEGER*2 IEIGHT, I255 PARAMETER (I255=255) EQUIVALENCE (JA,J2(1)) LOGICAL CALLED, LITEND EXTERNAL LITEND INTEGER IND,I,NE SAVE CALLED, IND DATA CALLED/.FALSE./ C IF (.NOT.CALLED) THEN IF (LITEND(1)) THEN IND = 1 ELSE IND = 2 ENDIF CALLED=.TRUE. ENDIF C C====== Swap bytes if required C IEIGHT = 8 IF (SWAPB) THEN DO 10 I = 1,NE I2(I) = IOR(IAND(ISHFT(I2(I),-IEIGHT),I255), + ISHFT(I2(I),IEIGHT)) 10 CONTINUE END IF C C====== Copy data C IF (SIGNED) THEN DO 20 I=1,NE IA(I) = I2(I) 20 CONTINUE ELSE JA=0 DO 30 I=1,NE J2(IND)=I2(I) IA(I)=JA 30 CONTINUE END IF END C C C C SUBROUTINE 'CCPIBY' C =================== C C_BEGIN_CCPIBY SUBROUTINE CCPIBY(IBYT,IA,NB) C ============================= C C COPY AN ARRAY OF INTEGERS INTO AN ARRAY OF UNSIGNED (OR UNSIGNED) BYTES. C NOTE: NO OVERFLOW CHECKING IS DONE. C C (MUST BE IMPLEMENTED IF CCPBYT FUNCTION RETURNS .TRUE.) C [for LAUE] C C Arguments: C ========== C C IBYT (O) BYTE ARRAY(*) RETURNING DATA (MAY BE AN INTEGER ARRAY C FOR EXAMPLE WITH DATA PACKED INTO ADJACENT BYTES) C IA (I) INTEGER ARRAY(*): Input values C NB (I) INTEGER: IF >0, THE NUMBER OF ELEMENTS TO BE COPIED TO C UNSIGNED BYTES C IF <0, -THE NUMBER OF ELEMENTS TO BE COPIED TO C SIGNED BYTES C_END_CCPIBY C C SPECIFICATION STATEMENTS C ------------------------ C INTEGER IA(*) INTEGER*1 IBYT(*) INTEGER*1 JBYT(4) EQUIVALENCE (JA,JBYT(1)) LOGICAL CALLED, LITEND EXTERNAL LITEND INTEGER IND SAVE CALLED, IND DATA CALLED/.FALSE./ C IF (.NOT.CALLED) THEN IF (LITEND(1)) THEN IND = 1 ELSE IND = 4 ENDIF CALLED=.TRUE. ENDIF C C COPY DATA C --------- C NE = NB IF (NE.GT.0) THEN DO 10 I=1,NE JA=IA(I) IBYT(I)=JBYT(IND) 10 CONTINUE ELSE NE = -NE DO 20 I=1,NE IBYT(I) = IA(I) 20 CONTINUE END IF END C C C C SUBROUTINE 'CCPII2' C =================== C C_BEGIN_CCPII2 SUBROUTINE CCPII2(I2,IA,NE,SIGNED,SWAPB) C ======================================== C C Copy an array of integers into an array of INTEGER*2 elements. C NOTE: No overflow checking is done. C C (Must be implemented if ccpbyt function returns .TRUE.) C [for LAUE] C C Arguments: C ========== C C I2 (O) INTEGER*2 ARRAY(*): returning data (may be an INTEGER array for C example with data packed into adjacent INTEGER*2 elements) C IA (I) INTEGER ARRAY(*): holding input values C NE (I) INTEGER: The number of elements to be copied C SIGNED (I) LOGICAL: =.TRUE. Copy as signed integer*2 values C =.FALSE. Copy as unsigned integer*2 values C SWAPB (I) LOGICAL: =.TRUE. Swap bytes in the integer*2 elements C =.FALSE. Do not swap bytes C_END_CCPII2 C C====== Specification statements C LOGICAL SIGNED, SWAPB INTEGER IA(*) INTEGER*2 I2(*) INTEGER*2 J2(2) INTEGER*2 IEIGHT, I255 PARAMETER (I255=255) EQUIVALENCE (JA,J2(1)) LOGICAL CALLED, LITEND EXTERNAL LITEND INTEGER IND SAVE CALLED, IND DATA CALLED/.FALSE./ C IF (.NOT.CALLED) THEN IF (LITEND(1)) THEN IND = 1 ELSE IND = 2 ENDIF CALLED=.TRUE. ENDIF C C====== Copy data C IEIGHT = 8 IF (SIGNED) THEN DO 10 I=1,NE I2(I) = IA(I) 10 CONTINUE ELSE DO 20 I=1,NE JA=IA(I) I2(I)=J2(IND) 20 CONTINUE ENDIF C C====== Swap bytes if required C IF (SWAPB) THEN DO 30 I = 1,NE I2(I) = IOR(IAND(ISHFT(I2(I),-IEIGHT),I255), + ISHFT(I2(I),IEIGHT)) 30 CONTINUE END IF END C C C C_BEGIN_CCPMDE SUBROUTINE CCPMDE(MODE,NBYT) C ============================ C C---- If byte handling is available (see ccpbyt) then this subroutine C returns the number of bytes per data item for the different modes C used, in particular, in the map handling subroutines. C C---- If byte handling is not available, then the number of words per C item is returned with zeros for the undefined items C C Arguments: C ========== C C MODE (I) INTEGER: C MODE = 0, BYTES C = 1, SHORT (2 BYTE) INTEGERS C = 2, REAL/INTEGER (SINGLE WORD) C = 3, SHORT COMPLEX (2 * 2 BYTE INTEGERS) C = 4, COMPLEX (TWO WORDS) C C NBYT (O) INTEGER: C > 0, THE NUMBER OF BYTES FOR THE ITEM IF C CCPBYT RETURNS .TRUE. OR THE NUMBER C OF WORDS IF CCPBYT RETURNS .FALSE. C = 0, NO VALUE AVAILABLE FOR THIS MODE C = -1, INVALID MODE C C TYPICAL VALUES: 1 2 4 4 8 IF BYTE HANDLING AVAILABLE WITH 4 C BYTES/WORD C 0 0 1 0 2 IF BYTE HANDLING UNAVAILABLE C_END_CCPMDE C C SPECIFICATION STATEMENTS C ------------------------ C C .. Scalar Arguments .. INTEGER MODE,NBYT C .. C .. Local Arrays .. INTEGER MODES(0:4) C .. C .. Data statements .. DATA MODES/1,2,4,4,8/ C .. C C---- Get number of bytes or words C NBYT = -1 IF (MODE.GE.0 .AND. MODE.LE.4) NBYT = MODES(MODE) END C C C C_BEGIN_CCPMVB SUBROUTINE CCPMVB(ARR1,I1,ARR2,I2,NTOMOV) C ========================================= C C---- This subroutine moves bytes from one non-character array C to another. I must be implemented if ccpbyt returns .true. C but will otherwise be a dummy routine. C C Arguments: C ========== C C ARR1 (I/O) BYTE ARRAY(*): TO WHICH BYTES ARE TO BE COPIED C I1 (I) INTEGER: THE START BYTE NUMBER IN ARR1 WHERE THE BYTES ARE C TO BE COPIED C ARR2 (I) BYTE ARRAY(*): FROM WHICH BYTES ARE TO BE COPIED C I2 (I) THE START BYTE NUMBER IN ARR2 FROM WHICH THE BYTES C ARE TO BE COPIED C NTOMOV (I) INTEGER: THE NUMBER OF BYTES TO BE COPIED C_END_CCPMVB C C .. Scalar Arguments .. INTEGER I1,I2,NTOMOV C .. C .. Array Arguments .. INTEGER*1 ARR1(*),ARR2(*) C .. C .. Local Scalars .. INTEGER I,J,N C .. I = I1 - 1 J = I2 - 1 DO 10 N = 1,NTOMOV I = I + 1 J = J + 1 ARR1(I) = ARR2(J) 10 CONTINUE C END C C C_BEGIN_CCPMVI SUBROUTINE CCPMVI (IARR1,IARR2,NUM) C ================================= C C This routine assigns the first NUM words of IARR2 to IARR1 C C Arguments: C ========== C C IARR1 (O) INTEGER ARRAY(*) C IARR2 (O) INTEGER ARRAY(*) C NUM (I) Number of words to copy C_END_CCPMVI C C Arguments INTEGER NUM REAL IARR1(*),IARR2(*) C INTEGER J C DO 10 J=1,NUM 10 IARR1(J)=IARR2(J) END C C C_BEGIN_CCPMVR SUBROUTINE CCPMVR (ARR1,ARR2,NUM) C ================================= C C This routine assigns the first NUM elements of ARR2 to ARR1 C C Arguments: C ========== C C ARR1 (O) REAL ARRAY(*) C ARR2 (O) REAL ARRAY(*) C NUM (I) Number of words to copy C_END_CCPMVR C C Arguments INTEGER NUM REAL ARR1(*),ARR2(*) C INTEGER J C DO 10 J=1,NUM 10 ARR1(J)=ARR2(J) END C C_BEGIN_CCPNUN INTEGER FUNCTION CCPNUN () C ========================== C C Return (the next) unused (not connected) i/o unit number. C Use this to select an arbitrary unit for i/o to avoid clashes with C other code. (The value returned will be the same until the unit in C question is opened or a lower-numbered one is closed.) C C_END_CCPNUN LOGICAL OD, EX EXTERNAL CCPERR INTEGER IOS C The `standard' unit 5 and 6 may or may not be reported as open, C normally depending on whether an appropriate read or write has C happened, so we'll start at 7. Lower-numbered ones might be used C for other things such as standard error. 99 seems a reasonable C place to stop. DO 10 CCPNUN=7,99 INQUIRE (UNIT=CCPNUN, OPENED=OD, IOSTAT=IOS, EXIST=EX) IF (EX .AND. (.NOT.OD) .AND. IOS.EQ.0) RETURN 10 CONTINUE CALL CCPERR (1, 'CCPNUN: Can''t find an unused unit') END C C C C_BEGIN_CCPONL LOGICAL FUNCTION CCPONL(IDUM) C ============================= C C---- This function determines whether a program is being run on-line C if this information is available C C Arguments: C ========== C C IDUM (D) DUMMY C C RETURNS .TRUE. IF PROGRAM IS BEING RUN ON-LINE C RETURNS .FALSE. IF BATCH MODE OR STATUS UNKNOWN C_END_CCPONL C C .. Scalar Arguments .. INTEGER IDUM C .. C .. Local Scalars .. INTEGER IYES,ITERM C .. C .. External Functions .. EXTERNAL UISATT C .. C C test for fortran unit=6 o/p C IYES = 0 ITERM = 6 CALL UISATT(ITERM,IYES) CCPONL = IYES.EQ.1 END C C C C SUBROUTINE 'CCPPSF' C =================== C C_BEGIN_CCPPSF SUBROUTINE CCPPSF(FILNAM,PATH,NAME,TYPE,VERS) C ============================================= C C PARSE FILE NAME INTO COMPONENTS C C NOTE: THE ROUTINE CONTAINS MACHINE DEPENDENT CODE C C C Arguments: C ========== C C FILNAM (I) CHARACTER*(*): FILE NAME STRING (NO EMBEDDED BLANKS ASSUMED) C C PATH (O) CHARACTER*(*): STRING RETURNING PATH OR, FOR VAX VMS, C THE PART OF THE FILE SPECIFICATION UP TO THE C END OF THE DIRECTORY SPECIFICATION (BLANK IF NONE) C (INCLUDES TERMINATING ] or : or /) C C NAME (O) CHARACTER*(*): STRING RETURNING NAME. (BLANK IF NONE) C C TYPE (O) CHARACTER*(*): STRING RETURNING FILE TYPE/EXTENSION C (BLANK IF NONE) C C VERS (O) CHARACTER*(*): STRING RETURNING THE VERSION. C (BLANK IF NONE) C C AFTER REMOVAL OF THE PATH PART OF THE STRING, IF PRESENT, THE VERSION ON C A VAX IS TAKEN AS ANY TEXT FOLLOWING A SEMICOLON IN THE STRING OR, IF NO C SEMICOLON IS PRESENT, ANY TEXT FOLLOWING THE LAST DOT IN THE STRING C PROVIDED THAT AT LEAST TWO DOTS ARE PRESENT. ON A UNIX SYSTEM THE VERSION C WILL ALWAYS BE RETURNED AS A BLANK. C C AFTER THE REMOVAL OF THE PATH AND VERSION PARTS OF THE STRING THEN, IF C THERE IS AT LEAST ONE DOT, THE NAME IS THE STRING UP TO THE LAST DOT C REMAINING AND THE TYPE IS THE PART OF THE STRING AFTER THE DOT. IF C NO DOT IS PRESENT THEN THE REMAINING STRING IS THE NAME AND THE TYPE C IS BLANK. C_END_CCPPSF C C SPECIFICATION STATEMENTS C ------------------------ C CHARACTER*(*) FILNAM,PATH,NAME,TYPE,VERS INTEGER LMAX,LMIN,L,LSC,LDOT,NDOT,LENSTR EXTERNAL VAXVMS, WINMVS, RTNBKS, LENSTR LOGICAL VAXVMS, WINMVS, VMS, MVS CHARACTER RTNBKS*1, BKS*1 C C INITIALISATIONS C --------------- C PATH=' ' NAME=' ' TYPE=' ' VERS=' ' LMAX=LENSTR(FILNAM) IF (LMAX.EQ.0) RETURN LMIN=0 VMS = VAXVMS() MVS = WINMVS() BKS = RTNBKS() 10 LMIN=LMIN+1 IF (FILNAM(LMIN:LMIN).EQ.' ') GO TO 10 C C GET PATH C -------- C IF (VMS) THEN DO 20 L=LMAX,LMIN,-1 IF (FILNAM(L:L).EQ.':'.OR.FILNAM(L:L).EQ.']') GO TO 30 20 CONTINUE ELSEIF (MVS) THEN DO 21 L=LMAX,LMIN,-1 IF (FILNAM(L:L).EQ.BKS .OR. FILNAM(L:L).EQ.'/')GO TO 30 21 CONTINUE ELSE DO 22 L=LMAX,LMIN,-1 IF (FILNAM(L:L).EQ.'/')GO TO 30 22 CONTINUE ENDIF GO TO 40 30 PATH=FILNAM(LMIN:L) LMIN=L+1 IF (LMIN.GT.LMAX) RETURN C C GET VERSION IF PRESENT C ---------------------- C 40 CONTINUE IF (VMS) THEN LSC=INDEX(FILNAM(LMIN:LMAX),';') IF (LSC.GT.0) THEN LSC=LSC+LMIN-1 IF (LSC.LT.LMAX) VERS=FILNAM(LSC+1:LMAX) LMAX=LSC-1 ELSE LDOT=0 NDOT=0 DO 50 L=LMAX,LMIN,-1 IF (FILNAM(L:L).EQ.'.') THEN NDOT=NDOT+1 IF (LDOT.EQ.0) LDOT=L ENDIF 50 CONTINUE IF (NDOT.GT.1) THEN IF (LDOT.LT.LMAX) VERS=FILNAM(LDOT+1:LMAX) LMAX=LDOT-1 ENDIF ENDIF ENDIF C C GET NAME AND TYPE C ----------------- C IF (LMAX.LT.LMIN) RETURN LDOT=0 DO 60 L=LMAX,LMIN,-1 IF (FILNAM(L:L).EQ.'.') THEN LDOT=L GO TO 70 ENDIF 60 CONTINUE 70 IF (LDOT.EQ.0) THEN NAME=FILNAM(LMIN:LMAX) RETURN ELSE IF (LDOT.GT.LMIN) NAME=FILNAM(LMIN:LDOT-1) IF (LDOT.LT.LMAX) TYPE=FILNAM(LDOT+1:LMAX) ENDIF END C C C_BEGIN_CSETNV SUBROUTINE CSETNV(LNAME,FILNAM,ENAME,ETYPE,EXTN,ICOUNT,LSKIP) C ============================================================= C C Associate `logical name' LNAME with value FILNAM. It is passed C arrays of (name, type, extension) for ICOUNT number of name lines C read from environ.def. Doesn't re-define existing name if LSKIP is true. C C Arguments: C ========== C C LNAME (I) CHARACTER*(*): Logical name (environment variable). C C FILNAM (I/O) CHARACTER*(*): File name, if extension is omitted it is appended C C ENAME (I/O) CHARACTER(150)*20 ARRAY: containing list of environment C variables; if LNAME is not in list it is appended C (also to ETYPE & EXTN arrays). C C ETYPE (I,O) CHARACTER(150)*5 ARRAY: containing list of in/out types. C C EXTN (I/O) CHARACTER(150)*4 ARRAY: containing list of extensions. C C ICOUNT (I/O) INTEGER: Length of arrays ENAME, ETYPE & EXTN. C C LSKIP (I) LOGICAL: If .TRUE. existing name not re-defined. C C_END_CSETNV C C .. Parameters .. INTEGER ILIMIT,ISTRLN,IENV PARAMETER (ILIMIT=150,ISTRLN=200,IENV=20) C .. C .. Scalar Arguments .. INTEGER ICOUNT CHARACTER LNAME* (*),FILNAM* (*) LOGICAL LSKIP C .. C .. Array Arguments .. CHARACTER ENAME(ILIMIT)* (IENV),ETYPE(ILIMIT)* (5), + EXTN(ILIMIT)* (4) C .. C .. Local Scalars .. INTEGER I,II,ISTAT,JJ,PROCID LOGICAL VAX,MVS,EXIST CHARACTER ERRSTR* (ISTRLN),LIBFIL* (ISTRLN),PROGNM* (ISTRLN), + TMPNAM* (ISTRLN),LINE* (ISTRLN),SCRFIL* (ISTRLN), + BKS*(1) C .. C .. External Functions .. INTEGER GETPID,LENSTR LOGICAL VAXVMS, WINMVS CHARACTER FDIR* (ISTRLN),FEXTN* (ISTRLN),FROOT* (ISTRLN), RTNBKS EXTERNAL LENSTR,VAXVMS,FDIR,FEXTN,FROOT C .. C .. External Subroutines .. EXTERNAL CCPERR,UGTARG,QPRINT,UGTENV,USTENV C .. C .. Intrinsic Functions .. INTRINSIC INDEX C .. SAVE DATA PROGNM/' '/ C C---- Check Logical Name does not already exist (unless processing C command line, in which case LSKIP will be true to override C environment) C CALL UGTENV(LNAME,TMPNAM) IF (TMPNAM.NE.' ' .AND. LSKIP ) RETURN VAX = VAXVMS() MVS = WINMVS() BKS = RTNBKS() C C---- Get program name (argv[0]), but check if we have it already C IF (PROGNM.EQ.' ') THEN CALL UGTARG(0,TMPNAM) PROGNM = FROOT(TMPNAM) ENDIF C C---- look through list for a match (possibly abbreviated) [is this C abbreviation possibility documented?] C DO 10 JJ = 1,ICOUNT IF (ENAME(JJ).EQ.LNAME(1:LENSTR(ENAME(JJ)))) GO TO 20 10 CONTINUE C C---- Unknown logical name add it to the list. C TMPNAM = 'Non standard logical name ' TMPNAM(27:) = LNAME CALL QPRINT(2,TMPNAM) ICOUNT = ICOUNT + 1 IF (ICOUNT.GT.ILIMIT) + CALL CCPERR(1,'Too many logical names') ENAME(ICOUNT) = LNAME ETYPE(ICOUNT) = 'undef' IF (LENSTR(FEXTN(FILNAM)).GT.4) + CALL CCPERR(2, + 'Extension too long in s/r CSETNV: '//FEXTN(FILNAM)) EXTN(ICOUNT) = FEXTN(FILNAM) JJ = ICOUNT C C---- Known logical name processing C 20 IF (FEXTN(FILNAM).EQ.' ') THEN C C---- Add extension C IF (FILNAM.EQ.'/dev/null' .OR. FILNAM.EQ.'NL:') THEN C but not if FILNAM is /dev/null or NL: GOTO 333 ELSE II = LENSTR(FILNAM) + 1 FILNAM(II:) = EXTN(JJ) ENDIF ENDIF IF (FDIR(FILNAM).EQ.' ') THEN CCC this didn't agree with documentation: CCC IF (EXTN(JJ).EQ.'.lib' .OR. EXTN(JJ).EQ.'.prt' .OR. CCC + EXTN(JJ).EQ.'.bes' .OR. EXTN(JJ).EQ.'.dic') THEN TMPNAM = FEXTN(FILNAM) IF (VAX) CALL CCPLWC(TMPNAM) IF (TMPNAM.EQ.'lib' .OR. TMPNAM.EQ.'prt' .OR. + TMPNAM.EQ.'bes' .OR. TMPNAM.EQ.'dic') THEN C look for files without path but with standard extension in the C standard place CALL UGTENV('CLIBD',LIBFIL) C add the standard directory qualifier IF (VAX) THEN C fixme: should we insist that VMS defines CLIBD as well as un*x? IF (LIBFIL.NE.' ') THEN TMPNAM = 'CLIBD:' TMPNAM(7:) = FILNAM ELSE TMPNAM = FILNAM ENDIF ELSEIF (MVS) THEN IF (LIBFIL.EQ.' ') CALL CCPERR(1,'CLIBD not defined') II = LENSTR(LIBFIL) TMPNAM = LIBFIL(:II)//BKS II = II + 2 TMPNAM(II:) = FILNAM ELSE IF (LIBFIL.EQ.' ') CALL CCPERR(1,'CLIBD not defined') II = LENSTR(LIBFIL) TMPNAM = LIBFIL(:II)//'/' II = II + 2 TMPNAM(II:) = FILNAM END IF FILNAM = TMPNAM ELSE IF (EXTN(JJ).EQ.'.scr' .OR. FEXTN(FILNAM).EQ.'scr') THEN C scratch files in a special place C actually create /_. CALL UGTENV('CCP4_SCR',TMPNAM) IF (VAX) THEN IF (TMPNAM.EQ.' ') THEN TMPNAM = PROGNM ELSE TMPNAM = 'CCP4_SCR:' // PROGNM ENDIF ELSEIF (MVS) THEN IF (TMPNAM.EQ.' ') CALL CCPERR(1,'CCP4_SCR not defined') II = LENSTR(TMPNAM) + 1 TMPNAM(II:) = BKS//PROGNM ELSE IF (TMPNAM.EQ.' ') CALL CCPERR(1,'CCP4_SCR not defined') II = LENSTR(TMPNAM) + 1 TMPNAM(II:) = '/'//PROGNM END IF II = LENSTR(TMPNAM) + 1 TMPNAM(II:II) = '_' II = II + 1 I = INDEX(FILNAM,'.') TMPNAM(II:) = FILNAM(:I) IF (VAX) THEN WRITE (SCRFIL,'(Z8.8)') GETPID() ELSE PROCID = MOD(GETPID(),100000) C Windows98 does not return a pid so make a number up IF (PROCID.GT.99999 .OR. PROCID.LE.0) THEN CALL USTIME(PROCID) PROCID = MOD(PROCID,100000) ENDIF WRITE (SCRFIL,'(I5.5)') PROCID ENDIF FILNAM = TMPNAM(1:LENSTR(TMPNAM))//SCRFIL END IF END IF 333 CONTINUE C C---- Now test input files do exist (but not for defaults, to avoid C checking 40 or 50 files listed in default.def which the setup C should guarantee) C IF (ETYPE(JJ).EQ.'in' .AND. .NOT.LSKIP) THEN INQUIRE(FILE=FILNAM,EXIST=EXIST) IF (.NOT.EXIST) THEN ERRSTR = 'Cannot find file ' ERRSTR(18:) = FILNAM CALL CCPERR (-1,ERRSTR) END IF END IF II = LENSTR(LNAME) + 1 LINE = LNAME LINE(II:II) = '=' II = II + 1 LINE(II:) = FILNAM C ======================================= CALL USTENV(LINE(1:LENSTR(LINE)),ISTAT) C ======================================= IF (ISTAT.NE.0) THEN IF (VAX) THEN ERRSTR = 'Cannot create environment variable ' ELSE ERRSTR = 'Cannot create logical name ' ENDIF ERRSTR(36:) = LNAME CALL CCPERR (-1,ERRSTR) END IF CALL QPRINT(3,LINE) END C C C C_BEGIN_CCPPAG SUBROUTINE CCPPAG(IUN,NCOL,NLIN) C ================================ C C---- This subroutine returns the number of columns and lines C for a printer output page on a given fortran unit number C if the information is available C C Arguments: C ========== C C IUN (I) INTEGER: FORTRAN UNIT NUMBER C NCOL (O) INTEGER: NUMBER OF COLUMNS IN THE PAGE C NLIN (O) INTEGER: NUMBER OF LINES IN THE PAGE C C Return 80,132 unless a terminal whence 0,80 C_END_CCPPAG C C .. Scalar Arguments .. INTEGER IUN,NCOL,NLIN C .. C .. Local Scalars .. INTEGER IYES C .. C .. External Subroutines .. EXTERNAL UISATT C .. CALL UISATT(IUN,IYES) IF (IYES.EQ.1) THEN NLIN = 0 NCOL = 80 ELSE NLIN = 80 NCOL = 132 END IF END C C C C SUBROUTINE 'CCPSI2' C =================== C C_BEGIN_CCPSI2 SUBROUTINE CCPSI2(IVAL,IA,N) C ============================ C C SET AN INTEGER VALUE FROM 0 TO 65535 INTO THE N'TH UNSIGNED INTEGER*2 ELEMENT C OF AN INTEGER (OR OTHER) ARRAY. C NOTE: NO OVERFLOW CHECKING IS DONE. C C (MUST BE IMPLEMENTED IF CCPBYT FUNCTION RETURNS .TRUE.) C [for LAUE] C C Arguments: C ========== C C IVAL (I) INTEGER: VALUE FROM 0 TO 65535 C C IA (I/O) INTEGER*2 ARRAY: WHERE THE UNSIGNED INTEGER*2 VALUE IS TO BE C INSERTED C C N (I) INTEGER: THE POSITION IN 'IA' WHERE THE UNSIGNED INTEGER*2 C VALUE IS TO BE INSERTED C_END_CCPSI2 C C SPECIFICATION STATEMENTS C ------------------------ C INTEGER*2 IA(*) INTEGER*2 JBYT(2) INTEGER JA,IVAL,N EQUIVALENCE (JA,JBYT(1)) LOGICAL CALLED, LITEND EXTERNAL LITEND INTEGER IND SAVE CALLED, IND DATA CALLED/.FALSE./ C IF (.NOT.CALLED) THEN IF (LITEND(1)) THEN IND = 1 ELSE IND = 2 ENDIF CALLED=.TRUE. ENDIF C C SET UNSIGNED INTEGER*2 C ---------------------- C JA=IVAL IA(N)=JBYT(IND) END C C C C SUBROUTINE 'CCPSTB' C =================== C C_BEGIN_CCPSTB SUBROUTINE CCPSTB(IVAL,IA,N) C ============================ C C SET AN INTEGER VALUE FROM 0 TO 255 INTO THE N'TH BYTE OF AN INTEGER C (OR OTHER) ARRAY. C NOTE: NO OVERFLOW CHECKING IS DONE. C C (MUST BE IMPLEMENTED IF CCPBYT FUNCTION RETURNS .TRUE.) C [for LAUE] C C Arguments: C ========== C C IVAL (I) INTEGER: VALUE FROM 0 TO 255 C IA (I/O) BYTE ARRAY(*): WHERE THE BYTE VALUE IS TO BE INSERTED C N (I) INTEGER: THE POSITION IN 'IA' WHERE THE BYTE VALUE IS TO C BE INSERTED C_END_CCPSTB C C SPECIFICATION STATEMENTS C ------------------------ C INTEGER*1 IA(*) INTEGER*1 JBYT(4) EQUIVALENCE (JA,JBYT(1)) EQUIVALENCE (JA,JBYT(1)) LOGICAL CALLED, LITEND EXTERNAL LITEND INTEGER IND SAVE CALLED, IND DATA CALLED/.FALSE./ C IF (.NOT.CALLED) THEN IF (LITEND(1)) THEN IND = 1 ELSE IND = 4 ENDIF CALLED=.TRUE. ENDIF C C SET BYTE C -------- C JA=IVAL IA(N)=JBYT(IND) END C C C C_BEGIN_CCPSUM REAL FUNCTION CCPSUM(A,N,L) C =========================== C C---- This function sums the elements of an array. (for the cray this C function will call the cray 'ssum' function) C C Arguments: C ========== C C A (I) REAL ARRAY(N): ARRAY TO BE SUMMED C N (I) INTEGER: NO. OF ELEMENTS IN THE ARRAY C L (I) INTEGER: SUM EVERY L'TH ELEMENT C C CCPSUM RETURNS THE SUM C_END_CCPSUM C C SPECIFICATION STATEMENTS AND CODE C C .. Scalar Arguments .. INTEGER L,N C .. C .. Array Arguments .. REAL A(N) C .. C .. Local Scalars .. INTEGER I C .. CCPSUM = 0.0 DO 10 I = 1,N,L CCPSUM = A(I) + CCPSUM 10 CONTINUE END C C C C_BEGIN_CCPTOI SUBROUTINE CCPTOI(ARRAY,N,II,ITYP,IFAIL) C ======================================== C C---- This subroutine converts the n'th byte or integer*2 element in a C non-character array to an integer value. it is used by the C map file handling routines and must be implemented if map modes C 0,1,3 or 5 are to be used. C C Arguments: C ========== C C ARRAY (I) REAL ARRAY(*): CONTAINING THE ELEMENTS TO BE CONVERTED C C N (I) INTEGER: THE NUMBER OF THE ELEMENT TO BE CONVERTED C C II (O) INTEGER: THE CALCULATED INTEGER VALUE (FOR BYTES THIS WILL C BE IN THE RANGE 0-255) C C ITYP (I) INTEGER: THE CONVERSION TYPE =1, BYTE TO INTEGER C =2, INTEGER*2 TO INTEGER C C IFAIL (I/O) INTEGER: ON INPUT =0, STOP IF CONVERSION NOT AVAILABLE C =1, RETURN FROM SUBROUTINE ALWAYS C ON OUTPUT UNCHANGED IF CONVERSION CARRIED OUT C =-1 IF CONVERSION NOT AVAILABLE C_END_CCPTOI C C .. Scalar Arguments .. INTEGER IFAIL,II,ITYP,N C .. C .. Array Arguments .. REAL ARRAY(*) C .. C .. Local Scalars .. REAL RR INTEGER IA,NB,NIH,NW C .. C .. Local Arrays .. INTEGER*1 IBYT(4),JBYT(4) INTEGER*2 JHALF(2) C .. C .. Intrinsic Functions .. INTRINSIC MOD C .. C .. Equivalences .. EQUIVALENCE (IA,IBYT(1)) EQUIVALENCE (RR,JHALF(1),JBYT(1)) C .. LOGICAL CALLED, LITEND INTEGER IND EXTERNAL LITEND, CCPERR SAVE CALLED, IND DATA CALLED/.FALSE./ C IF (.NOT.CALLED) THEN CALLED=.TRUE. IF (LITEND(1)) THEN IND = 1 ELSE IND = 4 ENDIF ENDIF C GO TO (10,20) ITYP C C---- Byte to integer value C 10 NW = (N-1)/4 + 1 NB = MOD(N-1,4) + 1 IA = 0 RR = ARRAY(NW) IBYT(IND) = JBYT(NB) II = IA IF (II.LT.0 .OR. II.GT.255) THEN IF (IFAIL .EQ. 0) THEN CALL CCPERR(1,' *** Error in CCPTOI, bad convertion ***') ELSE IFAIL = -1 ENDIF ENDIF RETURN C C---- Integer*2 to integer value C 20 NW = (N-1)/2 + 1 NIH = MOD(N-1,2) + 1 RR = ARRAY(NW) II = JHALF(NIH) IF (II.LT.0 .OR. II.GT.65535) THEN IF (IFAIL .EQ. 0) THEN CALL CCPERR(1,' *** Error in CCPTOI, bad convertion ***') ELSE IFAIL = -1 ENDIF ENDIF END C C C C_BEGIN_CCPUFL SUBROUTINE CCPUFL C ================= C C---- This subroutine is called to suppress underflow error messages C if required and if the facility is available. C C Arguments: NONE C ========== C C---- Not implemented. C_END_CCPUFL END C C C C_BEGIN_CCP4_PATCH_LEVEL SUBROUTINE CCP4_PATCH_LEVEL(PATCH_LEVEL) C ================================= C C---- Return current CCP4 patch level as string C C Arguments: C ========== C C PATCH_LEVEL (O) CHARACTER*(*): current patch level of CCP4 suite C_END_CCP4_PATCH_LEVEL C C .. Scalar Arguments .. CHARACTER*(*) PATCH_LEVEL PATCH_LEVEL = '5.0f' END C C C C_BEGIN_CCPZBI SUBROUTINE CCPZBI (ARR1,NUM) C ============================ C C This routine zeros NUM bytes of the array ARR1 C C Arguments: C C ARR1 (O) BYTE ARRAY(*): array to be zeroed C NUM (I) INTEGER: Number of bytes C_END_CCPZBI C C Arguments ...... INTEGER NUM INTEGER*1 ARR1(*) C INTEGER J C DO 10 J=1,NUM 10 ARR1(J)=0 END C C C_BEGIN_CCPZI SUBROUTINE CCPZI (IARR1,NUM) C =========================== C C This routine assigns zero to IARR1 using NUM words C C Arguments: C C IARR1 (O) INTEGER ARRAY(*): array to be zeroed C NUM (I) INTEGER: Number of words C_END_CCPZI C C Arguments .......... INTEGER NUM, IARR1(*) C INTEGER J C DO 10 J=1,NUM 10 IARR1(J)=0 END C C C_BEGIN_CCPZR SUBROUTINE CCPZR (ARR1,NUM) C =========================== C C This routine assigns zero to ARR1 using NUM words C C Arguments: C C ARR1 (O) REAL ARRAY(*): array to be zeroed C NUM (I) INTEGER: Number of words C_END_CCPZR C C Arguments .......... INTEGER NUM REAL ARR1(*) C INTEGER J C DO 10 J=1,NUM 10 ARR1(J)=0.0 END C C C =================================== C_BEGIN_FDIR FUNCTION FDIR(FILNAM) CHARACTER*(*) FDIR C =================================== C C---- Returns the path (directory) of a file name or ' ' C C Arguments: C C FILNAM (I) CHARACTER*(*): File name C_END_FDIR CHARACTER FILNAM* (*) CHARACTER*1 NAME, TYPE, VERS EXTERNAL CCPPSF C CALL CCPPSF(FILNAM, FDIR, NAME, TYPE, VERS) END C C C ==================================== C_BEGIN_FEXTN FUNCTION FEXTN(FILNAM) CHARACTER*(*) FEXTN C ==================================== C C---- Returns the extension of a file name or ' ' C C Arguments: C C FILNAM (I) CHARACTER*(*): File name C_END_FEXTN CHARACTER FILNAM* (*) CHARACTER*1 PATH, NAME, VERS EXTERNAL CCPPSF C CALL CCPPSF(FILNAM, PATH, NAME, FEXTN, VERS) END C C C ==================================== C_BEGIN_FROOT FUNCTION FROOT(FILNAM) CHARACTER*(*) FROOT C ==================================== C C---- Returns a file name minus an extension. C C Arguments: C C FILNAM (I) CHARACTER*(*): File name C_END_FROOT C CHARACTER FILNAM* (*) CHARACTER*1 PATH, TYPE, VERS EXTERNAL CCPPSF C CALL CCPPSF(FILNAM, PATH, FROOT, TYPE, VERS) END C C C C_BEGIN_LITEND LOGICAL FUNCTION LITEND(IDUM) C ============================= C C---- Check endedness, Returns TRUE if little endian (VAX, FX2800, C Ultrix) C FALSE if big endian (IBM,IRIS,ESV) C C Arguments: C ========== C C IDUM (D) DUMMY C_END_LITEND C INTEGER I, IDUM INTEGER*1 B(4) EQUIVALENCE (I,B(1)) C C---- Initialise B C DO 10 JDO=1,4 B(JDO) = 0 10 CONTINUE C I = 1 C IF (B(1) .NE. 0) THEN LITEND = .TRUE. ELSE LITEND = .FALSE. END IF C END C C^L C====================================================================== C C_BEGIN_LENSTR INTEGER FUNCTION LENSTR(STRING) C =============================== C C---- Returns significant string length excluding trailing spaces C C NB: LENSTR removes trailing spaces, plus trailing "null" C characters (ascii code 0) and carriage-returns (ascii code 13). C Carriage-returns may be inserted by editing on non-unix C systems? (PJX) C C Arguments: C ========== C C STRING (I) CHARACTER*(*): Input string C_END_LENSTR C C .. Scalar Arguments .. CHARACTER STRING* (*) C .. C .. Intrinsic Functions .. INTRINSIC LEN C .. LENSTR = LEN(STRING) 10 CONTINUE IF (LENSTR.NE.0) THEN IF( ICHAR(STRING(LENSTR:LENSTR)).EQ.0 .OR. . ICHAR(STRING(LENSTR:LENSTR)).EQ.13 .OR. . STRING(LENSTR:LENSTR) .EQ.' ' ) THEN LENSTR = LENSTR - 1 GO TO 10 END IF END IF C END C C C FUNCTION 'LUNSTI' C ================= C C_BEGIN_LUNSTI FUNCTION LUNSTI(IDUM) C ===================== C C Returns the fortran standard input unit number C C Arguments: C ========== C C IDUM (D) Dummy C_END_LUNSTI C INTEGER LUNSTI,IDUM C LUNSTI = 5 END C C C FUNCTION 'LUNSTO' C ================= C C_BEGIN_LUNSTO FUNCTION LUNSTO(IDUM) C ===================== C C Returns the fortran standard output unit number C C Arguments: C ========== C C IDUM (I) Dummy argument C_END_LUNSTO C INTEGER LUNSTO,IDUM C LUNSTO = 6 END C C C FUNCTION 'NBITST' C ================= C C_BEGIN_NBITST FUNCTION NBITST(IWORD,LSB,NBITS) C ================================ C C Return the (unsigned) integer value held within a bit field in a word C [for LAUE] C C Arguments: C ========== C C IWORD (I) INTEGER: The word containing the bits to be examined C C LSB (I) INTEGER: The least significant bit offset for the bit field C C NBITS (I) INTEGER: The number of bits in the bit field (Must be less C than the word length) C_END_NBITST C C====== Get the bit value C INTEGER IWORD,LSB,NBITS,IVAL,KMSK,KVAL C KMSK = 2**NBITS - 1 NBITST = IAND(ISHFT(IWORD,-LSB),KMSK) END C C C ======================= C_BEGIN_NOCRLF SUBROUTINE NOCRLF(LINE) C ======================= C C---- Output a line supressing cr/lf. C C Arguments: C ========== C C LINE (I) CHARACTER*(*): Line to output. C_END_NOCRLF C EXTERNAL LUNSTO,TTSEND INTEGER LUNSTO CHARACTER*(*) LINE CALL TTSEND(LUNSTO(1),LINE,0) END C C C SUBROUTINE 'STBITS' C =================== C C_BEGIN_STBITS SUBROUTINE STBITS (IWORD,LSB,NBITS,IVAL) C ======================================== C Set a bit field within a word to a given (unsigned) integer value C [for LAUE] C C Arguments: C ========== C C IWORD (I/O) INTEGER: The word in which the bits are to be set C C LSB (I) INTEGER: The least significant bit offset for the bit field C C NBITS (I) INTEGER: The number of bits in the bit field (must be less C than the word length) C C IVAL (I) INTEGER: The unsigned integer value to be set in the bit C field (The user should ensure that this value will C fit within the requested bit field) C_END_STBITS C C====== Set the bits C KMSK = 2**NBITS - 1 KVAL = IVAL KMSK = ISHFT(KMSK,LSB) KMSK = NOT(KMSK) KVAL = ISHFT(KVAL,LSB) IWORD = IOR(IAND(IWORD,KMSK),KVAL) END C C^L C ============================ LOGICAL FUNCTION HKLEQ(IH,KH) C ============================= C C---- Returns true if indices ih = kh C C .. Array Arguments .. INTEGER IH(3),KH(3) C .. C HKLEQ = .FALSE. C IF (IH(1).EQ.KH(1) .AND. IH(2).EQ.KH(2) .AND. + IH(3).EQ.KH(3)) HKLEQ = .TRUE. C END C C Group 7: Subroutines for generating and accessing a hash table: C====================================================================== C C---- CCP4_HASH_SETUP CCP4_HASH_LOOKUP CCP4_HASH_ZEROIT C C Routines and functions used to initialise, set up and access C an internal look-up table. Not clear why these routines are C here in particular. C C---- SUBROUTINE CCP4_HASH_SETUP(NSER,NFIND) C C---- This subroutine sets up a value for the function ccp4_hash_lookup C when ccp4_hash_lookup(nser) is later evaluated it will return nfind C this function will allow the efficient retrieval of an identifier C for a large range variable (such as a crystal number). the values C of the function ccp4_hash_lookup(nser) are stored in the array C it(2, kpri) where kpri is the prime number used to generate the C function. C The array it lives in the common look which is shared by C ccp4_hash_setup and the function ccp4_hash_lookup C C NOTES: A hash table is a way of storing information so that it C easily be retrieved without the need for indexing or long searches. C NSER is referred to as the "key", which is "hashed" (computer- C science speak for "messed up") by the hashing function (in this C case MOD(NSER4,KPRI) + 1) to determine where the value pair will C be stored. The function LOOKUP can then search on the same basis C when supplied with the key, to retreive the pair in (at most) 3 C calculations. Note that KPRI (the table size) MUST BE A PRIME in C order for this method to work. C C IT(1, NDX) = NSER, IT(2, NDX) = NFIND C C---- INTEGER FUNCTION CCP4_HASH_LOOKUP(NSER) C C---- The function ccp4_hash_lookup returns the value nfind (which was C input when setting up the function in the subroutine ccp4_hash_setup) C for the large range variable nser. Uses hashing. (see comments for C CCP4_HASH_SETUP for description of hashing method). C C---- SUBROUTINE CCP4_HASH_ZEROIT() C C Initialises elements of array it used in ccp4_hash_setup and C ccp4_hash_lookup to zero. C^L C ======================================= INTEGER FUNCTION CCP4_HASH_LOOKUP(NSER) C ======================================= C C---- The function ccp4_hash_lookup returns the value nfind (which was C input when setting up the function in the subroutine ccp4_hash_setup) C for the large range variable nser. Uses hashing. (see comments for C CCP4_HASH_SETUP for description of hashing method). C IMPLICIT NONE C .. Parameter (table size: MUST BE A PRIME NUMBER) INTEGER KPRI PARAMETER (KPRI=12007) C C .. Scalar Arguments .. INTEGER NSER C .. C .. Arrays in Common .. INTEGER IT C .. C .. Local Scalars .. INTEGER NDX,NSER4 C .. C .. Intrinsic Functions .. INTRINSIC MOD C .. C .. Common blocks .. COMMON /LOOK/IT(2,KPRI) SAVE /LOOK/ C .. C NSER4 = NSER C 10 CONTINUE C NDX = MOD(NSER4,KPRI) + 1 IF (NSER.NE.IT(1,NDX)) THEN IF (IT(1,NDX).NE.0) THEN NSER4 = NSER4 + 3 GO TO 10 END IF END IF C CCP4_HASH_LOOKUP = IT(2,NDX) C END C C^L C ====================================== SUBROUTINE CCP4_HASH_SETUP(NSER,NFIND) C ====================================== C C---- This subroutine sets up a value for the function ccp4_hash_lookup C when ccp4_hash_lookup(nser) is later evaluated it will return nfind C this function will allow the efficient retrieval of an identifier C for a large range variable (such as a crystal number). the values C of the function ccp4_hash_lookup(nser) are stored in the array C it(2, kpri) where kpri is the prime number used to generate the C function C The array it lives in the common look which is shared by C ccp4_hash_setup and the function ccp4_hash_lookup C C NOTES: A hash table is a way of storing information so that it C easily be retrieved without the need for indexing or long searches. C NSER is referred to as the "key", which is "hashed" (computer- C science speak for "messed up") by the hashing function (in this C case MOD(NSER4,KPRI) + 1) to determine where the value pair will C be stored. The function LOOKUP can then search on the same basis C when supplied with the key, to retreive the pair in (at most) 3 C calculations. Note that KPRI (the table size) MUST BE A PRIME in C order for this method to work. C C IT(1, NDX) = NSER, IT(2, NDX) = NFIND C IMPLICIT NONE C .. Parameter (table size: MUST BE A PRIME NUMBER) INTEGER KPRI PARAMETER (KPRI=12007) C C .. Scalar Arguments .. INTEGER NFIND,NSER C .. C .. Arrays in Common .. INTEGER IT C .. C .. Local Scalars .. INTEGER NDX,NSER4 CHARACTER STROUT*140 C .. C .. Intrinsic Functions .. INTRINSIC MOD C .. C .. Common blocks .. COMMON /LOOK/IT(2,KPRI) SAVE /LOOK/ C .. C NSER4 = NSER 10 CONTINUE NDX = MOD(NSER4,KPRI) + 1 IF ((NSER4-NSER) .GE. 3*KPRI) THEN WRITE (STROUT, '(A,I8)') $ ' **** Error in SETUP: overflowed hash table, size ', KPRI CALL PUTLIN(STROUT,'CURWIN') CALL CCPERR(1,'*** Filled hash table in SETUP ***') ENDIF IF (IT(1,NDX).NE.0) THEN NSER4 = NSER4 + 3 GO TO 10 END IF C IT(1,NDX) = NSER IT(2,NDX) = NFIND RETURN END C C^L C C ============================= SUBROUTINE CCP4_HASH_ZEROIT() C ============================= C IMPLICIT NONE C .. Parameter (table size: MUST BE A PRIME NUMBER) INTEGER KPRI PARAMETER (KPRI=12007) C C .. Arrays in Common .. INTEGER IT C .. C .. Local Scalars .. INTEGER I C .. C .. C .. Common blocks .. COMMON /LOOK/IT(2,KPRI) SAVE /LOOK/ C DO 20 I = 1,KPRI IT(1,I) = 0 IT(2,I) = 0 20 CONTINUE RETURN C END C C^L C C ================================== REAL FUNCTION LSTLSQ(MINDX, IH, IK, IL) C ================================== C IMPLICIT NONE C EXTERNAL LSTLSQ1 C C PARAMETERS INTEGER MINDX, IH, IK, IL C C reso RETURN value REAL RESO C CALL LSTLSQ1(RESO, MINDX, IH, IK, IL) LSTLSQ=RESO RETURN END C C^L C C ================================== REAL FUNCTION STHLSQ(IH, IK, IL) C ================================== C IMPLICIT NONE C EXTERNAL STHLSQ1 C C PARAMETERS INTEGER IH, IK, IL C C reso RETURN value REAL RESO C CALL STHLSQ1(RESO, IH, IK, IL) STHLSQ=RESO RETURN END C C^L C C ================================== REAL FUNCTION STS3R4(IH, IK, IL) C ================================== C IMPLICIT NONE C EXTERNAL STS3R41 C C PARAMETERS INTEGER IH, IK, IL C C reso RETURN value REAL RESO C CALL STS3R41(RESO, IH, IK, IL) STS3R4=RESO RETURN END libccp4-8.0.0/fortran/cmaplib_f.c0000644000000000000000000021352714242731033014731 0ustar 00000000000000/* cmaplib_f.c: Fortran API for accessing CCP4 map files Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /* */ /** @page cmap_f_page Fortran API to CMAP * * @section cmap_f_file_list File list
  • cmaplib_f.c
* @section cmap_f_overview Overview This library consists of a set of wrappers to the CMAP library giving the same API as the original maplib.f For details of the API, see the original documentation. This document covers some peculiarities of the C implementation. */ /** @file cmaplib_f.c * * @brief Fortran API for input, output and manipulation of CCP4 map files. * * @author Charles Ballard */ #include #include #include #include"cmaplib_f.h" #include"cmap_errno.h" #include"ccp4_fortran.h" #include"ccp4_parser.h" #include"csymlib.h" #include"ccp4_general.h" #include"ccp4_program.h" /* rcsid[] = "$Id$" */ static struct _IOConvMap *ioArray[MAXFILES]; static int last_Read = -1; static int last_Write = -1; static int SetChannel() { register int i; for (i=0;i!=MAXFILES;i++) if (ioArray[i] == NULL) break; return i; } static int GetChannel(int iunit) { register int i; for (i=0;i!=MAXFILES;i++) if (ioArray[i] && ioArray[i]->ipc == iunit) break; return i; } static int ioArrayPrint(IOConvMap *ioMap) { char *filename = ccp4_file_name((*ioMap->mapfile).stream); long length = ccp4_file_length((*ioMap->mapfile).stream); unsigned rw_mode = ccp4_file_is_read((*ioMap->mapfile).stream); if (ccp4VerbosityLevel(-1) < 1) goto out; printf("\n Logical Name: %s Filename: %s \n", ioMap->logname,filename); if (rw_mode == 1) { fprintf(stdout,"\nFile name for input map file on unit %3d : %s\n", ioMap->ipc,filename); fprintf(stdout,"file size %ld ; logical name %s\n\n",length,ioMap->logname); } else { fprintf(stdout,"\nFile name for output map file on unit %3d : %s\n", ioMap->ipc,filename); fprintf(stdout,"logical name %s\n\n",ioMap->logname); } out: free(filename); /* we strdup it in ccp4_file_name */ return 1; } static int HeaderInit(CMMFile *mfile, const char *title, int mode, const int *order, const int *grid, int nc_start, int nc_end, int nr_start, int nr_end, int ns_start, int nsecs, int lspgrp, const float *cell, float min, float max, double mean, double rms) { int tmp_array[3]; ccp4_cmap_set_datamode(mfile,mode); ccp4_cmap_set_cell(mfile,cell); ccp4_cmap_set_label(mfile,title,0); ccp4_cmap_set_grid(mfile,grid); ccp4_cmap_set_order(mfile,order); ccp4_cmap_set_mapstats(mfile,min,max,mean,rms); ccp4_cmap_set_spacegroup(mfile,lspgrp); tmp_array[0] = nc_end - nc_start +1; tmp_array[1] = nr_end - nr_start +1; tmp_array[2] = nsecs; ccp4_cmap_set_dim(mfile,tmp_array); tmp_array[0] = nc_start; tmp_array[1] = nr_start; tmp_array[2] = ns_start; ccp4_cmap_set_origin(mfile,tmp_array); return (1); } static int HeaderReturn(const CMMFile *mfile, char *title, int *mode, int *order, int *grid, int *nc_start, int *nc_end, int *nr_start, int *nr_end, int *ns_start, int *nsecs, int *spacegroup, float *cell, float *min, float *max, double *mean, double *rms) { int tmp_array[3]; char *tmp_label; if (ccp4_cmap_number_label(mfile)) if ((tmp_label = ccp4_cmap_get_label(mfile,0)) != NULL) strcpy(title,tmp_label); *mode = ccp4_cmap_get_datamode(mfile); ccp4_cmap_get_origin(mfile,tmp_array); *nc_start = tmp_array[0]; *nr_start = tmp_array[1]; *ns_start = tmp_array[2]; ccp4_cmap_get_dim(mfile,tmp_array); *nc_end = *nc_start + tmp_array[0] -1; *nr_end = *nr_start + tmp_array[1] -1; *nsecs = tmp_array[2]; ccp4_cmap_get_mapstats(mfile,min,max,mean,rms); ccp4_cmap_get_order(mfile,order); ccp4_cmap_get_grid(mfile,grid); ccp4_cmap_get_cell(mfile,cell); *spacegroup = ccp4_cmap_get_spacegroup(mfile); return (1); } static int HeaderPrint(const CMMFile *mfile) { static const char axes[]={' ','X','Y','Z'}; if(!mfile) { if (ccp4VerbosityLevel(-1) > 0) fprintf(stderr,"WARNING: no header information to print.\n"); return (0);} /* C. Vonrhein: make the output identical to old (pre-5.0) Fortran */ /* libraries */ fprintf(stdout,"\n\n"); fprintf(stdout," Number of columns, rows, sections ...............%5d%5d%5d\n", mfile->map_dim[0],mfile->map_dim[1],mfile->map_dim[2]); fprintf(stdout," Map mode ........................................%5d\n", mfile->data_mode); fprintf(stdout," Start and stop points on columns, rows, sections %5d%5d%5d%5d%5d%5d\n", mfile->origin[0], mfile->origin[0]+mfile->map_dim[0] - 1, mfile->origin[1], mfile->origin[1]+mfile->map_dim[1] - 1, mfile->origin[2], mfile->origin[2]+mfile->map_dim[2] - 1); fprintf(stdout," Grid sampling on x, y, z ........................%5d%5d%5d\n", mfile->cell_grid[0], mfile->cell_grid[1], mfile->cell_grid[2]); fprintf(stdout," Cell dimensions .................................%10.4f %10.4f %10.4f %10.4f %10.4f %10.4f\n", mfile->cell[0], mfile->cell[1], mfile->cell[2], mfile->cell[3], mfile->cell[4], mfile->cell[5]); fprintf(stdout," Fast, medium, slow axes ......................... %c %c %c\n", axes[mfile->axes_order[0]], axes[mfile->axes_order[1]], axes[mfile->axes_order[2]]); fprintf(stdout," Minimum density .................................%12.5f\n", mfile->stats.min); fprintf(stdout," Maximum density .................................%12.5f\n", mfile->stats.max); fprintf(stdout," Mean density ....................................%12.5f\n", (float) mfile->stats.mean); fprintf(stdout," Rms deviation from mean density .................%12.5f\n", (float) mfile->stats.rms); fprintf(stdout," Space-group .....................................%5d\n", mfile->spacegroup); fprintf(stdout," Number of titles ................................%5d\n", ccp4_cmap_number_label(mfile)); fprintf(stdout,"\n\n"); fprintf(stdout," %-35s\n", "Labels: "); { int i, nlabels = ccp4_cmap_number_label(mfile); for (i=0 ; i != nlabels ; i++) fprintf(stdout," %s\n",ccp4_cmap_get_label(mfile,i)); } fprintf(stdout,"\n\n"); return (0); } /* belongs to fortran interface , also provide translators for others? or should be in csym lib */ static int SymopToFMat4(char *symchs_begin, char *symchs_end, float *rot) { int no_real =0, no_recip = 0, no_axis = 0; /* counters */ int col = 3, nops = 0; int nsym = 0; float sign = 1.0f, value = 0.0f, value2; char *cp, *ptr_symchs = symchs_begin, ch; int j,k; /* loop variables */ unsigned char Isep = FALSE; /* parsed seperator? */ /* initialise and clear the relevant */ /* use knowledge that are using [4][4] for rot */ for (j = 0 ; j !=4 ; ++j) for (k = 0; k !=4 ; ++k) rot[(k << 2) +j] = 0.0f; rot[(3 << 2) +3] = 1.0f; while (ptr_symchs <= symchs_end) { ch = *ptr_symchs; /* parse it */ if (isspace(ch) || (ch == '*' && no_axis != 0) ) { ++ptr_symchs; continue; } else if (ch == ',' || ch == '*') { ++ptr_symchs; if (value == 0.0f && col == 3) { /* nothing set, this is a problem */ fprintf(stderr, "Problem \n"); return (no_recip)? -(nsym) : nsym ; /* salvage what we can */ } else { Isep = TRUE; /* drop through to evaluation*/ } } else if (ch == 'X' || ch == 'x') { no_real++, col = 0; if (value == 0.0f) value = sign * 1.0f; ++ptr_symchs; continue; } else if (ch == 'Y' || ch == 'y') { no_real++, col = 1; if (value == 0.0f) value = sign * 1.0f; ++ptr_symchs; continue; } else if (ch == 'Z' || ch == 'z') { no_real++, col = 2; if (value == 0.0f) value = sign * 1.0f; ++ptr_symchs; continue; } else if (ch == 'H' || ch == 'h') { no_recip++, col = 0; if (value == 0.0f) value = sign * 1.0f; ++ptr_symchs; continue; } else if (ch == 'K' || ch == 'k') { no_recip++, col = 1; if (value == 0.0f) value = sign * 1.0f; ++ptr_symchs; continue; } else if (ch == 'L' || ch == 'l') { no_recip++, col = 2; if (value == 0.0f) value = sign * 1.0f; ++ptr_symchs; continue; } else if (ch == 'A' || ch == 'a') { no_axis++, col = 0; if (value == 0.0f) value = sign * 1.0f; ++ptr_symchs; continue; } else if (ch == 'B' || ch == 'b') { no_axis++, col = 1; if (value == 0.0f) value = sign * 1.0f; ++ptr_symchs; continue; } else if (ch == 'C' || ch == 'c') { no_axis++, col = 2; if (value == 0.0f) value = sign * 1.0f; ++ptr_symchs; continue; } else if (ch == '+' || ch == '-') { sign = ((ch == '+')? 1.0f : -1.0f) ; ++ptr_symchs; if ( value == 0.0f && col == 3) continue; /* drop through to evaluation */ } else if ( ch == '/') { ++ptr_symchs; if (value == 0.0f) { fprintf(stderr,"ooops\n"); /* error */ } value2 = strtod(ptr_symchs, &cp); if (!value2) return (1); value = (float) value/value2; ptr_symchs = cp; continue; } else if ( isdigit(ch) || ch == '.') { value = strtod(ptr_symchs, &cp); ptr_symchs = cp; continue; } else { ++ptr_symchs; continue; } /* value to be entered in rot */ rot[(((nsym << 2) + col) << 2) + nops] = value; /* have we passed a operator seperator */ if (Isep) { Isep = FALSE; ++nops; sign = 1.0f; if (nops == 3) { nops = 0; ++nsym; /* init for next operator */ for (j = 0 ; j !=4 ; ++j) for (k = 0; k !=4 ; ++k) rot[(((nsym << 2) +k) << 2) +j] = 0.0f; rot[(((nsym << 2) +3) << 2) +3] = 1.0f; } } /* reset for next cycle */ col = 3; value = 0.0f; } /* tidy up */ if (value) rot[(((nsym << 2) + col) << 2) + nops] = value; return (no_recip)? -(++nsym) : ++nsym ; } static int NumberToSymop(char **symchs_begin, int spacegroup) { int i,nsym; const int n_byt_symop = 80; CCP4SPG *spg; spg=ccp4spg_load_by_ccp4_num(spacegroup); nsym = spg->nsymop; /* * We allocate an extra byte for a null. * ccp4_cmap_set_symop assumes that the buffer is null terminated for strlen. * We really need a strnlen function */ if ( !(*symchs_begin = (char *) malloc( 1 + nsym * n_byt_symop * sizeof(char)) )) { ccp4_signal( CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_AllocFail), "Write_Sym_Gp",NULL); return (-1); } memset(*symchs_begin,' ',n_byt_symop*nsym); (*symchs_begin)[n_byt_symop*nsym] = 0; for (i = 0; i < nsym; ++i) rotandtrn_to_symop(*symchs_begin+n_byt_symop*i, (*symchs_begin)+n_byt_symop*(i+1), spg->symop[i]); ccp4spg_free(&spg); return nsym; } /** * mwrhdl: * @iunit: (I) map stream number, internal to program * @mapnam: (I) logical file name * @title: (I) map title * @nsecs: (I) number of sections in the map * @iuvw:[3] (I) fast, medium and slow axes storage * @mxyz:[3] (I) sampling intervals along X, Y, Z * @nw1: (I) number of first section * @nu1: (I) start of section on fast axis * @nu2: (I) end of section on fast axis * @nv1: (I) start of section on medium axis * @nv2: (I) end of section on medium axis * @cell:[6] (I) cell dimensions in Angstroms and degrees * @lspgrp: (I) space group number * @lmode: (I) map data mode =0, FORTRAN logical*1 (char) * =1, FORTRAN integer*2 (short?) * =2, FORTRAN real*4 (float) * =3, complex integer*2 * =4, complex real * =5, ==0 * =10, bricked byte map * * description: Function used to open an output map file and * set up the header information. The actual header * is only written to the file when the file is closed */ FORTRAN_SUBR ( MWRHDL, mwrhdl, (int *iunit, const fpstr mapnam, const fpstr title, int *nsecs, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode, fpstr_size_t mapnam_len, fpstr_size_t title_len), (int *iunit, const fpstr mapnam, const fpstr title, int *nsecs, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode), (int *iunit, const fpstr mapnam, fpstr_size_t mapnam_len, const fpstr title, fpstr_size_t title_len, int *nsecs, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode)) { char *temp_title, *temp_map, *file; int ii; temp_map = ccp4_FtoCString(FTN_STR(mapnam), FTN_LEN(mapnam) ); temp_title = ccp4_FtoCString(FTN_STR(title), FTN_LEN(title) ); if (!(file = getenv(temp_map))) file = temp_map; if ( (ii = SetChannel()) == MAXFILES ) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MWRHDL", NULL); ioArray[ii] = (IOConvMap *) malloc(sizeof(IOConvMap)); if ((ioArray[ii]->mapfile = (CMMFile *) ccp4_cmap_open(file, O_WRONLY)) == NULL) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_CantOpenFile), "MWRHDL", NULL); ioArray[ii]->ipc = *iunit; ioArray[ii]->logname = strdup(temp_map); ioArrayPrint(ioArray[ii]); HeaderInit(ioArray[ii]->mapfile, temp_title, *lmode, iuvw, mxyz, *nu1, *nu2, *nv1, *nv2, *nw1, *nsecs, *lspgrp, cell, 0.0f, 0.0f, 0.0, 0.0); /* Record for FORTRAN API */ last_Write = ii; free(temp_title); free(temp_map); } FORTRAN_SUBR ( CCP4_MAP_WRITE_OPEN_HEADER_BY_NAME, ccp4_map_write_open_header_by_name, (int *iunit, const fpstr mapnam, const fpstr title, int *nsecs, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode, fpstr_size_t mapnam_len, fpstr_size_t title_len), (int *iunit, const fpstr mapnam, const fpstr title, int *nsecs, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode), (int *iunit, const fpstr mapnam, fpstr_size_t mapnam_len, const fpstr title, fpstr_size_t title_len, int *nsecs, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode)) { char *temp_title, *temp_map, *file; int ii; temp_map = ccp4_FtoCString(FTN_STR(mapnam), FTN_LEN(mapnam) ); temp_title = ccp4_FtoCString(FTN_STR(title), FTN_LEN(title) ); if (!(file = getenv(temp_map))) file = temp_map; if ( (ii = SetChannel()) == MAXFILES ) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MWRHDL", NULL); ioArray[ii] = (IOConvMap *) malloc(sizeof(IOConvMap)); if ((ioArray[ii]->mapfile = (CMMFile *) ccp4_cmap_open(file, O_WRONLY)) == NULL) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_CantOpenFile), "MWRHDL", NULL); ioArray[ii]->ipc = *iunit; ioArray[ii]->logname = strdup(temp_map); ioArrayPrint(ioArray[ii]); HeaderInit(ioArray[ii]->mapfile, temp_title, *lmode, iuvw, mxyz, *nu1, *nu2, *nv1, *nv2, *nw1, *nsecs, *lspgrp, cell, 0.0f, 0.0f, 0.0, 0.0); /* Record for FORTRAN API */ last_Write = ii; free(temp_title); free(temp_map); } /** * mwrhdr: * @iunit: (I) map stream number, internal to program * @title: (I) map title * @nsecs: (I) number of sections in the map * @iuvw:[3] (I) fast, medium and slow axes storage * @mxyz:[3] (I) sampling intervals along X, Y, Z * @nw1: (I) number of first section * @nu1: (I) start of section on fast axis * @nu2: (I) end of section on fast axis * @nv1: (I) start of section on medium axis * @nv2: (I) end of section on medium axis * @cell:[6] (I) cell dimensions in Angstroms and degrees * @lspgrp: (I) space group number * @lmode: (I) map data mode =0, FORTRAN logical*1 (char) * =1, FORTRAN integer*2 (short?) * =2, FORTRAN real*4 (float) * =3, complex integer*2 * =4, complex real * =5, ==0 * =10, bricked byte map * * description: similar to mwrhdl(). Difference is that the logical filename for * the map is assumed to be %MAPOUT. */ FORTRAN_SUBR ( MWRHDR, mwrhdr, (int *iunit, const fpstr title, int *nsecs, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode, fpstr_size_t title_len), (int *iunit, const fpstr title, int *nsecs, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode), (int *iunit, const fpstr title, fpstr_size_t title_len, int *nsecs, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode)) { char *temp_title, *file; int ii; temp_title = ccp4_FtoCString(FTN_STR(title), FTN_LEN(title) ); if (!(file = getenv("MAPOUT"))) file = "MAPOUT"; if ( (ii = SetChannel()) == MAXFILES ) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MWRHDR", NULL); ioArray[ii] = (IOConvMap *) malloc(sizeof(IOConvMap)); if ((ioArray[ii]->mapfile = ccp4_cmap_open(file, O_WRONLY)) == NULL) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_CantOpenFile), "MWRHDR", NULL); ioArray[ii]->ipc = *iunit; ioArray[ii]->logname = strdup("MAPOUT"); ioArrayPrint(ioArray[ii]); HeaderInit(ioArray[ii]->mapfile, temp_title, *lmode, iuvw, mxyz, *nu1, *nu2, *nv1, *nv2, *nw1, *nsecs, *lspgrp, cell, 0.0f, 0.0f, 0.0, 0.0); free(temp_title); /* record for FORTRAN API */ last_Write = ii; } FORTRAN_SUBR ( CCP4_MAP_WRITE_OPEN_HEADER_BY_ID, ccp4_map_write_open_header_by_id, (int *iunit, const fpstr title, int *nsecs, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode, fpstr_size_t title_len), (int *iunit, const fpstr title, int *nsecs, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode), (int *iunit, const fpstr title, fpstr_size_t title_len, int *nsecs, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode)) /* see MWRHDR */ { char *temp_title, *file; int ii; temp_title = ccp4_FtoCString(FTN_STR(title), FTN_LEN(title) ); if (!(file = getenv("MAPOUT"))) file = "MAPOUT"; if ( (ii = SetChannel()) == MAXFILES ) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MWRHDR", NULL); ioArray[ii] = (IOConvMap *) malloc(sizeof(IOConvMap)); if ((ioArray[ii]->mapfile = ccp4_cmap_open(file, O_WRONLY)) == NULL) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_CantOpenFile), "MWRHDL", NULL); ioArray[ii]->ipc = *iunit; ioArray[ii]->logname = strdup("MAPOUT"); ioArrayPrint(ioArray[ii]); HeaderInit(ioArray[ii]->mapfile, temp_title, *lmode, iuvw, mxyz, *nu1, *nu2, *nv1, *nv2, *nw1, *nsecs, *lspgrp, cell, 0.0f, 0.0f, 0.0, 0.0); free(temp_title); /* record for FORTRAN API */ last_Write = ii; } /** * mrdhds: * @iunit: (I) stream number * @mapnam: (I) logical (file) name * @title: (O) title of map (char[80]) * @nsec: (O) number of sections * @iuvw:[3] (O) fast, medium, slow axes (1,2,3 for X,Y,Z) * @mxyz:[3] (O) sampling intervals along x,y,z * @nw1: (O) first section number * @nu1: (O) limits on fast axis * @nu2: (O) * @nv1: (O) limits on medium axis * @nv2: (O) * @cell:[6] (O) cell dimensions in Angstroms and degrees * @lspgrp: (O) space-group number * @lmode: (O) map data mode * @rhmin: (O) minimum density * @rhmax: (O) maximum density * @rhmean: (O) mean densitry * @rhrms: (O) rms deviation form mean density * @ifail: (I/O) On input: =0, stop on error * =1, return on error * On output: =-1, error * =unchanged, no error * @iprint: (I) =0, silent * =other, print info * * description: Read map header from stream @iunit, logical name in @mapnam */ FORTRAN_SUBR( MRDHDS, mrdhds, (int *iunit, const fpstr mapnam, fpstr title, int *nsec, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode, float *rhmin, float *rhmax, float *rhmean, float *rhrms, int *ifail, int *iprint, fpstr_size_t mapnam_len, fpstr_size_t title_len), (int *iunit, const fpstr mapnam, fpstr title, int *nsec, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode, float *rhmin, float *rhmax, float *rhmean, float * rhrms, int *ifail, int *iprint), (int *iunit, const fpstr mapnam, fpstr_size_t mapnam_len, fpstr title, fpstr_size_t title_len, int *nsec, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode, float *rhmin, float *rhmax, float *rhmean, float * rhrms, int *ifail, int *iprint)) { char temp_title[81], *temp_map, *file; int ii; double drhmean,drhrms; temp_map = ccp4_FtoCString(FTN_STR(mapnam), FTN_LEN(mapnam) ); if (!(file = getenv(temp_map))) file = temp_map; if ( (ii = SetChannel()) == MAXFILES ) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MRDHDS", NULL); ioArray[ii] = (IOConvMap *) malloc(sizeof(IOConvMap)); if ((ioArray[ii]->mapfile = ccp4_cmap_open(file, O_RDONLY)) == NULL) { if (!(*ifail)) { ccp4_signal(CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_CantOpenFile), "MRDHDS", NULL); ccperror(1,"Error in opening input map file."); } else { ccp4_signal(CMAP_ERRNO(CMERR_CantOpenFile), "MRDHDS", NULL); *ifail = -1; return ; } } ioArray[ii]->ipc = *iunit; ioArray[ii]->logname = strdup(temp_map); HeaderReturn(ioArray[ii]->mapfile, temp_title, lmode, iuvw, mxyz, nu1, nu2, nv1, nv2, nw1, nsec, lspgrp, cell, rhmin, rhmax, &drhmean, &drhrms); *rhmean = (float) drhmean; *rhrms = (float) drhrms; if (*iprint != 0) { ioArrayPrint(ioArray[ii]); HeaderPrint(ioArray[ii]->mapfile); } strncpy(title,temp_title,MIN(strlen(temp_title),FTN_LEN(title))); /* free malloc'ed memory */ free(temp_map); /* record for FORTRAN API */ last_Read = ii; } FORTRAN_SUBR( CCP4_MAP_READ_OPEN_HEADER_CHECK, ccp4_map_read_open_header_check, (int *iunit, const fpstr mapnam, fpstr title, int *nsec, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode, float *rhmin, float *rhmax, float *rhmean, float *rhrms, int *ifail, int *iprint, fpstr_size_t mapnam_len, fpstr_size_t title_len), (int *iunit, const fpstr mapnam, fpstr title, int *nsec, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode, float *rhmin, float *rhmax, float *rhmean, float * rhrms, int *ifail, int *iprint), (int *iunit, const fpstr mapnam, fpstr_size_t mapnam_len, fpstr title, fpstr_size_t title_len, int *nsec, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode, float *rhmin, float *rhmax, float *rhmean, float * rhrms, int *ifail, int *iprint)) /* see MRDHDS */ { char temp_title[81], *temp_map, *file; int ii; double drhmean,drhrms; temp_map = ccp4_FtoCString(FTN_STR(mapnam), FTN_LEN(mapnam) ); if (!(file = getenv(temp_map))) file = temp_map; if ( (ii = SetChannel()) == MAXFILES ) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MRDHDS", NULL); ioArray[ii] = (IOConvMap *) malloc(sizeof(IOConvMap)); if ((ioArray[ii]->mapfile = ccp4_cmap_open(file, O_RDONLY)) == NULL) { if (!(*ifail)) { ccp4_signal(CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_CantOpenFile), "MRDHDS", NULL); ccperror(1,"Error in opening input map file."); } else { ccp4_signal(CMAP_ERRNO(CMERR_CantOpenFile), "MRDHDS", NULL); *ifail = -1; return; } } ioArray[ii]->ipc = *iunit; ioArray[ii]->logname = strdup(temp_map); HeaderReturn(ioArray[ii]->mapfile, temp_title, lmode, iuvw, mxyz, nu1, nu2, nv1, nv2, nw1, nsec, lspgrp, cell, rhmin, rhmax, &drhmean, &drhrms); *rhmean = (float) drhmean; *rhrms = (float) drhrms; if (*iprint != 0) { ioArrayPrint(ioArray[ii]); HeaderPrint(ioArray[ii]->mapfile); } strncpy(title,temp_title,MIN(strlen(temp_title),FTN_LEN(title))); /* free malloc'ed memory */ free(temp_map); /* record for FORTRAN API */ last_Read = ii; } /** * mrdhdr: * @iunit: (I) stream number * @mapnam: (I) logical (file) name * @title: (O) title of map (char[80]) * @nsec: (O) number of sections * @iuvw:[3] (O) fast, medium, slow axes (1,2,3 for X,Y,Z) * @mxyz:[3] (O) sampling intervals along x,y,z * @nw1: (O) first section number * @nu1: (O) limits on fast axis * @nu2: (O) * @nv1: (O) limits on medium axis * @nv2: (0) * @cell:[6] (O) cell dimensions in Angstroms and degrees * @lspgrp: (O) space-group number * @lmode: (O) map data mode * @rhmin: (O) minimum density * @rhmax: (O) maximum density * @rhmean: (O) mean density deviation * @rhrms: (O) rms deviation * * description: Read map header from stream @iunit, logical name in @mapnam. * Differs from mrdhds() in that there are no IFAIL nor IPRINT */ FORTRAN_SUBR( MRDHDR, mrdhdr, (int *iunit, const fpstr mapnam, fpstr title, int *nsec, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode, float *rhmin, float *rhmax, float *rhmean, float *rhrms, fpstr_size_t mapnam_len, fpstr_size_t title_len), (int *iunit, const fpstr mapnam, fpstr title, int *nsec, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode, float *rhmin, float *rhmax, float *rhmean, float * rhrms), (int *iunit, const fpstr mapnam, fpstr_size_t mapnam_len, fpstr title, fpstr_size_t title_len, int *nsec, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode, float *rhmin, float *rhmax, float *rhmean, float * rhrms)) { char temp_title[81], *temp_map, *file; int ii; double drhmean,drhrms; temp_map = ccp4_FtoCString(FTN_STR(mapnam), FTN_LEN(mapnam) ); if (!(file = getenv(temp_map))) file = temp_map; if ( (ii = SetChannel()) == MAXFILES ) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MRDHDR", NULL); ioArray[ii] = (IOConvMap *) malloc(sizeof(IOConvMap)); if ((ioArray[ii]->mapfile = ccp4_cmap_open(file, O_RDONLY)) == NULL) { ccp4_signal(CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_CantOpenFile), "MRDHDR", NULL); ccperror(1,"Error in opening input map file."); } ioArray[ii]->ipc = *iunit; ioArray[ii]->logname = strdup(temp_map); HeaderReturn(ioArray[ii]->mapfile, temp_title, lmode, iuvw, mxyz, nu1, nu2, nv1, nv2, nw1, nsec, lspgrp, cell, rhmin, rhmax, &drhmean, &drhrms); *rhmean = (float) drhmean; *rhrms = (float) drhrms; ioArrayPrint(ioArray[ii]); HeaderPrint(ioArray[ii]->mapfile); ccp4_CtoFString(FTN_STR(title),FTN_LEN(title),temp_title); /* free malloc'ed memory */ free(temp_map); /* record for FORTRAN API */ last_Read = ii; } FORTRAN_SUBR( CCP4_MAP_READ_OPEN_HEADER, ccp4_map_read_open_header, (int *iunit, const fpstr mapnam, fpstr title, int *nsec, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode, float *rhmin, float *rhmax, float *rhmean, float *rhrms, fpstr_size_t mapnam_len, fpstr_size_t title_len), (int *iunit, const fpstr mapnam, fpstr title, int *nsec, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode, float *rhmin, float *rhmax, float *rhmean, float * rhrms), (int *iunit, const fpstr mapnam, fpstr_size_t mapnam_len, fpstr title, fpstr_size_t title_len, int *nsec, int iuvw[3], int mxyz[3], int *nw1, int *nu1, int *nu2, int *nv1, int *nv2, float cell[6], int *lspgrp, int *lmode, float *rhmin, float *rhmax, float *rhmean, float * rhrms)) /* see MRDHDR */ { char temp_title[81], *temp_map, *file; int ii; double drhmean,drhrms; temp_map = ccp4_FtoCString(FTN_STR(mapnam), FTN_LEN(mapnam) ); if (!(file = getenv(temp_map))) file = temp_map; if ( (ii = SetChannel()) == MAXFILES ) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MRDHDR", NULL); ioArray[ii] = (IOConvMap *) malloc(sizeof(IOConvMap)); if ((ioArray[ii]->mapfile = ccp4_cmap_open(file, O_RDONLY)) == NULL) { ccp4_signal(CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_CantOpenFile), "MRDHDR", NULL); ccperror(1,"Error in opening input map file."); } ioArray[ii]->ipc = *iunit; ioArray[ii]->logname = strdup(temp_map); HeaderReturn(ioArray[ii]->mapfile, temp_title, lmode, iuvw, mxyz, nu1, nu2, nv1, nv2, nw1, nsec, lspgrp, cell, rhmin, rhmax, &drhmean, &drhrms); *rhmean = (float) drhmean; *rhrms = (float) drhrms; ioArrayPrint(ioArray[ii]); HeaderPrint(ioArray[ii]->mapfile); strncpy(title,temp_title,MIN(strlen(temp_title),FTN_LEN(title))); /* free malloc'ed memory */ free(temp_map); /* record for FORTRAN API */ last_Read = ii; } /** * @iunit: (I) stream number * * description: Write out header to mapfile on stream @iunit, and close it. */ FORTRAN_SUBR( MWCLOSE, mwclose, (int *iunit), (int *iunit), (int *iunit)) { int ii; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MWCLOSE", NULL); ccp4_cmap_close(ioArray[ii]->mapfile); /* record for FORTRAN API */ free(ioArray[ii]->logname); free(ioArray[ii]); ioArray[ii] = NULL; last_Write = -1; } FORTRAN_SUBR( CCP4_MAP_WRITE_CLOSE_AUTO, ccp4_map_write_close_auto, (int *iunit), (int *iunit), (int *iunit)) /* see MWCLOSE */ { int ii; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MWCLOSE", NULL); ccp4_cmap_close(ioArray[ii]->mapfile); /* record for FORTRAN API */ free(ioArray[ii]->logname); free(ioArray[ii]); ioArray[ii] = NULL; last_Write = -1; } /** * mclose: * @iunit: (I) map stream number * @min: (I) minimum density in map * @max: (I) maximum density in map * @mean: (I) the sum of all the densities in the map. * (this will be divided internally by the number * of points in the map to give the mean density * which is then stored) * @rms (I) the sum of the squares of the density values in the * map (this will be used internally to calculate the * rms deviation from the mean value, which is then * stored) * * description: Write out header to map file on stream @iunit, and close it. */ FORTRAN_SUBR( MCLOSE, mclose, (int *iunit, float *min, float *max, float *mean, float *rms), (int *iunit, float *min, float *max, float *mean, float *rms), (int *iunit, float *min, float *max, float *mean, float *rms)) { int ii; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MCLOSE", NULL); ccp4_cmap_closemode(ioArray[ii]->mapfile, 2); ccp4_cmap_set_mapstats(ioArray[ii]->mapfile,*min, *max, (double) *mean, (double) *rms); ccp4_cmap_close(ioArray[ii]->mapfile); /* record for FORTRAN API */ if (ioArray[ii]->logname) free(ioArray[ii]->logname); free(ioArray[ii]); ioArray[ii] = NULL; last_Write = -1; } FORTRAN_SUBR( CCP4_MAP_WRITE_CLOSE_USER_SUM, ccp4_map_write_close_user_sum, (int *iunit, float *min, float *max, float *mean, float *rms), (int *iunit, float *min, float *max, float *mean, float *rms), (int *iunit, float *min, float *max, float *mean, float *rms)) /* see MCLOSE */ { int ii; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MCLOSE", NULL); ccp4_cmap_closemode(ioArray[ii]->mapfile, 2); ccp4_cmap_set_mapstats(ioArray[ii]->mapfile,*min, *max, (double) *mean, (double) *rms); ccp4_cmap_close(ioArray[ii]->mapfile); /* record for FORTRAN API */ if (ioArray[ii]->logname) free(ioArray[ii]->logname); free(ioArray[ii]); ioArray[ii] = NULL; last_Write = -1; } /** * mclosc: * @iunit: (I) map stream number * @min: (I) minimum density in map * @max: (I) maximum density in map * @mean: (I) the sum of all the densities in the map. * @rms: (I) the sum of the squares of the density values in the map * * description: Write out header to map file on stream @iunit, and close it. * This routine differs from mwclose() in that the @mean and @rms * values are written directly. */ FORTRAN_SUBR( MCLOSC, mclosc, (int *iunit, float *min, float *max, float *mean, float *rms), (int *iunit, float *min, float *max, float *mean, float *rms), (int *iunit, float *min, float *max, float *mean, float *rms)) { int ii; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MCLOSC", NULL); ccp4_cmap_closemode(ioArray[ii]->mapfile, 1); ccp4_cmap_set_mapstats(ioArray[ii]->mapfile,*min, *max, (double) *mean, (double) *rms); ccp4_cmap_close(ioArray[ii]->mapfile); /* record for FORTRAN API */ if (ioArray[ii]->logname) free(ioArray[ii]->logname); free(ioArray[ii]); ioArray[ii] = NULL; last_Write = -1; } FORTRAN_SUBR( CCP4_MAP_WRITE_CLOSE_USER_MEAN, ccp4_map_write_close_user_mean, (int *iunit, float *min, float *max, float *mean, float *rms), (int *iunit, float *min, float *max, float *mean, float *rms), (int *iunit, float *min, float *max, float *mean, float *rms)) /* see MCLOSC */ { int ii; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MCLOSC", NULL); ccp4_cmap_closemode(ioArray[ii]->mapfile, 1); ccp4_cmap_set_mapstats(ioArray[ii]->mapfile,*min, *max, (double) *mean, (double) *rms); ccp4_cmap_close(ioArray[ii]->mapfile); /* record for FORTRAN API */ if (ioArray[ii]->logname) free(ioArray[ii]->logname); free(ioArray[ii]); ioArray[ii] = NULL; last_Write = -1; } /** * mrclos: * @iunit: (I) map stream number */ FORTRAN_SUBR( MRCLOS, mrclos, (int *iunit), (int *iunit), (int *iunit)) { int ii; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MRCLOS", NULL); ccp4_cmap_close(ioArray[ii]->mapfile); /* record for FORTRAN API */ if (ioArray[ii]->logname) free(ioArray[ii]->logname); free(ioArray[ii]); ioArray[ii] = NULL; last_Read = -1; } FORTRAN_SUBR( CCP4_MAP_READ_CLOSE, ccp4_map_read_close, (int *iunit), (int *iunit), (int *iunit)) /* see MRCLOS */ { int ii; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MRCLOS", NULL); ccp4_cmap_close(ioArray[ii]->mapfile); /* record for FORTRAN API */ if (ioArray[ii]->logname) free(ioArray[ii]->logname); free(ioArray[ii]); ioArray[ii] = NULL; last_Read = -1; } /** * msywrt: * @iunit: (I) map stream number * @nsym: (I) number of symmetry operators * @rot: (I) rotation/translation matrices (4,4,nsym) * * description: Write @nsym symmetry operators to iostream @iunit. * note: the symmetry operators are written to the file one per * line, and may have a different format to those in the * SYMOP file (uses symtr3()). */ FORTRAN_SUBR( MSYWRT, msywrt, (int *iunit, int *nsym, float *rot), (int *iunit, int *nsym, float *rot), (int *iunit, int *nsym, float *rot)) { int ii,i,j,k; float rsm[4][4]; char buffer[80]; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MSYWRT", NULL); for (i=0; i != *nsym ; ++i) { memset(buffer,' ',80U); for (j=0; j != 4 ; ++j) for (k=0; k != 4 ; ++k) rsm[j][k] = *(rot+16*i+j+4*k); mat4_to_symop(buffer,&buffer[80],(const float (*)[4])rsm); ccp4_cmap_set_symop(ioArray[ii]->mapfile,buffer); } /* record for FORTRAN API */ last_Write = ii; } FORTRAN_SUBR( CCP4_MAP_WRITE_SYMM_MATRIX, ccp4_map_write_symm_matrix, (int *iunit, int *nsym, float *rot), (int *iunit, int *nsym, float *rot), (int *iunit, int *nsym, float *rot)) /* see MSYWRT */ { int ii,i,j,k; float rsm[4][4]; char buffer[80]; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MSYWRT", NULL); for (i=0; i != *nsym ; ++i) { memset(buffer,' ',80U); for (j=0; j != 4 ; ++j) for (k=0; k != 4 ; ++k) rsm[j][k] = *(rot+16*i+j+4*k); mat4_to_symop(buffer,&buffer[80],(const float (*)[4])rsm); ccp4_cmap_set_symop(ioArray[ii]->mapfile,buffer); } /* record for FORTRAN API */ last_Write = ii; } /** * msymop: * @iunit: (I) map stream number * @nsym: (O) number of symmetry operations * @rot: (O) rotation/translation matrices (4,4,nsym) * * description: Read symmetry operations from the mapfile on iostream @iunit * (after call to mrdhdr() to initialise header). * Convert to matrices and vectors. * Note: when no symops are found the I matrix is return (P1 spacegroup) */ FORTRAN_SUBR( MSYMOP, msymop, (int *iunit, int *nsym, float *rot), (int *iunit, int *nsym, float *rot), (int *iunit, int *nsym, float *rot)) { char buffer[81]; int nsymop, ii, i, result= 0; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MSYMOP", NULL); nsymop = ccp4_cmap_num_symop(ioArray[ii]->mapfile); ccp4_cmap_seek_symop(ioArray[ii]->mapfile, 0, SEEK_SET); for (i=0 ; i != nsymop ; ++i) { ccp4_cmap_get_symop(ioArray[ii]->mapfile,buffer); ccp4printf(1," Symmetry operations: %s\n",buffer); result += SymopToFMat4(buffer,&buffer[80],rot+16*i); } if ( result != nsymop) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_ReadFail), "MSYMOP", NULL); else if ( nsymop == 0) { /* if no symops are found, what to return? here the I matrix */ int k; ccp4printf(0,"WARNING: 0 dimension symops, returning P1\n"); memset(rot, '\0', 16*sizeof(float)); for (k = 0; k !=4 ; k++) rot[(k<<2)+k] = 1.0f; *nsym = 1; } else *nsym = result; /* record for FORTRAN API */ last_Read = ii; } FORTRAN_SUBR( CCP4_MAP_READ_SYMM_MATRIX, ccp4_map_read_symm_matrix, (int *iunit, int *nsym, float *rot), (int *iunit, int *nsym, float *rot), (int *iunit, int *nsym, float *rot)) /* see MSYMOP */ { char buffer[81]; int ii, i, nsymop, result= 0; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MSYMOP", NULL); nsymop = ccp4_cmap_num_symop(ioArray[ii]->mapfile); ccp4_cmap_seek_symop(ioArray[ii]->mapfile, 0, SEEK_SET); for (i=0 ; i != nsymop ; ++i) { ccp4_cmap_get_symop(ioArray[ii]->mapfile,buffer); ccp4printf(1," Symmetry operations: %s",buffer); result += SymopToFMat4(buffer,&buffer[80],rot+16*i); } if ( result != nsymop) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_ReadFail), "MSYMOP", NULL); else if ( nsymop == 0) { /* if no symops are found, what to return? here the I matrix */ int k; ccp4printf(0,"WARNING: 0 dimension symops, returning P1\n"); memset(rot, '\0', 16*sizeof(float)); for (k = 0; k !=4 ; k++) rot[(k<<2)+k] = 1.0f; *nsym = 1; } else *nsym = result; /* record for FORTRAN API */ last_Read = ii; } /** * msyput: * @sunit: (I) iostream to use for SYMOP library (ignored) * @spacegroup:(I) spacegroup number * @iunit: (I) map stream number * * description: Copy symmetry operators to map * stream @iunit, leaving space at head of file for n_byt_hdr items * of header records. */ FORTRAN_SUBR( MSYPUT, msyput, (int *sunit, int *spacegroup, int *iunit), (int *sunit, int *spacegroup, int *iunit), (int *sunit, int *spacegroup, int *iunit)) { const int n_byt_symop=80; int i,ii, nsymop; char *symops, *buffer; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MSYPUT", NULL); nsymop = NumberToSymop(&symops,*spacegroup); for (i=0, buffer=symops ; i != nsymop ; ++i, buffer += n_byt_symop) { ccp4_cmap_set_symop(ioArray[ii]->mapfile,buffer); } free(symops); /* record for FORTRAN API */ last_Write = ii; } FORTRAN_SUBR( CCP4_MAP_WRITE_SPGNAME, ccp4_map_write_spgname, (int *sunit, int *spacegroup, int *iunit), (int *sunit, int *spacegroup, int *iunit), (int *sunit, int *spacegroup, int *iunit)) /* see MSYPUT */ { const int n_byt_symop=80; int i,ii, nsymop; char *symops, *buffer; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MSYPUT", NULL); nsymop = NumberToSymop(&symops,*spacegroup); for (i=0, buffer=symops ; i != nsymop ; ++i, buffer += n_byt_symop) { ccp4_cmap_set_symop(ioArray[ii]->mapfile,buffer); } /* record for FORTRAN API */ last_Write = ii; } /** * mspew: * @iunit: (I) stream number * @section: (I) array holding the map section. * * description: Write whole map section to stream @iunit. * This routine is only suitable if the whole map section is to * be written. */ FORTRAN_SUBR( MSPEW, mspew, (int *iunit, float *section), (int *iunit, float *section), (int *iunit, float *section)) { int ii; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MSPEW", NULL); if (ccp4_cmap_write_section(ioArray[ii]->mapfile, section) == 0) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_WriteFail), "MSPEW", NULL); /* record for FORTRAN API */ last_Write = ii; } FORTRAN_SUBR( CCP4_MAP_WRITE_ALL_SECTION, ccp4_map_write_all_section, (int *iunit, float *section), (int *iunit, float *section), (int *iunit, float *section)) /* see MSPEW */ { int ii; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MSPEW", NULL); if (ccp4_cmap_write_section(ioArray[ii]->mapfile, section) == 0) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_WriteFail), "MSPEW", NULL); /* record for FORTRAN API */ last_Write = ii; } /** * mgulp: * @iunit: (I) map stream number * @section: (O) array containing section of map data read from file * @ier: (O) error code =0, OK * =non-zero, error or end-of-file * * description: Read next whole map section from stream @iunit to array @section. * @section is returned in the same mode as in the file, no data * conversion is performed. */ FORTRAN_SUBR( MGULP, mgulp, (int *iunit, float *section, int *ier), (int *iunit, float *section, int *ier), (int *iunit, float *section, int *ier)) { int ii; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MGULP", NULL); if ( (*ier = ccp4_cmap_read_section(ioArray[ii]->mapfile,section)) == 0) ccp4_signal(CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_ReadFail), "MGULP", NULL); *ier = (*ier == 0) ? -1 : 0; /* record for FORTRAN API */ last_Read = ii; } FORTRAN_SUBR( CCP4_MAP_READ_WHOLE_SECTION_AS_MODE, ccp4_map_read_whole_section_as_mode, (int *iunit, float *section, int *ier), (int *iunit, float *section, int *ier), (int *iunit, float *section, int *ier)) /* see MGULP */ { int ii; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MGULP", NULL); if ((*ier = ccp4_cmap_read_section(ioArray[ii]->mapfile, section)) == 0) ccp4_signal(CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_ReadFail), "MGULP", NULL); *ier = (*ier >= 0) ? 0 : -1; /* record for FORTRAN API */ last_Read = ii; } /** * mwrsec: * @iunit: (I) map stream number * @section: (I) array holding the map section * @mu: (I) the number of points along the whole fast axis * @mv: (I) the number of points along the whole medium axis * @iu1: (I) the starting array index along the fast axis * @iu2: (I) the final array index along the fast axis * @iv1: (I) the starting array index along the medium axis * @iv2: (I) the final array index along the medium axis * * description: Write part of map section X(MU,MV) to stream @iunit * * Note: the C routine this calls uses the C/C++ convention of * [) rather than []. Therefore the the @iu1 and @iv1 values * are decremented by 1, and the @iu2 and @iv2 are unchanged * as paramenters (C uses 0 offset for arrays). Also note * that the dimensions are fall the storage array, not the map. */ FORTRAN_SUBR( MWRSEC, mwrsec, (int *iunit, float *section, int *mu, int *mv, int *iu1, int *iu2, int *iv1, int *iv2), (int *iunit, float *section, int *mu, int *mv, int *iu1, int *iu2, int *iv1, int *iv2), (int *iunit, float *section, int *mu, int *mv, int *iu1, int *iu2, int *iv1, int *iv2)) { int ii, jj; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MWRSEC", NULL); for (jj=*iv1-1 ; jj != *iv2; jj++) if (ccp4_cmap_write_data(ioArray[ii]->mapfile, section+jj*(*mu)+(*iu1)-1, (*iu2)-(*iu1)+1) == -1) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_WriteFail), "MWRSEC", NULL); /* record for FORTRAN API */ last_Write = ii; } FORTRAN_SUBR( CCP4_MAP_WRITE_PART_SECTION, ccp4_map_write_part_section, (int *iunit, float *section, int *mu, int *mv, int *iu1, int *iu2, int *iv1, int *iv2), (int *iunit, float *section, int *mu, int *mv, int *iu1, int *iu2, int *iv1, int *iv2), (int *iunit, float *section, int *mu, int *mv, int *iu1, int *iu2, int *iv1, int *iv2)) /* see MWRSEC */ { int ii, jj; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MWRSEC", NULL); for (jj=*iv1-1 ; jj != *iv2; jj++) if (ccp4_cmap_write_data(ioArray[ii]->mapfile, section+jj*(*mu)+(*iu1)-1, (*iu2)-(*iu1)+1) == -1) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_WriteFail), "MWRSEC", NULL); /* record for FORTRAN API */ last_Write = ii; } /** * mrdlin: * @iunit: (I) stream number * @line: (O) array to contain the line of data from the map * @ier: (O) error flag =0, OK * =non-zero, error or EOF. * * description: Read the next line of the map from stream @iunit into array * @line. @line is returned in the same mode as in file, * no data conversion is performed. */ FORTRAN_SUBR( MRDLIN, mrdlin, (int *iunit, float *line, int *ier), (int *iunit, float *line, int *ier), (int *iunit, float *line, int *ier)) { int ii; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MRDLIN", NULL); if ((*ier = ccp4_cmap_read_row(ioArray[ii]->mapfile, line)) == 0) ccp4_signal(CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_ReadFail), "MRDLIN", NULL); *ier = (*ier == 0) ? -1 : 0; /* record for FORTRAN API */ last_Read = ii; } FORTRAN_SUBR( CCP4_MAP_READ_LINE_AS_MODE, ccp4_map_read_line_as_mode, (int *iunit, float *line, int *ier), (int *iunit, float *line, int *ier), (int *iunit, float *line, int *ier)) /* see MRDLIN */ { int ii; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MRDLIN", NULL); if ((*ier = ccp4_cmap_read_row(ioArray[ii]->mapfile, line)) == 0) ccp4_signal(CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_ReadFail), "MRDLIN", NULL); *ier = (*ier == 0) ? -1 : 0; /* record for FORTRAN API */ last_Read = ii; } /** * mgulpr: * @iunit: (I) stream number * @section: (O) array to contain the section read from the file * @ier: (O) error flag =0, OK * =non-zero, error or EOF. * * description: Read next whole map section from stream @iunit to array @section. * For map modes other than 2, the array is converted to real; for * complex maps (MODE = 3 or 4) the complex amplitude is evaluated. */ FORTRAN_SUBR( MGULPR, mgulpr, (int *iunit, float *section, int *ier), (int *iunit, float *section, int *ier), (int *iunit, float *section, int *ier)) { uint8 *buffer; int ii, read_dim, mode; int nstore[3]; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MGULPR", NULL); ccp4_cmap_get_dim(ioArray[ii]->mapfile,nstore); read_dim = nstore[0]*nstore[1]; if ((mode = ccp4_cmap_get_datamode( ioArray[ii]->mapfile)) == FLOAT32) buffer = (uint8 *) section; else buffer = (uint8 *) calloc(read_dim , ccp4_file_itemsize((*ioArray[ii]->mapfile).stream)); if (ccp4_cmap_read_section(ioArray[ii]->mapfile, buffer) == 0) { ccp4_signal(CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_ReadFail), "MGULPR", NULL); *ier = -1; } else { ccp4_utils_translate_mode_float(section, buffer, read_dim, mode); *ier = 0; } /* record for FORTRAN API */ last_Read = ii; } FORTRAN_SUBR( CCP4_MAP_READ_WHOLE_SECT_AS_REAL, ccp4_map_read_whole_sect_as_real, (int *iunit, float *section, int *ier), (int *iunit, float *section, int *ier), (int *iunit, float *section, int *ier)) /* see MGULPR */ { uint8 *buffer; int ii, read_dim, mode; int nstore[3]; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MGULPR", NULL); ccp4_cmap_get_dim(ioArray[ii]->mapfile,nstore); read_dim = nstore[0]*nstore[1]; if ((mode = ccp4_cmap_get_datamode( ioArray[ii]->mapfile)) == FLOAT32) buffer = (uint8 *) section; else buffer = (uint8 *) calloc(read_dim , ccp4_file_itemsize((*ioArray[ii]->mapfile).stream)); if (ccp4_cmap_read_section(ioArray[ii]->mapfile, buffer) == 0) { ccp4_signal(CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_ReadFail), "MGULPR", NULL); *ier = -1; } else { ccp4_utils_translate_mode_float(section, buffer, read_dim, mode); *ier = 0; } /* record for FORTRAN API */ last_Read = ii; } /** * mposn: * @iunit: (I) stream number * @sec: (I) position the input map before @sec * * description: Sets the position in the map file so that the next section * to be read is @sec. Note: the section number is input. */ FORTRAN_SUBR( MPOSN, mposn, (int *iunit, int *sec), (int *iunit, int *sec), (int *iunit, int *sec)) { int ii, origin[3], section; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MPOSN", NULL); ccp4_cmap_get_origin(ioArray[ii]->mapfile,origin); section = *sec - origin[2]; if ( ccp4_cmap_seek_section(ioArray[ii]->mapfile, section, SEEK_SET) == -1) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_SeekFail), "MPOSN", NULL); /* record for FORTRAN API */ last_Read = ii; } FORTRAN_SUBR( CCP4_MAP_READ_POSITION_SELECTION, ccp4_map_read_position_selection, (int *iunit, int *sec), (int *iunit, int *sec), (int *iunit, int *sec)) /* see MPOSN */ { int ii, origin[3], section; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MPOSN", NULL); ccp4_cmap_get_origin(ioArray[ii]->mapfile,origin); section = *sec - origin[2]; if ( ccp4_cmap_seek_section(ioArray[ii]->mapfile, section, SEEK_SET) == -1) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_SeekFail), "MPOSN", NULL); /* record for FORTRAN API */ last_Read = ii; } /** * mposnw: * @iunit: (I) stream number * @sec: (I) position the input map before @sec * * description: Sets the position in the map file so that the next section * to be written is @sec (used to overwrite) */ FORTRAN_SUBR( MPOSNW, mposnw, (int *iunit, int *sec), (int *iunit, int *sec), (int *iunit, int *sec)) { int ii, origin[3], section; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MPOSNW", NULL); ccp4_cmap_get_origin(ioArray[ii]->mapfile,origin); section = *sec - origin[2]; if ( ccp4_cmap_seek_section(ioArray[ii]->mapfile, section, SEEK_SET) == -1) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_SeekFail), "MPOSNW", NULL); /* record for FORTRAN API */ last_Write = ii; } FORTRAN_SUBR( CCP4_MAP_WRITE_POSITION_SECTION, ccp4_map_write_position_section, (int *iunit, int *sec), (int *iunit, int *sec), (int *iunit, int *sec)) /* see MPOSNW */ { int ii, origin[3], section; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MPOSNW", NULL); ccp4_cmap_get_origin(ioArray[ii]->mapfile,origin); section = *sec - origin[2]; if ( ccp4_cmap_seek_section(ioArray[ii]->mapfile, section, SEEK_SET) == -1) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_SeekFail), "MPOSNW", NULL); /* record for FORTRAN API */ last_Write = ii; } /** * msycpy: * @iunit: (I) input map stream number * @ounit: (I) output map stream number * * description: Copy symmetry data from file on iostream @iunit to the file * on iostream @iunit (after header initialisation calls). */ FORTRAN_SUBR( MSYCPY, msycpy, (int *iunit, int *ounit), (int *iunit, int *ounit), (int *iunit, int *ounit)) { int ii,jj, nsym, i; char symop[81]; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile || (jj = GetChannel(*ounit)) == MAXFILES || !ioArray[jj]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MSYCPY", NULL); nsym = ccp4_cmap_num_symop(ioArray[ii]->mapfile); ccp4_cmap_seek_symop(ioArray[ii]->mapfile,0,SEEK_SET); for (i=0; i != nsym ; ++i) { if (ccp4_cmap_get_symop(ioArray[ii]->mapfile, symop) == 1) ccp4_cmap_set_symop(ioArray[jj]->mapfile, symop); } last_Read = ii; last_Write = jj; } FORTRAN_SUBR( CCP4_MAP_COPY_SYMMETRY, ccp4_map_copy_symmetry, (int *iunit, int *ounit), (int *iunit, int *ounit), (int *iunit, int *ounit)) /* see MSYCPY */ { int ii,jj, nsym, i; char symop[81]; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile || (jj = GetChannel(*ounit)) == MAXFILES || !ioArray[jj]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "MSYCPY", NULL); nsym = ccp4_cmap_num_symop(ioArray[ii]->mapfile); ccp4_cmap_seek_symop(ioArray[ii]->mapfile,0,SEEK_SET); for (i=0; i != nsym ; ++i) { if (ccp4_cmap_get_symop(ioArray[ii]->mapfile, symop) == 1) ccp4_cmap_set_symop(ioArray[jj]->mapfile, symop); } last_Read = ii; last_Write = jj; } /** * mttrep: * @label: (I) new label (max. length 80 chars) * @posn: (I) position for label in label array. * * description: Replace label at @posn in header of current output mapfile. * Maximum of 10 labels, is exceeded overwrites final label. */ FORTRAN_SUBR( MTTREP, mttrep, (const fpstr label, int *posn, fpstr_size_t label_len), (const fpstr label, int *posn), (const fpstr label, fpstr_size_t label_len, int *posn)) { char *temp_label; /* no output map, nothing to do */ if (last_Write == -1) return; temp_label = ccp4_FtoCString(FTN_STR(label), FTN_LEN(label)); ccp4_cmap_set_label(ioArray[last_Write]->mapfile, temp_label,*posn-1 ); free(temp_label); } FORTRAN_SUBR( CCP4_MAP_WRITE_REPLACE_TITLE, ccp4_map_write_replace_title, (const fpstr label, int *posn, fpstr_size_t label_len), (const fpstr label, int *posn), (const fpstr label, fpstr_size_t label_len, int *posn)) /* see MTTREP */ { char *temp_label; /* no output map, nothing to do */ if (last_Write == -1) return; temp_label = ccp4_FtoCString(FTN_STR(label), FTN_LEN(label)); ccp4_cmap_set_label(ioArray[last_Write]->mapfile, temp_label,*posn-1 ); free(temp_label); } /** * mttcpy: * @label: (I) new label * * description: Copy all labels from the current input map to the header (struct) * of the current output mapfile, adding @label to the end. */ FORTRAN_SUBR( MTTCPY, mttcpy, (const fpstr label, fpstr_size_t label_len), (const fpstr label), (const fpstr label, fpstr_size_t label_len)) { char *temp_label; int nlabel=0,i; /* no output map, nothing to do */ if (last_Write == -1) return; temp_label = ccp4_FtoCString(FTN_STR(label), FTN_LEN(label)); if (last_Read != -1) { nlabel = ccp4_cmap_number_label(ioArray[last_Read]->mapfile); for (i=0 ; i != nlabel ; ++i) ccp4_cmap_set_label(ioArray[last_Write]->mapfile, ccp4_cmap_get_label(ioArray[last_Read]->mapfile,i), i); } ccp4_cmap_set_label(ioArray[last_Write]->mapfile, temp_label,nlabel); free(temp_label); } FORTRAN_SUBR( CCP4_MAP_COPY_TITLE, ccp4_map_copy_title, (const fpstr label, fpstr_size_t label_len), (const fpstr label), (const fpstr label, fpstr_size_t label_len)) /* see MTTCPY */ { char *temp_label; int nlabel=0,i; /* no output map, nothing to do */ if (last_Write == -1) return; temp_label = ccp4_FtoCString(FTN_STR(label), FTN_LEN(label)); if (last_Read != -1) { nlabel = ccp4_cmap_number_label(ioArray[last_Read]->mapfile); for (i=0 ; i != nlabel ; ++i) ccp4_cmap_set_label(ioArray[last_Write]->mapfile, ccp4_cmap_get_label(ioArray[last_Read]->mapfile,i), i); } ccp4_cmap_set_label(ioArray[last_Write]->mapfile, temp_label,nlabel); free(temp_label); } /** * mskput: * @skew_rot: (I) skew rotation matrix S[3][3];S11, S12, etc * @skew_trans (I) skew translation vector T[3] * * description: Put skew transformation in header struct of current output * mapfile. * Note: Phil Evans (9/93), should probably not use this routine. */ FORTRAN_SUBR( MSKPUT, mskput, (float *skew_rot, float *skew_trans), (float *skew_rot, float *skew_trans), (float *skew_rot, float *skew_trans)) { ccp4_cmap_set_mask(ioArray[last_Write]->mapfile, skew_rot, skew_trans); } FORTRAN_SUBR( CCP4_MAP_WRITE_SKEW_INFO, ccp4_map_write_skew_info, (float *skew_rot, float *skew_trans), (float *skew_rot, float *skew_trans), (float *skew_rot, float *skew_trans)) /* see MSKPUT */ { ccp4_cmap_set_mask(ioArray[last_Write]->mapfile, skew_rot, skew_trans); } /** * mskget: * @skew_rot: (I) skew rotation matrix S[3][3]; S11, S12, etc * @skew_trans (I) skew translation vector T[3] * returns: value of skew_flag. * * description: Get skew translation from input header struct. * Skew transformation form orthogonal atom fram to orthogonal map frame: * Xo(map) = S*(Xo(atoms)-T) */ FORTRAN_FUN(int, MSKGET, mskget, (float *mask_rot, float *mask_trans), (float *mask_rot, float *mask_trans), (float *mask_rot, float *mask_trans)) { return ccp4_cmap_get_mask(ioArray[last_Read]->mapfile, mask_rot, mask_trans); } /** * ccp4_map_write_section_header: * @iunit: (I) stream number * @section: (I) array holding the map section. * @local_hdr: (I) local header information * * description: Write whole map section to stream @iunit. * This routine is only suitable if the whole map section is to * be written. */ FORTRAN_SUBR( CCP4_MAP_WRITE_SECTION_HEADER, ccp4_map_write_section_header, (int *iunit, float *section, const fpstr local_hdr, fpstr_size_t local_hdr_len), (int *iunit, float *section, const fpstr local_hdr), (int *iunit, float *section, const fpstr local_hdr, fpstr_size_t local_hdr_len)) { int ii; char *tmp_label; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "CCP4_MAP_WRITE_SECTION_HEADER", NULL); if (ccp4_cmap_write_section(ioArray[ii]->mapfile, section) == EOF) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_WriteFail), "CCP4_MAP_WRITE_SECTION_HEADER", NULL); tmp_label = ccp4_FtoCString(FTN_STR(local_hdr), FTN_LEN(local_hdr) ); if (ccp4_cmap_write_section_header(ioArray[ii]->mapfile, tmp_label) == EOF) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_WriteFail), "CCP4_MAP_WRITE_SECTION_HEADER", NULL); free(tmp_label); /* record for FORTRAN API */ last_Write = ii; } /** * ccp4_map_read_section_header: * @iunit: (I) map stream number * @section: (O) array containing section of map data read from file * @local_hdr: (O) local header information as CHAR array * @ier: (O) error code =0, OK * =non-zero, error or end-of-file * * description: Read next whole map section from stream @iunit to array @section. * @section is returned in the same mode as in the file, no data * conversion is performed. */ FORTRAN_SUBR( CCP4_MAP_READ_SECTION_HEADER, ccp4_map_read_section_header, (int *iunit, float *section, const fpstr local_hdr, int *ier, fpstr_size_t local_hdr_len), (int *iunit, float *section, const fpstr local_hdr, int *ier), (int *iunit, float *section, const fpstr local_hdr, fpstr_size_t local_hdr_len, int *ier)) { int ii; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "CCP4_MAP_READ_SECTION_HEADER", NULL); if ((*ier = ccp4_cmap_read_section(ioArray[ii]->mapfile,section)) == -1) { ccp4_signal(CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_ReadFail), "CCP4_MAP_READ_SECTION_HEADER", NULL); return; } if ((*ier = ccp4_cmap_read_section_header(ioArray[ii]->mapfile, FTN_STR(local_hdr))) == EOF) ccp4_signal(CCP4_ERRLEVEL(3) | CMAP_ERRNO(CMERR_ReadFail), "CCP4_MAP_READ_SECTION_HEADER", NULL); *ier = (*ier >= 0) ? 0 : -1; /* record for FORTRAN API */ last_Read = ii; } FORTRAN_SUBR( CCP4_MAP_SET_LOCAL_HEADER, ccp4_map_set_local_header, (int *iunit, int *size), (int *iunit, int *size), (int *iunit, int *size)) { int ii; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "CCP4_MAP_SET_LOCAL_HEADER", NULL); ccp4_cmap_set_local_header(ioArray[ii]->mapfile, (size_t)*size); } FORTRAN_SUBR( CCP4_MAP_GET_LOCAL_HEADER, ccp4_map_get_local_header, (int *iunit, int *size), (int *iunit, int *size), (int *iunit, int *size)) { int ii; if ( (ii = GetChannel(*iunit)) == MAXFILES || !ioArray[ii]->mapfile) ccp4_signal(CCP4_ERRLEVEL(4) | CMAP_ERRNO(CMERR_NoChannel), "CCP4_MAP_GET_LOCAL_HEADER", NULL); *size = (int) ccp4_cmap_get_local_header(ioArray[ii]->mapfile); } /** * mwfnam: * @logname: (O) logical name of last open file * * description: Returns the logical name for the last written to file */ FORTRAN_SUBR( MWFNAM, mwfnam, (fpstr logname, fpstr_size_t logname_len), (fpstr logname), (fpstr logname, fpstr_size_t logname_len)) { strncpy(FTN_STR(logname), ioArray[last_Write]->logname, MIN(strlen(ioArray[last_Write]->logname), FTN_LEN(logname))); } FORTRAN_SUBR( CCP4_MAP_GET_LAST_WRITE_FILENAME, ccp4_map_get_last_write_filename, (fpstr logname, fpstr_size_t logname_len), (fpstr logname), (fpstr logname, fpstr_size_t logname_len)) /*see MWFNAM */ { strncpy(FTN_STR(logname), ioArray[last_Write]->logname, MIN(strlen(ioArray[last_Write]->logname), FTN_LEN(logname))); } /** * mwfnam: * @logname: (O) logical name of last open file * * description: Returns the logical name for the last read from file */ FORTRAN_SUBR( MRFNAM, mrfnam, (fpstr logname, fpstr_size_t logname_len), (fpstr logname), (fpstr logname, fpstr_size_t logname_len)) { strncpy(FTN_STR(logname), ioArray[last_Read]->logname, MIN(strlen(ioArray[last_Read]->logname), FTN_LEN(logname))); } FORTRAN_SUBR( CCP4_MAP_GET_LAST_READ_FILENAME, ccp4_map_get_last_read_filename, (fpstr logname, fpstr_size_t logname_len), (fpstr logname), (fpstr logname, fpstr_size_t logname_len)) /* see MRFNAM */ { strncpy(FTN_STR(logname), ioArray[last_Read]->logname, MIN(strlen(ioArray[last_Read]->logname), FTN_LEN(logname))); } /** * mstmst: * @map: (O) "MAP " * * description: Set integer MAP to string "MAP " */ FORTRAN_SUBR( MSTMST, mstmst, (int *map), (int *map), (int *map)) { strncpy((char *)map, "MAP ", strlen("MAP ")); } /** * modecv: * @output: (O) output array contain translated reals * @input: (I) pre-translation array (read from file) * @number: (I) number of elements to be translated * @mode: (I) storage mode, = 0 FORTRAN character (uint8) * = 1 FORTRAN I*2 (uint16) * = 3 complex short * = 4 complex real (uint32) * * description: Convert @number items form @input (mode @mode) to float in @output. */ FORTRAN_SUBR( MODECV, modecv, (float *output, float *input, int *number, int *mode), (float *output, float *input, int *number, int *mode), (float *output, float *input, int *number, int *mode)) { if( (ccp4_utils_translate_mode_float(output, (void *)input, *number, *mode) != *number)) ccp4_signal(CMAP_ERRNO(CMERR_ParamError),"MODECV", NULL); } FORTRAN_SUBR( CCP4_MAP_MODE_TO_REAL, ccp4_map_mode_to_real, (float *output, float *input, int *number, int *mode), (float *output, float *input, int *number, int *mode), (float *output, float *input, int *number, int *mode)) /* see MODECV */ { if( (ccp4_utils_translate_mode_float(output, (void *)input, *number, *mode) != *number)) ccp4_signal(CMAP_ERRNO(CMERR_ParamError),"MODECV", NULL); } FORTRAN_FUN(int, NBYTXX, nbytxx, (int *nwords), (int *nwords),(int *nwords)) /* Returns the number of machine items in NWORDS words (floats) */ { return ((int) sizeof(float)) * (*nwords); } libccp4-8.0.0/fortran/cmtzlib_f.c0000644000000000000000000027605214242731033014770 0ustar 00000000000000/* cmtzlib_f.c: Fortran API to CMTZlib Copyright (C) 2001 CCLRC, Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @page cmtz_f_page Fortran API to CMTZ * * @section cmtz_f_file_list File list
  • cmtzlib_f.c
* @section cmtz_f_overview Overview This library consists of a set of wrappers to the CMTZ library giving the same API as the original mtzlib.f For details of the API, see the original documentation. This document covers some peculiarities of the C implementation. * @section cmtz_f_batches Batches Batch headers are held as a linked list in the MTZ data structure. Upon reading an MTZ file, a list is created holding the all the batch headers from the input file (mtz->n_orig_bat holds the number read in). LRBATS will return a list of batch numbers. LRBAT can be used to read the batch headers one at a time.

LWBAT can be used to write new or updated batch headers. Updated batch headers are in fact added as new batch headers at the end of the list of input batch headers. This mimics the use of RBATW/CBATW in the Fortran routines. There are problems with this approach, and this may be re-implemented. */ /** @file cmtzlib_f.c * * @brief Fortran API for input, output and manipulation of MTZ files. * * @author Martyn Winn */ /*#define FORTRAN_CALL_DEBUG 1*/ #if defined (FORTRAN_CALL_DEBUG) # define CMTZLIB_DEBUG(x) x #else # define CMTZLIB_DEBUG(x) #endif #include #include #include #include #include "ccp4_fortran.h" #include "ccp4_utils.h" #include "cmtzlib.h" #include "csymlib.h" #include "ccp4_program.h" #include "ccp4_general.h" /* rcsid[] = "$Id$" */ #define MFILES 9 #define MAXSYM 192 static int cmtz_in_memory = 0; static int rlun[MFILES] = {0}; static int wlun[MFILES] = {0}; static MTZ *mtzdata[MFILES] = {NULL}; /* cf. Eugene's channel for rwbrook */ static char fileout[MFILES][MAXFLEN]; static int irref[MFILES] = {0}; static int iwref[MFILES] = {0}; static char user_label_in[MFILES][MCOLUMNS][2][31]; static char user_label_out[MFILES][MCOLUMNS][2][31]; static MTZCOL *collookup[MFILES][MCOLUMNS]; static MTZCOL *collookup_out[MFILES][MCOLUMNS]; static int sortorder[MFILES][5] = {{0}}; static int logmss[MFILES][MCOLUMNS]; static int ndatmss[MFILES]; static MTZBAT *rbat[MFILES]; static int nbatw[MFILES] = {0}; static double coefhkl[MFILES][6] = {{0}}; /* MVS defaults to int and doesn't like it */ #ifdef _MSC_VER #if (CALL_LIKE_MVS==2) void CCP4H_INIT_LIB(int *ihtml, int *isumm); #else void __stdcall CCP4H_INIT_LIB(int *ihtml, int *isumm); #endif #else FORTRAN_SUBR(CCP4H_INIT_LIB, ccp4h_init_lib, (int *ihtml,int *isumm), (int *ihtml,int *summ), (int *ihtml,int *isumm)); #endif void MtzMemTidy(void) { int i; /* free any existing Mtz struct */ for (i = 0; i < MFILES; ++i) if (mtzdata[i]) MtzFree(mtzdata[i]); } /* Utility function for checking subroutine input rwmode = 1 for read file, 2 for write file ... */ int MtzCheckSubInput(const int mindx, const char *subname, const int rwmode) { if (mindx <= 0 || mindx > MFILES) { printf("Error in %s: mindx %d out of range!\n",subname,mindx); return 1; } if (rwmode == 1 && rlun[mindx-1] == 0) { printf("Error in %s: mindx %d not open for read!\n",subname,mindx); return 1; } if (rwmode == 2 && wlun[mindx-1] == 0) { printf("Error in %s: mindx %d not open for write!\n",subname,mindx); return 1; } return 0; } /** Mainly for backwards compatibility. The only thing it does now is * initialise the html/summary stuff, which is usually done by CCPFYP * anyway. */ FORTRAN_SUBR ( MTZINI, mtzini, ( ), ( ), ( )) { int ihtml, isumm; /* initialise html/summary stuff */ ihtml = 0; isumm = 0; FORTRAN_CALL (CCP4H_INIT_LIB, ccp4h_init_lib, (&ihtml,&isumm), (&ihtml,&isumm), (&ihtml,&isumm)); return; } /** Open an MTZ file for reading. This is a wrapper to MtzGet. * @param mindx (I) MTZ file index * @param filename (I) Filename to open (real or logical) * @param iprint (I) Specifies how much header information to print out. * @param ifail (O) Returns 0 if successful, non-zero otherwise. */ FORTRAN_SUBR ( LROPEN, lropen, (int *mindx, fpstr filename, int *iprint, int *ifail, fpstr_size_t filename_len), (int *mindx, fpstr filename, int *iprint, int *ifail), (int *mindx, fpstr filename, fpstr_size_t filename_len, int *iprint, int *ifail)) { int i; char *temp_name, *fullfilename; CMTZLIB_DEBUG(puts("CMTZLIB_F: LROPEN");) *ifail = 0; if (*mindx <= 0 || *mindx > MFILES) { printf("Error: mindx out of range!\n"); *ifail = 1; return; } if (rlun[*mindx-1] != 0) { printf("Error: mindx already used for read!\n"); *ifail = 1; return; } if (wlun[*mindx-1] != 0) { printf("Error: mindx already used for write!\n"); *ifail = 1; return; } temp_name = ccp4_FtoCString(FTN_STR(filename), FTN_LEN(filename)); if (getenv(temp_name) != NULL) { fullfilename = strdup(getenv(temp_name)); } else { fullfilename = strdup(temp_name); } /* In-memory mode not tested so well. Think it might be broken for some Fortran programs, e.g. when generating extra reflections. */ if (getenv("CMTZ_IN_MEMORY")) cmtz_in_memory = 1; /* open file and read into memory */ mtzdata[*mindx-1] = MtzGet(temp_name,cmtz_in_memory); if (mtzdata[*mindx-1] == NULL) { printf("Error: failed to open file for read!\n"); *ifail = -1; free(fullfilename); free(temp_name); return; } rlun[*mindx-1] = 1; /* Make sure HKL are in base dataset */ MtzAssignHKLtoBase(mtzdata[*mindx-1]); ccp4printf(1,"\n OPENED INPUT MTZ FILE \n"); ccp4printf(1," Logical Name: %s Filename: %s \n\n",temp_name,fullfilename); if (*iprint > 0) ccp4_lhprt(mtzdata[*mindx-1], *iprint); /* set some control variables for Fortran calls */ irref[*mindx-1] = 0; if (mtzdata[*mindx-1]->n_orig_bat > 0) rbat[*mindx-1] = mtzdata[*mindx-1]->batch; /* calculate hkl coefficients and store in coefhkl */ for (i = 0; i < mtzdata[*mindx-1]->nxtal; ++i) if (mtzdata[*mindx-1]->xtal[i]->cell[0] > 0.001) { MtzHklcoeffs(mtzdata[*mindx-1]->xtal[i]->cell, coefhkl[*mindx-1]); break; } free(fullfilename); free(temp_name); } /** Get title from MTZ file opened for read. * @param mindx (I) MTZ file index * @param ftitle (O) Title. * @param len (O) Length of returned title. */ FORTRAN_SUBR ( LRTITL, lrtitl, (int *mindx, fpstr ftitle, int *len, fpstr_size_t ftitle_len), (int *mindx, fpstr ftitle, int *len), (int *mindx, fpstr ftitle, fpstr_size_t ftitle_len, int *len)) { char temp_title[71]; CMTZLIB_DEBUG(puts("CMTZLIB_F: LRTITL");) if (MtzCheckSubInput(*mindx,"LRTITL",1)) return; *len = ccp4_lrtitl(mtzdata[*mindx-1], temp_title); ccp4_CtoFString(FTN_STR(ftitle),FTN_LEN(ftitle),temp_title); } /** Get history lines from MTZ file opened for read. * @param mindx (I) MTZ file index * @param hstrng (O) Array of history lines. * @param nlines (I/O) On input, dimension of hstrng, i.e. the maximum * number of history lines to be returned. On output, actual number of * history lines returned. */ FORTRAN_SUBR ( LRHIST, lrhist, (int *mindx, fpstr hstrng, int *nlines, fpstr_size_t hstrng_len), (int *mindx, fpstr hstrng, int *nlines), (int *mindx, fpstr hstrng, fpstr_size_t hstrng_len, int *nlines)) { CMTZLIB_DEBUG(puts("CMTZLIB_F: LRHIST");) if (MtzCheckSubInput(*mindx,"LRHIST",1)) return; *nlines = ccp4_lrhist(mtzdata[*mindx-1], hstrng, *nlines); } /** Fortran wrapper to functions returning number of reflections, columns * and ranges. In fact, it returns current values on MINDX rather than * those of the input file. * @param mindx MTZ file index * @param versnx (O) MTZ version. This is the version of the current library rather than that of the input file. If these differ, a warning will have been issued by LROPEN/MtzGet. * @param ncolx Number of columns. * @param nreflx Number of reflections. * @param ranges Array of column ranges. */ FORTRAN_SUBR ( LRINFO, lrinfo, (int *mindx, fpstr versnx, int *ncolx, int *nreflx, float *ranges, fpstr_size_t versnx_len), (int *mindx, fpstr versnx, int *ncolx, int *nreflx, float *ranges), (int *mindx, fpstr versnx, fpstr_size_t versnx_len, int *ncolx, int *nreflx, float *ranges)) { int i,j,k,iarray; char mtzvers[20]; CMTZLIB_DEBUG(puts("CMTZLIB_F: LRINFO");) if (MtzCheckSubInput(*mindx,"LRINFO",1)) return; sprintf(mtzvers,"MTZ:V%d.%d",MTZ_MAJOR_VERSN,MTZ_MINOR_VERSN); ccp4_CtoFString(FTN_STR(versnx),FTN_LEN(versnx),mtzvers); *ncolx = MtzNumActiveCol(mtzdata[*mindx-1]); *nreflx = MtzNref(mtzdata[*mindx-1]); /* get ranges of active columns */ iarray = 0; for (i = 0; i < mtzdata[*mindx-1]->nxtal; ++i) for (j = 0; j < mtzdata[*mindx-1]->xtal[i]->nset; ++j) for (k = 0; k < mtzdata[*mindx-1]->xtal[i]->set[j]->ncol; ++k) if (mtzdata[*mindx-1]->xtal[i]->set[j]->col[k]->active) { ranges[iarray*2] = mtzdata[*mindx-1]->xtal[i]->set[j]->col[k]->min; ranges[iarray*2+1] = mtzdata[*mindx-1]->xtal[i]->set[j]->col[k]->max; iarray++; } } /** Fortran wrapper to function returning number of columns read in * from input file. * @param mindx MTZ file index * @param ncolx Number of columns. */ FORTRAN_SUBR ( LRNCOL, lrncol, (int *mindx, int *ncolx), (int *mindx, int *ncolx), (int *mindx, int *ncolx)) { CMTZLIB_DEBUG(puts("CMTZLIB_F: LRNCOL");) if (MtzCheckSubInput(*mindx,"LRNCOL",1)) return; *ncolx = MtzNumSourceCol(mtzdata[*mindx-1]); } /** Returns the current reflection number from an * MTZ file opened for read. Files are normally read sequentially, * the number returned is the number of the *NEXT* reflection * record to be read. If you are going to jump about the file * with LRSEEK then use this to record the current position before * you start, so that it can be restored afterwards, if required. * @param mindx MTZ file index * @param nreflx the reflection record number of the next reflection to be read */ FORTRAN_SUBR ( LRNREF, lrnref, (int *mindx, int *nreflx), (int *mindx, int *nreflx), (int *mindx, int *nreflx)) { CMTZLIB_DEBUG(puts("CMTZLIB_F: LRNREF");) if (MtzCheckSubInput(*mindx,"LRNREF",1)) return; *nreflx = irref[*mindx-1] + 1; } /* Fortran wrapper for ccp4_lrsort */ FORTRAN_SUBR ( LRSORT, lrsort, (int *mindx, int sortx[5]), (int *mindx, int sortx[5]), (int *mindx, int sortx[5])) { CMTZLIB_DEBUG(puts("CMTZLIB_F: LRSORT");) if (MtzCheckSubInput(*mindx,"LRSORT",1)) return; ccp4_lrsort(mtzdata[*mindx-1], sortx); } /** Fortran wrapper for ccp4_lrbats. * May be called for non-multirecord file, just to check there are * no batches. * @param mindx MTZ file index * @param nbatx Number of batches found. * @param batchx Array of batch numbers. */ FORTRAN_SUBR ( LRBATS, lrbats, (int *mindx, int *nbatx, int batchx[]), (int *mindx, int *nbatx, int batchx[]), (int *mindx, int *nbatx, int batchx[])) { CMTZLIB_DEBUG(puts("CMTZLIB_F: LRBATS");) if (MtzCheckSubInput(*mindx,"LRBATS",1)) return; ccp4_lrbats(mtzdata[*mindx-1], nbatx, batchx); } /* Fortran wrapper for MtzListColumn */ FORTRAN_SUBR ( LRCLAB, lrclab, (int *mindx, fpstr clabs, fpstr ctyps, int *ncol, fpstr_size_t clabs_len, fpstr_size_t ctyps_len), (int *mindx, fpstr clabs, fpstr ctyps, int *ncol), (int *mindx, fpstr clabs, fpstr_size_t clabs_len, fpstr ctyps, fpstr_size_t ctyps_len, int *ncol)) { int i,j,k; char cclabs[MCOLUMNS][31]={{0}}, cctyps[MCOLUMNS][3]={{0}}; int ccsetid[MCOLUMNS]; CMTZLIB_DEBUG(puts("CMTZLIB_F: LRCLAB");) if (MtzCheckSubInput(*mindx,"LRCLAB",1)) return; *ncol = MtzListInputColumn(mtzdata[*mindx-1], cclabs, cctyps, ccsetid); for (i = 0; i < *ncol; ++i) { for (j = 0; j < clabs_len; ++j) { if (cclabs[i][j] == '\0') { for (k = j; k < clabs_len; ++k) { clabs[clabs_len*i+k] = ' '; } break; } else { clabs[clabs_len*i+j] = cclabs[i][j]; } } } for (i = 0; i < *ncol; ++i) { for (j = 0; j < ctyps_len; ++j) { if (cctyps[i][j] == '\0') { for (k = j; k < ctyps_len; ++k) { ctyps[ctyps_len*i+k] = ' '; } break; } else { ctyps[ctyps_len*i+j] = cctyps[i][j]; } } } } /* Fortran wrapper for MtzListColumn */ FORTRAN_SUBR ( LRCLID, lrclid, (int *mindx, int csetid[], int *ncol), (int *mindx, int csetid[], int *ncol), (int *mindx, int csetid[], int *ncol)) { char cclabs[MCOLUMNS][31]={{0}}, cctyps[MCOLUMNS][3]={{0}}; CMTZLIB_DEBUG(puts("CMTZLIB_F: LRCLID");) if (MtzCheckSubInput(*mindx,"LRCLID",1)) return; *ncol = MtzListInputColumn(mtzdata[*mindx-1], cclabs, cctyps, csetid); } /** Return the nominal cell dimensions of the MTZ structure. In * fact, these are the cell dimensions of the 1st crystal in the * MTZ structure. It is better to use the cell dimensions of the * correct crystal, as obtained from LRIDX. * @param mindx (I) MTZ file index * @param cell (O) Cell dimensions. */ FORTRAN_SUBR ( LRCELL, lrcell, (int *mindx, float cell[]), (int *mindx, float cell[]), (int *mindx, float cell[])) { CMTZLIB_DEBUG(puts("CMTZLIB_F: LRCELL");) if (MtzCheckSubInput(*mindx,"LRCELL",1)) return; ccp4_lrcell(mtzdata[*mindx-1]->xtal[0], cell); } /** Return the overall resolution limits of the MTZ structure. * These are the widest limits over all crystals present. * @param mindx (I) MTZ file index * @param minres (O) minimum resolution * @param maxres (O) maximum resolution */ FORTRAN_SUBR ( LRRSOL, lrrsol, (int *mindx, float *minres, float *maxres), (int *mindx, float *minres, float *maxres), (int *mindx, float *minres, float *maxres)) { CMTZLIB_DEBUG(puts("CMTZLIB_F: LRRSOL");) if (MtzCheckSubInput(*mindx,"LRRSOL",1)) return; MtzResLimits(mtzdata[*mindx-1], minres, maxres); } /* Fortran wrapper for ccp4_lrsymi_c As for LRSYMI, but with confidence flag added. */ FORTRAN_SUBR ( LRSYMI_C, lrsymi_c, (int *mindx, int *nsympx, fpstr ltypex, int *nspgrx, fpstr spgrnx, fpstr pgnamx, fpstr spgconf, fpstr_size_t ltypex_len, fpstr_size_t spgrnx_len, fpstr_size_t pgnamx_len, fpstr_size_t spgconf_len), (int *mindx, int *nsympx, fpstr ltypex, int *nspgrx, fpstr spgrnx, fpstr pgnamx, fpstr spgconf), (int *mindx, int *nsympx, fpstr ltypex, fpstr_size_t ltypex_len, int *nspgrx, fpstr spgrnx, fpstr_size_t spgrnx_len, fpstr pgnamx, fpstr_size_t pgnamx_len, fpstr spgconf, fpstr_size_t spgconf_len)) { char ltypex_temp[2],spgrnx_temp[MAXSPGNAMELENGTH+1], pgnamx_temp[11], spgconf_temp[2]; CMTZLIB_DEBUG(puts("CMTZLIB_F: LRSYMI_C");) if (MtzCheckSubInput(*mindx,"LRSYMI_C",1)) return; ccp4_lrsymi_c(mtzdata[*mindx-1], nsympx, ltypex_temp, nspgrx, spgrnx_temp, pgnamx_temp, spgconf_temp); ccp4_CtoFString(FTN_STR(ltypex),FTN_LEN(ltypex),ltypex_temp); ccp4_CtoFString(FTN_STR(spgrnx),FTN_LEN(spgrnx),spgrnx_temp); ccp4_CtoFString(FTN_STR(pgnamx),FTN_LEN(pgnamx),pgnamx_temp); ccp4_CtoFString(FTN_STR(spgconf),FTN_LEN(spgconf),spgconf_temp); } /* Fortran wrapper for ccp4_lrsymi */ FORTRAN_SUBR ( LRSYMI, lrsymi, (int *mindx, int *nsympx, fpstr ltypex, int *nspgrx, fpstr spgrnx, fpstr pgnamx, fpstr_size_t ltypex_len, fpstr_size_t spgrnx_len, fpstr_size_t pgnamx_len), (int *mindx, int *nsympx, fpstr ltypex, int *nspgrx, fpstr spgrnx, fpstr pgnamx), (int *mindx, int *nsympx, fpstr ltypex, fpstr_size_t ltypex_len, int *nspgrx, fpstr spgrnx, fpstr_size_t spgrnx_len, fpstr pgnamx, fpstr_size_t pgnamx_len)) { char ltypex_temp[2],spgrnx_temp[MAXSPGNAMELENGTH+1], pgnamx_temp[11]; CMTZLIB_DEBUG(puts("CMTZLIB_F: LRSYMI");) if (MtzCheckSubInput(*mindx,"LRSYMI",1)) return; ccp4_lrsymi(mtzdata[*mindx-1], nsympx, ltypex_temp, nspgrx, spgrnx_temp, pgnamx_temp); ccp4_CtoFString(FTN_STR(ltypex),FTN_LEN(ltypex),ltypex_temp); ccp4_CtoFString(FTN_STR(spgrnx),FTN_LEN(spgrnx),spgrnx_temp); ccp4_CtoFString(FTN_STR(pgnamx),FTN_LEN(pgnamx),pgnamx_temp); } /** Get symmetry matrices from MTZ structure. * @param mindx (I) MTZ file index. * @param nsymx (O) Number of symmetry operators held in MTZ header. * @param rsymx (O) Symmetry operators as 4 x 4 matrices, in the order they * are held in the MTZ header. Each matrix has translations in * elements [3][*]. Note that a Fortran application will reverse * the order of indices. */ FORTRAN_SUBR ( LRSYMM, lrsymm, (int *mindx, int *nsymx, float rsymx[MAXSYM][4][4]), (int *mindx, int *nsymx, float rsymx[MAXSYM][4][4]), (int *mindx, int *nsymx, float rsymx[MAXSYM][4][4])) { int i,j,k; float rsym[MAXSYM][4][4]; CMTZLIB_DEBUG(puts("CMTZLIB_F: LRSYMM");) if (MtzCheckSubInput(*mindx,"LRSYMM",1)) return; ccp4_lrsymm(mtzdata[*mindx-1], nsymx, rsym); /* ccp4_lrsymm returns matrices in C order, so swap here */ for (i = 0; i < *nsymx; ++i) for (j = 0; j < 4; ++j) for (k = 0; k < 4; ++k) rsymx[i][j][k] = rsym[i][k][j]; /* register this spacegroup with csymlib_f */ ccp4spg_register_by_symops(mtzdata[*mindx-1]->mtzsymm.nsym,mtzdata[*mindx-1]->mtzsymm.sym); } /** Fortran wrapper to MtzParseLabin. This matches tokens from the LABIN * line against the program labels supplied by the program. * @param mindx (I) MTZ file index. * @param lsprgi (I) Array of program column labels. These are the column * labels used by the program, as opposed to the column labels in the file. * @param nlprgi (I) Number of input program labels. * @param ntok (I) From Parser: number of tokens on line * @param labin_line (I) From Parser: input line * @param ibeg (I) From Parser: array of starting delimiters for each token * @param iend (I) From Parser: array of ending delimiters for each token */ FORTRAN_SUBR ( LKYIN, lkyin, (const int *mindx, const fpstr lsprgi, const int *nlprgi, const int *ntok, const fpstr labin_line, const int ibeg[], const int iend[], fpstr_size_t lsprgi_len, fpstr_size_t labin_line_len), (const int *mindx, const fpstr lsprgi, const int *nlprgi, const int *ntok, const fpstr labin_line, const int ibeg[], const int iend[]), (const int *mindx, const fpstr lsprgi, fpstr_size_t lsprgi_len, const int *nlprgi, const int *ntok, const fpstr labin_line, fpstr_size_t labin_line_len, const int ibeg[], const int iend[] )) { int i,j; char *label; char *temp_name; CMTZLIB_DEBUG(puts("CMTZLIB_F: LKYIN");) if (*mindx <= 0 || *mindx > MFILES) { printf("Error: mindx out of range!\n"); return; } label = (char *) ccp4_utils_malloc((*nlprgi)*31*sizeof(char)); temp_name = ccp4_FtoCString(FTN_STR(labin_line), FTN_LEN(labin_line)); for (i = 0; i < *nlprgi; ++i) { for (j = 0; j < lsprgi_len; ++j) { if (lsprgi[lsprgi_len*i+j] == ' ') { break; } else { label[i*31+j] = lsprgi[lsprgi_len*i+j]; } } label[i*31+j] = '\0'; } if (MtzParseLabin(temp_name,label,*nlprgi,user_label_in[*mindx-1]) == -1) ccperror(1,"Error in label assignments in LABIN"); free(temp_name); free(label); } /* Fortran wrapper for MtzParseLabin */ FORTRAN_SUBR ( LKYOUT, lkyout, (const int *mindx, const fpstr lsprgo, const int *nlprgo, const int *ntok, const fpstr labin_line, const int ibeg[], const int iend[], fpstr_size_t lsprgo_len, fpstr_size_t labin_line_len), (const int *mindx, const fpstr lsprgo, const int *nlprgo, const int *ntok, const fpstr labin_line, const int ibeg[], const int iend[]), (const int *mindx, const fpstr lsprgo, fpstr_size_t lsprgo_len, const int *nlprgo, const int *ntok, const fpstr labin_line, fpstr_size_t labin_line_len, const int ibeg[], const int iend[] )) { int i,j; char *label; char *temp_name; CMTZLIB_DEBUG(puts("CMTZLIB_F: LKYOUT");) if (*mindx <= 0 || *mindx > MFILES) { printf("Error: mindx out of range!\n"); return; } if (*nlprgo <= 0) { ccp4printf(1,"Warning from LKYOUT: no program output labels !\n"); return; } if (*ntok <= 1) { ccp4printf(1,"Warning from LKYOUT: no arguments to LABOUT !\n"); return; } label = (char *) ccp4_utils_malloc((*nlprgo)*31*sizeof(char)); temp_name = ccp4_FtoCString(FTN_STR(labin_line), FTN_LEN(labin_line)); for (i = 0; i < *nlprgo; ++i) { for (j = 0; j < lsprgo_len; ++j) { if (lsprgo[lsprgo_len*i+j] == ' ') { break; } else { label[i*31+j] = lsprgo[lsprgo_len*i+j]; } } label[i*31+j] = '\0'; } if (MtzParseLabin(temp_name,label,*nlprgo,user_label_out[*mindx-1]) == -1) ccperror(1,"Error in label assignments in LABOUT"); free(temp_name); free(label); } /* Fortran wrapper for MtzParseLabin */ FORTRAN_SUBR ( LKYSET, lkyset, (const fpstr lsprgi, const int *nlprgi, fpstr lsusrj, int kpoint[], const int *itok, const int *ntok, const fpstr labin_line, const int ibeg[], const int iend[], fpstr_size_t lsprgi_len, fpstr_size_t lsusrj_len, fpstr_size_t labin_line_len), (const fpstr lsprgi, const int *nlprgi, fpstr lsusrj, int kpoint[], const int *itok, const int *ntok, const fpstr labin_line, const int ibeg[], const int iend[]), (const fpstr lsprgi, fpstr_size_t lsprgi_len, const int *nlprgi, fpstr lsusrj, fpstr_size_t lsusrj_len, int kpoint[], const int *itok, const int *ntok, const fpstr labin_line, fpstr_size_t labin_line_len, const int ibeg[], const int iend[] )) { int i,j,k; char *label; char *user_lab; char *temp_name; CMTZLIB_DEBUG(puts("CMTZLIB_F: LKYSET");) temp_name = ccp4_FtoCString(FTN_STR(labin_line), FTN_LEN(labin_line)); label = (char *) ccp4_utils_malloc((*nlprgi)*31*sizeof(char)); user_lab = (char *) ccp4_utils_malloc((*nlprgi)*62*sizeof(char)); for (i = 0; i < *nlprgi; ++i) { for (j = 0; j < 30; ++j) { if (lsprgi[lsprgi_len*i+j] == ' ') { break; } else { label[i*31+j] = lsprgi[lsprgi_len*i+j]; } } label[i*31+j] = '\0'; } if (MtzParseLabin(temp_name,label,*nlprgi,user_lab) == -1) ccperror(1,"Error in label assignments in LKYSET"); for (i = 0; i < *nlprgi; ++i) { /* leave kpoint unchanged unless user label exists */ if (strcmp(user_lab+31+i*62,"") != 0) kpoint[i] = -1; for (j = 0; j < lsprgi_len; ++j) { if (user_lab[31+i*62+j] == '\0') { for (k = j; k < lsprgi_len; ++k) { lsusrj[lsprgi_len*i+k] = ' '; } break; } else { lsusrj[lsprgi_len*i+j] = user_lab[31+i*62+j]; } } } free(temp_name); free(label); free(user_lab); } /** Fortran wrapper to ccp4_lrassn. First this updates labels from * user_label_in if set by lkyin, then sets collookup array of pointers * to columns. * @param mindx (I) MTZ file index. * @param lsprgi (I) Array of program column labels. These are the column * labels used by the program, as opposed to the column labels in the file. * @param nlprgi (I) Number of input program labels. * @param lookup (I/O) On input, indicates whether a column is compulsory * or not (-1 = hard compulsory - program will fail if column not found, * 1 = soft compulsory - program will attempt to find column even if not * assigned on LABIN, 0 = optional). On output, gives the index of the * column in the input file. * @param ctprgi (I) Array of column types. */ FORTRAN_SUBR ( LRASSN, lrassn, (const int *mindx, fpstr lsprgi, int *nlprgi, int lookup[], fpstr ctprgi, fpstr_size_t lsprgi_len, fpstr_size_t ctprgi_len), (const int *mindx, fpstr lsprgi, int *nlprgi, int lookup[], fpstr ctprgi), (const int *mindx, fpstr lsprgi, fpstr_size_t lsprgi_len, int *nlprgi, int lookup[], fpstr ctprgi, fpstr_size_t ctprgi_len)) { int i,j,k,l,err; char *label; char *type; MTZCOL **colarray; CMTZLIB_DEBUG(puts("CMTZLIB_F: LRASSN");) err = 0; if (MtzCheckSubInput(*mindx,"LRASSN",1)) return; label = (char *) ccp4_utils_malloc((*nlprgi)*31*sizeof(char)); type = (char *) ccp4_utils_malloc((*nlprgi)*3*sizeof(char)); /* if lkyin has been called, used those labels */ /* for soft and hard compulsory labels, use program labels */ for (i = 0; i < *nlprgi; ++i) { if (strcmp(user_label_in[*mindx-1][i][1],"") != 0) { if (!MtzColLookup(mtzdata[*mindx-1],user_label_in[*mindx-1][i][1])) { printf("Error in LABIN: label %s not found in file!\n",user_label_in[*mindx-1][i][1]); err++; } strcpy(label+i*31,user_label_in[*mindx-1][i][1]); } else if (lookup[i] != 0) { for (j = 0; j < 30; ++j) { if (j == lsprgi_len || lsprgi[lsprgi_len*i+j] == ' ') { break; } else { label[i*31+j] = lsprgi[lsprgi_len*i+j]; } } label[i*31+j] = '\0'; } else { label[i*31] = '\0'; } } /* Exit on error */ if (err) { ccperror(1,"Error in label assignments in LABIN"); } for (i = 0; i < *nlprgi; ++i) { for (j = 0; j < 2; ++j) { if (j == ctprgi_len || ctprgi[ctprgi_len*i+j] == ' ') { break; } else { type[i*3+j] = ctprgi[ctprgi_len*i+j]; } } type[i*3+j] = '\0'; } colarray = ccp4_lrassn(mtzdata[*mindx-1],label,*nlprgi,type); for (l = 0; l < *nlprgi; ++l) { collookup[*mindx-1][l] = colarray[l]; } /* Set maximum number of columns to read. This is used in LRREFF and LRREFM */ ndatmss[*mindx-1] = *nlprgi; for (l = 0; l < *nlprgi; ++l) { /* Loop over all columns */ for (i = 0; i < mtzdata[*mindx-1]->nxtal; ++i) { for (j = 0; j < mtzdata[*mindx-1]->xtal[i]->nset; ++j) { for (k = 0; k < mtzdata[*mindx-1]->xtal[i]->set[j]->ncol; ++k) { if (mtzdata[*mindx-1]->xtal[i]->set[j]->col[k] == collookup[*mindx-1][l]) { lookup[l] = mtzdata[*mindx-1]->xtal[i]->set[j]->col[k]->source; goto next_label; } } } } /* label not assigned */ /* Have compulsory labels been found? */ if (lookup[l] == -1) { printf("Error: label %s not found in file!\n",label+l*31); err++; } lookup[l] = 0; next_label: ; } free(colarray); free(label); free(type); /* Exit on error */ if (err) { ccperror(1,"Error in label assignments"); } return; } /** Fortran wrapper for ccp4_lridx. * Return dataset information. Note requirement to input how much * memory allocated in calling routine. * @param mindx MTZ file index * @param project_name * @param crystal_name * @param dataset_name * @param isets * @param datcell * @param datwave * @param ndatasets On input: space reserved for dataset information. * On output: number of datasets found. */ FORTRAN_SUBR ( LRIDX, lridx, (const int *mindx, fpstr project_name, fpstr crystal_name, fpstr dataset_name, int *isets, float *datcell, float *datwave, int *ndatasets, fpstr_size_t project_name_len, fpstr_size_t crystal_name_len, fpstr_size_t dataset_name_len), (const int *mindx, fpstr project_name, fpstr crystal_name, fpstr dataset_name, int *isets, float *datcell, float *datwave, int *ndatasets), (const int *mindx, fpstr project_name, fpstr_size_t project_name_len, fpstr crystal_name, fpstr_size_t crystal_name_len, fpstr dataset_name, fpstr_size_t dataset_name_len, int *isets, float *datcell, float *datwave, int *ndatasets)) { int j,k,x,d,iset; char cxname[64], cdname[64], cpname[64]; int cisets; float cdatcell[6], cdatwave; CMTZLIB_DEBUG(puts("CMTZLIB_F: LRIDX");) if (MtzCheckSubInput(*mindx,"LRIDX",1)) return; /* Loop over crystals */ for (iset = 0, x = 0; x < mtzdata[*mindx-1]->nxtal; ++x) { /* Loop over datasets for each crystal */ for (d = 0; d < mtzdata[*mindx-1]->xtal[x]->nset; ++d ) { ccp4_lridx(mtzdata[*mindx-1], mtzdata[*mindx-1]->xtal[x]->set[d], cxname, cdname, cpname, &cisets, cdatcell, &cdatwave); /* check calling Fortran has assigned enough memory */ if (iset+1 > *ndatasets) { printf("Warning in LRIDX. You have only reserved enough memory for %d datasets but there are more in the MTZ file. \n",*ndatasets); printf("Only returning partial dataset information. \n"); *ndatasets = -1; return; } for (j = 0; j < project_name_len; ++j) { if (cpname[j] == '\0') { for (k = j; k < project_name_len; ++k) { project_name[project_name_len*iset+k] = ' '; } break; } else { project_name[project_name_len*iset+j] = cpname[j]; } } for (j = 0; j < crystal_name_len; ++j) { if (cxname[j] == '\0') { for (k = j; k < crystal_name_len; ++k) { crystal_name[crystal_name_len*iset+k] = ' '; } break; } else { crystal_name[crystal_name_len*iset+j] = cxname[j]; } } for (j = 0; j < dataset_name_len; ++j) { if (cdname[j] == '\0') { for (k = j; k < dataset_name_len; ++k) { dataset_name[dataset_name_len*iset+k] = ' '; } break; } else { dataset_name[dataset_name_len*iset+j] = cdname[j]; } } isets[iset] = cisets; for (j = 0; j < 6; ++j) datcell[iset*6+j] = cdatcell[j]; datwave[iset] = cdatwave; ++iset; } } *ndatasets = iset; } /* Return cell parameters associated with the specified dataset * @param mindx On input: MTZ file index * @param iset On input: integer specifying the setid for which the * cell parameters are required. * @param mtzcell Array of 6 reals. On output: populated with the * required cell parameters. */ FORTRAN_SUBR ( LRCELX, lrcelx, (const int *mindx, const int *iset, float *mtzcell), (const int *mindx, const int *iset, float *mtzcell), (const int *mindx, const int *iset, float *mtzcell)) { MTZ *mtz; MTZXTAL *xtal; MTZSET *set; int i,j,k; /* NB This function interacts directly with the mtz data structure stored in memory */ CMTZLIB_DEBUG(puts("CMTZLIB_F: LRCELX");) if (MtzCheckSubInput(*mindx,"LRCELX",1)) return; mtz = mtzdata[*mindx-1]; for (i = 0; i < mtz->nxtal; ++i) { xtal = mtz->xtal[i]; for (j = 0; j < xtal->nset; ++j) { set = xtal->set[j]; /* Check if we have found the set in question */ if (set->setid == *iset) { /* Copy the cell for the crystal that the dataset belongs to */ for (k = 0; k < 6; ++k) { mtzcell[k] = xtal->cell[k]; } /* Job done - escape! */ return; } } } printf("LRCELX: error, dataset %d not found\n",*iset); return; } /* Fortran wrapper for ccp4_lridx */ FORTRAN_SUBR ( LRIDC, lridc, (const int *mindx, fpstr project_name, fpstr dataset_name, int *isets, float *datcell, float *datwave, int *ndatasets, fpstr_size_t project_name_len, fpstr_size_t dataset_name_len), (const int *mindx, fpstr project_name, fpstr dataset_name, int *isets, float *datcell, float *datwave, int *ndatasets), (const int *mindx, fpstr project_name, fpstr_size_t project_name_len, fpstr dataset_name, fpstr_size_t dataset_name_len, int *isets, float *datcell, float *datwave, int *ndatasets)) { int j,k,x,d,iset; char cxname[64], cdname[64], cpname[64]; int cisets; float cdatcell[6], cdatwave; CMTZLIB_DEBUG(puts("CMTZLIB_F: LRIDC");) if (MtzCheckSubInput(*mindx,"LRIDC",1)) return; /* Loop over crystals */ for (iset = 0, x = 0; x < mtzdata[*mindx-1]->nxtal; ++x) { /* Loop over datasets for each crystal */ for (d = 0; d < mtzdata[*mindx-1]->xtal[x]->nset; ++d ) { ccp4_lridx(mtzdata[*mindx-1], mtzdata[*mindx-1]->xtal[x]->set[d], cxname, cdname, cpname, &cisets, cdatcell, &cdatwave); for (j = 0; j < project_name_len; ++j) { if (cpname[j] == '\0') { for (k = j; k < project_name_len; ++k) { project_name[project_name_len*iset+k] = ' '; } break; } else { project_name[project_name_len*iset+j] = cpname[j]; } } for (j = 0; j < dataset_name_len; ++j) { if (cdname[j] == '\0') { for (k = j; k < dataset_name_len; ++k) { dataset_name[dataset_name_len*iset+k] = ' '; } break; } else { dataset_name[dataset_name_len*iset+j] = cdname[j]; } } isets[iset] = cisets; for (j = 0; j < 6; ++j) datcell[iset*6+j] = cdatcell[j]; datwave[iset] = cdatwave; ++iset; } } *ndatasets = iset; } /* Fortran wrapper for ccp4_lridx */ FORTRAN_SUBR ( LRID, lrid, (const int *mindx, fpstr project_name, fpstr dataset_name, int *isets, int *ndatasets, fpstr_size_t project_name_len, fpstr_size_t dataset_name_len), (const int *mindx, fpstr project_name, fpstr dataset_name, int *isets, int *ndatasets), (const int *mindx, fpstr project_name, fpstr_size_t project_name_len, fpstr dataset_name, fpstr_size_t dataset_name_len, int *isets, int *ndatasets)) { int j,k,x,d,iset; char cxname[64], cdname[64], cpname[64]; int cisets; float cdatcell[6], cdatwave; CMTZLIB_DEBUG(puts("CMTZLIB_F: LRID");) if (MtzCheckSubInput(*mindx,"LRID",1)) return; /* Loop over crystals */ for (iset = 0, x = 0; x < mtzdata[*mindx-1]->nxtal; ++x) { /* Loop over datasets for each crystal */ for (d = 0; d < mtzdata[*mindx-1]->xtal[x]->nset; ++d ) { ccp4_lridx(mtzdata[*mindx-1], mtzdata[*mindx-1]->xtal[x]->set[d], cxname, cdname, cpname, &cisets, cdatcell, &cdatwave); for (j = 0; j < project_name_len; ++j) { if (cpname[j] == '\0') { for (k = j; k < project_name_len; ++k) { project_name[project_name_len*iset+k] = ' '; } break; } else { project_name[project_name_len*iset+j] = cpname[j]; } } for (j = 0; j < dataset_name_len; ++j) { if (cdname[j] == '\0') { for (k = j; k < dataset_name_len; ++k) { dataset_name[dataset_name_len*iset+k] = ' '; } break; } else { dataset_name[dataset_name_len*iset+j] = cdname[j]; } } isets[iset] = cisets; ++iset; } } *ndatasets = iset; } /* If we are reading from memory rather than file, this simply sets irref */ FORTRAN_SUBR ( LRSEEK, lrseek, (const int *mindx, int *nrefl), (const int *mindx, int *nrefl), (const int *mindx, int *nrefl)) { int respos; CMTZLIB_DEBUG(puts("CMTZLIB_F: LRSEEK");) if (MtzCheckSubInput(*mindx,"LRSEEK",1)) return; /* lrrefl / lrreff will increment this */ irref[*mindx-1] = *nrefl - 1; if (!cmtz_in_memory) { respos = (*nrefl - 1) * MtzNumSourceCol(mtzdata[*mindx-1]) + SIZE1; ccp4_file_seek(mtzdata[*mindx-1]->filein, respos, SEEK_SET); } } /* Fortran wrapper for ccp4_lrrefl */ /* adata returned in file order */ FORTRAN_SUBR ( LRREFL, lrrefl, (const int *mindx, float *resol, float adata[], ftn_logical *eof), (const int *mindx, float *resol, float adata[], ftn_logical *eof), (const int *mindx, float *resol, float adata[], ftn_logical *eof)) { int ieof,biomol,mindex; /*CMTZLIB_DEBUG(puts("CMTZLIB_F: LRREFL");)*/ /* BIOMOL compatibility */ if (*mindx > 1000) { biomol = 1; mindex = *mindx - 1000; } else { biomol = 0; mindex = *mindx; } if (MtzCheckSubInput(mindex,"LRREFL",1)) return; ndatmss[mindex-1] = MtzNumSourceCol(mtzdata[mindex-1]); ++irref[mindex-1]; ieof = ccp4_lrrefl(mtzdata[mindex-1], resol, adata, logmss[mindex-1], irref[mindex-1]); if (ieof) { *eof = FORTRAN_LOGICAL_TRUE; } else { *eof = FORTRAN_LOGICAL_FALSE; } } /* Fortran wrapper for ccp4_lrreff */ /* adata returned in order of requested columns */ FORTRAN_SUBR ( LRREFF, lrreff, (const int *mindx, float *resol, float adata[], ftn_logical *eof), (const int *mindx, float *resol, float adata[], ftn_logical *eof), (const int *mindx, float *resol, float adata[], ftn_logical *eof)) { int ieof,biomol,mindex; /* CMTZLIB_DEBUG(puts("CMTZLIB_F: LRREFF");) */ /* BIOMOL compatibility */ if (*mindx > 1000) { biomol = 1; mindex = *mindx - 1000; } else { biomol = 0; mindex = *mindx; } if (MtzCheckSubInput(mindex,"LRREFF",1)) return; ++irref[mindex-1]; ieof = ccp4_lrreff(mtzdata[mindex-1], resol, adata, logmss[mindex-1], collookup[mindex-1], ndatmss[mindex-1], irref[mindex-1]); if (ieof) { *eof = FORTRAN_LOGICAL_TRUE; } else { *eof = FORTRAN_LOGICAL_FALSE; } } /* Fortran wrapper for ccp4_lrrefm */ FORTRAN_SUBR ( LRREFM, lrrefm, (const int *mindx, ftn_logical logmiss[]), (const int *mindx, ftn_logical logmiss[]), (const int *mindx, ftn_logical logmiss[])) { int i; if (MtzCheckSubInput(*mindx,"LRREFM",1)) return; for (i = 0; i < ndatmss[*mindx-1]; ++i) { if (logmss[*mindx-1][i]) { logmiss[i] = FORTRAN_LOGICAL_TRUE; } else { logmiss[i] = FORTRAN_LOGICAL_FALSE; } } } /* Check for MNFs in array of ndata reals. Results returned in logmiss. */ FORTRAN_SUBR ( MTZ_CHECK_FOR_MNF, mtz_check_for_mnf, (const int *mindx, const int *ndata, float adata[], ftn_logical logmiss[]), (const int *mindx, const int *ndata, float adata[], ftn_logical logmiss[]), (const int *mindx, const int *ndata, float adata[], ftn_logical logmiss[])) { int i; if (MtzCheckSubInput(*mindx,"MTZ_CHECK_FOR_MNF",1)) return; for (i = 0; i < *ndata; ++i) { if (ccp4_ismnf(mtzdata[*mindx-1], adata[i])) { logmiss[i] = FORTRAN_LOGICAL_TRUE; } else { logmiss[i] = FORTRAN_LOGICAL_FALSE; } } } /* print out header information */ FORTRAN_SUBR ( LHPRT, lhprt, (const int *mindx, const int *iprint), (const int *mindx, const int *iprint), (const int *mindx, const int *iprint)) { CMTZLIB_DEBUG(puts("CMTZLIB_F: LHPRT");) if (MtzCheckSubInput(*mindx,"LHPRT",1)) return; ccp4_lhprt(mtzdata[*mindx-1], *iprint); } /* print out header information */ FORTRAN_SUBR ( LHPRT_ADV, lhprt_adv, (const int *mindx, const int *iprint), (const int *mindx, const int *iprint), (const int *mindx, const int *iprint)) { CMTZLIB_DEBUG(puts("CMTZLIB_F: LHPRT_ADV");) if (MtzCheckSubInput(*mindx,"LHPRT_ADV",1)) return; ccp4_lhprt_adv(mtzdata[*mindx-1], *iprint); } /** Fortran wrapper for ccp4_lrbat. Returns the header info for the next * batch from the multi-record MTZ file open on index MINDX, as * the two arrays RBATCH (for numbers) and CBATCH (for characters). * @param mindx MTZ file index * @param batno On return, batch number * @param rbatch On return, real and integer batch data. * @param cbatch On return, character batch data (title and axes names). * @param iprint =0 no printing, =1 print title only, >1 print full header. */ FORTRAN_SUBR ( LRBAT, lrbat, (const int *mindx, int *batno, float rbatch[], fpstr cbatch, const int *iprint, fpstr_size_t cbatch_len), (const int *mindx, int *batno, float rbatch[], fpstr cbatch, const int *iprint), (const int *mindx, int *batno, float rbatch[], fpstr cbatch, fpstr_size_t cbatch_len, const int *iprint)) { MTZBAT *batch; CMTZLIB_DEBUG(puts("CMTZLIB_F: LRBAT");) if (MtzCheckSubInput(*mindx,"LRBAT",1)) return; if (mtzdata[*mindx-1]->n_orig_bat <= 0) { printf("Error: file on mindx is not a multi-record file! \n"); return; } if (rbat[*mindx-1] == NULL) { *batno = -1; return; } batch = rbat[*mindx-1]; *batno = batch->num; ccp4_lrbat(batch, rbatch, cbatch, *iprint); /* advance to next batch (may be NULL) */ rbat[*mindx-1] = batch->next; } /* Print batch header information. In principle, this need not be connected to existing data structure */ FORTRAN_SUBR ( LBPRT, lbprt, (const int *ibatch, const int *iprint, float rbatch[], fpstr cbatch, fpstr_size_t cbatch_len), (const int *ibatch, const int *iprint, float rbatch[], fpstr cbatch), (const int *ibatch, const int *iprint, float rbatch[], fpstr cbatch, fpstr_size_t cbatch_len)) { char btitle[71]; /* For batches */ int *intbuf = (int *) rbatch; float *fltbuf = rbatch + NBATCHINTEGERS; MTZBAT *batch; CMTZLIB_DEBUG(puts("CMTZLIB_F: LBPRT");) if (! *iprint) return; if (*iprint == 1) { strncpy(btitle,cbatch,70); btitle[70] = '\0'; printf(" Batch number: \n"); printf(" %6d %s\n",*ibatch,btitle); } batch = MtzMallocBatch(); strncpy(batch->title,cbatch,70); strncpy(batch->gonlab[0],cbatch+70,8); strncpy(batch->gonlab[1],cbatch+78,8); strncpy(batch->gonlab[2],cbatch+86,8); batch->num = *ibatch; MtzArrayToBatch(intbuf, fltbuf, batch); MtzPrintBatchHeader(batch); MtzFreeBatch(batch); return; } /* Set batch pointer to batch number batno. This is held in the static rbat[]. If batno == 0 then set rbat[] to mtz->batch */ FORTRAN_SUBR ( LRBRES, lrbres, (const int *mindx, const int *batno), (const int *mindx, const int *batno), (const int *mindx, const int *batno)) { int istat=-1; MTZBAT *batch; CMTZLIB_DEBUG(puts("CMTZLIB_F: LRBRES");) if (MtzCheckSubInput(*mindx,"LRBRES",1)) return; if (mtzdata[*mindx-1]->n_orig_bat <= 0) { printf("Error: file on mindx is not a multi-record file! \n"); return; } if (*batno == 0) { rbat[*mindx-1] = mtzdata[*mindx-1]->batch; } else { batch = mtzdata[*mindx-1]->batch; while (batch != NULL) { if (*batno == batch->num) { rbat[*mindx-1] = batch; istat = 0; break; } batch = batch->next; } if (istat == -1) printf("Error: file on %d has no batch %d ! \n",*mindx,*batno); } } /* Fortran wrapper for ccp4_lrbat */ FORTRAN_SUBR ( LRBTIT, lrbtit, (const int *mindx, const int *batno, fpstr tbatch, const int *iprint, fpstr_size_t tbatch_len), (const int *mindx, const int *batno, fpstr tbatch, const int *iprint), (const int *mindx, const int *batno, fpstr tbatch, fpstr_size_t tbatch_len, const int *iprint)) { int istat=-1; MTZBAT *batch; float rbatch[NBATCHWORDS]; char cbatch[94]; CMTZLIB_DEBUG(puts("CMTZLIB_F: LRBTIT");) if (MtzCheckSubInput(*mindx,"LRBTIT",1)) return; if (mtzdata[*mindx-1]->n_orig_bat <= 0) { printf("Error: file on mindx is not a multi-record file! \n"); return; } batch = mtzdata[*mindx-1]->batch; while (batch != NULL) { if (*batno == batch->num) { rbat[*mindx-1] = batch; istat = 0; ccp4_lrbat(batch, rbatch, cbatch, *iprint); break; } batch = batch->next; } if (istat == -1) printf("Error: file on %d has no batch %d ! \n",*mindx,*batno); /* advance to next batch (may be NULL) */ rbat[*mindx-1] = batch->next; strncpy(tbatch,cbatch,70); } /* Fortran wrapper for ccp4_lrbat */ FORTRAN_SUBR ( LRBSCL, lrbscl, (const int *mindx, const int *batno, float batscl[], int *nbatsc), (const int *mindx, const int *batno, float batscl[], int *nbatsc), (const int *mindx, const int *batno, float batscl[], int *nbatsc)) { int istat=-1, nbscal, iprint=0; MTZBAT *batch; float rbatch[NBATCHWORDS]; int *intbatch = (int *) rbatch; char cbatch[94]; CMTZLIB_DEBUG(puts("CMTZLIB_F: LRBSCL");) if (MtzCheckSubInput(*mindx,"LRBSCL",1)) return; if (mtzdata[*mindx-1]->n_orig_bat <= 0) { printf("Error in lrbscl: file on mindx is not a multi-record file! \n"); return; } batch = mtzdata[*mindx-1]->batch; while (batch != NULL) { if (*batno == batch->num) { rbat[*mindx-1] = batch; istat = 0; ccp4_lrbat(batch, rbatch, cbatch, iprint); break; } batch = batch->next; } if (istat == -1) { printf("Error: file on %d has no batch %d ! \n",*mindx,*batno); return; } /* advance to next batch (may be NULL) */ rbat[*mindx-1] = batch->next; nbscal = intbatch[16]; if (nbscal > *nbatsc) { printf("From LRBSCL : %d too many batch scales in orientation block for batch %d, maximum %d \n",nbscal,*batno,*nbatsc); return; } *nbatsc = nbscal; batscl[0] = rbatch[72]; batscl[1] = rbatch[73]; batscl[2] = rbatch[74]; batscl[3] = rbatch[75]; } /* Fortran wrapper for ccp4_lrbat */ FORTRAN_SUBR ( LRBSETID, lrbsetid, (const int *mindx, const int *batno, int *bsetid), (const int *mindx, const int *batno, int *bsetid), (const int *mindx, const int *batno, int *bsetid)) { int istat=-1, iprint=0; MTZBAT *batch; float rbatch[NBATCHWORDS]; int *intbatch = (int *) rbatch; char cbatch[94]; CMTZLIB_DEBUG(puts("CMTZLIB_F: LRBSETID");) if (MtzCheckSubInput(*mindx,"LRBSETID",1)) return; if (mtzdata[*mindx-1]->n_orig_bat <= 0) { printf("Error: file on mindx is not a multi-record file! \n"); return; } batch = mtzdata[*mindx-1]->batch; while (batch != NULL) { if (*batno == batch->num) { istat = 0; ccp4_lrbat(batch, rbatch, cbatch, iprint); break; } batch = batch->next; } if (istat == -1) printf("Error: file on %d has no batch %d ! \n",*mindx,*batno); *bsetid = intbatch[20]; } /* Rewind to first reflection */ FORTRAN_SUBR ( LRREWD, lrrewd, (const int *mindx), (const int *mindx), (const int *mindx)) { if (MtzCheckSubInput(*mindx,"LRREWD",1)) return; irref[*mindx-1] = 0; /* Position file at start of reflections */ if (!cmtz_in_memory) ccp4_file_seek(mtzdata[*mindx-1]->filein, SIZE1, SEEK_SET); } /* Fortran wrapper for MtzHklcoeffs */ FORTRAN_SUBR ( LSTRSL, lstrsl, (const int *mindx, const float *a, const float *b, const float *c, const float *alpha, const float *beta, const float *gamma ), (const int *mindx, const float *a, const float *b, const float *c, const float *alpha, const float *beta, const float *gamma ), (const int *mindx, const float *a, const float *b, const float *c, const float *alpha, const float *beta, const float *gamma )) { float cell[6]; CMTZLIB_DEBUG(puts("CMTZLIB_F: LSTRSL");) cell[0] = *a; cell[1] = *b; cell[2] = *c; cell[3] = *alpha; cell[4] = *beta; cell[5] = *gamma; /* calculate hkl coefficients and store in coefhkl */ MtzHklcoeffs(cell, coefhkl[*mindx-1]); } /* Fortran wrapper for MtzInd2reso */ FORTRAN_SUBR (LSTLSQ1, lstlsq1, (float *reso, const int *mindx, const int *ih, const int *ik, const int *il), (float *reso, const int *mindx, const int *ih, const int *ik, const int *il), (float *reso, const int *mindx, const int *ih, const int *ik, const int *il)) { int in[3]; /* CMTZLIB_DEBUG(puts("CMTZLIB_F: LSTLSQ");) */ in[0] = *ih; in[1] = *ik; in[2] = *il; (*reso) = 0.25*MtzInd2reso(in, coefhkl[*mindx-1]); return; } /* In fact, already closed, so free memory */ FORTRAN_SUBR ( LRCLOS, lrclos, (const int *mindx), (const int *mindx), (const int *mindx)) { if (MtzCheckSubInput(*mindx,"LRCLOS",1)) return; rlun[*mindx-1] = 0; if (wlun[*mindx-1] == 0) { MtzFree(mtzdata[*mindx-1]); mtzdata[*mindx-1] = NULL; } } /** Fortran wrapper to open output MTZ file. In fact, if * reflection data is being held in memory, defer opening * until MtzPut call. But if reflections are written * immediately to file, need to open now. * @param mindx MTZ file index. * @param filename Output file name. * @param ifail (O) Returns 0 if successful, non-zero otherwise. */ FORTRAN_SUBR ( LWOPEN_NOEXIT, lwopen_noexit, (const int *mindx, fpstr filename, int *ifail, fpstr_size_t filename_len), (const int *mindx, fpstr filename, int *ifail), (const int *mindx, fpstr filename, fpstr_size_t filename_len, int *ifail)) { char *temp_name, *fullfilename, err_str[300]; int nxtal=1, nset[1]={1}; int i,j,k,icol; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWOPEN_NOEXIT");) *ifail = 0; if (*mindx <= 0 || *mindx > MFILES) { printf("Error: mindx out of range!\n"); *ifail = 1; return; } temp_name = ccp4_FtoCString(FTN_STR(filename), FTN_LEN(filename)); if (getenv("CMTZ_IN_MEMORY")) cmtz_in_memory = 1; /* no corresponding read file, so set up empty structure with HKL_base crystal and dataset. Label set ID 0, so added ones start at 1. */ if (rlun[*mindx-1] == 0) { mtzdata[*mindx-1] = MtzMalloc(nxtal,nset); strcpy(mtzdata[*mindx-1]->xtal[0]->xname,"HKL_base"); strcpy(mtzdata[*mindx-1]->xtal[0]->pname,"HKL_base"); mtzdata[*mindx-1]->xtal[0]->set[0]->setid = 0; strcpy(mtzdata[*mindx-1]->xtal[0]->set[0]->dname,"HKL_base"); mtzdata[*mindx-1]->refs_in_memory = cmtz_in_memory; } wlun[*mindx-1] = 1; strcpy(fileout[*mindx-1],temp_name); iwref[*mindx-1] = 0; if (!cmtz_in_memory) { if (mtzdata[*mindx-1]->filein) { if (getenv(temp_name) != NULL) { fullfilename = strdup(getenv(temp_name)); } else { fullfilename = strdup(temp_name); } if (!strcmp(mtzdata[*mindx-1]->filein->name,fullfilename)) { strcpy(err_str,"LWOPEN_NOEXIT: output file is same as open input file: "); strncat(err_str,fullfilename,245); ccperror(2,err_str); free(temp_name); free(fullfilename); *ifail = 1; return; } free(fullfilename); } if ( !(mtzdata[*mindx-1]->fileout = MtzOpenForWrite(temp_name)) ) { strcpy(err_str,"LWOPEN_NOEXIT: failed to open output file "); strncat(err_str,temp_name,260); ccperror(2,err_str); free(temp_name); *ifail = 1; return; } /* assign existing columns for output */ /* if lwclab/lwassn are called with iappnd=0 then these are overwritten */ /* needs to be here for those rare progs which don't call lwclab/lwassn */ for (i = 0; i < mtzdata[*mindx-1]->nxtal; ++i) for (j = 0; j < mtzdata[*mindx-1]->xtal[i]->nset; ++j) for (k = 0; k < mtzdata[*mindx-1]->xtal[i]->set[j]->ncol; ++k) if ((icol = mtzdata[*mindx-1]->xtal[i]->set[j]->col[k]->source) != 0) collookup_out[*mindx-1][icol-1] = mtzdata[*mindx-1]->xtal[i]->set[j]->col[k]; } free(temp_name); } /** Fortran wrapper to open output MTZ file. In fact, if * reflection data is being held in memory, defer opening * until MtzPut call. But if reflections are written * immediately to file, need to open now. * @param mindx MTZ file index. * @param filename Output file name. */ FORTRAN_SUBR ( LWOPEN, lwopen, (const int *mindx, fpstr filename, fpstr_size_t filename_len), (const int *mindx, fpstr filename), (const int *mindx, fpstr filename, fpstr_size_t filename_len)) { int ifail; FORTRAN_CALL ( LWOPEN_NOEXIT, lwopen_noexit, (mindx, filename, &ifail, filename_len), (mindx, filename, &ifail), (mindx, filename, filename_len, &ifail)); if ( ifail ) ccperror(1,"LWOPEN: failed to open output file"); } /** Set title for output file. * @param mindx MTZ file index. * @param ftitle Title to be added to output MTZ file. * @param flag =0 replace old title with new one, or * =1 append new one to old, with one space */ FORTRAN_SUBR ( LWTITL, lwtitl, (const int *mindx, const fpstr ftitle, const int *flag, fpstr_size_t ftitle_len), (const int *mindx, const fpstr ftitle, const int *flag), (const int *mindx, const fpstr ftitle, fpstr_size_t ftitle_len, const int *flag)) { char *temp_title; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWTITL");) if (MtzCheckSubInput(*mindx,"LWTITL",2)) return; temp_title = ccp4_FtoCString(FTN_STR(ftitle), FTN_LEN(ftitle)); ccp4_lwtitl(mtzdata[*mindx-1], temp_title, *flag); free(temp_title); } /** Set sort order for output file. The integer array is stored * as static. Try to set sort order now, but may not be possible * if LWCLAB/LWASSN not yet called. * @param mindx MTZ file index. * @param sortx Sort order as integer array. */ FORTRAN_SUBR ( LWSORT, lwsort, (const int *mindx, int sortx[5]), (const int *mindx, int sortx[5]), (const int *mindx, int sortx[5])) { int i,j,k,l,icol=0; MTZCOL *colsort[5]; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWSORT");) if (MtzCheckSubInput(*mindx,"LWSORT",2)) return; for (i = 0; i < 5; ++i) { sortorder[*mindx-1][i] = sortx[i]; colsort[i] = NULL; } for (i = 0; i < mtzdata[*mindx-1]->nxtal; ++i) for (j = 0; j < mtzdata[*mindx-1]->xtal[i]->nset; ++j) for (k = 0; k < mtzdata[*mindx-1]->xtal[i]->set[j]->ncol; ++k) { ++icol; for (l = 0; l < 5; ++l) if (sortx[l] == icol) colsort[l] = mtzdata[*mindx-1]->xtal[i]->set[j]->col[k]; } MtzSetSortOrder(mtzdata[*mindx-1],colsort); } /* Fortran wrapper for MtzAddHistory */ FORTRAN_SUBR ( LWHIST, lwhist, (int *mindx, fpstr hstrng, int *nlines, fpstr_size_t hstrng_len), (int *mindx, fpstr hstrng, int *nlines), (int *mindx, fpstr hstrng, fpstr_size_t hstrng_len, int *nlines)) { CMTZLIB_DEBUG(puts("CMTZLIB_F: LWHIST");) if (MtzCheckSubInput(*mindx,"LWHIST",2)) return; MtzAddHistory(mtzdata[*mindx-1], hstrng, *nlines); } /* Fortran wrapper for MtzAddHistory */ /* Also includes progname and date */ FORTRAN_SUBR ( LWHSTL, lwhstl, (int *mindx, const fpstr hstrng, fpstr_size_t hstrng_len), (int *mindx, const fpstr hstrng), (int *mindx, const fpstr hstrng, fpstr_size_t hstrng_len)) { char hline[MTZRECORDLENGTH],date[11],time[9],*temp_hstrng; size_t len=0, Length; int i; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWHSTL");) if (*mindx <= 0 || *mindx > MFILES) { printf("Error in lwhstl: mindx out of range!\n"); return; } if (!mtzdata[*mindx-1]) { printf("Error in lwhstl: mindx not open for write (or read)!\n"); return; } strcpy(hline,"From "); if (ccp4ProgramName(NULL)) { len = strlen(strcpy(hline+5,ccp4ProgramName(NULL))) + 5; hline[len++] = ' '; } if (ccp4_utils_date(date)) { len = len + strlen(strcpy(hline+len,date)); hline[len++] = ' '; } if (ccp4_utils_time(time)) { len = len + strlen(strcpy(hline+len,time)); hline[len++] = ' '; } /* append hstrng to hline - hline is not necessarily null-terminated */ /* MtzAddHistory assumes that hline is either null-terminated, or * full - otherwise, garbage may be added */ temp_hstrng = ccp4_FtoCString(FTN_STR(hstrng), FTN_LEN(hstrng)); Length = strlen(temp_hstrng); if (Length > MTZRECORDLENGTH-len) Length = MTZRECORDLENGTH-len; strncpy(hline+len,temp_hstrng,Length); for (i = len+Length; i < MTZRECORDLENGTH; ++i) hline[i] = '\0'; MtzAddHistory(mtzdata[*mindx-1], hline, 1); free(temp_hstrng); } /** Fortran wrapper to ccp4_lwidx for writing dataset header information. * As for LWIDX except crystal name is not provided, and defaults to * supplied project name. Also cell and wavelength are not provided and * default to zero. This exists for backwards-compatibility - use LWIDX * instead. * @param mindx MTZ file index. * @param project_name Name of project that parent crystal belongs to. * @param dataset_name Name of dataset. */ FORTRAN_SUBR ( LWID, lwid, (const int *mindx, const fpstr project_name, const fpstr dataset_name, fpstr_size_t project_name_len, fpstr_size_t dataset_name_len), (const int *mindx, const fpstr project_name, const fpstr dataset_name), (const int *mindx, const fpstr project_name, fpstr_size_t project_name_len, const fpstr dataset_name, fpstr_size_t dataset_name_len)) { char *temp_xname, *temp_pname, *temp_dname; float datcell[6]={0.0},datwave=0.0; MTZ *mtz; int i; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWID");) if (MtzCheckSubInput(*mindx,"LWID",2)) return; temp_pname = ccp4_FtoCString(FTN_STR(project_name), FTN_LEN(project_name)); temp_dname = ccp4_FtoCString(FTN_STR(dataset_name), FTN_LEN(dataset_name)); /* default crystal name to project name */ temp_xname = strdup(temp_pname); mtz = mtzdata[*mindx-1]; /* if it's a new crystal, then default cell dimensions to existing ones */ if (MtzXtalLookup(mtz,temp_xname) == NULL && mtz->nxtal > 0 && mtz->xtal[0]->cell[0] != 0.0) for (i = 0; i < 6; ++i) datcell[i] = mtz->xtal[0]->cell[i]; ccp4_lwidx(mtz, temp_xname, temp_dname, temp_pname, datcell, &datwave); free(temp_xname); free(temp_pname); free(temp_dname); } /** Fortran wrapper to ccp4_lwidx for writing dataset header information. * As for LWIDX except crystal name is not provided, and defaults to * supplied project name. This exists for backwards-compatibility - use LWIDX * instead. * @param mindx MTZ file index. * @param project_name Name of project that parent crystal belongs to. * @param dataset_name Name of dataset. * @param datcell Cell dimensions of parent crystal. * @param datwave Wavelength of dataset. */ FORTRAN_SUBR ( LWIDC, lwidc, (const int *mindx, const fpstr project_name, const fpstr dataset_name, float datcell[6], float *datwave, fpstr_size_t project_name_len, fpstr_size_t dataset_name_len), (const int *mindx, const fpstr project_name, const fpstr dataset_name, float datcell[6], float *datwave), (const int *mindx, const fpstr project_name, fpstr_size_t project_name_len, const fpstr dataset_name, fpstr_size_t dataset_name_len, float datcell[6], float *datwave)) { char *temp_xname, *temp_pname, *temp_dname; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWIDC");) if (MtzCheckSubInput(*mindx,"LWIDC",2)) return; temp_pname = ccp4_FtoCString(FTN_STR(project_name), FTN_LEN(project_name)); temp_dname = ccp4_FtoCString(FTN_STR(dataset_name), FTN_LEN(dataset_name)); /* default crystal name to project name */ temp_xname = strdup(temp_pname); ccp4_lwidx(mtzdata[*mindx-1], temp_xname, temp_dname, temp_pname, datcell, datwave); free(temp_xname); free(temp_pname); free(temp_dname); } /** Fortran wrapper to ccp4_lwidx for writing dataset header information. * @param mindx MTZ file index. * @param project_name Name of project that parent crystal belongs to. * @param crystal_name Name of parent crystal. * @param dataset_name Name of dataset. * @param datcell Cell dimensions of parent crystal. * @param datwave Wavelength of dataset. */ FORTRAN_SUBR ( LWIDX, lwidx, (const int *mindx, const fpstr project_name, const fpstr crystal_name, const fpstr dataset_name, float datcell[6], float *datwave, fpstr_size_t project_name_len, fpstr_size_t crystal_name_len, fpstr_size_t dataset_name_len), (const int *mindx, const fpstr project_name, const fpstr crystal_name, const fpstr dataset_name, float datcell[6], float *datwave), (const int *mindx, const fpstr project_name, fpstr_size_t project_name_len, const fpstr crystal_name, fpstr_size_t crystal_name_len, const fpstr dataset_name, fpstr_size_t dataset_name_len, float datcell[6], float *datwave)) { char *temp_xname, *temp_pname, *temp_dname; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWIDX");) if (MtzCheckSubInput(*mindx,"LWIDX",2)) return; temp_pname = ccp4_FtoCString(FTN_STR(project_name), FTN_LEN(project_name)); temp_xname = ccp4_FtoCString(FTN_STR(crystal_name), FTN_LEN(crystal_name)); temp_dname = ccp4_FtoCString(FTN_STR(dataset_name), FTN_LEN(dataset_name)); ccp4_lwidx(mtzdata[*mindx-1], temp_xname, temp_dname, temp_pname, datcell, datwave); free(temp_xname); free(temp_pname); free(temp_dname); } /** Fortran wrapper to update cell of output MTZ file. Overall * cell is obsolete - we only store crystal cell dimensions. * Therefore this simply writes the cell dimensions for any * crystal which has not yet been set. Crystal cell dimensions * should be set directly with lwidc. * @param mindx MTZ file index. * @param cell Output cell dimensions. */ FORTRAN_SUBR ( LWCELL, lwcell, (const int *mindx, float cell[6]), (const int *mindx, float cell[6]), (const int *mindx, float cell[6])) { MTZ *mtz; int i,j; char xname[200]="unknown", pname[200]="unknown", dname[200]="unknown"; float datwave = 0.0; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWCELL");) if (MtzCheckSubInput(*mindx,"LWCELL",2)) return; /* nothing to do if input cell is zero */ if (cell[0] < 0.001) return; mtz = mtzdata[*mindx-1]; if (mtz->nxtal == 0) { ccp4_lwidx(mtz, xname, dname, pname, cell, &datwave); } else { for (i = 0; i < mtz->nxtal; ++i) { if (mtz->xtal[i]->cell[0] == 0.0) for (j = 0; j < 6; ++j) mtz->xtal[i]->cell[j] = cell[j]; } } /* calculate hkl coefficients and store in coefhkl */ MtzHklcoeffs(cell, coefhkl[*mindx-1]); } /** Obsolete - use LWIDASX. * @param mindx MTZ file index. * @param nlprgo Number of output columns. * @param pname Array of project names. * @param dname Array of dataset names. * @param iappnd If 0 then assign all columns, if 1 then assign appended columns. */ FORTRAN_SUBR ( LWIDAS, lwidas, (const int *mindx, int *nlprgo, fpstr pname, fpstr dname, int *iappnd, fpstr_size_t pname_len, fpstr_size_t dname_len), (const int *mindx, int *nlprgo, fpstr pname, fpstr dname, int *iappnd), (const int *mindx, int *nlprgo, fpstr pname, fpstr_size_t pname_len, fpstr dname, fpstr_size_t dname_len, int *iappnd)) {int i,j,k,istart; char *project_name; char *crystal_name; char *dataset_name; MTZSET *baseset=NULL; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWIDAS");) if (MtzCheckSubInput(*mindx,"LWIDAS",2)) return; project_name = (char *) ccp4_utils_malloc((*nlprgo)*(pname_len+1)*sizeof(char)); crystal_name = (char *) ccp4_utils_malloc((*nlprgo)*(pname_len+1)*sizeof(char)); dataset_name = (char *) ccp4_utils_malloc((*nlprgo)*(dname_len+1)*sizeof(char)); for (i = 0; i < *nlprgo; ++i) { for (j = 0; j < pname_len; ++j) { if (pname[pname_len*i+j] == ' ') { break; } else { project_name[i*(pname_len+1)+j] = pname[pname_len*i+j]; } } project_name[i*(pname_len+1)+j] = '\0'; /* default crystal name to project name */ strcpy(crystal_name+i*(pname_len+1),project_name+i*(pname_len+1)); } for (i = 0; i < *nlprgo; ++i) { for (j = 0; j < dname_len; ++j) { if (dname[dname_len*i+j] == ' ') { break; } else { dataset_name[i*(dname_len+1)+j] = dname[dname_len*i+j]; } } dataset_name[i*(dname_len+1)+j] = '\0'; } /* assignment request is in terms of pname/dname but data structure is in terms of xname/dname. We need to find appropriate xname. Use first crystal of correct pname/dname. If none found, above default is used. */ for (i = 0; i < *nlprgo; ++i) for (j = 0; j < mtzdata[*mindx-1]->nxtal; ++j) if (!strcmp(mtzdata[*mindx-1]->xtal[j]->pname, project_name+i*(pname_len+1))) for (k = 0; k < mtzdata[*mindx-1]->xtal[j]->nset; ++k) if (!strcmp(mtzdata[*mindx-1]->xtal[j]->set[k]->dname, dataset_name+i*(dname_len+1))) { strncpy(crystal_name+i*(pname_len+1), mtzdata[*mindx-1]->xtal[j]->xname,pname_len); *(crystal_name+i*(pname_len+1)+pname_len) = '\0'; } /* if we are appending columns, shift collookup_out */ istart = 0; if (*iappnd == 1) istart = MtzNumSourceCol(mtzdata[*mindx-1]); /* get base dataset if it exists */ baseset = MtzSetLookup(mtzdata[*mindx-1],"HKL_base/HKL_base"); for (i = 0; i < *nlprgo; ++i) { /* sanity check */ if (!collookup_out[*mindx-1][i+istart]) { printf(" LWIDAS: severe warning - column %d does not exist. \n",i); continue; } if (baseset && (strcmp(collookup_out[*mindx-1][i+istart]->type,"H") == 0) ) { MtzAssignColumn(mtzdata[*mindx-1], collookup_out[*mindx-1][i+istart], "HKL_base","HKL_base"); } else if (strlen(crystal_name+i*(pname_len+1)) && strlen(dataset_name+i*(dname_len+1))) { MtzAssignColumn(mtzdata[*mindx-1], collookup_out[*mindx-1][i+istart], crystal_name+i*(pname_len+1), dataset_name+i*(dname_len+1)); } } free(project_name); free(crystal_name); free(dataset_name); } /** Assign output columns to crystal/datasets. * @param mindx MTZ file index. * @param nlprgo Number of output columns. * @param xname Array of crystal names for columns. * @param dname Array of dataset names for columns. * @param iappnd If 0 then assign all columns, if 1 then assign appended columns. */ FORTRAN_SUBR ( LWIDASX, lwidasx, (const int *mindx, int *nlprgo, fpstr xname, fpstr dname, int *iappnd, fpstr_size_t xname_len, fpstr_size_t dname_len), (const int *mindx, int *nlprgo, fpstr xname, fpstr dname, int *iappnd), (const int *mindx, int *nlprgo, fpstr xname, fpstr_size_t xname_len, fpstr dname, fpstr_size_t dname_len, int *iappnd)) {int i,j,istart; char *crystal_name; char *dataset_name; MTZSET *baseset=NULL; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWIDASX");) if (MtzCheckSubInput(*mindx,"LWIDASX",2)) return; crystal_name = (char *) ccp4_utils_malloc((*nlprgo)*(xname_len+1)*sizeof(char)); dataset_name = (char *) ccp4_utils_malloc((*nlprgo)*(dname_len+1)*sizeof(char)); for (i = 0; i < *nlprgo; ++i) { for (j = 0; j < xname_len; ++j) { if (xname[xname_len*i+j] == ' ') { break; } else { crystal_name[i*(xname_len+1)+j] = xname[xname_len*i+j]; } } crystal_name[i*(xname_len+1)+j] = '\0'; } for (i = 0; i < *nlprgo; ++i) { for (j = 0; j < dname_len; ++j) { if (dname[dname_len*i+j] == ' ') { break; } else { dataset_name[i*(dname_len+1)+j] = dname[dname_len*i+j]; } } dataset_name[i*(dname_len+1)+j] = '\0'; } /* if we are appending columns, shift collookup_out */ istart = 0; if (*iappnd == 1) istart = MtzNumSourceCol(mtzdata[*mindx-1]); /* get base dataset if it exists */ baseset = MtzSetLookup(mtzdata[*mindx-1],"HKL_base/HKL_base"); for (i = 0; i < *nlprgo; ++i) { /* sanity check */ if (!collookup_out[*mindx-1][i+istart]) { printf(" LWIDASX: severe warning - column %d does not exist. \n",i); continue; } if (baseset && (strcmp(collookup_out[*mindx-1][i+istart]->type,"H") == 0) ) { MtzAssignColumn(mtzdata[*mindx-1], collookup_out[*mindx-1][i+istart], "HKL_base","HKL_base"); } else if (strlen(crystal_name+i*(xname_len+1)) && strlen(dataset_name+i*(dname_len+1))) { MtzAssignColumn(mtzdata[*mindx-1], collookup_out[*mindx-1][i+istart], crystal_name+i*(xname_len+1), dataset_name+i*(dname_len+1)); } } free(crystal_name); free(dataset_name); } /** Assign output columns to crystal/datasets. * This is a simpler version of LWIDASX to assign all columns to one dataset * (except for HKL which are assigned to base dataset). * @param mindx MTZ file index. * @param xname Crystal name for all columns. * @param dname Dataset name for all columns. */ FORTRAN_SUBR ( LWIDALL, lwidall, (const int *mindx, fpstr xname, fpstr dname, fpstr_size_t xname_len, fpstr_size_t dname_len), (const int *mindx, fpstr xname, fpstr dname), (const int *mindx, fpstr xname, fpstr_size_t xname_len, fpstr dname, fpstr_size_t dname_len)) { int i,j,k,l=0; MTZCOL **colarray; char *crystal_name; char *dataset_name; MTZSET *baseset=NULL; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWIDALL");) if (MtzCheckSubInput(*mindx,"LWIDALL",2)) return; crystal_name = ccp4_FtoCString(FTN_STR(xname), FTN_LEN(xname)); dataset_name = ccp4_FtoCString(FTN_STR(dname), FTN_LEN(dname)); /* get base dataset if it exists */ baseset = MtzSetLookup(mtzdata[*mindx-1],"HKL_base/HKL_base"); if (strlen(crystal_name) && strlen(dataset_name)) { /* need direct pointers to columns as we are going to mess with xtal/set hierarchy */ colarray = (MTZCOL **) ccp4_utils_malloc(MtzNcol(mtzdata[*mindx-1])*sizeof(MTZCOL *)); for (i = 0; i < mtzdata[*mindx-1]->nxtal; ++i) for (j = 0; j < mtzdata[*mindx-1]->xtal[i]->nset; ++j) for (k = 0; k < mtzdata[*mindx-1]->xtal[i]->set[j]->ncol; ++k) colarray[l++] = mtzdata[*mindx-1]->xtal[i]->set[j]->col[k]; for (l = 0; l < MtzNcol(mtzdata[*mindx-1]); ++l) { if (baseset && (strcmp(colarray[l]->type,"H") == 0) ) { MtzAssignColumn(mtzdata[*mindx-1], colarray[l], "HKL_base","HKL_base"); } else { MtzAssignColumn(mtzdata[*mindx-1], colarray[l], crystal_name, dataset_name); } } free(colarray); } free(crystal_name); free(dataset_name); } /** Write or update symmetry information for MTZ header. * @param mindx (I) MTZ file index. * @param nsymx (I) number of symmetry operators * @param nsympx (I) number of primitive symmetry operators * @param rsymx (I) Array of symmetry operators as 4 x 4 matrices. Each matrix * is input with translations in elements [3][*] (i.e. reversed with respect * to the way the Fortran application sees it). This function reverses * the order before passing to ccp4_lwsymm. * @param ltypex (I) lattice type * @param nspgrx (I) spacegroup number * @param spgrnx (I) spacegroup name * @param pgnamx (I) point group name */ FORTRAN_SUBR ( LWSYMM, lwsymm, (int *mindx, int *nsymx, int *nsympx, float rsymx[MAXSYM][4][4], fpstr ltypex, int *nspgrx, fpstr spgrnx, fpstr pgnamx, fpstr_size_t ltypex_len, fpstr_size_t spgrnx_len, fpstr_size_t pgnamx_len), (int *mindx, int *nsymx, int *nsympx, float rsymx[MAXSYM][4][4], fpstr ltypex, int *nspgrx, fpstr spgrnx, fpstr pgnamx), (int *mindx, int *nsymx, int *nsympx, float rsymx[MAXSYM][4][4], fpstr ltypex, fpstr_size_t ltypex_len, int *nspgrx, fpstr spgrnx, fpstr_size_t spgrnx_len, fpstr pgnamx, fpstr_size_t pgnamx_len)) { char *temp_ltypex, *temp_spgrnx, *temp_pgnamx; int i,ii,j,k,nsym; float rsym[MAXSYM][4][4]; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWSYMM");) if (MtzCheckSubInput(*mindx,"LWSYMM",2)) return; temp_ltypex = ccp4_FtoCString(FTN_STR(ltypex), FTN_LEN(ltypex)); temp_spgrnx = ccp4_FtoCString(FTN_STR(spgrnx), FTN_LEN(spgrnx)); temp_pgnamx = ccp4_FtoCString(FTN_STR(pgnamx), FTN_LEN(pgnamx)); /* deal with array conventions */ nsym = *nsymx; if (nsym > MAXSYM) nsym = MAXSYM; for (i = 0; i < nsym; ++i) for (j = 0; j < 4; ++j) for (k = 0; k < 4; ++k) rsym[i][j][k] = rsymx[i][k][j]; /* if there is a cell, check specified symmetry is consistent with it */ if (nsym > 0) { for(ii=0;iinxtal;ii++) { if(mtzdata[*mindx-1]->xtal[ii]->cell[0] != 0.0 && strcmp(mtzdata[*mindx-1]->xtal[ii]->xname,"HKL_base")) if (!ccp4spg_check_symm_cell(nsym,rsym,mtzdata[*mindx-1]->xtal[ii]->cell)) { printf(" LWSYMM: severe warning - specified symmetry not consistent with cell dimensions! \n"); printf(" Spacegroup %s \n",temp_spgrnx); printf(" Cell dimensions %f %f %f %f %f %f \n",mtzdata[*mindx-1]->xtal[ii]->cell[0], mtzdata[*mindx-1]->xtal[ii]->cell[1],mtzdata[*mindx-1]->xtal[ii]->cell[2], mtzdata[*mindx-1]->xtal[ii]->cell[3],mtzdata[*mindx-1]->xtal[ii]->cell[4], mtzdata[*mindx-1]->xtal[ii]->cell[5]); ccperror(1,"Error in spacegroup or cell dimensions."); } } } ccp4_lwsymm(mtzdata[*mindx-1], nsym, *nsympx, rsym, temp_ltypex, *nspgrx, temp_spgrnx, temp_pgnamx); free(temp_ltypex); free(temp_spgrnx); free(temp_pgnamx); } /** Write or update symmetry information for MTZ header. * @param mindx (I) MTZ file index. * @param spgconf (I) one-character spacegroup confidence flag */ FORTRAN_SUBR ( LWSYMCONF, lwsymconf, (int *mindx, fpstr spgconf, fpstr_size_t spgconf_len), (int *mindx, fpstr spgconf), (int *mindx, fpstr spgconf, fpsrt_size_t spgconf_len)) { char *temp_spgconf; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWSYMCONF");) if (MtzCheckSubInput(*mindx,"LWSYMCONF",2)) return; temp_spgconf = ccp4_FtoCString(FTN_STR(spgconf), FTN_LEN(spgconf)); ccp4_lwsymconf(mtzdata[*mindx-1], temp_spgconf); free(temp_spgconf); } /** Fortran wrapper to assign columns of output MTZ file. * First this updates labels from user_label_out if set by lkyout, * then sets collookup_out array of pointers to columns. * @param mindx MTZ file index. * @param lsprgo array of output labels * @param nlprgo number of output labels * @param ctprgo array of output column types * @param iappnd if = 0 replace all existing columns, else if = 1 "append" to * existing columns. Note that columns are appended to the relevant datasets * and are not therefore necessarily at the end of the list of columns. */ FORTRAN_SUBR ( LWASSN, lwassn, (const int *mindx, fpstr lsprgo, const int *nlprgo, fpstr ctprgo, int *iappnd, fpstr_size_t lsprgo_len, fpstr_size_t ctprgo_len), (const int *mindx, fpstr lsprgo, const int *nlprgo, fpstr ctprgo, int *iappnd), (const int *mindx, fpstr lsprgo, fpstr_size_t lsprgo_len, const int *nlprgo, fpstr ctprgo, fpstr_size_t ctprgo_len, int *iappnd)) { int i,j,istart; char *label; char *type; MTZCOL **colarray, *colsort[5]; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWASSN");) if (MtzCheckSubInput(*mindx,"LWASSN",2)) return; label = (char *) ccp4_utils_malloc((*nlprgo)*31*sizeof(char)); type = (char *) ccp4_utils_malloc((*nlprgo)*3*sizeof(char)); /* Construct label array to pass to ccp4_lwassn. This has undergone several iterations. Watch out for special cases: output assignment is taken from LABIN e.g. revise (same prog label in lsprgi and lsprgo, and iappnd = 0) dm has same prog label FDM in lsprgi and lsprgo, and iappnd = 1 so these are distinct columns sfall has "labout allin" which should be sorted out by sfall itself */ for (i = 0; i < *nlprgo; ++i) { /* set label to program default */ for (j = 0; j != 30 && j != lsprgo_len && lsprgo[lsprgo_len*i+j] != ' ' ; ++j) { label[i*31+j] = lsprgo[lsprgo_len*i+j]; } label[i*31+j] = '\0'; /* if there was a user output assignment (LABOUT), overwrite with this */ if (strcmp(user_label_out[*mindx-1][i][1],"")) { strcpy(label+i*31,user_label_out[*mindx-1][i][1]); } else { /* else check for input assignment (see e.g. revise.exam) */ for (j = 0; j < MCOLUMNS; ++j) { if (strcmp(user_label_in[*mindx-1][j][1],"") && !strcmp(user_label_in[*mindx-1][j][0],label+i*31)) { strcpy(label+i*31,user_label_in[*mindx-1][j][1]); break; } } } /* check for duplicated labels */ for (j = 0; j < i; ++j) if ( ! strncmp(label+i*31,label+j*31,31) ) { printf("LWASSN: duplicate column labels in output file, columns %d and %d both have the label %s \n",j,i,label+i*31); ccperror(1,"Duplicate column labels in output file"); } } /* end of labels loop */ /* types loop */ for (i = 0; i < *nlprgo; ++i) { for (j = 0; j < 2; ++j) { if (j == ctprgo_len || ctprgo[ctprgo_len*i+j] == ' ') { break; } else { type[i*3+j] = ctprgo[ctprgo_len*i+j]; } } type[i*3+j] = '\0'; } /* type loop */ /* if we are appending columns, shift collookup_out */ istart = 0; if (*iappnd == 1) istart = MtzNumSourceCol(mtzdata[*mindx-1]); /* assign new columns for output */ colarray = ccp4_lwassn(mtzdata[*mindx-1],label,*nlprgo,type,*iappnd); for (j = 0; j < 5; ++j) colsort[j] = NULL; for (i = 0; i < *nlprgo; ++i) { collookup_out[*mindx-1][i+istart] = colarray[i]; /* register sort order */ for (j = 0; j < 5; ++j) if (sortorder[*mindx-1][j] == (i + 1)) colsort[j] = colarray[i]; } /* If LWSORT has been called, then sortorder[][] should be set, and we make sure sort order is up-to-date with output columns. If sortorder[][] not set, we retain sort order of input file. */ if (sortorder[*mindx-1][0]) MtzSetSortOrder(mtzdata[*mindx-1],colsort); free(colarray); free(label); free(type); } /* Fortran wrapper for ccp4_lwassn */ /* As lwassn except doesn't check user_label_out */ FORTRAN_SUBR ( LWCLAB, lwclab, (const int *mindx, fpstr lsprgo, const int *nlprgo, fpstr ctprgo, int *iappnd, fpstr_size_t lsprgo_len, fpstr_size_t ctprgo_len), (const int *mindx, fpstr lsprgo, const int *nlprgo, fpstr ctprgo, int *iappnd), (const int *mindx, fpstr lsprgo, fpstr_size_t lsprgo_len, const int *nlprgo, fpstr ctprgo, fpstr_size_t ctprgo_len, int *iappnd)) {int i,j,istart; char *label; char *type; MTZCOL **colarray, *colsort[5]; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWCLAB");) if (MtzCheckSubInput(*mindx,"LWCLAB",2)) return; label = (char *) ccp4_utils_malloc((*nlprgo)*31*sizeof(char)); type = (char *) ccp4_utils_malloc((*nlprgo)*3*sizeof(char)); for (i = 0; i < *nlprgo; ++i) { for (j = 0; j < 30; ++j) { if (j == lsprgo_len || lsprgo[lsprgo_len*i+j] == ' ') { break; } else { label[i*31+j] = lsprgo[lsprgo_len*i+j]; } } label[i*31+j] = '\0'; /* check for duplicated labels */ for (j = 0; j < i; ++j) if ( ! strncmp(label+i*31,label+j*31,31) ) { printf("LWCLAB: duplicate column labels in output file, columns %d and %d both have the label %s \n",j,i,label+i*31); ccperror(1,"Duplicate column labels in output file"); } } for (i = 0; i < *nlprgo; ++i) { for (j = 0; j < 3; ++j) { if (j == ctprgo_len || ctprgo[ctprgo_len*i+j] == ' ') { break; } else { type[i*3+j] = ctprgo[ctprgo_len*i+j]; } } type[i*3+j] = '\0'; } /* if we are appending columns, shift collookup_out */ istart = 0; if (*iappnd == 1) istart = MtzNumSourceCol(mtzdata[*mindx-1]); /* assign new columns for output */ colarray = ccp4_lwassn(mtzdata[*mindx-1],label,*nlprgo,type,*iappnd); for (j = 0; j < 5; ++j) colsort[j] = NULL; for (i = 0; i < *nlprgo; ++i) { collookup_out[*mindx-1][i+istart] = colarray[i]; /* register sort order */ for (j = 0; j < 5; ++j) if (sortorder[*mindx-1][j] == (i + 1)) colsort[j] = colarray[i]; } /* If LWSORT has been called, then sortorder[][] should be set, and we make sure sort order is up-to-date with output columns. If sortorder[][] not set, we retain sort order of input file. */ if (sortorder[*mindx-1][0]) MtzSetSortOrder(mtzdata[*mindx-1],colsort); free(colarray); free(label); free(type); } /** Write batch header for batch number batno. * @param mindx MTZ file index * @param batno Serial number of batch. * @param rbatch Real/integer batch information. * @param cbatch Character batch information. */ FORTRAN_SUBR ( LWBAT, lwbat, (const int *mindx, int *batno, float rbatch[], fpstr cbatch, fpstr_size_t cbatch_len), (const int *mindx, int *batno, float rbatch[], fpstr cbatch), (const int *mindx, int *batno, float rbatch[], fpstr cbatch, fpstr_size_t cbatch_len)) { MTZBAT *batch; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWBAT");) if (MtzCheckSubInput(*mindx,"LWBAT",2)) return; /* No check on mtzdata[*mindx-1]->n_orig_bat It might be 0 if this is the first batch written. */ /* batno = 0 is special flag to remove batch information */ /* Used for example in SCALA to write merged file from unmerged input */ if (*batno == 0) { mtzdata[*mindx-1]->n_orig_bat = 0; MtzFreeBatch(mtzdata[*mindx-1]->batch); mtzdata[*mindx-1]->batch = NULL; return; } /* add as new batch */ batch = NULL; if (!ccp4_lwbat(mtzdata[*mindx-1], batch, *batno, rbatch, cbatch) ) ccperror(1,"LWBAT: error in ccp4_lwbat, see messages above"); /* record number of batch headers for output */ ++nbatw[*mindx-1]; } /** Write batch header for batch number batno. Only the batch title * is provided, so dummy header is written. * @param mindx MTZ file index * @param batno Serial number of batch. * @param tbatch Batch title. */ FORTRAN_SUBR ( LWBTIT, lwbtit, (const int *mindx, int *batno, fpstr tbatch, fpstr_size_t tbatch_len), (const int *mindx, int *batno, fpstr tbatch), (const int *mindx, int *batno, fpstr tbatch, fpstr_size_t tbatch_len)) { char cbatch[95]=" "; int length; float rbatch[NBATCHWORDS]={0.0}; int *intbuf = (int *) rbatch; MTZBAT *batch; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWBTIT");) if (MtzCheckSubInput(*mindx,"LWBTIT",2)) return; /* No check on mtzdata[*mindx-1]->n_orig_bat It might be 0 if this is the first batch written. */ /* batno = 0 is special flag to remove batch information */ /* Used for example in SCALA to write merged file from unmerged input */ if (*batno == 0) { mtzdata[*mindx-1]->n_orig_bat = 0; MtzFreeBatch(mtzdata[*mindx-1]->batch); mtzdata[*mindx-1]->batch = NULL; return; } length = (FTN_LEN(tbatch) < 70) ? FTN_LEN(tbatch) : 70 ; strncpy(cbatch,FTN_STR(tbatch),length); cbatch[length] = '\0'; intbuf[0] = NBATCHWORDS; intbuf[1] = NBATCHINTEGERS; intbuf[2] = NBATCHREALS; /* add as new batch */ batch = NULL; if (!ccp4_lwbat(mtzdata[*mindx-1], batch, *batno, rbatch, cbatch) ) ccperror(1,"LWBTIT: error in ccp4_lwbat, see messages above"); /* record number of batch headers for output */ ++nbatw[*mindx-1]; } /** Write batch header for batch number batno. New batch scales * are set. batno must correspond to pre-existing batch. * @param mindx MTZ file index * @param batno Serial number of batch. * @param batscl Array of batch scales. * @param nbatsc Number of batch scales. */ FORTRAN_SUBR ( LWBSCL, lwbscl, (const int *mindx, int *batno, float batscl[], int *nbatsc), (const int *mindx, int *batno, float batscl[], int *nbatsc), (const int *mindx, int *batno, float batscl[], int *nbatsc)) { int i,istat=-1, iprint=0; MTZBAT *batch; float rbatch[NBATCHWORDS]; int *intbatch = (int *) rbatch; char cbatch[94]; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWBSCL");) if (MtzCheckSubInput(*mindx,"LWBSCL",2)) return; /* No check on mtzdata[*mindx-1]->n_orig_bat It might be 0 if this is the first batch written. */ batch = mtzdata[*mindx-1]->batch; while (batch != NULL) { if (*batno == batch->num) { istat = 0; ccp4_lrbat(batch, rbatch, cbatch, iprint); break; } batch = batch->next; } if (istat == -1) { printf("Error: file on %d has no batch %d ! \n",*mindx,*batno); return; } /* add as new batch */ batch = NULL; intbatch[16] = *nbatsc; for (i = 0; i < *nbatsc; ++i) rbatch[72+i] = batscl[i]; if (!ccp4_lwbat(mtzdata[*mindx-1], batch, *batno, rbatch, cbatch) ) ccperror(1,"LWBSCL: error in ccp4_lwbat, see messages above"); } /** Obsolete. Use LWBSETIDX * @param mindx MTZ file index * @param batno Serial number of batch. * @param project_name Project Name * @param dataset_name Dataset Name */ FORTRAN_SUBR ( LWBSETID, lwbsetid, (const int *mindx, const int *batno, const fpstr project_name, const fpstr dataset_name, fpstr_size_t project_name_len, fpstr_size_t dataset_name_len), (const int *mindx, const int *batno, const fpstr project_name, const fpstr dataset_name), (const int *mindx, const int *batno, const fpstr project_name, fpstr_size_t project_name_len, const fpstr dataset_name, fpstr_size_t dataset_name_len)) { char *temp_xname, *temp_pname, *temp_dname; int i,istat=-1; MTZBAT *batch; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWBSETID");) if (MtzCheckSubInput(*mindx,"LWBSETID",2)) return; /* No check on mtzdata[*mindx-1]->n_orig_bat It might be 0 if this is the first batch written. */ temp_pname = ccp4_FtoCString(FTN_STR(project_name), FTN_LEN(project_name)); temp_dname = ccp4_FtoCString(FTN_STR(dataset_name), FTN_LEN(dataset_name)); /* default crystal name to project name */ temp_xname = strdup(temp_pname); batch = mtzdata[*mindx-1]->batch; /* if new batch headers have been written, skip the old ones */ if (MtzNbat(mtzdata[*mindx-1]) > mtzdata[*mindx-1]->n_orig_bat) { for (i=0; i < mtzdata[*mindx-1]->n_orig_bat; ++i) batch = batch->next; } while (batch != NULL) { if (*batno == batch->num) { istat = 0; break; } batch = batch->next; } if (istat == -1) { printf("Error in lwbsetid: file on %d has no batch %d ! \n",*mindx,*batno); } else { ccp4_lwbsetid(mtzdata[*mindx-1], batch, temp_xname, temp_dname); } free(temp_xname); free(temp_pname); free(temp_dname); } /** Assign a batch to a particular dataset, identified by crystal name * and dataset name. * @param mindx MTZ file index * @param batno Serial number of batch. * @param crystal_name Crystal Name * @param dataset_name Dataset Name */ FORTRAN_SUBR ( LWBSETIDX, lwbsetidx, (const int *mindx, const int *batno, const fpstr crystal_name, const fpstr dataset_name, fpstr_size_t crystal_name_len, fpstr_size_t dataset_name_len), (const int *mindx, const int *batno, const fpstr crystal_name, const fpstr dataset_name), (const int *mindx, const int *batno, const fpstr crystal_name, fpstr_size_t crystal_name_len, const fpstr dataset_name, fpstr_size_t dataset_name_len)) { char *temp_xname, *temp_dname; int i,istat=-1; MTZBAT *batch; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWBSETIDX");) if (MtzCheckSubInput(*mindx,"LWBSETIDX",2)) return; /* No check on mtzdata[*mindx-1]->n_orig_bat It might be 0 if this is the first batch written. */ temp_xname = ccp4_FtoCString(FTN_STR(crystal_name), FTN_LEN(crystal_name)); temp_dname = ccp4_FtoCString(FTN_STR(dataset_name), FTN_LEN(dataset_name)); batch = mtzdata[*mindx-1]->batch; /* if new batch headers have been written, skip the old ones */ if (MtzNbat(mtzdata[*mindx-1]) > mtzdata[*mindx-1]->n_orig_bat) { for (i=0; i < mtzdata[*mindx-1]->n_orig_bat; ++i) batch = batch->next; } while (batch != NULL) { if (*batno == batch->num) { istat = 0; break; } batch = batch->next; } if (istat == -1) { printf("Error in lwbsetidx: file on %d has no batch %d ! \n",*mindx,*batno); } else { ccp4_lwbsetid(mtzdata[*mindx-1], batch, temp_xname, temp_dname); } free(temp_xname); free(temp_dname); } /** Set whole array to MNF. The value of the MNF is taken from * the MTZ struct on unit mindx. * @param mindx MTZ file index * @param adata Array of reflection data to be initialised. * @param ncol Number of columns in the array to be initialised. */ FORTRAN_SUBR ( EQUAL_MAGIC, equal_magic, (const int *mindx, float adata[], const int *ncol), (const int *mindx, float adata[], const int *ncol), (const int *mindx, float adata[], const int *ncol)) { int i; union float_uint_uchar uf; /* CMTZLIB_DEBUG(puts("CMTZLIB_F: EQUAL_MAGIC");)*/ if (*mindx <= 0 || *mindx > MFILES) { printf("Error in equal_magic: mindx out of range!\n"); return; } if ( ! mtzdata[*mindx-1] ) { printf("Error in equal_magic: mindx %d not open yet!\n",*mindx); return; } if (strncmp (mtzdata[*mindx-1]->mnf.amnf,"NAN",3) == 0) { uf = ccp4_nan(); } else { uf.f = mtzdata[*mindx-1]->mnf.fmnf; } for (i = 0; i < *ncol; ++i) { adata[i] = uf.f; } } /** Set or get MNF of file. * @param mindx MTZ file index * @param val_magic Value of MNF * @param setval If true, set the MNF with the value in val_magic. * If false, return value of MNF in val_magic. Returned as true, unless * there is an error. */ FORTRAN_SUBR ( SET_MAGIC, set_magic, (const int *mindx, float *val_magic, ftn_logical *setval), (const int *mindx, float *val_magic, ftn_logical *setval), (const int *mindx, float *val_magic, ftn_logical *setval)) { union float_uint_uchar uf; CMTZLIB_DEBUG(puts("CMTZLIB_F: SET_MAGIC");) if (*mindx <= 0 || *mindx > MFILES) { printf("Error in set_magic: mindx out of range!\n"); return; } if ( ! mtzdata[*mindx-1] ) { printf("Warning in set_magic: mindx %d not open yet! MNF not set.\n",*mindx); return; } if (*setval == FORTRAN_LOGICAL_FALSE) { /* return current MNF */ if (strncmp (mtzdata[*mindx-1]->mnf.amnf,"NAN",3) == 0) { uf = ccp4_nan(); } else { uf.f = mtzdata[*mindx-1]->mnf.fmnf; } *val_magic = uf.f; } else { /* set the current MNF */ if (ccp4_utils_isnan((union float_uint_uchar *) val_magic)) { sprintf(mtzdata[*mindx-1]->mnf.amnf,"NAN"); } else { mtzdata[*mindx-1]->mnf.fmnf = *val_magic; } } *setval = FORTRAN_LOGICAL_TRUE; } /* Change value of MNF in an array */ FORTRAN_SUBR ( RESET_MAGIC, reset_magic, (const int *mindx, const float adata[], float bdata[], const int *ncol, const float *val_magica, const float *val_magicb), (const int *mindx, const float adata[], float bdata[], const int *ncol, const float *val_magica, const float *val_magicb), (const int *mindx, const float adata[], float bdata[], const int *ncol, const float *val_magica, const float *val_magicb)) { int i; float val_magic; union float_uint_uchar uf; CMTZLIB_DEBUG(puts("CMTZLIB_F: RESET_MAGIC");) val_magic = *val_magica; /* replace val_magica by file value if appropriate */ if (*mindx > 0) { if (rlun[*mindx-1] > 0 || wlun[*mindx-1] > 0) { if (strncmp (mtzdata[*mindx-1]->mnf.amnf,"NAN",3) == 0) { uf = ccp4_nan(); val_magic = uf.f; } else { val_magic = mtzdata[*mindx-1]->mnf.fmnf; } } } /* if adata[i] is a MNF replace it's value */ for (i = 0; i < *ncol; ++i) { bdata[i] = adata[i]; if (ccp4_utils_isnan((union float_uint_uchar *) &val_magic)) { if (ccp4_utils_isnan((union float_uint_uchar *) &adata[i])) bdata[i] = *val_magicb; } else { if (adata[i] == val_magic) bdata[i] = *val_magicb; } } } /** Write a one array of reflection data to output file. * This is a wrapper for ccp4_lwrefl. * @param mindx (I) MTZ file index * @param adata (I) Array of reflection data to write. * @param ifail (O) Returns 0 if successful, non-zero otherwise. */ FORTRAN_SUBR ( LWREFL_NOEXIT, lwrefl_noexit, (const int *mindx, const float adata[], int *ifail), (const int *mindx, const float adata[], int *ifail), (const int *mindx, const float adata[], int *ifail)) { /* CMTZLIB_DEBUG(puts("CMTZLIB_F: LWREFL_NOEXIT");) */ *ifail = 0; if (MtzCheckSubInput(*mindx,"LWREFL_NOEXIT",2)) { *ifail = 1; return; } ++iwref[*mindx-1]; if (!ccp4_lwrefl(mtzdata[*mindx-1],adata,collookup_out[*mindx-1], MtzNumActiveCol(mtzdata[*mindx-1]),iwref[*mindx-1]) ) { *ifail = 1; return; } } /** Write a one array of reflection data to output file. * This is a wrapper for ccp4_lwrefl. This routine exits upon * failure. * @param mindx (I) MTZ file index * @param adata (I) Array of reflection data to write. */ FORTRAN_SUBR ( LWREFL, lwrefl, (const int *mindx, const float adata[]), (const int *mindx, const float adata[]), (const int *mindx, const float adata[])) { int ifail; FORTRAN_CALL ( LWREFL_NOEXIT, lwrefl_noexit, (mindx, adata, &ifail), (mindx, adata, &ifail), (mindx, adata, &ifail)); if ( ifail ) ccperror(1,"LWREFL: failed to write reflection"); } /** Write MTZ file header and close output file. Wrapper for MtzPut. * @param mindx (I) MTZ file index * @param iprint (I) Specify whether to write output file header to log. * @param ifail (O) Returns 0 if successful, non-zero otherwise. */ FORTRAN_SUBR ( LWCLOS_NOEXIT, lwclos_noexit, (const int *mindx, int *iprint, int *ifail), (const int *mindx, int *iprint, int *ifail), (const int *mindx, int *iprint, int *ifail)) { char *fullfilename; CMTZLIB_DEBUG(puts("CMTZLIB_F: LWCLOS_NOEXIT");) *ifail = 0; if (MtzCheckSubInput(*mindx,"LWCLOS_NOEXIT",2)) { *ifail = 1; return; } /* fix number of reflections at the number "written out" */ mtzdata[*mindx-1]->nref = iwref[*mindx-1]; if ( !MtzPut(mtzdata[*mindx-1],fileout[*mindx-1]) ) { *ifail = 1; return; } if (getenv(fileout[*mindx-1]) != NULL) { fullfilename = strdup(getenv(fileout[*mindx-1])); } else { fullfilename = strdup(fileout[*mindx-1]); } ccp4printf(1,"\n WRITTEN OUTPUT MTZ FILE \n"); ccp4printf(1," Logical Name: %s Filename: %s \n\n",fileout[*mindx-1],fullfilename); if (*iprint > 0) ccp4_lhprt(mtzdata[*mindx-1], *iprint); wlun[*mindx-1] = 0; if (rlun[*mindx-1] == 0) { MtzFree(mtzdata[*mindx-1]); mtzdata[*mindx-1] = NULL; } free(fullfilename); } /** Write MTZ file header and close output file. Wrapper for MtzPut. * @param mindx (I) MTZ file index * @param iprint (I) Specify whether to write output file header to log. */ FORTRAN_SUBR ( LWCLOS, lwclos, (const int *mindx, int *iprint), (const int *mindx, int *iprint), (const int *mindx, int *iprint)) { int ifail; FORTRAN_CALL ( LWCLOS_NOEXIT, lwclos_noexit, (mindx, iprint, &ifail), (mindx, iprint, &ifail), (mindx, iprint, &ifail)); if ( ifail ) ccperror(1,"LWCLOS: failed to write output file"); } /* old internal routines - obsolete! */ FORTRAN_SUBR ( RBATHD, rbathd, (),(),()) { printf("RBATHD: Obsolete internal routine: you should not be calling this!\n"); return; } FORTRAN_SUBR ( WBATHD, wbathd, (),(),()) { printf("WBATHD: Obsolete internal routine: you should not be calling this!\n"); return; } FORTRAN_SUBR ( LRHDRL, lrhdrl, (),(),()) { printf("LRHDRL: Obsolete internal routine: you should not be calling this!\n"); return; } FORTRAN_SUBR ( LABPRT, labprt, (),(),()) { printf("LABPRT: Obsolete internal routine: you should not be calling this!\n"); return; } FORTRAN_SUBR ( LBPRTH, lbprth, (),(),()) { printf("LBPRTH: Obsolete internal routine: you should not be calling this!\n"); return; } FORTRAN_SUBR ( SORTUP, sortup, (),(),()) { printf("SORTUP: Obsolete internal routine: you should not be calling this!\n"); return; } FORTRAN_SUBR ( ADDLIN, addlin, (),(),()) { printf("ADDLIN: Obsolete internal routine: you should not be calling this!\n"); return; } FORTRAN_FUN (int, NEXTLN, nextln, (),(),()) { printf("NEXTLN: Obsolete internal function: you should not be using this!\n"); return -1; } FORTRAN_SUBR ( IS_MAGIC, is_magic, (const float *val_magic, const float *valtst, ftn_logical *lvalms), (const float *val_magic, const float *valtst, ftn_logical *lvalms), (const float *val_magic, const float *valtst, ftn_logical *lvalms)) { printf("IS_MAGIC: Obsolete internal routine: you should not be calling this!\n"); return; } libccp4-8.0.0/fortran/csymlib_f.c0000644000000000000000000015376214242731033014770 0ustar 00000000000000/* csymlib_f.c: Fortran API to CCP4 symmetry handling functions Copyright (C) 2001 CCLRC, Martyn Winn This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @page csym_f_page Fortran API to CSYM * * @section csym_f_file_list File list

  • csymlib_f.c
* * @section csym_f_overview Overview This library consists of a set of wrappers to the CSYM library giving the same API as the original symlib.f For details of the API, see the original documentation. This document covers some peculiarities of the C implementation. * @section csym_f_multiple Multiple Spacegroups The set of Fortran calls which mimic the original symlib.f assume you are working within a single spacegroup. All calls access the same spacegroup data structure, in analogy with the COMMON blocks of symlib.f For cases where you wish to work with multiple spacegroups (e.g. in the program REINDEX, a different set of calls is provided (the names of which generally start with "CCP4SPG_F_"). These identify the spacegroup of interest via an index "sindx" (by analogy with the "mindx" of mtzlib). * @section csym_f_mtz Symmetry information from MTZ files MTZ file headers contain 2 types of symmetry records:
SYMINF
Contains number of symmetry operators, number of primitive symmetry operators, lattice type, spacegroup number, spacegroup name and point group name.
SYMM
A series of records holding the symmetry operators.
Note that the spacegroup name is likely to be ambiguous at best, with no indication of the particular setting used. The primary source of symmetry information is therefore taken to be the list of symmetry operators. Note also that the order of operators is important if an ISYM column is present. */ /** @file csymlib_f.c * * @brief Fortran API for symmetry information. * * @author Martyn Winn */ /*#define FORTRAN_CALL_DEBUG 1*/ #if defined (FORTRAN_CALL_DEBUG) # define CSYMLIB_DEBUG(x) x #else # define CSYMLIB_DEBUG(x) #endif #include #include #include #include #include "ccp4_fortran.h" #include "ccp4_general.h" #include "ccp4_parser.h" #include "csymlib.h" #include "cmtzlib.h" #include "cvecmat.h" /* rcsid[] = "$Id$" */ #define MSPAC 4 #define MAXSYM 192 /* the two constants below are also defined in ccp4/csymlib.c, keep in sync */ #define MAXSYMOPS 20 #define MAXLENSYMOPSTR 80 static CCP4SPG *spacegroup = NULL; /* allow more than one spacegroup ?? */ static CCP4SPG *spacegrp[MSPAC] = {NULL}; /* cf. Eugene's channel for rwbrook */ void ccp4spg_mem_tidy(void) { CSYMLIB_DEBUG(puts("CSYMLIB_F: ccp4spg_mem_tidy");) /* free any existing spacegroup */ if ( spacegroup ) ccp4spg_free(&spacegroup); } FORTRAN_SUBR ( INVSYM, invsym, (const float a[4][4], float ai[4][4]), (const float a[4][4], float ai[4][4]), (const float a[4][4], float ai[4][4])) { CSYMLIB_DEBUG(puts("CSYMLIB_F: INVSYM");) invert4matrix(a,ai); } FORTRAN_SUBR ( SYMFR3, symfr3, (const fpstr icol, const int *i1, int *nsym, float rot[MAXSYM][4][4], int *eflag, fpstr_size_t icol_len), (const fpstr icol, const int *i1, int *nsym, float rot[MAXSYM][4][4], int *eflag), (const fpstr icol, fpstr_size_t icol_len, const int *i1, int *nsym, float rot[MAXSYM][4][4], int *eflag)) /* symfr3 ---- Read and interpret symmetry operations This is the same as symfr2 except that it doesn't abort on error Instead the error status is returned in eflag (0=success, otherwise indicates an error occured). */ { char *temp_name; int i,j,k,ns; float tmp_rot[MAXSYMOPS][4][4]; CSYMLIB_DEBUG(puts("CSYMLIB_F: SYMFR3");) /* nsym is the position to store the first symop in Convert from Fortran (starts at 1) to C (starts at 0) */ *nsym = *nsym - 1; if (*nsym < 0) *nsym = 0; /* Get the input string to interpret */ temp_name = ccp4_FtoCString(FTN_STR(icol)+(*i1-1), FTN_LEN(icol)-(*i1-1)); /* Fetch the matrices */ if ((ns = symfr_driver(temp_name,tmp_rot)) >= 0) { /* Store the matrices in Fortran ordering i.e. reverse of that normally used in C */ for (i = 0; i < ns; ++i) for (j = 0; j < 4; ++j) for (k = 0; k < 4; ++k) rot[*nsym+i][j][k] = tmp_rot[i][k][j]; *nsym = *nsym + ns; *eflag = 0; } else { /* Error occured in symfr_driver - return error*/ *eflag = 1; } /* Tidy up */ if (temp_name) free(temp_name); return; } FORTRAN_SUBR( SYMFR2, symfr2, (fpstr symchs, int *icol, int *nsym, float rot[MAXSYM][4][4], fpstr_size_t symchs_len), (fpstr symchs, int *icol, int *nsym, float rot[MAXSYM][4][4]), (fpstr symchs, fpstr_size_t symchs_len, int *icol, int *nsym, float rot[MAXSYM][4][4])) /* symfr2 ---- Read and interpret symmetry operations SYMFR2 recognises the following types of input: real space symmetry operations, e.g. X+1/2,Y-X,Z reciprocal space operations, e.g. h,l-h,-k reciprocal axis vectors, e.g. a*+c*,c*,-b* real space axis vectors, e.g. a,c-a,-b The subroutine returns the appropriate 4x4 transformation matrix for each operation. The calling program must interpret the resutling matrix(ces) correctly. Multiple symmetry operations can be specified in a single input line, and must be separated by * (with spaces either side). On entry, icol is the first character to look at nsym is the number of the first symmetry operation to be read, and returns with the last one read */ { char *temp_name; int i,j,k,ns; float tmp_rot[MAXSYMOPS][4][4]; CSYMLIB_DEBUG(puts("CSYMLIB_F: SYMFR2");) /* nsym is the position to store the first symop in Convert from Fortran (starts at 1) to C (starts at 0) */ *nsym = *nsym - 1; if (*nsym < 0) *nsym = 0; /* Get the input string to interpret */ temp_name = ccp4_FtoCString(FTN_STR(symchs)+(*icol-1), FTN_LEN(symchs)-(*icol-1)); /* Fetch the matrices */ if ((ns = symfr_driver(temp_name,tmp_rot)) >= 0) { /* Store the matrices in Fortran ordering i.e. reverse of that normally used in C */ for (i = 0; i < ns; ++i) for (j = 0; j < 4; ++j) for (k = 0; k < 4; ++k) rot[*nsym+i][j][k] = tmp_rot[i][k][j]; *nsym = *nsym + ns; } else { /* Error occured in symfr_driver - abort */ ccperror(1," **SYMMETRY OPERATOR ERROR**"); return; } /* Tidy up */ if (temp_name) free(temp_name); return; } /** Fortran wrapper for mat4_to_symop. * @param nsm number of symmetry matrices passed. * @param rsm symmetry matrices. * @param symchs symmetry strings returned. * @param iprint print flag. */ FORTRAN_SUBR ( SYMTR3, symtr3, (const int *nsm, const float rsm[MAXSYM][4][4], fpstr symchs, const int *iprint, fpstr_size_t symchs_len), (const int *nsm, const float rsm[MAXSYM][4][4], fpstr symchs, const int *iprint), (const int *nsm, const float rsm[MAXSYM][4][4], fpstr symchs, fpstr_size_t symchs_len, const int *iprint)) { char temp_symch[80]; int i,j,k; float rsym[4][4]; CSYMLIB_DEBUG(puts("CSYMLIB_F: SYMTR3");) for (i = 0; i < *nsm; ++i) { /* need to transpose F to C */ for (j = 0; j < 4; ++j) for (k = 0; k < 4; ++k) rsym[j][k] = rsm[i][k][j]; mat4_to_symop(temp_symch,temp_symch+79,(const float (*)[4])rsym); /* mat4_to_symop fills temp_symch with spaces */ /* ccp4_CtoFString will perform strlen(temp_symch) */ temp_symch[79] = '\0'; ccp4_CtoFString(FTN_STR(symchs+i*FTN_LEN(symchs)),FTN_LEN(symchs),temp_symch); if (*iprint) { printf("Symmetry %d %s \n",i+1,temp_symch); } } } /** Fortran wrapper for mat4_to_symop. * @param nsm number of symmetry matrices passed. * @param rsm symmetry matrices. * @param symchs symmetry strings returned. */ FORTRAN_SUBR ( SYMTR4, symtr4, (const int *nsm, const float rsm[MAXSYM][4][4], fpstr symchs, fpstr_size_t symchs_len), (const int *nsm, const float rsm[MAXSYM][4][4], fpstr symchs), (const int *nsm, const float rsm[MAXSYM][4][4], fpstr symchs, fpstr_size_t symchs_len)) { char temp_symch[80]; int i,j,k; float rsym[4][4]; CSYMLIB_DEBUG(puts("CSYMLIB_F: SYMTR4");) for (i = 0; i < *nsm; ++i) { /* need to transpose F to C */ for (j = 0; j < 4; ++j) for (k = 0; k < 4; ++k) rsym[j][k] = rsm[i][k][j]; mat4_to_symop(temp_symch,temp_symch+80,(const float (*)[4])rsym); /* mat4_to_symop will pad with spaces, but ccp4_CtoFString needs * null-terminated */ temp_symch[79] = '\0'; ccp4_CtoFString(FTN_STR(symchs+i*FTN_LEN(symchs)),FTN_LEN(symchs),temp_symch); } } FORTRAN_SUBR ( PGMDF, pgmdf, (int *jlass, int*jcentr, int jscrew[3]), (int *jlass, int*jcentr, int jscrew[3]), (int *jlass, int*jcentr, int jscrew[3])) { static int klass, icentr, iscrew[3]; CSYMLIB_DEBUG(puts("CSYMLIB_F: PGMDF");) if (*jlass==0) { /* need to set these variables */ *jlass = klass; *jcentr = icentr; jscrew[0] = iscrew[0]; jscrew[1] = iscrew[1]; jscrew[2] = iscrew[2]; } else { klass = *jlass; icentr = *jcentr; iscrew[0] = jscrew[0]; iscrew[1] = jscrew[1]; iscrew[2] = jscrew[2]; } /* sorry, too lazy to do write statements! */ } FORTRAN_SUBR ( PGDEFN, pgdefn, (fpstr nampg, int *nsymp, const int *nsym, float rsmt[192][4][4], const ftn_logical *lprint, fpstr_size_t nampg_len), (fpstr nampg, int *nsymp, const int *nsym, float rsmt[192][4][4], const ftn_logical *lprint), (fpstr nampg, fpstr_size_t nampg_len, int *nsymp, const int *nsym, float rsmt[192][4][4], const ftn_logical *lprint)) { int i,j,k,l,nsym1; ccp4_symop *op1; CSYMLIB_DEBUG(puts("CSYMLIB_F: PGDEFN");) /* free any existing spacegroup and start again */ if ( spacegroup ) ccp4spg_free(&spacegroup); op1 = (ccp4_symop *) ccp4_utils_malloc(*nsym*sizeof(ccp4_symop)); for (i = 0; i < *nsym; ++i) { for (k = 0; k < 3; ++k) { for (l = 0; l < 3; ++l) op1[i].rot[k][l] = rsmt[i][l][k]; /* Discard any translational component - it's not required anyway when looking up the point group */ op1[i].trn[k] = 0.0; } } /* Throw away symops that are duplicated once the translations have been removed */ nsym1 = *nsym; i = 0; while ( i < nsym1 ) { j = i + 1; while ( j < nsym1 ) { if (ccp4_symop_code( op1[i] ) == ccp4_symop_code( op1[j] )) { /* Duplication - overwrite this with the symop at the end of the list */ --nsym1; for (k = 0; k < 3; ++k) { for (l = 0; l < 3; ++l) { op1[j].rot[k][l] = op1[nsym1].rot[k][l]; } /* Nb don't increment j as we need to test the 'new' symop for duplication before stepping on */ } } else { /* Look at next symop */ ++j; } } /* Look at next symop */ ++i; } /* first, identify a spacegroup from supplied symops */ spacegroup = ccp4_spgrp_reverse_lookup(nsym1,op1); free(op1); if (!spacegroup) ccperror(1,"Fatal error in PGDEFN"); ccp4_CtoFString(FTN_STR(nampg),FTN_LEN(nampg),spacegroup->point_group); *nsymp = spacegroup->nsymop_prim; } /** Return Laue number and name for current spacegroup. * @param nampg Point group name (unused in this implementation) * @param nlaue Laue number * @param launam Laue name */ FORTRAN_SUBR ( PGNLAU, pgnlau, (const fpstr nampg, int *nlaue, fpstr launam, fpstr_size_t nampg_len, fpstr_size_t launam_len), (const fpstr nampg, int *nlaue, fpstr launam), (const fpstr nampg, fpstr_size_t nampg_len, int *nlaue, fpstr launam, fpstr_size_t launam_len)) { char *temp_pgname; CSYMLIB_DEBUG(puts("CSYMLIB_F: PGNLAU");) temp_pgname = ccp4_FtoCString(FTN_STR(nampg), FTN_LEN(nampg)); if (!spacegroup || !ccp4spg_pgname_equal(spacegroup->point_group,temp_pgname)) { printf("PGNLAU: No spacegroup or incorrect spacegroup loaded! \n"); free(temp_pgname); return; } /* We should check we have the right spacegroup! However, nampg is typically in the format of the MTZ header record, which is different from that recorded in syminfo.lib */ *nlaue = spacegroup->nlaue; ccp4_CtoFString(FTN_STR(launam),FTN_LEN(launam),spacegroup->laue_name); free(temp_pgname); } /** Return Laue number and name for a spacegroup onto index "sindx". * @param sindx index of this spacegroup. * @param nlaue Laue number * @param launam Laue name */ FORTRAN_SUBR ( CCP4SPG_F_GET_LAUE, ccp4spg_f_get_laue, (const int *sindx, int *nlaue, fpstr launam, fpstr_size_t launam_len), (const int *sindx, int *nlaue, fpstr launam), (const int *sindx, int *nlaue, fpstr launam, fpstr_size_t launam_len)) { CSYMLIB_DEBUG(puts("CSYMLIB_F: CCP4SPG_F_GET_LAUE");) if (*sindx <= 0 || *sindx > MSPAC) { printf("Error in CCP4SPG_F_GET_LAUE: sindx %d out of range!\n",*sindx); return; } if ( ! spacegrp[*sindx-1] ) { printf("CCP4SPG_F_GET_LAUE: No spacegroup loaded on channel %d ! \n",*sindx); return; } *nlaue = spacegrp[*sindx-1]->nlaue; ccp4_CtoFString(FTN_STR(launam),FTN_LEN(launam),spacegrp[*sindx-1]->laue_name); } /** Return ranges on H K L appropriate to spacegroup. * @param sindx index of this spacegroup. * @param nlaue Laue number * @param launam Laue name */ FORTRAN_SUBR ( HKLRANGE, hklrange, (int *ihrng0, int *ihrng1, int *ikrng0, int *ikrng1, int *ilrng0, int *ilrng1), (int *ihrng0, int *ihrng1, int *ikrng0, int *ikrng1, int *ilrng0, int *ilrng1), (int *ihrng0, int *ihrng1, int *ikrng0, int *ikrng1, int *ilrng0, int *ilrng1)) { int i,j,itest; int test[8],max; CSYMLIB_DEBUG(puts("CSYMLIB_F: HKLRANGE");) if (!spacegroup) { ccperror(2,"HKLRANGE: No spacegroup loaded yet! \n"); return; } /* set up maximum ranges */ *ihrng0 = - (*ihrng1); *ikrng0 = - (*ikrng1); *ilrng0 = - (*ilrng1); max = *ihrng1; if (*ikrng1 > max) max = *ikrng1; if (*ilrng1 > max) max = *ilrng1; test[0] = -max-2; test[1] = -max-1; test[2] = -max+1; test[3] = -1; test[4] = 1; test[5] = max-1; test[6] = max+1; test[7] = max+2; /* now try to cut it down by testing points */ /* this is overkill but should be safe */ /* update: not so simple. Didn't work for R32, see bugzilla 4149 */ /* should be fixed now, but if further problems then consider not cutting down at all */ itest = 0; for (i = 0; i < 8; ++i) for (j = 0; j < 8; ++j) if (ccp4spg_is_in_asu(spacegroup,*ihrng0,test[i],test[j])) itest = 1; if (!itest) *ihrng0 = 0; itest = 0; for (i = 0; i < 8; ++i) for (j = 0; j < 8; ++j) if (ccp4spg_is_in_asu(spacegroup,*ihrng1,test[i],test[j])) itest = 1; if (!itest) *ihrng1 = 0; itest = 0; for (i = 0; i < 8; ++i) for (j = 0; j < 8; ++j) if (ccp4spg_is_in_asu(spacegroup,test[i],*ikrng0,test[j])) itest = 1; if (!itest) *ikrng0 = 0; itest = 0; for (i = 0; i < 8; ++i) for (j = 0; j < 8; ++j) if (ccp4spg_is_in_asu(spacegroup,test[i],*ikrng1,test[j])) itest = 1; if (!itest) *ikrng1 = 0; itest = 0; for (i = 0; i < 8; ++i) for (j = 0; j < 8; ++j) if (ccp4spg_is_in_asu(spacegroup,test[i],test[j],*ilrng0)) itest = 1; if (!itest) *ilrng0 = 0; itest = 0; for (i = 0; i < 8; ++i) for (j = 0; j < 8; ++j) if (ccp4spg_is_in_asu(spacegroup,test[i],test[j],*ilrng1)) itest = 1; if (!itest) *ilrng1 = 0; } /** Return the Patterson group name and number corresponding to a spacegroup * identified by spacegroup name and point group name. * @param spgnam On input, spacegroup name. * @param pgname On input, point group name. * @param patnam On return, Patterson spacegroup name. * @param lpatsg On return, Patterson spacegroup number. */ FORTRAN_SUBR ( PATSGP, patsgp, (const fpstr spgnam, const fpstr pgname, fpstr patnam, int *lpatsg, fpstr_size_t spgnam_len, fpstr_size_t pgname_len, fpstr_size_t patnam_len), (const fpstr spgnam, const fpstr pgname, fpstr patnam, int *lpatsg), (const fpstr spgnam, fpstr_size_t spgnam_len, const fpstr pgname, fpstr_size_t pgname_len, fpstr patnam, fpstr_size_t patnam_len, int *lpatsg)) { CCP4SPG *tmp_spacegroup; char *temp_spgnam, *temp_pgname; CSYMLIB_DEBUG(puts("CSYMLIB_F: PATSGP");) temp_spgnam = ccp4_FtoCString(FTN_STR(spgnam), FTN_LEN(spgnam)); temp_pgname = ccp4_FtoCString(FTN_STR(pgname), FTN_LEN(pgname)); if ( !spacegroup || !ccp4spg_name_equal_to_lib(spacegroup->symbol_xHM,temp_spgnam) || !ccp4spg_pgname_equal(spacegroup->point_group,temp_pgname) ) { /* load temporary spacegroup */ if ( ! (tmp_spacegroup = ccp4spg_load_by_ccp4_spgname(temp_spgnam)) ) { printf("PATSGP: failed to load spacegroup info from SYMINFO! \n"); free(temp_spgnam); free(temp_pgname); return; } *lpatsg = tmp_spacegroup->npatt; ccp4_CtoFString(FTN_STR(patnam),FTN_LEN(patnam),tmp_spacegroup->patt_name); free(tmp_spacegroup); } else { *lpatsg = spacegroup->npatt; ccp4_CtoFString(FTN_STR(patnam),FTN_LEN(patnam),spacegroup->patt_name); } free(temp_spgnam); free(temp_pgname); } /** Set spacegroup for subsequent calls to ASUPUT, ASUGET, ASUSYM and ASUPHP. * @param spgnam spacegroup name * @param numsgp spacegroup number * @param pgname On return, point group name * @param msym number of symmetry matrices passed. * @param rrsym symmetry matrices (preferred method of identifying spacegroup). * @param msymp On return, number of primitive symmetry operators * @param mlaue On return, number of Laue group. * @param lprint If true, print symmetry information. */ FORTRAN_SUBR ( ASUSET, asuset, (fpstr spgnam, int *numsgp, fpstr pgname, int *msym, float rrsym[192][4][4], int *msymp, int *mlaue, ftn_logical *lprint, fpstr_size_t spgnam_len, fpstr_size_t pgname_len), (fpstr spgnam, int *numsgp, fpstr pgname, int *msym, float rrsym[192][4][4], int *msymp, int *mlaue, ftn_logical *lprint), (fpstr spgnam, fpstr_size_t spgnam_len, int *numsgp, fpstr pgname, fpstr_size_t pgname_len, int *msym, float rrsym[192][4][4], int *msymp, int *mlaue, ftn_logical *lprint)) { int i,k,l; ccp4_symop *op1; CSYMLIB_DEBUG(puts("CSYMLIB_F: ASUSET");) /* free any existing spacegroup and start again */ if ( spacegroup ) ccp4spg_free(&spacegroup); op1 = (ccp4_symop *) ccp4_utils_malloc(*msym*sizeof(ccp4_symop)); for (i = 0; i < *msym; ++i) { for (k = 0; k < 3; ++k) { for (l = 0; l < 3; ++l) op1[i].rot[k][l] = rrsym[i][l][k]; op1[i].trn[k] = rrsym[i][3][k]; } } /* Loading by symops ensures spacegroup has desired ordering of symops. This is important for ASUGET which may use ISYM stored in MTZ file. */ spacegroup = ccp4_spgrp_reverse_lookup(*msym,op1); /* If we fail to find match for symops, fall back on spacegroup number. */ if (!spacegroup ) { if (*numsgp > 0) { if ( ! (spacegroup = ccp4spg_load_by_ccp4_num(*numsgp)) ) { printf("ASUSET: failed to load spacegroup info from SYMINFO! \n"); ccperror(1,"Fatal error in ASUSET."); return; } } else { printf("ASUSET: no spacegroup info! \n"); ccperror(1,"Fatal error in ASUSET."); return; } } ccp4_CtoFString(FTN_STR(pgname),FTN_LEN(pgname),spacegroup->point_group); *msymp = spacegroup->nsymop_prim; *mlaue = spacegroup->nlaue; if (*lprint != FORTRAN_LOGICAL_FALSE) ccp4spg_print_recip_spgrp(spacegroup); free(op1); } /** Return symmetry operators and inverses, set up by ASUSET. * @param rassym symmetry operators. * @param rinsym inverse symmetry operators. * @param nisym number of symmetry operators returned. */ FORTRAN_SUBR ( ASUSYM, asusym, (float rassym[384][4][4], float rinsym[384][4][4], int *nisym), (float rassym[384][4][4], float rinsym[384][4][4], int *nisym), (float rassym[384][4][4], float rinsym[384][4][4], int *nisym)) { int i,j,k,l; float sgn; CSYMLIB_DEBUG(puts("CSYMLIB_F: ASUSYM");) if (spacegroup) { *nisym = 0; for (i = 0; i < spacegroup->nsymop_prim; ++i) { sgn = +1.0; for (j = 0; j < 2; ++j) { for (k = 0; k < 3; ++k) { for (l = 0; l < 3; ++l) { rassym[*nisym][l][k] = sgn * spacegroup->symop[i].rot[k][l]; rinsym[*nisym][l][k] = sgn * spacegroup->invsymop[i].rot[k][l]; } rassym[*nisym][3][k] = sgn * spacegroup->symop[i].trn[k]; rinsym[*nisym][3][k] = sgn * spacegroup->invsymop[i].trn[k]; rassym[*nisym][k][3] = 0.0; rinsym[*nisym][k][3] = 0.0; } rassym[*nisym][3][3] = 1.0; rinsym[*nisym][3][3] = 1.0; ++(*nisym); sgn = -1.0; } } } else { ccperror(2,"ASUSYM: No spacegroup loaded yet! \n"); } } /** Put reflection in asymmetric unit, as set up by ASUSET. * @param ihkl input indices. * @param jhkl output indices. * @param isym symmetry operation applied (ISYM number). */ FORTRAN_SUBR ( ASUPUT, asuput, (const int ihkl[3], int jhkl[3], int *isym), (const int ihkl[3], int jhkl[3], int *isym), (const int ihkl[3], int jhkl[3], int *isym)) { int hin,kin,lin,hout,kout,lout; CSYMLIB_DEBUG(puts("CSYMLIB_F: ASUPUT");) hin = ihkl[0]; kin = ihkl[1]; lin = ihkl[2]; *isym = ccp4spg_put_in_asu(spacegroup, hin, kin, lin, &hout, &kout, &lout); jhkl[0] = hout; jhkl[1] = kout; jhkl[2] = lout; } /** Get the original indices jkhl from input indices ihkl generated * under symmetry operation isym. * @param ihkl input indices. * @param jhkl output indices (recovered original indices). * @param isym symmetry operation to be applied (ISYM number). */ FORTRAN_SUBR ( ASUGET, asuget, (const int ihkl[3], int jhkl[3], const int *isym), (const int ihkl[3], int jhkl[3], const int *isym), (const int ihkl[3], int jhkl[3], const int *isym)) { int hin,kin,lin,hout,kout,lout; CSYMLIB_DEBUG(puts("CSYMLIB_F: ASUGET");) hin = ihkl[0]; kin = ihkl[1]; lin = ihkl[2]; ccp4spg_generate_indices(spacegroup, *isym, hin, kin, lin, &hout, &kout, &lout); jhkl[0] = hout; jhkl[1] = kout; jhkl[2] = lout; } /** Generate phase of symmetry equivalent JHKL from that of IHKL. * @param jhkl indices hkl generated in ASUPUT * @param lsym symmetry number for generating JHKL * @param isign 1 for I+ , -1 for I- * @param phasin phase for reflection IHKL * @param phasout phase for reflection JHKL */ FORTRAN_SUBR ( ASUPHP, asuphp, (const int jhkl[3], const int *lsym, const int *isign, const float *phasin, float *phasout), (const int jhkl[3], const int *lsym, const int *isign, const float *phasin, float *phasout), (const int jhkl[3], const int *lsym, const int *isign, const float *phasin, float *phasout)) { int hin,kin,lin; float trans[3]; CSYMLIB_DEBUG(puts("CSYMLIB_F: ASUPHP");) trans[0] = spacegroup->symop[*lsym-1].trn[0]; trans[1] = spacegroup->symop[*lsym-1].trn[1]; trans[2] = spacegroup->symop[*lsym-1].trn[2]; hin = jhkl[0]; kin = jhkl[1]; lin = jhkl[2]; *phasout = ccp4spg_phase_shift(hin, kin, lin, *phasin, trans, *isign); } /** Loads a spacegroup onto index "sindx". The spacegroup is * identified by the spacegroup name. * @param sindx index of this spacegroup. * @param namspg spacegroup name. */ FORTRAN_SUBR ( CCP4SPG_F_LOAD_BY_NAME, ccp4spg_f_load_by_name, (const int *sindx, fpstr namspg, fpstr_size_t namspg_len), (const int *sindx, fpstr namspg), (const int *sindx, fpstr namspg, fpstr_size_t namspg_len)) { char *temp_name; CSYMLIB_DEBUG(puts("CSYMLIB_F: CCP4SPG_F_LOAD_BY_NAME");) if (*sindx <= 0 || *sindx > MSPAC) { printf("Error in CCP4SPG_F_LOAD_BY_NAME: sindx %d out of range!\n",*sindx); return; } /* free any existing spacegroup and start again */ if ( spacegrp[*sindx-1] ) ccp4spg_free(&spacegrp[*sindx-1]); temp_name = ccp4_FtoCString(FTN_STR(namspg), FTN_LEN(namspg)); if (strlen(temp_name)) { spacegrp[*sindx-1] = ccp4spg_load_by_ccp4_spgname(temp_name); } free (temp_name); } /** Loads a spacegroup onto index "sindx". The spacegroup is * identified by the set of symmetry matrices. * @param sindx index of this spacegroup. * @param msym number of symmetry matrices passed. * @param rrsym symmetry matrices. */ FORTRAN_SUBR ( CCP4SPG_F_LOAD_BY_OPS, ccp4spg_f_load_by_ops, (const int *sindx, int *msym, float rrsym[192][4][4]), (const int *sindx, int *msym, float rrsym[192][4][4]), (const int *sindx, int *msym, float rrsym[192][4][4])) { int i,k,l; ccp4_symop *op1; CSYMLIB_DEBUG(puts("CSYMLIB_F: CCP4SPG_F_LOAD_BY_OPS");) if (*sindx <= 0 || *sindx > MSPAC) { printf("Error in CCP4SPG_F_LOAD_BY_OPS: sindx %d out of range!\n",*sindx); return; } /* free any existing spacegroup and start again */ if ( spacegrp[*sindx-1] ) ccp4spg_free(&spacegrp[*sindx-1]); op1 = (ccp4_symop *) ccp4_utils_malloc(*msym*sizeof(ccp4_symop)); for (i = 0; i < *msym; ++i) { for (k = 0; k < 3; ++k) { for (l = 0; l < 3; ++l) op1[i].rot[k][l] = rrsym[i][l][k]; op1[i].trn[k] = rrsym[i][3][k]; } } /* Loading by symops ensures spacegroup has desired ordering of symops. This is important for ASUGET which may use ISYM stored in MTZ file. */ spacegrp[*sindx-1] = ccp4_spgrp_reverse_lookup(*msym,op1); if (!spacegroup ) { printf("CCP4SPG_F_LOAD_BY_OPS: no spacegroup info! \n"); ccperror(1,"Fatal error in CCP4SPG_F_LOAD_BY_OPS."); return; } ccp4spg_print_recip_spgrp(spacegrp[*sindx-1]); free(op1); } /** Compare two sets of symmetry operators to see if they are * in the same order. This is important for the consistent use * of ISYM which encodes the operator position in the list. * @param msym1 number of symmetry matrices passed in first list. * @param rrsym1 first list of symmetry matrices. * @param msym2 number of symmetry matrices passed in second list. * @param rrsym2 second list of symmetry matrices. * @return 1 if operator lists are equal and in the same order, 0 otherwise */ FORTRAN_FUN (int, CCP4SPG_F_EQUAL_OPS_ORDER, ccp4spg_f_equal_ops_order, (int *msym1, float rrsym1[192][4][4],int *msym2, float rrsym2[192][4][4]), (int *msym1, float rrsym1[192][4][4],int *msym2, float rrsym2[192][4][4]), (int *msym1, float rrsym1[192][4][4],int *msym2, float rrsym2[192][4][4])) { int i,k,l,ret; ccp4_symop *op1, *op2; CSYMLIB_DEBUG(puts("CSYMLIB_F: CCP4SPG_F_EQUAL_OPS_ORDER");) op1 = (ccp4_symop *) ccp4_utils_malloc(*msym1*sizeof(ccp4_symop)); for (i = 0; i < *msym1; ++i) { for (k = 0; k < 3; ++k) { for (l = 0; l < 3; ++l) op1[i].rot[k][l] = rrsym1[i][l][k]; op1[i].trn[k] = rrsym1[i][3][k]; } } op2 = (ccp4_symop *) ccp4_utils_malloc(*msym2*sizeof(ccp4_symop)); for (i = 0; i < *msym2; ++i) { for (k = 0; k < 3; ++k) { for (l = 0; l < 3; ++l) op2[i].rot[k][l] = rrsym2[i][l][k]; op2[i].trn[k] = rrsym2[i][3][k]; } } ret = ccp4_spgrp_equal_order(*msym1, op1, *msym2, op2); free(op1); free(op2); return ret; } /** Put reflection in asymmetric unit of spacegroup on index sindx. * @param sindx index of this spacegroup. * @param ihkl input indices. * @param jhkl output indices. * @param isym symmetry operation applied (ISYM number). */ FORTRAN_SUBR ( CCP4SPG_F_ASUPUT, ccp4spg_f_asuput, (const int *sindx, const int ihkl[3], int jhkl[3], int *isym), (const int *sindx, const int ihkl[3], int jhkl[3], int *isym), (const int *sindx, const int ihkl[3], int jhkl[3], int *isym)) { int hin,kin,lin,hout,kout,lout; CSYMLIB_DEBUG(puts("CSYMLIB_F: CCP4SPG_F_ASUPUT");) if (*sindx <= 0 || *sindx > MSPAC) { printf("Error in CCP4SPG_F_ASUPUT: sindx %d out of range!\n",*sindx); return; } if ( ! spacegrp[*sindx-1] ) { printf("CCP4SPG_F_ASUPUT: No spacegroup loaded on channel %d ! \n",*sindx); return; } hin = ihkl[0]; kin = ihkl[1]; lin = ihkl[2]; *isym = ccp4spg_put_in_asu(spacegrp[*sindx-1], hin, kin, lin, &hout, &kout, &lout); jhkl[0] = hout; jhkl[1] = kout; jhkl[2] = lout; } /** Test whether reflection or it's Friedel mate is in asu. * The argument nlaue is checked against the value for the current * spacegroup: if it differs then spacegroup->nlaue is updated temporarily. * @param ihkl reflection indices. * @param nlaue Laue group number. * @return 1 if in asu, -1 if -h -k -l is in asu, 0 otherwise */ FORTRAN_FUN (int, INASU, inasu, (const int ihkl[3], const int *nlaue), (const int ihkl[3], const int *nlaue), (const int ihkl[3], const int *nlaue)) { int ih, ik, il, nlaue_save = -1, retval; CSYMLIB_DEBUG(puts("CSYMLIB_F: INASU");) if (!spacegroup) { ccperror(2,"INASU: No spacegroup loaded yet! \n"); return 999; } if (spacegroup->nlaue != *nlaue) { /* The requested Laue number is different to that for the current spacegroup Save the current Laue code and load the data for the requested code */ nlaue_save = spacegroup->nlaue; if (ccp4spg_load_laue(spacegroup,*nlaue)) { printf("INASU: unrecognised CCP4 Laue code\n"); return 999; } } ih = ihkl[0]; ik = ihkl[1]; il = ihkl[2]; retval = ccp4spg_is_in_pm_asu(spacegroup,ih,ik,il); if (nlaue_save > -1) { /* Restore previous settings */ ccp4spg_load_laue(spacegroup,nlaue_save); } return retval; } /** Test whether reflection or it's Friedel mate is in the asymmetric * unit of the spacegroup on index "sindx". * @param sindx index of this spacegroup. * @param ihkl reflection indices. * @return 1 if in asu, -1 if -h -k -l is in asu, 0 otherwise */ FORTRAN_FUN (int, CCP4SPG_F_INASU, ccp4spg_f_inasu, (const int *sindx, const int ihkl[3]), (const int *sindx, const int ihkl[3]), (const int *sindx, const int ihkl[3])) { int ih, ik, il, retval; CSYMLIB_DEBUG(puts("CSYMLIB_F: CCP4SPG_F_INASU");) if (*sindx <= 0 || *sindx > MSPAC) { printf("Error in CCP4SPG_F_INASU: sindx %d out of range!\n",*sindx); return 999; } if ( ! spacegrp[*sindx-1] ) { printf("CCP4SPG_F_INASU: No spacegroup loaded on channel %d ! \n",*sindx); return 999; } ih = ihkl[0]; ik = ihkl[1]; il = ihkl[2]; retval = ccp4spg_is_in_pm_asu(spacegrp[*sindx-1],ih,ik,il); return retval; } FORTRAN_SUBR ( PRTRSM, prtrsm, (const fpstr pgname, const int *nsymp, const float rsymiv[192][4][4], fpstr_size_t pgname_len), (const fpstr pgname, const int *nsymp, const float rsymiv[192][4][4]), (const fpstr pgname, fpstr_size_t pgname_len, const int *nsymp, const float rsymiv[192][4][4])) { CSYMLIB_DEBUG(puts("CSYMLIB_F: PRTRSM");) ccp4spg_print_recip_ops(spacegroup); } void ccp4spg_register_by_ccp4_num(int numspg) { CSYMLIB_DEBUG(puts("CSYMLIB_F: ccp4spg_register_by_ccp4_num");) /* free any existing spacegroup and start again */ if ( spacegroup ) ccp4spg_free(&spacegroup); spacegroup = ccp4spg_load_by_ccp4_num(numspg); if (!spacegroup) ccperror(1,"Fatal error in ccp4spg_register_by_ccp4_num"); } void ccp4spg_register_by_symops(int nops, float rsm[][4][4]) { int i,k,l; ccp4_symop *op1; CSYMLIB_DEBUG(puts("CSYMLIB_F: ccp4spg_register_by_symops");) /* free any existing spacegroup and start again */ if ( spacegroup ) ccp4spg_free(&spacegroup); /* identify spacegroup from supplied symops */ op1 = (ccp4_symop *) ccp4_utils_malloc(nops*sizeof(ccp4_symop)); for (i = 0; i < nops; ++i) { for (k = 0; k < 3; ++k) { for (l = 0; l < 3; ++l) { op1[i].rot[k][l] = rsm[i][k][l]; } op1[i].trn[k] = rsm[i][k][3]; } } spacegroup = ccp4_spgrp_reverse_lookup(nops,op1); free(op1); if (!spacegroup) ccperror(1,"Fatal error in ccp4spg_register_by_symops"); } /** Fortran wrapper for ccp4spg_load_by_* functions. * @param ist Obsolete parameter. * @param lspgrp Spacegroup number in CCP4 convention. If set on * entry, used to search for spacegroup. Returned value is that found. * @param namspg_cif Spacegroup name. If set on * entry, used to search for spacegroup. Returned value is the full * extended Hermann Mauguin symbol, with one slight alteration. Symbols * such as 'R 3 :H' are converted to 'H 3'. This is for backwards compatibility. * @param namspg_cifs On output, contains the spacegroup name without * any spaces. * @param nampg On output, the point group name. * @param nsymp On output, the number of primitive symmetry operators. * @param nsym On output, the total number of symmetry operators. * @param rlsymmmatrx On output, the symmetry operators. */ FORTRAN_SUBR ( MSYMLB3, msymlb3, (const int *ist, int *lspgrp, fpstr namspg_cif, fpstr namspg_cifs, fpstr nampg, int *nsymp, int *nsym, float rlsymmmatrx[192][4][4], fpstr_size_t namspg_cif_len, fpstr_size_t namspg_cifs_len, fpstr_size_t nampg_len), (const int *ist, int *lspgrp, fpstr namspg_cif, fpstr namspg_cifs, fpstr nampg, int *nsymp, int *nsym, float rlsymmmatrx[192][4][4]), (const int *ist, int *lspgrp, fpstr namspg_cif, fpstr_size_t namspg_cif_len, fpstr namspg_cifs, fpstr_size_t namspg_cifs_len, fpstr nampg, fpstr_size_t nampg_len, int *nsymp, int *nsym, float rlsymmmatrx[192][4][4])) { int i,j,k; char *temp_name, *shortname=NULL, *no_colon_name=NULL; CSYMLIB_DEBUG(puts("CSYMLIB_F: MSYMLB3");) /* search by number first we assume that lspgrp is in CCP4 convention */ if (*lspgrp > 0) { /* free any existing spacegroup and start again */ if ( spacegroup ) ccp4spg_free(&spacegroup); spacegroup = ccp4spg_load_by_ccp4_num(*lspgrp); } else { /* else try to search by name */ temp_name = ccp4_FtoCString(FTN_STR(namspg_cif), FTN_LEN(namspg_cif)); if (strlen(temp_name)) { /* free any existing spacegroup and start again */ if ( spacegroup ) ccp4spg_free(&spacegroup); spacegroup = ccp4spg_load_by_ccp4_spgname(temp_name); } free (temp_name); } if (spacegroup) { if (spacegroup->spg_ccp4_num > 0) { *lspgrp = spacegroup->spg_ccp4_num; } else { *lspgrp = spacegroup->spg_num; } /* produce de-coloned version of xHM symbol */ if (strlen(spacegroup->symbol_xHM) > 0) { no_colon_name = (char *) ccp4_utils_malloc((strlen(spacegroup->symbol_xHM)+1)*sizeof(char)); strcpy(no_colon_name,spacegroup->symbol_xHM); } else { /* If no _xHM try _old. This should only happen in exceptional circumstances! */ no_colon_name = (char *) ccp4_utils_malloc((strlen(spacegroup->symbol_old)+1)*sizeof(char)); strcpy(no_colon_name,spacegroup->symbol_old); } ccp4spg_name_de_colon(no_colon_name); ccp4_CtoFString(FTN_STR(namspg_cif),FTN_LEN(namspg_cif),no_colon_name); if (spacegroup->symbol_old) { if (strlen(spacegroup->symbol_old) > 0) { shortname = (char *) ccp4_utils_malloc((strlen(spacegroup->symbol_old)+1)*sizeof(char)); ccp4spg_to_shortname(shortname,spacegroup->symbol_old); } } if (!shortname) { if (strlen(no_colon_name) > 0) { shortname = (char *) ccp4_utils_malloc((strlen(no_colon_name)+1)*sizeof(char)); ccp4spg_to_shortname(shortname,no_colon_name); } } ccp4_CtoFString(FTN_STR(namspg_cifs),FTN_LEN(namspg_cifs),shortname); free(shortname); ccp4_CtoFString(FTN_STR(nampg),FTN_LEN(nampg),spacegroup->point_group); *nsymp = spacegroup->nsymop_prim; *nsym = spacegroup->nsymop; for (i = 0; i < *nsym; ++i) { for (j = 0; j < 3; ++j) { for (k = 0; k < 3; ++k) rlsymmmatrx[i][k][j] = spacegroup->symop[i].rot[j][k]; rlsymmmatrx[i][3][j] = spacegroup->symop[i].trn[j]; rlsymmmatrx[i][j][3] = 0.0; } rlsymmmatrx[i][3][3] = 1.0; } } } FORTRAN_SUBR ( MSYMLB, msymlb, (const int *ist, int *lspgrp, fpstr namspg_cif, fpstr nampg, int *nsymp, int *nsym, float rlsymmmatrx[192][4][4], fpstr_size_t namspg_cif_len, fpstr_size_t nampg_len), (const int *ist, int *lspgrp, fpstr namspg_cif, fpstr nampg, int *nsymp, int *nsym, float rlsymmmatrx[192][4][4]), (const int *ist, int *lspgrp, fpstr namspg_cif, fpstr_size_t namspg_cif_len, fpstr nampg, fpstr_size_t nampg_len, int *nsymp, int *nsym, float rlsymmmatrx[192][4][4])) { char namspg_cifs; int namspg_cifs_len=0; CSYMLIB_DEBUG(puts("CSYMLIB_F: MSYMLB");) FORTRAN_CALL ( MSYMLB3, msymlb3, (ist, lspgrp, namspg_cif, &namspg_cifs, nampg, nsymp, nsym, rlsymmmatrx, namspg_cif_len, namspg_cifs_len, nampg_len), (ist, lspgrp, namspg_cif, &namspg_cifs, nampg, nsymp, nsym, rlsymmmatrx), (ist, lspgrp, namspg_cif, namspg_cif_len, &namspg_cifs, namspg_cifs_len, nampg, nampg_len, nsymp, nsym, rlsymmmatrx)); } FORTRAN_SUBR ( MSYMLB2, msymlb2, (const int *ist, int *lspgrp, fpstr namspg_cif, fpstr nampg, int *nsymp, int *nsym, float rlsymmmatrx[192][4][4], fpstr_size_t namspg_cif_len, fpstr_size_t nampg_len), (const int *ist, int *lspgrp, fpstr namspg_cif, fpstr nampg, int *nsymp, int *nsym, float rlsymmmatrx[192][4][4]), (const int *ist, int *lspgrp, fpstr namspg_cif, fpstr_size_t namspg_cif_len, fpstr nampg, fpstr_size_t nampg_len, int *nsymp, int *nsym, float rlsymmmatrx[192][4][4])) { char namspg_cifs; int namspg_cifs_len=0; CSYMLIB_DEBUG(puts("CSYMLIB_F: MSYMLB2");) FORTRAN_CALL ( MSYMLB3, msymlb3, (ist, lspgrp, namspg_cif, &namspg_cifs, nampg, nsymp, nsym, rlsymmmatrx, namspg_cif_len, namspg_cifs_len, nampg_len), (ist, lspgrp, namspg_cif, &namspg_cifs, nampg, nsymp, nsym, rlsymmmatrx), (ist, lspgrp, namspg_cif, namspg_cif_len, &namspg_cifs, namspg_cifs_len, nampg, nampg_len, nsymp, nsym, rlsymmmatrx)); } FORTRAN_SUBR ( MSYGET, msyget, (const int *ist, int *lspgrp, int *nsym, float rlsymmmatrx[192][4][4]), (const int *ist, int *lspgrp, int *nsym, float rlsymmmatrx[192][4][4]), (const int *ist, int *lspgrp, int *nsym, float rlsymmmatrx[192][4][4])) { char namspg_cif, namspg_cifs, nampg; int namspg_cif_len=0, namspg_cifs_len=0, nampg_len=0, nsymp=0; CSYMLIB_DEBUG(puts("CSYMLIB_F: MSYGET");) FORTRAN_CALL ( MSYMLB3, msymlb3, (ist, lspgrp, &namspg_cif, &namspg_cifs, &nampg, &nsymp, nsym, rlsymmmatrx, namspg_cif_len, namspg_cifs_len, nampg_len), (ist, lspgrp, &namspg_cif, &namspg_cifs, &nampg, &nsymp, nsym, rlsymmmatrx), (ist, lspgrp, &namspg_cif, namspg_cif_len, &namspg_cifs, namspg_cifs_len, &nampg, nampg_len, &nsymp, nsym, rlsymmmatrx)); } /** Epsilon zones currently set up in ccp4spg_load_spacegroup * If these are not available, use lookup by symops. * @param nsm number of symmetry operators. * @param nsmp number of primitive symmetry operators. * @param rsm symmetry matrices. * @param iprint If iprint > 0 then a summary of epsilon zones is printed. */ FORTRAN_SUBR ( EPSLN, epsln, (const int *nsm, const int *nsmp, const float rsm[192][4][4], const int *iprint), (const int *nsm, const int *nsmp, const float rsm[192][4][4], const int *iprint), (const int *nsm, const int *nsmp, const float rsm[192][4][4], const int *iprint)) { int i,k,l; ccp4_symop *op1; CSYMLIB_DEBUG(puts("CSYMLIB_F: EPSLN");) /* identify spacegroup from supplied symops */ op1 = (ccp4_symop *) ccp4_utils_malloc(*nsm*sizeof(ccp4_symop)); for (i = 0; i < *nsm; ++i) { for (k = 0; k < 3; ++k) { for (l = 0; l < 3; ++l) { op1[i].rot[k][l] = rsm[i][l][k]; } op1[i].trn[k] = rsm[i][3][k]; } } spacegroup = ccp4_spgrp_reverse_lookup(*nsm,op1); if (spacegroup && *iprint > 0) ccp4spg_print_epsilon_zones(spacegroup); free(op1); } FORTRAN_SUBR ( EPSLON, epslon, (const int ih[3], float *epsi, int *isysab), (const int ih[3], float *epsi, int *isysab), (const int ih[3], float *epsi, int *isysab)) { int h,k,l; CSYMLIB_DEBUG(puts("CSYMLIB_F: EPSLON");) if (!spacegroup) { ccperror(2,"EPSLON: No spacegroup loaded yet! \n"); return; } h = ih[0]; k = ih[1]; l = ih[2]; *epsi = (float) ccp4spg_get_multiplicity(spacegroup, h, k, l); *isysab = ccp4spg_is_sysabs(spacegroup, h, k, l); } FORTRAN_SUBR ( CCP4SPG_F_EPSLON, ccp4spg_f_epslon, (const int *sindx, const int ih[3], float *epsi, int *isysab), (const int *sindx, const int ih[3], float *epsi, int *isysab), (const int *sindx, const int ih[3], float *epsi, int *isysab)) { int h,k,l; CSYMLIB_DEBUG(puts("CSYMLIB_F: CCP4SPG_F_EPSLON");) if (*sindx <= 0 || *sindx > MSPAC) { printf("Error in CCP4SPG_F_EPSLON: sindx %d out of range!\n",*sindx); return; } if ( ! spacegrp[*sindx-1] ) { printf("CCP4SPG_F_EPSLON: No spacegroup loaded on channel %d ! \n",*sindx); return; } h = ih[0]; k = ih[1]; l = ih[2]; *epsi = (float) ccp4spg_get_multiplicity(spacegrp[*sindx-1], h, k, l); *isysab = ccp4spg_is_sysabs(spacegrp[*sindx-1], h, k, l); } FORTRAN_SUBR ( SYSAB, sysab, (const int in[3], int *isysab), (const int in[3], int *isysab), (const int in[3], int *isysab)) { int h,k,l; CSYMLIB_DEBUG(puts("CSYMLIB_F: SYSAB");) h = in[0]; k = in[1]; l = in[2]; *isysab = ccp4spg_is_sysabs(spacegroup, h, k, l); } FORTRAN_SUBR ( CCP4SPG_F_IS_SYSABS, ccp4spg_f_is_sysabs, (const int *sindx, const int in[3], int *isysab), (const int *sindx, const int in[3], int *isysab), (const int *sindx, const int in[3], int *isysab)) { int h,k,l; CSYMLIB_DEBUG(puts("CSYMLIB_F: CCP4SPG_F_IS_SYSABS");) if (*sindx <= 0 || *sindx > MSPAC) { printf("Error in CCP4SPG_F_IS_SYSABS: sindx %d out of range!\n",*sindx); return; } if ( ! spacegrp[*sindx-1] ) { printf("CCP4SPG_F_IS_SYSABS: No spacegroup loaded on channel %d ! \n",*sindx); return; } h = in[0]; k = in[1]; l = in[2]; *isysab = ccp4spg_is_sysabs(spacegrp[*sindx-1], h, k, l); } /** Set up centric zones based on symmetry operators. * Convention: translations are in rsm[isym][3][*] * @param nsm number of symmetry matrices passed. * @param rsm symmetry matrices. * @param iprint If iprint > 0 then a summary of centric zones is printed. */ FORTRAN_SUBR ( CENTRIC, centric, (const int *nsm, const float rsm[192][4][4], const int *iprint), (const int *nsm, const float rsm[192][4][4], const int *iprint), (const int *nsm, const float rsm[192][4][4], const int *iprint)) { int i,k,l; ccp4_symop *op1=NULL; CSYMLIB_DEBUG(puts("CSYMLIB_F: CENTRIC");) /* identify spacegroup from supplied symops */ op1 = (ccp4_symop *) ccp4_utils_malloc(*nsm*sizeof(ccp4_symop)); for (i = 0; i < *nsm; ++i) { for (k = 0; k < 3; ++k) { for (l = 0; l < 3; ++l) { op1[i].rot[k][l] = rsm[i][l][k]; } op1[i].trn[k] = rsm[i][3][k]; } } spacegroup = ccp4_spgrp_reverse_lookup(*nsm,op1); if (spacegroup && *iprint > 0) ccp4spg_print_centric_zones(spacegroup); free(op1); } FORTRAN_SUBR ( CENTR, centr, (const int ih[3], int *ic), (const int ih[3], int *ic), (const int ih[3], int *ic)) { int h,k,l; CSYMLIB_DEBUG(puts("CSYMLIB_F: CENTR");) h = ih[0]; k = ih[1]; l = ih[2]; *ic = ccp4spg_is_centric(spacegroup, h, k, l); if (*ic == -1) ccperror(1,"Fatal error in CENTR."); } FORTRAN_SUBR ( CCP4SPG_F_IS_CENTRIC, ccp4spg_f_is_centric, (const int *sindx, const int ih[3], int *ic), (const int *sindx, const int ih[3], int *ic), (const int *sindx, const int ih[3], int *ic)) { int h,k,l; CSYMLIB_DEBUG(puts("CSYMLIB_F: CCP4SPG_F_IS_CENTRIC");) if (*sindx <= 0 || *sindx > MSPAC) { printf("Error in CCP4SPG_F_IS_CENTRIC: sindx %d out of range!\n",*sindx); return; } if ( ! spacegrp[*sindx-1] ) { printf("CCP4SPG_F_IS_CENTRIC: No spacegroup loaded on channel %d ! \n",*sindx); return; } h = ih[0]; k = ih[1]; l = ih[2]; *ic = ccp4spg_is_centric(spacegrp[*sindx-1], h, k, l); if (*ic == -1) ccperror(1,"Fatal error in CCP4SPG_F_IS_CENTRIC."); } FORTRAN_SUBR ( CENTPHASE, centphase, (const int ih[3], float *cenphs), (const int ih[3], float *cenphs), (const int ih[3], float *cenphs)) { int h,k,l; CSYMLIB_DEBUG(puts("CSYMLIB_F: CENTPHASE");) h = ih[0]; k = ih[1]; l = ih[2]; if (! ccp4spg_is_centric(spacegroup, h, k, l) ) { printf("CENTPHASE: This is not a centric reflection!\n"); return; } *cenphs = ccp4spg_centric_phase(spacegroup, h, k, l); } FORTRAN_SUBR ( CCP4SPG_F_CENTPHASE, ccp4spg_f_centphase, (const int *sindx, const int ih[3], float *cenphs), (const int *sindx, const int ih[3], float *cenphs), (const int *sindx, const int ih[3], float *cenphs)) { int h,k,l; CSYMLIB_DEBUG(puts("CSYMLIB_F: CCP4SPG_F_CENTPHASE");) if (*sindx <= 0 || *sindx > MSPAC) { printf("Error in CCP4SPG_F_IS_CENTPHASE: sindx %d out of range!\n",*sindx); return; } if ( ! spacegrp[*sindx-1] ) { printf("CCP4SPG_F_IS_CENTPHASE: No spacegroup loaded on channel %d ! \n",*sindx); return; } h = ih[0]; k = ih[1]; l = ih[2]; if (! ccp4spg_is_centric(spacegrp[*sindx-1], h, k, l) ) { printf("CCP4SPG_F_CENTPHASE: This is not a centric reflection!\n"); return; } *cenphs = ccp4spg_centric_phase(spacegrp[*sindx-1], h, k, l); } /* Returns map limits of a.s.u. in fractional units. These are rounded up or down to mimic <= or < respectively. In fact, these limits may be larger than 1 a.s.u. but always have one corner at the origin */ FORTRAN_SUBR ( SETLIM, setlim, (const int *lspgrp, float xyzlim[3][2]), (const int *lspgrp, float xyzlim[3][2]), (const int *lspgrp, float xyzlim[3][2])) { CCP4SPG *tmp_spacegroup; CSYMLIB_DEBUG(puts("CSYMLIB_F: SETLIM");) if (!spacegroup || spacegroup->spg_ccp4_num != *lspgrp) { /* load spacegroup if necessary */ /* spacegroup only temporary, as setlim is not expected to interact with other calls */ if ( ! (tmp_spacegroup = ccp4spg_load_by_ccp4_num(*lspgrp)) ) { printf("SETLIM: failed to load spacegroup info from SYMINFO! \n"); return; } xyzlim[0][1] = tmp_spacegroup->mapasu_ccp4[0]; xyzlim[1][1] = tmp_spacegroup->mapasu_ccp4[1]; xyzlim[2][1] = tmp_spacegroup->mapasu_ccp4[2]; free(tmp_spacegroup); } else { xyzlim[0][1] = spacegroup->mapasu_ccp4[0]; xyzlim[1][1] = spacegroup->mapasu_ccp4[1]; xyzlim[2][1] = spacegroup->mapasu_ccp4[2]; } xyzlim[0][0] = 0.0; xyzlim[1][0] = 0.0; xyzlim[2][0] = 0.0; } /* Returns map limits of a.s.u. in fractional units. These are rounded up or down to mimic <= or < respectively. In fact, these limits may be larger than 1 a.s.u. but always have one corner at the origin. This version uses mapasu_zero limits from sgtbx */ FORTRAN_SUBR ( SETLIM_ZERO, setlim_zero, (const int *lspgrp, float xyzlim[3][2]), (const int *lspgrp, float xyzlim[3][2]), (const int *lspgrp, float xyzlim[3][2])) { CCP4SPG *tmp_spacegroup; CSYMLIB_DEBUG(puts("CSYMLIB_F: SETLIM_ZERO");) if (!spacegroup || spacegroup->spg_ccp4_num != *lspgrp) { /* load spacegroup if necessary */ /* spacegroup only temporary, as setlim is not expected to interact with other calls */ if ( ! (tmp_spacegroup = ccp4spg_load_by_ccp4_num(*lspgrp)) ) { printf("SETLIM_ZERO: failed to load spacegroup info from SYMINFO! \n"); return; } xyzlim[0][1] = tmp_spacegroup->mapasu_zero[0]; xyzlim[1][1] = tmp_spacegroup->mapasu_zero[1]; xyzlim[2][1] = tmp_spacegroup->mapasu_zero[2]; free(tmp_spacegroup); } else { xyzlim[0][1] = spacegroup->mapasu_zero[0]; xyzlim[1][1] = spacegroup->mapasu_zero[1]; xyzlim[2][1] = spacegroup->mapasu_zero[2]; } xyzlim[0][0] = 0.0; xyzlim[1][0] = 0.0; xyzlim[2][0] = 0.0; } FORTRAN_SUBR ( SETGRD, setgrd, (const int *nlaue, const float *sample, const int *nxmin, const int *nymin, const int *nzmin, int *nx, int *ny, int *nz), (const int *nlaue, const float *sample, const int *nxmin, const int *nymin, const int *nzmin, int *nx, int *ny, int *nz), (const int *nlaue, const float *sample, const int *nxmin, const int *nymin, const int *nzmin, int *nx, int *ny, int *nz)) { int nlaue_save = -1; if (!spacegroup) { ccperror(2,"SETGRD: No spacegroup loaded yet! \n"); return; } if (spacegroup->nlaue != *nlaue) { printf("SETGRD: supplied CCP4 Laue code is different from that currently stored\n"); printf("NLAUE (supplied) = %d\n",*nlaue); printf("NLAUE (library) = %d\n",spacegroup->nlaue); printf("(For program FFT and certain spacegroups, this is OK.)\n"); /* The requested Laue number is different to that for the current spacegroup Save the current Laue code and load the data for the requested code */ nlaue_save = spacegroup->nlaue; if (ccp4spg_load_laue(spacegroup,*nlaue)) { printf("SETGRD: unrecognised CCP4 Laue code, couldn't set FFT grid\n"); return; } } set_fft_grid(spacegroup, *nxmin, *nymin, *nzmin, *sample, nx, ny, nz); if (nlaue_save > -1) { /* Restore previous settings */ ccp4spg_load_laue(spacegroup,nlaue_save); } return; } FORTRAN_SUBR ( FNDSMP, fndsmp, (const int *minsmp, const int *nmul, const float *sample, int *nsampl), (const int *minsmp, const int *nmul, const float *sample, int *nsampl), (const int *minsmp, const int *nmul, const float *sample, int *nsampl)) { *nsampl = get_grid_sample(*minsmp, *nmul, *sample); } FORTRAN_SUBR ( CALC_ORIG_PS, calc_orig_ps, (fpstr namspg_cif, int *nsym, float rsym[192][4][4], int *norig, float orig[96][3], ftn_logical *lpaxisx, ftn_logical *lpaxisy, ftn_logical *lpaxisz, fpstr_size_t namspg_cif_len), (fpstr namspg_cif, int *nsym, float rsym[192][4][4], int *norig, float orig[96][3], ftn_logical *lpaxisx, ftn_logical *lpaxisy, ftn_logical *lpaxisz), (fpstr namspg_cif, fpstr_size_t namspg_cif_len, int *nsym, float rsym[192][4][4], int *norig, float orig[96][3], ftn_logical *lpaxisx, ftn_logical *lpaxisy, ftn_logical *lpaxisz)) { char *temp_namspg; int i,j,k; int polarx, polary, polarz; float crsym[192][4][4]; CSYMLIB_DEBUG(puts("CSYMLIB_F: CALC_ORIG_PS");) temp_namspg = ccp4_FtoCString(FTN_STR(namspg_cif), FTN_LEN(namspg_cif)); for (i = 0; i < *nsym; ++i) { for (j = 0; j < 4; ++j) { for (k = 0; k < 4; ++k) { crsym[i][k][j] = rsym[i][j][k]; } } } *norig = ccp4spg_generate_origins(temp_namspg, *nsym, (const float (*)[4][4])crsym, orig, &polarx, &polary, &polarz, 1); *lpaxisx = polarx ? FORTRAN_LOGICAL_TRUE : FORTRAN_LOGICAL_FALSE; *lpaxisy = polary ? FORTRAN_LOGICAL_TRUE : FORTRAN_LOGICAL_FALSE; *lpaxisz = polarz ? FORTRAN_LOGICAL_TRUE : FORTRAN_LOGICAL_FALSE; free(temp_namspg); } static double coefhkl[6]; FORTRAN_SUBR ( SETRSL, setrsl, (const float *a, const float *b, const float *c, const float *alpha, const float *beta, const float *gamma), (const float *a, const float *b, const float *c, const float *alpha, const float *beta, const float *gamma), (const float *a, const float *b, const float *c, const float *alpha, const float *beta, const float *gamma)) { float cell[6]; CSYMLIB_DEBUG(puts("CSYMLIB_F: SETRSL");) cell[0] = *a; cell[1] = *b; cell[2] = *c; cell[3] = *alpha; cell[4] = *beta; cell[5] = *gamma; MtzHklcoeffs(cell, coefhkl); } FORTRAN_SUBR (STHLSQ1, sthlsq1, (float *reso, const int *ih, const int *ik, const int *il), (float *reso, const int *ih, const int *ik, const int *il), (float *reso, const int *ih, const int *ik, const int *il)) { int in[3]; CSYMLIB_DEBUG(puts("CSYMLIB_F: STHLSQ");) in[0] = *ih; in[1] = *ik; in[2] = *il; (*reso) = 0.25*MtzInd2reso(in, coefhkl); return; } FORTRAN_SUBR (STS3R41, sts3r41, (float *reso, const int *ih, const int *ik, const int *il), (float *reso, const int *ih, const int *ik, const int *il), (float *reso, const int *ih, const int *ik, const int *il)) { int in[3]; CSYMLIB_DEBUG(puts("CSYMLIB_F: STS3R4");) in[0] = *ih; in[1] = *ik; in[2] = *il; (*reso) = 0.25*MtzInd2reso(in, coefhkl); return; } /* straight translation, needs to be done properly, used in phistats */ FORTRAN_SUBR ( HANDCHANGE, handchange, (const int *lspgrp, float *cx, float *cy, float *cz), (const int *lspgrp, float *cx, float *cy, float *cz), (const int *lspgrp, float *cx, float *cy, float *cz)) { CSYMLIB_DEBUG(puts("CSYMLIB_F: HANDCHANGE");) switch (*lspgrp) { case 80: *cx=0.0; *cy=0.5; *cz=0.0; break; case 98: *cx=0.0; *cy=0.5; *cz=0.25; break; case 210: *cx=0.75; *cy=0.25; *cz=0.75; break; case 214: *cx=0.25; *cy=0.25; *cz=0.25; break; } } libccp4-8.0.0/fortran/dna_header.fh0000644000000000000000000000225514242731033015234 0ustar 00000000000000C C dna_header.fh: include file for dna_output.f C Copyright (C) 2004 CCLRC, Graeme Winter C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C c common block for dna use c do not compile directly integer dnafd logical dnaout c some bits to keep track of the "state" of the output XML file logical dnaintable, dnainlist character dna_image*80 common /dnabits/ dnafd, dnaout, dnaintable, dnainlist common /dnabobs/ dna_image c end common block libccp4-8.0.0/fortran/dna_output.f0000644000000000000000000001647714242731033015207 0ustar 00000000000000C C dna_output.f: write output for the DNA project C Copyright (C) 2004 CCLRC, Graeme Winter C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C c dna_output.f c maintained by G.Winter c "standard" DNA output XML subroutines for c fortran programs - these will create named tables, lists and items c c tables containeth lists, which in turn containeth items. c c These may be applied to programs other than Mosflm - so long c as I can code up a clever way of handling this output! c c c c c c $Id$ c c set no output flag - this is the alternative to starting the output c and should be called for good form - an alternative would be to c call dna_start with filename = ' ' - which I could interpret c appropriately subroutine dna_set_no_output implicit none include 'dna_header.fh' dnaout = .false. return end c c start writing the dna output - this takes a program name, c for instance 'mosflm' - this should be called as soon as c the file is opened c subroutine dna_start(filename, progname) implicit none include 'dna_header.fh' character*(*) progname, filename integer ifail, lenstr external lenstr dnainlist = .false. dnaintable = .false. dna_image = ' ' ifail = 1 call ccpdpn(dnafd, filename, 'UNKNOWN', 'F' ,0 , ifail) if (ifail.ne.1) then call ccperr(2, 'dna_start: error opening file') dnaout = .false. else dnaout = .true. endif 1 format('') 2 format('') if(dnaout) write(dnafd, 1) if(dnaout) write(dnafd, 2) progname(1:lenstr(progname)) return end c c finish writing dna output - this should go at the end of the c program c subroutine dna_end implicit none include 'dna_header.fh' 1 format('') c close any ongoing tables if (dnainlist) call dna_list_end if (dnaintable) call dna_table_end if(dnaout) write(dnafd, 1) if(dnaout) close(dnafd) dnaout = .false. return end c c write an item containing a "real" c subroutine dna_real_item(name, value) implicit none include 'dna_header.fh' character *(*) name real value integer lenstr external lenstr 1 format(' ', e15.6, '') if(dnaout) write(dnafd, 1) name(1:lenstr(name)), value return end subroutine dna_double_item(name, value) implicit none include 'dna_header.fh' character *(*) name double precision value integer lenstr external lenstr 1 format(' ', e15.6, '') if(dnaout) write(dnafd, 1) name(1:lenstr(name)), value return end c c as above sed 's/real/integer/' c subroutine dna_integer_item(name, value) implicit none include 'dna_header.fh' character *(*) name integer value, lenstr external lenstr 1 format(' ', i15, '') if(dnaout) write(dnafd, 1) name(1:lenstr(name)), value return end c c as above sed 's/real/character*(*)/' c subroutine dna_character_item(name, value) implicit none include 'dna_header.fh' character *(*) name character *(*) value integer lenstr external lenstr 1 format(' ', a, '') if(dnaout) write(dnafd, 1) name(1:lenstr(name)), value return end c c start a named list c subroutine dna_list_start(name) implicit none include 'dna_header.fh' character *(*) name 1 format(' ') c check that we are not already in a list, and if we are c close it! if (dnainlist) call dna_list_end dnainlist = .true. if(dnaout) write(dnafd, 1) name return end subroutine dna_ilist_start(name, index) c this is the same as the above but with an integer index c so that you can have any lists with the same name - very c important for tabular output. implicit none include 'dna_header.fh' character *(*) name integer index 1 format(' ') c check that we are not already in a list, and if we are c close it! if (dnainlist) call dna_list_end dnainlist = .true. if(dnaout) write(dnafd, 1) name, index return end c c finish a named list c subroutine dna_list_end implicit none include 'dna_header.fh' 1 format(' ') c check that we are in a list if (dnainlist) then if(dnaout) write(dnafd, 1) end if dnainlist = .false. return end c c start a named table c subroutine dna_table_start(name) implicit none include 'dna_header.fh' character *(*) name integer lenstr external lenstr 1 format(' ') 2 format('
') c check that we are not already inside a table if (dnaintable) call dna_table_end dnaintable = .true. if (dna_image .eq. ' ') then if(dnaout) write(dnafd, 2) name(1:lenstr(name)) else if(dnaout) write(dnafd, 1) name(1:lenstr(name)), + dna_image(1:lenstr(dna_image)) end if return end c c finish a named table c subroutine dna_table_end implicit none include 'dna_header.fh' 1 format('
') c check we are not still inside a list if (dnainlist) then call dna_list_end end if if (dnaintable) then if(dnaout) write(dnafd, 1) end if dnaintable = .false. return end subroutine dna_error(message) implicit none character*(*) message integer lenstr external lenstr call dna_table_start('error') call dna_list_start('error') call dna_character_item('message', message(1:lenstr(message))) call dna_list_end call dna_table_end return end subroutine dna_warning(message) implicit none character*(*) message integer lenstr external lenstr call dna_table_start('warning') call dna_list_start('warning') call dna_character_item('message', message(1:lenstr(message))) call dna_list_end call dna_table_end return end libccp4-8.0.0/fortran/fftlib.f0000644000000000000000000016667214242731033014276 0ustar 00000000000000C C fftlib.f: fast-fourier transform library routines C Copyright (C) Lynn Ten Eyck C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C C-- FFT81 F77TRNFM.FOR 13/09/85 JWC C C C**** FOLLOWING ARE ROUTINES USED BY TEN EYCK'S FFT PROGRAMS*** C C SUBROUTINE CMPLFT(X,Y,N,D) C =============================== C C C Complex finite discrete fourier transform C transforms one dimension of multi-dimensional data C modified by L. F. TEN EYCK from a one-dimensional version written C by G. T. SANDE, 1969. C C This program calculates the transform C (X(T) + I*Y(T))*(COS(2*PI*T/N) - I*SIN(2*PI*T/N)) C C INDEXING -- the arrangement of the multi-dimensional data is C specified by the integer array D, the values of which are used as C control parameters in do loops. when it is desired to cover all C elements of the data for which the subscript being transformed has C the value I0, the following is used. C C I1 = (I0 - 1)*D(2) + 1 C DO 100 I2 = I1, D(1), D(3) C I3 = I2 + D(4) - 1 C DO 100 I = I2, I3, D(5) C . C . C 100 CONTINUE C C with this indexing it is possible to use a number of arrangements C of the data, including normal fortran complex numbers (d(5) = 2) C or separate storage of real and imaginary parts. C C C---- PMAX is the largest prime factor that will be tolerated by this C program. C C---- TWOGRP is the largest power of two that is treated as a special C case. C C .. Scalar Arguments .. INTEGER N C .. C .. Array Arguments .. REAL X(*),Y(*) INTEGER D(5) C .. C .. Local Scalars .. INTEGER PMAX,PSYM,TWOGRP LOGICAL ERROR CHARACTER EMESS*80 C .. C .. Local Arrays .. INTEGER FACTOR(15),SYM(15),UNSYM(15) C .. C .. External Subroutines .. EXTERNAL DIPRP,MDFTKD,SRFP C .. PMAX = 19 TWOGRP = 8 C IF (N.GT.1) THEN CALL SRFP(N,PMAX,TWOGRP,FACTOR,SYM,PSYM,UNSYM,ERROR) IF (ERROR) THEN C WRITE (EMESS,FMT=9000) N call ccperr(1, EMESS) ELSE C CALL MDFTKD(N,FACTOR,D,X,Y) CALL DIPRP(N,SYM,PSYM,UNSYM,D,X,Y) END IF END IF C C---- Format statements C 9000 FORMAT ('FFTLIB: invalid number of points for CMPL FT. N =',I10) END C C SUBROUTINE SRFP(PTS,PMAX,TWOGRP,FACTOR,SYM,PSYM,UNSYM,ERROR) C ================================================================== C C C---- Symmetrized reordering factoring programme C C C .. Scalar Arguments .. INTEGER PMAX,PSYM,PTS,TWOGRP LOGICAL ERROR C .. C .. Array Arguments .. INTEGER FACTOR(15),SYM(15),UNSYM(15) C .. C .. Local Scalars .. INTEGER F,J,JJ,N,NEST,P,PTWO,Q,R C .. C .. Local Arrays .. INTEGER PP(14),QQ(7) C .. NEST = 14 C N = PTS PSYM = 1 F = 2 P = 0 Q = 0 10 CONTINUE IF (N.LE.1) THEN GO TO 60 ELSE DO 20 J = F,PMAX IF (N.EQ. (N/J)*J) GO TO 30 20 CONTINUE GO TO 40 30 IF (2*P+Q.GE.NEST) THEN GO TO 50 ELSE F = J N = N/F IF (N.EQ. (N/F)*F) THEN N = N/F P = P + 1 PP(P) = F PSYM = PSYM*F ELSE Q = Q + 1 QQ(Q) = F END IF GO TO 10 END IF END IF C 40 CONTINUE WRITE (6,FMT=9000) PMAX,PTS ERROR = .TRUE. GO TO 100 C 50 CONTINUE WRITE (6,FMT=9010) NEST,PTS ERROR = .TRUE. GO TO 100 C 60 CONTINUE R = 1 IF (Q.EQ.0) R = 0 IF (P.GE.1) THEN DO 70 J = 1,P JJ = P + 1 - J SYM(J) = PP(JJ) FACTOR(J) = PP(JJ) JJ = P + Q + J FACTOR(JJ) = PP(J) JJ = P + R + J SYM(JJ) = PP(J) 70 CONTINUE END IF IF (Q.GE.1) THEN DO 80 J = 1,Q JJ = P + J UNSYM(J) = QQ(J) FACTOR(JJ) = QQ(J) 80 CONTINUE SYM(P+1) = PTS/PSYM**2 END IF JJ = 2*P + Q FACTOR(JJ+1) = 0 PTWO = 1 J = 0 90 CONTINUE J = J + 1 IF (FACTOR(J).NE.0) THEN IF (FACTOR(J).EQ.2) THEN PTWO = PTWO*2 FACTOR(J) = 1 IF (PTWO.LT.TWOGRP) THEN IF (FACTOR(J+1).EQ.2) GO TO 90 END IF FACTOR(J) = PTWO PTWO = 1 END IF GO TO 90 END IF IF (P.EQ.0) R = 0 JJ = 2*P + R SYM(JJ+1) = 0 IF (Q.LE.1) Q = 0 UNSYM(Q+1) = 0 ERROR = .FALSE. C 100 CONTINUE C C---- Format statements C 9000 FORMAT (' FFTLIB: Largest factor exceeds ',I3,'. N = ',I6,'.') 9010 FORMAT (' FFTLIB: Factor count exceeds ',I3,'. N = ',I6,'.') END C C SUBROUTINE MDFTKD(N,FACTOR,DIM,X,Y) C ========================================== C C C---- Multi-dimensional complex fourier transform kernel driver C C C .. Scalar Arguments .. INTEGER N C .. C .. Array Arguments .. REAL X(*),Y(*) INTEGER DIM(5),FACTOR(15) C .. C .. Local Scalars .. INTEGER F,M,P,R,S C .. C .. External Subroutines .. EXTERNAL R2CFTK,R3CFTK,R4CFTK,R5CFTK,R8CFTK,RPCFTK C .. S = DIM(2) F = 0 M = N 10 CONTINUE F = F + 1 P = FACTOR(F) IF (P.EQ.0) THEN RETURN ELSE M = M/P R = M*S IF (P.LE.8) THEN GO TO (10,20,30,40,50,80,70,60) P GO TO 80 C 20 CONTINUE CALL R2CFTK(N,M,X(1),Y(1),X(R+1),Y(R+1),DIM) GO TO 10 C 30 CONTINUE CALL R3CFTK(N,M,X(1),Y(1),X(R+1),Y(R+1),X(2*R+1),Y(2*R+1), + DIM) GO TO 10 C 40 CONTINUE CALL R4CFTK(N,M,X(1),Y(1),X(R+1),Y(R+1),X(2*R+1),Y(2*R+1), + X(3*R+1),Y(3*R+1),DIM) GO TO 10 C 50 CONTINUE CALL R5CFTK(N,M,X(1),Y(1),X(R+1),Y(R+1),X(2*R+1),Y(2*R+1), + X(3*R+1),Y(3*R+1),X(4*R+1),Y(4*R+1),DIM) GO TO 10 C 60 CONTINUE CALL R8CFTK(N,M,X(1),Y(1),X(R+1),Y(R+1),X(2*R+1),Y(2*R+1), + X(3*R+1),Y(3*R+1),X(4*R+1),Y(4*R+1),X(5*R+1), + Y(5*R+1),X(6*R+1),Y(6*R+1),X(7*R+1),Y(7*R+1), + DIM) GO TO 10 END IF C 70 CONTINUE CALL RPCFTK(N,M,P,R,X,Y,DIM) GO TO 10 END IF C 80 CONTINUE WRITE (6,FMT=9000) C C---- Format statements C 9000 FORMAT ('0TRANSFER ERROR DETECTED IN MDFTKD',//) END C C SUBROUTINE R2CFTK(N,M,X0,Y0,X1,Y1,DIM) C ============================================== C C C---- Radix 2 multi-dimensional complex fourier transform kernel C C .. Scalar Arguments .. INTEGER M,N C .. C .. Array Arguments .. REAL X0(*),X1(*),Y0(*),Y1(*) INTEGER DIM(5) C .. C .. Local Scalars .. REAL ANGLE,C,FM2,IS,IU,RS,RU,S,TWOPI INTEGER J,K,K0,K1,K2,KK,L,L1,M2,MM2,MOVER2,NS,NT,SEP, + SIZE LOGICAL FOLD,ZERO C .. C .. Intrinsic Functions .. INTRINSIC COS,REAL,SIN C .. C .. Data statements .. DATA TWOPI/6.283185/ C .. C NT = DIM(1) SEP = DIM(2) L1 = DIM(3) SIZE = DIM(4) - 1 K2 = DIM(5) NS = N*SEP M2 = M*2 FM2 = REAL(M2) MOVER2 = M/2 + 1 MM2 = SEP*M2 C DO 50 J = 1,MOVER2 FOLD = J .GT. 1 .AND. 2*J .LT. M + 2 K0 = (J-1)*SEP + 1 ZERO = j. eq. 1 IF (.NOT.ZERO) THEN ANGLE = TWOPI*REAL(j-1)/FM2 C = COS(ANGLE) S = SIN(ANGLE) END IF 10 CONTINUE C DO 40 KK = K0,NS,MM2 DO 30 L = KK,NT,L1 K1 = L + SIZE DO 20 K = L,K1,K2 RS = X0(K) + X1(K) IS = Y0(K) + Y1(K) RU = X0(K) - X1(K) IU = Y0(K) - Y1(K) X0(K) = RS Y0(K) = IS IF (ZERO) THEN X1(K) = RU Y1(K) = IU ELSE X1(K) = RU*C + IU*S Y1(K) = IU*C - RU*S END IF 20 CONTINUE 30 CONTINUE 40 CONTINUE IF (FOLD) THEN FOLD = .FALSE. K0 = (M+1-J)*SEP + 1 C = -C GO TO 10 END IF 50 CONTINUE C END C C SUBROUTINE R3CFTK(N,M,X0,Y0,X1,Y1,X2,Y2,DIM) C ====================================================== C C C---- Radix 3 multi-dimensional complex fourier transform kernel C C .. Scalar Arguments .. INTEGER M,N C .. C .. Array Arguments .. REAL X0(*),X1(*),X2(*),Y0(*),Y1(*),Y2(*) INTEGER DIM(5) C .. C .. Local Scalars .. REAL A,ANGLE,B,C1,C2,FM3,I0,I1,I2,IA,IB,IS,R0, + R1,R2,RA,RB,RS,S1,S2,T,TWOPI INTEGER J,K,K0,K1,K2,KK,L,L1,M3,MM3,MOVER2,NS,NT,SEP, + SIZE LOGICAL FOLD,ZERO C .. C .. Intrinsic Functions .. INTRINSIC COS,REAL,SIN C .. C .. Data statements .. DATA TWOPI/6.283185/,A/-0.5/,B/0.86602540/ C .. C NT = DIM(1) SEP = DIM(2) L1 = DIM(3) SIZE = DIM(4) - 1 K2 = DIM(5) NS = N*SEP M3 = M*3 FM3 = REAL(M3) MM3 = SEP*M3 MOVER2 = M/2 + 1 C DO 50 J = 1,MOVER2 FOLD = J .GT. 1 .AND. 2*J .LT. M + 2 K0 = (J-1)*SEP + 1 ZERO = j .eq. 1 IF (.NOT.ZERO) THEN ANGLE = TWOPI*REAL(j-1)/FM3 C1 = COS(ANGLE) S1 = SIN(ANGLE) C2 = C1*C1 - S1*S1 S2 = S1*C1 + C1*S1 END IF 10 CONTINUE C DO 40 KK = K0,NS,MM3 DO 30 L = KK,NT,L1 K1 = L + SIZE DO 20 K = L,K1,K2 R0 = X0(K) I0 = Y0(K) RS = X1(K) + X2(K) IS = Y1(K) + Y2(K) X0(K) = R0 + RS Y0(K) = I0 + IS RA = RS*A + R0 IA = IS*A + I0 RB = (X1(K)-X2(K))*B IB = (Y1(K)-Y2(K))*B IF (ZERO) THEN X1(K) = RA + IB Y1(K) = IA - RB X2(K) = RA - IB Y2(K) = IA + RB ELSE R1 = RA + IB I1 = IA - RB R2 = RA - IB I2 = IA + RB X1(K) = R1*C1 + I1*S1 Y1(K) = I1*C1 - R1*S1 X2(K) = R2*C2 + I2*S2 Y2(K) = I2*C2 - R2*S2 END IF 20 CONTINUE 30 CONTINUE 40 CONTINUE IF (FOLD) THEN FOLD = .FALSE. K0 = (M+1-J)*SEP + 1 T = C1*A + S1*B S1 = C1*B - S1*A C1 = T T = C2*A - S2*B S2 = -C2*B - S2*A C2 = T GO TO 10 END IF 50 CONTINUE C END C C SUBROUTINE R4CFTK(N,M,X0,Y0,X1,Y1,X2,Y2,X3,Y3,DIM) C ============================================================== C C C---- Radix 4 multi-dimensional complex fourier transform kernel C C .. Scalar Arguments .. INTEGER M,N C .. C .. Array Arguments .. REAL X0(*),X1(*),X2(*),X3(*),Y0(*),Y1(*), + Y2(*),Y3(*) INTEGER DIM(5) C .. C .. Local Scalars .. REAL ANGLE,C1,C2,C3,FM4,I1,I2,I3,IS0,IS1,IU0, + IU1,R1,R2,R3,RS0,RS1,RU0,RU1,S1,S2,S3,T,TWOPI INTEGER J,K,K0,K1,K2,KK,L,L1,M4,MM4,MOVER2,NS,NT,SEP, + SIZE LOGICAL FOLD,ZERO C .. C .. Intrinsic Functions .. INTRINSIC COS,REAL,SIN C .. C .. Data statements .. DATA TWOPI/6.283185/ C .. C NT = DIM(1) SEP = DIM(2) L1 = DIM(3) SIZE = DIM(4) - 1 K2 = DIM(5) NS = N*SEP M4 = M*4 FM4 = REAL(M4) MM4 = SEP*M4 MOVER2 = M/2 + 1 C DO 50 J = 1,MOVER2 FOLD = J .GT. 1 .AND. 2*J .LT. M + 2 K0 = (J-1)*SEP + 1 ZERO = j .eq. 1 IF (.NOT.ZERO) THEN ANGLE = TWOPI*REAL(j-1)/FM4 C1 = COS(ANGLE) S1 = SIN(ANGLE) C2 = C1*C1 - S1*S1 S2 = S1*C1 + C1*S1 C3 = C2*C1 - S2*S1 S3 = S2*C1 + C2*S1 END IF 10 CONTINUE C DO 40 KK = K0,NS,MM4 DO 30 L = KK,NT,L1 K1 = L + SIZE DO 20 K = L,K1,K2 RS0 = X0(K) + X2(K) IS0 = Y0(K) + Y2(K) RU0 = X0(K) - X2(K) IU0 = Y0(K) - Y2(K) RS1 = X1(K) + X3(K) IS1 = Y1(K) + Y3(K) RU1 = X1(K) - X3(K) IU1 = Y1(K) - Y3(K) X0(K) = RS0 + RS1 Y0(K) = IS0 + IS1 IF (ZERO) THEN X2(K) = RU0 + IU1 Y2(K) = IU0 - RU1 X1(K) = RS0 - RS1 Y1(K) = IS0 - IS1 X3(K) = RU0 - IU1 Y3(K) = IU0 + RU1 ELSE R1 = RU0 + IU1 I1 = IU0 - RU1 R2 = RS0 - RS1 I2 = IS0 - IS1 R3 = RU0 - IU1 I3 = IU0 + RU1 X2(K) = R1*C1 + I1*S1 Y2(K) = I1*C1 - R1*S1 X1(K) = R2*C2 + I2*S2 Y1(K) = I2*C2 - R2*S2 X3(K) = R3*C3 + I3*S3 Y3(K) = I3*C3 - R3*S3 END IF 20 CONTINUE 30 CONTINUE 40 CONTINUE IF (FOLD) THEN FOLD = .FALSE. K0 = (M+1-J)*SEP + 1 T = C1 C1 = S1 S1 = T C2 = -C2 T = C3 C3 = -S3 S3 = -T GO TO 10 END IF 50 CONTINUE C END C C SUBROUTINE R5CFTK(N,M,X0,Y0,X1,Y1,X2,Y2,X3,Y3,X4,Y4,DIM) C ================================================================= C C C---- Radix 5 multi-dimensional complex fourier transform kernel C C .. Scalar Arguments .. INTEGER M,N C .. C .. Array Arguments .. REAL X0(*),X1(*),X2(*),X3(*),X4(*),Y0(*), + Y1(*),Y2(*),Y3(*),Y4(*) INTEGER DIM(5) C .. C .. Local Scalars .. REAL A1,A2,ANGLE,B1,B2,C1,C2,C3,C4,FM5,I0,I1,I2, + I3,I4,IA1,IA2,IB1,IB2,IS1,IS2,IU1,IU2,R0,R1,R2, + R3,R4,RA1,RA2,RB1,RB2,RS1,RS2,RU1,RU2,S1,S2,S3, + S4,T,TWOPI INTEGER J,K,K0,K1,K2,KK,L,L1,M5,MM5,MOVER2,NS,NT,SEP, + SIZE LOGICAL FOLD,ZERO C .. C .. Intrinsic Functions .. INTRINSIC COS,REAL,SIN C .. C .. Data statements .. DATA TWOPI/6.283185/,A1/0.30901699/,B1/0.95105652/, + A2/-0.80901699/,B2/0.58778525/ C .. C NT = DIM(1) SEP = DIM(2) L1 = DIM(3) SIZE = DIM(4) - 1 K2 = DIM(5) NS = N*SEP M5 = M*5 FM5 = REAL(M5) MM5 = SEP*M5 MOVER2 = M/2 + 1 C DO 50 J = 1,MOVER2 FOLD = J .GT. 1 .AND. 2*J .LT. M + 2 K0 = (J-1)*SEP + 1 ZERO = j .eq. 1 IF (.NOT.ZERO) THEN ANGLE = TWOPI*REAL(j-1)/FM5 C1 = COS(ANGLE) S1 = SIN(ANGLE) C2 = C1*C1 - S1*S1 S2 = S1*C1 + C1*S1 C3 = C2*C1 - S2*S1 S3 = S2*C1 + C2*S1 C4 = C2*C2 - S2*S2 S4 = S2*C2 + C2*S2 END IF 10 CONTINUE C DO 40 KK = K0,NS,MM5 DO 30 L = KK,NT,L1 K1 = L + SIZE DO 20 K = L,K1,K2 R0 = X0(K) I0 = Y0(K) RS1 = X1(K) + X4(K) IS1 = Y1(K) + Y4(K) RU1 = X1(K) - X4(K) IU1 = Y1(K) - Y4(K) RS2 = X2(K) + X3(K) IS2 = Y2(K) + Y3(K) RU2 = X2(K) - X3(K) IU2 = Y2(K) - Y3(K) X0(K) = R0 + RS1 + RS2 Y0(K) = I0 + IS1 + IS2 RA1 = RS1*A1 + R0 + RS2*A2 IA1 = IS1*A1 + I0 + IS2*A2 RA2 = RS1*A2 + R0 + RS2*A1 IA2 = IS1*A2 + I0 + IS2*A1 RB1 = RU1*B1 + RU2*B2 IB1 = IU1*B1 + IU2*B2 RB2 = RU1*B2 - RU2*B1 IB2 = IU1*B2 - IU2*B1 IF (ZERO) THEN X1(K) = RA1 + IB1 Y1(K) = IA1 - RB1 X2(K) = RA2 + IB2 Y2(K) = IA2 - RB2 X3(K) = RA2 - IB2 Y3(K) = IA2 + RB2 X4(K) = RA1 - IB1 Y4(K) = IA1 + RB1 ELSE R1 = RA1 + IB1 I1 = IA1 - RB1 R2 = RA2 + IB2 I2 = IA2 - RB2 R3 = RA2 - IB2 I3 = IA2 + RB2 R4 = RA1 - IB1 I4 = IA1 + RB1 X1(K) = R1*C1 + I1*S1 Y1(K) = I1*C1 - R1*S1 X2(K) = R2*C2 + I2*S2 Y2(K) = I2*C2 - R2*S2 X3(K) = R3*C3 + I3*S3 Y3(K) = I3*C3 - R3*S3 X4(K) = R4*C4 + I4*S4 Y4(K) = I4*C4 - R4*S4 END IF 20 CONTINUE 30 CONTINUE 40 CONTINUE IF (FOLD) THEN FOLD = .FALSE. K0 = (M+1-J)*SEP + 1 T = C1*A1 + S1*B1 S1 = C1*B1 - S1*A1 C1 = T T = C2*A2 + S2*B2 S2 = C2*B2 - S2*A2 C2 = T T = C3*A2 - S3*B2 S3 = -C3*B2 - S3*A2 C3 = T T = C4*A1 - S4*B1 S4 = -C4*B1 - S4*A1 C4 = T GO TO 10 END IF 50 CONTINUE C END C C SUBROUTINE R8CFTK(N,M,X0,Y0,X1,Y1,X2,Y2,X3,Y3,X4,Y4,X5,Y5,X6,Y6, + X7,Y7,DIM) C =============================================================== C C C---- Radix 8 multi-dimensional complex fourier transform kernel C C .. Scalar Arguments .. INTEGER M,N C .. C .. Array Arguments .. REAL X0(*),X1(*),X2(*),X3(*),X4(*),X5(*), + X6(*),X7(*),Y0(*),Y1(*),Y2(*),Y3(*), + Y4(*),Y5(*),Y6(*),Y7(*) INTEGER DIM(5) C .. C .. Local Scalars .. REAL ANGLE,C1,C2,C3,C4,C5,C6,C7,E,FM8,I1,I2,I3, + I4,I5,I6,I7,IS0,IS1,IS2,IS3,ISS0,ISS1,ISU0,ISU1, + IU0,IU1,IU2,IU3,IUS0,IUS1,IUU0,IUU1,R1,R2,R3,R4, + R5,R6,R7,RS0,RS1,RS2,RS3,RSS0,RSS1,RSU0,RSU1, + RU0,RU1,RU2,RU3,RUS0,RUS1,RUU0,RUU1,S1,S2,S3,S4, + S5,S6,S7,T,TWOPI INTEGER J,K,K0,K1,K2,KK,L,L1,M8,MM8,MOVER2,NS,NT,SEP, + SIZE LOGICAL FOLD,ZERO C .. C .. Intrinsic Functions .. INTRINSIC COS,REAL,SIN C .. C .. Data statements .. DATA TWOPI/6.283185/,E/0.70710678/ C .. C NT = DIM(1) SEP = DIM(2) L1 = DIM(3) SIZE = DIM(4) - 1 K2 = DIM(5) NS = N*SEP M8 = M*8 FM8 = REAL(M8) MM8 = SEP*M8 MOVER2 = M/2 + 1 C DO 50 J = 1,MOVER2 FOLD = J .GT. 1 .AND. 2*J .LT. M + 2 K0 = (J-1)*SEP + 1 ZERO = j .eq. 1 IF (.NOT.ZERO) THEN ANGLE = TWOPI*REAL(j-1)/FM8 C1 = COS(ANGLE) S1 = SIN(ANGLE) C2 = C1*C1 - S1*S1 S2 = S1*C1 + C1*S1 C3 = C2*C1 - S2*S1 S3 = S2*C1 + C2*S1 C4 = C2*C2 - S2*S2 S4 = S2*C2 + C2*S2 C5 = C4*C1 - S4*S1 S5 = S4*C1 + C4*S1 C6 = C4*C2 - S4*S2 S6 = S4*C2 + C4*S2 C7 = C4*C3 - S4*S3 S7 = S4*C3 + C4*S3 END IF 10 CONTINUE C DO 40 KK = K0,NS,MM8 DO 30 L = KK,NT,L1 K1 = L + SIZE DO 20 K = L,K1,K2 RS0 = X0(K) + X4(K) IS0 = Y0(K) + Y4(K) RU0 = X0(K) - X4(K) IU0 = Y0(K) - Y4(K) RS1 = X1(K) + X5(K) IS1 = Y1(K) + Y5(K) RU1 = X1(K) - X5(K) IU1 = Y1(K) - Y5(K) RS2 = X2(K) + X6(K) IS2 = Y2(K) + Y6(K) RU2 = X2(K) - X6(K) IU2 = Y2(K) - Y6(K) RS3 = X3(K) + X7(K) IS3 = Y3(K) + Y7(K) RU3 = X3(K) - X7(K) IU3 = Y3(K) - Y7(K) RSS0 = RS0 + RS2 ISS0 = IS0 + IS2 RSU0 = RS0 - RS2 ISU0 = IS0 - IS2 RSS1 = RS1 + RS3 ISS1 = IS1 + IS3 RSU1 = RS1 - RS3 ISU1 = IS1 - IS3 RUS0 = RU0 - IU2 IUS0 = IU0 + RU2 RUU0 = RU0 + IU2 IUU0 = IU0 - RU2 RUS1 = RU1 - IU3 IUS1 = IU1 + RU3 RUU1 = RU1 + IU3 IUU1 = IU1 - RU3 T = (RUS1+IUS1)*E IUS1 = (IUS1-RUS1)*E RUS1 = T T = (RUU1+IUU1)*E IUU1 = (IUU1-RUU1)*E RUU1 = T X0(K) = RSS0 + RSS1 Y0(K) = ISS0 + ISS1 IF (ZERO) THEN X4(K) = RUU0 + RUU1 Y4(K) = IUU0 + IUU1 X2(K) = RSU0 + ISU1 Y2(K) = ISU0 - RSU1 X6(K) = RUS0 + IUS1 Y6(K) = IUS0 - RUS1 X1(K) = RSS0 - RSS1 Y1(K) = ISS0 - ISS1 X5(K) = RUU0 - RUU1 Y5(K) = IUU0 - IUU1 X3(K) = RSU0 - ISU1 Y3(K) = ISU0 + RSU1 X7(K) = RUS0 - IUS1 Y7(K) = IUS0 + RUS1 ELSE R1 = RUU0 + RUU1 I1 = IUU0 + IUU1 R2 = RSU0 + ISU1 I2 = ISU0 - RSU1 R3 = RUS0 + IUS1 I3 = IUS0 - RUS1 R4 = RSS0 - RSS1 I4 = ISS0 - ISS1 R5 = RUU0 - RUU1 I5 = IUU0 - IUU1 R6 = RSU0 - ISU1 I6 = ISU0 + RSU1 R7 = RUS0 - IUS1 I7 = IUS0 + RUS1 X4(K) = R1*C1 + I1*S1 Y4(K) = I1*C1 - R1*S1 X2(K) = R2*C2 + I2*S2 Y2(K) = I2*C2 - R2*S2 X6(K) = R3*C3 + I3*S3 Y6(K) = I3*C3 - R3*S3 X1(K) = R4*C4 + I4*S4 Y1(K) = I4*C4 - R4*S4 X5(K) = R5*C5 + I5*S5 Y5(K) = I5*C5 - R5*S5 X3(K) = R6*C6 + I6*S6 Y3(K) = I6*C6 - R6*S6 X7(K) = R7*C7 + I7*S7 Y7(K) = I7*C7 - R7*S7 END IF 20 CONTINUE 30 CONTINUE 40 CONTINUE IF (FOLD) THEN FOLD = .FALSE. K0 = (M+1-J)*SEP + 1 T = (C1+S1)*E S1 = (C1-S1)*E C1 = T T = S2 S2 = C2 C2 = T T = (-C3+S3)*E S3 = (C3+S3)*E C3 = T C4 = -C4 T = - (C5+S5)*E S5 = (-C5+S5)*E C5 = T T = -S6 S6 = -C6 C6 = T T = (C7-S7)*E S7 = - (C7+S7)*E C7 = T GO TO 10 END IF 50 CONTINUE C END C C SUBROUTINE RPCFTK(N,M,P,R,X,Y,DIM) C ========================================== C C C---- Radix prime multi-dimensional complex fourier transform kernel C CMDW: Note, routine works beyond the nominal bounds of X and Y. C We think this is deliberate, so don't be tempted to "fix" it. C This routine is therefore incompatible with "bounds-checking" C options of compilers. C C .. Scalar Arguments .. INTEGER M,N,P,R C .. C .. Array Arguments .. REAL X(R,P),Y(R,P) INTEGER DIM(5) C .. C .. Local Scalars .. REAL ANGLE,FMP,FP,FU,IS,IU,RS,RU,T,TWOPI,XT,YT INTEGER J,JJ,K,K0,K1,K2,KK,L,L1,MMP,MOVER2,MP,NS,NT,PM, + PP,SEP,SIZE,U,V LOGICAL FOLD,ZERO C .. C .. Local Arrays .. REAL A(18),AA(9,9),B(18),BB(9,9),C(18),IA(9),IB(9), + RA(9),RB(9),S(18) C .. C .. Intrinsic Functions .. INTRINSIC COS,REAL,SIN C .. C .. Data statements .. DATA TWOPI/6.283185/ C .. C C NT = DIM(1) SEP = DIM(2) L1 = DIM(3) SIZE = DIM(4) - 1 K2 = DIM(5) NS = N*SEP MOVER2 = M/2 + 1 MP = M*P FMP = REAL(MP) MMP = SEP*MP PP = P/2 PM = P - 1 FP = REAL(P) FU = 0.0 DO 10 U = 1,PP FU = FU + 1.0 ANGLE = TWOPI*FU/FP JJ = P - U A(U) = COS(ANGLE) B(U) = SIN(ANGLE) A(JJ) = A(U) B(JJ) = -B(U) 10 CONTINUE DO 30 U = 1,PP DO 20 V = 1,PP JJ = U*V - U*V/P*P AA(V,U) = A(JJ) BB(V,U) = B(JJ) 20 CONTINUE 30 CONTINUE C DO 140 J = 1,MOVER2 FOLD = J .GT. 1 .AND. 2*J .LT. M + 2 K0 = (J-1)*SEP + 1 ZERO = j .eq. 1 IF (.NOT.ZERO) THEN ANGLE = TWOPI*REAL(j-1)/FMP C(1) = COS(ANGLE) S(1) = SIN(ANGLE) DO 40 U = 2,PM C(U) = C(U-1)*C(1) - S(U-1)*S(1) S(U) = S(U-1)*C(1) + C(U-1)*S(1) 40 CONTINUE END IF 50 CONTINUE C DO 120 KK = K0,NS,MMP DO 110 L = KK,NT,L1 K1 = L + SIZE DO 100 K = L,K1,K2 XT = X(K,1) YT = Y(K,1) RS = X(K,2) + X(K,P) IS = Y(K,2) + Y(K,P) RU = X(K,2) - X(K,P) IU = Y(K,2) - Y(K,P) DO 60 U = 1,PP RA(U) = AA(U,1)*RS + XT IA(U) = AA(U,1)*IS + YT RB(U) = BB(U,1)*RU IB(U) = BB(U,1)*IU 60 CONTINUE XT = XT + RS YT = YT + IS DO 80 U = 2,PP JJ = P - U RS = X(K,U+1) + X(K,JJ+1) IS = Y(K,U+1) + Y(K,JJ+1) RU = X(K,U+1) - X(K,JJ+1) IU = Y(K,U+1) - Y(K,JJ+1) XT = XT + RS YT = YT + IS DO 70 V = 1,PP RA(V) = AA(V,U)*RS + RA(V) IA(V) = AA(V,U)*IS + IA(V) RB(V) = BB(V,U)*RU + RB(V) IB(V) = BB(V,U)*IU + IB(V) 70 CONTINUE 80 CONTINUE X(K,1) = XT Y(K,1) = YT DO 90 U = 1,PP JJ = P - U IF (ZERO) THEN X(K,U+1) = RA(U) + IB(U) Y(K,U+1) = IA(U) - RB(U) X(K,JJ+1) = RA(U) - IB(U) Y(K,JJ+1) = IA(U) + RB(U) ELSE XT = RA(U) + IB(U) YT = IA(U) - RB(U) X(K,U+1) = C(U)*XT + S(U)*YT Y(K,U+1) = C(U)*YT - S(U)*XT XT = RA(U) - IB(U) YT = IA(U) + RB(U) X(K,JJ+1) = C(JJ)*XT + S(JJ)*YT Y(K,JJ+1) = C(JJ)*YT - S(JJ)*XT END IF 90 CONTINUE 100 CONTINUE 110 CONTINUE 120 CONTINUE IF (FOLD) THEN FOLD = .FALSE. K0 = (M+1-J)*SEP + 1 DO 130 U = 1,PM T = C(U)*A(U) + S(U)*B(U) S(U) = -S(U)*A(U) + C(U)*B(U) C(U) = T 130 CONTINUE GO TO 50 END IF 140 CONTINUE C END C C SUBROUTINE HERMFT(X,Y,N,DIM) C ================================== C C C C---- Hermitian symmetric fourier transform C C Given the unique terms of a hermitian symmetric sequence of length C 2N this subroutine calculates the 2N real numbers which are its C fourier transform. The even numbered elements of the transform C (0, 2, 4, . . ., 2n-2) are returned in X and the odd numbered C elements (1, 3, 5, . . ., 2n-1) in Y. C C A finite hermitian sequence of length 2n contains n + 1 unique C real numbers and n - 1 unique imaginary numbers. For convenience C the real value for X(n) is stored at Y(0). C C C .. Scalar Arguments .. INTEGER N C .. C .. Array Arguments .. REAL X(*),Y(*) INTEGER DIM(5) C .. C .. Local Scalars .. REAL A,ANGLE,B,C,CO,D,E,F,SI,TWON,TWOPI INTEGER D2,D3,D4,D5,I,I0,I1,I2,J,K,K1,NOVER2,NT C .. C .. External Subroutines .. EXTERNAL CMPLFT C .. C .. Intrinsic Functions .. INTRINSIC COS,REAL,SIN C .. TWOPI = 6.283185 TWON = REAL(2*N) C NT = DIM(1) D2 = DIM(2) D3 = DIM(3) D4 = DIM(4) - 1 D5 = DIM(5) C DO 20 I0 = 1,NT,D3 I1 = I0 + D4 DO 10 I = I0,I1,D5 A = X(I) B = Y(I) X(I) = A + B Y(I) = A - B 10 CONTINUE 20 CONTINUE C NOVER2 = N/2 + 1 IF (NOVER2.GE.2) THEN DO 50 I0 = 2,NOVER2 ANGLE = REAL(I0-1)*TWOPI/TWON CO = COS(ANGLE) SI = SIN(ANGLE) K = (N+2-2*I0)*D2 K1 = (I0-1)*D2 + 1 DO 40 I1 = K1,NT,D3 I2 = I1 + D4 DO 30 I = I1,I2,D5 J = I + K A = X(I) + X(J) B = X(I) - X(J) C = Y(I) + Y(J) D = Y(I) - Y(J) E = B*CO + C*SI F = B*SI - C*CO X(I) = A + F X(J) = A - F Y(I) = E + D Y(J) = E - D 30 CONTINUE 40 CONTINUE 50 CONTINUE C CALL CMPLFT(X,Y,N,DIM) END IF C C END C C SUBROUTINE INV21(X,Y,N,D) C ========================= C C C C---- Inverts fourier transform along a screw C diad. the result is scaled by n. C C C .. Scalar Arguments .. INTEGER N C .. C .. Array Arguments .. REAL X(*),Y(*) INTEGER D(5) C .. C .. Local Scalars .. REAL A,B,C,C1,PI,R,S,S1 INTEGER D1,D2,D3,D4,D5,I,J,J1,J2,J3,K,KK,L,LL,M,NOVER2 C .. C .. External Subroutines .. EXTERNAL CMPLFT C .. C .. Intrinsic Functions .. INTRINSIC COS,REAL,SIN C .. PI = 3.141593 C D1 = D(1) D2 = D(2) D3 = D(3) D4 = D(4) - 1 D5 = D(5) C NOVER2 = N/2 LL = N*D2 KK = NOVER2*D2 DO 20 J1 = 1,D1,D3 J2 = J1 + D4 DO 10 J = J1,J2,D5 L = LL + J K = KK + J X(L) = X(J) + X(K) X(K) = X(K) + Y(K) Y(L) = 0.0 Y(K) = 0.0 10 CONTINUE 20 CONTINUE C C1 = COS(PI/REAL(N)) S1 = SIN(PI/REAL(N)) C = 1.0 S = 0.0 DO 50 I = 2,NOVER2 KK = (N+2-2*I)*D2 LL = (N+1-I)*D2 R = C*C1 - S*S1 S = C*S1 + S*C1 C = R J1 = (I-1)*D2 + 1 DO 40 J2 = J1,D1,D3 J3 = J2 + D4 DO 30 J = J2,J3,D5 L = J + LL K = J + KK X(L) = X(L) + X(J) + X(K) X(J) = Y(J)*S + X(J) X(K) = Y(K)*S + X(K) Y(J) = Y(J)*C Y(K) = -Y(K)*C 30 CONTINUE 40 CONTINUE 50 CONTINUE C CALL CMPLFT(X,Y,N,D) C DO 80 I = 1,NOVER2 KK = (N+1-2*I)*D2 LL = I*D2 + KK J1 = (I-1)*D2 + 1 DO 70 J2 = J1,D1,D3 J3 = J2 + D4 DO 60 J = J2,J3,D5 K = J + KK L = J + LL A = X(J) - X(L) B = Y(J) + Y(L) X(J) = X(L) Y(J) = -Y(L) X(L) = X(K) + A Y(L) = Y(K) - B X(K) = A Y(K) = B 60 CONTINUE 70 CONTINUE 80 CONTINUE C M = N - 2 DO 130 I = 1,M K = I 90 CONTINUE J = K K = J/2 IF (2*K.NE.J) K = N - 1 - K IF (K-I) 90,130,100 100 KK = (K-I)*D2 J1 = I*D2 + 1 DO 120 J2 = J1,D1,D3 J3 = J2 + D4 DO 110 J = J2,J3,D5 K = J + KK A = X(K) B = Y(K) X(K) = X(J) Y(K) = Y(J) X(J) = A Y(J) = B 110 CONTINUE 120 CONTINUE 130 CONTINUE C C END C C SUBROUTINE REALFT(EVEN,ODD,N,DIM) C ====================================== C C C C REAL FOURIER TRANSFORM C C Given a real sequence of length 2n this subroutine calculates the C unique part of the fourier transform. The fourier transform has C n + 1 unique real parts and n - 1 unique imaginary parts. Since C the real part at x(n) is frequently of interest, this subroutine C stores it at x(n) rather than in y(0). Therefore x and y must be C of length n + 1 instead of n. Note that this storage arrangement C is different from that employed by the hermitian fourier transform C subroutine. C C For convenience the data is presented in two parts, the first C containing the even numbered real terms and the second containing C the odd numbered terms (numbering starting at 0). On return the C real part of the transform replaces the even terms and the C imaginary part of the transform replaces the odd terms. C C C .. Scalar Arguments .. INTEGER N C .. C .. Array Arguments .. REAL EVEN(*),ODD(*) INTEGER DIM(5) C .. C .. Local Scalars .. REAL A,ANGLE,B,C,CO,D,E,F,SI,TWON,TWOPI INTEGER D2,D3,D4,D5,I,I0,I1,I2,J,K,L,NOVER2,NT C .. C .. External Subroutines .. EXTERNAL CMPLFT C .. C .. Intrinsic Functions .. INTRINSIC COS,REAL,SIN C .. TWOPI = 6.283185 TWON = REAL(2*N) C CALL CMPLFT(EVEN,ODD,N,DIM) C NT = DIM(1) D2 = DIM(2) D3 = DIM(3) D4 = DIM(4) - 1 D5 = DIM(5) NOVER2 = N/2 + 1 C IF (NOVER2.GE.2) THEN DO 30 I = 2,NOVER2 ANGLE = REAL(I-1)*TWOPI/TWON CO = COS(ANGLE) SI = SIN(ANGLE) I0 = (I-1)*D2 + 1 J = (N+2-2*I)*D2 DO 20 I1 = I0,NT,D3 I2 = I1 + D4 DO 10 K = I1,I2,D5 L = K + J A = (EVEN(L)+EVEN(K))/2.0 C = (EVEN(L)-EVEN(K))/2.0 B = (ODD(L)+ODD(K))/2.0 D = (ODD(L)-ODD(K))/2.0 E = C*SI + B*CO F = C*CO - B*SI EVEN(K) = A + E EVEN(L) = A - E ODD(K) = F - D ODD(L) = F + D 10 CONTINUE 20 CONTINUE 30 CONTINUE END IF C IF (N.GE.1) THEN J = N*D2 DO 50 I1 = 1,NT,D3 I2 = I1 + D4 DO 40 K = I1,I2,D5 L = K + J EVEN(L) = EVEN(K) - ODD(K) ODD(L) = 0.0 EVEN(K) = EVEN(K) + ODD(K) ODD(K) = 0.0 40 CONTINUE 50 CONTINUE END IF C C END C C SUBROUTINE RSYMFT(X,N,DIM) C =============================== C C C C REAL SYMMETRIC MULTIDIMENSIONAL FOURIER TRANSFORM C C N must be a multiple of 4. The two unique elements are stored at C X(1) and X(n+1). C C Decimation in frequency applied to a real symmetric sequence of C length 2n gives a real symmetric sequence of length n, the C transform of which gives the even numbered fourier coefficients, C and a hermitian symmetric sequence of length n, the transform of C which gives the odd numbered fourier coefficients. The sum of C the two sequences is a hermitian symmetric sequence of length n, C which may be stored in n/2 complex locations. The transform of C this sequence is n real numbers representing the term by term sum C of the even and odd numbered fourier coefficients. This symmetric C sequence may be solved if any of the fourier coefficients are C known. For this purpose x0, which is simply the sum of the C original sequence, is computed and saved in x(n+1). C C C .. Scalar Arguments .. INTEGER N C .. C .. Array Arguments .. REAL X(*) INTEGER DIM(5) C .. C .. Local Scalars .. REAL A,ANGLE,B,C,CO,D,SI,TWON,TWOPI INTEGER D1,D2,D3,D4,D5,I,I0,I1,I2,II,J,J0,J1,K,K0,K1, + K2,L,M,MJ,MK,ML,MM,NN,NOVER2,NOVER4, + TWOD2 CHARACTER EMESS*80 C .. C .. External Subroutines .. EXTERNAL HERMFT C .. C .. Intrinsic Functions .. INTRINSIC COS,REAL,SIN C .. IF (N.NE.1) THEN NOVER2 = N/2 NOVER4 = N/4 IF (4*NOVER4.NE.N) THEN C WRITE (EMESS,FMT=9000) N call ccperr(1, EMESS) ELSE D1 = DIM(1) D2 = DIM(2) D3 = DIM(3) D4 = DIM(4) - 1 D5 = DIM(5) TWOPI = 6.283185 TWON = REAL(2*N) TWOD2 = 2*D2 C K0 = N*D2 + 1 DO 20 K1 = K0,D1,D3 K2 = K1 + D4 DO 10 K = K1,K2,D5 X(K) = X(K)/2.0 10 CONTINUE 20 CONTINUE C DO 50 I = 2,NOVER2 ANGLE = REAL(I-1)*TWOPI/TWON CO = COS(ANGLE) SI = SIN(ANGLE) K0 = (I-1)*D2 + 1 J0 = (N+2-2*I)*D2 J1 = (N+1-I)*D2 DO 40 K1 = K0,D1,D3 K2 = K1 + D4 DO 30 K = K1,K2,D5 L = K + J0 NN = K + J1 A = X(L) + X(K) B = X(L) - X(K) X(K) = A - B*CO X(L) = B*SI X(NN) = X(NN) + A 30 CONTINUE 40 CONTINUE 50 CONTINUE C IF (NOVER4.NE.1) THEN J0 = NOVER4 - 1 DO 80 I = 1,J0 K0 = (NOVER2+I)*D2 + 1 J1 = (NOVER2-2*I)*D2 DO 70 K1 = K0,D1,D3 K2 = K1 + D4 DO 60 K = K1,K2,D5 L = K + J1 A = X(K) X(K) = X(L) X(L) = A 60 CONTINUE 70 CONTINUE 80 CONTINUE END IF C J0 = NOVER2*D2 J1 = N*D2 DO 100 K1 = 1,D1,D3 K2 = K1 + D4 DO 90 K = K1,K2,D5 I = K + J0 L = K + J1 X(I) = X(I)*2.0 X(L) = X(K) + X(I) + X(L)*2.0 X(K) = X(K)*2.0 90 CONTINUE 100 CONTINUE C K = NOVER2*D2 + 1 CALL HERMFT(X(1),X(K),NOVER2,DIM) C C---- Solve the equations for all of the sequences C I0 = 1 - D2 MK = NOVER2*D2 MJ = MK + D2 ML = N*D2 + D2 MM = ML DO 130 II = 1,NOVER4 I0 = I0 + D2 MJ = MJ - TWOD2 ML = ML - TWOD2 MM = MM - D2 DO 120 I1 = I0,D1,D3 I2 = I1 + D4 DO 110 I = I1,I2,D5 J = I + MJ K = I + MK L = I + ML M = I + MM A = X(I) - X(M) B = X(L) - A C = X(K) - B D = X(J) - C X(I) = X(M) X(J) = A X(K) = B X(L) = C X(M) = D 110 CONTINUE 120 CONTINUE 130 CONTINUE C C---- The results are now in a scrambled digit reversed order, i.e. C x(1), x(5), x(9), ..., x(10), x(6), x(2), ..., x(3), x(7), x(11), C ..., x(12), x(8), x(4). the following section of program follows C the permutation cycles and does the necessary interchanges. C IF (NOVER4.NE.1) THEN NN = N - 2 DO 170 I = 1,NN K = I 140 CONTINUE C K0 = K/4 L = K - K0*4 IF (L.NE. (L/2)*2) K0 = NOVER4 - 1 - K0 K = L*NOVER4 + K0 IF (K.LT.I) GO TO 140 IF (K.NE.I) THEN C K0 = I*D2 + 1 J0 = (K-I)*D2 DO 160 K1 = K0,D1,D3 K2 = K1 + D4 DO 150 K = K1,K2,D5 L = K + J0 A = X(K) X(K) = X(L) X(L) = A 150 CONTINUE 160 CONTINUE END IF 170 CONTINUE END IF END IF END IF C C---- Format statements C 9000 FORMAT ('FFTLIB: N not a multiple of 4 in R SYM FT. N =',I10,//) END C C SUBROUTINE SDIAD(X,Y,N,DIM) C =============================== C C C C This subroutine computes half the fourier synthesis along a screw C diad lying along a crystallographic axis given half the fourier C coefficients. That is, it assumes that f(t) = conjg(f(-t)) for t C even and f(t) = -conjg(f(-t)) for t odd. n is the length of the C desired half of the transform. The location x(n+1) is required as C a scratch location and therefore a value is also returned in C x(n+1) and y(n+1). The value of the second half of the transform C may be generated from the first half by the formula x(n+t) = x(t), C y(n+t) = -y(t). In other words, the last half of the transform is C the complex conjugate of the first half. C C The transform is calculated by forming the sum of the even terms C and the odd terms in place, using the symmetry relations to C obtain the values for negative subscripts. The transform of the C resulting sequence may be separated by using the fact that the C transform of the even terms is real, while the prodct of the C transform of the odd terms and (cos(pi*t/n) - i*sin(pi*t/n)) is C imaginary. The scratch location is required because the formula C for separating the two transforms breaks down when t = n/2. C C C Corrections from A.D.MCLACHLAN 1980, put here sep 1985 C errors in original algorithm for the scratch location which C assumed f(n)=0 C C C C .. Scalar Arguments .. INTEGER N C .. C .. Array Arguments .. REAL X(*),Y(*) INTEGER DIM(5) C .. C .. Local Scalars .. REAL A,ANGLE,C,S,TWON,TWOPI INTEGER D1,D2,D3,D4,D5,I,J,K,K0,K1,K2,L,M,MN,NN,NOVER2 LOGICAL FOLD CHARACTER EMESS*80 C .. C .. External Subroutines .. EXTERNAL CMPLFT C .. C .. Intrinsic Functions .. INTRINSIC COS,REAL,SIN C .. NOVER2 = N/2 IF (2*NOVER2.NE.N) THEN C WRITE (EMESS,FMT=9000) N call ccperr(1, EMESS) ELSE TWON = REAL(2*N) TWOPI = 6.2831852 D1 = DIM(1) D2 = DIM(2) D3 = DIM(3) D4 = DIM(4) - 1 D5 = DIM(5) C S = -1.0 IF (NOVER2.EQ. (2* (NOVER2/2))) S = -S K0 = (N-1)*D2 + 1 DO 20 K1 = K0,D1,D3 K2 = K1 + D4 DO 10 K = K1,K2,D5 L = K + D2 Y(L) = X(K)*S 10 CONTINUE 20 CONTINUE S = 1.0 NN = N - 2 DO 50 I = 1,NN,2 S = -S MN = (N+1-I)*D2 K0 = (I-1)*D2 + 1 DO 40 K1 = K0,D1,D3 K2 = K1 + D4 DO 30 K = K1,K2,D5 J = K + D2 L = 2*D2 + K M = K + MN Y(M) = X(J)*S + Y(M) X(K) = X(K) + X(J) X(J) = X(L) - X(J) Y(K) = Y(K) + Y(J) Y(J) = Y(J) - Y(L) 30 CONTINUE 40 CONTINUE 50 CONTINUE K0 = (N-2)*D2 + 1 DO 70 K1 = K0,D1,D3 K2 = K1 + D4 DO 60 K = K1,K2,D5 L = K + D2 X(K) = X(K) + X(L) Y(K) = Y(K) + Y(L) J = L + D2 X(L) = X(J) - X(L) 60 CONTINUE 70 CONTINUE C C---- Reorder scrambled fourier coefficients C DO 110 I = 1,NN K = I 80 CONTINUE K = 2*K IF (K.GT.N-1) K = 2*N - 1 - K IF (K.LT.I) GO TO 80 IF (K.NE.I) THEN J = (K-I)*D2 K0 = I*D2 + 1 DO 100 K1 = K0,D1,D3 K2 = K1 + D4 DO 90 K = K1,K2,D5 L = K + J A = X(K) X(K) = X(L) X(L) = A A = Y(K) Y(K) = Y(L) Y(L) = A 90 CONTINUE 100 CONTINUE END IF 110 CONTINUE C CALL CMPLFT(X,Y,N,DIM) C M = NOVER2 - 1 DO 150 I = 1,M ANGLE = REAL(I)*TWOPI/TWON C = COS(ANGLE) S = SIN(ANGLE) K0 = I*D2 + 1 FOLD = .TRUE. 120 CONTINUE C DO 140 K1 = K0,D1,D3 K2 = K1 + D4 DO 130 K = K1,K2,D5 A = Y(K)/C X(K) = X(K) + S*A Y(K) = A 130 CONTINUE 140 CONTINUE IF (FOLD) THEN C C = -C K0 = (N-I)*D2 + 1 FOLD = .FALSE. GO TO 120 END IF 150 CONTINUE C M = NOVER2*D2 K0 = M + 1 DO 170 K1 = K0,D1,D3 K2 = K1 + D4 DO 160 K = K1,K2,D5 J = K - M L = K + M A = Y(L)*2.0 X(K) = X(K) + A Y(K) = A X(L) = X(J) Y(L) = -Y(J) 160 CONTINUE 170 CONTINUE C END IF C C---- Format statements C 9000 FORMAT ('FFT error: SDIAD: N odd. N =',I10) END C C SUBROUTINE DIPRP(PTS,SYM,PSYM,UNSYM,DIM,X,Y) C ================================================= C C C---- Double in place reordering programme C C C .. Scalar Arguments .. INTEGER PSYM,PTS C .. C .. Array Arguments .. REAL X(*),Y(*) INTEGER DIM(5),SYM(15),UNSYM(15) C .. C .. Local Scalars .. REAL T INTEGER A,AL,B,BL,BS,C,CL,CS,D,DELTA,DK,DL,DS,E,EL,ES,F, + FL,FS,G,GL,GS,H,HL,HS,I,IL,IS,J,JJ,JL,JS,K,KK,KL, + KS,L,LK,LL,LS,M,ML,MODS,MS,MULT,N,NEST,NL,NS,NT, + P,P0,P1,P2,P3,P4,P5,PUNSYM,SEP,SIZE,TEST LOGICAL ONEMOD C .. C .. Local Arrays .. INTEGER MODULO(14),S(14),U(14) C .. C .. Equivalences .. EQUIVALENCE (AL,U(1)), (BS,S(2)), (BL,U(2)) EQUIVALENCE (CS,S(3)), (CL,U(3)), (DS,S(4)), (DL,U(4)) EQUIVALENCE (ES,S(5)), (EL,U(5)), (FS,S(6)), (FL,U(6)) EQUIVALENCE (GS,S(7)), (GL,U(7)), (HS,S(8)), (HL,U(8)) EQUIVALENCE (IS,S(9)), (IL,U(9)), (JS,S(10)), (JL,U(10)) EQUIVALENCE (KS,S(11)), (KL,U(11)), (LS,S(12)), (LL,U(12)) EQUIVALENCE (MS,S(13)), (ML,U(13)), (NS,S(14)), (NL,U(14)) C .. NEST = 14 C NT = DIM(1) SEP = DIM(2) P2 = DIM(3) SIZE = DIM(4) - 1 P4 = DIM(5) IF (SYM(1).NE.0) THEN DO 10 J = 1,NEST U(J) = 1 S(J) = 1 10 CONTINUE N = PTS DO 20 J = 1,NEST IF (SYM(J).EQ.0) THEN GO TO 30 ELSE JJ = NEST + 1 - J U(JJ) = N S(JJ) = N/SYM(J) N = N/SYM(J) END IF 20 CONTINUE C 30 JJ = 0 DO 190 A = 1,AL DO 180 B = A,BL,BS DO 170 C = B,CL,CS DO 160 D = C,DL,DS DO 150 E = D,EL,ES DO 140 F = E,FL,FS DO 130 G = F,GL,GS DO 120 H = G,HL,HS DO 110 I = H,IL,IS DO 100 J = I,JL,JS DO 90 K = J,KL,KS DO 80 L = K,LL,LS DO 70 M = L,ML,MS DO 60 N = M,NL,NS JJ = JJ + 1 IF (JJ.LT.N) THEN DELTA = (N-JJ)*SEP P1 = (JJ-1)*SEP + 1 DO 50 P0 = P1,NT,P2 P3 = P0 + SIZE DO 40 P = P0,P3,P4 P5 = P + DELTA T = X(P) X(P) = X(P5) X(P5) = T T = Y(P) Y(P) = Y(P5) Y(P5) = T 40 CONTINUE 50 CONTINUE END IF 60 CONTINUE 70 CONTINUE 80 CONTINUE 90 CONTINUE 100 CONTINUE 110 CONTINUE 120 CONTINUE 130 CONTINUE 140 CONTINUE 150 CONTINUE 160 CONTINUE 170 CONTINUE 180 CONTINUE 190 CONTINUE END IF C IF (UNSYM(1).NE.0) THEN PUNSYM = PTS/PSYM**2 MULT = PUNSYM/UNSYM(1) TEST = (UNSYM(1)*UNSYM(2)-1)*MULT*PSYM LK = MULT DK = MULT DO 200 K = 2,NEST IF (UNSYM(K).EQ.0) THEN GO TO 210 ELSE LK = UNSYM(K-1)*LK DK = DK/UNSYM(K) U(K) = (LK-DK)*PSYM MODS = K END IF 200 CONTINUE 210 ONEMOD = MODS .LT. 3 IF (.NOT.ONEMOD) THEN DO 220 J = 3,MODS JJ = MODS + 3 - J MODULO(JJ) = U(J) 220 CONTINUE END IF MODULO(2) = U(2) JL = (PUNSYM-3)*PSYM MS = PUNSYM*PSYM C DO 290 J = PSYM,JL,PSYM K = J 230 CONTINUE C K = K*MULT IF (.NOT.ONEMOD) THEN DO 240 I = 3,MODS K = K - (K/MODULO(I))*MODULO(I) 240 CONTINUE END IF IF (K.GE.TEST) THEN K = K - (K/MODULO(2))*MODULO(2) + MODULO(2) ELSE K = K - (K/MODULO(2))*MODULO(2) END IF IF (K.LT.J) GO TO 230 C IF (K.NE.J) THEN DELTA = (K-J)*SEP DO 280 L = 1,PSYM DO 270 M = L,PTS,MS P1 = (M+J-1)*SEP + 1 DO 260 P0 = P1,NT,P2 P3 = P0 + SIZE DO 250 JJ = P0,P3,P4 KK = JJ + DELTA T = X(JJ) X(JJ) = X(KK) X(KK) = T T = Y(JJ) Y(JJ) = Y(KK) Y(KK) = T 250 CONTINUE 260 CONTINUE 270 CONTINUE 280 CONTINUE END IF 290 CONTINUE END IF C END C C Obscure routines only used by SFALL C =============================== SUBROUTINE PRMVCI(PERM,JV,N,N1) C =============================== C C---- Permute vector JV(N,3) by permutation matrix PERM C N1 is first dimension of JV C C .. Scalar Arguments .. INTEGER N,N1 C .. C .. Array Arguments .. REAL PERM(4,4) INTEGER JV(N1,3) C .. C .. Local Scalars .. INTEGER I C .. C .. Local Arrays .. REAL BV(3) C .. C .. Intrinsic Functions .. INTRINSIC NINT C .. C C---- Permute C DO 10 I = 1,3 BV(I) = PERM(I,1)*FLOAT(JV(N,1)) + PERM(I,2)*FLOAT(JV(N,2)) + + PERM(I,3)*FLOAT(JV(N,3)) 10 CONTINUE C C---- Copy back C DO 20 I = 1,3 JV(N,I) = NINT(BV(I)) 20 CONTINUE C END C C =============================== SUBROUTINE PRMVCR(PERM,AV,N,N1) C =============================== C C---- Permute vector AV(N,3) by permutation vector KP C N1 is first dimension of AV C C .. Scalar Arguments .. INTEGER N,N1 C .. C .. Array Arguments .. REAL AV(N1,3),PERM(4,4) C .. C .. Local Scalars .. INTEGER I C .. C .. Local Arrays .. REAL BV(3) C .. C C---- Permute C DO 10 I = 1,3 BV(I) = PERM(I,1)*AV(N,1) + PERM(I,2)*AV(N,2) + + PERM(I,3)*AV(N,3) 10 CONTINUE C C---- Copy back C DO 20 I = 1,3 AV(N,I) = BV(I) 20 CONTINUE C END C libccp4-8.0.0/fortran/keyparse.f0000644000000000000000000003362714242731033014644 0ustar 00000000000000C C keyparse.f: high-level interface to CCP4 parser functions C Copyright (C) 1995 Dave Love, Kevin Cowtan C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C C A simplified interface to the %$!$#@$ (so-called) parser: C C The idea is to call a routine (MEMOPARSE) to read a keyworded line C into a hidden internal buffer and then have a simple chain of C calls to a set of routines which check the appropriate keyword, C look for any extra arguments associated with it, and set values in C their arguments as appropriate. No if ... then ... else (or, much C worse, assigned goto) is necessary, nor maintaining the parser C arrays -- the relevant checking is done internally. At the end of C the checks, call PARSEDIAGNOSE to print any appropriate messages C and loop back to MEMOPARSE if PARSEDIAGNOSE's argument is true C (otherwise continue and process the data read in). You don't need C to check for `END' or end-of-file. Geddit? C C Escape hatch: use PARSEKEYARG to get all the tokens after a random C keyword and call PARSE (or whatever) to deal with them as C necessary. This is usually deprecated, however -- go for C simply-structured input. C C 10 call memoparse (.true.) ! setup and echo i/p C call parseint ('IVAL', ival) ! ival.eq.3 after `IVAL 3' C call parsecell (cell) ! assign cell from `CELL 20 30 40' etc. C call parsekeyarg ('FRED', rest) ! the full horror in REST C call parse (rest, ....) C [firkle with the `parse'd arrays] C ... C call parsediagnose (cont) ! check C if (cont) goto 10 C c now do something useful... C C Fixme: the set of routines below might need extending... C Fixme: consider whether more obscure names worthwhile to avoid C possible clashes. C C Dave Love $Date$ C Additions by Kevin Cowtan C subroutine memoparse (echo) C C Call PARSER and stash the returned values away for later testing C when the other entrypoints are called. (OK, so it's not really C memoisation...). C C ECHO is set to echo the parser i/p. implicit none C Args character*(*) key, subkey, spgnam, pgname, rest character*30 prglab(*) character*1 chnam logical echo, flag, cont integer ival, nsym, numsgp, nsymp, n, ivals (n), nth, mtznum, + nprglab, toks, inat0, inat1, ires0, ires1, imode, ifail real rval, cell (6), rsym (4,4,*), resmin, resmax, smin, smax, + rvals(n) C Stores for parser stuff integer maxtoks, maxline C Let's not mess around... parameter (maxtoks = 500, maxline=2000) integer ibeg(maxtoks), iend(maxtoks), ityp(maxtoks), idec(maxtoks) real fvalue (maxtoks) character*4 cvalue (maxtoks), memokey, memosubkey character line*(maxline) integer ntok C locals logical someerr, eof, argerr, success(maxtoks) integer i, k save data someerr, eof /2*.false./ ntok=maxtoks argerr = .false. line = ' ' C in case of immediate EOF: success(1) = .true. call parser(memokey, line, ibeg, iend, ityp, fvalue, cvalue, idec, + ntok, eof, echo) C END == EOF always if (memokey.eq.'END') eof = .true. C not sure if necessary: if (eof) memokey = ' ' do i=1,ntok success(i) = .false. enddo return entry parsekey (key, flag) C bare KEY -- set FLAG if found if (memokey.eq.key) then C matched key if (ntok.eq.1) then success(1) = .true. flag = .true. else argerr = .true. call lerror (1, 0, 'No argument expected') end if end if return entry parsekeyarg (key, rest) C KEY + rest of line -- rest of line returned in REST if (memokey.eq.key) then C matched key if (ntok.gt.1) then do i=1,ntok success(i) = .true. enddo rest = line (ibeg(2):iend(ntok)) else rest = ' ' success(1) = .true. C argerr = .true. C call lerror (1, 0, 'Argument expected') end if end if return entry parseint (key, ival) C KEY + integer -- returned in IVAL if (memokey.eq.key) then C matched key if (ntok.eq.2 .and. ityp (2).eq.2) then ival = nint (fvalue(2)) do i=1,2 success(i) = .true. enddo else argerr = .true. call lerror (1, 0, 'Integer argument expected') end if end if return entry parsereal (key, rval) C KEY + real -- returned in RVAL if (memokey.eq.key) then C matched key if (ntok.eq.2 .and. ityp (2).eq.2) then rval = fvalue(2) do i=1,2 success(i) = .true. enddo else argerr = .true. call lerror (1, 0, 'Real argument expected') end if end if return entry parsenargs(key, toks) toks = 0 if (memokey .eq. key) toks = ntok return entry parsenints (key, n, ivals) C KEY + upto N integers -- N reset to number found, returned in IVALS if (memokey.eq.key) then success(1)=.true. if (ntok.ge.2 .and. ntok.le. n+1) then do i = 1, min (n, ntok-1) if (ityp (i+1).ne.2) return ivals (i) = nint (fvalue (i+1)) n = i success(i+1) = .true. end do else argerr = .true. n = ntok call lerror (1, 0, 'Incorrect number of integer arguments') end if end if return entry parsenreals (key, n, rvals) C KEY + upto N reals -- N reset to number found, returned in RVALS if (memokey.eq.key) then success(1)=.true. if (ntok.ge.2 .and. ntok.le. n+1) then do i = 1, min (n, ntok-1) if (ityp (i+1).ne.2) return rvals (i) = fvalue (i+1) n = i success(i+1) = .true. end do else argerr = .true. n = ntok call lerror (1, 0, 'Incorrect number of real arguments') end if end if return entry parsesubkey (key, subkey, flag) C KEY + subkeyword SUB -- set FLAG if found if (memokey.eq.key) then C matched key success(1) = .true. if (subkey.ne.' ') then do k=2,ntok memosubkey=cvalue(k) call ccpupc(memosubkey) if (memosubkey.eq.subkey) then flag=.true. success(k)=.true. endif enddo else flag=.true. end if end if return entry parsesubkeyarg (key, subkey, nth, rest) C KEY + subkey + rest of line -- rest of line returned in REST if (memokey.eq.key) then C matched key success(1) = .true. k = 1 if (subkey .ne. ' ') then k = 9999 do i=2,ntok memosubkey=cvalue(i) call ccpupc(memosubkey) if (memosubkey.eq.subkey) then k = i goto 90 endif enddo endif 90 if (k.le.ntok) then if (ntok.ge.k+nth) then rest = line (ibeg(k+nth):iend(ntok)) do i=2,ntok success(i) = .true. enddo else argerr = .true. call lerror (1, 0, 'Argument expected after sub-keyword') end if end if end if return entry parsesubint (key, subkey, nth, flag, ival) C KEY + n'th integer after subkey -- returned in IVAL C ERROR only if flag=true if (memokey.eq.key) then C ... matched key success(1) = .true. k=1 if (subkey.ne.' ') then k=9999 do i=2,ntok memosubkey=cvalue(i) call ccpupc(memosubkey) if (memosubkey.eq.subkey) then k=i goto 100 endif enddo endif 100 if (k.le.ntok) then C .... matched subkey (if set) success(k) = .true. if (ntok.ge.nth+k .and. ityp(nth+k).eq.2) then ival = nint (fvalue(nth+k)) success(nth+k) = .true. else if (flag) then argerr = .true. call lerror (1, 0, 'Integer sub-argument expected') endif endif endif return entry parsesubreal (key, subkey, nth, flag, rval) C KEY + n'th real after subkey -- returned in RVAL C ERROR only if flag=true if (memokey.eq.key) then C ... matched key success(1) = .true. k=1 if (subkey.ne.' ') then k=9999 do i=2,ntok memosubkey=cvalue(i) call ccpupc(memosubkey) if (memosubkey.eq.subkey) then k=i goto 110 endif end do endif 110 if (k.le.ntok) then C .... matched subkey (if set) success(k) = .true. if (ntok.ge.nth+k .and. ityp(nth+k).eq.2) then rval = fvalue(nth+k) success(nth+k) = .true. else if (flag) then argerr = .true. call lerror (1, 0, 'Real sub-argument expected') endif endif endif return entry parsesubchar (key, subkey, nth, flag, rest) C KEY + n'th string after subkey -- returned in REST if (memokey.eq.key) then C ... matched key success(1) = .true. k=1 if (subkey.ne.' ') then k=9999 do i=2,ntok memosubkey=cvalue(i) call ccpupc(memosubkey) if (memosubkey.eq.subkey) then k=i goto 120 endif end do endif 120 if (k.le.ntok) then C .... matched subkey (if set) success(k) = .true. if (ntok.ge.nth+k .and. (ityp(nth+k).ne.0 .or. .not.flag) ) then rest = line(ibeg(nth+k):iend(nth+k)) success(nth+k) = .true. else if (flag) then argerr = .true. call lerror (1, 0, 'Character sub-argument expected') endif endif endif return entry parsecell (cell) C CELL -- returned in CELL if (memokey.eq.'CELL') then call rdcell (2, ityp, fvalue, ntok, cell) do i=1,ntok success(i) = .true. enddo end if return entry parsesymm (spgnam, numsgp, pgname, nsym, nsymp, rsym) C SYMMetry -- usual values returned if (memokey.eq.'SYMM') then nsym = 0 call rdsymm(2, line, ibeg, iend, ityp, fvalue, ntok, spgnam, + numsgp, pgname, nsym, nsymp, rsym) do i=1,ntok success(i) = .true. enddo end if return entry parseatomselect(key, inat0, inat1, ires0, ires1, chnam, + imode) C KEYword followed by atom/residue selection syntax C key atom [[to] ] | C residue [all|ons|ca] [chain ] [[to] ] C Returns values of ,,imode... if (memokey.eq.key) then C matched key ifail = -1 call rdatomselect(2, inat0, inat1, ires0, ires1, chnam, imode, + ntok, line, ibeg, iend, ityp, idec, fvalue, + ifail) do i=1,ntok if (i.ne.ifail) success(i)=.true. enddo endif return entry parsereso (resmin, resmax, smin, smax) C RESOlution -- usual values returned if (memokey.eq.'RESO') then call rdreso (2, ityp, fvalue, ntok, resmin, resmax, smin, smax) do i=1,ntok success(i) = .true. enddo end if return entry parselabin(mtznum,prglab,nprglab) C LABIn -- requires mtz file number, program labels, and number of. if (memokey.eq.'LABI') then call lkyin(mtznum,prglab,nprglab,ntok,line,ibeg,iend) do i=1,ntok success(i) = .true. enddo end if return entry parselabout(mtznum,prglab,nprglab) C LABOut -- requires mtz file number, program labels, and number of. if (memokey.eq.'LABO') then call lkyout(mtznum,prglab,nprglab,ntok,line,ibeg,iend) do i=1,ntok success(i) = .true. enddo end if return entry parsefail() do i=1,ntok success(i) = .false. enddo return entry parseend(key) C KEY -- is treated as input terminator as same as END if (memokey .eq. key) eof = .true. return entry parsediagnose (cont) C Call at end of tests for possible 'Invalid keyword' diagnostic or C abort if at EOF and had an error. Continue processing (no EOF) C if (cont). if (.not.argerr .and. .not.eof) then if (.not.success(1)) then call lerror (1, 0, 'Invalid keyword') someerr = .true. endif do i=2,ntok if (.not.success(i)) then write (line,950)i 950 format ('Invalid sub-keyword in position ',i2) call lerror (1, 0, line) someerr = .true. endif enddo endif if (argerr) then someerr = .true. end if argerr = .false. if (eof) then cont = .false. if(someerr) call ccperr (1, 'Input error (see above)') else cont = .true. end if do i=1,ntok success(i) = .false. enddo return C end libccp4-8.0.0/fortran/lgglib.f0000644000000000000000000051601514242731033014256 0ustar 00000000000000C C lgglib.f: functions used by Guoguang Lu's programs C Copyright (C) 1999 Guoguang Lu C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C function angle(v1,v2) c calculate the angle between two vectors v1, and v2 c v1, v2 are the input 3*vectors c angle is the output angle between them (in degrees) real*4 v1(3),v2(3) c external acosd c write(7,*) 'v1,v2',v1,v2 c write(7,*) 'vem v1,v2',vem(3,v1),vem(3,v2) c write(7,*) 'poimut',poimult(3,3,v1,v2) arc = poimult(3,3,v1,v2)/(vem(3,v1)*vem(3,v2)) c write(7,*) 'arc=',arc if (abs(arc).gt.1.) then if (abs(arc)-1.gt.1e-5) write(7,*)'Warning arccosd > 1' if (arc.gt.1.) arc = 1. if (arc.lt.-1.) arc = -1. end if angle = acosd(arc) end c c SUBROUTINE ANGLZ(CELL,V,A) DIMENSION CELL(6),V(3),A(3) DO 10 I=1,3 10 A(I)=CELL(I)*V(I) END c c SUBROUTINE ANTIARR(IM,IN,A1,A) c Transpose an array DIMENSION A1(IM,IN),A(IN,IM) DO 10 II=1,IM DO 10 IJ=1,IN 10 A(IJ,II)=A1(II,IJ) END c c SUBROUTINE ARRAD(IM,IN,A1,A2,OUT) c Add two arrays DIMENSION A1(IM,IN),A2(IM,IN),OUT(IM,IN) DO 10 II=1,IM DO 10 IJ=1,IN 10 OUT(II,IJ)=A1(II,IJ)+A2(II,IJ) END c c SUBROUTINE ARRGIVE(N,XYZ0,XYZ) C Copy an N-dimensional real array XYZ0 to another one XYZ. REAL*4 XYZ(N),XYZ0(N) DO I = 1, N XYZ(I) = XYZ0(I) END DO END c c SUBROUTINE ARRI(IM,IN,A,V,I) c Extract the i'th row of an array INTEGER IM,IN DIMENSION A(IM,IN) DIMENSION V(IN) DO 20 I1=1,IN 20 V(I1)=A(I,I1) RETURN END c c SUBROUTINE ARRJ(IM,IN,A,VJ,IJ) c Extract the j'th column of an array DIMENSION A(IM,IN) DIMENSION VJ(IM) DO 20 I1=1,IM 20 VJ(I1)=A(I1,IJ) RETURN END c c C------MULTIPLY A REAL ARRAY BY A CONSTANT SUBROUTINE ARRMC(IM,IN,A1,C,A) DIMENSION A1(IM,IN),A(IM,IN) DO 10 I1=1,IM DO 10 I2=1,IN 10 A(I1,I2)=A1(I1,I2)*C END c c C-------A STANDARD SUBPROGRAM TO MULTIPLY TWO ARRAYS C A1(IM1,IN1)*A2(IM2,IN2)=RSLT(IM1,IN2) SUBROUTINE ARRMULT(IM1,IN1,IM2,IN2,A1,A2,RSLT,V1,V2) INTEGER IM1,IM2,IN1,IN2 DIMENSION A1(IM1,IN1),A2(IM2,IN2),RSLT(IM1,IN2) DIMENSION V1(IN1),V2(IM2) IF (IN1.NE.IM2) WRITE(6,*) 'The two arrays cannot be multiplied' DO 50 I=1,IM1 CALL ARRI(IM1,IN1,A1,V1,I) DO 40 IJ=1,IN2 CALL ARRJ(IM2,IN2,A2,V2,IJ) 40 RSLT(I,IJ)=POIMULT(IN1,IM2,V1,V2) 50 CONTINUE RETURN END SUBROUTINE ARRPS(IM,IN,A1,A2,OUT) DIMENSION OUT(IM,IN),A1(IM,IN),A2(IM,IN) DO 10 II=1,IM DO 10 IJ=1,IN 10 OUT(II,IJ)=A1(II,IJ)-A2(II,IJ) END c c subroutine arrrtoi(im,in,rmat,imat,err) c convert a matrix from real to integer c IM and IN are the dimensions. c rmat is input real IM*IN-dimension matrix c imat is output integer IM*IN-dimension matrix c err: if difference between real and integer values is bigger than c this parameter program will warn you real*4 rmat(im,in) integer imat(im,in) c do j = 1, in do i = 1, im if (rmat(i,j).ge.0) then imat(i,j) = int(rmat(i,j)+0.5) else imat(i,j) = int(rmat(i,j)-0.5) end if if (abs(rmat(i,j)-float(imat(i,j))).gt.err) then c WRITE(6,*) 'Warning: r-i > ',err c WRITE(6,*) 'i,j,real,integer',i,j,rmat(i,j),imat(i,j) end if end do end do end c c subroutine arrvalue(n,array,value) c initialise an n-dimensional array real array(n) do i = 1, n array(i) = value end do end c c SUBROUTINE AVERG(M,N,XIN,AVE) C A routine to calculate the row averages of an M*N array XIN. C The mean M-dimensional array is AVE which average the N data in XIN. DIMENSION XIN(M,N),AVE(M) XN = N DO I = 1, M AVE(I) = 0. DO J = 1, N AVE(I) = AVE(I) + XIN(I,J) END DO AVE(I) = AVE(I)/ XN END DO END c c function bondangle(xyz1,xyz2,xyz3) c subroutine to calculate a bond angle by giving 3 atoms. the output angle c will be vector 2-1 and 2-3 c 1 3 c \ / c \2/ c bondangle c xyz1,xyz2,xyz3 are the 3 atom positions and bondangle is shown in the fig c real xyz1(3),xyz2(3),xyz3(3) real xyz1(3),xyz2(3),xyz3(3) real b1(3),b2(3) call arrps(3,1,xyz1,xyz2,b1) call arrps(3,1,xyz3,xyz2,b2) bondangle = angle(b1,b2) end c c function bonddihed(xyz1,xyz2,xyz3,xyz4) c subroutine to calculate a dihedral angle by giving 4 atoms. c the output angle will be between plane of 1-2-3 and 2-3-4 c 1 4 1 c \ / \ c \2---3/ \2---3\ bonddihed=180 in this case c bonddihed= 0 in this case \ c 4 c xyz1,xyz2,xyz3 xyz4 are the 4 atom positions and bonddihed is c shown in the fig c real xyz1(3),xyz2(3),xyz3(3),xyz4(3) real xyz1(3),xyz2(3),xyz3(3),xyz4(3) c real b1(3),b2(3) real b321(3),b432(3) real b23(3),b32(3),b34(3),b21(3) real by(3),bdih(3),bd(2) real view(3,3),views(3,3) external acosd, asind c call arrps(3,1,xyz3,xyz2,b23) call arrps(3,1,xyz1,xyz2,b21) call veccrsmlt(b23,b21,b321) call arrps(3,1,xyz2,xyz3,b32) call arrps(3,1,xyz4,xyz3,b34) call veccrsmlt(b34,b32,b432) c call arrgive(3,b321,view(1,1)) c call arrgive(3,b23,view(1,3)) call veccrsmlt(b32,b321,by) call arrmc(3,1,b321,1./vem(3,b321),view(1,1)) call arrmc(3,1,b32,1./vem(3,b32),view(1,3)) call arrmc(3,1,by,1./vem(3,by),view(1,2)) call antiarr(3,3,view,views) call matmult(3,3,3,1,views,b432,bdih) if (bdih(3).gt.1.0e-5) then WRITE(6,*) 'Warning in dihedral',bdih end if c call arrmc(2,1,bdih,1./vem(2,bdih),bd) c c dump here c WRITE(6,*) 'views',views c WRITE(6,*) 'bdih',bdih c WRITE(6,*) 'bd',bd c if (bd(1).ge.0. .and. bd(2).ge. 0.) then bonddihed = acosd(bd(1)) else if (bd(1).ge.0. .and. bd(2).lt.0) then bonddihed = asind(bd(2)) else if (bd(1).lt.0. .and. bd(2).ge.0) then bonddihed = acosd(bd(1)) else if (bd(1).lt.0. .and. bd(2).lt.0) then bonddihed = -acosd(bd(1)) c else c stop ' what could be?' end if end c c subroutine caseres(res1,res2) c A subroutine to change the case of amino acid e.g. PHE to Phe c res1 input residue name c res2 output residue name c character*3 res1,res2,nam1(20),nam2(20) c... data statements. Separate declaration and init required for f2c data nam1 / 1 'ALA','ARG','ASN','ASP','CYS','GLN','GLU','GLY','HIS','ILE', 2 'LEU','LYS','MET','PHE','PRO','SER','THR','TRP','TYR','VAL'/ data nam2 / 1 'Ala','Arg','Asn','Asp','Cys','Gln','Glu','Gly','His','Ile', 2 'Leu','Lys','Met','Phe','Pro','Ser','Thr','Trp','Tyr','Val'/ c do i = 1,20 if (res1.eq.nam1(i)) then res2 = nam2(i) return end if end do res2 = res1 end c c SUBROUTINE CLLZ(NSYM,SYM,CELL) DIMENSION SYM(3,4,NSYM),CELL(6) DO 20 IS=1,NSYM DO 20 IC=1,3 20 SYM(IC,4,IS)=SYM(IC,4,IS)*CELL(IC) END c c SUBROUTINE COMPARE ( NATM, XYZ1, XYZ2, A, T ) C DIMENSION XYZ1(3,NATM), XYZ2(3,NATM), A(3,3), T(3) C A subroutine to compare two structure without superposition. c MOL2 i.e. XYZ2(3*NATM) = A(3*3) * XYZ1(3*NATM) + T(3) C Where NATM represents the number of the atoms in each molecule c which will be superimposed. c XYZ1(3,NATM) represents the coordinates of MOL1 c XYZ2(3,NATM) represents the coordinates of MOL2 C A(3*3) represents the output matrix. c T(3*3) represents the output vector. c C NATM can not be larger than NATM0 (currently 50000) or the parameter NATM0 C should be modified in this routine. c C COMMON/SHIFS/ SCALR,SCALT c DATA SCALR/1./,SCALT/1./ C Note: There should be a scale of the shifts. i.e. Shift= scale * shifts c Here SCALR is the rotation shiftscale c Here SCALT is the translation shiftscale c The initial and suggested SCALR is 1. c The initial and suggested SCALt is 1. C C COMMON/RMS/ RMS,SMEAN,NREF,NREF1 C RMS is the final R.M.S between two molecules. C SMEAN is the mean distance. c NREF is the number of cycles of rotation refinement c NREF1 is not used by this routine. c They could be used to judge the SCALR and SCALS c C COMMON/IAT/ IAT1,IAT2,IAT3,IAT C DATA SCALR/1./,IAT/0/ c by Guoguang Lu C 01/31/1995 at Purdue C COMMON/RMS/ RMS,SMEAN,NREF,NREF1 c COMMON/SHIFS/ SCALR,SCALS c COMMON/IAT/ IAT1,IAT2,IAT3,IAT c DATA SCALR/1./,SCALS/1./,IAT/0/,IAT1/1/,IAT2/2/,IAT3/3/ PARAMETER (NATM0 = 50000) c NATM0 is the largest number of atoms. DIMENSION XYZ1(3,NATM), XYZ2(3,NATM), A(3,3), T(3) DIMENSION X1(3,NATM0),X2(3,NATM0),DIS(3,NATM0) DIMENSION CEN1(3),CEN2(3) DIMENSION B1(3),B2(3),B3(3),T0(3) c c DEG=180./3.14159265359 c C Number of atoms cannot be more than NATM0 or less than 3. c C CALL RTMOV(NATM,XYZ1,A,T,DIS) CALL ARRPS(3,NATM,DIS,XYZ2,DIS) C ATM = NATM SMEAN = 0 DO I=1, NATM D = VEM(3,DIS(1,I)) SMEAN = SMEAN + D END DO SMEAN = SMEAN /ATM C c SMEAN = SIGMA (DISTANCE) / N C i i RMS = SQRT ( DOSQ(NATM*3,DIS) / ATM ) C c RMS = SQRT( SIGMA (DISTANCE^2) / N ) C i i c WRITE(6,*) WRITE(6,*) 'R.M.S.' WRITE(6,*) ' natm' WRITE(6,*) 'SQRT( SIGMA (Distance(i)^2)/natm ) = ',RMS WRITE(6,*) ' i=1' C WRITE(6,*) WRITE(6,*) 'Mean Distance:' WRITE(6,*) ' natm' WRITE(6,*) 'SIGMA (Distance(i)) /natm = ',SMEAN WRITE(6,*) ' i=1' C WRITE(6,*) WRITE(6,*) 'Mol1 is superposed to Mol2.' WRITE(6,*) 'The matrix and the vector are:' WRITE(6,*) WRITE(6,1) (A(1,J),J=1,3),CEN1(1),T0(1) WRITE(6,2) (A(2,J),J=1,3),CEN1(2),T0(2) WRITE(6,1) (A(3,J),J=1,3),CEN1(3),T0(3) 1 FORMAT(1X,' (',3F10.6,' ) ( ',f10.5,' ) (' 1 ,f10.5,' )') 2 FORMAT(1X,' X2 = (',3F10.6,' ) * ( X1 -',f10.5,' ) + (' 1 ,f10.5,' )') C CALL MATMULT(3,3,3,1,A,CEN1,B3) CALL ARRPS(3,1,T0,B3,B3) CALL ARRAD(3,1,CEN1,B3,T) C WRITE(6,*) WRITE(6,*) WRITE(6,4) (A(1,J),J=1,3),T(1) WRITE(6,5) (A(2,J),J=1,3),T(2) WRITE(6,4) (A(3,J),J=1,3),T(3) 4 FORMAT(1X,' (',3F10.6,' ) ( ) (',f10.5,' )') 5 FORMAT(1X,' X2 = (',3F10.6,' ) * ( X1 ) + (',f10.5,' )') C END c c SUBROUTINE CRSTLARR(CELL,CRST,CRIS) DIMENSION CRST(3,3),CRIS(3,3),BUF1(3),BUF2(3), 1IUF(3),CELL(6) INTEGER IUF external cosd, sind AP=CELL(4) BA=CELL(5) GA=CELL(6) CALL ARRMC(3,1,CRIS,0.,CRIS) COASTAR=(COSD(BA)*COSD(GA)-COSD(AP))/(SIND(BA) 1*SIND(GA)) SIASTAR=SQRT(1.-COASTAR*COASTAR) CRIS(1,1)=1. CRIS(1,2)=COSD(GA) CRIS(1,3)=COSD(BA) CRIS(2,2)=SIND(GA) CRIS(2,3)=-SIND(BA)*COASTAR CRIS(3,3)=SIND(BA)*SIASTAR CALL ARRMC(3,3,CRIS,1.,CRST) CALL IVSN(3,CRST,BUF1,BUF2,IUF,VAL,1E-6) RETURN END c c SUBROUTINE CRTMOVE(NATM,XIN,A,T0,T,XOUT) C A routine to compute: XOUT = A * (XIN-T0) + T C where XIN is the input 3*NATM array C XOUT is the output 3*NATM array c A(3,3) is a 3*3 rotation matrix c T0(3) is a 3-dimensional translational vector. c T(3) is a 3-dimensional translational vector. C Note: XIN has been changed into XIN-T0 after this subroutine. c 89/11/06, BMC,UU,SE c DIMENSION XIN(3,NATM),XOUT(3,NATM),A(3,3),T(3) C DIMENSION XIN(3,NATM),XOUT(3,NATM),A(3,3),T(3),T0(3) DO I = 1, NATM CALL ARRPS(3,1,XIN(1,I),T0,XIN(1,I)) END DO CALL MATMULT(3,3,3,NATM,A,XIN,XOUT) DO I = 1, NATM CALL ARRAD(3,1,XOUT(1,I),T,XOUT(1,I)) END DO END c c SUBROUTINE LGG_CRYSTAL(CELL,CELLS,DEOR,ORTH,DEORS,ORTHS) C PJX - renamed from CRYSTAL to avoid clashes with similarly named C common block in mapmask, ncsmask and dm C C this is a routine which inputs a cell parameter, CELL and calculates c CELLS*6 --- cell dimensions in reciprocal space c DEOR3*3 --- Deorthogonalization matrix in real space c ORTH3*3 --- Orthogonalization matrix in recepical space. c DEORS3*3 --- Deorthogonalization matrix in reciprocal space c ORTHS3*3 --- Orthogonalization matrix in reciprocal space. c All the matrices have cell dimension information in them. c Guoguang 931118 c REAL DEOR(3,3),ORTH(3,3),CELL(6) REAL DEORS(3,3),ORTHS(3,3),CELLS(6) REAL BUFF(3,3) DIMENSION B1(3),B2(3),IUF(3) external cosd, sind AP=CELL(4) BA=CELL(5) GA=CELL(6) COASTAR=(COSD(BA)*COSD(GA)-COSD(AP))/(SIND(BA) 1*SIND(GA)) SIASTAR=SQRT(1.-COASTAR*COASTAR) CALL ARRVALUE(9,ORTH,0.) ORTH(1,1)=CELL(1) ORTH(1,2)=CELL(2)*COSD(GA) ORTH(2,2)=CELL(2)*SIND(GA) ORTH(1,3)=CELL(3)*COSD(BA) ORTH(2,3)=-CELL(3)*SIND(BA)*COASTAR ORTH(3,3)=CELL(3)*SIND(BA)*SIASTAR C CALL ARRGIVE(9,ORTH,DEOR) CALL IVSN(3,DEOR,B1,B2,IUF,DE,1.0E-6) CALL ANTIARR(3,3,ORTH,DEORS) CALL ANTIARR(3,3,DEOR,ORTHS) C DO I = 1, 3 CELLS(I) = VEM(3,orths(1,I)) END DO C CELLS(4) = ANGLE(ORTHS(1,2),ORTHS(1,3)) CELLS(5) = ANGLE(ORTHS(1,3),ORTHS(1,1)) CELLS(6) = ANGLE(ORTHS(1,1),ORTHS(1,2)) RETURN END c c SUBROUTINE CRYSTREC(CELL,CELLS,DEOR,ORTH,DEORS,ORTHS) C this is a routine which inputs a cell parameter, CELL and calculates c matrices for deorthogonalization and orthgonalization c The convention in this routine is x=a* y in plane of a*-b*, z is C direction c CELLS*6 --- cell dimensions in reciprocal space c DEOR3*3 --- Deorthogonalization matrix in real space c ORTH3*3 --- Orthogonalization matrix in reciprocal space. c DEORS3*3 --- Deorthogonalization matrix in reciprocal space c ORTHS3*3 --- Orthogonalization matrix in reciprocal space. c All the matrices have cell dimension information in them. c Guoguang 950914 c REAL DEOR(3,3),ORTH(3,3),CELL(6) REAL DEORS(3,3),ORTHS(3,3),CELLS(6) REAL BUFF(3,3),CELL1(6) DIMENSION B1(3),B2(3),IUF(3) c Get a PDB convention CALL LGG_CRYSTAL(CELL,CELLS,DEOR,ORTH,DEORS,ORTHS) CALL LGG_CRYSTAL(CELLS,CELL1,DEORS,ORTHS,DEOR,ORTH) c end c c c This is a subroutine to split one line into multiple lines by detecting c a separation character for example ; | and so on c the multiple lines will be written to unit iout c iout -- unit to be written to c il -- length of the line c line -- the line of characters to be split c sep -- "separation character" c iline -- output number of lines after splitting. c guoguang 940616 subroutine cutline(iout,line,sep,iline) character*(*) line character*1 sep iline = 0 is = 1 c WRITE(6,*) line c WRITE(6,*) 'sep ',sep il = lenstr(line) do it=il,1,-1 if (ichar(line(it:it)).le.31) then line(it:it) = ' ' else goto 9 end if end do 9 il = it c WRITE(6,*) 'il',il,line(1:il) rewind (iout) if (il.eq.0) return 10 ip = index(line(is:il),sep) if (ip.eq.0) then il1 = lenstr(line(is:il)) if (il1.gt.0) then do isps = is, is+il1-1 if (line(isps:isps).ne.' ') then write(iout,'(a)') line(isps:is+il1-1) iline = iline + 1 rewind (iout) return end if end do stop 'Strange' end if else if (ip.gt.1) then il1 = lenstr(line(is:ip-2+is)) if (il1.gt.0) then do isps = is, is+il1-1 if (line(isps:isps).ne.' ') then write(iout,'(a)') line(isps:is+il1-1) iline = iline + 1 is = ip + is if (is.le.il) goto 10 rewind (10) return end if end do stop 'Strange' end if end if is = ip + is if (is.le.il) goto 10 rewind (10) return end if C stop 'CUTLINE' end c c function dedx2(x1,x2,x3,y1,y2,y3,abc) c this is a program which calculates dy/dx(x2) by fitting c a quadratic through 3 points. c y = a*x^2 + b*x + c c dy/dx = 2*a*x + b c Here dedv = dy/dx(x2) = 2*a*x2 + b c When there are 3 points x1,y1, x2,y2, x3,y3, the coefficients a,b,c c can be obtained from a linear equation and dy/dx(x2) can thus be c obtained. c c dimension abc(3),y(3),arr(3,3) dimension b1(3),b2(3),m(3) c y(1) = y1 y(2) = y2 y(3) = y3 arr(1,1) = x1 * x1 arr(2,1) = x2 * x2 arr(3,1) = x3 * x3 arr(1,2) = x1 arr(2,2) = x2 arr(3,2) = x3 arr(1,3) = 1. arr(2,3) = 1. arr(3,3) = 1. call ivsn(3,arr,b1,b2,m,de,1e-5) call matmult(3,3,3,1,arr,y,abc) dedx2 = 2.*abc(1)*x2 + abc(2) return end c c c a subroutine to convert denzo missetting angle to a matrix c definition [rot]=[rotx]*[roty]*[rotz] c subroutine denmis(phi,rot) real phi(3),rot(3,3) external cosd, sind sinx = sind(phi(1)) cosx = cosd(phi(1)) siny = sind(phi(2)) cosy = cosd(phi(2)) sinz = sind(phi(3)) cosz = cosd(phi(3)) rot(1,1) = cosy*cosz rot(2,1) = -cosx*sinz+sinx*siny*cosz rot(3,1) = sinx*sinz+cosx*siny*cosz rot(1,2) = cosy*sinz rot(2,2) = cosx*cosz+sinx*siny*sinz rot(3,2) = -sinx*cosz+cosx*siny*sinz rot(1,3) = -siny rot(2,3) = sinx*cosy rot(3,3) = cosx*cosy end c c function dihedral(x1,x2,x3,x4) c calculate the dihedral angle of four input positions c x1, x2, x3, x4 are the four input positions c dihedral is the output dihedral angle in degrees real*4 x1(3),x2(3),x3(3),x4(3) real*4 b1(3),b2(3),b3(3),b4(3) c call arrps(3,1,x1,x2,b1) call arrps(3,1,x3,x2,b2) call veccrsmlt(b1,b2,b3) call arrps(3,1,x2,x3,b1) call arrps(3,1,x4,x3,b2) call veccrsmlt(b1,b2,b4) dihedral = angle(b3,b4) end c c FUNCTION DIST(XYZ1,XYZ2) c Subroutine to calculate distance between two positions REAL xyz1(3),xyz2(3) DX = XYZ1(1)-XYZ2(1) DY = XYZ1(2)-XYZ2(2) DZ = XYZ1(3)-XYZ2(3) DIST = SQRT(DX*DX + DY*DY + DZ*DZ) END c c FUNCTION DOSQ(N,V) c DIMENSION V(N) C DOSQ = SIGMA ( V(i)^2 ) C i DIMENSION V(N) DOSQ = 0. DO 10 I=1,N 10 DOSQ = DOSQ + V(I)*V(I) RETURN END c c c------------------------------------------------------------ subroutine down(txt,len) c c convert character string to lower case c character*(*) txt character*80 save character*26 ualpha,lalpha data lalpha /'ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ data ualpha /'abcdefghijklmnopqrstuvwxyz'/ do 9000 i=1,len if((txt(i:i).ge.'A').and.(txt(i:i).le.'Z')) then match = index(lalpha,txt(i:i)) save(i:i) = ualpha(match:match) else save(i:i) = txt(i:i) end if c end do 9000 continue txt = save return end c c SUBROUTINE DRVRBD(ITH,ROH,A) C This is a subroutine to calculate the matrix of deriv(E)/deriv(theta i) c where E is a 3*3 rotation matrix and theta i (i=1,2,3) is Eulerian Angle c in ROH system. C DIMENSION A(3,3),ROH(3) c parameter description: c ITH: when ITH = 1 c the output matrix is deriv(E) /deriv(theta1) c when ITH = 2 c the output matrix is deriv(E) /deriv(theta2) c when ITH = 3 c the output matrix is deriv(E) /deriv(theta3) c ROH are the three Eulerian angles c A is the output deriv matrix. i.e. A = deriv(E) /deriv)(theta i) c written by Guoguang Lu c DIMENSION A(3,3),ROH(3) DIMENSION A1(3,3) ARC=3.14159265359/180.0 SIPS = SIN(ROH(1)*ARC) COPS = COS(ROH(1)*ARC) SITH = SIN(ROH(2)*ARC) COTH = COS(ROH(2)*ARC) SIPH = SIN(ROH(3)*ARC) COPH = COS(ROH(3)*ARC) c c Rossmann & Blow Matrix c c E(1,1) =-SIPS*COTH*SIPH + COPS*COPH c E(1,2) =-SIPS*COTH*COPH - COPS*SIPH c E(1,3) = SIPS*SITH c E(2,1) = COPS*COTH*SIPH + SIPS*COPH c E(2,2) = COPS*COTH*COPH - SIPS*SIPH c E(2,3) = - COPS*SITH c E(3,1) = SITH*SIPH c E(3,2) = SITH*COPH c E(3,3) = COTH IF (ITH.EQ.1) THEN A(1,1) =-coPS*COTH*SIPH - siPS*COPH A(1,2) =-coPS*COTH*COPH + siPS*SIPH A(1,3) = coPS*SITH A(2,1) =-siPS*COTH*SIPH + coPS*COPH A(2,2) =-siPS*COTH*COPH - coPS*SIPH A(2,3) = + siPS*SITH A(3,1) = 0. A(3,2) = 0. A(3,3) = 0. ELSE IF (ITH.EQ.2) THEN A(1,1) =+SIPS*siTH*SIPH A(1,2) =+SIPS*siTH*COPH A(1,3) = SIPS*coTH A(2,1) =-COPS*siTH*SIPH A(2,2) =-COPS*siTH*COPH A(2,3) = - COPS*coTH A(3,1) = coTH*SIPH A(3,2) = coTH*COPH A(3,3) = -siTH ELSE IF (ITH.EQ.3) THEN A(1,1) =-SIPS*COTH*coPH - COPS*siPH A(1,2) =+SIPS*COTH*siPH - COPS*coPH A(1,3) = 0. A(2,1) = COPS*COTH*coPH - SIPS*siPH A(2,2) =-COPS*COTH*siPH - SIPS*coPH A(2,3) = 0. A(3,1) = SITH*coPH A(3,2) = -SITH*siPH A(3,3) = 0. ELSE STOP 'invalid parameter ITH ' END IF C SINCE ROH IS IN DEGREES, THE MATRIX HAS TO BE MULTIPLIED BY ARC CALL ARRMC(3,3,A,ARC,A1) call arrgive(9,a1,a) END c c SUBROUTINE DRVROHTH(ITH,ROH,A) C This is a subroutine to calculate the matrix of deriv(E)/deriv(theta i) c where E is a 3*3 rotation matrix and theta i (i=1,2,3) is Eulerian Angle c in ROH system. C DIMENSION A(3,3),ROH(3) c parameter description: c ITH: when ITH = 1 c the output matrix is deriv(E) /deriv(theta1) c when ITH = 2 c the output matrix is deriv(E) /deriv(theta2) c when ITH = 3 c the output matrix is deriv(E) /deriv(theta3) c ROH are the three Eulerian angles c A is the output deriv matrix. i.e. A = deriv(E) /deriv)(theta i) c written by Guoguang Lu c DIMENSION A(3,3),ROH(3) ARC=3.14159265359/180.0 SIPS = SIN(ROH(1)*ARC) COPS = COS(ROH(1)*ARC) SITH = SIN(ROH(2)*ARC) COTH = COS(ROH(2)*ARC) SIPH = SIN(ROH(3)*ARC) COPH = COS(ROH(3)*ARC) C C C * ROH - MATRIX C C 110 E(1,1) = COPS*COPH - SIPS*SIPH*SITH C E(1,2) =-SIPS*COTH C E(1,3) = COPS*SIPH + SIPS*SITH*COPH C E(2,1) = SIPS*COPH + COPS*SITH*SIPH C E(2,2) = COPS*COTH C E(2,3) = SIPS*SIPH - COPS*SITH*COPH C E(3,1) =-COTH*SIPH C E(3,2) = SITH C E(3,3) = COTH*COPH IF (ITH.EQ.1) THEN A(1,1) = -SIPS*COPH - COPS*SIPH*SITH A(1,2) = -COPS*COTH A(1,3) = -SIPS*SIPH + COPS*SITH*COPH A(2,1) = COPS*COPH - SIPS*SITH*SIPH A(2,2) = -SIPS*COTH A(2,3) = COPS*SIPH + SIPS*SITH*COPH A(3,1) = 0. A(3,2) = 0. A(3,3) = 0. ELSE IF (ITH.EQ.2) THEN A(1,1) = - SIPS*SIPH*COTH A(1,2) = SIPS*SITH A(1,3) = SIPS*COTH*COPH A(2,1) = COPS*COTH*SIPH A(2,2) = -COPS*SITH A(2,3) = - COPS*COTH*COPH A(3,1) = SITH*SIPH A(3,2) = COTH A(3,3) = -SITH*COPH ELSE IF (ITH.EQ.3) THEN A(1,1) = -COPS*SIPH - SIPS*COPH*SITH A(1,2) = 0. A(1,3) = COPS*COPH - SIPS*SITH*SIPH A(2,1) =- SIPS*SIPH + COPS*SITH*COPH A(2,2) = 0. A(2,3) = SIPS*COPH + COPS*SITH*SIPH A(3,1) =-COTH*COPH A(3,2) = 0. A(3,3) = - COTH*SIPH ELSE STOP 'invalid parameter ITH ' END IF END c c SUBROUTINE DRVROHTHARC(ITH,ROH,A) C This is a subroutine to calculate the matrix of deriv(E)/deriv(theta i) c where E is a 3*3 rotation matrix and theta i (i=1,2,3) is Eulerian Angle c in ROH system. C DIMENSION A(3,3),ROH(3) c parameter description: c ITH: when ITH = 1 c the output matrix is deriv(E) /deriv(theta1) c when ITH = 2 c the output matrix is deriv(E) /deriv(theta2) c when ITH = 3 c the output matrix is deriv(E) /deriv(theta3) c ROH are the three Eulerian angles c A is the output deriv matrix. i.e. A = deriv(E) /deriv)(theta i) c written by Guoguang Lu c DIMENSION A(3,3),ROH(3) C ARC=3.14159265359/180.0 C ARC= 1.0 SIPS = SIN(ROH(1)) COPS = COS(ROH(1)) SITH = SIN(ROH(2)) COTH = COS(ROH(2)) SIPH = SIN(ROH(3)) COPH = COS(ROH(3)) C C C * ROH - MATRIX C C 110 E(1,1) = COPS*COPH - SIPS*SIPH*SITH C E(1,2) =-SIPS*COTH C E(1,3) = COPS*SIPH + SIPS*SITH*COPH C E(2,1) = SIPS*COPH + COPS*SITH*SIPH C E(2,2) = COPS*COTH C E(2,3) = SIPS*SIPH - COPS*SITH*COPH C E(3,1) =-COTH*SIPH C E(3,2) = SITH C E(3,3) = COTH*COPH IF (ITH.EQ.1) THEN A(1,1) = -SIPS*COPH - COPS*SIPH*SITH A(1,2) = -COPS*COTH A(1,3) = -SIPS*SIPH + COPS*SITH*COPH A(2,1) = COPS*COPH - SIPS*SITH*SIPH A(2,2) = -SIPS*COTH A(2,3) = COPS*SIPH + SIPS*SITH*COPH A(3,1) = 0. A(3,2) = 0. A(3,3) = 0. ELSE IF (ITH.EQ.2) THEN A(1,1) = - SIPS*SIPH*COTH A(1,2) = SIPS*SITH A(1,3) = SIPS*COTH*COPH A(2,1) = COPS*COTH*SIPH A(2,2) = -COPS*SITH A(2,3) = - COPS*COTH*COPH A(3,1) = SITH*SIPH A(3,2) = COTH A(3,3) = -SITH*COPH ELSE IF (ITH.EQ.3) THEN A(1,1) = -COPS*SIPH - SIPS*COPH*SITH A(1,2) = 0. A(1,3) = COPS*COPH - SIPS*SITH*SIPH A(2,1) =- SIPS*SIPH + COPS*SITH*COPH A(2,2) = 0. A(2,3) = SIPS*COPH + COPS*SITH*SIPH A(3,1) =-COTH*COPH A(3,2) = 0. A(3,3) = - COTH*SIPH ELSE STOP 'invalid parameter ITH ' END IF END c c SUBROUTINE DRVROHTHD(ITH,ROH,A) C This is a subroutine to calculate the matrix of deriv(E)/deriv(theta i) c where E is a 3*3 rotation matrix and theta i (i=1,2,3) is Eulerian Angle c in ROH system. C DIMENSION A(3,3),ROH(3) c parameter description: c ITH: when ITH = 1 c the output matrix is deriv(E) /deriv(theta1) c when ITH = 2 c the output matrix is deriv(E) /deriv(theta2) c when ITH = 3 c the output matrix is deriv(E) /deriv(theta3) c ROH are the three Eulerian angles c A is the output deriv matrix. i.e. A = deriv(E) /deriv)(theta i) c written by Guoguang Lu c DIMENSION A(3,3),ROH(3) DIMENSION A1(3,3) ARC=3.14159265359/180.0 SIPS = SIN(ROH(1)*ARC) COPS = COS(ROH(1)*ARC) SITH = SIN(ROH(2)*ARC) COTH = COS(ROH(2)*ARC) SIPH = SIN(ROH(3)*ARC) COPH = COS(ROH(3)*ARC) C C C * ROH - MATRIX C C 110 E(1,1) = COPS*COPH - SIPS*SIPH*SITH C E(1,2) =-SIPS*COTH C E(1,3) = COPS*SIPH + SIPS*SITH*COPH C E(2,1) = SIPS*COPH + COPS*SITH*SIPH C E(2,2) = COPS*COTH C E(2,3) = SIPS*SIPH - COPS*SITH*COPH C E(3,1) =-COTH*SIPH C E(3,2) = SITH C E(3,3) = COTH*COPH IF (ITH.EQ.1) THEN A(1,1) = -SIPS*COPH - COPS*SIPH*SITH A(1,2) = -COPS*COTH A(1,3) = -SIPS*SIPH + COPS*SITH*COPH A(2,1) = COPS*COPH - SIPS*SITH*SIPH A(2,2) = -SIPS*COTH A(2,3) = COPS*SIPH + SIPS*SITH*COPH A(3,1) = 0. A(3,2) = 0. A(3,3) = 0. ELSE IF (ITH.EQ.2) THEN A(1,1) = - SIPS*SIPH*COTH A(1,2) = SIPS*SITH A(1,3) = SIPS*COTH*COPH A(2,1) = COPS*COTH*SIPH A(2,2) = -COPS*SITH A(2,3) = - COPS*COTH*COPH A(3,1) = SITH*SIPH A(3,2) = COTH A(3,3) = -SITH*COPH ELSE IF (ITH.EQ.3) THEN A(1,1) = -COPS*SIPH - SIPS*COPH*SITH A(1,2) = 0. A(1,3) = COPS*COPH - SIPS*SITH*SIPH A(2,1) =- SIPS*SIPH + COPS*SITH*COPH A(2,2) = 0. A(2,3) = SIPS*COPH + COPS*SITH*SIPH A(3,1) =-COTH*COPH A(3,2) = 0. A(3,3) = - COTH*SIPH ELSE STOP 'invalid parameter ITH ' END IF C SINCE ROH IS IN DEGREES, THE MATRIX HAS TO MULTIPLIED BY ARC CALL ARRMC(3,3,A,ARC,A1) CALL arrgive(9,A1,A1) END c c function dstll2(x1,x2,y1,y2) c a routine to calculate the line-line distance. c input: c x1 and x2 are two positions on line X c y1 and y2 are two positions on line Y c output c dstll1 is the distance between x and y real x1(3),x2(3) real y1(3),y2(3) real b1(3),b2(3),b3(3),b4(3),b5(3),b6(3) c call arrps(3,1,x2,x1,b1) call arrps(3,1,y2,y1,b2) call veccrsmlt(b1,b2,b3) if (vem(3,b3).ge.1e-6) then dstll2 = dstps1(b3,x1,y1) else call arrps(3,1,y1,x1,b5) call arrmc(3,1,b1,1./vem(3,b1),b4) d1 = poimult(3,3,b5,b4) d2 = vem(3,b5) dstll2 = sqrt(d2*d2-d1*d1) end if end c c FUNCTION DSTPL1(VL,XYZ0,XYZ,VPL) C-----------DISTANCE FROM A POINT TO LINE c FUNCTION DSTPL1(VL,XYZ0,XYZ,VPL) c VL -3- is the input direction vector of the line c XYZ0 -3- is the input position of a point on the line c XYZ -3- is the input coordinates of the point. c VPL -3- is the output vector from the point to the line which is c perpendicular to the direction vector of the line. c DISTPL1 is the output distance from the point to the line i.e. /VPL(3)/ C so the equation of the line should be C x-XYZ0(1) y-XYZ0(2) z-XYZ0(3) C ----------- = ----------- = ----------- C VL(1) VL(2) VL(3) C where x,y,z is any position on the line c DIMENSION VL(3),XYZ0(3),XYZ(3),VPL(3) DIMENSION B(3),BUF(3) CALL ARRPS(3,1,XYZ,XYZ0,BUF) T=POIMULT(3,3,BUF,VL)/POIMULT(3,3,VL,VL) CALL ARRMC(3,1,VL,T,BUF) CALL ARRAD(3,1,BUF,XYZ0,B) CALL ARRPS(3,1,XYZ,B,VPL) DSTPL1=VEM(3,VPL) RETURN END c c FUNCTION DSTPL2(VL,XYZ0,XYZ,VP0,VPL) C-----------DISTANCE FROM A POINT TO LINE c FUNCTION DSTPL1(VL,XYZ0,XYZ,VP0,VPL) c VL -3- is the input directional vector of the line c XYZ0 -3- is the a input position which belong to the line c XYZ -3- is the input coordinate of the point. c VP0 -3- is the output coordinate whis is the image of the point in the c line C VPL -3- is the vector from VP0 to XYZ c DISTPL1 is the output distance from the point to the line i.e. /VPL(3)/ C so the equation of the line should be C x-XYZ0(1) y-XYZ0(2) z-XYZ0(3) C ----------- = ----------- = ----------- C VL(1) VL(2) VL(3) C where the x,y,z is any position of the line c DIMENSION VL(3),XYZ0(3),XYZ(3),VP0(3) DIMENSION VPL(3),BUF(3) CALL ARRPS(3,1,XYZ,XYZ0,BUF) DVL = VEM(3,VL) T= POIMULT(3,3,BUF,VL)/DVL*DVL CALL ARRMC(3,1,VL,T,BUF) CALL ARRAD(3,1,BUF,XYZ0,VP0) CALL ARRPS(3,1,XYZ,VP0,VPL) DSTPL2=VEM(3,VPL) RETURN END c c FUNCTION DSTPLROTR(A,T,XYZ) C-----------DISTANCE FROM A POINT TO A ROTATION axis defined by ROT,T c FUNCTION DSTPL1(VL,XYZ0,XYZ,VPL) c A 3*3 is the rotation matrix which defines the axis c T 3 is the translation vector which defines the axis c When there is a non-crystallographic rotation and translation c x2 = A*x1 + t c where A(3,3) is the 3*3 matrix c t(3) is translation vector. c XYZ -3- is the input coordinate of the point. c DISTPLROTR is the output distance from the point to the line i.e. /VPL(3)/ C so the equation of the line should be C where the x,y,z is any position of the line c Guoguang 970921 c real a(3,3),t(3),xyz(3),POL(3),xyz0(3),vpl(3) real B(3),BUF(3),vl(3),vl0(3) real b1(3),b2(3),x1(3),x2(3) external sind c call arrvalue(3,xyz0,0.) call mtovec(a,vl,vkapa) vlm = vem(3,vl) if (vlm.lt.1.e-4) then WRITE(6,*) 'a',a WRITE(6,*) 'vlm',vlm stop 'something strange in dstplrotr' end if if (abs(vlm-1.).gt.1.e-5) then call arrmc(3,1,vl,1./vlm,vl0) call arrgive(3,vl0,vl) end if if (abs(vkapa).lt.1e-4) then go = vem(3,t) dstplrotr=9999. else go = poimult(3,3,t,vl) end if call arrmc(3,1,vl,go,b1) call rtmov(3,xyz,a,t,x1) call arrps(3,1,x1,b1,x2) dstplrotr = dist(x2,xyz)/(2.*sind(vkapa/2.)) end c c FUNCTION DSTPS1(VS,XYZ0,XYZ) C------DISTANCE FROM A POINT TO A SECTION c FUNCTION DSTPS1(VL,XYZ0,XYZ,VPL) c VL -3- is the input directional vector of the plane section c XYZ0 -3- is the a input position which belong to the section c XYZ -3- is the input coordinate of the point. c DISTPL1 is the output distance from the point to the section C so the equation of the section should be C c VS(1) * ( x - XYZ0(1) ) + VS(2) * ( y - XYZ0(2) ) + VS(3) ( z - XYZ0(3) ) = 0 C C where the x,y,z is any position of the section c DIMENSION VS(3),XYZ0(3),XYZ(3),BUF(3) CALL ARRPS(3,1,XYZ,XYZ0,BUF) DSTPS1=POIMULT(3,3,VS,BUF)/VEM(3,VS) RETURN END c c c---------------------------------------------------------- subroutine elb(txt,len) c c eliminate leading blanks from a character string c character*(*) txt character*80 save do 9000 i=1,len if(txt(i:i).ne.' ') then nonb = i go to 100 end if 9000 continue return 100 continue save = txt(nonb:len) txt = save return end c c SUBROUTINE ELIZE(N,E) DIMENSION E(N,N) DO 10 I=1,N E(I,I)=1. c WRITE(6,*) I,E DO 5 IJ=1,N IF (I.NE.IJ) E(I,IJ)=0. 5 CONTINUE 10 CONTINUE RETURN END c c function error2d(xy1,xy2) real xy1(2),xy2(2) e1 = xy2(1)-xy1(1) e2 = xy2(2)-xy1(2) error2d = sqrt(e1*e1+e2*e2) end c c c read in a file and copy to another file c nin --- unit of input file c nout -- unit of output file c file -- name of the input file subroutine filein(nin,nout,file) character*(*) file character*132 line call ccpdpn(nin,file,'readonly','F',0,0) 5 read(nin,'(a)',end=10) line il = lenstr(line) write(nout,'(a)') line(1:il) goto 5 10 continue end c c SUBROUTINE FMATIN(N,X) REAL X(N) DO I = 1, N CALL FRCINSIDE(X(i)) END DO END c c SUBROUTINE FRAC2ANG(XYZ) C A subroutine to convert fractional coordinates xyz into orthogonal c coordinates in Angstrom units. C C SUBROUTINE FRAC2ANG(XYZ) C COMMON/CELL/ CELL,DEOR,ORTH C DIMENSION CELL(6),DEOR(3,3),ORTH(3,3),XYZ(3) C XYZ is an input fractional coordinate 3-dim array. c CELL: 6-dim array to save the cell constants c DEOR is 3*3 array, representing the deorthogonalizing array. c ORTH is 3*3 array, representing the orthogonalizing array. c COMMON/CELL/ CELL,DEOR,ORTH DIMENSION CELL(6),DEOR(3,3),ORTH(3,3),XYZ(3) DIMENSION B1(3),B2(3),B3(3) B3(1) = XYZ(1) * CELL(1) B3(2) = XYZ(2) * CELL(2) B3(3) = XYZ(3) * CELL(3) C CALL matmult(3,3,3,1,ORTH,B3,XYZ,B1) END c c SUBROUTINE FRCINSIDE(X) 10 CONTINUE IF (X.GE.1.) THEN X = MOD(X,1.) ELSE IF (X.LT.0.) THEN X = MOD(X,1.) + 1. END IF END c c SUBROUTINE FRCTOANG(XYZ) C A subroutine to convert fractional coordinates xyz into orthogonal c coordinates in Angstrom units. C C SUBROUTINE FRAC2ANG(XYZ) C COMMON/CELL/ CELL,DEOR,ORTH C DIMENSION CELL(6),DEOR(3,3),ORTH(3,3),XYZ(3) C XYZ is an input fractional coordinate 3-dim array. c CELL: 6-dim array to save the cell constants c DEOR is 3*3 array, representing the deorthogonalizing array. c ORTH is 3*3 array, representing the orthogonalizing array. c obs: different from frac2ang, the deor and orth must be from c subroutine crystal c COMMON/CELL/ CELL,DEOR,ORTH DIMENSION CELL(6),DEOR(3,3),ORTH(3,3),XYZ(3) DIMENSION B1(3),B2(3),B3(3) c B3(1) = XYZ(1) * CELL(1) c B3(2) = XYZ(2) * CELL(2) c B3(3) = XYZ(3) * CELL(3) C B3(1) = XYZ(1) B3(2) = XYZ(2) B3(3) = XYZ(3) CALL matmult(3,3,3,1,ORTH,B3,XYZ,B1) END character*80 function getnam(filnam) character*(*) filnam c character*80 cmd c call spstrunct(filnam) c il = lenstr(filnam) c write(cmd,'(3a)') 'printenv ',filnam(1:il),' > GETNAM' cc call system(cmd) c call ccpdpn(31,'GETNAM','old','F',0,0) c read(31,'(a)') getnam c call spstrunct(getnam) c close (31) getnam = ' ' call ugtenv(filnam,getnam) end c c SUBROUTINE GETPDB(X,ATOM,RES,SEQ,NATM,FILNAM) C A subroutine to read the Protein data bank format coordinate file c X 3*21000 arrays, output xyz coordinates c ATOM 21000 character*4 arrays, output atom names c RES 21000 character*4 arrays, output residue number e.g. A101 A103... C If residue number is like A 1 then it will become A1 c SEQ 21000 character*4 arrays, output peptide name. e.g. PHE TRY .... C NATM is the number of atoms in the coordinate file c FILNAT is the file name of the coordinate. c DIMENSION X(3,21000) CHARACTER*4 ATOM(21000),RES(21000),SEQ(21000),RES2 CHARACTER FILNAM*80,HEAD*6,RES1*5 C DATA FILNAM/'DIAMOND'/ C CALL SPSTRUNCT(FILNAM) call ccpdpn(3,FILNAM,'READONLY','F',0,0) C NATM = 1 5 READ(3,10,ERR=5,END=20) HEAD, ATOM(NATM), SEQ(NATM), RES1 1 , (X(I,NATM),I=1,3) 10 FORMAT(A6,7X,2A4,A5,4X,3F8.3) IF (HEAD.NE.'ATOM '.AND.HEAD.NE.'HEDATM') GOTO 5 C IF (RES1(1:1).NE.' '.AND.RES1(2:2).EQ.' ') THEN RES2(1:1) = RES1(1:1) RES2(2:4) = RES1(3:5) ELSE RES2 = RES1(2:5) END IF C call spstrunct(atom(natm)) call spstrunct(seq(natm)) call spstrunct(RES2) res(natm)=res2 C 12 CONTINUE C NATM = NATM + 1 IF (NATM.GT.21000) STOP 'Atoms can not be more than 21000.' GOTO 5 20 CONTINUE NATM = NATM - 1 CLOSE (3) C END c c SUBROUTINE GETPDB1(X,ATOM,SEQ,RES,BFAC,OCC,NATM,FILNAM) C A subroutine to read the Protein data bank format coordinate file c X 3*15000 arrays, output xyz coordinates c ATOM 15000 character*4 arrays, output atom names c RES 15000 character*4 arrays, output residue number e.g. A101 A103... C If residue number is like A 1 then it will become A1 c SEQ 15000 character*4 arrays, output peptide name. e.g. PHE TRY .... C NATM is the number of atoms in the coordinate file c FILNAT is the file name of the coordinate. c c in this subroutine, hydrogen atoms were excluded. c PARAMETER (MAXATM = 25000) DIMENSION X(3,MAXATM) real bfac(MAXATM),occ(MAXATM) CHARACTER*4 ATOM(MAXATM),RES(MAXATM),SEQ(MAXATM),RES2 CHARACTER FILNAM*80,HEAD*6,RES1*5 C DATA FILNAM/'DIAMOND'/ C CALL SPSTRUNCT(FILNAM) c WRITE(6,*) 'open file' c: WRITE(6,*) filnam call ccpdpn(3,FILNAM,'READONLY','F',0,0) C NATM = 1 5 READ(3,10,ERR=5,END=20) HEAD, ATOM(NATM), SEQ(NATM), RES1 1 , (X(I,NATM),I=1,3),occ(natm),bfac(natm) c normal format c10 FORMAT(A6,7X,2A4,A5,4X,3F8.3,2f6.2) c xplor format 10 FORMAT(A6,6X,2A4,1X,A5,4X,3F8.3,2f6.2) IF (HEAD.NE.'ATOM '.AND.HEAD.NE.'HETATM') GOTO 5 IF (ATOM(NATM)(1:1).EQ.'H'.or.ATOM(NATM)(1:2).EQ.' H') goto 5 C IF (RES1(1:1).NE.' '.AND.RES1(2:2).EQ.' ') THEN RES2(1:1) = RES1(1:1) RES2(2:4) = RES1(3:5) ELSE RES2 = RES1(2:5) END IF C call spstrunct(atom(natm)) call spstrunct(seq(natm)) call spstrunct(RES2) res(natm)=res2 C 12 CONTINUE C NATM = NATM + 1 IF (NATM.GT.MAXATM) STOP 'Atoms can not be more than MAXATM.' GOTO 5 20 CONTINUE NATM = NATM - 1 CLOSE (3) C END c c SUBROUTINE GETPDB2(X,ATOM,SEQ,RES,BFAC,OCC,NATM,FILNAM) C A subroutine to read the Protein data bank format coordinate file c X 3*maxatom arrays, output xyz coordinates c ATOM maxatom character*4 arrays, output atom names c RES maxatom character*4 arrays, output residue number e.g. A101 A103... C If residue number is like A 1 then it will become A1 c SEQ maxatom character*4 arrays, output peptide name. e.g. PHE TRY .... C NATM is the number of atoms in the coordinate file c FILNAT is the file name of the coordinate. c c in this subroutine, hydrogen atoms were included. c c getpdb1 is for xplor file and exclude Hydrogen c getpdb2 is for any file parameter (maxatom = 50000) DIMENSION X(3,maxatom) real bfac(maxatom),occ(maxatom) CHARACTER*4 ATOM(maxatom),RES(maxatom),SEQ(maxatom),RES2 CHARACTER FILNAM*80,HEAD*6,RES1*5 C DATA FILNAM/'DIAMOND'/ C CALL SPSTRUNCT(FILNAM) c WRITE(6,*) 'open file' c: WRITE(6,*) filnam call ccpdpn(3,FILNAM,'READONLY','F',0,0) C NATM = 1 5 READ(3,10,ERR=5,END=20) HEAD, ATOM(NATM), SEQ(NATM), RES1 1 , (X(I,NATM),I=1,3),occ(natm),bfac(natm) c normal format c10 FORMAT(A6,7X,2A4,A5,4X,3F8.3,2f6.2) c xplor format 10 FORMAT(A6,6X,2A4,1X,A5,4X,3F8.3,2f6.2) IF (HEAD.NE.'ATOM '.AND.HEAD.NE.'HETATM') GOTO 5 c IF (ATOM(NATM)(1:1).EQ.'H'.or.ATOM(NATM)(1:2).EQ.' H') goto 5 C IF (RES1(1:1).NE.' '.AND.RES1(2:2).EQ.' ') THEN RES2(1:1) = RES1(1:1) RES2(2:4) = RES1(3:5) ELSE RES2 = RES1(2:5) END IF C call spstrunct(atom(natm)) call spstrunct(seq(natm)) call spstrunct(RES2) res(natm)=res2 C 12 CONTINUE C NATM = NATM + 1 IF (NATM.GT.maxatom) STOP 'Atoms can not be more than maxatom.' GOTO 5 20 CONTINUE NATM = NATM - 1 CLOSE (3) C END c c SUBROUTINE GETPDB3(X,ATOM,SEQ,CH,RES,BFAC,OCC,NATM,FILNAM) C A subroutine to read the Protein data bank format coordinate file c X 3*15000 arrays, output xyz coordinates c ATOM 15000 character*4 arrays, output atom names c RES 15000 character*4 arrays, output residue number e.g. A101 A103... C If residue number is like A 1 then it will become A1 c SEQ 15000 character*4 arrays, output peptide name. e.g. PHE TRY .... C NATM is the number of atoms in the coordinate file c FILNAT is the file name of the coordinate. c c in this subroutine, hydrogen atoms were included. c c getpdb1 is for xplor file and exclude Hydrogen c getpdb2 is for any file parameter (maxpro = 50000) DIMENSION X(3,maxpro) real bfac(maxpro),occ(maxpro) CHARACTER*4 ATOM(maxpro),RES(maxpro),SEQ(maxpro),RES2 character*1 ch(maxpro) CHARACTER FILNAM*80,HEAD*6,RES1*5 C CALL SPSTRUNCT(FILNAM) c WRITE(6,*) 'open file' c: WRITE(6,*) filnam call ccpdpn(3,FILNAM,'READONLY','F',0,0) C NATM = 1 5 READ(3,10,ERR=5,END=20) HEAD, ATOM(NATM), SEQ(NATM), ch(natm), 1 res(natm), (X(I,NATM),I=1,3),occ(natm),bfac(natm) c normal format c10 FORMAT(A6,7X,2A4,A5,4X,3F8.3,2f6.2) c xplor format 10 FORMAT(A6,6X,2A4,1X,a1,A4,4X,3F8.3,2f6.2) IF (HEAD.NE.'ATOM '.AND.HEAD.NE.'HETATM') GOTO 5 c IF (ATOM(NATM)(1:1).EQ.'H'.or.ATOM(NATM)(1:2).EQ.' H') goto 5 C c IF (RES1(1:1).NE.' '.AND.RES1(2:2).EQ.' ') THEN c RES2(1:1) = RES1(1:1) c RES2(2:4) = RES1(3:5) c ELSE c RES2 = RES1(2:5) c END IF C call spstrunct(atom(natm)) call spstrunct(seq(natm)) c call spstrunct(RES2) c res(natm)=res2 C 12 CONTINUE C NATM = NATM + 1 IF (NATM.GT.maxpro) then WRITE(6,*) 'Error: atom number is',natm WRITE(6,*) 'Error.. Atoms cannot be more than',maxpro stop end if GOTO 5 20 CONTINUE NATM = NATM - 1 CLOSE (3) C END c c SUBROUTINE GETPDBCA(X,ATOM,RES,SEQ,NATM,FILNAM) C A subroutine to read the Protein data bank format coordinate file c In this version only Ca atoms are read. -- Guoguang 950922 c X 3*50000 arrays, output xyz coordinates c ATOM 50000 character*4 arrays, output atom names c RES 50000 character*4 arrays, output residue number e.g. A101 A103... C If residue number is like A 1 then it will become A1 c SEQ 50000 character*4 arrays, output peptide name. e.g. PHE TRY .... C NATM is the number of atoms in the coordinate file c FILNAT is the file name of the coordinate. c DIMENSION X(3,50000) CHARACTER*4 ATOM(50000),RES(50000),SEQ(50000),RES2 CHARACTER FILNAM*80,HEAD*6,RES1*5 C DATA FILNAM/'DIAMOND'/ C CALL SPSTRUNCT(FILNAM) call ccpdpn(3,FILNAM,'READONLY','F',0,0) C NATM = 1 5 READ(3,10,ERR=5,END=20) HEAD, ATOM(NATM), SEQ(NATM), RES1 1 , (X(I,NATM),I=1,3) 10 FORMAT(A6,7X,2A4,A5,4X,3F8.3) IF (HEAD(1:3).EQ.'END') GOTO 20 IF (HEAD.NE.'ATOM '.AND.HEAD.NE.'HEDATM') GOTO 5 IF (ATOM(NATM).NE.'CA ') GOTO 5 C IF (RES1(1:1).NE.' '.AND.RES1(2:2).EQ.' ') THEN RES2(1:1) = RES1(1:1) RES2(2:4) = RES1(3:5) ELSE RES2 = RES1(2:5) END IF C call spstrunct(atom(natm)) call spstrunct(seq(natm)) call spstrunct(RES2) res(natm)=res2 C 12 CONTINUE C NATM = NATM + 1 IF (NATM.GT.50000) STOP 'Atoms cannot be more than 50000.' GOTO 5 20 CONTINUE NATM = NATM - 1 CLOSE (3) C END c c SUBROUTINE GETRDI(X,ATOM,RES,SEQ,NATM,FILNAM) C A subroutine to read the Diamond format coordinate file c X 3*5500 arrays, output xyz coordinates c ATOM 5500 character*4 arrays, output atom names c RES 5500 character*4 arrays, output residue number e.g. A101 A103... C If res is 'A 1' then it will be truncated to 'A1 ' c SEQ 5500 character*4 arrays, output peptide name. e.g. PHE TRY .... C NATM is the number of atoms in the coordinate file c FILNAT is the file name of the coordinate. c DIMENSION X(3,5500) CHARACTER*4 ATOM(5500),RES(5500),SEQ(5500),RES1*4 CHARACTER FILNAM*80 C DATA FILNAM/'DIAMOND'/ C CALL SPSTRUNCT(FILNAM) call ccpdpn(2,FILNAM,'READONLY','F',0,0) C READ(2,'(A)') ATOM(1),ATOM(1),ATOM(1) C NATM = 1 5 READ(2,10,ERR=5,END=20) (X(I,NATM),I=1,3), 1 SEQ(NATM), RES(NATM), ATOM(NATM) 10 FORMAT(3F10.4,35X,A3,A4,3X,A4) IF (RES(NATM).EQ.'END '.OR.RES(natm).EQ.'CAST') GOTO 5 C CALL SPSTRUNCT(ATOM(NATM)) CALL SPSTRUNCT(SEQ(NATM)) CALL SPSTRUNCT(RES(NATM)) C 12 NATM = NATM + 1 GOTO 5 20 CONTINUE NATM = NATM - 1 I = 1 CLOSE (2) C 25 IF (I.LE.NATM.AND.SEQ(I).NE.' ') THEN C DO J = I-1, 1, -1 IF (J.LT.1) GOTO 30 IF (RES(I).EQ.RES(J)) THEN SEQ(J) = SEQ(I) ELSE GOTO 30 END IF END DO C 30 DO J = I+1, NATM IF (RES(I).EQ.RES(J)) THEN SEQ(J) = SEQ(I) ELSE GOTO 40 END IF END DO C 40 CONTINUE I = J GOTO 25 ELSE IF (I.LT.NATM) THEN I = I + 1 GOTO 25 ELSE RETURN END IF END c c SUBROUTINE GETSHELX ( X, ATOM, NATM, FILNAM ) c A routine to get coordinates and atom names from a SHELXX format c file. c X is 3*500 array to save the coordinates. c ATOM is 4 bytes 500-dim array to represent the atom names c NATM represents the number of atoms c FILNAM is the SHELXX format file name. c Sample coordinate format: c FVAR 0.90195 c ND 5 0.59828 0.24644 10.24980 11.00000 0.01625 0.00675 = c 0.03496 0.00372 0.00326 0.00215 c O1 4 0.58560 0.24368 0.55481 11.00000 0.02699 0.04010 = c 0.01761 0.00117 0.00328 0.01509 c ...... c ...... c END c PARAMETER (MAXATM = 500 ) CHARACTER FILNAM*80,ATOM(MAXATM)*4,KEY*80 DIMENSION X(3,MAXATM) C C Open the SHELXX format coordinate file. C call ccpdpn(1,FILNAM,'READONLY','F',0,0) C NATM = 0 READ(1,*) C 5 NATM = NATM + 1 IF (NATM.GT.MAXATM) + STOP 'Atoms of Shelxx cannot be more than 500.' READ(1,10) ATOM(NATM),(X(I,NATM),I=1,3) C WRITE(6,*) NATM,ATOM(NATM),(X(I,NATM),I=1,3) 10 FORMAT(A4,5X,3F10.5) IF (ATOM(NATM).EQ.'END '.OR. ATOM(NATM).EQ.' ') GOTO 20 READ(1,*) GOTO 5 20 NATM = NATM -1 CLOSE (1) RETURN END C C * ROH - MATRIX C c SUBROUTINE HUBER(ROT,E) DIMENSION E(3,3),ROT(3) c EQUIVALENCE (PS,AL,PA), (TH,BE,PB), (PH,GA,PC) c EQUIVALENCE (S1,SIPS), (S2,SITH), (S3,SIPH) c 1 ,(C1,COPS), (C2,COTH), (C3,COPH) PS=ROT(1) TH=ROT(2) PH=ROT(3) ARC=3.14159265359/180.0 SIPS = SIN(PS*ARC) COPS = COS(PS*ARC) SITH = SIN(TH*ARC) COTH = COS(TH*ARC) SIPH = SIN(PH*ARC) COPH = COS(PH*ARC) E(1,1) = COPS*COPH - SIPS*SIPH*SITH E(1,2) =-SIPS*COTH E(1,3) = COPS*SIPH + SIPS*SITH*COPH E(2,1) = SIPS*COPH + COPS*SITH*SIPH E(2,2) = COPS*COTH E(2,3) = SIPS*SIPH - COPS*SITH*COPH E(3,1) =-COTH*SIPH E(3,2) = SITH E(3,3) = COTH*COPH END C C C * ROH - MATRIX C SUBROUTINE HUBERARC(ROT,E) DIMENSION E(3,3),ROT(3) EQUIVALENCE (PS,AL,PA), (TH,BE,PB), (PH,GA,PC) EQUIVALENCE (S1,SIPS), (S2,SITH), (S3,SIPH) 1 ,(C1,COPS), (C2,COTH), (C3,COPH) PS=ROT(1) TH=ROT(2) PH=ROT(3) C ARC=3.14159265359/180.0 C ARC= 1.0 SIPS = SIN(PS) COPS = COS(PS) SITH = SIN(TH) COTH = COS(TH) SIPH = SIN(PH) COPH = COS(PH) E(1,1) = COPS*COPH - SIPS*SIPH*SITH E(1,2) =-SIPS*COTH E(1,3) = COPS*SIPH + SIPS*SITH*COPH E(2,1) = SIPS*COPH + COPS*SITH*SIPH E(2,2) = COPS*COTH E(2,3) = SIPS*SIPH - COPS*SITH*COPH E(3,1) =-COTH*SIPH E(3,2) = SITH E(3,3) = COTH*COPH END c c SUBROUTINE IARRGIVE(N,XYZ0,XYZ) C Copy an N-dimensional integer array XYZ0 to another one XYZ. INTEGER*4 XYZ(N),XYZ0(N) DO I = 1, N XYZ(I) = XYZ0(I) END DO END c c C------MULTIPLY AN INTEGER ARRAY BY A CONSTANT SUBROUTINE IARRMC(IM,IN,A1,C,A) INTEGER A1(IM,IN),A(IM,IN),C DO 10 I1=1,IM DO 10 I2=1,IN 10 A(I1,I2)=A1(I1,I2)*C END c c subroutine imatext(isym0,sout,ss1,ss2,ss3,trans) c A subroutine to transfer a symmetric matrix into a string. c isym0 is 3*3 symmetric matrix. c in is 3-dimensional strings of the input like 'x''y''z' or 'h''k''l' c trans is true. recognize the matrix as a transpose one. c sout is a 3-dimensional output string c c Guoguang 91-02-06 character sout(3)*12,ss1*1,ss2*1,ss3*1 logical*1 trans integer isym0(3,3) integer isym(3,3) character out(3,3)*4,temp*4,in(3)*1 c equivalence (sout,out) c in(1) = ss1 in(2) = ss2 in(3) = ss3 C if (trans) then do j = 1,3 do i = 1,3 isym(i,j) = isym0(j,i) end do end do else do j = 1, 3 do i = 1, 3 isym(i,j) = isym0(i,j) end do end do end if c do i = 1,3 do j = 1,3 out(i,j)(4:4) = in(j) if (isym(i,j).eq.0) then out(i,j)(1:4) = ' ' else if(abs(isym(i,j)).ge.10) then write(6,*) 'isym(',i,j,')=',isym(i,j),' > 10' stop 'error' else if (isym(i,j).gt.0) out(i,j)(1:1) = '+' if (isym(i,j).lt.0) out(i,j)(1:1) = '-' if (abs(isym(i,j)).ne.1) then write(out(i,j)(2:3),'(i1,a1)') abs(isym(i,j)),'*' else out(i,j)(2:3) = ' ' end if end if end do end do c do i = 1, 3 write(sout(i),'(3a4)') (out(i,j),j=1,3) c write(6,*) sout(i) c if (sout(i)(1:1).eq.'+') sout(i)(1:1) = ' ' c make the text shorter il = lenstr(sout(i)) if (il.gt.1) then iln = il do j = il-1, 1, -1 if (sout(i)(j:j).eq.' ') then lg = iln - j sout(i)(j:iln-1) = sout(i)(j+1:iln) sout(i)(iln:iln) = ' ' iln = iln - 1 end if end do end if if (sout(i)(1:1).eq.'+') sout(i)(1:1) = ' ' end do c end c c C-------A STANDARD SUBPROGRAM TO MULTIPLY TWO ARRAYS (a new quick version C --- this is for I4 version C) BMC 91/02/11/ Guoguang C A1(IM1,IN1)*A2(IM2,IN2)=RSLT(IM1,IN2) SUBROUTINE IMATMULT(IM1,IN1,IM2,IN2,A1,A2,RSLT) INTEGER A1(IM1,IN1),A2(IM2,IN2),RSLT(IM1,IN2) IF (IN1.NE.IM2) THEN stop 'The two arrays cannot be multiplied' end if DO I = 1, IM1 DO J = 1, IN2 RSLT(I,J) = 0. DO k = 1, in1 RSLT(I,J) = RSLT(I,J) + A1(I,K)*A2(K,J) END DO END DO END DO RETURN END c c c if you have a rigid movement x2=R*x1+1 c where R(3,3) is the rotation and t(3) is the translation c then x1 =R2*x1-t2 c where R2=R-1 c t2 =R-1*t c The program reads in R,T matrix (3,4) and returns a inversed RT2 c nmat is the number of matrix c subroutine invrt(nmat,rt,rt2) real rt(3,4,nmat),rt2(3,4,nmat) real b1(3),b2(3) integer me(3) c do i = 1, nmat call arrgive(9,rt(1,1,i),rt2(1,1,i)) call ivsn(3,rt2(1,1,i),b1,b2,me,de,1.e-4) call arrmc(3,1,rt(1,4,i),-1.,b1) call matmult(3,3,3,1,rt2(1,1,i),b1,rt2(1,4,i)) end do c end c c C--------- IN PLACE MATRIX INVERSION --------- SUBROUTINE IVSN(N,A,B,C,ME,DE,EP) C---- N is the dimension of the matrix A with N rows and N columns c---- A-N,N- is the input matrix with N rows and N columns. c--- ME(N), B(N) AND C(N) are the buffer of N-dimensional array. c--- DE could any value c EP is the least value of the pivot i.e. when |A| < EP, the program c will stop. c on output, DE is the determinant of the original matrix c on output, A is the inverse of the original input A c ME is an index array which keeps track of row swaps DIMENSION A(N,N),ME(N),B(N),C(N) INTEGER I,J,K,ME DE = 1.0 DO 10 J=1,N 10 ME(J)=J DO 20 I=1,N Y=0. DO 30 J=I,N IF (ABS(A(I,J)).LE.ABS(Y)) GOTO 30 K=J Y=A(I,J) 30 CONTINUE DE = DE*Y IF (ABS(Y).LT.EP) then write(6,*) 'Ill conditioned matrix:' write(6,'(3f12.6)') a WRITE(6,*) 'the pivot of the matrix is ', y, ' N = ',N STOP 4444 end if Y = 1.0/Y DO 40 J=1,N C(J) = A(J,K) A(J,K) = A(J,I) A(J,I) = -C(J)*Y B(J) = A(I,J)*Y 40 A(I,J) = A(I,J)*Y A(I,I) = Y J = ME(I) ME(I) = ME(K) ME(K) = J DO 11 K=1,N IF(K.EQ.I) GOTO 11 DO 12 J=1,N IF (J.EQ.I) GOTO 12 A(K,J) = A(K,J) - B(J)*C(K) 12 CONTINUE 11 CONTINUE 20 CONTINUE DO 33 I=1,N DO 44 K=1,N IF(ME(K).EQ.I) GOTO 55 44 CONTINUE 55 IF(K.EQ.I) GOTO 33 DO 66 J=1,N W = A(I,J) ! swap rows k and i A(I,J) = A(K,J) 66 A(K,J) = W IW = ME(I) ! keep track of index changes ME(I) = ME(K) ME(K) = IW DE = -DE ! determinant changes sign when two rows swapped 33 CONTINUE RETURN END c c SUBROUTINE KABMOD(TH1,TH2,TH3,TH11,TH12,TH13) DIMENSION TH(6) C C --- ERRECHNET EULERWINKEL IM BEREICH -180> No lattice ',LAT WRITE(6,*) 'Only P,A,B,C,I,F and R are allowed.' END IF DO ISYM = 1, NSYM DO ITR = 2, NTR I = (ITR-1)*NSYM + ISYM CALL ARRMC(3,3, SYM(1,1,ISYM), 1., SYM(1,1,I) ) CALL ARRAD(3,1, TR(1,ITR), SYM(1,4,ISYM), SYM(1,4,I) ) DO J = 1, 3 5 IF (SYM(J,4,I).GE.1.) THEN SYM(J,4,I) = SYM(J,4,I) - 1. GOTO 5 END IF 6 IF (SYM(J,4,I).LT.-1.) THEN SYM(J,4,I) = SYM(J,4,I) + 1. GOTO 6 END IF END DO ! J END DO ! ITR END DO ! ISYM NSYM = NSYM * NTR RETURN END c c SUBROUTINE LSQEQ(M,N,A,PHI,DETA,ATA,B1) C DIMENSION A(M,N),PHI(M),DETA(N),ATA(N,N) C DIMENSION B1(N) C This is a subroutine to compute the solution of least square equation C of a normal matrix. i.e. AT*A*DETA = AT*PHI ==> DETA = (AT*A)^(-1)*AT*PHI C It could be get the deta the make the SIGMA (phi)^2 = minimum c where there are M equations c ....... c phi i = 0 c ....... c c Note: In the program parameter PHI(I) = - phi0 i in the equation. c C written by Guoguang Lu c 23/01/1989 c parameter description: c M is the number of equations. i.e. PHIi = 0 (i=1,...M) C N is the number of the variables. C (N should be less than 3*N0 given in parameter statement.) C (At this moment, N0 is 6000.) c (A,PHI) is a M*(N+1) normal matrix c A is a M*N array c PHI is a M-dimensional vector. Here, PHI should be -phi0 in the equation. c DETA is the output shift. c ATA(N,N ) is a N*N buffer array. c B1(N) is a N-dimensional buffer array. c Note : M must not be less than N. PARAMETER (N0 = 6000 ) DIMENSION A(M,N),PHI(M),DETA(N),ATA(N,N) DIMENSION B1(N),ME(3*N0) IF (M.LT.N) THEN STOP 'Equation number is not enough' else if (M.EQ.N) THEN CALL IVSN(M,A,B1,DETA,ME,DE,1.E-5) c CALL ARRMC(N,1,DETA,0.,DETA) call arrvalue(n,deta,0.) DO 50 I = 1, N DO 50 J = 1, N 50 DETA(I) = DETA(I) + ATA(I,J)*PHI(J) ELSE C C T C ATA = A * A C call arrvalue(n*n,ata,0.) c CALL ARRMC(N,N,ATA,0.,ATA) DO 10 I = 1,N DO 10 J = I,N DO 10 K = 1,M 10 ATA(I,J) = ATA(I,J) + A(K,I)*A(K,J) IF (N.GE.2) THEN DO 20 I = 1, N DO 20 J = 1, I-1 20 ATA(I,J) = ATA(J,I) END IF C C C ATA = ATA^-1 C CALL IVSN (N,ATA,B1,DETA,ME,DE,1.E-5) C C T C B1 = A * PHI C c CALL ARRMC(N,1,B1,0.,B1) call arrvalue(n,b1,0.) DO 30 I = 1, N 30 B1(I) = POIMULT(M, M, A(1,I), PHI) C C DETA = ATA^-1 * B1 C C T T C i.e. DETA = (A * A) * A * PHI C c CALL ARRMC(N,1,DETA,0.,DETA) call arrvalue(n,deta,0.) DO 40 I = 1, N DO 40 J = 1, N 40 DETA(I) = DETA(I) + ATA(I,J)*B1(J) C END IF C END c c subroutine matitor(im,in,imat,rmat) c Convert a matrix from integer*2 to real*4 c real*4 rmat(im,in) integer imat(im,in) c do j = 1, in do i = 1, im rmat(i,j) = imat(i,j) end do end do end c c C-------A STANDARD SUBPROGRAM TO MULTIPLY TWO ARRAYS (a new quick version C) BMC 89/11/05/ Guoguang C A1(IM1,IN1)*A2(IM2,IN2)=RSLT(IM1,IN2) SUBROUTINE MATMULT(IM1,IN1,IM2,IN2,A1,A2,RSLT) DIMENSION A1(IM1,IN1),A2(IM2,IN2),RSLT(IM1,IN2) IF (IN1.NE.IM2) THEN stop 'The two arrays cannot be multiplied' end if DO I = 1, IM1 DO J = 1, IN2 RSLT(I,J) = 0. DO k = 1, in1 RSLT(I,J) = RSLT(I,J) + A1(I,K)*A2(K,J) END DO END DO END DO RETURN END c c subroutine matrtoi(im,in,rmat,imat) c Convert a matrix from real to integer c real*4 rmat(im,in) integer imat(im,in) c do j = 1, in do i = 1, im imat(i,j) = rmat(i,j) end do end do end c c FUNCTION MATSYM(S,TEXT,ICOL) C C A FORTRAN FUNCTION SUBPROGRAM TO SCAN A SYMMETRY CARD AND BUILD C THE CORRESPONDING SYMMETRY-OPERATION MATRIX. THE CONTENTS OF THE C CARD AND ERRORS ENCOUNTERED ARE WRITTEN OFF-LINE IN THE CALLING C PROGRAM. THE FUNCTIONAL VALUE IS NORMALLY ZERO, WHEN AN ERROR HAS C BEEN DETECTED THE NUMBERS 1-4 ARE GIVEN BACK: C ERROR-NUMBER 1: INVALID CHARACTER AT POSITION .... C 2: SYNTAX ERROR AT NONBLANK POSITION .... C 3: BAD COMMAS C 4: DETERMINANT OF ROTATION MATRIX NOT +1 OR -1 C C EXPLANATION OF ARGUMENTS C S IS THE 1ST ELEMENT OF THE 3X4 ARRAY WHERE THE SYM. OP. IS TO BE C STORED. C TEXT IS THE ARRAY OF THE TEXT RECORD WHICH IS TO BE SCANNED (LENGTH: C 36 CHARACTERS, CONTIGUOUSLY) C ICOL POINTS - IN CASE OF ERRORS - TO THE POSITION OF AN INVALID C CHARACTER OR AN SYNTAX ERROR WITHIN THE SYMMETRY CARD C C MODIFIED FOR PDP-11 06/JAN/78 S.J. REMINGTON C ***** LAST UPDATE 07/10/76 MRS WRS:PR2.MATSYM C ***** PREVIOUS UPDATES 07/07/75 06/11/72 C C DIMENSION S(3,4), ICHAR(36) CHARACTER*1 CHAR,VALID(14),BLANK CHARACTER*36 TEXT EQUIVALENCE (BLANK,VALID(14)) DATA VALID/'1','2','3','4','5','6','X','Y','Z','-','+','/',',', . ' '/ C C----INITIALIZE SIGNALS ICOL = 0 IFIELD = 0 C----CLEAR SYMOP ARRAY DO 4 J=1,4 DO 4 I=1,3 4 S(I,J) = 0.0 C C----TEST THE SYMMETRY TEXT (TEXT) FOR ILLEGAL CHARACTERS C C THE STATEMENT IS SCANNED AND ARRAY ICHAR IS FILLED WITH THE INDICES C OF EACH ELEMENT OF TEXT INTO THE ARRAY 'VALID' (I.E. IF THE SEVENTH C CHAR OF 'TEXT' -IGNORING BLANKS- IS 'Y', ICHAR(7)=8) C ICOLMX = 0 DO 20 I=1,36 CHAR = TEXT(I:I) IF(CHAR .EQ. BLANK) GO TO 20 ICOLMX = ICOLMX + 1 DO 10 J=1,13 IF( VALID(J) .NE. CHAR) GO TO 10 ICHAR(ICOLMX) = J GO TO 20 10 CONTINUE C--IF GOT TO HERE, THE CHAR ISN'T IN 'VALID' JTXTSC = I GO TO 9975 20 CONTINUE C C----BEGIN FIELD LOOP C 101 IFIELD = IFIELD + 1 IF(IFIELD-3) 104,104,103 C HAVE ALL CHARACTERS BEEN ANALYSED IN 3 FIELDS? 103 IF(ICOL-ICOLMX) 9987,1000,1000 C---NO MORE THAN THREE FIELDS PERMITTED 104 SIGN = 1.0 ICOL = ICOL+1 C----MARCH ON, FIND WHAT'S NEXT IFNUM=ICHAR(ICOL) IF (11-IFNUM) 9980,110,110 C----TEST FOR SIGNS 110 IF (10-IFNUM) 118,115,112 C----TEST TO DISTINGUISH BETWEEN NUMBERS AND LETTERS 112 IF (6-IFNUM) 125,130,130 C----FOUND A SIGN C COME HERE FOR MINUS 115 SIGN = -1.0 C COME HERE FOR PLUS 118 ICOL = ICOL + 1 C----NEXT CHARACTER MUST BE A NUMBER OR LETTER IFNUM=ICHAR(ICOL) IF (IFNUM-9) 122,122,9980 122 IF (IFNUM-6) 130,130,125 C----A LETTER 125 IFNUM = IFNUM - 6 S(IFIELD,IFNUM) = SIGN GO TO 150 C----A NUMBER, FLOAT IT INTO DIGIT 130 DIGIT = IFNUM ICOL = ICOL + 1 C----IS NEXT CHARACTER A SLASH IF(ICHAR(ICOL).EQ.12) GO TO 135 C----NO SLASH, TRANSLATION TERM COMPLETE ICOL=ICOL-1 GO TO 140 C----A SLASH IS NEXT, IS THERE A NUMBER AFTER IT 135 ICOL = ICOL + 1 IFNUM=ICHAR(ICOL) IF (IFNUM-6) 138,138,9980 C----MAKE FRACTION; '5' NOT ALLOWED IN DENOMINATOR 138 IF(IFNUM.EQ.5) GO TO 9980 DIGIT = DIGIT/FLOAT(IFNUM) C----ACCUMULATE THE VECTOR COMPONENT 140 S(IFIELD,4) = S(IFIELD,4) + SIGN*DIGIT C----TEST TO SEE IF THERE ARE MORE CHARACTERS IN THIS SUBFIELD C OR A NEW SUBFIELD 150 ICOL = ICOL + 1 SIGN = 1.0 C----TEST IF ALL DONE IF(ICOL - ICOLMX) 151,151,1000 151 CONTINUE C----A SUBFIELD BEGINS WITH A PLUS OR MINUS IF(ICHAR(ICOL).EQ.11) GO TO 118 IF(ICHAR(ICOL).EQ.10) GO TO 115 C----A COMMA MUST BE NEXT UNLESS ICOL IS ICOLMX+1 WHICH MEANS THE END IF(ICHAR(ICOL).EQ.13) GO TO 101 163 IF (ICOLMX+1-ICOL) 9980,1000,9980 C----EVERYTHING SEEMS OK SEE IF DETERMINANT IS A NICE + OR - 1. 1000 CONTINUE D=S(1,1)*S(2,2)*S(3,3) $ -S(1,2)*S(2,1)*S(3,3) $ -S(1,1)*S(2,3)*S(3,2) $ -S(1,3)*S(2,2)*S(3,1) $ +S(1,2)*S(2,3)*S(3,1) $ +S(1,3)*S(2,1)*S(3,2) IF(ABS(ABS(D) - 1.0) -.0001) 1001,9985,9985 1001 CONTINUE IF(IFIELD - 3) 9987,1002,9987 1002 CONTINUE C----LEGAL RETURN MATSYM = 0 2005 RETURN C C C----ILLEGAL CHARACTER ON SYMMETRY CARD 9975 MATSYM = 1 ICOL = JTXTSC GO TO 2005 C C----SYNTAX ERROR AT NONBLANK CHARACTER ICOL 9980 MATSYM = 2 GO TO 2005 C C----DETERMINANT IS NOT + OR - 1. 9985 MATSYM = 4 GO TO 2005 C C----INCORRECT NUMBER OF COMMAS 9987 MATSYM = 3 GO TO 2005 END c c c this is subroutine to transfer missetting angle to matrix c ROT = (phiz)*(phiy)*(phix) subroutine misseting(phi,rot) real phi(3),rot(3,3) external cosd, sind sinx = sind(phi(1)) cosx = cosd(phi(1)) siny = sind(phi(2)) cosy = cosd(phi(2)) sinz = sind(phi(3)) cosz = cosd(phi(3)) rot(1,1) = cosz*cosy rot(2,1) = sinz*cosy rot(3,1) = -siny rot(1,2) = cosz*siny*sinx - sinz*cosx rot(2,2) = sinz*siny*sinx + cosz*cosx rot(3,2) = cosy*sinx rot(1,3) = cosz*siny*cosx + sinz*sinx rot(2,3) = sinz*siny*cosx - cosz*sinx rot(3,3) = cosy*cosx end c if you have a rigid movement x2=R*x1+1 c where R(3,3) is the rotation and t(3) is the translation c then x1 =R2*x1-t2 c where R2=R-1 c t2 =R-1*t c The program reads in R,T matrix (3,4) 1 and 2, then returns an RT c which is rt = rt1*rt2 c c c subroutine morert(rt1,rt2,rt) real rt(3,4),rt2(3,4),rt1(3,4) real gt(4,4),gt2(4,4),gt1(4,4) real extr(4) real b1(3),b2(3) integer me(3) c... data statements. Separate declaration and init required for f2c data extr /0.,0.,0.,1./ c do i = 1, 4 gt1(i,4) = extr(i) gt2(i,4) = extr(i) end do c do j = 1, 3 do i = 1, 3 gt1(i,j) = rt1(i,j) gt2(i,j) = rt2(i,j) end do end do c do j = 1, 3 gt1(4,j) = rt1(j,4) gt2(4,j) = rt2(j,4) end do c call matmult(4,4,4,4,gt1,gt2,gt) c do j = 1, 3 do i = 1, 3 rt(i,j) = rt(i,j) end do end do c do j = 1, 4 rt(j,4) = gt(4,j) end do c c WRITE(6,*) 'gt' c write(6,'(4f10.5)') gt1 c write(6,'(4f10.5)') gt2 c write(6,'(4f10.5)') gt c end c c c a subroutine to transfer a normalized matrix to denzo missetting angle c definition [rot]=[rotx]*[roty]*[rotz] c GuoGuang 930706 subroutine mtodenmis(rot0,phi) real rot0(3,3) real rot(3,3),phi(3) external asind, atand, cosd c sinx = sind(phi(1)) c cosx = cosd(phi(1)) c siny = sind(phi(2)) c cosy = cosd(phi(2)) c sinz = sind(phi(3)) c cosz = cosd(phi(3)) c rot0(1,1) = cosy*cosz c rot0(2,1) = -cosx*sinz+sinx*siny*cosz c rot0(3,1) = sinx*sinz+cosx*siny*cosz c rot0(1,2) = cosy*sinz c rot0(2,2) = cosx*cosz+sinx*siny*sinz c rot0(3,2) = -sinx*cosz+cosx*siny*sinz c rot0(1,3) = -siny c rot0(2,3) = sinx*cosy c rot0(3,3) = cosx*cosy c call antiarr(3,3,rot0,rot) c sinx = sind(phi(1)) c cosx = cosd(phi(1)) c siny = sind(phi(2)) c cosy = cosd(phi(2)) c sinz = sind(phi(3)) c cosz = cosd(phi(3)) c rot(1,1) = cosz*cosy c rot(2,1) = sinz*cosy c rot(3,1) = -siny c rot(1,2) = cosz*siny*sinx - sinz*cosx c rot(2,2) = sinz*siny*sinx + cosz*cosx c rot(3,2) = cosy*sinx c rot(1,3) = cosz*siny*cosx + sinz*sinx c rot(2,3) = sinz*siny*cosx - cosz*sinx c rot(3,3) = cosy*cosx phi(2) = asind(-rot(3,1)) if (abs(phi(2)).ne.90.) then if (rot(1,1).eq.0.) then phi(3) = 90. else phi(3) = atand(rot(2,1)/rot(1,1)) if (phi(3).gt.0..and.rot(1,1)/cosd(phi(2)).lt.0.) 1 phi(3) = 180. + phi(3) if (phi(3).lt.0..and.rot(2,1)/cosd(phi(2)).gt.0.) 1 phi(3) = 180. + phi(3) end if if (rot(3,3).eq.0.) then phi(1) = 90. else phi(1) = atand(rot(3,2)/rot(3,3)) if (phi(1).gt.0..and.rot(3,3)/cosd(phi(2)).lt.0.) 1 phi(1) = 180. + phi(1) if (phi(1).lt.0..and.rot(3,2)/cosd(phi(2)).gt.0.) 1 phi(1) = 180. + phi(1) end if else WRITE(6,*) 'not implemented yet' end if end c c SUBROUTINE MTOHUBER(E,HB,HB1) DIMENSION E(3,3),HB(3),HB1(3) C C * ROH ANGLES: -180 < PSI < 180 C -90 < TH < 90 C -180 < PHI < 180 C ARC=3.14159265359/180.0 if (e(3,2).gt.1.0) e(3,2) = 1.0 if (e(3,2).lt.-1.0) e(3,2) = -1.0 210 TH = ASIN(E(3,2)) COSTH = COS(TH) c IF (COSTH.GE.0.01) GO TO 212 if (costh.lt.1.0e-6) then ph = 0. ps = acos(e(1,1)) if (e(2,1).lt.0) ps = -ps goto 1500 end if c WRITE (6,1212) COSTH c1212 FORMAT('-*** WARNING : COS(THETA) = ', E8.2, ' ***') 212 PH = E(3,3)/COSTH C IF (PH.GT.1.0.OR.PH.LT.-1.0) WRITE(6,1291) PH c IF (ABS(PH).GT.(1.00001)) WRITE(6,1291) PH 1291 FORMAT(' ARCOS(E33/COSTH)=',F12.5) 1020 FORMAT(' *** ERROR IN ROH *** ',2F10.4/) IF (PH.GT.1.0) PH=1.0 IF (PH.LT.-1.0) PH=-1.0 PH=ACOS(PH) TST=-COSTH*SIN(PH) IF (TST*E(3,1).LT.0.0) PH=-PH PS = E(2,2)/COSTH c IF (PS.GT.1.0.OR.PS.LT.-1.0) WRITE(6,1292) PS c if (abs(ps).gt.1.0001) write(6,1292) ps 1292 FORMAT(' ARCOS(E22/COSTH)=',F12.5) IF (PS.GT.1.0) PS=1.0 IF (PS.LT.-1.0) PS=-1.0 PS=ACOS(PS) TST=-COSTH*SIN(PS) IF (TST*E(1,2).LT.0.0) PS=-PS TST = -SIN(PS)*SIN(PH)*SIN(TH) + COS(PS)*COS(PH) c IF (ABS(TST-E(1,1)) .GT. 0.1) WRITE (6,1020) TST,E(1,1) TST = -COS(PS)*SIN(TH)*COS(PH) + SIN(PS)*SIN(PH) c IF (ABS(TST-E(2,3)) .GT. 0.1) WRITE (6,1020) TST,E(2,3) 1500 continue PS = PS/ARC TH = TH/ARC PH = PH/ARC PS1 = 180. + PS TH1 = 180. - TH PH1 = 180. + PH CALL KABMOD(PS,TH,PH,PS1,TH1,PH1) HB(1)=PS HB(2)=TH HB(3)=PH HB1(1)=PS1 HB1(2)=TH1 HB1(3)=PH1 END c c SUBROUTINE MTOHUBERARC(E,HB,HB1) DIMENSION E(3,3),HB(3),HB1(3) C C * ROH ANGLES: -180 < PSI < 180 C -90 < TH < 90 C -180 < PHI < 180 C C ARC=3.14159265359/180.0 C ARC=1.0 210 TH = ASIN(E(3,2)) COSTH = COS(TH) IF (COSTH.GE.0.01) GO TO 212 WRITE (6,1212) COSTH 1212 FORMAT('-*** WARNING : COS(THETA) = ', E8.2, ' ***') 212 PH = E(3,3)/COSTH c IF (PH.GT.1.0.OR.PH.LT.-1.0) WRITE(6,1291) PH 1291 FORMAT(' ARCOS(E33/COSTH)=',F12.5) 1020 FORMAT(' *** ERROR IN ROH *** ',2F10.4/) IF (PH.GT.1.0) PH=1.0 IF (PH.LT.-1.0) PH=-1.0 PH=ACOS(PH) TST=-COSTH*SIN(PH) IF (TST*E(3,1).LT.0.0) PH=-PH PS = E(2,2)/COSTH c IF (PS.GT.1.0.OR.PS.LT.-1.0) WRITE(6,1292) PS 1292 FORMAT(' ARCOS(E22/COSTH)=',F12.5) IF (PS.GT.1.0) PS=1.0 IF (PS.LT.-1.0) PS=-1.0 PS=ACOS(PS) TST=-COSTH*SIN(PS) IF (TST*E(1,2).LT.0.0) PS=-PS TST = -SIN(PS)*SIN(PH)*SIN(TH) + COS(PS)*COS(PH) c IF (ABS(TST-E(1,1)) .GT. 0.1) WRITE (6,1020) TST,E(1,1) TST = -COS(PS)*SIN(TH)*COS(PH) + SIN(PS)*SIN(PH) c IF (ABS(TST-E(2,3)) .GT. 0.1) WRITE (6,1020) TST,E(2,3) C PS = PS/ARC C TH = TH/ARC C PH = PH/ARC PS1 = 180. + PS TH1 = 180. - TH PH1 = 180. + PH CALL KABMOD(PS,TH,PH,PS1,TH1,PH1) HB(1)=PS HB(2)=TH HB(3)=PH HB1(1)=PS1 HB1(2)=TH1 HB1(3)=PH1 END c c c this is subroutine to transfer missetting angle to matrix c ROT = (phiz)*(phiy)*(phix) subroutine mtomisset(rot,phi) real phi(3),rot(3,3) external asind, atand, cosd c sinx = sind(phi(1)) c cosx = cosd(phi(1)) c siny = sind(phi(2)) c cosy = cosd(phi(2)) c sinz = sind(phi(3)) c cosz = cosd(phi(3)) c rot(1,1) = cosz*cosy c rot(2,1) = sinz*cosy c rot(3,1) = -siny c rot(1,2) = cosz*siny*sinx - sinz*cosx c rot(2,2) = sinz*siny*sinx + cosz*cosx c rot(3,2) = cosy*sinx c rot(1,3) = cosz*siny*cosx + sinz*sinx c rot(2,3) = sinz*siny*cosx - cosz*sinx c rot(3,3) = cosy*cosx phi(2) = asind(-rot(3,1)) if (abs(phi(2)).ne.90.) then if (rot(1,1).eq.0.) then phi(3) = 90. else phi(3) = atand(rot(2,1)/rot(1,1)) if (phi(3).gt.0..and.rot(1,1)/cosd(phi(2)).lt.0.) 1 phi(3) = 180. + phi(3) if (phi(3).lt.0..and.rot(2,1)/cosd(phi(2)).gt.0.) 1 phi(3) = 180. + phi(3) end if if (rot(3,3).eq.0.) then phi(1) = 90. else phi(1) = atand(rot(3,2)/rot(3,3)) if (phi(1).gt.0..and.rot(3,3)/cosd(phi(2)).lt.0.) 1 phi(1) = 180. + phi(1) if (phi(1).lt.0..and.rot(3,2)/cosd(phi(2)).gt.0.) 1 phi(1) = 180. + phi(1) end if else WRITE(6,*) 'not implemented yet' end if end c C C * POLAR ANGLES C SUBROUTINE MTOPOLOR(E,POL,POL1) DIMENSION E(3,3), POL(3),POL1(3) ARC=3.14159265359/180.0 230 COSPC = (E(1,1)+E(2,2)+E(3,3)-1.0)/2.0 IF (COSPC .LT.-1.0) 1 WRITE(6,1290) 1290 FORMAT(1X,' SUM OF DIAGONAL-ELEMENTS LESS 1 THAN -1./IS SET TO -1.') IF (COSPC .LT.-1.0) COSPC=-1.0 C --- PC == KAPPA (ALIAS CHI) PC = ACOS(COSPC) ARG = (E(2,2)-COSPC)/(1.0-COSPC) IF (ARG .GE. 0.0) GO TO 235 WRITE(6,1235) ARG 1235 FORMAT('-*** ARG = ',E10.4, ' * ARG=0 ASSUMED ***') ARG = 0.0 235 COSPA = SQRT(ARG) C --- PA == THETA (ALIAS PSI) PA = ACOS(COSPA) SINPA = SIN(PA) TST = 2*COSPA*SIN(PC) IF ((E(1,3)-E(3,1))*TST .LT. 0.0) PC=-PC SINPC = SIN(PC) IF (SINPA.NE.0.0) GO TO 237 WRITE (6,1237) 1237 FORMAT('-*** SIN(THETA) = 0; PHI UNDETERMINED ***') PB = 0. GO TO 250 C --- PB == PHI 237 IF(ABS(SINPC) .LT. 0.0001 .AND. 1 ABS(COSPA) .LT. 0.0001) GOTO 245 IF ( ABS(SINPA*SINPC) .LT. 0.001) GO TO 240 PB = ACOS( (E(3,2)-E(2,3)) / (2*SINPA*SINPC) ) TST = 2.0*SINPA*SIN(PB)*SINPC IF (TST*(E(1,2)-E(2,1)) .LT. 0.0) PB=-PB GO TO 250 240 FAC = 2.0*SINPA*COSPA*(1.0-COSPC) PB = ACOS((E(1,2)+E(2,1))/FAC) TST = FAC*SIN(PB) IF (-(E(2,3)+E(3,2))*TST .LT. 0.0) PB = -PB GO TO 250 245 DENOM = (1.0-ARG)*(COSPC-1.0) PB = 0.5*ASIN((E(1,3)+E(3,1))/DENOM) SINSPB = (COSPC-E(3,3))/DENOM IF (SIN(PB)**2 .LT. SINSPB) PB = 90.*ARC - PB 250 PA = PA/ARC PB = PB/ARC PC = PC/ARC TH1 = 180. - PA PH1 = 180. + PB PK1 = - PC CALL KABMOD(PA,PB,PC,TH1,PH1,PK1) POL(1)=PA POL(2)=PB POL(3)=PC POL1(1)=TH1 POL1(2)=PH1 POL1(3)=PK1 END c c subroutine mtopolors(e,p1,p2) dimension e(3,3),p1(3),p2(3) dimension b1(3),b2(3) external acosd call mtovec(e,b1,p1(3)) C if (p1(3).eq.0.) then p1(1) = 0. p1(2) = 0. p2(1) = 0. p2(2) = 0. p2(3) = 0. return end if C p1(1) = acosd(b1(2)) dos = sqrt(b1(1)*b1(1)+b1(3)*b1(3)) if (dos.eq.0.) then if (vem(3,b1).eq.0.and.p1(3).ne.0.) then WRITE(6,*) 'vec:',b1,'kapa:',p1(3) end if p1(2) = 0. p2(2) = 0. p2(1) = 180. - p1(1) if (p2(1).ge.360.) p2(1) = 0. return end if c c p1(2) = acosd( b1(1)/dos ) c b22 = asind( b1(3)/sqrt(b1(1)*b1(1)+b1(3)*b1(3)) ) if (b1(3).gt.0.) p1(2) = -p1(2) c p2(3) = -p1(3) p2(2) = 180. + p1(2) if (p2(2).gt.180) p2(2) = p2(2) -360. p2(1) = 180. - p1(1) end c c subroutine mtopolorz(e,p1,p2) c real e(3,3),p1(3),p2(3) real b1(3),b2(3) external acosd call mtovec(e,b1,p1(3)) c if (abs(p1(3)).lt.1e-3) then p1(1) = 0 p2(1) = 0 p1(2) = 0 p2(2) = 0 p2(3) = 0 return end if c p1(1) = acosd(b1(2)) c p1(2) = acosd( b1(1)/sqrt(b1(1)*b1(1)+b1(3)*b1(3)) ) c b22 = asind( b1(3)/sqrt(b1(1)*b1(1)+b1(3)*b1(3)) ) p1(1) = acosd(b1(3)) c if (p1(1).eq.0.or.p1(1).eq.180.) then p1(2) = 0. p2(2) = 0. p2(1) = p1(1) + 180. if (p2(1).ge.360) p2(1) = p2(1) - 360. p2(3) = -p1(3) return end if c p1(2) = acosd( b1(1)/sqrt(b1(1)*b1(1)+b1(2)*b1(2)) ) c b22 = asind( b1(2)/sqrt(b1(1)*b1(1)+b1(3)*b1(3)) ) c if (b22.gt.0.) p1(2) = -p1(2) if (b1(2).lt.0.) p1(2) = -p1(2) c p2(3) = -p1(3) p2(1) = 180. - p1(1) p2(2) = 180. + p1(2) if (p2(2).gt.180) p2(2) = p2(2) -360. end c c SUBROUTINE MTOR_B(IOPT2,E,ROT1,ROT2) C C * R&B ANGLES: -180 < AL < 180 C 0 < BE < 180 C -180 < GA < 180 C EQUIVALENCE (PS,AL,PA), (TH,BE,PB), (PH,GA,PC) EQUIVALENCE (S1,SIPS), (S2,SITH), (S3,SIPH) * ,(C1,COPS), (C2,COTH), (C3,COPH) DIMENSION E(3,3),E1(3,3),E2(3,3),X(3),X1(3) DIMENSION ROT1(3),ROT2(3) DATA E2 / 1., 3*0., 1., 3*0., 1./ ARC=3.14159265359/180.0 220 BE = ACOS(E(3,3)) GA = E(3,2)/SIN(BE) c IF (GA.GT.1.0.OR.GA.LT.-1.0) WRITE(6,1293) GA 1293 FORMAT(' ARCOS(E32/SINBE)=',F12.5) IF (GA.GT.1.0) GA=1.0 IF (GA.LT.-1.0) GA=-1.0 GA=ACOS(GA) TST= SIN(BE)*SIN(GA) IF (TST*E(3,1).LT.0.0) GA=-GA AL = -E(2,3)/SIN(BE) c IF (AL.GT.1.0.OR.AL.LT.-1.0) WRITE(6,1294) AL 1294 FORMAT(' ARCOS(-E23/SINBE)=',F12.5) IF (AL.GT.1.0) AL=1.0 IF (AL.LT.-1.0) AL=-1.0 AL=ACOS(AL) TST= SIN(BE)*SIN(AL) IF (TST*E(1,3).LT.0.0) AL=-AL TST = -SIN(AL)*COS(BE)*SIN(GA) + COS(AL)*COS(GA) IF (ABS(TST-E(1,1)) .GT. 0.1) WRITE (6,1010) TST,E(1,1) TST = COS(AL)*COS(BE)*COS(GA) - SIN(AL)*SIN(GA) IF (ABS(TST-E(2,2)) .GT. 0.1) WRITE (6,1010) TST,E(2,2) 1010 FORMAT(' *** ERROR IN R&B *** ',2F10.4/) AL = AL/ARC BE = BE/ARC GA = GA/ARC IF (IOPT2.NE.4) GO TO 225 AL=AL-90.0 GA=GA+90.0 225 CONTINUE AL1 = 180. + AL BE1 = - BE GA1 = 180. + GA CALL KABMOD(AL,BE,GA,AL1,BE1,GA1) C IF (IOPT2.EQ.2) WRITE (6,1220) AL,BE,GA,AL1,BE1,GA1 C IF (IOPT2.EQ.4) WRITE (6,1221) AL,BE,GA,AL1,BE1,GA1 C GO TO 100 ROT1(1)=AL ROT1(2)=BE ROT1(3)=GA ROT2(1)=AL1 ROT2(2)=BE1 ROT2(3)=GA1 END c c subroutine mtovec(a,vec,vkapa) c this is a subroutine which give a transfer a orthogonal matrix c to a polar angle rotate a direction of a vector which is 1. c a is the input 3*3 orthogonal matrix. c vec is the output 3-dim vector which indicate the axis direction c kappa is the output polar angle. c Guoguang 901001 bmc dimension a(3,3),vec(3),a1(3,3),a2(9),vec1(3) integer*2 sgn(3,8) external acosd data sgn/ 1,1,1, 1,1,-1, 1,-1,1, 1,-1,-1, 1 -1,1,1, -1,1,-1, -1,-1,1, -1,-1,-1/ c trace = a(1,1) + a(2,2) + a(3,3) c write(6,*),' trace ', trace if (trace .gt.3.) then if ( (trace-3.) .gt. 1e-4) write(6,*) 'The trace of the '// 1 'matrix is',trace,' more than 3. I set to 3 here.' trace = 3. else if (trace .lt.-1.) then if (( trace+1 ) .lt. -1e-4) write(6,*) 'The trace of the '// 1 'matrix is',trace,' less than -1. I set to -1 here.' trace = -1. end if coskapa = (trace - 1.) / 2. vkapa = acosd(coskapa) c write(6,*),' coskapa, kapa ', coskapa, kapa c if (abs(vkapa).lt.0.03) then vec(1) = 0. vec(2) = 0. vec(3) = 0. return else do i = 1, 3 temp = (a(i,i)-coskapa)/(1.-coskapa) if (temp.lt.0.) then if (temp.lt.-1e-4.and.(coskapa.ne.-1.)) then write(6,*) 'Warning: your matrix might be not a orthogonal'// 1 ' one' write(6,'(a,i1,a,i1,a)') 'vec(',i,')**2 =' write(6,*) temp,' coskapa,kapa,trace',coskapa,vkapa,trace end if temp = 0. end if vec1(i) = sqrt(temp) end do vv = vem(3,vec1) cc if (abs(vv-1.).gt.1e-4) then c write(6,*) 'Warning: modulus of vector is not 0, but',vv c end if call arrmc(3,1,vec1,1./vv,vec1) end if c c if (coskapa.eq.-1.) return errmin = 1.0 ireal = 0 do is = 1, 8 do i =1, 3 vec(i) = vec1(i) * sgn(i,is) end do c call rotvsvec(vec,vkapa,a1) call arrps(3,3,a1,a,a2) c err = 0. do ip = 1,9 err = abs(a2(ip)) + err end do if (err.lt.errmin) ireal = is errmin = min(errmin,err) c 10 end do c if (ireal. eq. 0) then c write(6,*) 'something wrong in this program a,a1' do is = 1, 8 do i =1, 3 vec(i) = vec1(i) * sgn(i,is) end do c call rotvsvec(vec,vkapa,a1) call arrps(3,3,a1,a,a2) write(6,*) 'a',a write(6,*) 'a1',a1 write(6,*) 'a2',a2 err = 0. do ip = 1,9 err = abs(a2(ip)) + err end do write(6,*) vec,vkapa,'vk' write(6,*) 'Error',err c end do stop ' ' else do i =1, 3 vec(i) = vec1(i) * sgn(i,ireal) end do if (errmin.gt.0.01) then write(6,*) 'ireal =', ireal call rotvsvec(vec,vkapa,a1) call arrps(3,3,a1,a,a2) write(6,*) a write(6,*) a1 write(6,*) a2 write(6,*) vec end if end if c check c v2 = asind(sinkapa) c if (coskapa.lt.0) v2 = -180. - v2 c c WRITE(6,*) 'kapa1,kapa2,error',v2,vkapa,abs(v2-vkapa) c end c c subroutine nodir(name1,name2,len2) c a subroutine which extracts the file name from a complete filename. c e.g. input name1 = /nfs/pdb/full/1cnd.pdb c output name2 = 1cnd.pdb c len2 is the length of the second word character*(*) name1,name2 c i1 = index(name1,'.pdb') i1 = lenstr(name1) do i = i1, 1, -1 if (name1(i:i).eq.'/') goto 20 end do i = 0 20 continue len2 = i1 - i name2(1:len2) = name1(i+1:i1) end c c SUBROUTINE ORIEN ( NATM, XYZ1, XYZ2, A ) c The subroutine selects three atoms to calculate the initial superposing c matrix A from two molecules in 3*4 array XYZ1 and XYZ2 individually. c Parameter description: c NATM is the number of the atoms c DIMENSION XYZ1(3,NATM), XYZ2(3,NATM), A(3,3) c XYZ1(3,NATM) represent the XYZ of molecule 1 c XYZ2(3,NATM) represent the XYZ of molecule 2 c A is the output superposing matrix. c COMMON/IAT/ IAT1,IAT2,IAT3,IAT c DATA IAT/0/ c Atom IAT1, IAT2 and IAT3 is used to calculate the matrix. It could be c decided outside the routine if IAT not eq 0. c c COMMON/IAT/ IAT1,IAT2,IAT3,IAT c DATA IAT/0/,IAT1/1/,IAT2/2/,IAT3/3/ DIMENSION XYZ1(3,NATM), XYZ2(3,NATM), A(3,3) DIMENSION V11(3),V12(3) DIMENSION V21(3),V22(3) DIMENSION C1(3,3),C2(3,3),C1P(3,3) DIMENSION B1(3),B2(3) c local elements REAL T(3) c c If IAT = 0, define the three atoms used to calculate the c initial orientation matrix c IF (IAT.EQ.0) THEN IAT1 = 1 IF (NATM.GE.6) THEN IAT2 = INT(NATM/3) + 1 IAT3 = 2*INT(NATM/3) + 1 ELSE IAT2 = 2 c IAT3 = 3 IAT3 = NATM END IF END IF c 15 if (dist(xyz1(1,iat1),xyz1(1,iat2)).lt.1.e-3.or. + dist(xyz2(1,iat1),xyz2(1,iat2)).lt.1.e-3) then iat1=iat1+1 if (iat1.lt.iat2) goto 15 call elize(3,a) print*, 'Warning: not give any matrix: -orien' return end if 16 if (dist(xyz1(1,iat2),xyz1(1,iat3)).lt.1.e-3.or. + dist(xyz2(1,iat2),xyz2(1,iat3)).lt.1.e-3) then iat2=iat2+1 if (iat2.lt.iat3) goto 15 call elize(3,a) print*, 'Warning: not give any matrix: -orien' end if C C Calculate the initial matrix and the Eulerian angle. c C C calculate the matrix 1 20 continue CALL ARRPS(3,1,XYZ1(1,IAT2),XYZ1(1,IAT1),V11) CALL ARRPS(3,1,XYZ1(1,IAT2),XYZ1(1,IAT3),V12) IF (VEM(3,V12).LT.1E-2) GOTO 50 CALL ARRMC (3,1,V12,1./VEM(3,V12),C1(1,1)) CALL VECCRSMLT (V12,V11,B1) IF (VEM(3,B1).LT.1E-2) GOTO 50 CALL ARRMC(3,1,B1,1./VEM(3,B1),C1(1,3)) CALL VECCRSMLT (C1(1,3),C1(1,1),C1(1,2)) C calculate the matrix 2 CALL ARRPS(3,1,XYZ2(1,IAT2),XYZ2(1,IAT1),V21) CALL ARRPS(3,1,XYZ2(1,IAT2),XYZ2(1,IAT3),V22) IF (VEM(3,V12).LT.1E-2) GOTO 50 CALL ARRMC (3,1,V22,1./VEM(3,V22),C2(1,1)) CALL VECCRSMLT (V22,V21,B1) IF (VEM(3,B1).LT.1E-2) GOTO 50 CALL ARRMC(3,1,B1,1./VEM(3,B1),C2(1,3)) CALL VECCRSMLT (C2(1,3),C2(1,1),C2(1,2)) c calculate the matrix A = c2 * c1^-1 (x2= A * x1) call ANTIARR(3,3,C1,C1P) c print*, 'iat1,iat2,iat3',iat1,iat2,iat3 CALL MATMULT(3,3,3,3,C2,C1P,A) C return 50 iat2 = iat2 + 1 if (iat2.ne.iat3.and.iat2.le.natm) goto 20 WRITE(6,*) 'warning: cannot give the orientation here' WRITE(6,*) 'natm,iat,iat1,iat2,iat3',natm,iat,iat1,iat2,iat3 call elize(3,a) call arrvalue(3,t,0.) END c c C-----------APPENDIX PROGRAM FOR THE NEWGIN SYSTEM ANGLE C WHEN INOPT1=8 SUBROUTINE OXFORD(ROT,E) DIMENSION E(3,3),ROT(3) external cosd, sind 2000 A1=ROT(1) A2=ROT(2) A3=ROT(3) E(1,1)=COSD(A1)*COSD(A2)*COSD(A3)-SIND(A1) 1*SIND(A3) E(2,1)=SIND(A1)*COSD(A2)*COSD(A3)+COSD(A1) 1*SIND(A3) E(3,1)=-(SIND(A2)*COSD(A3)) E(1,2)=-COSD(A1)*COSD(A2)*SIND(A3)-SIND(A1) 1*COSD(A3) E(2,2)=-SIND(A1)*COSD(A2)*SIND(A3)+COSD(A1) 1*COSD(A3) E(3,2)=SIND(A2)*SIND(A3) E(1,3)=COSD(A1)*SIND(A2) E(2,3)=SIND(A1)*SIND(A2) E(3,3)=COSD(A2) END c c subroutine packexpnd(cell,natom,xyz,nsym,sym) parameter(maxatm=25000) real xyz(3,maxatm),sym(3,4,160) real cell(6),deor(3,3),orth(3,3) real cells(6),deors(3,3),orths(3,3) real sym1(3,4,160) real tmove0(3),ave(3) real b1(3),b2(3),b3(3),b4(3),b5(3) real tmove(3,27) c... data statements. Separate declaration and init required for f2c data tmove 1 /-1.,-1.,-1., -1.,-1.,0., -1.,-1.,1., 2 -1., 0.,-1., -1., 0.,0., -1., 0.,1., 3 -1., 1.,-1., -1., 1.,0., -1., 1.,1., 4 0.,-1.,-1., -0.,-1.,0., -0.,-1.,1., 5 0., 0.,-1., 0. ,0.,0., 0., 0.,1., 6 0., 1.,-1., 0., 1.,0., 0., 1.,1., 7 1.,-1.,-1., 1.,-1.,0., 1.,-1.,1., 8 1., 0.,-1., 1., 0.,0., 1., 0.,1., 9 1., 1.,-1., 1., 1.,0., 1., 1.,1./ c nmove = 1 call lgg_crystal(CELL,CELLS,DEOR,ORTH,deors,orths) call averg(3,natom,xyz,ave) c WRITE(6,*) 'Average xyz',ave do isym = 1, nsym call matmult(3,3,3,1,deor,ave,b1) call matmult(3,3,3,1,sym(1,1,isym),b1,b2) call arrad(3,1,b2,sym(1,4,isym),b3) call arrgive(3,b3,b4) c WRITE(6,*) 'b3',b4 do i = 1, 3 call frcinside(b4(i)) b5(i) = b4(i) - b3(i) end do c WRITE(6,*) 'b4-b5',b4,b5 call arrad(3,1,b5,sym(1,4,isym),tmove0) c WRITE(6,*) 'tmove0',tmove0 call arrgive(9,sym(1,1,isym),sym1(1,1,nmove)) call arrgive(3,tmove0,sym1(1,4,nmove)) c write(6,*) 'Operation:',nmove c write(6,11) ((sym1(i,j,nmove),j=1,4),i=1,3) nmove = nmove + 1 call arrgive(12,sym(1,1,isym),sym1(1,1,nmove)) do jmove = 1,27 if (jmove.eq.14) goto 40 call arrad(3,1,tmove(1,jmove),tmove0,sym1(1,4,nmove)) do iatom = 1, natom call matmult(3,3,3,1,deor,xyz(1,iatom),b1) call matmult(3,3,3,1,sym1(1,1,nmove),b1,b2) call arrad(3,1,b2,sym1(1,4,nmove),b3) if (b3(1).ge.0. .and. b3(1).lt.1. .and. 1 b3(2).ge.0. .and. b3(2).lt.1. .and. 2 b3(3).ge.0. .and. b3(3).lt.1. ) then c write(6,*) 'move-iele-iatom',jmove,iele,iatom c WRITE(6,*) 'xyz-iatom',xyz(1,iatom),xyz(3,iatom),xyz(3,iatom) c WRITE(6,*) 'b1-deor',b1 c WRITE(6,*) 'b2-symrot',b2 c WRITE(6,*) 'b3-jmove',b3 c write(6,*) 'Operation:',nmove c write(6,11) ((sym1(i,j,nmove),j=1,4),i=1,3) nmove = nmove + 1 call arrgive(12,sym(1,1,isym),sym1(1,1,nmove)) goto 40 end if 30 end do 40 end do end do 11 format(4f10.4) c nsym = nmove - 1 c write(6,*) 'Total',nsym,' operations can put the molecule into c 1 the unit cell' call arrgive(nsym*12,sym1,sym) c end c c CHARACTER*16 FUNCTION PLTNAM(IDUM3) c CALL SYSTEM('printenv USER > PLTNAM') c call ccpdpn(55,'PLTNAM','UNKNOWN','F',0,0) c read(55,'(a)') pltnam c do i = 1, 16 c if (pltnam(i:i).eq.' ') goto 10 c end do cc10 continue c do j = i,16 c pltnam(j:j) = ' ' c end do call getlog(pltnam) call up(pltnam,16) END c c C------------STANDARD FUNCTION SUBPROGRAM FOR C----------------DOT PRODUCT OF TWO VECTORS FUNCTION POIMULT(N1,N2,V1,V2) DIMENSION V1(N1),V2(N2) POIMULT=0. IF (N1.NE.N2) GOTO 90 DO 10 I=1,N1 10 POIMULT=V1(I)*V2(I)+POIMULT RETURN 90 PRINT*,'POIMULT> Two vectors do not have same dimension' END c c SUBROUTINE POLOR(POL,E) DIMENSION E(3,3),POL(3) EQUIVALENCE (S1,SIPS), (S2,SITH), (S3,SIPH) 1 ,(C1,COPS), (C2,COTH), (C3,COPH) C C * POLAR ANGLE MATRIX (TRANSPOSED ACCORDING TO TOLLIN, ERRATA OF R&B) C ARC=3.14159265359/180.0 PS=POL(1) TH=POL(2) PH=POL(3) SIPS = SIN(PS*ARC) COPS = COS(PS*ARC) SITH = SIN(TH*ARC) COTH = COS(TH*ARC) SIPH = SIN(PH*ARC) COPH = COS(PH*ARC) 130 S1SQ = S1*S1 C1SQ = C1*C1 CPC = 1.0 - C3 E(1,1) = C3 + S1SQ*C2*C2*CPC E(2,1) = S1*C1*C2*CPC - S1*S2*S3 E(3,1) =-S1SQ*C2*S2*CPC - C1*S3 E(1,2) = S1*C1*C2*CPC + S1*S2*S3 E(2,2) = C3 + C1SQ*CPC E(3,2) =-S1*C1*S2*CPC + S1*C2*S3 E(1,3) =-S1SQ*S2*C2*CPC + C1*S3 E(2,3) =-S1*C1*S2*CPC - S1*C2*S3 E(3,3) = C3 + S1SQ*S2*S2*CPC END c c subroutine polors(pol,e) c my program to calculate matrix from polar angle c pol is psi phi kappa c where psi is angle between axis and Y c phi is angle between image of axis in XZ and X c kappa is rotating angle dimension e(3,3),pol(3) dimension b1(3) external cosd, sind b1(2) = cosd(pol(1)) b1(1) = sind(pol(1))*cosd(pol(2)) b1(3) = - sind(pol(1))*sind(pol(2)) call rotvsvec(b1,pol(3),e) end c c subroutine polorz(pol,e) c my program to calculate matrix from polar angle (z system) c pol is psi phi kappa c where psi is angle between axis and Z c phi is angle between image of axis in XY and X c kappa is rotating angle real e(3,3),pol(3) real b1(3) external cosd, sind c b1(2) = cosd(pol(1)) c b1(1) = sind(pol(1))*cosd(pol(2)) c b1(3) = - sind(pol(1))*sind(pol(2)) b1(3) = cosd(pol(1)) b1(1) = sind(pol(1))*cosd(pol(2)) b1(2) = sind(pol(1))*sind(pol(2)) call rotvsvec(b1,pol(3),e) end c c SUBROUTINE POS2VEC(NATM,POS,VEC) C This subroutine is to calculate the center-atom vector from the c coordinate. NATM vector will be produced from NATM atoms when NATM >= 3. c The NATM vectors is CEN->atom2, CEN->atom3,....CEN->atomN, where C CEN is the centre of the NATM atoms It is used to superimpose the c orientation of two molecules. c written by Guoguang Lu c C DIMENSION POS(3,NATM), VEC(3,NATM) C Parameter description: C NATM is the number of atoms c POS(1->3,i) is the coordinate of the i'th atom c VEC is the output vectors c DIMENSION POS(3,NATM), VEC(3,NATM),C(3) IF (NATM.LT.3) STOP 'Number of the atoms is less than 3' CALL AVERG(3,NATM,POS,C) C C is the center coordinate of the atoms DO I=1,NATM CALL ARRPS(3,1,POS(1,I),C,VEC(1,I)) C CALL ARRMC (3,1,VEC(1,I),1./VEM(3,VEC(1,I)),VEC(1,I)) END DO END c C C * R&B - MATRIX C SUBROUTINE R_B(ROT,E,IOTP) DIMENSION E(3,3),ROT(3) EQUIVALENCE (PS,AL,PA), (TH,BE,PB), (PH,GA,PC) EQUIVALENCE (S1,SIPS), (S2,SITH), (S3,SIPH) 1 ,(C1,COPS), (C2,COTH), (C3,COPH) PS=ROT(1) TH=ROT(2) PH=ROT(3) IF (IOTP.EQ.4) THEN PS=PS+90.0 PH=PH-90.0 END IF ARC=3.14159265359/180.0 SIPS = SIN(PS*ARC) COPS = COS(PS*ARC) SITH = SIN(TH*ARC) COTH = COS(TH*ARC) SIPH = SIN(PH*ARC) COPH = COS(PH*ARC) 120 E(1,1) =-S1*C2*S3 + C1*C3 E(2,1) = C1*C2*S3 + S1*C3 E(3,1) = S2*S3 E(1,2) =-S1*C2*C3 - C1*S3 E(2,2) = C1*C2*C3 - S1*S3 E(3,2) = S2*C3 E(1,3) = S1*S2 E(2,3) = - C1*S2 E(3,3) = C2 END c c real function lgg_radii(natm,xyz) c pjx: renamed from radii to avoid clash with common block c of same name in refmac4 c Explicitly typed to real c c--calculate average radii of a group of atoms. c first calculate the center of gravity c then the mean distance from each atom to this center. c real xyz(3,natm) real b1(3),b2(3) c lgg_radii = 0. call averg(3,natm,xyz,b1) do i = 1, natm call arrps(3,1,xyz(1,i),b1,b2) lgg_radii = lgg_radii + vem(3,b2) end do lgg_radii = lgg_radii/float(natm) end c c c this is a subroutine to change orthogonalization matrix according to c cell dimension raxis spindle and xray axis c input c character cell(6) ------ cell dimensions c character aspin*3 ------ raxis spindle axis c character axray*2 ------ raxis xray axis c output c CELLS*6 --- cell dimensions in reciprocal space c DEOR3*3 --- Deorthogonalization matrix in real space c ORTH3*3 --- Orthogonalization matrix in receprocal space. c DEORS3*3 --- Deorthogonalization matrix in reciprocal space c ORTHS3*3 --- Orthogonalization matrix in reciprocal space. c AND COMMON/DET/ DET 3*3 MATRIX transfer from statnd X-a orthogonal matrix c c Guoguang 930723 c c PJX 010125 renamed common block det to lggdet to avoid c clash with subroutine det in rsps. c This common block doesn't appear to be used anywhere else? c subroutine raxcrystl(cell,aspin,axray,cells,deor,orth,deors,orths) common/lggdet/ det real det(3,3),buf(3,3),buf2(3,3) real cell(6),cells(6) real deor(3,3),orth(3,3) real deors(3,3),orths(3,3) real pdir(3,6) INTEGER IC(6) real cof(6) character*3 aspin,pspin(6) character*2 axray,pxray(6) DIMENSION B1(3),B2(3),IUF(3) c... data statements. Separate declaration and init required for f2c data pdir /1.,0.,0.,0.,1.,0.,0.,0.,1., 1 -1.,0.,0.,0.,-1.,0.,0.,0.,-1./ data ic /1,2,3,1,2,3/ data cof /1.,1.,1.,-1.,-1.,-1./ data pspin /'+a*','+b*','+c*','-a*','-b*','-c*'/ data pxray /'+a','+b','+c','-a','-b','-c'/ c c standard orthogonalization matrix c call lgg_crystal(cell,cells,deor,orth,deors,orths) c c transferring matrix from new system to old det c c xray axis do i = 1, 6 if (axray.eq.pxray(i)) then call arrmc(3,1,orth(1,ic(i)), 1 cof(i)/vem(3,orth(1,ic(i))),det(1,1)) goto 30 end if end do WRITE(6,*) 'X-ray axis',(pxray(i),' ',i=1,6) WRITE(6,*) 'but you have ',axray stop 'wrong xray axis' 30 continue c spindle axis do i = 1, 6 if (aspin.eq.pspin(i)) then call arrmc(3,1,orths(1,ic(i)), 1 cof(i)/vem(3,orths(1,ic(i))),det(1,3)) goto 40 end if end do WRITE(6,*) 'spindle axis',(pspin(i),' ',i=1,6) WRITE(6,*) 'but you have ',aspin stop 'wrong xray axis' c 40 continue call veccrsmlt(det(1,3),det(1,1),det(1,2)) c call arrgive(9,orth,buf) call antiarr(3,3,det,buf2) call matmult(3,3,3,3,buf2,buf,orth) c CALL ARRGIVE(9,ORTH,DEOR) CALL IVSN(3,DEOR,B1,B2,IUF,DE,1.0E-6) CALL ANTIARR(3,3,ORTH,DEORS) CALL ANTIARR(3,3,DEOR,ORTHS) C c DO I = 1, 3 c CELLS(I) = VEM(3,orths(1,I)) c END DO C c CELLS(4) = ANGLE(ORTHS(1,2),ORTHS(1,3)) c CELLS(5) = ANGLE(ORTHS(1,3),ORTHS(1,1)) c CELLS(6) = ANGLE(ORTHS(1,1),ORTHS(1,2)) c end c c c this is a subroutine to change raxis spindle and xray axis into U matrix c input c character aspin*3 ------ raxis spindle axis c character axray*2 ------ raxis xray axis c real*4 umat(3,3) ------ raxis U matrix c Guoguang 930723 c subroutine raxumat(aspin,axray,umat) real umat(3,3) real rmat(3,3) real pdir(3,6) character*3 aspin,pspin(6) character*2 axray,pxray(6) c... data statements. Separate declaration and init required for f2c data pdir /1.,0.,0.,0.,1.,0.,0.,0.,1., 1 -1.,0.,0.,0.,-1.,0.,0.,0.,-1./ data pspin /'+a*','+b*','+c*','-a*','-b*','-c*'/ data pxray /'+a','+b','+c','-a','-b','-c'/ c do i = 1, 6 if (aspin.eq.pspin(i)) then call arrgive(3,pdir(1,i),umat(1,3)) goto 20 end if end do WRITE(6,*) ' allowed Spindle axis',(pspin(i),' ',i=1,6) stop 'wrong spindle axis' 20 continue c do i = 1, 6 if (axray.eq.pxray(i)) then call arrgive(3,pdir(1,i),umat(1,1)) goto 30 end if end do WRITE(6,*) 'X-ray axis',(pxray(i),' ',i=1,6) stop 'wrong xray axis' 30 continue call veccrsmlt(umat(1,3),umat(1,1),umat(1,2)) call antiarr(3,3,umat,rmat) call arrgive(9,rmat,umat) c end c c SUBROUTINE RECEPICAL(CELL,DEOR,ORTH) C This is a routine which inputs cell parameters, CELL and converts c them into reciprocal cell parameters. It then gives a deorthogonalization c and orthogonalization matrix in reciprocal space. c DIMENSION DEOR(3,3),ORTH(3,3),CELL(6) DIMENSION BUFF(3,3) DIMENSION B1(3),B2(3),IUF(3) external acosd, cosd, sind AP=CELL(4) BA=CELL(5) GA=CELL(6) CALL ARRMC(3,3,BUFF,0.,BUFF) COASTAR=(COSD(BA)*COSD(GA)-COSD(AP))/(SIND(BA) 1*SIND(GA)) SIASTAR=SQRT(1.-COASTAR*COASTAR) BUFF(1,1)=1. BUFF(1,2)=COSD(GA) BUFF(2,2)=SIND(GA) BUFF(1,3)=COSD(BA) BUFF(2,3)=-SIND(BA)*COASTAR BUFF(3,3)=SIND(BA)*SIASTAR C DO I =1, 3 CALL ARRMC(3,1,BUFF(1,I),CELL(I),BUFF(1,I)) END DO c c WRITE(6,*) buff C VOLUM = VLDIM3(BUFF) C CALL VECCRSMLT(BUFF(1,2),BUFF(1,3),DEOR(1,1)) CALL VECCRSMLT(BUFF(1,3),BUFF(1,1),DEOR(1,2)) CALL VECCRSMLT(BUFF(1,1),BUFF(1,2),DEOR(1,3)) CALL ARRMC(3,3,DEOR,1./VOLUM,DEOR) C c WRITE(6,*) volum c WRITE(6,*) i,cell(i),vem(3,deor(1,i)) DO I = 1, 3 CELL(I) = VEM(3,DEOR(1,I)) c WRITE(6,*) CELL(I) c WRITE(6,*) DEOR CALL ARRMC(3,1,DEOR(1,I),1./CELL(I),DEOR(1,i)) END DO C CELL(4) = ACOSD(POIMULT(3,3,DEOR(1,2),DEOR(1,3))) CELL(5) = ACOSD(POIMULT(3,3,DEOR(1,3),DEOR(1,1))) CELL(6) = ACOSD(POIMULT(3,3,DEOR(1,1),DEOR(1,2))) C CALL ARRMC(3,3,DEOR,1.,ORTH) CALL IVSN(3,ORTH,B1,B2,IUF,VAL,1E-6) RETURN END c c SUBROUTINE RECEPICAL0(CELL,DEOR,ORTH) C This is a routine which inputs cell parameters, CELL and converts c them into reciprocal cell parameters. It then gives a deorthogonalization c and orthogonalization matrix in reciprocal space. c DIMENSION DEOR(3,3),ORTH(3,3),CELL(6) DIMENSION BUFF(3,3) DIMENSION B1(3),B2(3),IUF(3) external acosd, cosd, sind AP=CELL(4) BA=CELL(5) GA=CELL(6) CALL ARRVALUE(3*3,BUFF,0.) COASTAR=(COSD(BA)*COSD(GA)-COSD(AP))/(SIND(BA) 1*SIND(GA)) SIASTAR=SQRT(1.-COASTAR*COASTAR) BUFF(1,1)=1. BUFF(1,2)=COSD(GA) BUFF(2,2)=SIND(GA) BUFF(1,3)=COSD(BA) BUFF(2,3)=-SIND(BA)*COASTAR BUFF(3,3)=SIND(BA)*SIASTAR C DO I =1, 3 CALL ARRMC(3,1,BUFF(1,I),CELL(I),BUFF(1,I)) END DO c c WRITE(6,*) buff C VOLUM = VLDIM3(BUFF) C CALL VECCRSMLT(BUFF(1,2),BUFF(1,3),ORTH(1,1)) CALL VECCRSMLT(BUFF(1,3),BUFF(1,1),ORTH(1,2)) CALL VECCRSMLT(BUFF(1,1),BUFF(1,2),ORTH(1,3)) CALL ARRMC(3,3,ORTH,1./VOLUM,ORTH) C c WRITE(6,*) volum c WRITE(6,*) i,cell(i),vem(3,ORTH(1,i)) DO I = 1, 3 CELL(I) = VEM(3,ORTH(1,I)) c WRITE(6,*) CELL(I) c WRITE(6,*) ORTH CALL ARRMC(3,1,ORTH(1,I),1./CELL(I),DEOR(1,i)) END DO C CELL(4) = ACOSD(POIMULT(3,3,DEOR(1,2),DEOR(1,3))) CELL(5) = ACOSD(POIMULT(3,3,DEOR(1,3),DEOR(1,1))) CELL(6) = ACOSD(POIMULT(3,3,DEOR(1,1),DEOR(1,2))) C CALL ARRGIVE(3*3,ORTH,DEOR) CALL IVSN(3,DEOR,B1,B2,IUF,VAL,1E-6) RETURN END c c SUBROUTINE REDSTRIN(NUNIT,NCHA,TXT,NPAR) C A subroutine to write a string of characters in unit NUNIT according c to the spaces in the string. It is used to change a character into c parameters under help of a file NUNIT. c NUNIT is the unit number. c NCHA is length of character string. c TXT is the NCHA bytes character. C NPAR is how many parameters in this string. CHARACTER*120 TXT NPAR = 0 REWIND (NUNIT) I = 1 10 IF (I.LE.NCHA) THEN IF (TXT(I:I).NE.' ') THEN J = I 20 IF (J.GE.NCHA) THEN WRITE(NUNIT,'(A)') TXT(I:J) NPAR = NPAR + 1 ELSE IF (TXT(J+1:J+1).EQ.' ') THEN WRITE(NUNIT,'(A)') TXT(I:J) NPAR = NPAR + 1 ELSE J = J + 1 GOTO 20 END IF I = J + 1 GOTO 10 ELSE IF (I.LT.NCHA) THEN I = I + 1 GOTO 10 END IF END IF C REWIND(NUNIT) END c c subroutine refmtoroh(amat,roh,roh2,rms) c This is a subroutine to calculate from a matrix to Eulerian angles in c Rober O Huber system and refine ROH angles to minimize c Sigma((Aroh(i,j)-Amat(i,j)**2). The output will include two c symmetric ROH angles a rms value of input matrix and the matrix c from ROH angles. c Input: amat(3,3) --- Input matrix c Output: roh(3,3) --- output ROH angle c roh2(3,3) --- output ROH angle c rms --- rms value between amat and mat from ROH angle. c Guoguang Lu, 950831. Purdue Univ c real amat(3,3),roh(3),roh2(3) real bmat(3,3),b1(3),b2(3),cmat(9) real rohnew(3) real vt(9,3),vvv(3,3),delta(3),det(3) c real droh(3,3,3) c ncyc = 0 deg = 180./3.141592654 call mtohuber(amat,roh,roh2) call huber(roh,bmat) call arrps(9,1,bmat,amat,cmat) c WRITE(6,*) 'cmat',cmat rms = vem(9,cmat) c11 format(3f10.7) c write(6,*) 'bmat' c write(6,11) bmat c 10 continue c WRITE(6,*) 'cycle,rms',rms,ncyc c WRITE(6,*) 'roh',roh ncyc = ncyc + 1 c call drvrohthd(1,roh,vt(1,1)) call drvrohthd(2,roh,vt(1,2)) call drvrohthd(3,roh,vt(1,3)) c c write(6,*) 'vt' c write(6,'(3f12.7,2x,f12.7)') ((vt(i,j),j=1,3),cmat(i),i=1,9) call lsqeq(9,3,vt,cmat,det,vvv,b1) c WRITE(6,*) 'det',det call arrps(3,1,roh,det,rohnew) c WRITE(6,*) 'rohnew',rohnew call huber(rohnew,bmat) c write(6,*) 'bmatnew' c write(6,11) bmat call arrps(9,1,bmat,amat,cmat) c WRITE(6,*) 'cmatnew',cmat rms1 = vem(9,cmat) if (rms1.lt.rms) then call arrgive(3,rohnew,roh) rms = rms1 goto 10 else c WRITE(6,*) 'Refinement finished with rms,rms1:',rms,rms1 roh2(1) = 180. + roh(1) roh2(2) = 180. - roh(2) roh2(3) = 180. + roh(3) end if c end c c SUBROUTINE REFORN ( NATM, XYZ1, XYZ2, A, VT, DIS ) C DIMENSION XYZ1(3,NATM), XYZ2(3,NATM), A(3,3) C DIMENSION VT(3*NATM,3), DIS(NATM,3) C A subroutine to give the superimpose matrix and vector from MOL1 to c MOL2 i.e. XYZ2(3*NATM) = A(3*3) * XYZ1(3*NATM) + T(3) C Where NATM represents the number of the atoms in each molecule c which will be superimposed. c XYZ1(3,NATM) represents the coordinates of MOL1 c XYZ2(3,NATM) represents the coordinates of MOL2 C A(3*3) represents the input initial matrix and c output matrix. C VT(3*6*NATM) is a 6*NATM-dimensional buffer array C DIS(3*NATM) is a 3*NATM-dimensional buffer array c C COMMON/SHIFS/ SCALR,SCALT C Note: There should be a scale of the shifts. i.e. Shift= scale * shifts c Here SCALR is the rotation shiftscale c Here SCALT is the translation shiftscale c The initial and suggested SCALR is 1. c The initial and suggested SCALt is 1. C C COMMON/RMS/ RMS,SMEAN,NREF,NREF1 C RMS is the final R.M.S between two molecules. C SMEAN is the mean distance. c NREF is the number of cycles of rotation refinement c NREF1 is the number of cycles of translation refinement c They could be used to judge the SCALR and SCALS c c The routine uses the atom-atom vector to perform the Eulerian angle least c square refinement. Testing shows that that this method might be more c accurate than others at least in orientation. c C SUPOS1 is almost same with SUPOS, but used as a subroutine as a first c step of the refinement by subroutine SUPRIMP. c c by Guoguang Lu cv c added an upper limit for number of refinement cycles to do. c C. Vonrhein cv C 30/01/1989 C C COMMON/RMS/ RMS,SMEAN,NREF,NREF1 c COMMON/SHIFS/ SCALR,SCALS PARAMETER (NATM0 = 50000) c NATM0 is the largest number of atoms. DIMENSION XYZ1(3,NATM), XYZ2(3,NATM), A(3,3) DIMENSION VT(3*NATM,3), DIS(3,NATM) DIMENSION VEC1(3,NATM0),VEC2(3,NATM0),VEC1P(3,NATM0) C DIMENSION DA(3,3,3),VVV(3,3) DIMENSION B1(3),B2(3),ROHOLD(3),ROH(3),DETAROH(3),TOLD(3) C MAXREF = maximum number of refinements to do C INTEGER MAXREF PARAMETER (MAXREF=100) C c... data statements. Separate declaration and init required for f2c DATA SCALR/1./,SCALT/1./ C DEG=180./3.14159265359 NREF=0 c NREF1=0 C CALL MTOHUBER(A,ROH,B1) c c calculate the atom-atom vector c CALL POS2VEC(NATM,XYZ1,VEC1) CALL POS2VEC(NATM,XYZ2,VEC2) C CALL MATMULT(3,3,3,NATM,A,VEC1,VEC1P) CALL ARRPS(3,NATM,VEC1P,VEC2,DIS) C A*V1 - V2 RMS1= DOSQ( 3*NATM, DIS ) RMS = sqrt(RMS1)/float(NATM) C 50 CONTINUE C C Refine the superimposing Eulerian Angle' c C WRITE(6,'(A)') '0' C WRITE(6,*) 'Cycle of Eulerian angle refinement ',NREF C WRITE(6,*) 'Superimposing matrix' C WRITE(6,10) ((A(I,J),J=1,3),I=1,3) C WRITE(6,*) 'Eulerian Angle', ROH C10 format (3F10.5) C WRITE(6,*) 'SIGMA (Deta vector)^2 =', RMS C C c C COMPUTE THE DETATH1,DETATH2,DETATH3 than the normal matrix C DO I = 1, 3 CALL DRVROHTH(I,ROH,DA(1,1,I)) CALL MATMULT(3,3,3,NATM,DA(1,1,I),VEC1,VT(1,I)) C (DERIV(A)/DERIV(THETAi))*VEC1 END DO c CALL LSQEQ(NATM*3,3,VT,DIS,DETAROH,VVV,B1) C To change it into degree from arc unit CALL ARRMC(3,1,DETAROH,DEG,DETAROH) C CALL ARRMC(3,1,DETAROH,-SCALR,DETAROH) C WRITE(6,*) 'DetaROH = ',DETAROH CALL ARRMC(3,1,ROH,1.,ROHOLD) C SAVE THE PREVIOUS ROH CALL ARRAD(3,1,ROHOLD,DETAROH,ROH) C ROH=ROHOLD+DETAROH CALL HUBER(ROH,A) C NEW MATRIX CALL MATMULT(3,3,3,NATM,A,VEC1,VEC1P) CALL ARRPS(3,NATM,VEC1P,VEC2,DIS) C A*V1 - V2 RMS=dosq(3*NATM,DIS) C C do only a maximum of MAXREF refinement cycles C IF ((NREF.LE.MAXREF).AND.(RMS.LT.RMS1)) THEN c RMS1=RMS NREF=NREF+1 GOTO 50 END IF C WRITE(6,'(A)') '0' C WRITE(6,*) 'That is the final rotation result.' C WRITE(6,'(A)') '0' CALL ARRMC(3,1,ROHOLD,1.,ROH) CALL HUBER(ROH,A) END c c SUBROUTINE REFORNFIN ( NATM, XYZ1, XYZ2, A, VT, DIS ) C DIMENSION XYZ1(3,NATM), XYZ2(3,NATM), A(3,3) C DIMENSION VT(3*NATM,3), DIS(NATM,3) C A subroutine to give the superimpose matrix and vector from MOL1 to c MOL2 i.e. XYZ2(3*NATM) = A(3*3) * XYZ1(3*NATM) + T(3) C Where NATM represents the number of the atoms in each molecule c which will be superimposed. c XYZ1(3,NATM) represents the coordinates of MOL1 c XYZ2(3,NATM) represents the coordinates of MOL2 C A(3*3) represents the input initial matrix and c output matrix. C VT(3*6*NATM) is a 6*NATM-dimensional buffer array C DIS(3*NATM) is a 3*NATM-dimensional buffer array c C COMMON/SHIFS/ SCALR,SCALT c DATA SCALR/1./,SCALT/1./ C Note: There should be a scale of the shifts. i.e. Shift= scale * shifts c Here SCALR is the rotation shiftscale c Here SCALT is the translation shiftscale c The initial and suggested SCALR is 1. c The initial and suggested SCALt is 1. C C COMMON/RMS/ RMS,SMEAN,NREF,NREF1 C RMS is the final R.M.S between two molecules. C SMEAN is the mean distance. c NREF is the number of cycles of rotation refinement c NREF1 is the number of cycles of translation refinement c They could be used to judge the SCALR and SCALS c c The program use the atom-atom vector to perform the Eulerian angle least c square refinement. Testing shows that this method might be more c accurate than others at least in orientation. c C SUPOS1 is almost the same as SUPOS, but used as a subroutine as a first c step of the refinement by subroutine SUPRIMP. c c by Guoguang Lu C 30/01/1989 C C COMMON/RMS/ RMS,SMEAN,NREF,NREF1 C COMMON/SHIFS/ SCALR,SCALS PARAMETER (NATM0 = 50000) c NATM0 is the largest number of atoms. DIMENSION XYZ1(3,NATM), XYZ2(3,NATM), A(3,3) DIMENSION VT(3*NATM,3), DIS(3,NATM) DIMENSION VEC1(3,NATM0),VEC2(3,NATM0),VEC1P(3,NATM0) C DIMENSION DA(3,3,3),VVV(3,3) DIMENSION B1(3),B2(3),ROHOLD(3),ROH(3),DETAROH(3),TOLD(3) C C C DEG=180./3.14159265359 C SCALR = 1. NREF=0 c NREF1=0 C CALL MTOHUBERARC(A,ROH,B1) c c calculate the atom-atom vector c CALL POS2VEC(NATM,XYZ1,VEC1) CALL POS2VEC(NATM,XYZ2,VEC2) C CALL MATMULT(3,3,3,NATM,A,VEC1,VEC1P) CALL ARRPS(3,NATM,VEC1P,VEC2,DIS) C A*V1 - V2 RMS1= DOSQ( 3*NATM, DIS ) RMS = RMS1 C 50 CONTINUE C C Refine the superimposing Eulerian Angle' c C WRITE(6,'(A)') '0' C WRITE(6,*) 'Cycle of Eulerian angle refinement ',NREF C WRITE(6,*) 'Superimposing matrix' C WRITE(6,10) ((A(I,J),J=1,3),I=1,3) C WRITE(6,*) 'Eulerian Angle', ROH C10 format (3F10.5) C WRITE(6,*) 'SIGMA (Deta vector)^2 =', RMS C C c C COMPUTE THE DETATH1,DETATH2,DETATH3 than the normal matrix C DO I = 1, 3 CALL DRVROHTHARC(I,ROH,DA(1,1,I)) CALL MATMULT(3,3,3,NATM,DA(1,1,I),VEC1,VT(1,I)) C (DERIV(A)/DERIV(THETAi))*VEC1 END DO c CALL LSQEQ(NATM*3,3,VT,DIS,DETAROH,VVV,B1) C To change it into degree from arc unit C CALL ARRMC(3,1,DETAROH,DEG,DETAROH) C 30 CONTINUE CALL ARRMC(3,1,DETAROH,-SCALR,DETAROH) C WRITE(6,*) 'SCALR ',SCALR C WRITE(6,*) 'DetaROH = ',DETAROH CALL ARRMC(3,1,ROH,1.,ROHOLD) C SAVE THE PREVIOUS ROH CALL ARRAD(3,1,ROHOLD,DETAROH,ROH) C ROH=ROHOLD+DETAROH CALL HUBERARC(ROH,A) C NEW MATRIX CALL MATMULT(3,3,3,NATM,A,VEC1,VEC1P) CALL ARRPS(3,NATM,VEC1P,VEC2,DIS) C A*V1 - V2 RMS=dosq(3*NATM,DIS) C C WRITE(6,*) 'RMS NEW AND OLD', RMS,RMS1 IF (RMS.LT.RMS1) THEN RMS1=RMS NREF=NREF+1 GOTO 50 ELSE IF(SCALR.GT.1E-4) THEN CALL ARRMC(3,1,DETAROH,-1./SCALR,DETAROH) SCALR = SCALR*0.5 CALL ARRMC(3,1,ROHOLD,1.,ROH) CALL HUBERARC(ROH,A) GOTO 30 END IF C WRITE(6,'(A)') '0' C WRITE(6,*) 'That is the final rotation result.' C WRITE(6,'(A)') '0' CALL ARRMC(3,1,ROHOLD,1.,ROH) CALL HUBERARC(ROH,A) END c c SUBROUTINE REFRT ( NATM, X1, X2, A, T, VT, DIS ) C DIMENSION X1(3,NATM), X2(3,NATM), A(3,3), T(3) C DIMENSION VT(3*NATM,6),DIS(3,NATM) C A subroutine to refine the superimpose matrix and vector from MOL1 to c MOL2 i.e. XYZ2(3*NATM) = A(3*3) * XYZ1(3*NATM) + T(3) C Where NATM represents the number of the atoms in each molecule c which will be superimposed. c XYZ1(3,NATM) represents the coordinates of MOL1 c XYZ2(3,NATM) represents the coordinates of MOL2 C A(3*3) represents the input initial matrix and c output matrix. c T(3*3) represents the input initial translation vector c output vector. C VT(3*6*NATM) is a 6*NATM-dimensional buffer array C DIS(3*NATM) is a 3*NATM-dimensional buffer array c C COMMON/SHIFS/ SCALR,SCALT c DATA SCALR/1./,SCALT/1./ C Note: There should be a scale of the shifts. i.e. Shift= scale * shifts c Here SCALR is the rotation shiftscale c Here SCALT is the translation shiftscale c The initial and suggested SCALR is 60. c The initial and suggested SCALt is 1. C C COMMON/RMS/ RMS,SMEAN,NREF,NREF1 C RMS is the final R.M.S between two molecules. C SMEAN is the mean distance. c NREF is the number of cycles of refinement c NREF1 is not useful. c They could be used to judge the SCALR and SCALS c c The program use translation linear to least square refinement. Testing c shows that it works quite well. The function of this routine is similar c to SUPOS but the r.m.s. is less and the orientation might be more dangerous. c c c by Guoguang Lu C 27/01/1989 C COMMON/RMS/ RMS,SMEAN,NREF1,NREF c COMMON/SHIFS/ SCALR,SCALT c DATA SCALR/1./,SCALT/1./,IAT/0/ C DIMENSION X1(3,NATM), X2(3,NATM), A(3,3), T(3) DIMENSION VT(NATM*3,6),DIS(3,NATM) DIMENSION VVV(6,6), VV1(6) C DIMENSION DA(3,3,3),DROH(3),DT(3),DETA(6) DIMENSION B1(3),B2(3),ROHOLD(3),ROH(3),TOLD(3) REAL EMT(3,3) EQUIVALENCE (DETA,DROH) EQUIVALENCE (DETA(4),DT) data emt /1.,0.,0.,0.,1.,0.,0.,0.,1./ C DEG=180./3.14159265359 SCALR = 1. SCALT = 1. iat = 0. NREF=0 epsilon = 1. C CALL MTOHUBER(A,ROH,B1) c CALL RTMOV(NATM,X1,A,T,DIS) CALL ARRPS(3,NATM,DIS,X2,DIS) RMS = DOSQ(NATM*3, DIS) RMS1 = RMS DO 5 I = 1, 3 DO 5 J = 1, NATM 5 CALL ARRGIVE(3,EMT(1,I),VT((J-1)*3+1,I+3)) C C Refine th1, th2, th3, tx, ty and tz c 10 CONTINUE c if ( (nref.gt.99) .or. (abs(epsilon).le.1.0e-5) ) goto 25 C WRITE(6,*) c WRITE(6,*) 'Cycle of refinement:',NREF C WRITE(6,*) 'Matrix' C WRITE(6,20) A C20 FORMAT(3F10.5) C WRITE(6,*) 'Eulerian Angle:',ROH C WRITE(6,*) 'Translation: ',T C WRITE(6,*) 'SIGMA (distance^2)=',RMS C C compute the normal matrix DO I =1, 3 CALL DRVROHTH(I,ROH,DA(1,1,I)) CALL MATMULT(3,3,3,NATM,DA(1,1,I),X1,VT(1,I)) C c CALL ARRMC(3,1,B1,0.,B1) c B1(I) = 1. c DO J = 1, NATM c CALL ARRMC(3,1,B1, 1., VT((J-1)*3+1,I+3) ) c END DO C END DO C CALL LSQEQ(3*NATM,6,VT,DIS,DETA,VVV,VV1) C C SHIFT = SHIFT * SCALE CALL ARRMC(3,1,DROH,-SCALR*deg,DROH) CALL ARRMC(3,1,DT,-SCALT,DT) C TYPE *, 'Shift ROH',DROH C TYPE *, 'Shift T ',DT C SAVE THE OLD ANGLE AND TRANSLATION VECTOR CALL ARRMC(3,1,ROH,1.,ROHOLD) CALL ARRMC(3,1,T,1.,TOLD) C CALL ARRAD(3,1,ROH,DROH,ROH) CALL ARRAD(3,1,T,DT,T) C CALL HUBER(ROH,A) C CALL RTMOV(NATM,X1,A,T,DIS) CALL ARRPS(3,NATM,DIS,X2,DIS) C RMS = DOSQ(NATM*3, DIS) c TYPE *, 'rms new and old ',rms, rms1 C IF (RMS.LT.RMS1) THEN epsilon = (rms1-rms)/rms1 NREF = NREF+1 RMS1=RMS GOTO 10 END IF C 25 continue CALL ARRMC(3,1,ROHOLD,1.,ROH) CALL ARRMC(3,1,TOLD,1.,T) CALL HUBER(ROH,A) C CALL RTMOV(NATM,X1,A,T,DIS) CALL ARRPS(3,NATM,DIS,X2,DIS) C ATM = NATM SMEAN = 0 DO I=1, NATM D = VEM(3,DIS(1,I)) SMEAN = SMEAN + D END DO SMEAN = SMEAN /ATM C c SMEAN = SIGMA (DISTANCE) / N C i i RMS = SQRT( RMS1/ATM ) C c RMS = SQRT( SIGMA (DISTANCE^2) / N ) C i i c c END c c SUBROUTINE REFRTFIN ( NATM, X1, X2, A, T, VT, DIS ) C DIMENSION X1(3,NATM), X2(3,NATM), A(3,3), T(3) C DIMENSION VT(3*NATM,6),DIS(3,NATM) C A subroutine to refine the superimpose matrix and vector from MOL1 to c MOL2 i.e. XYZ2(3*NATM) = A(3*3) * XYZ1(3*NATM) + T(3) C Where NATM represents the number of the atoms in each molecule c which will be superimposed. c XYZ1(3,NATM) represents the coordinates of MOL1 c XYZ2(3,NATM) represents the coordinates of MOL2 C A(3*3) represents the input initial matrix and c output matrix. c T(3*3) represents the input initial translation vector c output vector. C VT(3*6*NATM) is a 6*NATM-dimensional buffer array C DIS(3*NATM) is a 3*NATM-dimensional buffer array c C COMMON/SHIFS/ SCALR,SCALT c DATA SCALR/1./,SCALT/1./ C Note: There should be a scale of the shifts. i.e. Shift= scale * shifts c Here SCALR is the rotation shiftscale c Here SCALT is the translation shiftscale c The initial and suggested SCALR is 60. c The initial and suggested SCALt is 1. C C COMMON/RMS/ RMS,SMEAN,NREF,NREF1 C RMS is the final R.M.S between two molecules. C SMEAN is the mean distance. c NREF is the number of cycles of refinement c NREF1 is not useful. c They could be used to judge the SCALR and SCALS c c The routine uses translation linear to least square refinement. Testing c shows that it works quite well. The function of this routine is similar c to SUPOS but the r.m.s. is less and the orientation might be more dangerous. c c c by Guoguang Lu C 27/01/1989 C COMMON/RMS/ RMS,SMEAN,NREF1,NREF c COMMON/SHIFS/ SCALR,SCALT C DIMENSION X1(3,NATM), X2(3,NATM), A(3,3), T(3) DIMENSION VT(NATM*3,6),DIS(3,NATM) DIMENSION VVV(6,6), VV1(6) C DIMENSION DA(3,3,3),DROH(3),DT(3),DETA(6) DIMENSION B1(3),B2(3),ROHOLD(3),ROH(3),TOLD(3) EQUIVALENCE (DETA,DROH) EQUIVALENCE (DETA(4),DT) c... data statements. Separate declaration and init required for f2c DATA SCALR/1./,SCALT/1./,IAT/0/ C DEG=180./3.14159265359 NREF=0 C CALL MTOHUBERARC(A,ROH,B1) c CALL RTMOV(NATM,X1,A,T,DIS) CALL ARRPS(3,NATM,DIS,X2,DIS) RMS = DOSQ(NATM*3, DIS) RMS1 = RMS C C Refine th1, th2, th3, tx, ty and tz c 10 CONTINUE c C WRITE(6,*) c WRITE(6,*) 'Cycle of refinement:',NREF C WRITE(6,*) 'Matrix' C WRITE(6,20) A C20 FORMAT(3F10.5) C WRITE(6,*) 'Eulerian Angle:',ROH C WRITE(6,*) 'Translation: ',T C WRITE(6,*) 'SIGMA (distance^2)=',RMS C C compute the normal matrix DO I =1, 3 CALL DRVROHTHARC(I,ROH,DA(1,1,I)) CALL MATMULT(3,3,3,NATM,DA(1,1,I),X1,VT(1,I)) C CALL ARRMC(3,1,B1,0.,B1) B1(I) = 1. DO J = 1, NATM CALL ARRMC(3,1,B1, 1., VT((J-1)*3+1,I+3) ) END DO C END DO C CALL LSQEQ(3*NATM,6,VT,DIS,DETA,VVV,VV1) C C SHIFT = SHIFT * SCALE C CALL ARRMC(3,1,DROH,-SCALR*deg,DROH) 30 continue CALL ARRMC(3,1,DROH,-SCALR,DROH) CALL ARRMC(3,1,DT,-SCALT,DT) C TYPE *, 'scalr,scalt',scalr,scalt C TYPE *, 'Shift ROH',DROH C TYPE *, 'Shift T ',DT C SAVE THE OLD ANGLE AND TRANSLATION VECTOR CALL ARRMC(3,1,ROH,1.,ROHOLD) CALL ARRMC(3,1,T,1.,TOLD) C CALL ARRAD(3,1,ROH,DROH,ROH) CALL ARRAD(3,1,T,DT,T) C CALL HUBERARC(ROH,A) C CALL RTMOV(NATM,X1,A,T,DIS) CALL ARRPS(3,NATM,DIS,X2,DIS) C RMS = DOSQ(NATM*3, DIS) C TYPE *, 'refrt rms new and old ',rms, rms1 C IF (RMS.LT.RMS1) THEN NREF = NREF+1 RMS1=RMS GOTO 10 else if (scalr.gt.1.e-4) then CALL ARRMC(3,1,DROH,-1./SCALR,DROH) CALL ARRMC(3,1,DT,-1./SCALT,DT) scalr = scalr*0.5 scalt = scalt*0.5 CALL ARRMC(3,1,ROHOLD,1.,ROH) CALL ARRMC(3,1,TOLD,1.,T) CALL HUBERARC(ROH,A) goto 30 c END IF C CALL ARRMC(3,1,ROHOLD,1.,ROH) CALL ARRMC(3,1,TOLD,1.,T) CALL HUBERARC(ROH,A) C CALL RTMOV(NATM,X1,A,T,DIS) CALL ARRPS(3,NATM,DIS,X2,DIS) C ATM = NATM SMEAN = 0 DO I=1, NATM D = VEM(3,DIS(1,I)) SMEAN = SMEAN + D END DO SMEAN = SMEAN /ATM C c SMEAN = SIGMA (DISTANCE) / N C i i RMS = SQRT( RMS1/ATM ) C c RMS = SQRT( SIGMA (DISTANCE^2) / N ) C i i c c END c c SUBROUTINE REFRTFIN1 ( NATM, X1, X2, A, T, VT, DIS, DIST ) C DIMENSION X1(3,NATM), X2(3,NATM), A(3,3), T(3) C DIMENSION VT(NATM,6),DIS(3,NATM) C A subroutine to refine the superimpose matrix and vector from MOL1 to c MOL2 i.e. XYZ2(3*NATM) = A(3*3) * XYZ1(3*NATM) + T(3) C Where NATM represents the number of the atoms in each molecule c which will be superimposed. c XYZ1(3,NATM) represents the coordinates of MOL1 c XYZ2(3,NATM) represents the coordinates of MOL2 C A(3*3) represents the input initial matrix and c output matrix. c T(3*3) represents the input initial translation vector c output vector. C VT(6*NATM) is a 6*NATM-dimensional buffer array C DIS(3*NATM) is a 3*NATM-dimensional buffer array C DIST(NATM) is a 3*NATM-dimensional buffer array c C COMMON/SHIFS/ SCALR,SCALT c DATA SCALR/1./,SCALT/1./ C Note: There should be a scale of the shifts. i.e. Shift= scale * shifts c Here SCALR is the rotation shiftscale c Here SCALT is the translation shiftscale c The initial and suggested SCALR is 60. c The initial and suggested SCALt is 1. C C COMMON/RMS/ RMS,SMEAN,NREF,NREF1 C RMS is the final R.M.S between two molecules. C SMEAN is the mean distance. c NREF is the number of cycles of refinement c NREF1 is not useful. c They could be used to judge the SCALR and SCALS c c The routine uses translation linear to least square refinement. Testing c shows that it works quite well. The function of this routine is similar c to SUPOS but the r.m.s. is less and the orientation might be more dangerous. c c c by Guoguang Lu C 27/01/1989 C COMMON/RMS/ RMS,SMEAN,NREF1,NREF c COMMON/SHIFS/ SCALR,SCALT c DATA SCALR/1./,SCALT/1./,IAT/0/ C DIMENSION X1(3,NATM), X2(3,NATM), A(3,3), T(3) DIMENSION VT(NATM,6),DIS(3,NATM),DIST(NATM) DIMENSION VVV(6,6), VV1(6) C DIMENSION DA(3,3,3),DROH(3),DT(3),DETA(6) DIMENSION B1(3),B2(3),ROHOLD(3),ROH(3),TOLD(3) EQUIVALENCE (DETA,DROH) EQUIVALENCE (DETA(4),DT) C c DEG=180./3.14159265359 scalr = 1.0 scalt = 1.0 NREF=0 C CALL MTOHUBERarc(A,ROH,B1) c CALL RTMOV(NATM,X1,A,T,DIS) CALL ARRPS(3,NATM,DIS,X2,DIS) DO I =1, NATM DIST(I) = VEM(3,DIS(1,I)) END DO RMS = DOSQ(NATM*3, DIS) RMS1 = RMS C C Refine th1, th2, th3, tx, ty and tz c 10 CONTINUE c c WRITE(6,*) c WRITE(6,*) 'Cycle of refinement:',NREF c WRITE(6,*) 'Matrix' c WRITE(6,20) A c20 FORMAT(3F10.5) c WRITE(6,*) 'Eulerian Angle:',ROH c WRITE(6,*) 'Translation: ',T c WRITE(6,*) 'SIGMA (distance^2)=',RMS C C compute the normal matrix DO I =1, 3 CALL DRVROHTHarc(I,ROH,DA(1,1,I)) C DO J = 1, NATM CALL MATMULT(3,3,3,1,DA(1,1,I),X1(1,J),B1) VT(J,I) = POIMULT(3,3,DIS(1,J),B1) / DIST(J) VT(J,I+3) = DIS(I,J) / DIST(J) END DO C END DO CALL LSQEQ(NATM,6,VT,DIST,DETA,VVV,VV1) C TYPE *, 'Shift ', DETA C SHIFT = SHIFT * SCALe c CALL ARRMC(3,1,DROH,-SCALR*deg,DROH) 30 continue C TYPE *, 'SCALR, SCALT ', SCALR, SCALT CALL ARRMC(3,1,DROH,-SCALR,DROH) CALL ARRMC(3,1,DT,-SCALT,DT) C TYPE *, 'Shift ROH',DROH C TYPE *, 'Shift T ',DT C SAVE THE OLD ANGLE AND TRANSLATION VECTOR CALL ARRMC(3,1,ROH,1.,ROHOLD) CALL ARRMC(3,1,T,1.,TOLD) C CALL ARRAD(3,1,ROH,DROH,ROH) CALL ARRAD(3,1,T,DT,T) C CALL HUBERarc(ROH,A) C CALL RTMOV(NATM,X1,A,T,DIS) CALL ARRPS(3,NATM,DIS,X2,DIS) DO I =1, NATM DIST(I) = VEM(3,DIS(1,I)) END DO C RMS = DOSQ(NATM*3, DIS) C TYPE *, 'rms new and old ',rms, rms1 C IF (RMS.LT.RMS1) THEN NREF = NREF+1 RMS1=RMS GOTO 10 c else IF (RMS.ge.0) THEN else IF (scalr.Gt.1.e-4) THEN CALL ARRMC(3,1,DROH,-1./SCALR,DROH) CALL ARRMC(3,1,DT,-1./SCALT,DT) scalr = scalr*0.5 scalt = scalt*0.5 C CALL ARRMC(3,1,ROHOLD,1.,ROH) CALL ARRMC(3,1,TOLD,1.,T) CALL HUBERarc(ROH,A) goto 30 END IF C CALL ARRMC(3,1,ROHOLD,1.,ROH) CALL ARRMC(3,1,TOLD,1.,T) CALL HUBERarc(ROH,A) CALL RTMOV(NATM,X1,A,T,DIS) CALL ARRPS(3,NATM,DIS,X2,DIS) DO I =1, NATM DIST(I) = VEM(3,DIS(1,I)) END DO c RMS = DOSQ(NATM*3, DIS) c TYPE *, 'rms repeat and old ',rms, rms1 c TYPE *, 'ending rms ',rms ATM = NATM SMEAN = 0 DO I=1, NATM D = VEM(3,DIS(1,I)) SMEAN = SMEAN + D END DO SMEAN = SMEAN /ATM c c SMEAN = SIGMA (DISTANCE) / N C i i RMS = SQRT( RMS1/ATM ) C c RMS = SQRT( SIGMA (DISTANCE^2) / N ) C i i c c END c c function gg_res3to1(rin) character gg_res3to1*1,rin*3 character*3 res(20),abr(20) c... data statements. Separate declaration and init required for f2c data RES /'ALA','GLU','GLN','ASP','ASN','LEU','GLY' 1 ,'LYS','SER','VAL','ARG','THR' 2 ,'PRO','ILE','MET','PHE','TYR','CYS','TRP','HIS'/ data ABR /'A ','E ','Q ','D ','N ','L ','G ' 1 ,'K ','S ','V ','R ','T ' 2 ,'P ','I ','M ','F ','Y ','C ','W ','H '/ c do i = 1, 20 if (rin.eq.res(i)) then gg_res3to1 = abr(i)(1:1) return end if end do if (rin.eq.' ') then gg_res3to1 = ' ' return end if c write(6,*) 'Warning: no such residues ',rin gg_res3to1 = ' ' end c c subroutine rotvsvec(vec,vkapa,a) c a subroutine to give a matrix when you know there is a rotation c which angle is vkapa along the vector vec as axis. c vec is the input 3-dimensional vector where the rotation axis is c vkapa is the rotating angle c a is the output 3*3 rotating matrix. c real vec(3),a(3,3) external sind c WRITE(6,*) 'vec,vkapa' C WRITE(6,*) vec,vkapa c There is a strange bug on Alpha, ---- cosd(vkapa) has the wrong sign!!!! c Instead I have to have cos(vkapa*pai/180.) pai = 3.141592654 c sinkapa = sind(vkapa) coskapa = cos(vkapa*pai/180.) c a(1,1) = (1.-vec(1)*vec(1))*coskapa+vec(1)*vec(1) a(2,2) = (1.-vec(2)*vec(2))*coskapa+vec(2)*vec(2) a(3,3) = (1.-vec(3)*vec(3))*coskapa+vec(3)*vec(3) c a(1,2) = vec(1)*vec(2)*(1.-coskapa) -vec(3)*sinkapa a(2,1) = vec(1)*vec(2)*(1.-coskapa) +vec(3)*sinkapa c a(1,3) = vec(3)*vec(1)*(1.-coskapa) +vec(2)*sinkapa a(3,1) = vec(3)*vec(1)*(1.-coskapa) -vec(2)*sinkapa c a(2,3) = vec(2)*vec(3)*(1.-coskapa) -vec(1)*sinkapa a(3,2) = vec(2)*vec(3)*(1.-coskapa) +vec(1)*sinkapa c end c c SUBROUTINE RTMOV(NATM,XIN,A,T,XOUT) C A routine to compute: XOUT = A * XIN + T C where XIN is the input 3*NATM array C XOUT is the Output 3*NATM array c A(3,3) is a 3*3 rotation matrix c T(3) is a 3-dimensional translation vector. c DIMENSION XIN(3,NATM),XOUT(3,NATM),A(3,3),T(3) C DIMENSION XIN(3,NATM),XOUT(3,NATM),A(3,3),T(3) CALL MATMULT(3,3,3,NATM,A,XIN,XOUT) DO I = 1, NATM CALL ARRAD(3,1,XOUT(1,I),T,XOUT(1,I)) END DO END c c function screw(a,t) c dimension a(3,3),t(3),POL(3),xyz0(3) C this is a routine to calculate how much the movement is along the c the rotation axis. c When there is a non-crystallographic rotation and translation c x2 = A*x1 + t c where A(3,3) is the 3*3 matrix c t(3) is translation vector. c the routine output POL(3) (psi, phi and kappa), go and xyz0(3) c where psi (POL(1)) is the angle between the rotation axis and y axis c phi is the angle between X axis and the image of the rotation axis c kappa is the rotating angle. c go is the screw amount along the axis direction c Guoguang 900927 c dimension a(3,3),t(3) dimension vec(3) c call mtovec(a,vec,vkapa) if (vkapa.lt.1e-6) then screw = vem(3,t) end if c if (vem(3,t).lt.(1.e-6)) then screw = 0. return end if c vec is the direction of the axis vector. screw = poimult(3,3,t,vec) end c c subroutine sectime(sec,nhour,nmin,sres) c input seconds and output the hour and minute and residue second nmin = 0 nhour = 0 if (sec.gt.60.) then smin = sec/60. nmin = int(smin) sres = sec - nmin*60 end if if (nmin.gt.60) then nmin0 = nmin nhour = int(float(nmin)/60.) nmin = nmin0 - nhour*60 end if end c c subroutine seekaxis(a,t,cen1,cen2,POL,go,xyz0) c dimension a(3,3),t(3),POL(3),xyz0(3) C this is a routine to calculate how much the movement is along the c the rotation axis and where is the rotation axis from a rigid movement c matrix. c When there is a non-crystallographic rotation and translation c x2 = A*x1 + t c where A(3,3) is the 3*3 matrix c t(3) is translation vector. c cen(3), center of the two mass molecule c the routine output POL(3) (psi, phi and kappa), go and xyz0(3) c where psi (POL(1)) is the angle between the rotation axis and y axis c phi is the angle between X axis and the image of the rotation axis c kappa is the rotating angle. c go is the screw amount along the axis direction c Guoguang 900927 c xyz0(3) is one point where the axis pass by. This point should be c a project point of CEN on the axis line, where CEN is center of c two input molecules (CEN1+CEN2)/2. c dimension a(3,3),t(3),POL(3),xyz0(3),cen(3),cen1(3),cen2(3) dimension b1(3),b2(3),b3(3) dimension rot(3,3), rot1(3,3) dimension b4(3),b5(3),cenp1(3),cenp2(3),xyzp(3) dimension vec(3) logical*1 zax external tand c call arrmc(3,1,t,0.,xyz0) call mtopolorz(a,POL,b1) if (abs(POL(3)).lt.1e-6) then go = vem(3,t) end if c if (vem(3,t).lt.(1.e-6)) then go = 0. return end if c call arrad(3,1,cen1,cen2,b4) call arrmc(3,1,b4,0.5,cen) c c b1(2) = cosd(POL(1)) c b1(1) = sind(POL(1))*cosd(POL(2)) c b1(3) = - sind(POL(1))*sind(POL(2)) call mtovec(a,vec,vkapa) call arrgive(3,vec,b3) c b1 and vec is the direction of the axis vector. go = poimult(3,3,t,b3) c now define a new coordinate system c X0 = rot * X' c where Z' is the rotating axis. c and X'is in the Z'/cen2-cen1 plane c Y' is perpendicular to X' and Z' c so b1 is Z' vector. call arrps(3,1,cen2,cen1,b4) call veccrsmlt(b3,b4,b5) temp = vem(3,b5) if (temp.gt.(1.e-6)) then zax = .false. call arrmc(3,1,b5,1./temp,b2) c here b2 is X' vector call veccrsmlt(b2,b3,b1) c b3 is Y' vector c call arrgive(3,b2,rot(1,2)) call arrgive(3,b3,rot(1,3)) call arrgive(3,b1,rot(1,1)) else call elize(3,rot) zax = .true. end if c call antiarr(3,3,rot,rot1) c rot1 = rot**-1 c c b1 is the translation in new coordinate system 11 call matmult(3,3,3,1,rot1,t,b1) if (abs(b1(3)-go).gt.1e-6) then if (zax) then rot(3,3) = -1. rot(2,2) = -1. rot1(3,3) = -1. rot1(2,2) = -1. zax = .false. goto 11 else write(6,*) 'go ', go write(6,*) 't ',t write(6,*) 'b1 ',b1 write(6,*) 'rot1' write(6,'(3f12.5)') rot1 stop 'guoguang, you are wrong to get go' end if end if c c take cen as origin. take cen1 cen2 into new coordinates as cenp1,cenp2 call arrps(3,1,cen1,cen,b1) call matmult(3,3,3,1,rot1,b1,cenp1) call arrps(3,1,cen2,cen,b2) call matmult(3,3,3,1,rot1,b2,cenp2) c if (cenp1(2).gt.1.e-4) print *, 'Warning cenp1',cenp1 if (cenp2(2).gt.1.e-4) print *, 'Warning cenp2',cenp2 c the passing point in new system xyzp(1) = 0. xyzp(3) = 0. if (abs(180.-vkapa).lt.0.001) then xyzp(2) = 0. else xyzp(2) = -cenp1(1)/tand(vkapa/2.) end if c the passing point in old system call matmult(3,3,3,1,rot,xyzp,b4) call arrad(3,1,b4,cen,xyz0) c end c c subroutine seekscrew(a,t,POL,go,xyz0) c dimension a(3,3),t(3),POL(3),xyz0(3) C this is a routine to calculate how much the movement is along the c the rotation axis. c When there is a non-crystallographic rotation and translation c x2 = A*x1 + t c where A(3,3) is the 3*3 matrix c t(3) is translation vector. c the routine output POL(3) (psi, phi and kappa), go and xyz0(3) c where psi (POL(1)) is the angle between the rotation axis and y axis c phi is the angle between X axis and the image of the rotation axis c kappa is the rotating angle. c go is the screw amount along the axis direction c Guoguang 900927 c xyz0(3) is one point where the axis pass by. c dimension a(3,3),t(3),POL(3),xyz0(3) dimension b1(3),b2(3),b3(3) dimension rot(3,3), rot1(3,3),rot3(3,3),rot2(3,3) dimension b4(3) dimension vec(3) logical*1 zax external acosd, cosd c call arrmc(3,1,t,0.,xyz0) call mtopolors(a,POL,b1) if (abs(POL(3)).lt.1e-6) then go = vem(3,t) end if c if (vem(3,t).lt.(1.e-6)) then go = 0. return end if c c b1(2) = cosd(POL(1)) c b1(1) = sind(POL(1))*cosd(POL(2)) c b1(3) = - sind(POL(1))*sind(POL(2)) call mtovec(a,b1,vkapa) call arrmc(3,1,b1,1.,vec) c b1 and vec is the direction of the axis vector. go = poimult(3,3,t,b1) c b2(1) = 0. b2(2) = 0. b2(3) = 1. c now decide a new coordinate system c X0 = rot * X' c where Z' is the rotating axis. c and X'is in the XY plane. c so b1 is Z' vector. call veccrsmlt(b1,b2,b3) temp = vem(3,b3) if (temp.gt.(1.e-6)) then zax = .false. call arrmc(3,1,b3,1./temp,b2) c here b2 is X' vector call veccrsmlt(b1,b2,b3) c b3 is Y' vector c call arrmc(3,1,b2,1.,rot(1,1)) call arrmc(3,1,b3,1.,rot(1,2)) call arrmc(3,1,b1,1.,rot(1,3)) else call elize(3,rot) zax = .true. end if c call antiarr(3,3,rot,rot1) c rot1 = rot**-1 c c b1 is the translation in new coordinate system 11 call matmult(3,3,3,1,rot1,t,b1) if (abs(b1(3)-go).gt.1e-6) then if (zax) then rot(3,3) = -1. rot(2,2) = -1. rot1(3,3) = -1. rot1(2,2) = -1. zax = .false. goto 11 else write(6,*) 'go ', go write(6,*) 't ',t write(6,*) 'b1 ',b1 write(6,*) 'rot1' write(6,'(3f12.5)') rot1 stop 'guoguang, you are wrong to get go' end if end if c if (vem(2,b1).lt.1e-6) then c the axes pass by the origin. call arrmc(3,1,t,0.,xyz0) return end if c c set a new coordinate system to make axis x'' is the image of t in new c x'y' plane. and X' = rot2 * X'' c c b1(3) = 0. call elize(3,rot2) call arrmc(3,1,b1, 1./vem(3,b1), rot2(1,1) ) call veccrsmlt(rot2(1,3),rot2(1,1),rot2(1,2)) call antiarr(3,3,rot2,rot3) c x'' = rot3 * x' = rot3 * rot1 * x0 call matmult(3,3,3,1,rot3,b1,b4) if ( abs(b4(1)-vem(2,b1)).gt.1e-3 .or. abs(b4(2)).gt.1e-3 .or 1 . abs(b4(3)).gt.1e-3) THEN WRITE(6,*) 'b1',b1 WRITE(6,*) 'b4',b4 write(6,*) 'rot2' write(6,'(3f12.5)') rot2 write(6,*) 'rot3' write(6,'(3f12.5)') rot3 stop 'something wrong in rot2 or rot3' end if x0 = b4(1) c b2(3) = 0. b2(1) = x0/2 vkapa = POL(3) b2(2) = sqrt( (1+cosd(vkapa))/(1-cosd(vkapa)) ) * b2(1) if (vkapa.lt.0.) b2(2) = - b2(2) c b2 is what you want in x'' system c the mathematics is very simple, isn't it? c c check result call arrps(3,1,b2,b4,b3) ang = acosd( poimult(3,3,b2,b3)/(vem(3,b2)*vem(3,b3)) ) c if (abs(temp).gt.1) WRITE(6,*) temp c ang = asind(temp) if (abs(ang-abs(vkapa)).gt.1e-2) then WRITE(6,*) 'something wrong in seekscrew' WRITE(6,*) 'angle ',ang WRITE(6,*) 'b1 ',b1 WRITE(6,*) 'b2 ',b2 WRITE(6,*) 'b3 ',b3 WRITE(6,*) 'b4 ',b4 end if c now x0 = rot * x' = rot * rot2 * x'' = rot1 * x'' call matmult(3,3,3,3,rot,rot2,rot1) call matmult(3,3,3,1,rot1,b2,xyz0) c to check the result. ds1 = dstpl2(vec,xyz0,t,b1,b4) call arrmc(3,1,t,0.,b3) ds2 = dstpl2(vec,xyz0,b3,b2,b4) df = abs(ds2-ds1) c if (ds1.gt.1e-4) then if (df/ds1.gt.1e-4) + stop 'distance between 0-axis and t to axis is not same' else if (ds2.gt.2e-4) + stop 'distance between 0-axis and t to axis is not same' end if call arrps(3,1,b1,b2,b3) go1 = vem(3,b3) if (abs(abs(go)-go1) .gt. 1e-4) then WRITE(6,*) 'problem in go' WRITE(6,*) 'go ', go WRITE(6,*) 'screw', go1 end if c go is the real screw value along axis end c c subroutine seekscrewz(a,t,POL,go,xyz0) c dimension a(3,3),t(3),POL(3),xyz0(3) C this is a routine to calculate how much the movement is along the c the rotation axis. c When there is a non-crystallographic rotation and translation c x2 = A*x1 + t c where A(3,3) is the 3*3 matrix c t(3) is translation vector. c the routine output POL(3) (psi, phi and kappa), go and xyz0(3) c where psi (POL(1)) is the angle between the rotation axis and y axis c phi is the angle between X axis and the image of the rotation axis c kappa is the rotating angle. c go is the screw amount along the axis direction c Guoguang 900927 c xyz0(3) is one point where the axis pass by. c dimension a(3,3),t(3),POL(3),xyz0(3) dimension b1(3),b2(3),b3(3) dimension rot(3,3), rot1(3,3),rot3(3,3),rot2(3,3) dimension b4(3) dimension vec(3) logical*1 zax external acosd, cosd c call arrmc(3,1,t,0.,xyz0) call mtopolorz(a,POL,b1) if (abs(POL(3)).lt.1e-6) then go = vem(3,t) end if c if (vem(3,t).lt.(1.e-6)) then go = 0. return end if c c b1(2) = cosd(POL(1)) c b1(1) = sind(POL(1))*cosd(POL(2)) c b1(3) = - sind(POL(1))*sind(POL(2)) call mtovec(a,b1,vkapa) call arrmc(3,1,b1,1.,vec) c b1 and vec is the direction of the axis vector. go = poimult(3,3,t,b1) c b2(1) = 0. b2(2) = 0. b2(3) = 1. c now decide a new coordinate system c X0 = rot * X' c where Z' is the rotating axis. c and X'is in the XY plane. c so b1 is Z' vector. call veccrsmlt(b1,b2,b3) temp = vem(3,b3) if (temp.gt.(1.e-6)) then zax = .false. call arrmc(3,1,b3,1./temp,b2) c here b2 is X' vector call veccrsmlt(b1,b2,b3) c b3 is Y' vector c call arrmc(3,1,b2,1.,rot(1,1)) call arrmc(3,1,b3,1.,rot(1,2)) call arrmc(3,1,b1,1.,rot(1,3)) else call elize(3,rot) zax = .true. end if c call antiarr(3,3,rot,rot1) c rot1 = rot**-1 c c b1 is the translation in new coordinate system 11 call matmult(3,3,3,1,rot1,t,b1) if (abs(b1(3)-go).gt.1e-6) then if (zax) then rot(3,3) = -1. rot(2,2) = -1. rot1(3,3) = -1. rot1(2,2) = -1. zax = .false. goto 11 else write(6,*) 'go ', go write(6,*) 't ',t write(6,*) 'b1 ',b1 write(6,*) 'rot1' write(6,'(3f12.5)') rot1 stop 'guoguang, you are wrong to get go' end if end if c if (vem(2,b1).lt.1e-6) then c the axes pass by the origin. call arrmc(3,1,t,0.,xyz0) return end if c c set a new coordinate system to make axis x'' is the image of t in new c x'y' plane. and X' = rot2 * X'' c c b1(3) = 0. call elize(3,rot2) call arrmc(3,1,b1, 1./vem(3,b1), rot2(1,1) ) call veccrsmlt(rot2(1,3),rot2(1,1),rot2(1,2)) call antiarr(3,3,rot2,rot3) c x'' = rot3 * x' = rot3 * rot1 * x0 call matmult(3,3,3,1,rot3,b1,b4) if ( abs(b4(1)-vem(2,b1)).gt.1e-3 .or. abs(b4(2)).gt.1e-3 .or 1 . abs(b4(3)).gt.1e-3) THEN WRITE(6,*) 'b1',b1 WRITE(6,*) 'b4',b4 write(6,*) 'rot2' write(6,'(3f12.5)') rot2 write(6,*) 'rot3' write(6,'(3f12.5)') rot3 stop 'something wrong in rot2 or rot3' end if x0 = b4(1) c b2(3) = 0. b2(1) = x0/2 vkapa = POL(3) b2(2) = sqrt( (1+cosd(vkapa))/(1-cosd(vkapa)) ) * b2(1) if (vkapa.lt.0.) b2(2) = - b2(2) c b2 is what you want in x'' system c the mathematics is very simple, isn't it? c c check result call arrps(3,1,b2,b4,b3) ang = acosd( poimult(3,3,b2,b3)/(vem(3,b2)*vem(3,b3)) ) c if (abs(temp).gt.1) WRITE(6,*) temp c ang = asind(temp) if (abs(ang-abs(vkapa)).gt.1e-2) then WRITE(6,*) 'something wrong in seekscrew' WRITE(6,*) 'angle ',ang WRITE(6,*) 'b1 ',b1 WRITE(6,*) 'b2 ',b2 WRITE(6,*) 'b3 ',b3 WRITE(6,*) 'b4 ',b4 end if c now x0 = rot * x' = rot * rot2 * x'' = rot1 * x'' call matmult(3,3,3,3,rot,rot2,rot1) call matmult(3,3,3,1,rot1,b2,xyz0) c to check the result. ds1 = dstpl2(vec,xyz0,t,b1,b4) call arrmc(3,1,t,0.,b3) ds2 = dstpl2(vec,xyz0,b3,b2,b4) df = abs(ds2-ds1) c if (ds1.gt.1e-4) then if (df/ds1.gt.1e-4) + stop 'distance between 0-axis and t to axis is not same' else if (ds2.gt.2e-4) + stop 'distance between 0-axis and t to axis is not same' end if call arrps(3,1,b1,b2,b3) go1 = vem(3,b3) if (abs(abs(go)-go1) .gt. 1e-4) then WRITE(6,*) 'problem in go' WRITE(6,*) 'go ', go WRITE(6,*) 'screw', go1 end if c go is the real screw value along axis end c c SUBROUTINE SQSTLZ(M,P,PS,U,V) C a subroutine to calculate the orientation matrix and the two axes c from a symmetric matrix of an ellipse. by LGG c M(2,2) is the input symmetric matrix of the ellipse. C P(2,2) is one of the two orientation matrices of the ellipse C PS(2,2) is the inverse matrix of the matrix PS(2,2) C U, V are the lengths of the two axes of the ellipse. C DIMENSION M(2,2),P(2,2),PS(2,2) REAL M,P,A,B,C,U,V,X1,X2 10 FORMAT(1X,4F10.3) A=1 B=-(M(1,1)+M(2,2)) C=M(1,1)*M(2,2)-M(2,1)*M(1,2) CALL SQUROOT(A,B,C,X1,X2) U=SQRT(1./X1) V=SQRT(1./X2) P(2,1)=(X1-M(1,1))/M(1,2) P(2,2)=(X2-M(1,1))/M(1,2) S1=SQRT(P(2,1)*P(2,1)+1) S2=SQRT(P(2,2)*P(2,2)+1) P(2,1)=P(2,1)/S1 P(2,2)=P(2,2)/S2 P(1,1)=1./S1 P(1,2)=1./S2 PS(1,2)=P(2,1) PS(2,1)=P(1,2) PS(1,1)=P(1,1) PS(2,2)=P(2,2) RETURN END c c subroutine spacegp(nunit,file,latnam,nsym,nrot,sym,nsp) c In this subroutine the user gives a space group name, the subroutine reads the c ccp4 symmetry library, then it outputs the symmetry operations c Input c nunit --- unit number of library file c file--- symmetry libary file name c latnam --- *14 character of a spacegroup name c Output c nsymm --- Total number of symmetry operations in this spacegroup c nrot ---- only rotation symmetric operation in this spacegroup c symm ---- a 3*4*nsym symmmetric operation c matrix. c nsp --- space group number c in common symdump, if dump is true, dump all the information c maxop is the maximum number of symmetry operations c library format c155 6 2 R32 c X,Y,Z * -Y,X-Y,Z * Y-X,-X,Z c Y,X,-Z * -X,Y-X,-Z * X-Y,-Y,-Z c X+1/3,Y+2/3,Z+2/3 * -Y+1/3,X-Y+2/3,Z+2/3 * Y-X+1/3,-X+2/3,Z+2/3 c Y+1/3,X+2/3,-Z+2/3 * -X+1/3,Y-X+2/3,-Z+2/3 * X-Y+1/3,-Y+2/3,-Z+2/3 c X+2/3,Y+1/3,Z+1/3 * -Y+2/3,X-Y+1/3,Z+1/3 * Y-X+2/3,-X+1/3,Z+1/3 c Y+2/3,X+1/3,-Z+1/3 * -X+2/3,Y-X+1/3,-Z+1/3 * X-Y+2/3,-Y+1/3,-Z+1/3 parameter (maxop=96) character file*80,latnam*14 real sym(3,4,maxop) integer*4 nunit,nsp,nsym,nrot logical*1 dump c COMMON/SYMDUMP/ DUMP c character*80 key,str*40 c... data statements. Separate declaration and init required for f2c data dump /.false./ c c WRITE(6,*) 'nsp',nsp nsym=0 if (nunit.eq.0) nunit=25 if (file(1:1).eq.' ') call spstrunct(file) if (file(1:1).eq.' ') file='SYMOP' call ccpdpn(nunit,file(1:lenstr(file)),'READONLY','F',0,0) 10 read(nunit,'(a)',end=220) key im = lenstr(latnam) in = lenstr(key) is = index(key(1:in),latnam(1:im)) if (is.eq.0) goto 10 c call redstrin(12,i1-1,key,npar) read(key(1:12),*,err=10,end=10) isp,iall,irot c read(key(12:80),'(a)') latnam c if (isp.ne.nsp) goto 10 write(6,*) 'Space Group >>> ',Latnam,isp do i = 1, iall read(nunit,'(a)') key il = lenstr(key) key(il+1:il+1)='*' iend = 0 if (dump) write(6,'(1x,a)') key(1:il) 20 ist = iend+1 iend = index(key(ist:il+1),'*')+IST-1 str = ' ' str(1:iend-ist) = key(ist:iend-1) NSYM=NSYM+1 IF (MATSYM(SYM(1,1,nsym),STR,ICOL).EQ.0) GOTO 502 WRITE(6,*) 'Error in symop after column ',ICOL write(6,*) key write(6,*) str stop 'Check you file SYMOP' 502 continue if (dump) then write(6,'(4f8.4)') ((sym(j1,j2,nsym),j2=1,4),j1=1,3) end if if (iend.lt.il+1) goto 20 if (i.eq.irot) nrot = nsym end do write(6,45) nsym,nrot 45 format(1x,'Symmetric operation ----',6x, 1 'Total: ',i3,6x,'Rotation:',i3) close (unit=nunit) return 210 WRITE(6,*) 'Error opening the SYMOP file ',FILE(1:LENSTR(FILE)) 220 WRITE(6,*) 'Space group',latnam(1:im), + ' was not found in SYMOP file' nsym = 0 nrot = 0 latnam = ' ' STOP 'Check your SYMOP file' END c c SUBROUTINE SPSTRUNCT(STRING) CHARACTER*(*) STRING LENS = LEN(STRING) IL = LENSTR(STRING) C 5 CONTINUE ISP = INDEX(STRING(1:IL),' ') IF (ISP.EQ.0.OR.ISP.GE.IL) RETURN STRING(ISP:IL-1) = STRING(ISP+1:IL) STRING(IL:IL) = ' ' IL = IL - 1 GOTO 5 END c c SUBROUTINE SQUROOT(A,B,C,X1,X2) c Finds roots of a quadratic equation REAL A,B,C,X1,X2 X1=(-B+SQRT(B*B-4*A*C))/(2*A) X2=(-B-SQRT(B*B-4*A*C))/(2*A) RETURN END c c C a subroutine to calculate the statistics of a group of numbers c subroutine statis(n,value,vmean,rms,dmean) c dimension value(n) c n is the number of value in the group c value is the n-dimensional array whose statistics are required. c vmean is the output mean value of the array value(n) c rms is the output r.m.s in value(n) c dmean is the output mean deviation of value(n) subroutine statis(n,value,vmean,rms,dmean) dimension value(n) vmean = 0 do i =1, n vmean = vmean + value(i) end do vmean = vmean/n c rms = 0. dmean = 0. do i =1, n temp = value(i) - vmean dmean = dmean + abs(temp) rms = rms + temp*temp end do rms = sqrt(rms/n) dmean = dmean / n end c c SUBROUTINE LGG_STRING(NUNIT,NCHA,TXT,NPAR,cont) C A subroutine to write a character string to unit NUNIT using c the spaces in the string to split the string into a list of c parameters. c NUNIT is the unit number. c NCHA is the length of the character string. c TXT is the character string. C NPAR is the number of parameters in this string. c cont is a flag which represent if this is a continue string or start c .true. = continue c .false. = start c c CHARACTER*(*) TXT logical*1 cont if (.not.cont) then NPAR = 0 REWIND (NUNIT) end if jcha = 0 if (ncha.gt.0) then if (txt(ncha:ncha).eq.'-') then jcha = 1 txt(ncha:ncha)=' ' end if end if I = 1 10 IF (I.LE.NCHA-jcha) then if (TXT(I:I).NE.' ') THEN J = I 20 CONTINUE IF ((J+1).GT.NCHA) THEN WRITE(NUNIT,'(A)') TXT(I:J) NPAR = NPAR + 1 else if (TXT(J+1:J+1).EQ.' ') then WRITE(NUNIT,'(A)') TXT(I:J) NPAR = NPAR + 1 ELSE J = J + 1 GOTO 20 END IF I = J + 1 GOTO 10 ELSE IF (I.LT.NCHA-jcha) THEN I = I + 1 GOTO 10 END IF endif if (jcha.eq.1) TXT(NCHA:NCHA)='-' C c if (jcha.eq.0) REWIND(NUNIT) C END c c SUBROUTINE SUPIM ( NATM, XYZ1, XYZ2, A, T ) C DIMENSION XYZ1(3,NATM), XYZ2(3,NATM), A(3,3), T(3) C A subroutine to give the superimpose matrix and vector from MOL1 to c MOL2 i.e. XYZ2(3*NATM) = A(3*3) * XYZ1(3*NATM) + T(3) C Where NATM represents the number of the atoms in each molecule c which will be superimposed. c XYZ1(3,NATM) represents the coordinates of MOL1 c XYZ2(3,NATM) represents the coordinates of MOL2 C A(3*3) represents the output matrix. c T(3*3) represents the output vector. c C COMMON/SHIFS/ SCALR,SCALT c DATA SCALR/60./,SCALT/1./ C Note: There should be a scale of the shifts. i.e. Shift= scale * shifts c Here SCALR is the rotation shiftscale c Here SCALT is the translation shiftscale c The initial and suggested SCALR is 60. c The initial and suggested SCALt is 1. C C COMMON/RMS/ RMS,SMEAN,NREF,NREF1 C RMS is the final R.M.S between two molecules. C SMEAN is the mean distance. c NREF is the number of cycles of rotation refinement c NREF1 is not useful c They could be used to judge the SCALR and SCALS c C COMMON/IAT/ IAT1,IAT2,IAT3,IAT C DATA SCALR/60./,IAT/0/ C The routine uses the first three atoms to get the initial Eulerian C angle. IAT1, IAT2 and IAT3 are the indexes of the three selected atoms. c If IAT = 0, these atoms will be selected inside this routine. If not, c the three atoms will be defined outside the routine through the common c block. If the program does not work or you want special atoms, change c IAT1,IAT2,IAT3 in COMMON/IAT/ and set IAT to 0 in order to select c the three atoms in the main routine. c C NATM cannot be larger than NATM0 (currently 50000) or the parameter NATM0 C should be modified in this routine. c c The program use translation linear to least square refinement. Testing c shows that it works quite well. The function of this routine is similar c to SUPOS but the r.m.s. is less and the orientation might be more dangerous. c c c by Guoguang Lu C 27/01/1989 C C COMMON/RMS/ RMS,SMEAN,NREF,NREF1 COMMON/SHIFS/ SCALR,SCALS COMMON/IAT/ IAT1,IAT2,IAT3,IAT c DATA SCALR/60./,SCALS/1./ C DATA IAT/0/,IAT1/1/,IAT2/2/,IAT3/3/ PARAMETER (NATM0 = 50000) c NATM0 is the largest number of atoms. DIMENSION XYZ1(3,NATM), XYZ2(3,NATM), A(3,3), T(3) DIMENSION X1(3,NATM0),X2(3,NATM0),VT(3*6*NATM0),DIS(3*NATM0) DIMENSION CEN1(3),CEN2(3) DIMENSION B1(3),B2(3),B3(3),T0(3) c C Number of atoms cannot be more than NATM0 or less than 3. c IF (NATM.GT.NATM0) THEN WRITE(6,*) 'ERROR> Atom is more than ',NATM0 STOP ELSE IF (NATM.LT.3) THEN STOP 'ERROR> Atom is less than 3.' END IF c Compute the initial matrix. CALL ORIEN(NATM,XYZ1,XYZ2,A) C compute the gravity of mol1 and mol2 to CEN1 and CEN2 CALL AVERG(3,NATM,XYZ1,CEN1) CALL AVERG(3,NATM,XYZ2,CEN2) C T is the initial translation vector CALL ARRPS(3,1,CEN2,CEN1,T0) c Change the origin to CEN1. CALL TMOVE(3,NATM,XYZ1,CEN1,-1.,X1) CALL TMOVE(3,NATM,XYZ2,CEN1,-1.,X2) c C Refine th1, th2, th3, tx, ty and tz c CALL REFRT( NATM, X1, X2, A, T0, VT, DIS) c WRITE(6,*) WRITE(6,*) 'R.M.S.' WRITE(6,*) ' natm' WRITE(6,*) 'SQRT( SIGMA (Distance(i)^2)/natm ) = ',RMS WRITE(6,*) ' i=1' C WRITE(6,*) WRITE(6,*) 'Mean Distance:' WRITE(6,*) ' natm' WRITE(6,*) 'SIGMA (Distance(i)) /natm = ',SMEAN WRITE(6,*) ' i=1' C WRITE(6,'(A)') '0' WRITE(6,'(A)') '0' WRITE(6,*) 'Mol1 is superposed to Mol2.' WRITE(6,*) 'The matrix and the vector are:' WRITE(6,*) WRITE(6,1) (A(1,J),J=1,3),CEN1(1),T0(1) WRITE(6,2) (A(2,J),J=1,3),CEN1(2),T0(2) WRITE(6,1) (A(3,J),J=1,3),CEN1(3),T0(3) 1 FORMAT(1X,' (',3F10.6,' ) ( ',F8.3,' ) (' 1 ,F8.3,' )') 2 FORMAT(1X,' X2 = (',3F10.6,' ) * ( X1 -',F8.3,' ) + (' 1 ,F8.3,' )') C CALL MATMULT(3,3,3,1,A,CEN1,B3) CALL ARRPS(3,1,T0,B3,B3) CALL ARRAD(3,1,CEN1,B3,T) C WRITE(6,'(A)') '0' WRITE(6,'(A)') '0' WRITE(6,*) WRITE(6,4) (A(1,J),J=1,3),T(1) WRITE(6,5) (A(2,J),J=1,3),T(2) WRITE(6,4) (A(3,J),J=1,3),T(3) 4 FORMAT(1X,' (',3F10.6,' ) ( ) (',F8.3,' )') 5 FORMAT(1X,' X2 = (',3F10.6,' ) * ( X1 ) + (',F8.3,' )') C END c c SUBROUTINE SUPRIMP ( NATM, XYZ1, XYZ2, A, T ) C DIMENSION XYZ1(3,NATM), XYZ2(3,NATM), A(3,3), T(3) C A subroutine to give the superimpose matrix and vector from MOL1 to c MOL2 i.e. XYZ2(3*NATM) = A(3*3) * XYZ1(3*NATM) + T(3) C Where NATM represents the number of the atoms in each molecule c which will be superimposed. c XYZ1(3,NATM) represents the coordinates of MOL1 c XYZ2(3,NATM) represents the coordinates of MOL2 C A(3*3) represents the output matrix. c T(3*3) represents the output vector. c C NATM cannot be larger than NATM0 (currently 50000) or the parameter NATM0 C should be modified in this routine. c C COMMON/SHIFS/ SCALR,SCALT c DATA SCALR/1./,SCALT/1./ C Note: There should be a scale of the shifts. i.e. Shift= scale * shifts c Here SCALR is the rotation shiftscale c Here SCALT is the translation shiftscale c The initial and suggested SCALR is 1. c The initial and suggested SCALt is 1. C C COMMON/RMS/ RMS,SMEAN,NREF,NREF1 C RMS is the final R.M.S between two molecules. C SMEAN is the mean distance. c NREF is the number of cycles of rotation refinement c NREF1 is not used by this routine. c They could be used to judge the SCALR and SCALS c C COMMON/IAT/ IAT1,IAT2,IAT3,IAT C DATA SCALR/1./,IAT/0/ C The routine use the first three atoms to get the initial Eulerian C angle. IAT1, IAT2 and IAT3 are the indexes of the three select atoms. c If IAT = 0, these atoms will be selected inside this routine. If not, c the three atoms will be defined outside the routine through the common c block. If the program does not work or you want special atoms, change c IAT1,IAT2,IAT3 in COMMON/IAT/ and set IAT to 0 in order to select c the three atoms in the main routine. Subroutine ORIEN performs this c computation. c c Then the program use the subroutine REFORN to refine the orientation c by vector method. The refinement equation is same with subroutine SUPOS. C c The program use translation linear and Eulerian non-linear least square c refinement to refine both th1,th2,th3 and tx,ty,tz. Testing shows c that it can give very low r.m.s., much less than any other method c in most cases, however it is a little expensive in computer time. c c by Guoguang Lu C 27/01/1989 C COMMON/RMS/ RMS,SMEAN,NREF,NREF1 COMMON/SHIFS/ SCALR,SCALS COMMON/IAT/ IAT1,IAT2,IAT3,IAT c DATA SCALR/1./,SCALS/1./,IAT/0/,IAT1/1/,IAT2/2/,IAT3/3/ PARAMETER (NATM0 = 50000) c NATM0 is the largest number of atoms. DIMENSION XYZ1(3,NATM), XYZ2(3,NATM), A(3,3), T(3) DIMENSION X1(3,NATM0),X2(3,NATM0),VT(3*6*NATM0),DIS(3*NATM0) DIMENSION CEN1(3),CEN2(3) DIMENSION B1(3),B2(3),B3(3),T0(3) c c DEG=180./3.14159265359 c C Number of atoms cannot be more than NATM0 or less than 3. c IF (NATM.GT.50000) THEN WRITE(6,*) 'ERROR> Atom is more than ',NATM0 STOP ELSE IF (NATM.LT.3) THEN STOP 'ERROR> Atom is less than 3.' END IF c Compute the initial matrix. CALL ORIEN(NATM,XYZ1,XYZ2,A) c NREF1 = NREF C C Refine the orientation by vector method. C CALL REFORN ( NATM, XYZ1, XYZ2, A, VT, DIS) C C compute the gravity of mol1 and mol2 to CEN1 and CEN2 CALL AVERG(3,NATM,XYZ1,CEN1) CALL AVERG(3,NATM,XYZ2,CEN2) C T is the initial translation vector CALL ARRPS(3,1,CEN2,CEN1,T0) c Change the origin to CEN1. CALL TMOVE(3,NATM,XYZ1,CEN1,-1.,X1) CALL TMOVE(3,NATM,XYZ2,CEN1,-1.,X2) c C Refine th1, th2, th3, tx, ty and tz c CALL REFRT( NATM, X1, X2, A, T0, VT, DIS) c WRITE(6,*) WRITE(6,*) 'R.M.S.' WRITE(6,*) ' natm' WRITE(6,*) 'SQRT( SIGMA (Distance(i)^2)/natm ) = ',RMS WRITE(6,*) ' i=1' C WRITE(6,*) WRITE(6,*) 'Mean Distance:' WRITE(6,*) ' natm' WRITE(6,*) 'SIGMA (Distance(i)) /natm = ',SMEAN WRITE(6,*) ' i=1' C WRITE(6,*) WRITE(6,*) 'Mol1 is superposed to Mol2.' WRITE(6,*) 'The matrix and the vector are:' WRITE(6,*) WRITE(6,1) (A(1,J),J=1,3),CEN1(1),T0(1) WRITE(6,2) (A(2,J),J=1,3),CEN1(2),T0(2) WRITE(6,1) (A(3,J),J=1,3),CEN1(3),T0(3) 1 FORMAT(1X,' (',3F10.6,' ) ( ',f10.5,' ) (' 1 ,f10.5,' )') 2 FORMAT(1X,' X2 = (',3F10.6,' ) * ( X1 -',f10.5,' ) + (' 1 ,f10.5,' )') C CALL MATMULT(3,3,3,1,A,CEN1,B3) CALL ARRPS(3,1,T0,B3,B3) CALL ARRAD(3,1,CEN1,B3,T) C WRITE(6,*) WRITE(6,*) WRITE(6,4) (A(1,J),J=1,3),T(1) WRITE(6,5) (A(2,J),J=1,3),T(2) WRITE(6,4) (A(3,J),J=1,3),T(3) 4 FORMAT(1X,' (',3F10.6,' ) ( ) (',f10.5,' )') 5 FORMAT(1X,' X2 = (',3F10.6,' ) * ( X1 ) + (',f10.5,' )') C END c c SUBROUTINE SUPRIMPFIN ( NATM, XYZ1, XYZ2, A, T ) C DIMENSION XYZ1(3,NATM), XYZ2(3,NATM), A(3,3), T(3) C A subroutine to give the superimpose matrix and vector from MOL1 to c MOL2 i.e. XYZ2(3*NATM) = A(3*3) * XYZ1(3*NATM) + T(3) C Where NATM represents the number of the atoms in each molecule c which will be superimposed. c XYZ1(3,NATM) represents the coordinates of MOL1 c XYZ2(3,NATM) represents the coordinates of MOL2 C A(3*3) represents the output matrix. c T(3*3) represents the output vector. c C NATM cannot be larger than NATM0 (currently 50000) or the parameter NATM0 C should be modified in this routine. c C COMMON/SHIFS/ SCALR,SCALT c DATA SCALR/1./,SCALT/1./ C Note: There should be a scale of the shifts. i.e. Shift= scale * shifts c Here SCALR is the rotation shiftscale c Here SCALT is the translation shiftscale c The initial and suggested SCALR is 1. c The initial and suggested SCALt is 1. C C COMMON/RMS/ RMS,SMEAN,NREF,NREF1 C RMS is the final R.M.S between two molecules. C SMEAN is the mean distance. c NREF is the number of the cycles of the rotation refinement c NREF1 is not used by this routine. c They could be used to judge the SCALR,and SCALS c C COMMON/IAT/ IAT1,IAT2,IAT3,IAT C DATA SCALR/1./,IAT/0/ C The routine use the first three atoms to get the initial Eulerian C angle. IAT1, IAT2 and IAT3 are the indexes of the three select atoms. c If IAT = 0, these atoms will be selected inside this routine. If not, c the three atoms will be defined outside the routine through the common c block. If the program does not work or you want special atoms, change c IAT1,IAT2,IAT3 in COMMON/IAT/ and give the IAT to 0 in order to select c the three atoms in the main routine. Subroutine ORIEN is to proceed this c computing c c Then the program uses the subroutine REFORN to refine the orientation c by vector method. The refinement equation is same with subroutine SUPOS. C c The program use translation linear and Eulerian non-linear least square c refinement to refine both th1,th2,th3 and tx,ty,tz. Testing shows c that it can give very low r.m.s., much less than any other method c in most cases, however it is a little expensive in computer time. c c by Guoguang Lu C 27/01/1989 C COMMON/RMS/ RMS,SMEAN,NREF,NREF1 COMMON/SHIFS/ SCALR,SCALS COMMON/IAT/ IAT1,IAT2,IAT3,IAT c DATA SCALR/1./,SCALS/1./,IAT/0/,IAT1/1/,IAT2/2/,IAT3/3/ PARAMETER (NATM0 = 50000) c NATM0 is the maximum number of atoms. DIMENSION XYZ1(3,NATM), XYZ2(3,NATM), A(3,3), T(3) DIMENSION X1(3,NATM0),X2(3,NATM0),VT(3*6*NATM0),DIS(3*NATM0) DIMENSION CEN1(3),CEN2(3) DIMENSION B1(3),B2(3),B3(3),T0(3) c c DEG=180./3.14159265359 c C Number of atoms cannot be more than NATM0 or less than 3. c IF (NATM.GT.50000) THEN WRITE(6,*) 'ERROR> Atom is more than ',NATM0 STOP ELSE IF (NATM.LT.3) THEN STOP 'ERROR> Atom is less than 3.' END IF c Compute the initial matrix. CALL ORIEN(NATM,XYZ1,XYZ2,A) c NREF1 = NREF C C Refine the orientation by vector method. cc CALL REFORNFIN ( NATM, XYZ1, XYZ2, A, VT, DIS) NREFORN = NREF C C compute the gravity of mol1 and mol2 to CEN1 and CEN2 CALL AVERG(3,NATM,XYZ1,CEN1) CALL AVERG(3,NATM,XYZ2,CEN2) C T is the initial translation vector CALL ARRPS(3,1,CEN2,CEN1,T0) c Change the origin to CEN1. CALL TMOVE(3,NATM,XYZ1,CEN1,-1.,X1) CALL TMOVE(3,NATM,XYZ2,CEN1,-1.,X2) c C Refine th1, th2, th3, tx, ty and tz c CALL REFRTFIN ( NATM, X1, X2, A, T0, VT, DIS ) NREFRT = NREF1 CALL REFRTFIN1 ( NATM, X1, X2, A, T0, VT, DIS, VT(1+2*6*NATM) ) NREFRT1 = NREF1 c WRITE(6,*) 'Final fit cycle>>>', NREFORN, NREFRT, NREFRT1 WRITE(6,*) WRITE(6,*) 'R.M.S.' WRITE(6,*) ' natm' WRITE(6,*) 'SQRT( SIGMA (Distance(i)^2)/natm ) = ',RMS WRITE(6,*) ' i=1' C WRITE(6,*) WRITE(6,*) 'Mean Distance:' WRITE(6,*) ' natm' WRITE(6,*) 'SIGMA (Distance(i)) /natm = ',SMEAN WRITE(6,*) ' i=1' C WRITE(6,*) WRITE(6,*) 'Mol1 is superposed to Mol2.' WRITE(6,*) 'The matrix and the vector are:' WRITE(6,*) WRITE(6,1) (A(1,J),J=1,3),CEN1(1),T0(1) WRITE(6,2) (A(2,J),J=1,3),CEN1(2),T0(2) WRITE(6,1) (A(3,J),J=1,3),CEN1(3),T0(3) 1 FORMAT(1X,' (',3F10.6,' ) ( ',f10.5,' ) (' 1 ,f10.5,' )') 2 FORMAT(1X,' X2 = (',3F10.6,' ) * ( X1 -',f10.5,' ) + (' 1 ,f10.5,' )') C CALL MATMULT(3,3,3,1,A,CEN1,B3) CALL ARRPS(3,1,T0,B3,B3) CALL ARRAD(3,1,CEN1,B3,T) C WRITE(6,*) WRITE(6,*) WRITE(6,4) (A(1,J),J=1,3),T(1) WRITE(6,5) (A(2,J),J=1,3),T(2) WRITE(6,4) (A(3,J),J=1,3),T(3) 4 FORMAT(1X,' (',3F10.6,' ) ( ) (',f10.5,' )') 5 FORMAT(1X,' X2 = (',3F10.6,' ) * ( X1 ) + (',f10.5,' )') C END c c subroutine lgg_symlib(nunit,file,nsp,nsym,nrot,sym,latnam) c In this subroutine the user gives a space group number, the subroutine reads the c ccp4 symmetry library, then it outputs the symmetry operations c Input c file--- symmetry library file name c nsp --- space group number c Output c nsymm --- Total number of symmetry operations in this spacegroup c nrot ---- only rotation symmetric operations in this spacegroup c symm ---- a 3*4*nsym symmetric operation c matrix. c latnam --- *14 character spacegroup name c in common symdump, if dump is true, dump all the information c maxop is the maximum number of symmetry operations c libary format c155 6 2 R32 c X,Y,Z * -Y,X-Y,Z * Y-X,-X,Z c Y,X,-Z * -X,Y-X,-Z * X-Y,-Y,-Z c X+1/3,Y+2/3,Z+2/3 * -Y+1/3,X-Y+2/3,Z+2/3 * Y-X+1/3,-X+2/3,Z+2/3 c Y+1/3,X+2/3,-Z+2/3 * -X+1/3,Y-X+2/3,-Z+2/3 * X-Y+1/3,-Y+2/3,-Z+2/3 c X+2/3,Y+1/3,Z+1/3 * -Y+2/3,X-Y+1/3,Z+1/3 * Y-X+2/3,-X+1/3,Z+1/3 c Y+2/3,X+1/3,-Z+1/3 * -X+2/3,Y-X+1/3,-Z+1/3 * X-Y+2/3,-Y+1/3,-Z+1/3 parameter (maxop=96) character file*80,latnam*14 real sym(3,4,maxop) integer*4 nunit,nsp,nsym,nrot logical*1 dump c COMMON/SYMDUMP/ DUMP c character*80 key,str*40 c c... data statements. Separate declaration and init required for f2c data dump /.false./ c c WRITE(6,*) 'nsp',nsp nsym=0 if (nunit.eq.0) nunit=25 if (file(1:1).eq.' ') call spstrunct(file) if (file(1:1).eq.' ') file='SYMOP' call ccpdpn(nunit,file(1:lenstr(file)),'READONLY','F',0,0) 10 read(nunit,'(a)',end=220) key c il = lenstr(key) c i1 = index(key(1:il),'PG') c if (i1.eq.0) goto 10 c call redstrin(12,i1-1,key,npar) read(key(1:12),*,err=10,end=10) isp,iall,irot c WRITE(6,*) key(1:lenstr(key)),isp,nsp,latnam if (isp.ne.nsp) goto 10 c i1 = index(key(1:il),'PG') read(key(12:80),'(a)') latnam c call spstrunct(latnam) if (latnam(1:1).eq.' ') latnam(1:13) = latnam(2:14) if (isp.ne.nsp) goto 10 write(6,*) 'Space Group >>> ',Latnam,isp do i = 1, iall read(nunit,'(a)') key il = lenstr(key) key(il+1:il+1)='*' iend = 0 if (dump) write(6,'(1x,a)') key(1:il) 20 ist = iend+1 iend = index(key(ist:il+1),'*')+IST-1 str = ' ' str(1:iend-ist) = key(ist:iend-1) NSYM=NSYM+1 IF (MATSYM(SYM(1,1,nsym),STR,ICOL).EQ.0) GOTO 502 WRITE(6,*) 'Error in symop after colunm ',ICOL write(6,*) key write(6,*) str stop 'Check you file SYMOP' 502 continue if (dump) then write(6,'(4f8.4)') ((sym(j1,j2,nsym),j2=1,4),j1=1,3) end if if (iend.lt.il+1) goto 20 if (i.eq.irot) nrot = nsym end do write(6,45) nsym,nrot 45 format(1x,'Symmetric operation ----',6x, 1 'Total: ',i3,6x,'Rotation:',i3) close (unit=nunit) return 210 WRITE(6,*) 'Error opening the SYMOP file ',FILE(1:LENSTR(FILE)) 220 WRITE(6,*) 'Space group',nsp,' was not found in SYMOP file' nsym = 0 nrot = 0 latnam = ' ' STOP 'Check your SYMOP file' END c c SUBROUTINE TMOVE(M,NATM,XIN,T,CONST,XOUT) C XOUT = XIN + CONST * T C where XIN is input M*NATM-dimensional array. C XOUT N is output M*NATM-dimensional array. c T is a M-dimensional vector. c CONST is a constant. C DIMENSION XIN(M,NATM),XOUT(M,NATM),T(M),B(100) c DIMENSION XIN(M,NATM),XOUT(M,NATM),T(M),B(100) CALL ARRMC(M,1,T,CONST,B) DO I = 1, NATM CALL ARRAD(M,1,XIN(1,I),B,XOUT(1,I)) END DO END c c c------------------------------------------------------------ subroutine up(txt,len) c c convert character string to upper case c character*(*) txt character*80 save character*26 ualpha,lalpha data ualpha /'ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ data lalpha /'abcdefghijklmnopqrstuvwxyz'/ do 9000 i=1,len if((txt(i:i).ge.'a').and.(txt(i:i).le.'z')) then match = index(lalpha,txt(i:i)) save(i:i) = ualpha(match:match) else save(i:i) = txt(i:i) end if c end do 9000 continue txt = save return end c c SUBROUTINE VECCRSMLT(A1,A2,A) DIMENSION A1(3),A2(3),A(3) A(1)=VLDIM2(A1(2),A1(3),A2(2),A2(3)) A(2)=VLDIM2(A1(3),A1(1),A2(3),A2(1)) A(3)=VLDIM2(A1(1),A1(2),A2(1),A2(2)) END c c FUNCTION VEM(N,V) DIMENSION V(N) C=0 DO 10 I=1,N 10 C=C+V(I)*V(I) VEM=SQRT(C) RETURN END c c FUNCTION VLDIM3(AT) C A function to calculate the modulus of a 3*3-dimension matrix. c VLDIM3 = | AT3*3 | dimension at(3,3) dimension B1(3) C call veccrsmlt(at(1,1),at(1,2),b1) vldim3 = poimult(3,3,b1,at(1,3)) end c c FUNCTION VLDIM2(A11,A12,A21,A22) VLDIM2=A11*A22-A21*A12 END c c REAL FUNCTION COSD(ANGINDEG) REAL ANGINDEG COSD = COS(ANGINDEG*3.1415926/180.) END c c REAL FUNCTION SIND(ANGINDEG) REAL ANGINDEG SIND = SIN(ANGINDEG*3.1415926/180.) END c c REAL FUNCTION TAND(ANGINDEG) REAL ANGINDEG TAND = TAN(ANGINDEG*3.1415926/180.) END c c REAL FUNCTION ACOSD(VAL) REAL VAL ACOSD = ACOS(VAL)*180./3.1415926 END c c REAL FUNCTION ASIND(VAL) REAL VAL ASIND = ASIN(VAL)*180./3.1415926 END c c REAL FUNCTION ATAND(VAL) REAL VAL ATAND = ATAN(VAL)*180./3.1415926 END libccp4-8.0.0/fortran/libhtml.f0000644000000000000000000004034614242731033014450 0ustar 00000000000000C C libhtml.f: write HTML tags into program output C Copyright (C) 1998 Kevin Cowtan et al C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C C November 1998 KDC C WROTE IT! C Autumn 1999 SPE, AWA, MDW C New routines ccp4h_init_lib, ccp4h_html_close, ccp4h_summary_beg, C ccp4h_summary_end C C ========= C libhtml.f C ========= C C Link destinations can be of the for "#name" for a link in the same C document. Any other link will be prepended with $CHTML to link to C the documentation area C C The contents of the environment variable $CCP_PROGRAM_ID is concatenated c to the end of each link name. This allows multiple runs of a single C program from a script to be combined in one file without the links C conflicting. C C The environment variable $CCP_SUPPRESS_HTML if set suppresses the output C of most HTML tags. This is useful for devotees of plain text, and C especially for the command input section. C C ccp4h_init_lib(int ihtml, int isumm) - initialise the routines for C writing tags (html and summary) C C ccp4h_init() - write initial comment to identify file C C ccp4h_html_close() - write html close tag C C ccp4h_toc_beg() - write starting Contents section tags C C ccp4h_toc_ent(char*(*) text, char*(*) dest) - write Contents entry C text= the link text C dest= the link destination C C ccp4h_toc_end() - write ending Contents section tags C C ccp4h_graph_beg(x,y) - write starting JLogGraph applet tag C x = width of graph in pixels C y = height of graph in pixels C both can be zero, then they default to 400,300. C C ccp4h_graph_end() - write ending JLogGraph applet tag C C ccp4h_summary_beg() - begin summary section C C ccp4h_summary_end() - end summary section C C ccp4h_pre_beg() - begin preformatted (html
 tag)
C
C   ccp4h_pre_end() - end preformatted (html 
 tag)
C
C   ccp4h_rule() - rule (html 
tag) C C ccp4h_link(char*(*) text, char*(*) dest) - link (html tag) C text= the link text C dest= the link destination C if dest is not an anchor name (i.e. begins with '#'), then C the $CHTML path is prefixed automatically. C C ccp4h_link_key(char*(*) text, char*(*) dest) - link to CCP4 documentation C text= the keyparser keyword C dest= the link destination filename and anchor, C the $CHTML path is prefixed automatically. C Between call memparse(.false.) and the main keyparser processing, C call this routine with any keywords and links which should be C linked to the program doc. Then call parsefail() to restart C syntax checking.... e.g. C call memoparse(.false) C call ccp4h_link_key('LABIN ','fft.html#labin') C call ccp4h_link_key('GRID ','fft.html#grid') C call ccp4h_link_key('FFTSPGRP','fft.html#fftspgrp') C call parsefail() C C ccp4h_header(char*(*) text, char*(*) name, int level) - header C text= the link text C name= header name to link to C level=0-6. Header size. 0= plain text C subroutine ccp4h_init() C ccp4h_init() - write initial comment to identify file integer lpt, htmlinit, summlevel logical html,logsumm,htmlopen,summopen character cbin*160,chtml*160,cpid*160 common /ccp4hdat/lpt,html,logsumm,cbin,chtml,cpid,htmlinit, . htmlopen,summopen, summlevel save /ccp4hdat/ call ccp4h_init_lib(0,0) if (html .and. .not.htmlopen) then call ccp4h_summary_beg() write (lpt,10) 10 format(' ') htmlopen=.true. call ccp4h_rule() call ccp4h_summary_end() endif return end C subroutine ccp4h_init_lib(ihtml,isumm) C ccp4h_init_lib(ihtml,isum) - initialise variables in common block C C Arguments: ihtml = 0 (use default settings for html tags) C -1 (switch off html tags) C isumm = 0 (use default settings for summary tags) C -1 (switch off summary tags) C integer ihtml,isumm,ihtml_level,isumm_level integer lpt, idum, htmlinit, summlevel logical html,logsumm,htmlopen,summopen character cbin*160,chtml*160,cpid*160,dummy*160 external lunsto common /ccp4hdat/lpt,html,logsumm,cbin,chtml,cpid,htmlinit, . htmlopen,summopen, summlevel save /ccp4hdat/ data htmlinit/-1/, htmlopen/.false./ if (htmlinit.lt.0) then lpt=lunsto(idum) cbin = ' ' chtml = ' ' cpid = ' ' dummy = ' ' call ugtenv('CBIN',cbin) call ugtenv('CHTML',chtml) call ugtenv('CCP_PROGRAM_ID',cpid) call ugtenv('CCP_SUPPRESS_HTML',dummy) if (ihtml.lt.0) then html=.false. else html=(dummy.eq.' ') end if call ugtenv('CCP_SUPPRESS_SUMMARY',dummy) if (isumm.lt.0) then logsumm=.false. else logsumm=(dummy.eq.' ') end if ihtml_level=0 if (html) ihtml_level=1 isumm_level=0 if (logsumm) isumm_level=1 call ccp4h_init_clib(ihtml_level,isumm_level) htmlinit=0 summopen=.false. summlevel=0 endif return end C subroutine ccp4h_html_close() C ccp4h_html_close() - write html close tag integer lpt,htmlinit, summlevel logical html,logsumm,htmlopen,summopen character cbin*160,chtml*160,cpid*160 common /ccp4hdat/lpt,html,logsumm,cbin,chtml,cpid,htmlinit, . htmlopen,summopen, summlevel save /ccp4hdat/ if (html) then call ccp4h_summary_beg() write (lpt,10) 10 format('') htmlopen=.false. call ccp4h_summary_end() endif return end C subroutine ccp4h_toc_beg() C ccp4h_toc_beg() - write starting Contents section tags integer lpt,htmlinit, summlevel logical html,logsumm,htmlopen,summopen character cbin*160,chtml*160,cpid*160 common /ccp4hdat/lpt,html,logsumm,cbin,chtml,cpid,htmlinit, . htmlopen,summopen, summlevel save /ccp4hdat/ call ccp4h_header('Contents','toc',2) if (html) write (lpt,10) 10 format('') return end C subroutine ccp4h_graph_beg(x,y) C ccp4h_graph_beg() - write starting JLogGraph applet tag C x = width of graph in pixels C y = height of graph in pixels C both can be zero, then they default to 400,300. integer x,y,x1,y1,lenstr integer lpt, htmlinit, summlevel logical html,logsumm,htmlopen,summopen character cbin*160,chtml*160,cpid*160 common /ccp4hdat/lpt,html,logsumm,cbin,chtml,cpid,htmlinit, . htmlopen,summopen, summlevel save /ccp4hdat/ external lenstr x1=x y1=y if (x1.le.0) x1=400 if (y1.le.0) y1=300 if (html) write (lpt,20)x1,y1,cbin(1:lenstr(cbin)) 20 format( + 'For inline graphs use a Java browser') return end C subroutine ccp4h_summary_beg() C ccp4h_summary_beg() - begin summary section integer lpt, htmlinit, summlevel logical html,logsumm,htmlopen,summopen character cbin*160,chtml*160,cpid*160 common /ccp4hdat/lpt,html,logsumm,cbin,chtml,cpid,htmlinit, . htmlopen,summopen, summlevel save /ccp4hdat/ call ccp4h_init_lib(0,0) C logsumm should be true unless CCP_SUPPRESS_SUMMARY set if (.not.logsumm) return C C if summopen is true then there is already an "unclosed" BEGIN tag C in this case don't write another C keep track of nested level of calls to ccp4h_summary_beg and C ccp4h_summary_end if (summopen) then summlevel = summlevel + 1 return else summlevel = 1 endif if (html) then write (lpt,10) 10 format('') else write (lpt,20) 20 format('') endif C set summopen to indicate there is an "unclosed" BEGIN summopen=.true. return end C subroutine ccp4h_summary_end() C ccp4h_summary_end() - end summary section integer lpt, htmlinit, summlevel logical html,logsumm,htmlopen,summopen character cbin*160,chtml*160,cpid*160 common /ccp4hdat/lpt,html,logsumm,cbin,chtml,cpid,htmlinit, . htmlopen,summopen, summlevel save /ccp4hdat/ if (.not.logsumm) return C if summopen is not true then there is no matching BEGIN tag C in this case don't write an END C keep track of nested level of calls to ccp4h_summary_beg and C ccp4h_summary_end if (.not.summopen) THEN summlevel = 0 return endif if (summlevel .GT. 1) THEN summlevel = summlevel - 1 return endif if (html) then write (lpt,10) 10 format('') else write (lpt,20) 20 format('') endif C set summopen and summlevel to indicate there is no unmatched C BEGIN tag summopen=.false. summlevel = 0 return end C C subroutine ccp4h_pre_beg() C ccp4h_pre_beg() - begin preformatted (html
 tag)
      integer lpt, htmlinit, summlevel
      logical html,logsumm,htmlopen,summopen
      character cbin*160,chtml*160,cpid*160
      common /ccp4hdat/lpt,html,logsumm,cbin,chtml,cpid,htmlinit,
     .                 htmlopen,summopen, summlevel
      save   /ccp4hdat/
      if (html) write (lpt,10)
 10   format('
')
      return
      end
C
      subroutine ccp4h_pre_end()
C   ccp4h_pre_end() - end preformatted (html 
 tag)
      integer lpt, htmlinit, summlevel
      logical html,logsumm,htmlopen,summopen
      character cbin*160,chtml*160,cpid*160
      common /ccp4hdat/lpt,html,logsumm,cbin,chtml,cpid,htmlinit,
     .                 htmlopen,summopen, summlevel
      save   /ccp4hdat/
      if (html) write (lpt,10)
 10   format('
') return end C subroutine ccp4h_rule() C ccp4h_rule() - rule (html
tag) integer lpt, htmlinit, summlevel logical html,logsumm,htmlopen,summopen character cbin*160,chtml*160,cpid*160 common /ccp4hdat/lpt,html,logsumm,cbin,chtml,cpid,htmlinit, . htmlopen,summopen, summlevel save /ccp4hdat/ if (html) then write (lpt,10) 10 format('
') else write (lpt,11) 11 format('-------------------------------------------------------') endif return end C subroutine ccp4h_link(text,dest) C ccp4h_link(char*(*) text, char*(*) dest) - link (html tag) C text= the link text C dest= the link destination character*(*) text,dest integer lpt, htmlinit, summlevel logical html,logsumm,htmlopen,summopen character cbin*160,chtml*160,cpid*160,pn*160 common /ccp4hdat/lpt,html,logsumm,cbin,chtml,cpid,htmlinit, . htmlopen,summopen, summlevel save /ccp4hdat/ integer lenstr external lenstr,ccppnm call ccppnm(pn) if (html) then if (dest(1:1).eq.'#') then write (lpt,10)dest,pn(1:lenstr(pn)),cpid(1:lenstr(cpid)),text 10 format('',a,'') else write (lpt,20)chtml(1:lenstr(chtml)),dest,text 20 format('',a,'') endif else write (lpt,30)text 30 format(a) endif return end C subroutine ccp4h_link_key(key,dest) C ccp4h_link(char*(*) text, char*(*) dest) - link keyword C text= the link text C dest= the link destination character*(*) key,dest integer lpt, htmlinit, summlevel logical html,logsumm,htmlopen,summopen character cbin*160,chtml*160,cpid*160 common /ccp4hdat/lpt,html,logsumm,cbin,chtml,cpid,htmlinit, . htmlopen,summopen, summlevel save /ccp4hdat/ character kw*4,rest*120 logical flag integer lenstr external lenstr flag=.false. kw=key call parsesubkey(kw,' ',flag) if (flag) then call parsekeyarg(kw,rest) if (html) then write(lpt,20) + chtml(1:lenstr(chtml)),dest(1:lenstr(dest)),key, + rest(1:lenstr(rest)) 20 format(' Data line--- ',a,' ',a) else write(lpt,30)key,rest(1:lenstr(rest)) 30 format(' Data line--- ',a,a) endif endif return end C subroutine ccp4h_header(text,name,level) C ccp4h_header(char*(*) text, char*(*) name, int level) - header C text= the link text C name= header name to link to C level=0-6. Header size. 0= plain text character*(*) text,name integer level,lenstr integer lpt, htmlinit, summlevel logical html,logsumm,htmlopen,summopen character cbin*160,chtml*160,cpid*160,pn*160 common /ccp4hdat/lpt,html,logsumm,cbin,chtml,cpid,htmlinit, . htmlopen,summopen, summlevel save /ccp4hdat/ character*60 underline external lenstr,ccppnm call ccppnm(pn) if (html) then if (level.gt.0) then write (lpt,10)name,pn(1:lenstr(pn)),cpid(1:lenstr(cpid)), + level,text,level 10 format(/,'',a,'') else write (lpt,20)name,pn(1:lenstr(pn)),cpid(1:lenstr(cpid)),text 20 format(/,'',a,'') endif else if (level.le.0) then write(lpt,30)text(1:lenstr(text)) 30 format(a) else if (level.eq.1.or.level.eq.2.or.level.eq.3) then underline= + '------------------------------------------------------------' write(lpt,31)text(1:lenstr(text)), + underline(1:min(lenstr(text),60)) 31 format(/,/,a,/,a,/) else write(lpt,32)text(1:lenstr(text)) 32 format(/,a,/) endif endif return end C libccp4-8.0.0/fortran/library_f.c0000644000000000000000000010343714242731033014764 0ustar 00000000000000/* library_f.c: Fortran API to library.c Copyright (C) 2001 CCLRC, Charles Ballard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3, modified in accordance with the provisions of the license to address the requirements of UK law. You should have received a copy of the modified GNU Lesser General Public License along with this library. If not, copies may be downloaded from http://www.ccp4.ac.uk/ccp4license.php This program 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. */ /** @file library_f.c * FORTRAN API for library.c. * Charles Ballard */ /* FORTRAN API for library.c */ /* also include missing routines and wrappers for C commands */ /* */ /* revisions: */ /* (4/5/01) C.Ballard */ /* respond to first steps to make library.c */ /* more "C" like. */ /* (21/8/01) C.Ballard */ /* error catching from library.c */ /* */ /* % Copyright Daresbury Laboratory 1992--2001 */ /* % This is a CCP4 `part (i)' file for the purposes of copyright. */ /* % See the CCP4 distribution conditions for explanation. */ /* */ /* % \documentstyle[a4wide,times,noweb,makeidx]{article} */ /* */ /* % \newcommand{\ac}[1]{{\rm\normalshape\sc #1}} % acronym */ /* */ /* \documentclass{article} */ /* \usepackage{a4wide,times,noweb,makeidx} */ /* \newcommand{\ac}[1]{\textsc{#1}} % acronym */ /* \newcommand{\meta}[1]{\mbox{$\langle$\sl #1\/$\rangle$}} */ /* \newcommand{\ft}{\idx{Fortran}} */ /* \newcommand{\idx}[1]{#1\index{#1}} */ /* \newcommand{\fixme}[1]{\index{Fixme!}[{\bf Fixme!:} #1\@.]} */ /* */ /* \title{FORTRAN wrapper library routines} */ /* \date{$ $Date$ $} */ /* \author{This version: Martyn Winn, Charles Ballard @ Daresbury} */ /* */ /* \makeindex */ /* */ /* \noweboptions{longchunks,smallcode} */ /* */ /* \begin{document} */ /* */ /* \maketitle */ /* */ /* \noindent */ /* This file contains the wrappers for calling library.c from FORTRAN and */ /* some "missing" routines. */ /* \bigskip */ /* */ /* \tableofcontents */ /* */ /* */ /* \section{Summary} */ /* */ /* The following routines are defined: */ /* \bigskip */ /* */ /* \noindent */ /* \begin{tabular}{ll} */ /* */ /* Routine and arguments & Purpose \\ */ /* \hline */ /* [[ustenv(string, result)]] & set an environment variable \\ */ /* [[ccpal1(routine,number,type,length)]] & allocate arrays of type and */ /* & call routine \\ */ /* \end{tabular} */ /* */ /* */ /* \section{Portability and Code} */ /* */ /* System dependent names are handled in the FORTRAN_SUBR, */ /* FORTRAN_FUN, FORTRAN_CALL macros defined in the header file. */ /* fpstr is a typedef which masks the intricacies of FORTRAN string */ /* passing. */ /* */ /* <*>= */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "ccp4_utils.h" #include "ccp4_errno.h" #include "ccp4_fortran.h" #if defined(GFORTRAN) || defined (G95) #include #endif /* rcsid[] = "$Id$" */ /** Creates a null-terminated C string from an input * string obtained from a Fortran call. Trailing blanks are * removed. If input string is blank then return string "\0". * Memory assigned by malloc, so can be freed. * @param str1 pointer to string * @param str1_len Fortran length of string */ char *ccp4_FtoCString(fpstr str1, int str1_len) { char *str2; size_t length = ccp4_utils_flength(FTN_STR(str1),str1_len); str2 = (char *) ccp4_utils_malloc((length+1)*sizeof(char)); if(length) strncpy(str2, FTN_STR(str1), length); str2[length] = '\0'; return str2; } /** Creates a Fortran string from an input C string for passing back to * Fortran call. Characters after null-terminator may be junk, so pad * with spaces. If input cstring is NULL, return blank string. * @param str1 pointer Fortran to string * @param str1_len Fortran length of string * @param cstring input C string */ void ccp4_CtoFString(fpstr str1, int str1_len, const char *cstring) { int i; if (!cstring) { for (i = 0; i < str1_len; ++i) str1[i] = ' '; } else if (str1_len > strlen(cstring)) { strcpy(FTN_STR(str1),cstring); for (i = strlen(cstring); i < str1_len; ++i) str1[i] = ' '; } else { strncpy(FTN_STR(str1),cstring,str1_len); } } /* \section{Miscellaneous routines} */ /* \subsection{{\tt subroutine ustenv(\meta{string}, \meta{result})}} */ /* */ /* This sets an environment variable \meta{var} to \meta{val}, where the */ /* argument \meta{string}[[==']]\meta{var}[['//'='//']]\meta{val}[[']]. */ /* This is for use by the `\idx{logical name}' mechanism for specifying */ /* file connexions. Note that a \idx{VMS} varsion is supplied in {\tt */ /* vms.for} and that there is no standard way of setting and */ /* environment variable. In a minimal \ac{posix} system it might be */ /* necessary to twiddle the environment strings explicitly. */ /* Upon exit result contains [[0]] on Success, [[-1]] on Failure. */ /* */ /* */ /* = */ /* = */ #if ! defined (VMS) FORTRAN_SUBR ( USTENV, ustenv, (fpstr str, int *result, fpstr_size_t str_len), (fpstr str, int *result), (fpstr str, fpstr_size_t str_len, int *result)) { char *temp_name; temp_name = ccp4_FtoCString(FTN_STR(str), FTN_LEN(str)); if ((*result = ccp4_utils_setenv (temp_name)) != 0) ccp4_fatal("USTENV/CCP4_SETENV: Memory allocation failure"); free(temp_name); } #endif FORTRAN_SUBR ( USTIME, ustime, (int *isec), (int *isec), (int *isec)) { *isec = time(NULL); } /* \section{Miscellaneous routines} */ /* \subsection{{\tt outbuf()}} */ /* */ /* This sets stdout to line buffering (error not fatal) */ /* */ /* = */ /* = */ FORTRAN_SUBR ( OUTBUF, outbuf, (), (), ()) { #if defined (__APPLE__) && defined (_CALL_SYSV) char *s = "buffering=disable_preconn"; int s_len = strlen(s); FORTRAN_CALL (SETRTEOPTS,setrteopts,(s,s_len),(s,s_len),(s,s_len)); #endif if(ccp4_utils_outbuf()) ccp4_utils_print("OUTBUF:Can't turn off buffering"); } /* \subsection{{\tt subroutine cunlink (\meta{filename})}} */ /* This unlinks \meta{filename} from the directory. It's intended for */ /* use with scratch files, so that they can be hidden when opened but */ /* still be available as long as they remain connected (see [[CCPOPN]]). */ /* This functionality doesn't seem to exist in \idx{VMS}\@. Failure to */ /* unlink isn't fatal (it's been observed, apparently spuriously). */ /* */ /* = */ FORTRAN_SUBR ( CUNLINK, cunlink, (fpstr filename, fpstr_size_t filename_len), (fpstr filename), (fpstr filename, fpstr_size_t filename_len)) { #ifdef VMS return; /* can't do it */ #else char *temp_name; temp_name = ccp4_FtoCString(FTN_STR(filename), FTN_LEN(filename)); if( unlink(temp_name) ) ccp4_utils_print("CUNLINK: Can't unlink"); free(temp_name); #endif /* VMS */ } /* \section{Dynamic memory allocation} */ /* It's nice to be able to determine array sizes at run time to avoid */ /* messy recompilation. The only way effectively to get dynamic */ /* allocation in Fortran77 reasonably portably is to do the allocation, */ /* e.g.\ in C, and invoke the Fortran routine passed as a parameter with */ /* pointers to the allocated memory which it will treat as arrays. If we */ /* want to allow more than one array, it's more tricky. */ /* */ /* \subsection{{\tt subroutine ccpal1 (\meta{routne}, \meta{n}. */ /* \meta{type}, \meta{length})}} */ /* Arranges to call subroutine \meta{routne} with \meta{n} array */ /* arguments. Each has a type indicated by \meta{type}$(i)$ and a length */ /* given by \meta{length}($i$). \meta{type} is an integer array with */ /* values 1, 2, 3, 4 inidcating {\tt */ /* INTEGER}, {\tt REAL}, {\tt DOUBLE PRECISION} and {\tt COMPLEX} */ /* respectively. */ /* It's not immediately clear what all the Fortran/C */ /* conventions are for passing [[CHARACTER]] arrays, so we'll arrange a */ /* higher-level interface and have [[types]] here just numeric. The */ /* Fortran ([[CCPALC]]) will also do argument validation. Also the rules */ /* for passing external routines as arguments aren't clear---assume */ /* the obvious way. */ /* */ /* There's a \idx{VMS} Fortran version of this, although the code here */ /* does work fine in VMS\@. */ /* */ /* NB: there's a possibility of a hook here to use memory-mapped files on */ /* systems with the capability and insufficient VM\@. */ /* */ /* Under protest, this now allocates zeroed storage for where programs */ /* make bad assumptions. */ /* */ /* = */ #ifndef VMS /* we'll use the Fortran version in VMS*/ FORTRAN_SUBR ( CCPAL1, ccpal1, (void (* routne) (), int *n, int type[], int length[]), (void (* routne) (), int *n, int type[], int length[]), (void (* routne) (), int *n, int type[], int length[])) { static int item_sizes[] = { (int) sizeof (char), /* 0: bytes */ (int) sizeof (short int), /* 1: (integer) half words */ (int) sizeof (float), /* 2: reals/words */ (int) sizeof (int), /* 3: `short complex' (pairs of half words). NB int rather than 2*short since must fit into fortran integer */ (int) 2*sizeof (float), /* 4: complex (pairs of words) */ (int) sizeof (int), /* 5: not used */ (int) sizeof (int) /* 6: integers */ }; int i, size, *leng[13]; void *pointer[13]; for (i=0; i<*n; i++) { switch (type[i]) { case 1: size = item_sizes[6]; break; /* integer */ case 2: size = item_sizes[2]; break; /* real */ case 3: size = 2*item_sizes[2]; break; /* double */ case 4: size = 2*item_sizes[2]; break; /* complex */ case 5: size = item_sizes[1]; break; /* bytes (logical or integer *1) */ } pointer[i+1] = calloc ((size_t) length[i], (size_t) size); if (pointer[i+1] == NULL) ccp4_fatal ("CCPALC: can't allocate memory"); leng[i+1] = &(length[i]); /* convenience */ } switch (*n) { case 1: (* routne) (leng[1], pointer[1]); break; case 2: (* routne) (leng[1], pointer[1], leng[2], pointer[2]); break; case 3: (* routne) (leng[1], pointer[1], leng[2], pointer[2], leng[3], pointer[3]); break; case 4: (* routne) (leng[1], pointer[1], leng[2], pointer[2], leng[3], pointer[3], leng[4], pointer[4]); break; case 5: (* routne) (leng[1], pointer[1], leng[2], pointer[2], leng[3], pointer[3], leng[4], pointer[4], leng[5], pointer[5]); break; case 6: (* routne) (leng[1], pointer[1], leng[2], pointer[2], leng[3], pointer[3], leng[4], pointer[4], leng[5], pointer[5], leng[6], pointer[6]); break; case 7: (* routne) (leng[1], pointer[1], leng[2], pointer[2], leng[3], pointer[3], leng[4], pointer[4], leng[5], pointer[5], leng[6], pointer[6], leng[7], pointer[7]); break; case 8: (* routne) (leng[1], pointer[1], leng[2], pointer[2], leng[3], pointer[3], leng[4], pointer[4], leng[5], pointer[5], leng[6], pointer[6], leng[7], pointer[7], leng[8], pointer[8]); break; case 9: (* routne) (leng[1], pointer[1], leng[2], pointer[2], leng[3], pointer[3], leng[4], pointer[4], leng[5], pointer[5], leng[6], pointer[6], leng[7], pointer[7], leng[8], pointer[8], leng[9], pointer[9]); break; case 10: (* routne) (leng[1], pointer[1], leng[2], pointer[2], leng[3], pointer[3], leng[4], pointer[4], leng[5], pointer[5], leng[6], pointer[6], leng[7], pointer[7], leng[8], pointer[8], leng[9], pointer[9], leng[10], pointer[10]); break; case 11: (* routne) (leng[1], pointer[1], leng[2], pointer[2], leng[3], pointer[3], leng[4], pointer[4], leng[5], pointer[5], leng[6], pointer[6], leng[7], pointer[7], leng[8], pointer[8], leng[9], pointer[9], leng[10], pointer[10], leng[11], pointer[11]); break; case 12: (* routne) (leng[1], pointer[1], leng[2], pointer[2], leng[3], pointer[3], leng[4], pointer[4], leng[5], pointer[5], leng[6], pointer[6], leng[7], pointer[7], leng[8], pointer[8], leng[9], pointer[9], leng[10], pointer[10], leng[11], pointer[11], leng[12], pointer[12]); break; } for (i=0; i<*n; i++) free (pointer[i+1]); } #endif /* VMS */ /* \section{`Magic' numbers} */ /* */ /* When, for instance, an $F$ is unobserved in a derivative, we might */ /* want to give it a special value---a `\idx{magic number}'---possibly in */ /* addition to a special value of the $\sigma$, like a negative one. */ /* Using such a number in a calculation (by mistake, through ignoring the */ /* value of $\sigma$, say) should not allow one to get half-sensible */ /* results as one might if this number was $-9999$ or some such. (There */ /* is non-enforced connexion between the $F$ and its $\sigma$ in the MTZ */ /* file, although one could think of adding extra columns to the file */ /* with bit-encoded flags telling whether the $F$ in a given column was */ /* observed.) */ /* */ /* The obvious tactic with \ac{ieee} arithmetic is to use a \idx{NaN} */ /* value in such situations. Things may be set up so that we either get */ /* an exception on using it in arithmetic or it silently propagates to all */ /* values using it and its presence is indicated by a NaN in the output. */ /* On a \idx{VAX} architecture we can't use NaN, but there is the */ /* possibility of using a */ /* `reserved operand'\index{reserved operand|see{Rop}} */ /* (`\idx{Rop}') value, */ /* which will cause an exception (by experiment: when used for */ /* floating-point arithmetic {\em or\/} printed, but not when assigned). */ /* The \idx{Convex} native mode is similar, except that the Rop may be */ /* printed (in the form {\tt Rop0x}\meta{fraction part}). */ /* */ /* On, say, the \idx{IBM 370 architecture}---which we don't currently */ /* support---anything's a valid floating point number, and the best ploy */ /* is probably to use the largest representable number as the `magic' */ /* value. This would stand a good chance of raising an overflow */ /* exception if used. Anyhow, if such bad use of an undefined value is */ /* made in a program due to insufficient checking by the code, it should */ /* be spotted on the \ac{ieee} systems and the bug fixed---it's not */ /* strictly necessary that it should cause a fatal error on all */ /* architectures. */ /* */ /* We need to provide a means of setting the magic number and checking */ /* whether a given value is such. These are architecture-dependent */ /* bit-level operations, hence their presence in the C code. */ /* */ /* The suite doesn't currently use these routines, but should do soon. */ /* \subsection{Setting a value: {\tt subroutine qnan(value)}} */ /* */ /* [[qnan]] was originally a \ft{} [[real function]] returning the value */ /* (and actually done in 2 stages) with a subroutine implementation like */ /* this called by the \ft{} function to avoid problems under \idx{VMS} */ /* and native \idx{Convex}. However, the \idx{f2c} calling convention */ /* for a function loses in that case since it assumes a [[double]] value */ /* returned which is cast to [[float]] with a SIGFPE, sigh. */ /* */ /* = */ FORTRAN_SUBR ( QNAN, qnan, (union float_uint_uchar *realnum), (union float_uint_uchar *realnum), (union float_uint_uchar *realnum)) { *realnum = ccp4_nan (); } /* \subsection{Testing a value: {\tt int qisnan(\meta{real})}} */ /* */ /* We want a \ft{} logical function [[qisnan]] to test whether its argument */ /* is a \idx{NaN} or \idx{Rop}. We have to do this by writing a C */ /* [[int]]-valued procedure and testing the returned value in the \ft{} */ /* so that we don't have to assume how it represents logical values. The */ /* {\tt diskio}\index{diskio} library module provides the */ /* trivial interface [[QISNAN]]. */ /* */ /* = */ FORTRAN_FUN (int, QISNAN, qisnan, (union float_uint_uchar *realnum), (union float_uint_uchar *realnum), (union float_uint_uchar *realnum)) { return (_BTOLV(ccp4_utils_isnan (realnum))); } /* \subsection{Absent data test for {\tt mtzlib}: {\tt subroutine */ /* ccpbml (\meta{ncols}, \meta{cols})}} */ /* In {\tt mtzlib} there's a fudge for \idx{BIOMOL}-convention absence */ /* flags, which are re-written to zeroes. To do the real number */ /* comparison, though, it's necessary to do a [[qnan]]-type test first. */ /* We don't want to call [[qnan]] (which calls [[cisnan]]) on every */ /* number in the data file, so the tests are amortised in this routine */ /* which deals with a whole array \meta{cols} of length \meta{ncols}. */ /* */ /* = */ FORTRAN_SUBR ( CCPBML, ccpbml, (int *ncols, union float_uint_uchar cols[]), (int *ncols, union float_uint_uchar cols[]), (int *ncols, union float_uint_uchar cols[])) { ccp4_utils_bml (*ncols, cols) ; } /* \subsection{Updating MTZ column ranges: {\tt subroutine ccpwrg */ /* (\meta{ncols}, \meta{rcols}, \meta{wmin}, \meta{wmax})}} */ /* This is a similar fudge to [[ccpbml]] to avoid [[QISNAN]] calls in */ /* updating the MTZ column ranges in {\tt mtzlib}. Note that [[wminmax]] */ /* actually indexes a 3-D Fortran array with the first */ /* dimension range of 2, indicating minimum and maximum values respectively. */ /* */ /* = */ FORTRAN_SUBR ( CCPWRG, ccpwrg, (int *ncols, union float_uint_uchar cols[], float wminmax[]), (int *ncols, union float_uint_uchar cols[], float wminmax[]), (int *ncols, union float_uint_uchar cols[], float wminmax[])) { ccp4_utils_wrg (*ncols, cols, wminmax) ; } /* \subsection{Routines for Data Harvesting: {\tt subroutine hgetlimits}} */ /* Returns largest int and largest float as defined in and */ /* */ FORTRAN_SUBR ( HGETLIMITS, hgetlimits, (int *IValueNotDet, float *ValueNotDet), (int *IValueNotDet, float *ValueNotDet), (int *IValueNotDet, float *ValueNotDet)) { ccp4_utils_hgetlimits (IValueNotDet, ValueNotDet); } /* Wrap-around for mkdir function. Returns 0 if successful, 1 if directory */ /* already exists, and -1 if other error. */ FORTRAN_SUBR ( CMKDIR, cmkdir, (const fpstr path, const fpstr cmode, int *result, fpstr_size_t path_len, fpstr_size_t cmode_len), (const fpstr path, const fpstr cmode, int *result), (const fpstr path, fpstr_size_t path_len, const fpstr cmode, fpstr_size_t cmode_len, int *result)) { char *temp_path, *temp_cmode; temp_path = ccp4_FtoCString(FTN_STR(path), FTN_LEN(path)); temp_cmode = ccp4_FtoCString(FTN_STR(cmode), FTN_LEN(cmode)); *result = ccp4_utils_mkdir (temp_path, temp_cmode); free(temp_path); free(temp_cmode); } /* Wrap-around for mkdir function. Returns 0 if successful, 1 if directory */ /* already exists, and -1 if other error. */ FORTRAN_SUBR ( CCHMOD, cchmod, (const fpstr path, const fpstr cmode, int *result, fpstr_size_t path_len, fpstr_size_t cmode_len), (const fpstr path, const fpstr cmode, int *result), (const fpstr path, fpstr_size_t path_len, const fpstr cmode, fpstr_size_t cmode_len, int *result)) { char *temp_path, *temp_cmode; temp_path = ccp4_FtoCString(FTN_STR(path), FTN_LEN(path)); temp_cmode = ccp4_FtoCString(FTN_STR(cmode), FTN_LEN(cmode)); *result = ccp4_utils_chmod (temp_path, temp_cmode); free(temp_path); free(temp_cmode); } /* isatty doesnt seem to be in Mircrosoft Visual Studdio so this is a fudge */ #if defined (CALL_LIKE_MVS) # if CALL_LIKE_MVS == 1 int __stdcall ISATTY (int *lunit) { return 0; } /* erfc doesnt seem to be in Mircrosoft Visual Studdio so this is a fudge */ float __stdcall ERFC(float *value) { return (float) ccp4_erfc( (double) *value); } #else int isatty_ (int *lunit) { return 0; } float erfc_ (float *value) { return (float) ccp4_erfc( (double) *value); } # endif #endif #if defined(F2C) /* = */ int exit_ (status) int *status; { f_exit (); /* may or may not be registered with exit, depending on the C libraries capabilities, but is idempotent */ exit (*status); } int time_ () { return (int) time (NULL); } int getpid_ () { return (int) getpid (); } /* following are from libI77/fio.h */ #define MXUNIT 100 typedef struct { FILE *ufd; /*0=unconnected*/ char *ufnm; long uinode; int udev; int url; /*0=sequential*/ flag useek; /*true=can backspace, use dir, ...*/ flag ufmt; flag uprnt; flag ublnk; flag uend; flag uwrt; /*last io was write*/ flag uscrtch; } unit; extern unit f__units[]; #define TRUE_ (1) #define FALSE_ (0) #define err(f,m,s) {if(f) errno= m; else f__fatal(m,s); return(m);} /* end of fio.h extract */ int isatty_ (lunit) int *lunit; { if (*lunit>=MXUNIT || *lunit<0) err(1,101,"isatty"); /* f__units is a table of descriptions for the unit numbers (defined in io.h) with file descriptors rather than streams */ return (isatty(fileno((f__units[*lunit]).ufd)) ? TRUE_ : FALSE_); } /* FORTRAN gerror intrinsic */ int gerror_ (str, Lstr) char *str; int Lstr; { int i; if (errno == 0) { /* Avoid `Error 0' or some such message */ for (i=1; Lstr; i++) str[i] = ' '; } else { (void) strncpy (str, strerror (errno), Lstr); for (i = strlen (str); i < Lstr; i++) str[i] = ' '; /* pad with spaces */ } return 0; } /* FORTRAN IErrNo intrinsic */ int ierrno_ () { return errno; } int itime_ (array) int array[3]; { struct tm *lt; time_t tim; tim = time(NULL); lt = localtime(&tim); array[0] = lt->tm_hour; array[1] = lt->tm_min; array[2] = lt->tm_sec; } /* These ought to be intrinsic, but they should only be applied to */ /* [[INTEGER]] arguments. The types [[integer]] and [[logical]] are both */ /* assumed to be [[int]]. */ /* */ /* = */ int /* integer */ ibset_ (a, b) int /* integer */ *a, *b; { return (*a) | 1<<(*b); } int /* integer */ ibclr_ (a, b) int /* integer */ *a, *b; { return (*a) & ~(1<<(*b)); } int /* logical */ btest_ (a, b) int /* integer */ *a, *b; { return ((((unsigned long) *a)>>(*b)))&1 ? TRUE_ : FALSE_; } #endif /* F2C support */ #if defined (__hpux) || defined (_AIX) /* = */ #ifdef _AIX int isatty_ (int *fd) { return(isatty(*fd)); } #endif void gerror (str, Lstr) char *str; int Lstr; { int i; if (errno == 0) { /* Avoid `Error 0' or some such message */ for (i=1; Lstr; i++) str[i] = ' '; } else { (void) strncpy (str, strerror (errno), Lstr); for (i = strlen (str); i < Lstr; i++) str[i] = ' '; /* pad with spaces */ } } /* End of gerror (str, Lstr) */ int ierrno () { return errno; } #endif /* HPUX and AIX support */ #if !( defined(G95) || defined(GFORTRAN) || defined(F2C) || defined(__INTEL_COMPILER) ) && \ ( ( defined(__linux__) && defined(_CALL_SYSV) ) || defined(__APPLE__) ) /* linuxppc xlf and apple xlf support */ void gerror_ (str, Lstr) char *str; int Lstr; { int i; if (errno == 0) { /* Avoid `Error 0' or some such message */ for (i=1; Lstr; i++) str[i] = ' '; } else { (void) strncpy (str, strerror (errno), Lstr); for (i = strlen (str); i < Lstr; i++) str[i] = ' '; /* pad with spaces */ } } /* End of gerror (str, Lstr) */ int isatty_(int *iunit) { return isatty(*iunit); } #endif /* end of linuxppc/apple xlf support */ #if defined (sun) int isatty_(int *iunit) { return isatty(*iunit); } #endif /* neither gfortran or g95 have isatty */ /* not true, since August 05 this has been added to gfortran */ /* G95 support */ #if defined(G95) int isatty_(int *iunit) { return isatty(*iunit); } #endif #if defined(G95) || defined (GFORTRAN) /* FORTRAN gerror intrinsic */ int gerror_(str, Lstr) char *str; int Lstr; { int i; if (errno == 0) { /* Avoid `Error 0' or some such message */ for (i=1; Lstr; i++) str[i] = ' '; } else { (void) strncpy (str, strerror (errno), Lstr); for (i = strlen (str); i < Lstr; i++) str[i] = ' '; /* pad with spaces */ } return 0; } /* FORTRAN IErrNo intrinsic */ int ierrno_() { return errno; } void ltime_(int *stime, int tarray[9]) { int i; struct tm ldatim; time_t t = *stime; #ifdef __MINGW32__ // no localtime_r in MinGW struct tm* lt = localtime(&t); if (lt != NULL) { ldatim = *lt; #else if (localtime_r(&t, &ldatim) != NULL) { #endif tarray[0] = ldatim.tm_sec; tarray[1] = ldatim.tm_min; tarray[2] = ldatim.tm_hour; tarray[3] = ldatim.tm_mday; tarray[4] = ldatim.tm_mon; tarray[5] = ldatim.tm_year; tarray[6] = ldatim.tm_wday; tarray[7] = ldatim.tm_yday; tarray[8] = ldatim.tm_isdst; } else { for (i=0; i<9; i++) tarray[i] = 0; } } void idate_ (int *day, int *month, int *year) { struct tm *lt=NULL; time_t tim; tim = time(NULL); lt = localtime(&tim); *day = lt->tm_mday; *month = lt->tm_mon+1; /* need range 1-12 */ *year = lt->tm_year + 1900; } void gmtime_(int *stime, int gmarray[9]) { int i; struct tm udatim; time_t t = *stime; #ifdef __MINGW32__ // no gmtime_r in MinGW struct tm *p = gmtime(&t); if (p != NULL) { udatim = *p; #else if (gmtime_r(&t, &udatim) != NULL) { #endif gmarray[0] = udatim.tm_sec; gmarray[1] = udatim.tm_min; gmarray[2] = udatim.tm_hour; gmarray[3] = udatim.tm_mday; gmarray[4] = udatim.tm_mon; gmarray[5] = udatim.tm_year; gmarray[6] = udatim.tm_wday; gmarray[7] = udatim.tm_yday; gmarray[8] = udatim.tm_isdst; } else { for (i=0; i<9; i++) gmarray[i] = 0; } } void system_(int *status, char *cmd, int cmd_len) { char *str = calloc( cmd_len+1, sizeof(char)); str = strncpy( str, cmd, cmd_len); if ( (*status = system( str)) == -1 ) printf(" Forked command %s failed\n",cmd); free( str); return; } #endif #if defined (G95) int time_() { int ltim; time_t t_ltim; t_ltim = time(NULL); ltim = (int) t_ltim; return ltim; } #endif /* G95 support */ libccp4-8.0.0/fortran/modlib.f0000644000000000000000000016513014242731033014262 0ustar 00000000000000C C modlib.f: grab-bag of mathematical functions C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C C cross.f dot.f ea06c.f ea08c.f ea09c.f C fa01as.f fa01bs.f fa01cs.f fa01ds.f fm02ad.f C icross.f idot.f iminv3 match.f matmul.f C matmulnm.f matmulgen.f C matvec.f mc04b.f minvn.f minv3.f ranmar.f C scalev.f transp.f unit.f vdif.f vset.f C vsum.f zipin.f zipout.f C C Routines added by pjx (June 2000): C C GMPRD multiply two matrices (general) C MATMUL4 multiply two 4x4 matrices C MATMLN multiply two nxn matrices C DETMAT calculate the determinant of 3x3 matrix C MATVC4 matrix times vector (matrix is 4x4 array, treated as 3x3, C vector is length 3) C ML3MAT multiplies three matrices of any size C INV44 invert 4x4 matrix C MATMLI integer version of 3x3 matrix product MATMUL C MATMULTRANS multiply 3x3 matrix by transpose of another 3x3 matrix C IMATVEC integer version of MATVEC (post-multiply 3x3 matrix with a C vector) C TRANSFRM variant of MATVC4, same except that the input vector is C overwritten by the output vector C C Routines added by mdw (April 2003) C C ZJVX Compute zero of Bessel function of 1st kind Jv(x) C JDVX Compute Bessel functions of 1st kind Jv(x) and their derivatives C JVX Compute Bessel functions of 1st kind Jv(x) C GAMMA Compute gamma function GA(x) C MSTA1 Determine the starting point for backward C recurrence such that the magnitude of C Jn(x) at that point is about 10^(-MP) C MSTA2 Determine the starting point for backward C recurrence such that all Jn(x) has MP C significant digits C C_BEGIN_GMPRD C SUBROUTINE GMPRD(A,B,R,N,M,L) C ============================= C C C---- Ssp general matrix product C C R(N,L) = A(N,M) * B(M,L) C C .. Scalar Arguments .. INTEGER L,M,N C .. C .. Array Arguments .. REAL A(N*M),B(M*L),R(N*L) C .. C .. Local Scalars .. INTEGER I,IB,IK,IR,J,JI,K C .. C C_END_GMPRD C IR = 0 IK = -M DO 30 K = 1,L IK = IK + M DO 20 J = 1,N IR = IR + 1 JI = J - N IB = IK R(IR) = 0.0 DO 10 I = 1,M JI = JI + N IB = IB + 1 R(IR) = A(JI)*B(IB) + R(IR) 10 CONTINUE 20 CONTINUE 30 CONTINUE END C C_BEGIN_MATMUL4 C C ========================= SUBROUTINE MATMUL4(A,B,C) C ========================= C C Multiply two 4x4 matrices, A=B*C C C IMPLICIT NONE C C .. Array Arguments .. REAL A(4,4),B(4,4),C(4,4) C .. C .. Local Scalars .. REAL S INTEGER I,J,K C .. C_END_MATMUL4 C DO 30 I = 1,4 DO 20 J = 1,4 S = 0 DO 10 K = 1,4 S = B(I,K)*C(K,J) + S 10 CONTINUE A(I,J) = S 20 CONTINUE 30 CONTINUE RETURN END C C_BEGIN_MATMLN C subroutine matmln(n,a,b,c) C ========================= C C Multiply two nxn matrices C a = b . c C integer n real a(n,n),b(n,n),c(n,n) integer i,j,k C C_END_MATMLN C do 1 i=1,n do 2 j=1,n a(j,i)=0. do 3 k=1,n a(j,i)= b(j,k)*c(k,i)+a(j,i) 3 continue 2 continue 1 continue return end C C_BEGIN_DETMAT C C =========================== SUBROUTINE DETMAT(RMAT,DET) C ============================ C C---- Calculate determinant DET of 3x3 matrix RMAT C C C .. Scalar Arguments .. REAL DET C .. C .. Array Arguments .. REAL RMAT(3,3) C .. C_END_DETMAT C DET = RMAT(1,1)*RMAT(2,2)*RMAT(3,3) + + RMAT(1,2)*RMAT(2,3)*RMAT(3,1) + + RMAT(1,3)*RMAT(2,1)*RMAT(3,2) - + RMAT(1,3)*RMAT(2,2)*RMAT(3,1) - + RMAT(1,2)*RMAT(2,1)*RMAT(3,3) - + RMAT(1,1)*RMAT(2,3)*RMAT(3,2) C END C C C_BEGIN_MATVC4 C SUBROUTINE MATVC4(A,R,B) C ======================== C C Matrix x Vector C A(3) = R(4x4) . B(3) C REAL A(3), R(4,4), B(3) C REAL AA(4), BB(4) C EXTERNAL GMPRD,VSET C C_END_MATVC4 C CALL VSET(BB,B) BB(4) = 1.0 CALL GMPRD(R,BB,AA,4,4,1) CALL VSET(A,AA) RETURN END C C C_BEGIN_ML3MAT C C 26-Nov-1988 J. W. Pflugrath Cold Spring Harbor Laboratory C Edited to conform to Fortran 77. Renamed from Multiply_3_matrices to C ML3MAT C C ============================================================================== C C! to multiply three matrices C SUBROUTINE ML3MAT C ! input: 1st side of 1st matrix 1 (P C ! input: first matrix 2 ,A C ! input: 2nd side of 1st matrix & 1st side of 2nd matrix 3 ,Q C ! input: second matrix 4 ,B C ! input: 2nd side of 2nd matrix & 1st side of 3rd matrix 5 ,R C ! input: third matrix 6 ,C C ! input: 2nd side of 3rd matrix 7 ,S C ! output: product matrix 8 ,D) C CEE Multiplies three real matrices of any dimensions. It is not optimised C for very large matrices. C Multiply_3_matrices C*** this routine is inefficient! C Multiply_3_matrices Created: 15-NOV-1985 D.J.Thomas, MRC Laboratory of Molecular Biology, C Hills Road, Cambridge, CB2 2QH, England C C ! loop counters INTEGER I,J,K,L C ! loop limits INTEGER P,Q,R,S C ! first input matrix REAL A (1:P,1:Q) C ! second input matrix REAL B (1:Q,1:R) C ! third input matrix REAL C (1:R,1:S) C ! output matrix REAL D (1:P,1:S) C C_END_ML3MAT C DO 100 L = 1, S DO 100 I = 1, P D(I,L) = 0.0 DO 100 K = 1, R DO 100 J = 1, Q C C ! accumulate product matrix D=ABC C 100 D(I,L) = D(I,L) + A(I,J) * B(J,K) * C(K,L) CONTINUE CONTINUE CONTINUE CONTINUE C Multiply_3_matrices RETURN END C C C_BEGIN_INV44 C C ====================== SUBROUTINE INV44(A,AI) C ====================== C C SUBROUTINE TO INVERT 4*4 MATRICES FOR CONVERSION BETWEEN C FRACTIONAL AND ORTHOGONAL AXES C PARAMETERS C C A (I) 4*4 MATRIX TO BE INVERTED C AI (O) INVERSE MATRIX C C SPECIFICATION STATEMENTS C ------------------------ C C C GET COFACTORS OF 'A' IN ARRAY 'C' C --------------------------------- C IMPLICIT NONE C C .. Array Arguments .. REAL A(4,4),AI(4,4) C .. C .. Local Scalars .. REAL AM,D INTEGER I,I1,II,J,J1,JJ C .. C .. Local Arrays .. REAL C(4,4),X(3,3) C .. C C_END_INV44 C DO 40 II = 1,4 DO 30 JJ = 1,4 I = 0 DO 20 I1 = 1,4 IF (I1.EQ.II) GO TO 20 I = I + 1 J = 0 DO 10 J1 = 1,4 IF (J1.EQ.JJ) GO TO 10 J = J + 1 X(I,J) = A(I1,J1) 10 CONTINUE 20 CONTINUE AM = X(1,1)*X(2,2)*X(3,3) - X(1,1)*X(2,3)*X(3,2) + + X(1,2)*X(2,3)*X(3,1) - X(1,2)*X(2,1)*X(3,3) + + X(1,3)*X(2,1)*X(3,2) - X(1,3)*X(2,2)*X(3,1) C(II,JJ) = (-1)** (II+JJ)*AM 30 CONTINUE 40 CONTINUE C C---- calculate determinant C D = 0 DO 50 I = 1,4 D = A(I,1)*C(I,1) + D 50 CONTINUE C C---- get inverse matrix C DO 70 I = 1,4 DO 60 J = 1,4 AI(I,J) = C(J,I)/D 60 CONTINUE 70 CONTINUE RETURN END C C C_BEGIN_MATMLI C SUBROUTINE MATMLI(A,B,C) C ======================== C Integer matrix multiply INTEGER A(3,3),B(3,3),C(3,3),I,J,K C C_END_MATMULI C DO 1 I=1,3 DO 2 J=1,3 A(I,J)=0 DO 3 K=1,3 A(I,J)=A(I,J)+B(I,K)*C(K,J) 3 CONTINUE 2 CONTINUE 1 CONTINUE RETURN END C C C_BEGIN_MATMULTRANS C SUBROUTINE MATMULTrans(A,B,C) C ============================= C C A=B*C(transpose) for 3x3 matrices C IMPLICIT NONE C C ..Array arguments REAL A(3,3),B(3,3),C(3,3) C ..Local arrays REAL CT(3,3) C EXTERNAL MATMUL C C_END_MATMULTRANS C CALL TRANSP(CT,C) CALL MATMUL(A,B,CT) RETURN END C C C_BEGIN_IMATVEC C SUBROUTINE IMATVEC(V,A,B) C ======================== C C---- Post-multiply a 3x3 matrix by a vector C C V=AB C C .. Array Arguments .. INTEGER A(3,3),B(3),V(3) C .. C .. Local Scalars .. INTEGER I,J,S C C_END_IMATVEC C DO 20 I = 1,3 S = 0 C C DO 10 J = 1,3 S = A(I,J)*B(J) + S 10 CONTINUE C C V(I) = S 20 CONTINUE C C END C C C_BEGIN_TRANSFRM C SUBROUTINE TRANSFRM(X,MAT) C ========================== C C Transform vector X(3) by quine matrix MAT(4,4) C Return transformed vector in X. C IMPLICIT NONE C C ..Array arguments.. REAL X(3),MAT(4,4) C ..Local arrays.. REAL TMP(3) C C_END_TRANSFRM C CALL MATVC4(TMP,MAT,X) CALL VSET(X,TMP) RETURN END C C C C_BEGIN_CROSS C SUBROUTINE CROSS(A,B,C) C ======================= C C compute vector product A = B x C C C .. Array Arguments .. REAL A(3),B(3),C(3) C C_END_CROSS C .. A(1) = B(2)*C(3) - C(2)*B(3) A(2) = B(3)*C(1) - C(3)*B(1) A(3) = B(1)*C(2) - C(1)*B(2) END C C C_BEGIN_DOT C REAL FUNCTION DOT(A,B) C ====================== C C dot product of two vectors C C .. Array Arguments .. REAL A(3),B(3) C C_END_DOT C .. DOT = A(1)*B(1) + A(2)*B(2) + A(3)*B(3) END C C ****************************************************************** SUBROUTINE EIGEN_RS_ASC(A, R, N, MV) C ****************************************************************** C C---- SUBROUTINE TO COMPUTE EIGENVALUES & EIGENVECTORS OF A REAL C---- SYMMETRIC MATRIX, FROM IBM SSP MANUAL (SEE P165). C---- DESCRIPTION OF PARAMETERS - C---- A - ORIGINAL MATRIX STORED COLUMNWISE AS UPPER TRIANGLE ONLY, C---- I.E. "STORAGE MODE" = 1. EIGENVALUES ARE WRITTEN INTO DIAGONAL C---- ELEMENTS OF A I.E. A(1) A(3) A(6) FOR A 3*3 MATRIX. C---- R - RESULTANT MATRIX OF EIGENVECTORS STORED COLUMNWISE IN SAME C---- ORDER AS EIGENVALUES. C---- N - ORDER OF MATRICES A & R. C---- MV = 0 TO COMPUTE EIGENVALUES & EIGENVECTORS. C C c IMPLICIT NONE INTEGER NMAX PARAMETER (NMAX=10) REAL A(*), R(*) INTEGER N, MV C INTEGER IQ, J, I, IJ, IA, IND, L, M, MQ, LQ, LM, LL, MM INTEGER ILQ, IMQ, IM, IL, ILR, IMR REAL ANORM, ANRMX, RANGE, THR, X, Y, SINX, SINX2, & COSX, COSX2, SINCS C Lapack variables LOGICAL LAPACK CHARACTER*1 JOBZ, LAPRANGE, UPLO INTEGER INFO, NVECTORS REAL ABSTOL INTEGER ISUPPZ(2*NMAX), IWORK(10*NMAX) REAL WORK(26*NMAX),EVALUES(NMAX),AM(NMAX,NMAX) C C-- FOR REAL C DATA RANGE/1D-12/ DATA RANGE/1E-6/ C Alternative lapack routine - only marginally tested LAPACK = .FALSE. IF (LAPACK) THEN NVECTORS = 0 IF (N.GT.NMAX) + CALL CCPERR(1,'s/r EIGEN_RS_ASC: redimension NMAX!') IF (MV.EQ.0) JOBZ = 'V' LAPRANGE = 'A' UPLO = 'U' ABSTOL = 0.0 IA = 0 DO I = 1,N DO J = 1,I IA = IA + 1 AM(J,I) = A(IA) ENDDO ENDDO C CALL SSYEVR(JOBZ, LAPRANGE, UPLO, N, AM, N, C + 1, N, 1, N, ABSTOL, NVECTORS, EVALUES, R, C + N, ISUPPZ, WORK, 26*N, IWORK, 10*N, INFO) IA = 0 DO I = 1,NVECTORS DO J = 1,I IA = IA + 1 IF (J.EQ.I) A(IA) = EVALUES(I) ENDDO ENDDO RETURN ENDIF IF (MV.EQ.0) THEN IQ=-N DO J=1,N IQ=IQ+N DO I=1,N IJ=IQ+I IF (I.EQ.J) THEN R(IJ)=1. ELSE R(IJ)=0. ENDIF ENDDO ENDDO ENDIF C C---- INITIAL AND FINAL NORMS (ANORM & ANRMX) IA=0 ANORM=0. DO I=1,N DO J=1,I IA=IA+1 IF (J.NE.I) ANORM=ANORM+A(IA)**2 ENDDO ENDDO C IF (ANORM.LE.0.) GOTO 165 ANORM=SQRT(2.*ANORM) ANRMX=ANORM*RANGE/N C C---- INITIALIZE INDICATORS AND COMPUTE THRESHOLD IND=0 THR=ANORM 45 THR=THR/N 50 L=1 55 LQ=L*(L-1)/2 LL=L+LQ M=L+1 ILQ=N*(L-1) C C---- COMPUTE SIN & COS 60 MQ=M*(M-1)/2 LM=L+MQ IF (A(LM)*A(LM)-THR.LT.0.) GOTO 130 IND=1 MM=M+MQ X=.5*(A(LL)-A(MM)) Y=-A(LM)/SQRT(A(LM)**2+X*X) C---- Protect against rounding error. C. Flensburg 20080307. IF (ABS(Y).GT.1.0) Y=SIGN(1.0,Y) IF (X.LT.0.) Y=-Y SINX=Y/SQRT(2.*(1.+(SQRT(1.-Y*Y)))) SINX2=SINX**2 COSX=SQRT(1.-SINX2) COSX2=COSX**2 SINCS=SINX*COSX C C---- ROTATE L & M COLUMNS IMQ=N*(M-1) DO 125 I=1,N IQ=I*(I-1)/2 IF (I.NE.L .AND. I.NE.M) THEN IF (I.LT.M) THEN IM=I+MQ ELSE IM=M+IQ ENDIF IF (I.LT.L) THEN IL=I+LQ ELSE IL=L+IQ ENDIF X=A(IL)*COSX-A(IM)*SINX A(IM)=A(IL)*SINX+A(IM)*COSX A(IL)=X ENDIF IF (MV.EQ.0) THEN ILR=ILQ+I IMR=IMQ+I X=R(ILR)*COSX-R(IMR)*SINX R(IMR)=R(ILR)*SINX+R(IMR)*COSX R(ILR)=X ENDIF 125 CONTINUE C X=2.*A(LM)*SINCS Y=A(LL)*COSX2+A(MM)*SINX2-X X=A(LL)*SINX2+A(MM)*COSX2+X A(LM)=(A(LL)-A(MM))*SINCS+A(LM)*(COSX2-SINX2) A(LL)=Y A(MM)=X C C---- TESTS FOR COMPLETION C---- TEST FOR M = LAST COLUMN 130 IF (M.NE.N) THEN M=M+1 GOTO 60 ENDIF C C---- TEST FOR L =PENULTIMATE COLUMN IF (L.NE.N-1) THEN L=L+1 GOTO55 ENDIF IF (IND.EQ.1) THEN IND=0 GOTO50 ENDIF C C---- COMPARE THRESHOLD WITH FINAL NORM IF (THR.GT.ANRMX) GOTO 45 165 RETURN END C C The routines ea06c, ea08c, ea09c, fa01as, fa01bs, fa01cs, fa01ds, C fm02ad, mc04b, (and possibly others) are from the C Harwell Subroutine library. The conditions on their external use, C reproduced from the Harwell manual are: C * due acknowledgement is made of the use of subroutines in any C research publications resulting from their use. C * the subroutines may be modified for use in research applications C by external users. The nature of such modifiactions should be C indicated in writing for information to the liaison officer. At C no time however, shall the subroutines or modifications thereof C become the property of the external user. C The liaison officer for the library's external affairs is listed C as: Mr. S. Marlow, Building 8.9, Harwell Laboratory, Didcot, C Oxon OX11 0RA, UK. C C_BEGIN_EA06C C SUBROUTINE EA06C(A,VALUE,VECTOR,M,IA,IV,W) C ========================================== C C** 18/03/70 LAST LIBRARY UPDATE C C ( Calls EA08C(W,W(M1),VALUE,VECTOR,M,IV,W(M+M1)) C and MC04B(A,W,W(M1),M,IA,W(M+M1)) ) C C Given a real MxM symmetric matrix A = {aij} this routine C finds all its eigenvalues (lambda)i i=1,2,.....,m and C eigenvectors xj i=1,2,...,m. i.e. finds the non-trivial C solutions of Ax=(lambda)x C C The matrix is reduced to tri-diagonal form by applying C Householder transformations. The eigenvalue problem for C the reduced problem is then solved using the QR algorithm C by calling EA08C. C C Argument list C ------------- C C IA (I) (integer) should be set to the first dimension C of the array A, i.e. if the allocation C for the array A was specified by C DIMENSION A(100,50) C then IA would be set to 100 C C M (I) (integer) should be set to the order m of the matrix C C IV (I) (integer) should be set to the first dimension C of the 2-dimensional array VECTOR C C VECTOR(IV,M) (O) (real) 2-dimensional array, with first dimension IV, C containing the eigenvectors. The components C of the eigenvector vector(i) corresponding C to the eigenvalue (lambda)i (in VALUE(I)) C are placed in VECTOR(J,I) J=1,2,...,M. C The eigenvectors are normalized so that C xT(i)x(i)=1 i=1,2,...,m. C C VALUE(M) (O) (real) array in which the routine puts C the eigenvalues (lambda)i, i=1,2,...,m. C These are not necessarily in any order. C C W (I) (real(*)) working array used by the routine for C work space. The dimension must be set C to at least 5*M. C C_END_EA06C C C C .. Scalar Arguments .. INTEGER IA,IV,M C .. C .. Array Arguments .. REAL A(IA,M),VALUE(M),VECTOR(IV,M),W(*) C .. C .. Local Scalars .. REAL PP INTEGER I,I1,II,K,L,M1 C .. C .. External Subroutines .. EXTERNAL EA08C,MC04B C .. M1 = M + 1 W(1) = A(1,1) IF (M-2) 30,10,20 10 W(2) = A(2,2) W(4) = A(2,1) GO TO 30 20 CALL MC04B(A,W,W(M1),M,IA,W(M+M1)) 30 CALL EA08C(W,W(M1),VALUE,VECTOR,M,IV,W(M+M1)) IF (M.GT.2) THEN DO 70 L = 1,M DO 60 II = 3,M I = M - II + 1 IF (W(M1+I).NE.0) THEN PP = 0.0 I1 = I + 1 DO 40 K = I1,M PP = A(I,K)*VECTOR(K,L) + PP 40 CONTINUE PP = PP/ (A(I,I+1)*W(M1+I)) DO 50 K = I1,M VECTOR(K,L) = A(I,K)*PP + VECTOR(K,L) 50 CONTINUE END IF 60 CONTINUE 70 CONTINUE END IF END C C_BEGIN_EA08C C SUBROUTINE EA08C(A,B,VALUE,VEC,M,IV,W) C ===================================== C C (Calls EA09C(A,B,W(M+1),M,W)) C C This uses QR iteration to find the all the eigenvalues and C eigenvectors of the real symmetric tri-diagonal matrix C whose diagonal elements are A(i), i=1,M and off-diagonal C elements are B(i),i=2,M. The eigenvalues will have unit C length. The array W is used for workspace and must have C dimension at least 2*M. We treat VEC as if it had C dimensions (IV,M). C C First EA09, which uses the QR algorithm, is used to find C the eigenvalues; using these as shifts the QR algorithm is C again applied but now using the plane rotations to generate C the eigenvectors. Finally the eigenvalues are refined C by taking Rayleigh quotients of the vectors. C C Argument list C ------------- C C A(M) (I) (real) Diagonal elements C C B(M) (I) (real) Off-diagonal elements C C IV (I) (integer) should be set to the first dimen- C sion of the 2-dimensional array VEC C C M (I) (integer) should be set to the order m of the C matrix C C VALUE(M) (O) (real) Eigenvalues C C VEC (O) (real) Eigenvectors. The dimensions C should be set to (IV,M). C C W(*) (I) (real) Working array.The dimension must be C set to at least 2*M. C C_END_EA08C C C .. Scalar Arguments .. INTEGER IV,M C .. C .. Array Arguments .. REAL A(M),B(M),VALUE(M),VEC(1),W(*) C .. C .. Local Scalars .. REAL A11,A12,A13,A21,A22,A23,A33,A34,CO,EPS,ROOT,S,SI, + V1,V2,XAX,XX INTEGER I,II,ITER,J,J1,J2,JI,JK,K,L,N1,N2,N2M1 C .. C .. External Subroutines .. EXTERNAL EA09C C .. C .. Intrinsic Functions .. INTRINSIC ABS,MIN,SIGN,SQRT C .. C .. Data statements .. DATA EPS/1.0E-5/,A34/0.0/ C .. C C CALL EA09C(A,B,W(M+1),M,W) C C---- Set vec to the identity matrix. C DO 20 I = 1,M VALUE(I) = A(I) W(I) = B(I) K = (I-1)*IV + 1 L = K + M - 1 DO 10 J = K,L VEC(J) = 0.0 10 CONTINUE VEC(K+I-1) = 1.0 20 CONTINUE ITER = 0 IF (M.NE.1) THEN N2 = M 30 CONTINUE C C---- Each qr iteration is performed of rows and columns n1 to n2 C DO 40 II = 2,N2 N1 = 2 + N2 - II IF (ABS(W(N1)).LE. (ABS(VALUE(N1-1))+ABS(VALUE(N1)))* + EPS) GO TO 50 40 CONTINUE N1 = 1 50 IF (N2.NE.N1) THEN ROOT = W(M+N2) ITER = ITER + 1 N2M1 = N2 - 1 A22 = VALUE(N1) A12 = A22 - ROOT A23 = W(N1+1) A13 = A23 DO 70 I = N1,N2M1 A33 = VALUE(I+1) IF (I.NE.N2M1) A34 = W(I+2) S = SIGN(SQRT(A12*A12+A13*A13),A12) SI = A13/S CO = A12/S JK = I*IV + 1 J1 = JK - IV J2 = MIN(M,I+ITER) + J1 - 1 DO 60 JI = J1,J2 V1 = VEC(JI) V2 = VEC(JK) VEC(JI) = V1*CO + V2*SI VEC(JK) = V2*CO - V1*SI JK = JK + 1 60 CONTINUE IF (I.NE.N1) W(I) = S A11 = CO*A22 + SI*A23 A12 = CO*A23 + SI*A33 A13 = SI*A34 A21 = CO*A23 - SI*A22 A22 = CO*A33 - SI*A23 A23 = CO*A34 VALUE(I) = A11*CO + A12*SI A12 = -A11*SI + A12*CO W(I+1) = A12 A22 = A22*CO - A21*SI 70 CONTINUE VALUE(N2) = A22 GO TO 30 ELSE N2 = N2 - 1 IF (N2-1.GT.0) GO TO 30 END IF C C---- Rayleigh quotient C DO 90 J = 1,M K = (J-1)*IV XX = VEC(K+1)**2 XAX = A(1)*XX DO 80 I = 2,M XX = VEC(K+I)**2 + XX XAX = (B(I)*2.0*VEC(K+I-1)+VEC(K+I)*A(I))*VEC(K+I) + + XAX 80 CONTINUE VALUE(J) = XAX/XX 90 CONTINUE END IF END C C SUBROUTINE EA09C(A,B,VALUE,M,OFF) C ================================= C C 18/03/70 LAST LIBRARY UPDATE C C .. Scalar Arguments .. INTEGER M C .. C .. Array Arguments .. REAL A(M),B(M),OFF(M),VALUE(M) C .. C .. Local Scalars .. REAL A11,A12,A13,A21,A22,A23,A33,A34,BB,CC,CO,EPS, + ROOT,S,SBB,SI INTEGER I,II,N1,N2,N2M1 C .. C .. Intrinsic Functions .. INTRINSIC ABS,SQRT C .. C .. Data statements .. DATA A34/0.0/,EPS/0.6E-7/ C .. C C VALUE(1) = A(1) IF (M.NE.1) THEN DO 10 I = 2,M VALUE(I) = A(I) OFF(I) = B(I) 10 CONTINUE C C---- Each qr iteration is performed of rows and columns n1 to n2 C N2 = M 20 CONTINUE IF (N2.GT.1) THEN DO 30 II = 2,N2 N1 = 2 + N2 - II IF (ABS(OFF(N1)).LE. (ABS(VALUE(N1-1))+ + ABS(VALUE(N1)))*EPS) GO TO 40 30 CONTINUE N1 = 1 40 IF (N2.NE.N1) THEN C C---- Root is the eigenvalue of the bottom 2*2 matrix that is nearest C to the last matrix element and is used to accelerate the C convergence C BB = (VALUE(N2)-VALUE(N2-1))*0.5 CC = OFF(N2)*OFF(N2) SBB = 1.0 IF (BB.LT.0.0) SBB = -1.0 ROOT = CC/ (SQRT(BB*BB+CC)*SBB+BB) + VALUE(N2) N2M1 = N2 - 1 A22 = VALUE(N1) A12 = A22 - ROOT A23 = OFF(N1+1) A13 = A23 DO 50 I = N1,N2M1 A33 = VALUE(I+1) IF (I.NE.N2M1) A34 = OFF(I+2) S = SQRT(A12*A12+A13*A13) SI = A13/S CO = A12/S IF (I.NE.N1) OFF(I) = S A11 = CO*A22 + SI*A23 A12 = CO*A23 + SI*A33 A13 = SI*A34 A21 = CO*A23 - SI*A22 A22 = CO*A33 - SI*A23 A23 = CO*A34 VALUE(I) = A11*CO + A12*SI A12 = -A11*SI + A12*CO OFF(I+1) = A12 A22 = A22*CO - A21*SI 50 CONTINUE VALUE(N2) = A22 ELSE N2 = N2 - 1 END IF GO TO 20 END IF END IF END C C C---- Changes put in to make it work on vax (this version has scaling) C 1. 12 statements for calculation of over/underflow of determinant in ma21 C replaced by a simple one which will overflow more easily(entry ma21cd) C 2. changes to mc10ad to replace 370-specific parts.... C a. u=floati (6 times) C b. new alog16 procedure (twice) C c. simpler 16**diag statement (once) C 3. all double precision replaced by real*8 (not really necessary). C 4. replace a(n),b(n) by a(1),b(1) in fm02ad to avoid vax array checking. C FUNCTION FA01AS(I) C ================== DOUBLE PRECISION G, FA01AS INTEGER I COMMON/FA01ES/G G= 1431655765.D0 C C G=DMOD(G* 9228907.D0,4294967296.D0) IF(I.GE.0)FA01AS=G/4294967296.D0 IF(I.LT.0)FA01AS=2.D0*G/4294967296.D0-1.D0 RETURN END C SUBROUTINE FA01BS(MAX,NRAND) C ============================ C INTEGER NRAND, MAX DOUBLE PRECISION FA01AS EXTERNAL FA01AS NRAND=INT(FA01AS(1)*FLOAT(MAX))+1 RETURN END C SUBROUTINE FA01CS(IL,IR) C ======================== C DOUBLE PRECISION G INTEGER IL,IR COMMON/FA01ES/G G= 1431655765.D0 C IL=G/65536.D0 IR=G-65536.D0*FLOAT(IL) RETURN END C SUBROUTINE FA01DS(IL,IR) C ======================== C DOUBLE PRECISION G INTEGER IL,IR COMMON/FA01ES/G G= 1431655765.D0 C G=65536.D0*FLOAT(IL)+FLOAT(IR) RETURN END C C_BEGIN_FM02AD C DOUBLE PRECISION FUNCTION FM02AD(N,A,IA,B,IB) C ============================================= C C Compute the inner product of two double precision real C vectors accumulating the result double precision, when the C elements of each vector are stored at some fixed displacement C from neighbouring elements. Given vectors A={a(j)}, C B={b(j)} of length N, evaluates w=a(j)b(j) summed over C j=1..N. Can be used to evaluate inner products involving C rows of multi-dimensional arrays. C It can be used as an alternative to the assembler version, C but note that it is likely to be significantly slower in execution. C C Argument list C ------------- C C N (I) (integer) The length of the vectors (if N <= 0 FM02AD = 0) C C A (I) (double precision) The first vector C C IA (I) (integer) Subscript displacement between elements of A C C B (I) (double precision) The second vector C C IB (I) (integer) Subscript displacement between elements of B C C FM02AD the result C C C_END_FM02AD C DOUBLE PRECISION R1,A,B C C---- The following statement changed from a(n),b(n) to avoid vax dynamic C array check failure. C DIMENSION A(1),B(1) INTEGER N,JA,IA,JB,IB,I C R1=0D0 IF(N.LE.0) GO TO 2 JA=1 IF(IA.LT.0) JA=1-(N-1)*IA JB=1 IF(IB.LT.0) JB=1-(N-1)*IB I=0 1 I=I+1 R1=R1+A(JA)*B(JB) JA=JA+IA JB=JB+IB IF(I.LT.N) GO TO 1 2 FM02AD=R1 RETURN C END C C C_BEGIN_ICROSS C SUBROUTINE ICROSS(A,B,C) C ======================== C C Cross product (integer version) C C A = B x C C C .. Array Arguments .. INTEGER A(3),B(3),C(3) C C_END_ICROSS C .. A(1) = B(2)*C(3) - C(2)*B(3) A(2) = B(3)*C(1) - C(3)*B(1) A(3) = B(1)*C(2) - C(1)*B(2) END C C C_BEGIN_IDOT C INTEGER FUNCTION IDOT(A,B) C ========================== C C Dot product (integer version) C C IDOT = A . B C C .. Array Arguments .. INTEGER A(3),B(3) C C_END_IDOT C .. IDOT = A(1)*B(1) + A(2)*B(2) + A(3)*B(3) END C C C_BEGIN_IMINV3 C SUBROUTINE IMINV3(A,B,D) C ======================= C C Invert a general 3x3 matrix and return determinant in D C (integer version) C C A = (B)-1 C C .. Scalar Arguments .. INTEGER D C .. C .. Array Arguments .. INTEGER A(3,3),B(3,3) C C_END_IMINV3 C .. C .. Local Scalars .. INTEGER I,J C .. C .. Local Arrays .. INTEGER C(3,3) C .. C .. External Functions .. INTEGER IDOT EXTERNAL IDOT C .. C .. External Subroutines .. EXTERNAL ICROSS C .. C .. Intrinsic Functions .. INTRINSIC ABS C .. CALL ICROSS(C(1,1),B(1,2),B(1,3)) CALL ICROSS(C(1,2),B(1,3),B(1,1)) CALL ICROSS(C(1,3),B(1,1),B(1,2)) D = IDOT(B(1,1),C(1,1)) C C---- Test determinant C IF (ABS(D).GT.0) THEN C C---- Determinant is non-zero C DO 20 I = 1,3 DO 10 J = 1,3 A(I,J) = C(J,I)/D 10 CONTINUE 20 CONTINUE ELSE D = 0 END IF END C C C_BEGIN_MATMUL C SUBROUTINE MATMUL(A,B,C) C ======================== C C Multiply two 3x3 matrices C C A = BC C C .. Array Arguments .. REAL A(3,3),B(3,3),C(3,3) C C_END_MATMUL C .. C .. Local Scalars .. INTEGER I,J,K C .. DO 30 I = 1,3 DO 20 J = 1,3 A(I,J) = 0.0 DO 10 K = 1,3 A(I,J) = B(I,K)*C(K,J) + A(I,J) 10 CONTINUE 20 CONTINUE 30 CONTINUE END C C C_BEGIN_MATMULNM C SUBROUTINE MATMULNM(N,M,A,B,C) C ======================== C C Multiply NxM MXN matrices C C A = BC C C .. Array Arguments .. INTEGER N,M REAL A(N,N),B(N,M),C(M,N) C C_END_MATMUL C .. C .. Local Scalars .. INTEGER I,J,K C .. DO 30 I = 1,N DO 20 J = 1,N A(I,J) = 0.0 DO 10 K = 1,M A(I,J) = B(I,K)*C(K,J) + A(I,J) 10 CONTINUE 20 CONTINUE 30 CONTINUE END C C C_BEGIN_MATVEC C SUBROUTINE MATVEC(V,A,B) C ======================== C C Post-multiply a 3x3 matrix by a vector C C V = AB C C .. Array Arguments .. REAL A(3,3),B(3),V(3) C C_END_MATVEC C .. C .. Local Scalars .. REAL S INTEGER I,J C .. DO 20 I = 1,3 S = 0 DO 10 J = 1,3 S = A(I,J)*B(J) + S 10 CONTINUE V(I) = S 20 CONTINUE END C C C_BEGIN_MATMULGEN C SUBROUTINE MATMULGEN(Nb,Mbc,Nc,A,B,C) C ===================================== C C Generalised matrix multiplication subroutine C Multiplies a NbxMbc matrix (B) by a MbcXNc C (C) matrix, so that C C A = BC C IMPLICIT NONE C .. C .. Scalar Arguments .. INTEGER Nb,Mbc,Nc C .. C .. Array Arguments .. REAL A(Nb,Nc),B(Nb,Mbc),C(Mbc,Nc) C C_END_MATMULGEN C .. C .. Local Scalars .. INTEGER I,J,K C .. DO 30 J = 1,Nc DO 20 I = 1,Nb A(I,J) = 0.0 DO 10 K = 1,Mbc A(I,J) = B(I,K)*C(K,J) + A(I,J) 10 CONTINUE 20 CONTINUE 30 CONTINUE END C C C_BEGIN_MC04B C SUBROUTINE MC04B(A,ALPHA,BETA,M,IA,Q) C ===================================== C C Transforms a real symmetric matrix A={a(i,j)}, i, j=1..IA C into a tri-diagonal matrix having the same eigenvalues as A C using Householder's method. C C .. Scalar Arguments .. INTEGER IA,M C .. C .. Array Arguments .. REAL A(IA,1),ALPHA(1),BETA(1),Q(1) C C_END_MC04B C .. C .. Local Scalars .. REAL BIGK,H,PP,PP1,QJ INTEGER I,I1,I2,J,J1,KI,KJ,M1,M2 C .. C .. Intrinsic Functions .. INTRINSIC SQRT C .. ALPHA(1) = A(1,1) DO 20 J = 2,M J1 = J - 1 DO 10 I = 1,J1 A(I,J) = A(J,I) 10 CONTINUE ALPHA(J) = A(J,J) 20 CONTINUE M1 = M - 1 M2 = M - 2 DO 110 I = 1,M2 PP = 0.0 I1 = I + 1 DO 30 J = I1,M PP = A(I,J)**2 + PP 30 CONTINUE PP1 = SQRT(PP) IF (A(I,I+1).LT.0) THEN BETA(I+1) = PP1 ELSE BETA(I+1) = -PP1 END IF IF (PP.GT.0) THEN H = PP - BETA(I+1)*A(I,I+1) A(I,I+1) = A(I,I+1) - BETA(I+1) DO 60 KI = I1,M QJ = 0.0 DO 40 KJ = I1,KI QJ = A(KJ,KI)*A(I,KJ) + QJ 40 CONTINUE IF (KI-M.LT.0) THEN I2 = KI + 1 DO 50 KJ = I2,M QJ = A(KI,KJ)*A(I,KJ) + QJ 50 CONTINUE END IF Q(KI) = QJ/H 60 CONTINUE BIGK = 0.0 DO 70 KJ = I1,M BIGK = A(I,KJ)*Q(KJ) + BIGK 70 CONTINUE BIGK = BIGK/ (2.0*H) DO 80 KJ = I1,M Q(KJ) = Q(KJ) - A(I,KJ)*BIGK 80 CONTINUE DO 100 KI = I1,M DO 90 KJ = KI,M A(KI,KJ) = A(KI,KJ) - Q(KI)*A(I,KJ) - + Q(KJ)*A(I,KI) 90 CONTINUE 100 CONTINUE END IF 110 CONTINUE DO 120 I = 2,M H = ALPHA(I) ALPHA(I) = A(I,I) A(I,I) = H 120 CONTINUE BETA(M) = A(M-1,M) END C C C_BEGIN_MINVN C SUBROUTINE MINVN(A,N,D,L,M) C =========================== C C C---- Purpose C ======= C C invert a matrix C C---- Usage C ====== C C CALL MINVN(A,N,D,L,M) C C---- Description of parameters C ========================= C C A - input matrix, destroyed in computation and replaced by C resultant inverse. C C N - order of matrix A C C D - resultant determinant C C L - work vector of length n C C M - work vector of length n C C---- Remarks C ======= C C Matrix a must be a general matrix C C---- Subroutines and function subprograms required C ============================================= C C NONE C C---- Method C ====== C C The standard gauss-jordan method is used. the determinant C is also calculated. a determinant of zero indicates that C the matrix is singular. C C C---- Note C ===== C C If a double precision version of this routine is desired, the C c in column 1 should be removed from the double precision C statement which follows. C C double precision a,d,biga,hold C C the c must also be removed from double precision statements C appearing in other routines used in conjunction with this C routine. C C The double precision version of this subroutine must also C contain double precision fortran functions. abs in statement C 10 must be changed to dabs. C ccc REAL*8 D C C_END_MINVN C C---- Search for largest element C C .. Scalar Arguments .. REAL D INTEGER N C .. C .. Array Arguments .. REAL A(N*N) INTEGER L(N),M(N) C .. C .. Local Scalars .. REAL BIGA,HOLD INTEGER I,IJ,IK,IZ,J,JI,JK,JP,JQ,JR,K,KI,KJ,KK,NK C .. C .. Intrinsic Functions .. INTRINSIC ABS C .. C C D = 1.0 NK = -N DO 90 K = 1,N NK = NK + N L(K) = K M(K) = K KK = NK + K BIGA = A(KK) DO 20 J = K,N IZ = (J-1)*N DO 10 I = K,N IJ = IZ + I IF ((ABS(BIGA)-ABS(A(IJ))).LT.0.0) THEN BIGA = A(IJ) L(K) = I M(K) = J END IF 10 CONTINUE 20 CONTINUE C C---- Interchange rows C J = L(K) IF ((J-K).GT.0) THEN KI = K - N DO 30 I = 1,N KI = KI + N HOLD = -A(KI) JI = KI - K + J A(KI) = A(JI) A(JI) = HOLD 30 CONTINUE END IF C C---- Interchange columns C I = M(K) IF ((I-K).GT.0) THEN JP = (I-1)*N DO 40 J = 1,N JK = NK + J JI = JP + J HOLD = -A(JK) A(JK) = A(JI) A(JI) = HOLD 40 CONTINUE END IF C C---- Divide column by minus pivot (value of pivot element is C contained in biga) C IF (BIGA.NE.0.0) THEN DO 50 I = 1,N IF ((I-K).NE.0) THEN IK = NK + I A(IK) = A(IK)/ (-BIGA) END IF 50 CONTINUE C C---- Reduce matrix C DO 70 I = 1,N IK = NK + I HOLD = A(IK) IJ = I - N DO 60 J = 1,N IJ = IJ + N IF ((I-K).NE.0) THEN IF ((J-K).NE.0) THEN KJ = IJ - I + K A(IJ) = A(KJ)*HOLD + A(IJ) END IF END IF 60 CONTINUE 70 CONTINUE C C---- Divide row by pivot C KJ = K - N DO 80 J = 1,N KJ = KJ + N IF ((J-K).NE.0) A(KJ) = A(KJ)/BIGA 80 CONTINUE C C---- Product of pivots C D = D*BIGA C C---- Replace pivot by reciprocal C A(KK) = 1.0/BIGA ELSE GO TO 130 END IF 90 CONTINUE C C---- Final row and column interchange C K = N 100 CONTINUE K = (K-1) IF (K.GT.0) THEN I = L(K) IF ((I-K).GT.0) THEN JQ = (K-1)*N JR = (I-1)*N DO 110 J = 1,N JK = JQ + J HOLD = A(JK) JI = JR + J A(JK) = -A(JI) A(JI) = HOLD 110 CONTINUE END IF J = M(K) IF ((J-K).GT.0) THEN KI = K - N DO 120 I = 1,N KI = KI + N HOLD = A(KI) JI = KI - K + J A(KI) = -A(JI) A(JI) = HOLD 120 CONTINUE END IF GO TO 100 ELSE RETURN END IF 130 D = 0.0 C C END C C C_BEGIN_MINV3 C SUBROUTINE MINV3(A,B,D) C ====================== C C Invert a general 3x3 matrix and return determinant in D C C A = (B)-1 C C .. Scalar Arguments .. REAL D C .. C .. Array Arguments .. REAL A(3,3),B(3,3) C C_END_MINV3 C .. C .. Local Scalars .. INTEGER I,J C .. C .. Local Arrays .. REAL C(3,3) C .. C .. External Functions .. REAL DOT EXTERNAL DOT C .. C .. External Subroutines .. EXTERNAL CROSS C .. C .. Intrinsic Functions .. INTRINSIC ABS C .. CALL CROSS(C(1,1),B(1,2),B(1,3)) CALL CROSS(C(1,2),B(1,3),B(1,1)) CALL CROSS(C(1,3),B(1,1),B(1,2)) D = DOT(B(1,1),C(1,1)) C C---- Test determinant C IF (ABS(D).GT.1.0E-30) THEN C C---- Determinant is non-zero C DO 20 I = 1,3 DO 10 J = 1,3 A(I,J) = C(J,I)/D 10 CONTINUE 20 CONTINUE ELSE D = 0.0 END IF END C C C_BEGIN_RANMAR C SUBROUTINE RANMAR(RVEC,LEN) C =========================== C C Universal random number generator proposed by Marsaglia and Zaman C in report FSU-SCRI-87-50 C slightly modified by F. James, 1988 to generate a vector C of pseudorandom numbers RVEC of length LEN C and making the COMMON block include everything needed to C specify completely the state of the generator. C Transcribed from CERN report DD/88/22. C Rather inelegant messing about added by D. Love, Jan. 1989 to C make sure initialisation always occurs. C *** James says that this is the preferred generator. C Gives bit-identical results on all machines with at least C 24-bit mantissas in the flotaing point representation (i.e. C all common 32-bit computers. Fairly fast, satisfies very C stringent tests, has very long period and makes it very C simple to generate independly disjoint sequences. C See also RANECU. C The state of the generator may be saved/restored using the C whole contents of /RASET1/. C Call RANMAR to get a vector, RMARIN to initialise. C C Argument list C ------------- C C VREC (O) (REAL) Random Vector C C LEN (I) (INTEGER) Length of random vector C C C For ENTRY point RMARIN C ---------------------- C C Initialisation for RANMAR. The input values should C be in the ranges: 0<=ij<=31328, 0<=kl<=30081 C This shows the correspondence between the simplified input seeds C IJ, KL and the original Marsaglia-Zaman seeds i,j,k,l C To get standard values in Marsaglia-Zaman paper, C (I=12, J=34, K=56, L=78) put IJ=1802, KL=9373 C C IJ (I) (INTEGER) Seed for random number generator C C KL (I) (INTEGER) Seed for randon number generator C C_END_RANMAR C C .. C .. Agruments .. REAL RVEC(*) INTEGER LEN,IJ,KL C .. C .. Common Variables .. REAL C,CD,CM,U INTEGER I97,J97 C .. C .. Local Scalars .. REAL S,T,UNI INTEGER I,II,IVEC,J,JJ,K,L,M LOGICAL INITED C .. C .. Intrinsic Functions .. INTRINSIC MOD C .. C .. Common Blocks .. COMMON /RASET1/ U(97),C,CD,CM,I97,J97 C .. C .. Save Statement .. SAVE INITED, /RASET1/ C .. C .. Data Statement .. DATA INITED /.FALSE./ C C---- If initialised, fill RVEC and RETURN. If not, do initialisation C and return here later. C 1 IF (INITED) THEN DO 100 IVEC=1,LEN UNI=U(I97)-U(J97) IF (UNI.LT.0.) UNI=UNI+1. U(I97)=UNI I97=I97-1 IF (I97.EQ.0) I97=97 J97=J97-1 IF (J97.EQ.0) J97=97 C=C-CD IF (C.LT.0.) C=C+CM UNI=UNI-C IF (UNI.LT.0.) UNI=UNI+1. RVEC(IVEC)=UNI 100 CONTINUE RETURN ENDIF I=MOD(1802/177,177)+2 J=MOD(1802,177)+2 K=MOD(9373/169,178)+1 L=MOD(9373,169) C GOTO 10 C C---- Initialise and return without filling RVEC C ENTRY RMARIN(IJ,KL) I=MOD(IJ/177,177)+2 J=MOD(IJ,177)+2 K=MOD(KL/169,178)+1 L=MOD(KL,169) INITED=.TRUE. 10 CONTINUE DO 2 II=1,97 S=0. T=.5 DO 3 JJ=1,24 M=MOD(MOD(I*J,179)*K,179) I=J J=K K=M L=MOD(53*L+1,169) IF (MOD(L*M,64).GE.32) S=S+T T=0.5*T 3 CONTINUE U(II)=S 2 CONTINUE C=362436./16777216. CD=7654321./16777216. CM=16777213./16777216. I97=97 J97=33 IF (.NOT. INITED) THEN INITED=.TRUE. GOTO 1 ENDIF END C C C_BEGIN_SCALEV C SUBROUTINE SCALEV(A,X,B) C ======================== C C Scale vector B with scalar X and put result in A C C .. Scalar Arguments .. REAL X C .. C .. Array Arguments .. REAL A(3),B(3) C C_END_SCALEV C .. C .. Local Scalars .. INTEGER I C .. DO 10 I = 1,3 A(I) = B(I)*X 10 CONTINUE END C C C_BEGIN_TRANSP C SUBROUTINE TRANSP(A,B) C ====================== C C---- Transpose a 3x3 matrix C C A = BT C C .. Array Arguments .. REAL A(3,3),B(3,3) C C_END_TRANSP C .. C .. Local Scalars .. INTEGER I,J C .. DO 20 I = 1,3 DO 10 J = 1,3 A(I,J) = B(J,I) 10 CONTINUE 20 CONTINUE END C C C_BEGIN_UNIT C SUBROUTINE UNIT(V) C ================= C C Vector V reduced to unit vector C C .. Array Arguments .. REAL V(3) C C_END_UNIT C .. C .. Local Scalars .. REAL VMOD INTEGER I C .. C .. Intrinsic Functions .. INTRINSIC SQRT C .. VMOD = V(1)**2 + V(2)**2 + V(3)**2 VMOD = SQRT(VMOD) DO 10 I = 1,3 V(I) = V(I)/VMOD 10 CONTINUE END C C C_BEGIN_VDIF C SUBROUTINE VDIF(A,B,C) C ===================== C C Subtract two vectors C C A = B - C C C .. Array Arguments .. REAL A(3),B(3),C(3) C C_END_VDIF C .. C .. Local Scalars .. INTEGER I C .. DO 10 I = 1,3 A(I) = B(I) - C(I) 10 CONTINUE END C C C_BEGIN_VSET C SUBROUTINE VSET(A,B) C ==================== C C Copy a vector from B to A C C .. Array Arguments .. REAL A(3),B(3) C C_END_VSET C .. C .. Local Scalars .. INTEGER I C .. DO 10 I = 1,3 A(I) = B(I) 10 CONTINUE END C C C_BEGIN_VSUM C SUBROUTINE VSUM(A,B,C) C ====================== C C Add two vectors C C A = B + C C C .. Array Arguments .. REAL A(3),B(3),C(3) C C_END_VSUM C .. C .. Local Scalars .. INTEGER I C .. DO 10 I = 1,3 A(I) = B(I) + C(I) 10 CONTINUE END C C C_BEGIN_ZIPIN C SUBROUTINE ZIPIN(ID,N,BUF) C ========================== C C Fast binary read on unit ID into real array BUF of length N C C .. Scalar Arguments .. INTEGER ID,N C .. C .. Array Arguments .. REAL BUF(N) C C_END_ZIPIN C .. READ (ID) BUF END C C C_BEGIN_ZIPOUT C SUBROUTINE ZIPOUT(ID,N,BUF) C =========================== C C Fast binary write to unit ID of real array BUF length N C C .. Scalar Arguments .. INTEGER ID,N C .. C .. Array Arguments .. REAL BUF(N) C C_END_ZIPOUT C .. WRITE (ID) BUF END C C The following routines calculate Bessel functions of C the first kind, their derivatives, and their zeros. C Subroutine ZJVX is from Ian Tickle. C Subroutines JDVX, JVX, GAMMA and functions MSTA1, MSTA2 C are from MJYV at http://iris-lee3.ece.uiuc.edu/~jjin/routines/routines.html C These routines are copyrighted, but permission is given to incorporate these C routines into programs provided that the copyright is acknowledged. SUBROUTINE ZJVX(V,IZ,BJ,DJ,X) C C ======================================================= C Purpose: Compute zero of Bessel function Jv(x) C Input : V --- Order of Jv(x) C IZ --- Index of previous zero of Jv(x) C X --- Value of previous zero of Jv(x) C Output: BJ(N) --- Jv(x) for N = 0...INT(V) C DJ(N) --- J'v(x) for N = 0...INT(V) C X --- Value of next zero of Jv(x) C IMPLICIT NONE INTEGER IZ,N REAL*8 V,VM,X,X0 REAL*8 BJ(0:*),DJ(0:*) C C#### Initial guess at zero: needs previous value if not first. N=V IF (IZ.EQ.0) THEN X=1.99535+.8333883*SQRT(V)+.984584*V ELSEIF (N.LE.10) THEN X=X+3.11+.0138*V+(.04832+.2804*V)/(IZ+1)**2 ELSE X=X+3.001+.0105*V+(11.52+.48525*V)/(IZ+3)**2 ENDIF C C#### Polish zero by Newton-Cotes iteration. 1 CALL JDVX(V,X,VM,BJ,DJ) IF (INT(VM).NE.N) CALL CCPERR(1,'VM != N in ZJVX.') X0=X X=X-BJ(N)/DJ(N) IF (ABS(X-X0).GT.1D-10) GOTO 1 END C C SUBROUTINE JDVX(V,X,VM,BJ,DJ) C C ======================================================= C Purpose: Compute Bessel functions Jv(x) and their derivatives C Input : x --- Argument of Jv(x) C v --- Order of Jv(x) C ( v = n+v0, 0 <= v0 < 1, n = 0,1,2,... ) C Output: BJ(n) --- Jn+v0(x) C DJ(n) --- Jn+v0'(x) C VM --- Highest order computed C Routines called: C (1) GAMMA for computing gamma function C (2) MSTA1 and MSTA2 for computing the starting C point for backward recurrence C ======================================================= C IMPLICIT NONE INTEGER J,K,K0,L,M,N REAL*8 A,A0,BJV0,BJV1,BJVL,CK,CS,F,F0,F1,F2,GA,PI,PX,QX,R,RP,RP2, &RQ,SK,V,V0,VG,VL,VM,VV,X,X2,XK PARAMETER(PI=3.141592653589793D0, RP2=.63661977236758D0) REAL*8 BJ(0:*),DJ(0:*) INTEGER MSTA1,MSTA2 C X2=X*X N=INT(V) V0=V-N IF (X.LT.1D-100) THEN DO K=0,N BJ(K)=0D0 DJ(K)=0D0 ENDDO IF (V0.EQ.0D0) THEN BJ(0)=1D0 DJ(1)=.5D0 ELSE DJ(0)=1D300 ENDIF VM=V ELSE IF (X.LE.12D0) THEN DO L=0,1 VL=V0+L BJVL=1D0 R=1D0 DO K=1,40 R=-.25D0*R*X2/(K*(K+VL)) BJVL=BJVL+R IF (ABS(R).LT.ABS(BJVL)*1D-15) GOTO 20 ENDDO 20 VG=1D0+VL CALL GAMMA(VG,GA) A=(.5D0*X)**VL/GA IF (L.EQ.0) THEN BJV0=BJVL*A ELSEIF (L.EQ.1) THEN BJV1=BJVL*A ENDIF ENDDO ELSE K0=11 IF (X.GE.35D0) K0=10 IF (X.GE.50D0) K0=8 DO J=0,1 VV=4D0*(J+V0)*(J+V0) PX=1D0 RP=1D0 DO K=1,K0 RP=-.78125D-2*RP*(VV-(4*K-3)**2)*(VV-(4*K-1)**2)/ & (K*(2*K-1)*X2) PX=PX+RP ENDDO QX=1D0 RQ=1D0 DO K=1,K0 RQ=-.78125D-2*RQ*(VV-(4*K-1)**2)*(VV-(4*K+1)**2)/ & (K*(2*K+1)*X2) QX=QX+RQ ENDDO QX=.125D0*(VV-1D0)*QX/X XK=X-(.5D0*(J+V0)+.25D0)*PI A0=SQRT(RP2/X) CK=COS(XK) SK=SIN(XK) IF (J.EQ.0) THEN BJV0=A0*(PX*CK-QX*SK) ELSEIF (J.EQ.1) THEN BJV1=A0*(PX*CK-QX*SK) ENDIF ENDDO ENDIF BJ(0)=BJV0 BJ(1)=BJV1 DJ(0)=V0/X*BJ(0)-BJ(1) DJ(1)=BJ(0)-(1D0+V0)/X*BJ(1) IF (N.GE.2 .AND. N.LE.INT(.9*X)) THEN F0=BJV0 F1=BJV1 DO K=2,N F=2D0*(K+V0-1D0)/X*F1-F0 BJ(K)=F F0=F1 F1=F ENDDO ELSEIF (N.GE.2) THEN M=MSTA1(X,200) IF (M.LT.N) THEN N=M ELSE M=MSTA2(X,N,15) ENDIF F2=0D0 F1=1D-100 DO K=M,0,-1 F=2D0*(V0+K+1D0)/X*F1-F2 IF (K.LE.N) BJ(K)=F F2=F1 F1=F ENDDO IF (ABS(BJV0).GT.ABS(BJV1)) THEN CS=BJV0/F ELSE CS=BJV1/F2 ENDIF DO K=0,N BJ(K)=CS*BJ(K) ENDDO ENDIF DO K=2,N DJ(K)=BJ(K-1)-(K+V0)/X*BJ(K) ENDDO VM=N+V0 ENDIF END C C SUBROUTINE JVX(V,X,VM,BJ) C C ======================================================= C Purpose: Compute Bessel functions Jv(x) C Input : x --- Argument of Jv(x) C v --- Order of Jv(x) C ( v = n+v0, 0 <= v0 < 1, n = 0,1,2,... ) C Output: BJ(n) --- Jn+v0(x) C VM --- Highest order computed C Routines called: C (1) GAMMA for computing gamma function C (2) MSTA1 and MSTA2 for computing the starting C point for backward recurrence C ======================================================= C IMPLICIT NONE INTEGER J,K,K0,L,M,N REAL*8 A,A0,BJV0,BJV1,BJVL,CK,CS,F,F0,F1,F2,GA,PI,PX,QX,R,RP,RP2, &RQ,SK,V,V0,VG,VL,VM,VV,X,X2,XK PARAMETER(PI=3.141592653589793D0, RP2=.63661977236758D0) REAL*8 BJ(0:*) INTEGER MSTA1,MSTA2 C X2=X*X N=INT(V) V0=V-N IF (X.LT.1D-100) THEN DO K=0,N BJ(K)=0D0 ENDDO IF (V0.EQ.0D0) BJ(0)=1D0 VM=V ELSE IF (X.LE.12D0) THEN DO L=0,1 VL=V0+L BJVL=1D0 R=1D0 DO K=1,40 R=-.25D0*R*X2/(K*(K+VL)) BJVL=BJVL+R IF (ABS(R).LT.ABS(BJVL)*1D-15) GOTO 20 ENDDO 20 VG=1D0+VL CALL GAMMA(VG,GA) A=(.5D0*X)**VL/GA IF (L.EQ.0) THEN BJV0=BJVL*A ELSEIF (L.EQ.1) THEN BJV1=BJVL*A ENDIF ENDDO ELSE K0=11 IF (X.GE.35D0) K0=10 IF (X.GE.50D0) K0=8 DO J=0,1 VV=4D0*(J+V0)*(J+V0) PX=1D0 RP=1D0 DO K=1,K0 RP=-.78125D-2*RP*(VV-(4*K-3)**2)*(VV-(4*K-1)**2)/ & (K*(2*K-1)*X2) PX=PX+RP ENDDO QX=1D0 RQ=1D0 DO K=1,K0 RQ=-.78125D-2*RQ*(VV-(4*K-1)**2)*(VV-(4*K+1)**2)/ & (K*(2*K+1)*X2) QX=QX+RQ ENDDO QX=.125D0*(VV-1D0)*QX/X XK=X-(.5D0*(J+V0)+.25D0)*PI A0=SQRT(RP2/X) CK=COS(XK) SK=SIN(XK) IF (J.EQ.0) THEN BJV0=A0*(PX*CK-QX*SK) ELSEIF (J.EQ.1) THEN BJV1=A0*(PX*CK-QX*SK) ENDIF ENDDO ENDIF BJ(0)=BJV0 BJ(1)=BJV1 IF (N.GE.2 .AND. N.LE.INT(.9*X)) THEN F0=BJV0 F1=BJV1 DO K=2,N F=2D0*(K+V0-1D0)/X*F1-F0 BJ(K)=F F0=F1 F1=F ENDDO ELSEIF (N.GE.2) THEN M=MSTA1(X,200) IF (M.LT.N) THEN N=M ELSE M=MSTA2(X,N,15) ENDIF F2=0D0 F1=1D-100 DO K=M,0,-1 F=2D0*(V0+K+1D0)/X*F1-F2 IF (K.LE.N) BJ(K)=F F2=F1 F1=F ENDDO IF (ABS(BJV0).GT.ABS(BJV1)) THEN CS=BJV0/F ELSE CS=BJV1/F2 ENDIF DO K=0,N BJ(K)=CS*BJ(K) ENDDO ENDIF VM=N+V0 ENDIF END C SUBROUTINE GAMMA(X,GA) C C ================================================== C Purpose: Compute gamma function GA(x) C Input : x --- Argument of GA(x) C ( x is not equal to 0,-1,-2,... ) C Output: GA --- GA(x) C ================================================== C IMPLICIT NONE INTEGER K,M,M1 REAL*8 GA,GR,PI,R,X,Z PARAMETER(PI=3.141592653589793D0) REAL*8 G(26) DATA G/1D0, .5772156649015329D0, &-.6558780715202538D0, -.420026350340952D-1, &.1665386113822915D0, -.421977345555443D-1, &-.96219715278770D-2, .72189432466630D-2, &-.11651675918591D-2, -.2152416741149D-3, &.1280502823882D-3, -.201348547807D-4, &-.12504934821D-5, .11330272320D-5, &-.2056338417D-6, .61160950D-8, &.50020075D-8, -.11812746D-8, &.1043427D-9, .77823D-11, &-.36968D-11, .51D-12, &-.206D-13, -.54D-14, .14D-14, .1D-15/ C IF (X.EQ.INT(X)) THEN IF (X.GT.0D0) THEN GA=1D0 M1=X-1 DO K=2,M1 GA=GA*K ENDDO ELSE GA=1D300 ENDIF ELSE IF (ABS(X).GT.1D0) THEN Z=ABS(X) M=INT(Z) R=1D0 DO K=1,M R=R*(Z-K) ENDDO Z=Z-M ELSE Z=X ENDIF GR=G(26) DO K=25,1,-1 GR=GR*Z+G(K) ENDDO GA=1D0/(GR*Z) IF (ABS(X).GT.1D0) THEN GA=GA*R IF (X.LT.0D0) GA=-PI/(X*GA*DSIN(PI*X)) ENDIF ENDIF END C INTEGER FUNCTION MSTA1(X,MP) C C =================================================== C Purpose: Determine the starting point for backward C recurrence such that the magnitude of C Jn(x) at that point is about 10^(-MP) C Input : x --- Argument of Jn(x) C MP --- Value of magnitude C Output: MSTA1 --- Starting point C =================================================== C IMPLICIT NONE INTEGER IT,MP,N,N0,N1,NN REAL*8 A0,F,F0,F1,X REAL*8 ENVJ ENVJ(N,X)=.5D0*LOG10(6.28D0*N)-N*LOG10(1.36D0*X/N) C A0=ABS(X) N0=INT(1.1D0*A0)+1 F0=ENVJ(N0,A0)-MP N1=N0+5 F1=ENVJ(N1,A0)-MP DO IT=1,20 NN=N1-(N1-N0)/(1D0-F0/F1) F=ENVJ(NN,A0)-MP IF(ABS(NN-N1).LT.1) GOTO 20 N0=N1 F0=F1 N1=NN F1=F ENDDO 20 MSTA1=NN END C INTEGER FUNCTION MSTA2(X,N,MP) C C =================================================== C Purpose: Determine the starting point for backward C recurrence such that all Jn(x) has MP C significant digits C Input : x --- Argument of Jn(x) C n --- Order of Jn(x) C MP --- Significant digit C Output: MSTA2 --- Starting point C =================================================== C IMPLICIT NONE INTEGER IT,MP,N,N0,N1,NN REAL*8 A0,F,F0,F1,EJN,HMP,OBJ,X REAL*8 ENVJ ENVJ(N,X)=.5D0*LOG10(6.28D0*N)-N*LOG10(1.36D0*X/N) C A0=ABS(X) HMP=.5D0*MP EJN=ENVJ(N,A0) IF (EJN.LE.HMP) THEN OBJ=MP N0=INT(1.1D0*A0) ELSE OBJ=HMP+EJN N0=N ENDIF F0=ENVJ(N0,A0)-OBJ N1=N0+5 F1=ENVJ(N1,A0)-OBJ DO IT=1,20 NN=N1-(N1-N0)/(1D0-F0/F1) F=ENVJ(NN,A0)-OBJ IF (ABS(NN-N1).LT.1) GOTO 20 N0=N1 F0=F1 N1=NN F1=F ENDDO 20 MSTA2=NN+10 END C libccp4-8.0.0/fortran/mthlib.for0000644000000000000000000001726614242731033014642 0ustar 00000000000000C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C SUBROUTINE ROTMAT( U, ANG, R) C ============================= C C DIMENSION U( 3), R( 3, 3), K( 3, 3), V( 3) DATA K / 0, +3, -2, -3, 0, +1, +2, -1, 0/ C C DTOR = 3.14159265/180. S = SIN( ANG * DTOR) C = COS( ANG * DTOR) UMAG = SQRT( U(1)*U(1)+U(2)*U(2)+U(3)*U(3)) C C DO 999 I = 1, 3 V( I) = U( I)/ UMAG 999 CONTINUE C C DO 998 I = 1, 3 DO 997 J = 1, 3 R( I, J) = V( I) * V( J) * ( 1. - C) C C IF( I .EQ. J ) THEN R( I, J) = R( I, J) + C ELSE R( I, J) = R( I, J)+ + ISIGN(1, K( I, J))*S*V( IABS( K( I, J))) END IF C C 997 CONTINUE 998 CONTINUE C C RETURN C C END C C C SUBROUTINE MATMULT( A, B, AB) C ============================= C C DIMENSION A( 3, 3), B( 3, 3), AB( 3, 3) C C DO 999 I = 1, 3 DO 998 J = 1, 3 SUM = 0. DO 997 K = 1, 3 SUM = SUM + A( I, K) * B( K, J) 997 CONTINUE AB( I, J) = SUM 998 CONTINUE 999 CONTINUE C C RETURN C C END C C C FUNCTION DET( A) C ================ C C DIMENSION A( 3, 3) C C DET = A(1,1)*( A(2,2)*A(3,3) - A(2,3)*A(3,2)) + + A(1,2)*( A(2,3)*A(3,1) - A(2,1)*A(3,3)) + + A(1,3)*( A(2,1)*A(3,2) - A(2,2)*A(3,1)) C C RETURN C C END C C C FUNCTION INCMOD3( I, INC) C ========================= C C INCMOD3 = I + INC IF ( INCMOD3 .GT. 3) INCMOD3 = INCMOD3 - 3 C C RETURN C C END C C C SUBROUTINE MATINV( A, AI) C ========================= C C DIMENSION A( 3, 3), AI( 3, 3) C C D = DET( A) C C DO 999 I = 1, 3 I1 = INCMOD3( I, 1) I2 = INCMOD3( I, 2) DO 998 J = 1, 3 J1 = INCMOD3( J, 1) J2 = INCMOD3( J, 2) AI( J, I) = ( A( I1, J1)*A( I2, J2) - + A( I1, J2)*A( I2, J1))/D 998 CONTINUE 999 CONTINUE C C RETURN C C END C C C SUBROUTINE MATCOPY( SOURCE, DEST, IROWS, ICOLS) C =============================================== C C DIMENSION SOURCE( IROWS, ICOLS), DEST( IROWS, ICOLS) C C DO 999 I = 1, IROWS DO 998 J = 1, ICOLS DEST( I, J) = SOURCE( I, J) 998 CONTINUE 999 CONTINUE C C RETURN C C END C C C SUBROUTINE COPY_VECTOR( A, B, NX) C ================================= C C DIMENSION A( NX), B( NX) C C DO 999 I = 1, NX B( I) = A( I) 999 CONTINUE C C RETURN C C END C C C SUBROUTINE SCALE_VECTOR( SCALAR, VECTOR, SCALED_VECTOR, NX) C =========================================================== C C DIMENSION VECTOR( NX), SCALED_VECTOR( NX) C C DO 999 I = 1, NX SCALED_VECTOR( I) = SCALAR * VECTOR( I) 999 CONTINUE C C RETURN C C END C C C SUBROUTINE ADDVEC( A, B, AB, NX) C ================================ C C DIMENSION A( NX), B( NX), AB( NX) C C DO 999 I = 1, NX AB( I) = A( I) + B( I) 999 CONTINUE C C RETURN C C END C C C SUBROUTINE VECTOR_DIFF( A, B, A_MINUS_B, NX) C ============================================ C C DIMENSION A( NX), B( NX), A_MINUS_B( NX) C C DO 999 I = 1, NX A_MINUS_B( I) = A( I) - B( I) 999 CONTINUE C C RETURN C C END C C C FUNCTION DOTPRODUCT( A, B, NX) C ============================== C C DIMENSION A( NX), B( NX) C C SUM = 0. C C DO 999 I = 1, NX SUM = SUM + A( I) * B( I) 999 CONTINUE C C DOTPRODUCT = SUM C C RETURN C C END C C C SUBROUTINE CROSSPRODUCT( A, B, AB) C ================================== C C DIMENSION A( 3), B( 3), AB( 3) C C AB( 1) = A( 2) * B( 3) - A( 3) * B( 2) AB( 2) = A( 3) * B( 1) - A( 1) * B( 3) AB( 3) = A( 1) * B( 2) - A( 2) * B( 1) C C RETURN C C END C C C SUBROUTINE EXTRACT_MATRIX( A_SET, NX, NY, NSET, ISET, AMAT) C =========================================================== C C DIMENSION A_SET( NX, NY, NSET), AMAT( NX, NY) C C DO 999 I = 1, NX DO 998 J = 1, NY AMAT( I, J) = A_SET( I, J, ISET) 998 CONTINUE 999 CONTINUE C C RETURN C C END C C C SUBROUTINE EXTRACT_VECTOR( V_SET, NX, NSET, ISET, VEC) C ====================================================== C C DIMENSION V_SET( NX, NSET), VEC( NX) C C DO 999 I = 1, NX VEC( I) = V_SET( I, ISET) 999 CONTINUE C C RETURN C C END C C C SUBROUTINE BUILD_3VECTOR( VEC, X, Y, Z) C ======================================= C C DIMENSION VEC( 3) C C VEC( 1) = X VEC( 2) = Y VEC( 3) = Z C C RETURN C C END C C C SUBROUTINE GEN_TRIGTAB C ====================== C C COMMON /TRIGTAB/ AMULTIPLIER, COSTAB( 0:9000), SINTAB( 0:9000) C C MAXARG = 90. * AMULTIPLIER C C DO 999 I = 0, MAXARG ARG = FLOAT( I) / AMULTIPLIER COSTAB( I) = COSD( ARG) SINTAB( I) = SIND( ARG) 999 CONTINUE C C RETURN C C END C C C FUNCTION GET_COSD( ARG ) C ======================== C C COMMON /TRIGTAB/ AMULTIPLIER, COSTAB( 0:9000), SINTAB( 0:9000) C C A = ARG IF ( A .LT. 0. ) A = -A 10 CONTINUE C C IF ( A .GE. 360. ) THEN A = A - 360. GOTO 10 END IF C C IF ( A .GT. 180. ) A = 360. - A C C IF ( A .GT. 90. ) THEN A = 180. - A ASIGN = -1. ELSE ASIGN = 1. END IF C C IA = INT( A * AMULTIPLIER + .5 ) GET_COSD = ASIGN * COSTAB( IA ) C C RETURN C C END C C C FUNCTION GET_SIND( ARG ) C ======================== C C COMMON /TRIGTAB/ AMULTIPLIER, COSTAB( 0:9000), SINTAB( 0:9000) C C A = ARG C C IF ( A .LT. 0. ) THEN A = -A ASIGN = -1. ELSE ASIGN = 1. END IF C 10 CONTINUE C IF ( A .GE. 360. ) THEN A = A - 360. GOTO 10 END IF C C IF ( A .GT. 180. ) THEN A = 360. - A ASIGN = -1. * ASIGN END IF C C IF ( A .GT. 90. ) A = 180. - A IA = INT( A * AMULTIPLIER + .5 ) GET_SIND = ASIGN * SINTAB( IA ) C C RETURN C C END C C C FUNCTION RANDOM_GAUSSIAN( NRANDOM_0_1, IRANSEED ) C ================================================== C C SUM = 0. C C DO 999 I = 1, NRANDOM_0_1 SUM = SUM + RAN( IRANSEED ) -.5 999 CONTINUE C C RANDOM_GAUSSIAN = SUM C C RETURN C C END C C C FUNCTION ARCTAN_DEGREES( Y, X) C =============================== C C IF ( X .EQ. 0.0 ) THEN IF ( Y .EQ. 0.0 ) A = 0. IF ( Y .GT. 0.0 ) A = 90. IF ( Y .LT. 0.0 ) A = -90. ELSE IF ( Y .EQ. 0.0 ) THEN IF ( X .GE. 0.0 ) A = 0. IF ( X .LT. 0.0 ) A = 180. ELSE A = ATAN2D( Y, X) END IF END IF C C ARCTAN_DEGREES = A C C RETURN C C END C libccp4-8.0.0/fortran/pack_f.f0000644000000000000000000001464514242731033014243 0ustar 00000000000000C C pack_f.f: (de)compress diffraction image files C Copyright (C) 1995 Jan P Abrahams C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. c c c subroutine pack_wordimage (data, x, y, filn) c ================================= c c Pack data stored in the array DATA with dimensions x * y in file FILN. c implicit none c character*(*) filn integer*4 x, y, j integer*2 data(x, y) integer*4 filnarray(1025) c c .. c .. External C-routine external pack_wordimage_f do 10, j = 1, len(filn) if (filn(j:j) .ne. ' ') then filnarray(j) = ichar(filn(j:j)) else filnarray(j) = 0 endif 10 continue filnarray(len(filn) + 1) = 0 call pack_wordimage_f(data, x, y, filnarray) return end c******************************************************************************* c c c subroutine v2pack_wordimage (data, x, y, filn) c ================================= c c Pack data stored in the array DATA with dimensions x * y in file FILN. c implicit none c character*(*) filn integer*4 x, y, j integer*2 data(x, y) integer*4 filnarray(1025) c c .. c .. External C-routine external v2pack_wordimage_f do 10, j = 1, len(filn) if (filn(j:j) .ne. ' ') then filnarray(j) = ichar(filn(j:j)) else filnarray(j) = 0 endif 10 continue filnarray(len(filn) + 1) = 0 call v2pack_wordimage_f(data, x, y, filnarray) return end c******************************************************************************* c c c subroutine pack_longimage (data, x, y, filn) c ================================= c c Pack data stored in the array DATA with dimensions x * y in file FILN. c implicit none c character*(*) filn integer*4 x, y, j integer*4 data(x, y) integer*4 filnarray(1025) c c .. c .. External C-routine external pack_wordimage_f c do 10, j = 1, len(filn) if (filn(j:j) .ne. ' ') then filnarray(j) = ichar(filn(j:j)) else filnarray(j) = 0 endif 10 continue filnarray(len(filn) + 1) = 0 call pack_wordimage_f(data, x, y, filnarray) return end c******************************************************************************* c c c subroutine v2pack_longimage (data, x, y, filn) c ================================= c c Pack data stored in the array DATA with dimensions x * y in file FILN. c implicit none c character*(*) filn integer*4 x, y, j integer*4 data(x, y) integer*4 filnarray(1025) c c .. c .. External C-routine external v2pack_wordimage_f c do 10, j = 1, len(filn) if (filn(j:j) .ne. ' ') then filnarray(j) = ichar(filn(j:j)) else filnarray(j) = 0 endif 10 continue filnarray(len(filn) + 1) = 0 call v2pack_wordimage_f(data, x, y, filnarray) return end c******************************************************************************* c c c subroutine readpack_word (data, filn) c ================================= c c Read a packed image from file 'filn' into array 'data'. If you want c to generate the mirror-image, (interchange first and last stripes, etc.) c call "mirror_wordimg(data, nfast, nslow)", where nfast and nslow contain c the number of fast and slow indices, after reading the packed image. c implicit none c character*(*) filn integer*2 data, j integer*4 filnarray(1025) c c .. c .. External C-routine external readpack_word_f c do 10, j = 1, len(filn) if (filn(j:j) .ne. ' ') then filnarray(j) = ichar(filn(j:j)) else filnarray(j) = 0 endif 10 continue filnarray(len(filn) + 1) = 0 call readpack_word_f(data, filnarray) return end c******************************************************************************* c c c subroutine readpack_long (data, filn) c ================================= c c Read a packed image from file 'filn' into array 'data'. If you want c to generate the mirror-image, (interchange first and last stripes, etc.) c call "mirror_wordimg(data, nfast, nslow)", where nfast and nslow contain c the number of fast and slow indices, after reading the packed image. c implicit none c character*(*) filn integer*4 data, j integer*4 filnarray(1025) c c .. c .. External C-routine external readpack_long_f c do 10, j = 1, len(filn) if (filn(j:j) .ne. ' ') then filnarray(j) = ichar(filn(j:j)) else filnarray(j) = 0 endif 10 continue filnarray(len(filn) + 1) = 0 call readpack_long_f(data, filnarray) return end c******************************************************************************* c c c subroutine imsiz (filn, x, y) c ================================= c c Determines the size of the the packed image "filename" after c unpacking.The dimensions are returned in x and y. c Read a packed image from file 'filn' into array 'data'. c implicit none c character*(*) filn integer*4 x, y, j integer*4 filnarray(1025) c c .. c .. External C-routine external imsiz_f c do 10, j = 1, len(filn) if (filn(j:j) .ne. ' ') then filnarray(j) = ichar(filn(j:j)) else filnarray(j) = 0 endif 10 continue filnarray(len(filn) + 1) = 0 call imsiz_f(filnarray, x, y) return end c******************************************************************************* libccp4-8.0.0/fortran/parser.f0000644000000000000000000014624314242731033014314 0ustar 00000000000000C C parser.f: wrappers and utilies for C parser functions C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C C CCP4 PARSER Routines C ==================== C C Original Author: Based on Mike Levitt's routine of the same name. C Modified By: Peter Brick, Phil Evans, Eleanor Dodson, Dave Love C C Martyn Winn: legacy routines retained here. PARSER, PARSE and PARSDL C are now wrappers to C functions. C C Library parser.f contains the following subroutines and functions, C some of which are currently unsued and commented out. C C SUBROUTINES C C KEYNUM(N,NSTART,LINE,IBEG,IEND,ITYP,NTOK) C [ KEYERR(I,MODE,LINE,IBEG,IEND,ITYP) ] - internal subroutine (KEYNUM) C GTNREA(N,M,X,NTOK,ITYP,FVALUE) C GTNINT(N,M,J,NTOK,ITYP,FVALUE) C GTPREA(N,X,NTOK,ITYP,FVALUE) C GTPINT(N,I,NTOK,ITYP,FVALUE) C SBLANK(ARRAY,N1,N2) C CHKKEY(KEY,WORDS,NWORDS,IKEY) C PUTLIN(STROUT,OUTWIN) C BLANK(OUTWIN,NLINES) C LERROR(ERRFLG,IFAIL,ERRMSG) C RDSYMM(JTOK,LINE,IBEG,IEND,ITYP,FVALUE,NTOK,SPGNAM,NUMSGP,PGNAME, C NSYM,NSYMP,RSYM) C RDHEAD(JTOK,LINE,IBEG,IEND,ITYP,FVALUE,NTOK,MTZPRT,MTZBPR) C RDCELL(ITOK,ITYPE,FVALUE,NTOK,CELL) C RDRESO(ITOK,ITYPE,FVALUE,NTOK,RESMIN,RESMAX,SMIN,SMAX) C RDSCAL(ITOK,LINE,IBEG,IEND,ITYP,FVALUE,NTOK,NLPRGI,LSPRGI,ILPRGI,SCAL,BB) C RDRESL(ITOK,ITYPE,FVALUE,CVALUE,NTOK,RESMIN,RESMAX,SMIN,SMAX,ISTAT) C RDATOMSELECT(JTOK,INAT0,INAT1,IRES0,IRES1,CHNAM,IMODE,NTOK,LINE,IBEG, C IEND,ITYP,IDEC,FVALUE,IFAIL) C GTTREA(N,X,LFLAG,NTOK,ITYP,FVALUE) C GTTINT(N,I,LFLAG,NTOK,ITYP,FVALUE) C C FUNCTIONS C C LOGICAL FUNCTION CMATCH(STRING1,STRING2,NCHAR) C C_BEGIN_INTRO C CCP4 PARSER Routines C ==================== C C The PARSER module of the CCP4 library contains routines which are C mainly used for `free-format' `keyworded' input of control data for C programs. Most programs have a loop over input records which are C initially fed to the routine PARSER to tokenise them and extract the C initial keyword. PARSER can cope with continued, commented input C lines and included files. It calls PARSE to tokenise individual C records and PARSE is sometimes useful itself to compensate for the C lack of free-format internal READs in the fortran77 standard. See C the entries below for details. C C The library also contains routines to decode the parameters C following the `standard' program keywords SYMMETRY, RESOLUTION, C SCALE and CELL and to extract real and integer numbers from fields. C C_END_INTRO C C C_BEGIN_KEYNUM C ==================================================== SUBROUTINE KEYNUM(N,NSTART,LINE,IBEG,IEND,ITYP,NTOK) C ==================================================== C Check that correct number of numbers (numeric fields) are present C C--- Arguments: C C N (I) INTEGER Number of consecutive numeric fields expected C C NSTART (I) INTEGER Number of first field to check C C LINE (I) CHARACTER*(*) Array containing the fields C C IBEG (I) INTEGER(*) First column number of fields (from PARSER) C C IEND (I) INTEGER(*) Last column number of fields (from PARSER) C C ITYP (I) INTEGER(*) =0 null field C =1 character string C =2 number C (from PARSER) C C NTOK (I) INTEGER Number of fields (from PARSER) C C_END_KEYNUM C C .. Scalar Arguments .. INTEGER N,NSTART,NTOK CHARACTER LINE*(*) C .. C .. Array Arguments .. INTEGER IBEG(*),IEND(*),ITYP(*) C .. C .. Local Scalars .. INTEGER I CHARACTER LINERR*200 C .. C .. External Subroutines .. EXTERNAL KEYERR, CCPERR C .. C DO 10 I = NSTART,NSTART + N - 1 IF (I.GT.NTOK) THEN GO TO 30 ELSE IF (ITYP(I).NE.2) THEN GO TO 20 END IF 10 CONTINUE C RETURN C C ******************************* 20 CALL KEYERR(I,2,LINE,IBEG,IEND,ITYP) C ******************************* C CALL CCPERR(1, 'Keyword error') 30 CONTINUE C WRITE (LINERR,FMT='(A,I4,A,I4,A)') + ' *** TOO FEW NUMBERS - ', (I - NSTART), + ' FOUND WHEN ',N,' EXPECTED' CALL CCPERR(1, LINERR) C END C SUBROUTINE KEYERR(I,MODE,LINE,IBEG,IEND,ITYP) C ============================================= C Print warning when token not of correct type. C Internal subroutine, called from KEYNUM. C C .. Scalar Arguments .. INTEGER I,MODE CHARACTER LINE*(*) C .. C .. Array Arguments .. INTEGER IBEG(*),IEND(*),ITYP(*) C .. C .. Local Arrays .. CHARACTER TYPE(3)*12 C .. C .. Local Scalars .. CHARACTER LINERR*150 C .. C .. External Subroutines .. EXTERNAL LERROR C .. C .. Data statements .. DATA TYPE/'alphanumeric','numeric ', + 'quoted '/ C .. C C IF (MODE.EQ.0) THEN WRITE (LINERR,FMT='(A,A,A)') + ' ** ERROR : Key word < ', + LINE(IBEG(I) : IEND(I)), + ' > not recognized and has therefore been ignored' C C **************************** CALL LERROR(1,0,LINERR) C **************************** C ELSE WRITE (LINERR,FMT='(A,A,A,A,A,A,A)') + ' ** ERROR: Token < ', + LINE(IBEG(I) : IEND(I)), + ' > is ', + TYPE(ITYP(I)), + ' while a ',TYPE(I),' token was expected' C C **************************** CALL LERROR(1,0,LINERR) C **************************** END IF C END C C_BEGIN_GTNREA C ======================================== SUBROUTINE GTNREA(N,M,X,NTOK,ITYP,FVALUE) C ======================================== C Extract M real numbers X starting from N'th value of Parser C array FVALUE, if possible. If no value, X = 0.0 . C If illegal, write message. C C--- Arguments: C C N (I) INTEGER Number of 1st element of FVALUE to be extracted C C M (I) INTEGER Number of elements to be extracted C C X (O) REAL(M) Put extracted elements into this array C C NTOK (I) INTEGER Total number of fields (from PARSER) C C ITYP (I) INTEGER(*) =0 null field C =1 character string C =2 number C C FVALUE (I) REAL(*) Array of numbers to be extracted (from PARSER) C C_END_GTNREA C C .. Scalar Arguments .. INTEGER M,N,NTOK C .. C .. Array Arguments .. INTEGER ITYP(*) REAL X(M),FVALUE(*) C .. C .. Local Scalars .. INTEGER I,K CHARACTER LINERR*100 C .. C .. External Subroutines .. EXTERNAL LERROR C .. C DO 10 I = 1,M K = I + N - 1 X(I) = 0.0 C IF (K.LE.NTOK) THEN IF (ITYP(K).EQ.2) THEN X(I) = FVALUE(K) ELSE IF (ITYP(K).EQ.1) THEN WRITE (LINERR,FMT='(A,I4)') + ' Illegal number in field ',K C C **************************** CALL LERROR(1,0,LINERR) C **************************** C END IF END IF 10 CONTINUE END C C_BEGIN_GTNINT C ======================================== SUBROUTINE GTNINT(N,M,J,NTOK,ITYP,FVALUE) C ======================================== C Extract M integers J starting from N'th value of Parser array FVALUE, C if possible. If no value, J = 0 . If illegal, write message C C--- Arguments: C C N (I) INTEGER Number of 1st element of FVALUE to be extracted C C M (I) INTEGER Number of elements to be extracted C C J (O) INTEGER(M) Put extracted elements into this array C C NTOK (I) INTEGER Total number of fields (from PARSER) C C ITYP (I) INTEGER(*) =0 null field C =1 character string C =2 number C C FVALUE (I) REAL(*) Array of numbers to be extracted (from PARSER) C C_END_GTNINT C C .. Scalar Arguments .. INTEGER M,N,NTOK C .. C .. Array Arguments .. INTEGER J(M),ITYP(*) REAL FVALUE(*) C .. C .. Local Scalars .. INTEGER I,K CHARACTER LINERR*200 C .. C .. Intrinsic Functions .. INTRINSIC NINT C .. C .. External Subroutines .. EXTERNAL LERROR C .. C DO 10 I = 1,M K = I + N - 1 J(I) = 0 IF (K.LE.NTOK) THEN IF (ITYP(K).EQ.2) THEN J(I) = NINT(FVALUE(K)) ELSE IF (ITYP(K).EQ.1) THEN WRITE (LINERR,FMT='(A,I4)') + ' Illegal number in field ',K C C **************************** CALL LERROR(1,0,LINERR) C **************************** C END IF END IF 10 CONTINUE C END C C_BEGIN_GTPREA C ====================================== SUBROUTINE GTPREA(N,X,NTOK,ITYP,FVALUE) C ====================================== C Extract real number X from N'th value Parser array FVALUE, if possible C If no value, leave X unchanged. If illegal, write message C C--- Arguments: C C N (I) INTEGER Number of 1st element of FVALUE to be extracted C C X (O) REAL Extracted number put here C C NTOK (I) INTEGER Total number of fields (from PARSER) C C ITYP (I) INTEGER(*) =0 null field C =1 character string C =2 number C C FVALUE (I) REAL(*) Array of numbers to be extracted (from PARSER) C C_END_GTPREA C C .. Scalar Arguments .. REAL X INTEGER N,NTOK C .. C .. Array arguments .. REAL FVALUE(*) INTEGER ITYP(*) C .. C .. Local Scalars .. CHARACTER LINERR*200 C .. C .. External Subroutines .. EXTERNAL LERROR C .. C IF (N.LE.NTOK) THEN IF (ITYP(N).EQ.2) THEN X = FVALUE(N) ELSE IF (ITYP(N).EQ.1) THEN WRITE (LINERR,FMT='(A,I4)') + ' Illegal number in field ',N C C **************************** CALL LERROR(1,0,LINERR) C **************************** C END IF ELSE CALL LERROR (1, 0, 'Real number expected at end of line') END IF C END C C_BEGIN_GTPINT C ====================================== SUBROUTINE GTPINT(N,I,NTOK,ITYP,FVALUE) C ====================================== C Extract integer I from N'th value Parser array FVALUE, if possible C If no value, leave I unchanged. If illegal, write message C C--- Arguments: C C N (I) INTEGER Number of 1st element of FVALUE to be extracted C C I (O) INTEGER Extracted number put here C C NTOK (I) INTEGER Total number of fields (from PARSER) C C ITYP (I) INTEGER(*) =0 null field C =1 character string C =2 number C C FVALUE (I) REAL(*) Array of numbers to be extracted (from PARSER) C C_END_GTPINT C C .. Scalar Arguments .. INTEGER I,N,NTOK C .. C .. Arrays arguments .. REAL FVALUE(*) INTEGER ITYP(*) C .. C .. Local Scalars .. INTEGER ISTERR,IFGERR CHARACTER LINERR*100 C .. C .. External Subroutines .. EXTERNAL LERROR C .. C .. Intrinsic Functions .. INTRINSIC NINT C .. C IF (N.LE.NTOK) THEN IF (ITYP(N).EQ.2) THEN I = NINT(FVALUE(N)) ELSE IF (ITYP(N).EQ.1) THEN WRITE (LINERR,FMT='(A,I4)') + ' Illegal number in field ',N ISTERR = 1 IFGERR = 0 C C **************************** CALL LERROR(ISTERR,IFGERR,LINERR) C **************************** C END IF END IF C END C C_BEGIN_SBLANK C ============================== SUBROUTINE SBLANK(ARRAY,N1,N2) C ============================== C Blank characters N1 to N2 of ARRAY C C--- Arguments: C C ARRAY (I/O) CHARACTER(*) C C N1 (I) INTEGER C C N2 (I) INTEGER C C_END_SBLANK C CHARACTER*1 ARRAY(*) INTEGER I,N1,N2 C DO 10 I=N1,N2 ARRAY(I)=' ' 10 CONTINUE C RETURN END C C_BEGIN_CMATCH C ============================================== LOGICAL FUNCTION CMATCH(STRING1,STRING2,NCHAR) C ============================================== C C---- Compare nchar character in string1 and string2 C return cmatch .true. if all match, else .false. C C---- Arguments: C C STRING1 (I) CHARACTER*(*) 1st string to compare C C STRING2 (I) CHARACTER*(*) 2nd string to compare C C NCHAR (I) INTEGER number of characters to compare C C_END_CMATCH C CHARACTER*(*) STRING1,STRING2 INTEGER NCHAR C IF(STRING1(1:NCHAR).EQ.STRING2(1:NCHAR)) THEN CMATCH=.TRUE. ELSE CMATCH=.FALSE. ENDIF END C C_BEGIN_CHKKEY C ======================================== SUBROUTINE CHKKEY(KEY,WORDS,NWORDS,IKEY) C ======================================== C Check keyword KEY against list of NWORDS possible keywords in WORDS. C Allows abbreviated or extended keys provided they are not ambiguous. C C---- Arguments: C C KEY (I) CHARACTER*(*) Keyword for checking C C WORDS (I) CHARACTER(NWORDS)*(*) List of possible keywords C C NWORDS (I) INTEGER Number of keywords in WORDS C C IKEY (I/O) INTEGER = '?', list all words C Returns: C = keyword number found (.gt.0) C = 0 if not found or null C = -1 if ambiguous C C_END_CHKKEY C INTEGER NFMAX PARAMETER (NFMAX=20) C .. Scalar Arguments .. INTEGER NWORDS, IKEY CHARACTER KEY*(*) C .. C .. Array Arguments .. CHARACTER WORDS(NWORDS)*(*) C .. C .. Local Scalars .. INTEGER LK,I,L,NFOUND,JDO CHARACTER LINERR*200 C .. C .. Local Arrays .. INTEGER LFOUND(20) C .. C .. External Functions .. INTEGER LENSTR EXTERNAL LENSTR C .. C .. External Subroutines .. EXTERNAL PUTLIN,LERROR C .. C C---- Get minimum significant length of KEY C ( function LENSTR returns the length C of the character string excluding trailing blanks) C IKEY=0 C C *********** LK=LENSTR(KEY) C *********** C C---- Ignore null string C IF(LK.LE.0) RETURN C IF(KEY(1:1).EQ.'?') THEN C C **************** CALL PUTLIN(' Possible keywords are:','HLPWIN') C **************** C DO 10 JDO = 1,NWORDS C C **************** CALL PUTLIN(WORDS(JDO),'HLPWIN') C **************** C 10 CONTINUE C IKEY=0 RETURN ENDIF C NFOUND=0 C C---- Check all possible words in case of ambiguities C DO 20 I=1,NWORDS C C---- Key may be longer than word in list C C **************** L=MIN(LK,LENSTR(WORDS(I))) C **************** C IF(L.LE.0) GO TO 20 C C---- Find out if KEY is an initial substring of this option word C IF(INDEX(WORDS(I),KEY(1:L)).EQ.1) THEN NFOUND=NFOUND+1 C IF(NFOUND.GT.NFMAX) THEN WRITE (LINERR,FMT='(A,I5)') + ' CHKKEY: too many ambiguities : ',NFMAX C C **************************** CALL LERROR(1,0,LINERR) C **************************** C NFOUND=NFMAX ELSE LFOUND(NFOUND)=I ENDIF ENDIF 20 CONTINUE C C---- If keyword is ambiguous, list possibilities C IF(NFOUND.GT.1) THEN WRITE (LINERR,FMT='(A,A,A)') + ' Keyword ', + KEY(1:LK), + ' is ambiguous: possibilities are -' C C **************************** CALL LERROR(1,0,LINERR) C **************************** C DO 30 JDO = 1,NWORDS C C **************** CALL PUTLIN(WORDS(JDO),'HLPWIN') C **************** C 30 CONTINUE IKEY=-1 ELSEIF (NFOUND.EQ.1) THEN C C---- Success if only 1 found C IKEY=LFOUND(1) ENDIF END C C_BEGIN_PUTLIN C ================================ SUBROUTINE PUTLIN(STROUT,OUTWIN) C ================================ C---- This is a dummy PUTLIN to link with the MTZ routines mark 1 - C all it does is write the line in STROUT to lun 6. Later the C routines will be linked with the Compose-Parser etc. from Kim C where PUTLIN does a few more things ! C C---- Arguments: C C STROUT (I) CHARACTER*(*) Input line C C OUTWIN (O) CHARACTER*(*) Not used C C_END_PUTLIN C C .. Scalar Arguments .. CHARACTER OUTWIN* (*) CHARACTER STROUT* (*) C .. C .. Local Scalars .. INTEGER LUNOUT,LL,LS,LX C .. C .. External Functions .. INTEGER LENSTR EXTERNAL LENSTR C .. C .. Data statements .. DATA LUNOUT/6/ C .. C LL = LENSTR(STROUT) IF (LL.GE.132) THEN LX = 1 LS = 131 10 CONTINUE WRITE (LUNOUT,FMT=6000) STROUT(LX:LS) IF (LS.EQ.LL) GOTO 20 LX = LS + 1 LS = LS + 130 IF (LS.GT.LL) LS = LL GO TO 10 ELSE IF (LL.EQ.0) THEN WRITE(LUNOUT,FMT=6000) ELSE WRITE (LUNOUT,FMT=6000) STROUT(1:LL) END IF END IF 20 CONTINUE C C---- Format statements C 6000 FORMAT (' ',A) C END C C_BEGIN_BLANK C =============================== SUBROUTINE BLANK(OUTWIN,NLINES) C =============================== C---- This subroutine calls PUTLIN to output NLINES blank lines to the C window OUTWIN C C---- Arguments: C C OUTWIN (I) CHARACTER*6 output window C C NLINES (I) INTEGER number of blank lines to output C C_END_BLANK C C .. Scalar Arguments .. INTEGER NLINES CHARACTER OUTWIN*(*) C .. C .. Local Scalars .. INTEGER JDO10 C .. C .. External Subroutines .. EXTERNAL PUTLIN C .. C DO 10 JDO10 = 1,MAX(NLINES,1) C C ************** CALL PUTLIN(' ',OUTWIN) C ************** C 10 CONTINUE END C C_BEGIN_LERROR C ======================================= SUBROUTINE LERROR(ERRFLG,IFAIL,ERRMSG) C ======================================= C---- General error reporting subroutine, for the MTZ routines, etc C C---- Arguments: C C ERRFLG (I) INTEGER =1 output meesage as warning C =2 output message as fatal C C IFAIL (I) INTEGER =0 return after fatal error C =-1 STOP after reporting fatal error C C ERRMSG (I) CHARACTER*(*) character string containing error C message to output C C_END_LERROR C C .. Scalar Arguments .. INTEGER ERRFLG,IFAIL CHARACTER ERRMSG* (*) C .. C .. C .. External Subroutines .. EXTERNAL BLANK,PUTLIN C .. C IF (ERRFLG.EQ.1) THEN C C---- Output a warning message and return C CALL BLANK('ERRWIN',1) CALL PUTLIN('*** Warning','ERRWIN') CALL PUTLIN(ERRMSG,'ERRWIN') CALL BLANK('ERRWIN',1) C ELSE IF (ERRFLG.EQ.2) THEN C C---- Output a fatal message, and quit or return depending on IFAIL C CALL BLANK('ERRWIN',1) CALL PUTLIN('*** Error','ERRWIN') CALL PUTLIN(ERRMSG,'ERRWIN') IF (IFAIL.LT.0) THEN call ccperr(1,'*** Program Terminated ') ELSE CALL BLANK('ERRWIN',1) END IF RETURN ELSE C C---- Bad errflg, output message and continue C CALL BLANK('ERRWIN',1) CALL PUTLIN('*** Unrecognised error','ERRWIN') CALL PUTLIN(ERRMSG,'ERRWIN') CALL PUTLIN('Program continuing ...','ERRWIN') CALL BLANK('ERRWIN',1) C END IF END C C C_BEGIN_RDSYMM C ======================================================= SUBROUTINE RDSYMM(JTOK,LINE,IBEG,IEND,ITYP,FVALUE,NTOK, . SPGNAM,NUMSGP,PGNAME,NSYM,NSYMP,RSYM) C ======================================================= C---- Read and decode symmetry specification C C---- Arguments: C C JTOK (I) INTEGER Number of first field to interpret C C LINE (I) CHARACTER*(*) Input string (from PARSER) C C IBEG (I) INTEGER(*) 1st column number of tokens in field C (from PARSER) C C IEND (I) INTEGER(*) Last column number of tokens in field C (from PARSER) C C ITYP (I) INTEGER(*) =0 null field C =1 character string C =2 number C (from PARSER) C C FVALUE (I) REAL(*) Array of numbers. (from PARSER) C C NTOK (I) INTEGER The number of fields parsed. (from PARSER) C C C NSYM (I/O) INTEGER Number of symmetry operations already read, C including non-primitive. C (should be cleared to 0 at beginning) C C SPGNAM (I/O) CHARACTER*(*) Space group name C C NUMSGP (O) INTEGER Space group number C C PGNAME (O) CHARACTER*(*) Point group name C C NSYMP (O) INTEGER Number of primitive symmetry operations C C RSYM (O) REAL(4,4,*) Symmetry matrices. * should be at least =NSYM C C_END_RDSYMM C INTEGER JTOK,NTOK INTEGER IBEG(*),IEND(*),ITYP(*) REAL FVALUE(*) CHARACTER*(*)LINE,SPGNAM,PGNAME CHARACTER*20 SPGNAMS INTEGER NUMSGP,NSYM,NSYMP,LENSTR EXTERNAL LENSTR REAL RSYM(4,4,*) C C---- Look at next field on line: this can be C (a) a space-group number C (b) a space-group name, ie a string beginning P,I,R,F,A,B or C C (c) a symmetry operation (anything else) C C---- for cases (a) & (b), this is a single field: C case (c) is more than 1 field C SPGNAMS = ' ' SPGNAM = ' ' IF (JTOK.GT.NTOK) THEN CALL PUTLIN(' No symmetry data !!!','CURWIN') ELSE IF (JTOK.EQ.NTOK) THEN IF (NSYM.GT.0) THEN CALL PUTLIN('Warning: symmetry already given','CURWIN') ENDIF C C---- A single field, see if it is a number or a string C IF (ITYP(JTOK).EQ.2) THEN C C---- it's a number, treat as space-group number C NUMSGP = NINT(FVALUE(JTOK)) ELSE C C---- it's a string, treat as space-group name C SPGNAM = LINE(IBEG(JTOK) :IEND(JTOK)) CALL CCPUPC(SPGNAM) IF (SPGNAM(1:1).EQ.'R' .AND. + INDEX(SPGNAM,':H').LE.0) THEN WRITE(6,'(A,A)') 'Warning: rhombohedral axes implied', + ' - if you have hexagonal axes then use H' ENDIF NUMSGP = 0 END IF C C---- Read symmetry (all operations) from SYMOP C open symop on channel 24 - closed at end of reading C NSYMP returns number of primitive operations C C CALL MSYMLB(24,NUMSGP,SPGNAM,PGNAME,NSYMP,NSYM,RSYM) nsymp = 0 nsym = 0 CALL MSYMLB3(24,NUMSGP,SPGNAM,SPGNAMS,PGNAME,NSYMP,NSYM, + RSYM) ELSE C C C---- Read symmetry operations C NSYM = NSYM + 1 NSYMP = NSYM CALL CCPUPC(LINE) CALL SYMFR2(LINE,IBEG(JTOK),NSYM,RSYM) NUMSGP = 0 PGNAME = ' ' C END IF END IF END C C_BEGIN_RDHEAD C ====================================================== SUBROUTINE RDHEAD(JTOK,LINE,IBEG,IEND,ITYP,FVALUE,NTOK, . MTZPRT,MTZBPR) C ====================================================== C---- Read and decode HEADER command, to set print flags for MTZ headers C C---- Arguments: C C JTOK (I) INTEGER Number of first field to interpret C C LINE (I) CHARACTER*(*) Input string (from PARSER) C C IBEG (I) INTEGER(*) 1st column number of tokens in field C (from PARSER) C C IEND (I) INTEGER(*) Last column number of tokens in field C (from PARSER) C C ITYP (I) INTEGER(*) =0 null field C =1 character string C =2 number C (from PARSER) C C FVALUE (I) REAL(*) Array of numbers. (from PARSER) C C NTOK (I) INTEGER The number of fields parsed. (from PARSER) C C C MTZPRT (O) INTEGER Flag to control printout from MTZ file header C NONE sets MTZPRT = 0 C no header o/p C BRIEF sets MTZPRT = 1 (default) C brief header o/p C HISTORY sets MTZPRT = 2 C brief + mtz history C ALL sets MTZPRT = 3 C full header o/p from mtz reads C C MTZBPR (O) INTEGER Controls printout from BATCH HEADERS C NOBATCH sets MTZBPR = 0 C no batch header o/p C BATCH sets MTZBPR = 1 (default) C batch titles o/p C ORIENTATION sets MTZBPR = 2 C batch orientation also C C_END_RDHEAD C INTEGER JTOK,NTOK INTEGER IBEG(*),IEND(*),ITYP(*) REAL FVALUE(*) CHARACTER*(*) LINE INTEGER MTZPRT,MTZBPR C C Locals INTEGER I,IKEY CHARACTER KEY*12 C INTEGER NKEYS PARAMETER (NKEYS=7) CHARACTER*12 KEYS(NKEYS) DATA KEYS/'NONE','BRIEF','HISTORY','ALL', $ 'NOBATCH','BATCH','ORIENTATION'/ C C Set defaults MTZPRT = 1 MTZBPR = 1 C C Loop keywords IF (NTOK .GE. JTOK) THEN DO 10, I=JTOK,NTOK KEY = LINE(IBEG(I):IEND(I)) CALL CCPUPC(KEY) CALL CHKKEY(KEY,KEYS,NKEYS,IKEY) IF (IKEY .LE. 0) THEN CALL PUTLIN + ('Unrecognized or ambiguous subkeyword to HEADER: ' + // KEY,'CURWIN') ELSE IF (IKEY .EQ. 1) MTZPRT = 0 IF (IKEY .EQ. 2) MTZPRT = 1 IF (IKEY .EQ. 3) MTZPRT = 2 IF (IKEY .EQ. 4) MTZPRT = 3 IF (IKEY .EQ. 5) MTZBPR = 0 IF (IKEY .EQ. 6) MTZBPR = 1 IF (IKEY .EQ. 7) MTZBPR = 2 ENDIF 10 CONTINUE ENDIF END C C_BEGIN_RDCELL C ============================================== SUBROUTINE RDCELL(ITOK,ITYPE,FVALUE,NTOK,CELL) C ============================================== C---- Read and decode cell parameters C C---- Arguments: C C ITOK (I) INTEGER Number of first field to interpret C C ITYPE (I) INTEGER(*) =0 null field C =1 character string C =2 number C (from PARSER) C C FVALUE (I) REAL(*) Array of numbers. (from PARSER) C C NTOK (I) INTEGER The number of fields parsed. (from PARSER) C C CELL (O) REAL(6) Cell parameters a, b, c, alpha, beta, gamma. C C_END_RDCELL C C .. Scalar Arguments .. INTEGER ITOK,NTOK C .. C .. Array Arguments .. REAL CELL(6),FVALUE(*) INTEGER ITYPE(*) C .. C .. External Subroutines .. EXTERNAL GTPREA C .. C IF (NTOK .LT. ITOK+2) THEN CALL LERROR (1,0,'Cell a, b and c not given -- ignored') RETURN END IF CELL(4) = 90.0 CELL(5) = 90.0 CELL(6) = 90.0 C C *************************************** CALL GTPREA(ITOK,CELL(1),NTOK,ITYPE,FVALUE) CALL GTPREA(ITOK+1,CELL(2),NTOK,ITYPE,FVALUE) CALL GTPREA(ITOK+2,CELL(3),NTOK,ITYPE,FVALUE) C *************************************** C C ********************************************* IF (ITOK+3.LE.NTOK) CALL GTPREA(ITOK+3,CELL(4),NTOK,ITYPE,FVALUE) IF (ITOK+4.LE.NTOK) CALL GTPREA(ITOK+4,CELL(5),NTOK,ITYPE,FVALUE) IF (ITOK+5.LE.NTOK) CALL GTPREA(ITOK+5,CELL(6),NTOK,ITYPE,FVALUE) C ********************************************* END C C C_BEGIN_RDRESO C ================================================ SUBROUTINE RDRESO(ITOK,ITYPE,FVALUE,NTOK,RESMIN, + RESMAX,SMIN,SMAX) C ================================================ C---- Read and decode resolution limits. C C---- Arguments: C C ITOK (I) INTEGER Number of first field to interpret C C ITYPE (I) INTEGER(*) =0 null field C =1 character string C =2 number C (from PARSER) C C FVALUE (I) REAL(*) Array of numbers. (from PARSER) C C NTOK (I) INTEGER The number of fields parsed. (from PARSER) C C C RESMIN (O) REAL Minimum resolution (in As) C C RESMAX (O) REAL Maximum resolution (in As) C C SMIN (O) REAL Minimum resolution ( 4sin**2/lambda**2) C C SMAX (O) REAL Maximum resolution ( 4sin**2/lambda**2) C C_END_RDRESO C .. Scalar Arguments .. REAL RESMAX,RESMIN,SMAX,SMIN INTEGER ITOK,NTOK C .. C .. Array Arguments .. REAL FVALUE(*) INTEGER ITYPE(*) C .. C .. Local Scalars .. REAL RESTEM,STEM C .. C .. External Subroutines .. EXTERNAL GTPREA C .. C .. Intrinsic Functions .. INTRINSIC SQRT C .. C C---- Global defaults set here C RESMAX = 10000.0 RESMIN = .1 IF (NTOK.LT.ITOK) THEN CALL LERROR(1,0,'Resolution missing') RETURN END IF C C---- Look at next field on line: this can be C read resolution limits in A, if only one treat as high C resolution limit C C ************************************* CALL GTPREA(ITOK,RESMIN,NTOK,ITYPE,FVALUE) C ************************************* C IF (ABS(RESMIN).LE.0.000001) RESMIN = 0.00001 C C *************************************** IF (NTOK.GT.ITOK) + CALL GTPREA(ITOK+1,RESMAX,NTOK,ITYPE,FVALUE) C *************************************** C IF (ABS(RESMAX).LE.0.0000001) RESMAX = 100.0 C C IF (RESMIN.LE.RESMAX) THEN RESTEM = RESMAX RESMAX = RESMIN RESMIN = RESTEM END IF C C---- option to read 4sin**2/lamda**2 C IF (RESMIN.LE.1.0 .AND. RESMAX.LE.1.0) THEN C C---- swap over smin and resmin etc C SMIN = RESMIN SMAX = RESMAX RESMAX = SQRT(1.0/SMIN) RESMIN = SQRT(1.0/SMAX) ELSE SMIN = 1.0/RESMAX**2 SMAX = 1.0/RESMIN**2 END IF C C IF (SMIN.GT.SMAX) THEN STEM = SMAX SMAX = SMIN SMIN = STEM END IF C C RETURN END C C C_BEGIN_RDSCAL C ====================================================== SUBROUTINE RDSCAL(ITOK,LINE,IBEG,IEND,ITYP,FVALUE,NTOK, . NLPRGI,LSPRGI,ILPRGI,SCAL,BB) C ====================================================== C---- Read and decode SCALE . C C---- Arguments: C C ITOK (I/O) INTEGER Input: number of first field to interpret C Output: number of next token to interpret (.gt. 0) C = 0 if line exhausted (SCAL & BB OK) C = -1 if no scale given C = -2 unrecognized label C C LINE (I) CHARACTER*(*) Input string (from PARSER) C C IBEG (I) INTEGER(*) 1st column number of tokens in field C (from PARSER) C C IEND (I) INTEGER(*) Last column number of tokens in field C (from PARSER) C C ITYP (I) INTEGER(*) =0 null field C =1 character string C =2 number C (from PARSER) C C FVALUE (I) REAL(*) Array of numbers. (from PARSER) C C NTOK (I) INTEGER The number of fields parsed. (from PARSER) C C LSPRGI (I) CHARACTER(*)*30 Program label strings. C L(abel) S(tring) PRG(ram) I(nput) C C NLPRGI (I) INTEGER Number of label strings in LSPRGI C C ILPRGI (O) INTEGER Number in array of LSPRGI whose scale has been reset C C SCAL (O) REAL Scale factor, no default C C BB (O) REAL Temperature factor, default = 0.0 C C_END_RDSCAL C INTEGER ITOK,NTOK,ILPRGI,NLPRGI,JDO INTEGER IBEG(*),IEND(*),ITYP(*) REAL FVALUE(*) CHARACTER*(*) LINE CHARACTER*30 LSPRGI(*),CWORK REAL SCAL,BB C CWORK = LINE(IBEG(ITOK) :IEND(ITOK)) DO 10 JDO = 1,NLPRGI C IF (CWORK.EQ.LSPRGI(JDO)) GO TO 20 C 10 CONTINUE C C *********************** CALL PUTLIN('**** Error input assignment does not match'// + ' program labels','ERRWIN') C *********************** C ITOK = -2 RETURN C 20 ILPRGI = JDO IF(ITOK+1.GT.NTOK) THEN ITOK = -1 RETURN ELSE IF (ITYP(ITOK+1) .EQ. 2) THEN CALL GTPREA(ITOK+1,SCAL,NTOK,ITYP,FVALUE) ELSE ITOK = -1 RETURN ENDIF ENDIF C BB = 0 IF(ITOK+2.LE.NTOK) THEN IF (ITYP(ITOK+2) .EQ. 2) THEN CALL GTPREA(ITOK+2,BB,NTOK,ITYP,FVALUE) ITOK = ITOK + 3 ELSE ITOK = ITOK + 2 ENDIF IF (ITOK .GT. NTOK) ITOK = 0 ELSE ITOK = 0 ENDIF C RETURN END C C C_BEGIN_RDRESL C ====================================================== SUBROUTINE RDRESL(ITOK,ITYPE,FVALUE,CVALUE,NTOK,RESMIN, + RESMAX,SMIN,SMAX,ISTAT) C ====================================================== C---- Read and decode resolution limits. C Subkeywords in CVALUE recognized: C LOW read next number as low resolution limit C HIGH read next number as high resolution limit C C If LOW & HIGH are both present, the limits will still be swapped C to the correct order C C If only LOW or HIGH are given, the unset limit (ie either RESMAX, SMAX C or RESMIN, SMIN) will be set to -1.0. If only one number is given, C it is treated as a high resolution limit C C If both limits are given without keywords, and both are .lt. 1.0, c it is assumed that the limits are 4(sin theta/lambda)**2 rather than A C C---- Arguments: C C ITOK (I) INTEGER Number of first field to interpret C C ITYP (I) INTEGER(*) =0 null field C =1 character string C =2 number C (from PARSER) C C FVALUE (I) REAL(*) Array of numbers. (from PARSER) C C NTOK (I) INTEGER The number of fields parsed. (from PARSER) C C CVALUE (I) CHARACTER(*)*4 Parsed tokens from program input. (from PARSER) C C RESMIN (O) REAL Minimum resolution (in As) (ie low resolution) C C RESMAX (O) REAL Maximum resolution (in As) (ie high resolution) C C SMIN (O) REAL Minimum resolution ( 4sin**2/lambda**2) C (ie low resolution) C C SMAX (O) REAL Maximum resolution ( 4sin**2/lambda**2) C (ie high resolution) C C ISTAT (O) INTEGER =0 OK C =-1 illegal subkeyword C =+1 no limits set C =+2 illegal number (probably can't happen) C_END_RDRESL C C .. Scalar Arguments .. REAL RESMAX,RESMIN,SMAX,SMIN INTEGER ITOK,NTOK,ISTAT C .. C .. Array Arguments .. REAL FVALUE(*) INTEGER ITYPE(*) CHARACTER*4 CVALUE(*) C .. C .. Local Scalars .. REAL RESTEM,STEM INTEGER N, KMNMX, NSET, LFLAG, NKEYS, IKEY LOGICAL BOTH, KEYWRD CHARACTER*4 SUBKEY(2) C .. C .. External Subroutines .. EXTERNAL GTTREA, CCPUPC, CHKKEY C .. C .. Intrinsic Functions .. INTRINSIC SQRT C .. DATA SUBKEY /'LOW', 'HIGH'/ DATA NKEYS /2/ C C---- Global defaults set here C RESMAX = -1.0 RESMIN = -1.0 SMIN = -1.0 SMAX = -1.0 NSET = 0 KMNMX = 1 ISTAT = 0 BOTH = .TRUE. KEYWRD = .FALSE. C N = ITOK C 1 IF (N .LE. NTOK) THEN C IF (ITYPE(N) .EQ. 1) THEN C String CALL CCPUPC(CVALUE(N)) CALL CHKKEY(CVALUE(N),SUBKEY,NKEYS,IKEY) IF(IKEY.LE.0) THEN ISTAT = -1 RETURN C ====== ELSEIF (IKEY .EQ. 1) THEN C----- subkey LOW KMNMX = 1 ELSEIF (IKEY .EQ. 2) THEN C----- subkey HIGH KMNMX = 2 ENDIF BOTH = .NOT. BOTH KEYWRD = .TRUE. ELSE C Number RESTEM = 0.0 C ****************************************** CALL GTTREA(N,RESTEM,LFLAG,NTOK,ITYPE,FVALUE) C ****************************************** IF (LFLAG .EQ. 0) THEN IF (KMNMX .EQ. 1) THEN RESMIN = RESTEM NSET = NSET+1 KMNMX = 2 ELSEIF (KMNMX .EQ. 2) THEN RESMAX = RESTEM NSET = NSET+1 KMNMX = 1 ENDIF ELSE ISTAT = +2 ENDIF ENDIF N = N+1 GO TO 1 ENDIF C C Have any numbers been set? IF (NSET .EQ. 0) THEN ISTAT = +1 RETURN C ====== ELSEIF (NSET .EQ. 1) THEN C One only set, if no keywords have been defined, use single number as C high resolution limit IF (BOTH) THEN RESMAX = RESMIN RESMIN = -1.0 ENDIF ENDIF C C---- option to read 4sin**2/lamda**2 IF (.NOT. KEYWRD .AND. NSET .EQ. 2) THEN IF (RESMIN .GT. 0.0 .AND. RESMIN .LE. 1.0 .AND. $ RESMAX .GT. 0.0 .AND. RESMAX .LE. 1.0) THEN C---- swap over SMIN and RESMIN C SMIN = RESMIN RESMIN = SQRT(1.0/SMIN) C---- swap over SMAX and RESMAX SMAX = RESMAX RESMAX = SQRT(1.0/SMAX) END IF ENDIF C IF (RESMIN .GT. 0.0) THEN SMIN = 1.0/RESMIN**2 END IF C IF (RESMAX .GT. 0.0) THEN SMAX = 1.0/RESMAX**2 ENDIF C C---- Check that they are in the correct order, if both limits read C IF (NSET .EQ. 2) THEN IF (RESMIN.LE.RESMAX) THEN RESTEM = RESMAX RESMAX = RESMIN RESMIN = RESTEM ENDIF IF (SMIN.GT.SMAX) THEN STEM = SMAX SMAX = SMIN SMIN = STEM ENDIF ENDIF END C C_BEGIN_GTTREA C ============================================= SUBROUTINE GTTREA(N,X,LFLAG,NTOK,ITYP,FVALUE) C ============================================= C---- Extract real number X from N'th value of Parser array FVALUE, C if possible. C C If no value, leave X unchanged. If illegal, write message C C---- Arguments: C C N (I) INTEGER Number of 1st element of FVALUE to be extracted C C X (O) REAL Put extracted number here C C LFLAG (O) INTEGER = 0 OK (valid number or null field) C = -1 beyond end of line C = +1 illegal number C C NTOK (I) INTEGER Total number of fields (from PARSER) C C ITYP (I) INTEGER(*) =0 null field C =1 character string C =2 number C (from PARSER) C C FVALUE (I) REAL(*) Array of numbers to be extracted (from PARSER) C C_END_GTTREA C C .. Scalar Arguments .. REAL X INTEGER N,NTOK,LFLAG C .. C .. Array arguments .. REAL FVALUE(*) INTEGER ITYP(*) C .. C .. Local Scalars .. CHARACTER LINERR*200 C .. C .. External Subroutines .. EXTERNAL LERROR C .. C LFLAG = 0 IF (N.LE.NTOK) THEN IF (ITYP(N).EQ.2) THEN X = FVALUE(N) ELSE IF (ITYP(N).EQ.1) THEN WRITE (LINERR,FMT='(A,I4)') + ' Illegal number in field ',N C C **************************** CALL LERROR(1,0,LINERR) C **************************** C LFLAG = +1 END IF ELSE LFLAG = -1 END IF C END C C_BEGIN_GTTINT C ============================================= SUBROUTINE GTTINT(N,I,LFLAG,NTOK,ITYP,FVALUE) C ============================================= C---- Extract integer I from N'th value of Parser array FVALUE, C if possible. C C If no value, leave I unchanged. If illegal, write message. C C---- Arguments: C C N (I) INTEGER Number of 1st element of FVALUE to be extracted C C I (O) INTEGER Put extracted number here C C LFLAG (O) INTEGER = 0 OK (valid number or null field) C = -1 beyond end of line C = +1 illegal number C C NTOK (I) INTEGER Total number of fields (from PARSER) C C ITYP (I) INTEGER(*) =0 null field C =1 character string C =2 number C (from PARSER) C C FVALUE (I) REAL(*) Array of numbers to be extracted (from PARSER) C C_END_GTTINT C C IMPLICIT NONE C .. Scalar Arguments .. INTEGER I,N,NTOK,LFLAG C .. C .. Arrays arguments .. REAL FVALUE(*) INTEGER ITYP(*) C .. C .. Local Scalars .. CHARACTER LINERR*100 C .. C .. External Subroutines .. EXTERNAL LERROR C .. C .. Intrinsic Functions .. INTRINSIC NINT C .. C LFLAG = 0 IF (N.LE.NTOK) THEN IF (ITYP(N).EQ.2) THEN I = NINT(FVALUE(N)) ELSE IF (ITYP(N).EQ.1) THEN WRITE (LINERR,FMT='(A,I4)') ' Illegal number in field ',N C C **************************** CALL LERROR(1,0,LINERR) C **************************** C LFLAG = +1 END IF ELSE LFLAG = -1 END IF END C C_BEGIN_RDATOMSELECT C ================================================================== SUBROUTINE RDATOMSELECT(JTOK,INAT0,INAT1,IRES0,IRES1,CHNAM, + IMODE,NTOK,LINE,IBEG,IEND,ITYP,IDEC, + FVALUE,IFAIL) C ================================================================== C C Subroutine to process atom selection keyword with the following C general syntax: C C ATOM [ [TO] ] | C RESIDUE [ALL | ONS | CA] [ CHAIN ] C [ [TO] ] C C e.g. kywd atom 1 to 100 C kywd residue chain A 20 to 30 C kywd residue all 11 32 etc... C C To be compatible with DISTANG, CONTACT etc the ordering of the C RESIDUE subarguments is flexible, eg RESIDUE 1 TO 9 CA CHAIN B C is the same as RESIDUE CA CHAIN B 1 TO 9... C C The subroutine returns the selection entered by the user and expects the C calling program to deal with the results. The preceeding keywords are C relevant for this subroutine C C ARGUMENTS C ========= C C JTOK (I) INTEGER Number of first field to interpret C NTOK (I) INTEGER The number of fields parsed, from PARSER C LINE (I) CHARACTER*(*) Input string, from PARSER C IBEG (I) INTEGER(*) 1st column number of tokens in field C (from PARSER) C IEND (I) INTEGER(*) Last column number of tokens in field C (from PARSER) C ITYP (I) INTEGER(*) =0 null field C =1 character string C =2 number (from PARSER) C IDEC (I) INTEGER(*) Number of characters/digits in each token C (from PARSER) C FVALUE (I) REAL(*) Array of numbers. (from PARSER) C C INAT0 (O) INTEGER Lower limit of atom range (-99 if not set) C INAT1 (O) INTEGER Upper limit of atom range (-99 if not set) C IRES0 (O) INTEGER Lower limit of residue range (-99 if not set) C IRES1 (O) INTEGER Upper limit of residue range (-99 if not set) C CHNAM (O) CHARACTER*(*) Chain identifier (' ' if not set) C IMODE (I/O) INTEGER On entry: -1 = don't allow MODE C any other value = allow MODE C On exit: Type of atoms to include: C 1=ALL 2=ONS 3=CA (see eg CONTACT) C IFAIL (I/O) INTEGER On entry: 0 = suppress warnings C -1 = print warnings C On exit: 0 = LINE parsed ok C >0 = error occured parsing line C (value of IFAIL is no. of bad token) C C RETURNED VALUES C =============== C C The subroutine returns either: C C 1. first/last atom numbers, defining a range of atoms, or C 2. first/last residue numbers, defining a range of residues, plus C (optionally) chain identifier C (optionally) a MODE which specifies which type of atoms to C include: all = (default) all atoms in residue range C ons = only oxygen and nitrogen atoms C ca = only CA atoms C (see CONTACT/DISTANG) C C Unset atoms/residue numbers will be returned < 0 (i.e. -99) C Unset chain identifier will be returned as a blank, i.e. ' ' C Mode defaults to 1 = include all types of atoms. C C_END_RDATOMSELECT C IMPLICIT NONE C C ..Parameters INTEGER MAXTOK PARAMETER (MAXTOK=20) C C ..Scalar arguments INTEGER NTOK,JTOK,INAT0,INAT1,IRES0,IRES1,IMODE,IFAIL CHARACTER LINE*80,CHNAM*(*) C C ..Array arguments INTEGER IBEG(MAXTOK),IEND(MAXTOK),ITYP(MAXTOK),IDEC(MAXTOK) REAL FVALUE(MAXTOK) C C ..Local scalars INTEGER ITOK,NLIMIT,TEMP CHARACTER KEY*4,ERRLINE*80 LOGICAL LATOM,LRESI,LCHAIN,LLIMIT C C ..Local arrays INTEGER ILIMIT(2) C C ..External subroutines/functions EXTERNAL CCPUPC,CCPERR C C---- Initial checks C IF (NTOK.GT.MAXTOK) THEN ERRLINE = 'RD_KEY_SELECT: too many arguments' GO TO 9010 END IF C IF (JTOK.LT.1 .OR. JTOK.GT.NTOK) THEN ERRLINE = 'RD_KEY_SELECT: JTOK out of range' GO TO 9010 END IF C C---- Initialise values C INAT0 = -99 INAT1 = -99 LATOM = .FALSE. IRES0 = -99 IRES1 = -99 CHNAM = ' ' C C---- IMODE C IF (IMODE.NE.-1) IMODE = 0 C C---- Flags for modes C LATOM = .FALSE. LRESI = .FALSE. LCHAIN = .FALSE. LLIMIT = .FALSE. NLIMIT = 0 ERRLINE = ' ' C C---- Step through line token at a time C ITOK = JTOK C 9000 CONTINUE KEY = LINE(IBEG(ITOK):IEND(ITOK)) CALL CCPUPC(KEY) C C---- ATOM C ==== IF (KEY(1:4).EQ.'ATOM') THEN IF (LATOM.OR.LRESI) ERRLINE = 'Multiple ATOM/RESidue keywords' LATOM = .TRUE. C C---- RESIDUE C ======= ELSE IF (KEY(1:3).EQ.'RES') THEN IF (LATOM.OR.LRESI) ERRLINE = 'Multiple ATOM/RESidue keywords' LRESI = .TRUE. C C---- MODE: CA / ONS / ALL C ==================== ELSE IF (KEY(1:3).EQ.'ALL'.OR. + KEY(1:3).EQ.'ONS'.OR. + KEY(1:2).EQ.'CA') THEN C IF (IMODE.EQ.-1) + ERRLINE = 'ALL/ONS/CA: invalid specifiers' IF (.NOT.LRESI) + ERRLINE = 'ALL/ONS/CA not allowed without RESidue' IF (IMODE.GT.0) ERRLINE = 'Only one of CA/ONS/ALL allowed' C IF (KEY(1:3).EQ.'ALL') IMODE = 1 IF (KEY(1:3).EQ.'ONS') IMODE = 2 IF (KEY(1:2).EQ.'CA') IMODE = 3 C C---- CHAIN C ============= ELSE IF (KEY(1:4).EQ.'CHAI') THEN IF (.NOT.LRESI) ERRLINE = 'CHAIN only allowed after RESidue' IF (LCHAIN) ERRLINE = 'Only one CHAIN allowed per line' ITOK = ITOK + 1 IF (ITYP(ITOK).EQ.1 .AND. IDEC(ITOK).LE.2) THEN CHNAM = LINE(IBEG(ITOK):IEND(ITOK)) LCHAIN = .TRUE. ELSE ERRLINE = 'Chain name should be one or two characters' END IF C C---- Number ... C ========== C C These are atom or residue limits ... Process them all together C The possibilities are: 1 number, 2 numbers or 2 numbers separated C by "TO" ELSE IF (ITYP(ITOK).EQ.2) THEN IF (.NOT.(LATOM .OR. LRESI)) + ERRLINE = ' Missing ATOM or RESIDUE keyword' IF (LLIMIT) + ERRLINE = ' Already read a set of atom/residue limits' ILIMIT(1) = INT(FVALUE(ITOK)) ITOK = ITOK + 1 NLIMIT = NLIMIT + 1 C C Check the next argument - is it "TO"? IF (ITYP(ITOK).EQ.1) THEN KEY = LINE(IBEG(ITOK):IEND(ITOK)) CALL CCPUPC(KEY) IF (KEY(1:2).EQ.'TO') THEN IF(ITYP(ITOK+1).NE.2 .OR. ITOK.EQ.NTOK) + ERRLINE = 'TO should be followed by a number' ITOK = ITOK + 1 END IF END IF C C Check if the next argument is the second limit IF (ITYP(ITOK).EQ.2) THEN ILIMIT(2) = INT(FVALUE(ITOK)) NLIMIT = NLIMIT + 1 ELSE C C Otherwise, need to step back one token for next round ITOK = ITOK - 1 END IF LLIMIT = .TRUE. C C---- Check for TO out of place C ELSE IF (KEY(1:2).EQ.'TO') THEN ERRLINE = 'TO out of place' C C---- Keyword unrecognised otherwise C ELSE write(6,*)key ERRLINE = 'Unrecognised subkeyword' END IF C C---- Use ERRLINE to trap errors C IF (ERRLINE.NE.' ') GO TO 9010 C C---- Parse some more? C ITOK = ITOK + 1 IF (ITOK.LE.NTOK) GO TO 9000 C C---- Sort out the input C IF (NLIMIT.EQ.0) THEN ERRLINE = 'Atom/residue limits unspecified' GO TO 9010 ELSE IF (NLIMIT.EQ.1) THEN ILIMIT(2) = ILIMIT(1) ELSE IF (ILIMIT(1).GT.ILIMIT(2)) THEN TEMP = ILIMIT(1) ILIMIT(1) = ILIMIT(2) ILIMIT(2) = TEMP END IF C IF (LATOM) THEN INAT0 = ILIMIT(1) INAT1 = ILIMIT(2) ELSE IRES0 = ILIMIT(1) IRES1 = ILIMIT(2) END IF C IF (IMODE.EQ.0) IMODE = 1 C IFAIL = 0 RETURN C C---- Errors come to here C 9010 IF (IFAIL.LT.0) CALL CCPERR(2, ERRLINE) IFAIL = ITOK RETURN C END libccp4-8.0.0/fortran/plot84lib.f0000644000000000000000000133457714242731033014653 0ustar 00000000000000C C plot84lib.f C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C C C---- Subroutines in PLOT84.FORT C =========== C C initvt640.f C C GSbarx.f GSbftm.f GSblkd.f GScetx.f GScfsz.f C GSclpl.f GSclpt.f GSclts.f GScvax.f GSddrb.f C GSdrmv.f GSdvon.f GSedtr.f GSedvc.f GSedvp.f C GSenvr.f GSewnd.f GSewsc.f GSfram.f GSgch0.f C GSgchc.f GSgchf.f GSgsym.f GShair.f GSinit.f C GSintm.f GSinum.f GSline.f GSlras.f GSlrsb.f C GSlvck.f GSmuct.f GSoflw.f GSpict.f GSprtm.f C GSquik.f GSrdtm.f GSrfnt.f GSrstm.f GSsftm.f C GSsltm.f GSstrc.f GSstrd.f GSstyl.f GSsusp.f C GSsvtm.f GSswln.f GStimr.f GStmpy.f GStric.f C GStril.f GStsav.f GStyon.f GSutrn.f GSvcln.f C GSview.f GSxytm.f C C axis.f bopenw.f chncol.f crtGS.f drawpc.f C dtext.f findpc.f fread.f frtqrw.f getscl.f C helptxt.f initriplot.f iread.f irot.f nextpc.f C oldtril.f GScfix.f GScvlf.f GScvli.f GScvsc.f C GStxt.f qzread.f qzwrit.f rplot.f scale.f C settbl.f setvp.f string.f symbol.f zero.f C C---- Entry points in PLOT84.FORT C --------------------------- C C initvt640.f: ENTRY SELECTVT640() C ENTRY MOVEVT640(IX,IY) C ENTRY DRAWVT640(IX,IY) C ENTRY POINTVT640(IX,IY) C ENTRY TEXTVT640(BYTXT,NCHARS,ISIZE) C ENTRY XHAIRVT640(IX,IY,ICODE) C ENTRY DOTSONVT640() C ENTRY DOTSOFFVT640() C ENTRY DOTSCOMPVT640() C ENTRY SELECTVT100() C ENTRY MOVEVT100(IX,IY) C ENTRY CLEARVT100() C ENTRY BUFFVT640(ITERM,NBYTE) C ENTRY COORDVT640(ITERM,IX,IY,NBYTE) C C GSbarx.f: ENTRY GSBARY(CENT,YDIFF,WL,WR,NUM) C C GScetx.f: ENTRY GSCETS(TEXT,SIZ1,SIZ2,NJUST) C C GSddrb.f: ENTRY GSDOTB(XB,YB) C ENTRY GSMDRB(XB,YB) C ENTRY GSVBRK() C C GSdrmv.f: ENTRY GSDWTO(X,Y) C ENTRY GSDWBY(X,Y) C ENTRY GSPOIN(X,Y) C ENTRY GSMVTO(X,Y) C ENTRY GSMVBY(X,Y) C C GSdvon.f: ENTRY GSDVOF() C C GSedvp.f: ENTRY GSEBSZ(DWLIM1,DWLIM2) C C GSenvr.f: ENTRY GSXENV() C ENTRY GSDVIC(NN1,NN2) C ENTRY GSBSIZ(XX1,YY1) C ENTRY GSDVPT(XX1,XX2,YY1,YY2) C ENTRY GSWNDB(XX1,XX2,YY1,YY2) C ENTRY GSWSCL(NN1,NN2) C ENTRY GSDTRN(XX1,YY1) C C GSgch0.f: ENTRY GSGSY0(ISYMB,XCOFF,YCOFF,SIZX,SIZY) C C GSgchc.f: ENTRY GSGCHS(CHAR1,XCOFF,YCOFF,SIZ1,SIZ2,KFONT) C ENTRY GSGCHI(NLETT,XCOFF,YCOFF,KFONT) C ENTRY GSGCHH(NCHAR,XCOFF,YCOFF,KFONT) C C GSgsym.f: ENTRY GSGSYS(NSYMB,NSET,XCOFF,YCOFF,SIZX,SIZY) C ENTRY GSGSYC(CHAR1,NSET,XCOFF,YCOFF,SIZX,SIZY) C C GSinit.f: ENTRY GSTITL(TITL) C ENTRY GSPRNT(JPRINT) C C GSintm.f: ENTRY GSONTM(IUTERM) C ENTRY GSOFTM(IUTERM) C ENTRY GSSCTM() C ENTRY GSGRTM() C ENTRY GSMVTM(IX,IY) C ENTRY GSDWTM(IX,IY) C ENTRY GSPTTM(IX,IY) C ENTRY GSHRTM(IX,IY,CHKEY) C ENTRY GSTXTM(STRING,ISIZE) C ENTRY GSTYTM() C ENTRY GSMYTM(IX,IY) C ENTRY GSCYTM() C ENTRY GSDOTM() C ENTRY GSERTM() C ENTRY GSRVTM() C ENTRY GSLSTM(ITYPE) C ENTRY GSBLTM() C C GSinum.f: ENTRY GSFNUM(FNUM,NDIGIT,NAFTER,SIZX,SIZY,NJUST) C ENTRY GSENUM(ENUM,NDIGIT,NAFTER,SIZX,SIZY,NJUST) C C GSoflw.f: ENTRY GSOFLR(IUNITP,GSNAM) C ENTRY GSCFIL(IUNITP) C ENTRY GSWHDR() C ENTRY GSFLWI(IX,IY) C ENTRY GSUHDR() C ENTRY GSRHDR(KEOF) C ENTRY GSFLRI(IX,IY,KKEOF) C ENTRY GSFLP1() C ENTRY GSFLBR(NBYTE) C ENTRY GSFLSR(NBYTE) C ENTRY GSFLWR(IARRAY,NBYTE) C ENTRY GSFLRR(IARRAY,NBYTE,KKKEOF) C C GSpict.f: ENTRY GSWAIT(NSEC) C ENTRY GSENDP() C ENTRY GSSTOP() C C GSstrc.f: ENTRY GSSTRS(TEXT,SIZX,SIZY) C ENTRY GSSTRH(BYTXT,NLETT) C ENTRY GSSTR2(ITEXT2,NLETT) C ENTRY GSSTR4(ITEXT4,NLETT) C C GSstrd.f: ENTRY GSSTRU(TEXT,DX,DY) C ENTRY GSMIXC(MCOLOR) C C GSstyl.f: ENTRY GSLNWT(LWT) C ENTRY GSCOLR(ICOLR) C ENTRY GSPAPR(X) C ENTRY GSFONT(N) C ENTRY GSERAS() C ENTRY GSEREV() C ENTRY GSERAX() C C GStimr.f: ENTRY GSTIM0(ITPRNT) C C GStsav.f: ENTRY GSTRES(NTRSAV) C C GStyon.f: ENTRY GSTYOF() C C GSutrn.f: ENTRY GSSCLU(A,B) C ENTRY GSUROT(A,B) C ENTRY GSUMAT(TMAT) C ENTRY GSORGD(X,Y) C ENTRY GSORGU(X,Y) C ENTRY GSSCLC(A,B) C ENTRY GSCROT(A,B) C ENTRY GSCMAT(TMAT) C ENTRY GSORGC(X,Y) C ENTRY GSCSPA(A,B) C ENTRY GSCSPU(N) C ENTRY GSCENC(N) C ENTRY GSANCD(X,Y) C ENTRY GSANCU(X,Y) C ENTRY GSFCUR(X,Y) C ENTRY GSPCUR(X,Y) C ENTRY GSSCUR(XCGAP) C ENTRY GSLNFD(YCDOWN) C ENTRY GSTLNK(N) C ENTRY GSCMOD(N) C C SUBROUTINE AXIS(X,Y,LABEL,NSIDE,AXLEN,ANGLE,FVAL,DV) C ==================================================== C C---- Draw axes with labels for graphs C A.D. MCLACHLAN JULY 1984. LAST UPDATED 27 JUL 1984. C ADAPTED FROM D.A. AGARD PLOT82 C C (X,Y) = starting coordinates for axis generation (real) C LABEL = character text string for labeling the axis C NSIDE = +1 OR -1 C = + = annotations generated above axis C = - = annotations generated below axis C AXLEN = axis length in user units (real) C axis is marked every 1.0 user units C so user scale needs to be set properly C ANGLE = angle in degrees at which axis is drawn (real) C FVAL = first annotation value (real) C DV = delta annotation value (real) C C---- Character height is automatically set to be independent C of global scale C C---- Remove trailing blanks from label C max 40 characters to plot 5mm wide C C .. Scalar Arguments .. REAL ANGLE,AXLEN,DV,FVAL,X,Y INTEGER NSIDE CHARACTER LABEL* (*) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. REAL ADV,ANGFAC,ANL,COSA,DX,DY,EXABS,EXPDV,HGT,PI,QMAX,SIDE,SINA, + SIZE,THETA,USCALY,VAL,WIDL,XX,YY INTEGER I,IADV,IEXPDV,IVAL,JDIG,LABLEN,NAFTER,NDIGIT,NJUST,NTIC C .. C .. Local Arrays .. INTEGER NTRSAV(48) C .. C .. External Functions .. INTEGER LENSTR EXTERNAL LENSTR C .. C .. External Subroutines .. EXTERNAL GSANCU,GSCENC,GSCROT,GSCSPA,GSDWTO,GSFNUM, + GSFONT,GSINUM,GSMVTO,GSSCLC,GSSTRS,GSTRES, + GSTSAV C .. C .. Intrinsic Functions .. INTRINSIC ABS,ATAN2,COS,SIN C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (NTRSAV(11),USCALY) C .. C LABLEN = LENSTR(LABEL) IF (LABLEN.GT.40) LABLEN = 40 C PI = ATAN2(1.0,1.0)*4.0 ANGFAC = PI/180.0 C C---- Save current character and user scaling C CALL GSTSAV(NTRSAV) C C---- Set up scale for characters C this scaling results in a unit hgt=1.0 mm C for letter sizes independent of user scale "uscaly" . C HGT = (1.0/FLOAT(NTRSAV(11))) CALL GSSCLC(HGT,HGT) THETA = ANGLE*ANGFAC CALL GSCROT(THETA,THETA+PI/2.0) C C---- Centred characters with uniform spacing C CALL GSCENC(1) CALL GSCSPA(0.0,0.0) C C---- locate which side of axis to annotate and label C SIDE = +1.0 IF (NSIDE.LT.0) SIDE = -1.0 C C---- This section tries to rescale dv into a range from 0.01 to 99.0 C Determine value of 'dv' exponent C EXPDV = 0.0 ADV = ABS(DV) C C---- Zero delta annotation value? C IF (ADV.NE.0.0) THEN 10 CONTINUE C C---- 'DV' exponent calculation completed? C divide by 10.0 till lt. 99.0 C IF (ADV.GE.99.0) THEN ADV = ADV/10.0 EXPDV = EXPDV + 1.0 GO TO 10 END IF 20 CONTINUE C C---- 'DV' exponent calculation completed? C IF (ADV.LT.0.01) THEN C C---- multiply by 10.0 till ge. 0.01 C ADV = ADV*10.0 EXPDV = EXPDV - 1.0 GO TO 20 END IF END IF C C---- compute normalized 'fval' and 'dv' scaled by (10**-expdv) C VAL = (10.0** (-EXPDV))*FVAL ADV = (10.0** (-EXPDV))*DV EXABS = ABS(EXPDV) + 0.5 IEXPDV = EXABS IF (EXPDV.LT.0) IEXPDV = -IEXPDV C C---- check number of digits after decimal point C NTIC = AXLEN + 1.0 JDIG = 2 QMAX = (NTIC-1)*ADV + VAL IF (QMAX.GT.99.99) JDIG = 1 IADV = ADV IVAL = VAL IF ((ADV.EQ.IADV) .AND. (IVAL.EQ.VAL)) JDIG = 0 C C---- set up positioning constants for numbers C SINA = SIN(THETA) COSA = COS(THETA) C C---- numbers left justified and 7.0 mm above/below axis size 4mm C numbers offset by 4mm to left C DX = -4.0*HGT DY = 7.0*SIDE*HGT XX = DX*COSA + X - DY*SINA YY = DY*COSA + Y + DX*SINA C C---- annotate axis in user units 1.0 units at a step C CALL GSFONT(1) DO 30 I = 1,NTIC CALL GSANCU(XX,YY) NJUST = 1 NAFTER = JDIG NDIGIT = JDIG SIZE = 4.0 CALL GSFNUM(VAL,NDIGIT,NAFTER,SIZE,SIZE,NJUST) VAL = VAL + ADV XX = XX + COSA YY = YY + SINA 30 CONTINUE IF (LABLEN.GT.0) THEN C C---- label axis with lablen characters and possibly the expdv value C ANL = LABLEN C C---- does 'dv' exponent exist? C IF (IEXPDV.NE.0) ANL = LABLEN + 5 C C---- centre the label letters 5mm high centred 14mm above/below axis C SIZE = 5.0 WIDL = 5.0*ANL DX = 0.5*AXLEN - 0.5*WIDL*HGT DY = 14.0*SIDE*HGT XX = DX*COSA + X - DY*SINA YY = DY*COSA + Y + DX*SINA CALL GSANCU(XX,YY) CALL GSSTRS(LABEL,SIZE,SIZE) C C---- no 'dv' exponent to plot? C IF (IEXPDV.NE.0) THEN C C---- plot exponent label ' *10' C CALL GSSTRS(' *10',SIZE,SIZE) C C---- plot value of exponent as superscript 13mm above/below axis size 3mm C XX = (WIDL*COSA-1.0*SINA)*HGT + XX YY = (WIDL*SINA+1.0*COSA)*HGT + YY C C---- plot -iexpdv label values multiplied by 10.0**-iexpdv give true values C CALL GSANCU(XX,YY) NJUST = 1 NDIGIT = 1 SIZE = 3.0 CALL GSINUM(-IEXPDV,NDIGIT,SIZE,SIZE,NJUST) END IF END IF C C---- draw axis and tic marks normally 3mm long C DX = -3.0*SIDE*SINA*HGT DY = +3.0*SIDE*COSA*HGT XX = X - COSA YY = Y - SINA CALL GSMVTO(X,Y) DO 40 I = 1,NTIC XX = XX + COSA YY = YY + SINA CALL GSDWTO(XX,YY) CALL GSMVTO(XX+DX,YY+DY) CALL GSDWTO(XX,YY) 40 CONTINUE C C---- draw last bit of axis if required C XX = AXLEN*COSA + X YY = AXLEN*SINA + Y CALL GSDWTO(XX,YY) C C---- restore character scale C CALL GSTRES(NTRSAV) C C END C C C SUBROUTINE BOPENW C ================= C C C A.D. MCLACHLAN JULY 1984. LAST UPDATED 9 JULY 1984 C C .. Scalar Arguments .. INTEGER IFLAG3,IFLAG4,IX,IY C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. INTEGER IFLAG2,IFLAG5 C .. C .. External Subroutines .. EXTERNAL GSFLRI,GSFLWI,GSRHDR,GSUHDR,GSWHDR C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C CALL GSWHDR RETURN C ENTRY BWRITE(IX,IY) C =================== C CALL GSFLWI(IX,IY) RETURN C ENTRY BCLOSE() C ============ C CALL GSUHDR RETURN C ENTRY BOPENR(IFLAG3) C =================== C IFLAG3 = 0 IFLAG2 = 0 CALL GSRHDR(IFLAG2) IF (IFLAG2.EQ.1) THEN GO TO 10 ELSE RETURN END IF C ENTRY BREAD(IX,IY,IFLAG4) C ======================== C IFLAG4 = 0 IFLAG5 = 0 CALL GSFLRI(IX,IY,IFLAG5) IF (IFLAG5.NE.1) RETURN 10 IFLAG3 = 1 IFLAG4 = 1 C END C C C SUBROUTINE CRTGS(GSNAM,JCOLOR) C =============================== C C A.D. MCLACHLAN JULY 1984. LAST UPDATED 10 SEP 1984 C C .. Parameters .. REAL DOTPAP PARAMETER (DOTPAP=100.0/25.4) C .. C .. Scalar Arguments .. REAL PAPINX,PAPINY,VBXMAX,VBXMIN,VBYMAX,VBYMIN,X,Y INTEGER JCOLOR,NBPI,NDRAW,NFORM CHARACTER GSNAM* (*) C .. C .. Scalars in Common .. REAL BXMAX,BXMIN,BYMAX,BYMIN,SCALEX,SCALEY,USANGX,USANGY INTEGER KPRINT,LUNIN,LUNOUT LOGICAL*4 ICULNK,LINMOD C .. C .. Arrays in Common .. REAL CUMAT,USRMAT C .. C .. Local Scalars .. REAL CUORGX,CUORGY,DOTSMM,PAPLEN,PAPWID,XORIG,YORIG INTEGER MODE C .. C .. Local Arrays .. INTEGER NSTRAN(24) C .. C .. External Subroutines .. EXTERNAL GSBSIZ,GSDTRN,GSDWBY,GSDWTO,GSENDP,GSINIT, + GSMIXC,GSMVBY,GSMVTO,GSPICT,GSSTOP C .. C .. Intrinsic Functions .. INTRINSIC REAL C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSCLP/BXMIN,BXMAX,BYMIN,BYMAX COMMON /GSUTR/USRMAT(3,3),SCALEX,SCALEY,USANGX,USANGY, + CUMAT(3,3),LINMOD,ICULNK,KPRINT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (XORIG,USRMAT(1,3)), (YORIG,USRMAT(2,3)) EQUIVALENCE (CUORGX,CUMAT(1,3)), (CUORGY,CUMAT(2,3)) EQUIVALENCE (NSTRAN(1),USRMAT(1,1)) C .. C .. Data statements .. DATA PAPWID/330.0/,PAPLEN/508.0/,DOTSMM/DOTPAP/ C .. C CALL GSINIT(GSNAM) IF (JCOLOR.EQ.1) CALL GSMIXC(JCOLOR) CALL GSBSIZ(PAPWID,PAPLEN) CALL GSDTRN(DOTSMM,DOTSMM) CALL GSPICT RETURN C ENTRY ALTPRM(NBPI,PAPINX,PAPINY) C ================================ C DOTSMM = REAL(NBPI)/25.4 PAPWID = PAPINX*25.4 PAPLEN = PAPINY*25.4 RETURN C ENTRY BRKGS(NFORM) C =================== C C---- NFORM=(ge.0) another plot (lt.0) stop C IF (NFORM.GE.0) THEN CALL GSENDP CALL GSPICT ELSE CALL GSSTOP END IF RETURN C ENTRY BOUNDS(VBXMIN,VBXMAX,VBYMIN,VBYMAX) C ========================================= C BXMIN = VBXMIN BXMAX = VBXMAX BYMIN = VBYMIN BYMAX = VBYMAX RETURN C ENTRY PLOT(X,Y,NDRAW) C ===================== C C---- Two forms of entry: plot(x,y,n) or drawto/by & moveto/by C NDRAW = 0 drawto draw to position x,y relative to origin C NDRAW = 1 drawby draw to position x,y relative to C old pen position C NDRAW = 2 moveto move to position x,y relative to origin C NDRAW = 3 moveby move to position x,y relative to C old pen position C IF ((NDRAW.LT.0) .OR. (NDRAW.GT.3)) THEN IF (KPRINT.GE.1) WRITE (LUNOUT,FMT=6000) NDRAW NDRAW = 2 END IF MODE = NDRAW + 1 GO TO (50,30,20,10) MODE GO TO 40 C ENTRY DRAWBY(X,Y) GO TO 30 C ENTRY MOVETO(X,Y) GO TO 20 C ENTRY MOVEBY(X,Y) C ================= C 10 CONTINUE CALL GSMVBY(X,Y) RETURN C 20 CONTINUE CALL GSMVTO(X,Y) RETURN C 30 CONTINUE CALL GSDWBY(X,Y) RETURN C ENTRY DRAWTO(X,Y) C ================= 40 CONTINUE C 50 CONTINUE CALL GSDWTO(X,Y) C C---- Format statements C 6000 FORMAT (2X,'!!!OLDPLOT ERROR: NDRAW=',I5,' OUTSIDE RANGE(0-3) R', + 'ESET TO 2=MOVETO ') C C END C C C SUBROUTINE FINDPC(IFLAG6) C ======================== C C---- Position file to beginning of picture IPICT. Return 1 if end of file C C .. Scalar Arguments .. INTEGER IFLAG6 C .. C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWLIMX,DWLIMY, + SCALX,SCALY,TX,TY INTEGER ICOLOR,IPICT,IUNIT,IXMAX,IXMIN,IYMAX,IYMIN,KXMAX,KXMIN, + KYMAX,KYMIN,LINWT,LUNIN,LUNOUT,MCNTFL,MDEVIC,MDIREC, + MIXCOLOR,MOUT,MPIC,MSCAFL,NBACK,NPICS,NREC LOGICAL AAV,CLEAR,EOF,HTEXT,PAN,PICTURE,ROTATE,TABLE,UNIFORM CHARACTER PASWRD*8,TITLEH*80 C .. C .. Arrays in Common .. REAL RM,SPARE1,SPARE2 INTEGER PENS,PFLAGS C .. C .. Local Scalars .. INTEGER I,IFLAG2 C .. C .. External Subroutines .. EXTERNAL GSFLP1,GSFLSR,GSRHDR C .. C .. Common blocks .. COMMON /FLAGS/NBACK,PENS(8),PFLAGS(8),RM(2,2),TX,TY,SCALX,SCALY, + KXMIN,KXMAX,KYMIN,KYMAX,IPICT,AAV,PAN,ROTATE,CLEAR,UNIFORM, + TABLE,PICTURE,HTEXT,EOF COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSFHD/ + IUNIT, NREC, DOTMMX, DOTMMY, IXMIN, IXMAX, IYMIN, + IYMAX, LINWT, ICOLOR, MIXCOLOR, MDEVIC, MDIREC, MOUT, + MPIC, MSCAFL, MCNTFL, DWLIMX, DWLIMY, DVXMIN, DVXMAX, + DVYMIN, DVYMAX, NPICS, + PASWRD, + SPARE1(15), + TITLEH, + SPARE2(68) C C .. Save Statement .. C SAVE C IFLAG6 = 0 IF (IPICT.GT.0) THEN C C---- Rewind file C CALL GSFLP1 C IF (IPICT.GT.1) THEN C C---- Skip unwanted pictures C DO 10 I = 1,IPICT - 1 IFLAG2 = 0 CALL GSRHDR(IFLAG2) IF (IFLAG2.EQ.1) THEN GO TO 20 ELSE CALL GSFLSR(4*NREC) END IF 10 CONTINUE GO TO 30 C 20 IFLAG6 = 1 RETURN END IF C C---- Decrement picture number, since it is incremented later C 30 IPICT = IPICT - 1 C EOF = .FALSE. END IF C END C C C SUBROUTINE GETSCL C ================= C C---- Get scale factors SCALX, SCALY and translations TX, TY for C viewport KXMIN,KXMAX,KYMIN,KYMAX and rotation RM. C Plotfile limits are IXMIN,IXMAX,IYMIN,IYMAX. C C---- If UNIFORM is .false. , scales on x and y are different C C---- Rotate limits C C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWLIMX,DWLIMY, + SCALX,SCALY,TX,TY INTEGER ICOLOR,IPICT,IUNIT,IXMAX,IXMIN,IYMAX,IYMIN,KXMAX,KXMIN, + KYMAX,KYMIN,LINWT,LUNIN,LUNOUT,MCNTFL,MDEVIC,MDIREC, + MIXCOLOR,MOUT,MPIC,MSCAFL,NBACK,NPICS,NREC LOGICAL AAV,CLEAR,EOF,HTEXT,PAN,PICTURE,ROTATE,TABLE,UNIFORM CHARACTER PASWRD*8,TITLEH*80 C .. C .. Arrays in Common .. REAL RM,SPARE1,SPARE2 INTEGER PENS,PFLAGS C .. C .. Local Scalars .. INTEGER PXMAX,PXMIN,PYMAX,PYMIN C .. C .. Local Arrays .. INTEGER PX(4),PY(4) C .. C .. External Subroutines .. EXTERNAL IROT C .. C .. Intrinsic Functions .. INTRINSIC ABS,MAX,MIN,REAL C .. C .. Common blocks .. COMMON /FLAGS/NBACK,PENS(8),PFLAGS(8),RM(2,2),TX,TY,SCALX,SCALY, + KXMIN,KXMAX,KYMIN,KYMAX,IPICT,AAV,PAN,ROTATE,CLEAR,UNIFORM, + TABLE,PICTURE,HTEXT,EOF COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSFHD/ + IUNIT, NREC, DOTMMX, DOTMMY, IXMIN, IXMAX, IYMIN, + IYMAX, LINWT, ICOLOR, MIXCOLOR, MDEVIC, MDIREC, MOUT, + MPIC, MSCAFL, MCNTFL, DWLIMX, DWLIMY, DVXMIN, DVXMAX, + DVYMIN, DVYMAX, NPICS, + PASWRD, + SPARE1(15), + TITLEH, + SPARE2(68) C .. Save Statement .. C SAVE C CALL IROT(PX(1),PY(1),RM,IXMIN,IYMIN) CALL IROT(PX(2),PY(2),RM,IXMAX,IYMAX) CALL IROT(PX(3),PY(3),RM,IXMIN,IYMAX) CALL IROT(PX(4),PY(4),RM,IXMAX,IYMIN) PXMIN = MIN(PX(1),PX(2),PX(3),PX(4)) PXMAX = MAX(PX(1),PX(2),PX(3),PX(4)) PYMIN = MIN(PY(1),PY(2),PY(3),PY(4)) PYMAX = MAX(PY(1),PY(2),PY(3),PY(4)) C C---- Scales C SCALX = ABS((KXMAX-KXMIN)/REAL(PXMAX-PXMIN)) SCALY = ABS((KYMAX-KYMIN)/REAL(PYMAX-PYMIN)) C IF (UNIFORM) THEN SCALX = MIN(SCALX,SCALY) SCALY = SCALX END IF C C---- Translation C TX = ((KXMAX-KXMIN)- (PXMAX-PXMIN)*SCALX)*0.5 + KXMIN - + SCALX*PXMIN TY = ((KYMAX-KYMIN)- (PYMAX-PYMIN)*SCALY)*0.5 + KYMIN - + SCALY*PYMIN C END C C C SUBROUTINE GSBFTM(ITERM,NBYTE) C =============================== C C---- NBYTE=0 forces buffer to empty by writing C C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were BUFFER C and the following BYTEs to INTEGER: NBYTE C C .. Scalar Arguments .. INTEGER ITERM CHARACTER*1 NBYTE C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT,NBFPTR C .. C .. Arrays in Common .. CHARACTER*1 BUFFER C .. C .. Local Scalars .. INTEGER I C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSBFT/BUFFER(256),NBFPTR C C .. Save Statement .. C SAVE C IF ((NBYTE.EQ.CHAR(0)) .OR. (NBFPTR.EQ.256)) THEN WRITE (ITERM,FMT=6000) (BUFFER(I),I=1,NBFPTR) NBFPTR = 0 END IF IF (NBYTE.NE.CHAR(0)) THEN NBFPTR = NBFPTR + 1 BUFFER(NBFPTR) = NBYTE END IF C C---- Format statements C 6000 FORMAT (256A1) C END C C C SUBROUTINE GSBLKD C =================== C C A.D. McLachlan JUL 1984. Last updated 27 jul 1984. C C .. Scalars in Common .. REAL ANGFAC,CHANGX,CHANGY,CHRSCX,CHRSCY,CHRSPX,CHRSPY,DOTMMX, + DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWBLMX,DWBLMY,DWLIMX, + DWLIMY,PAPLMX,PAPLMY,SCALEX,SCALEY,UBXMAX,UBXMIN,UBYMAX, + UBYMIN,USANGX,USANGY,V64LMX,V64LMY,XCHAR,XCSTRT,YCHAR,YCSTRT INTEGER ICENTC,ICOLOR,IDRLVL,IFONT,IPRINT,IUNIT,IXMAX,IXMIN,IYMAX, + IYMIN,KPRINT,LINWT,LUNIN,LUNOUT,MCNTFL,MDEVIC,MDIREC, + MIXCOL,MOUT,MPIC,MSCAFL,NERROR,NPICS LOGICAL*4 DEVCON,FONTIN,ICULNK,INITON,LINMOD,UCSPAC CHARACTER FILNAM*80,TITLE*80 C .. C .. Arrays in Common .. REAL CHRMAT,CUMAT,USRMAT C .. C .. Local Scalars .. REAL CHORGX,CHORGY,CUORGX,CUORGY,XORIG,YORIG C .. C .. Local Arrays .. INTEGER NCTRAN(24),NSTRAN(24) C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSCHX/CHRMAT(3,3),CHRSCX,CHRSCY,CHANGX,CHANGY, + CHRSPX,CHRSPY,ICENTC,UCSPAC,IFONT,FONTIN,XCHAR, + YCHAR,XCSTRT,YCSTRT,ANGFAC COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE COMMON /GSUTR/USRMAT(3,3),SCALEX,SCALEY,USANGX,USANGY, + CUMAT(3,3),LINMOD,ICULNK,KPRINT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (XORIG,USRMAT(1,3)), (YORIG,USRMAT(2,3)) EQUIVALENCE (CUORGX,CUMAT(1,3)), (CUORGY,CUMAT(2,3)) EQUIVALENCE (NSTRAN(1),USRMAT(1,1)) EQUIVALENCE (CHORGX,CHRMAT(1,3)), (CHORGY,CHRMAT(2,3)) EQUIVALENCE (NCTRAN(1),CHRMAT(1,1)) C .. C .. Data statements .. LUNIN = 5 LUNOUT = 6 SCALEX = 1.0 SCALEY = 1.0 KPRINT = 1 ICULNK = .TRUE. FONTIN = .FALSE. UCSPAC = .FALSE. IFONT = 1 ICENTC = 1 MOUT = 90 INITON = .FALSE. DEVCON = .FALSE. IDRLVL = 0 DOTMMX = 10.0 DOTMMY = 10.0 C END C C C SUBROUTINE GSCETX(TEXT,NJUST) C ============================== C C---- Plot centred character string C C A.D.McLachlan JUN 1984. Last updated 16 oct 84 C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were NFONTS C C---- Plots a character string from the character*(*) variable TEXT C Removes leading and trailing blanks or null characters C uses the current font C uses ICENTC option to centre characters on baseline C level or on +0.5 level. characters are of size 1.0*1.5 C character units with even spacing, or else variable C NJUST controls centering (1)left (2)middle (3)right C C---- ENTRY GSCETS for variable size text C C .. Scalar Arguments .. REAL SIZ1,SIZ2 INTEGER NJUST CHARACTER TEXT* (*) C .. C .. Scalars in Common .. REAL ANGFAC,CHANGX,CHANGY,CHRSCX,CHRSCY,CHRSPX,CHRSPY,SCALEX, + SCALEY,USANGX,USANGY,XCHAR,XCSTRT,YCHAR,YCSTRT INTEGER ICENTC,IFONT,KPRINT,LUNIN,LUNOUT LOGICAL*4 FONTIN,ICULNK,LINMOD,UCSPAC C .. C .. Arrays in Common .. REAL CHRMAT,CUMAT,USRMAT INTEGER*2 IFHT,IFSTRT,IFWID,IFX0,IFY0,LENGF INTEGER*1 NFONTS C .. C .. Local Scalars .. REAL ATXL1,CHORGX,CHORGY,CUORGX,CUORGY,CWID,DSOFFX,DSOFFY,DSTRX, + DSTRY,SIZX,SIZY,WIDSUM,X1,X2,XORIG,Y1,Y2,YORIG INTEGER I,ILENG,LETT,LETTER,NFIRST,NLAST,NTXLEN CHARACTER BLANKC*1 C .. C .. Local Arrays .. INTEGER NCTRAN(24),NSTRAN(24) C .. C .. External Subroutines .. EXTERNAL GSCFSZ,GSSTRS C .. C .. Intrinsic Functions .. INTRINSIC ICHAR,INDEX,LEN C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSCHX/CHRMAT(3,3),CHRSCX,CHRSCY,CHANGX,CHANGY,CHRSPX, + CHRSPY,ICENTC,UCSPAC,IFONT,FONTIN,XCHAR,YCHAR,XCSTRT, + YCSTRT,ANGFAC COMMON /GSFNT/IFSTRT(150,4),LENGF(150,4),IFX0(150,4), + IFY0(150,4),IFWID(150,4),IFHT(150,4),NFONTS(4,3000,4) COMMON /GSUTR/USRMAT(3,3),SCALEX,SCALEY,USANGX,USANGY, + CUMAT(3,3),LINMOD,ICULNK,KPRINT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (XORIG,USRMAT(1,3)), (YORIG,USRMAT(2,3)) EQUIVALENCE (CUORGX,CUMAT(1,3)), (CUORGY,CUMAT(2,3)) EQUIVALENCE (NSTRAN(1),USRMAT(1,1)) EQUIVALENCE (CHORGX,CHRMAT(1,3)), (CHORGY,CHRMAT(2,3)) EQUIVALENCE (NCTRAN(1),CHRMAT(1,1)) C .. C .. Data statements .. DATA BLANKC/' '/ C SIZX = 1.0 SIZY = 1.0 GO TO 10 C ENTRY GSCETS(TEXT,SIZ1,SIZ2,NJUST) C =================================== C SIZX = SIZ1 SIZY = SIZ2 C C---- Check input njust C 10 IF ((NJUST.LT.1) .OR. (NJUST.GT.3)) THEN IF (KPRINT.GE.1) WRITE (LUNOUT,FMT=6002) NJUST NJUST = 2 END IF C C---- Eliminate illegal characters (ascii set is 32-126) C ILENG = LEN(TEXT) DO 20 I = 1,ILENG LETT = ICHAR(TEXT(I:I)) IF ((LETT.LE.31) .OR. (LETT.GE.127)) TEXT(I:I) = BLANKC 20 CONTINUE C C---- Remove trailing and leading blanks C NLAST = LEN(TEXT) 30 CONTINUE IF (INDEX(TEXT(NLAST:NLAST),' ').EQ.1) THEN NLAST = NLAST - 1 GO TO 30 END IF NFIRST = 1 40 CONTINUE IF (INDEX(TEXT(NFIRST:NFIRST),' ').EQ.1) THEN NFIRST = NFIRST + 1 GO TO 40 END IF C C---- Test for blank string C IF (NLAST.GT.0) THEN C C---- Check for left justify - no offset C IF (NJUST.EQ.1) THEN DSTRX = 0.0 DSTRY = 0.0 ELSE C C---- calculate space used by non-blank part of string (njust=2 or 3) C NTXLEN = NLAST - NFIRST + 1 ATXL1 = NTXLEN - 1 C C---- Letters 1.5 units high spaced by chrspy vertically C mean height above baseline for all chars C DSTRY = ATXL1*CHRSPY C C---- Width calculation uniform width of 1.0 spaced by chrspx C IF (UCSPAC) THEN DSTRX = (CHRSPX+1.0)*ATXL1 + 1.0 ELSE C C---- spacing from font tables C WIDSUM = 0.0 DO 50 I = NFIRST,NLAST LETTER = ICHAR(TEXT(I:I)) CALL GSCFSZ(LETTER,X1,X2,Y1,Y2,CWID,IFONT) WIDSUM = WIDSUM + CWID 50 CONTINUE DSTRX = ATXL1*CHRSPX + WIDSUM END IF C C---- Doubled offset for right justify C IF (NJUST.EQ.3) THEN DSTRX = 2.0*DSTRX DSTRY = 2.0*DSTRY END IF END IF C C---- offsets (with icentc offset to be applied later, now allowed for) C DSOFFX = -0.5*DSTRX IF (ICENTC.EQ.1) DSOFFX = DSOFFX + 0.5 DSOFFY = -0.5*DSTRY C C---- move character cursor by offset C XCSTRT = DSOFFX*SIZX + XCSTRT YCSTRT = DSOFFY*SIZY + YCSTRT C C---- draw leaving cursor at end of string C CALL GSSTRS(TEXT(NFIRST:NLAST),SIZX,SIZY) ELSE IF (KPRINT.GE.1) THEN WRITE (LUNOUT,FMT=6000) END IF C C---- Format statements C 6000 FORMAT (2X,'!!!GSCETX ERROR: ', + 'PLOTTING BLANK OR ZERO LENGTH STRING ') 6002 FORMAT (2X,'!!!GSCETX ERROR: ', + 'NJUST=',I5,' OUT OF RANGE 1-3 RESET AS 2=CENTRAL') C END C C C SUBROUTINE GSCFIX(REEL,IFIXI) C =============================== C C---- Greatest integer function C C .. Scalar Arguments .. REAL REEL INTEGER IFIXI C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Intrinsic Functions .. INTRINSIC INT,REAL C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C IFIXI = INT(REEL) IF ((REEL-REAL(IFIXI)).LT.0.0) IFIXI = IFIXI - 1 C END C C C SUBROUTINE GSCFSZ(NCHAR,XLEFT,XRIGHT,YLOW,YHIGH,CWID,KFONT) C ============================================================= C C---- Finds the size of characters in the current font C C A.D. McLachlan JUL 1984. Last updated 27 JUL 1984 C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were NFONTS C C The size is measured in character units in a C character box 1.0 units wide, 1.0 high above the line C and 0.5 low below the line C C XLEFT,XRIGHT,YLOW,YHIGH are drawing limits C C CWID is the character width used for spacing with C proportional spacing C C .. Parameters .. REAL FACT21 PARAMETER (FACT21=1.0/21.0) C .. C .. Scalar Arguments .. REAL CWID,XLEFT,XRIGHT,YHIGH,YLOW INTEGER KFONT,NCHAR C .. C .. Scalars in Common .. REAL ANGFAC,CHANGX,CHANGY,CHRSCX,CHRSCY,CHRSPX,CHRSPY,SCALEX, + SCALEY,USANGX,USANGY,XCHAR,XCSTRT,YCHAR,YCSTRT INTEGER ICENTC,IFONT,KPRINT,LUNIN,LUNOUT LOGICAL*4 FONTIN,ICULNK,LINMOD,UCSPAC C .. C .. Arrays in Common .. REAL CHRMAT,CUMAT,USRMAT INTEGER*2 IFHT,IFSTRT,IFWID,IFX0,IFY0,LENGF INTEGER*1 NFONTS C .. C .. Local Scalars .. REAL AW,CHORGX,CHORGY,CUORGX,CUORGY,RED,X1,X2,XORIG,Y1,Y2,YORIG INTEGER LETTER C .. C .. Local Arrays .. INTEGER NCTRAN(24),NSTRAN(24) C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSCHX/CHRMAT(3,3),CHRSCX,CHRSCY,CHANGX,CHANGY,CHRSPX, + CHRSPY,ICENTC,UCSPAC,IFONT,FONTIN,XCHAR,YCHAR,XCSTRT, + YCSTRT,ANGFAC COMMON /GSFNT/IFSTRT(150,4),LENGF(150,4),IFX0(150,4), + IFY0(150,4),IFWID(150,4),IFHT(150,4),NFONTS(4,3000,4) COMMON /GSUTR/USRMAT(3,3),SCALEX,SCALEY,USANGX,USANGY, + CUMAT(3,3),LINMOD,ICULNK,KPRINT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (XORIG,USRMAT(1,3)), (YORIG,USRMAT(2,3)) EQUIVALENCE (CUORGX,CUMAT(1,3)), (CUORGY,CUMAT(2,3)) EQUIVALENCE (NSTRAN(1),USRMAT(1,1)) EQUIVALENCE (CHORGX,CHRMAT(1,3)), (CHORGY,CHRMAT(2,3)) EQUIVALENCE (NCTRAN(1),CHRMAT(1,1)) C IF (KFONT.EQ.0) THEN XLEFT = 0.0 XRIGHT = 1.0 YHIGH = 1.0 YLOW = 0.0 CWID = 1.0 ELSE C C---- check font C IF ((KFONT.GE.1) .AND. (KFONT.LE.4)) THEN C C---- check letter C LETTER = NCHAR - 31 IF ((LETTER.GE.1) .AND. (LETTER.LE.146)) THEN C C---- for legal letters in fonts (1-4) C Here converting Integer*2 to Real*4 C BIG-ENDIAN PROBLEM ??? C X1 = IFX0(LETTER,KFONT) + 1 Y1 = IFY0(LETTER,KFONT) + 9 X2 = IFWID(LETTER,KFONT) - 1 Y2 = IFHT(LETTER,KFONT) + 9 C C---- some wide or high letters are shrunk down C AW = X2 IF (AW.GT.21.0) THEN RED = (21.0/AW) X1 = X1*RED X2 = X2*RED END IF IF (Y2.GT.21.0) THEN Y1 = (21.0/Y2)*Y1 Y2 = 21.0 END IF XLEFT = FACT21*X1 XRIGHT = FACT21*X2 YLOW = FACT21*Y1 YHIGH = FACT21*Y2 C CWID = IFWID(LETTER,KFONT) IF (CWID.GT.21.0) CWID = 21.0 IF (CWID.LE.0.0) CWID = 18.0 CWID = CWID*FACT21 GO TO 10 ELSE IF (KPRINT.GE.1) THEN WRITE (LUNOUT,FMT=6000) NCHAR END IF ELSE IF (KPRINT.GE.1) THEN WRITE (LUNOUT,FMT=6002) KFONT END IF C C---- for bad data return maximum sizes C XLEFT = 0.0 XRIGHT = 1.0 YHIGH = 1.0 YLOW = -0.5 CWID = 1.0 END IF 10 IF (KPRINT.GE.3) WRITE (LUNOUT,FMT=6004) NCHAR,KFONT,XLEFT, + XRIGHT,YLOW,YHIGH,CWID C C---- Format statements C 6000 FORMAT (2X,'!!!GSCFSZ ERROR: ILLEGAL NCHAR=',I5) 6002 FORMAT (2X,'!!!GSCFSZ ERROR: ILLEGAL KFONT=',I5) 6004 FORMAT (2X,'GSCFSZ: NCHAR KFONT =', + 2I5,/2X,'XLEFT XRIGHT YLOW Y', + 'HIGH = ',4F10.4,/2X,'WIDTH = ',F10.4) C END C C C SUBROUTINE GSCLPL(X1,Y1,X2,Y2,ACCEPT) C ===================================== C C---- Routine to clip lines in a rectangular window C C A.D. McLachlan JUN 1984 Last updated 10 JUL 1984 C C Cohen and Sutherland algorithm from foley & van dam C C .. Scalar Arguments .. REAL X1,X2,Y1,Y2 LOGICAL ACCEPT C .. C .. Scalars in Common .. REAL BXMAX,BXMIN,BYMAX,BYMIN C .. C .. Local Scalars .. INTEGER NCODE1,NCODE2,NSWAP LOGICAL DONE,INSIDE,REJECT C .. C .. External Subroutines .. EXTERNAL GSCLPT,GSCLTS,GSSWLN C .. C .. Intrinsic Functions .. INTRINSIC ABS LOGICAL BTEST C .. C .. Common blocks .. COMMON /GSCLP/BXMIN,BXMAX,BYMIN,BYMAX C .. REAL SMALL parameter (SMALL=1.0E-20) C .. Save Statement .. SAVE /GSCLP/ C .. C NSWAP = 1 ACCEPT = .FALSE. REJECT = .FALSE. DONE = .FALSE. 10 CONTINUE C C---- start of line clipping loop "level 1" here C C---- start loop now C find position codes for both ends of line C bytes 1=left 2=right 3=below 4=above C CALL GSCLPT(X2,Y2,NCODE2,INSIDE) CALL GSCLPT(X1,Y1,NCODE1,INSIDE) C C---- test for trivial cases (both ends inside or both share same excess) C CALL GSCLTS(REJECT,ACCEPT,NCODE1,NCODE2) C C---- enter "if1" "level 2" C IF (REJECT .OR. ACCEPT) THEN DONE = .TRUE. ELSE C C---- "else2" "level 2" C C C---- subdivide line since at least one endpoint is outside C -if (x1,y1) is inside swap ends so that (x1,y1) is now outside C IF (INSIDE) CALL GSSWLN(X1,Y1,X2,Y2,NCODE1,NCODE2,NSWAP) C C---- replace (x1,y1) by an end point on the boundary C -use y=y1+slope*(x-x1) or C - x=x1+(1.0/slope)*(y-y1) C -check for divides by zero when lines are horizontal or vertical C "if1" "level 3" C -split line on left (y1 is to left) C C C---- If machine is BigEndian, need to swap byte order C C C IF (BTEST(NCODE1,1)) THEN IF (ABS(X2-X1).GT.SMALL) Y1 = Y1 + (Y2-Y1)*(BXMIN-X1)/(X2-X1) X1 = BXMIN C C---- "else2" "level 3" split line on right (y1 is to right) C ELSE IF (BTEST(NCODE1,2)) THEN IF (ABS(X2-X1).GT.SMALL) Y1 = Y1 + (Y2-Y1)*(BXMAX-X1)/(X2-X1) X1 = BXMAX C C---- "else3" "level 3" split line at bottom (y1 is below) C ELSE IF (BTEST(NCODE1,3)) THEN IF (ABS(Y2-Y1).GT.SMALL) X1 = X1 + (X2-X1)*(BYMIN-Y1)/(Y2-Y1) Y1 = BYMIN C C---- "else4" "level 3" split line at top (y1 is above) C ELSE IF (BTEST(NCODE1,4)) THEN IF (ABS(Y2-Y1).GT.SMALL) X1 = X1 + (X2-X1)*(BYMAX-Y1)/(Y2-Y1) Y1 = BYMAX C C---- "endif" "level 3" C END IF C C---- "endif" "level 2" C END IF C C---- "end loop" "level 1" C IF (.NOT.DONE) GO TO 10 C C---- swap back line ends if required C IF (NSWAP.EQ.-1) + CALL GSSWLN(X1,Y1,X2,Y2,NCODE1,NCODE2,NSWAP) C END C C C SUBROUTINE GSCLPT(X,Y,NCODE,INSIDE) C ==================================== C C---- To test if a point is inside rectangular window C codes for bit<>0: 1=left 2=right 3=below 4=above C C .. Scalar Arguments .. REAL X,Y INTEGER NCODE LOGICAL INSIDE C .. C .. Scalars in Common .. REAL BXMAX,BXMIN,BYMAX,BYMIN INTEGER IZ4B C .. C .. Common blocks .. COMMON /GSCLP/BXMIN,BXMAX,BYMIN,BYMAX COMMON /GSBTST/ IZ4B C C .. Save Statement .. C SAVE /GSCLP/, /GSBTST/ C NCODE = IZ4B IF (X.LT.BXMIN) NCODE = IBSET (NCODE, 1) IF (X.GT.BXMAX) NCODE = IBSET (NCODE, 2) IF (Y.LT.BYMIN) NCODE = IBSET (NCODE, 3) IF (Y.GT.BYMAX) NCODE = IBSET (NCODE, 4) INSIDE = NCODE.EQ.IZ4B END C C C SUBROUTINE GSCLTS(REJECT,ACCEPT,NCODE1,NCODE2) C =============================================== C C---- To test if line lies wholly in or out of window C in cohen & sutherland test C C .. Scalar Arguments .. INTEGER NCODE1,NCODE2 LOGICAL ACCEPT,REJECT C .. C .. Scalars in Common .. INTEGER IZ4B C .. Local scalars INTEGER NCDAND C .. C .. Common blocks .. COMMON /GSBTST/ IZ4B C .. C .. Save Statement .. SAVE /GSBTST/ C .. NCDAND = IAND(NCODE1,NCODE2) REJECT = (NCDAND.NE.IZ4B) ACCEPT = (NCODE1.EQ.IZ4B) .AND. (NCODE2.EQ.IZ4B) END C C C SUBROUTINE GSCVAX(X,Y,LABEL,NSIDE,NTEX,AXLEN,GSCALE, + ANGLE,FVAL,DV) C ====================================================== C C---- Draw axes with labels for graphs C C A.D. McLachlan SEPT 1984. Last updated 12 NOV 1984. C adapted from d.a. agard plot82 C C (X,Y) = starting coordinates for axis generation (real) C LABEL = character text string for labeling the axis C NSIDE = +1 or -1 C = + = annotations generated above axis C = - = annotations generated below axis C NTEX = 1,0 do, do not plot labels and tic numbers along axis C AXLEN = axis length in graph units (real) C axis is marked every 1.0 graph units C GSCALE= value of 1 graph unit in user units (expected to be mm) C no value numbers drawn if gscale.lt.10.0 C ANGLE = angle in degrees at which axis is drawn (real) C FVAL = first annotation value (real) C DV = delta annotation value (real) C C---- Character height is automatically set to be independent C of global scale unless it is too large to go on axes C character fount is not set here C C---- remove trailing blanks from label C max 40 characters to plot 5mm wide C C .. Scalar Arguments .. REAL ANGLE,AXLEN,DV,FVAL,GSCALE,X,Y INTEGER NSIDE,NTEX CHARACTER LABEL* (*) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. REAL ADV,ANGFAC,ANL,COSA,DX,DY,EXABS,EXPDV,HGT,PI,QMAX,SIDE,SINA, + SIZE,SIZL,SPACL,SZMAX,SZMIN,THETA,VAL,WIDL,XX,YY INTEGER I,IADV,IEXPDV,IVAL,JDIG,LABLEN,NAFTER,NDIGIT,NJUST,NTIC C .. C .. Local Arrays .. INTEGER NTRSAV(48) C .. C .. External Functions .. INTEGER LENSTR EXTERNAL LENSTR C .. C .. External Subroutines .. EXTERNAL GSANCU,GSCENC,GSCROT,GSCSPU, + GSDWTO,GSFNUM,GSINUM, + GSMVTO,GSORGC,GSSCLC, + GSSTRS,GSTLNK,GSTRES,GSTSAV C .. C .. Intrinsic Functions .. INTRINSIC ABS,ATAN2,COS,SIN C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C LABLEN = LENSTR(LABEL) IF (LABLEN.GT.40) LABLEN = 40 C PI = ATAN2(1.0,1.0)*4.0 ANGFAC = PI/180.0 C C---- save current character and user scaling C CALL GSTSAV(NTRSAV) C C---- decouple character scaling from user scale C set up scale for characters C this scaling results in a unit hgt=1.0 mm C for letter sizes independent of user scale "uscaly" . C HGT = 1.0 CALL GSTLNK(0) CALL GSORGC(0.0,0.0) CALL GSSCLC(HGT,HGT) THETA = ANGLE*ANGFAC CALL GSCROT(THETA,THETA+PI/2.0) C C---- centred characters with uniform spacing C CALL GSCENC(1) CALL GSCSPU(1) C C---- choose which side of axis to annotate and label C SIDE = +1.0 IF (NSIDE.LT.0) SIDE = -1.0 C C---- this section tries to rescale dv into a range from 0.01 to 99.0 C determine value of 'dv' exponent C EXPDV = 0.0 ADV = ABS(DV) C C---- zero delta annotation value? C IF (ADV.NE.0.0) THEN 10 CONTINUE C C---- 'dv' exponent calculation completed? C divide by 10.0 till lt. 99.0 C IF (ADV.GE.99.0) THEN ADV = ADV/10.0 EXPDV = EXPDV + 1.0 GO TO 10 END IF 20 CONTINUE C C---- 'dv' exponent calculation completed? C IF (ADV.LT.0.01) THEN C C---- multiply by 10.0 till ge. 0.01 C ADV = ADV*10.0 EXPDV = EXPDV - 1.0 GO TO 20 END IF END IF C C---- compute normalized 'fval' and 'dv' scaled by (10**-expdv) C VAL = (10.0** (-EXPDV))*FVAL ADV = (10.0** (-EXPDV))*DV EXABS = ABS(EXPDV) + 0.5 IEXPDV = EXABS IF (EXPDV.LT.0) IEXPDV = -IEXPDV C C---- check number of digits after decimal point C NTIC = AXLEN + 1.0 JDIG = 2 QMAX = (NTIC-1)*ADV + VAL IF (QMAX.GT.99.99) JDIG = 1 IADV = ADV IVAL = VAL IF ((ADV.EQ.IADV) .AND. (IVAL.EQ.VAL)) JDIG = 0 C C---- set up positioning constants for numbers C SINA = SIN(THETA) COSA = COS(THETA) C C---- numbers left justified and 7.0 mm above/below axis size 4mm C numbers offset by 4mm to left C DX = -4.0*HGT DY = 7.0*SIDE*HGT XX = DX*COSA + X - DY*SINA YY = DY*COSA + Y + DX*SINA C C---- annotate axis in graph units 1.0 units at a step C NJUST = 1 NAFTER = JDIG NDIGIT = JDIG SIZE = 4.0 C C---- adjust size if necessary to allow 5 digits C and a space to each segment C but do not go below 2.0mm C no values drawn if gscale.lt.10.0 C SZMAX = GSCALE/6.0 SZMIN = 2.0 IF (SIZE.GT.SZMAX) SIZE = SZMAX IF (SIZE.LT.SZMIN) SIZE = SZMIN C IF (GSCALE.GE.10.0) THEN IF (NTEX.NE.0) THEN DO 30 I = 1,NTIC CALL GSANCU(XX,YY) CALL GSFNUM(VAL,NDIGIT,NAFTER,SIZE,SIZE,NJUST) VAL = VAL + ADV XX = COSA*GSCALE + XX YY = SINA*GSCALE + YY 30 CONTINUE END IF END IF IF (NTEX.NE.0) THEN IF (LABLEN.GT.0) THEN C C---- label axis with lablen characters and possibly the expdv value C ANL = LABLEN C C---- does 'dv' exponent exist? C IF (IEXPDV.NE.0) ANL = LABLEN + 5 C C---- centre the label C letters 5mm high centred 14mm above/below axis C SIZE = 5.0 C C---- shrink letters if too big to fit allowed space C allow space of 80% axis length C SPACL = 0.8*AXLEN*GSCALE SIZL = SPACL/ANL IF (SIZL.LT.5.0) SIZE = SIZL IF (SIZE.LT.2.0) SIZE = 2.0 WIDL = SIZE*ANL DX = (AXLEN*GSCALE)*0.5 - 0.5*WIDL*HGT DY = 14.0*SIDE*HGT XX = DX*COSA + X - DY*SINA YY = DY*COSA + Y + DX*SINA CALL GSANCU(XX,YY) CALL GSSTRS(LABEL,SIZE,SIZE) C C---- no 'dv' exponent to plot? C IF ((GSCALE.GE.10.0) .AND. (IEXPDV.NE.0)) THEN C C---- plot exponent label ' *10' C CALL GSSTRS(' *10',SIZE,SIZE) C C---- plot value of exponent as superscript C 13mm above/below axis size 3mm C XX = (WIDL*COSA-1.0*SINA)*HGT + XX YY = (WIDL*SINA+1.0*COSA)*HGT + YY C C---- plot -iexpdv C label values multiplied by 10.0**-iexpdv give true values C CALL GSANCU(XX,YY) NJUST = 1 NDIGIT = 1 SIZE = SIZE*0.6 IF (SIZE.LT.2.0) SIZE = 2.0 CALL GSINUM(-IEXPDV,NDIGIT,SIZE,SIZE,NJUST) END IF END IF END IF C C---- draw axis and tic marks normally 3mm long C DX = -3.0*SIDE*SINA*HGT DY = +3.0*SIDE*COSA*HGT XX = X - COSA*GSCALE YY = Y - SINA*GSCALE CALL GSMVTO(X,Y) DO 40 I = 1,NTIC XX = COSA*GSCALE + XX YY = SINA*GSCALE + YY CALL GSDWTO(XX,YY) CALL GSMVTO(XX+DX,YY+DY) CALL GSDWTO(XX,YY) 40 CONTINUE C C---- draw last bit of axis if required C XX = (AXLEN*GSCALE)*COSA + X YY = (AXLEN*GSCALE)*SINA + Y CALL GSDWTO(XX,YY) C C---- restore character scale C CALL GSTRES(NTRSAV) C END C C C SUBROUTINE GSCVLF(CARD,XNUM,NFIELDS) C ===================================== C C---- Subroutine to do free-format conversion C C A.D. MCLACHLAN JULY 1984. REVISED 4 SEP 1984. C C .. Scalar Arguments .. INTEGER NFIELDS CHARACTER CARD* (*) C .. C .. Array Arguments .. REAL XNUM(*) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. INTEGER I,IEND,ISTART,NCHAR,NPOINT CHARACTER BLANK*1 C .. C .. Intrinsic Functions .. INTRINSIC INDEX,LEN C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C C .. Data statements .. DATA BLANK/' '/ C .. C C NCHAR = LEN(CARD) DO 10 I = 1,20 XNUM(I) = 0.0 10 CONTINUE NFIELDS = 0 C C---- Search for starting point C ISTART = 1 20 CONTINUE IF ((CARD(ISTART:ISTART).EQ.BLANK) .AND. (ISTART.LT.NCHAR)) THEN ISTART = ISTART + 1 GO TO 20 END IF 30 CONTINUE C C---- Decode fields in g format C IF (ISTART.LT.NCHAR) THEN NFIELDS = NFIELDS + 1 NPOINT = INDEX(CARD(ISTART:),BLANK) - 1 IEND = ISTART + NPOINT - 1 C C---- 6333 FORMAT(G.0) C 6333 FORMAT(G10.0) C C---- DECODE(NPOINT,6333,CARD(ISTART:IEND)) XNUM(NFIELDS) C READ (CARD(ISTART:IEND),FMT=6333) XNUM(NFIELDS) ISTART = IEND + 2 40 CONTINUE C C---- Skip over repeated blanks C IF ((CARD(ISTART:ISTART).EQ.BLANK) .AND. (ISTART.LT.NCHAR)) THEN ISTART = ISTART + 1 GO TO 40 ELSE GO TO 30 END IF END IF C END C C C SUBROUTINE GSCVLI(CHLINE,CHOUT,NCHAR) C ======================================= C C A.D. MCLACHLAN JUL 1984 . LAST UPDATED 9 OCT 1984 C C---- Subroutine to scan through input (chline) look for "!" C adapted from d.a. agard "curvy" C return portion up to ! in chout and character count in nchar C if no "!" found then return up to 60 characters C and trim trailing blanks C if "!" then do not trim C note!! both input/output variables are character variables C C .. Scalar Arguments .. INTEGER NCHAR CHARACTER CHOUT*60,CHLINE* (*) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. INTEGER MAXCHR,NBEFOR CHARACTER EXCL*1 C .. C .. External Functions .. INTEGER LENSTR EXTERNAL LENSTR C .. C .. Intrinsic Functions .. INTRINSIC INDEX C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C C .. Data statements .. DATA EXCL/'!'/ DATA MAXCHR/60/ C NCHAR = 0 C C---- Search for "!" in first maxchr+1 positions C NBEFOR = INDEX(CHLINE,EXCL) - 1 IF (NBEFOR.GT.MAXCHR) NBEFOR = MAXCHR C C---- when no "!" C IF (NBEFOR.LT.0) THEN NBEFOR = MAXCHR C C---- trim trailing blanks C NBEFOR = LENSTR(CHLINE) END IF C C---- When first character is "!" or string is blank return nchar=0 C IF (NBEFOR.NE.0) THEN C C---- copy into chout C CHOUT = CHLINE(1:NBEFOR) NCHAR = NBEFOR END IF C END C C C SUBROUTINE GSCVSC(AMIN,AMAX,AXLEN,XLOW,DX) C ============================================ C C---- plot scaling routine for data ranging from amin to amax C C A.D. MCLACHLAN JULY 1984. LAST UPDATED 5 SEP 1984 C C adapted from d.a. agard "curvy" 1982 C C GSCVSC selects the 'nicest?' possible xlow & dx for axis C length axlen, using integer part of axlen to draw on C this routine uses the greatest integer routine GScfix(r,i) C C .. Scalar Arguments .. REAL AMAX,AMIN,AXLEN,DX,XLOW C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. REAL AXL,DECFAC,DEL,DL,DM,POW10,XHIGH,XREM INTEGER ILOW,IPOW10,IREM,JD,NDM,NXLEN C .. C .. Local Arrays .. REAL DMC(11) C .. C .. External Subroutines .. EXTERNAL GSCFIX C .. C .. Intrinsic Functions .. INTRINSIC LOG10,REAL C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C C .. Data statements .. DATA NDM/11/ DATA DMC/1.0,1.25,1.5,2.0,2.5,3.0,4.0,5.0,6.0,8.0,10.0/ C IF (AXLEN.NE.0) THEN C C---- The plot axis is of length "axlen" graph units C "NXLEN" is the number of complete segments along the axis C "(NXLEN+1)" tick marks will be drawn C NXLEN = AXLEN AXL = NXLEN C C---- "DEL" is the range of "x" covered by one segment C DEL = (AMAX-AMIN)*0.99/AXL IF (DEL.GT.0.0) THEN C DL = LOG10(DEL) CALL GSCFIX(DL,IPOW10) POW10 = IPOW10 DECFAC = 10.0**POW10 DM = DEL/DECFAC C C---- "DM" is a number between 1.0 and 9.99 got by scaling off C "POW10" powers of 10.0 from "del" C "DX" is a nice value for the range, just above "dm" in size C select nice dx C JD = 1 10 CONTINUE C C---- Search for demarcation value just above dm C IF (DM.GT.DMC(JD)) THEN JD = JD + 1 GO TO 10 END IF 20 CONTINUE C C---- Compute nice xlow C "XLOW" is a multiple of "dx" just below the observed "amin" C and is the value of "x" to align with the origin C tick mark C "XHIGH" is the value of "x" to plot at the last tick mark C and we should have "xhigh" .ge. "amax" C DX = DMC(JD)*DECFAC CALL GSCFIX((AMIN/DX),ILOW) XLOW = REAL(ILOW)*DX XHIGH = REAL(ILOW+NXLEN)*DX XREM = XHIGH - AMAX CALL GSCFIX((XREM/DX),IREM) C C---- Must increase dx & redo xlow? C IF (XREM.LT. (-DEL*0.01)) THEN C C---- increase dx. if at end of range go to next power of 10.0 C JD = JD + 1 IF (JD.GT.NDM) THEN JD = 2 DECFAC = DECFAC*10.0 END IF GO TO 20 END IF C C---- Centre plot on axis C XLOW = XLOW - REAL(IREM/2)*DX IF ((AMIN.LE.0.5*DX) .AND. (AMIN.GE.-0.1*DX)) XLOW = 0.0 RETURN END IF END IF WRITE (LUNOUT,FMT=6000) AMIN,AMAX,AXLEN XLOW = 0.0 DX = 1.0 C C---- Format statements C 6000 FORMAT (2X,'!!!GSCVSC ARGUMENT ERROR:',/2X,'AMIN=',E14.5,' AMA', + 'X= ',E14.5,' AXLEN= ',F10.4) C END C C C SUBROUTINE GSDDRB(XB,YB) C ========================= C C GSDDRB draw to point C GSMDRB move to point C GSDOTB draw a point or dot C C convert pen movements on the drawing C board into instructions to the plotfile or plot device C C A.D. McLachlan JUN 1984. Last updated 28 SEP 1984 C C .. Scalar Arguments .. REAL XB,YB C .. LOGICAL*4 DEVCON,INITON CHARACTER FILNAM*80,TITLE*80 C .. C .. Local Scalars .. INTEGER IDOT,IEND,IERAS,ILWT,IPAP,IPEN,IX,IY,MODE C .. C .. External Subroutines .. EXTERNAL GSDWTM,GSFLWI,GSLVCK,GSMVTM,GSPTTM C .. C .. Intrinsic Functions .. INTRINSIC NINT C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWBLMX,DWBLMY, + DWLIMX,DWLIMY,PAPLMX,PAPLMY,UBXMAX,UBXMIN,UBYMAX, + UBYMIN,V64LMX,V64LMY INTEGER ICOLOR,IDRLVL,IPRINT,IUNIT,IXMAX,IXMIN, + IYMAX,IYMIN,LINWT,LUNIN,LUNOUT,MCNTFL,MDEVIC, + MDIREC,MIXCOL,MOUT,MPIC,MSCAFL,NERROR,NPICS C C REAL FACX, FACY, XFOFF, YFOFF INTEGER IDXOFF, IDYOFF, IXOLD, IYOLD, MODOLD COMMON /GSDVT/FACX,FACY,XFOFF,YFOFF,IDXOFF,IDYOFF, + IXOLD,IYOLD,MODOLD COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE C C .. Save Statement .. C SAVE C C .. Data statements .. C C---- plotfile command codes C DATA IEND/-1/,IDOT/-2/,ILWT/-3/,IPEN/-4/,IPAP/-5/,IERAS/-6/ C C---- draw to point C MODE = 1 GO TO 10 C ENTRY GSDOTB(XB,YB) C ==================== C C---- Plot a single dot C MODE = 2 GO TO 10 C ENTRY GSMDRB(XB,YB) C ==================== C C---- Move to point C MODE = 3 GO TO 10 C ENTRY GSVBRK() C ============= C C---- Break the current chaining of plotted points C IXOLD = 0 IYOLD = 0 MODOLD = 0 RETURN C C---- check level C 10 IF (IDRLVL.NE.3) CALL GSLVCK('GSDDRB/MDRB/DOTB') C C---- convert coordinates to integers in range 1:32677 C IX = NINT(XB*FACX+XFOFF) + IDXOFF IY = NINT(YB*FACY+YFOFF) + IDYOFF C C---- update plot limits C IF (IX.LT.IXMIN) IXMIN = IX IF (IX.GT.IXMAX) IXMAX = IX IF (IY.LT.IYMIN) IYMIN = IY IF (IY.GT.IYMAX) IYMAX = IY C C---- report values C IF (IPRINT.GE.3) THEN GO TO (20,30,40) MODE 20 WRITE (LUNOUT,FMT=6000) XB,YB,IX,IY GO TO 50 30 WRITE (LUNOUT,FMT=6002) XB,YB,IX,IY GO TO 50 40 WRITE (LUNOUT,FMT=6004) XB,YB,IX,IY END IF C C---- operate device C 50 CONTINUE C C---- test to avoid repeated pen movements if new point is same as old C reject one move or repeated draw or repeated dot C allow line of zero length (draw after move) C IF ((IX.EQ.IXOLD) .AND. (IY.EQ.IYOLD)) THEN IF ((MODE.EQ.3) .OR. (MODE.EQ.MODOLD)) RETURN END IF C C---- now do the plot operation C IF (MDIREC.EQ.0) THEN GO TO (60,70,80) MODE C C---- (1,2) undefined plotfile or paper C C---- drawto C 60 CONTINUE CALL GSFLWI(IX,IY) GO TO 130 C C---- point C 70 CONTINUE CALL GSFLWI(IDOT,0) CALL GSFLWI(IX,IY) GO TO 130 C C---- moveto C 80 CONTINUE CALL GSFLWI(IX,-IY) ELSE GO TO (130,130,90) MDEVIC C C---- (1) undefined C (2) paper C (3) terminal C 90 CONTINUE GO TO (100,110,120) MODE 100 CALL GSDWTM(IX,IY) GO TO 130 110 CALL GSPTTM(IX,IY) GO TO 130 120 CALL GSMVTM(IX,IY) END IF 130 IXOLD = IX IYOLD = IY MODOLD = MODE C C---- Format statements C 6000 FORMAT (2X,'GSDDRB ',2F10.5,2I6) 6002 FORMAT (2X,'GSDOTB ',2F10.5,2I6) 6004 FORMAT (2X,'GSMDRB ',2F10.5,2I6) C END C C C SUBROUTINE GSDRMV(X,Y,N) C ========================= C C---- Line plotting routine adapted from d.a. agard's plot82 C C A.D. McLachlan JUN 1984 Last updated 27 JUL 1984 C C---- First call must be a moveto to get pen in a defined position C C .. Scalar Arguments .. REAL X,Y INTEGER N C .. C .. Scalars in Common .. REAL ANGFAC,CHANGX,CHANGY,CHRSCX,CHRSCY,CHRSPX,CHRSPY,DOTMMX, + DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWBLMX,DWBLMY,DWLIMX, + DWLIMY,PAPLMX,PAPLMY,SCALEX,SCALEY,UBXMAX,UBXMIN,UBYMAX, + UBYMIN,USANGX,USANGY,V64LMX,V64LMY,XBNEW,XBOLD,XCHAR,XCSTRT, + XNOW,YBNEW,YBOLD,YCHAR,YCSTRT,YNOW INTEGER ICENTC,ICOLOR,IDRLVL,IFONT,IPRINT,IUNIT,IXMAX,IXMIN,IYMAX, + IYMIN,KPRINT,LINWT,LUNIN,LUNOUT,MCNTFL,MDEVIC,MDIREC, + MIXCOL,MOUT,MPIC,MSCAFL,NERROR,NPICS LOGICAL*4 DEVCON,FONTIN,ICULNK,INITON,LINMOD,UCSPAC CHARACTER FILNAM*80,TITLE*80 C .. C .. Arrays in Common .. REAL CHRMAT,CUMAT,USRMAT C .. C .. Local Scalars .. REAL CHORGX,CHORGY,CUORGX,CUORGY,X1,X2,XORIG,XP,Y1,Y2,YORIG,YP INTEGER MODE,NCODE LOGICAL ACCEPT,INSIDE,LSTOUT,OLDOUT C .. C .. Local Arrays .. INTEGER NCTRAN(24),NSTRAN(24) C .. C .. External Subroutines .. EXTERNAL GSCLPL,GSCLPT,GSDDRB,GSDOTB,GSMDRB C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSCHX/CHRMAT(3,3),CHRSCX,CHRSCY,CHANGX,CHANGY, + CHRSPX,CHRSPY,ICENTC,UCSPAC,IFONT,FONTIN,XCHAR, + YCHAR,XCSTRT,YCSTRT,ANGFAC COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE COMMON /GSDWX/XNOW,YNOW,XBNEW,YBNEW,XBOLD,YBOLD COMMON /GSUTR/USRMAT(3,3),SCALEX,SCALEY,USANGX,USANGY, + CUMAT(3,3),LINMOD,ICULNK,KPRINT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (XORIG,USRMAT(1,3)), (YORIG,USRMAT(2,3)) EQUIVALENCE (CUORGX,CUMAT(1,3)), (CUORGY,CUMAT(2,3)) EQUIVALENCE (NSTRAN(1),USRMAT(1,1)) EQUIVALENCE (CHORGX,CHRMAT(1,3)), (CHORGY,CHRMAT(2,3)) EQUIVALENCE (NCTRAN(1),CHRMAT(1,1)) C .. C .. Entry Points .. ENTRY GSDWTO(X,Y) C ================== C MODE = 1 IF (KPRINT.GE.3) WRITE (LUNOUT,FMT=6000) GO TO 10 C ENTRY GSDWBY(X,Y) C ================== C MODE = 2 IF (KPRINT.GE.3) WRITE (LUNOUT,FMT=6002) GO TO 10 C ENTRY GSPOIN(X,Y) C ================== C MODE = 3 IF (KPRINT.GE.3) WRITE (LUNOUT,FMT=6014) GO TO 10 C ENTRY GSMVTO(X,Y) C ================== C MODE = 4 IF (KPRINT.GE.3) WRITE (LUNOUT,FMT=6004) GO TO 10 C ENTRY GSMVBY(X,Y) C ================== C MODE = 5 IF (KPRINT.GE.3) WRITE (LUNOUT,FMT=6006) C 10 CONTINUE C C---- (xp,yp) is target position for the pen C GO TO (20,30,20,20,30) MODE 20 XP = X YP = Y GO TO 40 30 XP = XNOW + X YP = YNOW + Y C C---- update the record of old and new requested user coordinates C 40 CONTINUE XNOW = XP YNOW = YP C C---- convert target point to drawing board coords C C---- use user or character transformation C IF (LINMOD) THEN XBNEW = USRMAT(1,1)*XP + USRMAT(1,2)*YP + XORIG YBNEW = USRMAT(2,1)*XP + USRMAT(2,2)*YP + YORIG ELSE XBNEW = CUMAT(1,1)*XP + CUMAT(1,2)*YP + CUORGX + XCHAR YBNEW = CUMAT(2,1)*XP + CUMAT(2,2)*YP + CUORGY + YCHAR END IF X2 = XBNEW Y2 = YBNEW C C---- update record of requested drawing board coords C these are not always the same as the pen positions because of C the clipping of the lines. the pen always stays on the board C oldout records if previous point was off the board C OLDOUT = LSTOUT C C---- check whether new point lies on board C CALL GSCLPT(XBNEW,YBNEW,NCODE,INSIDE) LSTOUT = (.NOT.INSIDE) C C---- record error C IF (LSTOUT) NERROR = NERROR + 1 C C---- for point save new position but only draw it if inside C IF ((MODE.EQ.3) .AND. INSIDE) THEN CALL GSDOTB(X2,Y2) C C---- for moveto or moveby save new position but only move pen C if position is on board C ELSE IF ((MODE.GT.3) .AND. INSIDE) THEN C C---- inside C CALL GSMDRB(X2,Y2) C C---- outside: no action C for drawto or drawby clip the line and change its end points C ELSE IF (MODE.LE.2) THEN X1 = XBOLD Y1 = YBOLD CALL GSCLPL(X1,Y1,X2,Y2,ACCEPT) C C---- draw line if accepted C IF (ACCEPT) THEN C C---- move pen to clipped old point if last point was outside frame C IF (OLDOUT) CALL GSMDRB(X1,Y1) CALL GSDDRB(X2,Y2) ELSE C C---- error if line removed C NERROR = NERROR + 1 END IF END IF C XBOLD = XBNEW YBOLD = YBNEW C IF (KPRINT.GE.3) THEN WRITE (LUNOUT,FMT=6008) XBOLD,YBOLD,XBNEW,YBNEW WRITE (LUNOUT,FMT=6010) X1,Y1,X2,Y2 WRITE (LUNOUT,FMT=6012) ACCEPT,INSIDE,LSTOUT,OLDOUT,MODE END IF C C---- Format statements C 6000 FORMAT (1X,'GSDWTO') 6002 FORMAT (1X,'GSDWBY') 6004 FORMAT (1X,'GSMVTO') 6006 FORMAT (1X,'GSMVBY') 6008 FORMAT (1X,'XBOLD YBOLD XBNEW YBNEW ',2F10.5,2X,2F10.5) 6010 FORMAT (1X,'X1 Y1 X2 Y2 ',2F10.5,2X,2F10.5) 6012 FORMAT (1X,'ACCEPT INSIDE LSTOUT OLDOUT MODE ',4L4,I5) 6014 FORMAT (1X,'GSPOIN') C END C C C SUBROUTINE GSDVON(GSNAM,NOUT) C =============================== C C---- Switches on plotting device C C A.D. McLachlan JUN 1984. Last updated 4 OCT 1984 C C .. Scalar Arguments .. INTEGER NOUT CHARACTER GSNAM* (*) C .. C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWBLMX,DWBLMY, + DWLIMX,DWLIMY,PAPLMX,PAPLMY,UBXMAX,UBXMIN,UBYMAX,UBYMIN, + V64LMX,V64LMY INTEGER ICOLOR,IDRLVL,IPRINT,IUNIT,IUNITR,IXMAX,IXMIN,IYMAX,IYMIN, + LINWT,LUNIN,LUNOUT,MCNTFL,MDEVIC,MDIREC,MIXCOL,MOUT,MPIC, + MSCAFL,NERROR,NPICS LOGICAL*4 DEVCON,INITON CHARACTER FILNAM*80,TITLE*80,TITLEH*80 C .. C .. Arrays in Common .. REAL IREC INTEGER AREC(128) C .. C .. Local Scalars .. INTEGER I,JPIC,KEOF,LEVEL,MREC,NRECL CHARACTER CHKEY*1,TMPNAM*40,BLN80*80 C .. C .. External Subroutines .. EXTERNAL GSBLTM,GSCFIL,GSCYTM,GSFLBR,GSFLP1, + GSFLSR,GSFLWR,GSGRTM,GSINTM,GSLVCK, + GSMYTM,GSOFLW,GSOFTM,GSRHDR, + GSSCTM,GSTYTM,GSWHDR C .. C .. Intrinsic Functions .. INTRINSIC INDEX C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE COMMON /GSFHD/IUNITR,IREC(128) C .. Save Statement .. C SAVE C C .. Equivalences .. C C---- Equivalences C EQUIVALENCE (IREC(1),AREC(1)) EQUIVALENCE (IREC(41),TITLEH) C .. C .. Data statements .. DATA BLN80/' '/ C C---- check level C TITLEH = TITLE IF ((IDRLVL.EQ.0) .OR. (IDRLVL.GT.2)) + CALL GSLVCK('GSDVON') C C---- to switch on plotting device or open plotfile C DEVCON = .TRUE. IF (MDIREC.EQ.1) THEN C C---- turn on device C GO TO (20,20,10) MDEVIC C C---- (1) undefined. C (2) paper C (3) terminal C 10 CONTINUE MOUT = NOUT IF (MOUT.LE.0) MOUT = 90 IF (IPRINT.GE.2) WRITE (LUNOUT,FMT=6004) MOUT CALL GSINTM(MOUT) CALL GSGRTM ELSE C C---- open plotfile C TMPNAM = GSNAM FILNAM = TMPNAM IF (INDEX(FILNAM,BLN80).EQ.1) FILNAM = 'plotout.plt' IF (IPRINT.GE.2) WRITE (LUNOUT,FMT=6000) FILNAM TMPNAM = FILNAM CALL GSOFLW(IUNIT,TMPNAM) END IF C 20 CONTINUE RETURN C ENTRY GSDVOF() C ============= C TITLEH = TITLE IF (MDIREC.EQ.1) THEN GO TO (50,50,30) MDEVIC C C---- terminal C 30 CONTINUE C C---- pause and wait for reply before clearing screen always write this!! C CALL GSBLTM CALL GSTYTM WRITE (LUNOUT,FMT=6002) READ (LUNIN,FMT=6006) CHKEY C C---- "return" or "blank" saves the screen C IF (CHKEY.NE.' ') CALL GSSCTM CALL GSTYTM CALL GSCYTM CALL GSMYTM(0,0) C C---- close graphics stream C CALL GSOFTM(MOUT) IF (IPRINT.GE.2) WRITE (LUNOUT,FMT=6004) MOUT ELSE C C---- add picture count to each file header position file at first record C CALL GSFLP1 NRECL = 512 DO 40 JPIC = 1,NPICS KEOF = 0 CALL GSRHDR(KEOF) IF (KEOF.NE.1) THEN AREC(23) = NPICS CALL GSFLBR(NRECL) IF (IPRINT.GE.2) WRITE (LUNOUT,FMT=6008) AREC(1), + (IREC(I),I=2,3), (AREC(I),I=4,16), + (IREC(I),I=17,22),AREC(23),TITLE CALL GSFLWR(IREC,NRECL) MREC = AREC(1) C QSKIP - skip forward 1 record of length LRECL C LRECL = Record length in elements C CALL QSEEK (IUNIT,IREC,IEL,LRECL) - Move to irec,iel CALL GSFLSR(MREC*4) MREC = AREC(1) END IF 40 CONTINUE C C---- write a last header for a null picture C with no records to terminate the file properly C LEVEL = IDRLVL IDRLVL = 3 CALL GSWHDR IDRLVL = LEVEL CALL GSCFIL(IUNIT) END IF 50 DEVCON = .FALSE. NERROR = 0 C C---- Format statements C 6000 FORMAT (2X,'GSDVON: FILNAM= ',A) 6002 FORMAT (2X,'Type "RETURN" or "SPACE" to save picture',4X,'any ot', + 'her character to clear ') 6004 FORMAT (2X,'GSDVON/DVOF: MOUT=',I5) 6006 FORMAT (A,A) 6008 FORMAT (2X,'Plot Header: ',I5,2F10.4,4I6,/1X,9I5,/1X,6F10.4,/1X, + I5,' TITLE: ',/1X,A) C END C C C SUBROUTINE GSEDTR(DTMMX,DTMMY) C =============================== C C---- Defines drawing board to device transformations C C A.D. McLachlan JUN 1984. Last updated 10 SEP 84. C C (XDRW,YDRW) are in mm. on board C (XDEV,YDEV) are in mm. on device C (IX,IY) are dot indices for device C (normally 10 dots/mm if plotfile) C (DTMMX,DTMMY) are dots/mm along x,y . C if called value is (0.0,0.0) C C---- then use automatic setting C negative values forbidden C C Board to device transformation for floating scale is C C XDEV=XDRW*WDFACX + XDOFF C YDEV=YDRW*WDFACY + YDOFF C C Board to device transformation for true scale is C C XDEV=XDRW+XDOFF C YDEV=YDRW+YDOFF C C OFFSETS (XDOFF,YDOFF) depend on floating or true origin C device mm to dot transformation for (ix,iy) in range 1:32767 is C C IX= XDEV*DOTMMX + IDXOFF C IY= YDEV*DOTMMY + IDYOFF C C combined transformation is C C IX=(XDRW*FACX+XFOFF)+IDXOFF C IY=(YDRW*FACY+YFOFF)+IDYOFF C C---- board to device C C .. Scalar Arguments .. REAL DTMMX,DTMMY C .. C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWBLMX,DWBLMY, + DWLIMX,DWLIMY,PAPLMX,PAPLMY,UBXMAX,UBXMIN,UBYMAX, + UBYMIN,V64LMX,V64LMY INTEGER ICOLOR,IDRLVL,IPRINT,IUNIT,IXMAX,IXMIN, + IYMAX,IYMIN,LINWT,LUNIN,LUNOUT,MCNTFL,MDEVIC, + MDIREC,MIXCOL,MOUT,MPIC,MSCAFL,NERROR,NPICS LOGICAL*4 DEVCON,INITON CHARACTER FILNAM*80,TITLE*80 C .. C .. Local Scalars .. REAL DT100,TX,TY,WDFACX,WDFACY,XDOFF,YDOFF INTEGER IBIG,IXBIG,IYBIG,NAUTO C .. C .. Intrinsic Functions .. INTRINSIC MAX,MIN C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT REAL FACX, FACY, XFOFF, YFOFF INTEGER IDXOFF, IDYOFF, IXOLD, IYOLD, MODOLD COMMON /GSDVT/FACX,FACY,XFOFF,YFOFF,IDXOFF,IDYOFF, + IXOLD,IYOLD,MODOLD COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE C C .. Save Statement .. C SAVE C IF (MSCAFL.EQ.0) THEN C C---- fixed scale C WDFACX = 1.0 WDFACY = 1.0 IF (MCNTFL.EQ.0) THEN C C---- fixed origin C XDOFF = 0.0 YDOFF = 0.0 ELSE C C---- floating origin C XDOFF = -UBXMIN YDOFF = -UBYMIN END IF ELSE IF (MCNTFL.EQ.0) THEN C C---- floating scale fixed origin maps (0...ubmax) onto (0...dvmax) C TX = DVXMAX/ (UBXMAX+0.0001) TY = DVYMAX/ (UBYMAX+0.0001) WDFACX = MIN(TX,TY) WDFACY = WDFACX XDOFF = 0.0 YDOFF = 0.0 ELSE C C---- floating scale floating origin C TX = (DVXMAX-DVXMIN)/ ((UBXMAX-UBXMIN)+0.0001) TY = (DVYMAX-DVYMIN)/ ((UBYMAX-UBYMIN)+0.0001) WDFACX = MIN(TX,TY) WDFACY = WDFACX XDOFF = DVXMIN - UBXMIN*WDFACX YDOFF = DVYMIN - UBYMIN*WDFACY END IF C C---- transformation from device (mm) to integers C NAUTO = 1 DOTMMX = DTMMX DOTMMY = DTMMY IF ((DOTMMX.NE.0.0) .OR. (DOTMMY.NE.0.0)) THEN NAUTO = 0 C C---- warn if outside range 100-254 dots per inch C constant for 100 dots per inch C DT100 = 100.0/25.4 IF (((DOTMMX.LT.DT100).OR. (DOTMMX.GT.10.0)) .OR. + ((DOTMMY.LT.DT100).OR. (DOTMMY.GT.10.0))) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6004) DOTMMX,DOTMMY END IF C C---- check for too fine a grid across device window C check for zero dots C IF ((DOTMMX.LE.0.0) .OR. (DOTMMY.LE.0.0)) NAUTO = 1 IXBIG = DOTMMX*DVXMAX IYBIG = DOTMMY*DVYMAX IBIG = MAX(IXBIG,IYBIG) IF (IBIG.GT.32766) NAUTO = 1 IF ((NAUTO.EQ.1) .AND. (IPRINT.GE.1)) WRITE (LUNOUT, + FMT=6006) DOTMMX,DOTMMY END IF C GO TO (10,10,20) MDEVIC C C---- (1,2) undefined plotfile or paper normally at 10.0 dots/mm C integers 1 to 32767 (2**15 - 1) C this section may override values set by call C 10 CONTINUE IF (NAUTO.EQ.1) THEN DOTMMX = 10.0 DOTMMY = 10.0 END IF IDXOFF = 1 IDYOFF = 1 GO TO 30 C C---- (3) vt640 plot screen C 20 CONTINUE C C---- integer memory grid (880*756) = (165.0*139.5)mm C user area with margins (96:975*13:768) C scales 880/165=5.3333 756/139.5=5.41935 C physical grid is 3.3333 dots/mm with full screen size C 1024*(5/8)=640 and 780*(8/13)=480 physical dots (192*144) mm C we only use part of this as dots near edge may get lost C C---- if interactive then override called values C IF ((NAUTO.EQ.1) .OR. (MDIREC.EQ.1)) THEN DOTMMX = 880.0/165.0 DOTMMY = 756.0/139.5 END IF IDXOFF = 96 IDYOFF = 13 C C---- combined transformation C 30 FACX = DOTMMX*WDFACX FACY = DOTMMY*WDFACY XFOFF = DOTMMX*XDOFF YFOFF = DOTMMY*YDOFF C C---- reset last point data for start of picture C IXOLD = 0 IYOLD = 0 MODOLD = 0 C IF (IPRINT.GE.2) THEN WRITE (LUNOUT,FMT=6000) WDFACX,WDFACY,FACX,FACY,XDOFF,YDOFF, + XFOFF,YFOFF,DOTMMX,DOTMMY,IDXOFF,IDYOFF WRITE (LUNOUT,FMT=6002) MSCAFL,MCNTFL,DWLIMX,DWLIMY,DVXMIN, + DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN,UBYMAX END IF C C---- Format statements C 6000 FORMAT (2X,'GSEDTR: WDFACX WDFACY FACX FACY ', + 4F10.4,/12X,'XDO', + 'FF YDOFF XFOFF YFOFF',4F10.4,/10X,'DOTMMX DOTMMY IDXOF', + 'F IDYOFF',2F10.4,2I5) 6002 FORMAT (2X,'GSEDTR: MSCAFL MCNTFL ',2I5,/2X,'DWLIMX DWLIMY ', + 2F10.4,/2X,'DVXMIN DVXMAX DVYMIN DVYMAX ',4F10.4,/2X,'UBX', + 'MIN UBXMAX UBYMIN UBYMAX ',4F10.4) 6004 FORMAT (2X,'!!!GSEDTR: WARNING - DOTMMX,DOTMMY=', + 2F10.4,/2X,'OU', + 'TSIDE EXPECTED RANGE 100/25.4-10.0 ') 6006 FORMAT (2X,'!!!GSEDTR: WARNING - DOTMMX,DOTMMY=', + 2F10.4,/2X,'TO', + 'O LARGE OR SMALL FOR DEVICE GRID 1-32766; VALUES IGNORED ' + ) C END C C C SUBROUTINE GSEDVC(NDIREC,NDEVIC,DWLIM1,DWLIM2, + DVLMX1,DVLMX2,DVLMY1,DVLMY2) C ============================================== C C A.D. McLachlan JUN 1984. Last updated 14 JUL 1984 C C---- Select plot device. C C .. Scalar Arguments .. REAL DVLMX1,DVLMX2,DVLMY1,DVLMY2,DWLIM1,DWLIM2 INTEGER NDEVIC,NDIREC C .. C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWBLMX,DWBLMY, + DWLIMX,DWLIMY,PAPLMX,PAPLMY,UBXMAX,UBXMIN,UBYMAX,UBYMIN, + V64LMX,V64LMY INTEGER ICOLOR,IDRLVL,IPRINT,IUNIT,IXMAX,IXMIN,IYMAX,IYMIN,LINWT, + LUNIN,LUNOUT,MCNTFL,MDEVIC,MDIREC,MIXCOL,MOUT,MPIC,MSCAFL, + NERROR,NPICS LOGICAL*4 DEVCON,INITON CHARACTER FILNAM*80,TITLE*80 C .. C .. Local Scalars .. REAL DTMXDF,DTMYDF,DWBXDF,DWBXMX,DWBYDF,DWBYMX,PAPXDF,PAPXMX, + PAPYDF,PAPYMX,V64XDF,V64XMX,V64YDF,V64YMX C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE C C .. Save Statement .. C SAVE C C .. Data statements .. C C---- data statements for device dimensions etc units millimetres C 2**15-1=32767 is maximum integer size on drawing board with C 10 dots/mm standard C extreme values and default values set here C C---- paper: approx 13*20 inches normal, 13.2*80 max C C---- vt640: approx 6.5*5.5 inches C C---- paper plotter has 1320 dot positions across page C 13.2 inches =335.28 mm. normally use only 1296 dots C paper plotter 100 dots/inch, but plot file uses 10 dots/mm C DATA DWBXMX/3276.6/,DWBYMX/3276.6/ DATA DWBXDF/330.0/,DWBYDF/508.0/ DATA PAPXMX/335.0/,PAPYMX/2032.0/ DATA PAPXDF/330.0/,PAPYDF/508.0/ DATA V64XMX/165.0/,V64YMX/139.5/ DATA V64XDF/165.0/,V64YDF/139.5/ DATA DTMXDF/10.0/,DTMYDF/10.0/ C C---- choice of deferred plotfile or direct immediate display C MDIREC=0,1 C MDEVIC = 1 undefined. must have mdirec=0 C = 2 paper plotter trilog C = 3 vt640 screen C MDEVIC = NDEVIC MDIREC = NDIREC C C---- check control values C IF ((MDEVIC.LT.1) .OR. (MDEVIC.GT.3)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6002) MDEVIC MDEVIC = 1 IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6004) END IF IF ((MDIREC.NE.0) .AND. (MDIREC.NE.1)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6000) MDIREC MDIREC = 0 IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6006) END IF C C---- check for interactive device C IF (((MDEVIC.EQ.1).OR. (MDEVIC.EQ.2)) .AND. (MDIREC.NE.0)) THEN MDIREC = 0 IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6006) END IF C C---- set the default device controls C sizes C DWLIM1 = DWBXDF DWLIM2 = DWBYDF C C---- copy limits into common block C DWBLMX = DWBXMX DWBLMY = DWBYMX PAPLMX = PAPXMX PAPLMY = PAPYMX V64LMX = V64XMX V64LMY = V64YMX DOTMMX = DTMXDF DOTMMY = DTMYDF DVLMX1 = 0.0 DVLMY1 = 0.0 GO TO (10,30,20) MDEVIC C C---- undefined device C 10 CONTINUE DVLMX2 = DWBXDF DVLMY2 = DWBYDF GO TO 30 20 DVLMX2 = V64XDF DVLMY2 = V64YDF RETURN C C---- paper C 30 DVLMX2 = PAPXDF DVLMY2 = PAPYDF C C---- Format statements C 6000 FORMAT (2X,'!!!GSEDVC ERROR: MDIREC NOT (0),(1) =',I5) 6002 FORMAT (2X,'!!!GSEDVC ERROR: ', + 'MDEVIC NOT (1)UNDEF (2)PAP (3)VT64', + '0 =',I5) 6004 FORMAT (2X,'!!!GSEDVC WARN: MDEVIC RESET TO (1)') 6006 FORMAT (2X,'!!!GSEDVC WARN: MDIREC RESET TO (0)') C END C C C SUBROUTINE GSEDVP(DVLMX1,DVLMX2,DVLMY1,DVLMY2,VBXMIN, + VBXMAX,VBYMIN,VBYMAX) C ====================================================== C C---- Resets plot device and board sizes to override defaults C but not exceed set limits C C A.D. McLachlan JUN 1984 Last updated 14 JUL 1984 C C .. Scalar Arguments .. REAL DVLMX1,DVLMX2,DVLMY1,DVLMY2,DWLIM1,DWLIM2,VBXMAX,VBXMIN, + VBYMAX,VBYMIN C .. C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWBLMX,DWBLMY, + DWLIMX,DWLIMY,PAPLMX,PAPLMY,UBXMAX,UBXMIN,UBYMAX,UBYMIN, + V64LMX,V64LMY INTEGER ICOLOR,IDRLVL,IPRINT,IUNIT,IXMAX,IXMIN,IYMAX,IYMIN,LINWT, + LUNIN,LUNOUT,MCNTFL,MDEVIC,MDIREC,MIXCOL,MOUT,MPIC,MSCAFL, + NERROR,NPICS LOGICAL*4 DEVCON,INITON CHARACTER FILNAM*80,TITLE*80 C .. C .. Local Scalars .. REAL XBIG,YBIG C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE C C .. Save Statement .. C SAVE C C---- Main entry here Check device viewport C DVXMIN = DVLMX1 DVXMAX = DVLMX2 DVYMIN = DVLMY1 DVYMAX = DVLMY2 GO TO (10,20,30) MDEVIC C C---- (1) undefined: max device size is board size C 10 CONTINUE XBIG = DWBLMX YBIG = DWBLMY GO TO 40 C C---- (2) paper: C 20 CONTINUE XBIG = PAPLMX YBIG = PAPLMY GO TO 40 C C---- (3) vt640: C 30 CONTINUE XBIG = V64LMX YBIG = V64LMY 40 IF ((DVXMIN.LT.0.0) .OR. (DVXMIN.GT. (DVXMAX-1.0))) THEN DVXMIN = 0.0 IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6008) DVLMX1,DVXMIN END IF IF ((DVXMAX.LT.1.0) .OR. (DVXMAX.GT.XBIG)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6004) DVXMAX,XBIG DVXMAX = XBIG END IF IF ((DVYMIN.LT.0.0) .OR. (DVYMIN.GT. (DVYMAX-1.0))) THEN DVYMIN = 0.0 IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6010) DVLMY1,DVYMIN END IF IF ((DVYMAX.LT.1.0) .OR. (DVYMAX.GT.YBIG)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6006) DVYMAX,YBIG DVYMAX = YBIG END IF C C---- set default drawing board window C VBXMIN = 0.0 VBXMAX = DWLIMX VBYMIN = 0.0 VBYMAX = DWLIMY RETURN C ENTRY GSEBSZ(DWLIM1,DWLIM2) C =========================== C C---- Check drawing board limits C DWLIMX = DWLIM1 DWLIMY = DWLIM2 IF ((DWLIMX.LT.1.0) .OR. (DWLIMX.GT.DWBLMX)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6000) DWLIMX,DWBLMX DWLIMX = DWBLMX END IF IF ((DWLIMY.LT.1.0) .OR. (DWLIMY.GT.DWBLMY)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6002) DWLIMY,DWBLMY DWLIMY = DWBLMY END IF C C---- Format statements C 6000 FORMAT (2X,'!!!GSEBSZ: DWLIMX=',F10.4, + ' OUTSIDE RANGE - RESET TO ',F10.4) 6002 FORMAT (2X,'!!!GSEBSZ: DWLIMY=',F10.4, + ' OUTSIDE RANGE - RESET TO ',F10.4) 6004 FORMAT (2X,'!!!GSEDVP: DVXMAX =',F10.4, + ' OUTSIDE RANGE - RESET TO ',F10.4) 6006 FORMAT (2X,'!!!GSEDVP: DVYMAX=',F10.4, + ' OUTSIDE RANGE - RESET TO ',F10.4) 6008 FORMAT (2X,'!!!GSEDVP: DVXMIN =',F10.4, + ' OUTSIDE RANGE - RESET TO ',F10.4) 6010 FORMAT (2X,'!!!GSEDVP: DVYMIN=',F10.4, + ' OUTSIDE RANGE - RESET TO ',F10.4) C END C C C SUBROUTINE GSENVR C ================== C C---- Sets up plotting windows etc C C A.D. McLachlan JUL 1984. Last updated 14 JUL 1984. C C**** ENTRY GSXENV used to clear old settings to default C C**** ENTRIES: GSDVIC,GSBSIZ,GSDVPT,GSWNDB,GSWSCL C GSDTRN C C These are used to set the desired values for window and C device constants. When GSenvr is called it uses either C its own default values or those set by the user to build C a reasonable plotting system. Each subroutine checks C its input values for errors and supplies a default for C the next step. C C---- The order of initialisation is: C GSEDVC (DIRECT,DEVICE) C GSEBSZ (DRAWING BOARD SIZE) C GSEDVP (DEVICE VIEWPORT) C GSEWND (DEVICE WINDOW) C GSEWSC (SCALING OPTIONS: FLOAT,FIX) C GSEDTR (DEVICE TRANSFORMATION) C C Values are remembered, so that a second call to GSenvir C sets the same environment as before. also, if any of the C settings are altered GSenvr makes minimal changes to C the values of other constants. C C---- The object of these routines is to ensure that all plots C stay within the drawing board and device limits. C C---- Main entry check level C C .. Scalar Arguments .. REAL XX1,XX2,YY1,YY2 INTEGER NN1,NN2 C .. C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWBLMX,DWBLMY, + DWLIMX,DWLIMY,PAPLMX,PAPLMY,UBXMAX,UBXMIN,UBYMAX,UBYMIN, + V64LMX,V64LMY INTEGER ICOLOR,IDRLVL,IPRINT,IUNIT,IXMAX,IXMIN,IYMAX,IYMIN,LINWT, + LUNIN,LUNOUT,MCNTFL,MDEVIC,MDIREC,MIXCOL,MOUT,MPIC,MSCAFL, + NERROR,NPICS LOGICAL*4 DEVCON,INITON CHARACTER FILNAM*80,TITLE*80 C .. C .. Local Scalars .. REAL DTMMX,DTMMY,DVLMX1,DVLMX2,DVLMY1,DVLMY2,DWLIM1,DWLIM2,VBXMAX, + VBXMIN,VBYMAX,VBYMIN,X1,X2,X3,X4,Y1,Y2,Y3,Y4 INTEGER N1,N2,NCNTFL,NDEVIC,NDIREC,NEBSIZ,NEDTRN,NEDVIC,NEDVPT, + NEWNDB,NEWSCL,NSCAFL C .. C .. External Subroutines .. EXTERNAL GSEBSZ,GSEDTR,GSEDVC,GSEDVP, + GSEWND,GSEWSC,GSLVCK C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE C C .. Save Statement .. C SAVE C IF ((IDRLVL.EQ.0) .OR. (IDRLVL.EQ.3)) + CALL GSLVCK('GSENVR') N1 = 0 N2 = 2 IF (NEDVIC.EQ.1) THEN N1 = NDIREC N2 = NDEVIC END IF CALL GSEDVC(N1,N2,X3,Y3,X1,X2,Y1,Y2) IF (NEBSIZ.EQ.1) THEN X3 = DWLIM1 Y3 = DWLIM2 END IF CALL GSEBSZ(X3,Y3) IF (NEDVPT.EQ.1) THEN X1 = DVLMX1 X2 = DVLMX2 Y1 = DVLMY1 Y2 = DVLMY2 END IF CALL GSEDVP(X1,X2,Y1,Y2,X3,X4,Y3,Y4) IF (NEWNDB.EQ.1) THEN X3 = VBXMIN X4 = VBXMAX Y3 = VBYMIN Y4 = VBYMAX END IF CALL GSEWND(X3,X4,Y3,Y4) N1 = 0 N2 = 1 IF (NEWSCL.EQ.1) THEN N1 = NSCAFL N2 = NCNTFL END IF CALL GSEWSC(N1,N2) X1 = 0.0 Y1 = 0.0 IF (NEDTRN.EQ.1) THEN X1 = DTMMX Y1 = DTMMY END IF CALL GSEDTR(X1,Y1) RETURN C ENTRY GSXENV() C ============= C C---- Check level C IF ((IDRLVL.EQ.0) .OR. (IDRLVL.EQ.3)) + CALL GSLVCK('GSXENV') NEDVIC = 0 NEBSIZ = 0 NEDVPT = 0 NEWNDB = 0 NEWSCL = 0 NEDTRN = 0 RETURN C ENTRY GSDVIC(NN1,NN2) C ====================== C C---- Check level C IF ((IDRLVL.EQ.0) .OR. (IDRLVL.GT.2)) + CALL GSLVCK('GSDVIC') NDIREC = NN1 NDEVIC = NN2 NEDVIC = 1 RETURN C ENTRY GSBSIZ(XX1,YY1) C ====================== C C---- Check level C IF ((IDRLVL.EQ.0) .OR. (IDRLVL.GT.2)) + CALL GSLVCK('GSBSIZ') DWLIM1 = XX1 DWLIM2 = YY1 NEBSIZ = 1 RETURN C ENTRY GSDVPT(XX1,XX2,YY1,YY2) C ============================== C C---- Check level C IF ((IDRLVL.EQ.0) .OR. (IDRLVL.GT.2)) + CALL GSLVCK('GSDVPT') DVLMX1 = XX1 DVLMX2 = XX2 DVLMY1 = YY1 DVLMY2 = YY2 NEDVPT = 1 RETURN C ENTRY GSWNDB(XX1,XX2,YY1,YY2) C ============================= C C---- Check level C IF ((IDRLVL.EQ.0) .OR. (IDRLVL.GT.2)) + CALL GSLVCK('GSWNDB') VBXMIN = XX1 VBXMAX = XX2 VBYMIN = YY1 VBYMAX = YY2 NEWNDB = 1 RETURN C ENTRY GSWSCL(NN1,NN2) C ====================== C C---- Check level C IF ((IDRLVL.EQ.0) .OR. (IDRLVL.GT.2)) + CALL GSLVCK('GSWSCL') NSCAFL = NN1 NCNTFL = NN2 NEWSCL = 1 RETURN C ENTRY GSDTRN(XX1,YY1) C ====================== C C---- Check level C IF ((IDRLVL.EQ.0) .OR. (IDRLVL.EQ.3)) + CALL GSLVCK('GSDTRN') DTMMX = XX1 DTMMY = YY1 NEDTRN = 1 C END C C C SUBROUTINE GSEWND(VBXMIN,VBXMAX,VBYMIN,VBYMAX) C ============================================== C C---- Resets drawing board window on drawing board in mm C must not be used till drawing board size is set C bounds which go off board are rejected C C A.D. McLachlan JUN 1984. Last updated 14 JUL 1984 C C .. Scalar Arguments .. REAL VBXMAX,VBXMIN,VBYMAX,VBYMIN C .. C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWBLMX,DWBLMY, + DWLIMX,DWLIMY,PAPLMX,PAPLMY,UBXMAX,UBXMIN,UBYMAX,UBYMIN, + V64LMX,V64LMY INTEGER ICOLOR,IDRLVL,IPRINT,IUNIT,IXMAX,IXMIN,IYMAX,IYMIN,LINWT, + LUNIN,LUNOUT,MCNTFL,MDEVIC,MDIREC,MIXCOL,MOUT,MPIC,MSCAFL, + NERROR,NPICS LOGICAL*4 DEVCON,INITON CHARACTER FILNAM*80,TITLE*80 C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE C C .. Save Statement .. C SAVE C UBXMIN = VBXMIN UBXMAX = VBXMAX UBYMIN = VBYMIN UBYMAX = VBYMAX IF (UBXMIN.LT.UBXMAX) THEN IF (UBYMIN.LT.UBYMAX) THEN IF ((UBXMIN.GE.0.0) .AND. (UBXMAX.LE.DWLIMX)) THEN IF ((UBYMIN.GE.0.0) .AND. (UBYMAX.LE.DWLIMY)) GO TO 10 END IF END IF END IF C C---- error in requested bounds C IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6000) UBXMIN,UBXMAX,UBYMIN, + UBYMAX,DWLIMX,DWLIMY UBXMIN = 0.0 UBXMAX = DWLIMX UBYMIN = 0.0 UBYMAX = DWLIMY IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6002) UBXMIN,UBXMAX,UBYMIN, + UBYMAX C C---- set clipping to current drawing board bounds C 10 CONTINUE C C---- Format statements C 6000 FORMAT (2X,'!!!GSEWND: BOUNDS REQUESTED ARE OFF BOARD ', + /2X,'XM', + 'IN XMAX YMIN YMAX (MM) = ',4F10.4,/2X,'BOARD DIMENSIONS ', + 'ARE ',2F10.4) 6002 FORMAT (2X,'!!!GSEWND: CORRECTED BOUNDS = ',4F10.4) C END C C C SUBROUTINE GSEWSC(NSCAFL,NCNTFL) C ================================= C C---- Resets scaling and window clipping options for device C C A.D. McLachlan JUN 1984. Last updated 10 AUG 1984 C C MSCAFL = 0 use true scale C MSCAFL = 1 floating scale - largest uniform one to fit device C MCNTFL = 0 true origin (0,0)board=(0,0)device C MCNTFL = 1 floating origin - get as much as possible on device C C---- Deferred plotting option (mdirec=0) C C MSCAFL=1 clip with drawing board bounds C MSCAFL=0 clip with drawing board bounds and give C warning message if too big for device C C---- Direct plotting option (mdirec=1) C C MSCAFL=1 clip with drawing board bounds C MSCAFL=0 clip to common region of drawing board and device C warning if too small C C .. Scalar Arguments .. INTEGER NCNTFL,NSCAFL C .. C .. Scalars in Common .. REAL BXMAX,BXMIN,BYMAX,BYMIN,DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX, + DVYMIN,DWBLMX,DWBLMY,DWLIMX,DWLIMY,PAPLMX,PAPLMY,UBXMAX, + UBXMIN,UBYMAX,UBYMIN,V64LMX,V64LMY INTEGER ICOLOR,IDRLVL,IPRINT,IUNIT,IXMAX,IXMIN,IYMAX,IYMIN,LINWT, + LUNIN,LUNOUT,MCNTFL,MDEVIC,MDIREC,MIXCOL,MOUT,MPIC,MSCAFL, + NERROR,NPICS LOGICAL*4 DEVCON,INITON CHARACTER FILNAM*80,TITLE*80 C .. C .. Local Scalars .. REAL DVWIDX,DVWIDY,UBWIDX,UBWIDY,UBXX,UBYY C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSCLP/BXMIN,BXMAX,BYMIN,BYMAX COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE C C .. Save Statement .. C SAVE C MSCAFL = NSCAFL MCNTFL = NCNTFL IF ((MSCAFL.NE.0) .AND. (MSCAFL.NE.1)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6000) MSCAFL MSCAFL = 1 END IF IF ((MCNTFL.NE.0) .AND. (MCNTFL.NE.1)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6002) MCNTFL MCNTFL = 1 END IF C DVWIDX = DVXMAX - DVXMIN DVWIDY = DVYMAX - DVYMIN UBWIDX = UBXMAX - UBXMIN UBWIDY = UBYMAX - UBYMIN C C---- for fixed scale check and trim the window C IF (MSCAFL.EQ.0) THEN C C---- fixed scale options C IF (MCNTFL.EQ.0) THEN C C---- fixed scale fixed origin C IF (((DVXMIN.GT.UBXMIN).OR. (DVXMAX.LT.UBXMAX)) .OR. + ((DVYMIN.GT.UBYMIN).OR. (DVYMAX.LT.UBYMAX))) THEN IF (IPRINT.GE.2) WRITE (LUNOUT,FMT=6004) MSCAFL,MCNTFL, + UBXMIN,UBXMAX,DVXMIN,DVXMAX,UBYMIN,UBYMAX,DVYMIN,DVYMAX IF (UBXMAX.GT.DVXMAX) UBXMAX = DVXMAX IF (UBYMAX.GT.DVYMAX) UBYMAX = DVYMAX IF (UBXMIN.LT.DVXMIN) UBXMIN = DVXMIN IF (UBYMIN.LT.DVYMIN) UBYMIN = DVYMIN IF (IPRINT.GE.2) WRITE (LUNOUT,FMT=6006) UBXMIN,UBXMAX, + UBYMIN,UBYMAX END IF C C---- check for vanishing window less than 1.0 mm across C IF ((UBXMIN.GT. (UBXMAX-1.0)) .OR. + (UBYMIN.GT. (UBYMAX-1.0))) THEN call ccperr(1, 'plotlib: GSEWSC: NULL WINDOW ') END IF C C---- fixed scale floating origin C ELSE IF ((UBWIDX.GT.DVWIDX) .OR. (UBWIDY.GT.DVWIDY)) THEN IF (IPRINT.GE.2) WRITE (LUNOUT,FMT=6004) MSCAFL,MCNTFL, + UBXMIN,UBXMAX,DVXMIN,DVXMAX,UBYMIN,UBYMAX,DVYMIN,DVYMAX C C---- trim the window C IF (DVWIDX.LT.UBWIDX) UBXMAX = UBXMIN + DVWIDX IF (DVWIDY.LT.UBWIDY) UBYMAX = UBYMIN + DVWIDY IF (IPRINT.GE.2) WRITE (LUNOUT,FMT=6006) UBXMIN,UBXMAX, + UBYMIN,UBYMAX END IF ELSE C C---- for floating scale the window can be larger than the device C for floating scale window C IF (MCNTFL.EQ.0) THEN C C---- floating scale fixed origin: map (0...ubmax) onto (0...dvmax) C trim window at lower bounds if necessary C UBXX = (UBXMAX/DVXMAX)*DVXMIN UBYY = (UBYMAX/DVYMAX)*DVYMIN IF (((UBXMAX.GT.DVXMAX).OR. (UBYMAX.GT.DVYMAX)) .OR. + ((UBXMIN.LT.UBXX).OR. (UBYMIN.LT.UBYY))) THEN IF (IPRINT.GE.2) WRITE (LUNOUT,FMT=6004) MSCAFL,MCNTFL, + UBXMIN,UBXMAX,DVXMIN,DVXMAX,UBYMIN,UBYMAX,DVYMIN,DVYMAX IF (UBXMIN.LT.UBXX) UBXMIN = UBXX IF (UBYMIN.LT.UBYY) UBYMIN = UBYY IF (IPRINT.GE.2) WRITE (LUNOUT,FMT=6006) UBXMIN,UBXMAX, + UBYMIN,UBYMAX END IF C C---- floating scale and origin C warn if widths exceed device limits do not trim window C ELSE IF ((DVWIDX.LT.UBWIDX) .OR. (DVWIDY.LT.UBWIDY)) THEN IF (IPRINT.GE.2) WRITE (LUNOUT,FMT=6004) MSCAFL,MCNTFL, + UBXMIN,UBXMAX,DVXMIN,DVXMAX,UBYMIN,UBYMAX,DVYMIN,DVYMAX END IF END IF C C---- set clipping window to (edited) value of drawing board window C BXMIN = UBXMIN BXMAX = UBXMAX BYMIN = UBYMIN BYMAX = UBYMAX C C---- Format statements C 6000 FORMAT (2X,'!!!GSEWSC: MSCAFL NOT(0,1)=',I5,' RESET TO 1') 6002 FORMAT (2X,'!!!GSEWSC: MCNTFL NOT(0,1)=',I5,' RESET TO 1') 6004 FORMAT (2X,'!!!GSEWSC - WARN: ', + 'DEVICE AREA TOO SMALL FOR DRAWING', + ' WINDOW ',/2X,'MSCAFL MCNTFL = ',2I5,/2X,'XMIN XMAX DVXM', + 'IN DVXMAX = ',4F10.4,/2X,'YMIN YMAX DVYMIN DVYMAX = ', + 4F10.4) 6006 FORMAT (2X,'!!!GSEWSC - WARN: WINDOW TRIMMED TO FIT BOARD ', + /2X,'XMIN XMAX YMIN YMAX = ',4F10.4) C END C C C SUBROUTINE GSFRAM(FXWID,FYWID,XF0,YF0,SLANT) C ============================================= C C---- Draws a slanted rectangular frame C C A.D. McLachlan AUG 1984. Last updated 2 AUG 1984 C C .. Scalar Arguments .. REAL FXWID,FYWID,SLANT,XF0,YF0 C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Arrays .. REAL P(2),Q(2),R(2),S(2) C .. C .. External Subroutines .. EXTERNAL GSLINE C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C P(1) = XF0 - FXWID - FYWID*SLANT P(2) = YF0 - FYWID Q(1) = XF0 + FXWID - FYWID*SLANT Q(2) = YF0 - FYWID R(1) = XF0 + FXWID + FYWID*SLANT R(2) = YF0 + FYWID S(1) = XF0 - FXWID + FYWID*SLANT S(2) = YF0 + FYWID CALL GSLINE(P,Q) CALL GSLINE(Q,R) CALL GSLINE(R,S) CALL GSLINE(S,P) C END C C C SUBROUTINE GSGCH0(LETTER,XCOFF,YCOFF,SIZX,SIZY) C ================================================ C C---- this routine draws both "letters" and "symbols" in font 0 C C---- A.D. McLachlan JUN 1984. ADAPTED FROM D.A. AGARD PLOT82. C Last updated 27th March 1990 PJD C C LETTER = ascii number. C XCOFF,YCOFF = position offsets of baseline left corner C from character cursor (xcstrt,ycstrt), C in character units C are xcoff*sizx,ycoff*sizy. C SIZX,SIZY = symbol width and height in character units. C C---- Standard ascii text assignments (characters numbered 0...127) C written in columns of 16 characters C C 0 16 32 48 64 80 96 112 C C 0 NUL DLE 32SPA 48 0 64 @ 80 P 96 112 p C 1 SOH DC1 33 ! 49 1 65 A 81 Q 97 a 113 q C 2 STX DC2 34 " 50 2 66 B 82 R 98 b 114 r C 3 ETX DC3 35 # 51 3 67 C 83 S 99 c 115 s C 4 EOT DC4 36 $ 52 4 68 D 84 T 100 d 116 t C 5 ENQ NAK 37 % 53 5 69 E 85 U 101 e 117 u C 6 ACK SYN 38 & 54 6 70 F 86 V 102 f 118 v C 7 BEL ETB 39 ' 55 7 71 G 87 W 103 g 119 w C 8 BS CAN 40 ( 56 8 72 H 88 X 104 h 120 x C 9 HT EM 41 ) 57 9 73 I 89 Y 105 i 121 y C 10 LF SUB 42 * 58 : 74 J 90 Z 106 j 122 z C 11 VT ESC 43 + 59 ; 75 K 91 [ 107 k 123 { C 12 FF FS 44 , 60 < 76 L 92 \ 108 l 124 | C 13 CR GS 45 - 61 = 77 M 93 ] 109 m 125 } C 14 SO RS 46 . 62 > 78 N 94 ^ 110 n 126 ~ C 15 SI US 47 / 63 ? 79 O 95 _ 111 o 127 DEL C C NUL Null DLE Data link escape C SOH Start of heading DC1 Device control 1 C STX Start of text DC2 Device control 2 C ETX End of text DC3 Device control 3 C EOT End of transmission DC4 Device control 4 C ENQ Enquiry NAK Negative acknowledge C ACK Acknowledge SYN Synchronous idle C BEL Bell ETB End transmission block C BS Backspace CAN Cancel C HT Horizontal tabulation EM End of medium C LF Line feed SUB Substitute C VT Vertical tab ESC Escape C FF Form feed FS File separator C CR Carriage return GS Group separator C SO Shift out RS Record separator C SI Shift in US Unit separator C SP Space DEL Delete C C--- each letter character is defined on a square grid (0-7) C character height is 1.0 character units =7.0 grid units C character width is 1.0 character units =7.0 grid units C the drawn strokes of each letter lie between (0-4) in ix C for text centred in grid we shift by 1.5 units to right C C---- icentc switch is ignored. letters start at bottom left init location C C .. Parameters .. REAL FACT7,FACT4 PARAMETER (FACT7=1.0/7.0,FACT4=1.0/4.0) C .. C .. Scalar Arguments .. REAL SIZX,SIZY,XCOFF,YCOFF INTEGER ISYMB INTEGER*4 LETTER C .. C .. Scalars in Common .. REAL ANGFAC,CHANGX,CHANGY,CHRSCX,CHRSCY,CHRSPX,CHRSPY,SCALEX, + SCALEY,USANGX,USANGY,XCHAR,XCSTRT,YCHAR,YCSTRT INTEGER KPRINT,LUNIN,LUNOUT INTEGER*4 ICENTC,IFONT LOGICAL*4 FONTIN,ICULNK,LINMOD,UCSPAC C .. C .. Arrays in Common .. REAL CHRMAT,CUMAT,USRMAT C .. C .. Local Scalars .. REAL ADX,ADY,AXOFF,CHORGX,CHORGY,CUORGX,CUORGY,FACTX,FACTY,XNEW, + XOLD,XORIG,XSPACE,XSTART,YNEW,YOLD,YORIG,YSPACE,YSTART INTEGER IDX,IDY,IPX,ISN,ITABLE,IW,KLETTR,MK1,NENTRY LOGICAL ENDCHR,ENDVST,OLDVEC C .. C .. Local Arrays .. INTEGER*2 IPC(463),IPT(127),NCTRAN(24),NSTRAN(24) C .. C .. External Subroutines .. EXTERNAL GSDWTO,GSMVTO C .. C .. Intrinsic Functions .. INTRINSIC REAL C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSCHX/CHRMAT(3,3),CHRSCX,CHRSCY,CHANGX,CHANGY,CHRSPX, + CHRSPY,ICENTC,UCSPAC,IFONT,FONTIN,XCHAR,YCHAR,XCSTRT, + YCSTRT,ANGFAC COMMON /GSUTR/USRMAT(3,3),SCALEX,SCALEY,USANGX,USANGY, + CUMAT(3,3),LINMOD,ICULNK,KPRINT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (XORIG,USRMAT(1,3)), (YORIG,USRMAT(2,3)) EQUIVALENCE (CUORGX,CUMAT(1,3)), (CUORGY,CUMAT(2,3)) EQUIVALENCE (NSTRAN(1),USRMAT(1,1)) EQUIVALENCE (CHORGX,CHRMAT(1,3)), (CHORGY,CHRMAT(2,3)) EQUIVALENCE (NCTRAN(1),CHRMAT(1,1)) C .. C .. Data statements .. DATA MK1/15/ C DATA (IPT(I),I=1,127)/ + 232,236,242,247,252,255,259,263,267,272,276,279,292,298,302, + 307, 46,309,310,312,315,318,321,324,326,329,332,334,336, 2, + 17, 59, * 24, 89, 73, 28, 53, 18, 85, 12, 38, 34, 14, 50, 48, 7, 1 49,184,189,192,196,203,205,210,216,218,226, 68, 40, 10, 87, 2 60, 62, 77, 93, 97,103,107,111,115,118,123,126,129,132,135, 3 137,140,142,147,151,156,161,167,169,172,174,177,179,182,281, 4 283,284,286,289,342,344,350,356,355,360,365,369,375,379,384, 5 389,392,395,396,400,405,410,416,419,424,428,432,435,440,444, 6 449,451,455,457,461, 1/ C C---- Character vector strings C DATA (IPC(I),I=1,100)/ 1 8, 8230, 12577, 529, 5380, 61, 8208, 4385, 2 24, 1094, 74, 4384, 12054, 17412, 8740, 46, 3 10279, 1344, 5894, 13863, 821, 4097, 18992, 8208, 4 4385, 5008, 31, 12545, 17218, 5172, 5637, 9798, 5 12064,-14845,-23005,-31165, 19460, 12576, 12086, 8464, 6 4642,-24302, 8979, 5156, 27, 17412, 75, 19460, 7 20224, 8464, 4642, 10513, 5895, 1558, 18311, 16512, 8 12609, 18480, 18432, 17410, 14, 5894, 17975, 9029, 9 8354, 12592, 10273, 8722, 4899, 5266, 9508, 7189, * -27630,-23518,-15869, 19203, 4144, 1537, 14103, 16966, 1 8497, 5138, 13605, 76, 13879, 16199,-15869, 19717, 2 5655,-26840, 13879, 16199, 1536, 14103, 16454, 2883, 3 13316, 17989, 1847, 12288/ C DATA (IPC(I),I=101,200)/ 1 17217, 60, 12353, 272, 5894, 20023, 1792, 17975, 2 12353, 8, 64, 13316, 1796, 79, 1863, 13316, 3 2052, 17203, 12353, 272, 5894, 20023, 1792, 17412, 4 18503, 12304, 10016, 7991, 4097, 16688, 79,-30975, 5 839, 18452, 7, 72, 1792, 18212, 72, 1792, 6 20288, 272, 5894, 17975, 12353, 24, 1792, 17975, 7 13381, 12, 16418, 14150, 1559, 4097, 18736, 1792, 8 17975, 13381, 13316, 72, 4097, 16688, 13379, 1300, 9 5894, 20023, 18183, 10279, 263, 12304, 20289, 8199, * 79, 7,1 6419, 79,-16376, 20224, 9223, 18336, 1 44, 18183, 18432, 71, 5894, 17975, 12353, 2320, 2 10006, 4128, 56, 5894, 17975, 325, 18432, 5894, 3 17975, 13381, 13332, 16707/ C DATA (IPC(I),I=201,300)/ 1 4144, 9, 321, 14391, 4097, 16688, 13379, 1796, 2 79, 5123, 17204, 12353, 272, 5894, 20023, 1798, 3 6215, 1300, 5894, 17975, 13381, 788, 4097, 16688, 4 15427, 4097, 16688, 14150, 1559, 4868, 19507, 9250, 5 4, 17472, 10788, 9250, 788, 4097, 16688, 13379, 6 10788, 9250, 546, 8226, 16930, 42, 34, 1058, 7 17442, 16418, 42, 9250, 16384, 10788, 9250, 8194, 8 9282, 42, 16930, 548, 9250, 10784, 17442, 16388, 9 34, 42, 17442, 17412, 34, 64, 42, 17442, * 1058, 8226, 42, 17442, 16388, 10752, 9250, 10784, 1 32, 12039, 18439, 8192, 3879, 10006,-27081, 10279, 2 835, 5138, 11, 12561, 4915,-32750,-16334,-15308, 3 3091,-15359,-15869,-16379/ C DATA (IPC(I),I=301,400)/ 1 11296, 17408, 16388,-31743, 19520, 11296, 4352, 12054, 2 18946, 9216, 72,-16383,-15869, 19460, 16898, 12595, 3 74,-16126, 15612, 6196,-19692,-24027, 14609, 8196, 4 76, 4609, 10016, 79, 8231, 578, 40, 9216, 5 2112,-15359, 18436, 8208, 4385, 5008, 9251,-27883, 6 14850, 9751, 7975, 4674, 1,-16079, 17216, 5172, 7 11,-32760, 4097, 16688, 13379, 2836,-16312, 12353, 8 272, 5123, 19252, 12802, 13379, 788, 4097, 18736, 9 14150, 5671, 1168, 60, 12288, 17729, 5686, 773, * 12818, 75,-30975, 5123, 17204, 72,-20463, 8992, 1 9363, 5413, 11284, 4097, 12576, 14005, 10039, 15910, 2 -30975,-16381, 19458,-20463, 10016, 31,-23519,-31743, 3 5123, 17204, 72, 12304/ C DATA (IPC(I),I=401,463)/ 1 17217, 5172, 259, 24,-31231, 4611, 17202, 13893, 2 3350, 16465, 17862, 5686, 773, 12818, 75,-31743, 3 5123, 19252, 4097, 16688, 4658, 5123, 19252,-19451, 4 4374, 12320, 73, 260, 12304, 16577, 76, 516, 5 16928, 76, 260, 8464, 16688, 8644, 44, 4096, 6 -15307, 5124, 18480, 12288,-14782, 774, 12818, 75, 7 64, 3140, 8496, 4898, 9508, 62,-23775, 12068, 8 8464, 13090, 9508, 30, 5123, 19507, 0/ C NENTRY = 1 FACTX = FACT7*SIZX FACTY = FACT7*SIZY AXOFF = 1.5 KLETTR = LETTER GO TO 10 C ENTRY GSGSY0(ISYMB,XCOFF,YCOFF,SIZX,SIZY) C ========================================= C C---- "SYMBOL" plotting C C---- This section plots one symbol centred on bottom left corner C each symbol is defined on a square grid (0,1,2,3,4) with C character height as 4 of these units C NENTRY = 2 FACTX = FACT4*SIZX FACTY = FACT4*SIZY AXOFF = 0.0 C C---- set pointer into table C KLETTR = ISYMB IF (KLETTR.LT.1) KLETTR = 1 C 10 CONTINUE ITABLE = IPT(KLETTR) LINMOD = .FALSE. XSPACE = (CHRSPX+1.0)*SIZX YSPACE = CHRSPY*SIZY C C---- if a symbol then jump into generator loop C IF (NENTRY.NE.2) THEN C C---- if letter = 0 then it is a null char and is ignored C recognises ascii 32 to 126 i.e. the full set C IF (KLETTR.EQ.0) THEN GO TO 50 END IF END IF C C---- draw characters as chains of vectors C each byte of the table contains two hexadecimal digits (0...15) C which define idx,idy as mod(idigit,8), using the hex '8' bit for C marking end of char or end of vector chain C C---- set markers for a new letter C XSTART = XCOFF*SIZX + XCSTRT YSTART = YCOFF*SIZY + YCSTRT C OLDVEC = .FALSE. ENDVST = .FALSE. ENDCHR = .FALSE. 20 CONTINUE C C---- use one table entry C IW = IPC(ITABLE) C C---- set offset value if iw is negative. C ISN = 0 IF (IW.LT.0) ISN = -1 C C---- two vector end points per integer*2 table entry C DO 30 IPX = 1,2 C C---- get y displacement on grid C iw contains 2 vector end points; 1 per 4 bits. C CCC IDY = IW .AND. MK1 IDY = IAND(IW,MK1) IDY = IDY + ISN IW = IW/16 C C---- get x displacement on grid C CCC IDX = IW .AND. MK1 IDX = IAND(IW,MK1) IDX = IDX + ISN IW = IW/16 C C---- if hex'08' bit on, end of character C IF (IDY.GE.8) THEN IDY = IDY - 8 ENDCHR = .TRUE. END IF C C---- if hex'08' bit on, end of vector string, but not character C IF (IDX.GE.8) THEN IDX = IDX - 8 ENDVST = .TRUE. END IF C C---- calculate vector end point and apply scale C ADX = (REAL(IDX)+AXOFF)*FACTX ADY = REAL(IDY)*FACTY XNEW = XSTART + ADX YNEW = YSTART + ADY C C---- plot vector C IF (.NOT.OLDVEC) THEN C C--- first time, start new vector C OLDVEC = .TRUE. ELSE IF ((XOLD.NE.XNEW) .OR. (YOLD.NE.YNEW)) THEN CALL GSMVTO(XOLD,YOLD) CALL GSDWTO(XNEW,YNEW) END IF C C---- test for end of char C IF (ENDCHR) THEN GO TO 40 ELSE C C---- test for end of vector chain C IF (ENDVST) THEN OLDVEC = .FALSE. ENDVST = .FALSE. END IF XOLD = XNEW YOLD = YNEW END IF 30 CONTINUE C C---- end of half-integer loop C ITABLE = ITABLE + 1 C C---- next packed word C GO TO 20 C C---- move cursor to start point of next letter or symbol C 40 CONTINUE XCSTRT = XCSTRT + XSPACE YCSTRT = YCSTRT + YSPACE 50 LINMOD = .TRUE. C END C C C SUBROUTINE GSGCHC(CHAR1,XCOFF,YCOFF,KFONT) C =========================================== C C---- Draws a character from the fonts(0,1-4) C C A.D.McLachlan JUN 1984. Last updated 27 JUL 84 C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were NCHAR, NFONTS C C CHAR1 = ascii character variable C XCOFF,YCOFF = offset of left baseline corner of character C from character cursor is (xcoff,ycoff) C character units C C width and height scale of symbol is 1.0 character units C after the call the character cursor is moved by C (cwid+chrspx),(chrspy) character units, where cwid=1.0 for C uniform spacing and is 0.0-1.0 for non-uniform spacing C C KFONT = 0 for full ASCII character set C KFONT = 1 for block letters (default) C KFONT = 2 for bold-face italics C KFONT = 3 for script C KFONT = 4 for greek C C .. Scalar Arguments .. REAL SIZ1,SIZ2,XCOFF,YCOFF INTEGER KFONT,NLETT CHARACTER*1 NCHAR CHARACTER CHAR1*1 C .. C .. Scalars in Common .. REAL ANGFAC,CHANGX,CHANGY,CHRSCX,CHRSCY,CHRSPX,CHRSPY,SCALEX, + SCALEY,USANGX,USANGY,XCHAR,XCSTRT,YCHAR,YCSTRT INTEGER ICENTC,IFONT,KPRINT,LUNIN,LUNOUT LOGICAL*4 FONTIN,ICULNK,LINMOD,UCSPAC C .. C .. Arrays in Common .. REAL CHRMAT,CUMAT,USRMAT INTEGER*2 IFHT,IFSTRT,IFWID,IFX0,IFY0,LENGF INTEGER*1 NFONTS C .. C .. Local Scalars .. REAL CHORGX,CHORGY,CUORGX,CUORGY,SIZX,SIZY,XORIG,YORIG INTEGER LETTER C .. C .. Local Arrays .. INTEGER NCTRAN(24),NSTRAN(24) C .. C .. External Subroutines .. EXTERNAL GSGCH0,GSGCHF C .. C .. Intrinsic Functions .. INTRINSIC ICHAR C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSCHX/CHRMAT(3,3),CHRSCX,CHRSCY,CHANGX,CHANGY,CHRSPX, + CHRSPY,ICENTC,UCSPAC,IFONT,FONTIN,XCHAR,YCHAR,XCSTRT, + YCSTRT,ANGFAC COMMON /GSFNT/IFSTRT(150,4),LENGF(150,4),IFX0(150,4), + IFY0(150,4),IFWID(150,4),IFHT(150,4),NFONTS(4,3000,4) COMMON /GSUTR/USRMAT(3,3),SCALEX,SCALEY,USANGX,USANGY, + CUMAT(3,3),LINMOD,ICULNK,KPRINT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (XORIG,USRMAT(1,3)), (YORIG,USRMAT(2,3)) EQUIVALENCE (CUORGX,CUMAT(1,3)), (CUORGY,CUMAT(2,3)) EQUIVALENCE (NSTRAN(1),USRMAT(1,1)) EQUIVALENCE (CHORGX,CHRMAT(1,3)), (CHORGY,CHRMAT(2,3)) EQUIVALENCE (NCTRAN(1),CHRMAT(1,1)) C SIZX = 1.0 SIZY = 1.0 LETTER = ICHAR(CHAR1) GO TO 10 C ENTRY GSGCHS(CHAR1,XCOFF,YCOFF,SIZ1,SIZ2,KFONT) C ================================================ C LETTER = ICHAR(CHAR1) SIZX = SIZ1 SIZY = SIZ2 GO TO 10 C ENTRY GSGCHI(NLETT,XCOFF,YCOFF,KFONT) C ====================================== C SIZX = 1.0 SIZY = 1.0 LETTER = NLETT GO TO 10 C ENTRY GSGCHH(NCHAR,XCOFF,YCOFF,KFONT) C ====================================== C SIZX = 1.0 SIZY = 1.0 LETTER = ICHAR(NCHAR) C C---- check font C 10 IF (KFONT.EQ.0) THEN CALL GSGCH0(LETTER,XCOFF,YCOFF,SIZX,SIZY) ELSE CALL GSGCHF(LETTER,XCOFF,YCOFF,SIZX,SIZY,KFONT) END IF C END C C C SUBROUTINE GSGCHF(LETTER,XCOFF,YCOFF,SIZX,SIZY,KFONT) C ========================================== C C---- Draws a character from the fonts(1-4) by number C C A.D.McLachlan JUN 1984. Last updated 27 JUL 84 C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were NFONTS C C HERSHEY FONTS FROM NATIONAL BUREAU OF STANDARDS Via A.M. Lesk C Modified by D.A. Agard to be a part of VAX PLOT81 package C LETTER = ascii number of symbol (or some special number) C XCOFF,YCOFF = offset of left baseline corner of character C from character cursor is (xcoff*sizx,ycoff*sizy) C character units C SIZX,SIZY = width and height scale of symbol in character C character units C C KFONT = 1 for block letters (default) C KFONT = 2 for bold-face italics C KFONT = 3 for script C KFONT = 4 for greek C C .. Scalar Arguments .. REAL SIZX,SIZY,XCOFF,YCOFF INTEGER KFONT,LETTER C .. C .. Scalars in Common .. REAL ANGFAC,CHANGX,CHANGY,CHRSCX,CHRSCY,CHRSPX,CHRSPY,SCALEX, + SCALEY,USANGX,USANGY,XCHAR,XCSTRT,YCHAR,YCSTRT INTEGER ICENTC,IFONT,KPRINT,LUNIN,LUNOUT LOGICAL*4 FONTIN,ICULNK,LINMOD,UCSPAC C .. C .. Arrays in Common .. REAL CHRMAT,CUMAT,USRMAT INTEGER*2 IFHT,IFSTRT,IFWID,IFX0,IFY0,LENGF INTEGER*1 NFONTS C .. C .. Local Scalars .. REAL AH,AW,CHFACX,CHFACY,CHORGX,CHORGY,CHSIZH,CHSIZW,CSHIFT, + CUORGX,CUORGY,FACT21,XORIG,XSHIFT,XSTART,XWOFF,XX1,XX2,YORIG, + YSHIFT,YSTART,YY1,YY2 INTEGER IFNT,ISTART,IXG,IYG,J,J1,J2,KLETTR,NSEG C .. C .. Local Arrays .. INTEGER NCTRAN(24),NSTRAN(24) C .. C .. External Subroutines .. EXTERNAL GSDWTO,GSMVTO C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSCHX/CHRMAT(3,3),CHRSCX,CHRSCY,CHANGX,CHANGY,CHRSPX, + CHRSPY,ICENTC,UCSPAC,IFONT,FONTIN,XCHAR,YCHAR,XCSTRT, + YCSTRT,ANGFAC COMMON /GSFNT/IFSTRT(150,4),LENGF(150,4),IFX0(150,4), + IFY0(150,4),IFWID(150,4),IFHT(150,4),NFONTS(4,3000,4) COMMON /GSUTR/USRMAT(3,3),SCALEX,SCALEY,USANGX,USANGY, + CUMAT(3,3),LINMOD,ICULNK,KPRINT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (XORIG,USRMAT(1,3)), (YORIG,USRMAT(2,3)) EQUIVALENCE (CUORGX,CUMAT(1,3)), (CUORGY,CUMAT(2,3)) EQUIVALENCE (NSTRAN(1),USRMAT(1,1)) EQUIVALENCE (CHORGX,CHRMAT(1,3)), (CHORGY,CHRMAT(2,3)) EQUIVALENCE (NCTRAN(1),CHRMAT(1,1)) C .. C .. Data statements .. C DATA FACT21/0.0476190/ C C---- each character is defined on an integer grid with 21 units for the C character height and various widths the scaled character is 1.0 C character units high (charh*21 grid units) the width is a multiple C of 1.0/21.0 character units. in font 1: C for capital letters the lowest point is at iy=-8 and top at iy=+13 C for lower-case letters the top is normally at iy=+6 with descenders C down to iy= -15 the [ ] | go from -15 to +17 the letter baseline is C therefore at -8. relative to this baseline letters rise to +21 C special chars to +25, lower case to +14, descents to -7 C widths are 20 for numbers (0-9),25 letter "m",27 for "@" is widest. C for each font the grid values lie in the range C IX=(IFX0+1)...(IFWID-1) C IY=(IFY0+1)...(IFHT+1) C in this drawing routine any big letters are shrunk to fit in a C "standard character box" (1.5) character units high and (1.0) C units wide,with the baseline (0.5) units above the bottom of the box. C positioning of characters is referred to the left end of the baseline C (icentc=0) or the centre of the upper box(icentc=1) 0.5 units C above the baseline. C LINMOD = .FALSE. IFNT = KFONT IF (IFNT.LT.1 .OR. IFNT.GT.4) IFNT = 1 C C---- set up sizes and starting point C CHSIZH = FACT21*SIZY CHSIZW = FACT21*SIZX XSTART = XCOFF*SIZX + XCSTRT YSTART = YCOFF*SIZY + YCSTRT C KLETTR = LETTER - 31 IF ((KLETTR.LT.1) .OR. (KLETTR.GT.146)) KLETTR = 1 C C---- size constants from table: height and width on (0...21) grid C AH = IFHT(KLETTR,IFNT) + 9 AW = IFWID(KLETTR,IFNT) C C---- max width will never exceed 21.0 units C XWOFF = 0.0 IF (AW.GT.21.0) THEN CHFACX = (21.0/AW)*CHSIZW ELSE CHFACX = CHSIZW C C---- for uniform spacing C IF (UCSPAC) XWOFF = 0.5* (21.0-AW) END IF C C---- max height will not exceed 21.0 units C IF (AH.LE.21.0) THEN CHFACY = CHSIZH ELSE CHFACY = (21.0/AH)*CHSIZH END IF C ISTART = IFSTRT(KLETTR,IFNT) NSEG = LENGF(KLETTR,IFNT) IF (NSEG.NE.0) THEN C C---- grid origin on letter baseline C IXG = IFX0(KLETTR,IFNT) IYG = IFY0(KLETTR,IFNT) + 8 C C---- build letter out of elementary vectors C J1 = ISTART J2 = ISTART + NSEG - 1 DO 10 J = J1,J2 XX1 = NFONTS(1,J,IFNT) + IXG YY1 = NFONTS(2,J,IFNT) + IYG XX2 = NFONTS(3,J,IFNT) + IXG YY2 = NFONTS(4,J,IFNT) + IYG C C---- scale C XX1 = (XX1+XWOFF)*CHFACX YY1 = YY1*CHFACY XX2 = (XX2+XWOFF)*CHFACX YY2 = YY2*CHFACY C C---- place on page C XX1 = XSTART + XX1 YY1 = YSTART + YY1 XX2 = XSTART + XX2 YY2 = YSTART + YY2 C C---- draw line vector C CALL GSMVTO(XX1,YY1) CALL GSDWTO(XX2,YY2) 10 CONTINUE END IF C C---- position of next character up to 21.0 grid units to right C IF (UCSPAC) THEN CSHIFT = 21.0*CHSIZW ELSE CSHIFT = AW*CHFACX C C---- default cshift as (6.0/7.0) * grid size of 21 C IF (CSHIFT.EQ.0.0) CSHIFT = 18.0*CHSIZW END IF XSHIFT = CHRSPX*SIZX + CSHIFT YSHIFT = CHRSPY*SIZY C C---- end of letter loop set position for next character operation C XCSTRT = XCSTRT + XSHIFT YCSTRT = YCSTRT + YSHIFT C LINMOD = .TRUE. C END C C C SUBROUTINE GSGSYM(NSYMB,NSET) C ============================== C C C---- Generates a symbol number (nsymb) from set (nset) C C A.D. McLachlan JUL 1984. Last updated JUL 27 1984 C C---- Three entries here: C C (1) GSGSYM draws centred symbol of standard size C and leaves character cursor unmoved C (2) GSGSYS draws centred symbol of chosen size and offset C and leaves character cursor unmoved C (3) GSGSYC treats symbol as a special form of letter C and centres it as for letters,at bottom left, C moving the character cursor C C XCOFF,YCOFF = offsets of symbol centre oor letter corner from C the character cursor are (xcoff*sizx,ycoff*sizy) C SIZX,SIZY = scale for size in character units C C---- After drawing the symbol the character cursor moves by the C normal letter spacing C C NSET=1,2 only available now !!! C 32 symbols in set 1 from font 0 tables C 46 symbols in set 2 from font 1 tables (characters 129-174) C C List of symbols in set 1 and set 2 C SET 1--- SET 2--- C A 1. square + line to centre A 1. left < bracket C B 2. octagon + line to cent B 2. right > bracket C C 3. plus sign C 3. double bar || C D 4. x cross D 4. +or- C E 5. triang + line to centre E 5. multiply x C F 6. diamond + line to cent F 6. decimal . C G 7. + with top arrow G 7. divide by C H 8. x with top link H 8. not= C I 9. z I 9. identically= C J 10. y j 10. or= C L 12. vertical bar L 12. varies as C M 13. square with ears M 13. accent / C N 14. union jack star N 14. accent \ C O 15. crossed square O 15. accent u C P 16. pentagram star P 16. quote 9 C Q 17. logical not --| Q 17. quote 6 C R 18. horiz bar -- R 18. quote back 9 C S 19. cap lambda S 19. quote back 6 C T 20. ident = triple BAR T 20. square root C U 21. right arrow U 21. boolean [ C V 22. low -- V 22. boolean u C W 23. +or- W 23. boolean ] C X 24. v X 24. boolean ^ C Y 25. square root Y 25. boolean epsilon C Z 26. down arrow Z 26. right arrow C 1 27. triangle delta 1 27. up arrow C 2 28. multiply x 2 28. left arrow C 3 29. divide by 3 29. down arrow C 4 30. us "cent" 4 30. partial deriv d C 5 31. vertical high bar 5 31. grad d C 6 32. underline 6 32. square root C 7 7 33. integral C 8 8 34. circuit integral 0/ C 9 9 35. infinity C a a 36. double ss sign C b b 37. dagger sign C c c 38. double dagger C d d 39. backward "e" C e e 40. aleph "n" C f f 41. ff ligature C g g 42. fi ligature C h h 43. fl ligature C i i 44. ffi ligature C j j 45. ffl ligature C k k 46. small "1" (footnote) C C C Symbols suitable for marking points on graphs are: C SET 1 :- 1 2 3 4 5 6 11 13 14 15 27 28=4 C alias A B C D E F K M N O 1 2=D C SET 2 :- 5 6 31 C alias E F 5 C C Option to get symbols through an ascii character code C NSYMB(1-26) = LETTERS (A-Z) C NSYMB(27-35) = DIGITS(1-9) C NSYMB(36-61) = LETTERS (a-z) C C---- Standard centred symbol C C .. Scalar Arguments .. REAL SIZX,SIZY,XCOFF,YCOFF INTEGER NSET,NSYMB CHARACTER CHAR1*1 C .. Scalars in Common .. REAL SCALEX,SCALEY,USANGX,USANGY INTEGER KPRINT,LUNIN,LUNOUT LOGICAL*4 ICULNK,LINMOD C .. C .. Arrays in Common .. REAL CUMAT,USRMAT C .. C .. Local Scalars .. REAL SZX,SZY,XCF,XCUR,YCF,YCUR INTEGER ISYMB,KFONT,LETTER,NCHAR,NENTRY C .. C .. External Subroutines .. EXTERNAL GSFCUR,GSGCHF,GSGSY0,GSPCUR C .. C .. Intrinsic Functions .. INTRINSIC ICHAR C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSUTR/USRMAT(3,3),SCALEX,SCALEY,USANGX,USANGY, + CUMAT(3,3),LINMOD,ICULNK,KPRINT C C .. Save Statement .. C SAVE C NENTRY = 1 ISYMB = NSYMB XCF = 0.0 YCF = 0.0 SZX = 1.0 SZY = 1.0 GO TO 20 C ENTRY GSGSYS(NSYMB,NSET,XCOFF,YCOFF,SIZX,SIZY) C ============================================== C C---- Centred symbol of chosen with chosen offset C NENTRY = 1 ISYMB = NSYMB GO TO 10 C ENTRY GSGSYC(CHAR1,NSET,XCOFF,YCOFF,SIZX,SIZY) C =============================================== C C---- Interpret character char1 as a special type of letter symbol C variable size and offset C NENTRY = 2 NCHAR = ICHAR(CHAR1) IF ((NCHAR.GE.49) .AND. (NCHAR.LE.57)) THEN C C---- Digits 1-9 ascii 49-57 aliased to symbols 27-35 C ISYMB = NCHAR - 22 ELSE IF ((NCHAR.GE.65) .AND. (NCHAR.LE.90)) THEN C C---- Letters a-z ascii 65-90 aliased to symbols 1-26 C ISYMB = NCHAR - 64 ELSE IF ((NCHAR.GE.97) .AND. (NCHAR.LE.107)) THEN C C---- letters A-K ascii 97-107 as symbols 36-46 C ISYMB = NCHAR - 61 ELSE ISYMB = NCHAR END IF C 10 CONTINUE XCF = XCOFF YCF = YCOFF SZX = SIZX SZY = SIZY C C---- Check for legal input C 20 IF ((NSET.LT.1) .OR. (NSET.GT.2)) THEN IF (KPRINT.GE.1) WRITE (LUNOUT,FMT=6000) NSET NSET = 2 END IF LETTER = ISYMB IF (NSET.EQ.2) LETTER = ISYMB + 128 C C---- All "symbols" are drawn centred in the middle C and cursor must not move,so save its position C all "special letters" are centred at bottom left C IF (NENTRY.EQ.1) THEN XCF = XCF - 0.5 YCF = YCF - 0.5 CALL GSFCUR(XCUR,YCUR) END IF C C---- Draw the character C GO TO (30,40) NSET 30 CALL GSGSY0 (LETTER,XCF,YCF,SZX,SZY) GO TO 50 40 KFONT = 1 CALL GSGCHF(LETTER,XCF,YCF,SZX,SZY,KFONT) C C---- For "symbols" restore character cursor C 50 IF (NENTRY.EQ.1) CALL GSPCUR(XCUR,YCUR) C C---- Format statements C 6000 FORMAT (2X,'!!!GSGSYM ERROR: NSET=',I5, + ' NOT 1 OR 2 - RESET AS ','2 ') C END C C C SUBROUTINE GSHAIR(X,Y,CHKEY) C ============================= C C---- Cross-hair control C C A.D. McLachlan SEP 1984. Last updated 19 SEP 1984 C C---- Place vt640 cross-hairs in user space, move them C with the four cursor keys ^ V < > , and read position C in user space when any character key is pressed C C---- NOTE: The vt640 manual says that the cross-hair only C responds to punctuation keys, but it appears to C respond to any character key, upper- or lower-case C after the key is pressed the cross hair vanishes. C the terminal cannot be used for typing or graphics C till the hair is off C C Terminal allows range ix=(0:1023) and iy=(0:779) C sometimes the position reported differs from the C position set by 1 unit C C .. Scalar Arguments .. REAL X,Y CHARACTER CHKEY*1 C .. C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWBLMX,DWBLMY, + DWLIMX,DWLIMY,PAPLMX,PAPLMY,SCALEX,SCALEY,UBXMAX, + UBXMIN,UBYMAX,UBYMIN,USANGX,USANGY,V64LMX,V64LMY INTEGER ICOLOR,IDRLVL,IPRINT,IUNIT,IXMAX,IXMIN, + IYMAX,IYMIN,KPRINT,LINWT,LUNIN,LUNOUT,MCNTFL, + MDEVIC,MDIREC,MIXCOL,MOUT,MPIC,MSCAFL,NERROR,NPICS LOGICAL*4 DEVCON,ICULNK,INITON,LINMOD CHARACTER FILNAM*80,TITLE*80 C .. C .. Arrays in Common .. REAL CUMAT,USRMAT C .. C .. Local Scalars .. REAL AV,BV,CUORGX,CUORGY,CV,DETU,DV,XB,XF,XORIG,YB,YF,YORIG INTEGER IX,IXHIGH,IXLOW,IY,IYHIGH,IYLOW INTEGER NCODE LOGICAL INSIDE C .. C .. Local Arrays .. INTEGER NSTRAN(24) C .. C .. External Subroutines .. EXTERNAL GSCLPT,GSHRTM,GSTYTM C .. C .. Intrinsic Functions .. INTRINSIC NINT C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT REAL FACX, FACY, XFOFF, YFOFF INTEGER IDXOFF, IDYOFF, IXOLD, IYOLD, MODOLD COMMON /GSDVT/FACX,FACY,XFOFF,YFOFF,IDXOFF,IDYOFF, + IXOLD,IYOLD,MODOLD COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE COMMON /GSUTR/USRMAT(3,3),SCALEX,SCALEY,USANGX,USANGY, + CUMAT(3,3),LINMOD,ICULNK,KPRINT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (XORIG,USRMAT(1,3)), (YORIG,USRMAT(2,3)) EQUIVALENCE (CUORGX,CUMAT(1,3)), (CUORGY,CUMAT(2,3)) EQUIVALENCE (NSTRAN(1),USRMAT(1,1)) C .. C .. Data statements .. DATA IXLOW/96/,IXHIGH/975/,IYLOW/13/,IYHIGH/768/ C C---- Check device C IF ((MDIREC.NE.0) .AND. (MDEVIC.EQ.3)) THEN C C---- Convert coords to drawing board and then to device grid C XB = USRMAT(1,1)*X + USRMAT(1,2)*Y + XORIG YB = USRMAT(2,1)*X + USRMAT(2,2)*Y + YORIG C C---- Check whether inside window C CALL GSCLPT(XB,YB,NCODE,INSIDE) IF (INSIDE) THEN IX = NINT(XB*FACX+XFOFF) + IDXOFF IY = NINT(YB*FACY+YFOFF) + IDYOFF ELSE IX = IDXOFF + 1 IY = IDYOFF + 1 END IF C C---- Check whether inside device viewport for plot84 C IF (IX.LT.IXLOW) IX = IXLOW IF (IX.GT.IXHIGH) IX = IXHIGH IF (IY.LT.IYLOW) IY = IYLOW IF (IY.GT.IYHIGH) IY = IYHIGH C C---- For printing reset terminal to teletype mode C IF (IPRINT.GE.2) THEN CALL GSTYTM WRITE (LUNOUT,FMT=6000) X,Y,IX,IY END IF C C---- Place hair at chosen position steer hair read new position by C pressing a key and terminal returns to graphics letter mode C CALL GSHRTM(IX,IY,CHKEY) C C---- Force position to lie in range on screen C IF (IX.LT.IXLOW) IX = IXLOW IF (IX.GT.IXHIGH) IX = IXHIGH IF (IY.LT.IYLOW) IY = IYLOW IF (IY.GT.IYHIGH) IY = IYHIGH C C---- Convert to drawing board C XF = IX - IDXOFF YF = IY - IDYOFF XB = (XF-XFOFF)/FACX YB = (YF-YFOFF)/FACY C C---- Convert back to user coordinates C DETU = USRMAT(1,1)*USRMAT(2,2) - USRMAT(1,2)*USRMAT(2,1) IF (DETU.EQ.0.0) DETU = 1.0E-20 AV = USRMAT(2,2)*DETU BV = -USRMAT(2,1)*DETU CV = -USRMAT(1,2)*DETU DV = USRMAT(1,1)*DETU XB = XB - XORIG YB = YB - YORIG X = AV*XB + BV*YB Y = CV*XB + DV*YB IF (IPRINT.GE.2) THEN CALL GSTYTM WRITE (LUNOUT,FMT=6002) X,Y,IX,IY WRITE (LUNOUT,FMT=6004) CHKEY END IF END IF C C---- Format statements C 6000 FORMAT (1X,'GSHAIR SET AT:(X,Y)= ',2F12.4,' (IX,IY)= ',2I6) 6002 FORMAT (1X,'GSHAIR FOUND AT:(X,Y)= ',2F12.4,' (IX,IY)= ',2I6) 6004 FORMAT (1X,'CHKEY= ',A) C END C C SUBROUTINE GSINIT(GSNAM) C ========================== C C---- Plot84 graphics program jun 1984 C adapted from d.a. agard plot82 C C A.D. McLachlan JUN 1984. Last updated 1 OCT 1984 C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were NFONTS C C---- To plot on plotfile,paper or vt640 screen C C Definitions of common blocks and variables in plot84 C C <> ((user transformation variables)) C USRMAT(3,3) = user scaling matrix: C C XDRW = USRMAT(1,1)*XU+USRMAT(1,2)*YU + XORIG C YDRW = USRMAT(2,1)*XU+USRMAT(2,2)*YU + YORIG C XORIG :=: USRMAT(1,3) C YORIG :=: USRMAT(2,3) C C XORIG,YORIG = user origin on drawing board (mm) C C SCALEX,SCALEY = mm equiv of 1 user unit along local x,y C USANGX,USANGY = angles of local user axes (radians) C CUMAT(3,3) = character*user scaling matrix C C CUORGX:=:CUMAT(1,3) CUORGY:=:CUMAT(2,3) C CUORGX,CUORGY = character*user origin value C C LINMOD = .TRUE. for line mode C ICULNK = .TRUE. for user char trans linked C NSTRAN(24) = array equivalent to (usrmat...iculnk) C KPRINT = print control, copy of iprint for some C routines C C <> ((character position variables)) C C CHRMAT(3,3) = character transformation matrix C CHORGX:=:CHRMAT(1,3) CHORGY:=:CHRMAT(2,3) C CHORGX,CHORGY = character origin in char units C relative to (xchar,ychar) C C CHRSCX,CHRSCY = char width and height in character units C (default=3.0) C CHANGX,CHANGY = angles of char x and y (radians) C CHRSPX,CHRSPY = character space extra values C ICENTC = character centering control C UCSPAC = .TRUE. for uniform spacing C IFONT = font number C FONTIN = .TRUE. after font tables read in C XCHAR,YCHAR = character anchor point C XCSTRT,YCSTRT = character cursor position C relative to anchor point C in character units on character grid C ANGFAC = pi/180.0 degrees to radians C NCTRAN(24) = array equivalent to (chrmat...angfac) C C <> ((pen position variables)) C C XNOW,YNOW = current user position C XBNEW,YBNEW = current board position C XBOLD,YBOLD = old board position C C <> ((DEVICE AND WINDOW VARIABLES)) C C MDEVIC = device (1)undef (2)paper (3) vt640 C MDIREC = (0)plotfile (1) direct C MOUT = vt640 unit symbolic number C MPIC = series number of picture C MSCAFL,MCNTFL = floating scale and origin C DWLIMX,DWLIMY = current drawing board size mm C DVXMIN,DVXMAX = device x viewport mm C DVYMIN,DVYMAX = device y viewport mm C UBXMIN,UBXMAX = drawing board x window mm C UBYMIN,UBYMAX = drawing board y window mm C FILNAM(*80) = plotfile name C DEVCON = logical*4 .true. when device switched on C INITON = .true. if GSinit called C NERROR = no of out of bounds errors C DWBLMX,DWBLMY = drawing board max size mm C PAPLMX,PAPLMY = paper max size mm C V64LMX,V64LMY = vt640 max size mm C IUNIT = symbolic unit number (plotfile) C DOTMMX,DOTMMY = dots per mm along device x y C (default(10.0,10.0)) C IXMIN,IXMAX = actual used x range of plot pixels C IYMIN,IYMAX = actual used y range of plot pixels C LINWT,ICOLOR = line-thickness, colour (default 4) C MIXCOL = (0) monochrome (1) mixed colours C NPICS = number of pictures in the run C IPRINT = print control (0)none (1)normal,(2,3)more C IDRLVL = initiation level (0)no-init,(1)init,(2)trset, C (3) drawing in progress C TITLE(*80) = plot title C C <> ((device mm to pixels integers transf)) C C FACX,FACY = scale factors C XFOFF,YFOFF = origin offsets C IDXOFF,IDYOFF = pixel margins C C Transformation is: C IX = (XDRW*FACX+XFOFF)+IDXOFF C IY = (YDRW*FACY+YFOFF)+IDYOFF C C IXOLD,IYOLD = pixel values of previous plotted point C MODOLD = mode of previous point (1=draw,2=point,3=move) C C <> ((clipping limits on drawing board)) C C BXMIN,BXMAX = x range C BYMIN,BYMAX = y range C C <> ((plot header data)) 512 bytes (some spare) C C IUNITR = unit number (copy of iunit) not part of header C IREC(128)/AREC(128) contains the other data as follows: C C 1. NREC = number of records after header C 2. DOTMMX = dots per mm along x C 3. DOTMMY = dots per mm along y C 4. IXMIN = low pixel x used C 5. IXMAX = high pixel x used C 6. IYMIN = low y C 7. IYMAX = high y C 8. LINWT = line thickness C 9. ICOLOR = colour C 10. MIXCOL = mixed colour C 11. MDEVIC = device type C 12. MDIREC = direct/deferred C 13. MOUT = output unit C 14. MPIC = picture number C 15. MSCAFL = floating scale C 16. MCNTFL = floating origin C 17. DWLIMX = drawing board x size C 18. DWLIMY = drawing board y size C 19. DVXMIN = device x min C 20. DVXMAX = device x max C 21. DVYMIN = device y min C 22. DVYMAX = device y max C 23. NPICS = number of pictures in this set C 24-25. PASWRD = password (character*8) C to show it is a plot84 file C 26-40. spare C 41-60. TITLEH = plot title(*80) C 61-128. spare C C <> text font generation vectors C C IFSTRT = start array position C LENGF = number of vectors C IFX0,IFY0 = origin shift C IFWID,IFHT = width, height constants C NFONTS = vector coords (4 bytes for x1,y1,x2,y2) C C <> for bit testing C IZ4B = result of 4 IBSETs C C .. Scalar Arguments .. INTEGER JPRINT CHARACTER GSNAM* (*),TITL* (*) C .. C .. Scalars in Common .. REAL ANGFAC,BXMAX,BXMIN,BYMAX,BYMIN,CHANGX,CHANGY,CHRSCX,CHRSCY, + CHRSPX,CHRSPY,DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN, + DWBLMX,DWBLMY,DWLIMX,DWLIMY,PAPLMX,PAPLMY,SCALEX, + SCALEY,UBXMAX,UBXMIN,UBYMAX,UBYMIN,USANGX,USANGY,V64LMX, + V64LMY,XBNEW,XBOLD,XCHAR,XCSTRT,XNOW,YBNEW,YBOLD,YCHAR, + YCSTRT,YNOW,DOTMMX2,DOTMMY2,DWLIMX2,DWLIMY2,DVXMIN2,DVXMAX2, + DVYMIN2,DVYMAX2,SPARE1,SPARE2 INTEGER ICENTC,ICOLOR,IDRLVL,IFONT,IPRINT,IUNIT, + IUNITR,IXMAX,IXMIN,IYMAX,IYMIN,KPRINT,LINWT, + LUNIN,LUNOUT,MCNTFL,MDEVIC,MDIREC,MIXCOL,MOUT,MPIC, + MSCAFL,NERROR,NPICS,IZ4B,MPIC2,NPICSX,NREC,IXMIN2,IXMAX2, + IYMIN2,IYMAX2,LINWT2,ICOLOR2,MIXCOLOR,MDEVIC2,MDIREC2, + MOUT2,MSCAFL2,MCNTFL2 LOGICAL*4 DEVCON,FONTIN,ICULNK,INITON,LINMOD,UCSPAC CHARACTER FILNAM*80,TITLE*80 C .. C .. Arrays in Common .. REAL CHRMAT,CUMAT,USRMAT INTEGER*2 IFHT,IFSTRT,IFWID,IFX0,IFY0,LENGF INTEGER*1 NFONTS C .. C .. Local Scalars .. REAL CHORGX,CHORGY,CUORGX,CUORGY,PI,XORIG,YORIG INTEGER NFLEN,NFSTRT CHARACTER PASWRD*8,TITLEH*80 C .. C .. Local Arrays .. INTEGER NCTRAN(24),NSTRAN(24) C .. C .. External Functions .. INTEGER LENSTR EXTERNAL LENSTR C .. C .. External Subroutines .. EXTERNAL GSLVCK,GSRFNT,GSSTYL,GSXENV C C---- Force the linker to include "block data" C EXTERNAL GSBLKD C .. C .. Intrinsic Functions .. INTRINSIC ATAN2,INDEX,MIN C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSCHX/CHRMAT(3,3),CHRSCX,CHRSCY,CHANGX,CHANGY, + CHRSPX,CHRSPY,ICENTC,UCSPAC,IFONT,FONTIN,XCHAR, + YCHAR,XCSTRT,YCSTRT,ANGFAC COMMON /GSCLP/BXMIN,BXMAX,BYMIN,BYMAX REAL FACX, FACY, XFOFF, YFOFF INTEGER IDXOFF, IDYOFF, IXOLD, IYOLD, MODOLD COMMON /GSDVT/FACX,FACY,XFOFF,YFOFF,IDXOFF,IDYOFF, + IXOLD,IYOLD,MODOLD COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX, + IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE COMMON /GSDWX/XNOW,YNOW,XBNEW,YBNEW,XBOLD,YBOLD COMMON /GSFHD/ + IUNITR, NREC, DOTMMX2, DOTMMY2, + IXMIN2, IXMAX2, IYMIN2, + IYMAX2, LINWT2, ICOLOR2, MIXCOLOR, MDEVIC2, + MDIREC2, MOUT2, + MPIC2, MSCAFL2, MCNTFL2, DWLIMX2, DWLIMY2, + DVXMIN2, DVXMAX2, + DVYMIN2, DVYMAX2, NPICSX, + PASWRD, + SPARE1(15), + TITLEH, + SPARE2(68) COMMON /GSFNT/IFSTRT(150,4),LENGF(150,4),IFX0(150,4), + IFY0(150,4),IFWID(150,4),IFHT(150,4),NFONTS(4,3000,4) COMMON /GSUTR/USRMAT(3,3),SCALEX,SCALEY,USANGX,USANGY, + CUMAT(3,3),LINMOD,ICULNK,KPRINT COMMON /GSBTST/ IZ4B C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (XORIG,USRMAT(1,3)), (YORIG,USRMAT(2,3)) EQUIVALENCE (CUORGX,CUMAT(1,3)), (CUORGY,CUMAT(2,3)) EQUIVALENCE (NSTRAN(1),USRMAT(1,1)) EQUIVALENCE (CHORGX,CHRMAT(1,3)), (CHORGY,CHRMAT(2,3)) EQUIVALENCE (NCTRAN(1),CHRMAT(1,1)) C C CALL GSBLKD C C---- Check level C IF (IDRLVL.EQ.3) CALL GSLVCK('GSINIT') IDRLVL = 1 INITON = .TRUE. C C---- All angles now stored as radians C PI = ATAN2(1.0,1.0)*4.0 ANGFAC = PI/180.0 IPRINT = 1 KPRINT = 1 NERROR = 0 TITLE = ' ' TITLEH = ' ' MPIC = 0 MPIC2 = MPIC NPICS = 0 NPICSX = NPICS C C---- Remove leading and trailing blanks from filename C NFLEN = LENSTR(GSNAM) NFSTRT = 1 IF (NFLEN.GT.0) THEN 10 CONTINUE IF ((INDEX(GSNAM(NFSTRT:NFSTRT),' ').EQ.1) .AND. + (NFSTRT.LE.NFLEN)) THEN NFSTRT = NFSTRT + 1 GO TO 10 END IF END IF IF ((NFLEN.LE.0) .OR. (NFSTRT.GT.NFLEN)) THEN IF (IPRINT.GT.0) . WRITE (LUNOUT,FMT=6002) GSNAM(1:MIN(130,LENSTR(GSNAM))) END IF C FILNAM = GSNAM(NFSTRT:NFLEN) DEVCON = .FALSE. C C---- Clear settings for device and windows etc C CALL GSXENV C C---- GSPICT will call GSenvr to set windows on first picture C GSPICT will clear user transformations C clear plot style C CALL GSSTYL FONTIN = .FALSE. C C---- Read in font first time through C IF (.NOT.FONTIN) CALL GSRFNT FONTIN = .TRUE. C generate word with all zero bits (exclusive or of two equal words) IZ4B = IEOR (0, 0) RETURN C ENTRY GSTITL(TITL) C ================== C TITLE = TITL TITLEH = TITLE IF (IPRINT.GT.1) WRITE (LUNOUT,FMT=6000) TITLE RETURN C ENTRY GSPRNT(JPRINT) C ===================== C C---- IPRINT controls the output of messages C (0) no print C (1) normal C (2) header and scaling information etc C (3) line vector details C IF ((JPRINT.LT.0) .OR. (JPRINT.GT.3)) JPRINT = 1 IPRINT = JPRINT KPRINT = JPRINT C C---- Format statements C 6000 FORMAT (2X,'GSTITL: ',A) 6002 FORMAT (1X,'!!GSINIT WARNING: BLANK OR ZERO-LENGTH FILENAME') C END C C C SUBROUTINE GSINTM(IUTERM) C ========================== C C---- Vt640 driver routines t.s. horsnell C C A.D.McLachlan: CORRECTIONS FOR PLOT84 Last updated 3 FEB 1988. C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were BUFFER, LNTYPE, XHAIR, CONTRL, KEY, ZERO, ONE, BEL, BS, C CAN, CR, ENQ, ESC, FF, FS, GS, HT, LF, RS, SUB, US, VT C C These are a set of FORTRAN-callable routines for driving the C VT640 Tektronix-4010 emulator on the VT100 terminals. Routines are C provided for line, point and text drawing, crosshair reading, C VT100 cursor positioning and screen clearing. C The memory coords (0-1023 in x, 0-780 in y) C are automatically converted C to the display range (0-639 in x, 0-479 in y). C The origin is always the bottom left hand corner of the screen. C C---- In these routines a time delay routine GSsusp(milsec) which waits C for milsec milliseconds is used to try to ensure that the changes of C terminal mode do not occur too fast for it to keep up. these apply C to changes between normal teletype (mode=mtty) and graphics modes. C ( vector or alpha) C C CALL GSINTM(ITERM) C Clear the display screen and open the FORTRAN unit ITERM as the C plot stream for output to terminal. Also open the unit C ITERMR=ITERM-1 as the plot stream for input to read from terminal C C CALL GSOPTM(ITERM) C Open the FORTRAN unit ITERM as the plot stream, but do not clear C the screen. Used when a new job wants to look at what is already C on the screen. C C CALL GSOFTM(ITERM) C Close terminal graphics FORTRAN stream (do not clear screen) C C CALL GSSCTM C Clear screen and leave in graphics vector mode C C CALL GSGRTM C Switch to VT640 mode (from a previously selected VT100 mode) C C CALL GSMVTM(IX,IY) C CALL GSDWTM(IX,IY) C CALL GSPTTM(IX,IY) C Move to the position (IX,IY), draw a vector from the current C position to position (IX,IY) or place a point at C the position (IX,IY) C C CALL GSTXTM(TEXT,ISIZE) C Write the string TEXT with char size ISIZE starting at C the current position defined by the last GSMVTM command. C The integer ISIZE=1,2,3,4 specifies the size in units of C the standard text size which is 7*9 physical dots on C the screen. C C CALL GSHRTM(IX,IY,CHKEY) C Place the cross-hairs at (IX,IY), display them and then C wait for the user to position them. The crosshairs are driven C by the 4 cursor keys C The coordinates are read when any character key is pressed. C The cross hair then disappears and the terminal returns to C alphabetical mode. The ASCII key character is returned C in CHKEY (CHARACTER*1). C C CALL GSDOTM C In VT640 mode, selects the normal drawing mode. C C CALL GSERTM C In VT640 mode, rubs out any dots which subsequent draws, C points, or texts overwrites. C C CALL GSRVTM C In VT640 mode, rubs out any dots which subsequent draws, C points, or texts overwrites. C C CALL GSTYTM C Return the display to VT100 mode. C C CALL GSMYTM(IX,IY) C Position the VT100 cursor to (IX,IY) 0<=IX<=79, 0<=IY<=23 C C CALL GSCYTM C Clear the VT100 screen, leaving the VT640 picture. C (vice-versa is not possible) C C CALL GSLSTM(ITYPE) C In VT640 mode select the line type for vector drawing. C ITYPE=1-4 C 1 = Normal C 2 = Dotted C 3 = Dot-Dash C 4 = Short Dash C 5 = Long Dash C C CALL GSBLTM C Ring the bell or BEEP of the terminal C C .. Scalar Arguments .. INTEGER ISIZE,ITYPE,IUTERM,IX,IY CHARACTER CHKEY*1,STRING* (*) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT,NBFPTR C .. C .. Arrays in Common .. CHARACTER*1 BUFFER C .. C .. Local Scalars .. INTEGER ITERM,ITERMR,JSIZE,MALPHA,MDRAW,MHAIR,MODE,MOVE,MPOINT, + MTTY,MVECT,NCLEAR,IFAIL,ITEROP CHARACTER*1 CONTRL,KEY,ZERO,ONE CHARACTER*1 BEL,BS,CAN,CR,ENQ,ESC,FF,FS,GS,HT,LF,RS,SUB,US,VT CHARACTER OUTLIN*14 C .. C .. Local Arrays .. CHARACTER*1 LNTYPE(5),XHAIR(5) C .. C .. External Subroutines .. EXTERNAL GSBFTM,GSSUSP,GSXYTM C .. C .. External Functions .. LOGICAL VAXVMS EXTERNAL VAXVMS C .. C .. Intrinsic Functions .. INTRINSIC CHAR C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSBFT/BUFFER(256),NBFPTR C C .. Save Statement .. C SAVE C C C .. Data statements .. DATA LNTYPE/'`','a','b','c','d'/ DATA MODE/0/ DATA MOVE/1/,MDRAW/2/,MPOINT/3/,MHAIR/4/,MALPHA/5/ DATA MVECT/0/,MTTY/6/ C .. C ZERO=CHAR(0) ONE=CHAR(1) BEL=CHAR(7) BS=CHAR(8) CAN=CHAR(24) CR=CHAR(13) ENQ=CHAR(5) ESC=CHAR(27) FF=CHAR(12) FS=CHAR(28) GS=CHAR(29) HT=CHAR(9) LF=CHAR(10) RS=CHAR(30) SUB=CHAR(26) US=CHAR(31) VT=CHAR(11) NCLEAR = 1 GO TO 10 C ENTRY GSONTM(IUTERM) C ==================== C NCLEAR = 0 GO TO 10 C ENTRY GSOFTM(IUTERM) C ===================== C C---- Turn off graphics stream C CALL GSSUSP(100) ITERM = IUTERM CALL GSBFTM(ITERM,ZERO) IF (ITERM.NE.6) CLOSE (UNIT=ITERM) MODE = MTTY RETURN C ENTRY GSSCTM() C ============= C C---- Clear screen and leave in graphics vector mode C CALL GSBFTM(ITERM,ZERO) CALL GSSUSP(100) WRITE (ITERM,FMT=6002) GS,ESC,FF,CAN,GS MODE = MVECT RETURN C ENTRY GSGRTM() C ============= C C---- Instruction "gs" start vector mode C IF (MODE.NE.MVECT) THEN CALL GSSUSP(100) WRITE (ITERM,FMT=6004) GS MODE = MVECT END IF RETURN C ENTRY GSMVTM(IX,IY) C ==================== C C---- For move/draw/point try and do as much output in C one write statement as possible to reduce i/o calls to vms C C---- use "GS" to define first vector end-point C CONTRL = GS CALL GSXYTM(ITERM,IX,IY,CONTRL) MODE = MOVE RETURN C ENTRY GSDWTM(IX,IY) C ==================== C CONTRL = CHAR(0) C C---- use "GS" to initialize vector sequence if no previous point C IF ((MODE.NE.MOVE) .AND. (MODE.NE.MDRAW)) CONTRL = GS CALL GSXYTM(ITERM,IX,IY,CONTRL) MODE = MDRAW RETURN C ENTRY GSPTTM(IX,IY) C ==================== C C---- Changed to avoid using point mode, which fails on some terminals C draw a zero-length vector at (ix,iy) C CONTRL = GS CALL GSXYTM(ITERM,IX,IY,CONTRL) CONTRL = CHAR(0) CALL GSXYTM(ITERM,IX,IY,CONTRL) MODE = MDRAW RETURN C ENTRY GSHRTM(IX,IY,CHKEY) C ========================== C CALL GSSUSP(50) CONTRL = GS MODE = MHAIR CALL GSXYTM(ITERM,IX,IY,CONTRL) C C---- Position cross-hairs at last moveto point C "US" gives alpha mode C "ESC,'/f'" loads last value of (ix,iy) into xhair address C "ESC,SUB" puts up xhair till a character key is pressed C drive xhair with the 4 cursor keys upper right ^ V < > C automatic exit to alpha mode C CALL GSBFTM(ITERM,ZERO) WRITE (ITERM,FMT=6006) US,ESC,'/f',ESC,SUB MODE = MHAIR READ (ITERMR,FMT=6008) XHAIR C C---- Decode coordinate bytes the bit pattern code here is C C bit value 32 16 8 4 2 1 C bit number 7 6 5 4 3 2 1 0 C C HIGH X P 0 1 X9 X8 X7 X6 X5 C LOW X P 0 1 X4 X3 X2 X1 X0 C C HIGH Y P 0 1 Y9 Y8 Y7 Y6 Y5 C LOW Y P 0 1 Y4 Y3 Y2 Y1 Y0 C C IX = 32*HIGHX + LOWX C IY = 32*HIGHY + LOWY C KEY = XHAIR(1) CHKEY = KEY CCC IX=ICHAR(XHAIR(2)).AND.31 IX=IAND(ICHAR(XHAIR(2)),31) CCC IX=32*IX+(ICHAR(XHAIR(3)).AND.31) IX=32*IX+(IAND(ICHAR(XHAIR(3)),31)) CCC IY=ICHAR(XHAIR(4)).AND.31 IY=IAND(ICHAR(XHAIR(4)),31) CCC IY=32*IY+(ICHAR(XHAIR(5)).AND.31) IY=32*IY+(IAND(ICHAR(XHAIR(5)),31)) MODE = MALPHA RETURN C ENTRY GSTXTM(STRING,ISIZE) C =========================== C CALL GSBFTM(ITERM,ZERO) MODE = MALPHA C C---- Writes at the position of the blinking cursor C set by a previous moveto C "US" selects alpha mode C "ESC, ISIZE" selects character size C JSIZE = ISIZE - 1 IF (JSIZE.LT.0) JSIZE = 0 IF (JSIZE.GT.3) JSIZE = 3 WRITE (ITERM,FMT=6010) US,ESC,JSIZE,STRING RETURN C ENTRY GSTYTM() C =============== C IF (MODE.NE.MTTY) THEN CALL GSBFTM(ITERM,ZERO) CALL GSSUSP(100) C C---- "US,CAN" selects transparent mode C WRITE (ITERM,FMT=6012) US,CAN MODE = MTTY END IF RETURN C ENTRY GSMYTM(IX,IY) C ==================== C CALL GSBFTM(ITERM,ZERO) IF (MODE.NE.MTTY) WRITE (ITERM,FMT=6012) US,CAN WRITE (OUTLIN,FMT=6014) ESC,'[',IY,';',IX,'f' WRITE (ITERM,FMT=6016) OUTLIN(1:8) MODE = MTTY RETURN C ENTRY GSCYTM() C ============= C CALL GSBFTM(ITERM,ZERO) IF (MODE.NE.MTTY) WRITE (ITERM,FMT=6012) US,CAN WRITE (ITERM,FMT=6018) ESC,'[2J' MODE = MTTY RETURN C ENTRY GSDOTM() C ============= C C---- Instruction "ESC/0d" sets dots-on level C CALL GSBFTM(ITERM,ZERO) CALL GSSUSP(100) WRITE (ITERM,FMT=6020) GS,ESC,'/0d' MODE = MVECT RETURN C ENTRY GSERTM() C ============= C C---- Instruction "ESC/1D" puts dots off (erase level) C CALL GSBFTM(ITERM,ZERO) CALL GSSUSP(100) WRITE (ITERM,FMT=6020) GS,ESC,'/1d' MODE = MVECT RETURN C ENTRY GSRVTM() C ============= C C---- Instruction "ESC/3d" Sets complement level C CALL GSBFTM(ITERM,ZERO) CALL GSSUSP(100) WRITE (ITERM,FMT=6020) GS,ESC,'/2d' MODE = MVECT RETURN C ENTRY GSLSTM(ITYPE) C ==================== C C---- Set line type C CALL GSBFTM(ITERM,ZERO) CALL GSSUSP(100) IF ((ITYPE.LT.1) .OR. (ITYPE.GT.5)) ITYPE = 1 WRITE (ITERM,FMT=6022) GS,ESC,LNTYPE(ITYPE) MODE = MVECT RETURN C ENTRY GSBLTM() C ============= C C---- Sound the "bell" or "beep" C CALL GSSUSP(100) WRITE (ITERM,FMT=6024) US,BEL,GS MODE = MVECT RETURN C 10 CONTINUE CALL GSSUSP(100) ITERM = IUTERM ITERMR = IUTERM - 1 NBFPTR = 0 C IF (VAXVMS()) THEN CLOSE (UNIT=ITERM) IFAIL = 0 ITEROP = -ITERM CALL CCPDPN (ITEROP,'SYS$OUTPUT','UNKNOWN','F',1024,IFAIL) ELSE ITERM = 6 END IF C IF (VAXVMS()) THEN CLOSE (UNIT=ITERMR) IFAIL = 0 ITEROP = -ITERMR CALL CCPDPN (ITEROP,'SYS$INPUT','UNKNOWN','F',1024,IFAIL) ELSE ITERMR = 5 END IF C C---- Only clear the screen if GSintm was called C WRITE (ITERM,FMT=6000) GS C C---- Instruction "GS" start vector mode C instruction "esc,ff" start alpha mode,clear memories,reset C instruction "CAN" start transparent mode (teletype letters working) C instruction "GS" start vector mode C IF (NCLEAR.NE.0) WRITE (ITERM,FMT=6000) ESC,FF,CAN,GS MODE = MVECT C C---- Format statements C 6000 FORMAT (4A1) 6002 FORMAT (5A1) 6004 FORMAT (A1) 6006 FORMAT (2A1,A,2A1) 6008 FORMAT (5A1) 6010 FORMAT (2A1,I1,A) 6012 FORMAT (2A1) 6014 FORMAT (2A1,I2.2,A1,I2.2,A1) 6016 FORMAT (A) 6018 FORMAT (A1,A) 6020 FORMAT (2A1,A) 6022 FORMAT (3A1) 6024 FORMAT (3A1) C END C C C SUBROUTINE GSINUM(INUM,NDIGIT,SIZX,SIZY,NJUST) C =============================================== C C---- Plot an integer in (i-ndigit) format C C A.D. McLachlan JUL 1984. Last updated 27 JUL 1984 C C---- For integers adjust ndigit upward to avoid overflows C C**** ENTRY GSFNUM for f-ndigit-.-nafter format: min=f3.0 C**** ENTRY GSENUM for e-ndigit-.-nafter format: min=e8.1 C C Maximum of 20 digits allowed. max of 10 after point C each routine adjusts format if necessary to try to C avoid overflows keeping nafter as set C njust justifying control (1)left (2)centre (3)right C C .. Scalar Arguments .. REAL ENUM,FNUM,SIZX,SIZY INTEGER INUM,NAFTER,NDIGIT,NJUST C .. C .. Scalars in Common .. REAL SCALEX,SCALEY,USANGX,USANGY INTEGER KPRINT,LUNIN,LUNOUT LOGICAL*4 ICULNK,LINMOD C .. C .. Arrays in Common .. REAL CUMAT,USRMAT C .. C .. Local Scalars .. REAL CUORGX,CUORGY,FABS,POW10,XORIG,YORIG INTEGER MAFTER,MDIGIT,NABS,NEEDED,NENTRY CHARACTER AFTER*3,DIGIT*3,BLANK20*20,TEXT*20 C .. C .. Local Arrays .. INTEGER NSTRAN(24) CHARACTER FMTE(5)*3,FMTF(5)*3,FMTI(3)*3 C .. C .. External Subroutines .. EXTERNAL GSCETS C .. C .. Intrinsic Functions .. INTRINSIC ABS,LOG10,REAL C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSUTR/USRMAT(3,3),SCALEX,SCALEY,USANGX,USANGY, + CUMAT(3,3),LINMOD,ICULNK,KPRINT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (XORIG,USRMAT(1,3)), (YORIG,USRMAT(2,3)) EQUIVALENCE (CUORGX,CUMAT(1,3)), (CUORGY,CUMAT(2,3)) EQUIVALENCE (NSTRAN(1),USRMAT(1,1)) C .. C .. Data statements .. DATA BLANK20/' '/ DATA FMTI/' (I',' 5 ',' ) '/ DATA FMTF/' (F',' 10',' . ',' 4 ',' ) '/ DATA FMTE/' (E',' 12',' . ',' 4 ',' ) '/ C NENTRY = 1 GO TO 10 C ENTRY GSFNUM(FNUM,NDIGIT,NAFTER,SIZX,SIZY,NJUST) C ================================================= C NENTRY = 2 GO TO 10 C ENTRY GSENUM(ENUM,NDIGIT,NAFTER,SIZX,SIZY,NJUST) C ================================================= C NENTRY = 3 C 10 CONTINUE C C---- Check for reasonable data settings C MDIGIT = NDIGIT IF (MDIGIT.GT.20) MDIGIT = 20 IF (NENTRY.NE.1) THEN MAFTER = NAFTER IF (MAFTER.GT.10) MAFTER = 10 IF (MAFTER.LT.0) MAFTER = 0 END IF C C---- Integer format: enlarge if too short C IF (NENTRY.EQ.1) THEN NABS = ABS(INUM) IF (NABS.NE.0) THEN NEEDED = LOG10(REAL(NABS)+0.5) + 1.0 IF (INUM.LT.0) NEEDED = NEEDED + 1 IF (MDIGIT.LT.NEEDED) MDIGIT = NEEDED END IF IF (MDIGIT.LT.1) MDIGIT = 1 C C---- Decimal after point check F decimal format C ELSE IF (NENTRY.EQ.2) THEN FABS = ABS(FNUM) IF (FABS.NE.0.0) THEN C C---- Needed is number of places before decimal point incl sign C POW10 = LOG10(FABS) IF (POW10.GE.0.0) THEN NEEDED = POW10 + 1.5 ELSE C C---- Number lt.(1.0) needs none before pt - but allow at least one digit after C NEEDED = 0 END IF C C---- Allow for - sign C IF (FNUM.LT.0.0) NEEDED = NEEDED + 1 C C---- Increase mdigit to include the point C NEEDED = NEEDED + 1 IF (POW10.LT.0.0) THEN C C---- For number lt.1.0 allow at least one digit after point C IF (MAFTER.LT.1) MAFTER = 1 END IF IF (MDIGIT.LT. (NEEDED+MAFTER)) MDIGIT = NEEDED + MAFTER C C---- For fnum=0.0 C ELSE IF (MDIGIT.LT. (MAFTER+2)) THEN MDIGIT = MAFTER + 2 END IF C C---- E format C ELSE IF (NENTRY.EQ.3) THEN IF (MDIGIT.LT. (MAFTER+7)) MDIGIT = MAFTER + 7 END IF C WRITE (DIGIT,FMT=6000) MDIGIT IF (KPRINT.GE.3) WRITE (LUNOUT,FMT=6004) DIGIT IF (NENTRY.GT.1) WRITE (AFTER,FMT=6000) MAFTER IF ((KPRINT.GE.3) .AND. (NENTRY.GT.1)) WRITE (LUNOUT, + FMT=6004) AFTER GO TO (20,30,40) NENTRY C C---- Set up internal integer format C 20 CONTINUE FMTI(2) = DIGIT TEXT = BLANK20 IF (KPRINT.GE.3) WRITE (LUNOUT,FMT=6004) FMTI WRITE (TEXT,FMT=FMTI) INUM GO TO 50 C C---- Set up internal decimal format C 30 CONTINUE FMTF(2) = DIGIT FMTF(4) = AFTER IF (KPRINT.GE.3) WRITE (LUNOUT,FMT=6004) FMTF TEXT = BLANK20 WRITE (TEXT,FMT=FMTF) FNUM GO TO 50 C C---- Set up internal "e" format C 40 CONTINUE FMTE(2) = DIGIT FMTE(4) = AFTER IF (KPRINT.GE.3) WRITE (LUNOUT,FMT=6004) FMTE TEXT = BLANK20 WRITE (TEXT,FMT=FMTE) ENUM C C---- Plot the result C 50 IF (KPRINT.GE.3) WRITE (LUNOUT,FMT=6002) TEXT(1:MDIGIT) CALL GSCETS(TEXT(1:MDIGIT),SIZX,SIZY,NJUST) C C---- Format statements C 6000 FORMAT (I3) 6002 FORMAT (1X,A) 6004 FORMAT (1X,20A3) C END C C C SUBROUTINE GSLINE(ZA,ZB) C ========================= C C .. Array Arguments .. REAL ZA(2),ZB(2) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. External Subroutines .. EXTERNAL GSDWTO,GSMVTO C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C CALL GSMVTO(ZA(1),ZA(2)) CALL GSDWTO(ZB(1),ZB(2)) C END C C C SUBROUTINE GSLRAS(IX1,IY1,IX2,IY2) C =================================== C C---- Plot a line as dots on a raster by bresenham's method C C A.D. McLachlan JUN 1984. Last updated 18 JUN 1984 C C---- Left and bottom refer to position of (x1,y1) along line C slow for slope inside range (-1.0,+1.0) C up for slope positive C C .. Scalar Arguments .. INTEGER IX1,IX2,IY1,IY2 C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. INTEGER IEND,IX,IY,MSIGN,ND,NX,NX2,NXY2,NY,NY2 LOGICAL BOTTOM,LEFT,SLOW,UP C .. C .. External Subroutines .. EXTERNAL GSDOTB C .. C .. Intrinsic Functions .. INTRINSIC ABS C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C LEFT = (IX1.LE.IX2) BOTTOM = (IY1.LE.IY2) UP = (BOTTOM .EQV. LEFT) IF (UP) THEN MSIGN = 1 ELSE MSIGN = -1 END IF NX = ABS(IX2-IX1) NY = ABS(IY2-IY1) SLOW = (NX.GE.NY) WRITE (LUNOUT,FMT=6000) LEFT,BOTTOM,UP,SLOW C C---- Constants C NX2 = 2*NX NY2 = 2*NY NXY2 = ABS(NX2-NY2) C C---- Set first point according to case C IF (SLOW) THEN C C---- Slope between +-1 : end is defined by x value at left end C IF (LEFT) THEN IX = IX1 IY = IY1 IEND = IX2 ELSE IX = IX2 IY = IY2 IEND = IX1 END IF ND = NY2 - NX ELSE C C---- Slope gt range +-1 : end is defined by y value at bottom end C IF (BOTTOM) THEN IX = IX1 IY = IY1 IEND = IY2 ELSE IX = IX2 IY = IY2 IEND = IY1 END IF ND = NX2 - NY END IF WRITE (LUNOUT,FMT=6002) MSIGN,NX,NY,NXY2,ND C C---- First dot C CALL GSDOTB(REAL(IX), REAL(IY)) C C---- Draw rest of line C IF (SLOW) THEN 10 CONTINUE C C---- Line of small slope: move along x C IF (IX.LT.IEND) THEN IX = IX + 1 IF (ND.LT.0) THEN ND = ND + NY2 ELSE IY = IY + MSIGN ND = ND - NXY2 END IF CALL GSDOTB(REAL(IX), REAL(IY)) GO TO 10 END IF ELSE 20 CONTINUE C C---- Line of steep slope: move along y C IF (IY.LT.IEND) THEN IY = IY + 1 IF (ND.LT.0) THEN ND = ND + NX2 ELSE IX = IX + MSIGN ND = ND - NXY2 END IF CALL GSDOTB(REAL(IX), REAL(IY)) GO TO 20 END IF C C---- Finished line C END IF C C---- Format statements C 6000 FORMAT (2X,'LEFT BOTTOM UP SLOW = ',4L4) 6002 FORMAT (2X,'MSIGN NX NY NXY2 ND = ',5I5) C END C C C SUBROUTINE GSLRSB(IX1,IY1,IX2,IY2) C =================================== C C---- Plot a line or single point as dots on a raster of bricks C by bresenham's method C C A.D. McLachlan JUN 1984. Last updated 16 JUL 1984 C 9/2/90 - PJD: Changed definition of several BYTEs to INTEGER. C They were NPLOTS, MBIT6 C C---- Definitions of brick sizes etc for trilog C Size of one brick: (48*64) dots, 6 dots/byte in (8*64)=512 bytes C Plot area (1536*8192) dots or (256*8192) bytes C Indexed dots(0:1536*0:8191) or bytes (0:255*0:8191) C Indexed bricks (0:31*0:127) one row of bricks=256*64=16384 bytes C C .. Parameters .. INTEGER NBITB,NBITB1 PARAMETER (NBITB=6,NBITB1=NBITB-1) INTEGER NWIDX,NWIDY,NBRIKX,NBRIKY PARAMETER (NWIDX=8,NWIDY=64,NBRIKX=32,NBRIKY=128) INTEGER NSIZEB,NSIZER PARAMETER (NSIZEB=NWIDX*NWIDY,NSIZER=NSIZEB*NBRIKX) INTEGER NWIDX1,NWIDY1 PARAMETER (NWIDX1=NWIDX-1,NWIDY1=NWIDY-1) INTEGER NSZBX1 PARAMETER (NSZBX1=NSIZEB-NWIDX1) INTEGER NSZRXB PARAMETER (NSZRXB=NSIZER+NWIDX-NSIZEB) INTEGER NBYTES,NBYTE1 PARAMETER (NBYTES=NSIZER*NBRIKY,NBYTE1=NBYTES-1) C .. C .. Scalar Arguments .. INTEGER IX1,IX2,IY1,IY2 C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Arrays in Common .. INTEGER NPLOTS C .. C .. Local Scalars .. INTEGER IBITX,IBRIKX,IBRIKY,IBX,IEND,IPX,IPY,IX,IY,JBRIK,JBYTE,ND, + NX,NX2,NXY2,NY,NY2 LOGICAL BOTTOM,LEFT,POINT,SLOW,UP C .. C .. Local Arrays .. INTEGER MBIT6(0:5) C .. C .. External Functions .. INTEGER ISHFT EXTERNAL ISHFT C .. C .. Intrinsic Functions .. INTRINSIC ABS C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSRAS/NPLOTS(0:NBYTE1) C C .. Save Statement .. C SAVE C C .. Data statements .. DATA MBIT6/1,2,4,8,16,32/ C C---- Left and bottom refer to position of (x1,y1) along line C slow for slope inside range (-1.0,+1.0) up for slope positive C LEFT = (IX1.LE.IX2) BOTTOM = (IY1.LE.IY2) UP = (BOTTOM .EQV. LEFT) NX = ABS(IX2-IX1) NY = ABS(IY2-IY1) C C---- Test for single point C IF ((NX.EQ.0) .AND. (NY.EQ.0)) THEN IX = IX1 IY = IY1 POINT = .TRUE. ELSE POINT = .FALSE. SLOW = (NX.GE.NY) C C---- Constants C NX2 = 2*NX NY2 = 2*NY NXY2 = ABS(NX2-NY2) C C---- Set first point according to case C IF (SLOW) THEN C C---- Slope between +-1 : end is defined by x value at left end C IF (LEFT) THEN IX = IX1 IY = IY1 IEND = IX2 ELSE IX = IX2 IY = IY2 IEND = IX1 END IF ND = NY2 - NX ELSE C C---- Slope gt range +-1 : end is defined by y value at bottom end C IF (BOTTOM) THEN IX = IX1 IY = IY1 IEND = IY2 ELSE IX = IX2 IY = IY2 IEND = IY1 END IF ND = NX2 - NY END IF END IF C C---- First dot coordinates in bit,byte and C brick array are ibitx,(ibx,iby),(ipx,ipy),(ibrikx,ibriky) C IBX = IX/NBITB IBITX = IX - NBITB*IBX IBRIKX = ISHFT(IBX,-3) IBRIKY = ISHFT(IY,-6) IPX = IBX - ISHFT(IBRIKX,3) IPY = IY - ISHFT(IBRIKY,6) JBRIK = ISHFT(IBRIKY,5) + IBRIKX JBYTE = ISHFT(IPY,3) + IPX + ISHFT(JBRIK,9) CCC NPLOTS(JBYTE) = (NPLOTS(JBYTE) .OR. MBIT6(IBITX)) NPLOTS(JBYTE) = IOR(NPLOTS(JBYTE), MBIT6(IBITX)) IF (.NOT.POINT) THEN C C---- Draw rest of line C IF (.NOT.SLOW) THEN C C---- End of slow lines Fast line of steep slope: move along y C IF (UP) THEN 10 CONTINUE C C---- Up x line C IF (IY.LT.IEND) THEN IY = IY + 1 IPY = IPY + 1 IF (IPY.GT.NWIDY1) THEN IPY = 0 JBYTE = JBYTE + NSZRXB ELSE JBYTE = JBYTE + NWIDX END IF IF (ND.LT.0) THEN ND = ND + NX2 ELSE IX = IX + 1 IBITX = IBITX + 1 IF (IBITX.GT.NBITB1) THEN IBITX = 0 IPX = IPX + 1 IF (IPX.GT.NWIDX1) THEN JBYTE = JBYTE + NSZBX1 IPX = 0 ELSE JBYTE = JBYTE + 1 END IF END IF ND = ND - NXY2 END IF CCC NPLOTS(JBYTE) = (NPLOTS(JBYTE) .OR. MBIT6(IBITX)) NPLOTS(JBYTE) = IOR(NPLOTS(JBYTE), MBIT6(IBITX)) GO TO 10 END IF ELSE C C---- End up line C 20 CONTINUE C C---- Down x line C IF (IY.LT.IEND) THEN IY = IY + 1 IPY = IPY + 1 IF (IPY.GT.NWIDY1) THEN IPY = 0 JBYTE = JBYTE + NSZRXB ELSE JBYTE = JBYTE + NWIDX END IF IF (ND.LT.0) THEN ND = ND + NX2 ELSE IX = IX - 1 IBITX = IBITX - 1 IF (IBITX.LT.0) THEN IBITX = NBITB1 IPX = IPX - 1 IF (IPX.LT.0) THEN JBYTE = JBYTE - NSZBX1 IPX = NWIDX1 ELSE JBYTE = JBYTE - 1 END IF END IF ND = ND - NXY2 END IF CCC NPLOTS(JBYTE) = (NPLOTS(JBYTE) .OR. MBIT6(IBITX)) NPLOTS(JBYTE) = IOR(NPLOTS(JBYTE), MBIT6(IBITX)) GO TO 20 END IF C C---- End down line C END IF C C---- Finished steep line Slow line of small slope: move along x C ELSE IF (UP) THEN 30 CONTINUE C C---- Up y line C IF (IX.LT.IEND) THEN IX = IX + 1 IBITX = IBITX + 1 IF (IBITX.GT.NBITB1) THEN IBITX = 0 IPX = IPX + 1 IF (IPX.GT.NWIDX1) THEN JBYTE = JBYTE + NSZBX1 IPX = 0 ELSE JBYTE = JBYTE + 1 END IF END IF IF (ND.LT.0) THEN ND = ND + NY2 ELSE IPY = IPY + 1 IF (IPY.GT.NWIDY1) THEN IPY = 0 JBYTE = JBYTE + NSZRXB ELSE JBYTE = JBYTE + NWIDX END IF ND = ND - NXY2 END IF CCC NPLOTS(JBYTE) = (NPLOTS(JBYTE) .OR. MBIT6(IBITX)) NPLOTS(JBYTE) = IOR(NPLOTS(JBYTE), MBIT6(IBITX)) GO TO 30 END IF ELSE C C---- End up line C 40 CONTINUE C C---- Down y line C IF (IX.LT.IEND) THEN IX = IX + 1 IBITX = IBITX + 1 IF (IBITX.GT.NBITB1) THEN IBITX = 0 IPX = IPX + 1 IF (IPX.GT.NWIDX1) THEN JBYTE = JBYTE + NSZBX1 IPX = 0 ELSE JBYTE = JBYTE + 1 END IF END IF IF (ND.LT.0) THEN ND = ND + NY2 ELSE IPY = IPY - 1 IF (IPY.LT.0) THEN IPY = NWIDY1 JBYTE = JBYTE - NSZRXB ELSE JBYTE = JBYTE - NWIDX END IF ND = ND - NXY2 END IF CCC NPLOTS(JBYTE) = (NPLOTS(JBYTE) .OR. MBIT6(IBITX)) NPLOTS(JBYTE) = IOR(NPLOTS(JBYTE), MBIT6(IBITX)) GO TO 40 END IF C C---- End of down line C END IF C C---- Finished all cases C END IF C END C C C SUBROUTINE GSLVCK(SUBNAM) C ========================== C C---- Checks for misplaced subroutine calls C C A.D. McLachlan JUL 1984. Last updated 11 JUL 1984. C C C .. Scalar Arguments .. CHARACTER SUBNAM* (*) C .. C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWBLMX,DWBLMY, + DWLIMX,DWLIMY,PAPLMX,PAPLMY,UBXMAX,UBXMIN,UBYMAX,UBYMIN, + V64LMX,V64LMY INTEGER ICOLOR,IDRLVL,IPRINT,IUNIT,IXMAX,IXMIN,IYMAX,IYMIN,LINWT, + LUNIN,LUNOUT,MCNTFL,MDEVIC,MDIREC,MIXCOL,MOUT,MPIC,MSCAFL, + NERROR,NPICS LOGICAL*4 DEVCON,INITON CHARACTER FILNAM*80,TITLE*80 C .. C .. Local Scalars .. CHARACTER OUTLIN*100 INTEGER LENSTR EXTERNAL LENSTR C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE C C .. Save Statement .. C SAVE C WRITE (LUNOUT,FMT=6000) OUTLIN(1:) = SUBNAM WRITE (LUNOUT,FMT=6001) OUTLIN(1:LENSTR(OUTLIN)),IDRLVL call ccperr(1,'plot84lib internal error') C C---- Format statements C 6000 FORMAT (2X,'!!!GSLVCK ***FATAL ERROR STOP*** - ') 6001 FORMAT (2X,'ATTEMPT TO CALL ',A,' AT LEVEL ',I5,/2X, + '(0)=NOINIT,(1)=INIT,(2)=','TRSET,(3)=DRAWING ') C END C C C SUBROUTINE GSMUCT(USRMAT,CHRMAT,CUMAT,ICULNK,IPRINT) C ===================================================== C C---- Combines character and user transformations C C A.D. McLachlan JULY 1984 Last updated 25 JULY 1984 C C---- The origin shifts in the usrmat transformation are included C in the anchor point setting and so must not be multiplied C into the character transformation as well C C .. Scalar Arguments .. INTEGER IPRINT LOGICAL*4 ICULNK C .. C .. Array Arguments .. REAL CHRMAT(3,3),CUMAT(3,3),USRMAT(3,3) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. REAL XORIG1,YORIG1 INTEGER I,J C .. C .. External Subroutines .. EXTERNAL GSTMPY C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C IF (ICULNK) THEN C C---- Annul and then restore user origin shift C XORIG1 = USRMAT(1,3) YORIG1 = USRMAT(2,3) USRMAT(1,3) = 0.0 USRMAT(2,3) = 0.0 CALL GSTMPY(USRMAT,CHRMAT,CUMAT) USRMAT(1,3) = XORIG1 USRMAT(2,3) = YORIG1 ELSE DO 20 J = 1,3 DO 10 I = 1,3 CUMAT(I,J) = CHRMAT(I,J) 10 CONTINUE 20 CONTINUE END IF IF (IPRINT.GE.2) WRITE (LUNOUT,FMT=6000) ICULNK,CUMAT(1,1), + CUMAT(1,2),CUMAT(1,3),CUMAT(2,1),CUMAT(2,2),CUMAT(2,3) C C---- Format statements C 6000 FORMAT (2X,'USER*CHARACTER TRANSFORMATION: ICULNK= ',L4,/2X,'CUM', + 'AT(1,1),(1,2),CUORGX = ',3F10.4,/2X,'CUMAT(2,1),(2,2),CU', + 'ORGY = ',3F10.4) C END C C C SUBROUTINE GSOFLW(IUNITP,GSNAM) C ================================= C C---- Set of subroutines for plot84 package to do i/o C C Adapted from d.a. agard plot81 C A.D. McLachlan JUN 1984 . Last updated 4 OCT 1984 C C---- Uses mrc random-access diskio routines. the header is reset after C each plot to contain the number of actual plot records and the C correct min/max values used in the plot. C C---- Header of 512 bytes in irec and equivalent variables C C---- Equivalences to convert integer*4 dot indices into C integer*2 without overflow C C .. Scalar Arguments .. INTEGER IUNITP,IX,IY,KEOF,KKEOF,KKKEOF,NBYTE CHARACTER GSNAM* (*) C .. C .. Array Arguments .. REAL IARRAY(*) C .. C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWBLMX,DWBLMY, + DWLIMX,DWLIMY,PAPLMX,PAPLMY,UBXMAX,UBXMIN,UBYMAX,UBYMIN, + V64LMX,V64LMY INTEGER ICOLOR,IDRLVL,IPRINT,IUNIT,IUNITR,IXMAX,IXMIN,IYMAX,IYMIN, + LINWT,LUNIN,LUNOUT,MCNTFL,MDEVIC,MDIREC,MIXCOL,MOUT,MPIC, + MSCAFL,NERROR,NPICS LOGICAL*4 DEVCON,INITON CHARACTER FILNAM*80,TITLE*80 C .. C .. Arrays in Common .. REAL IREC C .. C .. Local Scalars .. INTEGER I,IELM,IER,MREC,NRECL,NMCITM,KMODEX,LENSTR,KRECORD CHARACTER FILE84*8,TMPNAM*40,PASWRD*8,TITLEH*80 C .. C .. Local Arrays .. INTEGER*2 JXY(2) INTEGER JJXY (1) EQUIVALENCE (JXY,JJXY) C .. C .. External Subroutines .. EXTERNAL GSLVCK,QBACK,QCLOSE,QOPEN,QREAD,QSEEK, + QSKIP,QWRITE,QMODE,LENSTR C .. C .. Intrinsic Functions .. INTRINSIC INDEX C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE cc COMMON /GSFHD/ cc + IUNIT, NREC, DOTMMX, DOTMMY, IXMIN, IXMAX, IYMIN, cc + IYMAX, LINWT, ICOLOR, MIXCOLOR, MDEVIC, MDIREC, MOUT, cc + MPIC, MSCAFL, MCNTFL, DWLIMX, DWLIMY, DVXMIN, DVXMAX, cc + DVYMIN, DVYMAX, NPICS, cc + PASWRD, cc + SPARE1(15), cc + TITLEH, cc + SPARE2(68) COMMON /GSFHD/IUNITR,IREC(128) INTEGER AREC(128) C C .. Save Statement .. C SAVE C C .. Equivalences .. C C---- Equivalences C EQUIVALENCE (IREC(1),AREC(1)) EQUIVALENCE (TITLEH,IREC(41)) EQUIVALENCE (PASWRD,IREC(24)) C .. C .. Data statements .. DATA NRECL/512/ DATA FILE84/'PLOT%%84'/ ccx IPRINT = 3 C C---- Open plotfile to write check level C IF ((IDRLVL.EQ.0) .OR. (IDRLVL.GT.2)) + CALL GSLVCK('GSOFLW') C C---- Precaution against case that "GSnam" is C in fact same as "filnam" but called from another plot routine C IUNITR = IUNITP TMPNAM = GSNAM FILNAM = TMPNAM IF (IPRINT.GE.2) WRITE (LUNOUT,FMT=6002) TMPNAM CALL QOPEN(IUNITR,TMPNAM,'NEW') C C---- Change to byte handling C KMODEX = 0 CALL QMODE (IUNITR,KMODEX,NMCITM) IUNIT = IUNITR IUNITP = IUNITR RETURN C ENTRY GSOFLR(IUNITP,GSNAM) C ============================ C C---- Open plotfile to read check level C IUNITR = IUNITP TMPNAM = GSNAM FILNAM = TMPNAM IF (IPRINT.GE.2) WRITE (LUNOUT,FMT=6002) TMPNAM(1:LENSTR(TMPNAM)) CALL QOPEN(IUNITR,TMPNAM(1:LENSTR(TMPNAM)),'READONLY') C C---- Change to byte handling C KMODEX = 0 CALL QMODE (IUNITR,KMODEX,NMCITM) IUNIT = IUNITR IUNITP = IUNITR RETURN C ENTRY GSCFIL(IUNITP) C ===================== C C---- Close plotfile C IUNITR = IUNITP CALL QCLOSE(IUNITR) IUNIT = IUNITR IUNITP = IUNITR RETURN C ENTRY GSWHDR() C ============= C C---- Write out header of 512 bytes check level C IF (IDRLVL.NE.3) CALL GSLVCK('GSWHDR') AREC(1) = 0 IREC(2) = DOTMMX IREC(3) = DOTMMY AREC(4) = IXMIN AREC(5) = IXMAX AREC(6) = IYMIN AREC(7) = IYMAX AREC(8) = LINWT AREC(9) = ICOLOR AREC(10) = MIXCOL AREC(11) = MDEVIC AREC(12) = MDIREC AREC(13) = MOUT AREC(14) = MPIC AREC(15) = MSCAFL AREC(16) = MCNTFL IREC(17) = DWLIMX IREC(18) = DWLIMY IREC(19) = DVXMIN IREC(20) = DVXMAX IREC(21) = DVYMIN IREC(22) = DVYMAX AREC(23) = NPICS TITLEH = TITLE PASWRD = FILE84 IUNIT = IUNITR C CALL QWRITE(IUNITR,IREC,NRECL) IF (IPRINT.GE.2) WRITE (LUNOUT,FMT=6000) AREC(1),IREC(2), + IREC(3),(AREC(I),I=4,16), (IREC(I),I=17,22), + AREC(23),TITLEH,PASWRD RETURN C ENTRY GSFLWI(IX,IY) C ==================== C C---- Write out ix,iy to intermediate plot file check level C IF (IDRLVL.NE.3) CALL GSLVCK('GSFLWI') AREC(1) = AREC(1) + 1 JXY(1) = IX JXY(2) = IY IF (IPRINT.GE.3) WRITE (LUNOUT,FMT=*) JXY(1),JXY(2) CALL QWRITE(IUNITR,JJXY,4) RETURN C ENTRY GSUHDR() C ================ C C---- Update plot header check level C NRECL = 512 C C---- somehow on ESV lost AREC(1) = 0 ???? C IF (IDRLVL.NE.3) CALL GSLVCK('GSUHDR') IF ((AREC(1).GE.2) .OR. (JXY(1).GE.0)) THEN IF (IXMIN.GT.IXMAX) IXMIN = IXMAX IF (IYMIN.GT.IYMAX) IYMIN = IYMAX AREC(4) = IXMIN AREC(5) = IXMAX AREC(6) = IYMIN AREC(7) = IYMAX CALL QBACK(IUNITR, (4*AREC(1)+NRECL)) IF (IPRINT.GE.2) WRITE (LUNOUT,FMT=6000) AREC(1), +IREC(2),IREC(3), (AREC(I),I=4,16), +(IREC(I),I=17,22),AREC(23), + TITLEH,PASWRD CALL QWRITE(IUNITR,IREC,NRECL) KRECORD = AREC(1)*4 CALL QSKIP(IUNITR,KRECORD) END IF RETURN C ENTRY GSRHDR(KEOF) C =================== C C---- Read in header and init for buffered read C return to statement * on end-of-file or picture without any records C C (note that in the direct-access file the eof mark may C not match the end of the last record, so the plot file C is terminated by an empty header. C KEOF = 0 IER = 0 CALL QREAD(IUNITR,IREC,NRECL,IER) C C---- Check for empty or end of file C IF ((IER.EQ.0) .AND. (AREC(1).GE.2)) THEN C C---- Check for plot84 password C IF (INDEX(PASWRD,FILE84).NE.1) THEN WRITE (LUNOUT,FMT=6004) PASWRD ELSE RETURN END IF END IF KEOF = 1 RETURN C ENTRY GSFLRI(IX,IY,KKEOF) C ========================== C C---- Read in ix,iy return to statement * on eof C KKEOF = 0 IER = 0 CALL QREAD(IUNITR,JJXY,4,IER) IF (IER.NE.0) THEN KKEOF = 1 ELSE IX = JXY(1) IY = JXY(2) END IF RETURN C ENTRY GSFLP1() C ============= C C---- Reposition file at first record of picture 1 C MREC = 1 IELM = 1 CALL QSEEK(IUNITR,MREC,IELM,NRECL) RETURN C ENTRY GSFLBR(NBYTE) C ==================== C C---- Backspace nbyte bytes C CALL QBACK(IUNITR,NBYTE) RETURN C ENTRY GSFLSR(NBYTE) C ==================== C C---- Skip forward nbyte bytes C CALL QSKIP(IUNITR,NBYTE) RETURN C ENTRY GSFLWR(IARRAY,NBYTE) C =========================== C C---- Write an integer array of nbyte bytes C CALL QWRITE(IUNITR,IARRAY,NBYTE) RETURN C ENTRY GSFLRR(IARRAY,NBYTE,KKKEOF) C ================================== C C---- Read an integer array of nbyte bytes C KKKEOF = 0 IER = 0 CALL QREAD(IUNITR,IARRAY,NBYTE,IER) IF (IER.NE.0) KKKEOF = 1 C C---- Format statements C 6000 FORMAT (2X,'GSW/UHDR - HEADER: ',/2X,'NREC DOTMMX DOTMMY ', + I5,2F10.4,/2X,'IXMIN IXMAX IYMIN IYMAX ',4I6,/2X, + 'LINWT ','ICOLOR MIXCOL MDEVIC MDIREC ',5I5,/2X, + 'MOUT MPIC MSC','AFL MCNTFL ',4I5,/2X, + 'DWLIMX DWLIMY ',2F10.4,/2X,'DVXMIN', + ' DVXMAX DVYMIN DVYMAX ',4F10.4,/2X,'NPICS ',I5,' TITLE: ', + /1X,A,/2X,'PASWRD:',A) 6002 FORMAT (2X,'GSOFLW -PLOTFILE OPENED: NAME= ',A) 6004 FORMAT (2X,'GSRHDR -NOT A PLOT84 FILE: PASWRD= ',A) C END C C C SUBROUTINE GSPICT C ================== C C A.D. McLachlan JUN 1984. Last updated 2 OCT 1986 C C---- Routine to start a new picture on the plotter C C .. Scalar Arguments .. INTEGER NSEC C .. C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWBLMX,DWBLMY, + DWLIMX,DWLIMY,PAPLMX,PAPLMY,UBXMAX,UBXMIN,UBYMAX,UBYMIN, + V64LMX,V64LMY INTEGER ICOLOR,IDRLVL,IPRINT,IUNIT,IUNITR,IXMAX,IXMIN,IYMAX,IYMIN, + LINWT,LUNIN,LUNOUT,MCNTFL,MDEVIC,MDIREC,MIXCOL,MOUT,MPIC, + MSCAFL,NERROR,NPICS LOGICAL*4 DEVCON,INITON CHARACTER FILNAM*80,TITLE*80 C .. C .. Arrays in Common .. INTEGER AREC(128) REAL IREC C .. C .. Local Scalars .. INTEGER IDOT,IEND,IERAS,ILWT,IPAP,IPEN,ISTOP,IX,IY,MILSEC,NOUT CHARACTER CHKEY*1,PASWRD*8,GSNAM*40,TITLEH*80 C .. C .. External Subroutines .. EXTERNAL GSBLTM,GSCYTM,GSDVOF,GSDVON, + GSENVR,GSFLWI,GSGRTM,GSINTM, + GSLVCK,GSMYTM,GSSCTM,GSSTYL, + GSSUSP,GSTYTM,GSUHDR,GSUTRN, + GSWHDR C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE COMMON /GSFHD/IUNITR,IREC(128) ccx COMMON /GSFHD/ ccx + IUNIT, NREC, DOTMMX, DOTMMY, IXMIN, IXMAX, IYMIN, ccx + IYMAX, LINWT, ICOLOR, MIXCOLOR, MDEVIC, MDIREC, MOUT, ccx + MPIC, MSCAFL, MCNTFL, DWLIMX, DWLIMY, DVXMIN, DVXMAX, ccx + DVYMIN, DVYMAX, NPICS, ccx + PASWRD, ccx + SPARE1(15), ccx + TITLEH, ccx + SPARE2(68) C C .. Save Statement .. C SAVE C C .. Equivalences .. C EQUIVALENCE (IREC(1),AREC(1)) EQUIVALENCE (TITLEH,IREC(41)) EQUIVALENCE (PASWRD,IREC(24)) C .. C .. Data statements .. C C---- Command codes plotfile (only iend used here) C DATA CHKEY/' '/ DATA IEND/-1/,IDOT/-2/,ILWT/-3/,IPEN/-4/,IPAP/-5/,IERAS/-6/ C C---- Begin the next picture check level C IF ((IDRLVL.LT.1) .OR. (IDRLVL.EQ.3)) + CALL GSLVCK('GSPICT') C C---- Set the environment C CALL GSENVR C C---- Clear user transformation C CALL GSUTRN C C---- Set style defaults for colour etc C CALL GSSTYL IF (IPRINT.GE.2) WRITE (LUNOUT,FMT=6012) MDEVIC,MDIREC C C---- Switch on device C IF (.NOT.DEVCON) THEN NOUT = MOUT GSNAM = FILNAM CALL GSDVON(GSNAM,NOUT) END IF C C---- Set level as "drawing on" C IDRLVL = 3 C IF (MDIREC.EQ.1) THEN GO TO (20,20,10) MDEVIC C C---- Clear terminal screen and switch on C 10 CONTINUE MPIC = MPIC + 1 NPICS = MPIC CALL GSINTM(MOUT) C C---- Graphics vector mode C CALL GSGRTM ELSE C C---- Undefined or paper C---- Start the picture C MPIC = MPIC + 1 NPICS = MPIC C C---- Reset plot ranges to nonsense values C IXMAX = 0 IXMIN = 32767 IYMAX = 0 IYMIN = 32767 CALL GSWHDR END IF C C---- Clear out-of-bounds errors C 20 NERROR = 0 RETURN C ENTRY GSWAIT(NSEC) C =================== C C---- Pause between pictures up to 1 minute check level C IF ((IDRLVL.EQ.0) .OR. (IDRLVL.EQ.3)) + CALL GSLVCK('GSWAIT') IF (MDIREC.NE.0) THEN GO TO (50,50,30) MDEVIC C C---- Terminal C 30 CONTINUE IF (NSEC.GT.60) NSEC = 60 CALL GSTYTM C C---- Timed pause followed by clearance C IF (NSEC.GT.0) THEN MILSEC = NSEC*1000 CALL GSSUSP(MILSEC) CALL GSSCTM CALL GSTYTM CALL GSCYTM CALL GSMYTM(0,23) ELSE C C---- Ask to clear screen or not C terminal. write a message at bottom left and wait for character C then clear screen if not blank or return ring bell C CALL GSBLTM CALL GSTYTM CALL GSCYTM WRITE (LUNOUT,FMT=6002) READ (LUNIN,FMT=6004) CHKEY IF (CHKEY.NE.' ') THEN CALL GSINTM(MOUT) CALL GSTYTM ELSE CALL GSCYTM CALL GSMYTM(0,23) END IF END IF RETURN ELSE IF (IPRINT.GE.1) THEN WRITE (LUNOUT,FMT=6000) MPIC RETURN ELSE RETURN END IF C ENTRY GSENDP() C ================ C C---- End current picture C ISTOP = 0 IF (IDRLVL.NE.3) CALL GSLVCK('GSENDP') GO TO 40 C ENTRY GSSTOP() C ============= C C---- Terminate this series of plots C ISTOP = 1 C C---- Check level and switch off device if picture already complete C 40 IF (IDRLVL.EQ.3) THEN C C---- Terminate current picture C---- Reset out-of-bounds count C IF ((NERROR.GT.0) .AND. (IPRINT.GE.1)) WRITE (LUNOUT, + FMT=6008) NERROR NERROR = 0 IF (MDIREC.NE.1) THEN C C---- Deferred plot using plotfile C IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6006) MPIC C C---- Update plotfile header C IX = IEND IY = 1 CALL GSFLWI(IX,IY) NPICS = MPIC CALL GSUHDR C C---- Interactive plot do not clear screen C ELSE IF (MDEVIC.EQ.3) THEN CALL GSTYTM CALL GSCYTM CALL GSMYTM(0,23) END IF C IF (ISTOP.EQ.0) THEN IDRLVL = 1 RETURN END IF END IF C C---- Switch off device C CALL GSDVOF C C---- Set level for init required C IDRLVL = 0 C C---- Format statements C 6000 FORMAT (2X,'PLOT: End of picture number ',I5) 6002 FORMAT (2X,'Type any character to clear screen ',/2X,'""RETURN" ', + 'or "SPACE" to save ') 6004 FORMAT (A,A) 6006 FORMAT (2X,'END PLOT: Picture number ',I5) 6008 FORMAT (2X,'Number of out-of-bounds plot errors: ',I8) 6012 FORMAT (2X,'GSPICT: MDEVIC MDIREC = ',2I5) C 50 CONTINUE END C C C SUBROUTINE GSPRTM(ITERM,NRWMIN,NRWMAX) C ======================================= C C---- Vt640 dump to dot matrix printer. C C A.D. McLachlan SEP 1984. Last updated 21 SEP 1984. C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were NBIT0, ZERO C and the followig BYTEs to INTEGER: BYTE1, NBYTE, BITS, SIXBIT, C XBIT, SCREEN C C ITERM = fortran unit number for terminal in graphics package C NRWMIN = min line number for bottom of display dump C NRWMAX = max line number for top of display dump C the whole screen goes from 0 to 479 (bottom to top) C in physical dot units. C C This program works by reading lines in groups of three. C The given values of nrwmin and nrwmax will therefore be C rounded to 3*n-1 and 3*m. C C The 4010 memory coords (0-1023 in x, 0-780 in y) C are NOT USED here. C This routine uses the physical dot display range C (0-639 in x, 0-479 in y). C The origin is always at the bottom left hand corner of the screen. C C .. Scalar Arguments .. INTEGER ITERM,NRWMAX,NRWMIN C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. REAL SECTOT,SSTAGE INTEGER I,ICOLOR,IOFLAG,ITPRNT,J,K,NBIT6,NBITS,NBXOFF,NBXWID, + NCMAX,NCMIN,NCWID,NROW INTEGER BYTE1,NBYTE CHARACTER*1 NBIT0,ZERO C .. C .. Local Arrays .. INTEGER BITS(642),SIXBIT(107),XBIT(0:5) INTEGER SCREEN(0:127,0:479) C .. C .. External Subroutines .. EXTERNAL CLOSETRIPLOT,INITRIPLOT,GSBFTM, + GSGRTM,GSRDTM,GSSUSP, + GSTIM0,GSTIMR,TRICOLOUR,TRIPLOTC C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C C .. Data statements .. DATA XBIT/1,2,4,6,16,32/ DATA BYTE1/1/ C ZERO = CHAR(0) NBIT0 = CHAR(0) ITPRNT = 0 CALL GSTIM0(ITPRNT) C C---- Put vt640 in graphics mode and clear buffer of vt640 C CALL GSGRTM CALL GSBFTM(ITERM,ZERO) C C---- Call up trilog routines C IOFLAG = 1 CALL INITRIPLOT(2,'SCREEN.LIS',IOFLAG) ICOLOR = 4 CALL TRICOLOUR(ICOLOR) C C---- Read from vt640 memory C 5-bit chars + octal 100 in each byte. loaded to the right. C arranged in 128 columns of 5 dots wide. cols numbered (0:127) C and 480 rows of one dot high numbered (0:479) C origin (0,0) at bottom left of screen C C---- Screen limits to read C---- Set row limits to 3n-1 and 3m C read 3 lines at a time C if nlines.gt.1 then must read whole rows of 128 cols C IF (NRWMAX.GT.479) NRWMAX = 479 IF (NRWMAX.LE.0) NRWMAX = 479 NRWMAX = ((NRWMAX+3)/3)*3 - 1 IF (NRWMIN.GE.NRWMAX) NRWMIN = 0 IF (NRWMIN.LT.0) NRWMIN = 0 NRWMIN = (NRWMIN/3)*3 CALL GSRDTM(ITERM,NRWMIN,NRWMAX,SCREEN) C C---- Translate row by row into trilog code C C---- Number of bits read is 5*number of columns i.e. 640 C number of bits sent to trilog is multiple of 6 which C covers this i.e. 642 packed in 107 bytes C NCWID = 128 NCMIN = 0 NCMAX = 128 NBITS = 5*NCWID NBIT6 = (NBITS-1)/6 + 1 NBITS = NBIT6*6 C C---- Clear translation array C DO 10 I = 1,NBITS BITS(I) = ICHAR(NBIT0) 10 CONTINUE C C---- Start rows C DO 60 NROW = NRWMAX,NRWMIN,-1 C C---- Convert to bit stream C K = 0 DO 30 I = NCMIN,NCMAX NBYTE = SCREEN(I,NROW) K = K + 5 DO 20 J = 0,4 CCC BITS(K-J) = NBYTE .AND. BYTE1 BITS(K-J) = IAND(NBYTE, BYTE1) NBYTE = NBYTE/2 20 CONTINUE 30 CONTINUE C C---- Convert to 6-bit chars+octal 100 for trilog C K = 0 DO 50 I = 1,NBIT6 NBYTE = 64 DO 40 J = 0,5 K = K + 1 CCC IF (BITS(K).EQ.1) NBYTE = NBYTE .OR. XBIT(J) IF (BITS(K).EQ.1) NBYTE = IOR(NBYTE, XBIT(J)) 40 CONTINUE SIXBIT(I) = NBYTE 50 CONTINUE C C---- Control line for trilog printer C NBXWID = NBIT6 NBXOFF = 10 CALL TRIPLOTC(SIXBIT,NBXWID,NBXOFF) 60 CONTINUE C C---- Finish with trilog C CALL CLOSETRIPLOT CALL GSTIMR(SECTOT,SSTAGE,ITPRNT) WRITE (LUNOUT,FMT=6004) SECTOT CALL GSSUSP(1000) C C---- Format statements C 6004 FORMAT (2X,'GSPRTM: Trilog complete . cpu sec = ',F8.2) C END C C C SUBROUTINE GSQUIK C =================== C C---- Routine to do plotting under keyboard control C C A.D. McLachlan JUL 1984. Last updated 28 SEP 1984 C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were HCHAR, HTEXT C and the followig BYTEs to INTEGER: IARRAY C C NTERM = 0,1 for plotting off or on terminal C NCMFIL = 0,1 for commands interactively or from command file C PRINT = .true. .false. for printing prompts at each command C C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. REAL ANGFAC,ANGLE,AXLEN,CHANGX,CHANGY,CHORGX,CHORGY,CHRSCX,CHRSCY, + CHRSPX,CHRSPY,CWID,DTMMX,DTMMY,DV,DVLMX1,DVLMX2,DVLMY1, + DVLMY2,DWLIM1,DWLIM2,DWLMX1,DWLMX2,DWLMY1,DWLMY2,DX,DY,ENUM, + FNUM,FVAL,HGT,PI,PLENG,SCAFAC,SCALEX,SCALEY,SIZ1,SIZ2,SIZX, + SIZY,USANGX,USANGY,VBXMAX,VBXMIN,VBYMAX,VBYMIN,X,XANCH,XBOLD, + XCGAP,XCOFF,XCSTRT,XLEFT,XOLD,XORIG,XRIGHT,Y,YANCH,YBOLD, + YCDOWN,YCOFF,YCSTRT,YHIGH,YLOW,YOLD,YORIG INTEGER I,ICENTC,ICLINK,ICMODE,ICOLR,IERR,INUM,IPRINT,ISCALE, + ISYMB,IUNITP,IUSPCE,IX,IY,J,JJJ,KEOF,KFONT,KKEOF,KKKEOF, + LETTER,LINSIZ,LWT,MCOLOR,NAFTER,NBYTE,NC,NCHAR,NCHARS, + NCMFIL,NCNTFL,NCOUNT,NDEVIC,NDIG,NDIGIT,NDIREC,NFONT, + NGROUP,NIND,NINTER,NJUST,NLENG,NLETT,NMEMB,NOCENT,NOPRNT, + NOUT,NSCAFL,NSEC,NSET,NSTART,NSYMB,NTERM,NSCAFLNCNTFL CHARACTER*1 HCHAR LOGICAL PRINT CHARACTER CHAR1*1,KEYWF*4,WORD*4,BLANK80*80, + FILNAM*80,LISFIL*80,GSFIL*80,TEXT*80,TITLE*80,KEYWRD*1005 C .. C .. Local Arrays .. REAL P(2),Q(2),TMAT(2,2) INTEGER*4 ITEXT4(80),NTRSAV(48),KARRAY(128) REAL IARRAY(128) CHARACTER*1 HTEXT(80) INTEGER*2 ITEXT2(80) CHARACTER KEY5(200)*5 EQUIVALENCE (KARRAY(1), IARRAY(1)) C .. C .. External Functions .. INTEGER LENSTR EXTERNAL LENSTR C .. C .. External Subroutines .. EXTERNAL AXIS,CSTRING,NUMBER,GSANCD,GSANCU,GSBSIZ, + GSCENC,GSCETS,GSCETX,GSCFIL,GSCFSZ, + GSCMAT,GSCMOD,GSCOLR,GSCROT,GSCSPA, + GSCSPU,GSDDRB,GSDOTB,GSDTRN,GSDVIC, + GSDVOF,GSDVON,GSDVPT,GSDWBY,GSDWTO, + GSEBSZ,GSEDTR,GSEDVC,GSEDVP,GSENDP, + GSENUM,GSENVR,GSERAS,GSERAX,GSEREV, + GSEWND,GSEWSC,GSFCUR,GSFLBR,GSFLP1, + GSFLRI,GSFLRR,GSFLSR,GSFLWI,GSFLWR, + GSFNUM,GSFONT,GSGCH0,GSGCHC,GSGCHF EXTERNAL GSGCHH,GSGCHI,GSGCHS,GSGSY0,GSGSYC, + GSGSYM,GSGSYS,GSHAIR,GSINIT,GSINUM, + GSLINE,GSLNFD,GSLNWT,GSLVCK,GSMDRB, + GSMIXC,GSMVBY,GSMVTO,GSOFLR,GSOFLW, + GSORGC,GSORGD,GSORGU,GSPAPR,GSPCUR, + GSPICT,GSPOIN,GSPRNT,GSRFNT,GSRHDR, + GSSCLC,GSSCLU,GSSCUR,GSSTOP,GSSTR2, + GSSTR4,GSSTRC,GSSTRD,GSSTRH,GSSTRS, + GSSTRU,GSSTYL,GSTITL,GSTLNK,GSTRES, + GSTRIL,GSTSAV,GSTYOF,GSTYON,GSUHDR, + GSUMAT,GSUROT,GSUTRN,GSVIEW,GSWAIT, + GSWHDR,GSWNDB,GSWSCL,GSXENV,STRING,SYMBOL C .. C .. Intrinsic Functions .. INTRINSIC ATAN2,CHAR,INDEX,MOD C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (KEYWRD(5:5),KEY5(1)) EQUIVALENCE (KEYWF,KEYWRD) C .. C .. Data statements .. DATA KEYWF/' '/ DATA (KEY5(JJJ),JJJ=1,20)/'INIT','TITL','PRNT','ENVR','XENV', + 'DVIC','BSIZ','DVPT','WNDB','WSCL','DTRN','EDVC','EBSZ', + 'EDVP','EWND','EWSC','EDTR','RFNT','LVCK','PICT'/ DATA (KEY5(JJJ),JJJ=21,40)/'WAIT','ENDP','STOP','DVON','DVOF', + 'OFLW','OFLR','CFIL','FLWI','FLRI','WHDR','RHDR','UHDR', + 'FLP1','FLBR','FLSR','FLWR','FLRR','UTRN','SCLU'/ DATA (KEY5(JJJ),JJJ=41,60)/'UROT','UMAT','ORGD','ORGU','SCLC', + 'CROT','CMAT','ORGC','MUCT','TLNK','CMOD','CSPA','ANCD', + 'ANCU','FCUR','PCUR','LNFD','CENC','STYL','LNWT'/ DATA (KEY5(JJJ),JJJ=61,80)/'COLR','PAPR','FONT','ERAS','ERAX', + 'GCH0','GSY0','GCHF','GCHC','GCHI','GCHH','GSYM','INUM', + 'FNUM','ENUM','STRC','STRH','STR2','STR4','STRD'/ DATA (KEY5(JJJ),JJJ=81,100)/'STRU','CFSZ','CLPL','CLPT','CLTS', + 'SWLN','DWTO','DWBY','MVTO','MVBY','POIN','DDRB','MDRB', + 'DOTB','LRAS','LRSB','TEXT','VIEW','TRIL','QUIT'/ DATA (KEY5(JJJ),JJJ=101,120)/'VCLN','CETX','SCUR','GSYS','GSYC', + 'PROM','CETS','GCHS','STRS','MIXC','NUMB','SYMB','AXIS', + 'STNG','CSTN','NOPR','CSPU','TSAV','TRES','EREV'/ DATA (KEY5(JJJ),JJJ=121,130)/'HAIR','CMFL','LINE','TERM',' ', + ' ',' ',' ',' ',' '/ DATA (KEY5(JJJ),JJJ=131,200)/70*' '/ DATA BLANK80/' '/ DATA KARRAY/1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.,13., + 14.,15.,16.,112*0./ C PI = ATAN2(1.0,1.0)*4.0 ANGFAC = PI/180.0 C NTERM = 0 NCMFIL = 0 PRINT = .TRUE. NCOUNT = 0 10 CONTINUE NCOUNT = NCOUNT + 1 IF (PRINT) CALL NOCRLF (' >>>>') C C---- Check for control word with or without data C READ (LUNIN,FMT=6318) WORD CALL CCPUPC(WORD) C C---- Assign keyword to subgroup and member C NIND = INDEX(KEYWRD,WORD)/5 IF (NIND.EQ.0) THEN WRITE (LUNOUT,FMT=6304) WORD GO TO 10 ELSE IF (NIND.EQ.100) THEN GO TO 1390 ELSE C C---- Organise keys in groups of 10 C NGROUP = (NIND-1)/10 + 1 NMEMB = MOD(NIND-1,10) + 1 GO TO (20,130,240,350,460,570,680,790,900, + 1010,1110,1220,1330) NGROUP C C---- Keys(1-10) C 'INIT','TITL','PRNT','ENVR','XENV', C 'DVIC','BSIZ','DVPT','WNDB','WSCL', C 20 CONTINUE GO TO (30,40,50,60,70,80,90,100,110, + 120) NMEMB C C---- (( init )) C 30 CONTINUE IF (PRINT) CALL NOCRLF (' FILNAM(.PLT ASSUMED)...=') READ (LUNIN,FMT=6306) FILNAM C C---- Remove trailing blanks C NLENG = LENSTR(FILNAM) C C---- Construct .PLT file name C IF (NLENG.LT.1) THEN FILNAM = 'quick.plt' ELSE FILNAM = FILNAM(1:NLENG)//'.plt' END IF IF (.NOT.PRINT) WRITE (LUNOUT,FMT=6002) FILNAM CALL GSINIT(FILNAM) IF (NTERM.EQ.1) CALL GSDVIC(1,3) GO TO 10 C C---- (( titl )) C 40 CONTINUE IF (PRINT) CALL NOCRLF (' TITLE=...') READ (LUNIN,FMT=6306) TITLE IF (INDEX(TITLE,BLANK80).EQ.1) TITLE = 'QUICK' CALL GSTITL(TITLE) GO TO 10 C C---- (( prnt )) C 50 CONTINUE IF (PRINT) CALL NOCRLF (' IPRINT ......................=') READ (LUNIN,FMT=6308) IPRINT CALL GSPRNT(IPRINT) GO TO 10 C C---- (( envr )) C 60 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6008) CALL GSENVR GO TO 10 C C---- (( xenv )) C 70 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6010) CALL GSXENV GO TO 10 C C---- (( dvic )) C 80 CONTINUE IF (PRINT) CALL NOCRLF (' NDIREC NDEVIC ..................=') READ (LUNIN,FMT=*) NDIREC,NDEVIC CALL GSDVIC(NDIREC,NDEVIC) IF (NDIREC.EQ.1) THEN NTERM = 1 ELSE NTERM = 0 END IF GO TO 10 C C---- (( bsiz )) C 90 CONTINUE IF (PRINT) CALL NOCRLF (' DWLIMX,DWLIMY ..................=') READ (LUNIN,FMT=*) DWLIM1,DWLIM2 CALL GSBSIZ(DWLIM1,DWLIM2) GO TO 10 C C---- (( dvpt )) C 100 CONTINUE IF (PRINT) CALL NOCRLF (' DVXMIN DVXMAX DVYMIN DVYMAX ....=') READ (LUNIN,FMT=*) DVLMX1,DVLMX2,DVLMY1,DVLMY2 CALL GSDVPT(DVLMX1,DVLMX2,DVLMY1,DVLMY2) GO TO 10 C C---- (( wndb )) C 110 CONTINUE IF (PRINT) CALL NOCRLF (' VBXMIN VBXMAX VBYMIN VBYMAX ....=') READ (LUNIN,FMT=*) VBXMIN,VBXMAX,VBYMIN,VBYMAX CALL GSWNDB(VBXMIN,VBXMAX,VBYMIN,VBYMAX) GO TO 10 C C---- (( wscl )) C 120 CONTINUE IF (PRINT) CALL NOCRLF (' NSCAFL,NCNTFL ..................=') READ (LUNIN,FMT=*) NSCAFL,NCNTFL CALL GSWSCL(NSCAFL,NCNTFL) GO TO 10 C C---- keys(11-20) C 'DTRN','EDVC','EBSZ','EDVP','EWND', C 'EWSC','EDTR','RFNT','LVCK','PICT', C 130 CONTINUE GO TO (140,150,160,170,180,190,200,210,220, + 230) NMEMB C C---- (( dtrn )) C 140 CONTINUE IF (PRINT) CALL NOCRLF (' DOTMMX DOTMMY ...................=') READ (LUNIN,FMT=*) DTMMX,DTMMY CALL GSDTRN(DTMMX,DTMMY) GO TO 10 C C---- (( edvc )) C 150 CONTINUE IF (PRINT) CALL NOCRLF (' NDIREC NDEVIC ...................=') READ (LUNIN,FMT=*) NDIREC,NDEVIC CALL GSEDVC(NDIREC,NDEVIC,DWLIM1,DWLIM2,DWLMX1,DWLMX2, + DWLMY1,DWLMY2) IF (PRINT) WRITE (LUNOUT,FMT=6026) DWLIM1,DWLIM2 IF (PRINT) WRITE (LUNOUT,FMT=6028) DWLMX1,DWLMX2,DWLMY1,DWLMY2 GO TO 10 C C---- (( ebsz )) C 160 CONTINUE IF (PRINT) CALL NOCRLF (' DWLIMX DWLIMY ...................=') READ (LUNIN,FMT=*) DWLIM1,DWLIM2 CALL GSEBSZ(DWLIM1,DWLIM2) GO TO 10 C C---- (( edvp )) C 170 CONTINUE IF (PRINT) CALL NOCRLF (' DVXMIN DVXMAX DVYMIN DVYMAX .....=') READ (LUNIN,FMT=*) DVLMX1,DVLMX2,DVLMY1,DVLMY2 CALL GSEDVP(DVLMX1,DVLMX2,DVLMY1,DVLMY2,VBXMIN,VBXMAX, + VBYMIN,VBYMAX) IF (PRINT) WRITE (LUNOUT,FMT=6034) VBXMIN,VBXMAX,VBYMIN,VBYMAX GO TO 10 C C---- (( ewnd )) C 180 CONTINUE IF (PRINT) CALL NOCRLF (' VBXMIN VBXMAX VBYMIN VBYMAX ......=') READ (LUNIN,FMT=*) VBXMIN,VBXMAX,VBYMIN,VBYMAX CALL GSEWND(VBXMIN,VBXMAX,VBYMIN,VBYMAX) GO TO 10 C C---- (( ewsc )) C 190 CONTINUE IF (PRINT) CALL NOCRLF (' NSCAFL NCNTFL ....................=') READ (LUNIN,FMT=*) NSCAFLNCNTFL CALL GSEWSC(NSCAFL,NCNTFL) GO TO 10 C C----- (( edtr )) C 200 CONTINUE IF (PRINT) CALL NOCRLF (' DOTMMX DOTMMY ....................=') READ (LUNIN,FMT=*) DTMMX,DTMMY CALL GSEDTR(DTMMX,DTMMY) GO TO 10 C C----- (( rfnt )) C 210 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6042) CALL GSRFNT GO TO 10 C C----- (( lvck )) C 220 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6044) CALL GSLVCK('DUMMY') GO TO 10 C C---- (( pict )) C 230 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6046) CALL GSPICT C C---- for interactive plots use GStyon to get out of vector mode C and receive instructions C CALL GSTYON GO TO 10 C C---- keys(21-30) C 'WAIT','ENDP','STOP','DVON','DVOF', C 'OFLW','OFLR','CFIL','FLWI','FLRI', C 240 CONTINUE GO TO (250,260,270,280,290,300,310,320,330, + 340) NMEMB C C---- (( wait )) C 250 CONTINUE IF (PRINT) CALL NOCRLF (' NSEC .......................=') READ (LUNIN,FMT=*) NSEC CALL GSWAIT(NSEC) GO TO 10 C C---- (( endp )) C 260 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6050) CALL GSENDP CALL GSTYON GO TO 10 C C---- (( stop )) C 270 CONTINUE CALL GSSTOP CALL GSTYON GO TO 10 C C---- (( dvon )) C 280 CONTINUE IF (PRINT) CALL NOCRLF (' FILNAM ....=') READ (LUNIN,FMT=6306) FILNAM IF (INDEX(FILNAM,BLANK80).EQ.1) FILNAM = 'quick.plt' IF (PRINT) CALL NOCRLF (' NOUT ......................=') READ (LUNIN,FMT=6308) NOUT CALL GSDVON(FILNAM,NOUT) CALL GSTYON GO TO 10 C C---- (( dvof )) C 290 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6058) CALL GSDVOF CALL GSTYON GO TO 10 C C---- (( oflw )) C 300 CONTINUE IF (PRINT) CALL NOCRLF (' FILNAM ....=') READ (LUNIN,FMT=6306) FILNAM IF (INDEX(FILNAM,BLANK80).EQ.1) FILNAM = 'quick.plt' CALL GSOFLW(IUNITP,FILNAM) IF (PRINT) WRITE (LUNOUT,FMT=6062) IUNITP GO TO 10 C C---- (( oflr )) C 310 CONTINUE IF (PRINT) CALL NOCRLF (' FILNAM ....=') READ (LUNIN,FMT=6306) FILNAM IF (INDEX(FILNAM,BLANK80).EQ.1) FILNAM = 'quick.plt' CALL GSOFLR(IUNITP,FILNAM) IF (PRINT) WRITE (LUNOUT,FMT=6066) IUNITP GO TO 10 C C---- (( cfil )) C 320 CONTINUE IF (PRINT) CALL NOCRLF (' IUNITP .......................=') READ (LUNIN,FMT=6308) IUNITP CALL GSCFIL(IUNITP) GO TO 10 C C---- (( flwi )) C 330 CONTINUE IF (PRINT) CALL NOCRLF (' IX IY .........................=') READ (LUNIN,FMT=*) IX,IY CALL GSFLWI(IX,IY) GO TO 10 C C---- (( flri )) C 340 CONTINUE IF (PRINT) CALL NOCRLF (' IX IY .........................=') READ (LUNIN,FMT=*) IX,IY KKEOF = 0 CALL GSFLRI(IX,IY,KKEOF) IF (KKEOF.EQ.1) THEN IF (PRINT) WRITE (LUNOUT,FMT=6074) END IF GO TO 10 C 350 CONTINUE C C---- keys(31-40) C 'WHDR','RHDR','UHDR','FLP1','FLBR', C 'FLSR','FLWR','FLRR','UTRN','SCLU', C GO TO (360,370,380,390,400,440,450,410,420, + 430) NMEMB C C---- (( whdr )) C 360 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6076) CALL GSWHDR GO TO 10 C C---- (( rhdr )) C 370 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6080) KEOF = 0 CALL GSRHDR(KEOF) IF (KEOF.EQ.1) THEN IF (PRINT) WRITE (LUNOUT,FMT=6078) END IF GO TO 10 C C---- (( uhdr )) C 380 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6082) CALL GSUHDR GO TO 10 C C---- (( flp1 )) C 390 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6084) CALL GSFLP1 GO TO 10 C C---- (( flbr )) C 400 CONTINUE IF (PRINT) CALL NOCRLF (' NBYTE ........................=') READ (LUNIN,FMT=6308) NBYTE CALL GSFLBR(NBYTE) GO TO 440 C C---- (( flrr )) C 410 CONTINUE IF (PRINT) CALL NOCRLF (' ARRAY VALUES READ: NBYTE(128 MAX)=') READ (LUNIN,FMT=6308) NBYTE KKKEOF = 0 CALL GSFLRR(IARRAY,NBYTE,KKKEOF) IF (KKKEOF.EQ.1) THEN IF (PRINT) WRITE (LUNOUT,FMT=6094) END IF GO TO 10 C C---- (( utrn )) C 420 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6096) CALL GSUTRN GO TO 10 C C---- (( sclu )) C 430 CONTINUE IF (PRINT) CALL NOCRLF (' SCALEX SCALEY ................=') READ (LUNIN,FMT=*) SCALEX,SCALEY CALL GSSCLU(SCALEX,SCALEY) GO TO 10 C C---- (( flsr )) C 440 CONTINUE CALL GSFLSR(NBYTE) READ (LUNIN,FMT=6308) NBYTE C C---- (( flwr )) C 450 CONTINUE IF(PRINT)CALL NOCRLF(' ARRAY VALUES WRITTEN: NBYTE(128 MAX)=') READ (LUNIN,FMT=6308) NBYTE CALL GSFLWR(IARRAY,NBYTE) GO TO 10 C 460 CONTINUE C C---- keys(41-50) C 'UROT','UMAT','ORGD','ORGU','SCLC', C 'CROT','CMAT','ORGC','MUCT','TLNK', C GO TO (470,480,490,500,510,520,530,540,550, + 560) NMEMB C C---- (( urot )) C 470 CONTINUE IF (PRINT) CALL NOCRLF (' USANGX,USANGY ..................=') READ (LUNIN,FMT=*) USANGX,USANGY CALL GSUROT(USANGX*ANGFAC,USANGY*ANGFAC) GO TO 10 C C---- (( umat )) C 480 CONTINUE IF (PRINT) CALL NOCRLF (' UMAT(1,1) (1,2) (2,1) (2,2) ....=') READ (LUNIN,FMT=*) TMAT(1,1),TMAT(1,2),TMAT(2,1),TMAT(2,2) CALL GSUMAT(TMAT) GO TO 10 C C---- (( orgd )) C 490 CONTINUE IF (PRINT) CALL NOCRLF (' XORIGD YORIGD ..................=') READ (LUNIN,FMT=*) XORIG,YORIG CALL GSORGD(XORIG,YORIG) GO TO 10 C C---- (( orgu )) C 500 CONTINUE IF (PRINT) CALL NOCRLF (' XORIGU YORIGU ..................=') READ (LUNIN,FMT=*) XORIG,YORIG CALL GSORGU(XORIG,YORIG) GO TO 10 C C---- (( sclc )) C 510 CONTINUE IF (PRINT) CALL NOCRLF (' CHRSCX CHRSCY ..................=') READ (LUNIN,FMT=*) CHRSCX,CHRSCY CALL GSSCLC(CHRSCX,CHRSCY) GO TO 10 C C---- (( crot )) C 520 CONTINUE IF (PRINT) CALL NOCRLF (' CHANGX CHANGY ..................=') READ (LUNIN,FMT=*) CHANGX,CHANGY CALL GSCROT(CHANGX*ANGFAC,CHANGY*ANGFAC) GO TO 10 C C---- (( cmat )) C 530 CONTINUE IF (PRINT) CALL NOCRLF (' CMAT(1,1) (1,2) (2,1) (2,2) ....=') READ (LUNIN,FMT=*) TMAT(1,1),TMAT(1,2),TMAT(2,1),TMAT(2,2) CALL GSCMAT(TMAT) GO TO 10 C C---- (( orgc )) C 540 CONTINUE IF (PRINT) CALL NOCRLF (' CHORGX CHORGY ..................=') READ (LUNIN,FMT=*) CHORGX,CHORGY CALL GSORGC(CHORGX,CHORGY) GO TO 10 C C---- (( tlnk )) C 550 CONTINUE GO TO 10 560 IF (PRINT) CALL NOCRLF (' ICLINK (0)(1) ..................=') READ (LUNIN,FMT=6308) ICLINK CALL GSTLNK(ICLINK) GO TO 10 C 570 CONTINUE C C---- Keys(51-60) C 'CMOD','CSPA','ANCD','ANCU','FCUR', C 'PCUR','LNFD','CENC' 'STYL','LNWT', C GO TO (580,590,600,610,620,630,640,650,660, + 670) NMEMB C C---- (( cmod )) C 580 CONTINUE IF (PRINT) CALL NOCRLF (' ICMODE (0)(1) ..................=') READ (LUNIN,FMT=*) ICMODE CALL GSCMOD(ICMODE) GO TO 10 C C---- (( cspa )) C 590 CONTINUE IF (PRINT) CALL NOCRLF (' CHRSPX CHRSPY ..................=') READ (LUNIN,FMT=*) CHRSPX,CHRSPY CALL GSCSPA(CHRSPX,CHRSPY) GO TO 10 C C---- (( ancd )) C 600 CONTINUE IF (PRINT) CALL NOCRLF (' XANCHD YANCHD ..................=') READ (LUNIN,FMT=*) XANCH,YANCH CALL GSANCD(XANCH,YANCH) GO TO 10 C C---- (( ancu )) C 610 CONTINUE IF (PRINT) CALL NOCRLF (' XANCHU YANCHU ..................=') READ (LUNIN,FMT=*) XANCH,YANCH CALL GSANCU(XANCH,YANCH) GO TO 10 C C---- (( fcur )) C 620 CONTINUE CALL GSFCUR(XCSTRT,YCSTRT) IF (PRINT) WRITE (LUNOUT,FMT=6128) XCSTRT,YCSTRT GO TO 10 C C---- (( pcur )) C 630 CONTINUE IF (PRINT) CALL NOCRLF (' XCSTRT,YCSTRT ..................=') READ (LUNIN,FMT=*) XCSTRT,YCSTRT CALL GSPCUR(XCSTRT,YCSTRT) GO TO 10 C C---- (( lnfd )) C 640 CONTINUE IF (PRINT) CALL NOCRLF (' YCDOWN .........................=') READ (LUNIN,FMT=*) YCDOWN CALL GSLNFD(YCDOWN) GO TO 10 C C---- (( cenc )) C 650 CONTINUE IF (PRINT) CALL NOCRLF (' ICENTC (0)(1)...................=') READ (LUNIN,FMT=6308) ICENTC CALL GSCENC(ICENTC) GO TO 10 C C---- (( styl )) C 660 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6136) CALL GSSTYL GO TO 10 C C---- (( lnwt )) C 670 CONTINUE IF (PRINT) CALL NOCRLF (' LWT(1-9) .......................=') READ (LUNIN,FMT=6308) LWT CALL GSLNWT(LWT) GO TO 10 C 680 CONTINUE C C---- Keys(61-70) C 'COLR','PAPR','FONT','ERAS','ERAX', C 'GCH0','GSY0','GCHF','GCHC','GCHI', C GO TO (690,700,710,720,730,740,750,760,770, + 780) NMEMB C C---- (( colr )) C 690 CONTINUE IF (PRINT) CALL NOCRLF (' ICOLR ..........................=') READ (LUNIN,FMT=6308) ICOLR CALL GSCOLR(ICOLR) GO TO 10 C C---- (( papr )) C 700 CONTINUE IF (PRINT) CALL NOCRLF (' PLENG(MM).......................=') READ (LUNIN,FMT=*) PLENG CALL GSPAPR(PLENG) GO TO 10 C C---- (( font )) C 710 CONTINUE IF (PRINT) CALL NOCRLF (' NFONT (0-4) ....................=') READ (LUNIN,FMT=6308) NFONT CALL GSFONT(NFONT) GO TO 10 C C---- (( eras )) C 720 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6148) CALL GSTYOF CALL GSERAS CALL GSTYON GO TO 10 C C---- (( erax )) C 730 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6150) CALL GSTYOF CALL GSERAX CALL GSTYON GO TO 10 C C---- (( gch0 )) C 740 CONTINUE IF(PRINT) CALL NOCRLF(' LETTER(32-96) XCOFF YCOFF SIZX SIZY=') READ (LUNIN,FMT=*) LETTER,XCOFF,YCOFF,SIZX,SIZY CALL GSTYOF CALL GSGCH0(LETTER,XCOFF,YCOFF,SIZX,SIZY) CALL GSTYON GO TO 10 C C---- (( gsy0 )) C 750 CONTINUE IF(PRINT) CALL NOCRLF(' ISYMB(1-32) XCOFF YCOFF SIZX SIZY =') READ (LUNIN,FMT=*) ISYMB,XCOFF,YCOFF,SIZX,SIZY CALL GSTYOF CALL GSGSY0(ISYMB,XCOFF,YCOFF,SIZX,SIZY) CALL GSTYON GO TO 10 C C---- (( gchf )) C 760 CONTINUE IF (PRINT) + CALL NOCRLF (' LETTER(1-146) XCOFF YCOFF SIZX SIZY KFONT=') READ (LUNIN,FMT=*) LETTER,XCOFF,YCOFF,SIZX,SIZY,KFONT CALL GSTYOF CALL GSGCHF(LETTER,XCOFF,YCOFF,SIZX,SIZY,KFONT) CALL GSTYON GO TO 10 C C---- (( gchc )) C 770 CONTINUE IF (PRINT) CALL NOCRLF (' CHAR1 ..........................=') READ (LUNIN,FMT=6312) CHAR1 IF (PRINT) CALL NOCRLF (' XCOFF YCOFF KFONT ..............=') READ (LUNIN,FMT=*) XCOFF,YCOFF,KFONT CALL GSTYOF CALL GSGCHC(CHAR1,XCOFF,YCOFF,KFONT) CALL GSTYON GO TO 10 C C---- (( gchi )) C 780 CONTINUE IF (PRINT) CALL NOCRLF (' LETTER(NUM) XCOFF YCOFF KFONT ..=') READ (LUNIN,FMT=*) LETTER,XCOFF,YCOFF,KFONT CALL GSTYOF CALL GSGCHI(LETTER,XCOFF,YCOFF,KFONT) CALL GSTYON GO TO 10 C 790 CONTINUE C C---- keys(71-80) C 'GCHH','GSYM','INUM','FNUM','ENUM', C 'STRC','STRH','STR2','STR4','STRD', C GO TO (800,810,820,830,840,850,860,870,880, + 890) NMEMB C C---- (( gchh )) C 800 CONTINUE IF (PRINT) CALL NOCRLF (' HCHAR .........................=') READ (LUNIN,FMT=6312) HCHAR IF (PRINT) CALL NOCRLF (' XCOFF YCOFF KFONT .............=') READ (LUNIN,FMT=*) XCOFF,YCOFF,KFONT CALL GSTYOF CALL GSGCHH(HCHAR,XCOFF,YCOFF,KFONT) CALL GSTYON GO TO 10 C C---- (( gsym )) C 810 CONTINUE IF (PRINT) CALL NOCRLF (' NSYMB NSET ....................=') READ (LUNIN,FMT=*) NSYMB,NSET CALL GSTYOF CALL GSGSYM(NSYMB,NSET) CALL GSTYON GO TO 10 C C---- (( inum )) C 820 CONTINUE IF (PRINT) CALL NOCRLF (' INUM NDIGIT SIZX SIZY NJUST ...=') READ (LUNIN,FMT=*) INUM,NDIGIT,SIZX,SIZY,NJUST CALL GSTYOF CALL GSINUM(INUM,NDIGIT,SIZX,SIZY,NJUST) CALL GSTYON GO TO 10 C C---- (( fnum )) C 830 CONTINUE IF(PRINT) CALL NOCRLF(' FNUM NDIGIT NAFTER SIZX SIZY NJUST=') READ (LUNIN,FMT=*) FNUM,NDIGIT,NAFTER,SIZX,SIZY,NJUST CALL GSTYOF CALL GSFNUM(FNUM,NDIGIT,NAFTER,SIZX,SIZY,NJUST) CALL GSTYON GO TO 10 C C---- (( enum )) C 840 CONTINUE IF(PRINT) CALL NOCRLF(' ENUM NDIGIT NAFTER SIZX SIZY NJUST=') READ (LUNIN,FMT=*) ENUM,NDIGIT,NAFTER,SIZX,SIZY,NJUST CALL GSTYOF CALL GSENUM(ENUM,NDIGIT,NAFTER,SIZX,SIZY,NJUST) CALL GSTYON GO TO 10 C C---- (( strc )) C 850 CONTINUE IF (PRINT) CALL NOCRLF (' TEXT STRING ..........=') READ (LUNIN,FMT=6306) TEXT CALL GSTYOF CALL GSSTRC(TEXT) CALL GSTYON GO TO 10 C C---- (( strh )) C 860 CONTINUE IF (PRINT) CALL NOCRLF (' NUMBER OF LETTERS ............=') READ (LUNIN,FMT=*) NLETT IF (PRINT) CALL NOCRLF (' HTEXT ...=') READ (LUNIN,FMT=6314) (HTEXT(I),I=1,NLETT) CALL GSTYOF CALL GSSTRH(HTEXT,NLETT) CALL GSTYON GO TO 10 C C---- (( str2 )) C 870 CONTINUE IF (PRINT) CALL NOCRLF (' NUMBER OF LETTERS ............=') READ (LUNIN,FMT=*) NLETT IF (PRINT) CALL NOCRLF (' ITEXT2 ...=') READ (LUNIN,FMT=*) (ITEXT2(I),I=1,NLETT) CALL GSTYOF CALL GSSTR2(ITEXT2,NLETT) CALL GSTYON GO TO 10 C C---- (( str4 )) C 880 CONTINUE IF (PRINT) CALL NOCRLF (' NUMBER OF LETTERS .............=') READ (LUNIN,FMT=*) NLETT IF (PRINT) CALL NOCRLF (' ITEXT4 ...=') READ (LUNIN,FMT=*) (ITEXT4(I),I=1,NLETT) CALL GSTYOF CALL GSSTR4(ITEXT4,NLETT) CALL GSTYON GO TO 10 C C---- (( strd )) C 890 CONTINUE IF (PRINT) CALL NOCRLF (' TEXT ...=') READ (LUNIN,FMT=6306) TEXT IF (PRINT) CALL NOCRLF (' DXD DYD ........................=') READ (LUNIN,FMT=*) DX,DY CALL GSTYOF CALL GSSTRD(TEXT,DX,DY) CALL GSTYON GO TO 10 C 900 CONTINUE C C---- keys(81-90) C 'STRU','CFSZ','CLPL','CLPT','CLTS', C 'SWLN','DWTO','DWBY','MVTO','MVBY', C GO TO (910,920,930,940,950,960,970,980,990, + 1000) NMEMB C C---- (( stru )) C 910 CONTINUE IF (PRINT) CALL NOCRLF (' TEXT ...=') READ (LUNIN,FMT=6306) TEXT IF (PRINT) CALL NOCRLF (' DXU DYU .......................=') READ (LUNIN,FMT=*) DX,DY CALL GSTYOF CALL GSSTRU(TEXT,DX,DY) CALL GSTYON GO TO 10 C C---- (( cfsz )) C 920 CONTINUE IF (PRINT) CALL NOCRLF (' NCHAR KFONT ...................=') READ (LUNIN,FMT=*) NCHAR,KFONT CALL GSCFSZ(NCHAR,XLEFT,XRIGHT,YLOW,YHIGH,CWID,KFONT) CHAR1 = CHAR(NCHAR) IF (PRINT) WRITE (LUNOUT,FMT=6200) CHAR1,XLEFT,XRIGHT,YLOW, + YHIGH,CWID GO TO 10 C C---- (( clpl )) C 930 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6202) GO TO 10 C C---- (( clpt )) C 940 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6204) GO TO 10 C C---- (( clts )) C 950 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6206) GO TO 10 C C---- (( swln )) C 960 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6208) GO TO 10 C C---- (( dwto )) C 970 CONTINUE IF (PRINT) CALL NOCRLF (' X Y ...........................=') READ (LUNIN,FMT=*) X,Y CALL GSTYOF C C---- this trick is necessary to overcome the effect of switching C modes and of doing successive plots at the same point C IF (NTERM.EQ.1) THEN CALL GSMVTO(XOLD,YOLD) XOLD = X YOLD = Y END IF CALL GSDWTO(X,Y) CALL GSTYON GO TO 10 C C---- (( dwby )) C 980 CONTINUE IF (PRINT) CALL NOCRLF (' X Y ...........................=') READ (LUNIN,FMT=*) X,Y CALL GSTYOF IF (NTERM.EQ.1) THEN CALL GSMVTO(XOLD,YOLD) XOLD = XOLD + X YOLD = YOLD + Y END IF CALL GSDWBY(X,Y) CALL GSTYON GO TO 10 C C---- (( mvto )) C 990 CONTINUE IF (PRINT) CALL NOCRLF ('X Y ............................=') READ (LUNIN,FMT=*) X,Y C C---- For interactive plotting the terminal switching destroys the C vector chain so save the move till the draw comes along! C IF (NTERM.EQ.1) THEN XOLD = X YOLD = Y ELSE CALL GSMVTO(X,Y) END IF GO TO 10 C C---- (( mvby )) C 1000 CONTINUE IF (PRINT) CALL NOCRLF (' X Y ...........................=') READ (LUNIN,FMT=*) X,Y IF (NTERM.EQ.1) THEN XOLD = XOLD + X YOLD = YOLD + Y ELSE CALL GSMVBY(X,Y) END IF GO TO 10 C 1010 CONTINUE C C---- Keys(91-100) C 'POIN','DDRB','MDRB','DOTB','LRAS', C 'LRSB','TEXT','VIEW','TRIL','QUIT', C GO TO (1020,1030,1040,1050,1060,1070,1080,1090,1100, + 1380) NMEMB C C---- (( poin )) C 1020 CONTINUE IF (PRINT) CALL NOCRLF (' X Y ...........................=') READ (LUNIN,FMT=*) X,Y CALL GSTYOF CALL GSPOIN(X,Y) CALL GSTYON GO TO 10 C C---- (( ddrb )) C 1030 CONTINUE IF (PRINT) CALL NOCRLF (' X Y ............................=') READ (LUNIN,FMT=*) X,Y CALL GSTYOF IF (NTERM.EQ.1) THEN CALL GSMDRB(XBOLD,YBOLD) XBOLD = X YBOLD = Y END IF CALL GSDDRB(X,Y) CALL GSTYON GO TO 10 C C---- (( mdrb )) C 1040 CONTINUE IF (PRINT) CALL NOCRLF (' X Y ............................=') READ (LUNIN,FMT=*) X,Y IF (NTERM.EQ.1) THEN XBOLD = X YBOLD = Y ELSE CALL GSMDRB(X,Y) END IF GO TO 10 C C---- (( dotb )) C 1050 CONTINUE IF (PRINT) CALL NOCRLF (' X Y ............................=') READ (LUNIN,FMT=*) X,Y CALL GSTYOF CALL GSDOTB(X,Y) CALL GSTYON GO TO 10 C C---- (( lras )) C 1060 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6226) GO TO 10 C C---- (( lrsb )) C 1070 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6228) GO TO 10 C C---- (( text )) C 1080 CONTINUE IF (PRINT) CALL NOCRLF (' TEXT STRING ...=') READ (LUNIN,FMT=6306) TEXT GO TO 10 C C---- (( view )) C 1090 CONTINUE IF (PRINT) CALL NOCRLF (' GSFIL(.PLT ASSUMED)...=') READ (LUNIN,FMT=6306) GSFIL C C---- remove trailing blanks C NLENG = LENSTR(GSFIL) C C---- construct .PLT file name C IF (NLENG.LT.1) THEN GSFIL = 'quick.plt' ELSE GSFIL = GSFIL(1:NLENG)//'.plt' END IF NSTART = 0 ISCALE = 1 SCAFAC = 0.5 LINSIZ = 0 NOCENT = 0 NOPRNT = 1 NINTER = 0 IERR = 0 CALL GSVIEW(GSFIL,NSTART,ISCALE,SCAFAC,LINSIZ,NOCENT, + NOPRNT,NINTER,IERR) GO TO 10 C C---- (( tril )) C 1100 CONTINUE IF (PRINT) CALL NOCRLF (' GSFIL(.PLT ASSUMED) ...=') READ (LUNIN,FMT=6306) GSFIL C C---- remove trailing blanks C NLENG = LENSTR(GSFIL) C C---- construct .PLT file name C IF (NLENG.LT.1) THEN GSFIL = 'quick.plt' ELSE GSFIL = GSFIL(1:NLENG)//'.plt' END IF C C---- construct .lis file name C IF (NLENG.LT.1) THEN LISFIL = 'QUICK.LIS' ELSE LISFIL = GSFIL(1:NLENG)//'.LIS' END IF CALL GSTRIL(GSFIL,LISFIL,0) GO TO 10 C C---- Keys 101-110 C 'VCLN','CETX','SCUR','GSYS','GSYC', C 'NOPR','CETS','GCHS','STRS','MIXC' C 1110 CONTINUE GO TO (1120,1130,1140,1150,1160,1170,1180,1190,1200, + 1210) NMEMB C C---- (( vcln )) C 1120 CONTINUE GO TO 10 C C---- (( cetx )) C 1130 CONTINUE IF (PRINT) CALL NOCRLF (' TEXT ...=') READ (LUNIN,FMT=6306) TEXT IF (PRINT) CALL NOCRLF (' NJUST(1)(2)(3).................=') READ (LUNIN,FMT=*) NJUST CALL GSTYOF CALL GSCETX(TEXT,NJUST) CALL GSTYON GO TO 10 C C---- (( scur )) C 1140 CONTINUE IF (PRINT) CALL NOCRLF (' XCGAP .........................=') READ (LUNIN,FMT=*) XCGAP CALL GSSCUR(XCGAP) GO TO 10 C C---- (( gsys )) C 1150 CONTINUE IF (PRINT) CALL NOCRLF (' NSYMB NSET XCOFF YCOFF SIZX SIZY=') READ (LUNIN,FMT=*) NSYMB,NSET,XCOFF,YCOFF,SIZX,SIZY CALL GSTYOF CALL GSGSYS(NSYMB,NSET,XCOFF,YCOFF,SIZX,SIZY) CALL GSTYON GO TO 10 C C---- (( gsyc )) C 1160 CONTINUE IF (PRINT) CALL NOCRLF (' CHAR1 NSET .....................=') READ (LUNIN,FMT=6316) CHAR1,NSET IF (PRINT) CALL NOCRLF (' XCOFF YCOFF SIZX SIZY ..........=') READ (LUNIN,FMT=*) XCOFF,YCOFF,SIZX,SIZY CALL GSTYOF CALL GSGSYC(CHAR1,NSET,XCOFF,YCOFF,SIZX,SIZY) CALL GSTYON GO TO 10 C C---- (( prom )) C 1170 CONTINUE C C---- "prom" command sets print to .true. C PRINT = .TRUE. GO TO 10 C C---- (( cets )) C 1180 CONTINUE IF (PRINT) CALL NOCRLF (' TEXT ...=') READ (LUNIN,FMT=6306) TEXT IF (PRINT) CALL NOCRLF (' SIZX,SIZY,NJUST(1)(2)(3)......=') READ (LUNIN,FMT=*) SIZX,SIZY,NJUST CALL GSTYOF CALL GSCETS(TEXT,SIZX,SIZY,NJUST) CALL GSTYON GO TO 10 C C---- (( gchs )) C 1190 CONTINUE IF (PRINT) CALL NOCRLF (' CHAR1 ........................=') READ (LUNIN,FMT=6306) CHAR1 IF (PRINT) CALL NOCRLF (' XCOFF,YCOFF,SIZ1,SIZ2,KFONT...=') READ (LUNIN,FMT=*) XCOFF,YCOFF,SIZ1,SIZ2,KFONT CALL GSTYOF CALL GSGCHS(CHAR1,XCOFF,YCOFF,SIZ1,SIZ2,KFONT) CALL GSTYON GO TO 10 C C---- (( strs )) C 1200 CONTINUE IF (PRINT) CALL NOCRLF (' TEXT...=') READ (LUNIN,FMT=6306) TEXT IF (PRINT) CALL NOCRLF (' SIZX SIZY ....................=') READ (LUNIN,FMT=*) SIZX,SIZY CALL GSTYOF CALL GSSTRS(TEXT,SIZX,SIZY) CALL GSTYON GO TO 10 C C---- (( mixc )) C 1210 CONTINUE IF (PRINT) CALL NOCRLF (' MCOLOR .......................=') READ (LUNIN,FMT=*) MCOLOR CALL GSMIXC(MCOLOR) GO TO 10 C C---- keys(111-120) C 'NUMB','SYMB','AXIS','STNG','CSTN', C 'NOPR','CSPU','TSAV','TRES','EREV', C 1220 CONTINUE GO TO (1230,1240,1250,1260,1270,1280,1290,1300,1310, + 1320) NMEMB C C---- (( numb )) C 1230 CONTINUE IF (PRINT) CALL NOCRLF (' X Y HGT FNUM ANGLE NDIG .......=') READ (LUNIN,FMT=*) X,Y,HGT,FNUM,ANGLE,NDIG CALL GSTYOF CALL NUMBER(X,Y,HGT,FNUM,ANGLE,NDIG) CALL GSTYON GO TO 10 C C---- (( symb )) C 1240 CONTINUE IF (PRINT) CALL NOCRLF (' X Y HGT ANGLE NC ..............=') READ (LUNIN,FMT=*) X,Y,HGT,ANGLE,NC IF (PRINT) CALL NOCRLF (' BYTXT ...=') READ (LUNIN,FMT=6314) (HTEXT(J),J=1,NC) CALL GSTYOF CALL SYMBOL(X,Y,HGT,HTEXT,ANGLE,NC) CALL GSTYON GO TO 10 C C---- (( axis )) C 1250 CONTINUE IF (PRINT) CALL NOCRLF (' X Y NCHAR AXLEN ANGLE FVAL DV=') READ (LUNIN,FMT=*) X,Y,NCHAR,AXLEN,ANGLE,FVAL,DV IF (PRINT) CALL NOCRLF (' LABEL FOR AXIS ...=') READ (LUNIN,FMT=6314) (HTEXT(J),J=1,NCHAR) CALL GSTYOF CALL AXIS(X,Y,HTEXT,NCHAR,AXLEN,ANGLE,FVAL,DV) CALL GSTYON GO TO 10 C C---- (( stng )) C 1260 CONTINUE IF (PRINT) CALL NOCRLF (' NCHARS ......................=') READ (LUNIN,FMT=*) NCHARS IF (PRINT) CALL NOCRLF (' BYTXT ...=') READ (LUNIN,FMT=6314) (HTEXT(J),J=1,NCHARS) CALL GSTYOF CALL STRING(HTEXT,NCHARS) CALL GSTYON GO TO 10 C C---- (( cstn )) C 1270 CONTINUE IF (PRINT) CALL NOCRLF (' NCHARS .......................=') READ (LUNIN,FMT=*) NCHARS IF (PRINT) CALL NOCRLF (' BYTXT ...=') READ (LUNIN,FMT=6314) (HTEXT(J),J=1,NCHARS) CALL GSTYOF CALL CSTRING(HTEXT,NCHARS) CALL GSTYON GO TO 10 C C---- (( nopr )) C 1280 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6282) PRINT = .FALSE. GO TO 10 C C---- (( cspu )) C 1290 CONTINUE IF (PRINT) CALL NOCRLF (' IUSPCE (1) (0) ...............=') READ (LUNIN,FMT=*) IUSPCE CALL GSCSPU(IUSPCE) GO TO 10 C C---- (( tsav )) C 1300 CONTINUE IF (PRINT) CALL NOCRLF (' TSAV: Save current scales') CALL GSTSAV(NTRSAV) GO TO 10 C C---- (( tres )) C 1310 CONTINUE IF (PRINT) CALL NOCRLF (' TRES: Restore saved scales') CALL GSTRES(NTRSAV) GO TO 10 C C---- (( erev )) C 1320 CONTINUE IF (PRINT) CALL NOCRLF (' EREV: Reverse erase mode VT640') CALL GSTYON CALL GSEREV CALL GSTYON GO TO 10 C C---- keys(121-130) C 'HAIR',' ',' ',' ',' ', C ' ',' ',' ',' ',' ', C 1330 CONTINUE GO TO (1340,1350,1360,1370,10,10,10,10,10,10) NMEMB C C---- (( hair )) C 1340 CONTINUE IF (PRINT) CALL NOCRLF (' CROSS HAIR POSITION: X Y .....=') READ (LUNIN,FMT=*) X,Y CALL GSHAIR(X,Y,CHAR1) CALL GSTYON WRITE (LUNOUT,FMT=6294) X,Y,CHAR1 GO TO 10 C C---- (( cmfl )) C 1350 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6296) NCMFIL = 1 PRINT = .FALSE. GO TO 10 C C---- (( line )) C 1360 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6298) READ (LUNIN,FMT=*) P(1),P(2),Q(1),Q(2) CALL GSTYOF CALL GSLINE(P,Q) XOLD = Q(1) YOLD = Q(2) CALL GSTYON GO TO 10 C C---- (( term )) C 1370 CONTINUE IF (PRINT) WRITE (LUNOUT,FMT=6300) NTERM = 1 GO TO 10 END IF C C---- "quit" C 1380 CONTINUE C 1390 CONTINUE C C---- Format statements C 6002 FORMAT (2X,'FILE NAME USED =',A) 6008 FORMAT (1X,'ENVR') 6010 FORMAT (1X,'XENV') 6026 FORMAT (2X,'DEFAULT-- DWLIMX DWLIMY =',2F10.4) 6028 FORMAT (2X,'DEFAULT-- DVXMIN DVXMAX DVYMIN DVYMAX =',/1X,4F10.4) 6034 FORMAT (2X,'DEFAULT -- VBXMIN VBXMAX VBYMIN VBYMAX =',/1X,4F10.4) 6042 FORMAT (2X,'FONT READ IN ') 6044 FORMAT (2X,'LEVEL CHECK ') 6046 FORMAT (2X,'PICTURE STARTED ') 6050 FORMAT (2X,'END PICTURE ') 6058 FORMAT (2X,'PLOTTER SWITCHED OFF ') 6062 FORMAT (2X,'IUNIT RETURNED AS ',I5) 6066 FORMAT (2X,'IUNIT RETURNED AS ',I5) 6074 FORMAT (1X,'*FLRI EOF RETURN') 6076 FORMAT (2X,'WRITE HEADER ') 6078 FORMAT (1X,'*RHDR EOF RETURN') 6080 FORMAT (2X,'READ HEADER ') 6082 FORMAT (2X,'UPDATE HEADER ') 6084 FORMAT (2X,'REWIND PLOTFILE ') 6094 FORMAT ('*FLRR EOF RETURN') 6096 FORMAT (2X,'USER TRANSFORMATION ') 6128 FORMAT (2X,'CURSOR FOUND AT: XCSTRT YCSTRT =',2F10.4) 6136 FORMAT (1X,'-- GSSTYL CALLED --') 6148 FORMAT (2X,'ERASE VT640 ON') 6150 FORMAT (2X,'ERASE VT640 OFF') 6200 FORMAT (2X,'CHAR=',A,' XL XR YL YH ',4F10.4,/2X,'CWID ',F10.4) 6202 FORMAT (2X,'-NO TEST FOR GSCLPL-') 6204 FORMAT (2X,'-NO TEST FOR GSCLPT-') 6206 FORMAT (2X,'-NO TEST FOR GSCLTS-') 6208 FORMAT (2X,'-NO TEST FOR GSSWLN-') 6226 FORMAT (2X,'-NO TEST FOR GSLRAS-') 6228 FORMAT (2X,'-NO TEST FOR GSLRSB-') 6282 FORMAT (2X,'NOPR (Prompt off)') 6294 FORMAT ('$ FOUND AT X Y =',2F10.4,' CHKEY =',A) 6296 FORMAT (2X,'CMFL: Commands read from file ') 6298 FORMAT (2X,'LINE X1,Y1,X2,Y2 .....................=',4F10.4) 6300 FORMAT (2X,'TERMINAL PLOTTING SET ') 6304 FORMAT (2X,'!!!ERROR: UNKNOWN KEY=<',A4,'> IGNORED') 6306 FORMAT (A) 6308 FORMAT (I5) 6312 FORMAT (A1) 6314 FORMAT (80A1) 6316 FORMAT (A1,I5) 6318 FORMAT (A4,1X,A75) C END C C C SUBROUTINE GSRDTM(ITERM,NRWMIN,NRWMAX,SCREEN) C ============================================== C C---- Read vt640 screen as coded bytes of 5-bit data. C C A.D. McLachlan SEP 1984. Last updated 21 SEP 1984. C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were ESC, GS, SPARE C and the followig BYTEs to INTEGER: SCREEN C C This program works by reading lines in groups of three. C The given values of nrwmin and nrwmax will therefore be C rounded to 3*n-1 and 3*m. C On exit the terminal will be in teletype mode C C ITERM = fortran unit number for terminal in graphics package C NRWMIN = min line number for bottom of display dump C NRWMAX = max line number for top of display dump C the whole screen goes from 0 to 479 (bottom to top) C in physical dot units. C SCREEN = byte array for accepting the data. 128 bytes per line. C C The 4010 memory coords (0-1023 in x, 0-780 in y) are here C replaced by the physical dot display range C (0-639 in x, 0-479 in y). C The origin is always at the bottom left hand corner of the screen. C C .. Scalar Arguments .. INTEGER ITERM,NRWMAX,NRWMIN C .. C .. Array Arguments .. INTEGER SCREEN(0:127,0:*) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. REAL SECTOT,SSTAGE INTEGER I,ITPRNT,J,NCMAX,NCMIN,NCNT1,NCNT8,NCOUNT,NCWID,NCWID1, + NLEN,NLIN1,NLINES,NROW,NROWD,NRWLOW,NSTART CHARACTER*1 ESC,GS CHARACTER OUTLIN*40 C .. C .. Local Arrays .. CHARACTER*1 SPARE(8) C .. C .. External Subroutines .. EXTERNAL GSSUSP,GSTIM0,GSTIMR,GSTYTM C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C ESC = CHAR(27) GS = CHAR(29) ITPRNT = 0 CALL GSTIM0(ITPRNT) C C---- routine assumes vt640 is in graphics mode and buffer clear C C read from vt640 memory C 5-bit chars + octal 100 in each byte. loaded to the right. C arranged in 128 columns of 5 dots wide. cols numbered (0:127) C and 480 rows of one dot high numbered (0:479) C origin (0,0) at bottom left of screen C "GS" gives vector mode C For memory readback write esc";;C C C---- This routine reads up to 512 bytes or 4 rows at a time, C as this seems to be the maximum record length that the C machine can deal with records with more than 512 bytes C arrive without the terminator. C C---- !! The vt640 manual says that sets of zero bytes are sent as a C "$" followed by a count of up to 32 in the low six-bits of C the output character. but this does not seem to happen C when reading more than 9 bytes the byte 6 from the end of C the output seems to be lost. C C---- screen limits to read C C---- set row limits to 3n-1 and 3m C read 3 lines at a time C if nlines.gt.1 then must read whole rows of 128 cols C IF (NRWMAX.GT.479) NRWMAX = 479 IF (NRWMAX.LE.0) NRWMAX = 479 NRWMAX = ((NRWMAX+3)/3)*3 - 1 IF (NRWMIN.GE.NRWMAX) NRWMIN = 0 IF (NRWMIN.LT.0) NRWMIN = 0 NRWMIN = (NRWMIN/3)*3 NLINES = 3 NLIN1 = NLINES - 1 NRWLOW = NRWMIN + NLIN1 NCMIN = 0 NCWID = 128 NCWID1 = NCWID - 1 NCMAX = NCMIN + NCWID1 NCOUNT = NCWID*NLINES NCNT1 = NCOUNT - 1 NCNT8 = NCOUNT + 8 C C---- Begin readout C WARNING !! any changes to this part of the program should be C made with great caution, as they are likely to prevent it C from working correctly C NLEN = 19 DO 10 NROW = NRWMAX,NRWLOW,-NLINES IF (NROW.EQ.NRWLOW) THEN GO TO 20 ELSE C C---- internal write to set up character stream C no blanks allowed in the line C WRITE (OUTLIN,FMT=6000) GS,ESC,'"',NCMIN,';',NROW,';',NCNT8, + ';c' WRITE (ITERM,FMT=6002) OUTLIN(1:NLEN) C C---- read 8 spare bytes =40 C dots to circumvent error in terminal response C NROWD = NROW - NRWMIN READ (ITERM,FMT=6004) ((SCREEN((NCMIN+I), (NROWD-J)),I=0, + NCWID1),J=0,NLIN1),SPARE END IF 10 CONTINUE C C---- debugging write statements C write(ioprnt,23) nrow C write(ioprnt,24) C 1 ((screen((ncmin+i),(nrowd-j)),i=0,ncwid1),j=0,nlin1) C write(ioprnt,30) C 1 ((screen((ncmin+i),(nrowd-j)),i=0,ncwid1),j=0,nlin1) C C C---- special fixup for last row. C do not read spare, but reread last 8 bytes C 20 CONTINUE C C---- last group of rows C WRITE (OUTLIN,FMT=6000) GS,ESC,'"',NCMIN,';',NRWLOW,';',NCOUNT, + ';c' WRITE (ITERM,FMT=6002) OUTLIN(1:NLEN) NROWD = NRWLOW - NRWMIN READ (ITERM,FMT=6004) ((SCREEN((NCMIN+I), (NROWD-J)),I=0,NCWID1), + J=0,NLIN1) C C---- last 8 bytes C NCOUNT = 8 NSTART = NCMAX - 7 WRITE (OUTLIN,FMT=6000) GS,ESC,'"',NSTART,';',NRWMIN,';',NCOUNT, + ';c' WRITE (ITERM,FMT=6002) OUTLIN(1:NLEN) READ (ITERM,FMT=6004) (SCREEN((NSTART+I),0),I=0,7) CALL GSSUSP(100) CALL GSTYTM CALL GSSUSP(100) CALL GSTIMR(SECTOT,SSTAGE,ITPRNT) WRITE (LUNOUT,FMT=6010) SECTOT C C---- Format statements C 6000 FORMAT (2A1,A1,I3.3,A1,I3.3,A1,I6.6,A2) 6002 FORMAT (A) 6004 FORMAT (4096A1) 6010 FORMAT (2X,'GSRDTM: Screen read done. cpu sec = ',F8.2) C END C C C SUBROUTINE GSRFNT C ================== C C A.D. McLachlan JULY 1984. Last updated 17 SEP 1986 C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were NFONTS C C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Arrays in Common .. INTEGER*2 IFHT,IFSTRT,IFWID,IFX0,IFY0,LENGF INTEGER*1 NFONTS character str*255 C .. C .. Local Scalars .. INTEGER IUNITF,IFAIL,ITEROP C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSFNT/IFSTRT(150,4),LENGF(150,4),IFX0(150,4), + IFY0(150,4),IFWID(150,4),IFHT(150,4),NFONTS(4,3000,4) C C .. Save Statement .. C SAVE C C .. Data statements .. DATA IUNITF/89/ C IFAIL = 0 ITEROP = -IUNITF C [Changed in CCP4 6.5: ignore $PUBLIC_FONT84] C call getenv('PUBLIC_FONT84', str) C if (str.ne.' ') then C CALL CCPDPN (ITEROP,'PUBLIC_FONT84','READONLY','U',80,IFAIL) C IF (IFAIL.NE.0) GO TO 10 C READ (IUNITF) IFSTRT,LENGF,IFX0,IFY0,IFWID,IFHT,NFONTS C else call getenv('CCP4', str) str(lenstr(str)+1:) = '/lib/data/font84.ascii' call CCPDPN (ITEROP,str,'READONLY','F',0,IFAIL) IF (IFAIL.NE.0) GO TO 10 READ(IUNITF,2000) IFSTRT,LENGF,IFX0,IFY0,IFWID,IFHT,NFONTS C endif CLOSE (UNIT=IUNITF) RETURN 10 WRITE (LUNOUT,FMT=6000) C C---- Format statements C 2000 FORMAT(10I5) 6000 FORMAT (2X,'!!!GSRFNT ERROR: UNABLE TO READ FONTS - FILE=', + 'PUBLIC_FONT84') C END C C C SUBROUTINE GSRSTM(ITERM,FILNAM) C ================================ C C---- fill vt640 screen from a saved disc file in packed byte form. C C A.D. McLachlan SEP 1984. Last updated 22 SEP 1984. C 9/2/90 - PJD: Changed definition of several BYTEs to INTEGER C They were SCREEN C C ITERM = fortran unit number for terminal in graphics package C FILNAM = filename or logical unit number for output C C The screen was saved in rows of 128 bytes packed as 5 dots per bit C in the lower bits from left to right. 480 rows use 60*1024 bytes C the diskio direct access routines are used for writing the screen C C The 4010 memory coords (0-1023 in x, 0-780 in y) C are NOT USED here. C This routine uses the physical dot display range C (0-639 in x, 0-479 in y). C The origin is always at the bottom left hand corner of the screen. C C .. Scalar Arguments .. INTEGER ITERM CHARACTER FILNAM* (*) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. REAL SECTOT,SSTAGE CHARACTER*1 ZERO INTEGER IERR,ITPRNT,IUNIT,NCOL,NCOUNT,NROW,NRWMAX,NRWMIN,NMCITM C .. C .. Local Arrays .. INTEGER SCREEN(0:127,0:3) C .. C .. External Subroutines .. EXTERNAL GSBFTM,GSGRTM,GSSLTM,GSTIM0,GSTIMR, + GSTYTM,QCLOSE,QOPEN,QREAD C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C ZERO = CHAR(0) ITPRNT = 0 CALL GSTIM0(ITPRNT) C C---- put vt640 in graphics mode and clear buffer of vt640 C CALL GSGRTM CALL GSBFTM(ITERM,ZERO) C C---- open input file C CALL QOPEN(IUNIT,FILNAM,'READONLY') CALL QMODE (IUNIT,0,NMCITM) C C---- fill into vt640 memory C 5-bit chars + octal 100 in each byte. loaded to the right. C arranged in 128 columns of 5 dots wide. cols numbered (0:127) C and 480 rows of one dot high numbered (0:479) C origin (0,0) at bottom left of screen C NRWMIN = 0 NRWMAX = 479 NCOL = 0 NCOUNT = 512 C C---- Start reading rows C and put them onto screen from top to bottom C DO 10 NROW = NRWMAX,NRWMIN,-4 CALL QREAD(IUNIT,SCREEN,512,IERR) IF (IERR.EQ.1) THEN GO TO 20 ELSE CALL GSSLTM(ITERM, (NROW-3),NROW,SCREEN) END IF 10 CONTINUE C C---- close disc file C 20 CALL QCLOSE(IUNIT) CALL GSTIMR(SECTOT,SSTAGE,ITPRNT) CALL GSTYTM WRITE (LUNOUT,FMT=6000) SECTOT C C---- Format statements C 6000 FORMAT (2X,'GSRSTM: Restore complete . cpu sec = ',F8.2) C END C C C SUBROUTINE GSSFTM(ITERM,BITS,NROW,NCOL,NCOUNT) C =============================================== C C---- Routine for filling vt640 screen with dot patterns C C A.D. McLachlan SEP 1984 . Last updated 20 SEP 1984. C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were ZERO, NBIT0, PLUS, HASH, CR, ENQ, ESC C FF, FS, GS, HT, LF, RS, SUB, US, VT C and the followig BYTEs to INTEGER: BITS, NBYTE, BYTE1 ,XBIT, LINE C C Patterns are specified in bytes as 1,0,0,1,... one byte per dot C C ITERM = fortran unit number of terminal graphics stream C BITS = byte array of integers either 0 or 1 (no packing) C NCOL = col to start on screen (0:127) C each col holds 5 "bits" dots C NROW = row to start on screen (0:479) bottom left is (0,0) C NCOUNT = number of locations to load . each to hold 5 "bits" dots C one row has 128 locations or 640 dots. C So 5*ncount dots are loaded C ncount must not exceed 512 (equivalent to 2560 dots or C 4 complet lines of screen. C C---- write to vt640 memory C 5-bit chars + octal 100 in each byte. loaded to the right. C arranged in 128 columns of 5 dots wide. cols numbered (0:127) C and 480 rows of one dot high numbered (0:479) C origin (0,0) at bottom left of screen C for memory writeout write esc";;;A C C---- This routine writes up to 512 bytes or 4 rows at a time. C going from left to right and top to bottom on screen. C this requires the output of 515 bytes in all C because of the special C control codes. so the sys$output stream needs to be opened with C a suitably long record length (this program assumes recl=1024). C C---- !! the vt640 manual says that sets of zero bytes are sent as a C "$" followed by a count of up to 32 in the low six-bits of C The output character. but this does not seem to work C C---- Put vt640 in graphics mode and clear buffer of vt640 C C .. Scalar Arguments .. INTEGER ITERM,NCOL,NCOUNT,NROW C .. C .. Array Arguments .. INTEGER BITS(0:*) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. INTEGER I,ICOL,IOPRNT,JB5,KBIT,MCOUNT,NBITS,NBITS1,NCNT1,NLEN, + NPACK,NBYTE CHARACTER*1 ZERO,NBIT0,PLUS,HASH,ENQ,ESC,FF, + FS,GS,HT,LF,RS,SUB,US,VT CHARACTER OUTLIN*40 C .. C .. Local Arrays .. INTEGER XBIT(0:4),LINE(0:1023) C .. C .. External Subroutines .. EXTERNAL GSBFTM,GSGRTM C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C C .. Data statements .. DATA PLUS/'+'/,HASH/'#'/,XBIT/16,8,4,2,1/ C ZERO = CHAR(0) NBIT0 = CHAR(0) ENQ = CHAR(5) ESC = CHAR(27) FF = CHAR(12) FS = CHAR(28) GS = CHAR(29) HT = CHAR(9) LF = CHAR(10) RS = CHAR(30) SUB = CHAR(26) US = CHAR(31) VT = CHAR(11) C CALL GSGRTM CALL GSBFTM(ITERM,ZERO) C C---- Translate into packed form C number of bits sent is 5*number of columns C NPACK = 1 MCOUNT = NCOUNT IF (MCOUNT.LT.1) MCOUNT = 1 IF (MCOUNT.GT.512) MCOUNT = 512 NBITS = 5*MCOUNT NBITS1 = NBITS - 1 NCNT1 = MCOUNT - 1 IOPRNT = 8 C C---- Make up output array C KBIT = 0 DO 20 ICOL = 0,NCNT1 NBYTE = 64 C C---- Start on bits C DO 10 JB5 = 0,4 CCC IF (BITS(KBIT).EQ.1) NBYTE = NBYTE .OR. XBIT(JB5) IF (BITS(KBIT).EQ.1) NBYTE = IOR(NBYTE, XBIT(JB5)) KBIT = KBIT + 1 10 CONTINUE LINE(ICOL) = NBYTE 20 CONTINUE C C---- Send address load instruction C internal write to set up character stream C no blanks allowed in the line' C WRITE (OUTLIN,FMT=6000) ESC,'"',NCOL,';',NROW,';a' NLEN = 11 WRITE (ITERM,FMT=6002) OUTLIN(1:NLEN) C C---- Send line to vt640 C NCNT1 = NCOUNT - 1 WRITE (ITERM,FMT=6004) ESC,PLUS, (LINE(I),I=0,NCNT1),HASH C C---- Format statements C 6000 FORMAT (2A1,I3.3,A1,I3.3,A2) 6002 FORMAT (A) 6004 FORMAT (4096A1) C END C C C SUBROUTINE GSSLTM(ITERM,NRWMIN,NRWMAX,SCREEN) C ============================================== C C---- Routine for restoring vt640 screen with saved packed bytes C C A.D. McLachlan SEP 1984 . Last updated 22 SEP 1984. C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were ESC, HASH, PLUS, ZERO C and the followig BYTEs to INTEGER: SCREEN C C ITERM = fortran unit number of terminal graphics stream C NRWMIN = bottom row to fill C NRWMAX = top row to fill (max 4 rows at a time) C SCREEN = array of rows of bytes in cols (0:127) and rows (0:479) C one row has 128 locations or 640 dots. C bytes sent must not exceed 512 C (equivalent to 2560 dots or 4 complete lines of screen. C C .. Scalar Arguments .. INTEGER ITERM,NRWMAX,NRWMIN C .. C .. Array Arguments .. INTEGER SCREEN(0:127,0:*) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. INTEGER I,J,NCOL,NLEN,NRWLOW,NRWTOP,NSENT,NSENT1 CHARACTER*1 ESC,HASH,PLUS,ZERO CHARACTER OUTLIN*40 C .. C .. External Subroutines .. EXTERNAL GSBFTM,GSGRTM C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C C .. Data statements .. DATA PLUS/'+'/,HASH/'#'/ C ZERO = CHAR(0) ESC = CHAR(27) C C---- Write to vt640 memory C 5-bit chars + octal 100 in each byte. loaded to the right. C arranged in 128 columns of 5 dots wide. cols numbered (0:127) C and 480 rows of one dot high numbered (0:479) C origin (0,0) at bottom left of screen C for memory writeout write esc";;;A C C---- This routine writes up to 512 bytes or 4 rows at a time. C going from left to right and top to bottom on screen. C this requires the output of 515 bytes in all because C of the special C control codes. so the sys$output stream needs to be opened with C a suitably long record length (this program assumes recl=1024). C C---- !! the vt640 manual says that sets of zero bytes are sent as a C "$" followed by a count of up to 32 in the low six-bits of C the output character. but this does not seem to work C C---- Put vt640 in graphics mode and clear buffer of vt640 C CALL GSGRTM CALL GSBFTM(ITERM,ZERO) C C---- Check limits C NRWTOP = NRWMAX NRWLOW = NRWMIN IF (NRWTOP.GT.479) NRWTOP = 479 IF (NRWTOP.LT.0) NRWTOP = 0 IF (NRWLOW.LT.0) NRWLOW = 0 IF (NRWLOW.GT.NRWTOP) NRWLOW = NRWTOP NSENT = NRWTOP - NRWLOW + 1 IF (NSENT.GT.4) NSENT = 4 NSENT1 = NSENT - 1 NRWLOW = NRWTOP - NSENT1 C C---- Send address load instruction C internal write to set up character stream C no blanks allowed in the line C NCOL = 0 WRITE (OUTLIN,FMT=6000) ESC,'"',NCOL,';',NRWTOP,';a' NLEN = 11 WRITE (ITERM,FMT=6002) OUTLIN(1:NLEN) C C---- Send lines to vt640 C WRITE (ITERM,FMT=6004) ESC,PLUS, + ((SCREEN(I,J),I=0,127),J=NSENT1,0,-1),HASH C C---- Format statements C 6000 FORMAT (2A1,I3.3,A1,I3.3,A2) 6002 FORMAT (A) 6004 FORMAT (4096A1) C END C C C SUBROUTINE GSSTRC(TEXT) C ======================== C C---- Plot char string C C A.D.McLachlan JUN 1984. Last updated 16 OCT 84 C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were BYTXT, NFONTS C C---- Plots a character string from the character*(*) variable C (text) without trailing blanks C converts illegal ascii characters to blanks (not 32-126) C uses the current font C uses icentc option to centre characters on cursor C but not the string. characters are of size 1.0*1.5 C character units C C---- ENTRY GSSTRS for non-standard size C C---- ENTRIES for integer or 'h' format strings C GSSTRH(BYTXT,NLETT) for bytes C GSSTR2(ITEXT2,NLETT) for integer*2 C GSSTR4(ITEXT4,NLETT) for integer*4 C C .. Scalar Arguments .. REAL SIZX,SIZY INTEGER NLETT CHARACTER TEXT* (*) C .. C .. Array Arguments .. INTEGER*4 ITEXT4(*) INTEGER*2 ITEXT2(*) CHARACTER*1 BYTXT(*) C .. C .. Scalars in Common .. REAL ANGFAC,CHANGX,CHANGY,CHRSCX,CHRSCY,CHRSPX,CHRSPY,SCALEX, + SCALEY,USANGX,USANGY,XCHAR,XCSTRT,YCHAR,YCSTRT INTEGER ICENTC,IFONT,KPRINT,LUNIN,LUNOUT LOGICAL*4 FONTIN,ICULNK,LINMOD,UCSPAC C .. C .. Arrays in Common .. REAL CHRMAT,CUMAT,USRMAT INTEGER*2 IFHT,IFSTRT,IFWID,IFX0,IFY0,LENGF INTEGER*1 NFONTS C .. C .. Local Scalars .. REAL CHORGX,CHORGY,CUORGX,CUORGY,XCOFF,XORIG,YCOFF,YORIG INTEGER I,IPLOT,LCHAR,LETTER,NLENG C .. C .. Local Arrays .. INTEGER NCTRAN(24),NSTRAN(24) C .. C .. External Functions .. INTEGER LENSTR EXTERNAL LENSTR C .. C .. External Subroutines .. EXTERNAL GSGCHC,GSGCHI,GSGCHS C .. C .. Intrinsic Functions .. INTRINSIC ICHAR,LEN C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSCHX/CHRMAT(3,3),CHRSCX,CHRSCY,CHANGX,CHANGY,CHRSPX, + CHRSPY,ICENTC,UCSPAC,IFONT,FONTIN,XCHAR,YCHAR,XCSTRT, + YCSTRT,ANGFAC COMMON /GSFNT/IFSTRT(150,4),LENGF(150,4),IFX0(150,4), + IFY0(150,4),IFWID(150,4),IFHT(150,4),NFONTS(4,3000,4) COMMON /GSUTR/USRMAT(3,3),SCALEX,SCALEY,USANGX,USANGY, + CUMAT(3,3),LINMOD,ICULNK,KPRINT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (XORIG,USRMAT(1,3)), (YORIG,USRMAT(2,3)) EQUIVALENCE (CUORGX,CUMAT(1,3)), (CUORGY,CUMAT(2,3)) EQUIVALENCE (NSTRAN(1),USRMAT(1,1)) EQUIVALENCE (CHORGX,CHRMAT(1,3)), (CHORGY,CHRMAT(2,3)) EQUIVALENCE (NCTRAN(1),CHRMAT(1,1)) C IPLOT = 1 GO TO 10 C C ENTRY GSSTRS(TEXT,SIZX,SIZY) C ============================= C IPLOT = 5 10 CONTINUE NLENG = LEN(TEXT) C C---- Replace bad characters by blanks C DO 30 I = 1,NLENG LCHAR = ICHAR(TEXT(I:I)) IF ((LCHAR.GT.31) .AND. (LCHAR.LT.127)) GO TO 20 TEXT(I:I) = ' ' 20 CONTINUE 30 CONTINUE C C---- Remove trailing blanks C NLENG = LENSTR(TEXT) GO TO 40 C ENTRY GSSTRH(BYTXT,NLETT) C ========================= C IPLOT = 2 NLENG = NLETT GO TO 40 C ENTRY GSSTR2(ITEXT2,NLETT) C =========================== C IPLOT = 3 NLENG = NLETT GO TO 40 C ENTRY GSSTR4(ITEXT4,NLETT) C =========================== C IPLOT = 4 NLENG = NLETT GO TO 40 40 CONTINUE C C---- Check for no letters C IF (NLENG.LE.0) THEN IF (KPRINT.GE.1) WRITE (LUNOUT,FMT=6000) GO TO 140 END IF C C---- Set offsets C IF (ICENTC.EQ.0) THEN XCOFF = 0.0 YCOFF = 0.0 ELSE XCOFF = -0.5 YCOFF = -0.5 END IF C C---- Plot the string C DO 130 I = 1,NLENG GO TO (60,70,80,90,100) IPLOT 60 CONTINUE CALL GSGCHC(TEXT(I:I),XCOFF,YCOFF,IFONT) GO TO 120 70 CONTINUE LETTER = ICHAR(BYTXT(I)) GO TO 110 80 CONTINUE LETTER = ITEXT2(I) GO TO 110 90 CONTINUE LETTER = ITEXT4(I) GO TO 110 100 CONTINUE CALL GSGCHS(TEXT(I:I),XCOFF,YCOFF,SIZX,SIZY,IFONT) GO TO 120 110 CONTINUE CALL GSGCHI(LETTER,XCOFF,YCOFF,IFONT) 120 CONTINUE 130 CONTINUE 140 CONTINUE RETURN C C---- Format statements C 6000 FORMAT (2X, + '!!!GSSTRC/S ERROR: PLOTTING BLANK OR ZERO LENGTH', + ' STRING ') C END C C C SUBROUTINE GSSTRD(TEXT,DX,DY) C ============================== C C---- Plot char string C C A.D.McLachlan JUL 1984. Last updated 27 JUL 84 C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were NFONTS C C---- Plot a character string with drawing board separations (mm) C C---- ENTRY GSSTRU does same with user unit separations C C Plot the character*(*) variable (text) without trailing blanks C use the current font C use icentc option to centre characters on cursor C but not the string. characters are of size 1.0*1.5 C character units C this routine moves the anchor point for each character C and then restores it. the character cursor is reset to zero C for each character and not restored. C C .. Scalar Arguments .. REAL DX,DY CHARACTER TEXT* (*) C .. C .. Scalars in Common .. REAL ANGFAC,CHANGX,CHANGY,CHRSCX,CHRSCY,CHRSPX,CHRSPY,SCALEX, + SCALEY,USANGX,USANGY,XCHAR,XCSTRT,YCHAR,YCSTRT INTEGER ICENTC,IFONT,KPRINT,LUNIN,LUNOUT LOGICAL*4 FONTIN,ICULNK,LINMOD,UCSPAC C .. C .. Arrays in Common .. REAL CHRMAT,CUMAT,USRMAT INTEGER*2 IFHT,IFSTRT,IFWID,IFX0,IFY0,LENGF INTEGER*1 NFONTS C .. C .. Local Scalars .. REAL CHORGX,CHORGY,CUORGX,CUORGY,DXCHAR,DYCHAR,XCHOLD,XCOFF, + XORIG,YCHOLD,YCOFF,YORIG INTEGER I,NLENG C .. C .. Local Arrays .. INTEGER NCTRAN(24),NSTRAN(24) C .. C .. External Functions .. INTEGER LENSTR EXTERNAL LENSTR C .. C .. External Subroutines .. EXTERNAL GSGCHC C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSCHX/CHRMAT(3,3),CHRSCX,CHRSCY,CHANGX,CHANGY,CHRSPX, + CHRSPY,ICENTC,UCSPAC,IFONT,FONTIN,XCHAR,YCHAR,XCSTRT, + YCSTRT,ANGFAC COMMON /GSFNT/IFSTRT(150,4),LENGF(150,4),IFX0(150,4), + IFY0(150,4),IFWID(150,4),IFHT(150,4),NFONTS(4,3000,4) COMMON /GSUTR/USRMAT(3,3),SCALEX,SCALEY,USANGX,USANGY, + CUMAT(3,3),LINMOD,ICULNK,KPRINT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (XORIG,USRMAT(1,3)), (YORIG,USRMAT(2,3)) EQUIVALENCE (CUORGX,CUMAT(1,3)), (CUORGY,CUMAT(2,3)) EQUIVALENCE (NSTRAN(1),USRMAT(1,1)) EQUIVALENCE (CHORGX,CHRMAT(1,3)), (CHORGY,CHRMAT(2,3)) EQUIVALENCE (NCTRAN(1),CHRMAT(1,1)) C DXCHAR = DX DYCHAR = DY GO TO 10 C ENTRY GSSTRU(TEXT,DX,DY) C ========================= C DXCHAR = USRMAT(1,1)*DX + USRMAT(1,2)*DY DYCHAR = USRMAT(2,1)*DX + USRMAT(2,2)*DY C C---- Save current anchor point C 10 XCHOLD = XCHAR YCHOLD = YCHAR C C---- Zero character cursor C XCSTRT = 0.0 YCSTRT = 0.0 C C---- Remove trailing blanks C NLENG = LENSTR(TEXT) C C---- Check for no letters C IF (NLENG.GT.0) THEN C C---- Set offsets C IF (ICENTC.EQ.0) THEN XCOFF = 0.0 YCOFF = 0.0 ELSE XCOFF = -0.5 YCOFF = -0.5 END IF C C---- Plot the string C DO 20 I = 1,NLENG CALL GSGCHC(TEXT(I:I),XCOFF,YCOFF,IFONT) XCHAR = XCHAR + DXCHAR YCHAR = YCHAR + DYCHAR XCSTRT = 0.0 YCSTRT = 0.0 20 CONTINUE C C---- Restore anchor point values C C XCHAR = XCHOLD YCHAR = YCHOLD ELSE IF (KPRINT.GE.1) THEN WRITE (LUNOUT,FMT=6000) END IF C C---- Format statements C 6000 FORMAT (2X,'!!!GSSTRD/U ERROR: PLOTTING BLANK OR ZERO LENGTH', + ' STRING ') C END C C C SUBROUTINE GSSTYL C ================== C C---- Set plot style constants C C A.D. McLachlan JUL 1984. Last updated 2 OCT 1986 C C .. Scalar Arguments .. REAL X INTEGER ICOLR,LWT,MCOLOR,N C .. C .. Scalars in Common .. REAL ANGFAC,CHANGX,CHANGY,CHRSCX,CHRSCY,CHRSPX,CHRSPY,DOTMMX, + DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWBLMX,DWBLMY,DWLIMX, + DWLIMY,PAPLMX,PAPLMY,UBXMAX,UBXMIN,UBYMAX,UBYMIN,V64LMX, + V64LMY,XCHAR,XCSTRT,YCHAR,YCSTRT INTEGER ICENTC,ICOLOR,IDRLVL,IFONT,IPRINT,IUNIT,IXMAX,IXMIN,IYMAX, + IYMIN,LINWT,LUNIN,LUNOUT,MCNTFL,MDEVIC,MDIREC,MIXCOL,MOUT, + MPIC,MSCAFL,NERROR,NPICS LOGICAL*4 DEVCON,FONTIN,INITON,UCSPAC CHARACTER FILNAM*80,TITLE*80 C .. C .. Arrays in Common .. REAL CHRMAT C .. C .. Local Scalars .. REAL CHORGX,CHORGY,XPAP INTEGER IDOT,IEND,IERAS,ILWT,IPAP,IPEN,IVMODE,IX,IY,NCLCNT C .. C .. Local Arrays .. INTEGER NCTRAN(24) C .. C .. External Subroutines .. EXTERNAL GSDOTM,GSERTM,GSFLWI,GSLVCK,GSRVTM,GSVBRK C .. C .. Intrinsic Functions .. INTRINSIC ABS,NINT C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSCHX/CHRMAT(3,3),CHRSCX,CHRSCY,CHANGX,CHANGY,CHRSPX, + CHRSPY,ICENTC,UCSPAC,IFONT,FONTIN,XCHAR,YCHAR,XCSTRT, + YCSTRT,ANGFAC COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (CHORGX,CHRMAT(1,3)), (CHORGY,CHRMAT(2,3)) EQUIVALENCE (NCTRAN(1),CHRMAT(1,1)) C .. C .. Data statements .. C C---- Plotfile command codes C DATA IEND/-1/,IDOT/-2/,ILWT/-3/,IPEN/-4/,IPAP/-5/,IERAS/-6/ C C---- Check level C IF ((IDRLVL.EQ.0) .OR. (IDRLVL.EQ.3)) + CALL GSLVCK('GSSTYL') LINWT = 1 C C---- Default colour is black C ICOLOR = 1 MIXCOL = 0 NCLCNT = 0 RETURN C ENTRY GSMIXC(MCOLOR) C ===================== C C---- Set for multiple colour plot C should use before picture starts to set header C IF ((MCOLOR.LT.0) .OR. (MCOLOR.GT.1)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6000) MCOLOR MCOLOR = 0 END IF MIXCOL = MCOLOR RETURN C ENTRY GSLNWT(LWT) C ================== C C---- LWT = line weight for all plotting C C---- Allowed to call before picture starts C IF ((LWT.LT.1) .OR. (LWT.GT.9)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6002) LWT LWT = 1 END IF LINWT = LWT IF ((IDRLVL.EQ.3) .AND. (MDIREC.NE.1)) THEN IX = ILWT IY = LWT CALL GSFLWI(IX,IY) END IF RETURN C ENTRY GSCOLR(ICOLR) C ==================== C C---- Allowed to call before picture starts C C Colours for printer system C 1 Black (yellow+red+blue) C 2 Red C 3 Green (yellow+blue) C 4 Blue C 5 Yellow C 6 Orange (yellow+red) C 7 Purple (red+blue) C C---- For device or initialisation not ready C IF ((IDRLVL.EQ.3) .AND. (MDIREC.NE.1)) THEN C C---- Ignore if colour is same as already set and has been called before C IF ((NCLCNT.NE.1) .OR. (ICOLR.NE.ICOLOR)) THEN ICOLOR = ICOLR IX = IPEN IY = ICOLR CALL GSFLWI(IX,IY) NCLCNT = 1 C C---- Vector break C CALL GSVBRK END IF END IF RETURN C ENTRY GSPAPR(X) C ================ C C---- Send out x mm paper of empty lines 100/inch C C---- Set limit of 500.0 on (x) to avoid waste C XPAP = ABS(X) IF (XPAP.GT.500.0) XPAP = 500.0 IF ((IDRLVL.EQ.3) .AND. (MDIREC.NE.1)) THEN IX = IPAP IY = NINT(XPAP/0.254) CALL GSFLWI(IX,IY) END IF RETURN C ENTRY GSFONT(N) C =============== C C---- Set character font C N = 0 simple capital only font style C N = 1 nice block letters (default) C N = 2 italics C N = 3 script C N = 4 greek C IF ((N.LT.0) .OR. (N.GT.4)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6004) N N = 1 END IF IFONT = N RETURN C ENTRY GSERAS() C ============= C C---- Terminal rubout mode C IVMODE = 1 GO TO 10 C ENTRY GSEREV() C ============= C C---- Terminal reverse complement mode black<>white C IVMODE = 2 GO TO 10 C ENTRY GSERAX() C ============= C C---- Terminal end of rubout or reverse mode C IVMODE = 0 10 IF (MDIREC.EQ.0) THEN IX = IERAS IY = IVMODE CALL GSFLWI(IX,IY) C C---- Vector break C CALL GSVBRK END IF C IF ((MDIREC.EQ.1) .AND. (MDEVIC.EQ.3)) THEN IF (IVMODE.EQ.0) CALL GSDOTM IF (IVMODE.EQ.1) CALL GSERTM IF (IVMODE.EQ.2) CALL GSRVTM C C---- Vector break C CALL GSVBRK END IF C C---- Format statements C 6000 FORMAT (2X,'!!!GSMIXC ERROR: MCOLR=',I5,' OUT OF RANGE (0-1)', + ' RESET AS (0)= MONO') 6002 FORMAT (2X,'!!!GSLNWT ERROR: LINWT=',I5,' OUT OF RANGE (1-9)', + ' RESET AS 1=THIN ') 6004 FORMAT (2X,'!!!GSFONT ERROR: IFONT=',I5,' OUT OF RANGE(0-4)', + ' RESET AS 1=BLOCK ') C END C C C SUBROUTINE GSSUSP(MILSEC) C ========================== C C A.D. McLachlan SEP 1984. Last updated 19 SEP 1984. C C---- Real time pause for a given number of millisecs. C equivalent to t.s. horsnell's "suspend" C this integer declaration is necessary C C .. Scalar Arguments .. INTEGER MILSEC C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. INTEGER I CSYS$SETIMR,SYS$WAITFR C .. C .. Local Arrays .. INTEGER*4 NTIME(2) C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C .. C C---- Form quadword time interval. C NTIME(1) = -10000*MILSEC NTIME(2) = -1 I=1 IF (I.EQ.0) THEN call ccperr(1, 'GSSUSP: SETIMR FAILED') ELSE I=1 IF (I.EQ.0) call ccperr(1, 'GSSUSP: WAITFR FAILED') ENDIF C END C C C SUBROUTINE GSSVTM(ITERM,FILNAM) C ================================ C C---- Vt640 screen saved on a disc file in packed byte form. C C A.D. McLachlan SEP 1984. Last updated 22 SEP 1984. C 9/2/90 - PJD: Changed definition of several BYTEs to INTEGER C They were SCREEN C C ITERM = fortran unit number for terminal in graphics package C FILNAM = filename or logical unit number for output C C---- The screen is saved in rows of 128 bytes packed as 5 dots per bit C in the lower bits from left to right. 480 rows use 60*1024 bytes C the diskio direct access routines are used for writing the screen C C The 4010 memory coords (0-1023 in x, 0-780 in y) C are NOT USED here. C This routine uses the physical dot display range C (0-639 in x, 0-479 in y). C The origin is always at the bottom left hand corner of the screen. C C .. Scalar Arguments .. INTEGER ITERM CHARACTER FILNAM* (*) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. REAL SECTOT,SSTAGE CHARACTER*1 ZERO INTEGER ITPRNT,IUNIT,NROW,NRWMAX,NRWMIN,NMCITM C .. C .. Local Arrays .. INTEGER SCREEN(0:127,0:479) C .. C .. External Subroutines .. EXTERNAL GSBFTM,GSGRTM,GSRDTM,GSTIM0,GSTIMR, + QCLOSE,QOPEN,QWRITE C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C ZERO = CHAR(0) ITPRNT = 0 CALL GSTIM0(ITPRNT) C C---- Open output file C CALL QOPEN(IUNIT,FILNAM,'NEW') CALL QMODE (IUNIT,0,NMCITM) WRITE (LUNOUT,FMT=6002) C C---- Put vt640 in graphics mode and clear buffer of vt640 C CALL GSGRTM CALL GSBFTM(ITERM,ZERO) C C---- Read from vt640 memory C 5-bit chars + octal 100 in each byte. loaded to the right. C arranged in 128 columns of 5 dots wide. cols numbered (0:127) C and 480 rows of one dot high numbered (0:479) C origin (0,0) at bottom left of screen C NRWMIN = 0 NRWMAX = 479 CALL GSRDTM(ITERM,NRWMIN,NRWMAX,SCREEN) C C---- Start writing rows C DO 10 NROW = NRWMAX,NRWMIN,-4 CALL QWRITE(IUNIT,SCREEN(0, (NROW-3)),512) 10 CONTINUE C C---- Close disc file C CALL QCLOSE(IUNIT) CALL GSTIMR(SECTOT,SSTAGE,ITPRNT) WRITE (LUNOUT,FMT=6000) SECTOT C C---- Format statements C 6000 FORMAT (2X,'GSSVTM: Save complete . cpu sec = ',F8.2) 6002 FORMAT (2X,'GSSVTM: Started ') C END C C C SUBROUTINE GSSWLN(X1,Y1,X2,Y2,NCODE1,NCODE2,NSWAP) C =================================================== C C A.D. McLachlan JUN 1984 Last updated 10 JUL 1984 C C---- Swaps ends of lines in clipping routine C C .. Scalar Arguments .. REAL X1,X2,Y1,Y2 INTEGER NCODE1,NCODE2,NSWAP C .. C .. Local Scalars .. REAL X,Y INTEGER N C .. NSWAP = -NSWAP X = X1 X1 = X2 X2 = X Y = Y1 Y1 = Y2 Y2 = Y N = NCODE1 NCODE1 = NCODE2 NCODE2 = N C END C C C SUBROUTINE GSTIMR(SECTOT,SSTAGE,ITPRNT) C ======================================== C C---- Plot84 version of "timer" and "time0" C C A.D. McLachlan NOV 1984. Last updated 15 JAN 1986 C C .. Scalar Arguments .. REAL SECTOT,SSTAGE INTEGER ITPRNT C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. REAL SEC,SEC0,SEC1 INTEGER ISEC,ITIME C .. C .. External Functions .. C INTEGER LIB$INIT_TIMER,LIB$STAT_TIMER C EXTERNAL LIB$INIT_TIMER,LIB$STAT_TIMER C .. C .. Intrinsic Functions .. INTRINSIC REAL C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C ITIME = 0 ISEC = 0 Cvax ITIME = LIB$STAT_TIMER(2,ISEC) SEC = REAL(ISEC)/100.0 - SEC0 SECTOT = SEC SSTAGE = SEC - SEC1 SEC1 = SEC IF (ITPRNT.EQ.1) WRITE (LUNOUT,FMT=6000) SECTOT,SSTAGE RETURN C ENTRY GSTIM0(ITPRNT) C ===================== C ITIME = 0 Cvax ITIME = LIB$INIT_TIMER() ITIME = 0 ISEC = 0 Cvax ITIME = LIB$STAT_TIMER(2,ISEC) SEC0 = REAL(ISEC)/100.0 SEC1 = 0.0 IF (ITPRNT.EQ.1) WRITE (LUNOUT,FMT=6002) C C---- Format statements C 6000 FORMAT (1X,'-- TIME -- FOR JOB STEP ',F8.2,' THIS STAGE ',F8.2) 6002 FORMAT (1X,'-- TIME -- STARTED AT 0.0 SECS !!') C END C C C SUBROUTINE GSTMPY(TA,TB,TAB) C ============================= C C---- Multiplies together two plane transformation matrices C C A.D. McLachlan JUL 1984. Last updated 9 JULY 1984. C C---- Each transformation is of the type C ( X2 ) ( A B U ) ( X1 ) C ( Y2 ) * ( C D V ) * ( Y1 ) C (1.0 ) ( 0.0 0.0 1.0 ) (1.0 ) C C .. Array Arguments .. REAL TA(3,3),TAB(3,3),TB(3,3) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. INTEGER I,J C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C DO 20 J = 1,3 DO 10 I = 1,3 TAB(I,J) = TA(I,1)*TB(1,J) + TA(I,2)*TB(2,J) + TA(I,3)*TB(3,J) 10 CONTINUE 20 CONTINUE C END C C C SUBROUTINE GSTRIC(GSFIL,LISFIL,IOFLAG) C ======================================= C C---- Executive routine for tricolour C C adapted from d.a. agard's tricolour plot82 (1982) C C A.D. McLachlan SEP 1984. Last updated 1 OCT 1984 C 9/2/90 - PJD: Changed definition of several BYTEs to INTEGER C They were BRICKS, ICLBRK, LINROW, PAGE C C---- The program reads in the intermediate plot file and C generates a file of line dots to print on trilog printer/plotter C C for multicolour printing each picture is separated into three C primary ink colours which are overprinted: C INK 1 = YELLOW C INK 2 = MAGENTA C INK 3 = CYAN C C colour mixing is controlled by the table ictabl(ink,icolr) C the tints are: C 1 = BLACK Y+M+C C 2 = RED Y+M C 3 = GREEN Y +C C 4 = YELLOW Y C 5 = BLUE M+C C 6 = MAGENTA M C 7 = CYAN C C 8 = (WHITE) Y+M+C (ACTUALLY BLACK AGAIN) C C the maximum page depth is set at 8192 lines (100 per inch) C each line 1536 dots across (6 dots/byte and 256 bytes) C the plotter allows 1320 dots across page (220 bytes) C with a 13-inch paper width only the first 1296 dots (216 bytes) C on each line are used C with 8-inch page depth there are 800 lines per page C C in this version of the program the plot area is divided into C bricks of (48*64) dots or (8*64)=512 bytes C with 32 bricks across the page and 128 up the page C this reduces the number of virtual memory page faults C in plots with many long vectors which run up and down the page C the brick algorithm is 8 times faster than the plot82 trilog C method. C some of the byte-copying of bricks is done in terms of blocks C of character strings C C plot file command codes (ix,iy) revised july 1984 C (I,+J) draw line to (i,j) i,j in range 1 to 32766,not 0. C (I,-J) move to (i,j) C C (-I,J) treat i as a command code, j as a data value C (-1,J) end picture: C put out j pages of paper before next (j=1) C (-2,0) dot C (-3,J) lineweight,thickness j=1...9 C (-4,J) colour change. j defines colour C (-5,J) blank paper, j rows of 1/100 inch height C (-6,J) erase (vt640 only) C j=0 off, j=1 on, j=2 reverse black-white. C C---- Parameters to define the size and numbers of bricks C if these are altered the character*xxx string sizes may C need changing C C---- Picture array as bricks or as rows of bricks C C---- Special for nwidx=8 !! store 8 bytes in one character variable C C---- Output buffer as rows of lines or a row of bricks each 8 bytes wide C C---- whole bricks as blocks of 512(=nsizeb) characters C C---- one brick as characters to clear C C .. Parameters .. INTEGER NWIDX,NWIDY,NBRIKX,NBRIKY PARAMETER (NWIDX=8,NWIDY=64,NBRIKX=32,NBRIKY=128) INTEGER NSIZEB PARAMETER (NSIZEB=NWIDX*NWIDY) INTEGER NBYTX,NBYTX1 PARAMETER (NBYTX=NWIDX*NBRIKX,NBYTX1=NBYTX-1) INTEGER NWIDX1,NWIDY1 PARAMETER (NWIDX1=NWIDX-1,NWIDY1=NWIDY-1) INTEGER NBRKX1,NBRKY1 PARAMETER (NBRKX1=NBRIKX-1,NBRKY1=NBRIKY-1) INTEGER NDOTX PARAMETER (NDOTX=NWIDX*6) REAL DOTMMP PARAMETER (DOTMMP=100.0/25.4) C .. C .. Scalar Arguments .. INTEGER IOFLAG CHARACTER LISFIL* (*),GSFIL* (*) C .. C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWLIMX,DWLIMY INTEGER ICOLOR,IUNITR,IXMAX,IXMIN,IYMAX,IYMIN,LINWT,LUNIN,LUNOUT, + MCNTFL,MDEVIC,MDIREC,MIXCOL,MOUT,MPIC,MSCAFL,NPICS,NREC CHARACTER PASWRD*8,TITLEH*80 C .. C .. Arrays in Common .. REAL SPARE1,SPARE2 INTEGER BRICKS C .. C .. Local Scalars .. REAL SCFACX,SCFACY,SECTOT,SSTAGE,XWID,YWID INTEGER I,IAY,IBRIKX,IBRIKY,IBXMAX,IBXMIN,IBXWID,IBYMAX,IBYMIN, + IBYWID,ICLEAR,IDOT,IEND,IERAS,ILWT,IND,INK,IPAP,IPEN, + IPRINT,IPXMAX,IPXMIN,IPY,IPY0,IPY1,IPYBOT,IPYTOP,IRECX, + ITINT,IUNIT,IX,IXOLD,IY,IYOLD,JBYMAX,JBYMIN,JX,JXOLD,JY, + JYMAX,JYMIN,JYOLD,KEOF,KKEOF,LL,MAXDTX,MAXLNY,MPAGES, + MSKIP,NBACK,NBPG,NBXOFF,NBXWID,NDOT,NFORM,NLINPG,NLINU, + NLINY,NLNSKP,NMARGY,NPAGES,NPLOT,NREAD LOGICAL FIRST,IRET,START,STCOL CHARACTER CLRBRK*512 C .. C .. Local Arrays .. INTEGER ICTABL(3,8),ICV(3),IYRB(3),LOFFX(8),LOFFY(8) INTEGER ICLBRK(512),LINROW(0:NBYTX1,0:NWIDY1), + PAGE(0:NBYTX1,0:NWIDY1,0:NBRKY1) CHARACTER CBRIKS(0:NWIDY1,0:NBRKX1,0:NBRKY1)*8, + LLBROW(0:NBRKX1,0:NWIDY1)*8, + HOLBRK(0:NBRKX1,0:NBRKY1)*512 C .. C .. External Subroutines .. EXTERNAL CLOSETRIPLOT,INITRIPLOT,GSCFIL,GSFLBR, + GSFLRI,GSLRSB,GSOFLR,GSRHDR,GSTIM0, + GSTIMR,TRICOLOUR,TRIFORM,TRIPLOT,TRIPLOTC,TRIROW C .. C .. Intrinsic Functions .. INTRINSIC ABS,MIN,REAL C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSFHD/ + IUNITR, NREC, DOTMMX, DOTMMY, IXMIN, IXMAX, IYMIN, + IYMAX, LINWT, ICOLOR, MIXCOL, MDEVIC, MDIREC, MOUT, + MPIC, MSCAFL, MCNTFL, DWLIMX, DWLIMY, DVXMIN, DVXMAX, + DVYMIN, DVYMAX, NPICS, + PASWRD, + SPARE1(15), + TITLEH, + SPARE2(68) COMMON /GSRAS/BRICKS(0:NWIDX1,0:NWIDY1,0:NBRKX1,0:NBRKY1) C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (BRICKS(0,0,0,0),PAGE(0,0,0)) EQUIVALENCE (CBRIKS(0,0,0),BRICKS(0,0,0,0)) EQUIVALENCE (LINROW(0,0),LLBROW(0,0)) EQUIVALENCE (HOLBRK(0,0),BRICKS(0,0,0,0)) EQUIVALENCE (CLRBRK,ICLBRK(1)) C .. C .. Data statements .. DATA ICLBRK/512*64/ C C---- plotfile command codes C DATA IEND/-1/,IDOT/-2/,ILWT/-3/,IPEN/-4/,IPAP/-5/,IERAS/-6/ DATA LOFFX/1,0,-1,0,2,-2,-3,3/ DATA LOFFY/0,1,0,-1,2,-2,3,-3/ DATA MAXLNY/8191/,MAXDTX/1295/ DATA NLINPG/800/,NBPG/216/ DATA ICV/0,0,1/ DATA ICTABL/1,1,1,1,1,0,1,0,1,1,0,0,0,1,1,0,1,0,0,0,1,1,1,1/ C C---- Default tint is cyan C---- 1,1,1, Black C 1,1,0, Red C 1,0,1, Green C 1,0,0, Yellow C 0,1,1, Blue C 0,1,0, Magenta C 0,0,1, Cyan C 1,1,1 Black-white C IPRINT = 0 CALL GSTIM0(IPRINT) C C---- Start up plotfile and printer C CALL GSOFLR(IUNIT,GSFIL) C C---- ioflag=1,0 .ioflag=(1) C then batch jobs have file opened 'tr' and C must be part of sys$output or sys$print C ioflag=(0) C then all jobs have file opened as 'pd'=print/delete. C ioflag=0 C for normal trilog. ioflag=1 for trilogq program. C CALL INITRIPLOT(2,LISFIL,IOFLAG) 10 CONTINUE C C---- Start of current picture C FIRST = .TRUE. STCOL = .TRUE. DO 20 I = 1,3 IYRB(I) = 0 20 CONTINUE NFORM = 1 NLNSKP = 0 KEOF = 0 CALL GSRHDR(KEOF) IF (KEOF.NE.1) THEN IF (NREC.GT.0) THEN C C---- Default ink colour set as cyan C ICOLOR = 3 C C---- Rescale for different dot densities C SCFACX = DOTMMP/DOTMMX SCFACY = DOTMMP/DOTMMY IXMIN = REAL(IXMIN)*SCFACX IXMAX = REAL(IXMAX)*SCFACX IYMIN = REAL(IYMIN)*SCFACY IYMAX = REAL(IYMAX)*SCFACY C C---- Check size of plot and reduce if too big C rescaling may make ixmin,iymin zero C IF ((IXMIN.LT.0) .OR. (IXMAX.GT.MAXDTX) .OR. (IYMIN.LT.0) .OR. + (IYMAX.GT.MAXLNY)) WRITE (LUNOUT,FMT=6010) MAXDTX,MAXLNY, + IXMIN,IXMAX,IYMIN,IYMAX IF (IXMIN.LT.1) IXMIN = 1 IF (IXMAX.LT.IXMIN) IXMAX = IXMIN IF (IXMAX.GT.MAXDTX) IXMAX = MAXDTX IF (IYMIN.LT.1) IYMIN = 1 IF (IYMAX.LT.IYMIN) IYMAX = IYMIN IF (IYMAX.GT.MAXLNY) IYMAX = MAXLNY C C---- Brick limits across page C note ix=1...1295 but ibx=0...31 C IBXMIN = IXMIN/NDOTX IBXMAX = IXMAX/NDOTX IBXWID = IBXMAX - IBXMIN + 1 XWID = IBXWID*NDOTX XWID = XWID/DOTMMP C C---- Brick limits up and down C note it=1...8191 but iby=0...127 C IBYMIN = IYMIN/NWIDY IBYMAX = IYMAX/NWIDY IBYWID = IBYMAX - IBYMIN + 1 NLINY = IYMAX - IYMIN + 1 YWID = NLINY YWID = YWID/DOTMMP C C---- Centre up and down if only one page C lines used in the occupied bricks C NLINU = NLINY NPAGES = (NLINU-1)/NLINPG + 1 NMARGY = (NPAGES*NLINPG-NLINU)/2 C C---- Center along x: calculate offsets in bytes (6 dots/byte) C IPXMIN = IXMIN/6 IPXMAX = IXMAX/6 NBXWID = MIN((IPXMAX-IPXMIN+1),NBPG) NBXOFF = (NBPG-NBXWID)/2 C C---- Type information about picture C WRITE (LUNOUT,FMT=6000) NREC,ICOLOR,MIXCOL WRITE (LUNOUT,FMT=6002) IXMIN,IXMAX,IYMIN,IYMAX 30 CONTINUE C C---- Start on this colour pass. set constants and clear output array C NPLOT = 0 JYMIN = MAXLNY JYMAX = 0 START = .TRUE. IXOLD = 0 IYOLD = 0 NREAD = 0 NLNSKP = 0 C C---- Clear required rows of bricks C DO 50 IBRIKY = IBYMIN,IBYMAX DO 40 IBRIKX = IBXMIN,IBXMAX HOLBRK(IBRIKX,IBRIKY) = CLRBRK 40 CONTINUE 50 CONTINUE C C---- Start on this plot C---- Ndot remembers when a dot code was last issued C NDOT = 0 DO 100 IRECX = 1,NREC KKEOF = 0 CALL GSFLRI(IX,IY,KKEOF) IF (KKEOF.EQ.1) THEN GO TO 130 ELSE NREAD = NREAD + 1 NDOT = NDOT - 1 C C---- Handle control info C IF (IX.GE.0) THEN C C---- End of control record handling C if ink not yet defined in this pass call tricolour C IF (START) THEN CALL TRICOLOUR(ICOLOR) STCOL = .FALSE. START = .FALSE. END IF C C---- Test if this colour data is wanted C IF (ICV(ICOLOR).NE.0) THEN NPLOT = NPLOT + 1 C C---- Update limits of y for this pass C IAY = ABS(IY) IF (IAY.LT.JYMIN) JYMIN = IAY IF (IAY.GT.JYMAX) JYMAX = IAY C C---- Here for actual plot handling C IX = REAL(IX)*SCFACX IF (IY.LT.0) THEN IXOLD = IX IYOLD = REAL(-IY)*SCFACY ELSE IY = REAL(IY)*SCFACY IF (NDOT.LT.1) THEN CALL GSLRSB(IX,IY,IXOLD,IYOLD) ELSE CALL GSLRSB(IX,IY,IX,IY) END IF C C---- Here for multiple wt lines C IF (LINWT.GT.1) THEN LL = LINWT - 1 IF (LL.LT.2) LL = 2 DO 60 IND = 1,LL JX = LOFFX(IND) + IX JXOLD = LOFFX(IND) + IXOLD IF (JX.LT.IXMIN) JX = IXMIN IF (JX.GT.IXMAX) JX = IXMAX IF (JXOLD.LT.IXMIN) JXOLD = IXMIN IF (JXOLD.GT.IXMAX) JXOLD = IXMAX JY = LOFFY(IND) + IY JYOLD = LOFFY(IND) + IYOLD IF (JY.LT.IYMIN) JY = IYMIN IF (JY.GT.IYMAX) JY = IYMAX IF (JYOLD.LT.IYMIN) JYOLD = IYMIN IF (JYOLD.GT.IYMAX) JYOLD = IYMAX IF (NDOT.LT.1) THEN CALL GSLRSB(JX,JY,JXOLD,JYOLD) ELSE CALL GSLRSB(JX,JY,JX,JY) END IF 60 CONTINUE END IF IXOLD = IX IYOLD = IY END IF END IF ELSE IF (IX.EQ.IEND) THEN GO TO 110 ELSE IF (IX.EQ.IDOT) THEN NDOT = 2 ELSE IF (IX.EQ.ILWT) THEN LINWT = IY C C---- colour control C ELSE IF (IX.EQ.IPEN) THEN C C---- monochrome plots done in blue C ITINT = IY IF (MIXCOL.EQ.0) ITINT = 4 DO 70 INK = 1,3 ICV(INK) = ICTABL(INK,ITINT) 70 CONTINUE C C---- Record inks needed for this plot on the first pass C IF (FIRST) THEN DO 80 INK = 1,3 IF (ICV(INK).EQ.1) IYRB(INK) = 1 80 CONTINUE END IF C C---- if ink needs to be set choose first one required for current tint C IF (STCOL) THEN INK = 1 90 CONTINUE IF ((ICV(INK).EQ.0) .AND. (INK.LT.3)) THEN INK = INK + 1 GO TO 90 END IF ICOLOR = INK END IF C ELSE IF (IX.EQ.IPAP) THEN CALL TRIROW(IY) NLNSKP = NLNSKP + IY C C---- Ignore ix=ieras on paper plotter C END IF END IF 100 CONTINUE C GO TO 120 110 NFORM = IY IF (NREAD.EQ.1) NREAD = 0 C C---- End of records loop C 120 CONTINUE IRET = .TRUE. GO TO 140 C C---- Output section C 130 CONTINUE WRITE (LUNOUT,FMT=6006) NREC,NREAD IRET = .FALSE. C 140 IF (NREAD.EQ.0) THEN GO TO 220 ELSE WRITE (LUNOUT,FMT=6004) NREAD,ICOLOR,NPLOT IF (NLNSKP.GT.0) NMARGY = 0 IF (JYMIN.LT.IYMIN) JYMIN = IYMIN IF (JYMAX.GT.IYMAX) JYMAX = IYMAX MSKIP = NMARGY + IYMAX - JYMAX C C---- If no plotfile line skips call C trirow to skip lines and centre the page C CALL TRIROW(MSKIP) C C---- brick limits for this colour C JBYMAX = JYMAX/NWIDY JBYMIN = JYMIN/NWIDY C C---- positions of extreme lines used in top and bottom bricks C IPYTOP = JYMAX - JBYMAX*NWIDY IPYBOT = JYMIN - JBYMIN*NWIDY C C---- get a row of bricks at a time in reverse order of rows C DO 180 IBRIKY = JBYMAX,JBYMIN,-1 C C---- rearrange contents of each brick into lines 8 bytes at a time C IPY0 = 0 IPY1 = NWIDY1 IF (IBRIKY.EQ.JBYMAX) IPY1 = IPYTOP IF (IBRIKY.EQ.JBYMIN) IPY0 = IPYBOT DO 160 IPY = IPY0,IPY1 DO 150 IBRIKX = 0,NBRKX1 LLBROW(IBRIKX,IPY) = CBRIKS(IPY,IBRIKX,IBRIKY) 150 CONTINUE 160 CONTINUE C C---- print a row of bricks as lines from the buffer in reverse order C DO 170 IPY = IPY1,IPY0,-1 CALL TRIPLOTC(LINROW(IPXMIN,IPY),NBXWID,NBXOFF) 170 CONTINUE 180 CONTINUE C C---- lines just plotted went from iymax (with skip to jymax) to jymin C they used mpages pages C MPAGES = (IYMAX-JYMIN+NLINPG)/NLINPG C C---- set up for next pass C FIRST = .FALSE. C C---- last ink now done C IYRB(ICOLOR) = 0 C C---- select next ink C DO 190 INK = 1,3 IF (IYRB(INK).EQ.1) GO TO 200 190 CONTINUE GO TO 210 200 ICOLOR = INK C C---- skip back in plot file C CALL GSFLBR(4*NREC) C C---- skip back on paper C C original had this, but NSKIP isn't defined. Heaven knows C what this should be: CCC NBACK = - (NSKIP+IYMAX-JYMIN)/NLINPG - 1 NBACK = - (IYMAX-JYMIN)/NLINPG - 1 CALL TRIFORM(NBACK) CALL TRIROW(-20) CALL TRIFORM(1) GO TO 30 END IF C C---- wind on to clear whole picture out of printer C 210 NFORM = NFORM + NPAGES - MPAGES CALL TRIFORM(NFORM) C CALL GSTIMR(SECTOT,SSTAGE,IPRINT) WRITE (LUNOUT,FMT=6008) NREAD,XWID,YWID,SECTOT C C---- for next picture C IF (IRET) GO TO 10 END IF END IF C 220 CONTINUE C C---- finally reset ink to cyan C CALL TRICOLOUR(3) CALL TRIPLOT(ICLEAR,1) CALL GSCFIL(IUNIT) CALL CLOSETRIPLOT C C---- Format statements C 6000 FORMAT (' Plot Records = ',I6,' Ink colour = ',I6,' Mixed Colour', + ' = ',I6) 6002 FORMAT (' IXMIN IXMAX = ',2I8,' IYMIN IYMAX = ',2I8) 6004 FORMAT (' TRICOLOUR: Records read = ',I10,' Ink = ',I6,' Points ', + 'drawn = ',I10) 6006 FORMAT (2X,'TRILOG: End-file error reading plot records: expecte', + 'd,found=',2I8) 6008 FORMAT (2X,'TRILOG:',I8,' records read; area used(mm) =',2F7.0, + '; cpu sec',F6.2) 6010 FORMAT (2X,'!!!TRILOG: Warning; plot too big for X Y dot ranges ', + 2I5,/13X,'uses X1 X2 Y1 Y2 = ',4I6) C END C C C SUBROUTINE GSTRIL(GSFIL,LISFIL,IOFLAG) C ======================================== C C---- executive routine for trilog84 C C adapted from d.a. agard's trilog plot82 (1982) C C A.D. McLachlan JUN 1984. Last updated 21 OCT 1984 C 9/2/90 - PJD: Changed definition of several BYTEs to INTEGER C They were BRICKS, ICLBRK, LINROW, PAGE C C---- the program reads in the intermediate plot file and C generates a file of line dots to print on trilog printer/plotter C C the maximum page depth is set at 8192 lines (100 per inch) C each line 1536 dots across (6 dots/byte and 256 bytes) C the plotter allows 1320 dots across page (220 bytes) C with a 13-inch paper width only the first 1296 dots (216 bytes) C on each line are used C with 8-inch page depth there are 800 lines per page C C in this version of the program the plot area is divided into C bricks of (48*64) dots or (8*64)=512 bytes C with 32 bricks across the page and 128 up the page C this reduces the number of virtual memory page faults C in plots with many long vectors which run up and down the page C the brick algorithm is 8 times faster than the plot82 trilog C method. C some of the byte-copying of bricks is done in terms of blocks C of character strings C C plot file command codes (ix,iy) revised july 1984 C (I,+J) DRAW LINE TO (I,J) I,J IN RANGE 1 TO 32766,NOT 0. C (I,-J) MOVE TO (I,J) C C (-I,J) TREAT I AS A COMMAND CODE, J AS A DATA VALUE C (-1,J) END PICTURE: C PUT OUT J PAGES OF PAPER BEFORE NEXT (J=1) C (-2,0) DOT C (-3,J) LINEWEIGHT,THICKNESS J=1...9 C (-4,J) COLOUR CHANGE. J DEFINES COLOUR C (-5,J) BLANK PAPER, J ROWS OF 1/100 INCH HEIGHT C (-6,J) ERASE (VT640 ONLY) C J=0 OFF, J=1 ON, J=2 REVERSE BLACK-WHITE. C C parameters to define the size and numbers of bricks C if these are altered the character*xxx string sizes may C need changing C C---- Picture array as bricks or as rows of bricks C C---- special for nwidx=8 !! store 8 bytes in one character variable C C---- output buffer as rows of lines or a row of bricks each 8 bytes wide C C---- whole bricks as blocks of 512(=nsizeb) characters C C---- one brick as characters to clear C C .. Parameters .. INTEGER NWIDX,NWIDY,NBRIKX,NBRIKY PARAMETER (NWIDX=8,NWIDY=64,NBRIKX=32,NBRIKY=128) INTEGER NSIZEB PARAMETER (NSIZEB=NWIDX*NWIDY) INTEGER NBYTX,NBYTX1 PARAMETER (NBYTX=NWIDX*NBRIKX,NBYTX1=NBYTX-1) INTEGER NWIDX1,NWIDY1 PARAMETER (NWIDX1=NWIDX-1,NWIDY1=NWIDY-1) INTEGER NBRKX1,NBRKY1 PARAMETER (NBRKX1=NBRIKX-1,NBRKY1=NBRIKY-1) INTEGER NDOTX PARAMETER (NDOTX=NWIDX*6) REAL DOTMMP PARAMETER (DOTMMP=100.0/25.4) C .. C .. Scalar Arguments .. INTEGER IOFLAG CHARACTER LISFIL* (*),GSFIL* (*) C .. C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWLIMX,DWLIMY INTEGER ICOLOR,IUNITR,IXMAX,IXMIN,IYMAX,IYMIN,LINWT,LUNIN,LUNOUT, + MCNTFL,MDEVIC,MDIREC,MIXCOLOR,MOUT,MPIC,MSCAFL,NPICS,NREC, + MIXCOL CHARACTER PASWRD*8,TITLEH*80 C .. C .. Arrays in Common .. REAL SPARE1,SPARE2 INTEGER BRICKS C .. C .. Local Scalars .. REAL SCFACX,SCFACY,SECTOT,SSTAGE,XWID,YWID INTEGER IBRIKX,IBRIKY,IBXMAX,IBXMIN,IBXWID,IBYMAX,IBYMIN,IBYWID, + IDOT,IEND,IERAS,ILWT,IND,IPAP,IPEN,IPRINT,IPXMAX,IPXMIN, + IPY,IPY0,IPY1,IPYBOT,IPYTOP,IRECX, + ISTREM,IUNIT,IX,IXOLD,IY, + IYOLD,JX,JXOLD,JY,JYOLD,KEOF,KKEOF,LL,MAXDTX,MAXLNY,NBPG, + NBXOFF,NBXWID,NDOT,NFORM,NLINPG,NLINU,NLINY,NLNSKP,NMARGY, + NPAGES,NREAD,NSPARE LOGICAL IRET CHARACTER CLRBRK*512 C .. C .. Local Arrays .. INTEGER LOFFX(8),LOFFY(8) INTEGER ICLBRK(512),LINROW(0:NBYTX1,0:NWIDY1), + PAGE(0:NBYTX1,0:NWIDY1,0:NBRKY1) CHARACTER CBRIKS(0:NWIDY1,0:NBRKX1,0:NBRKY1)*8, + LLBROW(0:NBRKX1,0:NWIDY1)*8, + HOLBRK(0:NBRKX1,0:NBRKY1)*512 C .. C .. External Subroutines .. EXTERNAL CLOSETRIPLOT,INITRIPLOT,GSCFIL, + GSFLRI,GSLRSB,GSOFLR, + GSRHDR,GSTIM0,GSTIMR, + TRICOLOUR,TRIFORM,TRIPLOTC,TRIROW C .. C .. Intrinsic Functions .. INTRINSIC MIN,REAL C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSFHD/ + IUNITR, NREC, DOTMMX, DOTMMY, IXMIN, IXMAX, IYMIN, + IYMAX, LINWT, ICOLOR, MIXCOL, MDEVIC, MDIREC, MOUT, + MPIC, MSCAFL, MCNTFL, DWLIMX, DWLIMY, DVXMIN, DVXMAX, + DVYMIN, DVYMAX, NPICS, + PASWRD, + SPARE1(15), + TITLEH, + SPARE2(68) COMMON /GSRAS/BRICKS(0:NWIDX1,0:NWIDY1,0:NBRKX1,0:NBRKY1) C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (BRICKS(0,0,0,0),PAGE(0,0,0)) EQUIVALENCE (CBRIKS(0,0,0),BRICKS(0,0,0,0)) EQUIVALENCE (LINROW(0,0),LLBROW(0,0)) EQUIVALENCE (HOLBRK(0,0),BRICKS(0,0,0,0)) EQUIVALENCE (CLRBRK,ICLBRK(1)) C .. C .. Data statements .. DATA ICLBRK/512*64/ C C---- plotfile command codes C DATA IEND/-1/,IDOT/-2/,ILWT/-3/,IPEN/-4/,IPAP/-5/,IERAS/-6/ DATA LOFFX/1,0,-1,0,2,-2,-3,3/ DATA LOFFY/0,1,0,-1,2,-2,3,-3/ DATA MAXLNY/8191/,MAXDTX/1295/ DATA NLINPG/800/,NBPG/216/ DATA NSPARE/20/ C C---- for a genuine plot84 file paswrd = 'plot%%84' C IPRINT = 0 CALL GSTIM0(IPRINT) C C---- start up plotfile and printer C CALL GSOFLR(IUNIT,GSFIL) C C---- ioflag=1,0 .ioflag=(1) C then batch jobs have file opened 'tr' and C must be part of sys$output or sys$print C ioflag=(0) C then all jobs have file opened as 'pd'=print/delete. C normal trilog uses ioflag=0. trilogq uses ioflag=1 C ISTREM = 2 CALL INITRIPLOT(ISTREM,LISFIL,IOFLAG) 10 CONTINUE C C C---- start of current picture C---- skip nspare lines at start of first page C in addition to nmargy later C CALL TRIROW(NSPARE) NFORM = 1 NLNSKP = 0 KEOF = 0 CALL GSRHDR(KEOF) IF (KEOF.NE.1) THEN IF (NREC.GT.0) THEN C C---- Rescale for different dot densities C SCFACX = DOTMMP/DOTMMX SCFACY = DOTMMP/DOTMMY IXMIN = REAL(IXMIN)*SCFACX IXMAX = REAL(IXMAX)*SCFACX IYMIN = REAL(IYMIN)*SCFACY IYMAX = REAL(IYMAX)*SCFACY C C---- check size of plot and reduce if too big C rescaling may make ixmin,iymin zero C IF ((IXMIN.LT.0) .OR. (IXMAX.GT.MAXDTX) .OR. (IYMIN.LT.0) .OR. + (IYMAX.GT.MAXLNY)) WRITE (LUNOUT,FMT=6004) MAXDTX,MAXLNY, + IXMIN,IXMAX,IYMIN,IYMAX IF (IXMIN.LT.1) IXMIN = 1 IF (IXMAX.LT.IXMIN) IXMAX = IXMIN IF (IXMAX.GT.MAXDTX) IXMAX = MAXDTX IF (IYMIN.LT.1) IYMIN = 1 IF (IYMAX.LT.IYMIN) IYMAX = IYMIN IF (IYMAX.GT.MAXLNY) IYMAX = MAXLNY C C---- brick limits across page C note ix=1...1295 but ibx=0...31 C thus brick number 0 goes from ix=0 to 47 C IBXMIN = IXMIN/NDOTX IBXMAX = IXMAX/NDOTX IBXWID = IBXMAX - IBXMIN + 1 XWID = IBXWID*NDOTX XWID = XWID/DOTMMP C C---- brick limits up and down C note iy=1...8191 but iby=0...127 C thus brick number 0 goes from iy=0 to 63 C and its bottom line is not used C IBYMIN = IYMIN/NWIDY IBYMAX = IYMAX/NWIDY IBYWID = IBYMAX - IBYMIN + 1 NLINY = IYMAX - IYMIN + 1 YWID = NLINY YWID = YWID/DOTMMP C C---- Centre up and down if only one page C lines used in the occupied bricks C NLINU = NLINY + NSPARE NPAGES = (NLINU-1)/NLINPG + 1 NMARGY = (NPAGES*NLINPG-NLINU)/2 C C---- positions of extreme lines used in top and bottom bricks C IPYTOP = IYMAX - IBYMAX*NWIDY IPYBOT = IYMIN - IBYMIN*NWIDY C C---- center along x: calculate offsets in bytes (6 dots/byte) C IPXMIN = IXMIN/6 IPXMAX = IXMAX/6 NBXWID = MIN((IPXMAX-IPXMIN+1),NBPG) NBXOFF = (NBPG-NBXWID)/2 C C C---- Clear required rows of bricks C DO 30 IBRIKY = IBYMIN,IBYMAX DO 20 IBRIKX = IBXMIN,IBXMAX HOLBRK(IBRIKX,IBRIKY) = CLRBRK 20 CONTINUE 30 CONTINUE C C---- Start on this plot C IXOLD = 0 IYOLD = 0 NREAD = 0 C C---- ndot remembers when a dot code was last issued C NDOT = 0 DO 50 IRECX = 1,NREC KKEOF = 0 CALL GSFLRI(IX,IY,KKEOF) IF (KKEOF.EQ.1) THEN GO TO 80 ELSE NREAD = NREAD + 1 NDOT = NDOT - 1 C C---- handle control info C IF (IX.GE.0) THEN C C---- here for actual plot handling C IX = REAL(IX)*SCFACX IF (IY.LT.0) THEN IXOLD = IX IYOLD = REAL(-IY)*SCFACY ELSE IY = REAL(IY)*SCFACY IF (NDOT.LT.1) THEN CALL GSLRSB(IX,IY,IXOLD,IYOLD) ELSE CALL GSLRSB(IX,IY,IX,IY) END IF C C---- here for multiple wt lines C IF (LINWT.GT.1) THEN LL = LINWT - 1 IF (LL.LT.2) LL = 2 DO 40 IND = 1,LL JX = LOFFX(IND) + IX JXOLD = LOFFX(IND) + IXOLD IF (JX.LT.IXMIN) JX = IXMIN IF (JX.GT.IXMAX) JX = IXMAX IF (JXOLD.LT.IXMIN) JXOLD = IXMIN IF (JXOLD.GT.IXMAX) JXOLD = IXMAX JY = LOFFY(IND) + IY JYOLD = LOFFY(IND) + IYOLD IF (JY.LT.IYMIN) JY = IYMIN IF (JY.GT.IYMAX) JY = IYMAX IF (JYOLD.LT.IYMIN) JYOLD = IYMIN IF (JYOLD.GT.IYMAX) JYOLD = IYMAX IF (NDOT.LT.1) THEN CALL GSLRSB(JX,JY,JXOLD,JYOLD) ELSE CALL GSLRSB(JX,JY,JX,JY) END IF 40 CONTINUE END IF IXOLD = IX IYOLD = IY END IF ELSE IF (IX.EQ.IEND) THEN GO TO 60 ELSE IF (IX.EQ.IDOT) THEN NDOT = 2 ELSE IF (IX.EQ.ILWT) THEN LINWT = IY ELSE IF (IX.EQ.IPEN) THEN ICOLOR = 3 IF (IY.EQ.2) ICOLOR = 2 IF (IY.EQ.5) ICOLOR = 1 CALL TRICOLOUR(ICOLOR) ELSE IF (IX.EQ.IPAP) THEN CALL TRIROW(IY) C C---- ignore ix=ieras on paper plotter C NLNSKP = NLNSKP + IY END IF END IF 50 CONTINUE C GO TO 70 60 NFORM = IY IF (NREAD.EQ.1) NREAD = 0 C C---- end of records loop C 70 CONTINUE IRET = .TRUE. GO TO 90 C C---- output section C 80 CONTINUE WRITE (LUNOUT,FMT=6000) NREC,NREAD IRET = .FALSE. C 90 IF (NREAD.NE.0) THEN C C---- if no plotfile line skips call trirow C to skip lines and centre the page if there is only one page C IF ((NLNSKP.EQ.0) .AND. (NPAGES.LE.1)) CALL TRIROW(NMARGY) C C---- get a row of bricks at a time in reverse order of rows C DO 130 IBRIKY = IBYMAX,IBYMIN,-1 C C---- rearrange contents of each brick into lines 8 bytes at a time C IPY0 = 0 IPY1 = NWIDY1 IF (IBRIKY.EQ.IBYMAX) IPY1 = IPYTOP IF (IBRIKY.EQ.IBYMIN) IPY0 = IPYBOT DO 110 IPY = IPY0,IPY1 DO 100 IBRIKX = 0,NBRKX1 LLBROW(IBRIKX,IPY) = CBRIKS(IPY,IBRIKX,IBRIKY) 100 CONTINUE 110 CONTINUE C C---- print a row of bricks as lines from the buffer in reverse order C DO 120 IPY = IPY1,IPY0,-1 CALL TRIPLOTC(LINROW(IPXMIN,IPY),NBXWID,NBXOFF) 120 CONTINUE 130 CONTINUE CALL TRIFORM(NFORM) C CALL GSTIMR(SECTOT,SSTAGE,IPRINT) WRITE (LUNOUT,FMT=6002) NREAD,XWID,YWID,SECTOT C C---- for next picture C IF (IRET) GO TO 10 END IF END IF END IF C CALL GSCFIL(IUNIT) CALL CLOSETRIPLOT C C---- Format statements C 6000 FORMAT (2X,'TRILOG: End-file error reading plot records: expecte', + 'd,found=',2I8) 6002 FORMAT (2X,'TRILOG:',I8,' records read; area used(mm) =',2F7.0, + '; cpu sec',F6.2) 6004 FORMAT (2X,'!!!TRILOG: Warning; plot too big for X Y dot ranges ', + 2I5,/13X,'uses X1 X2 Y1 Y2 = ',4I6) C END C C C SUBROUTINE GSTSAV(NTRSAV) C ========================== C C---- save plot transformation and postion variables C C A.D. McLachlan JUL 1984. Last updated 27 JUL 1984 C C---- definitions of common blocks C <> ((user transformation variables)) C USRMAT(3,3) = user scaling matrix: C XDRW=USRMAT(1,1)*XU+USRMAT(1,2)*YU + XORIG C YDRW=USRMAT(2,1)*XU+USRMAT(2,2)*YU + YORIG C XORIG:=: USRMAT(1,3) YORIG:=: USRMAT(2,3) C XORIG,YORIG = user origin on drawing board (mm) C C SCALEX,SCALEY = mm equiv of 1 user unit along local x,y C USANGX,USANGY = angles of local user axes (radians) C CUMAT(3,3) = character*user scaling matrix C CUORGX:=:CUMAT(1,3) CUORGY:=:CUMAT(2,3) C CUORGX,CUORGY = character*user origin value C LINMOD = .TRUE. for line mode C ICULNK = .TRUE. for user char trans linked C NSTRAN(24) = array equivalent to (usrmat...iculnk) C KPRINT = print control, copy of iprint for some C routines C C <> ((character position variables)) C CHRMAT(3,3) = character transformation matrix C CHORGX:=:CHRMAT(1,3) CHORGY:=:CHRMAT(2,3) C CHORGX,CHORGY = character origin in char units C relative to (xchar,ychar) C CHRSCX,CHRSCY = char width and height in character units C (default=3.0) C CHANGX,CHANGY = angles of char x and y (radians) C CHRSPX,CHRSPY = character space extra values C ICENTC = character centering control C UCSPAC = .true. for uniform spacing C IFONT = font number C FONTIN = .true. after font tables read in C XCHAR,YCHAR = character anchor point C XCSTRT,YCSTRT = character cursor position C relative to anchor point C in character units on character grid C ANGFAC = pi/180.0 degrees to radians C NCTRAN(24) = array equivalent to (chrmat...angfac) C C---- Copy common note that kprint is not saved C C .. Array Arguments .. INTEGER NTRSAV(48) C .. C .. Scalars in Common .. REAL ANGFAC,CHANGX,CHANGY,CHRSCX,CHRSCY,CHRSPX,CHRSPY,SCALEX, + SCALEY,USANGX,USANGY,XCHAR,XCSTRT,YCHAR,YCSTRT INTEGER ICENTC,IFONT,KPRINT,LUNIN,LUNOUT LOGICAL*4 FONTIN,ICULNK,LINMOD,UCSPAC C .. C .. Arrays in Common .. REAL CHRMAT,CUMAT,USRMAT C .. C .. Local Scalars .. REAL CHORGX,CHORGY,CUORGX,CUORGY,XORIG,YORIG INTEGER I C .. C .. Local Arrays .. INTEGER NCTRAN(24),NSTRAN(24) C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSCHX/CHRMAT(3,3),CHRSCX,CHRSCY,CHANGX,CHANGY, + CHRSPX,CHRSPY,ICENTC,UCSPAC,IFONT,FONTIN,XCHAR,YCHAR, + XCSTRT,YCSTRT,ANGFAC COMMON /GSUTR/USRMAT(3,3),SCALEX,SCALEY,USANGX,USANGY, + CUMAT(3,3),LINMOD,ICULNK,KPRINT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (XORIG,USRMAT(1,3)), (YORIG,USRMAT(2,3)) EQUIVALENCE (CUORGX,CUMAT(1,3)), (CUORGY,CUMAT(2,3)) EQUIVALENCE (NSTRAN(1),USRMAT(1,1)) EQUIVALENCE (CHORGX,CHRMAT(1,3)), (CHORGY,CHRMAT(2,3)) EQUIVALENCE (NCTRAN(1),CHRMAT(1,1)) C DO 10 I = 1,24 NTRSAV(I) = NSTRAN(I) 10 CONTINUE DO 20 I = 1,24 NTRSAV(24+I) = NCTRAN(I) 20 CONTINUE RETURN C ENTRY GSTRES(NTRSAV) C ===================== C C---- Restore common C DO 30 I = 1,24 NSTRAN(I) = NTRSAV(I) 30 CONTINUE DO 40 I = 1,24 NCTRAN(I) = NTRSAV(24+I) 40 CONTINUE C END C C C SUBROUTINE GSTYON C ================== C C---- Change terminal to or from teletype mode in interactive plotting C C A.D. McLachlan SEP 1984. Last updated 3 OCT 1984 C C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWBLMX,DWBLMY, + DWLIMX,DWLIMY,PAPLMX,PAPLMY,UBXMAX,UBXMIN,UBYMAX,UBYMIN, + V64LMX,V64LMY INTEGER ICOLOR,IDRLVL,IPRINT,IUNIT,IXMAX,IXMIN,IYMAX,IYMIN,LINWT, + LUNIN,LUNOUT,MCNTFL,MDEVIC,MDIREC,MIXCOL,MOUT,MPIC,MSCAFL, + NERROR,NPICS LOGICAL*4 DEVCON,INITON CHARACTER FILNAM*80,TITLE*80 C .. C .. External Subroutines .. EXTERNAL GSCYTM,GSGRTM,GSMYTM,GSTYTM,GSVBRK C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE C C .. Save Statement .. C SAVE C IF ((MDIREC.NE.0) .AND. (DEVCON)) THEN C C---- switch terminal mode to teletype C cursor at bottom left. erase previous writing C CALL GSTYTM CALL GSCYTM CALL GSMYTM(0,23) END IF RETURN C ENTRY GSTYOF() C ============= C C---- Switch to vector graph mode C IF ((MDIREC.NE.0) .AND. (DEVCON)) THEN CALL GSGRTM C C---- break old vector chain C CALL GSVBRK END IF C END C C C SUBROUTINE GSUTRN C ================== C C---- set up user transformation defaults. other entries to rescale C adapted from d.a. agard plot82 C C A.D. McLachlan JUN 1984. Last updated 18 SEPT 1984 C C .. Scalar Arguments .. REAL A,B,X,XCGAP,Y,YCDOWN INTEGER N C .. C .. Array Arguments .. REAL TMAT(2,2) C .. C .. Scalars in Common .. REAL ANGFAC,CHANGX,CHANGY,CHRSCX,CHRSCY,CHRSPX,CHRSPY,DOTMMX, + DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWBLMX,DWBLMY,DWLIMX, + DWLIMY,PAPLMX,PAPLMY,SCALEX,SCALEY,UBXMAX,UBXMIN,UBYMAX, + UBYMIN,USANGX,USANGY,V64LMX,V64LMY,XBNEW,XBOLD,XCHAR,XCSTRT, + XNOW,YBNEW,YBOLD,YCHAR,YCSTRT,YNOW INTEGER ICENTC,ICOLOR,IDRLVL,IFONT,IPRINT,IUNIT,IXMAX,IXMIN,IYMAX, + IYMIN,KPRINT,LINWT,LUNIN,LUNOUT,MCNTFL,MDEVIC,MDIREC, + MIXCOL,MOUT,MPIC,MSCAFL,NERROR,NPICS LOGICAL*4 DEVCON,FONTIN,ICULNK,INITON,LINMOD,UCSPAC CHARACTER FILNAM*80,TITLE*80 C .. C .. Arrays in Common .. REAL CHRMAT,CUMAT,USRMAT C .. C .. Local Scalars .. REAL CHORGX,CHORGY,CUORGX,CUORGY,PI,XORIG,YORIG INTEGER I,ICLINK,ICMODE,J,NN C .. C .. Local Arrays .. INTEGER NCTRAN(24),NSTRAN(24) C .. C .. External Subroutines .. EXTERNAL GSLVCK,GSMUCT C .. C .. Intrinsic Functions .. INTRINSIC ATAN2,COS,SIN,SQRT C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSCHX/CHRMAT(3,3),CHRSCX,CHRSCY,CHANGX,CHANGY, + CHRSPX,CHRSPY,ICENTC,UCSPAC,IFONT,FONTIN,XCHAR,YCHAR, + XCSTRT,YCSTRT,ANGFAC COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE COMMON /GSDWX/XNOW,YNOW,XBNEW,YBNEW,XBOLD,YBOLD COMMON /GSUTR/USRMAT(3,3),SCALEX,SCALEY,USANGX,USANGY, + CUMAT(3,3),LINMOD,ICULNK,KPRINT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (XORIG,USRMAT(1,3)), (YORIG,USRMAT(2,3)) EQUIVALENCE (CUORGX,CUMAT(1,3)), (CUORGY,CUMAT(2,3)) EQUIVALENCE (NSTRAN(1),USRMAT(1,1)) EQUIVALENCE (CHORGX,CHRMAT(1,3)), (CHORGY,CHRMAT(2,3)) EQUIVALENCE (NCTRAN(1),CHRMAT(1,1)) C C---- check level C IF (IDRLVL.EQ.0) CALL GSLVCK('GSUTRN') IF (IDRLVL.LT.2) IDRLVL = 2 C C---- set user transformations C PI = ATAN2(1.0,1.0)*4.0 DO 20 J = 1,3 DO 10 I = 1,3 USRMAT(I,J) = 0.0 CHRMAT(I,J) = 0.0 CUMAT(I,J) = 0.0 10 CONTINUE 20 CONTINUE USRMAT(3,3) = 1.0 CHRMAT(3,3) = 1.0 CUMAT(3,3) = 1.0 SCALEX = 1.0 SCALEY = 1.0 CHRSCX = 3.0 CHRSCY = 3.0 USRMAT(1,1) = SCALEX USRMAT(2,2) = SCALEY CHRMAT(1,1) = CHRSCX CHRMAT(2,2) = CHRSCY USANGX = 0.0 USANGY = PI/2.0 CHANGX = 0.0 CHANGY = PI/2.0 CHRSPX = 0.0 CHRSPY = 0.0 ICULNK = .TRUE. ICENTC = 0 UCSPAC = .FALSE. IFONT = 1 LINMOD = .TRUE. C C---- anchor point and cursor C XCHAR = 0.0 YCHAR = 0.0 XCSTRT = 0.0 YCSTRT = 0.0 GO TO 60 C ENTRY GSSCLU(A,B) C ================== C C---- (A,B) horizontal and vertical scales. C 1 user unit=(a,b) mm scales are user/drawing board C SCALEX = A SCALEY = B GO TO 40 C ENTRY GSUROT(A,B) C ================= C C---- Set rotation of user coord system in radians anti-clockwise C with x and y axes along directions of angles (a,b) C USANGX = A USANGY = B GO TO 40 C ENTRY GSUMAT(TMAT) C ================== C C---- Reset transformation matrix (values in mm) C since this call destroys the current scales we recalculate them C USRMAT(1,1) = TMAT(1,1) USRMAT(2,1) = TMAT(2,1) USRMAT(1,2) = TMAT(1,2) USRMAT(2,2) = TMAT(2,2) SCALEX = SQRT(TMAT(1,1)**2+TMAT(2,1)**2) SCALEY = SQRT(TMAT(1,2)**2+TMAT(2,2)**2) IF (SCALEX.EQ.0) THEN USANGX = 0.0 ELSE USANGX = ATAN2(TMAT(2,1),TMAT(1,1)) END IF C IF (SCALEY.EQ.0) THEN USANGY = 0.0 ELSE USANGY = ATAN2(TMAT(2,2),TMAT(1,2)) END IF GO TO 50 C ENTRY GSORGD(X,Y) C ================== C C---- Set up user origin on drawing board in mm C XORIG = X YORIG = Y GO TO 50 C ENTRY GSORGU(X,Y) C ================= C C---- Set up user origin in terms of current user coords C XORIG = USRMAT(1,1)*X + XORIG + USRMAT(1,2)*Y YORIG = USRMAT(2,1)*X + YORIG + USRMAT(2,2)*Y GO TO 50 C ENTRY GSSCLC(A,B) C ================== C C---- Set values of chrscx,chrscy C CHRSCX = A CHRSCY = B GO TO 30 C ENTRY GSCROT(A,B) C ================== C C---- Set angles for character coordinate system in radians C anticlockwise with x and y axes along directions of (a,b) C CHANGX = A CHANGY = B GO TO 30 C ENTRY GSCMAT(TMAT) C =================== C C---- Reset character transformation matrix C CHRMAT(1,1) = TMAT(1,1) CHRMAT(1,2) = TMAT(1,2) CHRMAT(2,1) = TMAT(2,1) CHRMAT(2,2) = TMAT(2,2) CHRSCX = SQRT(TMAT(1,1)**2+TMAT(2,1)**2) CHRSCY = SQRT(TMAT(1,2)**2+TMAT(2,2)**2) IF (CHRSCX.EQ.0) THEN CHANGX = 0.0 ELSE CHANGX = ATAN2(TMAT(2,1),TMAT(1,1)) END IF C IF (CHRSCY.EQ.0) THEN CHANGY = 0.0 ELSE CHANGY = ATAN2(TMAT(2,2),TMAT(1,2)) END IF GO TO 50 C ENTRY GSORGC(X,Y) C ================== C C---- Set up origin of character transformation in character units C CHORGX = X CHORGY = Y GO TO 50 C ENTRY GSCSPA(A,B) C ================== C C---- (A,B)=values of extra character space,in character units C CHRSPX = A CHRSPY = B RETURN C ENTRY GSCSPU(N) C ================ C C---- (N)=iuspce iuspce=(0) variable spacing, (1)fixed C IF ((N.LT.0) .OR. (N.GT.1)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6016) N N = 0 END IF C IF (N.EQ.0) THEN UCSPAC = .FALSE. ELSE UCSPAC = .TRUE. END IF RETURN C ENTRY GSCENC(N) C ================ C C---- Set relative character position C N = 0 lower left hand corner (default) C N = 1 centred C IF ((N.LT.0) .OR. (N.GT.1)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6004) N N = 0 END IF ICENTC = N RETURN C ENTRY GSANCD(X,Y) C ================== C C---- Set up character anchor point on drawing board in mm C XCHAR = X YCHAR = Y XCSTRT = 0.0 YCSTRT = 0.0 RETURN C ENTRY GSANCU(X,Y) C ================== C C---- Set up character anchor point in user space C XCHAR = USRMAT(1,1)*X + USRMAT(1,2)*Y + XORIG YCHAR = USRMAT(2,1)*X + USRMAT(2,2)*Y + YORIG XCSTRT = 0.0 YCSTRT = 0.0 RETURN C ENTRY GSFCUR(X,Y) C ================== C C---- Report position of character cursor C X = XCSTRT Y = YCSTRT RETURN C ENTRY GSPCUR(X,Y) C ================== C C---- Set position of character cursor C XCSTRT = X YCSTRT = Y RETURN C ENTRY GSSCUR(XCGAP) C ==================== C C---- Move cursor to right by xcgap C XCSTRT = XCSTRT + XCGAP RETURN C ENTRY GSLNFD(YCDOWN) C ===================== C C---- Character cursor line feed C XCSTRT = 0 YCSTRT = YCSTRT - YCDOWN RETURN C ENTRY GSTLNK(N) C ================ C C---- Set linking of plot transformations C NN = N IF ((NN.LT.0) .OR. (NN.GT.1)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6000) NN NN = 1 END IF ICLINK = NN IF (ICLINK.EQ.1) THEN ICULNK = .TRUE. ELSE ICULNK = .FALSE. END IF RETURN C ENTRY GSCMOD(N) C =============== C IF ((N.LT.0) .OR. (N.GT.1)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6002) N N = 0 END IF ICMODE = N IF (ICMODE.EQ.1) THEN LINMOD = .FALSE. ELSE LINMOD = .TRUE. END IF RETURN 30 CHRMAT(1,1) = COS(CHANGX)*CHRSCX CHRMAT(2,1) = SIN(CHANGX)*CHRSCX CHRMAT(1,2) = COS(CHANGY)*CHRSCY CHRMAT(2,2) = SIN(CHANGY)*CHRSCY GO TO 50 40 USRMAT(1,1) = COS(USANGX)*SCALEX USRMAT(2,1) = SIN(USANGX)*SCALEX USRMAT(1,2) = COS(USANGY)*SCALEY USRMAT(2,2) = SIN(USANGY)*SCALEY C C---- check level C 50 IF (IDRLVL.NE.3) CALL GSLVCK('GS/UCTRN/') 60 CALL GSMUCT(USRMAT,CHRMAT,CUMAT,ICULNK,IPRINT) IF (IPRINT.GE.2) THEN WRITE (LUNOUT,FMT=6006) USRMAT(1,1),USRMAT(1,2),XORIG, + USRMAT(2,1),USRMAT(2,2),YORIG WRITE (LUNOUT,FMT=6008) SCALEX,SCALEY,USANGX/ANGFAC, + USANGY/ANGFAC WRITE (LUNOUT,FMT=6010) CHRMAT(1,1),CHRMAT(1,2),CHORGX, + CHRMAT(2,1),CHRMAT(2,2),CHORGY WRITE (LUNOUT,FMT=6012) CHRSCX,CHRSCY,CHANGX/ANGFAC, + CHANGY/ANGFAC END IF C C---- Format statements C 6000 FORMAT (2X,'!!!GSTLNK ERROR: ICLNK = ',I5,' NOT (0,1) - RESET', + ' TO (1)=LINKED ') 6002 FORMAT (2X,'!!!GSCMOD ERROR: ICMODE = ',I5,' NOT (0,1) - RESET', + 'TO (0)=LINE-MODE ') 6004 FORMAT (2X,'!!!GSCENC ERROR: N=',I5,' OUT OF RANGE(0-1) RESET', + 'AS 0=LOWLEFT ') 6006 FORMAT (2X,'USRMAT(1,1),(1,2) XORIG = ',3F10.4,/2X,'USRMAT(2,1)', + ',(2,2) YORIG = ',3F10.4) 6008 FORMAT (2X,'SCALEX SCALEY USANGX USANGY(DEG) = ',4F10.4) 6010 FORMAT (2X,'CHRMAT(1,1),(1,2) CHORGX = ',3F10.4,/2X,'CHRMAT(2,1)', + ',(2,2) CHORGY = ',3F10.4) 6012 FORMAT (2X,'CHRSCX CHRSCY CHANGX CHANGY (DEG) = ',4F10.4) 6016 FORMAT (2X,'!!!GSCSPU ERROR: IUSPCE=',I5,' NOT (0,1) RESET', + ' AS 0 = VARIABLE SPACING ') C END C C C SUBROUTINE GSVCLN(XVEC,YVEC,NPOINT) C ==================================== C C---- Plot a set of npoint points joined by lines C C A.D. McLachlan JUN 1984. Last updated 25 JUL 1984 C C .. Scalar Arguments .. INTEGER NPOINT C .. C .. Array Arguments .. REAL XVEC(NPOINT),YVEC(NPOINT) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. INTEGER J C .. C .. External Subroutines .. EXTERNAL GSDWTO,GSMVTO C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C CALL GSMVTO(XVEC(1),YVEC(1)) IF (NPOINT.GE.2) THEN DO 10 J = 2,NPOINT CALL GSDWTO(XVEC(J),YVEC(J)) 10 CONTINUE END IF C END C C C SUBROUTINE GSVIEW(FILNAM,NSTART,ISCALE,SCAFAC,LINSIZ, + NOCENT,NOPRNT,NINTER,IERR) C ========================================================= C C---- Runs interactive graphics on the vt640 terminal C C A.D. McLachlan JUNE 1984. Last updated 13 MAR 1985 C C adapted from d.a. agard's "view" program from plot82 C C FILNAM is name of intermediate plot file to read from C ISCALE=1,2,3 (1) uniform to fill screen C (2) chosen multiple of paper scale C (3) independent x,y to fill screen C SCAFAC scale factor (screenscale/paperscale) C default is 0.5 (only for iscale=2) C NOCENT=0,1 do, do not centre picture (only for iscale=1,2) C LINSIZ=0,1-9 (0)use original thickness (1-9) use value set C NSTART number of picture to start at in plot file C if nstart.lt.1 program asks user for value C NINTER=1,0 interactive use or not C ninter= -1 then do not read filnam or ninter C NOPRNT=0,1 print on,off C IERR=0,1 normal function or error return C C vt640 machine has raster of physical dots (640*480) C and xerox monitor plots at 10 physical dots/3mm C with full size (192.0,144.0)mm or (7.55906,5.66929)inches C vt640 programming uses raster of memory dots (0:1023 * 0:779) C and then the range (1024,780) is scaled down by factors C 1024*(5/8)=640 780*(8/13)=480. C C the paper plotter used by plot82 is 13 inches across and 20 in. C deep with 100 paper dots per inch. so 1300 (1296 used) across C and 2000 down. "nbpi" is the notional number of paper dots per C inch used in the plot file (normally 100), and is used by C this program to do the scaling from paper dots to vt640 memory C dots C the paper plotter actually has 1320 dots (13.2 inches) across C but normally only 1296 are used. C C this program leaves a margin at the edge of the screen and C uses screen area size (550*465) physical dots (165.0*139.5)mm C (6.5*5.5) inches with margins left 60=(0:59) bottom 8=(0:7) C physical user area is (60:609 * 8:472) dots C corresponding area in memory dots is (880*756) with margins C left 96=(0:95) bottom 13=(0:12) C memory user area (96:975 * 13:768) C with this convention default scale is that C 1 paper mm scales to 0.5 screen mm C scales are across 880/13=67.692 memdots/paper inch C up 756/11=68.727 memdots/paper inch C C .. Parameters .. REAL DTMMX,DTMMY PARAMETER (DTMMX=880.0/165.0,DTMMY=756.0/139.5) C .. C .. Scalar Arguments .. REAL SCAFAC INTEGER IERR,ISCALE,LINSIZ,NINTER,NOCENT,NOPRNT,NSTART CHARACTER FILNAM* (*) C .. C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWLIMX,DWLIMY INTEGER ICOLOR,IUNITR,IXMAX,IXMIN,IYMAX,IYMIN,LINWT,LUNIN,LUNOUT, + MCNTFL,MDEVIC,MDIREC,MIXCOL,MOUT,MPIC,MSCAFL,NPICS,NREC CHARACTER PASWRD*8,TITLEH*80 C .. C .. Arrays in Common .. REAL SPARE1,SPARE2 C .. C .. Local Scalars .. REAL AXFAC,AXRNGE,AYFAC,AYRNGE,SCALX,SCALY,SCMAXP,SCMAXX,SCMAXY, + SIZX,SIZX1,SIZY,SIZY1,SPAREX,SPAREY,TRUSCX,TRUSCY,XMAX,XMIN, + XSCRM1,XWID,YMAX,YMIN,YSCRM1,YWID INTEGER IDOT,IERAS,IND,IOUT,ISIZX1,ISIZY1,ISXMAX,ISXMIN,ISYMAX, + ISYMIN,IUNIT,IX,IXBIG,IXDRAW,IXEDG,IXMOVE,IXMRG1,IXOFF, + IXOLD,IXSPAR,IY,IYBIG,IYDRAW,IYEDG,IYMOVE,IYMRG1,IYOFF, + IYOLD,IYSPAR,J,JINIT,JPIC,JSKIP,KEOF,KKEOF,LL,MORE,NCONTR, + NDOT,NSKIP,LENSTR INTEGER*2 IEND,ILWT,IPAP,IPEN CHARACTER CHKEY*1,OUTLIN*100 C .. C .. Local Arrays .. INTEGER LOFFX(8),LOFFY(8) C .. C .. External Subroutines .. EXTERNAL GSCFIL,GSCYTM,GSDOTM,GSDWTM,GSERTM, + GSFLBR,GSFLP1,GSFLRI,GSFLSR,GSGRTM, + GSINTM,GSMVTM,GSMYTM,GSOFLR,GSOFTM, + GSPTTM,GSRHDR,GSRVTM,GSSCTM,GSTYTM, + LENSTR C .. C .. Intrinsic Functions .. INTRINSIC MIN,NINT,REAL C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSFHD/ + IUNITR, NREC, DOTMMX, DOTMMY, IXMIN, IXMAX, IYMIN, + IYMAX, LINWT, ICOLOR, MIXCOL, MDEVIC, MDIREC, MOUT, + MPIC, MSCAFL, MCNTFL, DWLIMX, DWLIMY, DVXMIN, DVXMAX, + DVYMIN, DVYMAX, NPICS, + PASWRD, + SPARE1(15), + TITLEH, + SPARE2(68) C C .. Save Statement .. C SAVE C .. Data statements .. C C---- screen size 880 by 756 for iscale=2 C C---- screen left and bottom margins 96,13 mem dots C DATA ISIZX1/879/,ISIZY1/755/ DATA SIZX1/880.0/,SIZY1/756.0/ DATA IXMRG1/96/,IYMRG1/13/ DATA XSCRM1/165.0/,YSCRM1/139.5/ DATA ISXMIN/5/,ISXMAX/1018/,ISYMIN/5/,ISYMAX/775/ C C---- plot file command codes C DATA IEND/-1/,IDOT/-2/,ILWT/-3/,IPEN/-4/,IPAP/-5/,IERAS/-6/ DATA LOFFX/1,0,-1,0,2,0,-2,0/ DATA LOFFY/0,1,0,-1,0,2,0,-2/ DATA CHKEY/' '/ C C---- scale factors 880/165.0 and 756/139.5 C C---- screen size in mm C C---- edge dot limits for marking edge of screen C C---- plot header contains 512 bytes or 128 words of header C iunitr is not part of the header, C but is used by the GSfile routines C information in an array in this common block C WORD(1) :=: NREC INTEGER C WORD(2:3) :=: DOTMMX,DOTMMY REALS C WORD(4:16) :=: (IXMIN:MCNTFL) INTEGER C WORD(17:22) :=: (DWLIMX:DVYMAX) REALS C WORD(23) :=: NPICS INTEGER C WORD(24:25) :=: PASWRD 'PLOT%%84' C WORD(26:40) :=: SPARE1(1:17) SPARE C WORD(41:60) :=: TITLEH(1:80) CHARACTERS C WORD(61:128):=: SPARE2(1:68) SPARE C C LUNIN = 5 LUNOUT = 6 C C JPIC = 0 JINIT = 0 NSKIP = NSTART - 1 NCONTR = 0 OUTLIN(1:) = FILNAM IF (NOPRNT.EQ.0) WRITE (LUNOUT,FMT=6052) NINTER,NOPRNT, + OUTLIN(1:LENSTR(OUTLIN)), + NSTART,ISCALE,SCAFAC,NOCENT,LINSIZ C C---- get filename and set options C IF (NINTER.NE.1) GO TO 10 CALL NOCRLF (' Type full name of plot file:-........= ') READ (LUNIN,FMT=6056) FILNAM 10 CONTINUE IF (NINTER.EQ.-1) THEN NINTER = 1 END IF OUTLIN(1:) = FILNAM IF ((NINTER.EQ.0) .AND. (NOPRNT.EQ.0)) WRITE (LUNOUT, + FMT=6028) OUTLIN(1:LENSTR(OUTLIN)) IF (NINTER.EQ.0) GO TO 30 20 CONTINUE CALL NOCRLF (' VIEW640: Auto(0) or interactive(1)...= ') READ (LUNIN,FMT=*) NCONTR IF ((NCONTR.EQ.0) .OR. (NCONTR.EQ.1)) GO TO 30 WRITE (LUNOUT,FMT=6050) GO TO 20 30 CONTINUE IF ((NCONTR.EQ.1) .OR. (NINTER.EQ.0)) GO TO 40 C C---- set for auto options if online otherwise use options as called C NSTART = 1 ISCALE = 1 SCAFAC = 0.5 LINSIZ = 0 NOCENT = 0 NOPRNT = 1 40 CONTINUE IF ((NCONTR.EQ.0) .OR. (NINTER.EQ.0)) GO TO 60 50 CONTINUE C C---- read print switch C CALL NOCRLF (' Noprnt: <0>Print on (1)Print off.....=') READ (LUNIN,FMT=*) NOPRNT C IF ((NOPRNT.EQ.0) .OR. (NOPRNT.EQ.1)) GO TO 60 WRITE (LUNOUT,FMT=6050) GO TO 50 60 CONTINUE C C---- output unit vt640 terminal C IOUT = 7 C C---- open plot file and read the first header C to see how many pictures there are C CALL GSOFLR(IUNIT,FILNAM) KEOF = 0 CALL GSRHDR(KEOF) IF (KEOF.EQ.1) GO TO 120 IF (NOPRNT.EQ.0) WRITE (LUNOUT,FMT=6030) NPICS 70 CONTINUE C C---- Start of main picture loop NOTE that header has already been read C C IF (NSTART.GT.0) GO TO 100 IF ((NINTER.EQ.0) .OR. (NCONTR.EQ.0)) GO TO 100 IF ((NOPRNT.EQ.0) .AND. (JPIC.GT.0)) WRITE (LUNOUT,FMT=6014) JPIC 80 CONTINUE CALL NOCRLF (' Type no of pictures to skip..........=') READ (LUNIN,FMT=*) NSKIP IF (NSKIP.GE.0) GO TO 90 WRITE (LUNOUT,FMT=6050) GO TO 80 90 CONTINUE 100 CONTINUE C C---- Skip up to start point C IF (NSKIP.LT.1) GO TO 130 DO 110 JSKIP = 1,NSKIP JPIC = JPIC + 1 IF (NREC.EQ.0) GO TO 120 IF (NOPRNT.EQ.0) WRITE (LUNOUT,FMT=6020) JPIC,IUNIT,NREC, + DOTMMX,DOTMMY,IXMIN,IXMAX,IYMIN,IYMAX,LINWT,ICOLOR,MIXCOL, + MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX,DWLIMY,DVXMIN, + DVXMAX,DVYMIN,DVYMAX,NPICS,TITLEH CALL GSFLSR(4*NREC) KEOF = 0 CALL GSRHDR(KEOF) IF (KEOF.EQ.1) GO TO 120 110 CONTINUE GO TO 130 120 CONTINUE C C---- End of pictures C WRITE (LUNOUT,FMT=6000) (JPIC-1),NSKIP IERR = 1 GO TO 440 130 CONTINUE C C---- Start processing picture C JPIC = JPIC + 1 IF (NREC.EQ.0) GO TO 140 IF (NOPRNT.EQ.0) WRITE (LUNOUT,FMT=6020) JPIC,IUNIT,NREC,DOTMMX, + DOTMMY,IXMIN,IXMAX,IYMIN,IYMAX,LINWT,ICOLOR,MIXCOL,MDEVIC, + MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX,DWLIMY,DVXMIN,DVXMAX, + DVYMIN,DVYMAX,NPICS,TITLEH GO TO 150 140 CONTINUE C C---- No picture or no records C WRITE (LUNOUT,FMT=6004) (JPIC-1) IERR = 1 GO TO 440 150 CONTINUE C C---- Plot dimensions in mm C C---- Range of plot in pixel integers dots on plot file C add 0.01 to avoid divide by zero C AXRNGE = REAL(IXMAX-IXMIN) + 0.01 AYRNGE = REAL(IYMAX-IYMIN) + 0.01 XMIN = REAL(IXMIN)/DOTMMX XMAX = REAL(IXMAX)/DOTMMX YMIN = REAL(IYMIN)/DOTMMY YMAX = REAL(IYMAX)/DOTMMY XWID = AXRNGE/DOTMMX YWID = AYRNGE/DOTMMY AXFAC = XWID/XSCRM1 AYFAC = YWID/YSCRM1 SCMAXX = 0.999/AXFAC SCMAXY = 0.999/AYFAC SCMAXP = MIN(SCMAXX,SCMAXY) IF (NOPRNT.EQ.0) WRITE (LUNOUT,FMT=6032) XMIN,XMAX,YMIN,YMAX, + XWID,YWID,XSCRM1,YSCRM1,AXFAC,AYFAC,SCMAXP IF ((NINTER.EQ.0) .OR. (NCONTR.EQ.0)) GO TO 250 160 CONTINUE C C---- Select scaling options C CALL NOCRLF (' Scaling: <1>Ufill (2)Choice (3)Fill..=') READ (LUNIN,FMT=*) ISCALE IF (ISCALE.EQ.0) ISCALE = 1 IF ((ISCALE.GE.1) .AND. (ISCALE.LE.3)) GO TO 170 WRITE (LUNOUT,FMT=6050) GO TO 160 170 CONTINUE IF (ISCALE.NE.2) GO TO 200 180 CONTINUE CALL NOCRLF (' Scale factor screen/paper <0.5>......=') READ (LUNIN,FMT=6048) SCAFAC IF (SCAFAC.EQ.0.0) SCAFAC = 0.5 IF (SCAFAC.GE.0.0) GO TO 190 WRITE (LUNOUT,FMT=6050) GO TO 180 190 CONTINUE 200 CONTINUE NOCENT = 1 IF (ISCALE.EQ.3) GO TO 220 210 CONTINUE CALL NOCRLF (' Nocentering <0> (1)..................=') READ (LUNIN,FMT=*) NOCENT IF ((NOCENT.EQ.0) .OR. (NOCENT.EQ.1)) GO TO 220 WRITE (LUNOUT,FMT=6050) GO TO 210 220 CONTINUE 230 CONTINUE CALL NOCRLF (' Lineweight <0>As in file (1-9)Fixed..=') READ (LUNIN,FMT=*) LINSIZ IF ((LINSIZ.GE.0) .AND. (LINSIZ.LE.9)) GO TO 240 WRITE (LUNOUT,FMT=6050) GO TO 230 240 CONTINUE 250 CONTINUE C C---- Calculate scale factors C C---- Device size C SIZX = SIZX1 SIZY = SIZY1 C C---- Set margin offsets C IXOFF = IXMRG1 IYOFF = IYMRG1 IXBIG = IXOFF + ISIZX1 IYBIG = IYOFF + ISIZY1 GO TO (280,260,280) ISCALE 260 CONTINUE C C---- Option with scale keyed to paper plot C (1 paper mm = scafac screen mm: default scafac=0.5) C IF (SCAFAC.LE.0.0) SCAFAC = 0.5 C C---- Dotmmx and dotmmy dots per mm assumed C SCALX = (DTMMX/DOTMMX)*SCAFAC SCALY = (DTMMY/DOTMMY)*SCAFAC C C---- filling ratio for screen area 880*756 memdots C AXFAC = (AXRNGE*SCALX)/SIZX AYFAC = (AYRNGE*SCALY)/SIZY IF (NOPRNT.EQ.0) WRITE (LUNOUT,FMT=6026) AXFAC,AYFAC IF (SCAFAC.LT.SCMAXP) GO TO 270 IF ((AXFAC.LE.1.0) .AND. (AYFAC.LE.1.0)) GO TO 270 C C---- plot too big for requested scale C SCMAXX = SCAFAC/AXFAC SCMAXY = SCAFAC/AYFAC IF (NOPRNT.EQ.0) WRITE (LUNOUT,FMT=6006) SCAFAC,SCMAXX,SCMAXY IF (NOPRNT.EQ.1) CALL NOCRLF (' RESCALED!') GO TO 280 270 CONTINUE IF (NOPRNT.EQ.0) WRITE (LUNOUT,FMT=6024) SCAFAC,SCAFAC GO TO 300 280 CONTINUE C C---- maximal scalings on screen area 880*756 C SCMAXX = XSCRM1/XWID SCMAXY = YSCRM1/YWID AXFAC = 1.0 AYFAC = 1.0 IF (ISCALE.EQ.3) GO TO 290 C C---- for uniform shape C SCMAXP = MIN(SCMAXX,SCMAXY) AXFAC = SCMAXP/SCMAXX AYFAC = SCMAXP/SCMAXY SCMAXX = SCMAXP SCMAXY = SCMAXP 290 CONTINUE C C---- actual scale ratios used C TRUSCX = SCMAXX TRUSCY = SCMAXY IF (NOPRNT.EQ.0) WRITE (LUNOUT,FMT=6026) AXFAC,AYFAC IF (NOPRNT.EQ.0) WRITE (LUNOUT,FMT=6024) TRUSCX,TRUSCY SCALX = (DTMMX/DOTMMX)*SCMAXX SCALY = (DTMMY/DOTMMY)*SCMAXY GO TO 300 300 CONTINUE C C---- prepare for actual plotting C C---- centre the plot on screen C IXEDG = IXOFF IYEDG = IYOFF IF ((NOCENT.EQ.1) .OR. (ISCALE.EQ.3)) GO TO 310 SPAREX = (1.0-AXFAC)*SIZX SPAREY = (1.0-AYFAC)*SIZY IXSPAR = 0.5*SPAREX IYSPAR = 0.5*SPAREY IXEDG = IXOFF + IXSPAR IYEDG = IYOFF + IYSPAR 310 CONTINUE C C---- pause to read input information:type any integer or "return" to go on C IF (NOPRNT.EQ.1) GO TO 320 CALL NOCRLF (' VIEW: Type "RETURN" to draw') READ (LUNIN,FMT=*) MORE 320 CONTINUE C C---- start up terminal C JINIT = 1 CALL GSINTM(IOUT) CALL GSGRTM C C---- draw edge dots on screen C CALL GSPTTM(ISXMIN,IYOFF) CALL GSPTTM(ISXMIN,IYBIG) CALL GSPTTM(ISXMAX,IYOFF) CALL GSPTTM(ISXMAX,IYBIG) CALL GSPTTM(IXOFF,ISYMIN) CALL GSPTTM(IXBIG,ISYMIN) CALL GSPTTM(IXOFF,ISYMAX) CALL GSPTTM(IXBIG,ISYMAX) C C---- initialise pen position and line thickness C IF (LINSIZ.GT.0) LINWT = LINSIZ IXOLD = IXEDG IYOLD = IYEDG C C---- expects nrec plot records (ix,iy) with no "end" codes C NDOT = 0 DO 350 J = 1,NREC NDOT = NDOT - 1 KKEOF = 0 CALL GSFLRI(IX,IY,KKEOF) IF (KKEOF.EQ.1) GO TO 360 C C---- check command codes C IF (IX.LT.0) THEN IF (IX.EQ.IEND) THEN GO TO 370 ELSE IF (IX.EQ.IDOT) THEN NDOT = 2 ELSE IF (IX.EQ.ILWT) THEN C C---- line thickness code ignored if linsiz is set C IF (LINSIZ.EQ.0) LINWT = IY C C---- skip all "pen","paper" codes C ELSE IF (IX.EQ.IERAS) THEN C C---- erase code C IF (IY.EQ.1) THEN CALL GSERTM ELSE IF (IY.EQ.0) THEN CALL GSDOTM ELSE IF (IY.EQ.2) THEN CALL GSRVTM END IF END IF GO TO 340 END IF IF (IY.LT.0) THEN IXOLD = NINT((IX-IXMIN)*SCALX) + IXEDG IYOLD = NINT((-IY-IYMIN)*SCALY) + IYEDG ELSE IX = NINT((IX-IXMIN)*SCALX) + IXEDG IY = NINT((IY-IYMIN)*SCALY) + IYEDG IF (NDOT.LT.1) THEN CALL GSMVTM(IXOLD,IYOLD) CALL GSDWTM(IX,IY) ELSE CALL GSPTTM(IX,IY) END IF C C---- here for multiple wt lines C IF (LINWT.GT.1) THEN LL = LINWT - 1 IF (LL.LT.2) LL = 2 DO 330 IND = 1,LL IXMOVE = LOFFX(IND) + IXOLD IYMOVE = LOFFY(IND) + IYOLD IF (IXMOVE.LT.IXEDG) IXMOVE = IXEDG IF (IYMOVE.LT.IYEDG) IYMOVE = IYEDG IF (IXMOVE.GT.IXBIG) IXMOVE = IXBIG IF (IYMOVE.GT.IYBIG) IYMOVE = IYBIG IF (NDOT.LT.1) CALL GSMVTM(IXMOVE,IYMOVE) IXDRAW = LOFFX(IND) + IX IYDRAW = LOFFY(IND) + IY IF (IXDRAW.LT.IXEDG) IXDRAW = IXEDG IF (IYDRAW.LT.IYEDG) IYDRAW = IYEDG IF (IXDRAW.GT.IXBIG) IXDRAW = IXBIG IF (IYDRAW.GT.IYBIG) IYDRAW = IYBIG IF (NDOT.LT.1) THEN CALL GSDWTM(IXDRAW,IYDRAW) ELSE CALL GSPTTM(IXDRAW,IYDRAW) END IF 330 CONTINUE END IF IXOLD = IX IYOLD = IY END IF 340 CONTINUE 350 CONTINUE C C---- end of this picture C GO TO 370 360 CONTINUE C C---- error during plot file reading C IERR = 1 GO TO 370 370 CONTINUE C C---- get commands from terminal C CALL GSTYTM CALL GSMYTM(0,23) C C---- if non-interactive go to next picture C IF ((NINTER.EQ.0) .OR. (NCONTR.EQ.0)) THEN CALL NOCRLF (' ') READ (LUNIN,FMT=*) MORE GO TO 410 END IF C C---- pause to look at picture "return" or "space" to save and continue C "+" to save and pause. any other character to delete C WRITE (LUNOUT,6600) 6600 FORMAT (' Type "RETURN" or "SPACE" to save "+" to pause',/, + ' any other character to delete ') cc CALL NOCRLF (' Type "RETURN" or "SPACE" to save "+" to pause') cc CALL NOCRLF (' any other character to delete ') READ (LUNIN,FMT=6058) CHKEY cc CALL GSCYTM IF (CHKEY.EQ.' ') THEN GO TO 390 ELSE IF (CHKEY.EQ.'+') THEN CALL NOCRLF (' ') READ (LUNIN,FMT=*) MORE GO TO 390 ELSE C C---- clear screen C CALL GSINTM(IOUT) END IF 390 CONTINUE C C---- another picture ? (0)=quit (1)=next, (-1)=repeat (100)=restart C CALL GSTYTM CALL GSMYTM(0,23) CALL NOCRLF (' (0)End (1)next (-1)again (100)begin..=') READ (LUNIN,FMT=*) MORE IF (MORE.EQ.0) THEN GO TO 450 ELSE IF (MORE.EQ.1) THEN GO TO 410 ELSE IF (MORE.EQ.-1) THEN GO TO 400 ELSE IF (MORE.EQ.100) THEN CALL GSFLP1 JPIC = 0 GO TO 410 ELSE WRITE (LUNOUT,FMT=6050) GO TO 390 END IF 400 CONTINUE C C---- when more=(-1) redraw same picture C to redraw current picture backspace the plot file C CALL GSFLBR(4*NREC+512) C C---- read header again C KEOF = 0 CALL GSRHDR(KEOF) IF (KEOF.EQ.1) GO TO 140 JPIC = JPIC - 1 GO TO 130 410 CONTINUE C C---- when more=(1) draw next picture read header for next picture C KEOF = 0 CALL GSRHDR(KEOF) IF (KEOF.EQ.1) GO TO 420 GO TO 70 420 CONTINUE WRITE (LUNOUT,FMT=6004) JPIC 440 CONTINUE C C---- clear the screen and return control to alpha mode C IF (JINIT.EQ.0) GO TO 460 C C---- pause to read screen type "return" to exit C IF (NINTER.EQ.0) GO TO 450 IF (NCONTR.EQ.1) CALL NOCRLF (' VIEW finished') IF (NCONTR.EQ.0) CALL NOCRLF (' ') 450 CONTINUE WRITE (LUNOUT,6600) cc CALL NOCRLF (' Exit: type "RETURN" or "SPACE" to save picture') cc CALL NOCRLF (' any other character to clear screen') READ (LUNIN,FMT=6058) CHKEY IF (CHKEY.NE.' ') THEN CALL GSSCTM END IF CALL GSTYTM CALL GSCYTM CALL GSOFTM(IOUT) 460 CONTINUE C C---- finish C CALL GSCFIL(IUNIT) RETURN C C---- Format statements C 6000 FORMAT (2X,'!!!VIEW -- Too few pictures ',I5,' found: tried to s', + 'kip ',I5) 6004 FORMAT (2X,'!!!VIEW -- Picture ',I5,' ENDS FILE ') 6006 FORMAT (2X,'!!!VIEW -- Plot too big: ',/2X,'Chosen scale =',F10.4, + ' max poss scales are X,Y ',2F10.4) 6014 FORMAT (2X,'Series number of last picture was ',I5) 6020 FORMAT (/1X,'--Picture number ',I5,' -- on IUNIT=',I5,/1X,I5, + ' records ',2F10.4,' dots/mm: x,y ',/2X,'input pixel inde', + 'x ranges X: ',2I6,' Y: ',2I6,/2X,'LINWT ',I5,' ICOLOR ', + I5,' MIXCOL ',I5,/2X,'MDEVIC ',I5,' MDIREC ',I5,' MOUT ', + I5,/2X,'MPIC ',I5,' MSCAFL ',I5,' MCNTFL ',I5,/2X,'DWLI', + 'MX ',F10.4,6X,'DWLIMY ',F10.4,/2X,'DVXMIN ',F10.4,6X,'DV', + 'XMAX ',F10.4,/2X,'DVYMIN ',F10.4,6X,'DVYMAX ',F10.4,/2X, + 'NPICS ',I5,' TITLE: ',/1X,A) 6024 FORMAT (2X,'Scale magnification screen/paper X,Y ',2F10.4) 6026 FORMAT (2X,'User area screen filling factors X,Y ',2F10.4) 6028 FORMAT (1X,'--Plot file-name requested is:-- ',A) 6030 FORMAT (1X,'--File contains ',I5,' pictures--') 6032 FORMAT (/1X,'--Original plot dimensions in mm--',/2X,'limits: ', + 'X1 X2 ',2F9.2,' Y1 Y2 ',2F9.2,/2X,'widths used X Y ', + 2F9.2,'; available ',2F9.2,/2X,'width filling factors X Y', + '; ',2F8.4,/2X,'max scale factor allowed; ', + ' ',F8.4,/) 6048 FORMAT (F10.5) 6050 FORMAT (/1X,'--ILLEGAL INPUT VALUE-- TRY AGAIN ') 6052 FORMAT (2X,'VIEW called with ',/2X,'NINTER =',I5,' NOPRNT =',I5, + /2X,'FILNAM = ',A,/2X,'NSTART =',I5,' ISCALE =',I5,' S', + 'CAFAC =',F10.5,/2X,'NOCENT =',I5,' LINSIZ =',I5,/) 6056 FORMAT (A) 6058 FORMAT (A) C END C C C SUBROUTINE GSXYTM(ITERM,IX,IY,CODE) C ==================================== C C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were CODE C and the followig BYTEs to INTEGER: MSX, MSY, LSX, LSY, OLDMSY, C OLDLSY, OLDMSX, OLDLSX C C .. Scalar Arguments .. INTEGER ITERM,IX,IY CHARACTER*1 CODE C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. INTEGER MSX,MSY,LSX,LSY,OLDMSY,OLDLSY,OLDMSX,OLDLSX C .. C .. External Subroutines .. EXTERNAL GSBFTM C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C C .. Data statements .. DATA OLDMSY,OLDLSY,OLDMSX,OLDLSX/0,0,0,0/ C .. C C---- Decode coordinate bytes C C the bit pattern code here is C C bit value 32 16 8 4 2 1 C bit number 7 6 5 4 3 2 1 0 C C HIGH X P 0 1 X9 X8 X7 X6 X5 C LOW X P 0 1 X4 X3 X2 X1 X0 C C HIGH Y P 0 1 Y9 Y8 Y7 Y6 Y5 C LOW Y P 0 1 Y4 Y3 Y2 Y1 Y0 C C IX = 32*HIGHX + LOWX C IY = 32*HIGHY + LOWY C C---- Encode the coordinates C CCC MSX=((IX.AND.992)/32).OR.32 MSX=IOR((IAND(IX,992)/32),32) CCC LSX=(IX.AND.31).OR.64 LSX=IOR(IAND(IX,31),64) CCC MSY=((IY.AND.992)/32).OR.32 MSY=IOR((IAND(IY,992)/32),32) CCC LSY=(IY.AND.31).OR.96 LSY=IOR(IAND(IY,31),96) C C---- Code.ne.0 means control character goes into buffer C IF (CODE.NE.CHAR(0)) CALL GSBFTM(ITERM,CODE) IF (OLDMSY.NE.MSY) CALL GSBFTM(ITERM,CHAR(MSY)) CALL GSBFTM(ITERM,CHAR(LSY)) IF (OLDMSX.NE.MSX) CALL GSBFTM(ITERM,CHAR(MSX)) CALL GSBFTM(ITERM,CHAR(LSX)) C C---- Save old coords for next time C OLDMSY = MSY OLDLSY = LSY OLDMSX = MSX OLDLSX = LSX C END C C C SUBROUTINE INITRIPLOT(ISTREAM,NAME,IFLAG) C ======================================== C C---- Set of fortran driver routines for the trilog printer C public version d.a. agard. copied from [public.progs]triplot C sep 6 1984. trivial changes a.d. mclachlan 6 sept 1984. C C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were LINE, PC, PF, PL, FORWARD, LINEFEED, REVERSE, BLANK, COLOURCH C C TRILOG PRINTER/PLOTTER. C all i/o is done using the mrc direct-access disk routines C C .. Scalar Arguments .. INTEGER IFLAG,IOFF,ISTREAM,LENGTH,N,NFORMS,NROWS CHARACTER NAME* (*) C .. C .. Array Arguments .. c CHARACTER LINE(*) INTEGER LINE(*) C .. C .. Scalars in Common .. INTEGER INIT,IUNIT,LUNIN,LUNOUT C .. C .. Arrays in Common .. CHARACTER PC*4,PF*6,PL*6 C .. C .. Local Scalars .. INTEGER J,NDO,NL,NBYTES(1),NMCITM,II,IDUM CHARACTER*1 FOWARD,REVERSE C .. C .. Local Arrays .. CHARACTER BLANK*250,COLOURCH(3),LINEFEED C .. C .. External Functions .. LOGICAL CCPONL EXTERNAL CCPONL C .. C .. External Subroutines .. EXTERNAL QCLOSE,QOPEN,QWRITE, QMODE C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C COMMON /TRIKKDAT/INIT,IUNIT,PC(4),PL(6),PF(6) C C .. Save Statement .. C SAVE C C .. Equivalences .. character*1 to integer DATA INIT/0/ C C C---- Set up all needed info; note odd byte counts must actually be even C DO 99 II=1,250 BLANK(II:II) = CHAR(0) 99 CONTINUE COLOURCH(1) = CHAR(16) COLOURCH(2) = CHAR(17) COLOURCH(3) = CHAR(18) LINEFEED(:1) = CHAR(10) PC(1:1) = CHAR(0) PC(2:2) = CHAR(0) PC(3:3) = CHAR(5) PC(4:4) = CHAR(0) PF(1:1) = CHAR(3) PF(2:2) = CHAR(0) PF(3:3) = CHAR(5) PF(4:4) = CHAR(0) PF(5:5) = CHAR(12) PF(6:6) = CHAR(0) PL(1:1) = CHAR(3) PL(2:2) = CHAR(0) PL(3:3) = CHAR(5) PL(4:4) = CHAR(0) PL(5:5) = CHAR(10) PL(6:6) = CHAR(0) FOWARD = CHAR(0) REVERSE = CHAR(23) C IF (INIT.NE.1) THEN IUNIT = ISTREAM INIT = 1 IF (IFLAG.EQ.1 .AND. CCPONL(IDUM)) THEN C C---- Open if in batch C CALL QOPEN(IUNIT,NAME,'NEW') ELSE CALL QOPEN(IUNIT,NAME,'NEW') END IF C C---- Change to byte handling C CALL QMODE (IUNIT,0,NMCITM) END IF RETURN C ENTRY TRICOLOUR(N) C ================== C IF (N.GE.1 .AND. N.LE.3) PC(4:4) = COLOURCH(N) RETURN C ENTRY TRIROW(NROWS) C =================== C IF (NROWS.LT.0) THEN NDO = -NROWS PL(4:4) = REVERSE DO 10 J = 1,NDO CALL QWRITC(IUNIT,PL) 10 CONTINUE ELSE IF (NROWS.GT.0) THEN NDO = NROWS PL(4:4) = CHAR(0) DO 20 J = 1,NDO CALL QWRITC(IUNIT,PL) 20 CONTINUE END IF RETURN C ENTRY TRIFORM(NFORMS) C ===================== C IF (NFORMS.LT.0) THEN NDO = -NFORMS PF(4:4) = REVERSE DO 30 J = 1,NDO CALL QWRITC(IUNIT,PF) 30 CONTINUE ELSE IF (NFORMS.GT.0) THEN NDO = NFORMS PF(4:4) = CHAR(0) DO 40 J = 1,NDO CALL QWRITC(IUNIT,PF) 40 CONTINUE END IF RETURN C ENTRY TRIPLOT(LINE,LENGTH) C ========================== C NBYTES (1) = LENGTH + 3 NL = 1 CALL QWRITE(IUNIT,NBYTES,1) CALL QWRITE(IUNIT,LINE,LENGTH) CALL QWRITC(IUNIT,LINEFEED) PC(4:4) = CHAR(0) RETURN C ENTRY TRIPLOTC(LINE,LENGTH,IOFF) C ================================ C NBYTES (1) = LENGTH + IOFF + 3 NL = 1 CALL QWRITE(IUNIT,NBYTES,1) IF (IOFF.GT.0) CALL QWRITC(IUNIT,BLANK) CALL QWRITE(IUNIT,LINE,LENGTH) CALL QWRITC(IUNIT,LINEFEED) PC(4:4) = CHAR(0) RETURN C ENTRY CLOSETRIPLOT() C ================== C CALL QCLOSE(IUNIT) C END C C C SUBROUTINE INITVT640(ITERM) C =========================== C C---- lookalike plot82 routines for driving the vt640 from plot84 C C A.D. McLachlan SEP 1984. Last updated 25 SEP 1984. C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were NBYTE, BYTXT, HTEXT C C .. Scalar Arguments .. INTEGER ICODE,ISIZE,ITERM,IX,IY,NCHARS CHARACTER*1 NBYTE C .. C .. Array Arguments .. CHARACTER*1 BYTXT(*) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. INTEGER I,JSIZE,N CHARACTER CHKEY*1,TEXT*256 C .. C .. Local Arrays .. CHARACTER*1 HTEXT(256) C .. C .. External Subroutines .. EXTERNAL GSBFTM,GSCYTM,GSDOTM,GSDWTM,GSERTM, + GSGRTM,GSHRTM,GSINTM,GSMVTM,GSMYTM, + GSPTTM,GSRVTM,GSTXTM,GSTYTM,GSXYTM C .. C .. Intrinsic Functions .. INTRINSIC ICHAR C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (TEXT,HTEXT(1)) C .. C CALL GSINTM(ITERM) RETURN C ENTRY SELECTVT640() C ================= C CALL GSGRTM RETURN C ENTRY MOVEVT640(IX,IY) C ====================== C CALL GSMVTM(IX,IY) RETURN C ENTRY DRAWVT640(IX,IY) C ====================== C CALL GSDWTM(IX,IY) RETURN C ENTRY POINTVT640(IX,IY) C ======================= C CALL GSPTTM(IX,IY) RETURN C ENTRY TEXTVT640(BYTXT,NCHARS,ISIZE) C =================================== C JSIZE = ISIZE + 1 N = NCHARS IF (N.GT.256) N = 256 DO 10 I = 1,N HTEXT(I) = BYTXT(I) 10 CONTINUE CALL GSTXTM(TEXT(1:N),JSIZE) RETURN C ENTRY XHAIRVT640(IX,IY,ICODE) C ============================= C CALL GSHRTM(IX,IY,CHKEY) ICODE = ICHAR(CHKEY) RETURN C ENTRY DOTSONVT640() C ================= C CALL GSDOTM RETURN C ENTRY DOTSOFFVT640() C ================== C CALL GSERTM RETURN C ENTRY DOTSCOMPVT640() C =================== C CALL GSRVTM RETURN C ENTRY SELECTVT100() C ================= C CALL GSTYTM RETURN C ENTRY MOVEVT100(IX,IY) C ====================== C CALL GSMYTM(IX,IY) RETURN C ENTRY CLEARVT100() C ================ C CALL GSCYTM RETURN C ENTRY BUFFVT640(ITERM,NBYTE) C ============================ C CALL GSBFTM(ITERM,NBYTE) RETURN C ENTRY COORDVT640(ITERM,IX,IY,NBYTE) C =================================== C CALL GSXYTM(ITERM,IX,IY,NBYTE) C END C C C SUBROUTINE IREAD(CARD,NUMS,NFIELDS) C =================================== C C---- Decode string CARD into floating numbers in NUMS, returns C number of numbers in NFIELDS C C .. Scalar Arguments .. INTEGER NFIELDS CHARACTER CARD* (*) C .. C .. Array Arguments .. INTEGER NUMS(*) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. INTEGER I,IEND,ISTART,N,NCHAR,NPC,NPOINT CHARACTER BLANK*1,COMMA*1 C .. C .. Intrinsic Functions .. INTRINSIC INDEX,LEN C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C C .. Data statements .. DATA BLANK/' '/,COMMA/','/ C .. C NCHAR = LEN(CARD) C C---- Numeric string C ISTART = 1 N = 0 IF (NFIELDS.LE.0) NFIELDS = 10000 10 CONTINUE C C---- Search for starting point C IF (CARD(ISTART:ISTART).EQ.BLANK .OR. + CARD(ISTART:ISTART).EQ.COMMA) THEN ISTART = ISTART + 1 IF (ISTART.GT.NCHAR) THEN GO TO 50 ELSE GO TO 10 END IF END IF 20 CONTINUE C C---- Decode fields C IF (ISTART.LE.NCHAR .AND. N.LT.NFIELDS) THEN N = N + 1 NPOINT = INDEX(CARD(ISTART:),BLANK) - 1 NPC = INDEX(CARD(ISTART:),COMMA) - 1 IF (NPC.GE.0 .AND. NPC.LT.NPOINT) NPOINT = NPC IEND = ISTART + NPOINT - 1 READ (CARD(ISTART:IEND),FMT=6333,ERR=40) NUMS(N) C C---- 6333 FORMAT(I) C 6333 FORMAT(I10) ISTART = IEND + 2 30 CONTINUE C C---- Skip over recurring blanks C IF (CARD(ISTART:ISTART).EQ.BLANK .OR. + CARD(ISTART:ISTART).EQ.COMMA) THEN ISTART = ISTART + 1 IF (ISTART.GT.NCHAR) THEN GO TO 50 ELSE GO TO 30 END IF END IF C I = I + 1 GO TO 20 ELSE GO TO 50 END IF C 40 NFIELDS = -1 RETURN C C---- All numeric fields decoded C 50 NFIELDS = N C END C C C SUBROUTINE IROT(IX,IY,RM,JX,JY) C =============================== C C---- Rotate JX,JY by 2 x 2 matrix RM, answer in IX, IY C C .. Scalar Arguments .. INTEGER IX,IY,JX,JY C .. C .. Array Arguments .. REAL RM(2,2) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Intrinsic Functions .. INTRINSIC NINT C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C IX = NINT(RM(1,1)*JX+RM(1,2)*JY) IY = NINT(RM(2,1)*JX+RM(2,2)*JY) C END C C C INTEGER FUNCTION ISHFT (INUM,IBITS) C =================================== C C---- ISHIFT perfoms a bitwise shift of INUM by IBITS bits. C For IBITS = 0 ISHIFT returns INUM unchanged C For IBITS > 0 ISHIFT returns the Left shift of INUM C For IBITS < 0 ISHIFT returns the Right shift of INUM C INTEGER INUM, IBITS C IF (IBITS.EQ.0) THEN ISHFT = INUM ELSE IF (IBITS.GT.0) THEN ISHFT = INUM * IBITS * 2 ELSE ISHFT = INUM / (IABS(IBITS) * 2) ENDIF C END C C C SUBROUTINE NEXTPC(IFLAG) C ======================= C C---- Open next picture C C .. Scalar Arguments .. INTEGER IFLAG C .. C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWLIMX,DWLIMY INTEGER ICOLOR,IUNIT,IXMAX,IXMIN,IYMAX,IYMIN,LINWT,LUNIN,LUNOUT, + MCNTFL,MDEVIC,MDIREC,MIXCOLOR,MOUT,MPIC,MSCAFL,NPICS,NREC CHARACTER PASWRD*8,TITLEH*80 C .. C .. Arrays in Common .. REAL SPARE1,SPARE2 C .. C .. Local Scalars .. INTEGER IFLAG2 C .. C .. External Subroutines .. EXTERNAL GSRHDR C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSFHD/ + IUNIT, NREC, DOTMMX, DOTMMY, IXMIN, IXMAX, IYMIN, + IYMAX, LINWT, ICOLOR, MIXCOLOR, MDEVIC, MDIREC, MOUT, + MPIC, MSCAFL, MCNTFL, DWLIMX, DWLIMY, DVXMIN, DVXMAX, + DVYMIN, DVYMAX, NPICS, + PASWRD, + SPARE1(15), + TITLEH, + SPARE2(68) C C .. Save Statement .. C SAVE C C C IFLAG = 0 IFLAG2 = 0 CALL GSRHDR(IFLAG2) IF (IFLAG2.NE.1) THEN IF (NREC.NE.0) RETURN END IF C IFLAG = 1 C END C C C SUBROUTINE OLDTRIL(GSFIL,LISFIL,IOFLAG) C ======================================== C C---- Substitute routine for old trilog82 C C ADAPTED FROM D.A. AGARD'S TRILOG PLOT82 (1982) C A.D. MCLACHLAN JUN 1984. LAST UPDATED 21 OCT 1984 C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were BRICKS C and the followig BYTEs to INTEGER: ICLBRK, KXY, LINROW, PAGE C C The program reads in the intermediate plot file and C generates a file of line dots to print on trilog printer/plotter C C The maximum page depth is set at 8192 lines (100 per inch) C each line 1536 dots across (6 dots/byte and 256 bytes) C the plotter allows 1320 dots across page (220 bytes) C with a 13-inch paper width only the first 1296 dots (216 bytes) C on each line are used C with 8-inch page depth there are 800 lines per page C C In this version of the program the plot area is divided into C bricks of (48*64) dots or (8*64)=512 bytes C with 32 bricks across the page and 128 up the page C this reduces the number of virtual memory page faults C in plots with many long vectors which run up and down the page C the brick algorithm is 8 times faster than the plot82 trilog C method. C some of the byte-copying of bricks is done in terms of blocks C of character strings C C --Plot file command codes (ix,iy) revised july 1984 C (I,+J) draw line to (i,j) i,j in range 1 to 32766,not 0. C (I,-J) move to (i,j) C C (-I,J) treat i as a command code, j as a data value C (-1,J) end picture: C put out j pages of paper before next (j=1) C (-2,0) dot C (-3,J) lineweight,thickness j=1...9 C (-4,J) colour change. j defines colour C (-5,J) blank paper, j rows of 1/100 inch height C (-6,J) erase (vt640 only) j=0 off, j=1 on, C j=2 reverse black-white. C C parameters to define the size and numbers of bricks C if these are altered the character*xxx string sizes may C need changing C C---- Picture array as bricks or as rows of bricks C C---- Special for nwidx=8 !! store 8 bytes in one character variable C C---- Output buffer as rows of lines C or a row of bricks each 8 bytes wide C C---- Whole bricks as blocks of 512(=nsizeb) characters C C---- One brick as characters to clear C C .. Parameters .. INTEGER NWIDX,NWIDY,NBRIKX,NBRIKY PARAMETER (NWIDX=8,NWIDY=64,NBRIKX=32,NBRIKY=128) INTEGER NBYTX,NBYTX1 PARAMETER (NBYTX=NWIDX*NBRIKX,NBYTX1=NBYTX-1) INTEGER NWIDX1,NWIDY1 PARAMETER (NWIDX1=NWIDX-1,NWIDY1=NWIDY-1) INTEGER NBRKX1,NBRKY1 PARAMETER (NBRKX1=NBRIKX-1,NBRKY1=NBRIKY-1) INTEGER NDOTX PARAMETER (NDOTX=NWIDX*6) REAL DOTMMP PARAMETER (DOTMMP=100.0/25.4) C .. C .. Scalar Arguments .. INTEGER IOFLAG CHARACTER LISFIL* (*),GSFIL* (*) C .. C .. Scalars in Common .. INTEGER ICOLOR,IUNIT,IXMAX,IXMIN,IYMAX,IYMIN,LINWT,LUNIN,LUNOUT, + MIXCOLOR,NBPI,NREC C .. C .. Arrays in Common .. REAL EXTRA INTEGER BRICKS C .. C .. Local Scalars .. REAL ANBPI,SCFACX,SCFACY,SECTOT,SSTAGE,XWID,YWID INTEGER IBRIKX,IBRIKY,IBXMAX,IBXMIN,IBXWID,IBYMAX,IBYMIN,IBYWID, + IER,IND,IPRINT,IPXMAX,IPXMIN,IPY,IPY0,IPY1,IPYBOT,IPYTOP, + IRECX, + ISTREM,IX,IXOLD,IY,IYOLD,JX,JXOLD,JY,JYOLD,LL,MAXDTX, + MAXLNY,NBPG,NBXOFF,NBXWID,NDOT,NFORM,NLINPG,NLINU,NLINY, + NLNSKP,NMARGY,NPAGES,NREAD,NSPARE,NMCITM INTEGER*2 IDOT,IEND,ILWT,IPAP,IPEN,KX,KY,IERAS LOGICAL IRET CHARACTER CLRBRK*512 C .. C .. Local Arrays .. INTEGER LOFFX(8),LOFFY(8),MREC(20) INTEGER ICLBRK(512),KXY(2),LINROW(0:NBYTX1,0:NWIDY1), + PAGE(0:NBYTX1,0:NWIDY1,0:NBRKY1) CHARACTER CBRIKS(0:NWIDY1,0:NBRKX1,0:NBRKY1)*8, + LLBROW(0:NBRKX1,0:NWIDY1)*8, + HOLBRK(0:NBRKX1,0:NBRKY1)*512 C .. C .. External Subroutines .. EXTERNAL CLOSETRIPLOT,INITRIPLOT,GSLRSB,GSTIM0,GSTIMR, + QCLOSE,QOPEN,QREAD,TRICOLOUR,TRIFORM,TRIPLOTC,TRIROW C .. C .. Intrinsic Functions .. INTRINSIC MIN,REAL C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSOLD/IUNIT,NREC,NBPI,IXMIN,IXMAX,IYMIN,IYMAX,LINWT, + ICOLOR,MIXCOLOR,EXTRA(11) COMMON /GSRAS/BRICKS(0:NWIDX1,0:NWIDY1,0:NBRKX1,0:NBRKY1) C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (BRICKS(0,0,0,0),PAGE(0,0,0)) EQUIVALENCE (CBRIKS(0,0,0),BRICKS(0,0,0,0)) EQUIVALENCE (LINROW(0,0),LLBROW(0,0)) EQUIVALENCE (HOLBRK(0,0),BRICKS(0,0,0,0)) EQUIVALENCE (CLRBRK,ICLBRK(1)) EQUIVALENCE (NREC,MREC(1)) EQUIVALENCE (KXY(1),KX), (KXY(2),KY) C .. C .. Data statements .. DATA ICLBRK/512*64/ DATA LOFFX/1,0,-1,0,2,-2,-3,3/ DATA LOFFY/0,1,0,-1,2,-2,3,-3/ DATA MAXLNY/8191/,MAXDTX/1320/ DATA NLINPG/800/,NBPG/216/ DATA NSPARE/20/ DATA IEND/4/,IDOT/16/,ILWT/2/, + IPEN/1/,IPAP/8/,IERAS/32/ C C---- plotfile command codes C IPRINT = 0 CALL GSTIM0(IPRINT) C C---- Start up plotfile and printer C CALL QOPEN(IUNIT,GSFIL,'READONLY') CALL QMODE (IUNIT,0,NMCITM) C C---- IOFLAG=1,0 .IOFLAG=(1) then batch jobs have file opened 'tr' and C must be part of sys$output or sys$print C IOFLAG=(0) then all jobs have file opened as 'pd'=print/delete. C normal trilog uses ioflag=0. trilogq uses ioflag=1 C ISTREM = 2 CALL INITRIPLOT(ISTREM,LISFIL,IOFLAG) 10 CONTINUE C C C---- Start of current picture C C---- Skip nspare lines at start of first C page in addition to nmargy later C CALL TRIROW(NSPARE) NFORM = 1 NLNSKP = 0 CALL QREAD(IUNIT,MREC,80,IER) IF ((IER.EQ.0) .AND. (NREC.GT.0)) THEN C C---- Rescale for different dot densities C ANBPI = NBPI SCFACX = 100.0/ANBPI SCFACY = SCFACX IXMIN = REAL(IXMIN)*SCFACX IXMAX = REAL(IXMAX)*SCFACX IYMIN = REAL(IYMIN)*SCFACY IYMAX = REAL(IYMAX)*SCFACY C C---- Check size of plot and reduce if too big C rescaling may make ixmin,iymin zero C IF ((IXMIN.LT.0) .OR. (IXMAX.GT.MAXDTX) .OR. (IYMIN.LT.0) .OR. + (IYMAX.GT.MAXLNY)) WRITE (LUNOUT,FMT=6004) MAXDTX,MAXLNY, + IXMIN,IXMAX,IYMIN,IYMAX IF (IXMIN.LT.1) IXMIN = 1 IF (IXMAX.LT.IXMIN) IXMAX = IXMIN IF (IXMAX.GT.MAXDTX) IXMAX = MAXDTX IF (IYMIN.LT.1) IYMIN = 1 IF (IYMAX.LT.IYMIN) IYMAX = IYMIN IF (IYMAX.GT.MAXLNY) IYMAX = MAXLNY C C---- Brick limits across page C NOTE IX=1...1295 BUT IBX=0...31 C thus brick number 0 goes from ix=0 to 47 C IBXMIN = IXMIN/NDOTX IBXMAX = IXMAX/NDOTX IBXWID = IBXMAX - IBXMIN + 1 XWID = IBXWID*NDOTX XWID = XWID/DOTMMP C C---- Brick limits up and down C NOTE IY=1...8191 BUT IBY=0...127 C thus brick number 0 goes from iy=0 to 63 C and its bottom line is not used C IBYMIN = IYMIN/NWIDY IBYMAX = IYMAX/NWIDY IBYWID = IBYMAX - IBYMIN + 1 NLINY = IYMAX - IYMIN + 1 YWID = NLINY YWID = YWID/DOTMMP C C---- Centre up and down if only one page C lines used in the occupied bricks C NLINU = NLINY + NSPARE NPAGES = (NLINU-1)/NLINPG + 1 NMARGY = (NPAGES*NLINPG-NLINU)/2 C C---- Positions of extreme lines used in top and bottom bricks C IPYTOP = IYMAX - IBYMAX*NWIDY IPYBOT = IYMIN - IBYMIN*NWIDY C C---- Center along x: calculate offsets in bytes (6 dots/byte) C IPXMIN = IXMIN/6 IPXMAX = IXMAX/6 NBXWID = MIN((IPXMAX-IPXMIN+1),NBPG) NBXOFF = (NBPG-NBXWID)/2 C C---- Clear required rows of bricks C DO 30 IBRIKY = IBYMIN,IBYMAX DO 20 IBRIKX = IBXMIN,IBXMAX HOLBRK(IBRIKX,IBRIKY) = CLRBRK 20 CONTINUE 30 CONTINUE C C---- Start on this plot C IXOLD = 0 IYOLD = 0 NREAD = 0 C C---- NDOT remembers when a dot code was last issued C NDOT = 0 DO 50 IRECX = 1,NREC CALL QREAD(IUNIT,KXY,4,IER) IF (IER.NE.0) THEN GO TO 80 ELSE IX = KX IY = KY NREAD = NREAD + 1 NDOT = NDOT - 1 C C---- Handle control info C IF (IX.GE.0) THEN C C---- Here for actual plot handling C IX = REAL(IX)*SCFACX IF (IY.LT.0) THEN IXOLD = IX IYOLD = REAL(-IY)*SCFACY ELSE IY = REAL(IY)*SCFACY IF (NDOT.LT.1) THEN CALL GSLRSB(IX,IY,IXOLD,IYOLD) ELSE CALL GSLRSB(IX,IY,IX,IY) END IF C C---- Here for multiple wt lines C IF (LINWT.GT.1) THEN LL = LINWT - 1 IF (LL.LT.2) LL = 2 DO 40 IND = 1,LL JX = LOFFX(IND) + IX JXOLD = LOFFX(IND) + IXOLD IF (JX.LT.IXMIN) JX = IXMIN IF (JX.GT.IXMAX) JX = IXMAX IF (JXOLD.LT.IXMIN) JXOLD = IXMIN IF (JXOLD.GT.IXMAX) JXOLD = IXMAX JY = LOFFY(IND) + IY JYOLD = LOFFY(IND) + IYOLD IF (JY.LT.IYMIN) JY = IYMIN IF (JY.GT.IYMAX) JY = IYMAX IF (JYOLD.LT.IYMIN) JYOLD = IYMIN IF (JYOLD.GT.IYMAX) JYOLD = IYMAX IF (NDOT.LT.1) THEN CALL GSLRSB(JX,JY,JXOLD,JYOLD) ELSE CALL GSLRSB(JX,JY,JX,JY) END IF 40 CONTINUE END IF IXOLD = IX IYOLD = IY END IF ELSE IF (IX.EQ.IEND) THEN GO TO 60 ELSE IF (IX.EQ.IDOT) THEN NDOT = 2 ELSE IF (IX.EQ.ILWT) THEN LINWT = IY ELSE IF (IX.EQ.IPEN) THEN ICOLOR = 3 IF (IY.EQ.2) ICOLOR = 2 IF (IY.EQ.5) ICOLOR = 1 CALL TRICOLOUR(ICOLOR) ELSE IF (IX.EQ.IPAP) THEN CALL TRIROW(IY) C C---- Ignore ix=ieras on paper plotter C NLNSKP = NLNSKP + IY END IF END IF 50 CONTINUE C GO TO 70 60 NFORM = IY IF (NREAD.EQ.1) NREAD = 0 C C---- End of records loop C 70 CONTINUE IRET = .TRUE. GO TO 90 C C---- Output section C 80 CONTINUE WRITE (LUNOUT,FMT=6000) NREC,NREAD IRET = .FALSE. C 90 IF (NREAD.NE.0) THEN C C---- If no plotfile line skips call trirow to skip lines C and centre the page if there is only one page C IF ((NLNSKP.EQ.0) .AND. (NPAGES.LE.1)) CALL TRIROW(NMARGY) C C---- Get a row of bricks at a time in reverse order of rows C DO 130 IBRIKY = IBYMAX,IBYMIN,-1 C C---- Rearrange contents of each brick into lines 8 bytes at a time C IPY0 = 0 IPY1 = NWIDY1 IF (IBRIKY.EQ.IBYMAX) IPY1 = IPYTOP IF (IBRIKY.EQ.IBYMIN) IPY0 = IPYBOT DO 110 IPY = IPY0,IPY1 DO 100 IBRIKX = 0,NBRKX1 LLBROW(IBRIKX,IPY) = CBRIKS(IPY,IBRIKX,IBRIKY) 100 CONTINUE 110 CONTINUE C C---- Print a row of bricks as lines from the buffer in reverse order C DO 120 IPY = IPY1,IPY0,-1 CALL TRIPLOTC(LINROW(IPXMIN,IPY),NBXWID,NBXOFF) 120 CONTINUE 130 CONTINUE CALL TRIFORM(NFORM) C CALL GSTIMR(SECTOT,SSTAGE,IPRINT) WRITE (LUNOUT,FMT=6002) NREAD,XWID,YWID,SECTOT C C---- For next picture C IF (IRET) GO TO 10 END IF END IF C CALL QCLOSE(IUNIT) CALL CLOSETRIPLOT C C---- Format statements C 6000 FORMAT (2X,'TRILOG82: End-file error reading plot records: expec', + 'ted,found=',2I8) 6002 FORMAT (2X,'TRILOG82:',I8,' records read; area used(mm) =',2F7.0, + '; cpu sec',F6.2) 6004 FORMAT (2X,'!!!TRILOG82: Warning; plot too big for X Y dot range', + 's ',2I5,/13X,'uses X1 X2 Y1 Y2 = ',4I6) C END C C C SUBROUTINE RPLOT(ILIM,IER) C ========================== C C Concerted for PLOT84 Sept 1984. Last updated 11 SEP 1984 C C Read plot to get limits ILIM (= umin,umax,vmin,vmax) C Starts at record IREC, returns IREC pointing to next plot C if IER = 0 C C Returns IER=1 if end of file found in header, =-1 if eof C in data, otherwise IER=0 C C Header is INTEGER*4 !!!!!!!! C C .. Scalar Arguments .. INTEGER IER C .. C .. Array Arguments .. INTEGER ILIM(4) C .. C .. Scalars in Common .. REAL DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN,DWLIMX,DWLIMY INTEGER LUNIN,LUNOUT INTEGER*4 ICOLOR,IUNITR,IXMAX,IXMIN,IYMAX,IYMIN,LINWT,MCNTFL, + MDEVIC,MDIREC,MIXCOLOR,MOUT,MPIC,MSCAFL,NPICS,NREC, + MIXCOL C .. C .. Arrays in Common .. REAL SPARE1,SPARE2 CHARACTER PASWRD*8,TITLEH*80 REAL IREC(128) C .. C .. Local Scalars .. INTEGER IEND,IERAS,ILNW,IPAP,IPEN,IUNIT C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSFHD/ + IUNITR, NREC, DOTMMX, DOTMMY, IXMIN, IXMAX, IYMIN, + IYMAX, LINWT, ICOLOR, MIXCOL, MDEVIC, MDIREC, MOUT, + MPIC, MSCAFL, MCNTFL, DWLIMX, DWLIMY, DVXMIN, DVXMAX, + DVYMIN, DVYMAX, NPICS, + PASWRD, + SPARE1(15), + TITLEH, + SPARE2(68) C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (IREC(1),NREC) C .. C .. Data statements .. C DATA IPEN/-4/,IEND/-1/,IPAP/-5/,IERAS/-6/,ILNW/-3/ C IER = 0 C C---- Read header C CALL QREAD(IUNIT,IREC,512,IER) C C---- End File if block length wrong C IF (IER.EQ.0) THEN C C---- Read limits (in bits) C ILIM(1) = IXMIN ILIM(2) = IXMAX ILIM(3) = IYMIN ILIM(4) = IYMAX END IF C C---- End of this plot Or end of file C END C C C SUBROUTINE SCALE(A,B) C ===================== C C A.D. MCLACHLAN JULY 1984. LAST UPDATED 8 SEP 1984 C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were NFONTS C C---- multiply scales by (a,b) C C .. Scalar Arguments .. REAL A,B,C,D,DEG,X,Y INTEGER ICOLR,LWT,N,NPOINT C .. C .. Array Arguments .. REAL XVEC(*),YVEC(*) C .. C .. Scalars in Common .. REAL ANGFAC,BXMAX,BXMIN,BYMAX,BYMIN,CHANGX,CHANGY,CHRSCX,CHRSCY, + CHRSPX,CHRSPY,DOTMMX,DOTMMY,DVXMAX,DVXMIN,DVYMAX,DVYMIN, + DWBLMX,DWBLMY,DWLIMX,DWLIMY,PAPLMX,PAPLMY,SCALEX, + SCALEY,UBXMAX,UBXMIN,UBYMAX,UBYMIN,USANGX,USANGY,V64LMX, + V64LMY,XBNEW,XBOLD,XCHAR,XCSTRT,XNOW,YBNEW,YBOLD,YCHAR, + YCSTRT,YNOW,DOTMMX2,DOTMMY2,DWLIMX2,DWLIMY2,DVXMIN2,DVXMAX2, + DVYMIN2,DVYMAX2,SPARE1,SPARE2 INTEGER ICENTC,ICOLOR,IDRLVL,IFONT,IPRINT,IUNIT, + IUNITR,IXMAX,IXMIN,IYMAX,IYMIN,KPRINT,LINWT,LUNIN,LUNOUT, + MCNTFL,MDEVIC,MDIREC,MIXCOL,MOUT,MPIC,MSCAFL,NERROR, + NPICS,NREC,IXMIN2,IXMAX2,IYMIN2,IYMAX2,LINWT2,ICOLOR2, + MIXCOLOR,MDEVIC2,MDIREC2,MOUT2,MPIC2,MSCAFL2,MCNTFL2, + NPICS2 LOGICAL*4 DEVCON,FONTIN,ICULNK,INITON,LINMOD,UCSPAC CHARACTER FILNAM*80,TITLE*80 C .. C .. Arrays in Common .. REAL CHRMAT,CUMAT,USRMAT INTEGER*2 IFHT,IFSTRT,IFWID,IFX0,IFY0,LENGF INTEGER*1 NFONTS C .. C .. Local Scalars .. REAL AA,BB,CHORGX,CHORGY,CUORGX,CUORGY,PI,XORIG,YORIG INTEGER M,MODE C .. C .. Local Arrays .. REAL TMAT(2,2) INTEGER NCTRAN(24),NSTRAN(24) C .. C .. External Subroutines .. EXTERNAL GSANCU,GSCENC,GSCOLR,GSCROT,GSFONT,GSLNWT, + GSORGD,GSORGU,GSPAPR,GSSCLC,GSSCLU,GSUMAT, + GSUROT,GSVCLN C .. C .. Intrinsic Functions .. INTRINSIC ATAN2 C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT COMMON /GSCHX/CHRMAT(3,3),CHRSCX,CHRSCY,CHANGX,CHANGY,CHRSPX, + CHRSPY,ICENTC,UCSPAC,IFONT,FONTIN,XCHAR,YCHAR,XCSTRT, + YCSTRT,ANGFAC COMMON /GSCLP/BXMIN,BXMAX,BYMIN,BYMAX REAL FACX, FACY, XFOFF, YFOFF INTEGER IDXOFF, IDYOFF, IXOLD, IYOLD, MODOLD COMMON /GSDVT/FACX,FACY,XFOFF,YFOFF,IDXOFF,IDYOFF, + IXOLD,IYOLD,MODOLD COMMON /GSDVW/MDEVIC,MDIREC,MOUT,MPIC,MSCAFL,MCNTFL,DWLIMX, + DWLIMY,DVXMIN,DVXMAX,DVYMIN,DVYMAX,UBXMIN,UBXMAX,UBYMIN, + UBYMAX,FILNAM,DOTMMX,DOTMMY,DEVCON,INITON,NERROR,DWBLMX, + DWBLMY,PAPLMX,PAPLMY,V64LMX,V64LMY,IUNIT,IXMIN,IXMAX,IYMIN, + IYMAX,LINWT,ICOLOR,MIXCOL,NPICS,IPRINT,IDRLVL,TITLE COMMON /GSDWX/XNOW,YNOW,XBNEW,YBNEW,XBOLD,YBOLD CHARACTER PASWRD*8,TITLEH*80 COMMON /GSFHD/ + IUNITR, NREC, DOTMMX2, DOTMMY2, +IXMIN2, IXMAX2, IYMIN2, + IYMAX2, LINWT2, ICOLOR2, MIXCOLOR, MDEVIC2, MDIREC2, MOUT2, + MPIC2, MSCAFL2, MCNTFL2, DWLIMX2, DWLIMY2, + DVXMIN2, DVXMAX2, + DVYMIN2, DVYMAX2, NPICS2, + PASWRD, + SPARE1(15), + TITLEH, + SPARE2(68) COMMON /GSFNT/IFSTRT(150,4),LENGF(150,4),IFX0(150,4), + IFY0(150,4),IFWID(150,4),IFHT(150,4),NFONTS(4,3000,4) COMMON /GSUTR/USRMAT(3,3),SCALEX,SCALEY,USANGX,USANGY, + CUMAT(3,3),LINMOD,ICULNK,KPRINT C C .. Save Statement .. C SAVE C C .. Equivalences .. EQUIVALENCE (XORIG,USRMAT(1,3)), (YORIG,USRMAT(2,3)) EQUIVALENCE (CUORGX,CUMAT(1,3)), (CUORGY,CUMAT(2,3)) EQUIVALENCE (NSTRAN(1),USRMAT(1,1)) EQUIVALENCE (CHORGX,CHRMAT(1,3)), (CHORGY,CHRMAT(2,3)) EQUIVALENCE (NCTRAN(1),CHRMAT(1,1)) C AA = SCALEX*A BB = SCALEY*B CALL GSSCLU(AA,BB) RETURN C ENTRY ROTATE(DEG) C ================= C PI = ATAN2(1.0,1.0)*4.0 ANGFAC = PI/180.0 AA = ANGFAC*DEG BB = (PI/2.0) + AA CALL GSUROT(AA,BB) RETURN C ENTRY TRANSFM(A,B,C,D) C ====================== C TMAT(1,1) = A TMAT(1,2) = B TMAT(2,1) = C TMAT(2,2) = D CALL GSUMAT(TMAT) RETURN C ENTRY ORIGIN(X,Y,N) C =================== C C N = 0 absolute (in mm) C N = 1 relative to old origin (user units) C IF ((N.LT.0) .OR. (N.GT.1)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6000) N N = 0 END IF MODE = N + 1 IF (MODE.EQ.1) THEN CALL GSORGD(X,Y) ELSE IF (MODE.EQ.2) THEN CALL GSORGU(X,Y) END IF RETURN C ENTRY ANROT(DEG) C ================ C GO TO 10 C ENTRY SCLCHR(A,B) C ================= C C---- (A,B) values for char width & height C AA = CHRSCX*A BB = CHRSCY*B CALL GSSCLC(AA,BB) RETURN C ENTRY CHRSPC(A) C =============== C BB = CHRSCX*A AA = CHRSCY CALL GSSCLC(AA,BB) RETURN C ENTRY LOCCHR(X,Y,N) C =================== C C---- Set up character origin in user units C N = 0 relative to current origin C N = 1 relative to current pen position C IF ((N.LT.0) .OR. (N.GT.1)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6002) N N = 1 END IF M = N + 1 IF (M.EQ.1) THEN CALL GSANCU(X,Y) ELSE IF (M.EQ.2) THEN CALL GSANCU(X+XNOW,Y+YNOW) END IF RETURN C ENTRY IRELCH(N) C =============== C IF ((N.NE.0) .AND. (N.NE.4)) THEN IF (IPRINT.GE.1) WRITE (LUNOUT,FMT=6004) N N = 0 END IF CALL GSCENC(N) RETURN C ENTRY FONT(N) C ============= C CALL GSFONT(N) RETURN C ENTRY LINEWT(LWT) C ================= C CALL GSLNWT(LWT) RETURN C ENTRY PEN(ICOLR) C ================ C CALL GSCOLR(ICOLR) RETURN C ENTRY PAPER(X) C ============== C CALL GSPAPR(X) RETURN C ENTRY VECGS(XVEC,YVEC,NPOINT) C ============================= C CALL GSVCLN(XVEC,YVEC,NPOINT) RETURN C C---- Now same as rotchr C ENTRY ROTCHR(DEG) C ================= C 10 CONTINUE C PI = ATAN2(1.0,1.0)*4.0 ANGFAC = PI/180.0 AA = ANGFAC*DEG BB = (PI/2.0) + AA CALL GSCROT(AA,BB) C C---- Format statements C 6000 FORMAT (2X,'!!! ORIGIN ERROR: N=',I5,' OUT OF RANGE(0-1) RESET A', + 'S 0=ABS ') 6002 FORMAT (2X,'!!! LOCCHR ERROR: N=',I5,' NOT 0 OR 1 RESET AS 1=US', + 'ER COORD ') 6004 FORMAT (2X,'!!!IRELCH ERROR: N=',I5,' NOT 0 OR 4 RESET AS 0=LOW', + 'LEFT ') C END C C C SUBROUTINE SETVP(NVP) C ===================== C C---- Set viewport to viewport number NVP C C Screen size is 768 x 575 C Memory is 1024 x 1024 C DATA LVP C 0,XS,0,YS, ! S screen C 0,XM,0,YM, ! M memory C 0,XS,YS2,YS, ! T top C 0,XS,0,YS2, ! B bottom C 0,XS2,0,YS, ! L left C XS2,XS,0,YS, ! R right C 0,XS2,YS2,YS, ! TL top left C XS2,XS,YS2,YS, ! TR top right C 0,XS2,0,YS2, ! BL bottom left C XS2,XS,0,YS2 ! BR bottom right C C---- Viewport keys C VPS/'S','M','T','B','L','R','TL','TR','BL','BR'/ C C .. Parameters .. REAL XS,XS2,YS,YS2 PARAMETER (XS=760,XS2=XS/2,YS=570,YS2=YS/2) REAL XM,YM PARAMETER (XM=1020,YM=1020) C .. C .. Scalar Arguments .. INTEGER NVP C .. C .. Scalars in Common .. REAL SCALX,SCALY,TX,TY INTEGER IPICT,KXMAX,KXMIN,KYMAX,KYMIN,LUNIN,LUNOUT,NBACK LOGICAL AAV,CLEAR,EOF,HTEXT,PAN,PICTURE,ROTATE,TABLE,UNIFORM C .. C .. Arrays in Common .. REAL RM INTEGER PENS,PFLAGS C .. C .. Local Arrays .. INTEGER LVP(4,10) C .. C .. Common blocks .. COMMON /FLAGS/NBACK,PENS(8),PFLAGS(8),RM(2,2),TX,TY,SCALX,SCALY, + KXMIN,KXMAX,KYMIN,KYMAX,IPICT,AAV,PAN,ROTATE,CLEAR,UNIFORM, + TABLE,PICTURE,HTEXT,EOF COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C C .. Data statements .. DATA LVP/0,XS,0,YS,0,XM,0,YM,0,XS,YS2,YS,0,XS,0,YS2,0,XS2,0,YS, + XS2,XS,0,YS,0,XS2,YS2,YS,XS2,XS,YS2,YS,0,XS2,0,YS2,XS2,XS,0, + YS2/ C KXMIN = LVP(1,NVP) KXMAX = LVP(2,NVP) KYMIN = LVP(3,NVP) KYMAX = LVP(4,NVP) C END C C C SUBROUTINE STRING(BYTXT,NCHARS) C =============================== C C---- Plot a text string. lookalike for plot82 C C A.D. MCLACHLAN JULY 1984. LAST UPDATED 24 JUL 1984 C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were BYTXT C C .. Scalar Arguments .. INTEGER NCHARS C .. C .. Array Arguments .. CHARACTER*1 BYTXT(*) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. INTEGER I,N,NJUST CHARACTER TEXT*256 C .. C .. External Subroutines .. EXTERNAL GSCETX,GSSTRH C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C CALL GSSTRH(BYTXT,NCHARS) RETURN C ENTRY CSTRING(BYTXT,NCHARS) C =========================== C TEXT = ' ' N = NCHARS IF (N.LT.1) N = 1 IF (N.GT.256) N = 256 DO 10 I = 1,N TEXT(I:I) = BYTXT(I) 10 CONTINUE NJUST = 2 CALL GSCETX(TEXT(1:N),NJUST) C END C C C SUBROUTINE SYMBOL(X,Y,HGT,BYTXT,ANGLE,NC) C ========================================= C C---- lookalike for plot82 symbol and number C C A.D. MCLACHLAN JUN 1984. LAST UPDATED 27 JUL 1984 C 9/2/90 - PJD: Changed definition of several BYTEs to CHARACTER*1. C They were BYTXT C C (X,Y) = positions C HGT = height in user units C BYTXT = character string in bytes C ANGLE = orientation in degrees C NC = number of chars C C .. Scalar Arguments .. REAL ANGLE,FNUM,HGT,X,Y INTEGER NC,NDIG C .. C .. Array Arguments .. CHARACTER*1 BYTXT(*) C .. C .. Scalars in Common .. INTEGER LUNIN,LUNOUT C .. C .. Local Scalars .. REAL ANGFAC,PI,THETA INTEGER INUM,NAFTER,NDIGIT,NENTRY,NJUST C .. C .. Local Arrays .. INTEGER NTRSAV(48) C .. C .. External Subroutines .. EXTERNAL GSANCU,GSCROT,GSFNUM,GSINUM, + GSSCLC,GSSTRH,GSTRES,GSTSAV C .. C .. Intrinsic Functions .. INTRINSIC ATAN2 C .. C .. Common blocks .. COMMON /PINOUT/LUNIN,LUNOUT C C .. Save Statement .. C SAVE C NENTRY = 1 GO TO 10 C ENTRY NUMBER(X,Y,HGT,FNUM,ANGLE,NDIG) C ===================================== C NENTRY = 2 C C---- Save current character scales C 10 CALL GSTSAV(NTRSAV) PI = ATAN2(1.0,1.0)*4.0 ANGFAC = PI/180.0 THETA = ANGLE*ANGFAC CALL GSSCLC(HGT,HGT) CALL GSCROT(THETA,THETA+PI/2.0) IF ((X.NE.999.0) .OR. (Y.NE.999.0) .OR. + (NENTRY.NE.1)) CALL GSANCU(X,Y) IF (NENTRY.EQ.2) THEN C C---- "NUMBER" plots a formatted number left justified C NJUST = 1 IF (NDIG.GE.0) THEN C C---- NDIG ge 0 use decimal format C NAFTER = NDIG NDIGIT = NDIG CALL GSFNUM(FNUM,NDIGIT,NAFTER,1.0,1.0,NJUST) ELSE C C---- NDIG.lt.0 plot as integer C INUM = FNUM NDIGIT = 1 CALL GSINUM(INUM,NDIGIT,1.0,1.0,NJUST) END IF ELSE C C---- "SYMBOL" plots a string C CALL GSSTRH(BYTXT,NC) END IF C C---- Restore scales C CALL GSTRES(NTRSAV) C END libccp4-8.0.0/fortran/plotsubs.f0000644000000000000000000006210514242731033014665 0ustar 00000000000000C C plotsubs.f C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C SUBROUTINE PLTAXS(VWPORT,XLOW,XHIGH,NXTICK,NXSTCK,LXTICK,XLABEL, . YLOW,YHIGH,NYTICK,NYSTCK,LYTICK,YLABEL) C ================================================================ C C C Draw box of axes, and set up user coordinate transformation C C C VWPORT(2,2) viewport, ie coordinates (in range 0 to 1) of C bottom left corner (i,1) and top right corner (i,2) C of box C XLOW, XHIGH range of values on x C NXTICK if .gt.0 approximate number of tick marks on x (=0 if none) C If .lt.0, use exactly the range (XLOW - XHIGH) & number C of ticks specified C NXSTCK number of subsidiary tick marks / division on x C LXTICK |LXTICK| = 1 ticks inside box C = 2 ticks outside box C .gt. 0 draw tick & label at end of axis C .lt. 0 omit last tick & label at end of axis C XLABEL label for x axis C C similarly, YLOW,YHIGH,NYTICK,NYSTCK,LYTICK,YLABEL C C REAL VWPORT(2,2),XLOW,XHIGH,YLOW,YHIGH INTEGER NXTICK,NXSTCK,LXTICK,NYTICK,NYSTCK,LYTICK CHARACTER*(*) XLABEL,YLABEL C REAL X,Y,TSIZE,WINDOW(2,2),WIN1,WIN2 INTEGER L,NLAB,IFLAG,JTICK,LENSTR EXTERNAL LINSUB,TXTSUB C C TSIZE=1.2 C C x axis IF(NXTICK.GT.0) THEN C Find "best" tick positions CALL UGLNDX(XLOW,XHIGH,NXTICK-2,NXTICK+2, . WIN1,WIN2,NLAB) C avoid aliasing array elements WINDOW (1,1) = WIN1 WINDOW (1,2) = WIN2 ELSE C Use given values NLAB=IABS(NXTICK) WINDOW(1,1)=XLOW WINDOW(1,2)=XHIGH ENDIF C Get best format for numbers CALL PLTNDG(WINDOW(1,1),WINDOW(1,2),NLAB) C bottom axis IFLAG=1 JTICK=LXTICK CALL UGLNAX(LINSUB,TXTSUB,IFLAG, . VWPORT(1,1),VWPORT(2,1),VWPORT(1,2),VWPORT(2,1), . WINDOW(1,1),WINDOW(1,2),NLAB,NXSTCK,JTICK) C top IFLAG=0 JTICK=(3-IABS(LXTICK))*ISIGN(1,LXTICK) CALL UGLNAX(LINSUB,TXTSUB,IFLAG, . VWPORT(1,1),VWPORT(2,2),VWPORT(1,2),VWPORT(2,2), . WINDOW(1,1),WINDOW(1,2),NLAB,NXSTCK,JTICK) C C Plot label L=LENSTR(XLABEL) X=0.5*(VWPORT(1,1)+VWPORT(1,2)) Y=VWPORT(2,1)-0.07 CALL PLTCTX(XLABEL(1:L),X,Y,TSIZE,2,0.0) C C y axis IF(NYTICK.GT.0) THEN C Find "best" tick positions CALL UGLNDX(YLOW,YHIGH,NYTICK-2,NYTICK+2, . WIN1,WIN2,NLAB) C avoid aliasing array elements WINDOW (2,1) = WIN1 WINDOW (2,2) = WIN2 ELSE C Use given values NLAB=IABS(NYTICK) WINDOW(2,1)=YLOW WINDOW(2,2)=YHIGH ENDIF C Get best format for numbers CALL PLTNDG(WINDOW(2,1),WINDOW(2,2),NLAB) C left IFLAG=2 JTICK=(3-IABS(LYTICK))*ISIGN(1,LYTICK) CALL UGLNAX(LINSUB,TXTSUB,IFLAG, . VWPORT(1,1),VWPORT(2,1),VWPORT(1,1),VWPORT(2,2), . WINDOW(2,1),WINDOW(2,2),NLAB,NYSTCK,JTICK) C right IFLAG=0 JTICK=LYTICK CALL UGLNAX(LINSUB,TXTSUB,IFLAG, . VWPORT(1,2),VWPORT(2,1),VWPORT(1,2),VWPORT(2,2), . WINDOW(2,1),WINDOW(2,2),NLAB,NYSTCK,JTICK) C C Plot label L=LENSTR(YLABEL) X=VWPORT(1,1)-0.11 Y=0.5*(VWPORT(2,1)+VWPORT(2,2)) CALL PLTCTX(YLABEL(1:L),X,Y,TSIZE,3,90.0) C C Set up user transformation CALL PLTWIN(VWPORT,WINDOW) C END SUBROUTINE PLTCHS(SCALE) C ======================== C C Set character scale as fraction of space 0-1 C REAL SCALE C CALL GSSCLC(SCALE,SCALE) END SUBROUTINE PLTCTX(STRING,X,Y,SIZE,MODE,ANGLE) C ============================================= C C*** Plot84 version C Plot STRING at X,Y, rotated by ANGLE, relative size SIZE C MODE = 1, 2, 3 justify left, middle, right C CHARACTER*(*) STRING REAL X,Y,ANGLE,DTOR,SIZE INTEGER MODE C C DTOR=ATAN(1.)/45. CALL GSANCU(X,Y) CALL GSCROT(ANGLE*DTOR,(ANGLE+90.)*DTOR) CALL GSCETS(STRING,SIZE,SIZE,MODE) END SUBROUTINE PLTDBU(X,Y) C ====================== C C Draw by point X,Y (user units) C REAL X,Y,XV,YV C C transform coordinates CALL PLTTNS(X,Y,XV,YV) CALL PLTDBY(XV,YV) END SUBROUTINE PLTDBY(X,Y) C ====================== C C*** Plot84 version C Draw to X,Y C REAL X,Y CALL GSDWBY(X,Y) END SUBROUTINE PLTDRW(X,Y) C ====================== C C*** Plot84 version C Draw to X,Y C REAL X,Y CALL GSDWTO(X,Y) END SUBROUTINE PLTDSH(M,R,D,T) C ========================== C C Set dash parameters C C M =0 SOLID LINE C M=1 DASHED LINE (DOT DUMMY PARAMETER) C M=2 CHAINED LINE C R == REPEAT repeat length C D == DASH dash length C T == DOT not used C REPEAT DASH DOT are in basic picture units (ie range 0 to 1 ) C INTEGER M REAL R,D,T C COMMON /DASH/ LPT,MODE,REPEAT,DASH,DOT,A1,B1 REAL REPEAT,DASH,DOT,A1,B1 INTEGER LPT,MODE SAVE /DASH/ C C MODE=M REPEAT=R DASH=D DOT=T LPT=0 END SUBROUTINE PLTDWU(X,Y) C ====================== C C Draw to point X,Y (user units) C REAL X,Y,XV,YV C C transform coordinates CALL PLTTNF(X,Y,XV,YV) CALL PLTDRW(XV,YV) END SUBROUTINE PLTFNM(FNUM,NDIG,NAFTER,X,Y,SIZE,MODE,ANGLE) C ======================================================== C C*** Plot84 version C Plot real FNUM at X,Y, rotated by ANGLE C NDIG digits, NAFTER digits after decimal point C MODE = 1, 2, 3 justify left, middle, right C REAL FNUM,X,Y,ANGLE,DTOR,SIZE INTEGER NDIG,NAFTER,MODE C C DTOR=ATAN(1.)/45. CALL GSANCU(X,Y) CALL GSCROT(ANGLE*DTOR,(ANGLE+90.)*DTOR) CALL GSFNUM(FNUM,NDIG,NAFTER,SIZE,SIZE,MODE) END SUBROUTINE PLTINI C ================= C C*** Plot84 version C Initialize plot on logical name PLOT C REAL XSIZE,YSIZE,CSIZE DATA XSIZE,YSIZE,CSIZE/200.,200.,0.015/ C CALL GSINIT('PLOT') CALL GSBSIZ(XSIZE,YSIZE) C 10 CALL GSPICT C User coordinates in range 0 - 1 on x & y CALL GSORGD(0.01*XSIZE,0.01*YSIZE) CALL GSSCLU(XSIZE*0.99,YSIZE*0.99) C Scale characters to CSIZE (user units) CALL GSTLNK(1) CALL GSSCLC(CSIZE,CSIZE) C Centred characters CALL GSCENC(1) RETURN C ENTRY PLTPIC C ============= C C Start new picture C CALL GSENDP GO TO 10 END SUBROUTINE PLTINM(INUM,NDIG,X,Y,SIZE,MODE,ANGLE) C ============================================ C C*** Plot84 version C Plot integer INUM at X,Y, rotated by ANGLE C NDIG digits C MODE = 1, 2, 3 justify left, middle, right C REAL X,Y,ANGLE,DTOR,SIZE INTEGER INUM,NDIG,MODE C C DTOR=ATAN(1.)/45. CALL GSANCU(X,Y) CALL GSCROT(ANGLE*DTOR,(ANGLE+90.)*DTOR) CALL GSINUM(INUM,NDIG,SIZE,SIZE,MODE) END SUBROUTINE PLTLIN(X,Y,NPT) C ========================= C C Draw lines to join NPT points X,Y C Coordinates are in user units C INTEGER NPT REAL X(NPT),Y(NPT) C COMMON /DASH/ LPT,MODE,REPEAT,DASH,DOT,A1,B1 REAL REPEAT,DASH,DOT,A1,B1 INTEGER LPT,MODE SAVE /DASH/ C REAL SMALL,GAP,A,B,X1,Y1,X2,Y2,DX,DY,R,XD,YD,XG,YG,D INTEGER I,J DATA SMALL/0.001/ C C MODE =0 FOR SOLID LINES IF(NPT.LE.1) RETURN IF(MODE.GT.0) GO TO 10 C C SOLID CALL PLTMVU(X(1),Y(1)) DO 1 I=2,NPT 1 CALL PLTDWU(X(I),Y(I)) RETURN C C C DASHED LINES, REPEAT IS REPEAT LENGTH, DASH IS DASH LENGTH C DOT IS DUMMY (NO CHAIN LINES) 10 GAP=REPEAT-DASH A=DASH B=GAP C LPT=0 IF 1ST CALL SINCE CALL TO S/R DASHED, OTHERWISE KEEP DASHES IN PHASE IF(LPT.EQ.0) GO TO 11 A=A1 B=B1 C 11 LPT=1 C Convert user units to picture units before working out dashing CALL PLTTNF(X(1),Y(1),X1,Y1) CC X1=X(1) CC Y1=Y(1) I=2 CALL PLTMOV(X1,Y1) C C COME HERE FOR NEW LINE 15 CALL PLTTNF(X(I),Y(I),X2,Y2) CC15 X2=X(I) CC Y2=Y(I) DX=X2-X1 DY=Y2-Y1 D=SQRT(DX*DX+DY*DY) IF(D.LT.SMALL) GO TO 30 DX=DX/D DY=DY/D R=D A1=0. B1=0. J=-1 C C R IS REMAINING LINE LENGTH C COME HERE FOR EACH DASH REPEAT 20 IF(R.LT.(A+B)) GO TO 25 IF(J) 26,26,27 C C LAST BIT, GET REMAINING DASH LENGTH 25 IF(R.LT.A) GO TO 21 C LAST PART IS IN GAP A1=0. B1=B-R+A B=R-A GO TO 22 C LAST PART IS IN DASH 21 A1=A-R B1=GAP A=R B=0. 22 J=-2 C 26 J=J+1 XD=A*DX YD=A*DY XG=B*DX YG=B*DY C 27 IF(A.GT.SMALL) CALL PLTDBY(XD,YD) IF(B.GT.SMALL) CALL PLTMBY(XG,YG) R=R-A-B IF(J) 30,28,20 C RESET DASH LENGTH AFTER 1ST REPEAT 28 A=DASH B=GAP J=0 GO TO 20 C C END OF LINE, RESTORE UNUSED DASH LENGTH 30 I=I+1 IF(I.GT.NPT) RETURN X1=X2 Y1=Y2 A=A1 B=B1 GO TO 15 C END SUBROUTINE PLTMBU(X,Y) C ====================== C C Move by point X,Y (user units) C REAL X,Y,XV,YV C C transform coordinates CALL PLTTNS(X,Y,XV,YV) CALL PLTMBY(XV,YV) END SUBROUTINE PLTMBY(X,Y) C ====================== C C*** Plot84 version C Move by X,Y C REAL X,Y CALL GSMVBY(X,Y) END SUBROUTINE PLTMOV(X,Y) C ====================== C C*** Plot84 version C Move to X,Y C REAL X,Y CALL GSMVTO(X,Y) END SUBROUTINE PLTMVU(X,Y) C ====================== C C Move to point X,Y (user units) C REAL X,Y,XV,YV C C transform coordinates CALL PLTTNF(X,Y,XV,YV) CALL PLTMOV(XV,YV) END SUBROUTINE PLTNDG(LOW,HIGH,NLAB) C ================================ C C Try to determine "best" number format for axis labelling C Input: C low, high low & high values for tick marks C nlab number of tick marks C C Output in COMMON /PLTDIG/ C ndec number of digits in number C idec number of digits after decimal point (0 for integer) C REAL RANGE,LOW,HIGH,DVAL,BIG INTEGER NLAB,N LOGICAL LINT C COMMON /PLTDIG/ NDEC,IDEC INTEGER NDEC,IDEC SAVE /PLTDIG/ C RANGE=HIGH-LOW BIG=MAX(ABS(LOW),ABS(HIGH)) C NDEC=5 IDEC=1 LINT=.FALSE. C DVAL=1.0 IF(NLAB.GT.1) DVAL=RANGE/(NLAB-1) IDEC=1-ALOG10(ABS(DVAL)) C IF(ABS(RANGE).GT.9.99) THEN LINT=.TRUE. NDEC=2+ALOG10(BIG) ENDIF C IF(AMOD(DVAL,1.0).EQ.0.0 .AND. . AMOD(LOW,1.0).EQ.0.0) LINT=.TRUE. C IF(LINT) IDEC=0 IF((LOW.LT.0.0.OR.HIGH.LT.0.0)) THEN N=0 IF(IDEC.GT.0) N=2+IDEC IF(NDEC.LT.N) NDEC=NDEC+1 ENDIF C END SUBROUTINE PLTSTP C ================= C C*** Plot84 version C Stop plotting C CALL GSENDP CALL GSSTOP END SUBROUTINE PLTTNF(X,Y,XV,YV) C ============================ C C Transform user X,Y to plotter XV,YV (range 0 to 1) C C REAL X,Y,XV,YV C COMMON /PLTTRN/ ORIGX,ORIGY,VSCALX,VSCALY REAL ORIGX,ORIGY,VSCALX,VSCALY SAVE /PLTTRN/ C XV=X*VSCALX+ORIGX YV=Y*VSCALY+ORIGY END C SUBROUTINE PLTTNS(X,Y,XV,YV) C ============================ C C Transform user X,Y to plotter XV,YV (range 0 to 1) C without translation (scaling only) C C REAL X,Y,XV,YV C COMMON /PLTTRN/ ORIGX,ORIGY,VSCALX,VSCALY SAVE /PLTTRN/ REAL ORIGX,ORIGY,VSCALX,VSCALY C XV=X*VSCALX YV=Y*VSCALY RETURN END C SUBROUTINE PLTWIN(VWPORT,WINDOW) C ================================ C C Set up mapping of viewport VWPORT to user window WINDOW C REAL VWPORT(2,2),WINDOW(2,2) C COMMON /PLTTRN/ ORIGX,ORIGY,VSCALX,VSCALY REAL ORIGX,ORIGY,VSCALX,VSCALY SAVE /PLTTRN/ C VSCALX=(VWPORT(1,2)-VWPORT(1,1))/(WINDOW(1,2)-WINDOW(1,1)) VSCALY=(VWPORT(2,2)-VWPORT(2,1))/(WINDOW(2,2)-WINDOW(2,1)) ORIGX=VWPORT(1,1)-WINDOW(1,1)*VSCALX ORIGY=VWPORT(2,1)-WINDOW(2,1)*VSCALY END SUBROUTINE UGLNAX(LSUB,TSUB,TFLG,XCLO,YCLO,XCHI,YCHI, X LOLB,HILB,NLAB,NSUBTK,LLTICK) C C ******************* THE UNIFIED GRAPHICS SYSTEM ******************* C * AXIS GENERATION SUBROUTINE * C * * C * THIS SUBROUTINE MAY BE USED TO GENERATE A DESCRIPTION OF AN * C * AXIS WITH LINEAR LABELING. A PAIR OF USER SUPPLIED SUBROUTINES * C * ARE CALLED TO PROCESS THE LINE SEGMENT END POINTS AND THE TEXT. * C * * C * THE CALLING SEQUENCE IS: * C * CALL UGLNAX(LSUB,TSUB,TFLG,XCLO,YCLO,XCHI,YCHI, * C * LOLB,HILB,NLAB,NSUBTK,LLTICK) * C * * C * THE PARAMETERS IN THE CALLING SEQUENCE ARE: * C * LSUB THE LINE SEGMENT END POINT SUBROUTINE. * C * TSUB THE LABEL SUBROUTINE. * C * TFLG A FLAG THAT IS PASSED TO TSUB. * C * XCLO X COORDINATE OF THE LOW END OF THE AXIS. * C * YCLO Y COORDINATE OF THE LOW END OF THE AXIS. * C * XCHI X COORDINATE OF THE HIGH END OF THE AXIS. * C * YCHI Y COORDINATE OF THE HIGH END OF THE AXIS. * C * LOLB DATA VALUE AT THE LOW END OF THE AXIS. * C * HILB DATA VALUE AT THE HIGH END OF THE AXIS. * C * NLAB NUMBER OF LABELS ON THE AXIS. if =0, no tick marks * C * NSUBTK Number of subsidiary tick marks between main ones. * C * LLTICK =1 tick on left, =2 tick on right =3 both * C * if .lt.0, don't plot tick or label at end of axis * C * * C * ROBERT C. BEACH * C * COMPUTATION RESEARCH GROUP * C * STANFORD LINEAR ACCELERATOR CENTER * C * * C ********************************************************************* C PRE 28/7/88 bodged C EXTERNAL LSUB,TSUB INTEGER TFLG REAL XCLO,YCLO,XCHI,YCHI,LOLB,HILB INTEGER NLAB,NSUBTK,LLTICK C C INTEGER EXNT REAL EXLS,EXRS C REAL DLAX,DLAY REAL DLTX,DLTY REAL DLBX,DLBY,DLBL REAL DLCX,DLCY REAL XCRD,YCRD,VALU REAL XCDS,YCDS C REAL FLT1 INTEGER INT1,INT2,LTICK,J C LTICK=IABS(LLTICK) C EXNT=MAX(0,NSUBTK) EXLS=0.0 EXRS=EXLS FLT1=0.01*MAX(ABS(XCHI-XCLO),ABS(YCHI-YCLO)) IF(MOD(LTICK,2).EQ.1) EXLS=FLT1 IF(LTICK.GE.2) EXRS=FLT1 C C DRAW THE AXIS STARTING AT THE LOW END. IF (NLAB.LT.2) THEN C Just draw line if .le.2 ticks CALL LSUB(XCLO,YCLO,0) CALL LSUB(XCHI,YCHI,1) GO TO 201 ENDIF C CALL LSUB(XCLO,YCLO,0) CALL LSUB(XCHI,YCHI,1) C C INITIALIZE THE TIC MARK AND LABEL LOOP. DLAX=XCHI-XCLO DLAY=YCHI-YCLO FLT1=SQRT(DLAX*DLAX+DLAY*DLAY) DLTX=DLAY/FLT1 DLTY=-DLAX/FLT1 FLT1=REAL(NLAB-1) DLBX=DLAX/FLT1 DLBY=DLAY/FLT1 DLBL=(HILB-LOLB)/FLT1 IF (EXNT.GE.1) THEN FLT1=REAL(EXNT+1) DLCX=DLBX/FLT1 DLCY=DLBY/FLT1 END IF C C LOOP TO GENERATE THE TIC MARKS AND LABELS. C Skip first tick (end of axis) if LLTICK .lt. 0 J=1 IF(LLTICK.LT.0) J=2 DO 102 INT1=J,NLAB C GENERATE TIC MARK POSITION. FLT1=REAL(INT1-1) XCRD=XCHI-FLT1*DLBX YCRD=YCHI-FLT1*DLBY C GENERATE A LABEL. VALU=HILB-FLT1*DLBL CALL TSUB(XCRD,YCRD,VALU,TFLG) C GENERATE A PRIMARY TIC MARK. CALL LSUB(XCRD+EXRS*DLTX,YCRD+EXRS*DLTY,0) CALL LSUB(XCRD-EXLS*DLTX,YCRD-EXLS*DLTY,1) C GENERATE SECONDARY TIC MARKS. IF ((INT1.NE.NLAB).AND.(EXNT.GE.1)) THEN DO 101 INT2=1,EXNT FLT1=REAL(INT2) XCDS=XCRD-FLT1*DLCX YCDS=YCRD-FLT1*DLCY CALL LSUB(XCDS+0.5*EXRS*DLTX,YCDS+0.5*EXRS*DLTY,2) CALL LSUB(XCDS-0.5*EXLS*DLTX,YCDS-0.5*EXLS*DLTY,3) 101 CONTINUE END IF 102 CONTINUE C 201 RETURN C C END SUBROUTINE UGLNDX(LODA,HIDA,MINL,MAXL,LOLB,HILB,NLAB) C C ******************* THE UNIFIED GRAPHICS SYSTEM ******************* C * AUXILIARY AXIS GENERATION PROGRAM * C * * C * THIS SUBROUTINE IS AN AID IN USING SUBROUTINE UGLNAX. IF A * C * PROGRAMMER DETERMINES THE EXTENT OF THE DATA AT EXECUTION TIME, * C * IT CAN BE A PROBLEM TO SUPPLY VALUES OF THE ARGUMENTS LOLB, * C * HILB, AND NLAB WHICH RESULT IN "ROUNDED NUMBERS" FOR THE * C * LABELS. THIS SUBROUTINE ACCEPTS AS ITS INPUT THE EXTENT OF THE * C * DATA AND THE APPROXIMATE NUMBER OF LABELS TO BE USED. ITS * C * OUTPUT IS THE THREE ARGUMENTS FOR UGLNAX. * C * * C * THE CALLING SEQUENCE IS: * C * CALL UGLNDX(LODA,HIDA,MINL,MAXL,LOLB,HILB,NLAB) * C * * C * THE PARAMETERS IN THE CALLING SEQUENCE ARE: * C * LODA LOW LIMIT OF ACTUAL DATA. * C * HIDA HIGH LIMIT OF ACTUAL DATA. * C * MINL MINIMUM NUMBER OF LABELS. * C * MAXL MAXIMUM NUMBER OF LABELS. * C * LOLB COMPUTED LOW LIMIT OF AXIS. * C * HILB COMPUTED HIGH LIMIT OF AXIS. * C * NLAB COMPUTED NUMBER OF LABELS. * C * * C * ROBERT C. BEACH * C * COMPUTATION RESEARCH GROUP * C * STANFORD LINEAR ACCELERATOR CENTER * C * * C ********************************************************************* C REAL LODA,HIDA INTEGER MINL,MAXL REAL LOLB,HILB INTEGER NLAB C CCCC INCLUDE 'UGSYSTEM:UGERRCBK.FOR/LIST' C REAL PVAL(3) INTEGER NPVL C REAL DALO,DAHI,SCAL,DLOX,DHIX,SCLX,OVLP REAL TVR1,TVR2 INTEGER IMIN,IMAX C INTEGER INT1,INT2,INT3,INT4 C DATA PVAL/1.0,2.0,5.0/ DATA NPVL/3/ C C ADJUST THE GIVEN DATA LIMITS. IF (LODA.LT.HIDA) THEN DALO=LODA DAHI=HIDA ELSE DALO=HIDA-0.5 DAHI=LODA+0.5 END IF TVR1=0.0005*(DAHI-DALO) DALO=DALO+TVR1 DAHI=DAHI-TVR1 C INITIALIZE THE LOOP TO FIND THE BEST VALUES. OVLP=1E20 IMIN=MAX(2,MINL) IMAX=MAX(IMIN,MAXL) C LOOP TO FIND THE BEST VALUES. DO 104 INT1=IMIN,IMAX SCAL=INT1-1 TVR2=(DAHI-DALO)/SCAL TVR1=LOG10(TVR2) INT2=INT(TVR1) IF (TVR1.LT.0.0) INT2=INT2-1 TVR2=TVR2/(10.0**INT2) IF (TVR2.GT.PVAL(NPVL)) THEN INT2=INT2+1 TVR2=TVR2/10.0 END IF DO 101 INT4=1,NPVL INT3=INT4 IF (PVAL(INT3).GE.TVR2) GO TO 102 101 CONTINUE 102 SCLX=PVAL(INT3)*(10.0**INT2) TVR1=(DAHI+DALO-SCLX*SCAL)/(2.0*SCLX) DLOX=AINT(TVR1)*SCLX IF (TVR1.LT.0.0) DLOX=DLOX-SCLX 103 DHIX=DLOX+SCLX*SCAL IF (DAHI.GT.DHIX) THEN DLOX=DLOX+SCLX IF ((DLOX-DALO).LE.(0.005*SCLX)) GO TO 103 IF (NPVL.NE.INT3) THEN INT3=INT3+1 ELSE INT3=1 INT2=INT2+1 END IF GO TO 102 END IF IF ((DHIX-DLOX).LT.OVLP) THEN OVLP=DHIX-DLOX LOLB=DLOX HILB=DHIX NLAB=INT1 END IF 104 CONTINUE C RETURN C END SUBROUTINE LINSUB(X,Y,IFLAG) C ============================ C C Line drawing subroutine called by UGLNAX C Move (IFLAG = 0 or 2) or draw (IFLAG = 1 or 3) to X,Y C REAL X,Y INTEGER IFLAG C IF(MOD(IFLAG,2).EQ.0) THEN CALL PLTMOV(X,Y) ELSE CALL PLTDRW(X,Y) ENDIF END SUBROUTINE TXTSUB(X,Y,VALU,IFLAG) C ================================= C C Text drawing subroutine called by UGLNAX C C IFLAG = 1 horizontal axis C = 2 vertical axis C REAL X,Y,VALU,XX,YY,ANGLE,SIZE INTEGER MODE,IFLAG C COMMON /PLTDIG/ NDEC,IDEC INTEGER NDEC,IDEC SAVE /PLTDIG/ C SIZE=1.0 XX=X YY=Y IF(IFLAG.EQ.1) THEN YY=YY-0.03 MODE=2 ANGLE=0.0 ELSEIF(IFLAG.EQ.2) THEN XX=XX-0.02 MODE=3 ANGLE=0.0 ELSE RETURN ENDIF C IF(IDEC.EQ.0) THEN CALL PLTINM(NINT(VALU),NDEC,XX,YY,SIZE,MODE,ANGLE) ELSE CALL PLTFNM(VALU,NDEC,IDEC,XX,YY,SIZE,MODE,ANGLE) ENDIF C RETURN END C C SUBROUTINE PL84CLEAR C ===================== C C C---- Start a new picture C C C .. External Subroutines .. EXTERNAL GSPICT C .. CALL GSPICT END C C C SUBROUTINE PL84CLOSE C ===================== C C C .. External Subroutines .. EXTERNAL GSSTOP C .. CALL GSSTOP END C C C SUBROUTINE PL84DRAW(IX,IY) C =========================== C C C---- Convert from 10 micron units to mm C C C .. Scalar Arguments .. INTEGER IX,IY C .. C .. Local Scalars .. REAL X,Y C .. C .. External Subroutines .. EXTERNAL GSDWTO C .. X = 0.01*IX Y = 0.01*IY CALL GSDWTO(X,Y) END C C C SUBROUTINE PL84END C =================== C C C .. External Subroutines .. EXTERNAL GSENDP C .. CALL GSENDP END C C C C **** PLOT84 ROUTINES ***** C =============== C C SUBROUTINE PL84INIT C ==================== C C C---- Initialise PLOT84 file C C C .. External Subroutines .. EXTERNAL GSINIT C .. CALL GSINIT('PLOT') END C C C SUBROUTINE PL84INTEG(INUM,NDIG,SIZX,SIZY,NJUST) C =============================================== C C C .. Scalar Arguments .. REAL SIZX,SIZY INTEGER INUM,NDIG,NJUST C .. C .. External Subroutines .. EXTERNAL GSINUM C .. CALL GSINUM(INUM,NDIG,SIZX,SIZY,NJUST) END C C C SUBROUTINE PL84MOVE(IX,IY) C =========================== C C C C---- Convert from 10 micron units to mm C C C .. Scalar Arguments .. INTEGER IX,IY C .. C .. Local Scalars .. REAL X,Y C .. C .. External Subroutines .. EXTERNAL GSMVTO C .. X = 0.01*IX Y = 0.01*IY CALL GSMVTO(X,Y) END C C C SUBROUTINE PL84NEWLINE(X) C ========================== C C C .. Scalar Arguments .. REAL X C .. C .. External Subroutines .. EXTERNAL GSLNFD C .. CALL GSLNFD(X) END C C C SUBROUTINE PL84ORIGIN(X,Y) C =========================== C C C .. Scalar Arguments .. REAL X,Y C .. C .. External Subroutines .. EXTERNAL GSANCD C .. CALL GSANCD(X,Y) END C C C SUBROUTINE PL84REAL(X,NDIG,NAFTER,SIZX,SIZY,NJUST) C =================================================== C C C .. Scalar Arguments .. REAL SIZX,SIZY,X INTEGER NAFTER,NDIG,NJUST C .. C .. External Subroutines .. EXTERNAL GSFNUM C .. CALL GSFNUM(X,NDIG,NAFTER,SIZX,SIZY,NJUST) END C C C SUBROUTINE PL84STRING(STR) C =========================== C C C C C .. Scalar Arguments .. CHARACTER STR* (*) C .. C .. External Subroutines .. EXTERNAL GSSTRC C .. CALL GSSTRC(STR) END C C C SUBROUTINE PL84XCUR(X) C ======================= C C C .. Scalar Arguments .. REAL X C .. C .. External Subroutines .. EXTERNAL GSSCUR C .. CALL GSSCUR(X) END libccp4-8.0.0/fortran/pxxml.f0000644000000000000000000003521614242731033014165 0ustar 00000000000000C C pxxml.f: write XML tags into program outout C Copyright (C) 2001 Alun Ashton C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C C C C ========= C pxxml.f C ========= C C Author : a.w.ashton@ccp4.ac.uk C Version : 1.0 C future : translate to C or C++ C C Assumption 1 : Exsisting/New file C XML files are only to be writen from new. The design must take into consideration C the possability of future extension so that XML file might be reopned. C C Assumption 2 : Sizes C The maximum size for an Element value or name is 80 characters. C The maximum size for an Attribute value or name is 80 characters. C The maximum size for program name is 20 characters. C The maximum size for XML filename – including path is 70 characters. C The maximum number of elements is 80. C C Assumption 3: Language C In the first instance the libs will be writen in fortran to test the other C assumptions! C SUBROUTINE XMLOpen (XMLFileUnit, rootvalue, ifail) C C First subroutine to be called. C Arguments: XMLFIleUnit : Input - No value C Output returns the file Unit number C root value = eg html C Ifail : same as usual! C C Purpose: open an XML file. C C See if XMLFILE has been assigned e.g. on command line. C If XMLFILE not assigned use program name.xml. C If file exists overwrite it. C Write out the header. C No provision for existing XML files to be reopened subroutine XMLOpen (XMLFileUnit, rootvalue, ifail) logical ccpexs character*(*) rootvalue integer XMLFileUnit, ifail, elementstatus(80), elementnumber character*80 openelements(80), XMLFileName character*1024 XMLOutputLine character version*10, date*8, progname*32 common /ccp4xmld/ elementnumber, elementstatus, openelements, $ XMLFileName,XMLOutputLine integer lenstr external ccpexs,lenstr XMLFileName=' ' elementnumber=0 elementstatus(1)=0 call ccp4_version(version) call ccpdat(date) call ccppnm(progname) call ugtenv('XMLFILE',XMLFileName) if (XMLFileUnit.ne.6) then if (XMLFileName.eq.' ') + XMLFileName=progname(1:lenstr(progname))//'.xml' if (ccpexs(XMLFileName)) call ccperr(2,'XMLFILE OVERWRITTEN') call ccpdpn(XMLFileUnit,XMLFileName,'UNKNOWN','F',0,ifail) endif C check to see if the rootvalue has a value or default to html if (lenstr(rootvalue).le.1) rootvalue='html' if (rootvalue(1:lenstr(rootvalue)).ne.'html') $ write (XMLFileUnit,'(A)') '' call XMLOpenElement(XMLFileUnit, rootvalue(1:lenstr(rootvalue)), $ ifail) if (rootvalue(1:lenstr(rootvalue)).ne.'html') then C First element should be information about the program call XMLOpenElement(XMLFileUnit, $ progname(1:lenstr(progname)), ifail) call XMLWriteAttribute(XMLFileUnit, $ progname(1:lenstr(progname)), $ 'ccp4_version', version(1:lenstr(version)), ifail) call XMLWriteAttribute(XMLFileUnit, $ progname(1:lenstr(progname)), $ 'date', date(1:lenstr(date)), ifail) call XMLCloseElement(XMLFileUnit, progname(1:lenstr(progname)), $ ifail) endif return end C subroutine XMLWriteJournalCitation(XMLFileUnit, AuthorsString, C + JournalString, VolumeString, PageStart, PageEnd, YearString, C + ifail) C For example: C call XMLWriteJournalCitation(XMLFILEUNIT,'B.W.Matthews', C + 'J.Mol.Biol.','33','491','497','1968',ifail) C If using the Bioxhit schema, this should only be called once C for each processing_stage. subroutine XMLWriteJournalCitation(XMLFileUnit, AuthorsString, + JournalString, VolumeString, IssueString, PageStart, PageEnd, + YearString, ifail) integer XMLFileUnit, ifail character*(*) AuthorsString, JournalString, VolumeString, + IssueString, PageStart, PageEnd, YearString call XMLOpenElement(XMLFileUnit,'citation',ifail) call XMLWriteElement(XMLFileUnit, + 'citation_type', 'journal', ifail) if (AuthorsString.ne.' ') call XMLWriteElement(XMLFileUnit, + 'citation_id', AuthorsString, ifail) if (JournalString.ne.' ') call XMLWriteElement(XMLFileUnit, + 'journal_abbreviation', JournalString, ifail) if (VolumeString.ne.' ') call XMLWriteElement(XMLFileUnit, + 'journal_volume', VolumeString, ifail) if (IssueString.ne.' ') call XMLWriteElement(XMLFileUnit, + 'journal_issue', IssueString, ifail) if (PageStart.ne.' ') call XMLWriteElement(XMLFileUnit, + 'page_from', PageStart, ifail) if (PageEnd.ne.' ') call XMLWriteElement(XMLFileUnit, + 'page_to', PageEnd, ifail) if (YearString.ne.' ') call XMLWriteElement(XMLFileUnit, + 'publication_year', YearString, ifail) call XMLCloseElement(XMLFileUnit,'citation',ifail) return end C subroutine XMLWriteMessages(XMLFileUnit, ccperr_level, C + MessageString, ifail) C For example: C call XMLWriteMessage(XMLFileUnit,0,'Normal Termination',ifail) C If using the Bioxhit schema, this should only be called once C for each processing_stage. subroutine XMLWriteMessages(XMLFileUnit, ccperr_level, + MessageString, ifail) integer XMLFileUnit, ifail, ccperr_level character*(*) MessageString character MessageCode*4,MessageSeverity*12 write(MessageCode,'(I4)') ccperr_level if (ccperr_level.eq.0) MessageSeverity='information' if (ccperr_level.eq.1) MessageSeverity='fatal error' if (ccperr_level.eq.2) MessageSeverity='warning' if (ccperr_level.eq.3) MessageSeverity='information' if (ccperr_level.eq.4) MessageSeverity='information' call XMLOpenElement(XMLFileUnit,'messages',ifail) call XMLWriteElement(XMLFileUnit, + 'message_code', MessageCode, ifail) if (MessageString.ne.' ') call XMLWriteElement(XMLFileUnit, + 'message_text', MessageString, ifail) call XMLWriteElement(XMLFileUnit, + 'message_severity', MessageSeverity, ifail) call XMLCloseElement(XMLFileUnit,'messages',ifail) return end C subroutine XMLOpenElement(XMLFileUnit, ElementName, ifail) C XMLFileUnit - integer - if file not already opened it will be C element name = value is char string. C completes a tag and reates a sub element but leaves tag open C e.g. C ') c tag end and start... 100 format('>') 105 format('<') c this is the indent 110 format(' ') c simply a string... 120 format(a) c indented open tag 130 format(a,'<',a) return end C subroutine XMLWriteAttribute C ElementName - if element not already opened then it will be C these are strings: AttributeName, AttributeValue, C subroutine XMLWriteAttribute(XMLFileUnit, ElementName, $ AttributeName, AttributeValue, ifail) integer lenstr character*(*) ElementName, AttributeName, AttributeValue integer indent integer XMLFileUnit, ifail, elementstatus(80), elementnumber character*80 openelements(80), XMLFileName character*1024 XMLOutputLine common /ccp4xmld/ elementnumber, elementstatus, openelements, $ XMLFileName,XMLOutputLine c save /ccp4xml/ external lenstr c firstly check element is open otherwise open! if (elementstatus(elementnumber).ne.1) then call XMLOpenElement(XMLFileUnit, ElementName, ifail) endif c secondly write the attribute write (XMLOutputLine(lenstr(XMLOutputLine)+1:), 120) $ AttributeName(1:lenstr(AttributeName)), $ AttributeValue(1:lenstr(AttributeValue)) c this is the indent 110 format(' ') c simply a string... 120 format(' ',a,'="',a,'" ') return end C subroutine XMLWriteElement C for inputing the value of the element. if its not already opened C it will be. Closes the element as well C subroutine XMLWriteElement(XMLFileUnit, ElementName, $ ElementValue, ifail) character*(*) ElementName, ElementValue integer XMLFileUnit, ifail, elementstatus(80), elementnumber character*80 openelements(80), XMLFileName character*1024 XMLOutputLine common /ccp4xmld/ elementnumber, elementstatus, openelements, $ XMLFileName,XMLOutputLine c save /ccp4xml/ integer lenstr external lenstr if (ElementName(1:lenstr(ElementName)).ne. $ openelements(elementnumber)) then call XMLOpenElement(XMLFileUnit, ElementName, ifail) endif if (elementnumber.ne.1) then c complete element and give the value write (XMLOutputLine(lenstr(XMLOutputLine)+1:), 125) $ ElementValue(1:lenstr(ElementValue)) elementstatus(elementnumber)=2 endif call XMLCloseElement(XMLFileUnit, ElementName, ifail) c an indented string 125 format('>',a) return end c subroutine XMLCloseElement C the subroutine will close the element if it is the current element C or go up the tree closing all elements till it reaches teh one specified. C if its the root element being specified then it will close the file as well. C subroutine XMLCloseElement(XMLFileUnit, ElementName, ifail) character*(*) ElementName character*80 indentline integer indent, elementlength integer XMLFileUnit, ifail, elementstatus(80), elementnumber character*80 openelements(80), XMLFileName integer lenstr external lenstr character*1024 XMLOutputLine common /ccp4xmld/ elementnumber, elementstatus, openelements, $ XMLFileName,XMLOutputLine c save /ccp4xml/ c sanity check to see if element is open do i = elementnumber,1,-1 if (ElementName(1:lenstr(ElementName)).eq. $ openelements(i)) goto 1 enddo call ccperr(2,'XMLCloseElement: trying to close wrong element') return 1 continue elementlength=lenstr(openelements(elementnumber)) indentline=' ' indent=0 do 10 indent = 1, elementnumber write (indentline(indent:indent), 110) 10 continue if (ElementName(1:lenstr(ElementName)).ne. $ openelements(elementnumber)) then C if the element to close is not the open one then close C the open one - can assume its just e.g. so only need a /> write (XMLOutputLine(lenstr(XMLOutputLine)+1:), 155) write (XMLFileUnit,'(a)') $ XMLOutputLine(1:lenstr(XMLOutputLine)) XMLOutputLine = ' ' openelements(elementnumber)=' ' elementstatus(elementnumber)=0 elementnumber=elementnumber-1 goto 1 else if (elementstatus(elementnumber).eq.1) then write (XMLOutputLine(lenstr(XMLOutputLine)+1:), 155) elementstatus(elementnumber)=2 write (XMLFileUnit,'(a)') $ XMLOutputLine(1:lenstr(XMLOutputLine)) XMLOutputLine = ' ' else if (lenstr(XMLOutputLine).eq.0) then write (XMLOutputLine,145) indentline(1:elementnumber), $ openelements(elementnumber)(1:elementlength) else write (XMLOutputLine(lenstr(XMLOutputLine)+1:), 150) $ openelements(elementnumber)(1:elementlength) endif write (XMLFileUnit,'(a)') $ XMLOutputLine(1:lenstr(XMLOutputLine)) XMLOutputLine = ' ' endif openelements(elementnumber)=' ' elementstatus(elementnumber)=0 elementnumber=elementnumber-1 endif if (elementnumber.eq.0) then close (XMLFileUnit) endif c this is the indent 110 format(' ') c indented complete end tag 145 format(a,'') c indented complete end tag 150 format('') c indented complete end tag 155 format(' />') return end libccp4-8.0.0/fortran/rwbrook.f0000644000000000000000000024255214242731033014505 0ustar 00000000000000C C rwbrook.f: Fortran interface to MMDB for handling coordinates C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C C************************************************************************** C C C************************************************************************** C C C Modifications C C CCB 23/4/01 C test to determine if H or R spacegroup, XYZOPEN2 C SUBROUTINE XYZINIT() C ==================== C C_BEGIN_XYZINIT C C This subroutine initialises the common block RBRKAA ready for reading C and writing coordinate files. Also, the common blocks associated with C storing the header information are initialised. It should be called only C once from the top of the program. C C Parameters: C C NONE C C COMMONS: C C /RBRKAA/ FILESOPEN,LOGUNIT(MAXFILESOPEN),UNIT(MAXFILESOPEN), C TYPE(MAXFILESOPEN) C C FILESOPEN no. of current coordinate files open. C LOGUNIT logical name of file C UNIT if the file is PDB then the unit is the physical C channel opened. If CIF then is related to blocks. C TYPE indicates whether PDB (1,-1) or CIF (2,-2). If C negative then file is output file. C C_END_XYZINIT C C .. Parameters .. INTEGER MAXFILESOPEN PARAMETER (MAXFILESOPEN=90) C .. C .. Variables in Common .. REAL CELL,CELLAS,RF,RO,RR,VOL INTEGER FILESOPEN,ITYP,NCODE,TYPE,UNIT CHARACTER LOGUNIT*80,BRKSPGRP*15 LOGICAL IFCRYS,IFHDOUT,IFNEWCRYS,IFSCAL,MATRIX C .. C .. Local Scalars .. INTEGER I C .. EXTERNAL MMDB_F_INIT,SIMRWBROOK C .. C .. Common Blocks .. COMMON /RBRKAA/ FILESOPEN,LOGUNIT(MAXFILESOPEN), + UNIT(MAXFILESOPEN),TYPE(MAXFILESOPEN) COMMON /RBRKXX/ IFCRYS,IFSCAL,ITYP,MATRIX,IFHDOUT,IFNEWCRYS COMMON /RBRKZZ/ CELL(6),RR(3,3,6),VOL,CELLAS(6) COMMON /ORTHOG/ RO(4,4),RF(4,4),NCODE COMMON /ORTHOGU/ ROU(4,4),RFU(4,4) COMMON /RBRKSPGRP/BRKSPGRP C .. C .. Save .. SAVE /RBRKAA/,/RBRKXX/,/RBRKZZ/,/ORTHOG/,/ORTHOGU/ C .. FILESOPEN = 0 DO 10 I=1,MAXFILESOPEN LOGUNIT(I) = ' ' UNIT(I) = 0 TYPE(I) = 0 10 CONTINUE DO 20 I=1,6 CELL(I) = 0.0 CELLAS(I) = 0.0 20 CONTINUE IFCRYS=.FALSE. IFSCAL=.FALSE. MATRIX=.FALSE. IFHDOUT=.FALSE. IFNEWCRYS=.FALSE. NCODE=0 ITYP=0 C C DO 30 I=1,3 DO 40 J=I+1,4 RO(I,J)=0.0 RO(J,I)=0.0 RF(I,J)=0.0 RF(J,I)=0.0 ROU(I,J)=0.0 ROU(J,I)=0.0 RFU(I,J)=0.0 RFU(J,I)=0.0 40 CONTINUE RO(I,I)=1.0 RF(I,I)=1.0 ROU(I,I)=1.0 RFU(I,I)=1.0 30 CONTINUE C C RO(4,4)=1.0 RF(4,4)=1.0 ROU(4,4)=1.0 RFU(4,4)=1.0 BRKSPGRP = ' ' C... mmdb fortran call to initialise CALL MMDB_F_INIT C... mmdb mimic rwbrook CALL SIMRWBROOK(1) RETURN END C C C SUBROUTINE RBINIT(IUNIT) C ======================== C C_BEGIN_RBINIT C C This routine is obsolete and should be removed. C C_END_RBINIT C C .. Parameters .. INTEGER MAXFILESOPEN PARAMETER (MAXFILESOPEN=90) C .. C .. Scalar Arguments .. INTEGER IUNIT C .. C .. Local Scalars .. INTEGER I,J,IRET C .. C .. Scalars in Common .. INTEGER FILESOPEN,NCODE,ITYP LOGICAL IFHDOUT,IFNEWCRYS,IFCRYS,IFSCAL,MATRIX C .. C .. Arrays in Common .. REAL RF,RO INTEGER UNIT,TYPE CHARACTER LOGUNIT*80 C .. C .. External Routines .. EXTERNAL MMDB_F_INIT,MMDB_F_REWD,SIMRWBROOK C .. C .. Common Blocks .. COMMON /RBRKAA/ FILESOPEN,LOGUNIT(MAXFILESOPEN), + UNIT(MAXFILESOPEN),TYPE(MAXFILESOPEN) COMMON /RBRKXX/IFCRYS,IFSCAL,ITYP,MATRIX,IFHDOUT,IFNEWCRYS COMMON /ORTHOG/RO(4,4),RF(4,4),NCODE COMMON /ORTHOGU/ ROU(4,4),RFU(4,4) C .. C .. Save Statement .. SAVE /RBRKAA/,/RBRKXX/,/ORTHOG/ C .. C C---- Make sure that MMDB_F_INIT is only called once. However, C this is not fool proof C DO 10 I=1,10 IF (IUNIT .EQ. UNIT(I)) GOTO 20 10 CONTINUE C... mmdb, initialise and simulate rwbrook CALL MMDB_F_INIT CALL SIMRWBROOK(1) C... mmdb, rewind channel 20 CALL MMDB_F_REWD(IUNIT,IRET) IFCRYS=.FALSE. IFSCAL=.FALSE. MATRIX=.FALSE. NCODE=0 ITYP=0 IBRKFL=0 C C DO 30 I=1,3 DO 40 J=I+1,4 RO(I,J)=0.0 RO(J,I)=0.0 RF(I,J)=0.0 RF(J,I)=0.0 ROU(I,J)=0.0 ROU(J,I)=0.0 RFU(I,J)=0.0 RFU(J,I)=0.0 40 CONTINUE RO(I,I)=1.0 RF(I,I)=1.0 ROU(I,I)=1.0 RFU(I,I)=1.0 30 CONTINUE RO(4,4)=1.0 RF(4,4)=1.0 ROU(4,4)=1.0 RFU(4,4)=1.0 RETURN END C C C SUBROUTINE XYZOPEN(LOGNAM,RWSTAT,FILTYP,IUNIT,IFAIL) C ===================================================== C C_BEGIN_XYZOPEN C C Calls XYZOPEN2 which has an extra paramater for ignoring C Symmetry and Cryst cards C C Parameters: C C LOGNAM (I) CHARACTER*(*) but maximum of eight? The logical unit C to which the file is assigned C RWSTAT (I) CHARACTER*(*) if 'INPUT' then file is readonly C if 'OUTPUT' then file is an output file. C FILTYP (I) CHARACTER*(*) if 'CIF' then the file type is treated as C CIF. If 'PDB' then the file type is C treated as PDB. If blank then file type is C automatically determined for input files C and for output file the file type will be C the same as the first file opened or C defaulted to PDB. C IUNIT (I/O) INTEGER If zero then unit is decided else C file opened on that unit C checked against previous data if C applicable. NOT used with output files. C IFAIL (I/O) INTEGER On input = 0 stop on failure C = 1 continue on failure C C On output unchanged if OK C = -1 if error C C C_END_XYZOPEN C C implicit none C .. C .. Arguments .. INTEGER IUNIT, IFAIL,ICRYST CHARACTER*(*) FILTYP,LOGNAM,RWSTAT ICRYST = 0 CALL XYZOPEN2(LOGNAM,RWSTAT,FILTYP,IUNIT,IFAIL,ICRYST) RETURN END C C C SUBROUTINE XYZOPEN2(LOGNAM,RWSTAT,FILTYP,IUNIT,IFAIL,ICRYST) C ===================================================== C C_BEGIN_XYZOPEN2 C C Opens a coordinate file for input or output. The channel number can C be determined automatically or set on input. The header info. C is also read: cell, orthog. matrix and symmetry. C This is a version of XYZOPEN with an extra argument to flag whether or C not the CRYST and SCALE cards are required. C C Parameters: C C LOGNAM (I) CHARACTER*(*) but maximum of eight? The logical unit C to which the file is assigned C RWSTAT (I) CHARACTER*(*) if 'INPUT' then file is readonly C if 'OUTPUT' then file is an output file. C FILTYP (I) CHARACTER*(*) if 'CIF' then the file type is treated as C CIF. If 'PDB' then the file type is C treated as PDB. If blank then file type is C automatically determined for input files C and for output file the file type will be C the same as the first file opened or C defaulted to PDB. C IUNIT (I/O) INTEGER If zero then unit is decided else C file opened on that unit C checked against previous data if C applicable. NOT used with output files. C IFAIL (I/O) INTEGER On input = 0 stop on failure C = 1 continue on failure C C On output unchanged if OK C = -1 if error C C ICRYST (I/O) INTEGER If zero, then check for and use CRYST C and SCALE cards in input PDB. C If one, ignore these cards even if C present. C C C_END_XYZOPEN2 C C implicit none C .. Parameters .. INTEGER MAXFILESOPEN,MAXSYM PARAMETER (MAXFILESOPEN=90,MAXSYM=96) INTEGER RWBERR_Ok,RWBERR_NoMatrices PARAMETER (RWBERR_Ok=0,RWBERR_NoMatrices=-16) C .. C .. Arguments .. INTEGER IFAIL,IUNIT,ICRYST,II,III,JJ,K,ISYM REAL AM,BM,RCHK1,RCHK2,FAC CHARACTER*(*) FILTYP,LOGNAM,RWSTAT C .. C .. Variables in Common .. REAL CELL,CELLAS,RF,RO,RR,VOL,ROU,RFU INTEGER FILESOPEN,ITYP,NCODE,TYPE,UNIT CHARACTER*80 LOGUNIT,BRKSPGRP*15 LOGICAL IFCRYS,IFHDOUT,IFNEWCRYS,IFSCAL,MATRIX c Check symmetry stuff C integer nsymchk,lspgrp,nsymppdbs,nsympdbs,ist real rsymchk(4,4,maxsym), rsympdbs(4,4,maxsym) character NAMSPG_CIFS*20,nampg*10 C .. C .. Local Scalars .. REAL ERROR,VOLCHK INTEGER IRET INTEGER I,IORTH,IFILTYP,J,LL,ILEN,KLEN CHARACTER ERRLIN*600,FILNAM*255 CHARACTER LFILTYP*3,LRWSTAT*5, SPGCHK*30 CHARACTER*40 ORTH(6) C .. C .. Local Arrays .. REAL P(4,4) CHARACTER IEC(3)*2 C .. C .. External Functions .. INTEGER LENSTR,CCPNUN LOGICAL CCPEXS EXTERNAL CCPEXS,LENSTR,CCPNUN C .. C .. External Routines .. EXTERNAL CCPDPN,CCPERR,CCPUPC,RBFROR,RBRINV,UGTENV, * MMDB_F_OPENL,MMDB_F_RBSPGRP,RBERRSTOP, * MMDB_F_RBCELL,MMDB_F_WBSPGRP,MMDB_F_RBORF C .. C .. Intrinsic Functions .. INTRINSIC ABS C .. C .. Common Blocks .. COMMON /RBRKAA/ FILESOPEN,LOGUNIT(MAXFILESOPEN), + UNIT(MAXFILESOPEN),TYPE(MAXFILESOPEN) COMMON /RBRKXX/IFCRYS,IFSCAL,ITYP,MATRIX,IFHDOUT,IFNEWCRYS COMMON /RBRKZZ/CELL(6),RR(3,3,6),VOL,CELLAS(6) COMMON /ORTHOG/RO(4,4),RF(4,4),NCODE COMMON /ORTHOGU/ ROU(4,4),RFU(4,4) COMMON /RBRKSPGRP/BRKSPGRP C .. C .. Save .. SAVE /RBRKAA/,/RBRKXX/,/RBRKZZ/,/ORTHOG/ C .. C .. Data Statement .. DATA IEC /'E1','E2','E3'/ DATA ORTH/'A // XO, C* // ZO (STANDARD PDB)', * 'B // XO, A* // ZO', * 'C // XO, B* // ZO', * 'HEX A+B // XO, C* // ZO', * 'A* // XO, C // ZO (ROLLETT)', * 'A // XO, B* // YO'/ C .. I = 0 II = 0 IFILTYP = 1 LL = 0 LRWSTAT = RWSTAT LFILTYP = FILTYP CALL CCPUPC(LFILTYP) CALL CCPUPC(LRWSTAT) C C---- If too many files opened C IF (FILESOPEN .EQ. MAXFILESOPEN) THEN CALL CCPERR(1,' *** ERROR: too many coordinate files open. ***') ENDIF C... C... MMDB open channel (need to test for failures) FILNAM = ' ' CALL UGTENV(LOGNAM,FILNAM) IF (LRWSTAT(1:5) .EQ. 'INPUT' .AND. FILNAM.EQ.' ') THEN CALL MMDB_F_OPEN(LOGNAM,LRWSTAT,LFILTYP,IUNIT,IRET) ELSEIF (LRWSTAT(1:5) .EQ. 'INPUT') THEN CALL MMDB_F_OPENL(LOGNAM,LRWSTAT,LFILTYP,IUNIT,IRET) ELSE IF (LFILTYP(1:1).EQ.' ' .AND. FILESOPEN.GE.1) THEN IF (ABS(TYPE(1)).EQ.1) THEN IFILTYP = 1 LFILTYP = 'PDB' ELSEIF (ABS(TYPE(1)).EQ.2) THEN IFILTYP = 2 LFILTYP = 'CIF' ENDIF ENDIF CALL MMDB_F_OPENL(LOGNAM,LRWSTAT,LFILTYP,IUNIT,IRET) ENDIF IF (IRET.NE.RWBERR_Ok) THEN IF (IRET.NE.RWBERR_NoMatrices) THEN C... MMDB error information CALL RBERRSTOP(1,IRET,IUNIT,1) ERRLIN = ' XYZOPEN: Error opening logical name '//LOGNAM IF (IFAIL .EQ. 0) THEN CALL CCPERR(1,ERRLIN(1:LENSTR(ERRLIN))) ELSE CALL CCPERR(2,ERRLIN(1:LENSTR(ERRLIN))) IFAIL = -1 RETURN ENDIF ENDIF ENDIF C C==== If the file is an INPUT file C IF (LRWSTAT(1:5) .EQ. 'INPUT') THEN C C---- Determine whether CIF or PDB C IF (LFILTYP(1:1) .EQ. ' ') THEN FILESOPEN = FILESOPEN + 1 LOGUNIT(FILESOPEN) = LOGNAM UNIT(FILESOPEN) = IUNIT TYPE(FILESOPEN) = 1 ENDIF C C---- If known as CIF C IF (LFILTYP(1:3).EQ.'CIF' .OR. IFILTYP.EQ.2) THEN FILESOPEN = FILESOPEN + 1 LOGUNIT(FILESOPEN) = LOGNAM UNIT(FILESOPEN) = IUNIT TYPE(FILESOPEN) = 2 ENDIF C C---- If known as a PDB file C IF (LFILTYP(1:3).EQ.'PDB') THEN FILESOPEN = FILESOPEN + 1 LOGUNIT(FILESOPEN) = LOGNAM UNIT(FILESOPEN) = IUNIT TYPE(FILESOPEN) = 1 ENDIF C C---- Cell card found - calculate standard orthogonalising matrix C Check if you already have a cell which is inconsistent with C this one C IF (ICRYST.EQ.0) THEN ITYP=1 BRKSPGRP = ' ' C... MMDB get spacegroup and cell (cache) CALL MMDB_F_RBSPGRP(IUNIT,SPGCHK,IRET) ILEN = LENSTR(SPGCHK) IF (ILEN.LE.1) THEN CALL CCPERR(2,' No Space group given on PDB CRYST1 line') ELSE BRKSPGRP = SPGCHK ENDIF C... C... MMDB get CELL and VOL for cache CALL MMDB_F_RBCELL(IUNIT,CELL,VOL,IRET) IF (IRET.EQ.0) THEN IFCRYS=.TRUE. ELSE IFCRYS=.FALSE. ENDIF C... MMDB get the orthogonalisation and fractional matrices RO(1,1) = 0.0 CALL MMDB_F_RBORF(IUNIT,RO,RF,NCODE,IRET) IF (NCODE.LT.0) THEN ERRLIN = + 'XYZOPEN2: Orthogonalisation code not determined. '// + 'Possible disagreement between CRYST1 and SCALEx cards.' CALL CCPERR(2,ERRLIN(1:LENSTR(ERRLIN))) ENDIF C IFSCAL indicates SCALEx cards found, MATRIX indicates RO,RF in /ORTHOG/ set up IF (IRET.EQ.0) THEN IFSCAL=.TRUE. MATRIX=.TRUE. ELSE IFSCAL=.FALSE. MATRIX=.FALSE. ENDIF C C If BRKSPGRP contains "/" it is probably a Patterson group and may C occupy the full 15 characters. Else it may be from the PDB and C may contain Z value which must be removed. IF (INDEX(BRKSPGRP,'/').EQ.0) BRKSPGRP(12:15) = ' ' C Read symmetry operators. IF (BRKSPGRP.NE.' ') THEN C Consistency check for R and H space groups. C (using angles only) C---- H name associated with a=b; Gamma = 120 IF( BRKSPGRP(1:1) .EQ. 'R' ) THEN IF(abs(cell(4)-90.0).LT.0.001 .AND. + abs(cell(5)-90.0).LT.0.001 .AND. + abs(cell(6)-120.0).LT.0.001) THEN BRKSPGRP(1:1)='H' CALL CCPERR(2, + ' Changing "rhombohedral" to "hexagonal"') CALL MMDB_F_WBSPGRP(IUNIT,BRKSPGRP,IRET) END IF C---- R name associated with a=b=c; Alpha=Beta=Gamma ELSE IF( BRKSPGRP(1:1) .EQ. 'H' ) THEN IF(abs(cell(4)-cell(5)).LT.0.001.AND. + abs(cell(5)-cell(6)).LT.0.001.AND. + abs(cell(6)-cell(4)).LT.0.001) THEN BRKSPGRP(1:1)='R' CALL CCPERR(2, + ' Changing "hexagonal" to "rhombohedral"') CALL MMDB_F_WBSPGRP(IUNIT,BRKSPGRP,IRET) END IF END IF C END IF C... set up standard orth matrices (cache) IF (IFCRYS) CALL RBFROR ENDIF C C==== If the file is an OUTPUT file C ELSE IF (LFILTYP(1:3) .EQ. 'CIF') IFILTYP = 2 IF (LFILTYP(1:3) .EQ. 'PDB') IFILTYP = 1 C C---- Open output PDB file C IF (IFILTYP .EQ. 1) THEN FILESOPEN = FILESOPEN + 1 LOGUNIT(FILESOPEN) = LOGNAM UNIT(FILESOPEN) = IUNIT TYPE(FILESOPEN) = -1 ENDIF IF (IFILTYP .EQ. 2) THEN FILESOPEN = FILESOPEN + 1 LOGUNIT(FILESOPEN) = LOGNAM UNIT(FILESOPEN) = IUNIT TYPE(FILESOPEN) = -2 ENDIF ENDIF C Generate ROU and RFU for AnisoU stuff IF (MATRIX) THEN RFU(4,4) = 1.0 DO I = 1,3 FAC= SQRT(RF(I,1)*RF(I,1) + RF(I,2)*RF(I,2) + + RF(I,3)*RF(I,3)) RFU(I,1) = RF(I,1)/FAC RFU(I,2) = RF(I,2)/FAC RFU(I,3) = RF(I,3)/FAC RFU(I,4) = 0.0 RFU(4,I) = 0.0 END DO CALL RBRINV(RFU,ROU) END IF C If reading in: check SCAL and CRYST1 cards IF (IFILTYP.EQ.1 .AND. LRWSTAT(1:5).EQ.'INPUT' .AND. ICRYST.EQ.0) + THEN IF (.NOT.IFCRYS) THEN WRITE(ERRLIN,FMT='(A,A)') ' NO CRYST CARDS READ FROM ',LOGNAM CALL CCPERR (2,ERRLIN(1:LENSTR(ERRLIN))) END IF IF (.NOT.IFSCAL) THEN WRITE(ERRLIN,FMT='(A,A)') ' NO SCALE CARDS READ FROM ',LOGNAM CALL CCPERR (2,ERRLIN(1:LENSTR(ERRLIN))) END IF END IF RETURN END C C C SUBROUTINE XYZCLOSE(IUNIT) C ========================== C C_BEGIN_XYZCLOSE C C This subroutine closes a coordinate file. C C Parameters: C C IUNIT (I) INTEGER Unit number for file C C_END_XYZCLOSE C C .. Parameters .. INTEGER MAXFILESOPEN PARAMETER (MAXFILESOPEN=90) C .. C .. Arguments .. INTEGER IUNIT C .. C .. Variables in Common .. INTEGER FILESOPEN, UNIT, TYPE CHARACTER*80 LOGUNIT C .. C .. Local Scalars .. INTEGER I,II,IRET C .. EXTERNAL MMDB_F_CLOSE C .. C .. Common Blocks .. COMMON /RBRKAA/ FILESOPEN,LOGUNIT(MAXFILESOPEN), + UNIT(MAXFILESOPEN),TYPE(MAXFILESOPEN) C .. C .. Save .. SAVE /RBRKAA/ C .. C II = 0 DO 10 I=1,FILESOPEN IF (UNIT(I) .EQ. IUNIT) THEN II = I GOTO 20 ENDIF 10 CONTINUE 20 IF (II .NE. 0) THEN IF (FILESOPEN.NE.1 .AND. II.NE.FILESOPEN) THEN LOGUNIT(II) = LOGUNIT(FILESOPEN) UNIT(II) = UNIT(FILESOPEN) TYPE(II) = TYPE(FILESOPEN) ENDIF FILESOPEN = FILESOPEN - 1 ENDIF C... MMDB, close the channel (some info in cache) CALL MMDB_F_CLOSE(IUNIT,IRET) RETURN END C C C SUBROUTINE XYZADVANCE(IUNIT,IOUT,ITER,*,*) C ========================================== C C_BEGIN_XYZADVANCE C C When IUNIT represents an input coordinate file, this subroutine reads C recognised data lines into a buffer BROOK, from which XYZATOM and C XYZCOORD can extract useful information. Optionally, if the card is C unrecognised (eg REMARK) then the line can be echoed to an output file. C C When IUNIT represents an output coordinate file, this subroutine writes C out the contents of the buffer WBROOK or WBROOK1. This buffer is filled C from an input file, or by calls to XYZATOM and XYZCOORD. C C Parameters: C C IUNIT (I) Channel number of the coordinate file C C These arguments are not relevant for output files. C IOUT (I) Logical unit number to which non-atom/hetatm/anisou records C are to be written (may be blank if reading only) C ITER (I) FLAG =1, return if 'ter' card found (via return 1) C =0, do not return when 'ter' card found C RETURN 1 Return on TER card if ITER=1 C RETURN 2 Return on end of file. C C_END_XYZADVANCE C C .. Paramters .. INTEGER MAXFILESOPEN PARAMETER (MAXFILESOPEN=90) INTEGER RWBERR_Ok PARAMETER (RWBERR_Ok=0) C .. C .. Arguments .. INTEGER IOUT,ITER,IUNIT C .. C .. Variables in Common .. REAL CELL,CELLAS,RF,RO,RR,VOL INTEGER FILESOPEN,NCODE,TYPE,UNIT CHARACTER LOGUNIT*80,BRKSPGRP*15 LOGICAL IFCRYS,IFHDOUT,IFNEWCRYS,IFSCAL,MATRIX C .. C .. Local Variables .. INTEGER I,II,IRET,IRE,ITE CHARACTER*80 ERRLIN CHARACTER*6 ITYPE(7) C .. C .. External Routines .. EXTERNAL CCPERR,MMDB_F_COPY,MMDB_F_ADVANCE C .. C .. Common Blocks .. COMMON /RBRKAA/ FILESOPEN,LOGUNIT(MAXFILESOPEN), + UNIT(MAXFILESOPEN),TYPE(MAXFILESOPEN) COMMON /RBRKXX/ IFCRYS,IFSCAL,ITYP,MATRIX,IFHDOUT,IFNEWCRYS COMMON /RBRKZZ/ CELL(6),RR(3,3,6),VOL,CELLAS(6) COMMON /ORTHOG/ RO(4,4),RF(4,4),NCODE COMMON /ORTHOGU/ ROU(4,4),RFU(4,4) COMMON /RBRKSPGRP/BRKSPGRP C .. C .. Save Statement .. SAVE /RBRKAA/,/RBRKXX/,/RBRKZZ/,/ORTHOG/ II = 0 DO 10 I=1,FILESOPEN IF (IUNIT .EQ. UNIT(I)) THEN II = I GOTO 15 ENDIF 10 CONTINUE ERRLIN = ' ERROR: in XYZADVANCE file has not been opened' CALL CCPERR(1,ERRLIN) C C... opened read 15 IF (TYPE(II).GT.0) THEN C... copying across IF (IOUT.NE.0) THEN IF(.NOT.IFHDOUT)THEN IF(IFCRYS .AND. .NOT.IFNEWCRYS) THEN C.. MMDB, copy header information CALL MMDB_F_COPY(IOUT,IUNIT,2,IRE) IFHDOUT=.TRUE. ELSE C... MMDB, copy header less CRYST1 cards CALL MMDB_F_COPY(IOUT,IUNIT,3,IRE) ENDIF ENDIF C... MMDB, advance pointer allowing for TER cards CALL MMDB_F_ADVANCE(IUNIT,IOUT,ITER,IRET) ELSE C... MMDB, standard advance pointer CALL MMDB_F_ADVANCE(IUNIT,IOUT,ITER,IRET) ENDIF ELSE IF(.NOT.IFHDOUT .AND. IFCRYS) THEN CALL MMDB_F_WBSPGRP(IOUT,BRKSPGRP,IRE) CALL MMDB_F_WBCELL(IOUT,CELL,NCODE,IRE) IFHDOUT=.TRUE. ENDIF CALL MMDB_F_ADVANCE(IUNIT,IOUT,ITER,IRET) ENDIF IF (IRET.EQ.1) RETURN 1 IF (IRET.EQ.2) RETURN 2 C END C C C SUBROUTINE XYZATOM(IUNIT,ISER,ATNAM,RESNAM,CHNNAM,IRESN, *RESNO,INSCOD,ALTCOD,SEGID,IZ,ID) C ======================================================== C C_BEGIN_XYZATOM C C This subroutine reads or writes the atom name, residue name, C chain name etc. into the buffer. XYZADVANCE actually advances a line C or atom. The character strings have undefined length in order to make C change easier. However, these data items will be strictly defined in C the working format. C C Parameters: C C IUNIT (I) Logical unit of the input coordinate file C ISER (I/O) Atom serial number C ATNAM (I/O) Atom name (left justified) C RESNAM (I/O) Residue name C CHNNAM (I/O) Chain name C IRESN (I/O) Residue number as an integer C RESNO (O) Residue number as character, NOT used for output file C INSCOD (I/O) The insertion code C ALTCOD (I/O) The alternate conformation code. C SEGID (I/O) Segid is here to complete PDB standard. C IZ (O) Atomic number (returned as 7 from ambiguous atoms), C NOT used for output file C ID (I/O) Atomic ID related to atomic number (element symbol C right justified), plus the ionic state +2, +3 etc.. C C_END_XYZATOM C C .. Paramters .. INTEGER MAXFILESOPEN PARAMETER (MAXFILESOPEN=90) INTEGER RWBERR_Ok,RWBWAR_MASK PARAMETER (RWBERR_Ok=0,RWBWAR_MASK=16384) INTEGER RWBWAR_WrongSerial PARAMETER (RWBWAR_WrongSerial=16448) C .. C .. Arguments .. INTEGER IRESN,ISER,IUNIT,IZ CHARACTER*(*) RESNO,ATNAM,RESNAM,CHNNAM CHARACTER*(*) ID,INSCOD,ALTCOD,SEGID CHARACTER*6 ITYPE(7) C .. C .. Variables in Common .. INTEGER FILESOPEN,ITYP,UNIT,TYPE CHARACTER LOGUNIT*80 LOGICAL IFCRYS,IFHDOUT,IFNEWCRYS,IFSCAL,MATRIX C .. C .. Local Scalars .. REAL U(6),OCC,X,Y,Z INTEGER I,II,IRET CHARACTER*100 ERRLIN C .. C .. External Routines/Functions .. EXTERNAL CCPERR,MMDB_F_ATOM,RBERRSTOP C .. C .. Common Blocks .. COMMON /RBRKAA/ FILESOPEN,LOGUNIT(MAXFILESOPEN), + UNIT(MAXFILESOPEN),TYPE(MAXFILESOPEN) COMMON /RBRKXX/ IFCRYS,IFSCAL,ITYP,MATRIX,IFHDOUT,IFNEWCRYS C C .. Save .. SAVE /RBRKAA/,/RBRKXX/ C .. c II = 0 DO 10 I=1,FILESOPEN IF (IUNIT .EQ. UNIT(I)) THEN II = I GOTO 20 ENDIF 10 CONTINUE ERRLIN = ' ERROR: in XYZATOM file has not been opened' CALL CCPERR(1,ERRLIN) C 20 CALL MMDB_F_ATOM(IUNIT,ISER,ATNAM,RESNAM,CHNNAM,IRESN, + RESNO,INSCOD,ALTCOD,SEGID,IZ,ID,IRET) IF (IRET.NE.RWBERR_Ok.AND.IRET.NE.RWBWAR_WrongSerial) + THEN C... MMDB error information CALL RBERRSTOP(1,IRET,IUNIT,0) IF (IAND(IRET,RWBWAR_MASK).EQ.0) THEN ERRLIN = ' ERROR: XYZATOM' CALL CCPERR(1,ERRLIN) ENDIF ENDIF RETURN END C C C SUBROUTINE XYZCOORD(IUNIT,XFLAG,BFLAG,X,Y,Z,OCC,BISO,U) C ======================================================= C C_BEGIN_XYZCOORD C C This subroutine reads or writes x, y, z, occupancy and b from/to C the internal buffer. The buffer is updated from the file by C XYZADVANCE. The coordinates can be input/output (to the subroutine) C as orthogonal or fractional. C C PDB files contain anisotropic temperature factors as orthogonal Us. C The anisotropic temperature factors can be input/output to this routine C as orthogonal or as crystallographic Us. C C Shelx defines Uf to calculate temperature factor as: C T(aniso_Uf) = exp (-2PI**2 ( (h*ast)**2 Uf_11 + (k*bst)**2 Uf_22 + ... C + 2hk*ast*bst*Uf_12 +..) C C Note: Uo_ji == Uo_ij and Uf_ji == Uf_ij. C C [Uo_ij] listed on ANISOU card satisfy the relationship: C [Uo_ij] = [RFu]-1 [Uf_ij] {[RFu]-1}T C C where [Rfu] is the normalised [Rf] matrix read from the SCALEi cards. C see code. [ROu] == [RFu]-1 C C T(aniso_Uo) = U(11)*H**2 + U(22)*K**2 + 2*U(12)*H*K + ... C where H,K,L are orthogonal reciprocal lattice indecies. ( EJD: I think????) C C Biso = 8*PI**2 (Uo_11 + Uo_22 + Uo_33) / 3.0 C C [Uf(symm_j)] = [Symm_j] [Uf] [Symm_j]T C C Parameters: C C IUNIT (I) Channel number of the input coordinate file C XFLAG (I) For input file C ='F' will get fractional coords. C ='O' will get orthogonal coords. C For output file C ='F' passed coordinates are fractional C ='O' passed coordinates are orthogonal C BFLAG (I) For input file C ='F' will get fractional us C ='O' will get orthogonal Us. C For output file C ='F' have fractional us C ='O' have othogonal Us C X (I/O) Coordinates (orthogonal angstrom coordinates as C Y (I/O) " stored) C Z (I/O) " C OCC (I/O) Occupancy C BISO (O) Isotropic temperature factor, NOT used for output file. C U(6) (I/O) Orthogonal Anisotropic temperature factor, unless only U(1) defined. C C_END_XYZCOORD C C .. Paramters .. INTEGER MAXFILESOPEN PARAMETER (MAXFILESOPEN=90) INTEGER RWBERR_Ok,RWBWAR_MASK PARAMETER (RWBERR_Ok=0,RWBWAR_MASK=16384) C .. C .. Arguments .. REAL U(6),BISO,X,Y,Z INTEGER IUNIT CHARACTER*1 BFLAG,XFLAG C .. C .. Variables in Common .. INTEGER FILESOPEN,ITYP,UNIT,TYPE CHARACTER LOGUNIT*80 LOGICAL IFCRYS,IFHDOUT,IFNEWCRYS,IFSCAL,MATRIX C .. C .. Local Scalars .. REAL EIGHTPI2,XX,YY,ZZ INTEGER I,II,IRET INTEGER IRESN,ISER,IZ CHARACTER*100 ERRLIN CHARACTER ATNAM*4,RESNAM*4,RESNO*4,ID*4,CHNNAM*1,SEGID*4 C .. C .. External Routines/Functions .. EXTERNAL CCPERR,MMDB_F_COORD,RBERRSTOP C .. C .. Intrinsic Functions .. INTRINSIC ABS,NINT C .. C .. Common Blocks .. COMMON /RBRKAA/ FILESOPEN,LOGUNIT(MAXFILESOPEN), + UNIT(MAXFILESOPEN),TYPE(MAXFILESOPEN) COMMON /RBRKXX/ IFCRYS,IFSCAL,ITYP,MATRIX,IFHDOUT,IFNEWCRYS C .. C .. Save .. SAVE /RBRKAA/,/RBRKXX/ C .. C .. Data Statement .. DATA EIGHTPI2 /78.956835/ II = 0 DO 10 I=1,FILESOPEN IF (IUNIT .EQ. UNIT(I)) THEN II = I GOTO 20 ENDIF 10 CONTINUE ERRLIN = ' ERROR: in XYZCOORD has not been opened' CALL CCPERR(1,ERRLIN) 20 CALL MMDB_F_COORD(IUNIT,XFLAG,BFLAG,X,Y,Z,OCC,BISO,U,IRET) IF (IRET.NE.RWBERR_Ok) THEN C... MMDB error information CALL RBERRSTOP(1,IRET,IUNIT,0) IF (IOR(IRET,RWBWAR_MASK).EQ.0) THEN ERRLIN = ' ERROR: XYZATOM' CALL CCPERR(1,ERRLIN) ENDIF ENDIF RETURN END C C C SUBROUTINE XYZREWD(IUNIT) C ========================= C C_BEGIN_XYZREWD C C This routine is resets pointer to the begining of the file ie. C rewind the file. C C Parameters: C C IUNIT (I) INTEGER Channel number for file. C C_END_XYZREWD C C .. Parameters .. INTEGER MAXFILESOPEN PARAMETER (MAXFILESOPEN=90) INTEGER RWBWAR_RewOutput PARAMETER (RWBWAR_RewOutput=34) C .. C .. Arguments .. INTEGER IUNIT C .. C .. Variables in Common .. INTEGER FILESOPEN,TYPE,UNIT CHARACTER*80 LOGUNIT C .. C .. Local Scalars .. INTEGER I,II CHARACTER*100 ERRLIN C .. C .. External Functions/Routines .. EXTERNAL CCPERR,MMDB_F_REWD C .. C .. Intrinsic Functions .. INTRINSIC ABS C .. C .. Common Blocks .. COMMON /RBRKAA/ FILESOPEN,LOGUNIT(MAXFILESOPEN), + UNIT(MAXFILESOPEN),TYPE(MAXFILESOPEN) C .. C .. Save .. SAVE /RBRKAA/ C .. II = 0 DO 10 I=1,FILESOPEN IF (IUNIT .EQ. UNIT(I)) THEN II = I GOTO 20 ENDIF 10 CONTINUE ERRLIN = ' ERROR: in XYZREWD file has not been opened' CALL CCPERR(1,ERRLIN) 20 CALL MMDB_F_REWD(IUNIT,IRET) IF (IRET.EQ. RWBWAR_RewOutput) THEN CALL CCPERR(2, + ' WARNING: you are rewinding an output file!!') ENDIF RETURN END C C C SUBROUTINE XYZBKSP(IUNIT) C ========================= C C_BEGIN_XYZBKSP C C This routine is the opposite to XYZADVANCE in that it retreats C one atom ie. backspacing. C C Parameters: C C IUNIT (I) INTEGER Channel number for file. C C_END_XYZBKSP C C .. Parameters .. INTEGER MAXFILESOPEN PARAMETER (MAXFILESOPEN=90) INTEGER RWBWAR_RewOutput PARAMETER (RWBWAR_RewOutput=34) C .. C .. Arguments .. INTEGER IUNIT C .. C .. Variables in Common .. INTEGER FILESOPEN,TYPE,UNIT CHARACTER*80 LOGUNIT C .. C .. Local Scalars .. INTEGER I,II,IRET CHARACTER*100 ERRLIN C .. C .. External Functions/Routines .. EXTERNAL CCPERR,MMDB_F_BKSP C .. C .. Intrinsic Functions .. INTRINSIC ABS C .. C .. Common Blocks .. COMMON /RBRKAA/ FILESOPEN,LOGUNIT(MAXFILESOPEN), + UNIT(MAXFILESOPEN),TYPE(MAXFILESOPEN) C .. C .. Save .. SAVE /RBRKAA/ C .. II = 0 DO 10 I=1,FILESOPEN IF (IUNIT .EQ. UNIT(I)) THEN II = I GOTO 20 ENDIF 10 CONTINUE ERRLIN = ' ERROR: in XYZBKSP file has not been opened' CALL CCPERR(1,ERRLIN) 20 CALL MMDB_F_BKSP(IUNIT,IRET) IF (IRET .EQ. RWBWAR_RewOutput) THEN CALL CCPERR(2, + ' WARNING: you are backspacing an output file!!') ENDIF RETURN END C C C SUBROUTINE RBROOK(IUNIT,ISER,ATNAM,RESNAM,CHNNAM,IRESN,RESNO,IS, *X,Y,Z,OCC,B,IZ,IOUT,MSG1,MSG2,ITER,*,*) C ================================================================ C C_BEGIN_RBROOK C C This subroutine is obsolete and should be removed. May be C PROBLEM in that routine returns orthogonal coordinates and not fractional C ones. C C_END_RBROOK C C .. Scalar Arguments .. REAL X,Y,Z,OCC,B INTEGER IUNIT,ISER,IRESN,IS,IOUT,IZ,MSG1,MSG2,ITER CHARACTER*(*) RESNO CHARACTER ATNAM*4,RESNAM*4,CHNNAM*1 C .. C .. Local Scalars .. CHARACTER*4 ID,SEGID CHARACTER*1 INSCOD,ALTCOD C .. C .. Local Arrays .. REAL U(6) C .. C .. External Routines .. EXTERNAL XYZADVANCE,XYZATOM,XYZCOORD C .. IS = 0 10 CALL XYZADVANCE(IUNIT,IOUT,ITER,*1000,*2000) CALL XYZCOORD(IUNIT,'O','U',X,Y,Z,OCC,B,U) C C---- Skip ANISOU card in PDB. Test on X, Y and Z are not strictly necessary C as routines can only read PDB currently. C IF (U(2).NE.0.0 .AND. U(3).NE.0.0) THEN IF (X.EQ.0.0 .AND. Y.EQ.0.0 .AND. Z.EQ.0.0) GOTO 10 ENDIF CALL XYZATOM(IUNIT,ISER,ATNAM,RESNAM,CHNNAM,IRESN,RESNO,INSCOD, + ALTCOD,SEGID,IZ,ID) RETURN 1000 RETURN 1 2000 RETURN 2 END C C C SUBROUTINE WBROOK(IUNIT,ISER,ATNAM,RESNAM,CHNNAM,IRESN,IS, *X,Y,Z,OCC,B,IZ) C ================================================================ C C_BEGIN_RBROOK C C This subroutine is obsolete and should be removed. May be C PROBLEM in that routine does not cater for IS. C C_END_RBROOK C C .. Scalar Arguments .. REAL X,Y,Z,OCC,B INTEGER IUNIT,ISER,IRESN,IS,IZ CHARACTER ATNAM*4,RESNAM*4,CHNNAM*1 C .. C .. Local Scalars .. CHARACTER*4 ID,SEGID,RESNO CHARACTER*1 INSCOD,ALTCOD C .. C .. Local Arrays .. REAL U(6) C .. C .. External Routines .. EXTERNAL XYZADVANCE,XYZATOM,XYZCOORD C .. SEGID = ' ' ID = ' ' INSCOD = ' ' ALTCOD = ' ' RESNO = ' ' DO 10 I=1,6 U(I) = 0.0 10 CONTINUE CALL XYZADVANCE(IUNIT,0,0,*1000,*1000) CALL XYZCOORD(IUNIT,'O','U',X,Y,Z,OCC,B,U) CALL XYZATOM(IUNIT,ISER,ATNAM,RESNAM,CHNNAM,IRESN,RESNO,INSCOD, + ALTCOD,SEGID,IZ,ID) C C---- This label is here for completeness but is not used (see XYZADVANCE). C 1000 CONTINUE RETURN END C C C C SUBROUTINE PDBREAD(ISER,ATNAM,RESNAM,CHNNAM,IRESN,RESNO, C *X,Y,Z,OCC,U,IZ,SEGID,ID) C ======================================================== C C_BEGIN_PDBREAD C C The subroutine PDBREAD is used to read coordinates from a PDB C format coordinate file. This routine should not be used stand alone C but through XYZADVANCE. C C Parameters C C ISER (O) Atom serial number C ATNAM (O) Atom name (character*4 left justified) C RESNAM (O) Residue name (character*4) C CHNNAM (O) Chain name (character*1) C IRESN (O) Residue number as an integer C RESNO (O) Residue number (character*4 or character*5) C If character*5 then the 5th character will be the C insertion code. C X (O) Coordinates (orthogonal angstrom coordinates as C Y (O) " stored) C Z (O) " C OCC (O) Occupancy C U(6) (O) Temperature factor C IZ (O) Atomic number (returned as 7 from ambiguous atoms) C ID (O) Atomic ID related to atomic number + ionic state. C (character*4) C C COMMON BLOCKS C C COMMON /RBRKXX/IFCRYS,IFSCAL,ITYP,MATRIX C C IFCRYS .TRUE. IF 'CRYST1' CARD READ, OTHERWISE .FALSE. C IFSCAL .TRUE. IF 'SCALE' CARDS READ, OTHERWISE .FALSE. C ITYP TYPE OF LAST CARD READ =1, 'CRYST1' C =2, 'SCALE' C =3, 'TER' C =4, 'ATOM' C =5, 'HETATM' C MATRIX .TRUE. IF FRACT/ORTHOG MATRICES CALCULATED C .FALSE. IF NOT C C C BROOK CHARACTER*1 ARRAY WHICH IS THE BUFFER FOR PDB FILES C C COMMON/RBRKZZ/CELL(6),RR(3,3,6),VOL,CELLAS(6) C C CELL CELL DIMENSIONS FROM 'CRYST1' CARD IF READ C (CHECK IFCRYS) C RR STANDARD ORTHOGONALISING MATRICES CALCULATED IF THE C 'CRYST1' CARD WAS READ (CHECK IFCRYS) C C COMMON /ORTHOG/RO(4,4),RF(4,4),NCODE C C RO ORTHOGONALISING MATRIX (ONLY SET IF 'CRYST1' OR 'SCALE' C CARDS PRESENT - CHECK 'MATRIX' FLAG) C RF FRACTIONALISING MATRIX (ONLY SET IF 'CRYST1' OR 'SCALE' C CARDS PRESENT - CHECK 'MATRIX' FLAG) C NCODE FLAG INDICATING SETTING FOUND, 0 IF NOT ONE THAT WAS C RECOGNISED C C_END_PDBREAD C C C .. Parameters .. C INTEGER MAXIATM, MAXIHATM C PARAMETER (MAXIATM=102,MAXIHATM=14) C .. C .. Arguments .. C REAL U(6),OCC,X,Y,Z C INTEGER IRESN,ISER,IZ C CHARACTER*(*) RESNO C CHARACTER ATNAM*4,CHNNAM*1,ID*4,RESNAM*4,SEGID*4 C .. C .. Variables in Common .. C REAL CELL,CELLAS,RF,RO,RR,VOL C INTEGER ITYP,NCODE C CHARACTER BROOK*1,WBROOK*1,WBROOK1*1 C LOGICAL IFCRYS,IFSCAL,IFTER,MATRIX,IFHDOUT,IFNEWCRYS C .. C .. Local Scalars .. C INTEGER I,II,J C CHARACTER*100 ERRLIN C CHARACTER*80 BROOKA C CHARACTER*4 IRTYPE C CHARACTER*2 IAA,IAT,IE C CHARACTER*1 ISP C .. C .. Local Arrays .. C INTEGER IU(6) C CHARACTER*40 ORTH(5) C CHARACTER*2 IATM(MAXIATM),IHATM(MAXIHATM) C .. C .. External Routines/Functions .. C INTEGER LENSTR C EXTERNAL CCPERR,CCPUPC,LENSTR C .. C .. Intrinsic Functions .. C INTRINSIC ABS C .. C .. Common Blocks .. C COMMON /RBRKXX/IFCRYS,IFSCAL,ITYP,MATRIX,IFHDOUT,IFNEWCRYS C COMMON/RBRKZZ/CELL(6),RR(3,3,6),VOL,CELLAS(6) C COMMON /ORTHOG/RO(4,4),RF(4,4),NCODE C COMMON /ORTHOGU/ ROU(4,4),RFU(4,4) C .. C .. Equivalences .. C EQUIVALENCE (IRTYPE,BROOK(1)),(IE,BROOK(5)),(BROOKA,BROOK(1)) C .. C .. Save .. C SAVE /RBRKXX/,/RBRKZZ/,/ORTHOG/ C .. C .. Data Statement .. C DATA IATM/' H','HE','LI','BE',' B',' C',' N',' O',' F','NE', C * 'NA','MG','AL','SI',' P',' S','CL','AR',' K','CA', C * 'SC','TI',' V','CR','MN','FE','CO','NI','CU','ZN', C * 'GA','GE','AS','SE','BR','KR','RB','SR',' Y','ZR', C * 'NB','MO','TC','RU','RH','PD','AG','CD','IN','SN', C * 'SB','TE',' I','XE','CS','BA','LA','CE','PR','ND', C * 'PM','SM','EU','GD','TB','DY','HO','ER','TM','YB', C * 'LU','HF','TA',' W','RE','OS','IR','PT','AU','HG', C * 'TL','PB','BI','PO','AT','RN','FR','RA','AC','TH', C * 'PA',' U','NP','PU','AM','CM','BK','CF','ES','FM', C * ' D','AN'/ C DATA IHATM/'0H','1H','2H','3H','4H','5H','6H','7H','8H','9H', C + 'HH','*H',"'H",'"H'/ C DATA IAA/' A'/,ISP/' '/ C DATA ORTH/'A // XO, C* // ZO (STANDARD PDB)', C * 'B // XO, A* // ZO', C * 'C // XO, B* // ZO', C * 'HEX A+B // XO, C* // ZO', C * 'A* // XO, C // ZO (ROLLETT)'/ C DATA ITYPE/'CRYS','SCAL','TER ','ATOM','HETA','ANIS','END'/ C C C IFTER=.FALSE. C C---- Atom/hetatm card processing C C IF (IRTYPE.EQ.'ATOM' .OR. IRTYPE.EQ.'HETA' .OR. C + IRTYPE.EQ.'ANIS' .OR. IRTYPE.EQ.'TER ') THEN C IF (IRTYPE.EQ.'TER ') THEN C C---- 'ter' card found C C ITYP=3 C IFTER=.TRUE. C GO TO 450 C ENDIF C IF(BROOK(13).EQ.ISP) then C C---- ATNAM (O) Atom name (character*4 left justified) C C ATNAM=BROOK(14)//BROOK(15)//BROOK(16)//' ' C C---- atnam should never had ALTCODE added to it C C else C ATNAM=BROOK(13)//BROOK(14)//BROOK(15)//BROOK(16) C end if C C C450 READ(BROOKA,1006)ISER,IRESN C RESNAM=BROOK(18)//BROOK(19)//BROOK(20)//ISP C RESNO=BROOK(23)//BROOK(24)//BROOK(25)//BROOK(26) C IF(LEN(RESNO).GT.4)RESNO(5:5)=BROOK(27) C CHNNAM=BROOK(22) C IF(IFTER)GO TO 500 C SEGID = BROOK(73)//BROOK(74)//BROOK(75)//BROOK(76) C C---- Find atomic number and ID, ID can be kept in columns 77-80 C C ID = BROOK(77)//BROOK(78)//BROOK(79)//BROOK(80) C CALL CCPUPC(ID) C IAT=BROOK(13)//BROOK(14) C CALL CCPUPC(IAT) C C---- Fast initial check for C, O, N or H C II = 0 C IF (ID(1:4) .NE. ' ') THEN C IF (ID(1:2) .EQ. IATM(6)) THEN C II = 6 C GOTO 480 C ENDIF C IF (ID(1:2) .EQ. IATM(7)) THEN C II = 7 C GOTO 480 C ENDIF C IF (ID(1:2) .EQ. IATM(8)) THEN C II = 8 C GOTO 480 C ENDIF C IF (ID(1:2) .EQ. IATM(1)) THEN C II = 1 C GOTO 480 C ENDIF C C---- Must be a different element - check against all C possibilities, which is slower C DO 452 I=1,MAXIATM C IF (ID(1:2) .EQ. IATM(I)) THEN C II = I C GOTO 480 C ENDIF C452 CONTINUE C END IF C C If no ID match then make sure it is reset to be empty C C ID = ' ' C C Check against first characters of atom name: C C---- Initial fast check against C, O, N or H C IF (IAT.EQ.IATM(6)) THEN C II = 6 C GO TO 480 C ENDIF C IF (IAT.EQ.IATM(7)) THEN C II = 7 C GO TO 480 C ENDIF C IF (IAT.EQ.IATM(8)) THEN C II = 8 C GO TO 480 C ENDIF C IF (IAT.EQ.IATM(1)) THEN C II = 1 C GO TO 480 C ENDIF C C---- Could be a hydrogen? Check for things like 0H, HH, etc C II=1 C DO 454 J=1,MAXIHATM C IF (IAT.EQ.IHATM(J)) GO TO 480 C454 CONTINUE C C---- Must be a different element - check everything else C DO 456 I=1,MAXIATM C IF (IAT.EQ.IATM(I)) THEN C II = I C Should issue a warning if AC or AN to the effect that this C is based on ambigious input and should be checked C IF (II.EQ.89 .OR. II.EQ.102) THEN C WRITE(ERRLIN,2002)ATNAM,RESNAM,RESNO(1:4),IATM(II) C CALL CCPERR(2,ERRLIN) C END IF C GO TO 480 C ENDIF C456 CONTINUE C C---- No match for ID to anything using the first 2 characters C of the atom name C C If the atom name begins with " A" set the atom_type to N C " A" is an ambigious atom name so presumably using N is C just a default? C Otherwise it's completely unknown C C II=0 C IF(IAT.EQ.IAA) II=7 C C Ambigious name... C IF (II .EQ. 7) THEN C WRITE(ERRLIN,2002)ATNAM,RESNAM,RESNO(1:4),IATM(II) C CALL CCPERR(2,ERRLIN) C ELSE C C---- II is zero so try some other tricks to get a match C C Desperate measure: try to match second character only - C This will deal with the NO7* horrors.. C IF (IAT(1:1).NE.' ') THEN C IAT = ' '//BROOK(14) C DO I=1,MAXIATM C IF (IAT.EQ.IATM(I)) THEN C II = I C Issue a warning about this match since it C is based on incomplete data and assumptions C WRITE(ERRLIN,2002)ATNAM,RESNAM,RESNO(1:4),IATM(II) C CALL CCPERR(2,ERRLIN) C GO TO 480 C ENDIF C END DO C ENDIF C END IF C C Still completely unrecognised... give up C C IF (II .EQ. 0) THEN C WRITE(ERRLIN,2001)ATNAM,RESNAM,RESNO(1:4) C CALL CCPERR(2,ERRLIN) C END IF C C---- Atom number decided C480 IZ=II C C IF (IZ .EQ. 0) THEN C ID = ' ' C ELSE C C---- Keep the ionic state if valid, OR from atom name. C C IF (ID(1:1) .EQ. ' ') THEN C IF (ATNAM(3:3).EQ.'+' .OR. ATNAM(3:3).EQ.'-') C + ID(3:4) = ATNAM(3:4) C ELSE C IF (ID(3:3).NE.'+' .AND. ID(3:3).NE.'-') ID(3:4) = ' ' C ENDIF C ID(1:2) = IATM(IZ) C ENDIF C C---- Put elment ID into output buffer. C C DO 485 J=1,4 C WBROOK(76+J) = ID(J:J) C WBROOK1(76+J) = ID(J:J) C485 CONTINUE C IF (IRTYPE .EQ. 'ATOM'.or.IRTYPE.EQ.'HETA') THEN C This is the ONLY flag that you have read a ATOM or HETATOM card.. C DO 40 I=1,6 C U(I) = 0.0 C 40 CONTINUE C IF (IRTYPE.EQ.'ATOM') ITYP=4 C IF (IRTYPE.EQ.'HETA') ITYP=5 C READ(BROOKA,1005)X,Y,Z,OCC,U(1) C C---- AnisoU cards C C ELSE IF (IRTYPE .EQ. 'ANIS') THEN C C READ(BROOKA,1010)IU(1),IU(2),IU(3),IU(4),IU(5),IU(6) C DO 510 I=1,6 C U(I) = IU(I)/1.0E+04 C510 CONTINUE C Get rid of this, sometimes useful to know xyz C use values of U(i) to check for ANISOU C X = 0.0 C Y = 0.0 C Z = 0.0 C ENDIF C C RETURN C ENDIF C500 RETURN C C---- Format statements C C1005 FORMAT(30X,3F8.3,2F6.2) C1006 FORMAT(6X,I5,11X,I4) C1010 FORMAT(28X,6I7) C2001 FORMAT(' *UNKNOWN ATOMIC FORMFACTOR ',A4,' IN ',A4,1X,A4,'*') C2002 FORMAT(' *AMBIGUOUS ATOMIC FORMFACTOR ',A4,' IN ',A4,1X,A4, C + ' ASSIGNED AS ',A2,' *') C END C C C SUBROUTINE RBFRAC2(A,B,C,AL,BE,GA,ARGNCODE) C =========================================== C C_BEGIN_RBFRAC2 C C C This subroutine is used to calculate the default transformation C matrices between orthogonal angstrom and fractional coordinates C The sensible name is for Phil, as RBFRAC2 was changed from the original. C C C PARAMETERS C C A,B,C,AL,BE,GA (I) (REAL) CELL PARAMETERS IN ANGSTROMS AND DEGREES C ARGNCODE (I) (INTEGER) ORTHOGONALISATION CODE 1-6 C C_END_RBFRAC2 C C .. Arguments .. REAL A,B,C,AL,BE,GA INTEGER ARGNCODE C .. C .. Variables in Common .. REAL CELL,CELLAS,RF,RO,RR,VOL INTEGER ITYP,NCODE LOGICAL IFCRYS,IFSCAL,MATRIX,IFHDOUT,IFNEWCRYS C .. C .. External Routines .. EXTERNAL CCPERR,RBRINV C .. C .. Common Blocks .. COMMON /RBRKXX/IFCRYS,IFSCAL,ITYP,MATRIX,IFHDOUT,IFNEWCRYS COMMON /ORTHOG/RO(4,4),RF(4,4),NCODE COMMON /RBRKZZ/CELL(6),RR(3,3,6),VOL,CELLAS(6) C .. C .. Save Statement .. SAVE /RBRKXX/,/ORTHOG/,/RBRKZZ/ C .. IF (ARGNCODE.NE.0) NCODE = ARGNCODE C C---- Calculate matrices C DO 10 I=1,4 DO 10 J=1,4 RO(I,J)=0 RF(I,J)=0 10 CONTINUE C C RO(4,4)=1.0 RF(4,4)=1.0 CELL(1)=A CELL(2)=B CELL(3)=C CELL(4)=AL CELL(5)=BE CELL(6)=GA CALL RBFROR C C DO 20 I=1,3 DO 20 J=1,3 RO(I,J)=RR(I,J,1) 20 CONTINUE C C CALL RBRINV(RO,RF) MATRIX=.TRUE. CALL CCPERR(4,' ') CALL CCPERR(4, + ' STANDARD PDB COORDINATE SETTING WILL BE ASSUMED') CALL CCPERR(4, + ' IF NO SCALE CARDS PRESENT IN INPUT COORDINATE FILE') CALL CCPERR(4,' ') RETURN END C C C SUBROUTINE RBFRAC(A,B,C,AL,BE,GA,MSG) C ===================================== C C_BEGIN_RBFRAC C C This routine is obsolete and should be removed. C C_END_RBFRAC C C .. Scalar Arguments .. REAL A,B,C,AL,BE,GA INTEGER MSG C .. C .. External Routines .. EXTERNAL RBFRAC2 C .. CALL RBFRAC2(A,B,C,AL,BE,GA,1) RETURN END C C C SUBROUTINE RBRORF(ROO,RFF) C ========================== C C_BEGIN_RBRORF C C This routine is obsolete and should be removed. C C SUBROUTINE RBRORF(ROO,RFF) C C Subroutine to fill or return RF (fractionalising) and Ro C (orthogonalising) matrices. C C PARAMETERS C C ROO (I) (REAL(4,4)) 4*4 MATRIX TO BE INVERTED C RFF (O) (REAL(4,4)) INVERSE MATRIX C C common blocks C C C DIMENSION ROO(4,4),RFF(4,4) C LCODE = 0 CALL RBRORF2(ROO,RFF,LCODE) END C C C SUBROUTINE RBRORF2(ROO,RFF,LCODE) C ========================== C C_BEGIN_RBRORF C C SUBROUTINE RBRORF2(ROO,RFF,LCODE) C C Subroutine to fill or return RF (fractionalising) and Ro C (orthogonalising) matrices. C C PARAMETERS C C ROO (I) (REAL(4,4)) 4*4 MATRIX TO BE INVERTED C RFF (O) (REAL(4,4)) INVERSE MATRIX C C common blocks C C COMMON /RBRKXX/IFCRYS,IFSCAL,ITYP,MATRIX C COMMON /ORTHOG/RO(4,4),RF(4,4),NCODE C C_END_RBRORF LOGICAL IFCRYS,IFSCAL,MATRIX,IFHDOUT,IFNEWCRYS COMMON /RBRKXX/IFCRYS,IFSCAL,ITYP,MATRIX,IFHDOUT,IFNEWCRYS COMMON /ORTHOG/RO(4,4),RF(4,4),NCODE SAVE /ORTHOG/, /RBRKXX/ C C DIMENSION ROO(4,4),RFF(4,4) C C---- Get cofactors of 'a' in array 'c' C IF(ROO(1,1) .LE.0.0000000001) THEN DO 40 II=1,4 DO 30 JJ=1,4 RFF(II,JJ)=RF(II,JJ) ROO(II,JJ)=RO(II,JJ) 30 CONTINUE 40 CONTINUE LCODE = NCODE RETURN END IF C FILL... IF(ROO(1,1) .GT.0.0000000001) THEN DO 50 II=1,4 DO 60 JJ=1,4 RF(II,JJ)=RFF(II,JJ) RO(II,JJ)=ROO(II,JJ) 60 CONTINUE 50 CONTINUE NCODE = LCODE MATRIX = .TRUE. RETURN END IF END C C SUBROUTINE RBRINV(A,AI) C ======================= C C_BEGIN_RBRINV C C SUBROUTINE RBRINV(A,AI) C C C Subroutine to invert 4*4 matrices for conversion between C fractional and orthogonal axes. C C C PARAMETERS C C A (I) (REAL(4,4)) 4*4 MATRIX TO BE INVERTED C AI (O) (REAL(4,4)) INVERSE MATRIX C C_END_RBRINV C REAL A(4,4),AI(4,4),C(4,4),X(3,3) C C---- Get cofactors of 'a' in array 'c' C DO 40 II=1,4 DO 30 JJ=1,4 I=0 DO 20 I1=1,4 IF(I1.EQ.II)GO TO 20 I=I+1 J=0 DO 10 J1=1,4 IF(J1.EQ.JJ)GO TO 10 J=J+1 X(I,J)=A(I1,J1) 10 CONTINUE 20 CONTINUE AM=X(1,1)*X(2,2)*X(3,3)-X(1,1)*X(2,3)*X(3,2)+X(1,2)*X(2,3)*X(3,1) * -X(1,2)*X(2,1)*X(3,3)+X(1,3)*X(2,1)*X(3,2)-X(1,3)*X(2,2)*X(3,1) C(II,JJ)=(-1)**(II+JJ)*AM 30 CONTINUE 40 CONTINUE C C---- Calculate determinant C D=0 DO 50 I=1,4 D=D+A(I,1)*C(I,1) 50 CONTINUE C C---- Get inverse matrix C DO 70 I=1,4 DO 60 J=1,4 AI(I,J)=C(J,I)/D 60 CONTINUE 70 CONTINUE RETURN END C C C C SUBROUTINE RBFROR C ================= C C_BEGIN_RBFROR C C SUBROUTINE RBFROR C C THIS SUBROUTINE CALCULATES MATRICES FOR STANDARD ORTHOGONALISATIONS c and cell volume C C this generates the various orthogonalising matrices C ' NCODE =1 - ORTHOG AXES ARE DEFINED TO HAVE' C A PARALLEL TO XO CSTAR PARALLEL TO ZO' C ' NCODE =2 - ORTHOG AXES ARE DEFINED TO HAVE' C ' B PARALLEL TO XO ASTAR PARALLEL TO ZO' C ' NCODE =3 - ORTHOG AXES ARE DEFINED TO HAVE' C ' C PARALLEL TO XO BSTAR PARALLEL TO ZO' C ' NCODE =4 - ORTHOG AXES ARE DEFINED TO HAVE' C ' HEX A+B PARALLEL TO XO CSTAR PARALLEL TO ZO' C ' NCODE =5 - ORTHOG AXES ARE DEFINED TO HAVE' C ' ASTAR PARALLEL TO XO C PARALLEL TO ZO' C ' NCODE =6 - ORTHOG AXES ARE DEFINED TO HAVE' C A PARALLEL TO XO BSTAR PARALLEL TO YO' C C SET UP MATRICES TO ORTHOGONALISE H K L AND X Y Z FOR THIS CELL. C C Common Blocks C C .. Scalar Arguments .. REAL VOLL C .. C .. Array Arguments .. REAL CEL(6),RRR(3,3,6) C C COMMON/RBRKZZ/CELL(6),RR(3,3,6),VOL,CELLAS(6) C COMMON /RBREC/AC(6) C C_END_RBFROR C COMMON/RBRKZZ/CELL(6),RR(3,3,6),VOL,CELLAS(6) COMMON /RBREC/AC(6) SAVE /RBRKZZ/, /RBREC/ C C---- Initialisations C DO I = 1,6 CEL(I)=CELL(I) END DO VOLL = VOL CALL RBFRO1(CEL,VOLL,RRR) C RETURN END C C C =============================== SUBROUTINE RBFRO1(CEL,VOLL,RRR) C =============================== C C_BEGIN_RBFRO1 C C SUBROUTINE RBFRO1(CEL,VOLL,RRR) C C---- This subroutine is a duplicate of rbfror with a different call. C C PARAMETERS C C CEL (I) (REAL(6)) Cell dimensions C VOLL (O) (REAL) Cell volume C RRR (O) (REAL(3,3,6)) Standard orthogonisational matrices C C_END_RBFRO1 C C THIS SUBROUTINE CALCULATES MATRICES FOR STANDARD ORTHOGONALISATIONS c and cell volume C C this generates the various orthogonalising matrices C ' NCODE =1 - ORTHOG AXES ARE DEFINED TO HAVE' C A PARALLEL TO XO CSTAR PARALLEL TO ZO' C ' NCODE =2 - ORTHOG AXES ARE DEFINED TO HAVE' C ' B PARALLEL TO XO ASTAR PARALLEL TO ZO' C ' NCODE =3 - ORTHOG AXES ARE DEFINED TO HAVE' C ' C PARALLEL TO XO BSTAR PARALLEL TO ZO' C ' NCODE =4 - ORTHOG AXES ARE DEFINED TO HAVE' C ' HEX A+B PARALLEL TO XO CSTAR PARALLEL TO ZO' C ' NCODE =5 - ORTHOG AXES ARE DEFINED TO HAVE' C ' ASTAR PARALLEL TO XO C PARALLEL TO ZO' C ' NCODE =6 - ORTHOG AXES ARE DEFINED TO HAVE' C A PARALLEL TO XO BSTAR PARALLEL TO YO' C C SET UP MATRICES TO ORTHOGONALISE H K L AND X Y Z FOR THIS CELL. C C .. Scalar Arguments .. REAL VOLL C .. C .. Array Arguments .. REAL CEL(6),RRR(3,3,6) C .. C .. Scalars in Common .. REAL VOL C .. C .. Arrays in Common .. REAL AC,CELL,CELLAS,RR C .. C .. Local Scalars .. REAL A,ALPH,ALPHAS,AS,B,BET,BETAS,BS,C,CONV,COSA,COSAS,COSB,COSBS, + COSG,COSGS,CS,FCT,GAMM,GAMMAS,SINA,SINAS,SINB,SINBS,SING, + SINGS,SUM,V INTEGER I,J,K,N,NCODE C .. C .. Intrinsic Functions .. INTRINSIC ATAN2,COS,SIN,SQRT C .. C .. Common blocks .. COMMON /RBREC/AC(6) COMMON /RBRKZZ/CELL(6),RR(3,3,6),VOL,CELLAS(6) C .. C .. Save statement .. SAVE /RBRKZZ/, /RBREC/ C .. C C---- Initialisations C CELDEL = 0.0 IF (CEL(1).GT.0.0) THEN IF (CELL(1).GT.0.0) THEN IWARN = 0 DO 101 I = 1,6 CELDEL = ABS(CEL(I)-CELL(I))/CEL(I) IF (CELDEL.GT.0.01) IWARN = 1 101 CONTINUE IF(IWARN.NE.0) WRITE(6,9876)CELL,CEL 9876 FORMAT(' Inconsistency in Cell Dimensions - replacing old:', + /,' Old cell:',3X,6F10.5,/,' New cell:',3X,6F10.5) ENDIF DO 10 I = 1,6 CELL(I) = CEL(I) IF (CELL(I).EQ.0.0) call ccperr(1, +' **** Incorrect (0.0) CELL element in subroutine rbfro1?? ****') 10 CONTINUE ENDIF C C CONV = 3.14159/180.0 FCT = 8.0*3.14159*3.14159 ALPH = CELL(4)*CONV BET = CELL(5)*CONV GAMM = CELL(6)*CONV SUM = (ALPH+BET+GAMM)*0.5 V = SQRT(SIN(SUM-ALPH)*SIN(SUM-BET)*SIN(SUM-GAMM)*SIN(SUM)) VOL = 2.0*CELL(1)*CELL(2)*CELL(3)*V SINA = SIN(ALPH) COSA = COS(ALPH) SINB = SIN(BET) COSB = COS(BET) SING = SIN(GAMM) COSG = COS(GAMM) COSAS = (COSG*COSB-COSA)/ (SINB*SING) SINAS = SQRT(1.0-COSAS*COSAS) COSBS = (COSA*COSG-COSB)/ (SINA*SING) SINBS = SQRT(1.0-COSBS*COSBS) COSGS = (COSA*COSB-COSG)/ (SINA*SINB) SINGS = SQRT(1.0-COSGS*COSGS) A = CELL(1) B = CELL(2) C = CELL(3) AS = B*C*SINA/VOL BS = C*A*SINB/VOL CS = A*B*SING/VOL ALPHAS = ATAN2(SINAS,COSAS)/CONV BETAS = ATAN2(SINBS,COSBS)/CONV GAMMAS = ATAN2(SINGS,COSGS)/CONV CELLAS(1) = AS CELLAS(2) = BS CELLAS(3) = CS CELLAS(4) = ALPHAS CELLAS(5) = BETAS CELLAS(6) = GAMMAS C C---- Set useful things for calculating dstar C AC(1) = AS*AS AC(2) = BS*BS AC(3) = CS*CS AC(4) = 2.0*BS*CS*COSAS AC(5) = 2.0*CS*AS*COSBS AC(6) = 2.0*AS*BS*COSGS C C---- Zero matrices C DO 40 N = 1,6 DO 30 I = 1,3 DO 20 J = 1,3 RR(I,J,N) = 0.0 20 CONTINUE 30 CONTINUE 40 CONTINUE C C---- Calculate matrices C C---- XO along a Zo along c* C NCODE = 1 RR(1,1,NCODE) = A RR(1,2,NCODE) = B*COSG RR(1,3,NCODE) = C*COSB RR(2,2,NCODE) = B*SING RR(2,3,NCODE) = -C*SINB*COSAS RR(3,3,NCODE) = C*SINB*SINAS C C---- XO along b Zo along a* C NCODE = 2 RR(1,1,NCODE) = A*COSG RR(1,2,NCODE) = B RR(1,3,NCODE) = C*COSA RR(2,1,NCODE) = -A*SING*COSBS RR(2,3,NCODE) = C*SINA RR(3,1,NCODE) = A*SING*SINBS C C---- XO along c Zo along b* C NCODE = 3 RR(1,1,NCODE) = A*COSB RR(1,2,NCODE) = B*COSA RR(1,3,NCODE) = C RR(2,1,NCODE) = A*SINB RR(2,2,NCODE) = -B*SINA*COSGS RR(3,2,NCODE) = B*SINA*SINGS C C---- trigonal only - XO along a+b YO alon a-b Zo along c* C NCODE = 4 RR(1,1,NCODE) = A/2.0 RR(1,2,NCODE) = A/2.0 RR(2,1,NCODE) = -A*SING RR(2,2,NCODE) = A*SING RR(3,3,NCODE) = C C C---- XO along a* ZO along c C NCODE = 5 RR(1,1,NCODE) = A*SINB*SINGS RR(2,1,NCODE) = -A*SINB*COSGS RR(2,2,NCODE) = B*SINA RR(3,1,NCODE) = A*COSB RR(3,2,NCODE) = B*COSA RR(3,3,NCODE) = C C C---- Grr*! to Gerard Bricogne - his setting for P1 in SKEW. C XO along a Yo along b* C NCODE = 6 RR(1,1,NCODE) = A RR(1,2,NCODE) = B*COSG RR(1,3,NCODE) = C*COSB RR(2,2,NCODE) = B*SING*SINAS RR(3,2,NCODE) = -B*SING*COSAS RR(3,3,NCODE) = C*SINB C C---- copy rr(...) into rrr(...) C DO 11 I=1,6 CEL(I) = CELL(I) 11 CONTINUE DO 70 I = 1,6 DO 60 J = 1,3 DO 50 K = 1,3 RRR(K,J,I) = RR(K,J,I) 50 CONTINUE 60 CONTINUE 70 CONTINUE C C VOLL = VOL IF (CELDEL.GT.0.01) VOLL = -VOL C C END C C SUBROUTINE CVFRAC2(X,Y,Z,XX,YY,ZZ,IFLAG) C ============================================ C C_BEGIN_CVFRAC2 C C This subroutine is used to convert between the stored orthogonal and C fractional coordinates using the matrices set up in the common block C /ORTHOG/ by the subroutine XYZOPEN. If no matrices have been set up then the C program will stop with an error message. C C Call: CALL CVFRAC2(X,Y,Z,XX,YY,ZZ,IFLAG) C C Arguments: C C X (I) (REAL) Input coordinates. C Y (I) (REAL) " C Z (I) (REAL) " C XX (O) (REAL) Output coordinates. C YY (O) (REAL) " C ZZ (O) (REAL) " C IFLAG (I) (INTEGER) Flag =0, Convert coordinates from fractional to orthogonal C =1, Convert coordinates from orthogonal to fractional C C_END_CVFRAC2 C LOGICAL IFCRYS,IFSCAL,MATRIX,IFHDOUT,IFNEWCRYS COMMON /RBRKXX/IFCRYS,IFSCAL,ITYP,MATRIX,IFHDOUT,IFNEWCRYS COMMON /ORTHOG/RO(4,4),RF(4,4),NCODE SAVE /RBRKXX/,/ORTHOG/ C C---- Check that matrices set up C IF(.NOT.MATRIX)GO TO 800 C C---- Perform transformation C IF(IFLAG.NE.0)GO TO 10 XX=RO(1,1)*X + RO(1,2)*Y +RO(1,3)*Z +RO(1,4) YY=RO(2,1)*X + RO(2,2)*Y +RO(2,3)*Z +RO(2,4) ZZ=RO(3,1)*X + RO(3,2)*Y +RO(3,3)*Z +RO(3,4) RETURN 10 XX=RF(1,1)*X + RF(1,2)*Y +RF(1,3)*Z +RF(1,4) YY=RF(2,1)*X + RF(2,2)*Y +RF(2,3)*Z +RF(2,4) ZZ=RF(3,1)*X + RF(3,2)*Y +RF(3,3)*Z +RF(3,4) RETURN C C---- Error condition C 800 CALL CCPERR(4,' **FRACTIONAL/ORTHOGONAL MATRICES NOT SET UP**') call ccperr(1,' No knowledge of input orthogonalisation') C C---- Format statements C END C C C SUBROUTINE CVFRAC(X,Y,Z,XX,YY,ZZ,IFLAG,MSG) C =========================================== C C_BEGIN_CVFRAC C C Another silly obsolete routine that really should be deleted. C MSG value is in fact useless. Library output controlled by CCPERR. C C_END_CVFRAC C C .. Scalar Arguments .. REAL X,Y,Z,XX,YY,ZZ INTEGER IFLAG,MSG C .. C .. External Routines .. EXTERNAL CVFRAC2 C .. CALL CVFRAC2(X,Y,Z,XX,YY,ZZ,IFLAG) RETURN END C C C SUBROUTINE CVANISOB(B,IFLAG) C THIS SUBROUTINE SHOULD NOT BE USED C SEE CVANISOU REAL B(6) INTEGER IFLAG EXTERNAL CVANISOu, CCPERR WRITE (6,*) 'ERR: THIS PROGRAM USES S/R CVANISOB' WRITE (6,*) 'ERR: IT SHOULD NOT USE THIS ROUTINE' WRITE (6,*) 'ERR: CVANISOU IS CALLED AUTOMATICALLY' CALL CCPERR(2, 'CHANGE YOUR CODE') CALL CVANISOU(B, IFLAG) RETURN END C C C C SUBROUTINE CVANISOU(U,IFLAG) C ============================ C C_BEGIN_CVANISOU C C This subroutine is used to convert between crystallographic bs and C orthogonal Us or the other way round. The orthogonal matrices are C required, if no matrices have been set up then the program will stop C with an error message. The temperature factors are defined below; C C PDB files contain anisotropic temperature factors as orthogonal Us. C The anisotropic temperature factors can be input/output to this routine C as orthogonal or as crystallographic Us. C C Shelx defines Uf to calculate temperature factor as: C T(aniso_Uf) = exp (-2PI**2 ( (h*ast)**2 Uf_11 + (k*bst)**2 Uf_22 + ... C + 2hk*ast*bst*Uf_12 +..) C C Note: Uo_ji == Uo_ij and Uf_ji == Uf_ij. C C [Uo_ij] listed on ANISOU card satisfy the relationship: C [Uo_ij] = [RFu]-1 [Uf_ij] {[RFu]-1}T C C where [Rfu] is the normalised [Rf] matrix read from the SCALEi cards. C see code. [ROu] == [RFu]-1 C Hence: C [Uf_ij] = [RFu] [Uo_ij] {[RFu] }T C C T(aniso_Uo) = U(11)*H**2 + U(22)*K**2 + 2*U(12)*H*K + ... C where H,K,L are orthogonal reciprocal lattice indecies. ( EJD: I think????) C C Biso = 8*PI**2 (Uo_11 + Uo_22 + Uo_33) / 3.0 C C [Uf(symm_j)] = [Symm_j] [Uf] [Symm_j]T C C C Arguments: C C U(6) (I/O (REAL) Input coordinates. C IFLAG (I) (INTEGER) Flag =0, Convert coordinates from fract. to orthog. C =1, Convert coordinates from orthog. to fract. C C_END_CVANISOU C C .. Arguments .. REAL U(6) INTEGER IFLAG C .. C .. Variables in Common .. REAL RF,RO INTEGER NCODE LOGICAL IFCRYS,IFSCAL,MATRIX,IFHDOUT,IFNEWCRYS C .. C .. Local Variables .. INTEGER I,J REAL TWOPI2 REAL A(3,3),AT(3,3),TMP(3,3),TMPMAT(3,3) C .. C .. External Routines .. EXTERNAL CCPERR,MATMUL C .. C .. Common Blocks .. COMMON /RBRKXX/IFCRYS,IFSCAL,ITYP,MATRIX,IFHDOUT,IFNEWCRYS COMMON /ORTHOG/RO(4,4),RF(4,4),NCODE COMMON /ORTHOGU/ ROU(4,4),RFU(4,4) C .. C .. Save Statement .. SAVE /RBRKXX/,/ORTHOG/,/ORTHOGU/ C .. C .. Data Statements ... DATA TWOPI2 /19.739209/ C .. C C---- Check that matrices set up C IF(.NOT.MATRIX)GO TO 800 C C---- Perform transformation C TMP(1,1)=U(1) TMP(2,2)=U(2) TMP(3,3)=U(3) TMP(1,2)=U(4) TMP(2,1)=U(4) TMP(1,3)=U(5) TMP(3,1)=U(5) TMP(2,3)=U(6) TMP(3,2)=U(6) C C IFLAG (I) (INTEGER) Flag =0, Convert coordinates from fract. to orthog. C IFLAG (I) (INTEGER) Flag =1, Convert coordinates from orthog. to fract. C IF (IFLAG .EQ. 0) THEN DO 10 I=1,3 DO 10 J=1,3 A(J,I)=ROU(J,I) AT(I,J)=ROU(J,I) 10 CONTINUE ELSE DO 20 I=1,3 DO 20 J=1,3 A(J,I) = RFU(J,I) AT(I,J) = RFU(J,I) 20 CONTINUE ENDIF C CALL MATMUL(TMPMAT,TMP,AT) CALL MATMUL(TMP,A,TMPMAT) U(1) = TMP(1,1) U(2) = TMP(2,2) U(3) = TMP(3,3) U(4) = TMP(1,2) U(5) = TMP(1,3) U(6) = TMP(2,3) RETURN C C---- Error condition C 800 CALL CCPERR(4,' **FRACTIONAL/ORTHOGONAL MATRICES NOT SET UP**') call ccperr(1,' No knowledge of input orthogonalisation') C C---- Format statements C END C C C SUBROUTINE RBCELL(CELLD,CVOL) C ============================ C C_BEGIN_RBCELL C C SUBROUTINE RBCELL(CELLD,CVOL) C C Returns cell dimensions and unit cell volume. C C PARAMETERS C CELLD (O) (REAL(6)) cell dimensions C CVOL (O) (REAL) cell volume C C Common blocks C C COMMON/RBRKZZ/CELL(6),RR(3,3,6),VOL,CELLAS(6) C C_END_RBCELL C COMMON/RBRKZZ/CELL(6),RR(3,3,6),VOL,CELLAS(6) REAL CELL,RR,VOL,CELLAS REAL CELLD(6), CVOL SAVE /RBRKZZ/ C CVOL = VOL DO 1 I=1,6 1 CELLD(I) = CELL(I) END C C C SUBROUTINE RBRCEL(RCEL,RVOL) C ============================ C C_BEGIN_RBRCEL C C SUBROUTINE RBRCEL(RCEL,RVOL) C C THIS SUBROUTINE RETURNS Reciprocal cell dimensions, and reciprocal C unit cell volume. C C PARAMETERS C RCEL (O) (REAL(6)) reciprocal cell dimensions C RVOL (O) (REAL) reciprocal cell volume C C Common blocks C C COMMON/RBRKZZ/CELL(6),RR(3,3,6),VOL,CELLAS(6) C C_END_RBRCEL C COMMON/RBRKZZ/CELL(6),RR(3,3,6),VOL,CELLAS(6) REAL RCEL(6),RVOL REAL CELL,CELLAS,RR,VOL SAVE /RBRKZZ/ C IF (VOL.EQ.0.0) THEN RVOL = 0.0 ELSE RVOL = 1.0/VOL ENDIF DO 1 I=1,6 1 RCEL(I) = CELLAS(I) RETURN END C C C SUBROUTINE RBSPGRP(SPGRP) C ============================ C C_BEGIN_RBSPGRP C C SUBROUTINE SUBROUTINE RBSPGRP(SPGRP) C C Returns spacegrpup from pdb C C PARAMETERS C SPGRP (O) (CHARACTER*15) C C Common blocks C C COMMON /RBRKSPGRP/BRKSPGRP C C_END_RBSPGRP C CHARACTER SPGRP*(*) CHARACTER BRKSPGRP*15 INTEGER ILEN,KLEN,J COMMON /RBRKSPGRP/BRKSPGRP SPGRP = BRKSPGRP C C Make sure that the returned name is left-justified C ILEN = LENSTR(SPGRP) KLEN = ILEN C DO J = 1,ILEN-1 IF (SPGRP(1:1) .EQ. ' ') THEN SPGRP = SPGRP(2:KLEN) KLEN = KLEN - 1 END IF END DO C END C C C SUBROUTINE WBSPGRP(SPGRP) C ============================= C C_BEGIN_WBSPGRP C C SUBROUTINE WBSPGRP(SPGRP) C C Sets the internal spacegroup of a pdb file C C PARAMETERS C SPGRP (I) (CHARACTER*15) C C Common Blocks C C COMMON /RBRKSPGRP/BRKSPGRP C C_END_WBSPGRP C C... Local scalars CHARACTER SPGRP*(*) C... Common block CHARACTER BRKSPGRP*15 COMMON /RBRKSPGRP/BRKSPGRP BRKSPGRP = SPGRP C END C C C SUBROUTINE RES3TO1(RESNM3,RESNM1) C ================================ C C_BEGIN_RES3TO1 C C SUBROUTINE RES3TO1(RESNM3,RESNM1) C C FIND 3 CHARACTER RESIDUE NAME FROM 1 CHARACTER CODE OR C FIND 1 CHARACTER RESIDUE NAME FROM 3 CHARACTER CODE. C SUBROUTINE IS CALLED WITH EITHER RESNM3 OR RESNM1 PREVIOUSLY C ASSIGNED, AND THE OTHER IS ASSIGNED HERE. C C Parameters C C RESNM3 (I/O) CHAR*4 3 character residue name C RESNM1 (I/O) CHAR*1 1 character residue name C C_END_RES3TO1 C CHARACTER*4 RESNM3 CHARACTER*1 RESNM1 CHARACTER*4 MAACD3(26) CHARACTER*1 MAACD1(26) DATA NAACID/26/ DATA MAACD3/'ALA ','ARG ','ASN ','ASP ','CYS ','CYH ','GLN ', 1 'GLU ','GLY ','HIS ','ILE ','LEU ','LYS ','MET ','PHE ','PRO ', 2 'SER ','THR ','TRP ','TYR ','VAL ','HEM ','WAT ','SUL ','END ', 3 'DUM '/ DATA MAACD1/'A','R','N','D','C','C','Q', 1 'E','G','H','I','L','K','M','F','P', 2 'S','T','W','Y','V','X','O','U','Z','Z'/ C C---- Routine to find one character amino acid name C IF(RESNM3.NE.' ')THEN DO 1 I=1,NAACID IF(RESNM3.EQ.MAACD3(I)) GO TO 2 1 CONTINUE I=NAACID 2 RESNM1=MAACD1(I) RETURN ENDIF C C---- Routine to find three character amino acid name C IF(RESNM1.NE.' ')THEN DO 11 I=1,NAACID IF(RESNM1.EQ.MAACD1(I)) GO TO 12 11 CONTINUE I=NAACID 12 RESNM3=MAACD3(I) RETURN ENDIF END C C C SUBROUTINE RBRECIP(IH,IK,IL,S) C ============================== C C_BEGIN_BRECIP C C SUBROUTINE RBRECIP(IH,IK,IL,S) C C---- This subroutine calculates 4SIN**2/L**2 C C PARAMETERS C IH,IK,IL (I) (INTEGER) reflection indices C S (O) (REAL) 4SIN**2/L**2 C C_END_BRECIP C COMMON /RBREC/AC(6) SAVE /RBREC/ C S = .(AC(1)*IH*IH+AC(2)*IK*IK+AC(3)*IL*IL .+AC(4)*IK*IL+AC(5)*IL*IH+AC(6)*IH*IK) RETURN END C ===================================================== SUBROUTINE SFREAD2(ID,NG,A,B,C,IWT,IELEC,CU,MO,Ifail) C ===================================================== C C Inputs: ID atom identifier C This should match an atom type in the atomsf.lib C If an atom is identified as NE2+ say, characters are C subtracted from the ID till a match is found, or there are C no characters left. C EG: Routine tests first NE2+, then NE2, then NE, then N. C All matching checks UPPER CASE strings. C C NG num. of gaussian approximations (2 or 5 (default)) C IFILFF .TRUE. if want to open the library file assigned C to ATOMSF (default `atomsf.lib') C C Output: A(4) coefficient for structure factor calculation C B(4) coefficient for structure factor calculation C C coefficient for structure factor calculation C IWT atomic weight C IELEC number of electrons C CU(2) delta F' and delta F'' for Cu C MO(2) delta F' and delta F'' for Mo C Ifail = -1 if atom not found at all C = 0 OK C = 1 for two gaussian case that does not exist C C 20/11/2000 C. Vonrhein C fixed problem with one character atom name matching C (S, I and B affected) C C .. Scalar Arguments .. REAL C INTEGER IELEC,Ifail,IWT,NG CHARACTER ID*4,IDCHK*4,STRING*200 C .. C .. Array Arguments .. REAL A(4),B(4),CU(2),MO(2) C .. C .. Local Scalars .. INTEGER NGauss,IOS CHARACTER ID2*6,IDIN*6 LOGICAL OP C .. C .. External Subroutines .. EXTERNAL CCPDPN,CCPERR C .. IDCHK = ID CALL CCPUPC(IDCHK) ID2 = IDCHK//' ' NGauss = NG C IF (NGauss.EQ.2) THEN ID2(6:6) = '2' ELSE NGauss = 5 END IF C C---- Check to open file C INQUIRE (UNIT=45, OPENED=OP, IOSTAT=IOS) IF (IOS .NE. 0) CALL CCPERR(1,'Error opening ATOMSF file') IF (.NOT.OP) THEN Ifail = 1 CALL CCPDPN(45,'ATOMSF','READONLY','F',0,Ifail) IF (Ifail.LT.0) CALL CCPERR(1,'Error opening library file') ELSE REWIND 45 END IF C C---- Search for atom identifier ID IFAIL = -1 LID = LENSTR(ID) C Big loop over possible sub-strings of ID DO 25 NID = LID,1,-1 REWIND 45 C Small loop over lines in library file 10 CONTINUE READ (45,FMT=6002,END=50,ERR=40) IDIN C CALL CCPUPC(IDIN) IF (ID2(1:NID).EQ.IDIN(1:NID)) THEN c c 20/11/2000 C. Vonrhein c c special precautions for single character atom types: c skip this atom if second character is NOT '+', '-' or ' '. c IF ((NID.NE.1).OR.( (NID.EQ.1).AND.( . (IDIN(2:2).EQ."+").OR. . (IDIN(2:2).EQ."-").OR. . (IDIN(2:2).EQ." ") ) . )) THEN Ifail = 1 IF (NGauss.NE.2 .OR. IDIN(6:6).NE.' ') GO TO 60 END IF END IF C Up for next line of library file GO TO 10 C C---- Error reading library file C 40 CALL CCPERR(1,'Error reading library file') C C---- No match C 50 CONTINUE IF (NID.GT.1) THEN WRITE(STRING,'(A,A,A)') ' No match for atom ID ',ID2(1:NID), + ' subtracting one character ' CALL CCPERR(4,STRING(1:LENSTR(STRING))) ID2 = ID2(1:NID-1)//' '//ID2(NID+1:6) ID = ID (1:NID-1)//' ' ENDIF C End of big loop. Back for smaller substring of ID. 25 CONTINUE WRITE(STRING,'(A,A,A)') ' No match for atom ID ',ID2(1:1), + ' giving up! ' CALL CCPERR(4,STRING(1:LENSTR(STRING))) IFAIL = -1 RETURN C C---- Matched atom C 60 READ (45,FMT=6006) IWT,IELEC,C READ (45,FMT=6008) A(1),A(2),A(3),A(4) READ (45,FMT=6008) B(1),B(2),B(3),B(4) READ (45,FMT=6008) CU(1),CU(2),MO(1),MO(2) Ifail = 0 C C---- Format statements C 6002 FORMAT (A6) 6006 FORMAT (2X,I8,2X,I8,2X,F14.6) 6008 FORMAT (4 (2X,F14.6)) END C C C SUBROUTINE SFREAD(ID,NG,A,B,C,IWT,IELEC,CU,MO,IFAIL,IFILFF) C =========================================================== C C_BEGIN_SFREAD C C Obsolete routine should be deleted. IFILFF not used. C C_END_SFREAD C C .. Scalar Arguments .. REAL C INTEGER IELEC,Ifail,IWT,NG LOGICAL IFILFF CHARACTER ID*4 C .. C .. Array Arguments .. REAL A(4),B(4),CU(2),MO(2) C .. C .. External Routines .. EXTERNAL SFREAD2 C .. CALL SFREAD2(ID,NG,A,B,C,IWT,IELEC,CU,MO,IFAIL) RETURN END C C C SUBROUTINE WBCELL(IUNIT,ARGCELL,ARGNCODE) C ========================================= C C_BEGIN_WBCELL C C This subroutine writes out the cell and orthogonalisation matrices, to C the output file. If the input parameters are null then the cell etc. are C taken from the COMMON blocks. C C PARAMETERS C C IUNIT (I) (INTEGER) Channel number for output file. C C ARGCELL(6) (I) (REAL) crystallographic cell taken from COMMON C if cell = 0 C ARGNCODE (I) (INTEGER) NCODE number taken from COMMON if NCODE=0 C C_END_WBCELL C C .. Parameters .. INTEGER MAXFILESOPEN PARAMETER (MAXFILESOPEN=90) C .. C .. Agruments .. REAL ARGCELL(6) INTEGER ARGNCODE,IUNIT C .. C .. Variables in Common .. REAL CELL, RO, RF, RR INTEGER FILESOPEN, NCODE, TYPE, UNIT CHARACTER*80 LOGUNIT CHARACTER BRKSPGRP*15 LOGICAL IFCRYS,IFSCAL,MATRIX,IFHDOUT,IFNEWCRYS C .. C .. Local Scalars .. INTEGER I, II, J, IRET CHARACTER*80 ERRLIN C .. C .. External Routines/Functions .. EXTERNAL CCPERR,RBFROR,RBRINV,MMDB_F_WBSPGRP, + MMDB_F_WBCELL C .. C .. Common Blocks .. COMMON /RBRKAA/ FILESOPEN,LOGUNIT(MAXFILESOPEN), + UNIT(MAXFILESOPEN),TYPE(MAXFILESOPEN) COMMON /ORTHOG/RO(4,4),RF(4,4),NCODE COMMON /RBRKZZ/CELL(6),RR(3,3,6),VOL,CELLAS(6) COMMON /RBRKXX/ IFCRYS,IFSCAL,ITYP,MATRIX,IFHDOUT,IFNEWCRYS COMMON /RBRKSPGRP/BRKSPGRP C .. SAVE /ORTHOG/,/RBRKAA/,/RBRKXX/,/RBRKZZ/ II = 0 DO 10 I=1,FILESOPEN IF (IUNIT .EQ. UNIT(I)) THEN II = I GOTO 20 ENDIF 10 CONTINUE ERRLIN = ' ERROR: in WBCELL file has not been opened' CALL CCPERR(1,ERRLIN) 20 IF (ARGCELL(1) .EQ. 0.0) THEN IF (IFCRYS) CALL MMDB_F_WBCELL(IUNIT, CELL, ARGNCODE, IRET) ELSE CALL MMDB_F_WBCELL(IUNIT, ARGCELL, ARGNCODE, IRET) ENDIF C... update spacegroup information from cache CALL MMDB_F_WBSPGRP(IUNIT,BRKSPGRP,IRET) IF (ARGNCODE .NE. 0) THEN DO 30 I = 1,6 CELL(I) = ARGCELL(I) 30 CONTINUE CALL RBFROR DO 40 I = 1,3 DO 40 J = 1,3 RO(J,I) = RR(J,I,ARGNCODE) 40 CONTINUE RO(4,4) = 1.0 DO 50 I=1,3 RO(I,4) = 0.0 50 CONTINUE CALL RBRINV(RO,RF) ENDIF IFNEWCRYS = .TRUE. RETURN END C C C SUBROUTINE WREMARK(IUNIT,LINE) C ============================== C C_BEGIN_WREMARK C C This subroutine writes a line to the output file. Its main use is for C REMARK statements in PDB. C C Parameters: C C IUNIT (I) (CHARACTER*(*)) Channel number C LINE (I) (CHARACTER*(*)) line to be written, best C if declared as *80 C C_END_WREMARK C C .. Parameters .. INTEGER MAXFILESOPEN PARAMETER (MAXFILESOPEN=90) C .. C .. Arguments .. INTEGER IUNIT CHARACTER*(*) LINE C .. C .. Variables in Common .. INTEGER FILESOPEN,TYPE,UNIT CHARACTER*80 LOGUNIT C .. C .. Locals .. INTEGER II, IRET CHARACTER OUTLIN*80,ERRLIN*80 C .. C .. Common Blocks .. COMMON /RBRKAA/ FILESOPEN,LOGUNIT(MAXFILESOPEN), + UNIT(MAXFILESOPEN),TYPE(MAXFILESOPEN) C .. C .. Save Statement .. SAVE /RBRKAA/ C .. C C---- The remark line will be truncated if it > 80 characters C this fits with PDB and CIF syntax. C II = 0 DO 10 I=1,FILESOPEN IF (IUNIT .EQ. UNIT(I)) THEN II = I GOTO 20 ENDIF 10 CONTINUE ERRLIN = ' ERROR: in WREMARK file has not been opened' CALL CCPERR(1,ERRLIN) 20 CALL MMDB_F_WREMARK(IUNIT, LINE, IRET) RETURN END C C C SUBROUTINE RWBFIN(IUN,IOUT) C =========================== C C_BEGIN_RWBFIN C C This subroutine copies remaining lines straight from input to C output. C C_END_RWBFIN C C .. Scalar Arguments .. INTEGER IUN,IOUT C .. C .. External Routines .. EXTERNAL XYZADVANCE 10 CALL XYZADVANCE(IUN,IOUT,0,*1000,*1000) CALL XYZADVANCE(IOUT,0,0,*1000,*1000) GOTO 10 1000 RETURN END C C C SUBROUTINE RWNOHEAD() C ===================== C C_BEGIN_RWNOHEAD C C This subroutine resets the logical variable IFHDOUT in the RWBROOK C common block RBRKXX, and should be called once before either C XYZADVANCE or WBCELL in order to prevent those routines from writing C headers to an output pdb file. C Effectively we are fooling the library that the header has already C been written. C C_END_RWNOHEAD C C .. Arguments in common .. INTEGER ITYP LOGICAL IFCRYS,IFHDOUT,IFNEWCRYS,IFSCAL,MATRIX C C .. Common blocks .. COMMON /RBRKXX/ IFCRYS,IFSCAL,ITYP,MATRIX,IFHDOUT,IFNEWCRYS C IFHDOUT = .TRUE. C RETURN END C C SUBROUTINE NUM_EXPECTED_WATERS(RESO,TEMP,FHOH,SEFHOH) C ===================================================== C C_BEGIN_NUM_EXPECTED_WATERS C C Arguments: C C RESO (I) REAL Resolution in A. C TEMP (I) CHARACTER*4 'ROOM' or 'LOWT' for temperature. C FHOH (O) REAL Prediction of N_HOH/N_at C SEFHOH (O) REAL Standard error of FHOH C C Given the resolution, this routine returns the number of water C molecules expected to be determined by PX (and the associated C standard error) as a fraction of the number of protein atoms, C as estimated by the statistical analysis of Carugo & Bordo, C Acta Cryst D, 55, 479 (1999). Two expressions are given, one C for room temperature structures and one for low temperature C structures. C C_END_NUM_EXPECTED_WATERS C CHARACTER*4 TEMP,TTEMP REAL RESO,FHOH,SEFHOH TTEMP = TEMP CALL CCPUPC(TTEMP) IF (TTEMP.EQ.'ROOM') THEN FHOH = 0.301 - 0.095*RESO SEFHOH = 0.092 * SQRT(0.00114 + 0.005*(RESO - 2.3)**2) ELSEIF (TTEMP.EQ.'LOWT') THEN FHOH = 0.334 - 0.110*RESO SEFHOH = 0.043 * SQRT(0.030 + 0.167*(RESO - 2.2)**2) ENDIF RETURN END C C C SUBROUTINE WBCELLS(IUNIT,ARGCELL,ARGNCODE,NAMSPG_CIF) C ========================================= C C_BEGIN_WBCELL C C This subroutine writes out the cell and orthogonalisation matrices, to C the output file. If the input parameters are null then the cell etc. are C taken from the COMMON blocks. C C PARAMETERS C C IUNIT (I) (INTEGER) Channel number for output file. C C ARGCELL(6) (I) (REAL) crystallographic cell taken from COMMON C if cell = 0 C ARGNCODE (I) (INTEGER) NCODE number taken from COMMON if NCODE=0 C C_END_WBCELL C C .. Parameters .. INTEGER MAXFILESOPEN PARAMETER (MAXFILESOPEN=90) C .. C .. Agruments .. REAL ARGCELL(6) INTEGER ARGNCODE,IUNIT C .. C .. Variables in Common .. REAL CELL, RO, RF, RR INTEGER FILESOPEN, NCODE, TYPE, UNIT CHARACTER*80 LOGUNIT CHARACTER BRKSPGRP*15,NAMSPG_CIF*(*) LOGICAL IFCRYS,IFSCAL,MATRIX,IFHDOUT,IFNEWCRYS C .. C .. Local Scalars .. INTEGER I, II, J, IRET CHARACTER*80 ERRLIN CHARACTER*15 SPGRP C .. C .. External Routines/Functions .. EXTERNAL CCPERR,RBFROR,RBRINV,MMDB_F_RBSPGRP C .. C .. Common Blocks .. COMMON /RBRKAA/ FILESOPEN,LOGUNIT(MAXFILESOPEN), + UNIT(MAXFILESOPEN),TYPE(MAXFILESOPEN) COMMON /ORTHOG/RO(4,4),RF(4,4),NCODE COMMON /RBRKZZ/CELL(6),RR(3,3,6),VOL,CELLAS(6) COMMON /RBRKXX/ IFCRYS,IFSCAL,ITYP,MATRIX,IFHDOUT,IFNEWCRYS COMMON /RBRKSPGRP/BRKSPGRP C .. SAVE /ORTHOG/,/RBRKAA/,/RBRKXX/,/RBRKZZ/ C II = 0 DO 10 I=1,FILESOPEN IF (IUNIT .EQ. UNIT(I)) THEN II = I GOTO 20 ENDIF 10 CONTINUE ERRLIN = ' ERROR: in WBCELL file has not been opened' CALL CCPERR(1,ERRLIN) 20 CALL MMDB_F_RBSPGRP(IUNIT,SPGRP,IRET) C Has the spacegroup name been set yet? ILEN1 = LENSTR(SPGRP) ILEN2 = LENSTR(NAMSPG_CIF) IF(SPGRP.NE.' '.AND. + SPGRP(1:ILEN1).NE.NAMSPG_CIF(1:ILEN2)) then WRITE(6,'(A,/,4(A,5x))') '*** Incompatible space group names:', + ' From PDB input: ',SPGRP, + ' To be written to output:',NAMSPG_CIF CALL CCPERR(2,' Incompatible space group names') END IF BRKSPGRP = NAMSPG_CIF(1:ILEN2) CALL WBCELL(IUNIT,ARGCELL,ARGNCODE) RETURN END C libccp4-8.0.0/fortran/sorting_main.f0000644000000000000000000002725414242731033015511 0ustar 00000000000000C C sorting_main.f: sorting function library C Copyright (C) 2001 Garib Murshudov C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C ! ! A module to arrange memory for sorting ! records (allocate, reallocate, deallocate) module sorting_commons implicit none integer :: nmax_rec = 2000000 INTEGER NKEYS_S,NRECORD_S,KEY_ADDRESS,RECORD_ADDRESS integer NRECORD_NOW,NRECORD_RETURN,INDEX_ADDRESS integer NRECORD_IN_RUNS,NRECORD_IN_THIS_RUN integer NMAX_RECORD integer nkeys_l,nrec_l INTEGER SAVE_KEYS(5),SAVE_RECORD(200),ASCEND_DESCEND(5) REAL, allocatable :: keys_mem(:) real, allocatable :: array_mem(:) real, allocatable :: index_mem(:) contains subroutine sorting_allocate_this() if(nmax_rec.le.0)nmax_rec = 2000000 allocate(keys_mem(nkeys_l*nmax_rec)) allocate(array_mem(max(1,(nrec_l-nkeys_l)*nmax_rec))) allocate(index_mem(nmax_rec)) end subroutine subroutine sorting_reallocate_this() integer nk1,nr1,ni1 real, allocatable :: temp_keys(:) real, allocatable :: temp_recs(:) real, allocatable :: temp_inds(:) nk1 = nkeys_l*nmax_rec nr1 = max(1,(nrec_l-nkeys_l)*nmax_rec) ni1 = nmax_rec allocate(temp_keys(nk1)) allocate(temp_recs(nr1)) allocate(temp_inds(ni1)) temp_keys(1:nk1) = keys_mem(1:nk1) temp_recs(1:nr1) = array_mem(1:nr1) temp_inds(1:ni1) = index_mem(1:ni1) nmax_rec = nint(nmax_rec*1.5) deallocate(keys_mem) deallocate(array_mem) deallocate(index_mem) allocate(keys_mem(nkeys_l*nmax_rec)) allocate(array_mem(max(1,(nrec_l-nkeys_l)*nmax_rec))) allocate(index_mem(nmax_rec)) keys_mem(1:nk1) = temp_keys(1:nk1) array_mem(1:nr1) = temp_recs(1:nr1) index_mem(1:ni1) = temp_inds(1:ni1) deallocate(temp_keys) deallocate(temp_recs) deallocate(temp_inds) return end subroutine subroutine sorting_deallocate_this() deallocate(keys_mem) deallocate(array_mem) deallocate(index_mem) end subroutine end module sorting_commons ! ! now sorting bit INTEGER FUNCTION SRTBEG(NKEYS,KEYBUF,NRECL,ISS) use sorting_commons C IMPLICIT NONE INTEGER NKEYS,NRECL,KEYBUF(*),ISS C INTEGER IK,IREC,J,IRECORD_POSITIONS logical found C C----Find out how many records could be sorted. We need memory for C----NRECL = NKEYS + NRECORDS number of fields and one field for C----index of records which is going to be sorted. nkeys_l = nkeys nrec_l = nrecl/4 C C---allocate enough memory (if it is not enough then we will reallocate) call sorting_allocate_this() C C----Save positions of keys and remaining records in an array C----It would be easier if keybuf would have only info about C----ascending or descending and position of key. As it stands C----it is a bit more comlicated to derive. To minimise C----change in the calling subroutine use previous binsort style C----keybuf. DO IK=1,NKEYS J = (IK-1)*5+1 SAVE_KEYS(IK) = KEYBUF(J+2)/4 + 1 ASCEND_DESCEND(IK) = 1 IF(KEYBUF(J+1).NE.0) ASCEND_DESCEND(IK) = -1 ENDDO NKEYS_S = NKEYS IRECORD_POSITIONS = 0 NRECORD_S = 0 DO IREC=1,NREC_L found = .FALSE. DO IK=1,NKEYS IF(SAVE_KEYS(IK).EQ.IREC) then found = .TRUE. exit endif ENDDO if(.not.found) then IRECORD_POSITIONS = IRECORD_POSITIONS + 1 SAVE_RECORD(IRECORD_POSITIONS) = IREC NRECORD_S = NRECORD_S + 1 endif ENDDO c C---Now we are ready to accept records. It will be done by another C---routine. C---If external merging is necessary it should be initialised here. C NRECORD_NOW = 0 NRECORD_RETURN = 0 SRTBEG = 0 RETURN END C INTEGER FUNCTION SRTRLS(ADATA) use sorting_commons IMPLICIT NONE C C----Recieve one record and save it in the list. C----For large number of records if number of current records C----is equal to maximum number of records then they should be C----sorted and then written to external files taken care of C----distribution. (polyphase merging is possible option to use) REAL ADATA(*) C INTEGER IKEY_NOW,IREC_NOW,IK,IR C C---First save keys. NRECORD_NOW = NRECORD_NOW + 1 IF(NRECORD_NOW.GT.NMAX_REC) THEN ! Memory is not sufficient. Reallocate call sorting_reallocate_this() ELSEIF(NRECORD_NOW.EQ.NMAX_REC) THEN C C---Memory is not enough for internal sorting. External sorting C---part should be written. In that case available records C---should be sorted and written to file with distribution c---which is going to be used. (polyphase distribution is one possibility) C Cmdw binsort uses 4 scratch files (T=4) Cmdw Reads from stdin (see fillworka). Cmdw Each time buffer is full, do sort (see top of readrun; later Cmdw fwrite is only if all data fits into first buffer and disk not needed). Cmdw Write sorted buffer to scratch file (see writerun). Cmdw Read more, and write to next scratch file - see D2-D4 in merge(). Cmdw When finished, rewind scratch files and go to merge step D5. Cmdw Open scratch files here (with QOPEN) iff necessary. Cmdw When finished, need to rewind with QSEEK. ENDIF IKEY_NOW = (NRECORD_NOW-1)*NKEYS_S DO IK=1,NKEYS_S keys_mem(ikey_now+ik) = adata(save_keys(ik))*ascend_descend(ik) ENDDO IREC_NOW = (NRECORD_NOW-1)*NRECORD_S DO IR=1,NRECORD_S array_mem(irec_now + ir) = adata(save_record(ir)) ENDDO index_mem(nrecord_now) = nrecord_now C C---Normal return. No disaster. SRTRLS = 0 RETURN END C INTEGER FUNCTION SRTMRG() use sorting_commons C IMPLICIT NONE C C---This function should do merging. But here we use only sorting C---It will have to be expanded for merging for large number of records C CALL HEAP_SORT(NRECORD_NOW,NKEYS_S,keys_mem,index_mem) C C---Records have been sorted. They should be distributed. C---But it is next stage. SRTMRG = 0 RETURN END C INTEGER FUNCTION SRTRET(ADATA) use sorting_commons IMPLICIT NONE C C----Retrieve next record from the sorted list of the records. REAL ADATA(*) C C---This function should do merging. But here we use only sorting C---It will have to be expanded for merging for large number of records C INTEGER IK,IR,IKEY_REC,IREC_R integer kk C C----Take keys first. NRECORD_RETURN = NRECORD_RETURN + 1 IF(NRECORD_RETURN.GT.NRECORD_NOW) THEN C C----In case of external search read from file new set of records C----and then check if everything is o.k C C---Distaster. Calling subroutine wants more than it has given. SRTRET = -1 RETURN ENDIF C C---Take keys. IKEY_REC = (NRECORD_RETURN-1)*NKEYS_S DO IK=1,NKEYS_S kk = save_keys(ik) ADATA(kk) = keys_mem(ikey_rec + kk)*ascend_descend(ik) ENDDO C C--Now take records. IREC_R = (nint(index_mem(NRECORD_RETURN))-1)*nrecord_s DO IR=1,NRECORD_S ADATA(SAVE_RECORD(IR)) = array_mem(IREC_R + IR) ENDDO C C---Succesful retrieval SRTRET = 0 RETURN END C C---Internal sorting part. It could be improved C----------- SUBROUTINE HEAP_SORT(N,NKEYS,A_KEY,INDEX_R) IMPLICIT NONE C C----Sorting using heapsort. C----A contains keys C----INDEX_R index of records to be sorted C----N number of records C----NKEYS number of keys C C---Reference C c---Knuth, The art of computer programming Volume 3 C---1998 C INTEGER N,NKEYS REAL INDEX_R(*) REAL A_KEY(*) C REAL T_KEY(5),T1_KEY(5) C REAL INDEX_C INTEGER L,M,I_TEMP,L1,MKEY1_ADD,MKEY2_ADD,I_KEY,N1 C C-------------------------------------------------------------- L1 = N/2 C C---Create heap. everybody tends to reach his level of incomptence c WRITE(*,*)'In heap_sort' DO L=L1,1,-1 CALL SIFT_UP(N,L,NKEYS,A_KEY,INDEX_R) ENDDO C c--Remove heaps one after another N1 = N-1 DO M=N1,1,-1 INDEX_C = INDEX_R(1) INDEX_R(1) = INDEX_R(M+1) INDEX_R(M+1) = INDEX_C MKEY1_ADD = M*NKEYS DO I_KEY=1,NKEYS MKEY2_ADD = MKEY1_ADD + I_KEY T_KEY(I_KEY) = A_KEY(I_KEY) A_KEY(I_KEY) = A_KEY(MKEY2_ADD) A_KEY(MKEY2_ADD) = T_KEY(I_KEY) ENDDO CALL SIFT_UP(M,1,NKEYS,A_KEY,INDEX_R) ENDDO END C SUBROUTINE SIFT_UP(M,L,NKEYS,A_KEY,INDEX_R) c c---Sift ip process in heap sort. This implementation is C---intended to work for multykey cases. I am not sure this treatment is best C---for multy key cases. Other idea will have to be tested. IMPLICIT NONE INTEGER M,L,NKEYS REAL INDEX_R(*) REAL A_KEY(*) C INTEGER I,J,IKEY_ADD,NKEYS1,JKEY_ADD,JKEY1_ADD,LKEY_ADD, & I_KEY,J_KEY,I1_KEY REAL KEY_T(5),INDEX_C C C---Intitialise sift up (in Knuth's terminology H2) INDEX_C = INDEX_R(L) NKEYS1 = -NKEYS LKEY_ADD = L*NKEYS+NKEYS1 DO I_KEY=1,NKEYS KEY_T(I_KEY) = A_KEY(LKEY_ADD + I_KEY) ENDDO c C---H3 J = L 40 CONTINUE C c---Start sift up. Compare I with 2*I or 2*I+1 C---H4 I = J J = J + J C C---If(J.GT.M) then return time IKEY_ADD = I*NKEYS + NKEYS1 JKEY_ADD = J*NKEYS + NKEYS1 IF(J.LE.M) THEN IF(J.LT.M) THEN C c---J.lt.M find maximum of J and J + 1 (which is 2*I, 2*I+1) JKEY1_ADD = JKEY_ADD + NKEYS C C---H5 DO I_KEY=1,NKEYS IF(A_KEY(JKEY_ADD+I_KEY).LT.A_KEY(JKEY1_ADD+I_KEY)) THEN C c---Next record is smaller, Take it J = J + 1 JKEY_ADD = JKEY1_ADD GOTO 55 ELSE IF(A_KEY(JKEY_ADD+I_KEY).GT. & A_KEY(JKEY1_ADD+I_KEY))THEN C c--Next record is greater. No need to proceed GOTO 55 ENDIF C c----Cannot decide yet. Check another key ENDDO ENDIF 55 CONTINUE DO I_KEY = 1,NKEYS C C---compare saved record in initialisation with record J. If C---saved is smaller than current then then put for i (2*I or 2*I+1) IF(KEY_T(I_KEY).LT.A_KEY(JKEY_ADD + I_KEY)) THEN C C---H6 above H7 below INDEX_R(I) = INDEX_R(J) DO I1_KEY=1,NKEYS A_KEY(IKEY_ADD+I1_KEY) = A_KEY(JKEY_ADD+I1_KEY) ENDDO GOTO 40 ELSE IF(KEY_T(I_KEY).GT.A_KEY(JKEY_ADD + I_KEY)) THEN GOTO 80 ENDIF ENDDO ENDIF 80 CONTINUE C c---Put saved record to i-th and exit from sift up C---H8 INDEX_R(I) = INDEX_C DO I_KEY=1,NKEYS A_KEY(IKEY_ADD+I_KEY) = KEY_T(I_KEY) ENDDO RETURN END libccp4-8.0.0/fortran/testlib.f0000644000000000000000000002321414242731033014456 0ustar 00000000000000C C testlib.f: test program for Machine dependent routines C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C PROGRAM MCTEST C C---- Test file for Machine dependent routines C C .. Parameters .. INTEGER LBUF,LSTR PARAMETER (LBUF=500,LSTR=12) C .. C .. Local Scalars .. REAL ERSTR,SEC,NAN INTEGER I,IBYTE,IDAY,IER,ILENGTH,ILOOP,IMON,ISEC,ISEED,ISTAT, + IYEAR,IYES,J,LDUM,LUN,LUNIN,LUNOUT,NREC CHARACTER ERRSTR*40,HANDLE* (LSTR),NAME1* (LSTR),NAME2* (LSTR), + ENVNAM* (120),USRNAM* (LSTR),UDATE* (LSTR), + USRTIM* (LSTR),REPLY* (LSTR),TSTNAM*(LSTR),FOO*3 C .. C .. Local Arrays .. REAL BUFFER(LBUF) C .. C .. External Functions .. LOGICAL LITEND,VAXVMS, WINMVS, QISNAN REAL RANU INTEGER CCPNUN EXTERNAL LITEND,VAXVMS, WINMVS, QISNAN, RANU, CCPNUN C .. C .. External Subroutines .. EXTERNAL CCPERR,CCPFYP,NOCRLF,QCLOSE,QMODE,QOPEN,QQINQ,QREAD, + QSEEK,QWRITE,UBYTES,UCPUTM,UGERR,UGTENV,UGTUID, + UIDATE,UISATT,USTIME,UTIME,CCPRCS,CCPDPN, QNAN C .. C .. Intrinsic Functions .. INTRINSIC NINT C .. C .. Data statements .. DATA LUNIN/5/,LUNOUT/6/,NAME1/'AAA.TST'/,NAME2/'ZZZ.TST'/, + ISEED/0/,ILOOP/100/,TSTNAM/'TESTNAME'/ C .. C C---- Initialise CPU timer C SEC = -1.0 CALL UCPUTM(SEC) C C---- Parse command line arguments, open printer stream and print C version C CALL CCPFYP I = 0 CALL CCPDPN(LUNOUT,'PRINTER','PRINTER','F',0,I) IF (I.NE.0) CALL CCPERR(1,'Can''t open printer stream') CALL CCPRCS(6,'TESLIB','$Date$') C C---- Other initialisations C I = 0 CALL CCPDPN(10,NAME1,'NEW','F',0,I) IF (I.NE.0) CALL CCPERR(1,' Failed to open file '//NAME1) WRITE (10,FMT='(A)') ' I am the test file, delete me.' CLOSE (10,STATUS='DELETE') C C---- Start of Tests C WRITE (LUNOUT,FMT=6000) ' Routine Result Comments' C C---- UGTENV C CALL UGTENV('TESTENV',ENVNAM) WRITE (LUNOUT,FMT=6002) ' UGTENV',ENVNAM(1:12), . 'Get value of TESTENV' C C---- UGTUID C CALL UGTUID(USRNAM) WRITE (LUNOUT,FMT=6002) ' UGTUID',USRNAM,'Get Users name' C C---- UIDATE C CALL UIDATE(IMON,IDAY,IYEAR) WRITE (UDATE,FMT=6006) IDAY,IMON,IYEAR WRITE (LUNOUT,FMT=6002) ' UIDATE',UDATE,'Todays date' C C---- UTIME C CALL UTIME(USRTIM) WRITE (LUNOUT,FMT=6002) ' UTIME ',USRTIM,'Current time' C C---- USTIME C CALL USTIME(ISEC) WRITE (UDATE,FMT=6020) ISEC WRITE (LUNOUT,FMT=6002) ' USTIME',UDATE,'Absolute time (VMS=-1)' C C---- UISATT C CALL UISATT(LUNOUT,IYES) IF (IYES.EQ.0) THEN REPLY = 'No' ELSE WRITE (REPLY,FMT=6004) 'Yes, ',LUNOUT END IF WRITE (LUNOUT,FMT=6002) ' UISATT',REPLY, + 'are we attached to at tty? Unit number?' C C---- VAXVMS C REPLY = 'No' IF (VAXVMS()) REPLY = 'Yes' WRITE (LUNOUT,FMT=6002) ' VAXVMS',REPLY,'Is this VMS?' C C---- WINMVS C REPLY = 'No' IF (WINMVS()) REPLY = 'Yes' WRITE (LUNOUT,FMT=6002) ' WINMVS',REPLY,'Is this Win NT et al?' C C---- UBYTES C CALL UBYTES(IBYTE,HANDLE) WRITE (REPLY,FMT=6008) HANDLE,IBYTE WRITE (LUNOUT,FMT=6002) ' UBYTES',REPLY, + 'Get BYTE/WORD Handling and number of bytes per word' C C---- LITEND C REPLY = 'Big' IF (LITEND(IDUM)) REPLY = 'Little' WRITE (LUNOUT,FMT=6002) ' LITEND',REPLY,'Big/Little end machine' CCCC CCCC---- URENAM CCCC CCC CALL URENAM(NAME1,NAME2,ISTAT) CCC ERRSTR = 'OK' CCC IF (ISTAT.NE.0) CALL UGERR(ISTAT,ERSTR) CCC WRITE (LUNOUT,FMT=6002) ' URENAM',ERRSTR,'Check rename status' CCC CALL CUNLINK (NAME2) C C---- UGERR C OPEN (21,FILE='TESTFILE',STATUS='OLD',IOSTAT=I) CALL UGERR(I,ERRSTR) WRITE (REPLY,FMT=6020) I WRITE (LUNOUT,FMT=6002) ' UGERR ',REPLY,ERRSTR C C---- UCPUTM C SEC = 99.99 CALL UCPUTM(SEC) WRITE (REPLY,FMT=6016) SEC WRITE (LUNOUT,FMT=6002) ' UCPUTM',REPLY,'Show elapsed CPU time' C C---- NOCRLF C CALL NOCRLF('NOCRLF') WRITE(LUNOUT,'(''+'',14X,A)') 'Should be on same line' C C --- CCPNUN C I = CCPNUN () WRITE (REPLY,FMT=6020) I WRITE (LUNOUT,FMT=6002) ' CCPNUN',REPLY,'Next free unit' C C --- QNAN/QISNAN (`magic numbers') C CALL QNAN (NAN) IF ((.NOT.QISNAN (NAN)) .OR. QISNAN (1.0)) THEN WRITE (LUNOUT,'(/'' *** QNAN/QISNAN test failed''/)') ELSE WRITE (LUNOUT,'('' QNAN/QISNAN test OK'')') ENDIF C C---- End of tests C WRITE (LUNOUT,FMT=6000) ' Now test diskio routines' C C---- Now test the diskio stuff C CALL QOPEN(LUN,'DISKIO','UNKNOWN') CALL QMODE(LUN,2,LDUM) C C---- Write a file of size LBUF x LBUF x WORDSIZE C DO 20 I = 1,LBUF DO 10 J = 1,LBUF 10 BUFFER(J) = 0. BUFFER(I) = I CALL QWRITE(LUN,BUFFER,LBUF) 20 CONTINUE C C---- Close the file C CALL QCLOSE(LUN) C C---- reset the array buffer(*) C DO 30 I = 1,LBUF BUFFER(I) = 0.0 30 CONTINUE C C---- Now do some reads on the file just created C CALL QOPEN(LUN,'DISKIO','OLD') CALL QMODE(LUN,2,LDUM) C C---- test file size C CALL QQINQ(LUN,'DISKIO',REPLY,ILENGTH) ISTAT = LDUM*LBUF*LBUF WRITE (6,'(A,2(I8,A)//)') &' DISKIO should be',ISTAT,' bytes; is',ILENGTH,' bytes.' IF (ILENGTH.NE.ISTAT) CALL CCPERR(1, '*** FILE SIZE ERROR ***') C C---- Seed random Number Generator C REPLY = ' ' CALL UGTENV('SEED',REPLY) IF (REPLY.NE.' ') READ (REPLY,*) ISEED C C---- Get number of reads to perform C CALL UGTENV('READS',REPLY) IF (REPLY.NE.' ') READ (REPLY,*) ILOOP C C---- Do random reads & writes on the file C CALL UGTENV('NUMRECORD',ENVNAM) IF (ENVNAM.EQ.' ') THEN DO 40 I = 1,ILOOP NREC = NINT(100.*RANU(ISEED) + 1.) IF (NREC.LE.0 .OR. NREC.GT.LBUF) & CALL CCPERR(1,'*** RECORD ERROR ***') CALL QSEEK(LUN,NREC,1,LBUF) IF (RANU(ISEED).LT..5) THEN CALL QREAD(LUN,BUFFER,LBUF,IER) WRITE (LUNOUT,FMT=6014) NREC,BUFFER(NREC),IER IF (BUFFER(NREC).NE.NREC) & CALL CCPERR(1,'*** VERIFY ERROR ***') ELSE DO 70 J = 1,LBUF 70 BUFFER(J) = 0. BUFFER(NREC) = NREC CALL QWRITE(LUN,BUFFER,LBUF) WRITE (LUNOUT,FMT=6015) NREC,BUFFER(NREC) ENDIF 40 CONTINUE ELSE 50 CONTINUE CALL NOCRLF('Record to seek (-ve to write, Ctrl/Z to stop)> ') READ (LUNIN,6020,END=60) NREC I=IABS(NREC) IF (I.EQ.0 .OR. I.GT.LBUF) THEN WRITE (LUNOUT,*) '*** RECORD ERROR ***' GOTO 50 ENDIF CALL QSEEK(LUN,I,1,LBUF) IF (NREC.GT.0) THEN CALL QREAD(LUN,BUFFER,LBUF,IER) WRITE (LUNOUT,FMT=6014) NREC,BUFFER(NREC),IER IF (BUFFER(NREC).NE.NREC) & WRITE (LUNOUT,*) '*** VERIFY ERROR ***' ELSE DO 80 J = 1,LBUF 80 BUFFER(J) = 0. BUFFER(I) = I CALL QWRITE(LUN,BUFFER,LBUF) WRITE (LUNOUT,FMT=6015) I,BUFFER(I) ENDIF GOTO 50 ENDIF 60 CALL QCLOSE (LUN) CALL CUNLINK ('DISKIO') C Now check we can open and close a scratch file CALL QOPEN (LUN, 'foo.bar', 'SCRATCH') CALL QCLOSE (LUN) C and can we rewind a scratch file? (make sure something's been C written to it first) I = 0 CALL CCPDPN (LUN,'FOOEY','SCRATCH','F',0,I) WRITE (LUN,'(A)') 'foo' REWIND (LUN,ERR=170) READ (LUN,'(A)') FOO WRITE (LUNOUT, *) 'contents of temp file: ', FOO CALL CCPERR(0,'Normal Termination') 170 CALL CCPERR (1,'Can''t rewind scratch file') 90 CALL CCPERR(1,'*** EOF ERROR ***') C C---- Format Statements C 6000 FORMAT (//A,/) 6002 FORMAT (A7,3X,A12,A) 6004 FORMAT (A,I3) 6006 FORMAT (I2.2,'/',I2.2,'/',I4) 6008 FORMAT (A5,I3) 6014 FORMAT (' Seek Record:',I5,' Read: ',F8.2,' Status: ',I4) 6015 FORMAT (' Seek Record:',I5,' Write: ',F8.2) 6016 FORMAT (F8.2) 6020 FORMAT (I10) END C C REAL FUNCTION RANU(K) C==== UNIFORM PSEUDO-RANDOM NUMBER IN THE RANGE >= 0 AND < 1. C C Set the seed K zero or negative to start or restart the sequence. C K must be a variable since a new value is returned each time. C IMPLICIT NONE INTEGER M, IA, IC REAL RM PARAMETER (M=714025, IA=1366, IC=150889, RM=1./M) INTEGER J, K, IY, IR(97) LOGICAL FF SAVE IY, IR, FF DATA FF /.TRUE./ C IF (K.LE.0 .OR. FF) THEN FF = .FALSE. K = MOD(IC-K,M) DO 11 J = 1, 97 K = MOD(IA*K + IC, M) 11 IR(J) = K K = MOD(IA*K + IC, M) IY = K ENDIF C J = 1 + 97*IY/M IY = IR(J) RANU = IY*RM K = MOD(IA*K + IC, M) IR(J) = K END libccp4-8.0.0/fortran/unix.m40000644000000000000000000007343714242731033014102 0ustar 00000000000000C C unix.m4: Unix-specific low-level Fortran functions C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C dnl -*-fortran-*- C C dnl *** This file is meant to be processed by m4 with an appropriate dnl definition for the system type to produce Unix.f. dnl Be very careful about changing the m4-isms -- it's particularly easy dnl to introduce spurious spaces. It would be less fragile with cpp, but dnl we can't rely on being able to find it and use it with Fortran. dnl dnl Be careful about declaring system library routines either external or dnl intrinsic -- it's probably better to leave them undeclared and let the dnl compiler sort it out since this behaviour may (does?) differ. dnl dnl $Id$ dnl changequote([,])dnl * use [] as quotes rather than `' dnl dnl * units for record lengths: ifelse(_sgi,1, [ifelse(_f90,1,[define(_ubytes,'BYTES')],[define(_ubytes,'WORDS')])], dnl Changed in `DEC fortran' as opposed to (old) MIPS compiler on Ultrix: _dec_fortran,1, [define(_ubytes,'WORDS')], [define(_ubytes,'BYTES')])dnl dnl BYTE definition ifelse(_f90,1, [define(_byte,INTEGER*1)], [define(_byte,BYTE)]) dnl dnl * fortran compiler may or may not accept READONLY specifier on OPEN. dnl specifying it might catch the occasional bug. ifelse( _convex,1, [define(_readonly,[,READONLY])], _sgi,1, [ifelse(_f90,1,[define(_readonly,[])],[define(_readonly,[,READONLY])])], _pgf,1, [define(_readonly,[,READONLY])], _ifc,1, [define(_readonly,[,READONLY])], dnl * in Dec Fortran V3.0-2, at least, this seems to be *necessary*: _dec_fortran,1, [define(_readonly,[,READONLY])], [define(_readonly,)])dnl dnl dnl * fortran compiler may or may not accept CARRIAGECONTROL specifier on OPEN: ifelse( _convex,1, [define(_carriagecontrol,[,CARRIAGECONTROL=CCNTRL])], _sgi,1, [ifelse(_f90,1,[define(_carriagecontrol,[])],[define(_carriagecontrol,[,CARRIAGECONTROL=CCNTRL])])], _lf95,1, [define(_carriagecontrol,[,CARRIAGECONTROL=CCNTRL])], [define(_carriagecontrol,)])dnl dnl dnl * sometimes we can use IOINIT to specify carriagecontrol: ifelse(_sun,1, [undefine(_has_carriagecontrol)define(_ioinit,1)])dnl dnl dnl * In some cases we can't unlink scratch files in case they're rewond dnl since REWIND is implemented as close + open. Maybe a better solution dnl would use a routine doing a rewind instead of REWIND on scratch files. dnl There does *not* seem to be a problem with the following systems: dnl irix (4.0.5) (but see below), osf/1 (1.3), dnl aix (2.3?), HPUX (9.01), SunOS (4.1.3/SunPro 2.0.1) dnl I'm inclined to think _cant_unlink should be the default now... ifelse(_convex,1, [define(_cant_unlink,1)],dnl OS 10, at least _AIX,1, [define(_cant_unlink,1)],dnl _irix51,1, [define(_cant_unlink,1)],dnl necessary in irix 5.1 up dnl I thought _cant_unlink wasn't necessary for libf2c, but it certainly dnl seems to be now (Irix5). I wonder if this is somehow to do dnl with stdio rather than the fortran library itself... _f2c,1, [define(_cant_unlink,1)],dnl _g77,1, [define(_cant_unlink,1)],dnl _gfort,1, [define(_cant_unlink,1)],dnl _lf95,1, [define(_cant_unlink,1)],dnl _windows,1, [define(_cant_unlink,1)],dnl _pgf,1, [define(_cant_unlink,1)])dnl dnl * In the case above, we then want to open STATUS='DELETE', if dnl supported. Note the file will still be left around if the program dnl crashes. Irix (f77 3.4.4) tolerates the unlink but re-instates dnl the file when you try to do anything with it... ifelse(_convex,1, [define(_dispose,[,DISPOSE=DISP])], _sgi,1, [ifelse(_f90,1,[define(_dispose,[])],[define(_dispose,[,DISPOSE=DISP])])], [define(_dispose,)])dnl dnl C *** this file was automatically generated by configure C *** edit by hand only in extremis C C ======== C UNIX.FOR C ======== C C Subroutines: C C CCPOPN - open a file C UBYTES - Returns number of bytes per word and 'words'/'bytes' C to indicate if byte handling is available C UGERR - Get error explanation C UGTENV - Get value of env. variable C UGTUID - Get user id - it's name C UISATT - Is file a terminal? C CCPSPW - Spawns a new process to run shell command C CEXIT - Trivial interface to system dependent EXIT routine C TTSEND - Write string to terminal with various carriage control C options C UGTARG - Get command-line argument C hciftime - Time in cif format C ccp4_fflush_stdout - Flush buffers to stdout C C Functions: C C VAXVMS - Logical function returns TRUE if VAX/VMS C WINMVS - Logical function returns TRUE if Windows C RTNBKS - Returns backslash for Windows. C SUBROUTINE CCPOPN(IIUN,LOGNAM,KSTAT,ITYPE,LREC,IFAIL) C ==================================================== C C---- This subroutine is used to open a file C C The requirement to specify that leading carriage control C characters in the output records should be obeyed (or not) can't C be implemented portably; likewise specifying readonly opening. C Some compilers accept VAXtran `carriagecontrol=' and `readonly' C specifiers; if so we use them. Others have IOINIT, which can be C used to specify the carriage control. The HPUX compiler is said C not to have any means of doing this and AIX seems to be likewise, C sigh; they both seem to obey the normal Unix convention of C printing the format as-is rather than obeying the first character C as carriage control. Concentrix does obey the first column a la C VMS and `traditional' Fortran; the MIPS compilers have a compile C (link?) option to do so. [Unfortunately, carriagecontrol C specification isn't even defined in Fortan90, although C `ACTION="READ"' can be used.] C C PARAMETERS C ========== C C IIUN (I) UNIT NUMBER C LOGNAM (I) LOGICAL FILE NAME (UP TO 8 CHARACTERS) C KSTAT (I) FILE STATUS FLAG =1, 'UNKNOWN' C =2, 'SCRATCH' C =3, 'OLD' C =4, 'NEW' C =5, 'READONLY' C =6, 'PRINTER' C ITYPE (I) FILE TYPE FLAG =1, 'SEQUENTIAL' 'FORMATTED' C =2, 'SEQUENTIAL' 'UNFORMATTED' C =3, 'DIRECT' 'FORMATTED' C =4, 'DIRECT' 'UNFORMATTED' C LREC (I) RECORD LENGTH FOR DIRECT ACCESS FILE (NO. OF C CHARACTERS FOR A FORMATTED FILE OR WORDS FOR C AN UNFORMATTED FILE). NOT RELEVANT FOR A SEQUENTIAL C FILE C IFAIL (I/O) ON INPUT: =0, STOP ON OPEN FAILURE C =1, CONTINUE AFTER OPEN FAILURE C =2, CONTINUE SILENTLY AFTER OPEN FAILURE C ON OUTPUT: UNCHANGED IF FILE OPEN OK C =-1, ERROR IN OPENING FILE C C .. Scalar Arguments .. INTEGER IFAIL,KSTAT,ITYPE,IIUN,LREC CHARACTER LOGNAM* (*) C .. C .. Local Scalars .. INTEGER LLREC,IUN,IBYTES,ISTAT,L,IOS CHARACTER CCNTRL*7,ST*7,FRM*12,ERRSTR*500, + NAMFIL*255,HANDLE*5,OPNVAR*20, access*10 INTEGER UNKNWN, SCRTCH, OLD, NEW, RDONLY, PRINTR PARAMETER (UNKNWN=1, SCRTCH=2, OLD=3, NEW=4, RDONLY=5, PRINTR=6) ifdef(_ioinit,[ LOGICAL JUNK])dnl C .. C .. Local Arrays .. CHARACTER STAT(6)*7, DISP*6 C .. C .. External Functions .. INTEGER LENSTR ifdef(_ioinit,[ LOGICAL IOINIT])dnl EXTERNAL LENSTR C .. C .. External Subroutines .. EXTERNAL UGERR,UGTENV C .. C .. Data statements .. C NB mustn't have SCRATCH in here, because result is system C -dependent DATA STAT/'UNKNOWN','UNKNOWN','OLD','NEW','OLD','UNKNOWN'/ C .. C ISTAT = KSTAT C Negative unit number means don't give messages for successful open IUN = IIUN IF (IIUN.LT.0) IUN = -IIUN C Check args: IF (ISTAT.LT.1 .OR. ISTAT.GT.6 .OR. ITYPE.LT.1 .OR. ITYPE.GT.4) + THEN IF (IFAIL.EQ.0) THEN CALL CCPERR(1, + '**CCPOPN ERROR** Invalid parameters in call') ELSE WRITE (6, + '('' **CCPOPN ERROR** Invalid parameters in call'',/)') IFAIL = -1 END IF RETURN ENDIF C C Do nothing for pre-connected units (what's the significance of C `TERM...'?) IF (LOGNAM.EQ.'DATA' .OR. LOGNAM.EQ.'PRINTER' .OR. $ LOGNAM(:4).EQ.'TERM') RETURN C C if environment variable CCP4_OPEN has value `UNKNOWN', open files C with status UNKNOWN rather than new if they exist IF (ISTAT.EQ.NEW) THEN OPNVAR = ' ' CALL UGTENV('CCP4_OPEN',OPNVAR) IF (OPNVAR.EQ.'UNKNOWN' .OR. OPNVAR.EQ.'unknown') ISTAT = 1 END IF C C check for `logical name' referencing real file NAMFIL = ' ' CALL UGTENV(LOGNAM,NAMFIL) IF (NAMFIL.EQ.' ') NAMFIL = LOGNAM C check for blank filename IF (NAMFIL.EQ.' ') THEN WRITE (ERRSTR,FMT=6001) IUN 6001 FORMAT (' Open failed on unit ',I4, + ': CCPOPN has received a blank filename.') CALL CCPERR(1, ERRSTR) ENDIF C VMS null device (VMS code canonicalises /dev/null) IF (NAMFIL.EQ.'NL:' .OR. NAMFIL.EQ.'nl:') NAMFIL='/dev/null' C Special case: /dev/null should be opened UNKNOWN IF ( NAMFIL.EQ.'/dev/null') ISTAT = 1 C C type of open ST = STAT(ISTAT) IF (ITYPE.EQ.2 .OR. ITYPE.EQ.4) THEN FRM = 'UNFORMATTED' ELSE FRM = 'FORMATTED' ENDIF IF (ITYPE .EQ. 1 .OR. ITYPE.EQ.2) THEN ACCESS='SEQUENTIAL' ELSE ACCESS='DIRECT' ENDIF C IF (ISTAT.EQ.SCRTCH) THEN DISP = 'DELETE' ELSE DISP = 'KEEP' ENDIF C IF (access.eq.'DIRECT') THEN C Need to check is record length in words or bytes and set LLREC C accordingly. CALL UBYTES (IBYTES,HANDLE) LLREC = LREC*IBYTES IF (HANDLE.EQ.'WORDS'.AND.ITYPE.EQ.4) LLREC=LLREC/IBYTES IF (ISTAT.EQ.RDONLY) THEN C _readonly may be defined as null or as `READONLY,' OPEN(UNIT=IUN,STATUS='UNKNOWN',ACCESS='DIRECT',FORM=FRM + _readonly + ,FILE=NAMFIL,RECL=LLREC,IOSTAT=IOS,ERR=5) ELSE OPEN(UNIT=IUN,STATUS='UNKNOWN',ACCESS='DIRECT',FORM=FRM + _dispose + ,FILE=NAMFIL,RECL=LLREC,IOSTAT=IOS,ERR=5) ENDIF ELSE C if available, carriagecontrol='fortran' for print file, else = C 'list'. we can use ioinit instead where it's available (see e.g. C Sun manual). IF (ISTAT.EQ.PRINTR) THEN C want to obey format characters in column 1 CCNTRL = 'FORTRAN' FRM = 'FORMATTED' ifdef(_ioinit, [ JUNK = IOINIT(.TRUE., .FALSE., .FALSE., ' ' , .FALSE.) ])dnl ELSE C no special significance to column 1 CCNTRL = 'LIST' ifdef(_ioinit, [ JUNK = IOINIT(.FALSE., .FALSE., .FALSE., ' ' , .FALSE.) ])dnl END IF IF (FRM .EQ. 'UNFORMATTED') THEN C (carriage control not relevant) IF (ISTAT.EQ.RDONLY) THEN OPEN(UNIT=IUN, FILE=NAMFIL, STATUS=ST, ACCESS='SEQUENTIAL' + _readonly + ,FORM=FRM, ERR=5, IOSTAT=IOS) ELSE OPEN(UNIT=IUN, FILE=NAMFIL, STATUS=ST, ACCESS='SEQUENTIAL' + _dispose + ,FORM=FRM, ERR=5, IOSTAT=IOS) ENDIF ELSE IF (ISTAT.EQ.RDONLY) THEN OPEN(UNIT=IUN, FILE=NAMFIL, STATUS=ST, ACCESS='SEQUENTIAL' + _readonly + _carriagecontrol + ,FORM=FRM, ERR=5, IOSTAT=IOS) ELSE OPEN(UNIT=IUN, FILE=NAMFIL, STATUS=ST, ACCESS='SEQUENTIAL' + _carriagecontrol + _dispose + ,FORM=FRM, ERR=5, IOSTAT=IOS) ENDIF ENDIF ENDIF C C Scratch files are immediately unlinked from the directory; they C become inaccessible only when closed, but don't appear in the C directory and the name can be re-used. C NB this may break with REWIND if that is implemented as close + C reopen, sigh. See also _dispose above ifelse(_cant_unlink,1,,[ IF (ISTAT.EQ.SCRTCH) CALL CUNLINK (NAMFIL)] )dnl C C Error check 5 CONTINUE C don't report UNKNOWN if actually SCRATCH IF (ISTAT.EQ.SCRTCH) ST = 'SCRATCH' IF (IOS.NE.0) THEN CALL UGERR(IOS,ERRSTR) IF (IFAIL.EQ.0) THEN C hard failure WRITE (6,FMT=6002) IUN, NAMFIL(1:LENSTR(NAMFIL)), + LOGNAM(1:LENSTR(LOGNAM)) 6002 FORMAT (' Open failed: Unit:',I4,', File: ',A, ' (logical: ', + A, ')') ERRSTR = ' Open failed: File: ' // NAMFIL CALL CCPERR(-1, ERRSTR) else C soft failure IF (IFAIL.EQ.1) WRITE (6,FMT=6004) FRM, ST, IUN, + LOGNAM(1:LENSTR(LOGNAM)), NAMFIL(1:LENSTR(NAMFIL)), + ERRSTR(1:LENSTR(ERRSTR)) 6004 FORMAT (' **CCPOPN ERROR** ',A,3X,A, + ' file open failure on unit ',I3,/' Logical name: ', + A,', ','File name: ',A/1X,A/) IFAIL = -1 RETURN ENDIF ELSE IF (IIUN.LE.0) RETURN WRITE (ERRSTR,FMT=6000) FRM,ST,IUN CALL QPRINT (1, ' ') CALL QPRINT (1, ERRSTR) call ccp4h_summary_beg() ERRSTR = 'Logical name: ' ERRSTR (15:) = LOGNAM L = MIN(LENSTR (ERRSTR) + 1, LEN (ERRSTR)) ERRSTR (L:) = ', Filename: ' // NAMFIL CALL QPRINT (1, ERRSTR) call ccp4h_summary_end() CALL QPRINT (1, ' ') 6000 FORMAT (A,3X,A,' file opened on unit ',I3) ENDIF END C C ========================= LOGICAL FUNCTION VAXVMS() C ========================= C C VAXVMS - Operating Sytem in use returns .TRUE. if VAXVMS C C Input: none C C Returns: .TRUE. for VAXVMS, .FALSE. otherwise C C Arguments: none C C Usage: VAXVMS () C VAXVMS = .FALSE. C END C C ========================= LOGICAL FUNCTION WINMVS() C ========================= C C WINMVS - Windows mircrosoft Visual Studio C C Input: none C C Returns: .TRUE. for WINMVS, .FALSE. otherwise C C Arguments: none C C Usage: WINMVS () C ifelse(_windows,1, [ WINMVS = .TRUE.], [ WINMVS = .FALSE.]) C END C ========================= CHARACTER FUNCTION RTNBKS() C ========================= C C RTNBKS - Returns a Backslash for nt as Unix compilers are fussy! C C Input: none C C Returns: \ if WIN32 or not if Unix or vms C C Arguments: none C C Usage: RTNBKS () C ifelse(_windows,1, [ RTNBKS='\'], [ RTNBKS=' ']) C END C ============================== SUBROUTINE UBYTES(INUM,STRING) C ============================== C C UBYTES - Return statistics about byte handling C C Input: none C C Output: INUM - number of bytes per word C HANDLE - 'WORDS' or 'BYTES' C HANDLE - For unformatted files records are usually C counted in 'BYTES', however both VAX and C SGI swap to 'WORDS' for this file type. C C Arguments: INTEGER INUM C CHARACTER*5 HANDLE C C Usage: CALL UBYTES (INUM,HANDLE) C C .. Scalar Arguments .. INTEGER INUM CHARACTER STRING*5 C .. C C INUM = 4 STRING = _ubytes C END C C =============================== SUBROUTINE UGERR(STATUS,ERRSTR) C =============================== C C UGERR - Get error message string for error number in STATUS C (supposedly). Actually it ignores STATUS and always uses the C *last* error that occurred. C C Input: STATUS - Error number (if negative print error message) C C Output: ERRSTR - Error message string C C Arguments: INTEGER STATUS C CHARACTER*(*) ERRSTR C C Usage: CALL UGERR(STATUS, ERRSTR) C ifelse(_ifc,8, [ USE IFPORT USE IFCORE]) C C .. Scalar Arguments .. INTEGER STATUS CHARACTER ERRSTR* (*) C .. C .. Local Scalars .. LOGICAL IPRINT C .. C .. External Subroutines .. ifelse(_ifc,8,, _gfort,1, [ INTEGER IERRNO EXTERNAL GFORTRAN_IERRNO,GFORTRAN_GERROR], [ INTEGER IERRNO EXTERNAL IERRNO,GERROR]) C .. IPRINT = .FALSE. IF (STATUS.LT.0) THEN IPRINT = .TRUE. STATUS = -STATUS END IF C C---- Get error message from system C IF (IERRNO().NE.0) THEN CALL GERROR(ERRSTR) ELSE ERRSTR = ' ' ENDIF IF (IPRINT) WRITE (6,FMT=6000) 'UGERR',ERRSTR C 6000 FORMAT (' ',A,': ',A) END C C ================================ SUBROUTINE UGTENV(NAMENV,VALENV) C ================================ C C UGTENV - Get value of env. variable C C Input: NAMENV - Logical Name (trailing blanks are stripped) C C Output: VALENV - Its value C C Arguments: CHARACTER*(*) NAMENV, VALENV C C Usage: CALL UGTENV(NAMENV, VALENV) C C .. Scalar Arguments .. CHARACTER NAMENV* (*),VALENV* (*) C .. C .. External Subroutines .. C don't declare getenv INTEGER LENSTR EXTERNAL LENSTR C .. CALL GETENV(NAMENV(:LENSTR(NAMENV)),VALENV) C END C C ========================= SUBROUTINE UGTUID(USRNAM) C ========================= C C UGTUID - Get user ID C C Input: none C C Output: UID - user ID string C C Arguments: CHARACTER*(*) UID C C Usage: CALL UGTUID(UID) C C .. Scalar Arguments .. CHARACTER USRNAM* (*) C .. C .. External Subroutines .. C don't declare getenv C .. CALL GETENV('USER',USRNAM) IF (USRNAM.EQ.' ') CALL GETENV('LOGNAME',USRNAM) C END C C ============================== SUBROUTINE UISATT(FLUN,ANSWER) C ============================== C C UISATT - This function determines whether a program is being C run on-line if this information is available. C C Input: FLUN - Fortran Unit Number C C Output: ANS - 1 for on-line, 0 otherwise C C Arguments: INTEGER FLUN, ANS C C Usage: CALL UISATT (FLUN,ANS) C ifelse(_ifc,8, [ USE IFPORT]) C .. Scalar Arguments .. INTEGER ANSWER,FLUN C .. dnl there doesn't seem to be an AIX hook to translate between dnl fortran units and Unix stream numbers ifelse(_AIX,1, [ INTEGER IFLUN INTEGER ISATTY EXTERNAL ISATTY ANSWER = 0 IFLUN = FLUN IF (FLUN.EQ.5) THEN IFLUN = 0 ELSE IF (FLUN.EQ.6) THEN IFLUN = 1 ELSE CALL CCPERR(1,'Unit number other than 5 or 6 used with'// + 'UISATT or ISATTY (AIX restriction)') ENDIF IF (ISATTY(%VAL(IFLUN)).EQ.1) ANSWER = 1], _hpux,1, [ INTEGER ISATTY EXTERNAL ISATTY ANSWER = 0 IF (ISATTY(%VAL(FNUM(FLUN))) .EQ.1) ANSWER = 1], _sun,1, [ INTEGER ISATTY,GETFD EXTERNAL ISATTY,GETFD ANSWER = 0 IF (ISATTY(GETFD(FLUN)) .EQ. 1) ANSWER = 1], _xlf,1, [ INTEGER ISATTY INTEGER(4) GETFD,IFLUN INTRINSIC GETFD EXTERNAL ISATTY IFLUN = FLUN ANSWER = 0 IF (ISATTY(GETFD(IFLUN)) .EQ. 1) ANSWER = 1], _gfort,1, [ LOGICAL ISATTY ANSWER = 0 IF (ISATTY(FLUN)) ANSWER = 1], _ifc,8, [ ANSWER = 0 IF (ISATTY(FLUN)) ANSWER = 1], dnl (else) [ LOGICAL ISATTY EXTERNAL ISATTY ANSWER = 0 IF (ISATTY(FLUN)) ANSWER = 1]) C END C C_BEGIN_CCPSPW SUBROUTINE CCPSPW(STRING) C ========================= C C Spawns a new process to run shell command C C Arguments: C ========== C C STRING (I) CHARACTER*(*): string containing command C_END_CCPSPW C CHARACTER STRING*(*) EXTERNAL SYSTEM CALL SYSTEM(STATUS, STRING) END C SUBROUTINE CEXIT (ICODE) C trivial interface to system-dependent EXIT routine INTEGER ICODE dnl * for AIX we need an underscore to get the fortran-callable one dnl according to an item on the net, but that doesn't work in xlf with dnl AIX 2.3. The EXIT here does seem to be a Fortran one which dnl flushes the o/p buffers. This may be different in more recent dnl versions where the exit here might end up calling the libc one. ifelse(_AIX,1, [ CALL EXIT (%VAL(ICODE)) ], _hpux,1, [C The HP-UX fortran manual implies CALL EXIT flushes buffers C but it seems not to. This works in HP-UX A.09.01. CALL F77EXIT (ICODE) ], [ CALL EXIT (ICODE) ])dnl END C C SUBROUTINE 'TTSEND' C =================== C C Write a string to a terminal with various carriage control options C [for LAUE] C SUBROUTINE TTSEND (IUN, STR, ICC) C C Parameters: C C IUN (I) Unit number for the output C STR (I) The string to be output C ICC (I) = 0, no carriage control at the end of the string C (for prompts) C e.g. for routine TPROMP C = 1, normal carriage control C e.g. for routine TWRITE C = 2, no carriage control (for sending escape/control C character sequences to ANSI/T4014 terminals) C e.g. for QSCREEN graphics routines C = 3, Output line at current point on screen (no leading C line feed or carriage return - trailing does not C matter) C C Machine dependence examples: Convex 1000 FORMAT (A,$) C 1001 FORMAT (A) C 1002 FORMAT (A,$) C 1003 FORMAT (A) C C Vax 1000 FORMAT (' ',A,$) C 1001 FORMAT (' ',A) C 1002 FORMAT ('+',A,$) C 1003 FORMAT ('+',A) C C C====== Specification statements C CHARACTER*(*) STR CHARACTER*10 CCNTRL INTEGER IUN,ICC C C====== Write string C C 'LIST' is the equivalent of the normal Unix state CCNTRL = 'LIST' ifdef(_carriagecontrol,[], [ INQUIRE(IUN _carriagecontrol)] )dnl C in the case of systems obeying the carriagecontrol specifier, C we assume the stream has actually been opened, so that the C specifier is suitably defined -- on the Alliant, for instance, C it will be 'UNKNOWN' for an unopened stream (6 is pre-opened) C IF (CCNTRL .EQ. 'FORTRAN') THEN C VMS-type IF (ICC.EQ.0) THEN WRITE (IUN,1004) STR ELSE IF (ICC.EQ.2) THEN WRITE (IUN,1006) STR ELSE IF (ICC.EQ.3) THEN WRITE (IUN,1007) STR ELSE WRITE (IUN,1005) STR ENDIF ELSE IF (ICC.EQ.0) THEN WRITE (IUN,1000) STR ELSE IF (ICC.EQ.2) THEN WRITE (IUN,1002) STR ELSE IF (ICC.EQ.3) THEN WRITE (IUN,1003) STR ELSE WRITE (IUN,1001) STR ENDIF ENDIF C these formats are mostly non-standard, of course... 1000 FORMAT (A,$) 1001 FORMAT (A) 1002 FORMAT (A,$) 1003 FORMAT (A) 1004 FORMAT (' ',A,$) 1005 FORMAT (' ',A) 1006 FORMAT ('+',A,$) 1007 FORMAT ('+',A) END C SUBROUTINE UGTARG(I, ARG) INTEGER I CHARACTER *(*) ARG ifelse(_hpux,1, [C Maybe HPUX doesn't need to be different here. The Fortran/9000 C Reference says: C 4. GETARG can be accessed only with the C C $HP9000_800 INTRINSICS ON C C compiler directive. GETARG is similar to IGETARG except that C GETARG is called as a subroutine instead of as a function. It C accepts two arguments: n and str. n is an integer specifying C which command-line argument is requested. When n=1, it returns C the program name (unlike IGETARG which returns the program name C when n equals zero). str is a character variable that will C contain the requested command-line argument, padded with blanks on C the end. INTEGER J J = IGETARG(I, ARG, LEN(ARG))], [ CALL GETARG(I, ARG)]) END C c ============================ subroutine hciftime(ciftime) c ============================ ccFrom GERARD@XRAY.BMC.UU.SE Thu Sep 24 00:25:25 1998 c ifelse(_ifc,8, [ USE IFPORT], _xlf,1, [ use xlfutility]) implicit none c character ciftime*(*) c ifelse(_efc,1, [ integer gmt_hour,gmt_minutes,localdaymonth, + localhours,localminutes,localmonth,localseconds, + localyear,nhours,nminutes,diff integer(kind=8) :: stime real(kind=8) :: rtc ], _ifc,8, [ integer gmt_hour,gmt_minutes,localdaymonth, + localhours,localminutes,localmonth,localseconds, + localyear,nhours,nminutes,diff integer(kind=4) :: stime ], _xlf,1, [ integer gmt_hour,gmt_minutes,localdaymonth, + localhours,localminutes,localmonth,localseconds, + localyear,nhours,nminutes,diff integer(kind=TIME_SIZE) :: stime, time ], [ integer gmt_hour,gmt_minutes,localdaymonth, + localhours,localminutes,localmonth,localseconds, + localyear,nhours,nminutes,stime,diff ]) c character gmt_diff*1, timstr*8 c integer gmtarray(9),tarray(9) ifelse(_AIX,1, [ real*8 timef,stimef integer time external time,timef], _xlf,1, , _ifc,8, , [ integer time]) c intrinsic abs c code ... c c ... check if the argument can hold 25 characters c (better to return an error flag, of course ;-) c dnl * len is quoted since also m4 macro if ([len](ciftime) .lt. 25) then write(*,*) 'error --- hciftime: string too short' ciftime = ' ' return end if c ifelse(_ifc,1, [ stime = time(timstr) call gmtime(stime,gmtarray) call ltime(stime,tarray) ], _efc,1, [ stime = int(rtc(), kind=8) call gmtime(stime,gmtarray) call ltime(stime,tarray) ], _ifc,8, [ stime = int(rtc(), kind=8) call gmtime(stime,gmtarray) call ltime(stime,tarray) ], _xlf,1, [ stime = time() call gmtime(stime,gmtarray) call ltime(stime,tarray) ], _AIX,1, [ stime = time() call gmtime(stime,gmtarray) call ltime_(stime,tarray) ], [ stime = time() call gmtime(stime,gmtarray) call ltime(stime,tarray) ]) c nminutes = gmtarray(2) nhours = gmtarray(3) localseconds = tarray(1) localminutes = tarray(2) localhours = tarray(3) localdaymonth = tarray(4) localmonth = tarray(5) + 1 c .. tarray(6) should be years since 1900 so is Y2K-compliant localyear = tarray(6) + 1900 c c ... calculate time difference in minutes (some time zones c differ by N hours + 30 minutes from gmt) c diff = (60*localhours + localminutes) - + (60*nhours + nminutes) c c ... allow for different dates to avoid Kim's midnight bug c (fudge by simply checking if the day of the month is c identical or not; should be okay) c if (diff .lt. 0 .and. tarray(4) .ne. gmtarray(4)) then diff = diff + 24*60 else if (diff .gt. 0 .and. tarray(4) .ne. gmtarray(4)) then diff = diff - 24*60 end if c c ... get hour differences by taking INT(minutes)/60 c since INT(-1.5) would be -2, use ABS and adjust sign c gmt_hour = abs(diff) / 60 if (diff .lt. 0) gmt_hour = - gmt_hour gmt_minutes = diff - 60*gmt_hour if (gmt_hour .lt. 0 .or. gmt_minutes .lt. 0) then gmt_diff = '-' else gmt_diff = '+' end if c write (ciftime,fmt=6000) localyear,localmonth,localdaymonth, + localhours,localminutes,localseconds,gmt_diff,abs(gmt_hour), + abs(gmt_minutes) c c ... NOTE: "i4" in the following format makes that this routine c is not Year-10,000-compliant !!! c 6000 FORMAT (i4,'-',i2.2,'-',i2.2,'T',i2.2,':',i2.2,':',i2.2,a1,i2.2, + ':',i2.2) c return end C subroutine ccp4_fflush_stdout() dnl work around a buglet: : gfortran-4.1.2 glibc-2.7-2 dnl (2.6.23.1-37.fc8 x86_64 SMP) C. Flensburg 20071029. implicit none ifelse(_gfort,1, [ call flush(6) ],dnl (else) [ continue]) end ifelse(_windows,1,[ ifelse(_ifc,8,[ C ======================= SUBROUTINE UTIME(CTIME) C ======================= C C UTIME - Get current time hh:mm:ss C C Input: none C C Output: TIME - as ASCII string C C Arguments: CHARACTER*(*) CTIME C C Usage: CALL UTIME(CTIME) C C .. Scalar Arguments .. CHARACTER CTIME* (*) C .. C .. Local Arrays .. INTEGER IARRAY(3) C .. CALL ITIME(IARRAY) WRITE (CTIME,FMT=6000) IARRAY(1),IARRAY(2),IARRAY(3) 6000 FORMAT (I2,2 (':',I2.2)) END ]) ]) ifelse(_windows,1,[ ifelse(_ifc,8,[ C ====================== SUBROUTINE UCPUTM(SEC) C ====================== C C Get CPU time in seconds C C Parameter: C REAL SEC (i/o): If sec<=0.0, initialize timer and return current C elapsed cpu time since start of execution, otherwise C return elapsed cpu since timer was initialized. C Time is in seconds. C C .. Scalar Arguments .. REAL SEC C .. C .. Local Scalars .. REAL TLAST C .. C .. Local Arrays .. REAL TARRAY(2) C .. C .. Save statement .. SAVE TLAST C .. IF (SEC.LE.0.0) THEN TLAST = ETIME (TARRAY) SEC = TLAST ELSE SEC = ETIME (TARRAY) - TLAST ENDIF END ]) ]) libccp4-8.0.0/fortran/vms.for0000644000000000000000000012622514242731033014164 0ustar 00000000000000C C vms.for C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C C ---------------- vms.for -------------------- C replaces vmssupport.for and is replaced by unix.for C for unix systems. C C $Date$ C C VMS.FOR C ======= C C UGTENV - Get value of env. variable C UGERR - Get error explanation C UGTUID - Get user id - it's name C UIDATE - Get date in 3 integer format C UTIME - Get current time C USTIME - Get absolute time in seconds C UCPUTM - Get CPU time C UISATT - Is file a terminal? C URENAM - Rename file C VAXVMS - Logical function returns TRUE if VAX/VMS C WINMVS - Logical function returns TRUE if windows C UBYTES - Returns number of bytes per word and 'words'/'bytes' C to indicate if byte handling is available C GETPID - Get unique process id. C USTENV - Create logical name. C TTSEND - Write string to terminal with various carriage control options C GETELAPSED - Print timing info for CCPERR C UGTARG - Get command-line argument C GETREF - Abstracted from abscale since it has BYTE declaration. C CCPSPW - Spawns a new process to run DCL command C CCPAL1 - Support for CCPALC interface C CEXIT - Trivial interface to EXIT C C C ================================ SUBROUTINE UGTENV(NAMENV,VALENV) C ================================ C C UGTENV - Get value of env. variable C C Input: NAMENV - Logical Name C C Output: VALENV - It's value C C Arguments: CHARACTER*(*) NAMENV, VALENV C C Usage: CALL UGTENV(NAMENV, VALENV) C CHARACTER*(*) NAMENV,VALENV C INCLUDE '($LNMDEF)' INCLUDE '($SSDEF)' C INTEGER LN,LENGTH INTEGER*4 ITEMLIST(4),SYS$TRNLNM INTEGER*2 NAME_LEN_CODE(2) C C---- Equivalences C EQUIVALENCE (NAME_LEN_CODE(1),ITEMLIST(1)) C VALENV = ' ' LN = LENSTR(NAMENV) IF (LN.LE.0) RETURN C C---- Setup item list for routine C NAME_LEN_CODE(1) = LEN(VALENV) ! Length of buffer NAME_LEN_CODE(2) = LNM$_STRING ! item code for returning equivalence name ITEMLIST(2) = %LOC(VALENV) ! Address to return equivalence name ITEMLIST(3) = %LOC(LENGTH) ! Address to return name length ITEMLIST(4) = 0 ! terminator C C 10 IERR=SYS$TRNLNM(LNM$M_CASE_BLIND,'LNM$DCL_LOGICAL', . NAMENV(1:LN),,ITEMLIST) C END C C C =============================== SUBROUTINE UGERR(STATUS,ERRSTR) C =============================== C C UGERR - Get error message string for error number in status C C Input: STATUS - Error number (if negative then print error message, C if zero, then use last error) C C Output: ERRSTR - Error message string C C Arguments: INTEGER STATUS C CHARACTER*(*) ERRSTR C C Usage: CALL UGERR(STATUS, ERRSTR) C INCLUDE '($SSDEF)' INTEGER STATUS,IPRINT,ISTAT CHARACTER*(*) ERRSTR CHARACTER*100 OUTLIN INTEGER ISTART,IEND,COND,IFLAGS,IRET INTEGER LENSTR EXTERNAL LENSTR C C C---- IFLAGS masks out irrelevant parts if the error message C IFLAGS = 13 C C---- Remember STATUS because a call to ERRSNS destroys it ! C ISTAT = STATUS C C---- Set up print option C IPRINT = 0 IF (ISTAT .LT. 0) THEN IPRINT = 1 ISTAT = -ISTAT ENDIF C C---- Get error message from system C IF (ISTAT.NE.0) THEN CALL ERRSNS (ISTAT,,,,COND) ELSE CALL ERRSNS (,,,,COND) ENDIF C C---- Translate it C IRET = LIB$SYS_GETMSG(COND,ILEN,ERRSTR,IFLAGS) C C---- If not a fortran error then get system error instead C IF (IRET .EQ. SS$_MSGNOTFND) + IRET = LIB$SYS_GETMSG(ISTAT,ILEN,ERRSTR,IFLAGS) C WRITE (6,*) 'UGERR: ',ERRSTR(:LENSTR(ERRSTR)) C C---- Remove rubbish C ISTART = INDEX(ERRSTR,' ') + 1 IEND = ISTART + INDEX(ERRSTR(ISTART:),'!') - 2 IF (IEND.LT.ISTART) IEND = LEN(ERRSTR) ERRSTR = ERRSTR(ISTART:IEND) C C---- Print result if appropriate C IF (IPRINT.EQ.1) THEN WRITE (OUTLIN,100) ISTAT OUTLIN(LENSTR(OUTLIN)+2:) = ERRSTR WRITE(6,FMT='(A)') OUTLIN(1:LENSTR(OUTLIN)) 100 FORMAT (' OS error: ',I5,' Message: ') ENDIF C END C C C =========================== SUBROUTINE UGTUID(USERNAME) C =========================== C C UGTUID - Get user ID C C Input: none C C Output: UID - user ID string C C Arguments: CHARACTER*(*) UID C C Usage: CALL UGTUID(UID) C CHARACTER*(*) USERNAME C INCLUDE '($JPIDEF)' C CALL LIB$GETJPI(JPI$_USERNAME,,,,USERNAME) C END C C C ================================= SUBROUTINE UIDATE(MONTH,DAY,YEAR) C ================================= C C UIDATE - Get date in 3 integer format C C Input: none C C Output: MONTH,DAY,YEAR C C Arguments: INTEGER MONTH, DAY, YEAR C C Usage: CALL UIDATE(MONTH, DAY, YEAR) C INTEGER MONTH,DAY,YEAR C CALL IDATE(MONTH,DAY,YEAR) C END C C C ======================= SUBROUTINE UTIME(CTIME) C ======================= C C UTIME - Get current time as hh:mm:ss C C Input: none C C Output: TIME - as ASCII string C C Arguments: CHARACTER*(*) TIME C C Usage: CALL UTIME(TIME) C CHARACTER*(*) CTIME C CALL TIME(CTIME) C END C C C ============================== SUBROUTINE UISATT(FLUN,ANSWER) C ============================== C C UISATT - This function determines whether a program is being run C on-line if this information is available. C C Input: FLUN - Fortran Unit Number C C Output: ANS - 1 for on-line, 0 otherwise C C Arguments: INTEGER FLUN, ANS C C Usage: CALL UISATT (FLUN,ANS) C INTEGER FLUN,ANSWER INTEGER*2 LENGTH,CODE,ITEMLIST(8),RLN INTEGER BUFADDR,RLNADDR,SYS$GETJPI CHARACTER ERRSTR*100 C C---- Equivalences C EQUIVALENCE (ITEMLIST(1),LENGTH),(ITEMLIST(2),CODE), . (ITEMLIST(3),BUFADDR),(ITEMLIST(5),RLNADDR),(ITEMLIST(7),JEND) INTEGER BUF(5) INCLUDE '($JPIDEF)' C C---- Set up item list C LENGTH=20 ! Length of return buffer in bytes CODE=JPI$_TERMINAL ! Code for information required ( = '31D'X) BUFADDR=%LOC(BUF) ! Address of return buffer RLNADDR=%LOC(RLN) ! Address to receive length of returned JEND=0 ! Terminator of item list I=SYS$GETJPI(,,,%REF(LENGTH),,,) ANSWER = 0 C C---- Set mode. Length of information = 0 if in batch C IF (RLN.NE.0) ANSWER = 1 C END C C C ========================= LOGICAL FUNCTION VAXVMS() C ========================= C C VAXVMS - Operating Sytem in use returns .TRUE. if VAXVMS C C Input: none C C Returns: .TRUE. for VAXVMS, .FALSE. otherwise C C Arguments: none C C Usage: VAXVMS () C VAXVMS = .TRUE. C END C C C ========================= LOGICAL FUNCTION WINMVS() C ========================= C C WINMVS - Windows mircrosoft Visual Studio C C Input: none C C Returns: .TRUE. for WINMVS, .FALSE. otherwise C C Arguments: none C C Usage: WINMVS () C WINMVS = .FALSE. C END C C C =============================== SUBROUTINE UBYTES (INUM,STRING) C =============================== C C UBYTES - Return statistics about byte handling C C Input: none C C Output: INUM - number of bytes per word C HANDLE - 'WORDS' or 'BYTES' C C Arguments: INTEGER INUM C CHARACTER*5 HANDLE C C Usage: CALL UBYTES (INUM,HANDLE) C INTEGER INUM CHARACTER STRING*5 C INUM = 4 STRING = 'WORDS' C END C C C ===================================== SUBROUTINE URENAM(NAME1,NAME2,STATUS) C ===================================== C C URENAM - Rename file assigned to NAME1 to NAME2. C C Input: NAME1, NAME2 the file names C C Output: STATUS =0 if ok <>0 if an error C C Arguments: CHARACTER*(*) NAME1, NAME2 C INTEGER STATUS C C Usage: CALL URENAM (NAME1,NAME2,STATUS) C INCLUDE '($SSDEF)' C INTEGER STATUS CHARACTER*(*) NAME1,NAME2 C C---- Rename file C STATUS = LIB$RENAME_FILE (NAME1,NAME2) IF (STATUS .EQ. SS$_NORMAL) STATUS = 0 C END C C C C ============================== INTEGER FUNCTION IARGC(IDUMMY) C ============================== C C---- Return number of Command line arguments C C .. C .. Scalar Arguments .. INTEGER IDUMMY C .. C .. Scalars in Common .. INTEGER IARG C .. C .. External Subroutines .. EXTERNAL INITFYP C .. C .. Common blocks .. COMMON /ARGCOUNT/IARG C .. C .. Save statement .. SAVE C .. IF (IARG.EQ.-1) CALL INITFYP IARGC = IARG C END C C C C ============================ SUBROUTINE GETARG(INUM,LINE) C ============================ C C---- Get INUM'th command line argument or ' ' into LINE C C .. Parameters .. INTEGER MAXLEN,MAXPAR PARAMETER (MAXLEN=70,MAXPAR=41) C .. C .. Scalar Arguments .. INTEGER INUM CHARACTER LINE* (*) C .. C .. Scalars in Common .. INTEGER IARG C .. C .. Arrays in Common .. CHARACTER ARGNAM* (MAXLEN) C .. C .. External Subroutines .. EXTERNAL INITFYP C .. C .. Common blocks .. COMMON /ARGCOUNT/IARG COMMON /ARGS/ARGNAM(MAXPAR) C .. C .. Save statement .. SAVE C .. IF (IARG.EQ.-1) CALL INITFYP IF (INUM.LT.0 .OR. INUM.GT.IARG) THEN LINE = ' ' ELSE LINE = ARGNAM(INUM + 1) END IF C END C C C C ============================ INTEGER FUNCTION GETPID(IDUMMY) C ============================ C C Get process ID C IMPLICIT NONE INTEGER PID,IDUMMY C INTEGER ISTAT C INTEGER SYS$GETJPI C INCLUDE '($SSDEF)' C PID = 0 ISTAT = SYS$GETJPI(,PID,,0,,,) IF (ISTAT.NE.SS$_NORMAL) CALL LIB$SIGNAL(%VAL(ISTAT)) GETPID = PID C END C C C C =============================== SUBROUTINE USTENV(LINE,IRESULT) C =============================== C C Logical name assignment C LINE is '='. IRESULT.eq.0 iff successful C IMPLICIT NONE INTEGER IRESULT CHARACTER LOGNAM*80,FILNAM*200,LINE*(*) C STRUCTURE /ITMLST/ UNION MAP INTEGER*2 LB,IC INTEGER*4 IA,IR ENDMAP MAP INTEGER*4 IE ENDMAP ENDUNION ENDSTRUCTURE C RECORD /ITMLST/ ITM(2) C INTEGER ISTAT,ILEN C INTEGER LENSTR,SYS$CRELNM C INCLUDE '($SSDEF)' INCLUDE '($LNMDEF)' C IRESULT = 0 ILEN = INDEX(LINE, '=') IF (ILEN.EQ.0) THEN IRESULT = 1 RETURN ENDIF LOGNAM = LINE(1: ILEN - 1) FILNAM = LINE(ILEN + 1:) ITM(1).LB = LENSTR(FILNAM) ITM(1).IC = LNM$_STRING ITM(1).IA = %LOC(FILNAM) ITM(2).IE = 0 ISTAT = SYS$CRELNM(,'LNM$PROCESS',LOGNAM(:LENSTR(LOGNAM)),,ITM) IF (ISTAT.NE.SS$_NORMAL .AND. ISTAT.NE.SS$_SUPERSEDE) IRESULT = 2 C END C C C INTEGER FUNCTION SRTBEG(NKEYS,KEYB,LRECL,MEMSIZE) C ************************************************* IMPLICIT NONE C # of keys, key descriptions, fixed record length, memory (not used) INTEGER NKEYS,KEYB(*),LRECL,MEMSIZE C INTEGER ISTAT,NORMAL,DATASIZ,LUNSTO,LUNOUT,NFILSZ INTEGER I,J,JOLD INTEGER*2 KEYBUF(401) C C .. External Functions .. INTEGER SOR$BEGIN_SORT C C Definition of data type = single-precision floating - only this one C is implemented here EXTERNAL DSC$K_DTYPE_F,LUNSTO C C Things for descriptor of ADATA INTEGER*4 MDATA(2) INTEGER*2 M2DATA(4) EQUIVALENCE (MDATA(1),M2DATA(1)) COMMON /BISRTC/MDATA,NORMAL,DATASIZ,LUNOUT C SAVE KEYBUF C C C---- Set up key buffer for number of keys. A descriptor consists of: C 2-byte length (in bytes) C Each following "block" contains: C 2-byte data type (here real) C 2-byte ascending (0) or descending (1) order C 2-byte relative address of key in record (from 0) C 2-byte key length in bytes C C NORMAL return value from VMS sort subroutines NORMAL = 1 C Length of tada type i.e. 4 for REAL DATASIZ = 4 LUNOUT = LUNSTO(1) KEYBUF(1) = NKEYS DO 10 I = 1,NKEYS J = (I-1)*4 + 2 JOLD = (I-1)*5 + 1 C C---- Sort Data Type C IF (KEYB(JOLD).NE.7) THEN WRITE (LUNOUT,FMT=6010) 6010 FORMAT (' SRTBEG only REAL data type implemented') STOP END IF KEYBUF(J)=%LOC(DSC$K_DTYPE_F) C C---- Sort Order ascending/descending C KEYBUF(J+1) = KEYB(JOLD+1) C C---- position of 1st byte in key C KEYBUF(J+2) = KEYB(JOLD+2) C C---- keylength in BYTES C KEYBUF(J+3) = DATASIZ * KEYB(JOLD+3) IF (KEYB(JOLD+4).NE.0) THEN WRITE (LUNOUT,FMT=6011) 6011 FORMAT(' SRTBEG - on VMS MASK fields must be .EQ. 0') STOP ENDIF 10 CONTINUE C C C Make string descriptors for data record C A descriptor consists of: C 2-byte length (in bytes) C 2-byte class & type (probably not used) C 4-byte address of array C Note MDATA is equivalenced to M2DATA C length of array M2DATA(1)=LRECL C class = 1, type = 0 - never used but must be present M2DATA(2)='100'X C address of array - filled in SRTRLS & SRTRET C C---- Initialise sort, set parameters, etc C C ****************************** NFILSZ = 0 ISTAT = SOR$BEGIN_SORT(KEYBUF,LRECL,,NFILSZ,,,,,) C ****************************** C IF (ISTAT.NE.NORMAL) THEN WRITE (LUNOUT,FMT=6008) ISTAT 6008 FORMAT (' Sort fail : BEGIN, status=',Z9) C CALL LIB$STOP(%VAL(ISTAT)) END IF SRTBEG = 0 RETURN END C C C INTEGER FUNCTION SRTRLS(RECORD) C ******************************* IMPLICIT NONE REAL RECORD(*) C INTEGER ISTAT,NORMAL,DATASIZ,LUNOUT C INTEGER SOR$RELEASE_REC C C MDATA is descriptor (ie indirect address) of RECORD C Things for descriptor of ADATA INTEGER*4 MDATA(2) INTEGER*2 M2DATA(4) EQUIVALENCE (MDATA(1),M2DATA(1)) COMMON /BISRTC/MDATA,NORMAL,DATASIZ,LUNOUT C MDATA(2)=%LOC(RECORD) C ************* ISTAT = SOR$RELEASE_REC(MDATA) C ************* C C IF (ISTAT.EQ.0) THEN IF (ISTAT.EQ.NORMAL) THEN SRTRLS = 0 ELSE WRITE (LUNOUT,FMT=6010) ISTAT 6010 FORMAT (' Sort fail : SRTRLS, status=',Z9) C CALL LIB$STOP(%VAL(ISTAT)) STOP END IF RETURN END C C C INTEGER FUNCTION SRTMRG() C ************************* IMPLICIT NONE C INTEGER ISTAT,NORMAL,DATASIZ,LUNOUT INTEGER SOR$SORT_MERGE C C MDATA is descriptor (ie indirect address) of RECORD C Things for descriptor of ADATA INTEGER*4 MDATA(2) INTEGER*2 M2DATA(4) EQUIVALENCE (MDATA(1),M2DATA(1)) COMMON /BISRTC/MDATA,NORMAL,DATASIZ,LUNOUT C C ******** ISTAT = SOR$SORT_MERGE() C ******** C C IF (ISTAT.NE.0) THEN IF (ISTAT.NE.NORMAL) THEN WRITE (LUNOUT,FMT=6014) ISTAT 6014 FORMAT (' Sort fail : MERGE, status=',Z9) CALL LIB$STOP(%VAL(ISTAT)) STOP ENDIF SRTMRG = 0 RETURN END C C C INTEGER FUNCTION SRTRET(RECORD) C ******************************* IMPLICIT NONE C record array REAL RECORD(*) C INTEGER ISTAT,NORMAL,DATASIZ,LUNOUT C INTEGER SOR$RETURN_REC INTEGER SOR$END_SORT EXTERNAL SS$_ENDOFFILE C NRL not used, but still present (the length, which is already known) INTEGER*2 NRLVMS C C MDATA is descriptor (ie indirect address) of RECORD C Things for descriptor of ADATA INTEGER*4 MDATA(2) INTEGER*2 M2DATA(4) EQUIVALENCE (MDATA(1),M2DATA(1)) COMMON /BISRTC/MDATA,NORMAL,DATASIZ,LUNOUT C C set record address MDATA(2)=%LOC(RECORD) C ************* ISTAT = SOR$RETURN_REC(MDATA,NRLVMS) C ************* C IF (ISTAT.EQ.%LOC(SS$_ENDOFFILE)) THEN ISTAT = SOR$END_SORT() IF(ISTAT.NE.NORMAL) THEN WRITE(6,1005) ISTAT 1005 FORMAT(' Sort fail : END ,status=',Z9) CALL LIB$STOP(%VAL(ISTAT)) ENDIF SRTRET = -1 RETURN ELSE IF (ISTAT.NE.NORMAL) THEN WRITE(6,1006) ISTAT 1006 FORMAT(' Sort fail : RETURN, status=',Z9) CALL LIB$STOP(%VAL(ISTAT)) STOP ENDIF SRTRET = 0 RETURN END C C C SUBROUTINE CCPOPN(IIUN,LOGNAM,KSTAT,ITYPE,LREC,IFAIL) C ==================================================== C C---- This subroutine is used to open a file C C PARAMETERS C ========== C C IIUN (I) UNIT NUMBER C LOGNAM (I) LOGICAL FILE NAME (UP TO 8 CHARACTERS) C KSTAT (I) FILE STATUS FLAG =1, 'UNKNOWN' C =2, 'SCRATCH' C =3, 'OLD' C =4, 'NEW' C =5, 'READONLY' C =6, 'PRINTER' C ITYPE (I) FILE TYPE FLAG =1, 'SEQUENTIAL' 'FORMATTED' C =2, 'SEQUENTIAL' 'UNFORMATTED' C =3, 'DIRECT' 'FORMATTED' C =4, 'DIRECT' 'UNFORMATTED' C LREC (I) RECORD LENGTH FOR DIRECT ACCESS FILE (NO. OF C CHARACTERS FOR A FORMATTED FILE OR WORDS FOR C AN UNFORMATTED FILE). NOT RELEVANT FOR A SEQUENTIAL C FILE C IFAIL (I/O) ON INPUT: =0, STOP ON OPEN FAILURE C =1, CONTINUE AFTER OPEN FAILURE C =2, CONTINUE SILENTLY AFTER OPEN FAILURE C ON OUTPUT: UNCHANGED IF FILE OPEN OK C =-1, ERROR IN OPENING FILE C C .. Scalar Arguments .. INTEGER IFAIL,KSTAT,ITYPE,IIUN,LREC CHARACTER LOGNAM* (*) C .. C .. Local Scalars .. INTEGER LLREC,IUN,IBYTES,ISTAT C ERRSTR should be big enough to hold more than 2 255-long paths CHARACTER CCNTRL*7,ST*7,FRM*12,ERRSTR*600,FULNAM*255, + NAMFIL*255,HANDLE*5,OPNVAR*20, ACCESS*10, DISPOS*6 INTEGER UNKNWN, SCRTCH, OLD, NEW, RDONLY, PRINTR PARAMETER (UNKNWN=1, SCRTCH=2, OLD=3, NEW=4, RDONLY=5, PRINTR=6) LOGICAL LNONAM C .. C .. Local Arrays .. CHARACTER STAT(6)*7, OUTLIN*100 C .. C .. External Functions .. INTEGER LENSTR, LUNSTO LOGICAL VAXVMS,CCPEXS EXTERNAL LENSTR,VAXVMS,LUNSTO,CCPEXS C .. C .. External Subroutines .. EXTERNAL UGERR,UGTENV C .. C .. Data statements .. DATA STAT/'UNKNOWN','SCRATCH','OLD','NEW','OLD','UNKNOWN'/ C .. C ISTAT = KSTAT C Negative unit number means don't give messages for successful open IUN = IIUN IF (IIUN.LT.0) IUN = -IIUN C Check args: IF (ISTAT.LT.1 .OR. ISTAT.GT.6 .OR. ITYPE.LT.1 .OR. ITYPE.GT.4) + THEN IF (IFAIL.EQ.0) THEN CALL CCPERR(LUNSTO (1), + '**CCPOPN ERROR** Invalid parameters in call') ELSE WRITE (LUNSTO (1), + '('' **CCPOPN ERROR** Invalid parameters in call'',/)') IFAIL = -1 END IF RETURN ENDIF C C Do nothing for pre-connected units (what's the significance of C `TERM...'?) IF (LOGNAM.EQ.'DATA' .OR. LOGNAM.EQ.'PRINTER' .OR. $ LOGNAM(:4).EQ.'TERM') RETURN C C if environment variable CCP4_OPEN has value `UNKNOWN', open files C with status UNKNOWN rather than new if they exist IF (ISTAT.EQ.NEW) THEN OPNVAR = ' ' CALL UGTENV('CCP4_OPEN',OPNVAR) IF (OPNVAR.EQ.'UNKNOWN') ISTAT = 1 END IF C C type of open ST = STAT(ISTAT) IF (ITYPE.EQ.2 .OR. ITYPE.EQ.4) THEN FRM = 'UNFORMATTED' ELSE FRM = 'FORMATTED' ENDIF IF (ITYPE .EQ. 1 .OR. ITYPE.EQ.2) THEN ACCESS='SEQUENTIAL' ELSE ACCESS='DIRECT' ENDIF IF (ISTAT.EQ.SCRTCH) THEN C scratch file DISPOS = 'DELETE' ELSE DISPOS = 'KEEP' ENDIF C C check for `logical name' referencing real file CALL UGTENV(LOGNAM,NAMFIL) LNONAM = .FALSE. IF (NAMFIL.EQ.' ') THEN IF (.NOT. CCPEXS(LOGNAM)) LNONAM = .TRUE. NAMFIL = LOGNAM END IF C Unix null device (defined as canonical if programs need it) IF (NAMFIL.EQ.'/dev/null') NAMFIL = 'NL:' C Opening /dev/null is necessary in Unix; not sure if this is needed C but presumably does no harm. IF (NAMFIL.EQ.'NL:') ISTAT = 1 C IF (ACCESS.EQ.'DIRECT') THEN C Need to check is record length in words or bytes and set LLREC C accordingly. CALL UBYTES (IBYTES,HANDLE) LLREC = LREC*IBYTES IF (HANDLE.EQ.'WORDS'.AND.ITYPE.EQ.4) LLREC=LLREC/IBYTES IF (ISTAT.EQ.RDONLY) THEN C READONLY, may be defined as null or as `READONLY,' OPEN(UNIT=IUN,STATUS='UNKNOWN',ACCESS='DIRECT',FORM=FRM, + READONLY, + FILE=NAMFIL,RECL=LLREC,IOSTAT=IOS,ERR=5) ELSE OPEN(UNIT=IUN,STATUS='UNKNOWN',ACCESS='DIRECT',FORM=FRM, + DISPOSE = DISPOS, + FILE=NAMFIL,RECL=LLREC,IOSTAT=IOS,ERR=5) ENDIF ELSE C carriagecontrol='fortran' for print file, else = C 'list'. IF (ISTAT.EQ.PRINTR) THEN C want to obey format characters in column 1 CCNTRL = 'FORTRAN' FRM = 'FORMATTED' ELSE C no special significance to column 1 CCNTRL = 'LIST' END IF IF (FRM .EQ. 'UNFORMATTED') THEN C (carriage control not relevant) IF (ISTAT.EQ.RDONLY) THEN OPEN(UNIT=IUN, FILE=NAMFIL, STATUS=ST, ACCESS='SEQUENTIAL', + READONLY, + FORM=FRM, ERR=5, IOSTAT=IOS) ELSE OPEN(UNIT=IUN, FILE=NAMFIL, STATUS=ST, ACCESS='SEQUENTIAL', + FORM=FRM, ERR=5, IOSTAT=IOS, DISPOSE=DISPOS) ENDIF ELSE IF (ISTAT.EQ.RDONLY) THEN OPEN(UNIT=IUN, FILE=NAMFIL, STATUS=ST, ACCESS='SEQUENTIAL', + READONLY, DISPOSE=DISPOS, + CARRIAGECONTROL=CCNTRL, + FORM=FRM, ERR=5, IOSTAT=IOS) ELSE OPEN(UNIT=IUN, FILE=NAMFIL, STATUS=ST, ACCESS='SEQUENTIAL', + CARRIAGECONTROL=CCNTRL, DISPOSE=DISPOS, + FORM=FRM, ERR=5, IOSTAT=IOS) ENDIF ENDIF ENDIF C Error check 5 CONTINUE C don't report UNKNOWN if actually SCRATCH IF (ISTAT.EQ.SCRTCH) ST = 'SCRATCH' IF (IOS.NE.0) THEN IF (IFAIL.EQ.0) THEN C warning if there was no file associated with logical name IF (LNONAM) THEN ERRSTR = 'CCPOPN Logical name '//LOGNAM ERRSTR(LENSTR(ERRSTR)+2:) = 'has no associated file name' CALL CCPERR(2,ERRSTR) END IF C hard failure WRITE (ERRSTR,FMT=6002) IUN, NAMFIL(1:LENSTR(NAMFIL)), + LOGNAM(1:LENSTR(LOGNAM)) 6002 FORMAT ('Open failed: Unit:',I4,', File: ',A, ' (logical: ', A + , ')') CALL QPRINT (0, ERRSTR) ERRSTR = ' Open failed: File: ' // NAMFIL CALL CCPERR(1, ERRSTR) ELSE C soft failure IF (IFAIL.EQ.1) WRITE (LUNSTO (1),FMT=6004) FRM, ST, IUN, + LOGNAM(1:LENSTR(LOGNAM)), NAMFIL(1:LENSTR(NAMFIL)) 6004 FORMAT (' **CCPOPN ERROR** ',A,3X,A, + ' file open failure on unit ',I3) ERRSTR = 'Logical name: ' //LOGNAM CALL QPRINT (0, ERRSTR) ERRSTR = 'File name: ' // NAMFIL CALL QPRINT (0, ERRSTR) CALL UGERR(IOS,ERRSTR) CALL QPRINT (0, ERRSTR) CALL QPRINT (0, ' ') IFAIL = -1 RETURN ENDIF ELSE IF (IIUN.LE.0) RETURN INQUIRE (FILE=NAMFIL,NAME=FULNAM) C DJGL: why is this inquire necessary rather than using NAMFIL? WRITE (ERRSTR,FMT=6000) FRM,ST,IUN CALL QPRINT (1, ' ') CALL QPRINT (1, ERRSTR) call ccp4h_summary_beg() ERRSTR = 'Logical name: ' ERRSTR (15:) = LOGNAM L = MIN(LENSTR (ERRSTR) + 1, LEN (ERRSTR)) ERRSTR (L:) = ', Filename: ' // NAMFIL CALL QPRINT (1, ERRSTR) call ccp4h_summary_end() CALL QPRINT (1, ' ') 6000 FORMAT (A,3X,A,' file opened on unit ',I3) ENDIF END C C C SUBROUTINE 'TTSEND' C =================== C C Write a string to a terminal with various carriage control options C [for LAUE] C SUBROUTINE TTSEND (IUN, STR, ICC) C C Parameters: C C IUN (I) Unit number for the output C STR (I) The string to be output C ICC (I) = 0, no carriage control at the end of the string C (for prompts) C e.g. for routine TPROMP C = 1, normal carriage control C e.g. for routine TWRITE C = 2, no carriage control (for sending escape/control C character sequences to ANSI/T4014 terminals) C e.g. for QSCREEN graphics routines C = 3, Output line at current point on screen (no leading C line feed or carriage return - trailing does not C matter) C C Machine dependence examples: Convex 1000 FORMAT (A,$) C 1001 FORMAT (A) C 1002 FORMAT (A,$) C 1003 FORMAT (A) C C Vax 1000 FORMAT (' ',A,$) C 1001 FORMAT (' ',A) C 1002 FORMAT ('+',A,$) C 1003 FORMAT ('+',A) C C====== Specification statements C INTEGER IUN, ICC CHARACTER*(*) STR INTEGER LENSTR LOGICAL VAXVMS EXTERNAL CCPERR, LENSTR, VAXVMS C C====== Write string C IF (VAXVMS()) THEN IF (LENSTR(STR) .GT. 132) . CALL CCPERR(1,' TTSEND: Output string is greater than 132') ENDIF IF (ICC.EQ.0) THEN WRITE (IUN,1000) STR ELSE IF (ICC.EQ.2) THEN WRITE (IUN,1002) STR ELSE IF (ICC.EQ.3) THEN WRITE (IUN,1003) STR ELSE WRITE (IUN,1001) STR ENDIF C C====== Format statements C 1000 FORMAT (' ',A,$) 1001 FORMAT (' ',A) 1002 FORMAT ('+',A,$) 1003 FORMAT ('+',A) END C SUBROUTINE UGTARG(I, ARG) INTEGER I CHARACTER *(*) ARG CALL GETARG(I, ARG) END C ======================== SUBROUTINE GETELAPSED C ======================== C C GETELAPSED - print CPU and ELAPSED times since job started. C C**** NOTE - Code is not VAX/VMS specific but will only work correctly on VAX, C**** because on other systems USTIME returns system time relative to arbitrary C**** zero, whereas in VMS.FOR USTIME has been set up to return time relative C**** to start of job. C==== 8-NOV-93 Made s/r INITFYP entry in GETELAPSED to initialise elapsed time C to bring into line with unix.for. C C .. Local Scalars .. (GETELAPSED) REAL CPUTIM INTEGER CPUMIN, CPUSEC, CPUTIC, JOBMIN, JOBSEC, JOBSAV LOGICAL INITED C .. C .. Parameters .. (INITFYP) INTEGER MAXLEN,MAXPAR PARAMETER (MAXLEN=70,MAXPAR=41) C .. C .. Scalars in Common .. INTEGER IARG C .. C .. Arrays in Common .. CHARACTER ARGNAM* (MAXLEN) C .. C .. Local Scalars .. INTEGER I,J,K,L,LENARG,ISTAT CHARACTER CLIARG*700,NAME*200 C .. C .. External Subroutines .. EXTERNAL LIB$GET_FOREIGN C .. C .. Intrinsic Functions .. INTRINSIC INDEX C .. C .. Common blocks .. COMMON /ARGCOUNT/IARG COMMON /ARGS/ARGNAM(MAXPAR) C .. C .. Save statement .. SAVE CPUTIM, INITED, JOBSAV C .. C .. Data statements .. DATA INITED /.FALSE./ DATA CPUTIM /0./ DATA IARG/-1/ C .. INCLUDE '($SSDEF)' INCLUDE '($JPIDEF)' C C This should be included (either VAX C or DEC C version, determined C by the logical name) to link with the C version of the library. C However, it's not clear that it's actually necessary... INCLUDE 'CRTLINIT' C C Don't print anything if it hasn't been initialised (by CCPFYP/INITFYP). C CALL UCPUTM(CPUTIM) IF (INITED) THEN CPUTIC = NINT(100.*CPUTIM) CPUMIN = CPUTIC/6000 CPUSEC = MOD(CPUTIC/100,60) CPUTIC = MOD(CPUTIC,100) C CALL USTIME(JOBSEC) JOBSEC = JOBSEC - JOBSAV JOBMIN = JOBSEC/60 JOBSEC = MOD(JOBSEC,60) C WRITE (6,'(/,A,I6,2(A,I2.2),8X,A,I6,A,I2.2)') & ' CPU time used:',CPUMIN,':',CPUSEC,'.',CPUTIC, & 'Elapsed time:',JOBMIN,':',JOBSEC ENDIF C CALL USTIME(JOBSAV) INITED = .TRUE. C RETURN C C C ============= ENTRY INITFYP C ============= C CPUTIM = 0. CALL UCPUTM(CPUTIM) CALL USTIME(JOBSAV) INITED = .TRUE. C C---- Parse CLI argument: get command line C IARG = 0 DO 5 J = 1, MAXPAR ARGNAM(J) = ' ' 5 CONTINUE C C---- get user id and use for argv[0] C CALL UGTUID(ARGNAM(1)) C CALL LIB$GET_FOREIGN(CLIARG,,LENARG) C C---- Split command line into arguments. C IF (LENARG.GT.0) THEN J = 1 10 CONTINUE K = INDEX(CLIARG(J:LENARG),' ') IF (K.EQ.0) THEN K = LENARG ELSE K = J + K - 2 END IF IARG = IARG + 1 IF (IARG.EQ.MAXPAR) RETURN ARGNAM(IARG + 1) = CLIARG(J:K) DO 20 J = K + 2,LENARG IF (CLIARG(J:J).NE.' ') GO TO 10 20 CONTINUE END IF C END SUBROUTINE UCPUTM(CPUTIM) C ========================= C C Get CPU time in seconds. C C Argument: C REAL CPUTIM (i/o): If <= 0, initialize timer and return current C elapsed cpu time since start of execution, otherwise C return elapsed cpu since timer was initialized. C C****************** VAX/VMS SPECIFIC ! ********************* C INCLUDE '($JPIDEF)' INTEGER IOSB(2), IS, IT REAL CPUSAV, CPUTIM INTEGER SYS$GETJPIW C STRUCTURE /ITMLST/ UNION MAP INTEGER*2 LB,IC INTEGER IA,IR ENDMAP MAP INTEGER IE ENDMAP ENDUNION ENDSTRUCTURE C RECORD /ITMLST/ JPI(2) C DATA IT /0/, CPUSAV /0./ SAVE IT, CPUSAV C IF (IT.EQ.0) THEN JPI(1).LB = 4 JPI(1).IC = JPI$_CPUTIM JPI(1).IA = %LOC(IT) JPI(2).IE = 0 ENDIF C IS = SYS$GETJPIW(,,,JPI,IOSB,,) IF (IS) IS = IOSB(1) IF (.NOT.IS) CALL LIB$SIGNAL(%VAL(IS)) C IF (CPUTIM.LE.0.) THEN CPUSAV = .01*IT CPUTIM = CPUSAV ELSE CPUTIM = .01*IT - CPUSAV ENDIF END C ========================= SUBROUTINE USTIME(JOBTIM) C ========================= C C USTIME - Get elapsed job time in seconds to nearest second. C C Argument: INTEGER JOBTIM C C C****************** VAX/VMS SPECIFIC ! ********************* C INCLUDE '($JPIDEF)' LOGICAL LT INTEGER IOSB(2), IS, JOBTIM, T0(2), TN(2) REAL DT INTEGER SYS$GETJPIW, SYS$GETTIM C STRUCTURE /ITMLST/ UNION MAP INTEGER*2 LB,IC INTEGER IA,IR ENDMAP MAP INTEGER IE ENDMAP ENDUNION ENDSTRUCTURE C RECORD /ITMLST/ JPI(2) C DATA LT /.TRUE./ SAVE LT, T0 C IF (LT) THEN JPI(1).LB = 8 JPI(1).IC = JPI$_LOGINTIM JPI(1).IA = %LOC(T0) JPI(2).IE = 0 C IS = SYS$GETJPIW(,,,JPI,IOSB,,) IF (IS) IS = IOSB(1) IF (.NOT.IS) CALL LIB$SIGNAL(%VAL(IS)) LT = .FALSE. ENDIF C IS = SYS$GETTIM(TN) IF (.NOT.IS) CALL LIB$SIGNAL(%VAL(IS)) C C==== T0 = Absolute time at job login in 10^-7 sec units (INTEGER*8). C==== TN = Absolute time now in 10^-7 sec units (INTEGER*8). C==== JOBTIM = Time difference in seconds (INTEGER*4). C DT = REAL(TN(1)) - REAL(T0(1)) IF (T0(1).LT.0) DT = DT - 2.**32 IF (TN(1).LT.0) DT = DT + 2.**32 JOBTIM = NINT(1.E-7*(DT + 2.**32*(REAL(TN(2)) - REAL(T0(2))))) END C C ===================================================== SUBROUTINE GETREF(KERFLG,NREAD,NSPOTS,DYNAM,MAXOMITL) C ===================================================== C C [This has been abtracted from ABSCALE because of the BYTE C declaration.] C implicit none C C C C C C Read one reflection into common /IND/, skipping unmeasured reflections C Return 1 if end of file or all N spots found C Both integrated and profile fitted I's and SD's are stored, one in C INTT,SD and the other in INTT2,SD2. The values in INTT,SD are used C in scaling, and this is chosen on input card 1 to be either the C integrated or profile fitted value. C C C This routine is probably VAX specific in its unpacking of indices C C C C---- IC format generate file variables C C C C .. Scalar Arguments .. INTEGER NREAD,NSPOTS,KERFLG,MAXOMITL LOGICAL DYNAM C .. C .. Scalars in Common .. INTEGER IREC,IX,IY,JGUNIT,JH,JK,JL,MND LOGICAL PROFILE C .. C .. Arrays in Common .. REAL SPACER(12) INTEGER INTT(3),INTT2(3),ISD(3),ISD2(3),JUNK(2) C .. C .. Local Scalars .. INTEGER I,ICOL,ICOL2,IER,I4INTS,I4INTP BYTE IR,IM C .. C .. Local Arrays .. cejd INTEGER*2 IBUF(18) INTEGER*2 IBUF(19) BYTE B(2) C .. C .. External Subroutines .. EXTERNAL QREAD C .. C .. Common blocks .. LOGICAL BRIEF INTEGER IBRIEF COMMON /BRF/ BRIEF,IBRIEF COMMON /IND/JH,JK,JL,MND,JUNK,IX,IY,SPACER,INTT,ISD, + INTT2,ISD2 COMMON /INREC/JGUNIT,IREC COMMON /INTTYP/PROFILE C .. C .. Equivalences .. EQUIVALENCE (B(1),IBUF(4)), (B(1),IR), (B(2),IM) EQUIVALENCE (I4INTS,IBUF(7)),(I4INTP,IBUF(13)) C .. SAVE C C KERFLG = 0 C C 10 CONTINUE NREAD = NREAD + 1 C C IF (NREAD.GT.NSPOTS) THEN GO TO 40 ELSE C C ************************* CALL QREAD(JGUNIT,IBUF,36,IER) C ************************* C IREC = IREC + 1 IF (IER.NE.0) THEN GO TO 30 C C---- If rejected, skip to next refl C CAL ALLOW IR TO HAVE VALUES 5,6 ELSE IF ((IR.NE.0).AND.(IR.LE.4)) THEN GO TO 10 END IF END IF C C JH = IBUF(1) JK = IBUF(2) JL = IBUF(3) MND = IM IF (MND.LT.0) MND = 8 IX = IBUF(5) IY = IBUF(6) C C---- A film intensity in ibuf(7) for integrated intensities or C ibuf(13) for profile fitted intensities C IF (PROFILE) THEN ICOL = 13 ICOL2 = 7 ELSE ICOL = 7 ICOL2 = 13 END IF C C DO 20 I = 1,3 IF (DYNAM) THEN ISD(I) = IBUF(ICOL+2) ISD2(I) = IBUF(ICOL2+2) IF (PROFILE) THEN INTT(I) = I4INTP INTT2(I) = I4INTS ELSE INTT(I) = I4INTS INTT2(I) = I4INTP END IF ELSE INTT(I) = IBUF(ICOL) ISD(I) = IBUF(ICOL+1) INTT2(I) = IBUF(ICOL2) ISD2(I) = IBUF(ICOL2+1) END IF C C---- Test for badspots (isd=-9999) change to unmeasured C this will also reject overloaded reflections C-AL Change this so overloads are rejected (and counted) in RDREF C IF ( (ISD(I) .EQ. -9999) .AND. + (INTT(I) .NE. MAXOMITL) ) INTT(I) = -9999 IF ( (ISD2(I) .EQ. -9999) .AND. + (INTT2(I) .NE. MAXOMITL) ) + INTT2(I) = -9999 C C ICOL = ICOL + 2 ICOL2 = ICOL2 + 2 20 CONTINUE RETURN 30 KERFLG = -1 RETURN 40 KERFLG = -1 RETURN END C C C C_BEGIN_CCPSPW SUBROUTINE CCPSPW(STRING) C ========================= C C Spawns a new process using shell command C C Arguments: C ========== C C STRING (I) CHARACTER*(*): string containing command C_END_CCPSPW C CHARACTER STRING*(*) CALL LIB$SPAWN(STRING) END C SUBROUTINE CCPAL1 (ROUTNE, N, TYPE, LENGTH) C C Arrange to call ROUTNE with N TYPEd array arguments of given C LENGTH (see CCPALC) C EXTERNAL ROUTNE INTEGER N, TYPE (*), LENGTH (*) INTEGER I, SIZES (5), POINTER (12), ISTAT C bytes per word (assuming 32 bit words...) DATA SIZES /4,4,8,8,1/ C The calling routine, CCPALC, will have checked that the arguments C are in range DO I=1,N ISTAT = LIB$GET_VM (SIZES(TYPE (I))*LENGTH(I), POINTER(I)) IF (.NOT.ISTAT) + CALL CCPERR (-1, 'CCPALC: can''t allocate memory') CALL CCPZBI (%VAL(POINTER(I)), SIZES(TYPE (I))*LENGTH(I)) ENDDO IF (N.EQ.1) THEN CALL ROUTNE (LENGTH (1), %VAL(POINTER(1))) ELSE IF (N.EQ.2) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2))) ELSE IF (N.EQ.3) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3))) ELSE IF (N.EQ.4) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4))) ELSE IF (N.EQ.5) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4)), + LENGTH (5), %VAL(POINTER(5))) ELSE IF (N.EQ.6) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4)), + LENGTH (5), %VAL(POINTER(5)), LENGTH (6), %VAL(POINTER(6))) ELSE IF (N.EQ.7) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4)), + LENGTH (5), %VAL(POINTER(5)), LENGTH (6), %VAL(POINTER(6)), + LENGTH (7), %VAL(POINTER(7))) ELSE IF (N.EQ.8) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4)), + LENGTH (5), %VAL(POINTER(5)), LENGTH (6), %VAL(POINTER(6)), + LENGTH (7), %VAL(POINTER(7)), LENGTH (8), %VAL(POINTER(8))) ELSE IF (N.EQ.9) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4)), + LENGTH (5), %VAL(POINTER(5)), LENGTH (6), %VAL(POINTER(6)), + LENGTH (7), %VAL(POINTER(7)), LENGTH (8), %VAL(POINTER(8)), + LENGTH (9), %VAL(POINTER(9))) ELSE IF (N.EQ.10) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4)), + LENGTH (5), %VAL(POINTER(5)), LENGTH (6), %VAL(POINTER(6)), + LENGTH (7), %VAL(POINTER(7)), LENGTH (8), %VAL(POINTER(8)), + LENGTH (9), %VAL(POINTER(9)), + LENGTH (10), %VAL(POINTER(10))) ELSE IF (N.EQ.11) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4)), + LENGTH (5), %VAL(POINTER(5)), LENGTH (6), %VAL(POINTER(6)), + LENGTH (7), %VAL(POINTER(7)), LENGTH (8), %VAL(POINTER(8)), + LENGTH (9), %VAL(POINTER(9)), + LENGTH (10), %VAL(POINTER(10)), + LENGTH (11), %VAL(POINTER(11))) ELSE IF (N.EQ.12) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4)), + LENGTH (5), %VAL(POINTER(5)), LENGTH (6), %VAL(POINTER(6)), + LENGTH (7), %VAL(POINTER(7)), LENGTH (8), %VAL(POINTER(8)), + LENGTH (9), %VAL(POINTER(9)), + LENGTH (10), %VAL(POINTER(10)), + LENGTH (11), %VAL(POINTER(11)), + LENGTH (12), %VAL(POINTER(12))) ENDIF DO I=1,N ISTAT = LIB$FREE_VM (SIZES(TYPE (I))*LENGTH(I), POINTER(I)) IF (.NOT.ISTAT) CALL CCPERR (-1, 'CCPALC: can''t free memory') ENDDO END C SUBROUTINE CEXIT (ICODE) C trivial interface to system-dependent EXIT routine CALL EXIT (ICODE) END C CA dummy function for unix and vms C ========================= CHARACTER FUNCTION RTNBKS() C ========================= C C RTNBKS - Returns a Backslash for nt as unix compilers are fussy! C C Input: none C C Returns: \ if WIN32 or not if unix or vms C C Arguments: none C C Usage: RTNBKS () C RTNBKS=' ' C END c ============================ subroutine hciftime(ciftime) c ============================ c Uses f90 intrinsic Date_and_Time. Using f77: c works on VMS Fortran V7 but not earlier versions c works on Digital UNIX V4.0F c doesn't work on IRIX 6.5 c implicit none c character ciftime*(*) c character cdate*8,ctime*9,czone*5 integer ivalues(8) c c ... check if the argument can hold 25 characters c (better to return an error flag, of course ;-) c if (len(ciftime) .lt. 25) then print *,'error --- hciftime: string too short' ciftime = ' ' return end if c CALL Date_and_Time(CDATE,CTIME,CZONE,IVALUES) c write (ciftime,fmt=6000) IVALUES(1),IVALUES(2),IVALUES(3), + IVALUES(5),IVALUES(6),IVALUES(7),CZONE(1:3),CZONE(4:5) c c ... NOTE: "i4" in the following format makes that this routine c is not Year-10,000-compliant !!! c 6000 format (i4,'-',i2.2,'-',i2.2,'T',i2.2,':',i2.2,':',i2.2, + a3,':',a2) c return end libccp4-8.0.0/fortran/vmsdiskio.for0000644000000000000000000012051714242731033015365 0ustar 00000000000000C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C C**** VAXDISKIO.FOR **************************************************** C C This file contains a set of FORTRAN subroutines for C doing either sequential or random access disk I/O C with variable record lengths. The files are actually C written as fixed-record direct-access files, but this C is transparent to the user. C C Note: Only 10 files may be opened simultaneously!!!! C -- C This is a VAX version, and will require changes for other machines. C C Within these routines, all counting is done as bytes (== minimal C machine element). However, the entries QREAD, QWRITE, QSEEK, QBACK, C QSKIP and QLOCATE count in items. The conversion between bytes and C items may be changed by a call to QMODE, which defines the mode C (corresponding to map/image modes), and stores and returns the number C of bytes per item NCHITM. NCHITM defaults to 1 for all streams unless C changed by a call to QMODE. This equivalencing of bytes and items C should make it possible to write higher level routines which are C portable between computers, although the routines here are NOT C portable to non-byte computers. C C the calls provided are: C C call QOPEN(IUNIT,NAME,ATTRIBUTE) ;open file C call QCLOSE(IUNIT) ;close file C call QMODE(IUNIT,MODE,NCHITM) ;set mode C call QREAD(IUNIT,ARRAY,NITEMS,IER) ;read nitems C call QWRITE(IUNIT,ARRAY,NITEMS) ;write nitems C call QSEEK(IUNIT,IRECORD,IELEMENT,IRECLENGTH) ;move to irec,iel C call QBACK(IUNIT,IRECLENGTH) ;backspace 1 record C call QSKIP(IUNIT,IRECLENGTH) ;skip 1 record C call QLOCATE(IUNIT,LOCATION) ;return disk location C C For files created by QOPEN, the user may set numeric values for the C logical names CCP4_INITIAL and CCP4_EXTEND to specify the initial C (default = 100) and extend sizes (default = 30) for the file. C C QSEEK calculates the location as follows: C LOCATION = (IRECORD - 1)*IRECLENGTH + IELEMENT C C NOTE: as in FORTRAN, addressing begins at 1 for BOTH record & element C C where: C IUNIT = Variable used to contain channel # (SET by QOPEN!!!) C NAME = either a LOGICAL or FILE name to be associated with unit C ATTRIBUTE = one of the following: 'NEW' 'OLD' 'RO' 'SCRATCH' 'UNKNOWN' C ARRAY = starting location for data storage in core C NITEMS = number of items to transfer C IER = error flag (0 = no error) else # of bytes transferred C IRECORD = desired record # (starts @ 1) C IELEMENT = desired element # within record (items) (starts @ 1) C IRECLENGTH = record length in items C LENGTH = returned file size in bytes C LOCATION = returned location of disk pointer in items (starts @ 1) C MODE = file mode, to set correspondence between an item in the C file, and one machine character (byte). C mode 0 = bytes, 1 = short integers (*2), 2 = words C (reals or integers), 3 = short complex (2 integer*2), C 4 = complex C NCHITM = returned as number of characters (bytes) / item C C C C Last Update: 01.10.82 DAA VAX C 02.05.84 PRE item counting C 24.09.93 IJT remove macro calls C C For CCP compatibilty, added entries C QQOPEN(IUNIT,NAME,ISTAT) calls QOPEN, sets file status C from ISTAT = 1 'UNKNOWN' C = 2 'SCRATCH' C = 3 'OLD' C = 4 'NEW' C = 5 'READONLY' C Also sets default mode = 2 C C QQINQ(IUNIT,LFN,NAME,LENGTH) get full name & length of file C C SUBROUTINE DISKIO C ================= C C==== NRBLK = Number of physical blocks/logical block C.... Note the user may try varying NRBLK in the range 1...127 (=MAXDO), C but the other parameters should be left alone! C==== NCMAX = Maximum number of channels open simultaneously C==== NPBSZ = Physical block size on disk C==== MAXDO = Maximum number of physical blocks in one transfer C==== MAXMO = Maximum mode value C==== NBALQ = Default initial physical block allocation C==== NBDEQ = Default extension physical block allocation C IMPLICIT NONE INTEGER NRBLK, NCMAX, NPBSZ, MAXDO, MAXMO, NBALQ, NBDEQ, NSIZE, & NSIZE1, I2P15, I2P16 PARAMETER (NRBLK=64, NCMAX=10, NPBSZ=512, MAXDO=127, MAXMO=6, & NBALQ=100, NBDEQ=30, NSIZE=NRBLK*NPBSZ, NSIZE1=NSIZE+1, & I2P15=2**15, I2P16=2**16) C C==== Declare system calls, parameters, record structures etc etc ... C INCLUDE '($SYSSRVNAM)' INCLUDE '($RMSDEF)' INCLUDE '($FABDEF)' INCLUDE '($NAMDEF)' INCLUDE '($RABDEF)' INCLUDE '($XABDEF)' INCLUDE '($XABFHCDEF)' C RECORD /FABDEF/ FAB(NCMAX) RECORD /NAMDEF/ NAM(NCMAX) RECORD /RABDEF/ RAB(NCMAX) C STRUCTURE /MAPXABDEF/ UNION MAP RECORD /XABDEF/ XAB ENDMAP MAP RECORD /XABFHCDEF/ XABFHC ENDMAP ENDUNION ENDSTRUCTURE C RECORD /MAPXABDEF/ MAPXAB(NCMAX) C BYTE ARRAY(*), BUFFER(NSIZE,NCMAX), MS(4) CHARACTER ATBUTE*(*), ATTRIB*1, FILNAM*(*), MSG*80, NAME*(*), & UNK*7 CHARACTER FNAME(NCMAX)*127 LOGICAL EXIST LOGICAL BUFACT(NCMAX), WRTACT(NCMAX), NEW(NCMAX), LUNIT(NCMAX) INTEGER I, IEL, IER, IREC, IRET, IUNIT, L, LENGTH, LOCATION, & LRECL, MCHITM, MODE, MTIT, MTRT, NBYTES, MODE1, MAXNC INTEGER IBY, INDEX, ISAVE, ISTAT, IVBLK, J, JEL, KEL, KRECSZ, & NBY, NDO, NLEFT, NOBLK, NTOMOV INTEGER LRECSZ(NCMAX), MRECSZ(NCMAX), MODES(0:MAXMO), & MSIT(NCMAX), MSRT(NCMAX), NCHITM(NCMAX), NEL(NCMAX), & NMODE(NCMAX), NRECSZ(NCMAX), NVBLK(NCMAX) INTEGER LENSTR REAL BUF(NSIZE/4,NCMAX) EQUIVALENCE(BUFFER,BUF) COMMON /DISKIO_MODES_/ MAXNC, NMODE DATA MAXNC/NCMAX/ DATA UNK/'UNKNOWN'/, LUNIT/NCMAX*.TRUE./ SAVE C C Item length for each mode: these correspond to map/image modes 0 to 6 C byte, integer*2, real*4, complex*4, complex*8, unused, integer*4 DATA MODES/ 1, 2, 4, 4, 8, 0, 4 / C C C####################################################################### C C C*QOPEN ENTRY QOPEN(IUNIT,NAME,ATBUTE) C ============================== C C FIND NEXT AVAILABLE UNIT # C DO 10 J = 1,NCMAX 10 IF (LUNIT(J)) GOTO 20 WRITE(6,'(/A,I4)') ' Max available unit= ',NCMAX C C==== Maybe this should be a soft fail: IUNIT = -1 ? C CALL CCPERR(1,'QOPEN error: No available units !!') IUNIT = -1 RETURN C 20 IUNIT = J LUNIT(IUNIT) = .FALSE. NMODE(IUNIT) = 2 NCHITM(IUNIT) = 4 C C==== Identify File Access Block. C FAB(IUNIT).FAB$B_BID = FAB$C_BID FAB(IUNIT).FAB$B_BLN = FAB$C_BLN C C==== File name address & size, clear file-processing options. C FAB(IUNIT).FAB$L_FNA = %LOC(NAME) L = MIN(LENSTR(NAME),255) IF (L.GT.127) L = L - 256 FAB(IUNIT).FAB$B_FNS = L FAB(IUNIT).FAB$L_FOP = 0 C C==== File organisation is sequential. C FAB(IUNIT).FAB$B_ORG = FAB$C_SEQ C C==== Pretend record format is stream_lf for C's benefit. C FAB(IUNIT).FAB$B_RFM = FAB$C_STMLF C C==== NAM and XAB addresses. C FAB(IUNIT).FAB$L_NAM = %LOC(NAM(IUNIT)) FAB(IUNIT).FAB$L_XAB = %LOC(MAPXAB(IUNIT)) C C==== Identify NAMe block. C NAM(IUNIT).NAM$B_BID = NAM$C_BID NAM(IUNIT).NAM$B_BLN = NAM$C_BLN C C==== Expanded string address and size. C NAM(IUNIT).NAM$L_ESA = %LOC(FNAME(IUNIT)) NAM(IUNIT).NAM$B_ESS = LEN(FNAME(1)) FNAME(IUNIT) = ' ' C C==== Identify as eXtended Attributes Block for File Header Characteristics. C MAPXAB(IUNIT).XAB.XAB$B_COD = XAB$C_FHC MAPXAB(IUNIT).XAB.XAB$B_BLN = XAB$C_FHCLEN C ATTRIB = ATBUTE IF (ATTRIB.EQ.'R') THEN C C==== File access mode is block i/o readonly. C FAB(IUNIT).FAB$B_FAC = FAB$M_BIO .OR. FAB$M_GET C C==== Open existing file. C ISTAT = SYS$OPEN(FAB(IUNIT)) NEW(IUNIT) = .FALSE. ELSEIF (ATTRIB.EQ.'O') THEN C C==== File access mode is block i/o read/write. C FAB(IUNIT).FAB$B_FAC = FAB$M_BIO .OR. FAB$M_GET .OR. FAB$M_PUT C C==== Open existing file. C ISTAT = SYS$OPEN(FAB(IUNIT)) NEW(IUNIT) = .FALSE. ELSE C C==== Default allocation and extension quantities. C FAB(IUNIT).FAB$L_ALQ = NBALQ FAB(IUNIT).FAB$W_DEQ = NBDEQ C C==== Reset from user-defined logical names if present. C CALL UGTENV('CCP4_INITIAL',MSG) IF (MSG.NE.' ') READ (MSG,*,ERR=30) FAB(IUNIT).FAB$L_ALQ 30 CALL UGTENV('CCP4_EXTEND',MSG) IF (MSG.NE.' ') READ (MSG,*,ERR=40) FAB(IUNIT).FAB$W_DEQ C C==== File access mode is block i/o read/write. C 40 FAB(IUNIT).FAB$B_FAC = FAB$M_GET .OR. FAB$M_PUT .OR. FAB$M_BIO C IF (ATTRIB.EQ.'S') THEN C C==== Scratch file is temporary/marked-for-delete. C FAB(IUNIT).FAB$L_FOP = FAB$M_TMD C ELSE C C==== Create max version & truncate new file at EOF. C FAB(IUNIT).FAB$L_FOP = FAB$M_MXV .OR. FAB$M_TEF C IF (ATTRIB.EQ.'N') THEN CALL UGTENV('CCP4_OPEN',MSG) L = LENSTR(MSG) IF (L.GT.0 .AND. L.LE.7) THEN IF (MSG(:L).EQ.UNK(:L)) ATTRIB = 'U' ENDIF ENDIF C C==== If UNKNOWN set Create-IF. C IF (ATTRIB.EQ.'U') & FAB(IUNIT).FAB$L_FOP = FAB(IUNIT).FAB$L_FOP .OR. FAB$M_CIF ENDIF C C==== Create new or open existing file, depending on CIF setting. C ISTAT = SYS$CREATE(FAB(IUNIT)) NEW(IUNIT) = .TRUE. ENDIF C IF (ISTAT) THEN C C==== Identify Record Access Block. C RAB(IUNIT).RAB$B_BID = RAB$C_BID RAB(IUNIT).RAB$B_BLN = RAB$C_BLN C C==== FAB address and internal stream identifier. C RAB(IUNIT).RAB$L_FAB = %LOC(FAB(IUNIT)) RAB(IUNIT).RAB$W_ISI = 0 C C==== Record processing option is block i/o C RAB(IUNIT).RAB$L_ROP = RAB$M_BIO C C==== Connect RAB. C ISTAT = SYS$CONNECT(RAB(IUNIT)) ENDIF C IF (.NOT.ISTAT) THEN CALL LIB$SYS_GETMSG(ISTAT,L,MSG) WRITE (*,'(/1X,2A,I4,2A)') & ATBUTE(1:MIN(30,LENSTR(ATBUTE))),' file open error on unit', & IUNIT,', Logical name: ',NAME(:MIN(50,LENSTR(NAME))) WRITE(*,FMT='(//,1X,A)') MSG(1:MIN(130,L)) C C==== Maybe this should be a soft fail: IUNIT = -1 ? C CALL CCPERR(1,'QOPEN: FATAL ERROR') IUNIT = -1 RETURN ENDIF C WRITE (*,'(/1X,2A,I4,2A)') &ATBUTE(:MIN(30,LENSTR(ATBUTE))),' file opened on unit',IUNIT, &', Logical name: ',NAME(:MIN(50,LENSTR(NAME))) WRITE (*,'(/,2A)') & ' File name: ',FNAME(IUNIT)(:MIN(100,LENSTR(FNAME(IUNIT)))) IF (NEW(IUNIT)) THEN WRITE (*,'(A,2I8/)') & ' Initial & extend sizes in physical blocks =', & FAB(IUNIT).FAB$L_ALQ,FAB(IUNIT).FAB$W_DEQ ELSE WRITE (*,'(A,I10/)') ' File size in physical blocks =', & MAPXAB(IUNIT).XABFHC.XAB$L_EBK - 1 + & (MAPXAB(IUNIT).XABFHC.XAB$W_FFB + NPBSZ - 1) / NPBSZ ENDIF C LRECSZ(IUNIT) = NSIZE MRECSZ(IUNIT) = 0 NRECSZ(IUNIT) = 0 NVBLK(IUNIT) = 1 NEL(IUNIT) = 1 BUFACT(IUNIT) = .FALSE. WRTACT(IUNIT) = .FALSE. C C==== Initialise source machine integer and real types. C MSIT(IUNIT)=0 MSRT(IUNIT)=0 C C==== Fill buffer with 0's. C IF (NSIZE.LT.I2P15) THEN CALL LIB$MOVC5(0,,0,NSIZE,BUFFER(1,IUNIT)) ELSE C==== Convert buffer size to unsigned integer. CALL LIB$MOVC5(0,,0,NSIZE-I2P16,BUFFER(1,IUNIT)) ENDIF RETURN C C C####################################################################### C C C*QCLOSE ENTRY QCLOSE(IUNIT) C =================== C C==== Maybe this should be a soft fail: IUNIT = -1 ? C IF (LUNIT(IUNIT)) THEN CALL CCPERR(1,'QCLOSE error: File not open.') IUNIT = -1 RETURN ENDIF C ISTAT = 1 IF (WRTACT(IUNIT) .AND. BUFACT(IUNIT)) THEN IF (MRECSZ(IUNIT).GT.0) THEN NOBLK = (LRECSZ(IUNIT) - 1) / NPBSZ KEL = NPBSZ * NOBLK KRECSZ = MRECSZ(IUNIT) IF (KRECSZ.LT.NRECSZ(IUNIT)) KRECSZ = & MIN(NPBSZ * ((KRECSZ - 1) / NPBSZ + 1), NRECSZ(IUNIT)) KRECSZ = KRECSZ - KEL IF (KRECSZ.GE.I2P15) KRECSZ = KRECSZ - I2P16 C C==== Virtual block number, record buffer address and size. C RAB(IUNIT).RAB$L_BKT = NVBLK(IUNIT) + NOBLK RAB(IUNIT).RAB$L_RBF = %LOC(BUFFER(KEL+1,IUNIT)) RAB(IUNIT).RAB$W_RSZ = KRECSZ C C==== Write out the block. C ISTAT = SYS$WRITE(RAB(IUNIT)) D WRITE (*,'(A,5I8)') ' SYS$WRITE 1:', D & IUNIT,NVBLK(IUNIT)+NOBLK,KEL+1,KRECSZ,ISTAT IF (.NOT.ISTAT) THEN CALL LIB$SYS_GETMSG(ISTAT,L,MSG) WRITE (*,'(/1X,A/)') MSG(:MIN(130,L)) ENDIF ENDIF ENDIF LUNIT(IUNIT) = .TRUE. !FREE THIS UNIT # C C==== Close the file. C ISAVE = ISTAT ISTAT = SYS$CLOSE(FAB(IUNIT)) IF (.NOT.ISTAT) THEN CALL LIB$SYS_GETMSG(ISTAT,L,MSG) WRITE (*,'(/1X,A/)') MSG(:MIN(130,L)) ENDIF C IF (.NOT.ISAVE .OR. .NOT.ISTAT) C &CALL CCPERR(1,'QCLOSE: FATAL ERROR.') RETURN C C C####################################################################### C C C*QMODE ENTRY QMODE(IUNIT,MODE,MCHITM) C ============================== C C==== Maybe this should be a soft fail: IUNIT = -1 ? C IF (LUNIT(IUNIT)) THEN CALL CCPERR(1,'QMODE error: File not open.') IUNIT = -1 RETURN ENDIF C Check if recognized mode IF (MODE.GE.0 .AND. MODE.LE.MAXMO) THEN MCHITM=MAX(MODES(MODE),1) ELSE MCHITM=1 ENDIF NMODE(IUNIT)=MODE NCHITM(IUNIT)=MCHITM RETURN C C C####################################################################### C C C*QREAD ENTRY QREAD(IUNIT,ARRAY,NBYTES,IER) ENTRY QREADR(IUNIT,ARRAY,NBYTES,IER) ENTRY QREADI(IUNIT,ARRAY,NBYTES,IER) ENTRY QREADQ(IUNIT,ARRAY,NBYTES,IER) C =================================== C C==== Maybe this should be a soft fail: IUNIT = -1 ? C 45 IF (IUNIT.GT.MAXNC .OR. IUNIT.LT.1) + CALL CCPERR (1,'QREAD: bad stream number') IF (LUNIT(IUNIT)) THEN CALL CCPERR(1,'QREAD error: File not open.') IUNIT = -1 RETURN ENDIF NTOMOV = NBYTES * NCHITM(IUNIT) IER = 0 INDEX = 1 NEW(IUNIT) = .FALSE. D WRITE (*,'(A,2I8)') ' QREAD 1:',NTOMOV,NEL(IUNIT) C IF (.NOT.BUFACT(IUNIT)) THEN C C==== Virtual block number, user buffer address and size. C RAB(IUNIT).RAB$L_BKT = NVBLK(IUNIT) RAB(IUNIT).RAB$L_UBF = %LOC(BUFFER(1,IUNIT)) RAB(IUNIT).RAB$W_USZ = NSIZE C C==== Read in the block. C ISTAT = SYS$READ(RAB(IUNIT)) NRECSZ(IUNIT) = RAB(IUNIT).RAB$W_RSZ IF (NRECSZ(IUNIT).LT.0) NRECSZ(IUNIT) = NRECSZ(IUNIT) + I2P16 D WRITE (*,'(A,6I8)') ' SYS$READ 1:', D & IUNIT,NVBLK(IUNIT),1,NSIZE,ISTAT,NRECSZ(IUNIT) IF (.NOT.ISTAT) GOTO 60 C WRITE (*,'(1X,16F8.0)') (BUF(I,IUNIT),I=1,NSIZE/4) BUFACT(IUNIT) = .TRUE. ENDIF C 50 NLEFT = NRECSZ(IUNIT) + 1 - NEL(IUNIT) IF (NTOMOV.LE.NLEFT) THEN D WRITE (*,'(A,3I8)') ' QREAD 2:',NTOMOV,NEL(IUNIT),INDEX C C==== Move NTOMOV bytes from record BUFFER to user's ARRAY. C IF (NTOMOV.LT.I2P15) THEN CALL LIB$MOVC3(NTOMOV,BUFFER(NEL(IUNIT),IUNIT),ARRAY(INDEX)) ELSE C==== Convert buffer size to unsigned integer. CALL LIB$MOVC3(NTOMOV-I2P16,BUFFER(NEL(IUNIT),IUNIT), & ARRAY(INDEX)) ENDIF NEL(IUNIT) = NEL(IUNIT) + NTOMOV GOTO 100 ELSE IF (NLEFT.GT.0) THEN D WRITE (*,'(A,3I8)') ' QREAD 3:',NLEFT,NEL(IUNIT),INDEX C C==== Move NLEFT bytes from record BUFFER to user's ARRAY. C IF (NLEFT.LT.I2P15) THEN CALL LIB$MOVC3(NLEFT,BUFFER(NEL(IUNIT),IUNIT),ARRAY(INDEX)) ELSE C==== Convert buffer size to unsigned integer. CALL LIB$MOVC3(NLEFT-I2P16,BUFFER(NEL(IUNIT),IUNIT), & ARRAY(INDEX)) ENDIF NTOMOV = NTOMOV - NLEFT INDEX = INDEX + NLEFT ENDIF IF (WRTACT(IUNIT)) THEN IF (MRECSZ(IUNIT).GT.0) THEN NOBLK = (LRECSZ(IUNIT) - 1) / NPBSZ KEL = NPBSZ * NOBLK KRECSZ = MRECSZ(IUNIT) IF (KRECSZ.LT.NRECSZ(IUNIT)) KRECSZ = & MIN(NPBSZ * ((KRECSZ - 1) / NPBSZ + 1), NRECSZ(IUNIT)) KRECSZ = KRECSZ - KEL IF (KRECSZ.GE.I2P15) KRECSZ = KRECSZ - I2P16 RAB(IUNIT).RAB$L_BKT = NVBLK(IUNIT) + NOBLK RAB(IUNIT).RAB$L_RBF = %LOC(BUFFER(KEL+1,IUNIT)) RAB(IUNIT).RAB$W_RSZ = KRECSZ ISTAT = SYS$WRITE(RAB(IUNIT)) D WRITE (*,'(A,5I8)') ' SYS$WRITE 2:', D & IUNIT,NVBLK(IUNIT)+NOBLK,KEL+1,KRECSZ,ISTAT IF (.NOT.ISTAT) THEN CALL LIB$SYS_GETMSG(ISTAT,L,MSG) WRITE (*,'(/1X,A/)') MSG(:MIN(130,L)) CALL CCPERR(1,'QREAD: FATAL ERROR.') IER = -1 RETURN ENDIF LRECSZ(IUNIT) = NSIZE MRECSZ(IUNIT) = 0 NRECSZ(IUNIT) = 0 ENDIF WRTACT(IUNIT) = .FALSE. ENDIF NVBLK(IUNIT) = NVBLK(IUNIT) + NRBLK NEL(IUNIT) = 1 IF (NTOMOV.GE.NSIZE) THEN NDO = MIN(NTOMOV/NPBSZ, MAXDO) NBY = NDO*NPBSZ C C==== Convert buffer size to unsigned integer. C IF (NBY.LT.I2P15) THEN IBY = NBY ELSE IBY = NBY - I2P16 ENDIF RAB(IUNIT).RAB$L_BKT = NVBLK(IUNIT) RAB(IUNIT).RAB$L_UBF = %LOC(ARRAY(INDEX)) RAB(IUNIT).RAB$W_USZ = IBY ISTAT = SYS$READ(RAB(IUNIT)) D NRECSZ(IUNIT) = RAB(IUNIT).RAB$W_RSZ D IF (NRECSZ(IUNIT).LT.0) NRECSZ(IUNIT) = NRECSZ(IUNIT) + I2P16 D WRITE (*,'(A,6I8)') ' SYS$READ 2:', D & IUNIT,NVBLK(IUNIT),INDEX,IBY,ISTAT,NRECSZ(IUNIT) IF (.NOT.ISTAT) GOTO 60 NTOMOV = NTOMOV - NBY NVBLK(IUNIT) = NVBLK(IUNIT) + NDO IF (NTOMOV.EQ.0) THEN BUFACT(IUNIT) = .FALSE. GOTO 100 ENDIF INDEX = INDEX + NBY ENDIF RAB(IUNIT).RAB$L_BKT = NVBLK(IUNIT) RAB(IUNIT).RAB$L_UBF = %LOC(BUFFER(1,IUNIT)) RAB(IUNIT).RAB$W_USZ = NSIZE ISTAT = SYS$READ(RAB(IUNIT)) NRECSZ(IUNIT) = RAB(IUNIT).RAB$W_RSZ IF (NRECSZ(IUNIT).LT.0) NRECSZ(IUNIT) = NRECSZ(IUNIT) + I2P16 D WRITE (*,'(A,6I8)') ' SYS$READ 3:', D & IUNIT,NVBLK(IUNIT),1,NSIZE,ISTAT,NRECSZ(IUNIT) IF (.NOT.ISTAT) GOTO 60 C WRITE (*,'(1X,16F8.0)') (BUF(I,IUNIT),I=1,NSIZE/4) ENDIF GOTO 50 C 60 IF (ISTAT.NE.RMS$_EOF) THEN CALL LIB$SYS_GETMSG(ISTAT,L,MSG) WRITE (*,'(/1X,A/)') MSG(:MIN(130,L)) CALL CCPERR(1,'QREAD: FATAL ERROR.') ENDIF BUFACT(IUNIT) = .FALSE. IER = NBYTES - NTOMOV/NCHITM(IUNIT) IF (IER.EQ.0) IER = -1 C 100 IF (IER.EQ.0) THEN NTOMOV=NBYTES*NCHITM(IUNIT) ELSE NTOMOV=MAX(IER,0)*NCHITM(IUNIT) ENDIF C WRITE(6,*)'NMODE =',NMODE(IUNIT) C C==== Check if source machine integer conversion required. C IF (MSIT(IUNIT).NE.0) THEN C C==== INTEGER*2 or *4 mode ? C IF (NMODE(IUNIT).EQ.1 .OR. NMODE(IUNIT).EQ.3) THEN CALL QSWAP1(NTOMOV,ARRAY) ELSEIF (NMODE(IUNIT).EQ.6) THEN CALL QSWAP3(NTOMOV,ARRAY) ENDIF ENDIF C C==== Check if source machine real conversion required. C IF (MSRT(IUNIT).NE.0) THEN IF (NMODE(IUNIT).EQ.2 .OR. NMODE(IUNIT).EQ.4) THEN IF (MTRT.EQ.2) THEN C C==== Target machine is VAX; check source machine type for byte swap. C IF (MSRT(IUNIT).NE.4) CALL QSWAP3(NTOMOV,ARRAY) C C==== Check for Convex native. If IEEE convert from IEEE. C IF (MSRT(IUNIT).NE.5) CALL QFIEEE(NTOMOV/4,ARRAY) C C==== Swap to VAX byte order. C CALL QSWAP2(NTOMOV,ARRAY) C ELSEIF (MTRT.EQ.4) THEN C C==== Target machine is L-E/IEEE; check source machine type for byte swap. C IF (MSRT(IUNIT).EQ.2) THEN CALL QSWAP2(NTOMOV,ARRAY) ELSE CALL QSWAP3(NTOMOV,ARRAY) ENDIF C C==== If not IEEE convert to IEEE. C IF (MSRT(IUNIT).NE.1) CALL QTIEEE(NTOMOV/4,ARRAY) C ELSEIF (MTRT.EQ.1) THEN C C==== Target machine is B-E/IEEE; check source machine type for byte swap. C IF (MSRT(IUNIT).EQ.2) THEN CALL QSWAP1(NTOMOV,ARRAY) ELSEIF (MSRT(IUNIT).EQ.4) THEN CALL QSWAP3(NTOMOV,ARRAY) ENDIF C C==== If not IEEE convert to IEEE. C IF (MSRT(IUNIT).NE.4) CALL QTIEEE(NTOMOV/4,ARRAY) ELSE CALL CCPERR(1,'*** QREAD: Bad machine REAL type.') ENDIF ENDIF ENDIF RETURN C C C####################################################################### C C C*QWRITE ENTRY QWRITE(IUNIT,ARRAY,NBYTES) ENTRY QWRITI(IUNIT,ARRAY,NBYTES) ENTRY QWRITR(IUNIT,ARRAY,NBYTES) ENTRY QWRITQ(IUNIT,ARRAY,NBYTES) C ================================ C C==== Maybe this should be a soft fail: IUNIT = -1 ? C IF (IUNIT.GT.MAXNC .OR. IUNIT.LT.1) + CALL CCPERR (1,'QREAD: bad stream number') IF (LUNIT(IUNIT)) THEN CALL CCPERR(1,'QWRITE error: File not open.') IUNIT = -1 RETURN ENDIF INDEX = 1 NTOMOV = NBYTES * NCHITM(IUNIT) D WRITE (*,'(A,2I8)') ' QWRITE 1:',NTOMOV,NEL(IUNIT) IF (NEL(IUNIT).GT.NSIZE) THEN IF (WRTACT(IUNIT)) THEN IF (MRECSZ(IUNIT).GT.0) THEN NOBLK = (LRECSZ(IUNIT) - 1) / NPBSZ KEL = NPBSZ * NOBLK KRECSZ = NPBSZ * ((MRECSZ(IUNIT) - 1) / NPBSZ + 1) - KEL IF (KRECSZ.GE.I2P15) KRECSZ = KRECSZ - I2P16 RAB(IUNIT).RAB$L_BKT = NVBLK(IUNIT) + NOBLK RAB(IUNIT).RAB$L_RBF = %LOC(BUFFER(KEL+1,IUNIT)) RAB(IUNIT).RAB$W_RSZ = KRECSZ ISTAT = SYS$WRITE(RAB(IUNIT)) D WRITE (*,'(A,5I8)') ' SYS$WRITE 3:', D & IUNIT,NVBLK(IUNIT)+NOBLK,KEL+1,KRECSZ,ISTAT IF (.NOT.ISTAT) GOTO 80 LRECSZ(IUNIT) = NSIZE MRECSZ(IUNIT) = 0 NRECSZ(IUNIT) = 0 ENDIF ENDIF NEL(IUNIT) = 1 NVBLK(IUNIT) = NVBLK(IUNIT) + NRBLK BUFACT(IUNIT) = .FALSE. ENDIF WRTACT(IUNIT) = .TRUE. C 70 NLEFT = NSIZE1 - NEL(IUNIT) IF (.NOT.BUFACT(IUNIT)) THEN IF (NEL(IUNIT).GT.1 .OR. NTOMOV.LT.NSIZE) THEN IF (.NOT.NEW(IUNIT)) THEN RAB(IUNIT).RAB$L_BKT = NVBLK(IUNIT) RAB(IUNIT).RAB$L_UBF = %LOC(BUFFER(1,IUNIT)) RAB(IUNIT).RAB$W_USZ = NSIZE ISTAT = SYS$READ(RAB(IUNIT)) NRECSZ(IUNIT) = RAB(IUNIT).RAB$W_RSZ IF (NRECSZ(IUNIT).LT.0) & NRECSZ(IUNIT) = NRECSZ(IUNIT) + I2P16 D WRITE (*,'(A,6I8)') ' SYS$READ 4:', D & IUNIT,NVBLK(IUNIT),1,NSIZE,ISTAT,NRECSZ(IUNIT) C C ERROR=BLANK FILE C C==== Fill buffer with 0's. C IF (.NOT.ISTAT) THEN IF (NSIZE.LT.I2P15) THEN CALL LIB$MOVC5(0,,0,NSIZE,BUFFER(1,IUNIT)) ELSE C==== Convert buffer size to unsigned integer. CALL LIB$MOVC5(0,,0,NSIZE-I2P16,BUFFER(1,IUNIT)) ENDIF ENDIF ENDIF ENDIF BUFACT(IUNIT) = .TRUE. ENDIF C IF (NTOMOV.LE.NLEFT) THEN D WRITE (*,'(A,3I8)') ' QWRITE 2:',NTOMOV,NEL(IUNIT),INDEX C C==== Move NTOMOV bytes from user's ARRAY to record BUFFER. C IF (NTOMOV.LT.I2P15) THEN CALL LIB$MOVC3(NTOMOV,ARRAY(INDEX),BUFFER(NEL(IUNIT),IUNIT)) ELSE C==== Convert buffer size to unsigned integer. CALL LIB$MOVC3(NTOMOV-I2P16,ARRAY(INDEX), & BUFFER(NEL(IUNIT),IUNIT)) ENDIF LRECSZ(IUNIT)=MIN(LRECSZ(IUNIT),NEL(IUNIT)) NEL(IUNIT) = NEL(IUNIT) + NTOMOV MRECSZ(IUNIT)=MAX(MRECSZ(IUNIT),NEL(IUNIT)-1) NRECSZ(IUNIT)=MAX(NRECSZ(IUNIT),MRECSZ(IUNIT)) RETURN ELSE D WRITE (*,'(A,3I8)') ' QWRITE 3:',NLEFT,NEL(IUNIT),INDEX C C==== Move NLEFT bytes from user's ARRAY to record BUFFER. C IF (NLEFT.LT.I2P15) THEN CALL LIB$MOVC3(NLEFT,ARRAY(INDEX),BUFFER(NEL(IUNIT),IUNIT)) ELSE C==== Convert buffer size to unsigned integer. CALL LIB$MOVC3(NLEFT-I2P16,ARRAY(INDEX), & BUFFER(NEL(IUNIT),IUNIT)) ENDIF NOBLK = (MIN(LRECSZ(IUNIT),NEL(IUNIT)) - 1) / NPBSZ KEL = NPBSZ * NOBLK KRECSZ = NPBSZ * NRBLK - KEL IF (KRECSZ.GE.I2P15) KRECSZ = KRECSZ - I2P16 RAB(IUNIT).RAB$L_BKT = NVBLK(IUNIT) + NOBLK RAB(IUNIT).RAB$L_RBF = %LOC(BUFFER(KEL+1,IUNIT)) RAB(IUNIT).RAB$W_RSZ = KRECSZ ISTAT = SYS$WRITE(RAB(IUNIT)) D WRITE (*,'(A,5I8)') ' SYS$WRITE 4:', D & IUNIT,NVBLK(IUNIT)+NOBLK,KEL+1,KRECSZ,ISTAT IF (.NOT.ISTAT) GOTO 80 LRECSZ(IUNIT) = NSIZE MRECSZ(IUNIT) = 0 NRECSZ(IUNIT) = 0 NVBLK(IUNIT) = NVBLK(IUNIT) + NRBLK NEL(IUNIT) = 1 NTOMOV = NTOMOV - NLEFT INDEX = INDEX + NLEFT BUFACT(IUNIT) = .FALSE. C IF (NTOMOV.GT.NSIZE) THEN NDO = MIN(NTOMOV/NPBSZ, MAXDO) NBY = NDO*NPBSZ IF (NBY.LT.I2P15) THEN IBY = NBY ELSE IBY = NBY - I2P16 ENDIF RAB(IUNIT).RAB$L_BKT = NVBLK(IUNIT) RAB(IUNIT).RAB$L_RBF = %LOC(ARRAY(INDEX)) RAB(IUNIT).RAB$W_RSZ = IBY ISTAT = SYS$WRITE(RAB(IUNIT)) D WRITE (*,'(A,5I8)') ' SYS$WRITE 5:', D & IUNIT,NVBLK(IUNIT),1,IBY,ISTAT IF (.NOT.ISTAT) GOTO 80 NVBLK(IUNIT) = NVBLK(IUNIT) + NDO INDEX = INDEX + NBY NTOMOV = NTOMOV - NBY ENDIF ENDIF GOTO 70 C 80 CALL LIB$SYS_GETMSG(ISTAT,L,MSG) WRITE (*,'(/1X,A/)') MSG(:MIN(130,L)) CALL CCPERR(1,'QWRITE: FATAL ERROR.') RETURN C C C####################################################################### C C C*QBACK ENTRY QBACK(IUNIT,LRECL) C ======================== C C==== Maybe this should be a soft fail: IUNIT = -1 ? C IF (LUNIT(IUNIT)) THEN CALL CCPERR(1,'QBACK error: File not open.') IUNIT = -1 RETURN ENDIF JEL = NEL(IUNIT) - LRECL * NCHITM(IUNIT) IVBLK = (JEL - NSIZE)/NSIZE JEL = JEL - IVBLK*NSIZE IVBLK = NVBLK(IUNIT) + IVBLK*NRBLK IF (IVBLK.LT.1) THEN IVBLK = 1 JEL = 1 ENDIF GOTO 90 C C C####################################################################### C C C*QSKIP ENTRY QSKIP(IUNIT,LRECL) C ======================== C C==== Maybe this should be a soft fail: IUNIT = -1 ? C IF (LUNIT(IUNIT)) THEN IF (LUNIT(IUNIT)) CALL CCPERR(1,'QSKIP error: File not open.') IUNIT = -1 RETURN ENDIF JEL = NEL(IUNIT) + LRECL*NCHITM(IUNIT) - 1 IVBLK = JEL/NSIZE JEL = JEL - IVBLK*NSIZE + 1 IVBLK = NVBLK(IUNIT) + IVBLK*NRBLK GOTO 90 C C C####################################################################### C C C*QSEEK ENTRY QSEEK(IUNIT,IREC,IEL,LRECL) C ================================= C C==== Maybe this should be a soft fail: IUNIT = -1 ? C IF (LUNIT(IUNIT)) THEN CALL CCPERR(1,'QSEEK error: File not open.') IUNIT = -1 RETURN ENDIF JEL = MAX(((IREC - 1)*LRECL + IEL - 1)*NCHITM(IUNIT), 0) IVBLK = JEL/NSIZE JEL = JEL - IVBLK*NSIZE + 1 IVBLK = IVBLK*NRBLK + 1 C 90 IF (IVBLK.NE.NVBLK(IUNIT)) THEN IF (WRTACT(IUNIT) .AND. NEL(IUNIT).NE.1) THEN IF (MRECSZ(IUNIT).GT.0) THEN NOBLK = (LRECSZ(IUNIT) - 1) / NPBSZ KEL = NPBSZ * NOBLK KRECSZ = MRECSZ(IUNIT) IF (KRECSZ.LT.NRECSZ(IUNIT)) KRECSZ = & MIN(NPBSZ * ((KRECSZ - 1) / NPBSZ + 1), NRECSZ(IUNIT)) KRECSZ = KRECSZ - KEL IF (KRECSZ.GE.I2P15) KRECSZ = KRECSZ - I2P16 RAB(IUNIT).RAB$L_BKT = NVBLK(IUNIT) + NOBLK RAB(IUNIT).RAB$L_RBF = %LOC(BUFFER(KEL+1,IUNIT)) RAB(IUNIT).RAB$W_RSZ = KRECSZ ISTAT = SYS$WRITE(RAB(IUNIT)) D WRITE (*,'(A,5I8)') ' SYS$WRITE 6:', D & IUNIT,NVBLK(IUNIT)+NOBLK,KEL+1,KRECSZ,ISTAT C IF (.NOT.ISTAT) THEN CALL LIB$SYS_GETMSG(ISTAT,L,MSG) WRITE (*,'(/1X,A/)') MSG(:MIN(130,L)) CALL CCPERR(1,'QSEEK: FATAL ERROR -- MAYBE CORRUPT FILE.') RETURN ENDIF LRECSZ(IUNIT) = NSIZE MRECSZ(IUNIT) = 0 NRECSZ(IUNIT) = 0 ENDIF WRTACT(IUNIT) = .FALSE. ENDIF NVBLK(IUNIT) = IVBLK BUFACT(IUNIT) = .FALSE. NEW(IUNIT) = .FALSE. ENDIF C NEL(IUNIT) = JEL D WRITE (*,'(A,8X,I8)') ' QSEEK :',NEL(IUNIT) RETURN C C C####################################################################### C C C*QLOCATE ENTRY QLOCATE(IUNIT,LOCATION) C ============================= C C==== Maybe this should be a soft fail: IUNIT = -1 ? C IF (LUNIT(IUNIT)) THEN CALL CCPERR(1,'QLOCATE error: File not open.') IUNIT = -1 RETURN ENDIF LOCATION = (NEL(IUNIT)+(NVBLK(IUNIT)-1)*NPBSZ+NCHITM(IUNIT)-1)/ & NCHITM(IUNIT) RETURN C C C####################################################################### C C C*QQINQ ENTRY QQINQ(IUNIT,NAME,FILNAM,LENGTH) C ===================================== C C RETURNS FILE NAME AND LENGTH C IF NO NAME RETURN NAME AS BLANK, IF NO LENGTH RETURN LENGTH AS -1 C IF (LUNIT(IUNIT)) THEN INQUIRE (FILE=NAME,NAME=FILNAM) LENGTH = -1 ELSE FILNAM = FNAME(IUNIT) LENGTH = NPBSZ * (MAPXAB(IUNIT).XABFHC.XAB$L_EBK - 1) + & MAPXAB(IUNIT).XABFHC.XAB$W_FFB ENDIF RETURN C C C####################################################################### C C ENTRY QSETMS(IUNIT,MS,IRET) C =========================== C C==== Get machine integer and real types. C CALL QIRTYP(MTIT,MTRT) C C==== Get file integer and real types. C MSIT(IUNIT)=MS(2)/16 IF (MSIT(IUNIT).NE.0 .AND. MSIT(IUNIT).NE.1 .AND. & MSIT(IUNIT).NE.4) THEN WRITE (6,*) '*** BAD FILE INTEGER TYPE, ASSUME NATIVE ***' MSIT(IUNIT)=0 ENDIF MSRT(IUNIT)=MS(1)/16 IF ((MSRT(IUNIT).LT.0 .OR. MSRT(IUNIT).GT.2) .AND. & MSRT(IUNIT).NE.4 .AND. MSRT(IUNIT).NE.5) THEN WRITE (6,*) '*** BAD FILE REAL TYPE, ASSUME NATIVE ***' MSIT(IUNIT)=0 ENDIF IF (MSIT(IUNIT).EQ.0) MSRT(IUNIT)=0 IRET=16*MSIT(IUNIT)+MSRT(IUNIT) IF (MSIT(IUNIT).EQ.MTIT) MSIT(IUNIT)=0 IF (MSRT(IUNIT).EQ.MTRT) MSRT(IUNIT)=0 C WRITE (6,*) 'MSIT, MTIT, MSRT, MTRT =', C & MSIT(IUNIT),MTIT,MSRT(IUNIT),MTRT END C C C####################################################################### C C SUBROUTINE QQOPEN(IUNIT,NAME,ISTAT) C =================================== C C Open file with name NAME, returns IUNIT as unit number C C IMPLICIT NONE CHARACTER*(*) NAME INTEGER IUNIT, ISTAT, NCH C C GOTO (10,20,30,40,50),ISTAT 10 CALL QOPEN(IUNIT,NAME,'UNKNOWN') GOTO 100 20 CALL QOPEN(IUNIT,NAME,'SCRATCH') GOTO 100 30 CALL QOPEN(IUNIT,NAME,'OLD') GOTO 100 40 CALL QOPEN(IUNIT,NAME,'NEW') GOTO 100 50 CALL QOPEN(IUNIT,NAME,'RO') 100 RETURN END C C C####################################################################### C C SUBROUTINE QIRTYP(MI,MR) C ======================== C==== Integer/Real types; assumes equal endedness of integers and reals. IMPLICIT NONE INTEGER*2 I(2) INTEGER J,K,MI,MR REAL A,B,R PARAMETER (A=513./256., B=513./1024.) EQUIVALENCE (I,J), (K,R) DATA I/1,0/, K/1073758208/ IF (J.EQ.65536) THEN C==== Big-endian. MI=1 IF (R.EQ.A) THEN C==== IEEE. MR=1 ELSEIF (R.EQ.B) THEN C==== Convex native. MR=5 ELSE MR=0 ENDIF ELSEIF (J.EQ.1) THEN C==== Little-endian. MI=4 IF (R.EQ.A) THEN C==== IEEE. MR=4 ELSEIF (R.EQ.B) THEN C==== VAX native. MR=2 ELSE MR=0 ENDIF ELSE MI=0 MR=0 ENDIF END C C C####################################################################### C C SUBROUTINE QSWAP1(N,A) C ====================== C C==== Swap bytes N/N+1 for N = 0,2,4... C IMPLICIT NONE INTEGER I,N BYTE A(N),S DO 10 I=1,N,2 S=A(I) A(I)=A(I+1) 10 A(I+1)=S END C C C####################################################################### C C SUBROUTINE QSWAP2(N,A) C ====================== C C==== Swap bytes N/N+2 and N+1/N+3 for N = 0,4,8... C IMPLICIT NONE INTEGER I,N BYTE A(N),S DO 10 I=1,N,4 S=A(I) A(I)=A(I+2) A(I+2)=S S=A(I+1) A(I+1)=A(I+3) 10 A(I+3)=S END C C C####################################################################### C C SUBROUTINE QSWAP3(N,A) C ====================== C C==== Swap bytes N/N+3 and N+1/N+2 for N = 0,4,8... C IMPLICIT NONE INTEGER I,N BYTE A(N),S DO 10 I=1,N,4 S=A(I) A(I)=A(I+3) A(I+3)=S S=A(I+1) A(I+1)=A(I+2) 10 A(I+2)=S END C C C####################################################################### C C SUBROUTINE QFIEEE(N,A) C ====================== C C==== Convert from IEEE to VAX native, assuming IEEE byte order. C==== NaN (not a number) becomes ROP (reserved operand). C IMPLICIT NONE INTEGER IEXP,MANT,MDN1,MDN2,MEXP,MNAN,ROP PARAMETER (IEXP='01000000'X,MANT='003FFFFF'X,MDN1='00400000'X, & MDN2='00200000'X,MEXP='7E800000'X,MNAN='7F800000'X, & ROP='80000000'X) INTEGER E,I,N INTEGER A(N) C DO 10 I=1,N E=A(I).AND.MNAN IF (E.GT.0) THEN IF (E.LE.MEXP) THEN A(I)=A(I)+IEXP ELSEIF (E.LT.MNAN) THEN A(I)=ROP ELSE A(I)=ROP.OR.(A(I).AND..NOT.MNAN) ENDIF ELSEIF ((A(I).AND.MDN1).NE.0) THEN A(I)=(A(I).AND.ROP).OR.2*(A(I).AND.MANT).OR.IEXP ELSEIF ((A(I).AND.MDN2).NE.0) THEN A(I)=(A(I).AND.ROP).OR.4*(A(I).AND.MANT) ELSE A(I)=0 ENDIF 10 CONTINUE END C C C####################################################################### C C SUBROUTINE QTIEEE(N,A) C ====================== C C==== Convert to IEEE from VAX/Convex native, assuming IEEE byte order. C==== ROP (reserved operand) becomes NaN (not a number). C IMPLICIT NONE INTEGER IEXP,MDN1,MDN2,MNAN PARAMETER (IEXP='01000000'X,MDN1='00400000'X,MDN2='00200000'X, & MNAN='7F800000'X) INTEGER E,I,N INTEGER A(N) C DO 10 I=1,N E=A(I).AND.MNAN IF (E.GT.IEXP) THEN A(I)=A(I)-IEXP ELSEIF (E.EQ.0) THEN IF (A(I).LT.0) THEN A(I)=A(I).OR.MNAN ELSE A(I)=0 ENDIF ELSE IF (E.EQ.IEXP) THEN A(I)=(A(I)/2.AND..NOT.MNAN).OR.MDN1 ELSE A(I)=((A(I)+SIGN(2,A(I)))/4.AND..NOT.MNAN).OR.MDN2 ENDIF ENDIF 10 CONTINUE END C C C####################################################################### C C SUBROUTINE QRARCH(IUNIT,IEL,IRET) C ================================= C==== Read machine integer/real type from file. IMPLICIT NONE INTEGER I,IUNIT,IEL,IRET CHARACTER MSG*16 BYTE MS(4) C CALL UGTENV('CCP4_NATIVE',MSG) IF (MSG.NE.' ') THEN IRET=0 ELSE CALL QMODE(IUNIT,0,IRET) CALL QSEEK(IUNIT,1,4*IEL+1,0) CALL QREAD(IUNIT,MS,2,IRET) IF (IRET.NE.0) CALL CCPERR(1,'*** FATAL ERROR IN QRARCH ***') C WRITE(6,*)'MS =',MS(1),MS(2) CALL QSETMS(IUNIT,MS,IRET) ENDIF END C C C####################################################################### C C SUBROUTINE QWARCH(IUNIT,IEL) C ============================ C==== Write machine integer/real type to file. IMPLICIT NONE INTEGER IUNIT,IEL,IRET,MTIT,MTRT BYTE MS(4) DATA MS/4*0/ C CALL QIRTYP(MTIT,MTRT) C WRITE (6,*) 'MTIT, MTRT =',MTIT,MTRT MS(1)=17*MTRT MS(2)=16*MTIT+1 CALL QMODE(IUNIT,0,IRET) CALL QSEEK(IUNIT,1,4*IEL+1,0) CALL QWRITE(IUNIT,MS,4) END C C C####################################################################### C C SUBROUTINE QNAN(VALUE) C==== Get undefined number value. IMPLICIT NONE INTEGER NAN,ROPC,ROPV PARAMETER (NAN='FFFA5A5A'X,ROPC='80000000'X,ROPV='8000'X) INTEGER INAN,MTIT,MTRT REAL RNAN, VALUE EQUIVALENCE(INAN,RNAN) C CALL QIRTYP(MTIT,MTRT) IF (MTRT.EQ.1 .OR. MTRT.EQ.4) THEN INAN=NAN ELSEIF (MTRT.EQ.5) THEN INAN=ROPC ELSEIF (MTRT.EQ.2) THEN INAN=ROPV ELSE CALL CCPERR(1,'*** FATAL: QNAN machine type undefined.') ENDIF VALUE=RNAN END C C C####################################################################### C C LOGICAL FUNCTION QISNAN(A) C==== Test undefined number value. IMPLICIT NONE INTEGER MNAN,MROPC,MROPV,ROPC,ROPV PARAMETER (MNAN='7F800000'X,MROPC='FF800000'X,MROPV='FF80'X, & ROPC='80000000'X,ROPV='8000'X) INTEGER N,MTIT,MTRT REAL A,R EQUIVALENCE(N,R) C R=A CALL QIRTYP(MTIT,MTRT) IF (MTRT.EQ.2) THEN QISNAN=(N.AND.MROPV).EQ.ROPV ELSEIF (MTRT.EQ.5) THEN QISNAN=(N.AND.MROPC).EQ.ROPC ELSE IF (MTRT.EQ.1 .OR. MTRT.EQ.4) THEN QISNAN=(N.AND.MNAN).EQ.MNAN ELSE CALL CCPERR(1,'*** FATAL: QISNAN machine type undefined.') ENDIF END C C C####################################################################### C C SUBROUTINE CCPBML (N, A) C Reset BIOMOL absence flags to zero in N elements of array A, C testing for Rops. (We rely on the default optimisation to inline C the QISNAN, which otherwise will be called for each number in the C MTZ file.) INTEGER N, I REAL A (*) LOGICAL QISNAN EXTERNAL QISNAN DO I=1,N IF (.NOT.QISNAN (A(I))) THEN IF (A(I).LE.-0.99E10) A(I) = 0.0 ENDIF ENDDO END C C C####################################################################### C C SUBROUTINE CCPWRG (N, A, WRANGE) C This a an Rop-safe routine to update the column ranges needed by C mtzlib INTEGER I, N REAL A (*), WRANGE (2,N,*) LOGICAL QISNAN EXTERNAL QISNAN DO I=1,N IF (.NOT.QISNAN (A(I))) THEN IF (A(I).NE.-1E-10) THEN IF (A(I).LT.WRANGE(1,I,1)) WRANGE(1,I,1) = A(I) IF (A(I).GT.WRANGE(2,I,1)) WRANGE(2,I,1) = A(I) ENDIF ENDIF ENDDO END C C C####################################################################### C Reading and writing CHARACTER BUFFER, len(buffer) bytes, mode 0. C (It may be possible to declare BUFFER as a structure and get the C data address directly, without calling STR$ANALYZE_SDESC.) SUBROUTINE QREADC (IUNIT,BUFFER,RESULT) PARAMETER (NCMAX=10) INTEGER IUNIT, NITEMS, RESULT, MODE, OLDMODE, NMODE(NCMAX), MITEM CHARACTER BUFFER*(*) COMMON /DISKIO_MODES_/ MAXNC, NMODE IF (IUNIT.GT.MAXNC .OR. IUNIT.LT.1) + CALL CCPERR (1, 'QREADC: Bad unit number') C save the old mode and change to bytes OLDMODE = NMODE (IUNIT) CALL QMODE (IUNIT,0,MITEM) CALL STR$ANALYZE_SDESC (BUFFER, NITEMS, IPTR) CALL QREAD (IUNIT,%VAL(IPTR),NITEMS,RESULT) C restore mode CALL QMODE (IUNIT,OLDMODE,MITEM) END SUBROUTINE QWRITC (IUNIT,BUFFER,RESULT) PARAMETER (NCMAX=10) INTEGER IUNIT, NITEMS, RESULT, MODE, OLDMODE, NMODE(NCMAX), MITEM CHARACTER BUFFER*(*) COMMON /DISKIO_MODES_/ MAXNC, NMODE IF (IUNIT.GT.MAXNC .OR. IUNIT.LT.1) + CALL CCPERR (1, 'QREADC: Bad unit number') C save the old mode and change to bytes OLDMODE = NMODE (IUNIT) CALL QMODE (IUNIT,0,MITEM) CALL STR$ANALYZE_SDESC (BUFFER, NITEMS, IPTR) CALL QWRITE (IUNIT,%VAL(IPTR),NITEMS,RESULT) C restore mode CALL QMODE (IUNIT,OLDMODE,MITEM) END SUBROUTINE CUNLINK (FILE) C Dummy version -- can't unlink VMS files CHARACTER *(*) FILE END libccp4-8.0.0/fortran/w32mvs.f0000644000000000000000000007747314242731033014171 0ustar 00000000000000C C w32mvs.f: platform-dependent low-level functions for MVS C Copyright (C) 1999 Alun Ashton C C This library is free software: you can redistribute it and/or C modify it under the terms of the GNU Lesser General Public License C version 3, modified in accordance with the provisions of the C license to address the requirements of UK law. C C You should have received a copy of the modified GNU Lesser General C Public License along with this library. If not, copies may be C downloaded from http://www.ccp4.ac.uk/ccp4license.php C C This program is distributed in the hope that it will be useful, C but WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C GNU Lesser General Public License for more details. C C *** this file is an equivelant to unix.f or vms.for but C *** for the microsoft visual studio packages. C C ======== C w32mvs.f C ======== C C CCPOPN - open a file C UBYTES - Returns number of bytes per word and 'words'/'bytes' C to indicate if byte handling is available C UCPUTM - Get CPU time C UGERR - Get error explanation C UGTENV - Get value of env. variable C UGTUID - Get user id - it's name C UIDATE - Get date in 3 integer C UISATT - Is file a terminal? C USTIME - Get absolute time in seconds (-1 for VMS) C UTIME - Get current time C VAXVMS - Logical function returns TRUE if VAX/VMS C WINMVS - Logical function returns TRUE if W32/Microsoft dev studio C TTSEND - Write string to terminal with various carriage control C options C GETELAPSED - Print timing info for CCPERR - removed for now C UGTARG - Get command-line argument C GETREF - Abstracted from abscale since it has BYTE declaration. C CCPSPW - Spawns a new process to run shell command C RTNBKS - Returns a Backslash as unix compilers are fussy! C C SUBROUTINE CCPOPN(IIUN,LOGNAM,KSTAT,ITYPE,LREC,IFAIL) C ==================================================== C C---- This subroutine is used to open a file C C The requirement to specify that leading carriage control C characters in the output records should be obeyed (or not) can't C be implemented portably; likewise specifying readonly opening. C Some compilers accept VAXtran `carriagecontrol=' and `readonly' C specifiers; if so we use them. Others have IOINIT, which can be C used to specify the carriage control. The HPUX compiler is said C not to have any means of doing this and AIX seems to be likewise, C sigh; they both seem to obey the normal unix convention of C printing the as-is rather than obeying the first character C as carriage control. Concentrix does obey the first column a la C VMS and `traditional' Fortran; the MIPS compilers have a compile C (link?) option to do so. Unfortunately, carriagecontrol C specification isn't even defined in Fortan90, although C `ACTION="READ"' can be used. C C PARAMETERS C ========== C C IIUN (I) UNIT NUMBER C LOGNAM (I) LOGICAL FILE NAME (UP TO 8 CHARACTERS) C KSTAT (I) FILE STATUS FLAG =1, 'UNKNOWN' C =2, 'SCRATCH' C =3, 'OLD' C =4, 'NEW' C =5, 'READONLY' C =6, 'PRINTER' C ITYPE (I) FILE TYPE FLAG =1, 'SEQUENTIAL' 'FORMATTED' C =2, 'SEQUENTIAL' 'UNFORMATTED' C =3, 'DIRECT' 'FORMATTED' C =4, 'DIRECT' 'UNFORMATTED' C LREC (I) RECORD LENGTH FOR DIRECT ACCESS FILE (NO. OF C CHARACTERS FOR A FORMATTED FILE OR WORDS FOR C AN UNFORMATTED FILE). NOT RELEVANT FOR A SEQUENTIAL C FILE C IFAIL (I/O) ON INPUT: =0, STOP ON OPEN FAILURE C =1, CONTINUE AFTER OPEN FAILURE C =2, CONTINUE SILENTLY AFTER OPEN FAILURE C ON OUTPUT: UNCHANGED IF FILE OPEN OK C =-1, ERROR IN OPENING FILE C C .. Scalar Arguments .. INTEGER IFAIL,KSTAT,ITYPE,IIUN,LREC CHARACTER LOGNAM* (*) C .. C .. Local Scalars .. INTEGER LLREC,IUN,IBYTES,ISTAT,L,IOS CHARACTER CCNTRL*7,ST*7,FRM*12,ERRSTR*500, + NAMFIL*255,HANDLE*5,OPNVAR*20, access*10 INTEGER UNKNWN, SCRTCH, OLD, NEW, RDONLY, PRINTR PARAMETER (UNKNWN=1, SCRTCH=2, OLD=3, NEW=4, RDONLY=5, PRINTR=6) LOGICAL CCPEXS, LNONAM C .. C .. Local Arrays .. CHARACTER STAT(6)*7, DISP*6 C .. C .. External Functions .. INTEGER LENSTR, LUNSTO EXTERNAL LENSTR, LUNSTO C .. C .. External Subroutines .. EXTERNAL UGERR,UGTENV, CCPEXS C .. C .. Data statements .. C NB mustn't have SCRATCH in here, because result is system C -dependent c but as this is a system dependant file its ok! DATA STAT/'UNKNOWN','SCRATCH','OLD','NEW','OLD','UNKNOWN'/ C .. C ISTAT = KSTAT C Negative unit number means don't give messages for successful open IUN = IIUN IF (IIUN.LT.0) IUN = -IIUN C Check args: IF (ISTAT.LT.1 .OR. ISTAT.GT.6 .OR. ITYPE.LT.1 .OR. ITYPE.GT.4) + THEN IF (IFAIL.EQ.0) THEN CALL CCPERR(1, + '**CCPOPN ERROR** Invalid parameters in call') ELSE WRITE (LUNSTO(1), + '('' **CCPOPN ERROR** Invalid parameters in call'',/)') IFAIL = -1 END IF RETURN ENDIF C C Do nothing for pre-connected units (what's the significance of C `TERM...'?) IF (LOGNAM.EQ.'DATA' .OR. LOGNAM.EQ.'PRINTER' .OR. + LOGNAM(:4).EQ.'TERM') RETURN C C if environment variable CCP4_OPEN has value `UNKNOWN', open files C with status UNKNOWN rather than new if they exist IF (ISTAT.EQ.NEW) THEN OPNVAR = ' ' CALL UGTENV('CCP4_OPEN',OPNVAR) IF (OPNVAR.EQ.'UNKNOWN' .OR. OPNVAR.EQ.'unknown') ISTAT = 1 END IF C C check for `logical name' referencing real file CALL UGTENV(LOGNAM,NAMFIL) LNONAM = .FALSE. IF (NAMFIL.EQ.' ') THEN IF (.NOT. CCPEXS(LOGNAM)) LNONAM = .TRUE. NAMFIL = LOGNAM END IF C VMS null device (VMS code canonicalises /dev/null) IF (NAMFIL.EQ.'NL:' .OR. NAMFIL.EQ.'nl:') NAMFIL='/dev/null' C Special case: /dev/null should be opened UNKNOWN IF ( NAMFIL.EQ.'/dev/null') ISTAT = 1 C C type of open ST = STAT(ISTAT) IF (ITYPE.EQ.2 .OR. ITYPE.EQ.4) THEN FRM = 'UNFORMATTED' ELSE FRM = 'FORMATTED' ENDIF IF (ITYPE .EQ. 1 .OR. ITYPE.EQ.2) THEN ACCESS='SEQUENTIAL' ELSE ACCESS='DIRECT' ENDIF C IF (ISTAT.EQ.SCRTCH) THEN DISP = 'DELETE' ELSE DISP = 'KEEP' ENDIF C IF (access.eq.'DIRECT') THEN C Need to check is record length in words or bytes and set LLREC C accordingly. CALL UBYTES (IBYTES,HANDLE) LLREC = LREC*IBYTES IF (HANDLE.EQ.'WORDS'.AND.ITYPE.EQ.4) LLREC=LLREC/IBYTES IF (ISTAT.EQ.RDONLY) THEN C may be defined as null or as `READONLY,' OPEN(UNIT=IUN,STATUS='UNKNOWN',ACCESS='DIRECT',FORM=FRM, + READONLY, + FILE=NAMFIL,RECL=LLREC,IOSTAT=IOS,ERR=5) ELSE OPEN(UNIT=IUN,STATUS='UNKNOWN',ACCESS='DIRECT',FORM=FRM, + DISPOSE=DISP, + FILE=NAMFIL,RECL=LLREC,IOSTAT=IOS,ERR=5) ENDIF ELSE C if available, carriagecontrol='fortran' for print file, else = C 'list'. we can use ioinit instead where it's available (see e.g. C Sun manual). IF (ISTAT.EQ.PRINTR) THEN C want to obey characters in column 1 CCNTRL = 'FORTRAN' FRM = 'FORMATTED' ELSE C no special significance to column 1 CCNTRL = 'LIST' END IF IF (FRM .EQ. 'UNFORMATTED') THEN C (carriage control not relevant) IF (ISTAT.EQ.RDONLY) THEN OPEN(UNIT=IUN, FILE=NAMFIL, STATUS=ST, ACCESS='SEQUENTIAL', + READONLY, + FORM=FRM, ERR=5, IOSTAT=IOS) ELSE OPEN(UNIT=IUN, FILE=NAMFIL, STATUS=ST, ACCESS='SEQUENTIAL', + DISPOSE=DISP, + FORM=FRM, ERR=5, IOSTAT=IOS) ENDIF ELSE IF (ISTAT.EQ.RDONLY) THEN OPEN(UNIT=IUN, FILE=NAMFIL, STATUS=ST, ACCESS='SEQUENTIAL', + READONLY, + CARRIAGECONTROL=CCNTRL, + FORM=FRM, ERR=5, IOSTAT=IOS) ELSE OPEN(UNIT=IUN, FILE=NAMFIL, STATUS=ST, ACCESS='SEQUENTIAL', + CARRIAGECONTROL=CCNTRL, + DISPOSE=DISP, + FORM=FRM, ERR=5, IOSTAT=IOS) ENDIF ENDIF ENDIF C C Scratch files are immediately unlinked from the directory; they C become inaccessible only when closed, but don't appear in the C directory and the name can be re-used. C NB this may break with REWIND if that is implemented as close + C reopen, sigh. See also above c *** this now removed for windows. we will try actually opeing scratch files instead c IF (ISTAT.EQ.SCRTCH) CALL CUNLINK(NAMFIL) C C Error check 5 CONTINUE C don't report UNKNOWN if actually SCRATCH IF (ISTAT.EQ.SCRTCH) ST = 'SCRATCH' IF (IOS.NE.0) THEN CALL UGERR(IOS,ERRSTR) IF (IFAIL.EQ.0) THEN C warning if there was no file associated with logical name IF (LNONAM) THEN ERRSTR = 'CCPOPN Logical name '//LOGNAM ERRSTR(LENSTR(ERRSTR)+2:) = 'has no associated file name' CALL CCPERR(2,ERRSTR) END IF C hard failure WRITE (LUNSTO (1),FMT=6002) IUN, NAMFIL(1:LENSTR(NAMFIL)), + LOGNAM(1:LENSTR(LOGNAM)) 6002 FORMAT (' Open failed: Unit:',I4,', File: ',A, ' (logical: ', + A, ')') ERRSTR = ' Open failed: File: ' // NAMFIL CALL CCPERR(-1, ERRSTR) else C soft failure IF (IFAIL.EQ.1) WRITE (lunsto (1),FMT=6004) FRM, ST, IUN, + LOGNAM(1:LENSTR(LOGNAM)), NAMFIL(1:LENSTR(NAMFIL)), + ERRSTR(1:LENSTR(ERRSTR)) 6004 FORMAT (' **CCPOPN ERROR** ',A,3X,A, + ' file open failure on unit ',I3,/' Logical name: ', + A,', ','File name: ',A/1X,A/) IFAIL = -1 RETURN ENDIF ELSE IF (IIUN.LE.0) RETURN WRITE (ERRSTR,FMT=6000) FRM,ST,IUN CALL QPRINT (1, ' ') CALL QPRINT (1, ERRSTR) call ccp4h_summary_beg() ERRSTR = 'Logical name: ' ERRSTR (15:) = LOGNAM L = MIN(LENSTR (ERRSTR) + 1, LEN (ERRSTR)) ERRSTR (L:) = ', Filename: ' // NAMFIL CALL QPRINT (1, ERRSTR) call ccp4h_summary_end() CALL QPRINT (1, ' ') 6000 FORMAT (A,3X,A,' file opened on unit ',I3) ENDIF END C C C ============================== SUBROUTINE UBYTES(INUM,STRING) C ============================== C C UBYTES - Return statistics about byte handling C C Input: none C C Output: INUM - number of bytes per word C HANDLE - 'WORDS' or 'BYTES' C HANDLE - For unformatted files records are usually C counted in 'BYTES', however both VAX and C SGI swap to 'WORDS' for this file type. C C Arguments: INTEGER INUM C CHARACTER*5 HANDLE C C Usage: CALL UBYTES (INUM,HANDLE) C C .. Scalar Arguments .. INTEGER INUM CHARACTER STRING*5 C .. C C INUM = 4 STRING = 'BYTES' C END C C C ====================== SUBROUTINE UCPUTM(SEC) C ====================== C C Get CPU time in seconds C C Parameter: C REAL SEC (i/o): If sec<=0.0, initialize timer and return current C elapsed cpu time since start of execution, otherwise C return elapsed cpu since timer was initialized. C Time is in seconds. C C .. Scalar Arguments .. REAL SEC C .. C .. Local Scalars .. REAL TLAST C .. C .. Local Arrays .. REAL TARRAY(2) C .. C .. Save statement .. SAVE TLAST C .. IF (SEC.LE.0.0) THEN TLAST = ETIME (TARRAY) SEC = TLAST ELSE SEC = ETIME (TARRAY) - TLAST ENDIF END C C C =============================== SUBROUTINE UGERR(STATUS,ERRSTR) C =============================== cDEC$ IF DEFINED (__INTEL_COMPILER) USE IFCORE cDEC$ ENDIF C UGERR - Get error message string for error number in STATUS C (supposedly). Actually it ignores STATUS and always uses the C *last* error that occurred. C C Input: STATUS - Error number (if negative print error message) C C Output: ERRSTR - Error message string C C Arguments: INTEGER STATUS C CHARACTER*(*) ERRSTR C C Usage: CALL UGERR(STATUS, ERRSTR) C C .. Scalar Arguments .. INTEGER STATUS CHARACTER ERRSTR* (*) C .. C .. Local Scalars .. LOGICAL IPRINT C .. C .. External Subroutines .. INTEGER IERRNO, LUNSTO EXTERNAL IERRNO, LUNSTO C .. IPRINT = .FALSE. IF (STATUS.LT.0) THEN IPRINT = .TRUE. STATUS = -STATUS END IF C C---- Get error message from system C IF (IERRNO().NE.0) THEN CALL GERROR(ERRSTR) ELSE ERRSTR = ' ' ENDIF IF (IPRINT) WRITE (LUNSTO(1),FMT=6000) 'UGERR',ERRSTR C 6000 FORMAT (' ',A,': ',A) END C C ================================ SUBROUTINE UGTENV(NAMENV,VALENV) C ================================ C C UGTENV - Get value of env. variable C C Input: NAMENV - Logical Name (trailing blanks are stripped) C C Output: VALENV - Its value C C Arguments: CHARACTER*(*) NAMENV, VALENV C C Usage: CALL UGTENV(NAMENV, VALENV) C C .. Scalar Arguments .. CHARACTER NAMENV* (*),VALENV* (*) C .. C .. External Subroutines .. C don't declare getenv INTEGER LENSTR EXTERNAL LENSTR C .. CALL GETENV(NAMENV(:LENSTR(NAMENV)),VALENV) C END C C C ========================= SUBROUTINE UGTUID(USRNAM) C ========================= C C UGTUID - Get user ID C C Customised for win nt C C Input: none C C Output: UID - user ID string C C Arguments: CHARACTER*(*) UID C C Usage: CALL UGTUID(UID) C C .. Scalar Arguments .. CHARACTER USRNAM* (*) C .. C .. External Subroutines .. C don't declare getenv C .. C CALL GETENV('USER',USRNAM) CALL GETLOG(USRNAM) IF (USRNAM.EQ.' ') CALL GETENV('LOGNAME',USRNAM) C END C C C ==================================== SUBROUTINE UIDATE(IMONTH,IDAY,IYEAR) C ==================================== C C UIDATE - Get date in 3 integer . Alliant uses INTEGER*4 C and order is IDAY,IMONTH,IYEAR C C Input: none C C Output: MONTH,DAY,YEAR C C Arguments: INTEGER MONTH, DAY, YEAR C C Usage: CALL UIDATE(MONTH, DAY, YEAR) C C .. Scalar Arguments .. INTEGER IDAY,IMONTH,IYEAR C .. Local Arrays .. INTEGER IARRAY(3) C .. C don't declare IDATE -- it's often an intrinsic to avoid confusion C between the two possible calling sequences. On SGI, it's only C documented in one style but seems to work with the canonical C Unix one too; however, the order of the arguments of the C documented version (used here) *isn't* the same as for VMS... C CALL IDATE (IARRAY(1), IARRAY(2), IARRAY(3)) IDAY = IARRAY(1) IMONTH = IARRAY(2) IYEAR = IARRAY(3) C END C C C ============================== SUBROUTINE UISATT(FLUN,ANSWER) C ============================== C C UISATT - This function determines whether a program is being C run on-line if this information is available. C C Input: FLUN - Fortran Unit Number C C Output: ANS - 1 for on-line, 0 otherwise C C Arguments: INTEGER FLUN, ANS C C Usage: CALL UISATT (FLUN,ANS) C C .. Scalar Arguments .. INTEGER ANSWER,FLUN C .. LOGICAL ISATTY EXTERNAL ISATTY ANSWER = 0 IF (ISATTY(FLUN)) ANSWER = 1 C END C C C ======================= SUBROUTINE USTIME(ISEC) C ======================= C C USTIME - Get absolute time in seconds. C Convex uses STIME (), others seem to use TIME (). C C Input: none C C Output: SEC C C Arguments: INTEGER SEC C C Usage: CALL USTIME(SEC) C INTEGER ISEC C INTEGER TIME C ISEC = TIME() C END C C C ======================= SUBROUTINE UTIME(CTIME) C ======================= C C UTIME - Get current time hh:mm:ss C C Input: none C C Output: TIME - as ASCII string C C Arguments: CHARACTER*(*) CTIME C C Usage: CALL UTIME(CTIME) C C .. Scalar Arguments .. CHARACTER CTIME* (*) C .. C .. Local Arrays .. INTEGER IARRAY(3) C .. CALL ITIME(IARRAY) WRITE (CTIME,FMT=6000) IARRAY(1),IARRAY(2),IARRAY(3) 6000 FORMAT (I2,2 (':',I2.2)) END C C C ========================= LOGICAL FUNCTION VAXVMS() C ========================= C C VAXVMS - Operating Sytem in use returns .TRUE. if VAXVMS C C Input: none C C Returns: .TRUE. for VAXVMS, .FALSE. otherwise C C Arguments: none C C Usage: VAXVMS () C VAXVMS = .FALSE. C END C C C ========================= LOGICAL FUNCTION WINMVS() C ========================= C C WINMVS - Windows mircrosoft Visual Studio C C Input: none C C Returns: .TRUE. for WINMVS, .FALSE. otherwise C C Arguments: none C C Usage: WINMVS () C WINMVS = .TRUE. C END C C C SUBROUTINE 'TTSEND' C =================== C C Write a string to a terminal with various carriage control options C for LAUE C SUBROUTINE TTSEND (IUN, STR, ICC) C C Parameters: C C IUN (I) Unit number for the output C STR (I) The string to be output C ICC (I) = 0, no carriage control at the end of the string C (for prompts) C e.g. for routine TPROMP C = 1, normal carriage control C e.g. for routine TWRITE C = 2, no carriage control (for sending escape/control C character sequences to ANSI/T4014 terminals) C e.g. for QSCREEN graphics routines C = 3, Output line at current point on screen (no leading C line feed or carriage return - trailing does not C matter) C C Machine dependence examples: Convex 1000 FORMAT (A,$) C 1001 FORMAT (A) C 1002 FORMAT (A,$) C 1003 FORMAT (A) C C Vax 1000 FORMAT (' ',A,$) C 1001 FORMAT (' ',A) C 1002 FORMAT ('+',A,$) C 1003 FORMAT ('+',A) C C C====== Specification statements C CHARACTER*(*) STR CHARACTER*10 CCNTRL C C====== Write string C C 'LIST' is the equivalent of the normal unix state CCNTRL = 'LIST' C in the case of systems obeying the carriagecontrol specifier, C we assume the stream has actually been opened, so that the C specifier is suitably defined -- on the Alliant, for instance, C it will be 'UNKNOWN' for an unopened stream (6 is pre-opened) C IF (CCNTRL .EQ. 'FORTRAN') THEN C VMS-type IF (ICC.EQ.0) THEN WRITE (IUN,1004) STR ELSE IF (ICC.EQ.2) THEN WRITE (IUN,1006) STR ELSE IF (ICC.EQ.3) THEN WRITE (IUN,1007) STR ELSE WRITE (IUN,1005) STR ENDIF ELSE IF (ICC.EQ.0) THEN WRITE (IUN,1000) STR ELSE IF (ICC.EQ.2) THEN WRITE (IUN,1002) STR ELSE IF (ICC.EQ.3) THEN WRITE (IUN,1003) STR ELSE WRITE (IUN,1001) STR ENDIF ENDIF C these formats are mostly non-standard, of course... 1000 FORMAT (A,$) 1001 FORMAT (A) 1002 FORMAT (A,$) 1003 FORMAT (A) 1004 FORMAT (' ',A,$) 1005 FORMAT (' ',A) 1006 FORMAT ('+',A,$) 1007 FORMAT ('+',A) END C C C ===================== c SUBROUTINE GETELAPSED cC ===================== cC c EXTERNAL LUNSTO, USTIME c INTEGER LUNSTO c REAL TARRAY(2), JUNK c INTEGER ELAPS, START c LOGICAL INITED c SAVE START, INITED c DATA INITED /.FALSE./ cC c JUNK = ETIME(TARRAY) c CALL USTIME(ELAPS) c ELAPS = ELAPS - START cC don't print anything if it hasn't been initialised (by CCPFYP) c IF (INITED) WRITE(LUNSTO(1),6000) TARRAY(1), TARRAY(2), c + ELAPS/60, MOD(ELAPS, 60) c 6000 FORMAT(' Times: User: ', F9.1, 's System: ', F6.1, 's Elapsed:', c + I5 , ':',I2.2) cC c ENTRY INITFYP c CALL USTIME(START) c INITED = .TRUE. cC Machine-dependent startup, e.g. set FPE on SunOS c END C SUBROUTINE UGTARG(I, ARG) INTEGER I CHARACTER *(*) ARG CALL GETARG(I, ARG) END C C ===================================================== SUBROUTINE GETREF(KERFLG,NREAD,NSPOTS,DYNAM,MAXOMITL) C ===================================================== C C This has been abtracted from ABSCALE because of the BYTE C declaration. C C implicit none C C C C C C Read one reflection into common /IND/, skipping unmeasured reflections C Return 1 if end of file or all N spots found C Both integrated and profile fitted I's and SD's are stored, one in C INTT,SD and the other in INTT2,SD2. The values in INTT,SD are used C in scaling, and this is chosen on input card 1 to be either the C integrated or profile fitted value. C C C This routine is probably VAX specific in its unpacking of indices C C C C---- IC generate file variables C C C C .. Scalar Arguments .. INTEGER NREAD,NSPOTS,KERFLG,MAXOMITL LOGICAL DYNAM C .. C .. Scalars in Common .. INTEGER IREC,IX,IY,JGUNIT,JH,JK,JL,MND LOGICAL PROFILE C .. C .. Arrays in Common .. REAL SPACER(12) INTEGER INTT(3),INTT2(3),ISD(3),ISD2(3),JUNK(2) C .. C .. Local Scalars .. INTEGER I,ICOL,ICOL2,IER,I4INTS,I4INTP BYTE IR,IM C .. C .. Local Arrays .. cejd INTEGER*2 IBUF(18) INTEGER*2 IBUF(19) BYTE B(2) C .. C .. External Subroutines .. EXTERNAL QREAD C .. C .. Common blocks .. LOGICAL BRIEF INTEGER IBRIEF COMMON /BRF/ BRIEF,IBRIEF COMMON /IND/JH,JK,JL,MND,JUNK,IX,IY,SPACER,INTT,ISD, + INTT2,ISD2 COMMON /INREC/JGUNIT,IREC COMMON /INTTYP/PROFILE C .. C .. Equivalences .. EQUIVALENCE (B(1),IBUF(4)), (B(1),IR), (B(2),IM) EQUIVALENCE (I4INTS,IBUF(7)),(I4INTP,IBUF(13)) C .. SAVE C C KERFLG = 0 C C 10 CONTINUE NREAD = NREAD + 1 C C IF (NREAD.GT.NSPOTS) THEN GO TO 40 ELSE C C ************************* CALL QREAD(JGUNIT,IBUF,36,IER) C ************************* C IREC = IREC + 1 IF (IER.NE.0) THEN GO TO 30 C C---- If rejected, skip to next refl C CAL ALLOW IR TO HAVE VALUES 5,6 ELSE IF ((IR.NE.0).AND.(IR.LE.4)) THEN GO TO 10 END IF END IF C C JH = IBUF(1) JK = IBUF(2) JL = IBUF(3) MND = IM IF (MND.LT.0) MND = 8 IX = IBUF(5) IY = IBUF(6) C C---- A film intensity in ibuf(7) for integrated intensities or C ibuf(13) for profile fitted intensities C IF (PROFILE) THEN ICOL = 13 ICOL2 = 7 ELSE ICOL = 7 ICOL2 = 13 END IF C C DO 20 I = 1,3 IF (DYNAM) THEN ISD(I) = IBUF(ICOL+2) ISD2(I) = IBUF(ICOL2+2) IF (PROFILE) THEN INTT(I) = I4INTP INTT2(I) = I4INTS ELSE INTT(I) = I4INTS INTT2(I) = I4INTP END IF ELSE INTT(I) = IBUF(ICOL) ISD(I) = IBUF(ICOL+1) INTT2(I) = IBUF(ICOL2) ISD2(I) = IBUF(ICOL2+1) END IF C C---- Test for badspots (isd=-9999) change to unmeasured C this will also reject overloaded reflections C-AL Change this so overloads are rejected (and counted) in RDREF C IF ( (ISD(I) .EQ. -9999) .AND. + (INTT(I) .NE. MAXOMITL) ) INTT(I) = -9999 IF ( (ISD2(I) .EQ. -9999) .AND. + (INTT2(I) .NE. MAXOMITL) ) + INTT2(I) = -9999 C C ICOL = ICOL + 2 ICOL2 = ICOL2 + 2 20 CONTINUE RETURN 30 KERFLG = -1 RETURN 40 KERFLG = -1 RETURN C C END C_BEGIN_CCPSPW SUBROUTINE CCPSPW(STRING) C ========================= C C Spawns a new process to run shell command C C Arguments: C ========== C C STRING (I) CHARACTER*(*): string containing command C_END_CCPSPW C CHARACTER STRING*(*) EXTERNAL SYSTEM CALL SYSTEM(STRING) END C SUBROUTINE CCPAL1 (ROUTNE, N, TYPE, LENGTH) C C Arrange to call ROUTNE with N TYPEd array arguments of given C LENGTH (see CCPALC) C EXTERNAL ROUTNE INTEGER N, TYPE (*), LENGTH (*) INTEGER I, SIZES (5), POINTER (12), ISTAT C bytes per word (assuming 32 bit words...) DATA SIZES /4,4,8,8,1/ C The calling routine, CCPALC, will have checked that the arguments C are in range DO I=1,N POINTER(I) = malloc(SIZES(TYPE (I))*LENGTH(I)) IF (POINTER(I) .eq. 0) + CALL CCPERR (-1, 'CCPALC: can''t allocate memory') CALL CCPZBI (%VAL(POINTER(I)), SIZES(TYPE (I))*LENGTH(I)) ENDDO IF (N.EQ.1) THEN CALL ROUTNE (LENGTH (1), %VAL(POINTER(1))) ELSE IF (N.EQ.2) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2))) ELSE IF (N.EQ.3) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3))) ELSE IF (N.EQ.4) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4))) ELSE IF (N.EQ.5) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4)), + LENGTH (5), %VAL(POINTER(5))) ELSE IF (N.EQ.6) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4)), + LENGTH (5), %VAL(POINTER(5)), LENGTH (6), %VAL(POINTER(6))) ELSE IF (N.EQ.7) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4)), + LENGTH (5), %VAL(POINTER(5)), LENGTH (6), %VAL(POINTER(6)), + LENGTH (7), %VAL(POINTER(7))) ELSE IF (N.EQ.8) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4)), + LENGTH (5), %VAL(POINTER(5)), LENGTH (6), %VAL(POINTER(6)), + LENGTH (7), %VAL(POINTER(7)), LENGTH (8), %VAL(POINTER(8))) ELSE IF (N.EQ.9) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4)), + LENGTH (5), %VAL(POINTER(5)), LENGTH (6), %VAL(POINTER(6)), + LENGTH (7), %VAL(POINTER(7)), LENGTH (8), %VAL(POINTER(8)), + LENGTH (9), %VAL(POINTER(9))) ELSE IF (N.EQ.10) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4)), + LENGTH (5), %VAL(POINTER(5)), LENGTH (6), %VAL(POINTER(6)), + LENGTH (7), %VAL(POINTER(7)), LENGTH (8), %VAL(POINTER(8)), + LENGTH (9), %VAL(POINTER(9)), + LENGTH (10), %VAL(POINTER(10))) ELSE IF (N.EQ.11) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4)), + LENGTH (5), %VAL(POINTER(5)), LENGTH (6), %VAL(POINTER(6)), + LENGTH (7), %VAL(POINTER(7)), LENGTH (8), %VAL(POINTER(8)), + LENGTH (9), %VAL(POINTER(9)), + LENGTH (10), %VAL(POINTER(10)), + LENGTH (11), %VAL(POINTER(11))) ELSE IF (N.EQ.12) THEN CALL ROUTNE ( + LENGTH (1), %VAL(POINTER(1)), LENGTH (2), %VAL(POINTER(2)), + LENGTH (3), %VAL(POINTER(3)), LENGTH (4), %VAL(POINTER(4)), + LENGTH (5), %VAL(POINTER(5)), LENGTH (6), %VAL(POINTER(6)), + LENGTH (7), %VAL(POINTER(7)), LENGTH (8), %VAL(POINTER(8)), + LENGTH (9), %VAL(POINTER(9)), + LENGTH (10), %VAL(POINTER(10)), + LENGTH (11), %VAL(POINTER(11)), + LENGTH (12), %VAL(POINTER(12))) ENDIF DO I=1,N CALL free(POINTER(I)) ENDDO END C SUBROUTINE CEXIT (ICODE) C trivial interface to system-dependent EXIT routine INTEGER ICODE CALL EXIT (ICODE) END subroutine clear end subroutine gdummy character *(*) char_dummy entry qreset return entry reshap return entry qdevic(keybd) return entry winope(char_dummy,i0) return entry keepas(i1,i2) return entry draw2i(i3,i4) return entry move2i(i5,i6) return entry loadma(i7) return entry gconfi return entry mmode(i8) return entry foregr return entry getval(i9) return entry color(i10) return entry getsiz(r1,r2) return cc entry clear this is in somewhere else in -ltermcap cc return entry ortho2(r3,r4,r5,r6) return entry getori(r7,r8) return end C C C ========================= CHARACTER FUNCTION RTNBKS() C ========================= C C RTNBKS - Returns a Backslash for nt as unix compilers are fussy! C C Input: none C C Returns: \ if WIN32 or space if unix or vms C C Arguments: none C C Usage: RTNBKS () C RTNBKS='\' C END c ============================ subroutine hciftime(ciftime) c ============================ c Uses f90 intrinsic Date_and_Time. Using f77: c works on VMS Fortran V7 but not earlier versions c works on Digital UNIX V4.0F c doesn't work on IRIX 6.5 c implicit none c character ciftime*(*) c character cdate*8,ctime*10,czone*5 integer ivalues(8) c c ... check if the argument can hold 25 characters c (better to return an error flag, of course ;-) c if (len(ciftime) .lt. 25) then print *,'error --- hciftime: string too short' ciftime = ' ' return end if c CALL Date_and_Time(CDATE,CTIME,CZONE,IVALUES) c write (ciftime,fmt=6000) IVALUES(1),IVALUES(2),IVALUES(3), + IVALUES(5),IVALUES(6),IVALUES(7),CZONE(1:3),CZONE(4:5) c c ... NOTE: "i4" in the following format makes that this routine c is not Year-10,000-compliant !!! c 6000 format (i4,'-',i2.2,'-',i2.2,'T',i2.2,':',i2.2,':',i2.2, + a3,':',a2) c return end libccp4-8.0.0/m4/libtool.m40000644000000000000000000105745414242731033013432 0ustar 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,ifort*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | ifort*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" //link //DLL //IMPLIB:"$tool_output_objdir$libname.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" //link //DLL //IMPLIB:"$tool_output_objdir$libname.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS libccp4-8.0.0/m4/ltoptions.m40000644000000000000000000003007314242731033014004 0ustar 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) libccp4-8.0.0/m4/ltsugar.m40000644000000000000000000001042414242731033013430 0ustar 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) libccp4-8.0.0/m4/ltversion.m40000644000000000000000000000126214242731033013774 0ustar 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) libccp4-8.0.0/m4/lt~obsolete.m40000644000000000000000000001375614242731033014334 0ustar 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) libccp4-8.0.0/m4/m4_ax_check_compile_flag.m40000644000000000000000000000407014242731033016615 0ustar 00000000000000# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # # Check whether the given FLAG works with the current language's compiler # or gives an error. (Warnings, however, are ignored) # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # INPUT gives an alternative input source to AC_COMPILE_IFELSE. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 6 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) AS_VAR_IF(CACHEVAR,yes, [m4_default([$2], :)], [m4_default([$3], :)]) AS_VAR_POPDEF([CACHEVAR])dnl ])dnl AX_CHECK_COMPILE_FLAGS