NCBI BLAST toolkit compile option

I try to compile NCBI BLAST C toolkit on a machine

uname -and Motif libraries installed.
Linux c2 2.6.5-7.286_lustre.1.6.4.3smp #1 SMP Sun Feb 17 09:45:12 EST 2008 x86_64 x86_64 x86_64 GNU/Linux

the default compiler with NCBI for linux64 is gcc. The compiling process stops in the middle and spins off the following error message

pgcc -O3 -c -I…/include -I/usr/X11R6/include -L/usr/X11R6/lib64 -L/usr/X11R6/lib -DWIN_MOTIF ncbi_heapmgr.c
PGC-F-0249-#error – “Don’t know how to pack on this 64-bit platform” (ncbi_heapmgr.c: 136)
PGC/x86-64 Linux 7.2-1: compilation aborted
make: *** [ncbi_heapmgr.o] Error 2

basically there is no definition for “HEAP_PACKED” for this particular platform. Any one has the same problem before; how should I fix it?

Hi xu_ying,

I’ve never compiled this code myself, but when I look at the source code where this error occurs I see the following:

#ifdef NCBI_OS_LINUX
#  if NCBI_PLATFORM_BITS == 64
#     ifdef __GNUC__
#       define HEAP_PACKED  __attribute__ ((packed))
#     else
#       error "Don't know how to pack on this 64-bit platform"
#     endif
#  else
#     define HEAP_PACKED /* */
#  endif
#else
#  define HEAP_PACKED /* */
#endif

/* Heap's own block view */
typedef struct HEAP_PACKED {
    SHEAP_Block head;         /* Block head                                  */
    TNCBI_Size  prevfree;     /* Heap index for prev free block (if free)    */
    TNCBI_Size  nextfree;     /* Heap index for next free block (if free)    */
} SHEAP_HeapBlock;

So basically, the code chokes unless your using gcc. You can modify the code as follows to get it to compile.

#ifdef NCBI_OS_LINUX
#  if NCBI_PLATFORM_BITS == 64
#     ifdef __GNUC__
#       define HEAP_PACKED  __attribute__ ((packed))
#     else
#       define HEAP_PACKED  
#     endif
#  else
#     define HEAP_PACKED /* */
#  endif
#else
#  define HEAP_PACKED /* */
#endif

/* Heap's own block view */
typedef struct HEAP_PACKED {
    SHEAP_Block head;         /* Block head                                  */
    TNCBI_Size  prevfree;     /* Heap index for prev free block (if free)    */
    TNCBI_Size  nextfree;     /* Heap index for next free block (if free)    */
} SHEAP_HeapBlock;

Though I don’t know what impact this will have nor if any more of the code contains these GNU specific extensions.

  • Mat