Skip to content

Commit

Permalink
Avoid compiler warnings about implicit function declarations.
Browse files Browse the repository at this point in the history
Include header that declares functions from the UMFPACK library before
using them. Add path to that header to the preprocessor flags.
Also keep similar order of linker flags independent of whether the
bundled or an external UMFPACK library is used.

This warning is elevated to an error in LLVM Clang 18 (with default
compiler flags).
  • Loading branch information
mmuetzel authored and tzwinger committed Jul 15, 2024
1 parent dbf539a commit 99abe68
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 7 additions & 6 deletions fem/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,18 +179,19 @@ ENDIF()
# ElmerSolver libraries
IF(UMFPACK_FOUND)
SET(ELMERSOLVER_LIBRARIES matc fhuti binio arpack
${UMFPACK_LIBRARIES}
${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}
${UMFPACK_LIBRARIES}
${CMAKE_DL_LIBS})
INCLUDE_DIRECTORIES(${UMFPACK_INCLUDE_DIR})

TARGET_INCLUDE_DIRECTORIES(elmersolver PRIVATE ${UMFPACK_INCLUDE_DIR})
#LIST(APPEND ELMERSOLVER_LIBRARIES ${UMFPACK_LIBRARIES})
#TARGET_LINK_LIBRARIES(elmersolver "${UMFPACK_LIBRARIES}")
ELSE()
SET(ELMERSOLVER_LIBRARIES matc umfpack
amd fhuti binio arpack
${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}
SET(ELMERSOLVER_LIBRARIES matc fhuti binio arpack
umfpack amd
${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}
${CMAKE_DL_LIBS})
TARGET_INCLUDE_DIRECTORIES(elmersolver PRIVATE ${PROJECT_SOURCE_DIR}/umfpack/src/umfpack/include)
ENDIF()

IF(WITH_LUA)
Expand Down
2 changes: 2 additions & 0 deletions fem/src/umf4_f77wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@

#include "../config.h"

#include "umfpack.h"

#ifdef NULL
#undef NULL
#endif
Expand Down

0 comments on commit 99abe68

Please sign in to comment.