Skip to content

Commit

Permalink
Apply pre-commmit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandanehy authored and actions-user committed Nov 27, 2023
1 parent 620c886 commit cb8ea6a
Show file tree
Hide file tree
Showing 145 changed files with 8,332 additions and 9,471 deletions.
2 changes: 1 addition & 1 deletion .gitlab/pnnl/incline.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ failure:
- .report-status
rules:
- when: on_failure


148 changes: 85 additions & 63 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,42 @@ project(ReSolve VERSION "0.1.0")

set(CMAKE_CXX_STANDARD 11)

set(PACKAGE_NAME "ReSolve")
set(PACKAGE_NAME "ReSolve")
set(PACKAGE_TARNAME "resolve")

# Prohibit in-source build
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "In-source build prohibited.")
endif()

option(RESOLVE_TEST_WITH_BSUB "Use `jsrun` instead of `mpirun` commands when running tests" OFF)
option(RESOLVE_USE_KLU "Use KLU, AMD and COLAMD libraries from SuiteSparse" ON)
option(RESOLVE_TEST_WITH_BSUB
"Use `jsrun` instead of `mpirun` commands when running tests" OFF
)
option(RESOLVE_USE_KLU "Use KLU, AMD and COLAMD libraries from SuiteSparse" ON)
option(RESOLVE_USE_CUDA "Use CUDA language and SDK" OFF)
option(RESOLVE_USE_HIP "Use HIP language and ROCm library" OFF)
option(RESOLVE_USE_HIP "Use HIP language and ROCm library" OFF)

option(RESOLVE_USE_GPU "Use GPU device for computations" OFF)
option(RESOLVE_USE_GPU "Use GPU device for computations" OFF)
mark_as_advanced(FORCE RESOLVE_USE_GPU)

option(RESOLVE_USE_DOXYGEN "Use Doxygen to generate Re::Solve documentation" ON)
set(RESOLVE_CTEST_OUTPUT_DIR ${PROJECT_BINARY_DIR} CACHE PATH "Directory where CTest outputs are saved")
set(RESOLVE_CTEST_OUTPUT_DIR
${PROJECT_BINARY_DIR}
CACHE PATH "Directory where CTest outputs are saved"
)

if(RESOLVE_USE_CUDA)
set(RESOLVE_USE_GPU ON CACHE BOOL "Using CUDA GPU!" FORCE)
set(RESOLVE_USE_GPU
ON
CACHE BOOL "Using CUDA GPU!" FORCE
)
endif()

if(RESOLVE_USE_HIP)
set(RESOLVE_USE_GPU ON CACHE BOOL "Using HIP GPU!" FORCE)
set(RESOLVE_USE_GPU
ON
CACHE BOOL "Using HIP GPU!" FORCE
)
endif()

# MacOS specific things
Expand All @@ -51,53 +62,56 @@ set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
# Add CMake sources from `cmake` dir
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

# Including clang-format cmake files to do automatic checking of formating
# TODO: Set up clang-format
#include(./cmake/clang-format)
# Including clang-format cmake files to do automatic checking of formating TODO:
# Set up clang-format include(./cmake/clang-format)

if (RESOLVE_USE_DOXYGEN)
if(RESOLVE_USE_DOXYGEN)
find_package(Doxygen)
endif()

if ( DOXYGEN_FOUND )
set( DOXYGEN_OUTPUT_DIRECTORY ./sphinx/_build/doxygen )
set( DOXYGEN_COLLABORATION_GRAPH YES )
set( DOXYGEN_EXTRACT_ALL YES )
set( DOXYGEN_CLASS_DIAGRAMS YES )
set( DOXYGEN_HIDE_UNDOC_RELATIONS NO )
set( DOXYGEN_HAVE_DOT YES )
set( DOXYGEN_CLASS_GRAPH YES )
set( DOXYGEN_CALL_GRAPH YES )
set( DOXYGEN_CALLER_GRAPH YES )
set( DOXYGEN_COLLABORATION_GRAPH YES )
set( DOXYGEN_BUILTIN_STL_SUPPORT YES )
set( DOXYGEN_EXTRACT_PRIVATE YES )
set( DOXYGEN_EXTRACT_PACKAGE YES )
set( DOXYGEN_EXTRACT_STATIC YES )
set( DOXYGEN_EXTRACT_LOCALMETHODS YES )
set( DOXYGEN_UML_LOOK YES )
set( DOXYGEN_UML_LIMIT_NUM_FIELDS 50 )
set( DOXYGEN_TEMPLATE_RELATIONS YES )
set( DOXYGEN_DOT_GRAPH_MAX_NODES 100 )
set( DOXYGEN_MAX_DOT_GRAPH_DEPTH 0 )
set( DOXYGEN_DOT_TRANSPARENT YES )
if(DOXYGEN_FOUND)
set(DOXYGEN_OUTPUT_DIRECTORY ./sphinx/_build/doxygen)
set(DOXYGEN_COLLABORATION_GRAPH YES)
set(DOXYGEN_EXTRACT_ALL YES)
set(DOXYGEN_CLASS_DIAGRAMS YES)
set(DOXYGEN_HIDE_UNDOC_RELATIONS NO)
set(DOXYGEN_HAVE_DOT YES)
set(DOXYGEN_CLASS_GRAPH YES)
set(DOXYGEN_CALL_GRAPH YES)
set(DOXYGEN_CALLER_GRAPH YES)
set(DOXYGEN_COLLABORATION_GRAPH YES)
set(DOXYGEN_BUILTIN_STL_SUPPORT YES)
set(DOXYGEN_EXTRACT_PRIVATE YES)
set(DOXYGEN_EXTRACT_PACKAGE YES)
set(DOXYGEN_EXTRACT_STATIC YES)
set(DOXYGEN_EXTRACT_LOCALMETHODS YES)
set(DOXYGEN_UML_LOOK YES)
set(DOXYGEN_UML_LIMIT_NUM_FIELDS 50)
set(DOXYGEN_TEMPLATE_RELATIONS YES)
set(DOXYGEN_DOT_GRAPH_MAX_NODES 100)
set(DOXYGEN_MAX_DOT_GRAPH_DEPTH 0)
set(DOXYGEN_DOT_TRANSPARENT YES)
set(DOXYGEN_DISABLE_INDEX NO)
set(DOXYGEN_FULL_SIDEBAR NO)
set(DOXYGEN_GENERATE_TREEVIEW YES)
set(DOXYGEN_HTML_EXTRA_STYLESHEET "./docs/doxygen/doxygen-awesome-css/doxygen-awesome.css")
set(DOXYGEN_HTML_EXTRA_STYLESHEET
"./docs/doxygen/doxygen-awesome-css/doxygen-awesome.css"
)
set(DOXYGEN_HTML_COLORSTYLE LIGHT)
doxygen_add_docs( doxygen ${RPP_PROJECT_SOURCE_DIR} )
doxygen_add_docs(doxygen ${RPP_PROJECT_SOURCE_DIR})

else()
message( "Doxygen need to be installed to generate the doxygen documentation" )
message("Doxygen need to be installed to generate the doxygen documentation")
endif()


if (RESOLVE_USE_KLU)
if(RESOLVE_USE_KLU)
include(FindKLU)
if(NOT KLU_LIBRARY)
message(STATUS "Cannot find KLU, disabling SuiteSparse module ...")
set(RESOLVE_USE_KLU OFF CACHE BOOL "Build without SuiteSparse AMD module." FORCE)
set(RESOLVE_USE_KLU
OFF
CACHE BOOL "Build without SuiteSparse AMD module." FORCE
)
endif()
else()
message(STATUS "Not using SuiteSparse KLU")
Expand All @@ -116,7 +130,10 @@ if(RESOLVE_USE_CUDA)
endif()

if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_ARCHITECTURES 60 CACHE STRING "Selects CUDA architectures")
set(CMAKE_CUDA_ARCHITECTURES
60
CACHE STRING "Selects CUDA architectures"
)
endif()

set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-extended-lambda")
Expand All @@ -134,16 +151,14 @@ else()
message(STATUS "Not using HIP")
endif(RESOLVE_USE_HIP)


# The binary dir is already a global include directory
configure_file(
${CMAKE_SOURCE_DIR}/resolve/resolve_defs.hpp.in
${CMAKE_BINARY_DIR}/resolve/resolve_defs.hpp)
install(
FILES ${CMAKE_BINARY_DIR}/resolve/resolve_defs.hpp
DESTINATION include/resolve
)

${CMAKE_BINARY_DIR}/resolve/resolve_defs.hpp
)
install(FILES ${CMAKE_BINARY_DIR}/resolve/resolve_defs.hpp
DESTINATION include/resolve
)

# Enable testing
enable_testing()
Expand All @@ -155,31 +170,38 @@ add_subdirectory(resolve)
include(CMakePackageConfigHelpers)

# Creates a version file for the package
write_basic_package_version_file(ReSolveConfigVersion.cmake
VERSION ${CMAKE_PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion)
write_basic_package_version_file(
ReSolveConfigVersion.cmake
VERSION ${CMAKE_PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
)

# Generate install rules for targets
install(EXPORT ReSolveTargets
FILE ReSolveTargets.cmake
NAMESPACE ReSolve::
DESTINATION share/resolve/cmake
install(
EXPORT ReSolveTargets
FILE ReSolveTargets.cmake
NAMESPACE ReSolve::
DESTINATION share/resolve/cmake
)


# Creates a config file
configure_package_config_file(./cmake/ReSolveConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/ReSolveConfig.cmake
INSTALL_DESTINATION share/resolve/cmake)
configure_package_config_file(
./cmake/ReSolveConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/ReSolveConfig.cmake
INSTALL_DESTINATION share/resolve/cmake
)

# Generates install rules for cmake config files
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ReSolveConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/ReSolveConfigVersion.cmake"
DESTINATION share/resolve/cmake)

"${CMAKE_CURRENT_BINARY_DIR}/ReSolveConfigVersion.cmake"
DESTINATION share/resolve/cmake
)

# Add usage examples
add_subdirectory(examples)

# Add tests
set(RESOLVE_CTEST_OUTPUT_DIR ${PROJECT_BINARY_DIR} CACHE PATH "Directory where CTest outputs are saved")
set(RESOLVE_CTEST_OUTPUT_DIR
${PROJECT_BINARY_DIR}
CACHE PATH "Directory where CTest outputs are saved"
)
add_subdirectory(tests)
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,3 @@ class Matrix // No, class is outside ReSolve namespace
{
// matrix code
};


2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

******************************************************************************
******************************************************************************
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,3 @@ contributions to ReSolve must be made under the smae licensing terms.
**Please Note** If you are using ReSolve with any third party libraries linked
in (e.g., KLU), be sure to review the respective license of the package as that
license may have more restrictive terms than the ReSolve license.

1 change: 0 additions & 1 deletion buildsystem/ascent-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
module load gcc/10.2
# Load spack deps
source ./buildsystem/spack/ascent/modules/dependencies.sh

1 change: 0 additions & 1 deletion buildsystem/incline-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ unset GPU_DEVICE_ORDINAL

# Load spack generated modules
source ./buildsystem/spack/incline/modules/dependencies.sh

1 change: 0 additions & 1 deletion buildsystem/init-mirror.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ res=$?
chmod -R ugo+wrx $SPACK_MIRROR &

exit $res

1 change: 0 additions & 1 deletion buildsystem/spack/ascent/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ export SPACK_PYTHON=$(which python)
export tempdir=$SPACK_CACHE
export TMP=$SPACK_CACHE
export TMPDIR=$SPACK_CACHE

1 change: 0 additions & 1 deletion buildsystem/spack/ascent/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,3 @@ spack:
modules: [gcc/10.2]
operating_system: rhel8
target: ppc64le

2 changes: 1 addition & 1 deletion buildsystem/spack/deception/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ spack:
fc: /share/apps/gcc/9.1.0/bin/gfortran
operating_system: centos7
target: x86_64
modules: [gcc/9.1.0]
modules: [gcc/9.1.0]
1 change: 0 additions & 1 deletion buildsystem/spack/incline/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ export SPACK_PYTHON=$(which python3)
export tempdir=$SPACK_CACHE
export TMP=$SPACK_CACHE
export TMPDIR=$SPACK_CACHE

38 changes: 18 additions & 20 deletions cmake/FindKLU.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#[[
Looks for `klu` library and header directory.
Expand All @@ -12,29 +11,29 @@ Users may set the following variables:
]]


find_library(KLU_LIBRARY
NAMES
klu
PATHS
${KLU_DIR} $ENV{KLU_DIR} ${HIOP_KLU_DIR}
ENV LD_LIBRARY_PATH ENV DYLD_LIBRARY_PATH
PATH_SUFFIXES
lib64 lib)
find_library(
KLU_LIBRARY
NAMES klu
PATHS ${KLU_DIR}
$ENV{KLU_DIR}
${HIOP_KLU_DIR}
ENV
LD_LIBRARY_PATH
ENV
DYLD_LIBRARY_PATH
PATH_SUFFIXES lib64 lib
)

if(KLU_LIBRARY)
get_filename_component(KLU_LIBRARY_DIR ${KLU_LIBRARY} DIRECTORY)
endif()

find_path(KLU_INCLUDE_DIR
NAMES
klu.h
PATHS
${KLU_DIR} $ENV{KLU_DIR} ${HIOP_KLU_DIR} ${KLU_LIBRARY_DIR}/..
PATH_SUFFIXES
include
include/suitesparse
include/klu)
find_path(
KLU_INCLUDE_DIR
NAMES klu.h
PATHS ${KLU_DIR} $ENV{KLU_DIR} ${HIOP_KLU_DIR} ${KLU_LIBRARY_DIR}/..
PATH_SUFFIXES include include/suitesparse include/klu
)

if(KLU_LIBRARY)
message(STATUS "Found klu include: ${KLU_INCLUDE_DIR}")
Expand All @@ -51,4 +50,3 @@ endif()

set(KLU_INCLUDE_DIR CACHE PATH "Path to klu.h")
set(KLU_LIBRARY CACHE PATH "Path to klu library")

14 changes: 6 additions & 8 deletions cmake/ReSolveFindCudaLibraries.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# Exports target `resolve_cuda` which finds all cuda libraries needed by resolve.

# Exports target `resolve_cuda` which finds all cuda libraries needed by
# resolve.

add_library(resolve_cuda INTERFACE)

find_package(CUDAToolkit REQUIRED)

target_link_libraries(resolve_cuda INTERFACE
CUDA::cusolver
CUDA::cublas
CUDA::cusparse
CUDA::cudart
)
target_link_libraries(
resolve_cuda INTERFACE CUDA::cusolver CUDA::cublas CUDA::cusparse
CUDA::cudart
)

install(TARGETS resolve_cuda EXPORT ReSolveTargets)
Loading

0 comments on commit cb8ea6a

Please sign in to comment.