Skip to content

Commit

Permalink
Merge pull request #1968 from jedwards4b/add_rpath
Browse files Browse the repository at this point in the history
add rpath variables to cmake build
  • Loading branch information
jedwards4b committed Aug 16, 2023
2 parents 05e4284 + 3d3a2f5 commit 96a7d73
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -469,12 +469,16 @@ FILE(READ "${CMAKE_CURRENT_BINARY_DIR}/libpio.settings"
LIBPIO_SETTINGS)
MESSAGE(STATUS ${LIBPIO_SETTINGS})

# Set RPATH for shared libraries
set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")

# 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.
#####
Expand Down
6 changes: 4 additions & 2 deletions src/clib/pio_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
#include <limits.h>
#include <math.h>
#include <netcdf.h>
#ifdef _NETCDF4
#include <netcdf_par.h>
#ifdef PIO_HAS_PAR_FILTERS
#include <netcdf_filter.h>
#include <netcdf_meta.h>
#endif
#ifdef _NETCDF4
#include <netcdf_par.h>
#endif
#ifdef _PNETCDF
#include <pnetcdf.h>
#endif
Expand Down
6 changes: 3 additions & 3 deletions tests/performance/pioperformance.F90
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ subroutine pioperformancetest(filename, piotypes, mype, npe_base, &
integer(kind=PIO_Offset_kind) :: maplen, gmaplen
integer :: ndims
integer, pointer :: gdims(:)
character(len=20) :: fname
character(len=24) :: fname
type(var_desc_t) :: vari(nvars), varr(nvars), vard(nvars)
type(iosystem_desc_t) :: iosystem
integer :: stride, n
Expand Down Expand Up @@ -266,7 +266,7 @@ subroutine pioperformancetest(filename, piotypes, mype, npe_base, &

call pio_init(mype, comm, ntasks, 0, stride, PIO_REARR_SUBSET, iosystem)

write(fname, '(a,i1,a,i4.4,a,i1,a)') 'pioperf.',rearr,'-',ntasks,'-',k,'.nc'
write(fname, '(a,i1,a,i6.6,a,i1,a)') 'pioperf.',rearr,'-',ntasks,'-',iotype,'.nc'

call PIO_set_hint(iosystem, "nc_var_align_size", "1")

Expand Down Expand Up @@ -379,7 +379,7 @@ subroutine pioperformancetest(filename, piotypes, mype, npe_base, &
! Now the Read
#ifdef DOREAD

write(fname, '(a,i1,a,i4.4,a,i1,a)') 'pioperf.',rearr,'-',ntasks,'-',iotype,'.nc'
write(fname, '(a,i1,a,i6.6,a,i1,a)') 'pioperf.',rearr,'-',ntasks,'-',iotype,'.nc'

ierr = PIO_OpenFile(iosystem, File, iotype, trim(fname), mode=PIO_NOWRITE);
do nv=1,nvars
Expand Down

0 comments on commit 96a7d73

Please sign in to comment.