Skip to content

Commit

Permalink
Squashed 'src/externals/pio2/' changes from 1ff0f44..602f71c
Browse files Browse the repository at this point in the history
602f71c Merge pull request #1688 from NCAR/ejh_more_summary
3601aea clean up
0ff7f7b added new feature settings to pio_meta.h
0900126 added netCDF-4 and netcdf-4 par to list of features in summary
dfc908e Merge pull request #1685 from NCAR/ejh_fix_summary
9789048 updated summary
cdb24f5 fixed libpio for autotools builds with fortran info, added FCFLAGS
903fc75 Merge pull request #1683 from NCAR/ejh_cmake_2
addb05c adding cmake build
7074cf9 adding cmake build
2928d62 adding cmake build
94efbbe adding cmake build
6da9b11 adding cmake build
7b2f0d1 Merge pull request #1680 from NCAR/ejh_fix_test
3f10bbc ok, dial back on docs for now
4ed34f5 ok, dial back on docs for now
17c71cf Merge branch 'master' into ejh_fix_test
cb4ea89 Merge pull request #1673 from jedwards4b/jedwards/cmake_piolibsettings
e773963 still trying docs
f515008 now trying docs as well
ef28e9b now trying docs as well
047e557 Merge branch 'master' into jedwards/cmake_piolibsettings
353031d trying to get env vars working
f501ad2 fixed yml error
8e011fc change to trigger CI
aa8bdb5 change to trigger CI
72186bb Merge pull request #1679 from NCAR/ejh_add_strict_workflow
253eb90 commented out running of test_darray_multivar3.c
fbf9c3a commented out running of test_darray_multivar3.c
c856445 Merge branch 'master' into ejh_add_strict_workflow
a23f256 commented out running of test_darray_multivar3.c
1c70406 Merge branch 'master' into jedwards/cmake_piolibsettings
6400614 one more fix
d51d7b9 additional output from cmake
391f720 Merge pull request #1671 from jedwards4b/jedwards/rec_var_fix
aec3413 uncommenting much of the commented code in test_darray_multivar3
11a9ad5 cleanup, update pnetcdf lib
79b4b02 try again
531882a add space
266e040 append not prepend
41dc2c9 removed extra make invokation
34059c6 turned on asan for C
aabe4ec try again
3e5dd3d turned off asan
96b25f9 try updating travis script
1dd31fd adding strict autotools github actions workflow
ca3b8c2 add test to Makefile.am
39d9ae1 dont compare what you dont know
df2c37a Merge branch 'jedwards/cmake_piolibsettings' of github.com:jedwards4b/ParallelIO into jedwards/cmake_piolibsettings
e66c8f4 add debug print for travis
5e2a76f add a test
03335ff remove PLOG
8d293ab Merge branch 'jedwards/rec_var_fix' of github.com:jedwards4b/ParallelIO into jedwards/rec_var_fix
9bc0a8a conditional plog
1e3330a Merge branch 'master' into jedwards/rec_var_fix
fb0d63d Merge branch 'master' into jedwards/cmake_piolibsettings
5d3d0ff Merge pull request #1674 from NCAR/ejh_test_ci_2
0c1d343 renamed builds to avoid confusion
73d2b8b removed extra build to avoid confusion
0b92d3b change to trigger CI
dda3ba4 backout change for travis test
5dc5719 improve libpio settings output from cmake
f6ad7c5 fix initialization of var rec_var
2bd7f60 Merge pull request #1668 from NCAR/edwardhartnett-patch-2
3b6bbe3 Create master_netcdf.yml
53b2a79 Merge pull request #1666 from NCAR/ejh_error
f2a2e63 added pio_error.c to Makefile.am
9816c7e merged in bugfix/gcc10-multiple-definitions
e6d4a15 Merge pull request #1665 from NCAR/ejh_pio_next
e4f5c01 fixed comments
2ad546c fixed version in cmake output of pio_meta.h
5246b64 fixing szip write flag again!
9224d77 fixing version numbers again!
8444d38 fixing version in cmake builds
b90d6c5 change for CI
d64a09a Reorder dependencies and add pioc for pio_tutil target
cfb02eb Fix parallel build failures for make check by adding dependencies and compiling fortran modules only once.
1533e32 Add missing headers
893b2de Fix multiple definition errors with GCC>=10.1.0 by seperating definitions from declarations
c8a0245 Merge pull request #1659 from NCAR/ejh_summary
2f3daaf Merge branch 'master' into ejh_summary
c3e2839 Merge pull request #1661 from NCAR/ejh_actions
1454560 working on GitHub actions build
5244094 Merge pull request #1660 from NCAR/edwardhartnett-patch-1
38ca1b0 Create c-cpp.yml
804e05a getting pio_meta.h working in CMake
d8bff5c add pio_meta.h.in
87bf3fd add pio_meta.h.in
f536ece add pio_meta.h.in
9fce7ef add pio_meta.h.in
3c6b51d more work on build summary
24a6b6b working on build summary
25923f3 further development of build summary
da613e5 adding libpio.settings.in
cdf9704 added *.F90.in to gitignore
9316d5c add libpio.settings.in
cb5342d Merge pull request #1657 from NCAR/ejh_25
4445b0f fixed cmake version number
ba330d4 updated version numbers
aeefa82 Merge pull request #1656 from NCAR/ejh_doc_fixes
69e4178 updated docs with feeback from Jim
7bc20b4 fixed documentation errors
35b513e fixed documentation errors
58e255c Merge pull request #1655 from NCAR/ejh_release
599e32f updated libtool release numbers
e1fa7f7 changed version numbers

git-subtree-dir: src/externals/pio2
git-subtree-split: 602f71c
  • Loading branch information
jedwards4b committed Jul 31, 2020
1 parent c295eb3 commit 631c158
Show file tree
Hide file tree
Showing 31 changed files with 1,186 additions and 185 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/autotools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: autotools

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

env:
CC: mpicc
FC: mpifort
CPPFLAGS: "-I/usr/include -I/usr/local/include"
# CFLAGS: "-std=c99 -fsanitize=address -fno-omit-frame-pointer -Werror"
# FFLAGS: "-fsanitize=address -fno-omit-frame-pointer"
# FCFLAGS: "-fsanitize=address -fno-omit-frame-pointer -Werror"

steps:
- uses: actions/checkout@v2
- name: Installs
run: |
sudo apt-get install netcdf-bin libnetcdf-dev doxygen graphviz wget gfortran libjpeg-dev libz-dev openmpi-bin libopenmpi-dev
- name: pnetcdf build
run: |
wget https://parallel-netcdf.github.io/Release/pnetcdf-1.11.0.tar.gz
tar -xzvf pnetcdf-1.11.0.tar.gz
ls -l
pushd pnetcdf-1.11.0
./configure --prefix=/usr --enable-shared
make
sudo make install
popd
- name: autoreconf
run: autoreconf -i
- name: configure
run: ./configure
- name: make distcheck
run: make distcheck
44 changes: 44 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: cmake

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

env:
CC: mpicc
FC: mpifort
CPPFLAGS: "-I/usr/include -I/usr/local/include"

steps:
- uses: actions/checkout@v2
- name: Installs
run: |
sudo apt-get install netcdf-bin libnetcdf-dev doxygen graphviz wget gfortran libjpeg-dev libz-dev openmpi-bin libopenmpi-dev
- name: pnetcdf build
run: |
wget https://parallel-netcdf.github.io/Release/pnetcdf-1.12.1.tar.gz
tar -xzvf pnetcdf-1.12.1.tar.gz
ls -l
pushd pnetcdf-1.12.1
./configure --prefix=/usr --enable-shared --disable-cxx
make
sudo make install
popd
- name: cmake build
run: |
find /usr -name libnetcdf.so
mkdir build
cd build
cmake -Wno-dev -DNetCDF_C_LIBRARY=/usr/lib/x86_64-linux-gnu/libnetcdf.so -DNetCDF_C_INCLUDE_DIR=/usr/include -DCMAKE_PREFIX_PATH=/usr -DPIO_HDF5_LOGGING=On -DPIO_USE_MALLOC=On -DPIO_ENABLE_LOGGING=On -DPIO_ENABLE_TIMING=Off ..
make VERBOSE=1
make tests VERBOSE=1
ctest -VV
47 changes: 47 additions & 0 deletions .github/workflows/strict_autotools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: strict_autotools

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

env:
CC: mpicc
FC: mpifort
CPPFLAGS: "-I/usr/include -I/usr/local/include"

steps:
- uses: actions/checkout@v2
- name: Installs
run: |
sudo apt-get install netcdf-bin libnetcdf-dev doxygen graphviz wget gfortran libjpeg-dev libz-dev openmpi-bin libopenmpi-dev
- name: pnetcdf build
run: |
wget https://parallel-netcdf.github.io/Release/pnetcdf-1.12.1.tar.gz
tar -xzvf pnetcdf-1.12.1.tar.gz
ls -l
pushd pnetcdf-1.12.1
./configure --prefix=/usr --enable-shared --disable-cxx
make
sudo make install
popd
- name: autoreconf
run: autoreconf -i
- name: configure
run: |
export CFLAGS="-std=c99 -fsanitize=address -fno-omit-frame-pointer -Werror"
export FFLAGS="-fsanitize=address -fno-omit-frame-pointer -Werror"
export FCFLAGS="-fsanitize=address -fno-omit-frame-pointer -Werror"
./configure
- name: make -j distcheck
run: |
export DISTCHECK_CONFIGURE_FLAGS="--enable-fortran"
make -j distcheck
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ html/
*~
\#*\#
*.o
*.in
Makefile.in
*.F90.in
*.lo
*.la
Makefile
Expand Down
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ before_script:
- export CC=mpicc
- export FC=mpif90
- export CPPFLAGS='-I/usr/include'
- wget https://parallel-netcdf.github.io/Release/pnetcdf-1.11.0.tar.gz
- tar -xzvf pnetcdf-1.11.0.tar.gz
- wget https://parallel-netcdf.github.io/Release/pnetcdf-1.12.1.tar.gz
- tar -xzvf pnetcdf-1.12.1.tar.gz
- ls -l
- pushd pnetcdf-1.11.0
- pushd pnetcdf-1.12.1
- ./configure --prefix=/usr --enable-shared
- make
- sudo make install
Expand All @@ -38,7 +38,7 @@ env:
- CPPFLAGS='-I/usr/include'
- CFLAGS='-std=c99'
- LDFLAGS='-L/usr/lib'

script:
- autoreconf -i
- export CFLAGS='-std=c99 -fsanitize=address -fno-omit-frame-pointer -Werror'
Expand All @@ -54,4 +54,4 @@ script:
- cmake -DPIO_HDF5_LOGGING=On -DPIO_USE_MALLOC=On -DPIO_ENABLE_LOGGING=On -DPIO_ENABLE_TIMING=Off ..
- make VERBOSE=1
- make tests VERBOSE=1
- make test VERBOSE=1
- ctest -VV
186 changes: 185 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,64 @@ project (PIO C Fortran)
# The project version number.
set(VERSION_MAJOR 2 CACHE STRING "Project major version number.")
set(VERSION_MINOR 5 CACHE STRING "Project minor version number.")
set(VERSION_PATCH 0 CACHE STRING "Project patch version number.")
set(VERSION_PATCH 1 CACHE STRING "Project patch version number.")
mark_as_advanced(VERSION_MAJOR VERSION_MINOR VERSION_PATCH)

# Create version info in autotools parlance for pio_meta.h.
set(PIO_VERSION_MAJOR ${VERSION_MAJOR})
set(PIO_VERSION_MINOR ${VERSION_MINOR})
set(PIO_VERSION_PATCH ${VERSION_PATCH})

# This is needed for the libpio.settings file.
SET(PACKAGE_VERSION ${PIO_VERSION_MAJOR}.${PIO_VERSION_MINOR}.${PIO_VERSION_PATCH})

# Determine the configure date.
IF(DEFINED ENV{SOURCE_DATE_EPOCH})
EXECUTE_PROCESS(
COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}"
OUTPUT_VARIABLE CONFIG_DATE
)
ELSE()
EXECUTE_PROCESS(
COMMAND date
OUTPUT_VARIABLE CONFIG_DATE
)
ENDIF()
IF(CONFIG_DATE)
string(STRIP ${CONFIG_DATE} CONFIG_DATE)
ENDIF()

# A function used to create autotools-style 'yes/no' definitions.
# If a variable is set, it 'yes' is returned. Otherwise, 'no' is
# returned.
#
# Also creates a version of the ret_val prepended with 'NC',
# when feature is true, which is used to generate netcdf_meta.h.
FUNCTION(is_enabled feature ret_val)
IF(${feature})
SET(${ret_val} "yes" PARENT_SCOPE)
SET("PIO_${ret_val}" 1 PARENT_SCOPE)
ELSE()
SET(${ret_val} "no" PARENT_SCOPE)
SET("PIO_${ret_val}" 0 PARENT_SCOPE)
ENDIF(${feature})
ENDFUNCTION()

# A function used to create autotools-style 'yes/no' definitions.
# If a variable is set, it 'yes' is returned. Otherwise, 'no' is
# returned.
#
# Also creates a version of the ret_val prepended with 'NC',
# when feature is true, which is used to generate netcdf_meta.h.
FUNCTION(is_disabled feature ret_val)
IF(${feature})
SET(${ret_val} "no" PARENT_SCOPE)
ELSE()
SET(${ret_val} "yes" PARENT_SCOPE)
SET("PIO_${ret_val}" 1 PARENT_SCOPE)
ENDIF(${feature})
ENDFUNCTION()

# The size of the data buffer for write/read_darray().
set(PIO_BUFFER_SIZE 134217728)

Expand Down Expand Up @@ -188,6 +243,7 @@ add_subdirectory (src)

# Custom "piotests" target (builds the test executables)
add_custom_target (tests)
add_dependencies (tests pioc piof)

# Custom "check" target that depends upon "tests"
add_custom_target (check COMMAND ${CMAKE_CTEST_COMMAND})
Expand All @@ -207,3 +263,131 @@ endif ()
if (PIO_ENABLE_DOC)
add_subdirectory (doc)
endif ()

# Include this so we can check values in netcdf_meta.h.
INCLUDE(CheckCSourceCompiles)
INCLUDE(FindNetCDF)
find_package (NetCDF REQUIRED)
find_package (PnetCDF)


SET(STATUS_PNETCDF PnetCDF_C_FOUND)

###
# Check to see if netcdf-4 capability is present in netcdf-c.
###
CHECK_C_SOURCE_COMPILES("
#include <netcdf_meta.h>
#if !NC_HAS_NC4
choke me
#endif
int main() {return 0;}" HAVE_NETCDF4)

###
# Check to see if netcdf-4 parallel I/O capability is present in
# netcdf-c. (Really we should be checking NC_HAS_PARALLEL4, but that
# was only recently introduced, so we will go with NC_HAS_PARALLEL.)
###
CHECK_C_SOURCE_COMPILES("
#include <netcdf_meta.h>
#if !NC_HAS_PARALLEL
choke me
#endif
int main() {return 0;}" HAVE_NETCDF_PAR)

###
# Check to see if szip write capability is present in netcdf-c.
###
SET(CMAKE_REQUIRED_INCLUDES ${NetCDF_C_INCLUDE_DIR})
CHECK_C_SOURCE_COMPILES("
#include <netcdf_meta.h>
#if !NC_HAS_SZIP_WRITE
choke me
#endif
int main() {return 0;}" HAVE_SZIP_WRITE)

###
# Check to see if parallel filters are supported by HDF5/netcdf-c.
###
CHECK_C_SOURCE_COMPILES("
#include <netcdf_meta.h>
#if !NC_HAS_PAR_FILTERS
choke me
#endif
int main() {return 0;}" HDF5_HAS_PAR_FILTERS)

#####
# Configure and print the libpio.settings file.
#####

# Get system configuration, Use it to determine osname, os release, cpu. These
# will be used when committing to CDash.
find_program(UNAME NAMES uname)
IF(UNAME)
macro(getuname name flag)
exec_program("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}")
endmacro(getuname)
getuname(osname -s)
getuname(osrel -r)
getuname(cpu -m)
set(TMP_BUILDNAME "${osname}-${osrel}-${cpu}")
ENDIF()

# Set
SET(prefix ${CMAKE_INSTALL_PREFIX})
SET(exec_prefix ${CMAKE_INSTALL_PREFIX})
SET(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
SET(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
SET(CC ${CMAKE_C_COMPILER})

# Set variables to mirror those used by autoconf.
# This way we don't need to maintain two separate template
# files.
SET(host_cpu "${cpu}")
SET(host_vendor "${osname}")
SET(host_os "${osrel}")
SET(abs_top_builddir "${CMAKE_CURRENT_BINARY_DIR}")
SET(abs_top_srcdir "${CMAKE_CURRENT_SOURCE_DIR}")

SET(CC_VERSION "${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}")
SET(FC_VERSION "${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION}")
# Build *FLAGS for libpio.settings. (CFLAGS, CPPFLAGS, FFLAGS promoted from src)
SET(LDFLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE}}")

is_disabled(BUILD_SHARED_LIBS enable_static)
is_enabled(BUILD_SHARED_LIBS enable_shared)

is_enabled(USE_SZIP HAS_SZIP_WRITE)
is_enabled(STATUS_PNETCDF HAS_PNETCDF)
is_enabled(HAVE_H5Z_SZIP HAS_SZLIB)
is_enabled(HDF5_HAS_PAR_FILTERS HAS_PAR_FILTERS)
is_enabled(HAVE_NETCDF4 HAS_NETCDF4)
is_enabled(HAVE_NETCDF_PAR HAS_NETCDF4_PAR)

# Generate file from template.
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/libpio.settings.in"
"${CMAKE_CURRENT_BINARY_DIR}/libpio.settings"
@ONLY)

# Read in settings file, print out.
# Avoid using system-specific calls so that this
# might also work on Windows.
FILE(READ "${CMAKE_CURRENT_BINARY_DIR}/libpio.settings"
LIBPIO_SETTINGS)
MESSAGE(STATUS ${LIBPIO_SETTINGS})

# Install libpio.settings file into same location
# as the libraries.
INSTALL(FILES "${PIO_BINARY_DIR}/libpio.settings"
DESTINATION lib
COMPONENT libraries)

#####
# Create pio_meta.h include file.
#####
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/src/clib/pio_meta.h.in
${CMAKE_CURRENT_SOURCE_DIR}/src/clib/pio_meta.h @ONLY)

FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/src/clib/pio_meta.h
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src/clib/)
5 changes: 4 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ if BUILD_DOCS
DOC = doc
endif

# Build in each of these subdirs.
SUBDIRS = src tests examples ${DOC} scripts cmake

EXTRA_DIST = CMakeLists.txt set_flags.am COPYRIGHT cmake_config.h.in
# Add these files to the distribution.
EXTRA_DIST = CMakeLists.txt set_flags.am COPYRIGHT cmake_config.h.in \
libpio.settings.in
Loading

0 comments on commit 631c158

Please sign in to comment.