[Imgcif-l] CBFlib_0.7.7 update to subrelease 0.7.7.4

Jon Wright wright at esrf.fr
Mon May 7 17:29:36 BST 2007


Dear Herbert,

Here are some notes for compiling with the mingw system on windows. It 
is a free gnu c compiler with "msys" bash shell.  For f90 I used the g95 
compiler ( www.g95.org ).

g95 is fussy about the inline binary constants. A diff of 
fcb_read_bits.m4 should be attached - it could easily contain errors as 
I don't really know the intentions of the code. I have just used the 
transfer intrinsic to give a matching type to use in IAND.

libmap.a is required for target 'all' in the Makefiles but my 'make' 
doesn't see how to make it. I've attached an edited makefile for this 
compiler / platform. There are some issues with "time" not existing and, 
no directories /usr/bin etc. Might be worthwhile to have a Makefile and 
then a platform dependent make.inc ? I had to change in lots of places.

My favourite windows C compiler (mingw gcc) didn't know about bzero: 
needed to add something near the top of cbf_codes.c:

#ifdef __MINGW32__
#define bzero(ptr,size) memset (ptr, 0, size);
#endif


The needed to remove the -ansi flag from the makefile as "swab" function 
is otherwise hidden by an ifdef in <string.h>.
  src/cbf_uncompressed.c:431: warning: implicit declaration of function 
`swab'

mkstemp is missing on mingw32 also (in img2cif.c etc), I have attached a 
header file implementation, but I am not sure if it works. If this is in 
the example directory then add this to img2cif.c, cif2cbf.c and 
convert_minicbf.c:

#ifdef __MINGW32__
#include "mkstemp.h"
#endif

It might be better to use tmpfile(?). /tmp exists on my system, but is 
extremely unlikely to be there in general. This change allows the 
programs to compile, but not pass the tests. It seems windows (mingw 
MSYS bash shell) does like reading or writing binary images through 
stdin or stdout. I changed the makefile to use filenames for the images. 
This means the mkstemp supplied may be no good. It might be better to 
force stdin and stdout to be binary streams in this case, as in 
(http://archives.postgresql.org/pgsql-hackers-win32/2005-01/msg00227.php)

I can investigate further if you think it is likely that windows users 
will need this functionality.

Since "time" is not a windows/dos command - I added a makefile variable 
$(TIME) which is empty for this system.

Finally, I get a slew of test failures which make me worry I got the 
fortran wrong, trimmed output from "make tests" is attached. With the 
fixes it appears to be OK apart from the map part.

I shall try to look at the python bindings again soon. Leaving tomorrow 
for the APS user meeting  for a week and then the UK for the week after.

Best wishes,

Jon




Herbert J. Bernstein wrote:
> The CBFlib release at
> 
>    http://www.bernstein-plus-sons.com/software/CBF
> 
> has been upgraded to CBFlib_0.7.7 subrelease 0.7.7.4 of 6 May 2007.
> 
> For those used to CBFlib_0.7.6.1, this is a major revision, with
> an implementation of byte offset compression, and extension of
> the packed compression, support for reading with f90 routines,
> support for 3d images, and much faster I/O.  A draft of the
> latest draft imgCIF dictionary (version 1.5.2) is included
> and can also be seen at
> 
>    http://www.bernstein-plus-sons.com/software/CBF/doc
> 
> For those who have already been using CBFlib_0.7.7, the changes
> in this version are to correct an error in the ordering of dimensions
> in some image writes, and adjust the ordering of dimension
> declarations versus the actual array declarations to work with
> more f90 compilers.  The draft dictionary has been updated
> too include the latest suggestions from the recent discussion
> on the imgcif list.
> 
> Our thanks to:
> 
>    W. Kabsch for the f90 implementation of A. Hammersley's
> byte offset compression and the initial F90 code to read
> CBFs,
>    J. P. Abrahams and CCP4 for permission to incorporate the
> logic of packed_c.c into CBFlib under the gnu open source licenses,
>    E. Eikenberry for a very fast C-implementation of byte offset
> compression and for helpful suggestions in speeding things up
> in general,
>    H. Powell for pointing out the need to reorder the F90 declarations
>    A. Hammersley and J. Wright for many helpful suggestions, especially
> with respect to beam centering and real arrays,
>    and these people and many other members of the community for testing
> and suggestions and a great deal of patience as we work though problems.
> 
>    Bug reports, comments and suggestions would be much appreciated.
> 
>    -- Herbert

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fcb_read_bits.m4.diff
Url: http://scripts.iucr.org/pipermail/imgcif-l/attachments/20070507/84ded851/attachment-0003.ksh 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.log
Url: http://scripts.iucr.org/pipermail/imgcif-l/attachments/20070507/84ded851/attachment-0004.ksh 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Makefile_mingw
Url: http://scripts.iucr.org/pipermail/imgcif-l/attachments/20070507/84ded851/attachment-0005.ksh 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mkstemp.h
Url: http://scripts.iucr.org/pipermail/imgcif-l/attachments/20070507/84ded851/attachment-0001.h 


More information about the imgcif-l mailing list