[Insight-developers] 64 bit build detection

kent williams norman-k-williams at uiowa.edu
Thu Jun 11 13:51:31 EDT 2009


Interesting question. Looking at what we do (and that's based on what Slicer
does) the difference between 64 and 32 bit comes about in how we set the
CFLAGS and CXXFLAGS before we run CMake -- we don't tell CMake anything
about whether it's 32 or 64 bit.

I don't remember seeing anything about CMake telling you whether you're 32
or 64bit. As a last ditch effort you could try to run a program that uses
the current CFLAGS and returns the size of a pointer e.g.

int main() { exit(sizeof(void *) == 4 ? 32 : 64 ); }


On 6/11/09 11:50 AM, "Gaëtan Lehmann" <gaetan.lehmann at jouy.inra.fr> wrote:

> 
> Hi,
> 
> I need to know if, with the compiler option provided by the user, or
> the default configuration of the system, the build produce 64 bit
> binaries.
> I can't see any obvious way to find that.
> 
> I need it (at least) to run java tests with the -d64 parameters, and
> to add a /64 to the install path on opensolaris.
> 
> Thanks,
> 
> Gaëtan



More information about the Insight-developers mailing list