Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while using CMake trying to configure a project #17987

Closed
NickGkiouzenis opened this issue Oct 17, 2023 · 4 comments
Closed

Error while using CMake trying to configure a project #17987

NickGkiouzenis opened this issue Oct 17, 2023 · 4 comments
Labels
more info needed issues that cannot be triaged until more information is submitted by the original user stale issues that have not been addressed in a while; categorized by a bot

Comments

@NickGkiouzenis
Copy link

Describe the issue

i want to build the libpqxx drivers using CMake

Urgency

Needed for work.

Target platform

Version: 1.83.1 (user setup) Commit: f1b07bd25dfad64b0167beb15359ae573aecd2cc Date: 2023-10-10T23:48:05.904Z Electron: 25.8.4 ElectronBuildId: 24154031 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.22621

Build script

cmake_minimum_required(VERSION 3.8)

file(READ VERSION VER_FILE_CONTENT)
string(STRIP ${VER_FILE_CONTENT} VER_FILE_CONTENT)

set(CMAKE_MAKE_PROGRAM "C:/Program Files/CMake/bin/cmake.exe")
project(
libpqxx
VERSION ${VER_FILE_CONTENT}
LANGUAGES CXX
)

if(NOT "${CMAKE_CXX_STANDARD}")
set(CMAKE_CXX_STANDARD 17)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_SOURCE_DIR "C:/Users/ngkiouzenis/code/Nikolakis_Projectakis/libpqxx/libpqxx-7.8.1")
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

############################################
add_subdirectory(build-pqxx)
target_link_libraries(libpqxx/ PRIVATE pqxx)

############################################
option(BUILD_DOC "Build documentation" ON)

if(NOT SKIP_BUILD_TEST)
option(BUILD_TEST "Build all test cases" ON)
endif()

include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
include(config)

add_subdirectory(src)
add_subdirectory(include)
if(BUILD_DOC)
add_subdirectory(doc)
endif()
if(BUILD_TEST)
add_subdirectory(test)
endif()

installation

write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/libpqxx-config-version.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
install(FILES cmake/libpqxx-config.cmake
"${CMAKE_CURRENT_BINARY_DIR}/libpqxx-config-version.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libpqxx
)
install(
EXPORT libpqxx-targets
NAMESPACE libpqxx::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libpqxx
)

Build tree export

export(
EXPORT libpqxx-targets
NAMESPACE libpqxx::
FILE ${CMAKE_CURRENT_BINARY_DIR}/libpqxx-targets.cmake
)
configure_file(
cmake/libpqxx-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/libpqxx-config.cmake
COPYONLY
)

Package generation

set(CPACK_GENERATOR TGZ)
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
include(CPack)

Error / output

CMake Error at CMakeLists.txt:7 (project):
Running

'C:/PROGRA~1/CMake/bin/cmake.exe' '-?'

failed with:

CMake Error: Unknown argument -?

CMake Error: Run 'cmake --help' for all supported options.

Visual Studio Version

Version: 1.83.1 (user setup) Commit: f1b07bd25dfad64b0167beb15359ae573aecd2cc Date: 2023-10-10T23:48:05.904Z Electron: 25.8.4 ElectronBuildId: 24154031 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.22621

GCC / Compiler Version

g++.exe (Rev2, Built by MSYS2 project) 13.2.0

@NickGkiouzenis NickGkiouzenis added the build build issues; typically submitted using template label Oct 17, 2023
@NickGkiouzenis
Copy link
Author

i also get this when i try to configure it using the "Configure All Projects" command from the CMake tools extension :
[main] Configuring project: libpqxx-7.8.1
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=C:\msys64\mingw64\bin\gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\msys64\mingw64\bin\g++.exe -SC:/Users/ngkiouzenis/code/Nikolakis_Projectakis/libpqxx/libpqxx-7.8.1 -Bc:/Users/ngkiouzenis/code/Nikolakis_Projectakis/libpqxx/libpqxx-7.8.1/build -G "MinGW Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] -- The CXX compiler identification is GNU 13.2.0
[cmake] -- Detecting CXX compiler ABI info
[cmake] -- Detecting CXX compiler ABI info - failed
[cmake] -- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe
[cmake] -- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe - broken
[cmake] CMake Error at C:/Program Files/CMake/share/cmake-3.27/Modules/CMakeTestCXXCompiler.cmake:60 (message):
[cmake] The C++ compiler
[cmake]
[cmake] "C:/msys64/mingw64/bin/g++.exe"
[cmake]
[cmake] is not able to compile a simple test program.
[cmake]
[cmake] It fails with the following output:
[cmake]
[cmake] Change Dir: 'C:/Users/ngkiouzenis/code/Nikolakis_Projectakis/libpqxx/libpqxx-7.8.1/build/CMakeFiles/CMakeScratch/TryCompile-9tmt0j'
[cmake]
[cmake] Run Build Command(s): "C:/Program Files/CMake/bin/cmake.exe" -E env VERBOSE=1 C:/PROGRA~1/CMake/bin/cmake.exe -f Makefile cmTC_27e2b/fast
[cmake] CMake Warning:
[cmake] Ignoring extra path from command line:
[cmake]
[cmake] "cmTC_27e2b/fast"
[cmake]
[cmake]
[cmake] CMake Error: Unknown argument -f
[cmake] CMake Error: Run 'cmake --help' for all supported options.
[cmake]
[cmake]
[cmake]
[cmake]
[cmake]
[cmake] CMake will not be able to correctly generate this project.
[cmake] Call Stack (most recent call first):
[cmake] CMakeLists.txt:7 (project)
[cmake]
[cmake]
[cmake] -- Configuring incomplete, errors occurred!
[proc] The command: "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=C:\msys64\mingw64\bin\gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\msys64\mingw64\bin\g++.exe -SC:/Users/ngkiouzenis/code/Nikolakis_Projectakis/libpqxx/libpqxx-7.8.1 -Bc:/Users/ngkiouzenis/code/Nikolakis_Projectakis/libpqxx/libpqxx-7.8.1/build -G "MinGW Makefiles" exited with code: 1

@snnn
Copy link
Member

snnn commented Oct 18, 2023

But, how does it relate to ONNX Runtime?

@snnn snnn added more info needed issues that cannot be triaged until more information is submitted by the original user and removed build build issues; typically submitted using template labels Oct 18, 2023
Copy link
Contributor

This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@github-actions github-actions bot added the stale issues that have not been addressed in a while; categorized by a bot label Nov 17, 2023
Copy link
Contributor

github-actions bot commented Jan 9, 2024

This issue has been automatically closed due to inactivity. Please reactivate if further support is needed.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info needed issues that cannot be triaged until more information is submitted by the original user stale issues that have not been addressed in a while; categorized by a bot
Projects
None yet
Development

No branches or pull requests

2 participants