From 9f8e44551068b831f96b2f15523d12b03fd07d31 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 4 Dec 2018 10:13:49 -0700 Subject: CGNS: Add option for 64-bit integers (#9990) * CGNS: Add option for 64-bit integers Added the `int64` variant which will build the library using 64-bit integers for certain values. This gives the capability to have models with more than 2 billion cells and/or nodes. Beginning with CGNS-3.1.0, two new typedef variables have been introduced to support 64-bit mode. The `cglong_t` typedef is always a 64-bit integer, and `cgsize_t` will be either a 32-bit or 64-bit integer depending on how the library was built. Many of the C functions in the MLL have been changed to to use `cgsize_t` instead of `int` in the arguments. These functions include any that may exceed the 2Gb limit of an` int`, e.g. zone dimensions, element data, boundary conditions, and connectivity. In Fortran, all integer data is taken to be `integer*4` for 32-bit and `integer*8` for 64-bit builds. --- var/spack/repos/builtin/packages/cgns/package.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/cgns/package.py b/var/spack/repos/builtin/packages/cgns/package.py index e101f84c27..7a21848e6b 100644 --- a/var/spack/repos/builtin/packages/cgns/package.py +++ b/var/spack/repos/builtin/packages/cgns/package.py @@ -21,6 +21,7 @@ class Cgns(CMakePackage): variant('fortran', default=False, description='Enable Fortran interface') variant('scoping', default=True, description='Enable scoping') variant('mpi', default=True, description='Enable parallel cgns') + variant('int64', default=False, description='Build with 64-bit integers') depends_on('hdf5', when='+hdf5~mpi') depends_on('hdf5+mpi', when='+hdf5+mpi') @@ -48,6 +49,10 @@ class Cgns(CMakePackage): '-DCMAKE_Fortran_COMPILER=%s' % spec['mpi'].mpifc ]) + options.append( + '-DCGNS_ENABLE_64BIT:BOOL={0}'.format( + 'ON' if '+int64' in spec else 'OFF')) + if '+hdf5' in spec: options.extend([ '-DCGNS_ENABLE_HDF5:BOOL=ON', -- cgit v1.2.3-60-g2f50