diff --git a/.gitmodules b/.gitmodules index d4f31a89a6..1fc858501f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -78,7 +78,7 @@ url = https://github.com/jrmadsen/pybind11.git [submodule "projects/rocprofiler-systems/external/sqlite"] path = projects/rocprofiler-systems/external/sqlite - url = https://github.com/sqlite/sqlite + url = https://github.com/sqlite/sqlite.git [submodule "projects/rocprofiler-systems/examples/openmp/external/ompvv"] path = projects/rocprofiler-systems/examples/openmp/external/ompvv url = https://github.com/OpenMP-Validation-and-Verification/OpenMP_VV.git diff --git a/projects/rocprofiler-systems/CMakeLists.txt b/projects/rocprofiler-systems/CMakeLists.txt index 012b2fb30c..f4a9d30eb9 100644 --- a/projects/rocprofiler-systems/CMakeLists.txt +++ b/projects/rocprofiler-systems/CMakeLists.txt @@ -236,9 +236,10 @@ rocprofiler_systems_add_option(ROCPROFSYS_BUILD_CODECOV "Build for code coverage rocprofiler_systems_add_option(ROCPROFSYS_INSTALL_PERFETTO_TOOLS "Install perfetto tools (i.e. traced, perfetto, etc.)" OFF ) -rocprofiler_systems_add_option(ROCPROFILER_BUILD_SQLITE3 - "Enable building sqlite3 library internally" OFF +rocprofiler_systems_add_option(ROCPROFSYS_BUILD_SQLITE3 + "Enable building sqlite3 library internally" ON ) + rocprofiler_systems_add_option(ROCPROFSYS_BUILD_GTEST "Enable building googletest library internally" ON ) diff --git a/projects/rocprofiler-systems/cmake/SQLite3.cmake b/projects/rocprofiler-systems/cmake/SQLite3.cmake index 44669c3280..9f40a2e2e0 100644 --- a/projects/rocprofiler-systems/cmake/SQLite3.cmake +++ b/projects/rocprofiler-systems/cmake/SQLite3.cmake @@ -1,6 +1,6 @@ include_guard(GLOBAL) -if(ROCPROFILER_BUILD_SQLITE3) +if(ROCPROFSYS_BUILD_SQLITE3) message(STATUS "Building SQLite3 from source!") execute_process( COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/external/sqlite @@ -16,29 +16,34 @@ if(ROCPROFILER_BUILD_SQLITE3) find_program(MAKE_COMMAND NAMES make gmake PATH_SUFFIXES bin REQUIRED) - include(ExternalProject) - ExternalProject_Add( - rocprofiler-systems-sqlite-build - PREFIX ${PROJECT_BINARY_DIR}/external/sqlite/build - SOURCE_DIR ${PROJECT_SOURCE_DIR}/external/sqlite - BUILD_IN_SOURCE 0 - CONFIGURE_COMMAND - /configure --prefix=${PROJECT_BINARY_DIR}/external/sqlite/install - --libdir=${PROJECT_BINARY_DIR}/external/sqlite/install/lib --disable-shared - --with-tempstore=yes --enable-all --disable-tcl CFLAGS=-O3\ -g1 - BUILD_COMMAND ${MAKE_COMMAND} install -s - INSTALL_COMMAND "" + set(SQLITE_BUILD_DIR ${PROJECT_BINARY_DIR}/external/sqlite/build) + set(SQLITE_INSTALL_DIR ${PROJECT_BINARY_DIR}/external/sqlite/install) + set(SQLITE_LIB ${SQLITE_INSTALL_DIR}/lib/libsqlite3.a) + + add_custom_command( + OUTPUT ${SQLITE_LIB} + COMMAND ${CMAKE_COMMAND} -E make_directory ${SQLITE_BUILD_DIR} + COMMAND + ${CMAKE_COMMAND} -E chdir ${SQLITE_BUILD_DIR} + ${PROJECT_SOURCE_DIR}/external/sqlite/configure --prefix=${SQLITE_INSTALL_DIR} + --libdir=${SQLITE_INSTALL_DIR}/lib --disable-shared --with-tempstore=yes + --enable-all --disable-tcl + CFLAGS=-O3\ -g1\ -fPIC\ -DSQLITE_DEFAULT_MEMSTATUS=0 + COMMAND ${CMAKE_COMMAND} -E chdir ${SQLITE_BUILD_DIR} ${MAKE_COMMAND} install -s + COMMENT "Building SQLite3 from source" + VERBATIM ) + add_custom_target(rocprofiler-systems-sqlite-build DEPENDS ${SQLITE_LIB}) + target_link_libraries( rocprofiler-systems-sqlite3 - INTERFACE - $ + INTERFACE $ ) target_include_directories( rocprofiler-systems-sqlite3 SYSTEM - INTERFACE $ + INTERFACE $ ) add_dependencies(rocprofiler-systems-sqlite3 rocprofiler-systems-sqlite-build) else() diff --git a/projects/rocprofiler-systems/external/sqlite b/projects/rocprofiler-systems/external/sqlite new file mode 160000 index 0000000000..d98f758f40 --- /dev/null +++ b/projects/rocprofiler-systems/external/sqlite @@ -0,0 +1 @@ +Subproject commit d98f758f405a03617fde1fe9f5cd5c2d41d820b7 diff --git a/projects/rocprofiler-systems/source/lib/core/rocpd/data_storage/database.hpp b/projects/rocprofiler-systems/source/lib/core/rocpd/data_storage/database.hpp index 503108d061..200d5fd764 100644 --- a/projects/rocprofiler-systems/source/lib/core/rocpd/data_storage/database.hpp +++ b/projects/rocprofiler-systems/source/lib/core/rocpd/data_storage/database.hpp @@ -34,7 +34,6 @@ namespace rocpd { namespace data_storage { -static std::mutex _mutex; class database { public: @@ -182,8 +181,7 @@ public: std::shared_ptr stmt{ p_stmt, sqlite3_finalize }; return [stmt, query, this](Values... value) { - std::lock_guard lock{ _mutex }; - int position = 1; + int position = 1; ((bind_value(stmt.get(), position++, value, query)), ...);