Skip to content

Commit

Permalink
Merge pull request #1103 from LLNL/bugfix/kweiss/axom-export
Browse files Browse the repository at this point in the history
Some bugfixes for axom's installation
  • Loading branch information
kennyweiss committed May 30, 2023
2 parents 1ae02ac + 91b9d33 commit 8eca639
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/axom/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ foreach(_component ${AXOM_COMPONENTS_ENABLED})
set(_export_header ${PROJECT_BINARY_DIR}/include/axom/export/${_component}.h)
generate_export_header( ${_component}
PREFIX_NAME AXOM_
EXPORT_FILE_NAME ${_export_header}
)

EXPORT_FILE_NAME ${_export_header})
install(FILES ${_export_header}
DESTINATION include/axom/export )
endforeach()

#------------------------------------------------------------------------------
Expand Down
4 changes: 0 additions & 4 deletions src/axom/multimat/examples/calculate_gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ void avgDensityCompactFlat(mmat::MultiMat& mm)
{
axom::fmt::print("Running average density compact - flat\n");
int ncells = mm.getNumberOfCells();
int nmats = mm.getNumberOfMaterials();

auto* relationSet = mm.getSparse2dFieldSet(mmat::DataLayout::CELL_DOM);
int nthreads = relationSet->totalSize();
Expand All @@ -134,7 +133,6 @@ void avgDensityCompactFlat(mmat::MultiMat& mm)
nthreads,
AXOM_LAMBDA(int flatid) {
int cell_id = relationSet->flatToFirstIndex(flatid);
int mat_id = relationSet->flatToSecondIndex(flatid);

double density_avg_slot = density[flatid] * vf[flatid];

Expand All @@ -153,7 +151,6 @@ void avgDensityCompactSubmap(mmat::MultiMat& mm)
{
axom::fmt::print("Running average density compact - submap\n");
int ncells = mm.getNumberOfCells();
int nmats = mm.getNumberOfMaterials();

const auto density = mm.getSparse2dField<double>("Densityfrac");
const auto vf = mm.getSparse2dField<double>("Volfrac");
Expand Down Expand Up @@ -241,7 +238,6 @@ void avgDensityIter(mmat::MultiMat& mm)
{
axom::fmt::print("Running average density - iterators\n");
int ncells = mm.getNumberOfCells();
int nmats = mm.getNumberOfMaterials();

const auto density = mm.getDense2dField<double>("Densityfrac");
const auto vf = mm.getDense2dField<double>("Volfrac");
Expand Down
2 changes: 1 addition & 1 deletion src/axom/multimat/examples/helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct Value_Checker
}
else
{
if(values.size() != vec.size())
if(static_cast<axom::IndexType>(values.size()) != vec.size())
{
SLIC_ERROR(
axom::fmt::format("Sizes of arrays are different. 'values' has {} "
Expand Down
2 changes: 1 addition & 1 deletion src/axom/multimat/examples/traversal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void various_traversal_methods(int nmats,
axom::Array<double> cellmat_arr;
cellmat_arr.resize((use_sparse ? nfilled : nmats * ncells) * ncomp);
double x_sum = 0;
for(unsigned int i = 0; i < cellmat_arr.size() / ncomp; i++)
for(axom::IndexType i = 0; i < cellmat_arr.size() / ncomp; i++)
{
if(use_sparse || cellMatRel[i])
{
Expand Down
4 changes: 2 additions & 2 deletions src/axom/multimat/multimat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ int MultiMat::getFieldIdx(const std::string& field_name) const

std::string MultiMat::getFieldName(int field_idx) const
{
if(field_idx < 0 || field_idx >= m_fieldNameVec.size())
if(field_idx < 0 || field_idx >= static_cast<int>(m_fieldNameVec.size()))
{
return "";
}
Expand Down Expand Up @@ -832,7 +832,7 @@ void MultiMat::makeOtherRelation(DataLayout layout)

//add them to make this the end index
{
unsigned int i;
axom::IndexType i;
for(i = 1; i < newBeginVec.size() - 1; i++)
{
newBeginVec[i] += newBeginVec[i - 1];
Expand Down
3 changes: 2 additions & 1 deletion src/cmake/axom-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ if(NOT AXOM_FOUND)
foreach(_component ${AXOM_COMPONENTS_ENABLED})
set_property(TARGET axom
PROPERTY INTERFACE_LINK_LIBRARIES
axom::${_component})
axom::${_component}
APPEND)
endforeach()

# HACK: Clear INTERFACE_COMPILE_OPTIONS to avoid requiring OpenMP in user code
Expand Down
8 changes: 8 additions & 0 deletions src/examples/using-with-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ if(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE)
${BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE})
endif()

# HACK: Define the `mpi` target as an alias to `axom::mpi` if/when necessary
# Details: An axom dependency has a link dependency to `mpi`, but it might
# not be a target. Need to mark axom::mpi as global to use it for an alias.
if(NOT TARGET mpi AND TARGET axom::mpi)
set_target_properties(axom::mpi PROPERTIES IMPORTED_GLOBAL TRUE)
add_library(mpi ALIAS axom::mpi)
endif()

#------------------------------------------------------------------------------
# Set up example target that depends on axom
#------------------------------------------------------------------------------
Expand Down

0 comments on commit 8eca639

Please sign in to comment.