Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
vite
Merge requests
!106
fix Otf2
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
fix Otf2
ftrahay/vite:otf2
into
master
Overview
0
Commits
7
Pipelines
4
Changes
6
Closed
TRAHAY Francois
requested to merge
ftrahay/vite:otf2
into
master
11 months ago
Overview
0
Commits
7
Pipelines
4
Changes
6
Expand
This merge request improves the OTF2 parser:
improve the cmake detection of otf2 (you just need to have otf2-config in your path to setup the include/lib dirs)
when loading an OTF2, there was a race condition that prevents vite from displaying the trace
0
0
Merge request reports
Compare
master
version 3
15b07521
11 months ago
version 2
5bd79b4e
11 months ago
version 1
827bca8b
11 months ago
master (base)
and
latest version
latest version
5b1b3c29
7 commits,
11 months ago
version 3
15b07521
6 commits,
11 months ago
version 2
5bd79b4e
5 commits,
11 months ago
version 1
827bca8b
4 commits,
11 months ago
6 files
+
177
−
65
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
cmake/FindOTF2.cmake
+
69
−
50
Options
#
#
# Find the OTF2 librar
ies and include dir
# Find the OTF2 librar
y
#
#
# OTF2_INCLUDE_DIR - Directories to include to use OTF2
# OTF2_INCLUDE_DIR - Directories to include to use OTF2
# OTF2_LIBRARY - Files to link against to use OTF2
# OTF2_LIBRARY_PATH - Files to link against to use OTF2
# OTF2_FOUND - When false, don't try to use OTF2
# OTF2_CONFIG - Path to otf2-config
#
# OTF2_DIR can be used to make it simpler to find the various include
# directories and compiled libraries when OTF2 was not installed in the
find_program
(
OTF2_CONFIG otf2-config REQUIRED
)
# usual/well-known directories (e.g. because you made an in tree-source
find_program
(
OTF2_PRINT otf2-print REQUIRED
)
# compilation or because you installed it in an "unusual" directory).
# Just set OTF2_DIR it to your specific installation directory
#
FIND_LIBRARY
(
OTF2_LIBRARY otf2
PATHS
/usr/lib
/usr/local/lib
${
OTF2_DIR
}
/lib
)
IF
(
OTF2_LIBRARY
)
IF
(
NOT OTF2_CONFIG OR NOT EXISTS
${
OTF2_CONFIG
}
)
GET_FILENAME_COMPONENT
(
OTF2_GUESSED_INCLUDE_DIR_tmp
"
${
OTF2_LIBRARY
}
"
PATH
)
MESSAGE
(
STATUS
"Cannot find otf2-config"
)
STRING
(
REGEX REPLACE
"lib$"
"include"
OTF2_GUESSED_INCLUDE_DIR
"
${
OTF2_GUESSED_INCLUDE_DIR_tmp
}
"
)
SET
(
OTF2_VERSION
${
OTF2_REQUIRED_VERSION
}
)
ENDIF
(
OTF2_LIBRARY
)
ELSE
()
message
(
STATUS
"OTF2 installation found. (using
${
OTF2_CONFIG
}
)"
)
FIND_PATH
(
OTF2_INCLUDE_DIR otf2/otf2.h
PATHS
execute_process
(
COMMAND
${
OTF2_CONFIG
}
"--cppflags"
OUTPUT_VARIABLE OTF2_INCLUDE_DIR
)
${
OTF2_GUESSED_INCLUDE_DIR
}
STRING
(
REPLACE
"
\n
"
""
OTF2_INCLUDE_DIR
${
OTF2_INCLUDE_DIR
}
)
${
OTF2_DIR
}
/include
STRING
(
REPLACE
"-I"
""
OTF2_INCLUDE_DIR
${
OTF2_INCLUDE_DIR
}
)
/usr/include
/usr/local/include
execute_process
(
COMMAND
${
OTF2_CONFIG
}
"--ldflags"
OUTPUT_VARIABLE _LINK_LD_ARGS
)
${
CMAKE_SOURCE_DIR
}
/externals/otf2/include/
STRING
(
REPLACE
" "
";"
_LINK_LD_ARGS
${
_LINK_LD_ARGS
}
)
FOREACH
(
_ARG
${
_LINK_LD_ARGS
}
)
IF
(
${
_ARG
}
MATCHES
"^-L"
)
STRING
(
REGEX REPLACE
"^-L"
""
_ARG
${
_ARG
}
)
STRING
(
STRIP
"
${
_ARG
}
"
_ARG
)
SET
(
OTF2_LINK_DIRS
${
OTF2_LINK_DIRS
}
${
_ARG
}
)
ENDIF
(
${
_ARG
}
MATCHES
"^-L"
)
ENDFOREACH
(
_ARG
)
execute_process
(
COMMAND
${
OTF2_CONFIG
}
"--libs"
OUTPUT_VARIABLE _LINK_LD_ARGS
)
STRING
(
REPLACE
" "
";"
_LINK_LD_ARGS
${
_LINK_LD_ARGS
}
)
FOREACH
(
_ARG
${
_LINK_LD_ARGS
}
)
IF
(
${
_ARG
}
MATCHES
"^-l"
)
STRING
(
REGEX REPLACE
"^-l"
""
_ARG
"
${
_ARG
}
"
)
STRING
(
STRIP
"
${
_ARG
}
"
_ARG
)
FIND_LIBRARY
(
_OTF2_LIB_FROM_ARG NAMES
${
_ARG
}
HINTS
${
OTF2_LINK_DIRS
}
NO_DEFAULT_PATH
)
IF
(
${
_ARG
}
STREQUAL
"otf2"
OR
${
_ARG
}
STREQUAL
"open-trace-format2"
)
SET
(
OTF2_LIBRARY
${
_OTF2_LIB_FROM_ARG
}
)
ELSE
()
IF
(
_OTF2_LIB_FROM_ARG
)
LIST
(
APPEND OTF2_LIBRARIES
${
_OTF2_LIB_FROM_ARG
}
)
ENDIF
(
_OTF2_LIB_FROM_ARG
)
ENDIF
()
UNSET
(
_OTF2_LIB_FROM_ARG CACHE
)
ENDIF
(
${
_ARG
}
MATCHES
"^-l"
)
ENDFOREACH
(
_ARG
)
execute_process
(
COMMAND
${
OTF2_CONFIG
}
"--version"
OUTPUT_VARIABLE OTF2_VERSION
)
STRING
(
REPLACE
"otf2-config: version "
""
OTF2_VERSION
${
OTF2_VERSION
}
)
STRING
(
REPLACE
"
\n
"
""
OTF2_VERSION
${
OTF2_VERSION
}
)
STRING
(
REPLACE
"."
";"
_VERSION
${
OTF2_VERSION
}
)
LIST
(
GET _VERSION 0 OTF2_MAJOR_VERSION
)
LIST
(
GET _VERSION 1 OTF2_MINOR_VERSION
)
ENDIF
()
include
(
FindPackageHandleStandardArgs
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
OTF2
FOUND_VAR OTF2_FOUND
REQUIRED_VARS OTF2_CONFIG OTF2_LIBRARY OTF2_INCLUDE_DIR
VERSION_VAR OTF2_VERSION
)
)
IF
(
OTF2_INCLUDE_DIR
)
if
(
NOT OTF2_FOUND
)
IF
(
OTF2_LIBRARY
)
unset
(
OTF2_CONFIG
)
SET
(
OTF2_FOUND
"YES"
)
unset
(
OTF2_CONFIG CACHE
)
MARK_AS_ADVANCED
(
OTF2_DIR
)
unset
(
OTF2_LINK_DIRS
)
MARK_AS_ADVANCED
(
OTF2_INCLUDE_DIR
)
unset
(
OTF2_LIBRARIES
)
MARK_AS_ADVANCED
(
OTF2_LIBRARY
)
endif
()
ENDIF
(
OTF2_LIBRARY
)
ENDIF
(
OTF2_INCLUDE_DIR
)
mark_as_advanced
(
OTF2_LIBRARY
)
IF
(
NOT OTF2_FOUND
)
MESSAGE
(
"OTF2 installation was not found. Please provide OTF2_DIR:"
)
MESSAGE
(
" - through the GUI when working with ccmake, "
)
MESSAGE
(
" - as a command line argument when working with cmake e.g. "
)
MESSAGE
(
" cmake .. -DOTF2_DIR:PATH=/usr/local/otf "
)
MESSAGE
(
"Note: the following message is triggered by cmake on the first "
)
MESSAGE
(
" undefined necessary PATH variable (e.g. OTF2_INCLUDE_DIR)."
)
MESSAGE
(
" Providing OTF2_DIR (as above described) is probably the"
)
MESSAGE
(
" simplest solution unless you have a really customized/odd"
)
MESSAGE
(
" OTF2 installation..."
)
SET
(
OTF2_DIR
""
CACHE PATH
"Root of OTF2 install tree."
)
ENDIF
(
NOT OTF2_FOUND
)
Loading