Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-codegen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Christian Heinigk
dune-codegen
Commits
f4eef262
Commit
f4eef262
authored
6 years ago
by
Marcel Koch
Browse files
Options
Downloads
Patches
Plain Diff
links all targets with likwid if it is found and `DUNE_CODEGEN_PROFILING` is set
parent
7526946b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmake/modules/DuneCodegenMacros.cmake
+5
-0
5 additions, 0 deletions
cmake/modules/DuneCodegenMacros.cmake
cmake/modules/Findlikwid.cmake
+104
-0
104 additions, 0 deletions
cmake/modules/Findlikwid.cmake
with
109 additions
and
0 deletions
cmake/modules/DuneCodegenMacros.cmake
+
5
−
0
View file @
f4eef262
...
...
@@ -81,6 +81,8 @@
find_package
(
benchmark
)
find_package
(
likwid
)
add_custom_target
(
generation
)
# Gather a list of form compiler sources to add as dependencies
...
...
@@ -207,6 +209,9 @@ function(add_generated_executable)
add_executable
(
${
GEN_TARGET
}
${
GEN_EXCLUDE_FROM_ALL
}
${
GEN_SOURCE
}
${
header_deps
}
)
target_include_directories
(
${
GEN_TARGET
}
PUBLIC
${
CMAKE_CURRENT_BINARY_DIR
}
)
add_dependencies
(
generation
${
GEN_TARGET
}
)
if
(
DUNE_CODEGEN_PROFILING AND likwid_FOUND
)
target_link_libraries
(
${
GEN_TARGET
}
${
likwid_LIBRARIES
}
)
endif
()
endfunction
()
include
(
GeneratedSystemtests
)
...
...
This diff is collapsed.
Click to expand it.
cmake/modules/Findlikwid.cmake
0 → 100644
+
104
−
0
View file @
f4eef262
# .. cmake_module::
#
# Module that checks whether likwid is available and usable.
#
# Variables used by this module which you may want to set:
#
# :ref:`likwid_ROOT`
# Path list to search for likwid.
#
# Sets the following variables:
#
# :code:`likwid_FOUND`
# True if likwid available.
#
# :code:`likwid_INCLUDE_DIRS`
# Path to the likwid include directories.
#
#
# :code:`likwid_LIBRARIES`
# Link against these libraries to use likwid.
#
# .. cmake_variable:: likwid_ROOT
#
# You may set this variable to have :ref:`Findlikwid` look
# for the likwid package in the given paths before inspecting
# system paths.
#
find_path
(
LIKWID_INCLUDE_DIR
NAMES
"likwid.h"
PATHS
${
likwid_ROOT
}
PATH_SUFFIXES
"include"
"include/likwid"
NO_DEFAULT_PATH
)
find_path
(
LIKWID_INCLUDE_DIR
NAMES
"likwid.h"
PATH_SUFFIXES
"include"
"include/likwid"
)
find_library
(
LIKWID_LIBRARY
NAMES
"likwid"
PATHS
${
likwid_ROOT
}
PATH_SUFFIXES
"lib"
"lib32"
"lib64"
NO_DEFAULT_PATH
)
find_library
(
LIKWID_LIBRARY
NAMES
"likwid"
PATH_SUFFIXES
"lib"
"lib32"
"lib64"
)
include
(
CMakePushCheckState
)
cmake_push_check_state
()
if
(
LIKWID_INCLUDE_DIR
)
set
(
CMAKE_REQUIRED_INCLUDES
${
CMAKE_REQUIRED_INCLUDES
}
${
LIKWID_INCLUDE_DIR
}
)
endif
()
if
(
LIKWID_LIBRARY
)
set
(
CMAKE_REQUIRED_LIBRARIES
${
CMAKE_REQUIRED_LIBRARIES
}
${
LIKWID_LIBRARY
}
)
endif
()
cmake_pop_check_state
()
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
"likwid"
DEFAULT_MSG
LIKWID_INCLUDE_DIR
LIKWID_LIBRARY
)
mark_as_advanced
(
LIKWID_INCLUDE_DIR LIKWID_LIBRARY
)
# if headers are found, store results
if
(
likwid_FOUND
)
set
(
likwid_INCLUDE_DIRS
${
LIKWID_INCLUDE_DIR
}
)
set
(
likwid_LIBRARIES
${
LIKWID_LIBRARY
}
)
# log result
file
(
APPEND
${
CMAKE_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/CMakeOutput.log
"Determing location of likwid succeeded:
\n
"
"Include directory:
${
likwid_INCLUDE_DIRS
}
\n
"
"Libraries to link against:
${
likwid_LIBRARIES
}
\n\n
"
)
set
(
likwid_DUNE_COMPILE_FLAGS
"-I
${
likwid_INCLUDE_DIRS
}
"
CACHE STRING
"Compile Flags used by DUNE when compiling with likwid programs"
)
set
(
likwid_DUNE_LIBRARIES
${
likwid_LIBRARIES
}
CACHE STRING
"Libraries used by DUNE when linking likwid programs"
)
else
()
# log errornous result
file
(
APPEND
${
CMAKE_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/CMakeError.log
"Determing location of likwid failed:
\n
"
"Include directory:
${
likwid_INCLUDE_DIRS
}
\n
"
"Libraries to link against:
${
likwid_LIBRARIES
}
\n\n
"
)
endif
()
# set HAVE_LIKWID for config.h
set
(
HAVE_LIKWID
${
likwid_FOUND
}
)
# register all likwid related flags
if
(
likwid_FOUND
)
dune_register_package_flags
(
COMPILE_DEFINITIONS
"ENABLE_LIKWID=1"
LIBRARIES
"
${
likwid_LIBRARIES
}
"
INCLUDE_DIRS
"
${
likwid_INCLUDE_DIRS
}
"
)
endif
()
# text for feature summary
set_package_properties
(
"LIKWID"
PROPERTIES
DESCRIPTION
"likwid"
PURPOSE
"Performance monitoring and benchmarking suite."
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment