Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rpath variables to cmake build #1968

Merged
merged 4 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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