forked from NCAR/ParallelIO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
111 lines (88 loc) · 3.7 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
## This is the autoconf file for the PIO library.
## Ed Hartnett 8/16/17
# Initialize autoconf and automake.
AC_INIT(pio, 2.3.1)
AC_CONFIG_SRCDIR(src/clib/pio_darray.c)
AM_INIT_AUTOMAKE([foreign serial-tests])
# The m4 directory holds macros for autoconf.
AC_CONFIG_MACRO_DIR([m4])
# Find and learn about the C compiler.
AC_PROG_CC
# Libtool initialisation.
AC_PROG_LIBTOOL
# Always use malloc in autotools builds.
AC_DEFINE([PIO_USE_MALLOC], [1], [use malloc for memory])
AC_MSG_CHECKING([whether a PIO_BUFFER_SIZE was specified])
AC_ARG_WITH([piobuffersize],
[AS_HELP_STRING([--with-piobuffersize=<integer>],
[Specify buffer size for PIO.])],
[PIO_BUFFER_SIZE=$with_piobuffersize], [PIO_BUFFER_SIZE=134217728])
AC_MSG_RESULT([$PIO_BUFFER_SIZE])
AC_DEFINE_UNQUOTED([PIO_BUFFER_SIZE], [$PIO_BUFFER_SIZE], [buffer size for darray data.])
# Does the user want to enable logging?
AC_MSG_CHECKING([whether debug logging is enabled])
AC_ARG_ENABLE([logging],
[AS_HELP_STRING([--enable-logging],
[enable debug logging capability (will negatively impact performance). \
This debugging feature is probably only of interest to PIO developers.])])
test "x$enable_logging" = xyes || enable_logging=no
AC_MSG_RESULT([$enable_logging])
if test "x$enable_logging" = xyes; then
AC_DEFINE([PIO_ENABLE_LOGGING], 1, [If true, turn on logging.])
fi
# NetCDF (at least classic) is required for PIO to build.
AC_DEFINE([_NETCDF], [1], [netCDF classic library available])
# Is parallel-netcdf library available?
#AC_DEFINE([_PNETCDF], [1], [parallel-netcdf library available])
# The PIO version, again.
AC_DEFINE([PIO_VERSION_MAJOR], [2], [PIO major version])
AC_DEFINE([PIO_VERSION_MINOR], [3], [PIO minor version])
AC_DEFINE([PIO_VERSION_PATCH], [1], [PIO patch version])
# ???
AC_DEFINE([CPRGNU], [1], [defined by CMake build])
# We must have MPI to build PIO.
AC_DEFINE([HAVE_MPI], [1], [defined by CMake build])
# ???
AC_DEFINE([INCLUDE_CMAKE_FCI], [1], [defined by CMake build])
# All builds are on LINUX.
AC_DEFINE([LINUX], [1], [defined by CMake build])
# Check for netCDF library.
AC_CHECK_LIB([netcdf], [nc_create], [], [AC_MSG_ERROR([Can't find or link to the netcdf library.])])
# Check for pnetcdf library.
AC_CHECK_LIB([pnetcdf], [ncmpi_create], [], [])
# If we have parallel-netcdf, then set these as well.
if test x$ac_cv_lib_pnetcdf_ncmpi_create = xyes; then
AC_DEFINE([_PNETCDF], [1], [parallel-netcdf library available])
AC_DEFINE([USE_PNETCDF_VARN], [1], [defined by CMake build])
AC_DEFINE([USE_PNETCDF_VARN_ON_READ], [1], [defined by CMake build])
fi
# Do we have a parallel build of netCDF-4?
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "netcdf_meta.h"],
[[#if !NC_HAS_PARALLEL
# error
#endif]
])], [have_netcdf_par=yes], [have_netcdf_par=no])
AC_MSG_CHECKING([whether netCDF provides parallel IO])
AC_MSG_RESULT([${have_netcdf_par}])
if test x$have_netcdf_par = xyes; then
AC_DEFINE([_NETCDF4],[1],[Does netCDF library provide netCDF-4 with parallel access])
fi
# Not working for some reason, so I will just set it...
AC_CHECK_TYPE([MPI_Offset], [], [], [#include <mpi.h>])
if test "x${ac_cv_type_MPI_Offset}" = xyes; then
AC_CHECK_SIZEOF([MPI_Offset], [], [#include <mpi.h>])
else
AC_MSG_ERROR([Unable to find type MPI_Offset in mpi.h])
fi
#AC_CHECK_SIZEOF([MPI_Offset], [], [[#include <mpi.h>]])
#AC_DEFINE([SIZEOF_MPI_OFFSET], [8], [netCDF classic library available])
# Create the config.h file.
AC_CONFIG_HEADERS([config.h])
# Create the makefiles.
AC_OUTPUT(Makefile
src/Makefile
src/clib/Makefile
tests/Makefile
tests/cunit/Makefile
examples/Makefile
examples/c/Makefile)