View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0015251 | CMake | CMake | public | 2014-11-13 15:58 | 2015-07-08 08:57 | ||||
Reporter | Maxim Mikityanskiy | ||||||||
Assigned To | |||||||||
Priority | normal | Severity | major | Reproducibility | always | ||||
Status | closed | Resolution | no change required | ||||||
Platform | Linux | OS | Linux | OS Version | Gentoo Linux | ||||
Product Version | CMake 3.0.2 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0015251: "The CMAKE_C_COMPILER … is not a full path and was not found in the PATH" if using CMakeDetermineSystem and toolchain file | ||||||||
Description | There is an issue that prevents any version of freerdp to build on Gentoo using CMake 3.0.2. At first, Gentoo's portage passes -DCMAKE_TOOLCHAIN_FILE=gentoo_toolchain.cmake to cmake command line; gentoo_toolchain.cmake contains following: SET (CMAKE_C_COMPILER x86_64-pc-linux-gnu-gcc) SET (CMAKE_CXX_COMPILER x86_64-pc-linux-gnu-g++) And when I try to build freerdp, the following message from CMake appears: cmake --no-warn-unused-cli -C /build/tmp/portage/net-misc/freerdp-1.1.0_beta1_p20130710-r2/work/freerdp-1.1.0_beta1_p20130710_build/gentoo_common_config.cmake -G Unix Makefiles -DCMAKE_INSTALL_PREFIX=/usr -DWITH_ALSA=ON -DWITH_CLIENT=ON -DWITH_CUPS=OFF -DWITH_DEBUG_ALL=OFF -DWITH_MANPAGES=OFF -DWITH_DIRECTFB=OFF -DWITH_FFMPEG=OFF -DWITH_GSTREAMER=OFF -DWITH_JPEG=ON -DWITH_PULSE=ON -DWITH_SERVER=OFF -DWITH_PCSC=OFF -DWITH_SSE2=ON -DCHANNEL_URBDRC=ON -DWITH_X11=ON -DWITH_XINERAMA=ON -DWITH_XV=ON -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Gentoo -DCMAKE_INSTALL_DO_STRIP=OFF -DCMAKE_USER_MAKE_RULES_OVERRIDE=/build/tmp/portage/net-misc/freerdp-1.1.0_beta1_p20130710-r2/work/freerdp-1.1.0_beta1_p20130710_build/gentoo_rules.cmake -DCMAKE_TOOLCHAIN_FILE=/build/tmp/portage/net-misc/freerdp-1.1.0_beta1_p20130710-r2/work/freerdp-1.1.0_beta1_p20130710_build/gentoo_toolchain.cmake /build/tmp/portage/net-misc/freerdp-1.1.0_beta1_p20130710-r2/work/freerdp-1.1.0_beta1_p20130710 Not searching for unused variables given on the command line. loading initial cache file /build/tmp/portage/net-misc/freerdp-1.1.0_beta1_p20130710-r2/work/freerdp-1.1.0_beta1_p20130710_build/gentoo_common_config.cmake -- The C compiler identification is GNU 4.9.2 -- Check for working C compiler: /usr/lib64/ccache/bin/x86_64-pc-linux-gnu-gcc -- Check for working C compiler: /usr/lib64/ccache/bin/x86_64-pc-linux-gnu-gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Found PkgConfig: /usr/bin/x86_64-pc-linux-gnu-pkg-config (found version "0.28") -- FreeRDP GIT -- Git Revision n/a -- Performing Test Wno-unused-result -- Performing Test Wno-unused-result - Success -- Performing Test Wno-unused-but-set-variable -- Performing Test Wno-unused-but-set-variable - Success -- Performing Test Wno-deprecated-declarations -- Performing Test Wno-deprecated-declarations - Success -- Looking for include file fcntl.h -- Looking for include file fcntl.h - found -- Looking for include file unistd.h -- Looking for include file unistd.h - found -- Looking for include file stdint.h -- Looking for include file stdint.h - found -- Looking for include file inttypes.h -- Looking for include file inttypes.h - found -- Looking for include file sys/modem.h -- Looking for include file sys/modem.h - not found -- Looking for include file sys/filio.h -- Looking for include file sys/filio.h - not found -- Looking for include file sys/strtio.h -- Looking for include file sys/strtio.h - not found -- Looking for include file sys/select.h -- Looking for include file sys/select.h - found -- Performing Test HAVE_TM_GMTOFF -- Performing Test HAVE_TM_GMTOFF - Success -- Looking for include file pthread.h -- Looking for include file pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Looking for include file sys/eventfd.h -- Looking for include file sys/eventfd.h - found -- Finding recommended feature X11 for X11 (X11 client and server) -- Disable feature X11 using "-DWITH_X11=OFF" -- Found X11: /usr/lib64/libX11.so -- Skipping optional feature DirectFB for DirectFB (DirectFB client) -- Enable feature DirectFB using "-DWITH_DIRECTFB=ON" -- Finding required feature ZLIB for compression (data compression) -- Found ZLIB: /usr/lib64/libz.so (found version "1.2.8") -- Finding required feature OpenSSL for cryptography (encryption, certificate validation, hashing functions) -- Found OpenSSL: /usr/lib64/libssl.so;/usr/lib64/libcrypto.so (found version "1.0.1j") -- Finding recommended feature ALSA for sound (audio input, audio output and multimedia redirection) -- Disable feature ALSA using "-DWITH_ALSA=OFF" -- Found ALSA: /usr/lib64/libasound.so (found version "1.0.28") -- Finding optional feature Pulse for sound (audio input, audio output and multimedia redirection) -- checking for module 'libpulse' -- found libpulse, version 5.0 -- Found Pulse: /usr/include -- Skipping optional feature Cups for printing (printer device redirection) -- Enable feature Cups using "-DWITH_CUPS=ON" -- Skipping optional feature PCSC for smart card (smart card device redirection) -- Enable feature PCSC using "-DWITH_PCSC=ON" -- Skipping recommended feature FFmpeg for multimedia (multimedia redirection, audio and video playback) -- Skipping recommended feature Gstreamer for multimedia (multimedia redirection, audio and video playback) -- Skipping optional feature IPP for performance (Intel Integrated Performance Primitives library) -- Enable feature IPP using "-DWITH_IPP=ON" -- Skipping optional feature NPP for performance (NVIDIA Performance Primitives library) -- Enable feature NPP using "-DWITH_NPP=ON" CMake Error at winpr/CMakeLists.txt:20 (project): The CMAKE_C_COMPILER: x86_64-pc-linux-gnu-gcc is not a full path and was not found in the PATH. Tell CMake where to find the compiler by setting either the environment variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH. I tried to reproduce the bug with minimal CMakeLists.txt. The bug can be reproduced with the following script: mkdir src cat > CMakeLists.txt << "EOF" cmake_minimum_required(VERSION 3.0.2) project(test C) include(CMakeDetermineSystem) add_subdirectory(src) EOF cat > src/CMakeLists.txt << "EOF" cmake_minimum_required(VERSION 3.0.2) project(src C) EOF cat > toolchain.cmake << "EOF" set(CMAKE_C_COMPILER x86_64-pc-linux-gnu-gcc) EOF cmake . -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake You will see the following output: -- The C compiler identification is GNU 4.9.2 -- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc -- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done CMake Error at src/CMakeLists.txt:2 (project): The CMAKE_C_COMPILER: x86_64-pc-linux-gnu-gcc is not a full path and was not found in the PATH. Tell CMake where to find the compiler by setting either the environment variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH. -- Configuring incomplete, errors occurred! See also "/tmp/test/CMakeFiles/CMakeOutput.log". I think that the reason of the bug is that CMake sets CMAKE_C_COMPILER=/usr/bin/x86_64-pc-linux-gnu-gcc after parsing toolchain file, but CMakeDetermineSystem module includes toolchain file again, and now CMAKE_C_COMPILER=x86_64-pc-linux-gnu-gcc, which leads to failure. | ||||||||
Steps To Reproduce | Look at script above. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
Relationships | |
Relationships |
Notes | |
(0037215) Brad King (manager) 2014-11-13 16:06 |
Having a full path to the compiler is a new requirement starting in CMake 3.0. The incompatibility was introduced across a major version number bump and is considered acceptable. The project will have to be fixed to use a full path. |
(0037216) Maxim Mikityanskiy (reporter) 2014-11-13 16:18 |
It doesn't seem that having a full path to the compiler in the toolchain file is really required in CMake 3.0. At first, if you remove "include(CMakeDetermineSystem)" from CMakeLists.txt, all things work flawlessly, CMake makes absolute path to the compiler using $PATH automatically. At second, even the error message states that "The CMAKE_C_COMPILER: x86_64-pc-linux-gnu-gcc is not a full path and was not found in the PATH", so it must be either a full path or be in $PATH. The bug appears then we include CMakeDetermineSystem, which reincludes ${CMAKE_TOOLCHAIN_FILE}, so ${CMAKE_C_COMPILER} is reassigned to relative path, and CMake does not fix the path now. So this is really a bug, either CMakeDetermineSystem should be fixed or CMake should be fixed to resolve absolute paths not only on first parsing of ${CMAKE_TOOLCHAIN_FILE}. |
(0037217) Brad King (manager) 2014-11-13 16:20 |
CMakeDetermineSystem is an internal and undocumented module. It should never be included directly by project or toolchain file code. It is loaded automatically by the project() command. |
(0037218) Maxim Mikityanskiy (reporter) 2014-11-13 16:22 |
>It should never be included directly by project or toolchain file code. OK, thanks, if so, the bug should be filed to freerdp, which includes CMakeDetermineSystem from CMakeLists.txt. |
(0038023) Gerard Weatherby (reporter) 2015-02-23 10:27 edited on: 2015-02-23 11:23 |
There's still a bit of a bug: since full paths are required, the part of the error message "and was not found in the PATH." makes no sense. |
(0038025) Brad King (manager) 2015-02-23 11:15 |
Re 0015251:0038023: At the point that the diagnostic is produced a full path is required. If the user specified a tool by name then CMake might find it in the PATH and compute the proper full path prior to this check. The error message is reporting that this did not happen. |
(0039060) Robert Maynard (manager) 2015-07-08 08:57 |
Closing resolved issues that have not been updated in more than 4 months. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2014-11-13 15:58 | Maxim Mikityanskiy | New Issue | |
2014-11-13 16:06 | Brad King | Note Added: 0037215 | |
2014-11-13 16:18 | Maxim Mikityanskiy | Note Added: 0037216 | |
2014-11-13 16:20 | Brad King | Note Added: 0037217 | |
2014-11-13 16:22 | Maxim Mikityanskiy | Note Added: 0037218 | |
2014-11-14 09:01 | Brad King | Status | new => resolved |
2014-11-14 09:01 | Brad King | Resolution | open => no change required |
2015-02-23 10:27 | Gerard Weatherby | Note Added: 0038023 | |
2015-02-23 11:15 | Brad King | Note Added: 0038025 | |
2015-02-23 11:23 | Gerard Weatherby | Note Edited: 0038023 | |
2015-07-08 08:57 | Robert Maynard | Note Added: 0039060 | |
2015-07-08 08:57 | Robert Maynard | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |