[cmake-developers] [CMake 0015251]: "The CMAKE_C_COMPILER … is not a full path and was not found in the PATH" if using CMakeDetermineSystem and toolchain file
Mantis Bug Tracker
mantis at public.kitware.com
Thu Nov 13 15:58:47 EST 2014
The following issue has been SUBMITTED.
======================================================================
http://public.kitware.com/Bug/view.php?id=15251
======================================================================
Reported By: Maxim Mikityanskiy
Assigned To:
======================================================================
Project: CMake
Issue ID: 15251
Category: CMake
Reproducibility: always
Severity: major
Priority: normal
Status: new
======================================================================
Date Submitted: 2014-11-13 15:58 EST
Last Modified: 2014-11-13 15:58 EST
======================================================================
Summary: "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.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2014-11-13 15:58 Maxim MikityanskiyNew Issue
======================================================================
More information about the cmake-developers
mailing list