Skip to content

Commit

Permalink
Fixes for GCC-13.x and PNG configuration
Browse files Browse the repository at this point in the history
- Removed initialization list for Eigen::Tensor in favor of parameter-pack resize
- Only add PNG::PNG to target links if PNG is found
  • Loading branch information
The9Cat committed Oct 22, 2023
1 parent 4edc490 commit 22f83ce
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 16 deletions.
2 changes: 1 addition & 1 deletion coefs/BasisFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2367,7 +2367,7 @@ namespace BasisClasses
Eigen::Tensor<float, 3> ret;

try {
ret.resize({rows, 6, nout});
ret.resize(rows, 6, nout);
}
catch (const std::bad_alloc& e) {
std::cout << "BasicFactor::IntegrateOrbits: memory allocation failed: "
Expand Down
8 changes: 6 additions & 2 deletions coefs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
set(bin_PROGRAMS nativetoh5 h5compare viewcoefs h5power makecoefs testread)

set(common_LINKLIB OpenMP::OpenMP_CXX MPI::MPI_CXX PNG::PNG yaml-cpp
exputil ${VTK_LIBRARIES} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES})
set(common_LINKLIB OpenMP::OpenMP_CXX MPI::MPI_CXX yaml-cpp exputil
${VTK_LIBRARIES} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES})

if(PNG_FOUND)
list(APPEND common_LINKLIB PNG::PNG)
endif()

set(common_INCLUDE $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include/>
Expand Down
4 changes: 2 additions & 2 deletions coefs/Coefficients.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ namespace CoefClasses
int ntim = times.size();

// Resize the tensor
ret.resize({(Lmax+1)*(Lmax+2)/2, Nmax, ntim});
ret.resize((Lmax+1)*(Lmax+2)/2, Nmax, ntim);

for (int t=0; t<ntim; t++) {
auto cof = coefs[times[t]];
Expand Down Expand Up @@ -602,7 +602,7 @@ namespace CoefClasses
int ntim = times.size();

// Resize the tensor
ret.resize({Mmax+1, Nmax, ntim});
ret.resize(Mmax+1, Nmax, ntim);

for (int t=0; t<ntim; t++) {
auto cof = coefs[times[t]];
Expand Down
2 changes: 1 addition & 1 deletion coefs/FieldGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ namespace Field
//
std::map<std::string, Eigen::Tensor<float, 3>> frame;
for (auto label : labels) {
frame[label].resize({grid[0], grid[1], grid[2]});
frame[label].resize(grid[0], grid[1], grid[2]);
}

std::vector<double> del =
Expand Down
6 changes: 5 additions & 1 deletion pyEXP/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ find_package (Python3 COMPONENTS Interpreter Development)

# Default build environment
#
set(common_LINKLIB OpenMP::OpenMP_CXX MPI::MPI_CXX PNG::PNG yaml-cpp
set(common_LINKLIB OpenMP::OpenMP_CXX MPI::MPI_CXX yaml-cpp
exputil ${VTK_LIBRARIES} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES})

if(PNG_FOUND)
list(APPEND common_LINKLIB PNG::PNG)
endif()

set(common_INCLUDE $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include/>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/>
Expand Down
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ if (ENABLE_DSMC)
endif()

set(common_LINKLIB ${DSMC_LIBS} exputil expcoef OpenMP::OpenMP_CXX
MPI::MPI_CXX PNG::PNG yaml-cpp ${VTK_LIBRARIES})
MPI::MPI_CXX yaml-cpp ${VTK_LIBRARIES})

if(PNG_FOUND)
list(APPEND common_LINKLIB PNG::PNG)
endif()

if(CUDA_FOUND)
list(APPEND common_INCLUDE_DIRS ${CUDA_TOOLKIT_INCLUDE})
Expand Down
8 changes: 6 additions & 2 deletions utils/Analysis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ set(bin_PROGRAMS diskcoef halocoef diskcoef diskprof haloprof slabprof
pcatest readcoefsD readcoefsH sphprof pspxvalH pspxvalH2 pspxvalD
pspxvalD2 pspKLH pspKLD diskeof yaml_diff kdtest)

set(common_LINKLIB OpenMP::OpenMP_CXX MPI::MPI_CXX PNG::PNG yaml-cpp
exputil ${VTK_LIBRARIES} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES})
set(common_LINKLIB OpenMP::OpenMP_CXX MPI::MPI_CXX yaml-cpp exputil
${VTK_LIBRARIES} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES})

if(PNG_FOUND)
list(APPEND common_LINKLIB PNG::PNG)
endif()

if(CUDA_FOUND)
list(APPEND common_LINKLIB ${CUDA_LIBRARIES} ${CUDA_nvToolsExt_LIBRARY})
Expand Down
10 changes: 7 additions & 3 deletions utils/MSSA/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
set(bin_PROGRAMS exp_haloN disk_noise halo_noise expmssa)

set(common_LINKLIB
yaml-cpp PNG::PNG exputil ${VTK_LIBRARIES} ${EIGEN3_LIBRARIES}
${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES} ${FFTW_DOUBLE_LIB})
set(common_LINKLIB yaml-cpp exputil ${VTK_LIBRARIES}
${EIGEN3_LIBRARIES} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES}
${FFTW_DOUBLE_LIB})

if(PNG_FOUND)
list(APPEND common_LINKLIB PNG::PNG)
endif()

set(common_INCLUDE $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include/>
Expand Down
8 changes: 6 additions & 2 deletions utils/PhaseSpace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ if(HAVE_XDR)
list(APPEND bin_PROGRAMS tipstd2psp)
endif()

set(common_LINKLIB OpenMP::OpenMP_CXX MPI::MPI_CXX PNG::PNG yaml-cpp
expcoef exputil PNG::PNG ${VTK_LIBRARIES} ${HDF5_LIBRARIES})
set(common_LINKLIB OpenMP::OpenMP_CXX MPI::MPI_CXX yaml-cpp expcoef
exputil ${VTK_LIBRARIES} ${HDF5_LIBRARIES})

if(PNG_FOUND)
list(APPEND common_LINKLIB PNG::PNG)
endif()

if(CUDA_FOUND)
list(APPEND common_LINKLIB ${CUDA_LIBRARIES} ${CUDA_nvToolsExt_LIBRARY})
Expand Down
6 changes: 5 additions & 1 deletion utils/Test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@

set(bin_PROGRAMS readSL testBarrier testConfig testBessz)

set(common_LINKLIB OpenMP::OpenMP_CXX MPI::MPI_CXX PNG::PNG expcoef exputil
set(common_LINKLIB OpenMP::OpenMP_CXX MPI::MPI_CXX expcoef exputil
yaml-cpp ${VTK_LIBRARIES})

if(PNG_FOUND)
list(APPEND common_LINKLIB PNG::PNG)
endif()

set(common_INCLUDE
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include/>
Expand Down

0 comments on commit 22f83ce

Please sign in to comment.