gpp4-1.3.1/0000755000175100017510000000000011530702343007367 500000000000000gpp4-1.3.1/gpp4.m40000644000175100017510000000322711251203037010423 00000000000000# -*- mode: sh; mode: font-lock -*- # AM_PATH_GPP4([ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]) AC_DEFUN([AM_PATH_GPP4], [ AC_PROVIDE([AM_PATH_GPP4]) AC_ARG_WITH(gpp4, AC_HELP_STRING( [--with-gpp4=PFX], [use gpp4 library (default is NO) and set prefix]), [ test "$withval" = no || with_gpp4=yes test "$withval" = yes || gpp4_prefix="$withval" ], [ with_gpp4="$enable_gpp4" ] ) #dnl default is no for now if test x$with_gpp4 = xyes ; then #user override AS_IF([test "x$CCP4_LIBS" != x && test "x$CCP4_CXXFLAGS" != x ], [ have_gpp4=yes ], [ AC_MSG_CHECKING([for ccp4_errno in gpp4]) saved_LIBS="$LIBS" saved_CXXFLAGS="$CXXFLAGS" CCP4_LIBS="" CCP4_CXXFLAGS="" if test "x$gpp4_prefix" != x; then # ie. gpp4=thing was given (thing is what we're checking for) ac_CCP4_CXXFLAGS="-I$gpp4_prefix/include/gpp4" ac_CCP4_LDOPTS="-L$gpp4_prefix/lib -lgpp4" else # treat as standard lib/include ac_CCP4_CXXFLAGS="" ac_CCP4_LDOPTS="-lgpp4" fi LIBS="$ac_CCP4_LDOPTS $saved_LIBS" CXXFLAGS="$ac_CCP4_CXXFLAGS $saved_CXXFLAGS" # # AC_TRY_LINK uses the c compiler (set by AC_LANG), so we will # temporarily reassign $CC to the c++ compiler. # AC_LANG_PUSH(C++) AC_TRY_LINK([#include "ccp4/ccp4_errno.h"], [int a = ccp4_errno; CCP4::ccp4_error("conftest"); ], have_gpp4=yes, have_gpp4=no) AC_LANG_POP(C++) # the language we have just quit AC_MSG_RESULT($have_gpp4) LIBS="$saved_LIBS" CXXFLAGS="$saved_CXXFLAGS" ]) #user override AS_IF([test x$have_gpp4 = xyes], [ CCP4_CXXFLAGS="$ac_CCP4_CXXFLAGS" CCP4_LIBS="$ac_CCP4_LDOPTS" ifelse([$1], , :, [$1]) ], [ ifelse([$2], , :, [$2]) ] ) fi #dnl --with-gpp4 AC_SUBST(CCP4_CXXFLAGS) AC_SUBST(CCP4_LIBS) ]) gpp4-1.3.1/gpp4f.pc.in0000644000175100017510000000040111507207102011250 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: gpp4 Description: alternative to the CCP4 library, FORTRAN API Version: @VERSION@ Requires: gpp4 mmdb Conflicts: Libs: -L${libdir} -lgpp4f Cflags: -I${includedir}/gpp4 gpp4-1.3.1/data/0000755000175100017510000000000011530702344010301 500000000000000gpp4-1.3.1/data/syminfo.lib0000644000175100017510000116764011253531226012415 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 0 symbol Hall ' C 2y (z,y,-x)' symbol xHM 'A 1 2 1' symbol old '' 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 0 symbol Hall '-P 2ybc (x-z,y,z)' symbol xHM 'P 1 21/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; 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 0 symbol Hall '-P 2ybc (z,y,-x)' symbol xHM 'P 1 21/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/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 z,y,-x symbol ccp4 2005 symbol Hall ' A 2y' 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/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,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 gpp4-1.3.1/data/Makefile.am0000644000175100017510000000023111251203037012244 00000000000000## -*- mode: Makefile ; mode: font-lock -*- ## This file is to be processed by automake. dist_pkgdata_DATA = syminfo.lib environ.def default.def #### gpp4-1.3.1/data/environ.def0000644000175100017510000001664211251203037012365 00000000000000# -*-sh-*- # List of standard `logical names' with types (in, out or inout) # and default filename extensions. This list is read in at run time. # # ? indicates checked in ccp4 progs/libs and no known use # ABCOEFFS=inout.coe # Optional Fourier terms (fft) ABSIN=in.dat # absorption data (absurd) ANGDAT=in.prt # angles library file ANGOUT=out.dih # angles o/p #ATCONT=inout.dat # ? ATOMOP=out.brk # sfall (but scratch) ATOMSF=in.lib # sfall ATOUT=out.brk # vecref ATS=inout.brk # ? (.scr in default.def) #ATSORT=inout.brk # ? BADSPOT=inout.spt # mosflm BONESIN=in.bon # bones2pdb #BREG=inout.dat # ? #BRKIN=in.brk # ? CHECKS=inout.chk # prolsq CLMN=inout.cof # amore #CMPAT=inout.dat # ? #CMPOUT=out.cmp # no longer in compar CMPTMP=inout.scr # compar COEFFS=inout.cof # almn #CORRIN=in.dat # ? #CORROUT=out.dat # ? CROSSECDATA=in.lib # crossec CRUNCH2_CDAT=inout.dat # crunch2 CRUNCH2ASC=in.lib # crunch2 CRUNCH2SEED=in.lib # crunch2 #CURVY=inout.dat # ? DATIN=in.dat # asc_2_p84 only DATOUT=out.out # p84_2_asc only #DATOUTTMP=inout.dat # ? DELTAS=out.dat # lsqkab #DENSITY=inout.ind # ? DICTPROTN=in.dic # protin DICTION=in.dic # restrain DIFFIN=in.dat # diffop DIFFOUT=out.dat # diffin DISKIO=inout.scr # testlib, fft, sfall #ENVIN=in.map # skewplanes EXCHANGE=inout.dat # exchange FCALC=inout.scr # sfall FFTHKLSCR=inout.scr # fft, sfall scratch file #FOBS=inout.scr # (no longer in sfall) #GENERIN=in.dat # skewplanes (generate) GENFILE=inout.gen # abscale, oscgen (mosflm distrib) GRADMAT=inout.mat # prolsq HDATA=in.his # squash (not CCP4) HESS=inout.scr # sfall HISTLIB=in.lib # dm HKLIN=in.mtz # general reflexion i/p file #HKLMUIN=in.mu # ? HKLOUT=out.mtz # general reflexion o/p file HKLPCK=inout.car # amore #INDICES6=inout.ind # ? #INT1DAT=inout.dat # ? #INTERIN=in.dat # skewplanes (interpol) INTP1=inout.scr # sfall ITAPE3=inout.scr # polarrfn KHCONN=inout.khc # distang LCF=inout.lcf # exchange #LIMITS=out.lim # ? LSQOP=out.brk # lsqkab MAPBRK=inout.mbk # mapbrick (not ccp4) MAPIN=in.map # general map input file MAPOUT=inout.map # general map output file #MAPPRT=out.mpt # ? #MAPSKEW=inout.map # skewplanes MASK=inout.msk # envelope, flatmap #MATCHIN=inout.ind # ? #MATDAT=out.out # skewplanes (matrices) MATRIX=inout.mat # skewbrk (not ccp4), superpose, deriv #MOSFLMDAT=in.dat # ? KEYWORD=inout.scr # oasis SIGNDT=inout.scr # oasis PROTDT=inout.scr # oasis SCRA8=inout.scr # oasis SIGMA2=inout.scr # oasis MTZ2VSCR=inout.scr # mtz2various #MTZIN=in.mtz # ? #MTZOUT=inout.mtz # ? #NEWCOEFF=inout.dat # ? NCSIN=in.msk # dm NEWPARM=out.com # mlphare ODFILE=inout.od # stills (mosflm distrib.) #OLDCOEFF=inout.dat # ? #PARAMSIN=in.dat # skewplanes #PARAMSOUT=out.dat # skewplanes PEAK_LIST=out.out # mapsig #PEKIN=inout.pea # ? #PHI=inout.scr # sfall (no longer used) PLOT=inout.plo # plot84 stuff PLOTFILE=inout.plt # asc_2_p84, p84_2_asc PLOTIN=in.plt # ribbon stuff (not ccp4) PLOTOUT=out.plt # ribrot, splitd (not ccp4) PMF_CDAT=inout.dat # pmf PMFASC=in.lib # pmf PMOSFLMDAT=in.dat # mosflm PRJOUT=out.out # distang PROFILE=inout.prf # mosflm PROTCOUNTS=inout.dat # prolsq, protin PROTOUT=inout.dat # prolsq, protin PROTSCR=inout.scr # refmac PSOUT=out.ps # anisoanl PSRESOURCE=in.lib # anisoanl RANTMP2=inout.scr # rantan RANTMP3=inout.scr # rantan #RECNIN=out.map # skewplanes #RECNSTWIN=in.map # ? #RECNWIN=out.map # skewplanes #RECONIN=in.dat # skewplanes #RECORD=inout.ind # ? #RECORDIN=in.ind # ? #RECORDUT=out.ind # ? REFRCD=in.brk # lsqkab REFSCR=inout.scr # refmac RIBDAT=inout.dat # ribbon (not ccp4) RIBLP=out.lp # ribbon (not ccp4) RIBOUT=out.rib # ribbon (not ccp4) #RMSOUT=out.out # ? RMSTAB=out.dat # lsqkab, baverage ROGUES=out.rgs # agrovata ROTFUN=inout.scr # polarrfn RSTATSBKR=out.dat # rstats SCALES=inout.sca # rotavata SCRADII=in.lib # sc SCTEMP=inout.scr # sc SCDOTS=inout.scr # sc SCRAT1=inout.scr # protin #SCRATCH=inout.ind # ? SCRATCH11=inout.scr # restrain SCRATCH12=inout.scr # restrain SCRATCH14=inout.scr # restrain #SCRGB1=inout.scr # sfall (no longer used) #SD=inout.scr # ? SEARCHSAVE=inout.sav # rsearch #SFKHMAT=inout.dat # ? SHIFTIN=in.dat # prolsq SHIFTOUT=inout.out # prolsq SHIFTS=inout.scr # sfall #SHRINKIN=in.dat # skewplanes #SORT1=in.ind # ? #SORTDAT=inout.dat # skewplanes (bsort) #SORTIN=in.ind # ? #SORTOUT=out.ind # ? #SPOTDUMP=inout.odd # ? SOLIN=in.msk # dm SOLOUT=out.msk # dm SPOTOD=inout.od # mosflm SPOTS=inout.spt # refix, imstills SUMMARY=out.sum # mosflm SYMOP=in.lib # symlib SYMINFO=in.lib # new symlib TABLE=inout.car # amore #TAPEIN=in.in # ? TEMP=inout.scr # pluto, npo TO=inout.pea # peakmax #TRANSFER=inout.dat # skewplanes #TRUNCIN=in.map # skewplanes #TRUNCWIN=in.map # skewplanes #ULYIN=in.uly # ? WORKCD=in.brk # lsqkab WRKIN=in.map # maprot WRKOUT=out.map # maprot XYZIN=in.brk # general coordinate i/p XYZOUT=out.brk # general coordinate o/p JWCSCR=inout.scr # libjwc_f #XYZREG=inout.reg # ? #HELPFILE=in.hlb # cli_help, chlp (obsolete?) gpp4-1.3.1/data/default.def0000644000175100017510000000610411251203037012321 00000000000000# list of default values for the corresponding `logical names' -*- sh -*- # defined in environ.def ABCOEFFS=fftkw.abcoeffs # fft ATOMOP=ATOMOP.scr # sfall ATOMSF=atomsf.lib # sfall (generated by atomsf prog.) # (atomsf_neutron.lib is also possible) ATS=ATS.scr ANGDAT=angldat.prt # angles BADSPOT=badspot.scr # mosflm CMPTMP=TMP.scr # compar COEFFS1=CF1.scr # almn, polarrfn COEFFS2=CF2.scr # almn, polarrfn CROSSECDATA=crossec.lib # crossec CRUNCH2_CDAT=crunch_cdat.dat # crunch2 CRUNCH2ASC=crunch_asc.lib # crunch2 CRUNCH2SEED=random_seed.lib # crunch2 DICTION=chiral_pep4.dic # restrain DICTPROTN=protin.dic # protin (ideal values) DISKIO1=IO1.scr DISKIO2=IO2.scr FCALC=FCAL.scr # sfall #FOBS=FOBS.scr # commented out of sfall HESS=HESS.scr # sfall HISTLIB=hist.lib # dm FFTHKLSCR=IO4.scr # fft, sfall INTP1=INTP1.scr # sfall ITAPE3=ITAPE3.scr # polarrfn KEYWORD=keyword.scr # oasis SIGNDT=signdt.scr # oasis PROTDT=protdt.scr # oasis SCRA8=scra8.scr # oasis SIGMA2=sigma2.scr # oasis MTZ2VSCR=TMP.scr # mtz2various OMITTMP1=tmp1.scr # omit OMITTMP2=tmp2.scr # omit OMITTMP3=tmp3.scr # omit OMITTMP4=tmp4.scr # omit OMITTMP5=tmp5.scr # omit OMITTMP6=tmp6.scr # omit OMITTMP7=tmp7.scr # omit OMITFORT4=tmp04.scr # omit OMITFORT11=tmp11.scr # omit OMITFORT67=tmp67.scr # omit #PHI=PHI.scr # unused in sfall PEAK_LIST=peaks.out # mapsig PMF_CDAT=pmf_cdat.dat # pmf PMFASC=pmf_asc.lib # pmf PSOUT=anisoanl.ps # anisoanl PSRESOURCE=ps_resource.lib # anisoanl RANTMP2=scratch2.scr # rantan RANTMP3=scratch3.scr # rantan REFSCR=IO4.scr # refmac ROTFUN=ROTFUN.scr # polarrfn RSTATSBKR=rstatsbkr.dat # rstats SCRADII=sc_radii.lib # sc SCTEMP=tmp.scr # sc SCDOTS=dots.scr # sc SCRAT1=SCRAT1.scr # protin SCRATCH11=SCR11.SCR # restrain SCRATCH12=SCR12.SCR # restrain SCRATCH14=SCR14.SCR # restrain #SCRGB1=SCRGB1.scr # unused in sfall SD1=SD1.scr # ? SD2=SD2.scr # ? SHIFTS=SHIFTS.scr # sfall SYMOP=symop.lib # symlib SYMINFO=syminfo.lib # new symlib TEMP=temp.scr TEMP1=temp1.scr # amore TEMP2=temp2.scr # amore TEMPI=TEMPI.scr # amore TEMPJ=TEMPJ.scr # amore JWCSCR=jwcf.scr # libjwc_f ! memory values for a large amore: !FITING_NR=500000 !TRAING_NR=500000 !ROTING_MI=600000 !ROTING_MC=2900000 !TABLING_MI=1500000 !TABLING_MR=5400000 gpp4-1.3.1/data/Makefile.in0000644000175100017510000002700611526170230012271 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ subdir = data DIST_COMMON = $(dist_pkgdata_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = 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__installdirs = "$(DESTDIR)$(pkgdatadir)" DATA = $(dist_pkgdata_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ 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@ FLIBS = @FLIBS@ GPP4_PREFIX = @GPP4_PREFIX@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MMDB_CFLAGS = @MMDB_CFLAGS@ MMDB_LIBS = @MMDB_LIBS@ 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@ PKG_CONFIG = @PKG_CONFIG@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WANT_GPP4F = @WANT_GPP4F@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ 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@ lt_ECHO = @lt_ECHO@ 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@ dist_pkgdata_DATA = syminfo.lib environ.def default.def all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign data/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign data/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_pkgdataDATA: $(dist_pkgdata_DATA) @$(NORMAL_INSTALL) test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ 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)$(pkgdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ done uninstall-dist_pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkgdatadir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkgdatadir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @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 check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(pkgdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: 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) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_pkgdataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_pkgdataDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dist_pkgdataDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am uninstall uninstall-am uninstall-dist_pkgdataDATA #### # 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: gpp4-1.3.1/COPYING0000644000175100017510000001674311523037274010363 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. gpp4-1.3.1/src_f/0000755000175100017510000000000011530702344010464 500000000000000gpp4-1.3.1/src_f/csymlib_f.c0000644000175100017510000016021011523037274012524 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @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" #define MSPAC 4 #define MAXSYM 192 #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); } /* 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_F: 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; } FORTRAN_SUBR ( SYMFR3, symfr3, (const fpstr icol, const int *i1, int *nsym, float rot[MAXSYM][4][4], int *eflag, int icol_len), (const fpstr icol, const int *i1, int *nsym, float rot[MAXSYM][4][4], int *eflag), (const fpstr icol, int 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], int symchs_len), (fpstr symchs, int *icol, int *nsym, float rot[MAXSYM][4][4]), (fpstr symchs, int 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, int 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, int 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, int symchs_len), (const int *nsm, const float rsm[MAXSYM][4][4], fpstr symchs), (const int *nsm, const float rsm[MAXSYM][4][4], fpstr symchs, int 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, int nampg_len), (fpstr nampg, int *nsymp, const int *nsym, float rsmt[192][4][4], const ftn_logical *lprint), (fpstr nampg, int 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, int nampg_len, int launam_len), (const fpstr nampg, int *nlaue, fpstr launam), (const fpstr nampg, int nampg_len, int *nlaue, fpstr launam, int 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, int launam_len), (const int *sindx, int *nlaue, fpstr launam), (const int *sindx, int *nlaue, fpstr launam, int 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, int spgnam_len, int pgname_len, int patnam_len), (const fpstr spgnam, const fpstr pgname, fpstr patnam, int *lpatsg), (const fpstr spgnam, int spgnam_len, const fpstr pgname, int pgname_len, fpstr patnam, int 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, int spgnam_len, int pgname_len), (fpstr spgnam, int *numsgp, fpstr pgname, int *msym, float rrsym[192][4][4], int *msymp, int *mlaue, ftn_logical *lprint), (fpstr spgnam, int spgnam_len, int *numsgp, fpstr pgname,int 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, int namspg_len), (const int *sindx, fpstr namspg), (const int *sindx, fpstr namspg, int 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], int pgname_len), (const fpstr pgname, const int *nsymp, const float rsymiv[192][4][4]), (const fpstr pgname, int 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], int namspg_cif_len, int namspg_cifs_len, int 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, int namspg_cif_len, fpstr namspg_cifs, int namspg_cifs_len, fpstr nampg, int 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], int namspg_cif_len, int 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, int namspg_cif_len, fpstr nampg, int 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], int namspg_cif_len, int 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, int namspg_cif_len, fpstr nampg, int 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, int 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, int namspg_cif_len), (fpstr namspg_cif, int 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; } } gpp4-1.3.1/src_f/ccp4_unitcell_f.c0000644000175100017510000001173211523037274013616 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @file ccp4_unitcell_f.c * @brief Fortran API to ccp4_unitcell.c. * @author Martyn Winn */ #include "ccp4_fortran.h" #include "ccp4_unitcell.h" /* 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); } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src_f/parser.f0000644000175100017510000014613511523037274012066 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 C License as published by the Free Software Foundation, either C version 3 of the License, or (at your option) any later version. C C This library 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 GNU C Lesser General Public License for more details. C C You should have received a copy of the GNU Lesser General Public C License along with This library. If not, see C . C 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 gpp4-1.3.1/src_f/keyparse.f0000644000175100017510000003355011523037274012411 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 C License as published by the Free Software Foundation, either C version 3 of the License, or (at your option) any later version. C C This library 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 GNU C Lesser General Public License for more details. C C You should have received a copy of the GNU Lesser General Public C License along with This library. If not, see C . 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: 2008-06-09 10:41:02 $ 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 gpp4-1.3.1/src_f/library_f.c0000644000175100017510000007130411523037274012533 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @file library_f.c @brief FORTRAN API for library.c. @date 2001 @author Charles Ballard This file contains the wrappers for calling library.c from FORTRAN and some "missing" routines. 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. */ #if defined(G95) || defined (GFORTRAN) #include #endif #include "ccp4_utils.h" #include "ccp4_errno.h" #include "ccp4_fortran.h" /** 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); if (length < 0) return NULL; 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, int str_len), (fpstr str, int *result), (fpstr str, int str_len, int *result)) { char *temp_name; temp_name = ccp4_FtoCString(FTN_STR(str), FTN_LEN(str)); if ( (*result = ccp4_utils_setenv (temp_name)) ) ccp4_fatal("USTENV/CCP4_SETENV: Memory allocation failure"); free(temp_name); } #endif #if ! defined (_MSC_VER) FORTRAN_SUBR ( USTIME, ustime, (int *isec), (int *isec), (int *isec)) { *isec = time(NULL); } #endif /* \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, int filename_len), (fpstr filename), (fpstr filename, int 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*/ #ifndef _MSC_VER 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 = 0, *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 */ #endif /* \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, int path_len, int cmode_len), (const fpstr path, const fpstr cmode, int *result), (const fpstr path, int path_len, const fpstr cmode, int 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, int path_len, int cmode_len), (const fpstr path, const fpstr cmode, int *result), (const fpstr path, int path_len, const fpstr cmode, int 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 Studio so this is a fudge */ #if defined (CALL_LIKE_MVS) # if CALL_LIKE_MVS == 1 int __stdcall ISATTY (int *lunit) { lunit = 0 ; return *lunit; } /* 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) { lunit = 0 ; return *lunit; } 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 (__APPLE__) && !defined (__GNUC__) ) /* 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 apple xlf support */ #if ( defined (__linux__) && defined (_CALL_SYSV) ) /* linuxppc 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); } #elif defined(G95) || defined (GFORTRAN) /* G95 and GFORTRAN support */ int isatty_(int *iunit) { return isatty(*iunit); } /* 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; } #endif #if defined (sun) int isatty_(int *iunit) { return isatty(*iunit); } #endif #if defined(G95) || defined (GFORTRAN) /* FORTRAN IErrNo intrinsic */ int ierrno_() { return errno; } void ltime_(int *stime, int tarray[9]) { int i; struct tm ldatim; if (localtime_r((const time_t *) stime, &ldatim) != NULL) { 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; if (gmtime_r((const time_t *) stime, &udatim) != NULL) { 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 */ gpp4-1.3.1/src_f/rwbrook.f0000644000175100017510000024220411523037274012251 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 C License as published by the Free Software Foundation, either C version 3 of the License, or (at your option) any later version. C C This library 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 GNU C Lesser General Public License for more details. C C You should have received a copy of the GNU Lesser General Public C License along with This library. If not, see 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 gpp4-1.3.1/src_f/cmaplib_f.c0000644000175100017510000021245111523037274012476 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @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" 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) { const 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); 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); } free((void *)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) { 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, int mapnam_len, int 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, int mapnam_len, const fpstr title, int 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, int mapnam_len, int 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, int mapnam_len, const fpstr title, int 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, int 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, int 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, int 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, int 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, int mapnam_len, int 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, int mapnam_len, fpstr title, int 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, int mapnam_len, int 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, int mapnam_len, fpstr title, int 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, int mapnam_len, int 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, int mapnam_len, fpstr title, int 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, int mapnam_len, int 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, int mapnam_len, fpstr title, int 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); fprintf(stdout," 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; fprintf(stdout,"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); fprintf(stdout," 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; fprintf(stdout,"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]; ii = GetChannel(*iunit); jj = GetChannel(*ounit); if ( ii == MAXFILES || !ioArray[ii]->mapfile || jj == 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]; ii = GetChannel(*iunit); jj = GetChannel(*ounit); if ( ii == MAXFILES || !ioArray[ii]->mapfile || jj == 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, int label_len), (const fpstr label, int *posn), (const fpstr label, int 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, int label_len), (const fpstr label, int *posn), (const fpstr label, int 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, int label_len), (const fpstr label), (const fpstr label, int 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, int label_len), (const fpstr label), (const fpstr label, int 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, int local_hdr_len), (int *iunit, float *section, const fpstr local_hdr), (int *iunit, float *section, const fpstr local_hdr, int 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, int local_hdr_len), (int *iunit, float *section, const fpstr local_hdr, int *ier), (int *iunit, float *section, const fpstr local_hdr, int 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, int logname_len), (fpstr logname), (fpstr logname, int 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, int logname_len), (fpstr logname), (fpstr logname, int 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, int logname_len), (fpstr logname), (fpstr logname, int 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, int logname_len), (fpstr logname), (fpstr logname, int 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); } /** Returns the number of machine items in NWORDS words (floats) */ FORTRAN_FUN(int, NBYTXX, nbytxx, (int *nwords), (int *nwords),(int *nwords)) { return ((int) sizeof(float)) * (*nwords); } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src_f/unix.f0000644000175100017510000005054711502447111011546 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 C License as published by the Free Software Foundation; either C version 2.1 of the License, or (at your option) any later C version. C C This library 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 GNU C Lesser General Public License for more details. C C You should have received a copy of the GNU Lesser General Public C License along with this library; if not, write to the Free C Software Foundation, Inc., 51 Franklin Street, Fifth Floor, C Boston, MA 02110-1301 USA C C 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 UGTIUD - 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 WINMVS 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) C .. C .. Local Arrays .. CHARACTER STAT(6)*7, DISP*6 C .. C .. External Functions .. INTEGER LENSTR 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 may be defined as null or as `READONLY,' OPEN(UNIT=IUN,STATUS='UNKNOWN',ACCESS='DIRECT',FORM=FRM + + ,FILE=NAMFIL,RECL=LLREC,IOSTAT=IOS,ERR=5) ELSE OPEN(UNIT=IUN,STATUS='UNKNOWN',ACCESS='DIRECT',FORM=FRM + + ,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' 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' + + ,FORM=FRM, ERR=5, IOSTAT=IOS) ELSE OPEN(UNIT=IUN, FILE=NAMFIL, STATUS=ST, ACCESS='SEQUENTIAL' + + ,FORM=FRM, ERR=5, IOSTAT=IOS) ENDIF ELSE IF (ISTAT.EQ.RDONLY) THEN OPEN(UNIT=IUN, FILE=NAMFIL, STATUS=ST, ACCESS='SEQUENTIAL' + + + ,FORM=FRM, ERR=5, IOSTAT=IOS) ELSE OPEN(UNIT=IUN, FILE=NAMFIL, STATUS=ST, ACCESS='SEQUENTIAL' + + + ,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 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 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 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 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 = 'BYTES' 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 C C .. Scalar Arguments .. INTEGER STATUS CHARACTER ERRSTR* (*) C .. C .. Local Scalars .. LOGICAL IPRINT C .. C .. External Subroutines .. 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 C .. Scalar Arguments .. INTEGER ANSWER,FLUN C .. 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 CALL EXIT (ICODE) 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' INQUIRE(IUN ) 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 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 implicit none c character ciftime*(*) c 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) 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 if (len(ciftime) .lt. 25) then write(*,*) 'error --- hciftime: string too short' ciftime = ' ' return end if c 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() implicit none continue end gpp4-1.3.1/src_f/Makefile.am0000644000175100017510000000157211254421002012435 00000000000000## -*- mode: Makefile ; mode: font-lock -*- ## This file is to be processed by automake. EXTRA_DIST = unix.m4 dna_header.fh AM_CFLAGS = -I $(top_srcdir)/src -DGFORTRAN lib_LTLIBRARIES = libgpp4f.la libgpp4f_c_files = ccp4_diskio_f.c ccp4_parser_f.c cmaplib_f.c csymlib_f.c \ ccp4_general_f.c ccp4_unitcell_f.c cmtzlib_f.c library_f.c libgpp4f_f_files = ccplib.f fftlib.f modlib.f parser.f rwbrook.f libhtml.f \ keyparse.f unix.f dna_output.f pack_f.f libgpp4f_la_SOURCES = $(libgpp4f_c_files) $(libgpp4f_f_files) CLEANFILES = unix.f libgpp4f_la_LIBADD = $(top_builddir)/src/libgpp4.la @MMDB_LIBS@ $(FLIBS) libgpp4f_la_CFLAGS = $(AM_CFLAGS) @MMDB_CFLAGS@ # IMPORTANT! # Read http://sourceware.org/autobook/autobook/autobook_91.html # before changing the version-info (read: don't change it) libgpp4f_la_LDFLAGS = -version-info 0:0:0 unix.f: unix.m4 m4 < unix.m4 > unix.f #### gpp4-1.3.1/src_f/unix.m40000644000175100017510000007044211502430652011637 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 C License as published by the Free Software Foundation; either C version 2.1 of the License, or (at your option) any later C version. C C This library 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 GNU C Lesser General Public License for more details. C C You should have received a copy of the GNU Lesser General Public C License along with this library; if not, write to the Free C Software Foundation, Inc., 51 Franklin Street, Fifth Floor, C Boston, MA 02110-1301 USA C dnl -*-fortran-*- 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: unix.m4,v 1.94 2010/09/17 12:16:37 rmk65 Exp $ 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 _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 UGTIUD - 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 WINMVS 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 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 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 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], 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 gpp4-1.3.1/src_f/ccp4_general_f.c0000644000175100017510000003174011530701627013413 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @file ccp4_general_f.c * @brief Fortran API to ccp4_general.c. * @date Created Oct. 2001 @author Martyn Winn */ #include #include #include #include #include #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" /** 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 #endif #ifdef GFORTRAN extern int _gfortran_iargc(void); extern void _gfortran_getarg(int *i,char *arg,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] */ #ifdef GFORTRAN argc = _gfortran_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); #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, int string_len), (fpstr string), (fpstr string, int 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, int string_len), (fpstr string), (fpstr string, int 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, int errstr_len), (const int *istat, const fpstr errstr), (const int *istat, const fpstr errstr, int 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, int msg_len), (const int *iflag, const fpstr msg), (const int *iflag, const fpstr msg, int 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, int string_len), (fpstr string), (fpstr string, int 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). */ #if ! defined (_MSC_VER) 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]; } #endif /** Fortran wrapper to string data function. * @param caldat Date string in format dd/mm/yy. */ FORTRAN_SUBR ( CCPDAT, ccpdat, (fpstr caldat, int caldat_len), (fpstr caldat), (fpstr caldat, int 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; } } #if ! defined (_MSC_VER) FORTRAN_SUBR ( UTIME, utime, (fpstr ctime, int ctime_len), (fpstr ctime), (fpstr ctime, int 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; } } #endif FORTRAN_SUBR ( CCP4_VERSION, ccp4_version, (const fpstr version, int version_len), (const fpstr version), (const fpstr version, int 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, int version_len), (const fpstr version, int *iflag), (const fpstr version, int 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, int prog_len, int vdate_len), (const int *ilp, const fpstr prog, const fpstr vdate), (const int *ilp, const fpstr prog, int prog_len, const fpstr vdate, int 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, int prog_len, int rcsdat_len), (const int *ilp, const fpstr prog, const fpstr rcsdat), (const int *ilp, const fpstr prog, int prog_len, const fpstr rcsdat, int 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, int pnm_len), (const fpstr pnm, int pnm_len), (const fpstr pnm, int pnm_len)) { ccp4_CtoFString(FTN_STR(pnm), FTN_LEN(pnm), ccp4ProgramName(NULL)); } FORTRAN_FUN ( ftn_logical, CCPEXS, ccpexs, (const fpstr name, int name_len), (const fpstr name), (const fpstr name, int 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, int name_len), (const fpstr name), (const fpstr name, int 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) ); } gpp4-1.3.1/src_f/libhtml.f0000644000175100017510000004024111523037274012214 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 C License as published by the Free Software Foundation, either C version 3 of the License, or (at your option) any later version. C C This library 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 GNU C Lesser General Public License for more details. C C You should have received a copy of the GNU Lesser General Public C License along with This library. If not, see C . 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 gpp4-1.3.1/src_f/cmtzlib_f.c0000644000175100017510000027405511523037274012543 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @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" #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},{0},{0},{0},{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},{0},{0},{0},{0},{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 #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, int filename_len), (int *mindx, fpstr filename, int *iprint, int *ifail), (int *mindx, fpstr filename, int 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; return; } rlun[*mindx-1] = 1; /* Make sure HKL are in base dataset */ MtzAssignHKLtoBase(mtzdata[*mindx-1]); printf("\n OPENED INPUT MTZ FILE \n"); printf(" 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, int ftitle_len), (int *mindx, fpstr ftitle, int *len), (int *mindx, fpstr ftitle, int 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, int hstrng_len), (int *mindx, fpstr hstrng, int *nlines), (int *mindx, fpstr hstrng, int hstrng_len, int *nlines)) { CMTZLIB_DEBUG(puts("CMTZLIB_F: LRHIST");) if (MtzCheckSubInput(*mindx,"LRHIST",1)) return; *nlines = ccp4_lrhist(mtzdata[*mindx-1], (char (*)[])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, int versnx_len), (int *mindx, fpstr versnx, int *ncolx, int *nreflx, float *ranges), (int *mindx, fpstr versnx, int 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, int clabs_len, int ctyps_len), (int *mindx, fpstr clabs, fpstr ctyps, int *ncol), (int *mindx, fpstr clabs, int clabs_len, fpstr ctyps, int 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, int ltypex_len, int spgrnx_len, int pgnamx_len, int spgconf_len), (int *mindx, int *nsympx, fpstr ltypex, int *nspgrx, fpstr spgrnx, fpstr pgnamx, fpstr spgconf), (int *mindx, int *nsympx, fpstr ltypex, int ltypex_len, int *nspgrx, fpstr spgrnx, int spgrnx_len, fpstr pgnamx, int pgnamx_len, fpstr spgconf, int 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, int ltypex_len, int spgrnx_len, int pgnamx_len), (int *mindx, int *nsympx, fpstr ltypex, int *nspgrx, fpstr spgrnx, fpstr pgnamx), (int *mindx, int *nsympx, fpstr ltypex, int ltypex_len, int *nspgrx, fpstr spgrnx, int spgrnx_len, fpstr pgnamx, int 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[], int lsprgi_len, int 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, int lsprgi_len, const int *nlprgi, const int *ntok, const fpstr labin_line, int 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, (const char (*)[])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[], int lsprgo_len, int 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, int lsprgo_len, const int *nlprgo, const int *ntok, const fpstr labin_line, int 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) { printf("Warning from LKYOUT: no program output labels !\n"); return; } if (*ntok <= 1) { printf("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, (const char (*)[])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[], int lsprgi_len, int lsusrj_len, int 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, int lsprgi_len, const int *nlprgi, fpstr lsusrj, int lsusrj_len, int kpoint[], const int *itok, const int *ntok, const fpstr labin_line, int 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, (const char (*)[])label, *nlprgi, (char (*)[2][31])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, int lsprgi_len, int ctprgi_len), (const int *mindx, fpstr lsprgi, int *nlprgi, int lookup[], fpstr ctprgi), (const int *mindx, fpstr lsprgi, int lsprgi_len, int *nlprgi, int lookup[], fpstr ctprgi, int 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], (const char(*)[31])label, *nlprgi, (char (*)[3])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, int project_name_len, int crystal_name_len, int 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, int project_name_len, fpstr crystal_name, int crystal_name_len, fpstr dataset_name, int 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, int project_name_len, int 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, int project_name_len, fpstr dataset_name, int 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, int project_name_len, int dataset_name_len), (const int *mindx, fpstr project_name, fpstr dataset_name, int *isets, int *ndatasets), (const int *mindx, fpstr project_name, int project_name_len, fpstr dataset_name, int 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], (const MTZCOL **)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, int cbatch_len), (const int *mindx, int *batno, float rbatch[], fpstr cbatch, const int *iprint), (const int *mindx, int *batno, float rbatch[], fpstr cbatch, int 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, int cbatch_len), (const int *ibatch, const int *iprint, float rbatch[], fpstr cbatch), (const int *ibatch, const int *iprint, float rbatch[], fpstr cbatch, int 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, int tbatch_len), (const int *mindx, const int *batno, fpstr tbatch, const int *iprint), (const int *mindx, const int *batno, fpstr tbatch, int 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, int filename_len), (const int *mindx, fpstr filename, int *ifail), (const int *mindx, fpstr filename, int 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) ) 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, int filename_len), (const int *mindx, fpstr filename), (const int *mindx, fpstr filename, int 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, int ftitle_len), (const int *mindx, const fpstr ftitle, const int *flag), (const int *mindx, const fpstr ftitle, int 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, int hstrng_len), (int *mindx, fpstr hstrng, int *nlines), (int *mindx, fpstr hstrng, int hstrng_len, int *nlines)) { CMTZLIB_DEBUG(puts("CMTZLIB_F: LWHIST");) if (MtzCheckSubInput(*mindx,"LWHIST",2)) return; MtzAddHistory(mtzdata[*mindx-1], (const char (*)[])hstrng, *nlines); } /* Fortran wrapper for MtzAddHistory */ /* Also includes progname and date */ FORTRAN_SUBR ( LWHSTL, lwhstl, (int *mindx, const fpstr hstrng, int hstrng_len), (int *mindx, const fpstr hstrng), (int *mindx, const fpstr hstrng, int 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], (const char (*)[])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, int project_name_len, int dataset_name_len), (const int *mindx, const fpstr project_name, const fpstr dataset_name), (const int *mindx, const fpstr project_name, int project_name_len, const fpstr dataset_name, int 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, int project_name_len, int 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, int project_name_len, const fpstr dataset_name, int 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, int project_name_len, int crystal_name_len, int 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, int project_name_len, const fpstr crystal_name, int crystal_name_len, const fpstr dataset_name, int 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, int pname_len, int dname_len), (const int *mindx, int *nlprgo, fpstr pname, fpstr dname, int *iappnd), (const int *mindx, int *nlprgo, fpstr pname, int pname_len, fpstr dname, int 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, int xname_len, int dname_len), (const int *mindx, int *nlprgo, fpstr xname, fpstr dname, int *iappnd), (const int *mindx, int *nlprgo, fpstr xname, int xname_len, fpstr dname, int 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, int xname_len, int dname_len), (const int *mindx, fpstr xname, fpstr dname), (const int *mindx, fpstr xname, int xname_len, fpstr dname, int 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, int ltypex_len, int spgrnx_len, int 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, int ltypex_len, int *nspgrx, fpstr spgrnx, int spgrnx_len, fpstr pgnamx, int 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, int spgconf_len), (int *mindx, fpstr spgconf), (int *mindx, fpstr spgconf, int 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, int lsprgo_len, int ctprgo_len), (const int *mindx, fpstr lsprgo, const int *nlprgo, fpstr ctprgo, int *iappnd), (const int *mindx, fpstr lsprgo, int lsprgo_len, const int *nlprgo, fpstr ctprgo, int 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], (const char (*)[])label, *nlprgo, (const char (*)[])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, int lsprgo_len, int ctprgo_len), (const int *mindx, fpstr lsprgo, const int *nlprgo, fpstr ctprgo, int *iappnd), (const int *mindx, fpstr lsprgo, int lsprgo_len, const int *nlprgo, fpstr ctprgo, int 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], (const char (*)[])label, *nlprgo, (const char (*)[])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, int cbatch_len), (const int *mindx, int *batno, float rbatch[], fpstr cbatch), (const int *mindx, int *batno, float rbatch[], fpstr cbatch, int 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, int tbatch_len), (const int *mindx, int *batno, fpstr tbatch), (const int *mindx, int *batno, fpstr tbatch, int 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, int project_name_len, int 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, int project_name_len, const fpstr dataset_name, int 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, int crystal_name_len, int 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, int crystal_name_len, const fpstr dataset_name, int 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]); } printf("\n WRITTEN OUTPUT MTZ FILE \n"); printf(" 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; } gpp4-1.3.1/src_f/fftlib.f0000644000175100017510000016656111523037274012045 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 C License as published by the Free Software Foundation, either C version 3 of the License, or (at your option) any later version. C C This library 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 GNU C Lesser General Public License for more details. C C You should have received a copy of the GNU Lesser General Public C License along with This library. If not, see C . C 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 gpp4-1.3.1/src_f/dna_output.f0000644000175100017510000001645311523037274012753 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 C License as published by the Free Software Foundation, either C version 3 of the License, or (at your option) any later version. C C This library 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 GNU C Lesser General Public License for more details. C C You should have received a copy of the GNU Lesser General Public C License along with This library. If not, see C . 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: dna_output.f,v 1.7 2008-06-09 10:41:02 mdw Exp $ 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 gpp4-1.3.1/src_f/pack_f.f0000644000175100017510000001452711523037274012014 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 C License as published by the Free Software Foundation, either C version 3 of the License, or (at your option) any later version. C C This library 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 GNU C Lesser General Public License for more details. C C You should have received a copy of the GNU Lesser General Public C License along with This library. If not, see 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******************************************************************************* gpp4-1.3.1/src_f/ccp4_parser_f.c0000644000175100017510000004421711523037274013277 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @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 * @date 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" /*------------------------------------------------------------------*/ /* Utility functions */ /*------------------------------------------------------------------*/ /** 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; } /*------------------------------------------------------------------*/ /** 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; } /*------------------------------------------------------------------*/ /** 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, int key_len, int line_len, int 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, int key_len, fpstr line, int line_len, int *ibeg, int *iend, int *ityp, float *fvalue, fpstr cvalue, int 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; } /*------------------------------------------------------------------*/ /** 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; } /*------------------------------------------------------------------*/ /** Set delimiters for PARSE, PARSER SUBROUTINE PARSDL(NEWDLM,NNEWDL,NSPECD) */ FORTRAN_SUBR(PARSDL,parsdl, (fpstr newdlm, int *nnewdl, int *nspecd, int newdlm_len), (fpstr newdlm, int *nnewdl, int *nspecd), (fpstr newdlm, int 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; } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src_f/modlib.f0000644000175100017510000013117411523037274012035 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 C License as published by the Free Software Foundation, either C version 3 of the License, or (at your option) any later version. C C This library 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 GNU C Lesser General Public License for more details. C C You should have received a copy of the GNU Lesser General Public C License along with This library. If not, see C . C C C cross.f dot.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 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 gpp4-1.3.1/src_f/dna_header.fh0000644000175100017510000000227311254143161013000 00000000000000C -*- fortran -*- C dna_header.fh: include file for dna_output.f C Copyright (C) 2004 CCLRC, Graeme Winter C C This program is free software: you can redistribute it and/or modify it C under the terms of the Lesser GNU General Public License as published by C the Free Software Foundation, either version 3 of the License, or (at C your option) any later version. C C This program is distributed in the hope that it will be useful, but C WITHOUT ANY WARRANTY; without even the implied warranty of C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU C General Public License for more details. C C You should have received a copy of the Lesser GNU General Public C License along with this program. If not, see C . 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 gpp4-1.3.1/src_f/Makefile.in0000644000175100017510000006477111526170230012466 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ subdir = src_f DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = 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__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libgpp4f_la_DEPENDENCIES = $(top_builddir)/src/libgpp4.la \ $(am__DEPENDENCIES_1) am__objects_1 = libgpp4f_la-ccp4_diskio_f.lo \ libgpp4f_la-ccp4_parser_f.lo libgpp4f_la-cmaplib_f.lo \ libgpp4f_la-csymlib_f.lo libgpp4f_la-ccp4_general_f.lo \ libgpp4f_la-ccp4_unitcell_f.lo libgpp4f_la-cmtzlib_f.lo \ libgpp4f_la-library_f.lo am__objects_2 = ccplib.lo fftlib.lo modlib.lo parser.lo rwbrook.lo \ libhtml.lo keyparse.lo unix.lo dna_output.lo pack_f.lo am_libgpp4f_la_OBJECTS = $(am__objects_1) $(am__objects_2) libgpp4f_la_OBJECTS = $(am_libgpp4f_la_OBJECTS) libgpp4f_la_LINK = $(LIBTOOL) --tag=F77 $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(F77LD) $(AM_FFLAGS) $(FFLAGS) \ $(libgpp4f_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ F77COMPILE = $(F77) $(AM_FFLAGS) $(FFLAGS) LTF77COMPILE = $(LIBTOOL) --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) F77LD = $(F77) F77LINK = $(LIBTOOL) --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(F77LD) $(AM_FFLAGS) $(FFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgpp4f_la_SOURCES) DIST_SOURCES = $(libgpp4f_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ 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@ FLIBS = @FLIBS@ GPP4_PREFIX = @GPP4_PREFIX@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MMDB_CFLAGS = @MMDB_CFLAGS@ MMDB_LIBS = @MMDB_LIBS@ 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@ PKG_CONFIG = @PKG_CONFIG@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WANT_GPP4F = @WANT_GPP4F@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ 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@ lt_ECHO = @lt_ECHO@ 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@ EXTRA_DIST = unix.m4 dna_header.fh AM_CFLAGS = -I $(top_srcdir)/src -DGFORTRAN lib_LTLIBRARIES = libgpp4f.la libgpp4f_c_files = ccp4_diskio_f.c ccp4_parser_f.c cmaplib_f.c csymlib_f.c \ ccp4_general_f.c ccp4_unitcell_f.c cmtzlib_f.c library_f.c libgpp4f_f_files = ccplib.f fftlib.f modlib.f parser.f rwbrook.f libhtml.f \ keyparse.f unix.f dna_output.f pack_f.f libgpp4f_la_SOURCES = $(libgpp4f_c_files) $(libgpp4f_f_files) CLEANFILES = unix.f libgpp4f_la_LIBADD = $(top_builddir)/src/libgpp4.la @MMDB_LIBS@ $(FLIBS) libgpp4f_la_CFLAGS = $(AM_CFLAGS) @MMDB_CFLAGS@ # IMPORTANT! # Read http://sourceware.org/autobook/autobook/autobook_91.html # before changing the version-info (read: don't change it) libgpp4f_la_LDFLAGS = -version-info 0:0:0 all: all-am .SUFFIXES: .SUFFIXES: .c .f .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src_f/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src_f/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @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 " $(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)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgpp4f.la: $(libgpp4f_la_OBJECTS) $(libgpp4f_la_DEPENDENCIES) $(libgpp4f_la_LINK) -rpath $(libdir) $(libgpp4f_la_OBJECTS) $(libgpp4f_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpp4f_la-ccp4_diskio_f.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpp4f_la-ccp4_general_f.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpp4f_la-ccp4_parser_f.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpp4f_la-ccp4_unitcell_f.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpp4f_la-cmaplib_f.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpp4f_la-cmtzlib_f.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpp4f_la-csymlib_f.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgpp4f_la-library_f.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libgpp4f_la-ccp4_diskio_f.lo: ccp4_diskio_f.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpp4f_la_CFLAGS) $(CFLAGS) -MT libgpp4f_la-ccp4_diskio_f.lo -MD -MP -MF $(DEPDIR)/libgpp4f_la-ccp4_diskio_f.Tpo -c -o libgpp4f_la-ccp4_diskio_f.lo `test -f 'ccp4_diskio_f.c' || echo '$(srcdir)/'`ccp4_diskio_f.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgpp4f_la-ccp4_diskio_f.Tpo $(DEPDIR)/libgpp4f_la-ccp4_diskio_f.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ccp4_diskio_f.c' object='libgpp4f_la-ccp4_diskio_f.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpp4f_la_CFLAGS) $(CFLAGS) -c -o libgpp4f_la-ccp4_diskio_f.lo `test -f 'ccp4_diskio_f.c' || echo '$(srcdir)/'`ccp4_diskio_f.c libgpp4f_la-ccp4_parser_f.lo: ccp4_parser_f.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpp4f_la_CFLAGS) $(CFLAGS) -MT libgpp4f_la-ccp4_parser_f.lo -MD -MP -MF $(DEPDIR)/libgpp4f_la-ccp4_parser_f.Tpo -c -o libgpp4f_la-ccp4_parser_f.lo `test -f 'ccp4_parser_f.c' || echo '$(srcdir)/'`ccp4_parser_f.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgpp4f_la-ccp4_parser_f.Tpo $(DEPDIR)/libgpp4f_la-ccp4_parser_f.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ccp4_parser_f.c' object='libgpp4f_la-ccp4_parser_f.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpp4f_la_CFLAGS) $(CFLAGS) -c -o libgpp4f_la-ccp4_parser_f.lo `test -f 'ccp4_parser_f.c' || echo '$(srcdir)/'`ccp4_parser_f.c libgpp4f_la-cmaplib_f.lo: cmaplib_f.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpp4f_la_CFLAGS) $(CFLAGS) -MT libgpp4f_la-cmaplib_f.lo -MD -MP -MF $(DEPDIR)/libgpp4f_la-cmaplib_f.Tpo -c -o libgpp4f_la-cmaplib_f.lo `test -f 'cmaplib_f.c' || echo '$(srcdir)/'`cmaplib_f.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgpp4f_la-cmaplib_f.Tpo $(DEPDIR)/libgpp4f_la-cmaplib_f.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cmaplib_f.c' object='libgpp4f_la-cmaplib_f.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpp4f_la_CFLAGS) $(CFLAGS) -c -o libgpp4f_la-cmaplib_f.lo `test -f 'cmaplib_f.c' || echo '$(srcdir)/'`cmaplib_f.c libgpp4f_la-csymlib_f.lo: csymlib_f.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpp4f_la_CFLAGS) $(CFLAGS) -MT libgpp4f_la-csymlib_f.lo -MD -MP -MF $(DEPDIR)/libgpp4f_la-csymlib_f.Tpo -c -o libgpp4f_la-csymlib_f.lo `test -f 'csymlib_f.c' || echo '$(srcdir)/'`csymlib_f.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgpp4f_la-csymlib_f.Tpo $(DEPDIR)/libgpp4f_la-csymlib_f.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='csymlib_f.c' object='libgpp4f_la-csymlib_f.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpp4f_la_CFLAGS) $(CFLAGS) -c -o libgpp4f_la-csymlib_f.lo `test -f 'csymlib_f.c' || echo '$(srcdir)/'`csymlib_f.c libgpp4f_la-ccp4_general_f.lo: ccp4_general_f.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpp4f_la_CFLAGS) $(CFLAGS) -MT libgpp4f_la-ccp4_general_f.lo -MD -MP -MF $(DEPDIR)/libgpp4f_la-ccp4_general_f.Tpo -c -o libgpp4f_la-ccp4_general_f.lo `test -f 'ccp4_general_f.c' || echo '$(srcdir)/'`ccp4_general_f.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgpp4f_la-ccp4_general_f.Tpo $(DEPDIR)/libgpp4f_la-ccp4_general_f.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ccp4_general_f.c' object='libgpp4f_la-ccp4_general_f.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpp4f_la_CFLAGS) $(CFLAGS) -c -o libgpp4f_la-ccp4_general_f.lo `test -f 'ccp4_general_f.c' || echo '$(srcdir)/'`ccp4_general_f.c libgpp4f_la-ccp4_unitcell_f.lo: ccp4_unitcell_f.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpp4f_la_CFLAGS) $(CFLAGS) -MT libgpp4f_la-ccp4_unitcell_f.lo -MD -MP -MF $(DEPDIR)/libgpp4f_la-ccp4_unitcell_f.Tpo -c -o libgpp4f_la-ccp4_unitcell_f.lo `test -f 'ccp4_unitcell_f.c' || echo '$(srcdir)/'`ccp4_unitcell_f.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgpp4f_la-ccp4_unitcell_f.Tpo $(DEPDIR)/libgpp4f_la-ccp4_unitcell_f.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ccp4_unitcell_f.c' object='libgpp4f_la-ccp4_unitcell_f.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpp4f_la_CFLAGS) $(CFLAGS) -c -o libgpp4f_la-ccp4_unitcell_f.lo `test -f 'ccp4_unitcell_f.c' || echo '$(srcdir)/'`ccp4_unitcell_f.c libgpp4f_la-cmtzlib_f.lo: cmtzlib_f.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpp4f_la_CFLAGS) $(CFLAGS) -MT libgpp4f_la-cmtzlib_f.lo -MD -MP -MF $(DEPDIR)/libgpp4f_la-cmtzlib_f.Tpo -c -o libgpp4f_la-cmtzlib_f.lo `test -f 'cmtzlib_f.c' || echo '$(srcdir)/'`cmtzlib_f.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgpp4f_la-cmtzlib_f.Tpo $(DEPDIR)/libgpp4f_la-cmtzlib_f.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cmtzlib_f.c' object='libgpp4f_la-cmtzlib_f.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpp4f_la_CFLAGS) $(CFLAGS) -c -o libgpp4f_la-cmtzlib_f.lo `test -f 'cmtzlib_f.c' || echo '$(srcdir)/'`cmtzlib_f.c libgpp4f_la-library_f.lo: library_f.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpp4f_la_CFLAGS) $(CFLAGS) -MT libgpp4f_la-library_f.lo -MD -MP -MF $(DEPDIR)/libgpp4f_la-library_f.Tpo -c -o libgpp4f_la-library_f.lo `test -f 'library_f.c' || echo '$(srcdir)/'`library_f.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgpp4f_la-library_f.Tpo $(DEPDIR)/libgpp4f_la-library_f.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='library_f.c' object='libgpp4f_la-library_f.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgpp4f_la_CFLAGS) $(CFLAGS) -c -o libgpp4f_la-library_f.lo `test -f 'library_f.c' || echo '$(srcdir)/'`library_f.c .f.o: $(F77COMPILE) -c -o $@ $< .f.obj: $(F77COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .f.lo: $(LTF77COMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @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 check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: 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 -rf ./$(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-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am 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-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 uninstall uninstall-am uninstall-libLTLIBRARIES unix.f: unix.m4 m4 < unix.m4 > unix.f #### # 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: gpp4-1.3.1/src_f/ccplib.f0000644000175100017510000017610611523037274012027 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 C License as published by the Free Software Foundation, either C version 3 of the License, or (at your option) any later version. C C This library 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 GNU C Lesser General Public License for more details. C C You should have received a copy of the GNU Lesser General Public C License along with This library. If not, see C . C 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: ccplib.f,v 1.105 2010/09/21 15:21:24 ccb Exp $ 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=8501) 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=8501) 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=8501) 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 gpp4-1.3.1/src_f/ccp4_diskio_f.c0000644000175100017510000005774111523037274013273 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @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 * @brief FORTRAN API for file i/o. * @author 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" /** * _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, int lognam_len, int atbuta_len), (int *iunit, fpstr lognam, fpstr atbuta), (int *iunit, fpstr lognam, int lognam_len, fpstr atbuta, int atbuta_len)) { char *atbut2, *temp_lognam, *fname; int istat = 0; 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, int lognam_len), (int *iunit, fpstr lognam, const int *istat), (int *iunit, fpstr lognam, int 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, int filename_len), (int *iunit, fpstr filename, int *istat), (int *iunit, fpstr filename, int 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, int buffer_len), (int *iunit, fpstr buffer, int *result), (int *iunit, fpstr buffer, int 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, int buffer_len), (int *iunit, fpstr buffer), (int *iunit, fpstr buffer, int 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, int logname_len, int filename_len), (int *istrm, fpstr logname, fpstr filename, int *length), (int *istrm, fpstr logname, int logname_len, fpstr filename, int 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); } gpp4-1.3.1/README0000644000175100017510000000467511507207102010200 00000000000000Introduction ------------ This distribution is a special version of the CCP4 library, released under the Lesser GNU Public License version 2.1. The last version of the CCP4 library covered by a free license was version 5.0.2. That version was patched by Ralf Grosse-Kunstleve to address some of the more serious deficiencies of the older library. It is the patched version of the CCP4 library that forms the basis for this distribution, which includes a GNU autotools build environment developed by Paul Emsley and Morten Kjeldgaard. The reason for creating this public fork of the CCP4 libraries is that several third party software distributions depend on the CCP4 libraries. However, you cannot create a derived work containing both CCP4 6.* licensed code and GPL'd code, and distribute the resulting software, since the GPL demands that the derived work be distributed without additional restrictions and the CCP4 6.* license imposes additional restrictions on redistribution - in particular (but not limited to) an indemnity clause. The goal of this project -- named gpp4 to distinguish it from CCP4 -- is to provide a drop-in replacement for the non-free CCP4 libraries, that as carefully as possible will implement the current CCP4 library interface. Building gpp4 ------------- The distribution includes two libraries, libgpp4, which is the C interface, and optionally libgpp4f, which is the fortran interface. To compile the Fortran library, it is required that the MMDB library is installed. This library can be fetched from the Launchpad project at either as a tar.gz archive or as a bazaar branch. To retrieve this, issue this from a suitable directory: bzr branch lp:mmdb Using the library ----------------- The header files for gpp4 are by default installed in $prefix/include/gpp4/ccp4/* which means that gpp4 should be a transparent drop-in replacement for the CCP4 libraries, if your C source files use includes of the form: #include In this case, it is necessary to pass the flag -I/usr/include/gpp4 to the compiler. Gpp4 supports the pkg-config interface, which means you can compile your program something like this: gcc -o foo `pkgconfig gpp4 --cflags --libs` foo.c In case your program uses the following include form (not recommended): #include "cmaplib.h" you need to pass the complete include path to the compiler (-I/usr/include/gpp4/ccp4) and you cannot make use of the pkg-config interface. gpp4-1.3.1/src/0000755000175100017510000000000011530702343010156 500000000000000gpp4-1.3.1/src/cmap_accessor.c0000644000175100017510000002047111523037274013056 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ #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; } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/gpp4_open_symop_file.c0000644000175100017510000000604311523037274014374 00000000000000/* This file is part of the gpp4 library distribution. Copyright: 2008 Morten Kjeldgaard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ #include #include #include #include #include "ccp4_utils.h" /*! Find the path of the SYMINFO file. We will try to locate the file in several places (in increasing order of significance): -# $SYMINFO environment variable -# ./syminfo.lib -# $prefix/share/gpp4/syminfo.lib -# $prefix/lib/syminfo.lib -# $CCP4/lib/data/syminfo.lib where $prefix is defined by the --prefix switch to the configure script. The function allocates memory for the pathname that must be free'd by the caller in order to avoid a memory leak. @return path to syminfo.lib file. */ char *gpp4_open_syminfo_file() { struct stat statbuf; char *str; char *fnam = (char *)ccp4_utils_malloc(512); if ((str = getenv("SYMINFO"))) { /* SYMINFO was defined, now check to see if file exists */ strncpy (fnam, str, 512); if( stat(fnam,&statbuf) == 0) { printf("\n Spacegroup information obtained from library file: \n"); printf(" Logical Name: SYMINFO Filename: %s\n\n", fnam); return fnam; } } printf("Environment variable SYMINFO not set ... guessing location of symmetry file.\n"); strncpy (fnam, "./syminfo.lib", 14); if( stat(fnam,&statbuf) == 0) { printf("\n Spacegroup information obtained from local file: %s\n", fnam); return fnam; } strncpy (fnam, GPP4_PREFIX, 512-24); strncat (fnam, "/share/gpp4/syminfo.lib", 24); if( stat(fnam,&statbuf) == 0) { printf("\n Spacegroup information obtained from system file: %s\n", fnam); return fnam; } strncpy (fnam, GPP4_PREFIX, 512-17); strncpy (fnam, "/lib/syminfo.lib", 17); if( stat(fnam,&statbuf) == 0) { printf("\n Spacegroup information obtained from system file: %s\n", fnam); return fnam; } /* Hmmm. Try one last time in the CCP4 installation */ if (!(str = getenv("CCP4"))) { printf("Environment variable CCP4 not set ... big trouble! \n"); free(fnam); return NULL; } strncpy(fnam, str, 512); strncat(fnam,"/lib/data/syminfo.lib", 22); if( stat(fnam,&statbuf) == 0) { printf("\n Spacegroup information obtained from CCP4 library: %s\n", fnam); return fnam; } /* We give up... */ free(fnam); return NULL; } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/cmap_symop.c0000644000175100017510000001214111523037274012416 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ #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); } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/library_file.h0000644000175100017510000001011311523037274012714 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @file library_file.h * @brief Functions for file i/o. * @author 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 *); const 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_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_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 */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/ccp4_parser.c0000644000175100017510000015061011523037274012460 00000000000000/* ccp4_parser.c: Functions to read in and "parse" CCP4 keyworded input. Copyright (C) 2001 CCLRC, Peter Briggs Copyright (C) 2007 Morten Kjeldgaard. This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @file ccp4_parser.c @brief Functions to read in and "parse" CCP4-style keyworded input, plus utility routines. @author Peter Briggs @date April 2001 */ #include #include #include #ifndef __FLOAT_H__ # include #endif #include #include "ccp4_parser.h" #include "ccp4_errno.h" #include "ccp4_sysdep.h" /* 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 static int symop_to_mat4_err(const char *); /*! Initialise a CCP4PARSERARRAY This function initialises 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) { 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; } /*! Cleans up a CCP4PARSEARRAY This function cleans up a CCP4PARSERARRAY 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 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; } /*! Initialise a token in a parser array This function initialise a single token in CCP4PARSERARRAY before use. It 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; } /*! Reinitialise a parser array before calling ccp4_parse Call this function to initialise CCP4PARSERARRAY before use (includes calls to ccp4_parse_init_token to initialise all tokens). 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; } /*! Set up or restore non-default delimiter characters. This function 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. @return 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; } /*! Set up or restore non-default comment characters. 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. @return 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; } /*! Set non-default maximum and minimum values for numerical tokens. 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; } /*! Parsing scanner This is a scanner based on the old CCP4 Fortranic PARSE routine. Given a string "line", break up into tokens and store in CCP4PARSERARRAY "parser" The function 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). @param line = pointer to a null-terminated string of characters, forming the input to be processed. Unaltered on output. @param parser = pointer to a CCP4PARSERARRAY structure which will be used to hold the results of processing the input line. @return ccp4_parse returns the number of tokens found in the line. The tokens are returned via the CCP4PARSERARRAY parser. */ int ccp4_parse(const char *line, CCP4PARSERARRAY *parser) { int quotedstring,starttoken,endtoken; char this_char,next_char,matchquote=0; int llen,ich,lword,diag=0; int token,nulltoken,isquote,iscommt=0,isdelim; double value; char *delim,*nulldelim,*comm; char quot[]="\"\'"; int ibeg=0,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); } return ntok; } /*! The main function for parsing lines ccp4_parser is the main function for reading lines, either supplied or read from stdin. It is based on the old CCP4 Fortranic PARSER routine. The function reads input from stdin or external file, breaks it up into tokens that are stored in CCP4PARSERARRAY "parser". 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. @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, up to nchar characters. @param nchars 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, or 0 on reaching end of file. On encountering an unrecoverable error ccp4_parser returns -1. */ 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; } /*! Test whether two keywords are identical. This function compares input strings to see if they match as CCP4-style keywords. 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) { 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); } /*! 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) { 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; } /*! 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) { float rsm[4][4]; symop_to_mat4(symchs_begin, symchs_end, rsm[0]); return (mat4_to_rotandtrn((const float (*)[4])rsm)); } /*! Convert symmetry operator as string to matrix. 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. @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 @note This is Charles' version of symfr. Note that translations are held in elements [*][3] and [3][3] is set to 1.0 */ 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 */ static 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; } /*! 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 rsm 4 x 4 matrix operator @return pointer to beginning of string */ 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); } /*! Convert rotation/translation string to symmetry operator. @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 symop @return pointer to beginning of string */ 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)); } /*! Convert rotation/translation string to 4x4 matrix data structure. @param rsm 4x4 matrix @param symop */ 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; } /*! Convert symmetry operator as matrix to string. 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]) { 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; } /*! 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]) { 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; } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/ccp4_file_err.h0000644000175100017510000000252311523037274012757 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @file ccp4_file_err.h @brief Header file with file handling error codes @author Charles Ballard */ #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 /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/cmaplib_f.h0000644000175100017510000000233511523037274012174 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @file cmaplib_f.h @brief Definition of the IOConvMap structure. Apparently not used anywhere (?). @author Charles Ballard. */ #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 */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/ccp4_unitcell.c0000644000175100017510000002572711523037274013015 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @file ccp4_unitcell.c @brief C library for manipulations based on cell parameters. @author Martyn Winn */ #include #include "ccp4_unitcell.h" #include "cvecmat.h" #include "ccp4_errno.h" /*! From input cell and orthogonalisation code, find orthogonalisation and fractionalisation matrices. @param[in] cell unit cell parameters @param[in] ncode orthogonalisation code: - ncode = 1 - xo along a zo along c* - ncode = 2 - xo along b zo along a* - ncode = 3 - xo along c zo along b* - ncode = 4 - trigonal only - xo along a+b yo alon a-b zo along c* - ncode = 5 - xo along a* zo along c - ncode = 6 - xo along a yo along b* @param[out] ro orthogonalization matrix @param[out] rf fractionalisation matrix @return 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. @param[in] cell direct space unit cell parameters. @param[out] rcell reciprocal space unit cell parameters. @return 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. @param[in] rf fractionalisation matrix @param[in] xo orthogonal coordinates @param[out] xf fractional coordinates @return void */ 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. @param[in] ro orthogonalization matrix @param[in] xf fractional coordinates @param[out] xo orthogonal coordinates @return void */ 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. @param[in] rf fractionalisation matrix @param[in] uo orthogonal u matrix @param[out] uf fractional u matrix @return void */ 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. @param[in] ro orthogonalization matrix @param[in] uf fractional u matrix @param[out] uo orthogonal u matrix @return void */ 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. @param[in] cell direct space cell parameters @return Cell volume. */ 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. @param[in] cell1 Cell parameters of first cell. @param[in] cell2 Cell parameters of second cell. @param[in] 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) { 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; } /*! Check if cell parameters conform to a rhombohedral setting. @param[in] cell Cell parameters. Angles are assumed to be in degrees. @param[in] tolerance A tolerance for agreement. @return 1 if cell parameters conform, 0 otherwise. */ 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; } /*! Check if cell parameters conform to a hexagonal setting. @param[in] cell Cell parameters. Angles are assumed to be in degrees. @param[in] tolerance A tolerance for agreement. @return 1 if cell parameters conform, 0 otherwise. */ 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; } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/ccp4_program.h.in0000644000175100017510000001317011530701627013242 00000000000000/* ccp4_program.h: Headers to utilies to set and fetch program information. Copyright (C) 2001 CCLRC, Peter Briggs Copyright (C) 2007, 2010 Morten Kjeldgaard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @file ccp4_program.h @brief Header file for utilies to set and fetch program information @author Peter Briggs, CCP4 @date May 2001 */ /* Macro definitions */ #ifndef __CCP4Program__ #define __CCP4Program__ #ifdef __cplusplus namespace CCP4 { extern "C" { #endif /*! CCP4 library version this version is derived from */ #define CCP4_VERSION_NO "6.1" /*! Patch level of CCP4 that gpp4 is derived from */ #define CCP4_PATCH_LEVEL "6.1.24" /*! GPP4 version is defined by autoconf */ #define GPP4_VERSION_NO "@PACKAGE_VERSION@" /* Maximum lengths of strings holding program names and versions */ #define MAXLEN_PROGNAME 80 /*!< Maximum length of program name */ #define MAXLEN_PROGVERSION 80 /*!< Maximum length of program version string */ #define MAXLEN_RCSDATE 80 /*!< Maximum length of date string */ /*------------------------------------------------------------------*/ /* 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, 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); /** Set or return program name. * @param progname Program name, or NULL to query existing value. * @return Program name */ char *ccp4ProgramName(const char *progname); /** 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, 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, 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, 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__ */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/pack_c.h0000644000175100017510000001346611523037274011507 00000000000000/* pack_c.h: (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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /* 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. */ /******************************************************************************/ /* 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) */ gpp4-1.3.1/src/cmap_stats.c0000644000175100017510000000342511523037274012412 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ #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); } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/ccp4_errno.h0000644000175100017510000001167311523037274012323 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @file ccp4_errno.h * @brief Header file for error handling routines * Error codes based on system errors. * @author Charles Ballard and Martyn Winn */ #ifndef __CCP4_ERROR_GUARD #define __CCP4_ERROR_GUARD #include #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 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 */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/ccp4_fortran.h0000644000175100017510000003016011523037274012641 00000000000000/* ccp4_fortran.h: header file for Fortran APIs Copyright (C) 2001 Eugene Krissinel Copyright (C) 2007 Morten Kjeldgaard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @file ccp4_fortran.h @brief Header file for Fortran APIs @author Eugene Krissinel */ #ifndef __CCP4_FORTRAN #define __CCP4_FORTRAN #include "ccp4_types.h" /* 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. @param NAME name of the FORTRAN subroutine in capital letters @param name name of the FORTRAN subroutine in small letters @param p_send parameter list (in brackets) with string lengths attached to the end of it (see below) @param p_sstruct parameter list (in brackets) with strings passed as complex parameters, or structures @param 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: @verbatim CALL_LIKE_STARDENT : 'fpstr' is identical to 'PSStrPar' CALL_LIKE_VMS : 'fpstr' is identical to 'dsc$descriptor_s *' @endverbatim 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 @code subroutine SomeSub ( k,s1,a,s2,m ) integer k,m real a character*(*) s1,s2 @endcode is translated to @code 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 ) ) @endcode The macro should replace ordinary function header statements to assure compatibility with FORTRAN links. In header files, do not forget to add semicolon: @code FORTRAN_SUBR ( .... ); @endcode while in source files use simply @code FORTRAN_SUBR ( .... ) { } @endcode
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; #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; # 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; # 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; #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; # 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; # 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; #if defined (KNOWN_MACHINE) # define FORTRAN_LOGICAL_TRUE 1 # define FORTRAN_LOGICAL_FALSE 0 #endif #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 */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/cmaplib.h0000644000175100017510000002014611523037274011667 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @page cmap_page CMAP library * @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 @brief Data structure describing an optional skew transformation of the map */ struct _CMMFile_Skew { float rotation[3][3]; /**< 3x3 rotation matrix */ float translation[3]; /**< translation component */ }; /** @struct _CMMFile_Symop @brief Data structure describing the block of symmetry data within the file */ struct _CMMFile_Symop { unsigned int offset; /**< offset of data block from beginning of file */ unsigned int size; /**< size of data block */ unsigned int number; /**< number of symmetry operations */ }; /** @struct _CMMFile_Data @brief Data structure describing the blocks within the file holding the map array */ struct _CMMFile_Data { size_t offset; size_t section_size; size_t header_size; size_t block_size; unsigned int number; }; /** @struct _CMMFile_Stats @brief Construct to hold various map statistics */ 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 @brief Construct to hold the information about a map file */ struct _CMMFile { CCP4File *stream; /**< pointer to file structure */ char *file_name; /**< name of file */ unsigned int data_mode; /**< */ unsigned int close_mode; /**< */ float cell[6]; /**< unit cell parameters */ int spacegroup; /**< space group number */ int map_dim[3]; /**< size of map array (number of columns, rows, sections) */ int origin[3]; /**< map origin (number of first column, row, section) */ int cell_grid[3]; /**< grid size along cell edges */ int axes_order[3]; /**< which axis corresponds to x, y, z */ 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 */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/ccp4_array.c0000644000175100017510000001157011523037274012303 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @file ccp4_array.c * @author Kevin Cowtan * @brief Resizable array implementation */ #include "ccp4_array.h" 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); } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/ccp4_spg.h0000644000175100017510000000702711523037274011765 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @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__ #ifdef __cplusplus namespace CSym { extern "C" { #endif /*! @struct ccp4_symop_ @brief Kevin's symmetry operator */ typedef struct ccp4_symop_ { float rot[3][3]; /*!< rotation matrix in row major ordering */ float trn[3]; /*!< translation component */ } ccp4_symop; /*!< creates a type name for struct ccp4_symop_ */ /*! @struct ccp4_spacegroup_ @brief Data structure of a space group descriptor */ 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; /*!< Creates a type name for struct ccp4_spacegroup_ */ #ifdef __cplusplus } } #endif #endif /*__CCP4_SPG__ */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/ccp4_vars.h0000644000175100017510000000330411523037274012141 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @file ccp4_vars.h @brief 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__ */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/cmap_skew.c0000644000175100017510000000714011523037274012223 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ #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; } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/cvecmat.c0000644000175100017510000001035511523037274011676 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @file cvecmat.c @brief C library for vector and matrix manipulations. @author Martyn Winn */ #include #include "cvecmat.h" /*! Vector cross product This function computes the vector cross product c = a X b @param[in] a vector 1 @param[in] b vector 2 @param[out] c cross product vector */ 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]; } /*! 3x3 matrix product This function computes the matrix product between two 3x3 matrices. @param[out] c matrix product @param[in] a left matrix @param[in] b right matrix */ 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]; } } /*! 4x4 matrix product. This function computes the matrix product between two 4x4 matrices. @param[out] c matrix product @param[in] a left matrix @param[in] b right matrix */ 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]; } } /*! 3x3 matrix inversion. @param[in] a 3*3 matrix to be inverted @param[out] ai inverse matrix @return 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; } /*! 4x4 matrix inversion. @param[in] a 4x4 matrix to be inverted @param[out] ai inverse matrix @return 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); } /*! Compute powers. This function computes powers of any base to any integer power. @param[in] base @param[in] power @return result of power calculation */ float ccp4_pow_ii(const float base, const int power) { int i = 0; float pow = 1; while (++i <= power) pow *= base; return pow; } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/ccp4_types.h0000644000175100017510000000632111523037274012334 00000000000000/* ccp4_types.h: CCP4 library.c macro definitions etc Copyright (C) 2001 CCLRC Copyright (C) 2007 Morten Kjeldgaard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @file ccp4_types.h @brief Header file containing various commonly used type definitions and some useful macros. */ #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 @brief Common data structure for floats, ints, and chars */ union float_uint_uchar { float32 f; /*!< float member */ uint32 i; /*!< 32 bit integer member */ uint8 c[4]; /*!< member of four bytes */ }; /*! @typedef pstr generic character pointer */ typedef char *pstr; /* CCP4 library.c macro definitions */ #ifndef FALSE #define FALSE 0 #define TRUE 1 #endif /*! @struct COMPLEX @brief Contruct representing a complex number. */ typedef struct { double r; /*!< real component */ double i; /*!< imaginary component */ } COMPLEX; /*!< complex number type */ /*! @struct POLAR @brief Contruct representing a polar coordinate complex number. */ typedef struct { double r; /*!< radial component */ double phi; /*!< angular component */ } POLAR; /*!< complex number type */ /* some simple macros, which may exist anyway */ /*! @def SQR(x) @brief A macro that returns the square of x. */ #ifndef SQR #define SQR(x) ((x)*(x)) #endif /*! @def DEGREE(x) @brief Convert radians to degrees. The result will be in [0:360]. */ #ifndef DEGREE #define DEGREE(x) ((((x < 0)?(x)+2*M_PI:(x))*360)/(2*M_PI)) #endif /*! @def RADIAN(x) @brief Convert degrees to radians. The result will be in [0:pi]. */ #ifndef RADIAN #define RADIAN(x) ((((x<0)?(x)+360:(x))*2*M_PI)/360) #endif /*! @def MAX(x,y) @brief A macro that returns the maximum of \a x and \a y. */ #ifndef MAX #define MAX(x, y) (((x)>(y))?(x):(y)) #endif /*! @def MIN(x,y) @brief A macro that returns the minimum of \a x and \a y. */ #ifndef MIN #define MIN(x, y) (((x)<(y))?(x):(y)) #endif /*! @def ABS(x) @brief A macro that returns the absolute value of \a x. */ #ifndef ABS #define ABS(x) (((x)<0)?-(x):(x)) #endif /*! @def SIGN(x) @brief Return the sign of \a x. */ #ifndef SIGN #define SIGN(x) (((x)<0)?-1:1) #endif #endif /* __CCP4_TYPES */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/cmap_errno.h0000644000175100017510000000333511523037274012406 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @file cmap_errno.h @brief Error codes for the library @author Charles Ballard. */ #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 */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/pack_c.c0000644000175100017510000013644111523037274011501 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ #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) # 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); abort(); } 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); abort();} 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); abort();} 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); abort();} 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))) { if (! fwrite(buffer, sizeof(BYTE), buffree - buffer, packfile)) { fprintf (stderr, "write error 1, aborting\n"); abort(); } 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++; if (!fwrite(buffer, sizeof(BYTE), len, packfile)) { fprintf (stderr, "write error 2, aborting\n"); abort(); } 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))) { if (fwrite(buffer, sizeof(BYTE), buffree - buffer, packfile)) { fprintf (stderr, "write error 3, aborting\n"); abort(); } 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++; if (!fwrite(buffer, sizeof(BYTE), len, packfile)) { fprintf (stderr, "write error 4, aborting\n"); abort(); } 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);} /******************************************************************************/ gpp4-1.3.1/src/ccp4_array.h0000644000175100017510000002040511523037274012305 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @file ccp4_array.h * @author Kevin Cowtan * @brief Header file for resizable array implementation. */ /*! \page ccp4_array_page CCP4 resizable array implementation \section 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 /*! constant pointer type */ typedef const void *ccp4_constptr; /*! byte pointer type */ typedef char *ccp4_byteptr; /*! pointer type */ typedef void *ccp4_ptr; /*! @struct ccp4array_base @brief definition for the array pre-header */ typedef struct ccp4array_base_ { int size; /*!< actual size of array */ int capacity; /*!< maximum capacity of array */ } 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 */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/Makefile.am0000644000175100017510000000213411526170075012140 00000000000000## -*- mode: Makefile ; mode: font-lock -*- ## This file is to be processed by automake. lib_LTLIBRARIES = libgpp4.la library_includedir=$(pkgincludedir)/ccp4 libgpp4_la_SOURCES = ccp4_array.c cmap_data.c cmtzlib.c ccp4_general.c \ cmap_header.c csymlib.c ccp4_parser.c cmap_labels.c cvecmat.c \ ccp4_program.c cmap_open.c library_err.c ccp4_unitcell.c cmap_skew.c \ library_file.c cmap_accessor.c cmap_stats.c library_utils.c cmap_close.c \ cmap_symop.c pack_c.c gpp4_open_symop_file.c # IMPORTANT! # Read http://sourceware.org/autobook/autobook/autobook_91.html # before changing the version-info (read: don't change it) libgpp4_la_LDFLAGS = -version-info 0:0:0 library_include_HEADERS = ccp4_array.h ccp4_unitcell.h cmap_stats.h \ ccp4_errno.h ccp4_utils.h cmtzlib.h ccp4_file_err.h ccp4_vars.h \ csymlib.h ccp4_fortran.h cmap_data.h cvecmat.h ccp4_general.h \ cmap_errno.h ccp4_parser.h cmap_header.h library_file.h ccp4_program.h \ cmap_labels.h mtzdata.h ccp4_spg.h cmaplib_f.h overview.h \ ccp4_sysdep.h cmaplib.h ccp4_types.h cmap_skew.h symlib.h pack_c.h DISTCLEANFILES = ccp4_program.h #### gpp4-1.3.1/src/ccp4_sysdep.h0000644000175100017510000001740411523037274012503 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @file ccp4_sysdep.h * * @brief System-dependent definitions. * * @author Charles Ballard, based in part on earlier versions */ #ifndef __CCP4_BITS #define __CCP4_BITS #if defined (_AIX) || defined(___AIX) # define KNOWN_MACHINE # define CALL_LIKE_HPUX 1 #endif #if defined (__hpux) # define KNOWN_MACHINE # define CALL_LIKE_HPUX 1 #endif #ifdef __sgi /* in ANSI mode */ # ifndef sgi # define sgi # endif #endif #if defined (sgi) # define KNOWN_MACHINE # define CALL_LIKE_SUN 1 #endif #if defined (sun) || defined (__sun) # define KNOWN_MACHINE # define CALL_LIKE_SUN 1 # 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(__OSF1__) || defined(__osf__) # define KNOWN_MACHINE # define CALL_LIKE_SUN 1 #endif #ifndef VMS # if defined (vms) || defined (__vms) || defined (__VMS) # define VMS # endif #endif #if defined (VMS) # define KNOWN_MACHINE # define CALL_LIKE_VMS 1 #endif #if defined(_MSC_VER) || defined (WIN32) # if defined (_MSC_VER) && (_MSC_VER >= 800) # define CALL_LIKE_MVS 2 # else # define CALL_LIKE_MVS 1 # endif # define KNOWN_MACHINE #endif #if defined (linux) || defined __linux__ || defined (__CYGWIN__) # undef CALL_LIKE_SUN # define KNOWN_MACHINE # define CALL_LIKE_SUN 1 #endif #if defined __linux__ && ( defined __PPC || defined __PPC__ ) # undef CALL_LIKE_SUN # define KNOWN_MACHINE # define CALL_LIKE_SUN 1 #endif #if defined (__FreeBSD__) # undef CALL_LIKE_SUN # define KNOWN_MACHINE # define CALL_LIKE_SUN 1 #endif #if defined(F2C) || defined(G77) # undef CALL_LIKE_SUN # define CALL_LIKE_SUN 1 # define KNOWN_MACHINE #endif #if defined(__APPLE__) # undef CALL_LIKE_SUN # define CALL_LIKE_SUN 1 # define KNOWN_MACHINE #endif #if defined (_CALL_SYSV) && ! defined (__APPLE__) # undef CALL_LIKE_SUN # define CALL_LIKE_SUN 1 # define KNOWN_MACHINE #endif #if ! defined (KNOWN_MACHINE) # error System type is not known -- see the Installation Guide #else #ifndef _POSIX_SOURCE #define _POSIX_SOURCE #endif /* include X/Open Unix extensions (e.g. cuserid) */ #ifndef _XOPEN_SOURCE #define _XOPEN_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 /* rint() function does not seen to exist for mingw32 defined in library_utils.c */ # if ((defined _WIN32) || (defined _MSC_VER)) && (!defined rint) double rint(double x); #endif #ifdef _MSC_VER #define M_PI 3.14159265358979323846 #endif #ifdef _MSC_VER # 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 */ #define BYTE 0 #define INT16 1 #define INT32 6 #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(WIN32) # define NATIVEIT DFNTI_IBO # define NATIVEFT DFNTF_LEIEEE #endif #if defined(__ARMEL__) # define NATIVEIT DFNTI_IBO # define NATIVEFT DFNTF_LEIEEE #endif #if defined (powerpc) || defined (__powerpc__) || defined (__ppc__) || defined __PPC # define NATIVEIT DFNTI_MBO # define NATIVEFT DFNTF_BEIEEE #endif #if defined (__s390__) || defined (__s390x__) # 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 (__hppa__) # define NATIVEIT DFNTI_MBO # define NATIVEFT DFNTF_BEIEEE #endif #if defined(__ARM__) || defined(__arm__) #if defined(__ARMEB__) # define NATIVEIT DFNTI_MBO # define NATIVEFT DFNTF_BEIEEE #endif #if defined(__ARMEL__) # define NATIVEIT DFNTI_IBO # define NATIVEFT DFNTF_LEIEEE #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 #endif /* __CCP4_BITS */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/cmap_header.c0000644000175100017510000001507111523037274012504 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ #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)); 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)); 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); } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/ccp4_general.c0000644000175100017510000014115211530471215012575 00000000000000/* ccp4_general.c: General library functions and utilities. Copyright (C) 2001, 2003 CCLRC, Peter Briggs et al Copyright (C) 2007 Morten Kjeldgaard. This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @file ccp4_general.c * * @brief General library functions and utilities * @author Peter Briggs et al. */ #include #include #include #include #include #include /* 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" /*! 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). @param[in] ierr error message level @param[in] message text to be displayed @see ccperror_noexit */ int ccperror(int ierr, const char *message) { ccperror_noexit(ierr, message); if (ierr==0) { exit(0); } else if (ierr==1 || ierr==-1) { exit(1); } return 0; } /*! Error reporting without program termination ccperror_noexit is called with a message level ierr and a message string, The exact behaviour is determined by the value of ierr: - 0 : normal termination - 1 : fatal error message - 2 : report severe warning - 3 : report information - 4 : report from library @param[in] ierr error message level @param[in] message text to be displayed @see ccperror */ 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; } /*! Wrapper for vprintf A wrapper for vprintf - acts like printf with an additional argument which is checked against the reference verbosity level. 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. @return 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; } /*! Search for a file (i.e. the default.def or environ.def files) in standard places. We will try to locate the file in several places (in increasing order of significance): -# $prefix/share/ -# $prefix/lib/ -# $CCP4/include where $prefix is defined by the --prefix switch to the configure script. The function allocates memory for the pathname that must be free'd by the caller in order to avoid a memory leak. @return the directory path to default.def file. */ static char *search_def_file(char *fnam) { struct stat statbuf; char *str, *join; char *dnam = (char *)ccp4_utils_malloc(512); // Try $prefix/share/gpp4/fnam: strncpy (dnam, GPP4_PREFIX, 400); strncat (dnam, "/share/gpp4/", 12); join = ccp4_utils_joinfilenames(dnam, fnam); if( stat(join,&statbuf) == 0) { free (join); return dnam; } free(join); // Try $prefix/lib/fnam: strncpy (dnam, GPP4_PREFIX, 400); strncpy (dnam, "/lib", 4); join = ccp4_utils_joinfilenames(dnam, fnam); if( stat(dnam,&statbuf) == 0) { free(join); return dnam; } free(join); /* Hmmm. Try one last time in the CCP4 installation */ if (!(str = getenv("CCP4"))) { printf("Environment variable CCP4 not set ... big trouble! \n"); free(dnam); return NULL; } strncpy(dnam, str, 512); strncat(dnam,"/include", 8); join = ccp4_utils_joinfilenames(dnam, fnam); if( stat(dnam,&statbuf) == 0) { free(join); return dnam; } free(join); /* We give up... */ free(dnam); return NULL; } /*------------------------------------------------------------------*/ /*! Initialise environment for CCP4 programs and parse command line arguments. 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. @param[in] argc number of command line arguments passed to main @param[in] argv array of command line parameters passed to main */ 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 */ 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 */ printf("\\//\\| gpp4 library version version %s\n",GPP4_VERSION_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"); 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 = search_def_file("environ.def"); if (std_dir && diag) printf ("--> found environ.def in %s\n", std_dir); /* 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"); 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; std_dir = search_def_file("default.def"); if (std_dir && diag) printf ("--> found default.def in %s\n", std_dir); /* 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"); 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 from the environment. Use our standard directory /tmp */ file_path = (char *) ccp4_utils_malloc(sizeof(char)*5); strncpy(file_path,"/tmp", 5); if (diag) printf("CCP4SETENV: set file path to CCP4_SCR = \"%s\"\n",file_path); /* 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(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; } /*! Check if named file exists and can be opened for reading 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. @return 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; } /*! Wrapper for the ccp4_utils_setenv command. Set environment variable logical_name to have value file_name. 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: -# Platform-dependency is encoded in ccp4_utils_setenv. -# 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; } /*------------------------------------------------------------------*/ /*! Write CCP4 banner to standard output. */ void ccp4_banner(void) { register int i; int diag=0; char prog_vers_str[19]; time_t curtime; struct tm *loctime; char timebuf[32]; if (diag) printf("Entering ccp4_banner \n"); /* Program version number */ if (ccp4_prog_vers(NULL) && strlen(ccp4_prog_vers(NULL))) { sprintf(prog_vers_str,"version %s",ccp4_prog_vers(NULL)); } else { /* If no program version available then use the major library version number */ sprintf(prog_vers_str,"version %s",GPP4_VERSION_NO); } /* Get the current time. */ curtime = time (NULL); /* Convert it to local time representation. */ loctime = localtime (&curtime); /* output date and time in RFC 2822 format. Example: Mon, 07 Aug 2006 12:34:56 -0600 */ strftime (timebuf, 32, "%a, %d %b %Y %T %z", loctime); char l1[132]; char l2[132]; char l3[132]; int ll1, ll2, ll3, ll = 0; sprintf(l1, "program name: %s, %s", ccp4ProgramName(NULL),prog_vers_str); sprintf(l2, "\\//\\| gpp4 library version: %s, compiled: %s", GPP4_VERSION_NO,__DATE__); sprintf(l3, "CCP4 library compatibility: patch level %s", CCP4_PATCH_LEVEL); #ifdef HAVE_STRNLEN ll1 = strnlen (l1, 132); ll2 = strnlen (l2, 132); ll3 = strnlen (l3, 132); #else ll1 = strlen (l1); ll2 = strlen (l2); ll3 = strlen (l3); #endif // Find longest line ll = MAX(ll1, ll2); ll = MAX(ll, ll3); putchar ('o'); for (i = 0; i < ll+2; i++) { putchar('-'); } fputs("o\n| ",stdout); fputs(l1, stdout); if (ll-ll1 > 0) { for (i=0; i 0) { for (i=0; i 0) { for (i=0; i. */ /*! @file ccp4_program.h @brief Header file for utilies to set and fetch program information @author Peter Briggs, CCP4 @date May 2001 */ /* Macro definitions */ #ifndef __CCP4Program__ #define __CCP4Program__ #ifdef __cplusplus namespace CCP4 { extern "C" { #endif /*! CCP4 library version this version is derived from */ #define CCP4_VERSION_NO "6.1" /*! Patch level of CCP4 that gpp4 is derived from */ #define CCP4_PATCH_LEVEL "6.1.24" /*! GPP4 version is defined by autoconf */ #define GPP4_VERSION_NO "1.3.1" /* Maximum lengths of strings holding program names and versions */ #define MAXLEN_PROGNAME 80 /*!< Maximum length of program name */ #define MAXLEN_PROGVERSION 80 /*!< Maximum length of program version string */ #define MAXLEN_RCSDATE 80 /*!< Maximum length of date string */ /*------------------------------------------------------------------*/ /* 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, 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); /** Set or return program name. * @param progname Program name, or NULL to query existing value. * @return Program name */ char *ccp4ProgramName(const char *progname); /** 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, 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, 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, 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__ */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/symlib.h0000644000175100017510000016347211523037274011571 00000000000000/* symlib.h: overview of syminfo library Copyright (C) 2003 CCLRC, Martyn Winn Modified by Morten Kjeldgaard 2007. This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @page csym_f_page Software Library for handling symmetry operations @section DESCRIPTION From CCP4 5.0, the core handling of symmetry information is done by a set of C functions. Separate @ref csym_page documentation describes the structures and functions used, and the API for C/C++ programs. For Fortran programs, the original set of subroutines (held in @c symlib.f) has been replaced by an @ref csym_page interface to the C library. From the point of view of an application programmer, this interface should be identical to the original set of subroutines. This document originates from the original Fortran library, but should be applicable to the new library. The available Fortran calls have been arranged as much as possible into groups by function. There are often several versions of calls apparently performing the same or very similar tasks, reflecting the policy of never removing existing functionality in order to maintain compatibility with programs written using older versions of the library. @section CONTENTS - @ref symmetry_library DESCRIPTION OF THE SYMMETRY LIBRARY - @ref symmetry_store HOW SYMMETRY OPERATIONS ARE STORED AND APPLIED - @ref describe_group DESCRIPTION OF THE GROUPS OF ROUTINES -# @ref group_1 Deriving and manipulating symmetry operations - @ref group_1_a 1.a. Deriving symmetry operator matrices - @ref group_1_b 1.b. Deriving information from symmetry operators . -# @ref group_2 Testing reflection data - @ref group_2_a 2.a. Centric reflections - @ref group_2_b 2.b. Epsilon zones . -# @ref group_3 Choosing asymmetric units - @ref group_3_a 3.a. Choosing asymmetric units for reflection data - @ref group_3_b 3.b. Choosing asymmetric units in real space consistent with FFT expectations . -# @ref group_4 Testing coordinate data -# @ref group_5 Permuting symmetry operators -# @ref group_6 Generating and accessing a hash table -# @ref group_7 Miscellaneous routines . - @ref list_of_routines FORTRAN API (arranged alphabetically) - @ref asymmetric_unit DEFINITION OF THE CCP4 ASYMMETRIC UNIT - @ref recip_asym_unit a. Reciprocal space - @ref real_asym_unit b. Real space . @section symmetry_library DESCRIPTION OF THE SYMMETRY LIBRARY In CCP4, the primary symmetry information is held in a library data file defined by the logical name SYMINFO. In the standard configuration of CCP4 this is the file syminfo.lib which normally resides in $CLIBD. This file replaces the previous data file SYMOP (i.e. $CLIBD/symop.lib). @c syminfo.lib holds information for all the standard spacegroups in the International Tables. For each spacegroup, several alternative settings are included (e.g. "P 1 2 1", "P 1 1 2" (a.k.a. 1003) and "P 2 1 1" for spacegroup 3). @subsection format Format of the symmetry library file Each setting of a spacegroup is delimited by begin_spacegroup / end_spacegroup records, and contains the following items: @verbatim 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 @endverbatim For example: @verbatim 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 @endverbatim A call to @ref msymlb3 MSYMLB3 should be used to retrieve information from the symmetry library. Note that not all the data items are compulsory for MSYMLB3, although older versions of the routine (MSYMLB2, MSYMLB, MSYGET) still need them. @section symmetry_store HOW SYMMETRY OPERATIONS ARE STORED AND APPLIED @subsection storage Storage of symmetry operations In syminfo.lib the symmetry operations in each spacegroup are listed as strings, for example X,Y,Z or -Y,X-Y,Z+1/3 etc. To be useful within a program these string representations have to be converted to some mathematical representation. Typically a symmetry operation RSym will consist of a rotation operation R and a translation operation T (basically a vector). These are applied to a vector x to obtain x':
x' = Rx + T
It is convenient to represent the rotation by a 3*3 matrix: @verbatim ( R11 R12 R13 ) [R] = ( R21 R22 R23 ) ( R31 R32 R33 ) @endverbatim and the translation by a column vector with 3 elements: @verbatim ( T1 ) [T] = ( T2 ) ( T3 ). @endverbatim CCP4 uses 4x4 arrays to store these symmetry operations as follows: @verbatim RSym = ( R11 R12 R13 T1 ) ( R21 R22 R23 T2 ) ( R31 R32 R33 T3 ) ( 0 0 0 1 ) @endverbatim or @verbatim RSym = ( [R] | [T] ) ( 0 0 0 | 1 ) @endverbatim Essentially this is a 4x4 matrix holding 3x3 transformation matrix in the "top-left-hand corner", the 3-element column (translation) vector in the "top-right-hand corner", and then (0 0 0 1) in the bottom row. The subroutine @ref msymlb3 MSYMLB3 will obtain the set of symmetry matrices in this representation for a given spacegroup, whilst @ref symfr2 SYMFR2 or @ref symfr3 SYMFR3 will obtain individual matrices from the string representation mentioned above. (@ref symtr4 SYMTR4 will perform the inverse operation, converting matrices to string representation.) @subsection application Application of symmetry operations @subsubsection real_space_coordinates 1. Real Space Coordinates Using the convention outlined above, post-multiplying the 4x4 matrix by a column vector as follows: @verbatim RSym . [xf] [yf] [zf] [1 ] @endverbatim will apply both the symmetry and the translation operations to real space coordinates with a single matrix multiplication. The CCP4 @ref modlib MODLIB library provides @ref matrix_vector_ops matrix-vector routines MATVEC4 and TRANSFRM which can be used to perform this operation. @subsubsection reciprocal_space 2. Reciprocal Space The inverse of real-space symmetry matrices are applied to reflection indices by pre-multiplying them by a row vector representing hkl,
ie. h' = h R-1
or,
(h' k' l') = (h k l) R-1
Note that only the operations in the appropriate Laue group are applied to reflection indices, so there are no translational components (i.e. the vector part of the operation, [T], is zero). The subroutine @ref invsym INVSYM will invert a 4x4 matrix stored in this representation, for the purpose of applying symmetry operations to reflection indices. @subsubsection axis_vectors 3. Axis Vectors Real space axis vectors are transformed like reciprocal space vectors, i.e.
(a' b' c') = (a b c) R-1
while reciprocal space axis vectors are transformed like real space coordinates, i.e.
(a*' b*' c*') = R (a* b* c*)
(See also the REINDEX documentation.) @section describe_group DESCRIPTION OF THE GROUPS OF ROUTINES The routines have been broken down into groups according to function. @subsection group_1 Subroutines for deriving and manipulating symmetry operations This group contains routines for obtaining the lists of symmetry operators from the library, and converting between the string (eg Y,X,-Z etc) and matrix representations of symmetry operators. @subsection group_1_a Group 1a: Deriving symmetry operator matrices
@ref msymlb3 MSYMLB3
Gets the symmetry operators in matrix representation for a specified spacegroup from the symmetry library. Will match to any valid s/g name but always returns the longest name, and will match to the spacegroup number if no name matches. Always uses the s/r PGDEFN to guess the point group and the number of primitive symmetry operations (so that any listed in the library are automatically ignored). Checks that the symmetry operations form a closed set.
Replaces: @ref msymlb2 MSYMLB2, @ref msymlb MSYMLB, @ref msyget MSYGET
@ref symfr2 SYMFR2, @ref symfr3 SYMFR3
Translates a character string containing symmetry operator(s) into matrix represenation, stored in a 4*4 matrix/array.
NB: SYMFR2 will translate real space coordinate operations (e.g. x+z,z,-y), reciprocal space operations (e.g. h,l-h,-k) and reciprocal- and real-space axis vector operations (e.g. a*+c*,c*,-b* and a,c-a,-b respectively). SYMFR3 only translates real space coordinate operations.
@ref symtr4 SYMTR4
Translates symmetry matrices into character strings with the equivalent symmetry operations.
Replaces: @ref symtrn SYMTRN, @ref symtr3 SYMTR3
@ref invsym INVSYM
Invert the 4*4 array holding the symmetry matrices, to get the inverse symmetry operation.
Use MSYMLB3 to obtain the set of symmetry operator matrices given the spacegroup name or number. SYMFR2/3 will generate individual symmetry operator matrices from their string representation (useful if the operators are a subset of a spacegroup). SYMTR4 performs the opposite action, and generates string representations of individual symmetry operations from the matrices. INVSYM will generate the inverse matrix of a real space symmetry operation, to be applied to reflection indices as described in @ref symmetry_store section 2. @subsubsection internal_routines Internal routines:
@ref determ DETERM
Calculate the determinant of 4*4 matrix.
@subsection group_1_b Group 1b: Deriving information from symmetry operators
@ref pgdefn PGDEFN
Obtain/guess pointgroup and primitive set of symmetry operators from analysis of all symmetry operators.
@ref pgmdf PGMDF
Gronigen subroutine: determine the nature of the rotation and screw axes from the symmetry matrices.
@ref pgnlau PGNLAU
Determine the Laue group from pointgroup name.
@ref patsgp PATSGP
Determine the Patterson spacegroup from true spacegroup.
@ref hklrange HKLRANGE
Return HKL ranges chosen in PGNLAU
These routines all derive additional information from the symmetry operators or the spacegroup name. The subroutine HKLRANGE returns the information stored in the common block which it shares with PGNLAU @subsection group_2 Group 2: Subroutines for testing reflection data @subsection group_2_a a) Centric reflections
@ref centric CENTRIC
Sets up symmetry elements; must be called first.
@ref centr CENTR
Tests if a reflection is centric
Nb: routines @ref centrc CENTRC and CENPHS both appear to be unused. Call CENTRIC once to set up the symmetry elements in common blocks shared with CENTR. This defines the set of centric reflections. Then for each reflection, a call to CENTR will return whether it is centric. @subsection group_2_b b) Epsilon zones
@ref epsln EPSLN
Sets up tables of epsilon zones; must be called first.
@ref epslon EPSLON
Returns the epsilon zone of a given reflection, as well as whether the reflection is systematically absent (using a call to SYSAB).
@ref sysab SYSAB
Function: determines if a reflection is systematically absent.
Call EPSLN once to generate the epsilon zones (general sets of reflections eg 00l or 0k0) and determine the multiplicity/fold. For each reflection a call to EPSLON returns the zone and if the reflection is systematically absent. SYSAB is not called directly. @ref hkleq HKLEQ - used in SCALA to test if two reflections have equal indices. @subsection group_3 Group 3: Subroutines for choosing asymmetric units Remember that the choice of asymmetric unit is NOT UNIQUE. These routines define the set of CCP4 asymmetric units. The limits for these definitions are given in @ref asymmetric_unit section 3. @subsubsection group_3_a a) Subroutines for choosing asymmetric units for reflection data
@ref asuset ASUSET
Set up symmetry for ASUPUT and ASUGET; must be called first. Calls PRTRSM.
@ref asuput ASUPUT
Put reflection into asymmetric unit defined in ASUSET (reverse operation of ASUGET). Calls INASU.
@ref asuget ASUGET
Recover original indices of a reflection in the asymmetric unit defined in ASUSET (reverse opertaion of ASUPUT).
@ref asuphp ASUPHP
Change phase for symmetry related reflection.
Call ASUSET first to set up symmetry operations in common blocks shared with the other routines. For each reflection calls can then be made to ASUPUT (return the unique hkl indices in the asymmetric unit and symmetry number) or ASUGET (obtain real space indices given unique hkl's and symmetry number). INASU will determine whether a given reflection lies in the asymmetric unit and ASUPHP will convert the phase.

Internal routines:

@ref inasu INASU
Funtion: test if reflection is in the asymmetric unit defined by ASUSET.
@ref prtrsm PRTRSM
Print reciprocal space symmetry operations.
Both these routines are called from within other routines, although they can also be called independently. ASUSET must be called before INASU can be used. @subsubsection group_3_b b) Subroutines for choosing asymmetric units in real space consistent with FFT expectations; FFT grids etc.
@ref setlim SETLIM
Set the appropriate box (=asymmetric unit) for the true spacegroup (ie not the FFT spacegroup). For cubic symmetry spacegroups, this will be more than one asymmetric unit.
@ref setlim_zero SETLIM_ZERO
Set the appropriate box (=asymmetric unit) for the true spacegroup (ie not the FFT spacegroup). For cubic symmetry spacegroups, this will be more than one asymmetric unit.
NB: This s/r differs from SETLIM in using asu limits derived from cctbx.
@ref setgrd SETGRD
Set up a suitable sampling grid for FFT. Calls FNSMP.
@subsubsection internal_routines_2 Internal routines:
@ref factrz FACTRZ
Function: returns TRUE if N has all prime factors \< 19.
@ref fndsmp FNDSMP
Find suitable grid sample.
@subsection group_4 Group 4: Subroutines for testing coordinate data
@ref calc_orig_ps CALC_ORIG_PS
Creates a list of equivalent origins for a given spacegroup
@ref xspecials XSPECIALS
Finds which coordinates occupy special positions (i.e. have occupancies less than 1.0) from consideration of the symmetry operations.
@ref krot KROT
Function: apply symmetry operation to coordinate triplet and check if the result lies in the asymmetric unit.

Neither of the routines XSPECIALS or KROT appear to be used in supported CCP4 programs. @subsection group_5 Group 5: Subroutines for permuting symmetry operators Three subroutines for permuting symmetry operations. They do not really belong here in symlib, but are widely used invisibly in FFT routines using symmetry operations to permute axes for easier fast fourier calculations.

@ref prmvci PRMVCI
Permutes specified column of an integer input matrix using another matrix.
@ref prmvcr PRMVCR
Equivalent to PRMVCI but operates on a real input matrix.
@ref rotfix ROTFIX
Permutes inverse symmetry operations.
@subsection group_6 Group 6: Subroutines for generating and accessing a hash table A set of routines used in SCALA, POSTREF and REBATCH.
@ref ccp4_hash_setup CCP4_HASH_SETUP
Places a value in the internal look-up table.
@ref ccp4_hash_lookup CCP4_HASH_LOOKUP
Access a value stored in the table.
@ref ccp4_hash_zeroit CCP4_HASH_ZEROIT
Initialise contents of the table to zero.
These routines are not directly related to symmetry operations. Hashing is a method of storing data value pairs in such a way that they can be be efficiently retreived later on; the hash table is the resulting data structure.

@subsection group_7 Group 7: Miscellaneous subroutines

@ref setrsl SETRSL
Routine to calculate set coefficients for calculation of (sin(theta)/lambda)**2, from cell dimensions and angles.
@ref sthlsq STHLSQ
Calculate (sin(theta)/lambda)**2 from h,k,l, using coefficients set by a call to SETRSL.
@ref sts3r4 STS3R4
Calculate (sin(theta)/lambda)**2 from h,k,l, using coefficients set by a call to SETRSL. Duplicates STHLSQ exactly.
These three routines share the common block RECPLT. SETRSL and STHLSQ are used only in CAD, whilst STS3R4 does not appear in any supported program. This is how the routines are used in CAD. A call to SETRSL with the cell dimensions and angles sets up coefficients in RECPLT, which are then used by the function STHLSQ to calculate the quantity "(sin(theta)/lamba)**2" for any given set of h, k, l indices. From Bragg's Law, this quantity is equal to 1/(4*d**2), that is, one-quarter of the resolution. Within CAD, multiplication by 4 yields the resolution 1/d**2.
@ref pstoph PSTOPH
Phase angle conversion routine.
The exact function of this routine is unclear and it does not appear in any supported program. @section list_of_routines FORTRAN API The following calls are available to Fortran programs. They are arranged alphabetically. @subsection asuget Subroutine ASUGET(IHKL,JHKL,ISYM) Get original indices of reflection from asymmetric unit, i.e. reverse operation of ASUPUT. Symmetry defined by call to ASUSET. On input:
IHKL(3)
input unique indices hkl
ISYM
symmetry number for output @n odd numbers are for I+ @n even numbers are for I- @n real-space symmetry operation number L = (ISYM-1)/2 + 1
On output:
JHKL(3)
output original indices hkl
The real-space symmetry matrices are applied in ASUPUT by premultiplying them by a row vector hkl, ie (h'k'l') = (hkl)R. So here we calculate (hkl) = (h'k'l') R**-1 @subsection asuphp Subroutine ASUPHP(JHKL,LSYM,ISIGN,PHASIN,PHSOUT) Generate phase of symmetry equivalent JHKL from that of IHKL.

On input:

JHKL(3)
indices hkl generated in ASUPUT
LSYM
symmetry number for generating JHKL ( found by ASUPUT)
ISIGN
= 1 for I+
= -1 for I-
PHASIN
phase for reflection IHKL(3)
On output:
PHSOUT
phase for reflection JHKL(3)
@subsection asuput Subroutine ASUPUT(IHKL,JHKL,ISYM) Put reflection into asymmetric unit defined by call to ASUSET

On input:

IHKL(3)
input indices hkl
On output:
JHKL(3)
output indices hkl
ISYM
symmetry number for output
odd numbers are for I+
even numbers are for I-
real-space symmetry operation number L = (ISYM-1)/2 + 1
The real-space symmetry matrices are applied by premultiplying them by a row vector hkl, ie (h'k'l') = (hkl)R @subsection asuset Subroutine ASUSET Set up & store symmetry informtion for later use in ASUPUT or ASUGET

On input:

SPGNAM
space-group name (not used) ( character)
NUMSGP
space-group number (not used)
PGNAME
point-group name ( character)
MSYM
total number of symmetry operations
RRSYM(4,4,MSYM)
symmetry matrices (real-space)
LPRINT
- printing flag. ( logical)
On output:
PGNAME
point-group name ( character)
MSYMP
number of primitive symmetry operations
MLAUE
Laue group number - See PGNLAU for details
@subsection calc_orig_ps Subroutine CALC_ORIG_PS(NAMSPG_CIF,NSYM,RSYM,NORIG,ORIG,LPAXISX,LPAXISY,LPAXISZ) Creates a list of equivalent origins for the named spacegroup.

ARGUMENTS

(I) NAMSPG_CIF
spacegroup name (character)
(I) NSYM
number of symmetry operations
(I) RSYM(4,4,NSYM)
symmetry ops stored as 4x4 matrices
(O) NORIG
number of origins.
(O) ORIG(3,i)
vector of alternate origin (for example : 0.5,0.0,0.5) only positive components. include vector: (0,0,0)
(O) LPAXISX
logical; set true if s/grp is polar along x axis
(O) LPAXISY
logical; set true if s/grp is polar along y axis
(O) LPAXISZ
logical; set true if s/grp is polar along z axis

Taken from Alexei Vagin @subsection ccp4_hash_lookup Integer Function CCP4_HASH_LOOKUP(NSER) The function CCP4_HASH_LOOKUP returns the value NFIND (which was input when setting up the function in the subroutine CCP4_HASH_SETUP) for the large range variable NSER. Uses hashing. (see comments for CCP4_HASH_SETUP for description of hashing method). @subsection ccp4_hash_setup Subroutine CCP4_HASH_SETUP(NSER,NFIND) This subroutine sets up a value for the function ccp4_hash_lookup.

When ccp4_hash_lookup(nser) is later evaluated it will return nfind

This function will allow the efficient retrieval of an identifier for a large range variable (such as a crystal number). The values of the function ccp4_hash_lookup(nser) are stored in the array it(2, kpri) where kpri is the prime number used to generate the function.

The array 'it' lives in the common block which is shared by ccp4_hash_setup and the function ccp4_hash_lookup

NOTES: A hash table is a way of storing information so that it easily be retrieved without the need for indexing or long searches. NSER is referred to as the "key", which is "hashed" (computer- science speak for "messed up") by the hashing function (in this case MOD(NSER4,KPRI) + 1) to determine where the value pair will be stored. The function LOOKUP can then search on the same basis when supplied with the key, to retreive the pair in (at most) 3 calculations. Note that KPRI (the table size) MUST BE A PRIME in order for this method to work. @subsection ccp4_hash_zeroit Subroutine CCP4_HASH_ZEROIT() Initialises elements of array 'it' used in ccp4_hash_setup and ccp4_hash_lookup to zero. @subsection centr Subroutine CENTR(IH,IC) Input IH(3) - reflection indices

Returns IC

Determine whether a reflection is centric (return IC=1) or not (IC=0). If none of the zone tests is satisfied, the reflection is non-centric. @subsection centrc Logical Function CENTRC(KHKL,ICENT) Returns value as true if reflection khkl is centric, false otherwise. It is general for all point groups - but only for the unique set of indices which conforms to the criterion of maximising the value of

(khkl(3)*256 + khkl(2))*256 + khkl(1)

as produced by e.g. subroutine turnip in protin and ulysses.

In this case the required tests are controlled by 7 flags in icent for

0KL H0L HK0 HKK HKH HHL H,-2H,L

(the last is needed in pg312) @subsection centric Subroutine CENTRIC(NSM,RSMT,IPRINT) This is Randy Read's method of defining centric reflections. It uses NSM and the symmetry operators stored in RSMT(4,4,NSM)

It decides how many centric zones there are, and flags them.

set up tests for 0kl h0l hk0 hhl hkh hkk h,-hl hk-h hk-k -h 2h l 2h -h l hkl

Zones are encoded using an idea from a program by Bricogne. If h*zone(1) + k*zone(2) + l*zone(3) is equal to 0.0, that reflection is in that zone. All that is needed is the most general conditions - a reflection is either centric or not. @subsection determ Subroutine DETERM(det,a) Gets determinant of a matrix

Input A
4*4 matrix (real)
Output DET
determinant of A.
@subsection epsln Subroutine EPSLN(NSM,NSMP,RSMT,IPRINT) It works out the epsilon cards using NSM and the symmetry operators stored in RSMT(4,4,NSM). This is Randys program description: @note zones defined as for centric zones, but fourth number on each line is the multiplicity corresponding to this zone. last card should always be 0 0 0 n, where n is appropriate for the lattice (1 for primitive, 2 for face- centred, etc.), so that general reflections get a value for epsilon. be very careful of the order of the zones. cards for reciprocal lattice rows should be given before those for planes, because the first test that is satisfied defines the zone. @n set up tests for @n h00 0k0 00l hh0 h0h 0kk h,-h0 h0-h 0k-k -h2h0 2h-h0 hhh hkl @subsection epslon Subroutine EPSLON(IH,EPSI,ISYSAB) Input IH(3) - reflection indices Returns EPSI ( epsilon zone) , and ISYSAB flag. Systematic absences flagged with ISYSAB = 1 Find the zone a reflection falls into, and return the appropriate value for the reflection multiplicity factor. Each reflection must have a zone. @subsection factrz Logical Function FACTRZ(N) Returns true if N has all prime factors \<= 19 @subsection fndsmp Subroutine FNDSMP(MINSMP, NMUL, SAMPLE, NSAMPL) Find suitable grid sample, approximately = SAMPLE/2 * maximum index, with required factor, and no prime factor > 19

On entry:

MINSMP
minimum sample, approximately 2 * maximum index
NMUL
required factor
SAMPLE
desired sample factor, ie if = 1.0 (minimum), try to get sample close to MINSMP
On exit:
nsampl
grid sample; if MINSMP\<=0, nsampl=nmul
@subsection hkleq Logical Function HKLEQ(IH,KH) Checks if indices are equal.

Returns true if indices ih = kh @subsection hklrange Subroutine HKLRANGE(IHRNG0,IKRNG1,IKRNG0,IKRNG1,ILRNG0,ILRNG1) Return HKL ranges chosen in PGNLAUE

Arguments: (INTEGER) HRNG0,HRNG1,KRNG0,KRNG1,LRNG0,LRNG1 @subsection inasu Integer Function INASU(IH, NLAUE) Arguments:

NLAUE
- code number for this pointgroup
IH(3)
- indices
Returns:

INASU = +1 if h k l chosen
INASU = -1 if -h-k-l chosen
INASU = 0 if reflection is out-of-bounds @subsection invsym Subroutine INVSYM(S,ST) Inverts a 4*4 matrix. Used here to get inverse symmetry operation for generating equivalent h k l, i.e.

[h'] = [h][St]

h'(j) =Sum(I=1,3)[ h(i)*St(I,J,NS)]

Arguments:

Input S
4*4 matrix to be inverted
Output ST
4*4 matrix (inverse of S)
@subsection krot Integer Function KROT(NS) Apply NS'th symmetry operation to JP to get LP, check if lies in asymmetric unit given by NAU.

Returns KROT=0 correct operation, =1 if not. @subsection msyget Subroutine MSYGET(IST,LSPGRP,NSYM,ROT) Get symmetry operations for space-group LSPGRP from library file, logical name SYMINFO.

Arguments:

IST
dummy parameter for backwards compatibility
LSPGRP (input)
Name of spacegroup
IST (input)
Stream of library file
NSYM (output)
Number of symmetry operations
ROT(4,4,NSYM) (output)
Rotation/translation matrices
@subsection msymlb Subroutine MSYMLB(IST,LSPGRP,NAMSPG,NAMPG,NSYMP,NSYM,ROT) Get symmetry operations from library file, logical name SYMINFO. Space group defined by LSPGRP - spacegroup number or NAMSPG - spacegroup name.

Arguments:

IST
dummy parameter for backwards compatibility
LSPGRP (I/O)
spacegroup number
NAMSPG (I/O)
spacegroup name
NAMPG (O)
pointgroup name
NSYMP (O)
number of primitive symmetry operations
NSYM (O)
number of symmetry operations
ROT(4,4,NSYM)
rotation/translation matrices
@subsection msymlb2 Subroutine MSYMLB2(IST,LSPGRP,NAMSPG_CIF,NAMPG,NSYMP,NSYM,ROT) Identical to MSYMLB, except that on output NAMSPG_CIF has correct CIF format, e.g. 'P 21 21 21'

NAMSPG_CIF should be as in _symmetry.space_group_name_H-M @subsection msymlb3 Subroutine MSYMLB3(IST,LSPGRP,NAMSPG_CIF,NAMSPG_CIFS,NAMPG,NSYMP,NSYM,RlSymmMatrx) Another version of MSYMLB, with the following changes:

  1. The routine will try first to match the assigned NAMSPG_CIF to ANY name given on the spacegroup line:

    It is satisfied by the first fit it finds:

    eg: 47 8 8 Pmmm PGmmm ORTHORHOMBIC 'P 2/m 2/m 2/m' 'P m m m'

    You could call the subroutine with NAMSPG_CIF = 'Pmmm' or 'P 2/m 2/m 2/m' or 'P m m m'

    But it will always return the LONGEST possible name. ie 'P 2/m 2/m 2/m'

  2. If there is no match to the spacegroup NAME, the space group is identified by its number. This requires that the number is UNIQUE, so alternate settings are numbered n000 + Int Tab number
  3. The point group name is always guessed at by the SR PGDEFN and the guess on the data line is ignored.
  4. The number of primitive symmetry operators is also determined by the SR PGDEFN. The non-primitive operators are stored in the first NSYMP symmetry matrices and the guess on the data line is ignored.
  5. The symmetry operators are checked to make sure they are a closed group.
In the library file, the header for each entry may contain (Order not guaranteed, but must start with)

LSPGRP NLINS and contain either NAMSPG or NAMSPG_CIF

LSPGRP NLINS NLINP NAMSPG NAMPG CRYSTAL NAMSPG_CIF

where:

LSPGRP
spacegroup number
NLINS
total number of lines of symmetry operators.
NLINP
number of LINES of primitive symmetry operators (not used now..)
NAMSPG_CIF
spacegroup name (in CIF format? presumably)
NAMPG
name of corresponding pointgroup (not used now..)

On entry:

IST
stream number to read file
LSPGRP
spacegroup number
NAMSPG or NAMSPG_CIF
any acceptable spacegroup name: this will be used to identify the spacegroup if possible

Returns:

LSPGRP
spacegroup number
NAMSPG_CIF
full spacegroup name
NAMSPG_CIFS
name without any spaces
NAMPG
pointgroup name ( obtained from pgdefn - not 100% reliable!)
NSYMP
number of primitive symmetry operations obtained from pgdefn- only different from NSYM in non-primitive spacegroups
NSYM
total number of symmetry operations
RlSymmMatrx(4,4,NSYM)
Symmetry Rotation/translation matrices
@subsection patsgp Subroutine PATSGP(SPGNAM, PGNAME, PATNAM, LPATSG) Determine Patterson spacegroup from true space-group

On entry:

SPGNAM
space-group name. Only used to determine lattice centering
PGNAME
point-group name
On exit:
PATNAM
name of Patterson spacegroup
LPATSG
number of Patterson spacegroup
@subsection pgdefn Subroutine PGDEFN(NAMPG,NSYMP,NSYM,RSYMT,LPRINT) Arguments:
Input NSYM
- number of symmetry operators. ( integer)
Input RSYMT
- 4*4 symmetry matrices. ( real)
Input LPRINT
- printing flag. ( logical)
Returns NAMPG
- name of point group. ( character)
Returns NSYMP
- number of primitive symmetry operators. ( integer)
Returns RSYMT
- possibly reordered.

This subroutine chooses the primitive set of symmetry operators.

If necessary it re-orders the symmetry operators to give the primitive ones first.

This subroutine works out the point group name NAMPG. That is ; it checks rotation axes, etc etc and recognises these point groups. (It DOES NOT cope with mirror planes etc)

Gronigen MDF stuff: It now sets up the common block MDFPAR for MDF file mods and fills in the symmetry info. See subroutine for details. @subsection pgmdf Subroutine PGMDF(JLASS,JCENTR,JSCREW) Gronigen subroutine.

Use this subroutine to transfer information to and from MDFPAR.
If JLASS eq 0 then fill JLASS JCENTR JSCREW from common block.
If JLASS gt 0 then fill KLASS ICENTR ISCREW in common block. @subsection pgnlau Subroutine PGNLAU(NAMPG,NLAUE,LAUNAM) Choose Laue group from PG name.

On entry:

NAMPG
point-group name ( character)
On exit:
NLAUE
Laue group number ( integer)
LAUNAM
Laue group name ( character)
This subroutine returns a laue code number used to choose the unique region of reciprocal space for each point group. The number nlaue is the same as the one set in CAD for this purpose. @verbatim Pointgroup Laue group Limits 3 pg1 1bar hkl:l>=0 hk0:h>=0 0k0:k>=0 1,2 pg1bar 4 pg2 (b) 2/m hkl:k>=0, l>=0 hk0:h>=0 3/b,4/b.... pgm pg2/m 5 pg2 (c) 2/m hkl:k>=0, l>=0 h0l:h>=0 1003,1004 6 pg222 mmm hkl:h>=0, k>=0, l>=0 16 ... pgmm2 pgmmm 7 pg4 4/m hkl:h>=0, l>=0 with k>=0 if h=0 and pg4bar pg4/m k>0 if h>0 8 pg422 4/mmm hkl:h>=0, k>=0, l>=0 89.. pg4mm pg4bar2m pg4barm2 pg4/mmm 9 pg3 3bar hkl:h>=0, k>0 00l:l>0 143.. pg3bar 10 pg312 3/m hkl:h>=0, k>=0 with k\<=h for all l. pg32 pg3m pg3m1 pg3barm1 if k = 0 l>=0 Space group numbers : 149-151-153 157 159 162 163 11 pg321 3bar1m hkl:h>=0, k>=0 with k\<=h for all l. pg31m pg3bar1m if h = k l>=0 Space group numbers : 150-152-154 12 pg6 6/m hkl:h>=0, k>=0, l>=0 with k>=0 if h=0 pg6bar 6/m and k> 0 if h>0 13 pg622 6/mmm hkl:h>=0, k>=0, l>=0 with h>=k 177.. pg6mm pg6barm2 pg6bar2m pg 6/mmm 14 pg23 m3 hkl:h>=0, k>=0, l>=0 with l>=h, k>=h pgm3bar 15 pg432 m3m hkl:h>=0, k>=0, l>=0 with k>=l pg4bar3m pgm3barm @endverbatim @subsection prmvci Subroutine PRMVCI(PERM,JV,N,N1)
Input PERM
- 4*4 matrix (real)
Input JV
- N1*3 matrix (integer)
Output JV
- N1*3 matrix (integer)

This has been modified by permuting the Nth column by matrix PERM.

Here is the code for clarity: @code C---- Permute C C DO 10 I = 1,3 C BV(I) = PERM(I,1)*JV(N,1) + PERM(I,2)*JV(N,2) + C + PERM(I,3)*JV(N,3) C 10 CONTINUE C C---- Copy back C C DO 20 I = 1,3 C JV(N,I) = NINT(BV(I)) C 20 CONTINUE @endcode @subsection prmvcr Subroutine PRMVCR(PERM,AV,N,N1)
Input PERM
- 4*4 matrix (real)
Input AV
- N1*3 matrix (real)
Output AV
- N1*3 matrix (real) This has been modified by permuting the Nth column by matrix PERM.

See PRMVCI - this routine is its real equivalent. @subsection prtrsm Subroutine PRTRSM(PGNAME, NSYMP, RSYMIV) Print reciprocal space symmetry operations

The real-space symmetry matrices are applied by premultiplying them by a row vector hkl, ie (h'k'l') = (hkl)R @subsection pstoph Subroutine PSTOPH (PSIX,PSIY,PSIZ,PHIX,PHIY,PHIZ,AVPHI) Convert PSIX,PSIY,PSIZ (= epsx,epsy,epsz) to PHIX,PHIY,PHIZ, using AVPHI

All angles in radians @subsection rotfix Subroutine ROTFIX Permutes inverse symmetry operations

Matrices passed in Common block ATSYM @subsection setgrd Subroutine SETGRD(NLAUE,SAMPLE,NXMIN,NYMIN,NZMIN,NX,NY,NZ) Set up a suitable sampling grid for FFT

Input:

NLAUE
Laue-group for FFT/SF calculation
SAMPLE
default fineness of sample, ie if = 1.0 (minimum), try to get sampling as close to minimum as possible.
Typically = 1.5 to get sample at traditional 3 * maximum index
NXMIN NYMIN NZMIN
minimum sampling (true XYZ)
Output:
NX,NY,NZ
sampling intervals along X,Y,Z
The sampling intervals must satisfy the following conditions: -# approximately SAMPLE * minimum sampling -# no prime factor \> 19 -# special restrictions for particular space-groups . This is ALL the point groups. @verbatim PG1 PG1bar PG2 PGm PG2/m PG222 PGmm2 PGmmm PG4 PG4bar PG4/m PG422 PG4mm PG4bar2m PG4/mmm PG3 PG3bar PG32 PG3m PG3barm PG6 PG6bar PG6/m PG622 PG6mm PG6bar2m PG6/mmm PG23 PGm/3bar PG432 PG4bar3m PGm3bar m @endverbatim We use: @verbatim PG1 PG1bar PG2 PG2/m PG222 PGmmm PG4 PG4/m PG422 PG4/mmm PG3 PG3bar PG32 PG3bar/m PG6 PG6/m PG622 PG6/mmm PG23 PGm/3bar PG432 PGm3barm @endverbatim For grid restrictions we only need to know the laue number. Here is the table: @verbatim 3 pg1 1bar hkl:l>=0 hk0:h>=0 0k0:k>=0 1,2 4 pg2 2/m hkl:k>=0, l>=0 hk0:h>=0 3/b,4/b.... 5 pg2(c) 2/m hkl:k>=0, l>=0 h0l:h>=0 1003,1004 6 pg222 mmm hkl:h>=0, k>=0, l>=0 16 ... 7 pg4 4/m hkl:h>=0, l>=0 with k>=0 if h=0 and 8 pg422 4/mmm hkl:h>=0, k>=0, l>=0 89.. 9 pg3 3bar hkl:h>=0, k>0 00l:l>0 143.. 10 pg312 3/m hkl:h>=0, k>=0 with k\<=h for all l. if k = 0 l>=0 Space group numbers : 149-151-153 11 pg321 3/m hkl:h>=0, k>=0 with k\<=h for all l. if h = k l>=0 Space group numbers : 150-152-154 12 pg6 6/m hkl:h>=0, k>=0, l>=0 with k=0 if h=0 13 pg622 6/mmm 14 pg23 m3 15 pg432 m3m @endverbatim @subsection setlim Subroutine SETLIM(LSPGRP,XYZLIM) Set appropriate box (asymmetric unit) for spacegroup (true spacegroup rather than FFT spacegroup) LSPGRP. For cubic symmetry spacegroups, this will be more than one asymmetric unit.

On entry:

lspgrp
true spacegroup (not FFT spacegroup)
On exit:
xyzlim(2,3)
minimum, maximum limits on x,y,z (fractions of cell); if spacegroup not recognized, returns xzylim(1,1) = -1.0
Note that the minimum limits (xyzlim(1,)) will always = 0.0
@subsection setlim_zero Subroutine SETLIM_ZERO(LSPGRP,XYZLIM) Set appropriate box (asymmetric unit) for spacegroup (true spacegroup rather than FFT spacegroup) LSPGRP. For cubic symmetry spacegroups, this will be more than one asymmetric unit.

NB This s/r differs from SETLIM in that the limits are taken from cctbx via CCP4's syminfo.lib file.

On entry:

lspgrp
true spacegroup (not FFT spacegroup)
On exit:
xyzlim(2,3)
minimum, maximum limits on x,y,z (fractions of cell); if spacegroup not recognized, returns xzylim(1,1) = -1.0
Note that the minimum limits (xyzlim(1,)) will always = 0.0
@subsection setrsl Subroutine SETRSL(A,B,C,ALPHA,BETA,GAMMA) Routine to calculate coefficients for (sin(theta)/lambda)**2 from h,k,l for general axes.

First calculates the components of input axes in an orthonormal basis, then calculate components of reciprocal axes in same basis.

The input angles are in degrees. @subsection sthlsq Real Function STHLSQ(IH,IK,IL) Calculate (sin(theta)/lambda)**2 from h,k,l. The coefficients are set by a previous call to SETRSL. Works for any kind of axes. @subsection sts3r4 Real Function STS3R4(IH,IK,IL) Calculate (sin(theta)/lambda)**2 from h,k,l. The coefficients are set by a call to SETRSL. Works for any kind of axes. @subsection symfr2 Subroutine SYMFR2(ICOL,I1,NS,ROT) Read and interpret symmetry operations

SYMFR2 recognises the following types of input: @verbatim 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 @endverbatim

The subroutine returns the appropriate 4x4 transformation matrix for each operation. The calling program must interpret the resulting matrix(ces) correctly.

On entry I1 is the first character of ICOL to look at (say after keyword 'SYMM')

NS is the number of the first symmetry operation to be read, & returns with the number of the last one read.

On exit, ROT(4,4,NS) contains the real-space symmetry matrices, in standard convention, i.e.

[x'] = [s][x]

x'(I)=Sum(J=1,3)ROT(I,J,NS)*x(J) + ROT(I,4,NS)

Input:

ICOL
character string containing symmetry operations
I1
first character in ICOL to interpret from.
Output:
ROT(I,4,NS)
contains the fractional translations.
@subsection symfr3 Subroutine SYMFR3(ICOL,I1,NS,ROT,EFLAG) Read and interpret symmetry operations.

Arguments:

ICOL (I) CHARACTER*80
Line containing the symmetry operations
I1 (I) INTEGER
First character to look at in ICOL (say after keyword 'SYM')
NS (I/O) INTEGER
is the number of the first symmetry operation to be read, & returns with the number of the last one read (ie you can have more than one on a line!)
ROT (O) REAL
Array (4,4,at_least_NS), on exit contains the real-space symmetry matrices, in standard convention, i.e.
[x'] = [s][x]

x'(I)=Sum(J=1,3)ROT(I,J,NS)*x(J) + ROT(I,4,NS)

ROT(I,4,NS) contains the fractional translations
EFLAG (O) INTEGER
Error flag - on exit, if 0 then OK, \> 0, an error occurred.
@subsection symtrn Subroutine SYMTRN(NSM,RSM) Symmetry translation from matrix back to characters

This translates the symmetry matrices RSM(4,4,NSM) into INT TAB character strings

It gives the real and reciprocal space operations. @verbatim eg X,Y,Z H , K, L eg -Y,X-Y, Z -H-K, H, L etc @endverbatim That is more complicated than you might think!! @subsection symtr3 Subroutine SYMTR3(NSM,RSM) Symmetry translation from matrix back to characters

This translates the symmetry matrices RSM(4,4,NSM) into INT TAB character strings

It gives the real and reciprocal space operations. @verbatim eg X,Y,Z H , K, L eg -Y,X-Y, Z -H-K, H, L etc @endverbatim That is more complicated than you might think!!

Arguments :

NSM (I) INTEGER
Number of Symmetry operations
RSM (I) REAL
Array of dimension (4,4,at least NSM) containing symmetry operations on input
SYMCHS (O) CHARACTER*(*)
Array of dimension at least NSM containing int tab char strings on output
IPRINT (I) INTEGER
Print flag
=0 No printing
=1 Print the int tab strings
@subsection symtr4 Subroutine SYMTR4(NSYM,RSM,SYMCHS) Symmetry translation from matrix back to characters

This translates the symmetry matrices RSM(4,4,NSM) into INT TAB character strings

It gives the real and reciprocal space operations. @verbatim eg X,Y,Z H , K, L eg -Y,X-Y, Z -H-K, H, L etc @endverbatim That is more complicated than you might think!!

Arguments :

Nsym (I) INTEGER
Number of Symmetry operations
Rsm (I) REAL
Array of dimension (4,4,at least Nsym) containing symmetry operations on input
Symchs (O) CHARACTER*(*)
Array of dimension at least Nsym containing int tab char strings on output
@subsection sysab Subroutine SYSAB(IN,ISYSAB) Input IN(3) - reflection indices

Returns ISYSAB flag. Systematic absences flagged with ISYSAB = 1 Only reflns with EPSI \> 1 need be considered. @subsection xspecials Subroutine XSPECIALS(NSYM,RSYM,XF,YF,ZF,NSPEC)

Input NSYM
- number of symmetry operators. ( integer)
Input RSYM
- 4*4*NSYM symmetry matrices. ( real)
Input XF YF ZF
- a coordinate in fractional coordinates.
Output NSPEC
- the multiplicity of the coordinate. eg: NSPEC = 3 for an atom on a 3fod axis.
This subroutine finds what coordinates occupy special positions i.e. have occupancies less than 1.0 from consideration of the symmetry operations. @section asymmetric_unit DEFINITION OF THE CCP4 ASYMMETRIC UNIT There is no standard defined asymmetric unit so the definitions are arbitrary and may differ between differ packages. The subroutines in @ref group_3_a group 3.a are used to define the CCP4 asymmetric unit, and to determine whether a reflection falls within this definition. Below are the definitions of the @ref recip_asym_unit reciprocal space and the @ref real_asym_unit real space asymmetric units under the CCP4 convention. @subsection recip_asym_unit a. Reciprocal Space Asymmetric Unit Definitions The reciprocal space asymmetric unit is defined in the subroutine ASUSET from the Laue group using calls to the s/r's PGDEFN and PGNLAU. The limits of the CCP4 asymmetric unit are (from @ref pgnlau PGNLAU):
Pointgroup Laue group Limits Spacegroup Nos
3 pg1
pg1bar
1bar hkl:l\>=0
hk0:h\>=0
0k0:k\>=0
1,2
4 pg2 (b)
pgm pg2/m
2/m hkl:k\>=0, l\>=0
hk0:h\>=0
3,4....
5 pg2 (c) 2/m hkl:k\>=0, l\>=0
h0l:h\>=0
1003, 1004
6 pg222
pgmm2
pgmmm
mmm hkl:h\>=0, k\>=0, l\>=0 16 ...
7 pg4
pg4bar
pg4/m
4/m hkl:h\>=0, l\>=0 with k\>=0 if h=0
and k\>0 if h\>0
75,..
8 pg422 pg4mm pg4bar2m
pg4barm2 pg4/mm
4/mmm hkl:h\>=0, k\>=0, l\>=0 89,..
9 pg3
pg3bar
3bar hkl:h\>=0, k\>0 00l:l\>0 143,..
10 pg312 pg32
pg3m pg3m1 pg3barm1
3/m hkl:h\>=0, k\>=0 with k\<=h for all l.
if k=0 l\>=0
149 151 153 157 159 162 163
11 pg321 pg31m pg3bar1m 3bar1m hkl:h\>=0, k\>=0 with k\<=h for all l.
if k=h l\>=0
150 152 154
12 pg6 pg6bar 6/m hkl:h\>=0, k\>=0, l\>=0 with k\>=0 if h=0 and k\>0 if h\>0 168..
13 pg622 pg6mm pg6barm2 pg6bar2m pg6/mmm 6/mmm hkl:h\>=0, k\>=0, l\>=0 with h\>=k 177..
14 pg23 pgm3bar m3 hkl:h\>=0, k\>=0, l\>=0 with l\>=h, k\>=h 195..
15 pg432 pg4bar3m pgm3barm m3m hkl:h\>=0, k\>=0, l\>=0 with k\=1 209..
@subsection real_asym_unit b. Real Space Asymmetric Unit Definitions The subroutine @ref setlim SETLIM contains the definitions of the real space asymmetric unit. Note that not all of the spacegroups have a definition within SETLIM.
No. Spacegroup Upper limits on x, y, z @ref asterisk (*)
1 P 1 x \< 1, y \< 1, z \< 1,
2 P -1 x \< 1, y \<= 1/2, z \< 1,
3 P 1 2 1 x \<= 1/2, y \< 1, z \< 1,
4 P 1 21 1 x \< 1, y \< 1/2, z \< 1,
5 C 1 2 1 x \<= 1/2, y \< 1/2, z \< 1,
10 P 1 2/M 1 x \<= 1/2, y \<= 1/2, z \< 1,
16 P 2 2 2 x \<= 1/2, y \<= 1/2, z \< 1,
17 P 2 2 21 x \<= 1/2, y \<= 1/2, z \< 1,
18 P 21 21 2 x \< 1, y \<= 1/4, z \< 1,
19 P 21 21 21 x \< 1, y \< 1, z \<= 1/4,
20 C 2 2 21 x \<= 1/2, y \<= 1/4, z \< 1,
21 C 2 2 2 x \<= 1/2, y \<= 1/4, z \< 1,
22 F 2 2 2 x \<= 1/4, y \<= 1/4, z \< 1,
23 I 2 2 2 x \<= 1/2, y \<= 1/4, z \<= 1,
24 I 21 21 21 x \<= 1/2, y \<= 1/4, z \< 1,
47 P 2/M 2/M 2/M x \<= 1/2, y \<= 1/2, z \<= 1/2,
65 C 2/M 2/M 2/M x \<= 1/2, y \<= 1/4, z \<= 1/2,
69 F 2/M 2/M 2/M x \<= 1/4, y \<= 1/4, z \<= 1/2,
71 I 2/M 2/M 2/M x \<= 1/2, y \<= 1/4, z \<= 1/2,
75 P 4 x \<= 1/2, y \<= 1/2, z \< 1,
76 P 41 x \< 1, y \< 1, z \< 1/4,
77 P 42 x \<= 1/2, y \< 1, z \< 1/2,
78 P 43 x \< 1, y \< 1, z \< 1/4,
79 I 4 x \<= 1/2, y \<= 1/2, z \<= 1/2,
80 I 41 x \<= 1/2, y \< 1, z \< 1/4,
83 P 4/M x \<= 1/2, y \<= 1/2, z \<= 1/2,
87 I 4/M x \<= 1/2, y \<= 1/2, z \<= 1/4,
89 P 4 2 2 x \<= 1/2, y \<= 1/2, z \<= 1/2,
90 P 4 21 2 x \<= 1/2, y \<= 1/2, z \<= 1/2,
91 P 41 2 2 x \< 1, y \< 1, z \<= 1/8,
92 P 41 21 2 x \< 1, y \< 1, z \<= 1/8,
93 P 42 2 2 x \<= 1/2, y \< 1, z \<= 1/4,
94 P 42 21 2 x \<= 1/2, y \<= 1/2, z \<= 1/2,
95 P 43 2 2 x \< 1, y \< 1, z \<= 1/8,
96 P 43 21 2 x \< 1, y \< 1, z \<= 1/8,
97 I 4 2 2 x \<= 1/2, y \<= 1/2, z \<= 1/4,
98 I 41 2 2 x \<= 1/2, y \< 1, z \<= 1/8,
123 P 4/M 2/M 2/M x \<= 1/2, y \<= 1/2, z \<= 1/2,
139 I 4/M 2/M 2/M x \<= 1/2, y \<= 1/2, z \<= 1/4,
143 P 3 x \<= 2/3, y \<= 2/3, z \< 1,
144 P 31 x \< 1, y \< 1, z \< 1/3,
145 P 32 x \< 1, y \< 1, z \< 1/3,
146 H 3 x \<= 2/3, y \<= 2/3, z \< 1/3,
147 P -3 x \<= 2/3, y \<= 2/3, z \<= 1/2,
148 R -3 x \<= 2/3, y \<= 2/3, z \<= 1/6,
149 P 3 1 2 x \<= 2/3, y \<= 2/3, z \<= 1/2,
150 P 3 2 1 x \<= 2/3, y \<= 2/3, z \<= 1/2,
151 P 31 1 2 x \< 1, y \< 1, z \<= 1/6,
152 P 31 2 1 x \< 1, y \< 1, z \<= 1/6,
153 P 32 1 2 x \< 1, y \< 1, z \<= 1/6,
154 P 32 2 1 x \< 1, y \< 1, z \<= 1/6,
155 H 3 2 x \<= 2/3, y \<= 2/3, z \<= 1/6,
162 P -31 2/M x \<= 2/3, y \<= 1/2, z \<= 1/2,
164 P -3 2/M 1 x \<= 2/3, y \<= 1/3, z \<= 1,
166 R -3 2/M x \<= 2/3, y \<= 2/3, z \<= 1/6,
168 P 6 x \<= 2/3, y \<= 1/2, z \< 1,
169 P 61 x \< 1, y \< 1, z \< 1/6,
170 P 65 x \< 1, y \< 1, z \< 1/6,
171 P 62 x \< 1, y \< 1, z \< 1/3,
172 P 64 x \< 1, y \< 1, z \< 1/3,
173 P 63 x \<= 2/3, y \<= 2/3, z \< 1/2,
175 P 6/M x \<= 2/3, y \<= 2/3, z \<= 1/2,
177 P 6 2 2 x \<= 2/3, y \<= 1/2, z \<= 1/2,
178 P 61 2 2 x \< 1, y \< 1, z \<= 1/12,
179 P 65 2 2 x \< 1, y \< 1, z \<= 1/12,
180 P 62 2 2 x \< 1, y \< 1, z \<= 1/6,
181 P 64 2 2 x \< 1, y \< 1, z \<= 1/6,
182 P 63 2 2 x \<= 2/3, y \<= 2/3, z \<= 1/4,
191 P 6/M 2/M 2/M x \<= 2/3, y \<= 1/3, z \<= 1/2,
195 P 2 3 x \< 1, y \< 1, z \<= 1/2,
196 F 2 3 x \<= 1/4, y \<= 1/4, z \< 1,
197 I 2 3 x \< 1, y \< 1, z \<= 1/2,
198 P 21 3 x \<= 1/2, y \<= 1/2, z \< 1,
199 I 21 3 x \<= 1/2, y \<= 1/2, z \<= 1/2,
200 P 2/M -3 x \<= 1/2, y \<= 1/2, z \<= 1/2,
202 F 2/M -3 x \<= 1/2, y \<= 1/2, z \<= 1/4,
204 I 2/M -3 x \<= 1/2, y \<= 1/2, z \<= 1/2,
207 P 4 3 2 x \< 1, y \<= 1/2, z \<= 1/2,
208 P 42 3 2 x \<= 1/2, y \< 1, z \<= 1/4,
209 F 4 3 2 x \<= 1/2, y \<= 1/2, z \<= 1/2,
210 F 41 3 2 x \<= 1/2, y \< 1, z \<= 1/8,
211 I 4 3 2 x \<= 1/2, y \<= 1/2, z \<= 1/4,
212 P 43 3 2 x \< 1, y \< 1, z \<= 1/8,
213 P 41 3 2 x \< 1, y \< 1, z \<= 1/8,
214 I 41 3 2 x \<= 1/2, y \< 1, z \<= 1/8,
221 P 4/M -3 2/M x \<= 1/2, y \<= 1/2, z \<= 1/2,
225 F 4/M -3 2/M x \<= 1/2, y \<= 1/4, z \<= 1/4,
229 I 4/M -3 2/M x \<= 1/2, y \<= 1/2, z \<= 1/4,
@anchor asterisk (*) The limits are in fractional coordinates, and the lower limits are always x=0, y=0, z=0. */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/cmap_data.c0000644000175100017510000004025611523037274012170 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @file cmap_data.c @brief Functions to manipulate CCP4 map files. */ #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); } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/cmap_labels.c0000644000175100017510000001265111523037274012517 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ #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; /* ccp4_file_seek(mfile->stream,labels_offset,SEEK_SET); */ for (i=0 ; i != mfile->labels.number ; i++) { memset(buffer,' ',80U); strncpy(buffer,mfile->labels.labels[i],strlen(mfile->labels.labels[i])); 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[in] mfile (CMMFile *) \param[in] title \return 0 or EOF on failure */ int ccp4_cmap_set_title(CMMFile *mfile, const char *title) { return ccp4_cmap_set_label(mfile, title, 0); } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/mtzdata.h0000644000175100017510000002203111523037274011717 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @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 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 */ #define MXTALS 100 /**< maximum number of crystals (for a few arrays - to be removed!) */ #define MSETS 1000 /**< maximum number of datasets (for a few arrays - to be removed!) */ #define MCOLUMNS 10000 /**< maximum number of columns (for a few arrays - to be removed!) */ /** 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[11]; /**< 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 gpp4-1.3.1/src/library_file.c0000644000175100017510000017136711523037274012732 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @file library_file.c * @brief Functions for file i/o. * @author Charles Ballard */ #include #include #include #if defined _MSC_VER #include #endif #include "library_file.h" #include "ccp4_errno.h" #include "ccp4_file_err.h" 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) sizeof (int), /* 5: not used */ (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, NULL, 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, NULL, 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 @c 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); } /*! Set file offset * @param cfile (CCP4File *) * @param offset stamp location */ int ccp4_file_raw_setstamp(CCP4File *cfile, const size_t offset) { cfile->stamp_loc = offset; return 0; } /** * ccp4_file_setstamp: * @param cfile (CCP4File *) * @param offset (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 * (BYTE (8 bit) = 0, * INT16 (16 bit) = 1, * 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 && mode != 5) { 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 (BYTE =0, INT16 =1, 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 const char * */ const 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 @c 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 @c fd and mode @c 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 @c 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"); #else # ifdef _MSC_VER if (cfile->scratch) { cfile->stream = tmpfile(); // if tmpfile fails, try opening temporary file the unix way if (!cfile->stream) { 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 #endif if (!cfile->stream) { ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_CantOpenFile), "ccp4_file_open2", NULL); cfile->iostat = CIO_CantOpenFile; 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 ( !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_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[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[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[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[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_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[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[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[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[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[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[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) 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 *) * @param message message to output. * 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 *) @param msg_start pointer to start position in string @param msg_end pointer to end position in string * * @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; } gpp4-1.3.1/src/library_utils.c0000644000175100017510000004064211523037274013142 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @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 (_MSC_VER) #include #include #include #include #endif #if !defined (_MSC_VER) #include #endif #define CCP4_ERRNO(y) (CCP4_ERR_UTILS | (y)) /* 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) { while (s[--len] == ' ') if (len == 0) return 0; return (++len); } /*! Print message on stdout. */ void ccp4_utils_print (const char *message) { printf ("%s\n",message); } #if ! defined (VMS) /*! Set variable in the environment */ 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) /* 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) /*! Alter buffering behaviour of stdout. */ 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 } /*! Turn off buffering of input stream. */ int ccp4_utils_noinpbuf(void) { return setvbuf(stdin, NULL, _IONBF, 0); } #endif /*! Return floating point representation of NaN */ 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); } /*! Check if a number is NaN @return true or false */ 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 */ /*! Check for BIOMOL absence flag. */ 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; } } /*! Define numbers representing integer max and floating point max. */ void ccp4_utils_hgetlimits (int *IValueNotDet, float *ValueNotDet) { *IValueNotDet = INT_MAX; *ValueNotDet = FLT_MAX; } /** Make a directory in the computer filesystem. * * @return 1 if successful. */ int ccp4_utils_mkdir (const char *path, const char *cmode) #if !defined (_MVS_VER) && !defined(_WIN32) { mode_t mode = 0; int result; #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 result = mkdir(path, (mode_t) mode); if (result == -1) { if (errno == EEXIST) { result = 1; } } return (result); } #else { /*printf("No harvesting on NT."); return (-1);*/ int result; result = mkdir(path); if (result == -1) { if (errno == EEXIST) { result = 1; } } return (result); } #endif /** Change protection mode on a file. * @return 1 if successful. */ int ccp4_utils_chmod (const char *path, const char *cmode) #if !defined (_MSC_VER) || !defined(_WIN32) { 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 (chmod(path, (mode_t) mode)); } #else { /*printf("No harvesting on NT."); return (-1);*/ return (chmod(path,0x0fff)); } #endif /** Wrapper for the malloc function, which adds some * error trapping. * */ void *ccp4_utils_malloc(size_t size) { void *val; val = malloc (size); if (!val && size) { perror ("Failure in ccp4_utils_malloc"); abort (); } return val;} /** Wrapper for the realloc function, which adds some * error trapping. */ 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;} /** Wrapper for the calloc function, which adds some * error trapping. */ 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. * (MVisualStudio version in w32mvs.c) * 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. */ #if ! defined (_MSC_VER) char *ccp4_utils_username(void) { static char userid_unknown[] = "unknown"; /* struct passwd *passwd_struct=NULL; */ char *userid=NULL; if (!(userid = getlogin())) { /* passwd_struct = getpwuid(getuid()); if (passwd_struct) { userid = passwd_struct->pw_name; } */ userid = userid_unknown; } return(userid); } #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 (filename[i] == PATH_SEPARATOR) { 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 (filename[i] == PATH_SEPARATOR) { 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 (filename[i] == PATH_SEPARATOR) { 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(char *dir, 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 an integer array containing the day, month and year. * * @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 day, month and year printed in a string. @param date string to receive the date information. The string must have size >= 11. @return pointer to date string. */ 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. */ #if ! defined (_MSC_VER) float ccp4_utils_etime (float tarray[2]) { 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; return (tarray[0]+tarray[1]); } #endif #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) /*! return cosinus in float representation */ float acosf(float x) { return (float) acos( (double) x); } /*! return arctan in float representation */ float atanf(float x) { return (float) atan( (double) x); } /*! return sinus in float representation */ float asinf(float x) { return (float) asin( (double) x); } #endif # if (defined _MVS) /*! return rounded int in double representation */ double rint(double x) { if (x >= 0.) { return (double)(int)(x+.5); } return (double)(int)(x-.5); } #endif /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/ccp4_unitcell.h0000644000175100017510000000674211523037274013016 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @file ccp4_unitcell.h * @brief C library for manipulations based on cell parameters. * @author 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 */ gpp4-1.3.1/src/cmap_data.h0000644000175100017510000000212611523037274012167 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @file cmap_data.h @brief Header file for CCP4 map functions */ #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 */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/cmtzlib.h0000644000175100017510000011725611530701627011733 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @page cmtz_page CMTZ library @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 @c mtz->refs_in_memory = 1 (as set e.g. by the argument to @c MtzGet), then all reflection data is read into memory from the file, and can be manipulated in memory. Else if @c mtz->refs_in_memory = 0 then explicit calls to @c ccp4_lrrefl, @c ccp4_lrreff and @c ccp4_lwrefl are required to read and write reflections from/to disk. Information on the data structure is given in mtzdata.h See extensive documentaion on the MTZ format at CCP4's website. @section cmtz_princ_func Principal Functions @subsection cmtz_reading Reading MTZ files Start by looking at @c MtzGet and @c ccp4_lrrefl / @c ccp4_lrreff. @subsection cmtz_writing Writing MTZ files If you have a structure in memory already, use @c MtzPut followed by @c MtzFree to release the memory. If you need to create a structure from scratch (i.e. without reading from an input file) then use @c MtzMalloc, @c MtzOpenForWrite, @c ccp4_lwsymm, @c MtzAddXtal, @c MtzAddDataset, @c MtzAddColumn and @c 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__ /* 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 gpp4-1.3.1/src/ccp4_parser.h0000644000175100017510000002376011523037274012472 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @page cparser_page CParser library * @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: * @code 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 ); * @endcode * @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__ /* 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 /* Parser String Sizes */ #define CCP4_PARSER_MAXLINELENGTH 200 /*!< Maximum length of line to be parsed */ #define CCP4_PARSER_MAXFILENAMELENGTH 200 /*!< Maximum length of file name to be parsed */ /* Structures and typedefs */ /*! @struct CCP4PARSERTOKEN @brief 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; /*!< Begin character positions of token in input line */ int iend; /*!< End character positions of token in input line */ } CCP4PARSERTOKEN; /*!< Type name for the CCP4 Parser token data structure */ /*! @struct CCP4PARSERARRAY @brief 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; /*!< Type name for the CCP4 Parser array data structure */ /* 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); 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__ */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/cmap_open.c0000644000175100017510000000671711523037274012224 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @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 for reading/writing. \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); } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/cvecmat.h0000644000175100017510000000272111523037274011701 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @file cvecmat.h @brief Declarations of matrix and vector handling functions. @author Martyn Winn */ #ifndef __CCP4_VECMAT #define __CCP4_VECMAT #ifdef __cplusplus extern "C" { #endif 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 */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/cmtzlib.c0000644000175100017510000035111311530701627011716 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /* DO NOT put Doxygen comments here - put in cmtzlib.h */ /* See cmtzlib.h for descriptions of functions */ #include #include #include #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" /* 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, hdrst, 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; jxtal = 0; nbat = 0; nref = 0; ntotcol = 0; newproj = 0; /* 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 = NULL; /* 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 *) &hdrst, 1); if (debug) printf(" istat=%d, hdrst read as %d \n",istat,hdrst); if (istat == EOF) { ccp4_signal(CCP4_ERRLEVEL(3) | CMTZ_ERRNO(CMTZERR_ReadFail),"MtzGet",NULL); ccp4_parse_end(parser); ccp4_file_close(filein); free(filename); return NULL; } /* 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, 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, 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, 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, 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, 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 { 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) ) { 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 = NULL; 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) ) { 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 = NULL; 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) ) { 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")) ) { 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,"")) { strcpy(mtz->mtzsymm.pgname,pgnamx); } 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, hdrst, 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 = NULL; MTZXTAL *xtl; char colsource[37], *taskenv; int date3[3], time3[3]; 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")) ) 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")) ) { 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.4f %17.4f %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') { 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 = mtz->nref * MtzNumActiveCol(mtz) + SIZE1 + 1; ccp4_file_setmode(fileout,2); ccp4_file_write(fileout,(uint8 *) &hdrst,1); /* 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; int 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' */ { if (batch != NULL) { MtzFreeBatch(batch->next); batch->next = NULL; free(batch); } 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; } gpp4-1.3.1/src/cmap_close.c0000644000175100017510000000467511523037274012371 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ #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; } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/Makefile.in0000644000175100017510000005053411526170230012151 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ subdir = src DIST_COMMON = $(library_include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/ccp4_program.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = ccp4_program.h 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__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(library_includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libgpp4_la_LIBADD = am_libgpp4_la_OBJECTS = ccp4_array.lo cmap_data.lo cmtzlib.lo \ ccp4_general.lo cmap_header.lo csymlib.lo ccp4_parser.lo \ cmap_labels.lo cvecmat.lo ccp4_program.lo cmap_open.lo \ library_err.lo ccp4_unitcell.lo cmap_skew.lo library_file.lo \ cmap_accessor.lo cmap_stats.lo library_utils.lo cmap_close.lo \ cmap_symop.lo pack_c.lo gpp4_open_symop_file.lo libgpp4_la_OBJECTS = $(am_libgpp4_la_OBJECTS) libgpp4_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libgpp4_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgpp4_la_SOURCES) DIST_SOURCES = $(libgpp4_la_SOURCES) HEADERS = $(library_include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ 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@ FLIBS = @FLIBS@ GPP4_PREFIX = @GPP4_PREFIX@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MMDB_CFLAGS = @MMDB_CFLAGS@ MMDB_LIBS = @MMDB_LIBS@ 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@ PKG_CONFIG = @PKG_CONFIG@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WANT_GPP4F = @WANT_GPP4F@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ 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@ lt_ECHO = @lt_ECHO@ 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@ lib_LTLIBRARIES = libgpp4.la library_includedir = $(pkgincludedir)/ccp4 libgpp4_la_SOURCES = ccp4_array.c cmap_data.c cmtzlib.c ccp4_general.c \ cmap_header.c csymlib.c ccp4_parser.c cmap_labels.c cvecmat.c \ ccp4_program.c cmap_open.c library_err.c ccp4_unitcell.c cmap_skew.c \ library_file.c cmap_accessor.c cmap_stats.c library_utils.c cmap_close.c \ cmap_symop.c pack_c.c gpp4_open_symop_file.c # IMPORTANT! # Read http://sourceware.org/autobook/autobook/autobook_91.html # before changing the version-info (read: don't change it) libgpp4_la_LDFLAGS = -version-info 0:0:0 library_include_HEADERS = ccp4_array.h ccp4_unitcell.h cmap_stats.h \ ccp4_errno.h ccp4_utils.h cmtzlib.h ccp4_file_err.h ccp4_vars.h \ csymlib.h ccp4_fortran.h cmap_data.h cvecmat.h ccp4_general.h \ cmap_errno.h ccp4_parser.h cmap_header.h library_file.h ccp4_program.h \ cmap_labels.h mtzdata.h ccp4_spg.h cmaplib_f.h overview.h \ ccp4_sysdep.h cmaplib.h ccp4_types.h cmap_skew.h symlib.h pack_c.h DISTCLEANFILES = ccp4_program.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): ccp4_program.h: $(top_builddir)/config.status $(srcdir)/ccp4_program.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @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 " $(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)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgpp4.la: $(libgpp4_la_OBJECTS) $(libgpp4_la_DEPENDENCIES) $(libgpp4_la_LINK) -rpath $(libdir) $(libgpp4_la_OBJECTS) $(libgpp4_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ccp4_array.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ccp4_general.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ccp4_parser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ccp4_program.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ccp4_unitcell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmap_accessor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmap_close.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmap_data.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmap_header.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmap_labels.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmap_open.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmap_skew.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmap_stats.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmap_symop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmtzlib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/csymlib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvecmat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpp4_open_symop_file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/library_err.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/library_file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/library_utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack_c.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-library_includeHEADERS: $(library_include_HEADERS) @$(NORMAL_INSTALL) test -z "$(library_includedir)" || $(MKDIR_P) "$(DESTDIR)$(library_includedir)" @list='$(library_include_HEADERS)'; test -n "$(library_includedir)" || list=; \ 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)$(library_includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(library_includedir)" || exit $$?; \ done uninstall-library_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(library_include_HEADERS)'; test -n "$(library_includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(library_includedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(library_includedir)" && rm -f $$files ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @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 check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(library_includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: 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) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-library_includeHEADERS 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 -rf ./$(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-libLTLIBRARIES \ uninstall-library_includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-library_includeHEADERS \ install-man install-pdf install-pdf-am 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 uninstall \ uninstall-am uninstall-libLTLIBRARIES \ uninstall-library_includeHEADERS #### # 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: gpp4-1.3.1/src/ccp4_utils.h0000644000175100017510000000565311523037274012337 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @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" #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(char *dir, 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 */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/overview.h0000644000175100017510000001311511526170075012124 00000000000000/* overview.h: overview of the gpp4 library (C) 2003 CCLRC, Martyn Winn, modified by Morten Kjeldgaard 2007, 2009. This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @mainpage The gpp4 library @section introduction Introduction This distribution is a special version of the CCP4 library, released under the Lesser GNU Public License version 2.1. The goal of this project -- named gpp4 to distinguish it from CCP4 -- is to provide a drop-in replacement for the CCP4 libraries, that as carefully as possible will implement the current CCP4 library interface. The initial motivation to create this public fork the CCP4 library was that the licensing was changed in version 6.0 to be "non-free". At the time, the last version of the CCP4 library covered by a free license was version 5.0.2. There are several third-party applications, such as Phenix and Coot, that depend on the CCP4 library. However, you could not legally create a derived work containing both CCP4 6.* licensed code and GPL'd code, and distribute the resulting program, since the GPL demands that the derived work be distributed without additional restrictions. The CCP4 6.* license imposed additional restrictions on redistribution - in particular (but not limited to) an indemnity clause. Version 5.0.2 of the CCP4 library was patched by Ralf Grosse-Kunstleve to address some of the more serious deficiencies of the older libraries and included with the Phenix distribution. It is this patched version of the CCP4 library that forms the original basis for this distribution, which includes a GNU autotools build environment developed by Paul Emsley and Morten Kjeldgaard. At this time, the CCP4 has revised its licensing policy, and the CCP4 library is again licensed under the Lesser GNU Public License. However, there is still a very good reason to maintain and develop ggp4, because the CCP4 library is tightly integrated with the entire CCP4 distribution, of currently around 220Mb. The ggp4 distribution thus serves as a small, standalone version, that can be included in third party software distributions. It is also available through the Ubuntu and Fedora software repositories for easy installation. @section purpose Purpose 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.
CCP4 Parser library
See the @ref cparser_page page for details on how to use the CCP4 parser routines from C/C++ programs.
CCP4 resizable arrays
See the @ref ccp4_array_page page for information on Kevin Cowtan's resizable array implementation.
Low level disk i/o
See the @ref diskio_f_page page for Fortran programmers.
*/ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/cmap_labels.h0000644000175100017510000000227411523037274012524 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @file cmap_labels.h @brief Declaration of routines to parse and output map labels. @author Charles Ballard. */ #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 */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/cmap_stats.h0000644000175100017510000000230711523037274012415 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @file cmap_stats.h @brief Declaration of the stats_update function. @author Charles Ballard. */ #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 */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/ccp4_program.c0000644000175100017510000001725311523037274012640 00000000000000/* ccp4_program.c: Utilies to set and fetch program information. Copyright (C) 2001 CCLRC, Peter Briggs Copyright (C) 2007 Morten Kjeldgaard This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @file ccp4_program.c @brief Utilies to set and fetch program information. @author Peter Briggs @date May 2001 */ #include #include #include #include #include "ccp4_program.h" #include "ccp4_parser.h" #include "ccp4_utils.h" #include "ccp4_general.h" /*! 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) { static char programversion[MAXLEN_PROGVERSION]=""; if (progvers) { strncpy(programversion, progvers, MAXLEN_PROGVERSION); programversion[MAXLEN_PROGVERSION-1] = '\0'; } return programversion; } /*! Set or return program name. @param progname Program name, or NULL to query existing value. @return Program name Always returns a pointer to the program name If progname is not NULL then set the program name to progname. @note 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; } /*! Set or return program RCS date @param rcs_string Date string, or NULL to query existing value. @return Date string 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. @note This routine does not make sense in gpp4, since RCS idents are not expanede in the SCM system we are using. */ 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: 2008/06/18 17:34:27 $" */ /* 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; } /*! Set or print program time information @param init The timer is started when this routine is called with a non-zero argument. When the routine is called with a 0 argument, timing information is printed to stdout. @note Only one timer can be handled. */ 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); } } /*! Set or return the reference verbosity level @param level Verbosity level, or -1 to query existing value. @return 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; } /*! 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, 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; } /*! 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"); } /*! 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, 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, char *message) { /* This is the default callback function which takes no action */ return 1; } /*! Check existence of licence agreement @param name Name of licence, e.g. "CCP4". @return always return 1. This is a dummy routine in gpp4. */ int ccp4_licence_exists(const char *name) { return 1; } /*! 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 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; } /*! 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) { static int isumm=0; if (isumm_in >= 0) isumm = isumm_in; return isumm; } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/cmap_header.h0000644000175100017510000000225411523037274012510 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @file cmap_header.h @brief Declarations of map header i/o routines. @author Charles Ballard */ #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 */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/csymlib.c0000644000175100017510000017166511523037274011732 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /* 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" /* 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 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); } char *gpp4_open_syminfo_file(); 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, filerec[80]; ccp4_symop *op2, *op3=NULL, opinv; /* spacegroup variables */ int sg_num=0, sg_ccp4_num=0, 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 = gpp4_open_syminfo_file())) return NULL; filein = fopen(symopfile,"r"); free(symopfile); 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) { printf(" 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; } 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"))) { /* :R spacegroup should be R already so just replace with blanks */ *ch1 = ' '; *(ch1+1) = ' '; } else if ((ch1 = strstr(name,":H"))) { /* :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))) { *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; value1 = value2 = 0.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; } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/ccp4_general.h0000644000175100017510000000707311523037274012612 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @file ccp4_general.h @brief Header file for CCP4 library clones */ /* Macro definitions */ #ifndef __CCPGeneral__ #define __CCPGeneral__ /* note order: this must be outside CCP4 namespace */ #include "ccp4_parser.h" #ifdef __cplusplus namespace CCP4 { extern "C" { #endif /** Maximum number of characters in lines read from environ.def and default.def files (@ref ccp4fyp) */ #define CCP4_MAXLINE 200 /** Maximum number of tokens in lines read from environ.def and default.def files (@ref ccp4fyp) */ #define CCP4_MAXTOKS 3 /** Maximum number of logical names that can be read and stored from environ.def (@ref ccp4fyp) */ #define CCP4_MAXNAMES 150 /** To guarantee that process id is always 5 characters, take the id number modulo 100,000 */ #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__ */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/cmap_skew.h0000644000175100017510000000217511523037274012233 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /*! @file cmap_skew.h @brief Declaration of the skew_set function. @author Charles Ballard. */ #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 */ /* Local variables: mode: font-lock End: */ gpp4-1.3.1/src/library_err.c0000644000175100017510000003205011523037274012564 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @file library_err.c * @brief Error handling library. * @author Charles Ballard */ #include #include #include #include "ccp4_errno.h" /** 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 abort() param message (const char *) */ void ccp4_fatal (const char *message) { ccp4_error(message); abort(); } 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 abort(). 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) abort(); } gpp4-1.3.1/src/csymlib.h0000644000175100017510000005276511523037274011736 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 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ /** @page csym_page CSYM library @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 \c 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 \c ccp4spg_load_by_standard_num, \c ccp4spg_load_by_ccp4_num, \c ccp4spg_load_by_spgname, \c ccp4spg_load_by_ccp4_spgname and \c 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 \c ccp4spg_free. Functions are provided to: - Query the data structure, e.g. \c ccp4spg_symbol_Hall, etc. (members of the structure can of course be obtained directly) - Check reciprocal space indices for a particular spacegroup, e.g. \c ccp4spg_is_in_asu, \c ccp4spg_is_centric, \c ccp4spg_get_multiplicity, \c ccp4spg_is_sysabs, etc. - Set appropriate grids for FFT, e.g. \c set_fft_grid @section csym_operators Symmetry operators Symmetry operators are expressed in a variety of ways: - Using the struct \c 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__ /* 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. * @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. * @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. * @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. * @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. * @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. * @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 op1 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 spgname_lib First spacegroup name, assumed to be a standard one * obtained at some point from SYMINFO * @param spgname_match 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); /** 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); /** 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 p2 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 /* Local variables: mode: font-lock End: */ gpp4-1.3.1/configure0000755000175100017510000200177011526170231011225 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.65 for gpp4 1.3.1. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. 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 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" 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 \$(( 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 : # 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. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} 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 and mok@bioxray.dk $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: 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_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 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=$?; test $as_status -eq 0 && as_status=1 if test "$3"; then as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 fi $as_echo "$as_me: error: $1" >&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; } # 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 -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' 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 if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac ECHO=${lt_ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF $* _LT_EOF exit 0 fi # 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 if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, 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='gpp4' PACKAGE_TARNAME='gpp4' PACKAGE_VERSION='1.3.1' PACKAGE_STRING='gpp4 1.3.1' PACKAGE_BUGREPORT='mok@bioxray.dk' PACKAGE_URL='' ac_unique_file="src/ccp4_vars.h" # 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 WANT_GPP4F WANT_GPP4F_FALSE WANT_GPP4F_TRUE GPP4_PREFIX MMDB_LIBS MMDB_CFLAGS PKG_CONFIG POW_LIB LIBOBJS LIBM FLIBS OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL lt_ECHO RANLIB AR OBJDUMP 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 LN_S ac_ct_F77 FFLAGS F77 CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC 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_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_gnu_ld enable_libtool_lock with_fortran_api ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP F77 FFLAGS PKG_CONFIG MMDB_CFLAGS MMDB_LIBS' # 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=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 $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 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 gpp4 1.3.1 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/gpp4] --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 gpp4 1.3.1:";; 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] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --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) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --without-fortran-api disable building of the Fortran library gpp4f 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 F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags PKG_CONFIG path to pkg-config utility MMDB_CFLAGS C compiler flags for MMDB, overriding pkg-config MMDB_LIBS linker flags for MMDB, overriding pkg-config 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 . _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 gpp4 configure 1.3.1 generated by GNU Autoconf 2.65 Copyright (C) 2009 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_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; } >/dev/null && { 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_f77_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 || $as_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; test "x$as_lineno_stack" = x && { as_lineno=; 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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_compile # 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; test "x$as_lineno_stack" = x && { as_lineno=; 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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_func # 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 || $as_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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_f77_try_link # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( cat <<\_ASBOX ## ----------------------------- ## ## Report this to mok@bioxray.dk ## ## ----------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_mongrel # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { 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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=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 eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_type 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 gpp4 $as_me 1.3.1, which was generated by GNU Autoconf 2.65. 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 cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX 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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX 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 cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX 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 cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX 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 ac_site_file1=$CONFIG_SITE 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" 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 ac_aux_dir= for ac_dir in config "$srcdir"/config; do for ac_t in install-sh install.sh shtool; do if test -f "$ac_dir/$ac_t"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/$ac_t -c" break 2 fi done done if test -z "$ac_aux_dir"; then as_fn_error "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$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. am__api_version='1.11' # 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 test "${ac_cv_path_install+set}" = set; 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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; } # Just in case sleep 1 echo timestamp > conftest.file # 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 ( 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 rm -f conftest.file 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 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; } 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 --run true"; then am_missing_run="$MISSING --run " 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 test "${ac_cv_prog_STRIP+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_ac_ct_STRIP+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_path_mkdir+set}" = set; 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac 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 test "${ac_cv_prog_AWK+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; 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 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='gpp4' VERSION='1.3.1' 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"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' # check base installations 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 test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_ac_ct_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_ac_ct_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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_set_status 77 as_fn_error "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 test "${ac_cv_objext+set}" = set; 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 test "${ac_cv_c_compiler_gnu+set}" = set; 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 test "${ac_cv_prog_cc_g+set}" = set; 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 test "${ac_cv_prog_cc_c89+set}" = set; 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 #include #include /* 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 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='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi 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 test "${am_cv_CC_dependencies_compiler_type+set}" = set; 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'. 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 8's {/usr,}/bin/sh. touch 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 ;; 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=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 test "${ac_cv_prog_CPP+set}" = set; 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.$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.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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.$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.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 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 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn 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 test "${ac_cv_prog_F77+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn 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 test "${ac_cv_prog_ac_ct_F77+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_f77_compiler_gnu+set}" = set; 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 test "${ac_cv_prog_f77_g+set}" = set; 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 { $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 { $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 { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; 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 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.2.6b' macro_revision='1.3017' 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 test "${ac_cv_build+set}" = set; 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 test "${ac_cv_host+set}" = set; 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 { $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 test "${ac_cv_path_SED+set}" = set; 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" { test -f "$ac_path_SED" && $as_test_x "$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 test "${ac_cv_path_GREP+set}" = set; 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" { test -f "$ac_path_GREP" && $as_test_x "$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 test "${ac_cv_path_EGREP+set}" = set; 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" { test -f "$ac_path_EGREP" && $as_test_x "$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 test "${ac_cv_path_FGREP+set}" = set; 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" { test -f "$ac_path_FGREP" && $as_test_x "$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 test "${lt_cv_path_LD+set}" = set; 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 test "${lt_cv_prog_gnu_ld+set}" = set; 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 test "${lt_cv_path_NM+set}" = set; 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 "$ac_tool_prefix"; then for ac_prog in "dumpbin -symbols" "link -dump -symbols" 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 test "${ac_cv_prog_DUMPBIN+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 -symbols" "link -dump -symbols" 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 test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 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 test "${lt_cv_nm_interface+set}" = set; 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:5022: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:5025: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:5028: 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; } # 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 test "${lt_cv_sys_max_cmd_len+set}" = set; 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; ;; 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 ;; 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"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$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"}, \ = c,a/b,, \ && 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 for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; 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 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 test "${ac_cv_prog_OBJDUMP+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${lt_cv_deplibs_check_method+set}" = set; 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. if ( 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 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' 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 ;; 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]) 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 Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) 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_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}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" $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 fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" $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 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 else AR="$ac_cv_prog_AR" fi test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru 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 test "${ac_cv_prog_STRIP+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_ac_ct_STRIP+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_RANLIB+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # 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 test "${lt_cv_sys_global_symbol_pipe+set}" = set; 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};"\ " /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 # 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 #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. */ 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_save_LIBS="$LIBS" lt_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_save_LIBS" CFLAGS="$lt_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 # 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 6223 "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 test "${lt_cv_cc_needs_belf+set}" = set; 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 ;; sparc*-*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*) LD="${LD-ld} -m elf64_sparc" ;; *) 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" 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 test "${ac_cv_prog_DSYMUTIL+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_NMEDIT+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_LIPO+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_ac_ct_LIPO+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_OTOOL+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_OTOOL64+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${lt_cv_apple_cc_single_mod+set}" = set; 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 test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 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 test "${lt_cv_ld_exported_symbols_list+set}" = set; 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; } 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" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac { $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 test "${ac_cv_header_stdc+set}" = set; 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 " eval as_val=\$$as_ac_Header if test "x$as_val" = 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" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done 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 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn 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 test "${ac_cv_prog_F77+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn 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 test "${ac_cv_prog_ac_ct_F77+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_f77_compiler_gnu+set}" = set; 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 test "${ac_cv_prog_f77_g+set}" = set; 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 if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi # Set options enable_dlopen=no enable_win32_dll=no # 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=yes fi # 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; pic_mode="$withval" 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 test "${lt_cv_objdir+set}" = set; 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 # Sed substitution that helps us do robust quoting. It backslashifies # 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' # 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 "X$cc_temp" | $Xsed -e 's%.*/%%' -e "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 test "${lt_cv_path_MAGIC_CMD+set}" = set; 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 test "${lt_cv_path_MAGIC_CMD+set}" = set; 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 lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $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 test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; 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:7835: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7839: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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= { $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 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' ;; 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 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' ;; pgcc* | pgf77* | pgf90* | pgf95*) # 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*) # IBM XL C 8.0/Fortran 10.1 on PPC lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Sun\ F*) # 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='' ;; 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*) 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}: result: $lt_prog_compiler_pic" >&5 $as_echo "$lt_prog_compiler_pic" >&6; } # # 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 test "${lt_cv_prog_compiler_pic_works+set}" = set; 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:8174: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:8178: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 test "${lt_cv_prog_compiler_static_works+set}" = set; 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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/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 test "${lt_cv_prog_compiler_c_o+set}" = set; 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:8279: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8283: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 test "${lt_cv_prog_compiler_c_o+set}" = set; 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:8334: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8338: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_flag_spec_ld= 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 ;; linux* | k*bsd*-gnu) link_all_deplibs=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = 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.9.1, 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 modify your PATH *** so that a non-GNU linker is found, and then restart. _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' 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/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' 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 ;; 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= 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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # 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; $ECHO \"$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]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; 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; $ECHO \"$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*) # 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= hardcode_libdir_flag_spec_ld='-rpath $libdir' archive_cmds='$LD -shared $libobjs $deplibs $compiler_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 $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) 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 $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' 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 $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 ;; 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 $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 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 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")) && (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 link_all_deplibs=no 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. 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 } }' 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 "$aix_libpath"; then 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 "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; 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. 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 } }' 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 "$aix_libpath"; then 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 "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' 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. 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 `$ECHO "X$deplibs" | $Xsed -e '\''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' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' 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=echo 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 ;; freebsd1*) ld_shlibs=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 -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 -fPIC ${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 -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${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_flag_spec_ld='+b $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 -a "$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 -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${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' ;; *) archive_cmds='$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='${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 $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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. 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) {} _ACEOF if ac_fn_c_try_link "$LINENO"; then : archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -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* | netbsdelf*-gnu) 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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -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 ${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 ${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; } $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 archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 $as_echo "$archive_cmds_need_lc" >&6; } ;; 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 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # 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 -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # 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; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` 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 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 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=`$ECHO "X$lib" | $Xsed -e '\''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 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,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) 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="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. 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 ;; 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 ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # 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 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 ;; freebsd1*) dynamic_linker=no ;; 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[123]*) 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 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 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' ;; interix[3-9]*) version_type=linux 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 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 Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux 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 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 : 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 # 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;/^$/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' ;; netbsdelf*-gnu) version_type=linux 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='NetBSD ld.elf_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 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 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 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 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 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 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 test "${ac_cv_lib_dl_dlopen+set}" = set; 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" = x""yes; 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" = x""yes; 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 test "${ac_cv_lib_dld_shl_load+set}" = set; 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" = x""yes; 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" = x""yes; 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 test "${ac_cv_lib_dl_dlopen+set}" = set; 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" = x""yes; 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 test "${ac_cv_lib_svld_dlopen+set}" = set; 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" = x""yes; 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 test "${ac_cv_lib_dld_dld_link+set}" = set; 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" = x""yes; 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 test "${lt_cv_dlopen_self+set}" = set; 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 10718 "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 void fnord() { int i=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; /* 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 test "${lt_cv_dlopen_self_static+set}" = set; 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 10814 "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 void fnord() { int i=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; /* 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_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 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_flag_spec_ld_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 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 CC=${F77-"f77"} 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 "X$cc_temp" | $Xsed -e 's%.*/%%' -e "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= { $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 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' ;; 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 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' ;; pgcc* | pgf77* | pgf90* | pgf95*) # 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*) # IBM XL C 8.0/Fortran 10.1 on PPC 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\ C*) # Sun C 5.9 lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='-Wl,' ;; *Sun\ F*) # 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='' ;; 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*) 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}: result: $lt_prog_compiler_pic_F77" >&5 $as_echo "$lt_prog_compiler_pic_F77" >&6; } # # 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 test "${lt_cv_prog_compiler_pic_works_F77+set}" = set; 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:11469: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:11473: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 test "${lt_cv_prog_compiler_static_works_F77+set}" = set; 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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/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 test "${lt_cv_prog_compiler_c_o_F77+set}" = set; 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:11568: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:11572: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 test "${lt_cv_prog_compiler_c_o_F77+set}" = set; 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:11620: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:11624: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_flag_spec_ld_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 ;; linux* | k*bsd*-gnu) link_all_deplibs_F77=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = 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.9.1, 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 modify your PATH *** so that a non-GNU linker is found, and then restart. _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' 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/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' 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 ;; 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= 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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # 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; $ECHO \"$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]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; 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; $ECHO \"$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*) # 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= hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' archive_cmds_F77='$LD -shared $libobjs $deplibs $compiler_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 $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs_F77=no fi ;; netbsd* | netbsdelf*-gnu) 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 $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' 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 $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 ;; 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 $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 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 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")) && (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 link_all_deplibs_F77=no 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. 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 } }' 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 "$aix_libpath"; then 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 "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; 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. 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 } }' 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 "$aix_libpath"; then 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 "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' 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. 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 `$ECHO "X$deplibs" | $Xsed -e '\''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' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' 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=echo 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 ;; freebsd1*) ld_shlibs_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 -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 -fPIC ${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 -a "$with_gnu_ld" = no; then archive_cmds_F77='$CC -shared -fPIC ${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_flag_spec_ld_F77='+b $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 -a "$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 -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${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 $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat > conftest.$ac_ext <<_ACEOF int foo(void) {} _ACEOF if ac_fn_f77_try_link "$LINENO"; then : archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -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* | netbsdelf*-gnu) 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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -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 ${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 ${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; } $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 archive_cmds_need_lc_F77=no else 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* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_F77" >&5 $as_echo "$archive_cmds_need_lc_F77" >&6; } ;; 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 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 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=`$ECHO "X$lib" | $Xsed -e '\''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 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,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) 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="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. 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 ;; 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 ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # 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 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 ;; freebsd1*) dynamic_linker=no ;; 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[123]*) 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 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 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' ;; interix[3-9]*) version_type=linux 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 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 Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux 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 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 : 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 # 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;/^$/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' ;; netbsdelf*-gnu) version_type=linux 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='NetBSD ld.elf_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 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 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 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 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 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 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" 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_config_commands="$ac_config_commands libtool" # Only expand once: 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 how to get verbose linking output from $F77" >&5 $as_echo_n "checking how to get verbose linking output from $F77... " >&6; } if test "${ac_cv_prog_f77_v+set}" = set; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : ac_cv_prog_f77_v= # Try some options frequently used verbose output for ac_verb in -v -verbose --verbose -V -\#\#\#; do cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF # Compile and link our simple test program by passing a flag (argument # 1 to this macro) to the Fortran compiler in order to get # "verbose" output that we can then parse for the Fortran linker # flags. ac_save_FFLAGS=$FFLAGS FFLAGS="$FFLAGS $ac_verb" eval "set x $ac_link" shift $as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 # gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, # LIBRARY_PATH; skip all such settings. ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="` $as_echo "$ac_f77_v_output" >&5 FFLAGS=$ac_save_FFLAGS rm -rf conftest* # On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where # /foo, /bar, and /baz are search directories for the Fortran linker. # Here, we change these into -L/foo -L/bar -L/baz (and put it first): ac_f77_v_output="`echo $ac_f77_v_output | grep 'LPATH is:' | sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output" # FIXME: we keep getting bitten by quoted arguments; a more general fix # that detects unbalanced quotes in FLIBS should be implemented # and (ugh) tested at some point. case $ac_f77_v_output in # If we are using xlf then replace all the commas with spaces. *xlfentry*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;; # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted # $LIBS confuse us, and the libraries appear later in the output anyway). *mGLOB_options_string*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; # Portland Group compiler has singly- or doubly-quoted -cmdline argument # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". *-cmdline\ * | *-ignore\ * | *-def\ *) ac_f77_v_output=`echo $ac_f77_v_output | sed "\ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; # If we are using Cray Fortran then delete quotes. *cft90*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;; esac # look for -l* and *.a constructs in the output for ac_arg in $ac_f77_v_output; do case $ac_arg in [\\/]*.a | ?:[\\/]*.a | -[lLRu]*) ac_cv_prog_f77_v=$ac_verb break 2 ;; esac done done if test -z "$ac_cv_prog_f77_v"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine how to obtain linking information from $F77" >&5 $as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;} fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compilation failed" >&5 $as_echo "$as_me: WARNING: compilation failed" >&2;} 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_v" >&5 $as_echo "$ac_cv_prog_f77_v" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 libraries of $F77" >&5 $as_echo_n "checking for Fortran 77 libraries of $F77... " >&6; } if test "${ac_cv_f77_libs+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$FLIBS" != "x"; then ac_cv_f77_libs="$FLIBS" # Let the user override the test. else cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF # Compile and link our simple test program by passing a flag (argument # 1 to this macro) to the Fortran compiler in order to get # "verbose" output that we can then parse for the Fortran linker # flags. ac_save_FFLAGS=$FFLAGS FFLAGS="$FFLAGS $ac_cv_prog_f77_v" eval "set x $ac_link" shift $as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 # gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, # LIBRARY_PATH; skip all such settings. ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="` $as_echo "$ac_f77_v_output" >&5 FFLAGS=$ac_save_FFLAGS rm -rf conftest* # On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where # /foo, /bar, and /baz are search directories for the Fortran linker. # Here, we change these into -L/foo -L/bar -L/baz (and put it first): ac_f77_v_output="`echo $ac_f77_v_output | grep 'LPATH is:' | sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output" # FIXME: we keep getting bitten by quoted arguments; a more general fix # that detects unbalanced quotes in FLIBS should be implemented # and (ugh) tested at some point. case $ac_f77_v_output in # If we are using xlf then replace all the commas with spaces. *xlfentry*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;; # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted # $LIBS confuse us, and the libraries appear later in the output anyway). *mGLOB_options_string*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; # Portland Group compiler has singly- or doubly-quoted -cmdline argument # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". *-cmdline\ * | *-ignore\ * | *-def\ *) ac_f77_v_output=`echo $ac_f77_v_output | sed "\ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; # If we are using Cray Fortran then delete quotes. *cft90*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;; esac ac_cv_f77_libs= # Save positional arguments (if any) ac_save_positional="$@" set X $ac_f77_v_output while test $# != 1; do shift ac_arg=$1 case $ac_arg in [\\/]*.a | ?:[\\/]*.a) ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue; then : else ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" fi ;; -bI:*) ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue; then : else if test "$ac_compiler_gnu" = yes; then for ac_link_opt in $ac_arg; do ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt" done else ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" fi fi ;; # Ignore these flags. -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -little \ |-LANG:=* | -LIST:* | -LNO:*) ;; -lkernel32) test x"$CYGWIN" != xyes && ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" ;; -[LRuYz]) # These flags, when seen by themselves, take an argument. # We remove the space between option and argument and re-iterate # unless we find an empty arg or a new option (starting with -) case $2 in "" | -*);; *) ac_arg="$ac_arg$2" shift; shift set X $ac_arg "$@" ;; esac ;; -YP,*) for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_j" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue; then : else ac_arg="$ac_arg $ac_j" ac_cv_f77_libs="$ac_cv_f77_libs $ac_j" fi done ;; -[lLR]*) ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue; then : else ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" fi ;; -zallextract*| -zdefaultextract) ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" ;; # Ignore everything else. esac done # restore positional arguments set X $ac_save_positional; shift # We only consider "LD_RUN_PATH" on Solaris systems. If this is seen, # then we insist that the "run path" must be an absolute path (i.e. it # must begin with a "/"). case `(uname -sr) 2>/dev/null` in "SunOS 5"*) ac_ld_run_path=`$as_echo "$ac_f77_v_output" | sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'` test "x$ac_ld_run_path" != x && if test "$ac_compiler_gnu" = yes; then for ac_link_opt in $ac_ld_run_path; do ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt" done else ac_cv_f77_libs="$ac_cv_f77_libs $ac_ld_run_path" fi ;; esac fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_libs" >&5 $as_echo "$ac_cv_f77_libs" >&6; } FLIBS="$ac_cv_f77_libs" 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 # check for libm LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mwvalidcheckl in -lmw" >&5 $as_echo_n "checking for _mwvalidcheckl in -lmw... " >&6; } if test "${ac_cv_lib_mw__mwvalidcheckl+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmw $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 _mwvalidcheckl (); int main () { return _mwvalidcheckl (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mw__mwvalidcheckl=yes else ac_cv_lib_mw__mwvalidcheckl=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_mw__mwvalidcheckl" >&5 $as_echo "$ac_cv_lib_mw__mwvalidcheckl" >&6; } if test "x$ac_cv_lib_mw__mwvalidcheckl" = x""yes; then : LIBM="-lmw" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 $as_echo_n "checking for cos in -lm... " >&6; } if test "${ac_cv_lib_m_cos+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $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 if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_cos=yes else ac_cv_lib_m_cos=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_m_cos" >&5 $as_echo "$ac_cv_lib_m_cos" >&6; } if test "x$ac_cv_lib_m_cos" = x""yes; then : LIBM="$LIBM -lm" fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 $as_echo_n "checking for cos in -lm... " >&6; } if test "${ac_cv_lib_m_cos+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $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 if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_cos=yes else ac_cv_lib_m_cos=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_m_cos" >&5 $as_echo "$ac_cv_lib_m_cos" >&6; } if test "x$ac_cv_lib_m_cos" = x""yes; then : LIBM="-lm" fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5 $as_echo_n "checking for sin in -lm... " >&6; } if test "${ac_cv_lib_m_sin+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $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 sin (); int main () { return sin (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_sin=yes else ac_cv_lib_m_sin=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_m_sin" >&5 $as_echo "$ac_cv_lib_m_sin" >&6; } if test "x$ac_cv_lib_m_sin" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi # check for std c headers { $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 test "${ac_cv_header_stdc+set}" = set; 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 # check for various headers for ac_header in fcntl.h float.h limits.h stddef.h stdlib.h stdint.h string.h sys/file.h sys/stat.h unistd.h wchar.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test "${ac_cv_struct_tm+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi # Checks for library functions. for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_malloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else ac_cv_func_malloc_0_nonnull=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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then : $as_echo "#define HAVE_MALLOC 1" >>confdefs.h else $as_echo "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac $as_echo "#define malloc rpl_malloc" >>confdefs.h fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 $as_echo_n "checking for GNU libc compatible realloc... " >&6; } if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_realloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *realloc (); #endif int main () { return ! realloc (0, 0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_realloc_0_nonnull=yes else ac_cv_func_realloc_0_nonnull=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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 $as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } if test $ac_cv_func_realloc_0_nonnull = yes; then : $as_echo "#define HAVE_REALLOC 1" >>confdefs.h else $as_echo "#define HAVE_REALLOC 0" >>confdefs.h case " $LIBOBJS " in *" realloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; esac $as_echo "#define realloc rpl_realloc" >>confdefs.h fi if test "${ac_cv_func_setvbuf_reversed+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_func_setvbuf_reversed=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 $as_echo_n "checking for working strtod... " >&6; } if test "${ac_cv_func_strtod+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_strtod=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #ifndef strtod double strtod (); #endif int main() { { /* Some versions of Linux strtod mis-parse strings with leading '+'. */ char *string = " +69"; char *term; double value; value = strtod (string, &term); if (value != 69 || term != (string + 4)) return 1; } { /* Under Solaris 2.4, strtod returns the wrong value for the terminating character under some conditions. */ char *string = "NaN"; char *term; strtod (string, &term); if (term != string && *(term - 1) == 0) return 1; } return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_strtod=yes else ac_cv_func_strtod=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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 $as_echo "$ac_cv_func_strtod" >&6; } if test $ac_cv_func_strtod = no; then case " $LIBOBJS " in *" strtod.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strtod.$ac_objext" ;; esac ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" if test "x$ac_cv_func_pow" = x""yes; then : fi if test $ac_cv_func_pow = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 $as_echo_n "checking for pow in -lm... " >&6; } if test "${ac_cv_lib_m_pow+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $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 pow (); int main () { return pow (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_pow=yes else ac_cv_lib_m_pow=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_m_pow" >&5 $as_echo "$ac_cv_lib_m_pow" >&6; } if test "x$ac_cv_lib_m_pow" = x""yes; then : POW_LIB=-lm else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 $as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} fi fi fi for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = x""yes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done # check for various c library functions for ac_func in strnlen memmove memset mkdir pow putenv rint setenv sqrt strchr strdup strerror strrchr strstr strlcpy do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" eval as_val=\$$as_ac_var if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # check for mmdb if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$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 PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$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 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" 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 PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; 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" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MMDB" >&5 $as_echo_n "checking for MMDB... " >&6; } if test -n "$PKG_CONFIG"; then if test -n "$MMDB_CFLAGS"; then pkg_cv_MMDB_CFLAGS="$MMDB_CFLAGS" else if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mmdb >= 1.19\""; } >&5 ($PKG_CONFIG --exists --print-errors "mmdb >= 1.19") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MMDB_CFLAGS=`$PKG_CONFIG --cflags "mmdb >= 1.19" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$MMDB_LIBS"; then pkg_cv_MMDB_LIBS="$MMDB_LIBS" else if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mmdb >= 1.19\""; } >&5 ($PKG_CONFIG --exists --print-errors "mmdb >= 1.19") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MMDB_LIBS=`$PKG_CONFIG --libs "mmdb >= 1.19" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then MMDB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "mmdb >= 1.19"` else MMDB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "mmdb >= 1.19"` fi # Put the nasty error message in config.log where it belongs echo "$MMDB_PKG_ERRORS" >&5 as_fn_error "Package requirements (mmdb >= 1.19) were not met: $MMDB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables MMDB_CFLAGS and MMDB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " "$LINENO" 5 elif test $pkg_failed = untried; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables MMDB_CFLAGS and MMDB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." "$LINENO" 5; } else MMDB_CFLAGS=$pkg_cv_MMDB_CFLAGS MMDB_LIBS=$pkg_cv_MMDB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : fi # gpp4 wants to know its prefix test "x$prefix" = xNONE && prefix=$ac_default_prefix cat >>confdefs.h <<_ACEOF #define GPP4_PREFIX "$prefix" _ACEOF GPP4_PREFIX=$prefix # Check whether --with-fortran-api was given. if test "${with_fortran_api+set}" = set; then : withval=$with_fortran_api; else with_fortran_api=yes fi # Define an automake conditional: if test "x$with_fortran_api" = "xyes"; then WANT_GPP4F_TRUE= WANT_GPP4F_FALSE='#' else WANT_GPP4F_TRUE='#' WANT_GPP4F_FALSE= fi # Define an autoconf substitution: if test "x$with_fortran_api" = "xyes"; then WANT_GPP4F=1 else WANT_GPP4F=0 fi ac_config_files="$ac_config_files Makefile gpp4.pc gpp4f.pc gpp4.spec gpp4.info Doxyfile src/Makefile src_f/Makefile data/Makefile test/Makefile src/ccp4_program.h" 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 test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= 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 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 "${WANT_GPP4F_TRUE}" && test -z "${WANT_GPP4F_FALSE}"; then as_fn_error "conditional \"WANT_GPP4F\" 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. 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 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=$?; test $as_status -eq 0 && as_status=1 if test "$3"; then as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 fi $as_echo "$as_me: error: $1" >&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 -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' 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 if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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 gpp4 $as_me 1.3.1, which was generated by GNU Autoconf 2.65. 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 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" 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 Configuration files: $config_files Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ gpp4 config.status 1.3.1 configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" Copyright (C) 2009 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=$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"` ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --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 "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' LD_F77='`$ECHO "X$LD_F77" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds_F77='`$ECHO "X$old_archive_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' compiler_F77='`$ECHO "X$compiler_F77" | $Xsed -e "$delay_single_quote_subst"`' GCC_F77='`$ECHO "X$GCC_F77" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_F77='`$ECHO "X$lt_prog_compiler_no_builtin_flag_F77" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl_F77='`$ECHO "X$lt_prog_compiler_wl_F77" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic_F77='`$ECHO "X$lt_prog_compiler_pic_F77" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static_F77='`$ECHO "X$lt_prog_compiler_static_F77" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_F77='`$ECHO "X$lt_cv_prog_compiler_c_o_F77" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc_F77='`$ECHO "X$archive_cmds_need_lc_F77" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_F77='`$ECHO "X$enable_shared_with_static_runtimes_F77" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec_F77='`$ECHO "X$export_dynamic_flag_spec_F77" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec_F77='`$ECHO "X$whole_archive_flag_spec_F77" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object_F77='`$ECHO "X$compiler_needs_object_F77" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds_F77='`$ECHO "X$old_archive_from_new_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_F77='`$ECHO "X$old_archive_from_expsyms_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_F77='`$ECHO "X$archive_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds_F77='`$ECHO "X$archive_expsym_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' module_cmds_F77='`$ECHO "X$module_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds_F77='`$ECHO "X$module_expsym_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld_F77='`$ECHO "X$with_gnu_ld_F77" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag_F77='`$ECHO "X$allow_undefined_flag_F77" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag_F77='`$ECHO "X$no_undefined_flag_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_F77='`$ECHO "X$hardcode_libdir_flag_spec_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld_F77='`$ECHO "X$hardcode_libdir_flag_spec_ld_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator_F77='`$ECHO "X$hardcode_libdir_separator_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_F77='`$ECHO "X$hardcode_direct_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute_F77='`$ECHO "X$hardcode_direct_absolute_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L_F77='`$ECHO "X$hardcode_minus_L_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var_F77='`$ECHO "X$hardcode_shlibpath_var_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic_F77='`$ECHO "X$hardcode_automatic_F77" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath_F77='`$ECHO "X$inherit_rpath_F77" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs_F77='`$ECHO "X$link_all_deplibs_F77" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path_F77='`$ECHO "X$fix_srcfile_path_F77" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols_F77='`$ECHO "X$always_export_symbols_F77" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds_F77='`$ECHO "X$export_symbols_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms_F77='`$ECHO "X$exclude_expsyms_F77" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms_F77='`$ECHO "X$include_expsyms_F77" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds_F77='`$ECHO "X$prelink_cmds_F77" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec_F77='`$ECHO "X$file_list_spec_F77" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action_F77='`$ECHO "X$hardcode_action_F77" | $Xsed -e "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ AR \ AR_FLAGS \ 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 \ SHELL \ ECHO \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ 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_flag_spec_ld \ hardcode_libdir_separator \ fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ finish_eval \ old_striplib \ striplib \ LD_F77 \ compiler_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_cv_prog_compiler_c_o_F77 \ export_dynamic_flag_spec_F77 \ whole_archive_flag_spec_F77 \ compiler_needs_object_F77 \ with_gnu_ld_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ fix_srcfile_path_F77 \ exclude_expsyms_F77 \ include_expsyms_F77 \ file_list_spec_F77; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$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 \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ export_symbols_cmds_F77 \ prelink_cmds_F77; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` ;; esac 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 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "gpp4.pc") CONFIG_FILES="$CONFIG_FILES gpp4.pc" ;; "gpp4f.pc") CONFIG_FILES="$CONFIG_FILES gpp4f.pc" ;; "gpp4.spec") CONFIG_FILES="$CONFIG_FILES gpp4.spec" ;; "gpp4.info") CONFIG_FILES="$CONFIG_FILES gpp4.info" ;; "Doxyfile") CONFIG_FILES="$CONFIG_FILES Doxyfile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src_f/Makefile") CONFIG_FILES="$CONFIG_FILES src_f/Makefile" ;; "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "src/ccp4_program.h") CONFIG_FILES="$CONFIG_FILES src/ccp4_program.h" ;; *) 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_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= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 # 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 {' >"$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 >>"\$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 >>"\$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 < "$tmp/subs1.awk" > "$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 $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES :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="$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 "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 >"$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 "$tmp/subs.awk" >$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' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$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 "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; :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"" || { # Autoconf 2.62 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"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //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' -e 's/\$U/'"$U"'/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 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="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 # 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 # 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 # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # 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 # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # 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 # 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 # The name of the directory that contains temporary libtool files. objdir=$objdir # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that does not interpret backslashes. ECHO=$lt_ECHO # 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 # 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 # 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 # 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 # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # 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 # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # 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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # 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 # 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 # ### 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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # 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 () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # 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 () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # 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_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}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $* )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # 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 () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -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 file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # 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 "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[^=]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$@"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1+=\$2" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1=\$$1\$2" } _LT_EOF ;; esac sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: F77 # The linker used to build libraries. LD=$lt_LD_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 # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_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 # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_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 # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path_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 # 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 # ### 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 $? 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 #### gpp4-1.3.1/AUTHORS0000644000175100017510000000230211254143362010357 00000000000000-*- mode: text -*- Authors of this software include: Charles Ballard: src/ccp4_file_err.h, src/ccp4_sysdep.h, src/ccp4_utils.h, src/cmap_accessor.c, src/cmap_close.c, src/cmap_data.*, src/cmap_errno.h, src/cmap_header.*, src/cmap_labels.*, src/cmap_open.c, src/cmap_skew.*, src/cmap_stats.*, src/cmap_symop.c, src/cmaplib.h, src/cmaplib_f.h, src/library_err.c, src/library_f.h, src/library_file.*, src/library_utils.c, src_f/cmaplib_f.c, src_f/library_f.c Charles Ballard and Martyn Winn: src/ccp4_errno.h, src_f/ccp4_diskio_f.c Eugene Krissinel: src/ccp4_fortran.h Kevin Cowtan: src/ccp4_array.*, src_f/libhtml.f Kevin Cowtan & Dave Love: src_f/keyparse.f Martyn Winn: src/ccp4_spg.h, src/ccp4_unitcell.*, src/ccp4_vars.h, src/cmtzlib.*, src/csymlib.*, src/cvecmat.*, src/mtzdata.h, src/overview.h, src_f/ccp4_general_f.c, src_f/ccp4_unitcell_f.c, src_f/cmtzlib_f.c, src_f/csymlib_f.c Peter Briggs: src/ccp4_parser.*, src/ccp4_program.*, src/ccp4_general.*, src_f/ccp4_parser_f.c Jan Pieter Abrahams: src/pack_c.*, src_f/pack_f.f Lynn Ten Eyck: src_f/fftlib.f Graeme Winter: dna_output.f, dna_header.fh Other authors: Ralf W. Grosse-Kunstleve, Paul Emsley, Morten Kjeldgaard. #### gpp4-1.3.1/gpp4.spec.in0000644000175100017510000000732411251203037011444 00000000000000# -*- mode: rpm-spec ; mode: font-lock -*- Summary: Library providing specific CCP4 functionality Name: @PACKAGE_NAME@ Version: @VERSION@ Release: 1%{?reltag}%{?repotag} License: LGPL Group: Science/Crystallography/Development URL: http://www.bioxray.au.dk/~mok/%{name} Source0: ftp://ftp.bioxray.au.dk/pub/mok/src/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: doxygen %description 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. The library contains several subcomponents: * CMTZ library -- Contains 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. * CMAP library -- Functions defining the C-level API for accessing CCP4 map files. * CSYM library -- a collection of functions centred around a data file syminfo.lib which is auto-generated from sgtbx (the Space Group Toolbox of cctbx). * CCP4 utility library -- many utility functions which either give specific CCP4 or platform independent functionality. * CCP4 Parser library -- provides CCP4-style parsing, as used for processing keywords of CCP4 programs, MTZ header records, etc. * CCP4 resizable arrays -- defines an object and methods which looks just like a simple C array, but can be resized at will without incurring excessive overheads. This is the source rpm package, when compiled it will build two packages libgpp4 and libgpp4-devel. %package -n libgpp4-devel Summary: Header files and library for developing free CCP4 programs Requires: libgpp4 = %{version}-%{release} Group: Science/Crystallography/Development %description -n libgpp4-devel 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. This package contains libraries and header files needed for program development. %package -n libgpp4 Summary: Shared libraries for programs developed with the gpp4 library Group: Science/Crystallography/Libraries %description -n libgpp4 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. This package contains the shared library components needed for programs that have been compiled with the gpp4 library. %prep %setup -q %build %configure make cd src doxygen %install rm -rf %{buildroot} %makeinstall %clean rm -rf %{buildroot} %files -n libgpp4 %defattr(-,root,root,-) %doc README COPYING NEWS AUTHORS %{_datadir}/gpp4/ %{_libdir}/libgpp4.so.0 %{_libdir}/libgpp4.so.0.0.0 %files -n libgpp4-devel %doc README COPYING NEWS AUTHORS doc test %defattr(-,root,root,-) %{_includedir}/gpp4 %{_libdir}/libgpp4.so %{_libdir}/libgpp4.a %{_libdir}/libgpp4.la %{_libdir}/pkgconfig/%{name}.pc %changelog * Sun Sep 02 2007 Morten Kjeldgaard - - Initial build. #### gpp4-1.3.1/INSTALL0000644000175100017510000002202411251203037010334 00000000000000Copyright 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. 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 only 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. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. 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. 4. Type `make install' to install the programs and any data files and documentation. 5. 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. 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=c89 CFLAGS=-O2 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 must use a version of `make' that supports the `VPATH' variable, such as 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 `..'. If you have to use a `make' that does not support the `VPATH' variable, you have 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. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' 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. 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'. Optional Features ================= 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. 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 `--target=TYPE' option 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 will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--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. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. gpp4-1.3.1/Makefile.am0000644000175100017510000000100611507207102011335 00000000000000## -*- mode: Makefile ; mode: font-lock -*- ## This file is to be processed by automake. ACLOCAL_AMFLAGS = -I config pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gpp4.pc # Also distribute these files: EXTRA_DIST = bootstrap README gpp4.pc.in gpp4f.pc.in gpp4.spec.in \ gpp4.info.in COPYRIGHT Doxyfile.in gpp4.m4 # Build in these directories SUBDIRS = src test data if WANT_GPP4F SUBDIRS += src_f pkgconfig_DATA += gpp4f.pc endif DISTCLEANFILES = gpp4.info gpp4.spec gpp4.pc gpp4f.pc Doxyfile #### gpp4-1.3.1/COPYRIGHT0000644000175100017510000000776511507207102010616 00000000000000 This is a list of copyrightholders of the source code in this distribution. They are given file-wise to make it easier to modify when patches/modifications come in. Latest update: 2009.09.16 Files: src/ccp4_array.* Copyright: © 2002 Kevin Cowtan Files: src/ccp4_errno.h Copyright: © 2001 CCLRC, Charles Ballard and Martyn Winn Files: src/ccp4_file_err.h Copyright: © 2001 CCLRC, Charles Ballard Files: src/ccp4_fortran.h Copyright: © 2001 Eugene Krissinel Copyright: © 2007 Morten Kjeldgaard Files: src/ccp4_general.* Copyright: © 2001, 2003 CCLRC, Peter Briggs Copyright: © 2007 Morten Kjeldgaard Files: src/ccp4_parser.* Copyright: © 2001 CCLRC, Peter Briggs Copyright: © 2007 Morten Kjeldgaard Files: src/ccp4_program.* Copyright: © 2001 CCLRC, Peter Briggs Copyright: © 2007 Morten Kjeldgaard Files: src/ccp4_spg.h Copyright: © 2001 CCLRC, Martyn Winn Files: src/ccp4_sysdep.h Copyright: © 2001 CCLRC Files: src/ccp4_types.h Copyright: © 2001 CCLRC Copyright: © 2007 Morten Kjeldgaard Files: src/ccp4_unitcell.* Copyright: © 2001 CCLRC, Martyn Winn Files: src/ccp4_utils.h Copyright: © 2001 CCLRC, Charles Ballard Files: src/ccp4_vars.h Copyright: © 2002 CCLRC, Martyn Winn Files: src/cmap_accessor.c Copyright: © 2001 CCLRC, Charles Ballard Files: src/cmap_close.c Copyright: © 2001 CCLRC, Charles Ballard Files: src/cmap_data.* Copyright: © 2001 CCLRC, Charles Ballard Files: src/cmap_errno.h Copyright: © 2001 CCLRC, Charles Ballard Files: src/cmap_header.* Copyright: © 2001 CCLRC, Charles Ballard Files: src/cmap_labels.* Copyright: © 2001 CCLRC, Charles Ballard Files: src/cmap_open.c Copyright: © 2001 CCLRC, Charles Ballard Files: src/cmap_skew.* Copyright: © 2001 CCLRC, Charles Ballard Files: src/cmap_stats.* Copyright: © 2001 CCLRC, Charles Ballard Files: src/cmap_symop.c Copyright: © 2001 CCLRC, Charles Ballard Files: src/cmaplib.h, src/cmaplib_f.h Copyright: © 2001 CCLRC, Charles Ballard Files: src/cmtzlib.* Copyright: © 2001 CCLRC, Martyn Winn Files: src/csymlib.* Copyright: © 2001 CCLRC, Martyn Winn Files: src/cvecmat.* Copyright: © 2001 CCLRC, Martyn Winn Files: src/gpp4_open_symop_file.c Copyright: © 2008 Morten Kjeldgaard Files: src/library_err.c Copyright: © 2001 CCLRC, Charles Ballard Files: src/library_file.* Copyright: © 2001 CCLRC, Charles Ballard Files: src/library_utils.c Copyright: © 2001 CCLRC, Charles Ballard Files: src/mtzdata.h Copyright: © 2001 CCLRC, Martyn Winn Files: src/overview.h Copyright: © 2003 CCLRC, Martyn Winn Copyright: © Morten Kjeldgaard 2007, 2009 Files: src/pack_c.c, src/pack_c.h Copyright: © 1995 Jan P Abrahams Files: src/symlib.h Copyright: © 2003 CCLRC, Martyn Winn Copyright: © Morten Kjeldgaard 2007 Files: src_f/ccp4_diskio_f.c Copyright: © 2002 CCLRC, Charles Ballard and Martyn Winn Files: src_f/ccp4_general_f.c Copyright: © 2001 CCLRC, Martyn Winn Files: src_f/ccp4_parser_f.c Copyright: © 2001 CCLRC, Peter Briggs Files: src_f/ccp4_unitcell_f.c Copyright: © 2001 CCLRC, Martyn Winn Files: src_f/ccplib.f Copyright: © Phil Evans Copyright: © Eleanor Dodson Files: src_f/cmaplib_f.c Copyright: © 2001 CCLRC, Charles Ballard Files: src_f/cmtzlib_f.c Copyright: © 2001 CCLRC, Martyn Winn Files: src_f/csymlib_f.c Copyright: © 2001 CCLRC, Martyn Winn Files: src_f/dna_output.f, src_f/dna_header.fh Copyright: © 2004 CCLRC, Graeme Winter Files: src_f/fftlib.f Copyright: © Lynn Ten Eyck Files: src_f/keyparse.f Copyright: © 1995 Dave Love, Kevin Cowtan Files: src_f/libhtml.f Copyright: © 1998 Kevin Cowtan Files: src_f/library_f.c Copyright: © 2001 CCLRC, Charles Ballard Files: src_f/modlib.f Copyright: © 1985 D.J. Thomas Copyright: © 2000 pjx Copyright: © 2008 C. Flensburg Copyright: © 1988 M. James Copyright: © 1989 D. Love Files: src_f/pack_f.f Copyright: © 1995 Jan P Abrahams Files: src_f/parser.f Copyright: Mike Levitt Copyright: Peter Brick, Phil Evans, Eleanor Dodson, Dave Love Files: src_f/rwbrook.f Copyright: *unknown* Files: test/* Copyright: © 2008-2010 Morten Kjeldgaard gpp4-1.3.1/ChangeLog0000644000175100017510000002330211530701740011061 000000000000002011-02-22 Morten Kjeldgaard * src/ccp4_general.c (ccp4fyp): If info is set, ccp4fyp needs to return a status value of 0 to the shell. 2011-02-16 Morten Kjeldgaard * src/cmtzlib.* (MtzRewdInput): New function, upstream patch applied. * src_f/ccp4_general_f.c: add wrapper for ccp4VerbosityLevel 2011-02-16 Morten Kjeldgaard * src/ccp4_general.c (ccp4fyp): Print out new gpp4 ASCII logo 2011-02-14 Morten Kjeldgaard * src/ccp4_program.h.in: GPP4_VERSION_NO was not defined unless the preprocessor defined VERSION. It is now hardwired into the derived header file via autoconf. 2011-02-09 Morten Kjeldgaard * src/ccp4_general.c (ccp4_banner): Have fun with banner. 2010-12-27 Morten Kjeldgaard * test/checkarch.c: deal with map files too. Expand test on arch format and print out more info. * test/mtzhdr.c: print extensive header information, inspirede by Ralfs post on ccp4-dev on 20100915 2010-12-26 Morten Kjeldgaard * src/ccp4_general.c (ccp4_banner): output date and time in RFC 2822 format. * test/mtzhdr.c: Output more complete header information, inspired by Ralf Grosse-Kunstleves mail to ccp4-dev on 20100915. 2010-12-16 Morten Kjeldgaard * src/csymlib.h: fix url in Doxygen markup. * src_f/parser.f (RDSYMM): Remove redundant parser output (from 6.1.24) * src_F/csymlib_f.c: Patch to improve test reflection set in HKLRANGE (from 6.1.24) * src/ccp4_program.c (ccp4_prog_vers): Simplify dealing with program version string, using system functions (from 6.1.24) * src/cmtzlib.c, src/cmtzlib.h: New API for symmetry confidence flag * src_f/cmtzlib_f.c: Add Fortran bindings for spacegroup confidence routines, from 6.1.24 * src/mtzdata.h: Extension to MTZ header info (from 6.1.24) * src/ccp4_program.h: Bump patch level to 6.1.24 * src_f/unix.m4: case issue fixed (from 6.1.24) * src_f/ccplib.f: Patch to increase table size to deal with problems in Scala (from 6.1.24). * src/library_file.c: Patch to deal with corrupted file stamp problem (from 6.1.24) * src_f/ccp4_general_f.c: Initialize string (from 6.1.24). * src/cmap_close.c (ccp4_cmap_close): Patch to fix potential division by zero (from 6.1.24) * src_f/cmaplib_f.c (HeaderPrint): Patch to improve map header printout (from 6.1.24) * src/library_err.c: Patch to introduce Two new error messages (from 6.1.24) * src/cmap_header.c, src/cmaplib.h: Introduce patches posted on the ccp4-dev list 20100811 by Martyn Winn to solve problem with MRC chimera maps 2010-01-25 Morten Kjeldgaard * Merge patches to the library from ccp4-6.1.3; this concerns only two files: src/ccp4_program.h and src/cmtzlib.c. * Add configure macro gpp4.m4 to tarball. 2009-10-02 Morten Kjeldgaard * Remove utils/* from the distribution; it is no longer required to split the fortran sources. 2009-09-23 Morten Kjeldgaard * library_f.c, cmtzlib_f.c, ccp4_unitcell_f.c, csymslib_f.c, cmaplib_f.c: fixed various compilation warnings; mostly pointer casting. 2009-09-14 Morten Kjeldgaard * Add code for the FORTRAN API in src_f/. The additions have not been tested very much, but I did succeed in building refmac version 5.6.0031 with it, and it seems to run. * CCP4 uses fsplit to split the fortran source files, but I don't think that is necessary anymore, so the library is built from the original, unsplit files. Fsplit is in the bzr repo at the moment but will go when it is firmly established that it's not needed. * I removed some subroutines from the file modlib.f (EA06C, EA08C, EA09C, FA01BS, FA01CS, FA01DS, FA01AS and function FM02AD) because they carry a license that I know is completely unacceptable by Ubuntu or Debian, and probably Fedora too. Don't know about Fink. Basically you are required to notify Harwell in writing if you make modifications to the code, and only research institutions are allowed to do it. The license also carries something akin to an advertising clause *). The main routine is EA06C, and it is not used by very many programs. I grepped the CCP4 distro and found that only these programs are callers: scaleit.f, icoeff.f, makedict.f, geomcalc.f, scala.f EA06C is an eigenvalue finding subroutine, so it is easy to find replacements. I don't understand why CCP4 distributes this code at all. 2009-09-08 Morten Kjeldgaard * Patches from Tim Fenn: - src/ccp4_sysdep.h: Allow for compilation on ARM - configure.ac: check for existence of sin() in libm - gpp4.pc: use standard autoconf variables 2008-12-02 Morten Kjeldgaard * src/gpp4_open_symop_file.c: New file containing function open_symop_file which is special to gpp4. * Many changes in many files to facilitate merging of future versions. * Merged in modifications from CCP4 library 6.1.0, since it is now LGPL licensed. 2008-12-01 Morten Kjeldgaard * src/ccp4_sysdep.h: patch from Ubuntu to allow building on the hppa and armel platforms 2007-10-21 Morten Kjeldgaard * gpp4.info.in: New conformant .info file from Bill Scott. 2007-10-20 Morten Kjeldgaard * test/Makefile.am: Variable $top_srcdir changed to $top_builddir to allow linking with newly built shared library if building with --prefix=blabla 2007-09-03 Morten Kjeldgaard * Renamed directory lib -> src * src/ccp4_general.c (ccp4fyp): Modified strategy used when searching for environ.def and default.def; also $prefix/share/gpp4 and $prefix/lib/ are searched. (By default, we install those files in $prefix/share/gpp4). * src/ccp4_general.c (ccp4fyp): Now guaranteed to use sensible defaults if environmental variables CLIBD and CCP4_SCR are not defined. In the first case, use our standard $prefix/share/gpp4 directory, in the second case, use /tmp. * src/csymlib.c (open_syminfo_file): memory leak fixed. * Bump version to 1.0.4, and release. 2007-09-02 Morten Kjeldgaard * Wrote spec file to generate rpm packages. * Wrote info file to build fink packages under Mac OS X. * Use declarative rules to install pkgconfig data instead of local install hooks. 2007-08-15 Morten Kjeldgaard * Bumped version to 1.0.3 * Added pkg-config module gpp4.pc * Under Linux it is necessary to specify libm when linking test program; this is not the case under Darwin. * Slight modification to configure.ac, so $prefix is set to something sensible in all cases (and not just "NONE"). 2007-08-10 Morten Kjeldgaard * Bump version to 1.0.2 * lib/csymlib.c: Changed the way the library searches for syminfo.lib. The code is now in a static function open_syminfo_file(). This is to make the library more standalone and independent of the CCP4 distribution. The search strategy is to search the environmental variable SYMINFO first, then a number of standard locations in the file system, and finally the CCP4 data directory. * lib/symlib.h: Added description of the FORTRAN API, which contains some more detail on the format of syminfo.lib. * Doxygen config file 'Doxyfile' has been moved to Doxyfile.in, and configure.ac now defines the software version in that file. * lib/ccp4_general.c: Banner modified to reflect gpp4 library version. 2007-08-09 Morten Kjeldgaard * Bump version to 1.0.1 * lib/overview.h: Edit overview, project is no longer called 'CINCH' but GPP4. * Removed lines INDEX_INFO::* sections from doxygen markup in all files. * Added Emacs local variables list to lib/*{c,h} 2007-07-25 Morten Kjeldgaard * lib/ccp4_unitcell.c: Reworked doxygen markup, moved from the header file to the C source file. 2007-07-24 Morten Kjeldgaard * lib/ccp4_types.h: Wrote doxygen markup. * lib/ccp4_parser.c (symop_to_mat4_err): Internal function, declared static. Probably other functions should be made static, too. This is on the TODO list. * lib/ccp4_parser.c: Doxygen markup reworked. I moved it from the header file, to the C source file, which is where the programmer most often will want to read the description. Merged descriptions of functions from comment in top of the file to the individual descriptions. Cleaned up comments everywhere, especially, I removed the ugly /*----- */ delimiters. * lib/ccp4_general.c: Internal routines ccp4fyp_cleanup and ccp4setenv_cleanup declared static. * lib/ccp4_general.c: Doxygen markup reworked. * lib/ccp4_fortran.h: - ditto - * lib/ccp4_program.*: - ditto - * lib/library_f.h: Header file deleted, since it is not being used anywhere. 2007-07-19 Morten Kjeldgaard * Removed files created in the build process from the git tree, since they only clutter the diffs and make it harder to see changes to the source code. * Added .gitignore files in top directory, lib/ and data/ 2007-07-04 Morten Kjeldgaard * Replaced license text in all source files in lib with straight LGPL version 2.1 license text. * Removed ancient rcsid static variable. Since the code is not under RCS control, it is not updated anymore and therefore useless. * COPYING now contains LGPL version 2.1. * Modified configure.ac to use config/ as it's config directory. We don't want all those autotools scripts cluttering the top directory. Also doing more checks. * Removed lib/w32mvs.h since it does not appear to be used anywhere. * Imported source code branches from Ralf Grosse-Kunstleve and Paul Emsley into git repository. Local variables: mode: change-log mode: font-lock End: gpp4-1.3.1/Doxyfile.in0000644000175100017510000016406611507207102011434 00000000000000# Doxyfile 1.5.6 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = gpp4 # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = @VERSION@ # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = ./doc # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, # Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, # Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, # and Ukrainian. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the DETAILS_AT_TOP tag is set to YES then Doxygen # will output the detailed description near the top, like JavaDoc. # If set to NO, the detailed description appears after the member # documentation. DETAILS_AT_TOP = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen to replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = src \ src_f # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = *.c \ *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. Otherwise they will link to the documentstion. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to FRAME, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. Other possible values # for this tag are: HIERARCHIES, which will generate the Groups, Directories, # and Class Hiererachy pages using a tree view instead of an ordered list; # ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which # disables this behavior completely. For backwards compatibility with previous # releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE # respectively. GENERATE_TREEVIEW = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This # font does not include all possible unicode characters however, so when you need # these (or just want a differently looking font) you can specify the font name # using DOT_FONTNAME. You need need to make sure dot is able to find the font, # which can be done by putting it in a standard location or by setting the # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # containing the font. DOT_FONTNAME = FreeSans # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is enabled by default, which results in a transparent # background. Warning: Depending on the platform used, enabling this option # may lead to badly anti-aliased labels on the edges of a graph (i.e. they # become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO gpp4-1.3.1/bootstrap0000755000175100017510000000017011251203037011244 00000000000000#! /bin/sh aclocal -I config \ && libtoolize --force --copy \ && automake --foreign --add-missing --copy \ && autoconf gpp4-1.3.1/aclocal.m40000644000175100017510000011610111526170227011154 00000000000000# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 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_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],, [m4_warning([this file was generated for autoconf 2.65. 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'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # 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. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # # Similar to PKG_CHECK_MODULES, make sure that the first instance of # this or PKG_CHECK_MODULES is called, or make sure to call # PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_ifval([$2], [$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$PKG_CONFIG"; then if test -n "$$1"; then pkg_cv_[]$1="$$1" else PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) fi else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` else $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD ifelse([$4], , [AC_MSG_ERROR(dnl [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT ])], [AC_MSG_RESULT([no]) $4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])], [$4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) ifelse([$3], , :, [$3]) fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 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.11' 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.11.1], [], [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.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 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, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # 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. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$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, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # 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. # serial 10 # 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", "GCJ", or "OBJC". # 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 ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" 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'. 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 8's {/usr,}/bin/sh. touch 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 ;; 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, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # 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. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 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"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //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' -e 's/\$U/'"$U"'/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, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 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. # serial 16 # 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.62])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], [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], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [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([AM_PROG_MKDIR_P])dnl # 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)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl 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, 2003, 2005, 2008 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, 2005 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. # serial 2 # 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])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 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. # serial 4 # 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, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # 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. # serial 6 # 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 supports --run. # If it does, 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 --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 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_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 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. # serial 4 # _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, 1997, 2000, 2001, 2003, 2005, 2008 # 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. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # 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 ( 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 rm -f conftest.file 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 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)]) # Copyright (C) 2001, 2003, 2005 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, 2008 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. # serial 2 # _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, 2005 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. # serial 2 # _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. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. 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([config/libtool.m4]) m4_include([config/ltoptions.m4]) m4_include([config/ltsugar.m4]) m4_include([config/ltversion.m4]) m4_include([config/lt~obsolete.m4]) gpp4-1.3.1/test/0000755000175100017510000000000011530702343010346 500000000000000gpp4-1.3.1/test/checkarch.c0000644000175100017510000000601311523046177012355 00000000000000/* checkarch.c: check the arch stamp in an mtz file. Copyright: © 2010 Morten Kjeldgaard License: GPL-3+ This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ #include #include #include "ccp4_utils.h" #include "ccp4_sysdep.h" int whatkind (CCP4File *fd) { char buf[12]; ccp4_file_raw_seek(fd, 0, SEEK_SET); if (ccp4_file_raw_read(fd, buf, 4UL) != 4) { return -1; } if (strncmp (buf, "MTZ ", 4) == 0) return 1; /* now see if file is a map */ ccp4_file_raw_seek(fd, 208, SEEK_SET); if (ccp4_file_raw_read(fd, buf, 4UL) != 4) { return -1; } if (strncmp (buf, "MAP ", 4) == 0) return 2; /* else return unknown */ return 0; } int process_file (char *fnam, int verbose) { int stamp_loc = 0; union { unsigned int i; unsigned char mtstring[4]; } res; CCP4File *fd = ccp4_file_open(fnam, O_RDONLY); printf ("%s; ", fnam); /* First figure out what kind of file this is */ switch (whatkind(fd)) { case -1: printf ("read error\n"); return 1; case 1: stamp_loc = 8; printf ("MTZ format; "); break; case 2: stamp_loc = 212; printf ("MAP format; "); break; case 0: printf ("unknown file\n"); return 1; } /* Now try to read the arch flag */ ccp4_file_raw_seek(fd, stamp_loc, SEEK_SET); if (ccp4_file_raw_read(fd, (char *) &res, 4UL) != 4) { printf ("error\n"); return 1; } if (res.i == 0) { printf ("no arch stamp found\n"); return 1; } int fconvert = res.mtstring[0]>>4; int iconvert = res.mtstring[1]>>4; if (iconvert == DFNTI_MBO) printf ("Motorola byte order; "); else if (iconvert == DFNTI_IBO) printf ("Intel byte order; "); switch (fconvert) { case DFNTF_BEIEEE: printf ("big endian ieee; "); break; case DFNTF_LEIEEE: printf ("little endian ieee; "); break; case DFNTF_VAX: printf ("vax floats; "); break; case DFNTF_CONVEXNATIVE: printf ("convex native floats; "); break; } if (iconvert == NATIVEIT && fconvert == NATIVEFT) printf ("native to this machine\n"); else printf ("not native to this machine\n"); return 0; } int main(int argc, char **argv) { int status; if (argc != 2) { puts("Usage: checkarch "); exit(1); } status = process_file (argv[1], 1); exit(status); } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/test/mtzcols.c0000644000175100017510000000342511530701233012126 00000000000000/* mtzcols -- a program to print the full mtz paths of columns in an MTZ file. Copyright: © 2010 Morten Kjeldgaard License: GPL-3+ This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ #include "cmtzlib.h" #include "ccp4_program.h" #include "ccp4_general.h" #include #include void mtzhdrout (MTZ *mtz) { char *s; register int i, j, k; for (j = 0; j < mtz->nxtal; j++) { /* simply print a list of project/crystal/datase lines */ for (i=0; i < mtz->xtal[j]->nset; i++) { for (k=0; k < mtz->xtal[j]->set[i]->ncol; k++) { printf ("%s/", mtz->xtal[j]->pname); printf ("%s/", mtz->xtal[j]->set[i]->dname); printf ("%s\n", mtz->xtal[j]->set[i]->col[k]->label); } } } return; } int main(int argc, char **argv) { if (argc != 2) { puts("Usage: mtzhdr "); exit(1); } ccp4ProgramName("mtzcols"); ccp4_prog_vers (VERSION); ccp4_banner(); MTZ *mtz = MtzGet (argv[1], 1); if (!mtz) { printf ("error reading mtz file %s\n", argv[1]); exit (1); } mtzhdrout(mtz); exit(0); } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/test/Makefile.am0000644000175100017510000000066711522246176012343 00000000000000## -*- mode: Makefile ; mode: font-lock -*- ## Copyright 2007 Morten Kjeldgaard ## This code is distributed under the GPL license. AM_CPPFLAGS = -I$(top_srcdir)/src AM_LDFLAGS = $(top_builddir)/src/libgpp4.la @LIBM@ noinst_PROGRAMS = load_syminfo mtzhdr checkarch maphdr mtzcols load_syminfo_SOURCES = load_syminfo.c mtzhdr_SOURCES = mtzhdr.c mtzcols_SOURCES = mtzcols.c checkarch_SOURCES = checkarch.c maphdr_SOURCES = maphdr.c #### gpp4-1.3.1/test/load_syminfo.c0000644000175100017510000000244611523046142013123 00000000000000/* load_syminfo.c: test program that loads syminfo.lib. Copyright: © 2007 Morten Kjeldgaard License: GPL-3+ This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ #include "csymlib.h" #include "ccp4_general.h" #include "ccp4_program.h" int main () { CCP4SPG *spg; ccpputenv ("SYMINFO", "../data/syminfo.lib"); ccp4ProgramName("load_syminfo"); ccp4_prog_vers (VERSION); ccp4_banner(); spg = ccp4spg_load_by_standard_num (20); ccp4spg_print_centric_zones(spg); ccp4spg_print_epsilon_zones(spg); ccp4spg_print_recip_spgrp(spg); ccp4spg_print_recip_ops(spg); return 0; } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/test/maphdr.c0000644000175100017510000000374711523046105011717 00000000000000/* maphdr -- a program to print header information from a map file. Copyright: © 2010 Morten Kjeldgaard License: GPL-3+ This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ #include "cmaplib.h" #include "ccp4_program.h" #include "ccp4_general.h" void maphdrout(CMMFile *map) { register int i; printf ("File name: %s\n", map->file_name); printf ("Data mode: %u\n", map->data_mode); printf ("Close mode: %u\n", map->close_mode); printf ("Unit cell:"); for (i=0; i<6; i++) printf (" %.3f", map->cell[i]); printf ("\n"); printf ("Map dimensions: %4d %4d %4d\n", map->map_dim[0],map->map_dim[1],map->map_dim[2]); printf ("Map origin: %4d %4d %4d\n", map->origin[0],map->origin[1],map->origin[2]); printf ("Map size: %4d %4d %4d\n", map->cell_grid[0],map->cell_grid[1],map->cell_grid[2]); printf ("Axis order: %4d %4d %4d\n", map->axes_order[0],map->axes_order[1],map->axes_order[2]); } int main(int argc, char **argv) { if (argc != 2) { puts("Usage: maphdr "); exit(1); } ccp4ProgramName("maphdr"); ccp4_prog_vers (VERSION); ccp4_banner(); CMMFile *map = ccp4_cmap_open(argv[1], O_RDONLY); if (!map) { printf ("error reading map file %s\n", argv[1]); exit (1); } maphdrout(map); exit(0); } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/test/mtzhdr.c0000644000175100017510000001370211523046026011746 00000000000000/* mtzhdr -- a program to print header information from mtz file. Inspired by Ralf Grosse-Kunstleves mail to ccp4-dev mailing list 20100915. Copyright: © 2010 Morten Kjeldgaard License: GPL-3+ This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with This library. If not, see . */ #include "cmtzlib.h" #include "ccp4_program.h" #include "ccp4_general.h" #include #include void mtzhdrout (MTZ *mtz) { char *s; register int i, j, k; printf ("Title: %s\n", mtz->title); printf ("Space group number: %d\n", mtz->mtzsymm.spcgrp); printf ("Space group name: %s\n", mtz->mtzsymm.spcgrpname); printf ("Point group name: %s\n", mtz->mtzsymm.pgname); printf ("Lattice type: %c\n", mtz->mtzsymm.symtyp); printf ("Space group confidence: %c ", mtz->mtzsymm.spg_confidence); if (mtz->mtzsymm.spg_confidence == 'L') { printf(" (only Bravais lattice is fixed so far)\n"); } else if (mtz->mtzsymm.spg_confidence == 'P') { printf(" (only pointgroup is fixed so far)\n"); } else if (mtz->mtzsymm.spg_confidence == 'E') { printf(" (one of pair of enantiomorphic spacegroups)\n"); } else if (mtz->mtzsymm.spg_confidence == 'S') { printf(" (spacegroup is known)\n"); } else { printf (" (unknown)\n"); } printf ("Number of crystals: %d\n", mtz->nxtal); printf ("Number of reflections: %d\n", mtz->nref); printf ("Number of reflections from file: %d\n", mtz->nref_filein); printf ("Resolution limits from file: %.2f %.2f\n", mtz->resmax_out, mtz->resmin_out); printf ("History:\n"); s = mtz->hist; for (i=0; i< mtz->histlines; i++) { putchar(' '); for (j=0; j<80; j++) putchar(*s++); putchar('\n'); } printf ("Number of columns: %d\n", mtz->ncol_read); if (mtz->refs_in_memory) { printf ("Reflections are held in memory\n"); } printf ("Original number of batches: %d\n", mtz->n_orig_bat); for (j = 0; j < mtz->nxtal; j++) { printf ("Crystal %d:\n", j+1); printf (" Name: %s\n", mtz->xtal[j]->xname); printf (" Project: %s\n", mtz->xtal[j]->pname); printf (" Id: %d\n", mtz->xtal[j]->xtalid); printf (" Unit cell:"); for (i=0; i<6; i++) printf (" %.3f", mtz->xtal[j]->cell[i]); printf ("\n"); printf (" Resolution range: %.2f %.2f\n", 1.0/sqrt(mtz->xtal[j]->resmin), 1.0/sqrt(mtz->xtal[j]->resmax)); printf (" Number of datasets: %d\n", mtz->xtal[j]->nset); for (i=0; i < mtz->xtal[j]->nset; i++) { printf (" Dataset %d:\n", i+1); printf (" Name: %s\n", mtz->xtal[j]->set[i]->dname); printf (" Id: %d\n", mtz->xtal[j]->set[i]->setid); printf (" Wavelength: %f\n", mtz->xtal[j]->set[i]->wavelength); printf (" Number of columns: %d\n", mtz->xtal[j]->set[i]->ncol); /* Determine length of longest label */ int n, max = 1; char fmt[16]; for (k=0; k < mtz->xtal[j]->set[i]->ncol; k++) { #ifdef HAVE_STRNLEN n = strnlen (mtz->xtal[j]->set[i]->col[k]->label, 31); #else n = strlen (mtz->xtal[j]->set[i]->col[k]->label); #endif max = n > max? n:max; } sprintf (fmt, " %%-%ds", max); printf (fmt, "label"); printf ("%11s%10s%11s%11s%9s\n", "#valid", "%valid", "min", "max", "type"); /* Now print info about columnts */ for (k=0; k < mtz->xtal[j]->set[i]->ncol; k++) { printf (fmt, mtz->xtal[j]->set[i]->col[k]->label); { float *r = mtz->xtal[j]->set[i]->col[k]->ref; register int h; int ct=0; for (h=0; h < mtz->nref; h++) { if (ccp4_ismnf(mtz, *r++)) ct++; } printf (" %10d", mtz->nref-ct); printf (" %8.2f%%", 100.0*(mtz->nref-ct)/mtz->nref); } printf (" %10.2f", mtz->xtal[j]->set[i]->col[k]->min); printf (" %10.2f", mtz->xtal[j]->set[i]->col[k]->max); printf (" %5s:", mtz->xtal[j]->set[i]->col[k]->type); switch (mtz->xtal[j]->set[i]->col[k]->type[0]) { case 'H': printf (" index h,k,l\n"); break; case 'F': printf (" amplitude\n"); break; case 'J': printf (" intensity\n"); break; case 'G': printf (" amplitude associated with F(+) or F(-)\n"); break; case 'K': printf (" intensity associated with I(+) or I(-)\n"); break; case 'D': printf (" anomalous difference\n"); break; case 'Q': printf (" standard deviation\n"); break; case 'I': printf (" integer\n"); break; case 'R': printf (" real\n"); break; case 'L': printf (" standard deviation of a column of type G\n"); break; case 'M': printf (" standard deviation of a column of type K\n"); break; case 'E': printf (" normalised structure factor\n"); break; case 'P': printf (" phase angle (degrees)\n"); break; case 'W': printf (" weight\n"); break; case 'A': printf (" phase probability coefficients\n"); break; case 'B': printf (" batch number\n"); break; case 'Y': printf (" packed partial/reject flag and symmetry number\n"); break; default: printf ("\n"); break; } } } } return; } int main(int argc, char **argv) { if (argc != 2) { puts("Usage: mtzhdr "); exit(1); } ccp4ProgramName("mtzhdr"); ccp4_prog_vers (VERSION); ccp4_banner(); MTZ *mtz = MtzGet (argv[1], 1); if (!mtz) { printf ("error reading mtz file %s\n", argv[1]); exit (1); } mtzhdrout(mtz); // ccp4_lhprt(mtz, 4); exit(0); } /* Local variables: mode: font-lock End: */ gpp4-1.3.1/test/Makefile.in0000644000175100017510000003711011526170231012335 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ noinst_PROGRAMS = load_syminfo$(EXEEXT) mtzhdr$(EXEEXT) \ checkarch$(EXEEXT) maphdr$(EXEEXT) mtzcols$(EXEEXT) subdir = test DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_checkarch_OBJECTS = checkarch.$(OBJEXT) checkarch_OBJECTS = $(am_checkarch_OBJECTS) checkarch_LDADD = $(LDADD) am_load_syminfo_OBJECTS = load_syminfo.$(OBJEXT) load_syminfo_OBJECTS = $(am_load_syminfo_OBJECTS) load_syminfo_LDADD = $(LDADD) am_maphdr_OBJECTS = maphdr.$(OBJEXT) maphdr_OBJECTS = $(am_maphdr_OBJECTS) maphdr_LDADD = $(LDADD) am_mtzcols_OBJECTS = mtzcols.$(OBJEXT) mtzcols_OBJECTS = $(am_mtzcols_OBJECTS) mtzcols_LDADD = $(LDADD) am_mtzhdr_OBJECTS = mtzhdr.$(OBJEXT) mtzhdr_OBJECTS = $(am_mtzhdr_OBJECTS) mtzhdr_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(checkarch_SOURCES) $(load_syminfo_SOURCES) \ $(maphdr_SOURCES) $(mtzcols_SOURCES) $(mtzhdr_SOURCES) DIST_SOURCES = $(checkarch_SOURCES) $(load_syminfo_SOURCES) \ $(maphdr_SOURCES) $(mtzcols_SOURCES) $(mtzhdr_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ 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@ FLIBS = @FLIBS@ GPP4_PREFIX = @GPP4_PREFIX@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MMDB_CFLAGS = @MMDB_CFLAGS@ MMDB_LIBS = @MMDB_LIBS@ 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@ PKG_CONFIG = @PKG_CONFIG@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WANT_GPP4F = @WANT_GPP4F@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ 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@ lt_ECHO = @lt_ECHO@ 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@ AM_CPPFLAGS = -I$(top_srcdir)/src AM_LDFLAGS = $(top_builddir)/src/libgpp4.la @LIBM@ load_syminfo_SOURCES = load_syminfo.c mtzhdr_SOURCES = mtzhdr.c mtzcols_SOURCES = mtzcols.c checkarch_SOURCES = checkarch.c maphdr_SOURCES = maphdr.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list checkarch$(EXEEXT): $(checkarch_OBJECTS) $(checkarch_DEPENDENCIES) @rm -f checkarch$(EXEEXT) $(LINK) $(checkarch_OBJECTS) $(checkarch_LDADD) $(LIBS) load_syminfo$(EXEEXT): $(load_syminfo_OBJECTS) $(load_syminfo_DEPENDENCIES) @rm -f load_syminfo$(EXEEXT) $(LINK) $(load_syminfo_OBJECTS) $(load_syminfo_LDADD) $(LIBS) maphdr$(EXEEXT): $(maphdr_OBJECTS) $(maphdr_DEPENDENCIES) @rm -f maphdr$(EXEEXT) $(LINK) $(maphdr_OBJECTS) $(maphdr_LDADD) $(LIBS) mtzcols$(EXEEXT): $(mtzcols_OBJECTS) $(mtzcols_DEPENDENCIES) @rm -f mtzcols$(EXEEXT) $(LINK) $(mtzcols_OBJECTS) $(mtzcols_LDADD) $(LIBS) mtzhdr$(EXEEXT): $(mtzhdr_OBJECTS) $(mtzhdr_DEPENDENCIES) @rm -f mtzhdr$(EXEEXT) $(LINK) $(mtzhdr_OBJECTS) $(mtzhdr_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checkarch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/load_syminfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maphdr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtzcols.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mtzhdr.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @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 check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: 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) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 -rf ./$(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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am 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 uninstall uninstall-am #### # 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: gpp4-1.3.1/gpp4.pc.in0000644000175100017510000000035111507207102011106 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: gpp4 Description: alternative to the CCP4 library Version: @VERSION@ Requires: Conflicts: Libs: -L${libdir} -lgpp4 Cflags: -I${includedir}/gpp4 gpp4-1.3.1/config/0000755000175100017510000000000011530702343010634 500000000000000gpp4-1.3.1/config/lt~obsolete.m40000644000175100017510000001311311513050652013367 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007 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 4 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_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) 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])]) gpp4-1.3.1/config/README0000644000175100017510000000014011251203037011423 00000000000000This directory is for automake, autoconf and libtool. Do not put other source files here. gpp4-1.3.1/config/ltoptions.m40000644000175100017510000002724211513050652013060 00000000000000# Helper functions for option handling. -*- 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 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], [0], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [0], [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], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [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])]) gpp4-1.3.1/config/config.guess0000755000175100017510000012753411251205616013111 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. timestamp='2008-01-23' # 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 2 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, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # 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 Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. 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 (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 # 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 tupples: *-*-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 __ELF__ >/dev/null 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 ;; *: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'` exit ;; 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 ;; 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:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-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:*:[456]) 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 __LP64__ >/dev/null 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:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) 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 ;; 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-gnu`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/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix 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-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu 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 ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${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-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; 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.0*:*) 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 i386. echo i386-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; } ;; 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.0*:*) 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 ;; 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 case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac 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 ;; 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 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 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: gpp4-1.3.1/config/config.sub0000755000175100017510000010115311251205616012541 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. timestamp='2008-01-16' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # 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 2 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, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # 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. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # 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. # 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 (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 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-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) 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) os= basic_machine=$1 ;; -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*) 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 \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | 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 | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-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-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | 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-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | 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-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-*) ;; # 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 ;; 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 ;; c90) basic_machine=c90-cray os=-unicos ;; 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) 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 ;; 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'm not sure what "Sysv32" means. Should this be sysv3.2? 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 ;; 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-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; 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 ;; 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) basic_machine=powerpc-unknown ;; ppc-*) 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-*) 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) 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 ;; 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 ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tile*) basic_machine=tile-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 ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-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[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. -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* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -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* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -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*) # 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 ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -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 ;; # 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 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) 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 ;; -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: gpp4-1.3.1/config/depcomp0000755000175100017510000004271311251205616012141 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2007-03-29.01 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # 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 outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac 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" # 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 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 -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## 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). ## - 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 -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## 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. tr ' ' ' ' < "$tmpdepfile" | ## 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. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -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 -eq 0; then : else 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 ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; 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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 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 -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else 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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 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 -eq 0; then : else 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,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" else echo "#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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # 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.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #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 $1 != '--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:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. 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 $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac 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. -*|$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" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. 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 $1 != '--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, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; 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-end: "$" # End: gpp4-1.3.1/config/ltversion.m40000644000175100017510000000127711513050652013052 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. # Generated from ltversion.in. # serial 3017 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.2.6b]) m4_define([LT_PACKAGE_REVISION], [1.3017]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.2.6b' macro_revision='1.3017' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) gpp4-1.3.1/config/ltsugar.m40000644000175100017510000001042411513050652012500 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 ]) gpp4-1.3.1/config/ltmain.sh0000755000175100017510000073341511513050652012414 00000000000000# Generated from ltmain.m4sh. # ltmain.sh (GNU libtool) 2.2.6b # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 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 # --tag=TAG use configuration variables from tag TAG # -v, --verbose print informational messages (default) # --version print version information # -h, --help print short or long 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. # 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.2.6b Debian-2.2.6b-2ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . PROGRAM=ltmain.sh PACKAGE=libtool VERSION="2.2.6b Debian-2.2.6b-2ubuntu1" TIMESTAMP="" package_revision=1.3017 # 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 # NLS nuisances: We save the old values to restore during execute mode. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). 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 $lt_unset CDPATH : ${CP="cp -f"} : ${ECHO="echo"} : ${EGREP="/bin/grep -E"} : ${FGREP="/bin/grep -F"} : ${GREP="/bin/grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="/bin/sed"} : ${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_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 "X${1}" | $Xsed -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 "X${1}" | $Xsed -e "$basename"` } # Generated shell functions inserted here. # 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" # The name of this program: # In the unlikely event $progname began with a '-', it would play havoc with # func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result case $progname in -*) progname=./$progname ;; esac # 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=: 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' # 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${mode+: }$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_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname${mode+: }$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 "X$my_directory_path" | $Xsed -e "$dirname"` done my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e '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 "X$my_tmpdir" | $Xsed } # 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 "X$1" | $Xsed -e "$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 "X$1" | $Xsed \ -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_version # Echo version message to standard output and exit. func_version () { $SED -n '/^# '$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 () { $SED -n '/^# Usage:/,/# -h/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" $ECHO $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help # Echo long help message to standard output and exit. func_help () { $SED -n '/^# Usage:/,/# Report bugs to/ { 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 --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p }' < "$progpath" exit $? } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { func_error "missing argument for $1" exit_cmd=exit } exit_cmd=: # Check that we have a working $ECHO. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then # Yippee, $ECHO works! : else # Restart under the correct shell, and then maybe $ECHO will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </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 } # Parse options once, thoroughly. This comes as soon as possible in # the script to make things like `libtool --version' happen quickly. { # 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 # Parse non-mode specific arguments: while test "$#" -gt 0; do opt="$1" shift case $opt in --config) func_config ;; --debug) preserve_args="$preserve_args $opt" func_echo "enabling shell trace mode" opt_debug='set -x' $opt_debug ;; -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break execute_dlfiles="$execute_dlfiles $1" shift ;; --dry-run | -n) opt_dry_run=: ;; --features) func_features ;; --finish) mode="finish" ;; --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break case $1 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 mode="$1" shift ;; --preserve-dup-deps) opt_duplicate_deps=: ;; --quiet|--silent) preserve_args="$preserve_args $opt" opt_silent=: ;; --verbose| -v) preserve_args="$preserve_args $opt" opt_silent=false ;; --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break preserve_args="$preserve_args $opt $1" func_enable_tag "$1" # tagname is set here shift ;; # Separate optargs to long options: -dlopen=*|--mode=*|--tag=*) func_opt_split "$opt" set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} shift ;; -\?|-h) func_usage ;; --help) opt_help=: ;; --version) func_version ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) nonopt="$opt" break ;; esac done 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_duplicate_deps ;; esac # Having warned about all mis-specified options, bail out if # anything was wrong. $exit_cmd $EXIT_FAILURE } # 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 } ## ----------- ## ## Main. ## ## ----------- ## $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 test -z "$mode" && func_fatal_error "error: you must specify a MODE." # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$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=$mode' for more information." } # 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_ltwrapper_scriptname_result="" if func_ltwrapper_executable_p "$1"; then func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" fi } # 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_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_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done 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 "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; # 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_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case "$@ " in " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) # 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 <?"'"'"' &()|`$[]' \ && 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 "X$srcfile" | $Xsed -e 's%^.*/%%' -e '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 removelist="$removelist $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist removelist="$removelist $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi 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 command="$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 command="$command -o $obj" fi # Suppress compiler output if we already did a PIC compilation. command="$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 "$mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $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 building PIC objects only -prefer-non-pic try to building 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 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 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 -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 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 \`$mode'" ;; esac $ECHO $ECHO "Try \`$progname --help' for more information about other modes." exit $? } # Now that we've collected a possible --mode arg, show help if necessary $opt_help && func_mode_help # 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 $execute_dlfiles; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) # 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 dir="$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 -*) ;; *) # 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_quote_for_eval "$file" args="$args $func_quote_for_eval_result" 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 "$mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done 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" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS $ECHO "X----------------------------------------------------------------------" | $Xsed $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 "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS } test "$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. $ECHO "X$nonopt" | $GREP shtool >/dev/null; 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" install_prog="$install_prog$func_quote_for_eval_result" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" install_prog="$install_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 -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. staticlibs="$staticlibs $file" ;; *.la) # 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 "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -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 "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "X$relink_command" | $Xsed -e "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_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" && staticlibs="$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 "X$lib" | $Xsed -e '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 "X$relink_command" | $Xsed -e '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 "X$file$stripped_ext" | $Xsed -e "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_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $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 "$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 /* 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 "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for progfile in $progfiles; do func_verbose "extracting global C symbols from \`$progfile'" $opt_dry_run || eval "$NM $progfile | $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" $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" } 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; " case $host in *cygwin* | *mingw* | *cegcc* ) $ECHO >> "$output_objdir/$my_dlsyms" "\ /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */" lt_dlsym_const= ;; *osf5*) echo >> "$output_objdir/$my_dlsyms" "\ /* This system does not cope well with relocations in const data */" lt_dlsym_const= ;; *) lt_dlsym_const=const ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ 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) ;; *) symtab_cflags="$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 "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "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 "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "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. 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 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | $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_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' 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 | $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 | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper_part1 [arg=no] # # Emit the first part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part1 () { func_emit_wrapper_part1_arg1=no if test -n "$1" ; then func_emit_wrapper_part1_arg1=$1 fi $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. Xsed='${SED} -e 1s/^X//' 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 ECHO=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then # Yippee, \$ECHO works! : else # Restart under the correct shell, and then maybe \$ECHO will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $ECHO "\ # Find the directory that this script lives in. thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e '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 \"X\$file\" | \$Xsed -e '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 \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done " } # end: func_emit_wrapper_part1 # func_emit_wrapper_part2 [arg=no] # # Emit the second part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part2 () { func_emit_wrapper_part2_arg1=no if test -n "$1" ; then func_emit_wrapper_part2_arg1=$1 fi $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_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 \"X\$thisdir\" | \$Xsed -e '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" # 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 \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 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\ " } # end: func_emit_wrapper_part2 # 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=no if test -n "$1" ; then func_emit_wrapper_arg1=$1 fi # split this up so that func_emit_cwrapperexe_src # can call each part independently. func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" } # func_to_host_path arg # # Convert paths to host format when used with build tools. # Intended for use with "native" mingw (where libtool itself # is running under the msys shell), or in the following cross- # build environments: # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # where wine is equipped with the `winepath' executable. # In the native mingw case, the (msys) shell automatically # converts paths for any non-msys applications it launches, # but that facility isn't available from inside the cwrapper. # Similar accommodations are necessary for $host mingw and # $build cygwin. Calling this function does no harm for other # $host/$build combinations not listed above. # # ARG is the path (on $build) that should be converted to # the proper representation for $host. The result is stored # in $func_to_host_path_result. func_to_host_path () { func_to_host_path_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' case $build in *mingw* ) # actually, msys # awkward: cmd appends spaces to result lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_path_tmp1=`( cmd //c echo "$1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_path_tmp1=`cygpath -w "$1"` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # Unfortunately, winepath does not exit with a non-zero # error code, so we are forced to check the contents of # stdout. On the other hand, if the command is not # found, the shell will set an exit code of 127 and print # *an error message* to stdout. So we must check for both # error code of zero AND non-empty stdout, which explains # the odd construction: func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` else # Allow warning below. func_to_host_path_result="" fi ;; esac if test -z "$func_to_host_path_result" ; then func_error "Could not determine host path corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_path_result="$1" fi ;; esac fi } # end: func_to_host_path # func_to_host_pathlist arg # # Convert pathlists to host format when used with build tools. # See func_to_host_path(), above. This function supports the # following $build/$host combinations (but does no harm for # combinations not listed here): # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # # 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. # # ARG is a pathlist (on $build) that should be converted to # the proper representation on $host. The result is stored # in $func_to_host_pathlist_result. func_to_host_pathlist () { func_to_host_pathlist_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # 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_to_host_pathlist_tmp2="$1" # Once set for this call, this variable should not be # reassigned. It is used in tha fallback case. func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e 's|^:*||' -e 's|:*$||'` case $build in *mingw* ) # Actually, msys. # Awkward: cmd appends spaces to result. lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # unfortunately, winepath doesn't convert pathlists func_to_host_pathlist_result="" func_to_host_pathlist_oldIFS=$IFS IFS=: for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do IFS=$func_to_host_pathlist_oldIFS if test -n "$func_to_host_pathlist_f" ; then func_to_host_path "$func_to_host_pathlist_f" if test -n "$func_to_host_path_result" ; then if test -z "$func_to_host_pathlist_result" ; then func_to_host_pathlist_result="$func_to_host_path_result" else func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" fi fi fi IFS=: done IFS=$func_to_host_pathlist_oldIFS ;; esac if test -z "$func_to_host_pathlist_result" ; then func_error "Could not determine the host path(s) corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This may break if $1 contains DOS-style drive # specifications. The fix is not to complicate the expression # below, but for the user to provide a working wine installation # with winepath so that path translation in the cross-to-mingw # case works properly. lt_replace_pathsep_nix_to_dos="s|:|;|g" func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_replace_pathsep_nix_to_dos"` fi # Now, add the leading and trailing path separators back case "$1" in :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" ;; esac case "$1" in *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" ;; esac ;; esac fi } # end: func_to_host_pathlist # 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 # define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include # define HAVE_SETENV # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif # endif #endif #include #include #include #include #include #include #include #include #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 #ifdef _MSC_VER # define S_IXUSR _S_IEXEC # define stat _stat # ifndef _INTPTR_T_DEFINED # define intptr_t int # endif #endif #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 */ #ifdef __CYGWIN__ # define FOPEN_WB "wb" #endif #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) #undef LTWRAPPER_DEBUGPRINTF #if defined DEBUGWRAPPER # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args static void ltwrapper_debugprintf (const char *fmt, ...) { va_list args; va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } #else # define LTWRAPPER_DEBUGPRINTF(args) #endif const char *program_name = NULL; 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_fatal (const char *message, ...); 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_opt_process_env_set (const char *arg); void lt_opt_process_env_prepend (const char *arg); void lt_opt_process_env_append (const char *arg); int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); static const char *script_text_part1 = EOF func_emit_wrapper_part1 yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ "/' -e 's/$/\\n"/' echo ";" cat <"))); for (i = 0; i < newargc; i++) { LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); } EOF case $host_os in mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); return 127; } return rval; EOF ;; *) cat <<"EOF" execv (lt_argv_zero, newargz); return rval; /* =127, but avoids unused variable warning */ EOF ;; esac cat <<"EOF" } void * xmalloc (size_t num) { void *p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char) name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable (const char *path) { struct stat st; LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 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; LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); 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; LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); 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 ("getcwd failed"); 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 ("getcwd failed"); 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) { LTWRAPPER_DEBUGPRINTF (("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 { char *errstr = strerror (errno); lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal ("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; } static void lt_error_core (int exit_status, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } void lt_setenv (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", (name ? name : ""), (value ? 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; } int lt_split_name_value (const char *arg, char** name, char** value) { const char *p; int len; if (!arg || !*arg) return 1; p = strchr (arg, (int)'='); if (!p) return 1; *value = xstrdup (++p); len = strlen (arg) - strlen (*value); *name = XMALLOC (char, len); strncpy (*name, arg, len-1); (*name)[len - 1] = '\0'; return 0; } void lt_opt_process_env_set (const char *arg) { char *name = NULL; char *value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); } lt_setenv (name, value); XFREE (name); XFREE (value); } void lt_opt_process_env_prepend (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); } new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_opt_process_env_append (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); } new_value = lt_extend_str (getenv (name), value, 1); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_update_exe_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? 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) { LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? 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 } # end: func_emit_cwrapperexe_src # 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 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 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 dlfiles="$dlfiles $arg" else dlprefiles="$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 "*) ;; *) deplibs="$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 # moreargs="$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 dlfiles="$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. dlprefiles="$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 "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) weak_libs="$weak_libs $arg" prev= continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$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 ;; -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 ;; # 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" dir=$func_stripname_result if test -z "$dir"; 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 # 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 "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) # 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 deplibs="$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 deplibs="$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) compiler_flags="$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) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) new_inherited_linker_flags="$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_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$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" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$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" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" linker_flags="$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" ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -F/path gives path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" compiler_flags="$compiler_flags $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. objs="$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 dlfiles="$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. dlprefiles="$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. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" 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 \"X\${$shlibpath_var}\" \| \$Xsed -e \'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" # 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_duplicate_deps ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$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 "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$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%" test "X$link_all_deplibs" != Xno && libs="$libs $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= case $lib in *.la) func_source "$lib" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` case " $weak_libs " in *" $deplib_base "*) ;; *) deplibs="$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) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -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 "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_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" newlib_search_path="$newlib_search_path $func_stripname_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" dir=$func_stripname_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$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 \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; 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. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$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 "X$inherited_linker_flags" | $Xsed -e '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 "*) ;; *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e '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" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$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. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done 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. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$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 "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$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 notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$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 # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$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" && \ dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi 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 newlib_search_path="$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" newlib_search_path="$newlib_search_path $func_stripname_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_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$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:"*) ;; *) temp_rpath="$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 "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$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 notinst_deplibs="$notinst_deplibs $lib" need_relink=no ;; *) if test "$installed" = no; then notinst_deplibs="$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 "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$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 "$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$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$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:"*) ;; *) compile_shlibpath="$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:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$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:"*) ;; *) finalize_shlibpath="$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 [\\/]*) add_dir="$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 "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$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" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" 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_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 compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" linker_flags="$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 "X $new_inherited_linker_flags" | $Xsed -e '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 "*) ;; *) lib_search_path="$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 "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$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 tmp_libs="$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" objs="$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!" libobjs="$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 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|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 ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; 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) 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. verstring="$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" libobjs="$libobjs $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$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 removelist="$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 oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "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 temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$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 "*) ;; *) dlfiles="$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 "*) ;; *) dlprefiles="$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*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$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 deplibs="$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` 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 "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$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. newdeplibs="$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 "*) newdeplibs="$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 \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$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. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ -e 's/ -lc$//' -e '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 "X $tmp_deplibs" | $Xsed -e "s,$i,,"` done fi if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | $GREP . >/dev/null; then $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 fi ;; 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 "X $newdeplibs" | $Xsed -e '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 "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO "X $deplibs" | $Xsed -e '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 "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$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 if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$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 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"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$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" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$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 "$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 linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$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" delfiles="$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 cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" func_len " $cmd" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then func_show_eval "$cmd" 'exit $?' 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 "X$include_expsyms" | $Xsed | $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 delfiles="$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 "*) ;; *) tmp_deplibs="$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" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$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\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$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 output_la=`$ECHO "X$output" | $Xsed -e "$basename"` # 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 $ECHO "$obj" >> $output done $ECHO ')' >> $output delfiles="$delfiles $output" 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 $ECHO "$obj" >> $output done delfiles="$delfiles $output" output=$firstobj\"$file_list_spec$output\" 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. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$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~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi delfiles="$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 "$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 "X$include_expsyms" | $Xsed | $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 delfiles="$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" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles libobjs="$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 "$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 "$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 "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$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 "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e '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]) compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e '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 "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$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 "*) ;; *) finalize_rpath="$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"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$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;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$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"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$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 "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$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 *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *cegcc) # Disable wrappers for cegcc, we are cross compiling anyway. wrappers_required=no ;; *) 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 "X$compile_command" | $Xsed -e '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=$?' # 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 rpath="$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 rpath="$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 "X$link_command" | $Xsed -e '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 $?' 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 "X$compile_var$compile_command$compile_rpath" | $Xsed -e '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 "X$link_command" | $Xsed -e '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 $?' # 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 "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $ECHO for shipping. if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$ECHO "X$ECHO" | $Xsed -e "$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 oldobjs="$oldobjs $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$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" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles oldobjs="$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" generated="$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" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi 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 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 "X$relink_command" | $Xsed -e "$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" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$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" newdlfiles="$newdlfiles $libdir/$name" ;; *) newdlfiles="$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" newdlprefiles="$newdlprefiles $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 newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; 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 "$mode" = link || test "$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) RM="$RM $arg"; rmforce=yes ;; -*) RM="$RM $arg" ;; *) files="$files $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then objdir="$origobjdir" else objdir="$dir/$origobjdir" fi func_basename "$file" name="$func_basename_result" test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; 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 rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${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 rmfiles="$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 rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$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 rmfiles="$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 rmfiles="$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 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done objdir="$origobjdir" # 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 "$mode" = uninstall || test "$mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$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 gpp4-1.3.1/config/install-sh0000755000175100017510000003246411251205616012572 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2006-12-25.00 # 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 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 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 trap '(exit $?); exit' 1 2 13 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 starting with `-'. 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 # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # 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-writeable 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 -z "$d" && 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-end: "$" # End: gpp4-1.3.1/config/libtool.m40000644000175100017510000077464711513050652012513 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 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 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 56 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_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 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 "X$cc_temp" | $Xsed -e 's%.*/%%' -e "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 _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_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])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 _LT_PROG_ECHO_BACKSLASH 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 # Sed substitution that helps us do robust quoting. It backslashifies # 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' # 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_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 "X$][$1" | $Xsed -e "$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 "X$" | $Xsed -e "$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' # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$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 "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\[$]0 --fallback-echo"')dnl " lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` ;; esac _LT_OUTPUT_LIBTOOL_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]) cat >"$CONFIG_LT" <<_LTEOF #! $SHELL # Generated by $as_me. # Run this file to recreate a libtool stub with the current configuration. lt_cl_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 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) 2008 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. if test "$no_create" != yes; then 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) fi ])# 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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_XSI_SHELLFNS sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) 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)], [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 # _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([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)]) 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], []) # _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 test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 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" ]) 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" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # 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 _LT_TAGVAR(whole_archive_flag_spec, $1)='' _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=echo _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 # ----------------------- # 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. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' 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 "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. m4_defun([_LT_PROG_ECHO_BACKSLASH], [_LT_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac ECHO=${lt_ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF [$]* _LT_EOF exit 0 fi # 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 if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(lt_ECHO) ]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that does not interpret backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _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 __oline__ "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 ;; sparc*-*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*) LD="${LD-ld} -m elf64_sparc" ;; *) 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_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [AC_CHECK_TOOL(AR, ar, false) test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1]) 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 \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _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_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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/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; ;; 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 ;; 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"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$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 __oline__ "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 void fnord() { int i=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; /* 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:__oline__: $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:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 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 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # 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 -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # 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; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` 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 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 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=`$ECHO "X$lib" | $Xsed -e '\''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 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,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) 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="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. 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 ;; 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 ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # 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 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 ;; freebsd1*) dynamic_linker=no ;; 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[[123]]*) 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 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 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' ;; interix[[3-9]]*) version_type=linux 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 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 Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux 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 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], [shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir # 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;/^$/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' ;; netbsdelf*-gnu) version_type=linux 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='NetBSD ld.elf_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 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 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 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 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 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 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([], [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 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 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' 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 ;; 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]) 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 Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) 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_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_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. AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) 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:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: $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:__oline__: 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_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-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 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' _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([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};"\ " /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 # 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 #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. */ 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_save_LIBS="$LIBS" lt_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_save_LIBS" CFLAGS="$lt_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 _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_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)= AC_MSG_CHECKING([for $compiler option to produce PIC]) 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)= ;; 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 ;; 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*) # IBM XL 8.0 on PPC _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* | netbsdelf*-gnu) ;; *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*) # 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' ;; 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 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' ;; pgcc* | pgf77* | pgf90* | pgf95*) # 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*) # IBM XL C 8.0/Fortran 10.1 on PPC _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)='-Wl,' ;; *Sun\ F*) # 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)='' ;; 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*) _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_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # 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]) # # 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_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' 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 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")) && ([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*) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ 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_flag_spec_ld, $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 ;; linux* | k*bsd*-gnu) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = 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.9.1, 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 modify your PATH *** so that a non-GNU linker is found, and then restart. _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(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/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' 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 ;; 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= 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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # 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; $ECHO \"$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]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; 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; $ECHO \"$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*) # 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)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_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 $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) 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 $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' 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 $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 ;; 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 $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 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 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")) && ([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 _LT_TAGVAR(link_all_deplibs, $1)=no 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 _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; 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 _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' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _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. _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 `$ECHO "X$deplibs" | $Xsed -e '\''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(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; 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 ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $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 -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 -fPIC ${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 -a "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${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_flag_spec_ld, $1)='+b $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 -a "$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 -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${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' ;; *) _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 $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE(int foo(void) {}, _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ) LDFLAGS="$save_LDFLAGS" else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -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" && $ECHO "X-set_version $verstring" | $Xsed` -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* | netbsdelf*-gnu) 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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -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 ${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 ${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_MSG_CHECKING([whether -lc should be explicitly linked in]) $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_TAGVAR(archive_cmds_need_lc, $1)=no else _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* AC_MSG_RESULT([$_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_flag_spec_ld], [1], [[If ld is used when linking, 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([], [fix_srcfile_path], [1], [Fix the shell variable $srcfile for the compiler]) _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([], [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_PROG_CXX # ------------ # Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ # compiler, we have our own version here. m4_defun([_LT_PROG_CXX], [ pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) AC_PROG_CXX 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 popdef([AC_MSG_ERROR]) ])# _LT_PROG_CXX dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_CXX], []) # _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], [AC_REQUIRE([_LT_PROG_CXX])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl 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_flag_spec_ld, $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(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_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++"} 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 -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -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 "\-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 _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; 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 _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' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _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*) # _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(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 ;; 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 ;; freebsd[[12]]*) # 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*) ;; 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; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${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; $ECHO "X$list" | $Xsed' ;; *) 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 -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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 -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -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; $ECHO "X$list" | $Xsed' _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 | $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 | $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 | $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 | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 will 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; $ECHO \"$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=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; xl*) # 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; $ECHO \"$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='echo' # 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=echo 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" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -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=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) 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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${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 "\-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*) # 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='echo' # 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 -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 -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 "\-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 "\-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(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 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_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 # 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 ]) 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 $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 else prev= fi if test "$pre_test_object_deps_done" = no; then case $p 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 ;; *.$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 # 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*) # 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_PROG_F77 # ------------ # Since AC_PROG_F77 is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_F77], [ pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) AC_PROG_F77 if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_F77 dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_F77], []) # _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_REQUIRE([_LT_PROG_F77])dnl AC_LANG_PUSH(Fortran 77) _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_flag_spec_ld, $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(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 CC=${F77-"f77"} 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" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_PROG_FC # ----------- # Since AC_PROG_FC is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_FC], [ pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) AC_PROG_FC if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_FC dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_FC], []) # _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_REQUIRE([_LT_PROG_FC])dnl AC_LANG_PUSH(Fortran) _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_flag_spec_ld, $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(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 CC=${FC-"f95"} 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" 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_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} 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 ## 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" ])# _LT_LANG_GCJ_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_GCC=$GCC GCC= CC=${RC-"windres"} 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" ])# _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_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_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"}, \ = c,a/b,, \ && 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_XSI_SHELLFNS # --------------------- # Bourne and XSI compatible variants of some useful shell functions. m4_defun([_LT_PROG_XSI_SHELLFNS], [case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # 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 () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # 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 () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # 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_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}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $[*] )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # 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 () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -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 file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } dnl func_dirname_and_basename dnl A portable version of this function is already defined in general.m4sh dnl so there is no need for it here. # 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 "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[[^=]]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$[@]"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]+=\$[2]" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]=\$$[1]\$[2]" } _LT_EOF ;; esac ]) gpp4-1.3.1/config/missing0000755000175100017510000002557711251205616012174 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # 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 run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] 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 # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: gpp4-1.3.1/NEWS0000644000175100017510000000343611507207102010011 000000000000002010-12-28 Morten Kjeldgaard * The C library can now be built on its own without having to also compile the Fortran API. This is done by passing the --without-fortran-api switch to configure. 2010-01-25 Morten Kjeldgaard * Incorporate patches to the library from ccp4-6.1.3. This is a minor bug fix. Bump version to 1.2.1. 2009-10-01 Morten Kjeldgaard * Version 1.2.0 of ggp4 released via launchpad.net The current version is on par with the CCP4 library version 6.1.2. The most important new feature is that gpp4 now supports the CCP4 library's FORTRAN API. This means that the programs REFMAC (version 5.6.0031) and MOSFLM (version 7.0.6), both of which are distributed by their authors on an individual release-schedule, can be built with gpp4, without the need for downloading and installing the entire CCP4 suite (~230 Mb). The size of the gpp4 tarball is 686 Kb. The gpp4 library is available via the software repository mechanisms of some Linux distributions (Ubuntu and Fedora) and for OSX via Fink. The gpp4 library's FORTRAN API requires installation of Eugene Krissinel's mmdb library. On the aforementioned distributions this is installed automatically as a dependency. 2008-12-03 Morten Kjeldgaard * Because the library from CCP4 version 6.1.0 is again LGPL'ed the (limited) changes from that version have been merged into gpp4 v. 1.1. The differences between gpp4 and the mother library is mostly in the documentation and some parts that make gpp4 standalone. 2007-07-05 Morten Kjeldgaard * Version 1.0 of gpp4 now builds and installs correctly with the autotools. Now it's time for testing. Local variables: mode: change-log mode: font-lock End: gpp4-1.3.1/Makefile.in0000644000175100017510000006151111526170231011360 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ 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@ @WANT_GPP4F_TRUE@am__append_1 = src_f @WANT_GPP4F_TRUE@am__append_2 = gpp4f.pc subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Doxyfile.in \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/gpp4.info.in $(srcdir)/gpp4.pc.in \ $(srcdir)/gpp4.spec.in $(srcdir)/gpp4f.pc.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ config/README config/config.guess config/config.sub \ config/depcomp config/install-sh config/ltmain.sh \ config/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/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_CLEAN_FILES = gpp4.pc gpp4f.pc gpp4.spec gpp4.info Doxyfile CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive 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__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = src test data src_f DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ 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@ FLIBS = @FLIBS@ GPP4_PREFIX = @GPP4_PREFIX@ 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@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MMDB_CFLAGS = @MMDB_CFLAGS@ MMDB_LIBS = @MMDB_LIBS@ 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@ PKG_CONFIG = @PKG_CONFIG@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WANT_GPP4F = @WANT_GPP4F@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ 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@ lt_ECHO = @lt_ECHO@ 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 config pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gpp4.pc $(am__append_2) # Also distribute these files: EXTRA_DIST = bootstrap README gpp4.pc.in gpp4f.pc.in gpp4.spec.in \ gpp4.info.in COPYRIGHT Doxyfile.in gpp4.m4 # Build in these directories SUBDIRS = src test data $(am__append_1) DISTCLEANFILES = gpp4.info gpp4.spec gpp4.pc gpp4f.pc Doxyfile all: all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(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: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): gpp4.pc: $(top_builddir)/config.status $(srcdir)/gpp4.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ gpp4f.pc: $(top_builddir)/config.status $(srcdir)/gpp4f.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ gpp4.spec: $(top_builddir)/config.status $(srcdir)/gpp4.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ gpp4.info: $(top_builddir)/config.status $(srcdir)/gpp4.info.in cd $(top_builddir) && $(SHELL) ./config.status $@ Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ 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|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || 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__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__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.lzma*) \ lzma -dc $(distdir).tar.lzma | $(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 a+w $(distdir) mkdir $(distdir)/_build mkdir $(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" \ $(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__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: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { 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: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: 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) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-pkgconfigDATA #### # 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: gpp4-1.3.1/configure.ac0000644000175100017510000000421511526170075011605 00000000000000# -*- mode: Autoconf; mode: font-lock -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT(gpp4, 1.3.1, mok@bioxray.dk) AC_CONFIG_SRCDIR([src/ccp4_vars.h]) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_MACRO_DIR([config]) AM_INIT_AUTOMAKE # check base installations AC_PROG_CC AC_PROG_CPP AC_PROG_F77 AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_LIBTOOL AC_F77_LIBRARY_LDFLAGS # check for libm AC_CHECK_LIBM AC_SUBST(LIBM) AC_CHECK_LIB(m, sin) # check for std c headers AC_HEADER_STDC([]) # check for various headers AC_CHECK_HEADERS([fcntl.h float.h limits.h stddef.h stdlib.h stdint.h string.h sys/file.h sys/stat.h unistd.h wchar.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_STRUCT_TM # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_REALLOC AC_FUNC_SETVBUF_REVERSED AC_FUNC_STRTOD AC_FUNC_VPRINTF # check for various c library functions AC_CHECK_FUNCS([strnlen memmove memset mkdir pow putenv rint setenv sqrt strchr strdup strerror strrchr strstr strlcpy]) # check for mmdb PKG_CHECK_MODULES(MMDB, mmdb >= 1.19) AC_SUBST(MMDB_CFLAGS) AC_SUBST(MMDB_LIBS) # gpp4 wants to know its prefix test "x$prefix" = xNONE && prefix=$ac_default_prefix AC_DEFINE_UNQUOTED([GPP4_PREFIX],["$prefix"],[Base directory of gpp4 installation]) GPP4_PREFIX=$prefix AC_SUBST(GPP4_PREFIX) dnl The next section provides logic to allow user to disable the dnl building of the Fortran API. AC_ARG_WITH([fortran-api], [AS_HELP_STRING([--without-fortran-api], [disable building of the Fortran library gpp4f])], [], [with_fortran_api=yes]) # Define an automake conditional: AM_CONDITIONAL([WANT_GPP4F],[test "x$with_fortran_api" = "xyes"]) # Define an autoconf substitution: if test "x$with_fortran_api" = "xyes"; then WANT_GPP4F=1 else WANT_GPP4F=0 fi AC_SUBST(WANT_GPP4F) dnl end of fortran-api selection dnl output the Makefiles AC_CONFIG_FILES([ Makefile gpp4.pc gpp4f.pc gpp4.spec gpp4.info Doxyfile src/Makefile src_f/Makefile data/Makefile test/Makefile src/ccp4_program.h ]) AC_OUTPUT #### gpp4-1.3.1/gpp4.info.in0000644000175100017510000000451111251203037011440 00000000000000 Package: @PACKAGE_NAME@ Version: @VERSION@ Revision: 1 Maintainer: Morten Kjeldgaard Description: Library providing CCP4 functionality License: LGPL Source: ftp://ftp.bioxray.au.dk/pub/mok/src/gpp4-%v.tar.gz Source-MD5: 48931781425a5b79a8255ebefaed24b3 NoSourceDirectory: false Depends: %N-shlibs (= %v-%r) BuildDependsOnly: true HomePage: http://www.bioxray.dk/~mok/gpp4 DocFiles: README AUTHORS NEWS COPYING DescDetail: << 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. The library contains several subcomponents: * CMTZ library -- Contains 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. * CMAP library -- Functions defining the C-level API for accessing CCP4 map files. * CSYM library -- a collection of functions centred around a data file syminfo.lib which is auto-generated from sgtbx (the Space Group Toolbox of cctbx). * CCP4 utility library -- many utility functions which either give specific CCP4 or platform independent functionality. * CCP4 Parser library -- provides CCP4-style parsing, as used for processing keywords of CCP4 programs, MTZ header records, etc. * CCP4 resizable arrays -- defines an object and methods which looks just like a simple C array, but can be resized at will without incurring excessive overheads. << CompileScript: << ./configure --prefix=%p make << InstallScript: << make install DESTDIR=%d << SplitOff: << Package: %N-shlibs Files: << lib/libgpp4.dylib lib/libgpp4.0.dylib lib/libgpp4.0.0.0.dylib << Shlibs: << %p/lib/libgpp4.dylib 1.0.0 %n (>= @VERSION@-1) %p/lib/libgpp4.0.dylib 1.0.0 %n (>= @VERSION@-1) %p/lib/libgpp4.0.0.0.dylib 1.0.0 %n (>= @VERSION@-1) << << SplitOff2: << Package: %N-dev BuildDependsOnly: True Files: << lib/*.a lib/*.la include/gpp4/ccp4/*.h share/gpp4/default.def share/gpp4/environ.def share/gpp4/syminfo.lib << << ####