[Llvm-bgq-discuss] Compiling apps on Cetus with clang

Hal Finkel hfinkel at anl.gov
Fri Oct 10 14:31:26 CDT 2014


----- Original Message -----
> From: "Mark Abraham" <mark.j.abraham at gmail.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "Sebastien Boisvert" <boisvert at anl.gov>, llvm-bgq-discuss at lists.alcf.anl.gov
> Sent: Friday, October 10, 2014 2:27:35 PM
> Subject: Re: [Llvm-bgq-discuss] Compiling apps on Cetus with clang
> 
> 
> Hi,
> 
> 
> I used
> https://github.com/gromacs/gromacs/blob/release-5-0/src/gromacs/gmxlib/network.c#L205
> in Gromacs, without apparent ill effect

Ah, thanks! For the benefit of our mailing-list archive, he did this:

#ifdef __clang__
/* IBM's declaration of this function in
 * /bgsys/drivers/V1R2M2/ppc64/spi/include/kernel/process.h
 * erroneously fails to specify __INLINE__, despite
 * /bgsys/drivers/V1R2M2/ppc64/spi/include/kernel/cnk/process_impl.h
 * specifiying __INLINE__, so bgclang thinks they are different enough
 * to complain about. */
static uint64_t Kernel_GetJobID();
#endif

#include <spi/include/kernel/location.h>

 -Hal

> 
> 
> Mark
> 
> 
> On Fri, Oct 10, 2014 at 9:13 PM, Hal Finkel < hfinkel at anl.gov >
> wrote:
> 
> 
> Hi,
> 
> Unfortunately, this is a known problem (and is already part of a
> Clang-compatibility PMR with IBM).
> 
> The problem really is not what is in compiler_support.h, but the fact
> that the declaration in process.h is missing __INLINE__ (if you'll
> notice, all of the other declarations have them). What I've done
> previously is to create a local copy of process.h, add the
> __INLINE__ and then put that file in my include path ahead of the
> real one.
> 
> I should really create a proper system-wide work-around for this, but
> I've not yet.
> 
> -Hal
> 
> 
> 
> ----- Original Message -----
> > From: "Sebastien Boisvert" < boisvert at anl.gov >
> > To: llvm-bgq-discuss at lists.alcf.anl.gov
> > Sent: Friday, October 10, 2014 2:09:35 PM
> > Subject: [Llvm-bgq-discuss] Compiling apps on Cetus with clang
> > 
> > 
> > 
> > I have set +mpiwrapper-bgclang in my ~/.soft
> > 
> > Then I ran 'resoft'.
> > 
> > My build script is:
> > 
> > [boisvert at cetuslac1 biosal]$ cat
> > scripts/IBM_Blue_Gene_Q/build-spate-clang.sh
> > #!/bin/bash
> > 
> > # on Cetus:
> > # 1. edit ~/.soft
> > # 2. run 'resoft'
> > 
> > CFLAGS="-I. -g -O3 -DTHORIUM_DEBUG "
> > CFLAGS="$CFLAGS -I/soft/libraries/alcf/current/xl/ZLIB/include"
> > LDFLAGS="-L/soft/libraries/alcf/current/xl/ZLIB/lib -lm -lz"
> > 
> > make clean
> > make -j 8 CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" \
> > applications/spate_metagenome_assembler/spate
> > 
> > 
> > I am getting this error:
> > 
> > 
> > 
> > 
> > 
> > Clang 3.6.0
> > "clang version 3.6.0 (trunk)"
> > CFLAGS="-I. -g -O3 -DTHORIUM_DEBUG "
> > 
> > /bgsys/drivers/V1R2M2/ppc64/spi/include/kernel/cnk/process_impl.h:132:10:
> > error: static declaration of 'Kernel_GetJobID' follows non-static
> > declaration
> > 
> > 
> > Obviously, I am not the author of process_impl.h.
> > 
> > The line 132 is:
> > 
> > __INLINE__
> > uint64_t Kernel_GetJobID()
> > {
> > return CNK_SPI_SYSCALL_0(GETJOBID);
> > }
> > 
> > 
> > The file /bgsys/drivers/V1R2M2/ppc64/spi/include/kernel/process.h
> > contains the prototype:
> > 
> > /*! \brief Returns the JobID of the currently active job
> > *
> > * \return job identifier
> > */
> > uint64_t Kernel_GetJobID();
> > 
> > 
> > I am not sure what is the problem. I suppose that it should also be
> > __INLINE__ (whatever this is) in process.h.
> > 
> > 
> > I digged a little and __INLINE__ is defined in
> > /bgsys/drivers/V1R2M2/ppc64/hwi/include/common/compiler_support.h
> > at
> > line 28:
> > 
> > #ifndef __INLINE__
> > #ifdef __llvm__
> > #define __INLINE__ static inline
> > #else
> > #define __INLINE__ extern inline __attribute__((always_inline))
> > #endif
> > #endif
> > 
> > 
> > So basically this is broken because a function can not be not
> > static
> > (in process.h) and static (process_impl.h) at the same time.
> > 
> > The obvious workaround here is to fix the broken
> > compiler_support.h.
> > 
> > 
> > 
> > Is there a (easy) of solving this (without having to re-root the
> > whole V1R2M2 tree !) ?
> > 
> > _______________________________________________
> > llvm-bgq-discuss mailing list
> > llvm-bgq-discuss at lists.alcf.anl.gov
> > https://lists.alcf.anl.gov/mailman/listinfo/llvm-bgq-discuss
> > 
> 
> --
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory
> 
> 
> _______________________________________________
> llvm-bgq-discuss mailing list
> llvm-bgq-discuss at lists.alcf.anl.gov
> https://lists.alcf.anl.gov/mailman/listinfo/llvm-bgq-discuss
> 
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory


More information about the llvm-bgq-discuss mailing list