[MDEV-5572] Compile with gprof Created: 2014-01-27  Updated: 2014-02-03  Resolved: 2014-01-27

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.7
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: VAROQUI Stephane Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

cmake does not accept -DENABLE_GPROF=1

BUILD/compile-amd64-gprof-no-ndb
SphinxSE does not link .

Spider and Handler Socket are ignored from the build .

Is there any documentation how to compile with gprof ?



 Comments   
Comment by Sergei Golubchik [ 2014-01-27 ]

We don't have a dedicated cmake option for every possible combination of gcc flags that one might think of. Just set CMAKE_C_FLAGS and CMAKE_CXX_FLAGS as you like:

CMAKE_C_FLAGS=-pg CMAKE_CXX_FLAGS=-pg cmake

Don't use BUILD/ scripts, they're from autotools era, not maintained anymore.

Comment by VAROQUI Stephane [ 2014-02-03 ]

This did not worked.

What works for me was adding in CMakeLists.txt , this already in place in Percona and MySQL server release.

OPTION(ENABLE_GPROF "Enable gprof (optimized, Linux builds only)" OFF)
IF (ENABLE_GPROF AND NOT WIN32 AND NOT APPLE)
SET(CMAKE_C_FLAGS_RELWITHDEBINFO
"${CMAKE_C_FLAGS_RELWITHDEBINFO} -pg")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -pg")
SET(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
"${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} -pg")
ENDIF()

cmake -DENABLE_GPROF=1 -DCMAKE_INSTALL_PREFIX=/usr/local/skysql/mariadb-10.0.7-linux-x86_64_gprof

Generated at Thu Feb 08 07:05:24 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.