Skip to content

Commit

Permalink
ok, dial back on docs for now
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhartnett committed Jul 29, 2020
2 parents 4ed34f5 + 17c71cf commit 3f10bbc
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 20 deletions.
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
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,10 @@ 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}")

# Build *FLAGS for libpio.settings.
SET(CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}")
SET(CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${CMAKE_BUILD_TYPE}}")
SET(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_${CMAKE_BUILD_TYPE}}")
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)
Expand Down
5 changes: 4 additions & 1 deletion libpio.settings.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ Shared Library: @enable_shared@
Static Library: @enable_static@
Extra libraries: @LIBS@

Fortran Compiler: @FC_VERSION@
FFLAGS: @FFLAGS@
FPPFLAGS: @FPPFLAGS@

# Features
--------
PnetCDF Support: @HAS_PNETCDF@
SZIP Write Support: @HAS_SZIP_WRITE@
Parallel Filters: @HAS_PAR_FILTERS@

5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ endif ()

# Build the C library
add_subdirectory (clib)
set(CFLAGS ${CFLAGS} PARENT_SCOPE)
set(CPPFLAGS ${CPPFLAGS} PARENT_SCOPE)


# Build the Fortran library
if (PIO_ENABLE_FORTRAN)
add_subdirectory (flib)
set(FFLAGS ${FFLAGS} PARENT_SCOPE)
set(FPPFLAGS ${FPPFLAGS} PARENT_SCOPE)
endif ()
25 changes: 17 additions & 8 deletions src/clib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,13 @@ target_compile_definitions (pioc

# Compiler-specific compiler options
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
target_compile_options (pioc
PRIVATE -std=c99)
string(APPEND CMAKE_C_FLAGS " -std=c99 " )
elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "PGI")
target_compile_options (pioc
PRIVATE -c99)
string(APPEND CMAKE_C_FLAGS " -c99 ")
elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel")
target_compile_options (pioc
PRIVATE -std=c99 -debug minimal)
string(APPEND CMAKE_C_FLAGS " -std=c99 -debug minimal ")
elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
target_compile_options (pioc
PRIVATE -std=c99)
string(APPEND CMAKE_C_FLAGS " -std=c99 ")
endif()

#==============================================================================
Expand Down Expand Up @@ -161,3 +157,16 @@ CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
if (NOT ${SIZEOF_SIZE_T} EQUAL ${SIZEOF_LONG_LONG})
message (FATAL_ERROR "size_t and long long must be the same size!")
endif ()

set(CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}" PARENT_SCOPE)
get_target_property(cppdefs pioc COMPILE_DEFINITIONS)
get_target_property(includes pioc INCLUDE_DIRECTORIES)
foreach(x IN LISTS cppdefs)
string(APPEND CPPFLAGS " -D${x}")
endforeach()
foreach(x IN LISTS includes)
if (x)
string(APPEND CPPFLAGS " -I${x}")
endif()
endforeach()
set(CPPFLAGS ${CPPFLAGS} PARENT_SCOPE)
12 changes: 12 additions & 0 deletions src/flib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,15 @@ endif ()
if (NOT PnetCDF_Fortran_FOUND AND NOT NetCDF_Fortran_FOUND)
message (FATAL_ERROR "Must have PnetCDF and/or NetCDF Fortran libraries")
endif ()
set(FFLAGS ${CMAKE_Fortran_FLAGS} PARENT_SCOPE)
get_target_property(fppdefs piof COMPILE_DEFINITIONS)
get_target_property(fincludes piof INCLUDE_DIRECTORIES)
foreach(x IN LISTS fppdefs)
string(APPEND FPPFLAGS " -D${x}")
endforeach()
foreach(x IN LISTS fincludes)
if (x)
string(APPEND FPPFLAGS " -I${x}")
endif()
endforeach()
set(FPPFLAGS ${FPPFLAGS} PARENT_SCOPE)
1 change: 1 addition & 0 deletions tests/cunit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,4 @@ else ()
NUMPROCS ${AT_LEAST_FOUR_TASKS}
TIMEOUT ${DEFAULT_TEST_TIMEOUT})
endif ()
MESSAGE("CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}")

0 comments on commit 3f10bbc

Please sign in to comment.