[CMake] Port from Debian to Windows: Include files not found

Randy Turner randallsturner13 at gmail.com
Fri Sep 18 15:10:41 EDT 2015


We are building for a TI TMS320C6713 DSK and are using a version of the
.cmake file discussed on this mailing list here:
http://marc.info/?l=cmake&m=136308196810830&w=2. Yes, the include path flag
has been overridden. We actually don't have a project() declaration, but
adding the line 'project(${TARGET_NAME} LANGUAGES C ASM)' enters into an
infinite loop where cmake appears to be failing to clear the cache.

I would assume that the omission of those include statements is what is
causing the problem. I've manually run just that section to build
Arinc.c.obj and included those include statements but it has dependencies
on other things in the makefile and can't be run on its own. One warning
that command generates that was not shown in what I sent you previously is
"WARNING: more than one source file is specified; option --output_file is
ignored." I can't be sure that that is related to the issue that I am
having but it is regularly generated via make under Windows but is not
present in the same command in Linux.

On Fri, Sep 18, 2015 at 2:08 PM, Parag Chandra <parag at ionicsecurity.com>
wrote:

> That is interesting. I’m used to seeing “-I/header/search/path”, but in
> this case it’s doing “—include_path=/header/search/path”; I guess you’re
> using some specialized compiler toolchain. So if I understand you
> correctly, if you were to manually edit the command that you pasted such
> that it had the necessary include paths in it and manually re-run it, then
> the command would succeed? Maybe you need to explicitly set the supported
> LANGUAGES in your project() command so that it includes both assembly and C?
>
>
>
> *Parag Chandra *Senior Software Engineer, Mobile Team
> Mobile: +1.919.824.1410
>
> <https://ionic.com>
>
> Ionic Security Inc.
> 1170 Peachtree St. NE STE 400, Atlanta, GA 30309
>
>
>
>
>
>
>
>
> From: Randy Turner
> Date: Friday, September 18, 2015 at 2:01 PM
> To: Parag Chandra
> Cc: "cmake at cmake.org"
> Subject: Re: [CMake] Port from Debian to Windows: Include files not found
>
> Awesome suggestion. I'm surprised that I hadn't yet tried that. I sent the
> output to a file and included the relevant portion below. I'm not the most
> familiar with parsing the output of makefiles, but it seems to only be
> using the include_paths for the first assembly object and not any of the
> subsequent c objects. I feel like there is something really obvious that
> I'm missing.
>
> [  6%] Building ASM object CMakeFiles/timer1.dir/os/vecs_timer1.asm.obj
> c:\ti\ccsv6\tools\compiler\c6000_7.4.15\bin\cl6x.exe  --compile_only
> --asm_file=C:\Users\aec_user-14\Documents\Repos\OperatingSystem\os\vecs_timer1.asm
>  --include_path=C:\Users\aec_user-14\Documents\Repos\OperatingSystem\C6xCSL\include
> --include_path=C:\Users\aec_user-14\Documents\Repos\OperatingSystem\C6xCSL\lib_3x
> --include_path=c:\ti\ccsv6\tools\compiler\c6000_7.4.15\include
> --include_path=c:\ti\ccsv6\tools\compiler\c6000_7.4.15\lib
> --include_path=C:\Users\aec_user-14\Documents\Repos\OperatingSystem\udp_ip
> --include_path=C:\Users\aec_user-14\Documents\Repos\OperatingSystem
> --include_path=C:\Users\aec_user-14\Documents\Repos\OperatingSystem\os
> --include_path=C:\Users\aec_user-14\Documents\Repos\OperatingSystem\sys
> --include_path=C:\Users\aec_user-14\Documents\Repos\OperatingSystem\utilities
>    -g --define="_DEBUG" --define="CHIP_6713" --define="RUNTEST"
> --output_file=CMakeFiles\timer1.dir\os\vecs_timer1.asm.obj
> [ 13%] Building C object CMakeFiles/timer1.dir/os/Arinc.c.obj
> c:\ti\ccsv6\tools\compiler\c6000_7.4.15\bin\cl6x.exe  --compile_only
> --c_file=C:\Users\aec_user-14\Documents\Repos\OperatingSystem\os\Arinc.c
>  -mv6710 --abi=coffabi --quiet --diag_wrap=off
> @CMakeFiles/timer1.dir/includes_C.rsp   -g --define="_DEBUG"
> --define="CHIP_6713" --define="RUNTEST"
> --output_file=CMakeFiles\timer1.dir\os\Arinc.c.obj
>
> >> Compilation failure
>
> On Fri, Sep 18, 2015 at 1:26 PM, Parag Chandra <parag at ionicsecurity.com>
> wrote:
>
>> As a diagnostic measure, can you try running in verbose mode, ala:
>>
>> make VERBOSE=1
>>
>> That will dump out the exact command lines that are being used, so you
>> can see the search paths.
>>
>>
>>
>> *Parag Chandra *Senior Software Engineer, Mobile Team
>> Mobile: +1.919.824.1410
>>
>> <https://ionic.com>
>>
>> Ionic Security Inc.
>> 1170 Peachtree St. NE STE 400, Atlanta, GA 30309
>>
>>
>>
>>
>>
>>
>>
>>
>> From: CMake on behalf of Randy Turner
>> Date: Friday, September 18, 2015 at 1:22 PM
>> To: "cmake at cmake.org"
>> Subject: [CMake] Port from Debian to Windows: Include files not found
>>
>> I am having trouble building a Code Composer Studio project with CMake.
>> Executing from the same directory in Linux compiles successfully, but in
>> Linux it fails to find any included files that aren't in the same directory
>> as the .c file that it's building. I can provide a relative path to help it
>> move on, but it will just fail to find the files referenced by that one.
>>
>> The very first #include of the project is <stdbool.h> which is located in
>> the compiler's install files. As shown in my StackOVerflow question about
>> this issue (
>> http://stackoverflow.com/questions/32591626/cmake-header-files-cannot-be-opened)
>> I can confirm that the files are in the directory that is included in the
>> CMakeLists.txt file and can be found while CMake is executing, but fail to
>> be located by make. I am using MinGW's make, and using the commands make
>> and mingw32-make both ellicit the same result, "fatal error: could not open
>> source file "stdbool.h" (no directories in search list)."
>>
>> Is there something that I'm missing here? Is something else necessary
>> beyond using INCLUDE_DIRECTORIES for all of the directories in the project?
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150918/8d082c0a/attachment-0001.html>
-------------- next part --------------
cmake_minimum_required(VERSION 2.8)

#Include the toolchain
include("toolchain_c671_dsp.cmake")

#Set the Target, Library, and Include Directories
set (TARGET_NAME timer1)
set (CSL_LIB ${CMAKE_SOURCE_DIR}/C6xCSL/lib_3x)
set (CSL_INCLUDE ${CMAKE_SOURCE_DIR}/C6xCSL/include)
set (COMPILER_INCLUDE ${CGT_COMPILER_ROOT}/include)
set (COMPILER_LIB ${CGT_COMPILER_ROOT}/lib)
#set (DSK_LIB /opt/ti/CCStudio_v3.1/c6000/dsk6713/lib)
set (IP_INCLUDE ${CMAKE_SOURCE_DIR}/udp_ip)
set (COMMON_INCLUDE ${CMAKE_SOURCE_DIR})
set (OS_INCLUDE ${CMAKE_SOURCE_DIR}/os)
#set (AS_INCLUDE ${CMAKE_SOURCE_DIR}/AS)
set (SYS_INCLUDE ${CMAKE_SOURCE_DIR}/sys)
set (UTIL_INCLUDE ${CMAKE_SOURCE_DIR}/utilities)

# Include the directories
INCLUDE_DIRECTORIES ("${CSL_INCLUDE}")
INCLUDE_DIRECTORIES ("${CSL_LIB}")
INCLUDE_DIRECTORIES ("${COMPILER_INCLUDE}")
INCLUDE_DIRECTORIES ("${COMPILER_LIB}")
#INCLUDE_DIRECTORIES ("${DSK_LIB}")
INCLUDE_DIRECTORIES ("${IP_INCLUDE}")
INCLUDE_DIRECTORIES ("${COMMON_INCLUDE}")
INCLUDE_DIRECTORIES ("${OS_INCLUDE}")
#INCLUDE_DIRECTORIES ("${AS_INCLUDE}")
INCLUDE_DIRECTORIES ("${SYS_INCLUDE}")
INCLUDE_DIRECTORIES ("${UTIL_INCLUDE}")

#Surpress CMAKE from adding -rdynamic to the linking
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")

#Specify the C Flags and global definitions
set(CMAKE_C_FLAGS "-mv6710 --abi=coffabi --quiet --diag_wrap=off")
add_definitions("-g --define=\"_DEBUG\" --define=\"CHIP_6713\" --define=\"RUNTEST\"")

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ./Debug)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ./Debug)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ./Debug)

#Make the executable with the included files
add_executable(${TARGET_NAME} ./os/vecs_timer1.asm ./os/Arinc.c ./os/cpld.c ./os/emif.c ./os/Gpio.c ./os/Mcbsp.c main.c ./os/Queues.c ./os/TaskDefinition.c ./os/Timer.c ./os/test/TestArinc.c ./os/test/test_os.c ./os/test/test_os_Runner.c ./os/test/unity.c)

#Set the Linker Flags / Libraries
target_link_libraries (${TARGET_NAME} ${UTIL_INCLUDE}/dsk6713bsl.lib ${UTIL_INCLUDE}/rts6700.lib ${CSL_LIB}/csl6713.lib ${UTIL_INCLUDE}/timer1.cmd)
SET_TARGET_PROPERTIES (${TARGET_NAME} PROPERTIES LINK_FLAGS "--reread_libs --warn_sections --rom_model --xml_link_info=./Debug/${TARGET_NAME}_linkinfo.xml --display_error_number")

-------------- next part --------------
A non-text attachment was scrubbed...
Name: toolchain_c671_dsp.cmake
Type: application/octet-stream
Size: 3721 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150918/8d082c0a/attachment-0001.obj>


More information about the CMake mailing list