View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010176CMakeCMakepublic2010-01-22 06:362013-06-26 15:54
Reporterdaniil 
Assigned ToAlex Neundorf 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0010176: Add Support for IAR compiler
DescriptionAdd support for IAR compiler. CMakeCCompilerId.c.in has such definition already
/* IAR Systems compiler for embedded systems.
   http://www.iar.com [^]
   Not supported yet by CMake
#elif defined(__IAR_SYSTEMS_ICC__)
# define COMPILER_ID "IAR" */
TagsNo tags attached.
Attached Filespdf file icon IAR C-C++ Development Guide for ARM.pdf [^] (4,523,552 bytes) 2010-01-22 10:15
rar file icon cmake.rar [^] (1,914 bytes) 2010-01-25 02:04
patch file icon IAR.patch [^] (2,452 bytes) 2010-01-25 12:24 [Show Content]
patch file icon IAR-with-linker.patch [^] (5,383 bytes) 2010-01-27 15:41 [Show Content]
patch file icon IAR-with-linker-2.patch [^] (5,389 bytes) 2010-01-27 15:48 [Show Content]
rar file icon daniil_project.rar [^] (1,253 bytes) 2010-01-28 09:33
rar file icon iar_arm_docs.rar [^] (3,159,742 bytes) 2010-02-02 02:53
rar file icon iar_avr_docs.rar [^] (2,653,879 bytes) 2010-02-02 02:57
rar file icon iar_avr32_docs.rar [^] (1,945,134 bytes) 2010-02-02 03:00
patch file icon IAR-2.patch [^] (6,422 bytes) 2010-02-03 16:06 [Show Content]
patch file icon IAR-3.patch [^] (6,644 bytes) 2010-02-11 13:29 [Show Content]
? file icon cmCTest.i [^] (1,845,906 bytes) 2010-02-12 10:14
rar file icon files.rar [^] (18,847 bytes) 2010-02-15 02:18
patch file icon IAR-4.patch [^] (6,636 bytes) 2010-02-15 12:43 [Show Content]
rar file icon iartest.rar [^] (33,576 bytes) 2010-02-16 03:31
patch file icon IAR-5.patch [^] (6,708 bytes) 2010-02-16 13:46 [Show Content]
? file icon iarAvr.cmake [^] (377 bytes) 2010-02-17 05:04
patch file icon IAR-6.patch [^] (8,406 bytes) 2010-02-18 16:27 [Show Content]
log file icon CMakeError.log [^] (2,024 bytes) 2010-02-19 02:17
? file icon main.r90 [^] (1,974 bytes) 2010-02-20 06:15
? file icon main.r90.hex [^] (9,300 bytes) 2010-02-23 13:21
rar file icon iartest_asm.rar [^] (2,634 bytes) 2010-02-24 03:30
? file icon cmHexFileConverter.h [^] (1,012 bytes) 2010-03-02 17:17
cxx file icon cmHexFileConverter.cxx [^] (7,177 bytes) 2010-03-02 17:17
? file icon IAR.cmake [^] (2,024 bytes) 2010-03-06 14:27
? file icon IAR-C.cmake [^] (1,175 bytes) 2010-03-06 14:27
? file icon IAR-CXX.cmake [^] (1,196 bytes) 2010-03-06 14:27
? file icon iarAvr-2.cmake [^] (482 bytes) 2010-03-09 03:22
patch file icon IAR-7.patch [^] (10,454 bytes) 2010-03-10 16:33 [Show Content]
patch file icon IAR-8.patch [^] (9,462 bytes) 2010-03-12 14:59 [Show Content]
? file icon MakefileM [^] (327 bytes) 2010-03-15 03:37 [Show Content]
patch file icon IAR-9.patch [^] (9,897 bytes) 2010-03-15 18:08 [Show Content]
patch file icon IAR-10.patch [^] (11,813 bytes) 2010-03-18 16:41 [Show Content]
rar file icon i26.rar [^] (175,640 bytes) 2010-03-22 11:35
patch file icon IAR-11.patch [^] (17,066 bytes) 2010-08-17 16:03 [Show Content]
txt file icon STM32_ToochainCmake.txt [^] (2,902 bytes) 2010-08-18 01:17 [Show Content]
txt file icon STM32_ToochainCmake_1r1.txt [^] (3,094 bytes) 2010-08-19 18:51 [Show Content]
txt file icon STM32_ToochainCmake_Force.txt [^] (2,918 bytes) 2010-08-22 19:52 [Show Content]

 Relationships

  Notes
(0019267)
Brad King (manager)
2010-01-22 10:09

The CMakeCCompilerId.c.in entry for __IAR_SYSTEMS_ICC__ is a placeholder. We have no access to this compiler or experience with it. If you (daniil) have access and would like to contribute support, we can guide you.

Read about CMake and cross compiling here:

  http://www.cmake.org/Wiki/CMake_Cross_Compiling [^]
(0019268)
Brad King (manager)
2010-01-22 10:10
edited on: 2010-01-22 10:10

The preprocessor identification symbol changed according to "Migrating to the 78K IAR Embedded Workbench version 4.x"
http://supp.iar.com/FilesPublic/SUPPORT/002809/EW78K_MigrationGuide.pdf [^]

  - version 3 defines: __IAR_SYSTEMS_ICC
  - version 4 defines: __IAR_SYSTEMS_ICC__
  - version 4 defines the old one for compatibility

(0019269)
Brad King (manager)
2010-01-22 10:14

This looks like a manual:
http://users.ece.gatech.edu/~mmckeown3/ECE3884/pdf/IAR%20C-C++%20Development%20Guide%20for%20ARM.pdf [^]
http://docjax.cloudapp.net/document/view.shtml?id=772121&title=IAR%20C/C++%20Development%20Guide [^]
(0019287)
Alex Neundorf (developer)
2010-01-24 14:42

For which operating system do you want to use the IAR compiler ?
One of the OSs CMake already supports or something else, maybe some custom OS ?

Well, anyway, to get forward, uncomment the lines you found above, and then see how it goes.
CMake should then tell you that it detected the compiler as "IAR".
If nothing special is present, it should get the default command line, i.e. something like CC -c <file>.c -o <file>.o

Alex
(0019288)
Alex Neundorf (developer)
2010-01-24 14:47

You may need compiler-specific files, have a look e.g. at the Modules/Compiler/Intel-*.cmake or Modules/Compiler/PGI-*.cmake files.

According to the documentation it shouldn't be hard to add the IAR compiler.

Alex
(0019290)
daniil (reporter)
2010-01-25 02:09
edited on: 2010-01-25 02:13

IAR is for window only.

I uncomment the line in the file and get the result. Do I need to recompile the cmake?

dkasyanov@DKASYANOV2 /c/Projects/cmake
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=./IARAvrToolChain.cmake .
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Projects/cmake

dkasyanov@DKASYANOV2 /c/Projects/cmake
$ make
Scanning dependencies of target my
[ 33%] Building CXX object CMakeFiles/my.dir/main.cpp.obj

   IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
   Copyright 1996-2009 IAR Systems AB.
Command line error: Unexpected command line arguments:
          -c
make[2]: *** [CMakeFiles/my.dir/main.cpp.obj] Error 2
make[1]: *** [CMakeFiles/my.dir/all] Error 2
make: *** [all] Error 2

Can you provide me with link to documentation how to add a new compiler?
Also I provide the project I train on, I am actually newbie to cmake so I can miss something.

IAR Embedded workbench project generator could be also great to implemented.
Could you provide me with guide how to do that, I would be great to contribute support.

(0019291)
Alex Neundorf (developer)
2010-01-25 02:12

It doesn't support "-c" ?
What is the command to compile foo.c to foo.o ?

Also, please rerun cmake in a freash build tree, and post the output here (the output above must be from an already existing build dir).

Alex
(0019292)
daniil (reporter)
2010-01-25 02:17

So I should rebuild cmake?
What is better sources I should get latest or cmake 2.8?
(0019293)
daniil (reporter)
2010-01-25 02:20

FYI
Iar has evaluation compiler with no time limit but code size limit.

http://iar.com/website1/1.0.1.0/675/1/ [^]
(0019294)
daniil (reporter)
2010-01-25 02:54

To compile foo.c to foo.o is

$ iccavr foo.c -o foo.o

   IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
   Copyright 1996-2009 IAR Systems AB.

 0 bytes of memory

Errors: none
Warnings: none
Warnings: none
(0019295)
daniil (reporter)
2010-01-25 07:32

I rebuild cmake and get the same error. What can I do next?
(0019297)
Alex Neundorf (developer)
2010-01-25 11:53

What's your target operating system ?
I'll add the necessary files then.

Alex
(0019298)
Alex Neundorf (developer)
2010-01-25 12:05

Please use current cvs HEAD.

Alex
(0019299)
Alex Neundorf (developer)
2010-01-25 12:27

Please apply the attached IAR.patch to current cvs HEAD.
CMake should then recognize the compiler as an "IAR" compiler and process the files Compiler/IAR-C.cmake and Compiler/IAR-CXX.cmake when used for these languages.
If you look at these two files, you will see that both set just one variable, which is the CMAKE_(C|CXX)_COMPILE_OBJECT variable.
This now doesn't use the "-c" anymore, so it should now be possible to compile your files.

We may have too add more variables there, see Modules/CMake(C|CXX)Information.cmake, the part at the end where a bunch of variables are set, for the default settings of the variables.

Alex
(0019305)
daniil (reporter)
2010-01-26 03:14

I applied patch. I got the result. It compiles but it doesn't links because IAR uses different software for linking.
ilinkarm.exe - is arm linker
xlink.exe - is avr linker

linking could be done: xlink foo.o $(LINKER_OPTIONS) -o foo.a90

How can I add specific linker.

$ make VERBOSE=1
/C/CMake/bin/cmake.exe -H/C/Projects/cmake -B/C/Projects/cmake --check-build-sy
tem CMakeFiles/Makefile.cmake 0
/C/CMake/bin/cmake.exe -E cmake_progress_start /C/Projects/cmake/CMakeFiles /C/
rojects/cmake/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/c/Projects/cmake'
make -f CMakeFiles/my.dir/build.make CMakeFiles/my.dir/depend
make[2]: Entering directory `/c/Projects/cmake'
/C/CMake/bin/cmake.exe -E cmake_depends "MSYS Makefiles" /C/Projects/cmake /C/P
ojects/cmake /C/Projects/cmake /C/Projects/cmake /C/Projects/cmake/CMakeFiles/m
.dir/DependInfo.cmake --color=
Dependee "c:/Projects/cmake/CMakeFiles/my.dir/DependInfo.cmake" is newer than d
pender "c:/Projects/cmake/CMakeFiles/my.dir/depend.internal".
Dependee "C:/Projects/cmake/CMakeFiles/CMakeDirectoryInformation.cmake" is newe
 than depender "c:/Projects/cmake/CMakeFiles/my.dir/depend.internal".
Scanning dependencies of target my
make[2]: Leaving directory `/c/Projects/cmake'
make -f CMakeFiles/my.dir/build.make CMakeFiles/my.dir/build
make[2]: Entering directory `/c/Projects/cmake'
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/cmake/CMakeFiles 1
[100%] Building C object CMakeFiles/my.dir/main.c.obj
"/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe" /C/Pr
jects/cmake/main.c --cpu=xm256a3 -ms -o CMakeFiles/my.dir/main.c.obj

   IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
   Copyright 1996-2009 IAR Systems AB.

 6 bytes of CODE memory

Errors: none
Warnings: none
Linking C executable my
"/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe" --cpu
xm256a3 -ms "CMakeFiles/my.dir/main.c.obj" -o my

   IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
   Copyright 1996-2009 IAR Systems AB.

  ?
  ^
"c:\Projects\cmake\CMakeFiles\my.dir\main.c.obj",1 Warning[Pa050]: non-native
          end of line sequence detected (this diagnostic is only issued once)

  ?
  ^
"c:\Projects\cmake\CMakeFiles\my.dir\main.c.obj",1 Error[Pe007]: unrecognized
          token

  ?
  ^
"c:\Projects\cmake\CMakeFiles\my.dir\main.c.obj",1 Error[Pe169]: expected a
          declaration

  ?§
  ^
"c:\Projects\cmake\CMakeFiles\my.dir\main.c.obj",2 Error[Pe007]: unrecognized
          token

  ?§
   ^
"c:\Projects\cmake\CMakeFiles\my.dir\main.c.obj",2 Error[Pe007]: unrecognized
          token

Errors: 4
Warnings: 1
make[2]: *** [my] Error 2
make[2]: Leaving directory `/c/Projects/cmake'
make[1]: *** [CMakeFiles/my.dir/all] Error 2
make[1]: Leaving directory `/c/Projects/cmake'
make: *** [all] Error 2
(0019321)
Alex Neundorf (developer)
2010-01-26 11:50

Hi,

I attached two new versions of IAR-C.cmake and IAR-CXX.cmake, please replace the existing ones (from the previous patch) with these two files.
If you have a look at them, they now search for the xlink executable and set the CMAKE_(C|CXX)_LINK_EXECUTABLE variables accordingly.

Let me know how it works.
I guess we also need to add rules for creating static and shared libraries.
You can have a look at e.g. CMake(C|CXX)Information.cmake to see how this is done.

Alex
(0019330)
daniil (reporter)
2010-01-27 02:23

Hi,

It compiles and links without errors, so I have to try the real project with proper flags to test if firmware works at all.

There is some issues.
1. I think it should be in a tool chain file, because IAR for AVR and IAR for ARM is two different compilers with two different linkers. I have added the lines into my tool chain file, it works.

   FIND_PROGRAM(CMAKE_IAR_LINKER xlink HINTS ${_CMAKE_TOOLCHAIN_LOCATION} )
   SET(CMAKE_LINKER "${CMAKE_IAR_LINKER}" CACHE FILEPATH "The IAR linker" FORCE)

   MESSAGE(STATUS "Found IAR linker: ${CMAKE_LINKER}")

2. How to use assembler? If it possible to generate objects files separately and then link them together?

3. What about shared libraries I don't know if it possible to create it at all, so I will investigate it.
  
Daniil
(0019331)
Alex Neundorf (developer)
2010-01-27 05:10

Regarding 1)
what is the name of the linker for AVR and what is the name for ARM ?
Can you make the compiler print all built-in macros and attach this here both for the ARM and the AVR compiler ?
Or, in other words, is there some define one can test for to check whether this is on ARM or on AVR ?
Like
#ifdef __AVR__
and something similar for ARM ?

Alex
(0019332)
daniil (reporter)
2010-01-27 05:38

ilinkarm.exe - IAR ARM linker
xlink.exe - IAR AVR, IAR AVR32 linker

iccavr.exe - IAR AVR C/C++ compiler
iccavr32.exe - IAR AVR32 C/C++ compiler
iccarm.exe - IAR ARM C/C++ compiler

aavr.exe - IAR AVR assembler
aavr32.exe - IAR AVR32 assembler
iasmarm.exe - IAR ARM assembler

iarchive.exe - IAR ARM archiver
xar.exe - IAR AVR, IAR AVR32 archiver

Yes there is such defines.
__ICCAVR__ for IAR AVR
__ICCARM__ for IAR ARM
__ICCAVR32__ for IAR AVR32


Daniil
(0019333)
Alex Neundorf (developer)
2010-01-27 06:20

Does the arm compiler also define any of the following ?
__arm__
__APCS_32__
__ARMEL__
__ARM_ARCH_3__
__ARM_ARCH_5T__
__ARM_EABI__

Alex
(0019334)
daniil (reporter)
2010-01-27 06:38

I think this is GNU's defines and compiler defines it itself depends on command line arguments.
I think IAR has different defines. I think they don't matter. In our project we don't use that defines at all.

e.g. __ARM_ARCH_3__ if mcpu=arm6.

Daniil
(0019336)
Alex Neundorf (developer)
2010-01-27 12:40

Yes, the defines listed above come from the gcc for arm.
It would be easier for cmake if the IAR compiler defined some of the same macros, so it needs only to test for those, and not for different ones for every compiler.
So, does the IAR arm compiler define some of them ?

Is there documentation for the IAR ARM compiler somewhere online ?

Alex
(0019339)
Alex Neundorf (developer)
2010-01-27 15:07

Ok, found it:
ftp://ftp.iar.se/WWWfiles/arm/Guides/odarm-4.pdf [^]
ftp://ftp.iar.se/WWWfiles/avr/guides/ocavr.pdf [^]
ftp://ftp.iar.se/WWWfiles/avr32/guides/ocavr32.pdf [^]

And the overview over all compilers:
http://www.iar.com/website1/1.0.1.0/675/1/ [^]

Alex
(0019340)
Alex Neundorf (developer)
2010-01-27 15:41

Please try the attached IAR-with-linker.patch, it is again against cvs HEAD.
And please post the output from an initial CMake run, I'd like to see whether it detects the ABI correctly.

Alex
(0019341)
Alex Neundorf (developer)
2010-01-27 15:49

Ignore IAR-with-linker.patch, it's not working.
Please try IAR-with-linker-2.patch instead.

Alex
(0019351)
daniil (reporter)
2010-01-28 09:33

Hi,

Please take a look, at my project I test on daniil_project.rar, if It is OK?
If not provide me with new one.

This what I get
AVR compiler.

********************************************************************************
dkasyanov@DKASYANOV2 /c/Projects/cmake
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=./iar.cmake .
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- Found IAR linker: CMAKE_IAR_LINKER-NOTFOUND
-- Processing Compiler/IAR-CXX.cmake...
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Projects/cmake

dkasyanov@DKASYANOV2 /c/Projects/cmake
$ make
Scanning dependencies of target my
[100%] Building C object CMakeFiles/my.dir/main.c.obj

   IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
   Copyright 1996-2009 IAR Systems AB.

 90 bytes of CODE memory (+ 7 bytes shared)
  2 bytes of DATA memory

Errors: none
Warnings: none
Linking C executable my
/bin/sh: CMAKE_IAR_LINKER-NOTFOUND: command not found
make[2]: *** [my] Error 127
make[1]: *** [CMakeFiles/my.dir/all] Error 2
make: *** [all] Error 2

dkasyanov@DKASYANOV2 /c/Projects/cmake
********************************************************************************
And this is for ARM

dkasyanov@DKASYANOV2 /c/Projects/cmake
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=./iarArm.cmake .
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- Found IAR linker: CMAKE_IAR_LINKER-NOTFOUND
-- Processing Compiler/IAR-CXX.cmake...
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Projects/cmake

dkasyanov@DKASYANOV2 /c/Projects/cmake
$ make
Scanning dependencies of target my
[100%] Building C object CMakeFiles/my.dir/main.c.obj

   IAR ANSI C/C++ Compiler V5.41.0.51741/W32 for ARM
   Copyright (C) 1999-2009 IAR Systems AB.

 100 bytes of CODE memory
   4 bytes of DATA memory

Errors: none
Warnings: none
Linking C executable my
/bin/sh: CMAKE_IAR_LINKER-NOTFOUND: command not found
make[2]: *** [my] Error 127
make[1]: *** [CMakeFiles/my.dir/all] Error 2
make: *** [all] Error 2

Daniil
(0019359)
Alex Neundorf (developer)
2010-01-28 13:54

Don't use the FORCE_COMPILER macros, they make cmake skip the compiler tests, and this shouldn't be necessary.
Just do
set(CMAKE_C_COMPILER <full path>/iccarm)
etc.
and then we should get it working.
(it doesn't find the linker now because it doesn't check for the full path to the compiler, which it would do if the compiler is not forced).

Alex
(0019361)
daniil (reporter)
2010-01-29 01:46

This what I get this time.
dkasyanov@DKASYANOV2 /c/Projects/cmake
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=./iarArm.cmake .
-- The C compiler identification is IAR
-- The CXX compiler identification is unknown
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- Found IAR linker: CMAKE_IAR_LINKER-NOTFOUND
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCCompiler.cmake:50 (MESSAGE):
  The C compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.4/arm/bin/iccarm.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/cmake/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/cmake/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin/iccarm.exe"
  /C/Projects/cmake/CMakeFiles/CMakeTmp/testCCompiler.c -o
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj



     IAR ANSI C/C++ Compiler V5.41.0.51741/W32 for ARM
     Copyright (C) 1999-2009 IAR Systems AB.



   8 bytes of CODE memory



  Errors: none

  Warnings: none

  Linking C executable cmTryCompileExec

  CMAKE_IAR_LINKER-NOTFOUND
  "CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj" -o cmTryCompileExec

  /bin/sh: CMAKE_IAR_LINKER-NOTFOUND: command not found

  make[1]: *** [cmTryCompileExec] Error 127

  make[1]: Leaving directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!


This is my toolchain iarArm.cmake. If it is wrong provide me with your.


# this one is important
SET(CMAKE_SYSTEM_NAME Generic)

# specify the cross compiler
set(CMAKE_C_COMPILER iccarm)
set(CMAKE_CXX_COMPILER iccarm)

# where is the target environment
SET(CMAKE_FIND_ROOT_PATH C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin)

# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Daniil
(0019363)
Alex Neundorf (developer)
2010-01-29 07:41

Are ilink and xlink in the same directory as the compiler or in some other directory ?

Alex
(0019365)
daniil (reporter)
2010-01-29 07:52

Yes, they are in a same directory and they are also in a PATH.
(0019375)
Alex Neundorf (developer)
2010-02-01 06:03

Please replace the "IAR.cmake" from the previous patch with the one I attached now. It will not make it work, it will just produce more debug output, so I see what's going on.

Alex
(0019376)
daniil (reporter)
2010-02-01 06:20

dkasyanov@DKASYANOV2 /c/Projects/cmake
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=./iarAvr.cmake .
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCCompiler.cmake:50 (MESSAGE):
  The C compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/bin/iccavr.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/cmake/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/cmake/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe" -o
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj -c
  /C/Projects/cmake/CMakeFiles/CMakeTmp/testCCompiler.c



     IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
     Copyright 1996-2009 IAR Systems AB.

  Command line error: Unexpected command line arguments:

            -c

  make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj] Error 2

  make[1]: Leaving directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!
(0019377)
Alex Neundorf (developer)
2010-02-01 06:54

Hmm, I do not see the "Processing Compiler/IAR.cmake..." in the output as in your previous post.
Did you use a clean CMake and just put the IAR.cmake there or did you use the patched cmake from the last try and replace the IAR.cmake there ?

Alex
(0019378)
daniil (reporter)
2010-02-01 07:42

My fault.

I sent you avr version... so send you both avr and arm.

//////////////////////////////////////////////////////////////////////////////
                                AVR VERSION
//////////////////////////////////////////////////////////////////////////////
dkasyanov@DKASYANOV2 /c/Projects/cmake
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=./iarAvr.cmake .
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCCompiler.cmake:50 (MESSAGE):
  The C compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/bin/iccavr.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/cmake/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/cmake/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe" -o
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj -c
  /C/Projects/cmake/CMakeFiles/CMakeTmp/testCCompiler.c



     IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
     Copyright 1996-2009 IAR Systems AB.

  Command line error: Unexpected command line arguments:

            -c

  make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj] Error 2

  make[1]: Leaving directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!

//////////////////////////////////////////////////////////////////////////////
                                ARM VERSION
//////////////////////////////////////////////////////////////////////////////

dkasyanov@DKASYANOV2 /c/Projects/cmake
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=./iarArm.cmake .
-- The C compiler identification is IAR
-- The CXX compiler identification is unknown
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bi
n/iccarm.exe-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: -C:/Program Files/IAR Systems/Embedded Workbench 5
.4/arm/bin-
-- _IAR_LINKER_NAME: --
-- Found IAR linker: CMAKE_IAR_LINKER-NOTFOUND
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCCompiler.cmake:50 (MESSAGE):
  The C compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.4/arm/bin/iccarm.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/cmake/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/cmake/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin/iccarm.exe"
  /C/Projects/cmake/CMakeFiles/CMakeTmp/testCCompiler.c -o
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj



     IAR ANSI C/C++ Compiler V5.41.0.51741/W32 for ARM
     Copyright (C) 1999-2009 IAR Systems AB.



   8 bytes of CODE memory



  Errors: none

  Warnings: none

  Linking C executable cmTryCompileExec

  CMAKE_IAR_LINKER-NOTFOUND
  "CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj" -o cmTryCompileExec

  /bin/sh: CMAKE_IAR_LINKER-NOTFOUND: command not found

  make[1]: *** [cmTryCompileExec] Error 127

  make[1]: Leaving directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!
(0019379)
Alex Neundorf (developer)
2010-02-01 08:00

I updated the attached IAR.cmake, pleace the old IAR.cmake with the new one. We should get further now.
CMAKE_C_COMPILER_ABI was not set yet at that point, so we just match the compiler name to see whether we have the arm or avr compiler.

Alex
(0019380)
daniil (reporter)
2010-02-01 08:12

Do I have to rebuild the tree when update IAR.cmake?
I do not.
(0019381)
Alex Neundorf (developer)
2010-02-01 08:14

No, you don't (but a "make install" will not actually compile anything, just install it).
You just have to make sure the new IAR.cmake ends up in the installed cmake (nothing has to be recompiled).

Alex
(0019382)
daniil (reporter)
2010-02-01 08:15

// ARM //
dkasyanov@DKASYANOV2 /c/Projects/cmake
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=./iarArm.cmake .
-- The C compiler identification is IAR
-- The CXX compiler identification is unknown
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bi
n/iccarm.exe-
-- CMAKE_CXX_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/
bin/iccarm.exe-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: -C:/Program Files/IAR Systems/Embedded Workbench 5
.4/arm/bin-
-- _IAR_LINKER_NAME: -ilink-
-- Found IAR linker: CMAKE_IAR_LINKER-NOTFOUND
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCCompiler.cmake:50 (MESSAGE):
  The C compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.4/arm/bin/iccarm.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/cmake/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/cmake/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin/iccarm.exe"
  /C/Projects/cmake/CMakeFiles/CMakeTmp/testCCompiler.c -o
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj



     IAR ANSI C/C++ Compiler V5.41.0.51741/W32 for ARM
     Copyright (C) 1999-2009 IAR Systems AB.



   8 bytes of CODE memory



  Errors: none

  Warnings: none

  Linking C executable cmTryCompileExec

  CMAKE_IAR_LINKER-NOTFOUND
  "CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj" -o cmTryCompileExec

  /bin/sh: CMAKE_IAR_LINKER-NOTFOUND: command not found

  make[1]: *** [cmTryCompileExec] Error 127

  make[1]: Leaving directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!
(0019385)
Alex Neundorf (developer)
2010-02-01 09:06

Hmm.
For the arm compiler "ilink" should be used, right ?

Is ilink.exe located in "C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin/" or in some other directory ?
(0019386)
daniil (reporter)
2010-02-01 09:23

Why ilink it should be ilinkarm.exe. See my post above.

retype here

ilinkarm.exe - IAR ARM linker
xlink.exe - IAR AVR, IAR AVR32 linker

iccavr.exe - IAR AVR C/C++ compiler
iccavr32.exe - IAR AVR32 C/C++ compiler
iccarm.exe - IAR ARM C/C++ compiler

aavr.exe - IAR AVR assembler
aavr32.exe - IAR AVR32 assembler
iasmarm.exe - IAR ARM assembler

iarchive.exe - IAR ARM archiver
xar.exe - IAR AVR, IAR AVR32 archiver

Yes there is such defines.
__ICCAVR__ for IAR AVR
__ICCARM__ for IAR ARM
__ICCAVR32__ for IAR AVR32

Daniil
(0019387)
daniil (reporter)
2010-02-01 09:27

I have change IAR.cmake to

# This file is processed when the IAR compiler is used for a C or C++ file
# Documentation can be downloaded here: http://www.iar.com/website1/1.0.1.0/675/1/ [^]

IF(_IAR_CMAKE_LOADED)
  RETURN()
ENDIF(_IAR_CMAKE_LOADED)
SET(_IAR_CMAKE_LOADED TRUE)

MESSAGE(STATUS "Processing Compiler/IAR.cmake...")
message(STATUS "CMAKE_C_COMPILER: -${CMAKE_C_COMPILER}-")
message(STATUS "CMAKE_CXX_COMPILER: -${CMAKE_CXX_COMPILER}-")
message(STATUS "CMAKE_C_COMPILER_ABI: -${CMAKE_C_COMPILER_ABI}-")
message(STATUS "_CMAKE_TOOLCHAIN_LOCATION: -${_CMAKE_TOOLCHAIN_LOCATION}-")

# For arm, IAR uses the "ilinkarm" linker:
IF("${CMAKE_C_COMPILER}" MATCHES "arm" OR "${CMAKE_CXX_COMPILER}" MATCHES "arm")
  SET(_IAR_LINKER_NAME "ilinkarm")
ENDIF("${CMAKE_C_COMPILER}" MATCHES "arm" OR "${CMAKE_CXX_COMPILER}" MATCHES "arm")

# For AVR and AVR32, IAR uses the "xlink" linker:
IF("${CMAKE_C_COMPILER}" MATCHES "avr" OR "${CMAKE_CXX_COMPILER}" MATCHES "avr")
  SET(_IAR_LINKER_NAME "xlink")
ENDIF("${CMAKE_C_COMPILER}" MATCHES "avr" OR "${CMAKE_CXX_COMPILER}" MATCHES "avr")


FIND_PROGRAM(CMAKE_IAR_LINKER "${_IAR_LINKER_NAME}" HINTS ${_CMAKE_TOOLCHAIN_LOCATION} )
SET(CMAKE_LINKER "${CMAKE_IAR_LINKER}" CACHE FILEPATH "The IAR linker" FORCE)

message(STATUS "_IAR_LINKER_NAME: -${_IAR_LINKER_NAME}-")


MESSAGE(STATUS "Found IAR linker: ${CMAKE_LINKER}")

and get the result

dkasyanov@DKASYANOV2 /c/Projects/cmake
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=./iarArm.cmake .
-- The C compiler identification is IAR
-- The CXX compiler identification is unknown
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bi
n/iccarm.exe-
-- CMAKE_CXX_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/
bin/iccarm.exe-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: -C:/Program Files/IAR Systems/Embedded Workbench 5
.4/arm/bin-
-- _IAR_LINKER_NAME: -ilinkarm-
-- Found IAR linker: C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin
/ilinkarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe -- works
-- Detecting C compiler ABI info
CMake Error: Could not COPY_FILE.
  OutputFile: ''
    copyFile: 'C:/Projects/cmake/CMakeFiles/CMakeDetermineCompilerABI_C.bin'

Unable to find executable for try_compile: tried "C:/Projects/cmake/CMakeFiles/C
MakeTmp/cmTryCompileExec" and "C:/Projects/cmake/CMakeFiles/CMakeTmp/Debug/cmTry
CompileExec" and "C:/Projects/cmake/CMakeFiles/CMakeTmp/Development/cmTryCompile
Exec".

-- Detecting C compiler ABI info - done
CMake Error at C:/CMake/Modules/CMakeDetermineCompilerABI.cmake:40 (FILE):
  file STRINGS file
  "C:/Projects/cmake/CMakeFiles/CMakeDetermineCompilerABI_C.bin" cannot be
  read.
Call Stack (most recent call first):
  C:/CMake/Modules/CMakeTestCCompiler.cmake:69 (CMAKE_DETERMINE_COMPILER_ABI)
  CMakeLists.txt:3 (project)


-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.4/arm/bin/iccarm.exe
-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.4/arm/bin/iccarm.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCXXCompiler.cmake:43 (MESSAGE):
  The C++ compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.4/arm/bin/iccarm.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/cmake/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/cmake/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building CXX object CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin/iccarm.exe" -o
  CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.obj -c
  /C/Projects/cmake/CMakeFiles/CMakeTmp/testCXXCompiler.cxx



     IAR ANSI C/C++ Compiler V5.41.0.51741/W32 for ARM

  Command line error: Copyright (C) 1999-2009 IAR Systems AB.

  Unexpected command line arguments:

            -c

  make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.obj]
  Error 2

  make[1]: Leaving directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!
(0019388)
Alex Neundorf (developer)
2010-02-01 09:29

The odarm-4.pdf talks about the "ILINK" linker, so I thought "ilink.exe" would be the name.
Please try the updated version of the attached IAR.cmake

Alex
(0019389)
daniil (reporter)
2010-02-01 09:32

dkasyanov@DKASYANOV2 /c/Projects/cmake
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=./iarArm.cmake .
-- The C compiler identification is IAR
-- The CXX compiler identification is unknown
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bi
n/iccarm.exe-
-- CMAKE_CXX_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/
bin/iccarm.exe-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: -C:/Program Files/IAR Systems/Embedded Workbench 5
.4/arm/bin-
-- _IAR_LINKER_NAME: -ilinkarm-
-- Found IAR linker: C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin
/ilinkarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe -- works
-- Detecting C compiler ABI info
CMake Error: Could not COPY_FILE.
  OutputFile: ''
    copyFile: 'C:/Projects/cmake/CMakeFiles/CMakeDetermineCompilerABI_C.bin'

Unable to find executable for try_compile: tried "C:/Projects/cmake/CMakeFiles/C
MakeTmp/cmTryCompileExec" and "C:/Projects/cmake/CMakeFiles/CMakeTmp/Debug/cmTry
CompileExec" and "C:/Projects/cmake/CMakeFiles/CMakeTmp/Development/cmTryCompile
Exec".

-- Detecting C compiler ABI info - done
CMake Error at C:/CMake/Modules/CMakeDetermineCompilerABI.cmake:40 (FILE):
  file STRINGS file
  "C:/Projects/cmake/CMakeFiles/CMakeDetermineCompilerABI_C.bin" cannot be
  read.
Call Stack (most recent call first):
  C:/CMake/Modules/CMakeTestCCompiler.cmake:69 (CMAKE_DETERMINE_COMPILER_ABI)
  CMakeLists.txt:3 (project)


-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.4/arm/bin/iccarm.exe
-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.4/arm/bin/iccarm.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCXXCompiler.cmake:43 (MESSAGE):
  The C++ compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.4/arm/bin/iccarm.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/cmake/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/cmake/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building CXX object CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin/iccarm.exe" -o
  CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.obj -c
  /C/Projects/cmake/CMakeFiles/CMakeTmp/testCXXCompiler.cxx



     IAR ANSI C/C++ Compiler V5.41.0.51741/W32 for ARM

  Command line error: Copyright (C) 1999-2009 IAR Systems AB.

  Unexpected command line arguments:

            -c

  make[1]: make[1]: Leaving directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  *** [CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.obj] Error 2

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!
(0019390)
Alex Neundorf (developer)
2010-02-01 09:33

Ah, I see you already did that yourself.
I'm looking for the C++ error now.
(0019391)
daniil (reporter)
2010-02-01 09:38

This is a iccarm command line options, to make it c++ it should be provided options
--ec++ Embedded C++
--eec++ Extended EC++ (EC++ with templates/namespaces/mutable/casts)


$ iccarm

   IAR ANSI C/C++ Compiler V5.41.0.51741/W32 for ARM
   Copyright (C) 1999-2009 IAR Systems AB.

Available command line options:
--aapcs {std|vfp}
                Specify calling convention.
--aeabi Generate aeabi compliant code
--align_sp_on_irq
                Generate code to align SP on entry to __irq functions
--arm Generate code in arm mode, same as --cpu_mode arm
--char_is_signed
                'Plain' char is treated as signed char
--cpu core Specify target core
                Valid options are core names such as ARM7TDMI
                and architecture names such as 4T
                ARM7TDMI is default
--cpu_mode {arm|a|thumb|t}
                Select default mode for functions, arm is default
--debug
-r Insert debug info in object file
--dependencies=[i][m] file|directory
                List file dependencies
                   i Include filename only (default)
                   m Makefile style
--diagnostics_tables file|directory
                Dump diagnostic message tables to file
--diag_error tag,tag,...
                Treat the list of tags as error diagnostics
--diag_remark tag,tag,...
                Treat the list of tags as remark diagnostics
--diag_suppress tag,tag,...
                Suppress the list of tags as diagnostics
--diag_warning tag,tag,...
                Treat the list of tags as warning diagnostics
--discard_unused_publics
                Discard unused public functions and variables
--dlib_config pathname
                Specify DLib library configuration file
--ec++ Embedded C++
--eec++ Extended EC++ (EC++ with templates/namespaces/mutable/casts)
--enable_hardware_workaround waid[,waid[...]]
                Generate hardware workaround for specified problem
--enable_multibytes
                Enable multibyte support
--endian {little|l|big|b}
                Select byte order, little-endian is default
--enum_is_int Force the size of all enumeration types to be at least 4 bytes
--error_limit limit
                Stop after this many errors (0 = no limit)
--fpu {VFPv1|VFPv2|VFPv3{_D16}{_FP16}|VFP9-S|none}
                Specify target FPU coprocessor support
                Default is none, which selects the software
                floating-point library.
--generate_alf output file name
                Generate an ALF description of the module
--header_context
                Adds include file context to diagnostics
--interwork Generate interworking code
--legacy legacyGenerationMode
                Generate object files compatible with
                older toolchains. Valid options are:
                RVCT3.0
--mfc Enable multiple file compilation
--migration_preprocessor_extensions
                Enable IAR migration preprocessor extensions
--misrac1998=arg,arg,...
                Enable MISRA-C 1998 diagnostics
                    all Enable all rules
                    required Enable all required rules
                    i Enable rule i
                    i-j Enable rule i through j
                    ~i Disable rule i
                    ~i-j Disable rule i through j
--misrac2004=arg,arg,...
                Enable MISRA-C 2004 diagnostics
                    all Enable all rules
                    required Enable all required rules
                    X Enable rule or chapter
                    X-Y Enable range
                    ~X Disable rule or chapter
                    ~X-Y Disable range
                  where X and Y is one of:
                    i All rules in chapter i
                    i.j Rule i.j
--misrac_verbose
                Enable verbose MISRA C messages
--no_clustering Disable static clustering for static and global variables
--no_code_motion
                Disable code motion
--no_const_align
                Turn off the alignment optimization for constants
--no_cse Disable common sub-expression elimination
--no_fragments Do not generate section fragments
--no_guard_calls
                Use the optimized non-AEABI function static initialization sch
e
--no_inline Disable function inlining
--no_loop_align Disable alignment of labels in loops (Thumb2)
--no_mem_idioms Disable idiom recognition for memcpy/memset/memclr
--no_path_in_file_macros
                Strip path from __FILE__ and __BASE_FILE__ macros
--no_scheduling Disable instruction scheduling
--no_tbaa Disable type based alias analysis
--no_typedefs_in_diagnostics
                Don't use typedefs when printing types
--no_unaligned_access
                Don't generate unaligned accesses
--no_unroll Disable loop unrolling
--no_warnings Disable generation of warnings
--no_wrap_diagnostics
                Don't wrap long lines in diagnostic messages
--only_stdout Use stdout only (no console output on stderr)
--output file|path
-o file|path Specify object file
--predef_macros file|directory
                Output predefined macros
--preinclude filename
                Include file before normal source
--preprocess=[c][n][l] file|directory
                Preprocessor output
                   c Include comments
                   n Preprocess only
                   l Include #line directives
--public_equ symbol[=value]
                Define public assembler symbol (EQU)
--relaxed_fp enable floating point optimizations that may affect the result
--remarks Enable generation of remarks
--require_prototypes
                Require prototypes for all called or public functions
--section section-name=new section-name
                Rename section
--separate_cluster_for_initialized_variables
                Separate initialized and uninitialized variables,
                when using variable clustering
--silent Silent operation
--strict_ansi Strict ANSI rules
--thumb Generate code in thumb mode, same as --cpu_mode thumb
--use_unix_directory_separators
                Use forward slashes in paths in debug information
--warnings_affect_exit_code
                Warnings affect exit code
--warnings_are_errors
                All warnings are errors
-D symbol[=value]
                Define macro (same as #define symbol [value])
-e Enable IAR C/C++ language extensions
-f file Read command line options from file
-I directory Add #include search directory
-l[c|C|D|E|a|A|b|B][N][H] file|directory
                Output list file
                   c C source listing
                   C with assembly code
                   D with pure assembly code
                   E with non-sequential assembly code
                   a Assembler file
                   A with C source
                   b Basic assembler file
                   B with C source
                   N Don't include diagnostics
                   H Include header file source lines
-O[n|l|m|h|hs|hz]
                Select level of optimization:
                   n No optimizations
                   l Low optimizations (default)
                   m Medium optimizations
                   h High optimizations
                   hz High optimizations, tuned for small code size
                   hs High optimizations, tuned for high speed
                       (-O without argument) The same setting as -Oh
(0019392)
Alex Neundorf (developer)
2010-02-01 09:46

Does it work if you add the --ec++ to CMAKE_CXX_COMPILER in your toolchain file ?
Like
set(CMAKE_CXX_COMPILER "c:/.../iccarm.exe" "--ec++")
(0019393)
daniil (reporter)
2010-02-01 09:50

I think it is works.

dkasyanov@DKASYANOV2 /c/Projects/cmake
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=./iarArm.cmake .
-- The C compiler identification is IAR
-- The CXX compiler identification is IAR
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bi
n/iccarm.exe-
-- CMAKE_CXX_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/
bin/iccarm.exe-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: -C:/Program Files/IAR Systems/Embedded Workbench 5
.4/arm/bin-
-- _IAR_LINKER_NAME: -ilinkarm-
-- Found IAR linker: C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin
/ilinkarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe -- works
-- Detecting C compiler ABI info
CMake Error: Could not COPY_FILE.
  OutputFile: ''
    copyFile: 'C:/Projects/cmake/CMakeFiles/CMakeDetermineCompilerABI_C.bin'

Unable to find executable for try_compile: tried "C:/Projects/cmake/CMakeFiles/C
MakeTmp/cmTryCompileExec" and "C:/Projects/cmake/CMakeFiles/CMakeTmp/Debug/cmTry
CompileExec" and "C:/Projects/cmake/CMakeFiles/CMakeTmp/Development/cmTryCompile
Exec".

-- Detecting C compiler ABI info - done
CMake Error at C:/CMake/Modules/CMakeDetermineCompilerABI.cmake:40 (FILE):
  file STRINGS file
  "C:/Projects/cmake/CMakeFiles/CMakeDetermineCompilerABI_C.bin" cannot be
  read.
Call Stack (most recent call first):
  C:/CMake/Modules/CMakeTestCCompiler.cmake:69 (CMAKE_DETERMINE_COMPILER_ABI)
  CMakeLists.txt:3 (project)


-- Processing Compiler/IAR-CXX.cmake...
-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.4/arm/bin/iccarm.exe
-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.4/arm/bin/iccarm.exe -- works
-- Detecting CXX compiler ABI info
CMake Error: Could not COPY_FILE.
  OutputFile: ''
    copyFile: 'C:/Projects/cmake/CMakeFiles/CMakeDetermineCompilerABI_CXX.bin'

Unable to find executable for try_compile: tried "C:/Projects/cmake/CMakeFiles/C
MakeTmp/cmTryCompileExec" and "C:/Projects/cmake/CMakeFiles/CMakeTmp/Debug/cmTry
CompileExec" and "C:/Projects/cmake/CMakeFiles/CMakeTmp/Development/cmTryCompile
Exec".

-- Detecting CXX compiler ABI info - done
CMake Error at C:/CMake/Modules/CMakeDetermineCompilerABI.cmake:40 (FILE):
  file STRINGS file
  "C:/Projects/cmake/CMakeFiles/CMakeDetermineCompilerABI_CXX.bin" cannot be
  read.
Call Stack (most recent call first):
  C:/CMake/Modules/CMakeTestCXXCompiler.cmake:62 (CMAKE_DETERMINE_COMPILER_ABI)
  CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!
(0019396)
Alex Neundorf (developer)
2010-02-01 10:16

Hmm, not sure why it doesn't find the output file.

What is the filename suffix of the generated executable ?
Do you set CMAKE_EXECUTABLE_SUFFIX somewhere ?
You could add a
message(STATUS "CMAKE_EXECUTABLE_SUFFIX: ${CMAKE_EXECUTABLE_SUFFIX}")
to IAR-C.cmake to see what is set.
What should the suffix be ?
(0019397)
daniil (reporter)
2010-02-01 10:28

It prints nothing.
What is executable suffix? Is it extension?

dkasyanov@DKASYANOV2 /c/Projects/cmake
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=./iarArm.cmake .
-- The C compiler identification is IAR
-- The CXX compiler identification is IAR
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bi
n/iccarm.exe-
-- CMAKE_CXX_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/
bin/iccarm.exe-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: -C:/Program Files/IAR Systems/Embedded Workbench 5
.4/arm/bin-
-- _IAR_LINKER_NAME: -ilinkarm-
-- Found IAR linker: C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin
/ilinkarm.exe
-- CMAKE_EXECUTABLE_SUFFIX:
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe -- works
-- Detecting C compiler ABI info
CMake Error: Could not COPY_FILE.
  OutputFile: ''
    copyFile: 'C:/Projects/cmake/CMakeFiles/CMakeDetermineCompilerABI_C.bin'
(0019398)
Alex Neundorf (developer)
2010-02-01 10:59

Yes, the filename extension, e.g. the ".exe" under Windows.
".a90" ?
For avr and arm ?

Alex
(0019423)
daniil (reporter)
2010-02-02 02:15

I am not sure but, arm linker generates elf file so the extension should be .elf.
but avr linker has different formats -Fformat, so there should be a different extension. But commonly used is .hex or .bin but I prefer .hex if it isn't elf.
(0019425)
daniil (reporter)
2010-02-02 03:02

I have uploaded the documentation about iar compilers. The documentation is provided with my IAR distribution.
(0019439)
Alex Neundorf (developer)
2010-02-02 14:12

Thanks for the information.
Can you please try what happens if you manually compile and link an executable with the arm compiler+linker, but don't specify any output extension ?
E.g. something like

ilinkarm main.o -o output

Will it create "output" or "outbut.something" ?

Alex
(0019449)
daniil (reporter)
2010-02-03 01:49

For ARM output.out - it is an elf file. I think for arm *.elf extension would be more informative.

But for AVR's xlink you should set a file format. The extensions is depends on that format.

dkasyanov@DKASYANOV2 /c/Projects/cmake
$ xlink -Fintel-extended main.o -o output
result is output.a90

Daniil
dkasyanov@DKASYANOV2 /c/Projects/cmake
$ xlink -Fmotorola-s37 main.o -o output
result is output.s37

Technically as I mentioned we can set for ARM .elf extension, but for AVR .hex extension.
Personally I think is native extension as s37 or a90 is more informative.
(0019453)
Alex Neundorf (developer)
2010-02-03 16:08

I attached a new patch IAR-2.patch, which is a patch against clean cvs HEAD.
It now sets CMAKE_EXECUTABLE_SUFFIX (in IAR.cmake) and it tries to put the first argument (the --ec++) into CMAKE_CXX_COMPILE_OBJECT (in IAR-CXX.cmake).

Please give it a try.
I'd say we should concentrate on one architecture first, e.g. the arm.

Alex
(0019454)
daniil (reporter)
2010-02-04 03:03

I have two variants of error

/*******************************************************************************/
/ First if set(CMAKE_CXX_COMPILER iccarm) in my tool chain file
/
////////////////////////////////////////////////////////////////////////////////
dkasyanov@DKASYANOV2 /c/Projects/cmake
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=./iarArm.cmake .
-- The C compiler identification is IAR
-- The CXX compiler identification is unknown
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bi
n/iccarm.exe-
-- CMAKE_CXX_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/
bin/iccarm.exe-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: -C:/Program Files/IAR Systems/Embedded Workbench 5
.4/arm/bin-
-- _IAR_LINKER_NAME: -ilinkarm-
-- Found IAR linker: C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin
/ilinkarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.4/arm/bin/iccarm.exe
-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.4/arm/bin/iccarm.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCXXCompiler.cmake:43 (MESSAGE):
  The C++ compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.4/arm/bin/iccarm.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/cmake/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/cmake/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building CXX object CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin/iccarm.exe" -o
  CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.obj -c
  /C/Projects/cmake/CMakeFiles/CMakeTmp/testCXXCompiler.cxx



     IAR ANSI C/C++ Compiler V5.41.0.51741/W32 for ARM
     Copyright (C) 1999-2009 IAR Systems AB.

  Command line error: Unexpected command line arguments:

            -c

  make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.obj]
  Error 2

  make[1]: Leaving directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)

/******************************************************************************
/
/ if set(CMAKE_CXX_COMPILER iccarm "--ec++") in my tool chain file
/
//////////////////////////////////////////////////////////////////////////////
dkasyanov@DKASYANOV2 /c/Projects/cmake
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=./iarArm.cmake .
-- The C compiler identification is IAR
-- The CXX compiler identification is IAR
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bi
n/iccarm.exe-
-- CMAKE_CXX_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/
bin/iccarm.exe-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: -C:/Program Files/IAR Systems/Embedded Workbench 5
.4/arm/bin-
-- _IAR_LINKER_NAME: -ilinkarm-
-- Found IAR linker: C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin
/ilinkarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Processing Compiler/IAR-CXX.cmake...
-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.4/arm/bin/iccarm.exe
-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.4/arm/bin/iccarm.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCXXCompiler.cmake:43 (MESSAGE):
  The C++ compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.4/arm/bin/iccarm.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/cmake/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/cmake/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building CXX object CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin/iccarm.exe"
  --ec++ --ec++ /C/Projects/cmake/CMakeFiles/CMakeTmp/testCXXCompiler.cxx -o
  CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.obj



     IAR ANSI C/C++ Compiler V5.41.0.51741/W32 for ARM
     Copyright (C) 1999-2009 IAR Systems AB.

  Command line error: Option can only occur once: --ec++

  make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.obj]
  Error 2

  make[1]: Leaving directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!
(0019456)
Alex Neundorf (developer)
2010-02-04 16:09

Please remove the "${CMAKE_CXX_COMPILER_ARG1}" from IAR-CXX.cmake.

To do it really step-by-step, maybe we should start with a C-only program.
This would mean a CMakeLists.txt like:

project(Foo C)
add_executable(hello main.c)

(listing the "C" in the project() call explicitely enables only the C language, no other language (CXX) )

Alex
(0019458)
daniil (reporter)
2010-02-05 02:23

Hi,

ARM simples example is compiled successfully both C and C++,
my congratulations.

This what I get with AVR.


dkasyanov@DKASYANOV2 /c/Projects/cmake
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=./iarAvr.cmake .
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbenc
 5.3/avr/bin/iccavr.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbenc
 5.3/avr/bin/iccavr.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCCompiler.cmake:50 (MESSAGE):
  The C compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/bin/iccavr.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/cmake/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/cmake/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe" -o
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj -c
  /C/Projects/cmake/CMakeFiles/CMakeTmp/testCCompiler.c

  Command line error:

     IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
     Copyright 1996-2009 IAR Systems AB.

  Unexpected command line argummake[1]: Leaving directory
  `/c/Projects/cmake/CMakeFiles/CMakeTmp'

  ents:

            -c

  make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj] Error 2

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:12 (project)


-- Configuring incomplete, errors occurred!
(0019461)
Alex Neundorf (developer)
2010-02-05 13:26

Cool :-)
But I'd like get the ARM compiler first supported completely.

Can you please post the commands for
1) only preprocessing a file, so we get the preprocessed source file
2) assembling a file, I mean, the command so that the C/C++ source file is compiled into asembler code, but not actually assembled into a binary object file

3) Also, does the toolchain support shared libraries ?

4) What's the command for creating a static library ?

What can iasmarm.exe do ?
5) How do I call iasmarm to process an assembler file ?
6) May the file contain #include or other preprocessor statements ?

If we have all that, then I'd like to commit that to cmake cvs and then continue with support for AVR.

Alex
(0019467)
daniil (reporter)
2010-02-08 02:49

Actually all commands are described in a guide I have attached.

1) only preprocessing a file, so we get the preprocessed source file
Option:
--preprocess
Syntax --preprocess[=[c][n][l]] {filename|directory}
Parameters
For information about specifying a filename or a directory, see Rules for specifying a
filename or directory as parameters, page 156.
Description Use this option to generate preprocessed output to a named file.


2) assembling a file, I mean, the command so that the C/C++ source file is compiled into asembler code, but not actually assembled into a binary object file

Use these options to compile the skeleton code:
iccarm skeleton.c -lA .
The -lA option creates an assembler language output file including C or C++ source
lines as assembler comments. The . (period) specifies that the assembler file should be
named in the same way as the C or C++ module (skeleton), but with the filename
extension s. Also remember to specify a low level of optimization, and -e for enabling
language extensions.
The result is the assembler source output file skeleton.s.
Note: The -lA option creates a list file containing call frame information (CFI)
directives, which can be useful if you intend to study these directives and how they are used.


3) Also, does the toolchain support shared libraries ?
I think it doesn't

4) What's the command for creating a static library ?
dkasyanov@DKASYANOV2 /c/Projects/cmake
$ iarchive.exe

   IAR Archive Tool V1.1.1
   Copyright (C) 2008-2009 IAR Systems AB.
Usage: iarchive [command] archive obj1 ... objN
                iarchive [command] obj1 ... objN -o archive
                iarchive [command] archive

Available command line options:
--create Create new archive
--delete
-d Delete module(s) from archive
--extract
-x Extract module(s) from archive
--output archive
-o archive Name of archive file
--replace
-r Replace or add module(s) to archive
--silent Silent operation
--silent
-S silent operation
--symbols List symbol table of archive
--toc
-t List archive table of content
--verbose
-V verbose operation
-f file Read command line options from file


What can iasmarm.exe do ?
5) How do I call iasmarm to process an assembler file ?
dkasyanov@DKASYANOV2 /c/Projects/cmake
$ iasmarm

    IAR Assembler V5.41.0.51741/W32 for ARM
    Copyright (C) 1999-2009 IAR Systems AB.

Usage: iasmarm {<options>} <sourcefile> {<options>}
Sourcefile: source file with default extension: .msa, , .asm, or .s

Environment: IASMARM
Options (specified order is of no importance):
-c{DEAOM} Listing options
                 D: Disable listing, E: Disable macro expansion
                 A: List only assembled part O: List several lines of code
                 M: List Macro definition
-o file Put object on: <file> <.o>
-Opath Put object on: <path> \ <source> <.o>
-ws To make warnings generate exit code 1
-wstring Disable warnings
                 string: <+|-,><+|-range><,+|-range>...
                 range: low_warning_nr<-high_warning_nr>
                 example: -w turns all warnings off
                          -w-,+10-12,+20 turns all but 10,11,12 and 20 off

-Enumber Allow <number> errors
-f file Extend command line with <file> <.xcl>
-r Enable debugger output in object
-B Print debug info for assembler macros
-Mab Change asm.macro argument quote chars,
                  where a is start-of-quote and b is end-of-quote char.
                  default is a == < and b == >.
-l file Generate a list on: <file> <.lst>
-Lpath Generate a list on: <path> \ <source> <.lst>
-tn Set tab spacing between 2 and 9 (default 8)
-x{DI2} Generate cross-reference list
                 D: Show all #defines, I: Show Internal table
                 2: Dual line space listing
-i List #included files
-pnn Page listing with 'nn' lines/page (10-150)
-DSYMB Equivalent to: #define SYMB 1
-DSYMB=xx Equivalent to: #define SYMB xx
-USYMB Equivalent to: #undef SYMB
-Ipath Add #include search path
-G Open standard input as source
-s{+|-} Set case sensitivity for user symbols
                 -s and -s+ enables sensitivity, -s- disables it.
-S Silent operation of assembler
-N No header in listing
-n Enable multibytes
-j Enable alternative register names, operators and mnemonics
-e Use big-endian byte order
--endian {little|l|big|b}
              Specify target byte order
--cpu core Specify target core
                 Valid options are core names such as ARM7TDMI
                 and architecture names such as 4T
                 Default is ARM7TDMI
--fpu {VFPv1|VFPv2|VFPv3{_D16}{_FP16}|VFP9-S|none}
              Specify target FPU coprocessor support
                 Default is none, which selects the software
                 floating-point library.
--legacy {legacyOption}
              Generate object files compatible with
              older toolchains. Valid options are:
              RVCT3.0

See EWARM_AssemblerReference.ENU.pdf for details..

6) May the file contain #include or other preprocessor statements ?
According to EWARM_AssemblerReference.ENU.pdf it could.



Daniil
(0019512)
Alex Neundorf (developer)
2010-02-11 13:33

Please try the attached IAR-3.patch.
Now also creating static libraries from C and C++ files should work.
I'm not sure I got the arguments right. All the UNIX ar's need "cr", so I added --create --replace here too. Maybe this is wrong. Please let me know.

Please also check whether you can now generate assembler and preprocessed files. Enter "make help" in a directory, and then you should see the targets for creating these files. Please execute them, both for C and C++ and check whether they work, and whether they produce the files as they are named in the output. Example:

hammer:~/src/CMake/build dir/CMake/Source$ make help
...
... cmCTest.o
... cmCTest.i
... cmCTest.s
...

hammer:~/src/CMake/build dir/CMake/Source$ make cmCTest.i
Preprocessing CXX source to CMakeFiles/CTestLib.dir/cmCTest.i
hammer:~/src/CMake/build dir/CMake/Source$

I.e. the preprocessed file should then really be found as "CMakeFiles/CTestLib.dir/cmCTest.i" and not with an automatically determined name by the compiler.

Thanks
Alex
(0019514)
daniil (reporter)
2010-02-12 10:11

So I am not sure if I do it right.

So build cmake, then goes to /c/CMake/source
and typed make help, so I get this:

... cmCTest.obj
... cmCTest.i
... cmCTest.s

Then i did make cmCTest.i
and get this:
dkasyanov@DKASYANOV2 /c/CMake/Source
$ make cmTest.i
Preprocessing CXX source to CMakeFiles/CMakeLib.dir/cmTest.i.

Take a look at the cmTest.i attached... I don't actually understand what you mean "not with an automatically determined name by the compiler"

Daniil
(0019519)
Alex Neundorf (developer)
2010-02-12 12:14

No, that's not what I meant.
After applying the IAR-3.patch, enter "make help" in your project (not in cmake).
Then you should see the rules for building object files (*.o), and also for assembler and preprocessed files (*.i and *.s).
Then execute these rules for one or more of your source files and check if the resulting file is what is expected.

Alex
(0019528)
daniil (reporter)
2010-02-15 02:17

It looks it works there is a result.

dkasyanov@DKASYANOV2 /c/Projects/cmake
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=./iarArm.cmake .
-- The C compiler identification is IAR
-- The CXX compiler identification is IAR
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bi
n/iccarm.exe-
-- CMAKE_CXX_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/
bin/iccarm.exe-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: -C:/Program Files/IAR Systems/Embedded Workbench 5
.4/arm/bin-
-- _IAR_LINKER_NAME: -ilinkarm-
-- Found IAR linker: C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin
/ilinkarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Processing Compiler/IAR-CXX.cmake...
-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.4/arm/bin/iccarm.exe
-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.4/arm/bin/iccarm.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Projects/cmake

dkasyanov@DKASYANOV2 /c/Projects/cmake
$ make main.i VERBOSE=0 CHAI
make -f CMakeFiles/my.dir/build.make CMakeFiles/my.dir/main.c.i
make[1]: Entering directory `/c/Projects/cmake'
Preprocessing C source to CMakeFiles/my.dir/main.c.i
"/C/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin/iccarm.exe" /C/Pro
jects/cmake/main.c --preprocess=cnl CMakeFiles/my.dir/main.c.i

   IAR ANSI C/C++ Compiler V5.41.0.51741/W32 for ARM
   Copyright (C) 1999-2009 IAR Systems AB.

Errors: none
Warnings: none
make[1]: Leaving directory `/c/Projects/cmake'

dkasyanov@DKASYANOV2 /c/Projects/cmake
$ make main.obj VERBOSE=0 CHAI
make -f CMakeFiles/my.dir/build.make CMakeFiles/my.dir/main.c.obj
make[1]: Entering directory `/c/Projects/cmake'
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/cmake/CMakeFiles 1
Building C object CMakeFiles/my.dir/main.c.obj
"/C/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin/iccarm.exe" /C/Pro
jects/cmake/main.c -o CMakeFiles/my.dir/main.c.obj

   IAR ANSI C/C++ Compiler V5.41.0.51741/W32 for ARM
   Copyright (C) 1999-2009 IAR Systems AB.

 100 bytes of CODE memory
   4 bytes of DATA memory

Errors: none
Warnings: none
make[1]: Leaving directory `/c/Projects/cmake'

dkasyanov@DKASYANOV2 /c/Projects/cmake
$ make main.s VERBOSE=0 CHAI
make -f CMakeFiles/my.dir/build.make CMakeFiles/my.dir/main.c.s
make[1]: Entering directory `/c/Projects/cmake'
Compiling C source to assembly CMakeFiles/my.dir/main.c.s
"/C/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin/iccarm.exe" /C/Pro
jects/cmake/main.c -lA H -o CMakeFiles/my.dir/main.c.s

   IAR ANSI C/C++ Compiler V5.41.0.51741/W32 for ARM
   Copyright (C) 1999-2009 IAR Systems AB.

 100 bytes of CODE memory
   4 bytes of DATA memory

Errors: none
Warnings: none
make[1]: Leaving directory `/c/Projects/cmake'


If it ok that H.s files is in my source directory but not in CMakeFiles directory. I have attached the files take look files.rar

Daniil
(0019529)
Alex Neundorf (developer)
2010-02-15 12:45

Ok. So the preprocessing worked, the assembler file not really.
I attached a new IAR-4.cmake, please give it a try.
The correct assembler file should now be generated.
Is there a way to keep the compiler from additionally generating the object file ? (I didn't find this in the manual).

Also, can you please try to build a simple static library, consisting of at least 2 files and link an executable against it, to see whether that works too ?

Alex
(0019534)
daniil (reporter)
2010-02-16 03:30

Hello

I had to modify IAR-C.make and IAR-CXX.make

SET(CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> <OBJECTS> --create -o <LINK_FLAGS> <TARGET>")

SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> <OBJECTS> --create -o <LINK_FLAGS> <TARGET>")

And it works both for C and C++ !!!!!!!!!!

I think it won't works with IARAVR because xar doesn't have --crates option. Why there is LINK_FLAGS?

Assembler file also generated correctly.
I don't understand the question (Is there a way to keep the compiler from additionally generating the object file ?)

This is output, and I also attached my project.

dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=iarArm.cmake .
-- The C compiler identification is IAR
-- The CXX compiler identification is IAR
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bi
n/iccarm.exe-
-- CMAKE_CXX_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/
bin/iccarm.exe-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: -C:/Program Files/IAR Systems/Embedded Workbench 5
.4/arm/bin-
-- _IAR_LINKER_NAME: -ilinkarm-
-- Found IAR linker: C:/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin
/ilinkarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.4/arm/bin/iccarm.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Processing Compiler/IAR-CXX.cmake...
-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.4/arm/bin/iccarm.exe
-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.4/arm/bin/iccarm.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Projects/cmake/iartest

dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
$ make VERBOSE=0
/C/CMake/bin/cmake.exe -H/C/Projects/cmake/iartest -B/C/Projects/cmake/iartest -
-check-build-system CMakeFiles/Makefile.cmake 0
/C/CMake/bin/cmake.exe -E cmake_progress_start /C/Projects/cmake/iartest/CMakeFi
les /C/Projects/cmake/iartest/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/c/Projects/cmake/iartest'
make -f CMakeFiles/iartestlib.dir/build.make CMakeFiles/iartestlib.dir/depend
make[2]: Entering directory `/c/Projects/cmake/iartest'
/C/CMake/bin/cmake.exe -E cmake_depends "MSYS Makefiles" /C/Projects/cmake/iarte
st /C/Projects/cmake/iartest /C/Projects/cmake/iartest /C/Projects/cmake/iartest
 /C/Projects/cmake/iartest/CMakeFiles/iartestlib.dir/DependInfo.cmake --color=
Dependee "c:/Projects/cmake/iartest/CMakeFiles/iartestlib.dir/DependInfo.cmake"
is newer than depender "c:/Projects/cmake/iartest/CMakeFiles/iartestlib.dir/depe
nd.internal".
Dependee "C:/Projects/cmake/iartest/CMakeFiles/CMakeDirectoryInformation.cmake"
is newer than depender "c:/Projects/cmake/iartest/CMakeFiles/iartestlib.dir/depe
nd.internal".
Scanning dependencies of target iartestlib
make[2]: Leaving directory `/c/Projects/cmake/iartest'
make -f CMakeFiles/iartestlib.dir/build.make CMakeFiles/iartestlib.dir/build
make[2]: Entering directory `/c/Projects/cmake/iartest'
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/cmake/iartest/CMakeF
iles 2
[ 50%] Building C object CMakeFiles/iartestlib.dir/lib/foo.c.obj
"/C/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin/iccarm.exe" /C/Pro
jects/cmake/iartest/lib/foo.c -o CMakeFiles/iartestlib.dir/lib/foo.c.obj

   IAR ANSI C/C++ Compiler V5.41.0.51741/W32 for ARM
   Copyright (C) 1999-2009 IAR Systems AB.

 16 bytes of CODE memory
  4 bytes of DATA memory

Errors: none
Warnings: none
Linking C static library libiartestlib.a
/C/CMake/bin/cmake.exe -P CMakeFiles/iartestlib.dir/cmake_clean_target.cmake
"/C/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin/iarchive.exe" "CMak
eFiles/iartestlib.dir/lib/foo.c.obj" --create -o libiartestlib.a

   IAR Archive Tool V1.1.1
   Copyright (C) 2008-2009 IAR Systems AB.


Errors: none
Warnings: none

make[2]: Leaving directory `/c/Projects/cmake/iartest'
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/cmake/iartest/CMakeF
iles 2
[ 50%] Built target iartestlib
make -f CMakeFiles/iartest.dir/build.make CMakeFiles/iartest.dir/depend
make[2]: Entering directory `/c/Projects/cmake/iartest'
/C/CMake/bin/cmake.exe -E cmake_depends "MSYS Makefiles" /C/Projects/cmake/iarte
st /C/Projects/cmake/iartest /C/Projects/cmake/iartest /C/Projects/cmake/iartest
 /C/Projects/cmake/iartest/CMakeFiles/iartest.dir/DependInfo.cmake --color=
Dependee "c:/Projects/cmake/iartest/CMakeFiles/iartest.dir/DependInfo.cmake" is
newer than depender "c:/Projects/cmake/iartest/CMakeFiles/iartest.dir/depend.int
ernal".
Dependee "C:/Projects/cmake/iartest/CMakeFiles/CMakeDirectoryInformation.cmake"
is newer than depender "c:/Projects/cmake/iartest/CMakeFiles/iartest.dir/depend.
internal".
Scanning dependencies of target iartest
make[2]: Leaving directory `/c/Projects/cmake/iartest'
make -f CMakeFiles/iartest.dir/build.make CMakeFiles/iartest.dir/build
make[2]: Entering directory `/c/Projects/cmake/iartest'
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/cmake/iartest/CMakeF
iles 1
[100%] Building C object CMakeFiles/iartest.dir/main.c.obj
"/C/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin/iccarm.exe" /C/Pro
jects/cmake/iartest/main.c -o CMakeFiles/iartest.dir/main.c.obj

   IAR ANSI C/C++ Compiler V5.41.0.51741/W32 for ARM
   Copyright (C) 1999-2009 IAR Systems AB.

 8 bytes of CODE memory

Errors: none
Warnings: none
Linking C executable iartest.elf
"/C/Program Files/IAR Systems/Embedded Workbench 5.4/arm/bin/ilinkarm.exe" "CMak
eFiles/iartest.dir/main.c.obj" libiartestlib.a -o iartest.elf

   IAR ELF Linker V5.41.0.51741/W32 for ARM
   Copyright (C) 2007-2009 IAR Systems AB.

     304 bytes of readonly code memory
  32 768 bytes of readwrite data memory

Errors: none
Warnings: none

Link time: 0.03 (CPU) 0.05 (elapsed)
make[2]: Leaving directory `/c/Projects/cmake/iartest'
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/cmake/iartest/CMakeF
iles 1
[100%] Built target iartest
make[1]: Leaving directory `/c/Projects/cmake/iartest'
/C/CMake/bin/cmake.exe -E cmake_progress_start /C/Projects/cmake/iartest/CMakeFi
les 0

dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
$ make help
The following are some of the valid targets for this Makefile:
... all (the default if no target is provided)
... clean
... depend
... edit_cache
... iartest
... iartestlib
... rebuild_cache
... lib/foo.obj
... lib/foo.i
... lib/foo.s
... main.obj
... main.i
... main.s

dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
$ make main.s
Compiling C source to assembly CMakeFiles/iartest.dir/main.c.s

   IAR ANSI C/C++ Compiler V5.41.0.51741/W32 for ARM
   Copyright (C) 1999-2009 IAR Systems AB.

 8 bytes of CODE memory

Errors: none
Warnings: none
(0019535)
Alex Neundorf (developer)
2010-02-16 13:51

Thanks for testing :-)

So, new day, new patch. I attached IAR-5.cmake.
I modified the rule for creating libraries, and also the rule for creating the assembler files. In your project I saw a main.o in the main directory, this was created by the compiler when it created the assembler file.

With "Is there a way to keep the compiler from additionally generating the object file ?" I meant whether it is possible to tell the compiler to generate only the assembler file, but not the object file.
Is this possible ?

With the IAR-5.patch it should not create the main.o anymore, but a main.o.dummy inside CMakeFiles/, right next to the main.c.s file. Can you please check that this is the case ?

Also, please check again that creating a library still works, also with more than 1 file.

Ok.
Now on to the avr.
Let's first try to get the avr C compiler working.
Can you try something like:

project(TestProject C)
add_executable(hello main.c)

with the IAR-5.patch ?
It should recognize at least the compiler ID, the very first thing cmake does.

Alex
(0019539)
daniil (reporter)
2010-02-17 03:04

It works for arm.

I have noticed that I have an option --eec++ in my tool chain file without that option c++ doesn't work. Is it OK? I think it is OK because the user could specify --ec++ option instead of --eec++.

It doesn't work for avr see output below.

I don't find the way how not to create an object when generating assembler. I think it because -lAH is an additional option to iccarm who's main purpose is generating objects.



dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=iarAvr.cmake .
-- The C compiler identification is unknown
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/bin/iccavr.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/cmake/iartest/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/cmake/iartest/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/cmake/iartest/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe" -o
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj -c
  /C/Projects/cmake/iartest/CMakeFiles/CMakeTmp/testCCompiler.c



     IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
     Copyright 1996-2009 IAR Systems AB.

  Command line error: Unexpected command line arguments:

            -c

  make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj] Error 2

  make[1]: Leaving directory `/c/Projects/cmake/iartest/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:4 (project)


-- Configuring incomplete, errors occurred!
(0019540)
Alex Neundorf (developer)
2010-02-17 04:35

> I have noticed that I have an option --eec++ in my tool chain file without
> that option c++ doesn't work. Is it OK? I think it is OK because the user
> could specify --ec++ option instead of --eec++

Yes, that's ok.

Can you please attach your current iarAvr.cmake file ?

Thanks
Alex
(0019541)
daniil (reporter)
2010-02-17 05:05

I have attached but actually it the same as arm.

# this one is important
SET(CMAKE_SYSTEM_NAME Generic)

set(CMAKE_C_COMPILER iccavr)
set(CMAKE_CXX_COMPILER iccavr "--eec++")

# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
(0019551)
Alex Neundorf (developer)
2010-02-18 16:31

IAR-6.patch attached.
It just adds some debug output to the compiler ID stage.
Please apply it and run it again on a fresh build dir, and post the output.
Please also attach the CMakeFiles/CMakeError.log file , maybe I see something there.

What type of file does the compiler actually produce when called without special arguments ?
CMake tries to parse the strings out of the generated binary file, it supports binary files, Intel HEX and Motorola s-record should work too.
Maybe the avr compiler creates a different format ?
Which one ?
If that's the case, can you please attached such a file of something like "hello world", i.e. a program which contains a string ?

Alex
(0019553)
daniil (reporter)
2010-02-19 02:17

> What type of file does the compiler actually produce when called without special arguments ?
If you mean when compiler invoked like iccavr main.c, that produce main.r90 binary file I don't know what is the format.

avr linker could create a lot of different formats intel extended, standard and motorola it supports. but formats is depends on microcontroller is choosen.
I think is up to user to choose the flags for format and microcontroller.

I attached the CMakeError.log

This is my output.
dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=iarAvr.cmake .
-- Trying flag ""
-- Checking file "CMakeCCompilerId.r90"
-- Trying flag "-c"
-- Trying flag "-Aa"
-- The C compiler identification is unknown
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/bin/iccavr.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/cmake/iartest/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/cmake/iartest/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/cmake/iartest/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe" -o
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj -c
  /C/Projects/cmake/iartest/CMakeFiles/CMakeTmp/testCCompiler.c



     IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
     Copyright 1996-2009 IAR Systems AB.

  Command line error: Unexpected command line arguments:

            -c

  make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj] Error 2

  make[1]: Leaving directory `/c/Projects/cmake/iartest/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:4 (project)


-- Configuring incomplete, errors occurred!

Daniil
(0019554)
Alex Neundorf (developer)
2010-02-19 04:38

Can you please attach such a .r90 file for hello-world style program, i.e. a program which in some way contains the string "hello world" ?
(it doesn't have to print it, but it shouldn't be optimized away).

Alex
(0019556)
daniil (reporter)
2010-02-20 06:14

I have attached.

Daniil
(0019559)
Alex Neundorf (developer)
2010-02-21 10:25

Oh, this is indeed a real binary format (not like Intel-hex).
Can you please also attach the main.c for this binary ?
(so I can see how the string is used and whether it might have been optimized away by the compiler/linker).

Thanks
Alex
(0019560)
Alex Neundorf (developer)
2010-02-21 10:30

Can you please also attach the assembler file which is produced for this main.c ?
I have seen e.g. sdcc turn a string into a sequency of load byte operations, which made the string not recognizable anymore.
Maybe the IAR compiler does something similar.

Alex
(0019596)
Alex Neundorf (developer)
2010-02-23 13:00

Can you please attach the main.c for the attached main.r90 and also process the main.c to an assembler file and attach this one too ?
I really can't see a string in the main.r90, but it really should be there somewhere.

Alex
(0019598)
Alex Neundorf (developer)
2010-02-23 13:21

I found the string ! :-)
See the attached main.r90.hex.
Near the end there is
0000:0740 00 00 00 00 c7 04 00 00 00 00 36 48 36 65 36 6c ....Ç.....6H6e6l
0000:0750 36 6c 36 6f 36 2c 36 20 36 77 36 6f 36 72 36 6c 6l6o6,6 6w6o6r6l
0000:0760 36 64 36 00 c7 05 00 00 00 00 61 00 00 00 00 60 6d6.Ç.....a....`

which contains "6H6el6l6o6,6 6w6o6r6l6d6." which is "Hello world" with "6"s inbetween.
What are the "6"s doing there ? Are they 1-byte assembler instructions ? Or are all strings stored like that ?
The first "6" is at offset 0x074a, so this is an even address. So the bytes which contain the actual text are at odd offsets. Strange.

Do you understand that file format ?
Does it look the same for the avr32 compiler (this is not the 32bit version, right) ?
Does it look the same in other object files from you ?

Alex
(0019602)
daniil (reporter)
2010-02-24 02:12

Hi

I have IAR on my work. We have monday, tuesday a national hollyday. So I try work out your request today-tomorrow.

Daniil
(0019603)
daniil (reporter)
2010-02-24 03:35

I have uploaded files, iartest_asm.rar.
That files are generated over
dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
$ iccavr main.c -lAH main.s

   IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
   Copyright 1996-2009 IAR Systems AB.

 32 bytes of CODE memory (+ 4 bytes shared)
 14 bytes of DATA memory

Errors: none
Warnings: none

I also found in a EWAVR_CompilerReference.pdf that .r90 is an object file. see page 4.

I can say nothing about avr32 because I don't have compiler yet but I think it is the same.


COMPILING
In the command line interface, the following line compiles the source file myfile.c
into the object file myfile.r90 using the default settings:
iccavr myfile.c
In addition, you need to specify some critical options, see Basic settings for project
configuration, page 5.
LINKING
The IAR XLINK Linker is used for building the final application. Normally, XLINK
requires the following information as input:
? A number of object files and possibly certain libraries
? The standard library containing the runtime environment and the standard language
functions
? A program start label
? A linker command file that describes the memory layout of the target system
? Information about the output format.
On the command line, the following line can be used for starting XLINK:
xlink myfile.r90 myfile2.r90 -s __program_start -f lnkm128s.xcl
cl3s-ec.r90 -o aout.a90 -FIntel-extended
In this example, myfile.r90 and myfile2.r90 are object files, lnkm128s.xcl is the
linker command file, and cl3s-ec.r90 is the runtime library. The option -s specifies
the label where the application starts. The option -o specifies the name of the output
file, and the option -F can be used for specifying the output format. (The default output
format is Motorola.)
The IAR XLINK Linker produces output according to your specifications. Choose the
output format that suits your purpose. You might want to load the output to a
debugger—which means that you need output with debug information. Alternatively,
you might want to load the output to a flash loader—in which case you need output
without debug information, such as Intel-hex or Motorola S-records.

Daniil
(0019681)
daniil (reporter)
2010-03-02 02:27

Hi

Just asking how things are going?

Daniil
(0019691)
Alex Neundorf (developer)
2010-03-02 17:20

Today I found some time again to have a look at this.
Please download the attached cmHexFileConverter.h and cxx and put them in the cmake Source/ directory (i.e. overwrite the files which are already there).

Then build it, install it, run it, and post the output here :-)

Hopefully it should recognize the compiler ID "IAR" now.

What the code tries to do is to create a modified object file from that r90 file, which first contains the original file, then all even bytes, then all odd bytes. From the one example it looks like that should make it work.

Alex
(0019713)
Alex Neundorf (developer)
2010-03-04 15:28

Did you already have time to try it ?
Or do you have problems due to the recent git-migration of cmake ?
(I didn't make the patch against current git master, but still my cvs checkout)

Alex
(0019719)
daniil (reporter)
2010-03-04 17:31

I am sorry I haven't time these two days. I try it today.
I also try to download a snapshot from git it is ok.

So I have to apply IAR-6.patch and put cmHexFileConverter.h and cxx in the cmake Source/ directory.

Daniil
(0019721)
daniil (reporter)
2010-03-05 02:37

Hello

I found a time :) see the result

xlink required the file format option specified. The format option is depended on target device.

$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=iarAvr.cmake .
-- Trying flag ""
-- Checking file "CMakeCCompilerId.r90"
extension: -.r90--- Trying flag "-c"
-- Trying flag "-Aa"
-- The C compiler identification is IAR
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bi
n/iccavr.exe-
-- CMAKE_CXX_COMPILER: -iccavr;--eec++-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: -C:/Program Files/IAR Systems/Embedded Workbench 5
.3/avr/bin-
-- Found IAR linker: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin
/xlink.exe
-- Found IAR archiver: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/b
in/xar.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/bin/iccavr.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/cmake/iartest/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/cmake/iartest/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/cmake/iartest/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe"
  /C/Projects/cmake/iartest/CMakeFiles/CMakeTmp/testCCompiler.c -o
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj



     IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
     Copyright 1996-2009 IAR Systems AB.



   6 bytes of CODE memory



  Errors: none

  Warnings: none

  Linking C executable cmTryCompileExec.hex

  "/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/xlink.exe"
  "CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj" -o
  cmTryCompileExec.hex



       IAR Universal Linker V4.61L/W32
       Copyright (C) 1987-2009 IAR Systems AB.

  Error[e58]: No format defined



  Available formats:

      aomf80196 aomf80251 aomf8051 aomf8096
      ashling ashling-6301 ashling-64180 ashling-6801
      ashling-8080 ashling-8085 ashling-z80 basemap
      coff debug debug-intel-ext debug-intel-std
      debug-motorola elf extended-tekhex hp
      hp-code hp-symb ieee695 ieee695-ie
      ieee695-is ieee695-m intel-extended intel-standard
      millenium motorola motorola-s19 motorola-s28
      motorola-s37 mpds mpds-code mpds-i
      mpds-m mpds-symb msd msd-i
      msd-m msd-t msp430_txt nec
      nec-symbolic nec2 nec2-symbolic nec78k
      nec78k-symbolic pentica-a pentica-ai pentica-am
      pentica-b pentica-bi pentica-bm pentica-c
      pentica-ci pentica-cm pentica-d pentica-di
      pentica-dm raw-binary rca simple
      simple-code symbolic sysrof tektronix
      ti7000 typed ubrof ubrof10
      ubrof5 ubrof6 ubrof7 ubrof8
      ubrof9 xcoff78k zax zax-i
      zax-m



  Fatal! Execution terminated...

  make[1]: *** [cmTryCompileExec.hex] Error 3

  make[1]: Leaving directory `/c/Projects/cmake/iartest/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:4 (project)


-- Configuring incomplete, errors occurred!
(0019722)
daniil (reporter)
2010-03-05 02:38

I think file format and target device should be specified by user in its toolchain file.

Daniil
(0019724)
daniil (reporter)
2010-03-05 04:39

I specified the linker format set(CMAKE_C_LINK_FLAGS "-Fintel-extended") and configuration passed successfully, then
I specify processor set(CMAKE_C_COMPILER iccavr "--cpu=m1281" ) and got the this.

dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=iarAvr.cmake VERBOSE=0 .
-- Trying flag ""
-- Trying flag "-c"
-- Trying flag "-Aa"
-- The C compiler identification is unknown
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/bin/iccavr.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/cmake/iartest/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/cmake/iartest/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/cmake/iartest/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe"
  --cpu=m1281 -o CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj -c
  /C/Projects/cmake/iartest/CMakeFiles/CMakeTmp/testCCompiler.c



     IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
     Copyright 1996-2009 IAR Systems AB.

  Command line error: Unexpected command line arguments:

            -c

  make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj] Error 2

  make[1]: Leaving directory `/c/Projects/cmake/iartest/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:4 (project)


-- Configuring incomplete, errors occurred!

dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
(0019743)
Alex Neundorf (developer)
2010-03-06 14:29

I attached updated versions of IAR.cmake, IAR-C.cmake and IAR-CXX.cmake. Please download them and replace your existing files with them.
Please check ARM is still working.
I think there are good chances AVR is now working too.
Please post the output again here.

In the toolchain file you should now be able to set the variable IAR_OUTPUT_FORMAT to what you like.
If it is not set, it is set by default to "motorola".

Let me know how it works :-)

Alex
(0019772)
daniil (reporter)
2010-03-09 03:21
edited on: 2010-03-09 03:24

I think that use special variable IAR_OUTPUT_FORMAT isn't good idea, because output format is linker option and accepted for avr only not for arm.
So using that variable cmake says that I can't use linker's -F option in CMAKE_C_LINK_FLAGS.

I believe toolchain file should looks like that see attchaed. Also CMAKE_C_LINK_FLAGS could contain a tens other parameters.


I think is better to use default tool chain file for checking...

Daniil

The output from the toolchain attached.

dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=iarAvr.cmake .
-- Trying flag ""
-- Trying flag "-c"
-- Trying flag "-Aa"
-- The C compiler identification is unknown
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/bin/iccavr.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/cmake/iartest/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/cmake/iartest/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/cmake/iartest/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe"
  --cpu=m1281 -o CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj -c
  /C/Projects/cmake/iartest/CMakeFiles/CMakeTmp/testCCompiler.c

  Command line error: Unexpected command line arguments:

            -c



     IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
     Copyright 1996-2009 IAR Systems AB.

  make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj] Error 2

  make[1]: Leaving directory `/c/Projects/cmake/iartest/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:4 (project)


-- Configuring incomplete, errors occurred!

(0019780)
Alex Neundorf (developer)
2010-03-09 15:12

The problem here is the line
"-- The C compiler identification is unknown"
If this is the case, cmake doesn't know what compiler it is and everything later on fails.
Please attach the CMakeFiles/CMakeError.log file here.

If we got the compiler ID with the simpler toolchain file, please try again with the simpler toolchain file, i.e. without "-Fintel-extended" and without "--cpu=m1281".
I think as soon as cmake recognizes the compiler ID as "IAR" again, there are good chances that compiling and linking will also work.
Please try that again.

Once we got it working, we can then check how to make it work nicer.

Alex
(0019795)
daniil (reporter)
2010-03-10 01:58

I got an error in IAR-C.cmake this is output.
I can say that before I replace IAR-C.cmake etc and If I don't specify --cpu=m1281 there wasn't errors the only problem was that linker generate wrong firmware.
So the option --cpu=m1281 break them all. I try backup and provide you with the output.

Daniil

dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=iarAvr.cmake .
-- Trying flag ""
-- Checking file "CMakeCCompilerId.r90"
extension: -.r90--- Trying flag "-c"
-- Trying flag "-Aa"
-- The C compiler identification is IAR
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bi
n/iccavr.exe-
-- CMAKE_CXX_COMPILER: -iccavr;--eec++-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: -C:/Program Files/IAR Systems/Embedded Workbench 5
.3/avr/bin-
-- Found IAR linker: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin
/xlink.exe
-- Found IAR archiver: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/b
in/xar.exe
-- IAR_TARGET_ARCHITECTURE: AVR
-- IAR_OUTPUT_FORMAT: motorola
CMake Warning at C:/CMake/Modules/Compiler/IAR-C.cmake:11 (IF):
  given arguments:

    "AVR STREQUAL " "ARM" ")



    SET(CMAKE_C_LINK_EXECUTABLE " "<CMAKE_LINKER>" "<OBJECTS>" "<CMAKE_C_LINK_FL
AGS>" "<LINK_FLAGS>" "<LINK_LIBRARIES>" "-o" "<TARGET>" ")
    SET(CMAKE_C_CREATE_STATIC_LIBRARY " "<CMAKE_AR>" "<TARGET>" "--create" "<LIN
K_FLAGS>" "<OBJECTS>" ")



  ENDIF (" "AVR" "STREQUAL" "ARM"

  Unknown arguments specified
Call Stack (most recent call first):
  C:/CMake/Modules/CMakeCInformation.cmake:31 (INCLUDE)
  CMakeLists.txt:4 (project)


CMake Error at C:/CMake/Modules/CMakeCInformation.cmake:31 (INCLUDE):
  A logical block opening on the line

    C:/CMake/Modules/Compiler/IAR-C.cmake:11 (IF)

  is not closed.
Call Stack (most recent call first):
  CMakeLists.txt:4 (project)


-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe
CMake Warning at C:/CMake/Modules/Compiler/IAR-C.cmake:11 (IF):
  given arguments:

    "AVR STREQUAL " "ARM" ")



    SET(CMAKE_C_LINK_EXECUTABLE " "<CMAKE_LINKER>" "<OBJECTS>" "<CMAKE_C_LINK_FL
AGS>" "<LINK_FLAGS>" "<LINK_LIBRARIES>" "-o" "<TARGET>" ")
    SET(CMAKE_C_CREATE_STATIC_LIBRARY " "<CMAKE_AR>" "<TARGET>" "--create" "<LIN
K_FLAGS>" "<OBJECTS>" ")



  ENDIF (" "AVR" "STREQUAL" "ARM"

  Unknown arguments specified
Call Stack (most recent call first):
  C:/CMake/Modules/CMakeCInformation.cmake:31 (INCLUDE)
  CMakeLists.txt:2 (PROJECT)


CMake Error at C:/CMake/Modules/CMakeCInformation.cmake:31 (INCLUDE):
  A logical block opening on the line

    C:/CMake/Modules/Compiler/IAR-C.cmake:11 (IF)

  is not closed.
Call Stack (most recent call first):
  CMakeLists.txt:2 (PROJECT)


CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/bin/iccavr.exe" is not able to compile a simple test program.

  It fails with the following output:





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:4 (project)


-- Configuring incomplete, errors occurred!
(0019796)
daniil (reporter)
2010-03-10 02:51

I have backed up and get two results first one if I don't specify -Fintel-extended the second one if specify.

****************** WITHOUT -Fintel-extended ************************************
dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=iarAvr.cmake .
-- Trying flag ""
-- Checking file "CMakeCCompilerId.r90"
extension: -.r90--- Trying flag "-c"
-- Trying flag "-Aa"
-- The C compiler identification is IAR
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bi
n/iccavr.exe-
-- CMAKE_CXX_COMPILER: -iccavr;--eec++-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: -C:/Program Files/IAR Systems/Embedded Workbench 5
.3/avr/bin-
-- Found IAR linker: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin
/xlink.exe
-- Found IAR archiver: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/b
in/xar.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/bin/iccavr.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/cmake/iartest/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/cmake/iartest/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/cmake/iartest/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe"
  /C/Projects/cmake/iartest/CMakeFiles/CMakeTmp/testCCompiler.c -o
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj



     IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
     Copyright 1996-2009 IAR Systems AB.



   6 bytes of CODE memory



  Errors: none

  Warnings: none

  Linking C executable cmTryCompileExec.hex

  "/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/xlink.exe"
  "CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj" -o
  cmTryCompileExec.hex



       IAR Universal Linker V4.61L/W32
       Copyright (C) 1987-2009 IAR Systems AB.

  Error[e58]: No format defined



  Available formats:

      aomf80196 aomf80251 aomf8051 aomf8096
      ashling ashling-6301 ashling-64180 ashling-6801
      ashling-8080 ashling-8085 ashling-z80 basemap
      coff debug debug-intel-ext debug-intel-std
      debug-motorola elf extended-tekhex hp
      hp-code hp-symb ieee695 ieee695-ie
      ieee695-is ieee695-m intel-extended intel-standard
      millenium motorola motorola-s19 motorola-s28
      motorola-s37 mpds mpds-code mpds-i
      mpds-m mpds-symb msd msd-i
      msd-m msd-t msp430_txt nec
      nec-symbolic nec2 nec2-symbolic nec78k
      nec78k-symbolic pentica-a pentica-ai pentica-am
      pentica-b pentica-bi pentica-bm pentica-c
      pentica-ci pentica-cm pentica-d pentica-di
      pentica-dm raw-binary rca simple
      simple-code symbolic sysrof tektronix
      ti7000 typed ubrof ubrof10
      ubrof5 ubrof6 ubrof7 ubrof8
      ubrof9 xcoff78k zax zax-i
      zax-m



  Fatal! Execution terminated...

  make[1]: *** [cmTryCompileExec.hex] Error 3

  make[1]: Leaving directory `/c/Projects/cmake/iartest/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:4 (project)


-- Configuring incomplete, errors occurred!


********************* WITH -Fintel-extended************************************

dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=iarAvr.cmake .
-- Trying flag ""
-- Checking file "CMakeCCompilerId.r90"
extension: -.r90--- Trying flag "-c"
-- Trying flag "-Aa"
-- The C compiler identification is IAR
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bi
n/iccavr.exe-
-- CMAKE_CXX_COMPILER: -iccavr;--eec++-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: -C:/Program Files/IAR Systems/Embedded Workbench 5
.3/avr/bin-
-- Found IAR linker: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin
/xlink.exe
-- Found IAR archiver: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/b
in/xar.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
extension: -.bin--- Configuring done
-- Generating done
-- Build files have been written to: C:/Projects/cmake/iartest

dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
(0019819)
Alex Neundorf (developer)
2010-03-10 16:35

Sorry for attaching broken files :-/

New day, new try :-)
I attached IAR-7.patch which is a patch against current CMake git master.
Please try that one.
It should recognize the IAR compiler, compile and link.
Please put neither -Fintel-extended not --mcpu=... into the toolchain file for now.

Hope it works today :-)
Alex
(0019834)
daniil (reporter)
2010-03-11 05:32

This is a result
The linker says no bytes in a memory because I think it requires additional linker options and compiler options. I think we try it next step.

Daniil

dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=iarAvr.cmake
-- Trying flag ""
-- Checking file "CMakeCCompilerId.r90"
extension: -.r90--- Trying flag "-c"
-- Trying flag "-Aa"
-- The C compiler identification is IAR
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bi
n/iccavr.exe-
-- CMAKE_CXX_COMPILER: -iccavr;--eec++-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: -C:/Program Files/IAR Systems/Embedded Workbench 5
.3/avr/bin-
-- Found IAR linker: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin
/xlink.exe
-- Found IAR archiver: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/b
in/xar.exe
-- IAR_TARGET_ARCHITECTURE: AVR
-- IAR_OUTPUT_FORMAT: motorola
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
extension: -.bin--- Configuring done
-- Generating done
-- Build files have been written to: C:/Projects/cmake/iartest

dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
$ make
Scanning dependencies of target iartest
[100%] Building C object CMakeFiles/iartest.dir/main.c.r90

   IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
   Copyright 1996-2009 IAR Systems AB.

    int i = 0;
        ^
"c:\Projects\cmake\iartest\main.c",9 Warning[Pe177]: variable "i" was
          declared but never referenced

 42 bytes of CODE memory (+ 4 bytes shared)
 14 bytes of DATA memory

Errors: none
Warnings: 1
Linking C executable iartest.bin

     IAR Universal Linker V4.61L/W32
     Copyright (C) 1987-2009 IAR Systems AB.

 No bytes in any memory

Errors: none
Warnings: none

[100%] Built target iartest
(0019835)
Alex Neundorf (developer)
2010-03-11 06:57

I think this looks good :-)

I think you should be able to now simply set the linker options you want either using target_link_libraries() or by setting the CMAKE_C_LINK_FLAGS directly in your CMakeLists.txt
(0019836)
daniil (reporter)
2010-03-11 07:55

Why CMakeLists.txt but not in a tool chain file ?
(0019837)
daniil (reporter)
2010-03-11 07:59

I use set(CMAKE_C_LINK_FLAGS "-Fintel-extended") I got the warning that
Warning[w32]: Format option set more than once. Using motorola format

Daniil
(0019859)
Alex Neundorf (developer)
2010-03-12 15:00

I attached IAR-8.cmake.
This time IAR_OUTPUT_FORMAT is gone, and you should be able to set CMAKE_C_LINK_FLAGS in the toolchain file.
If not set, they will default to -Fmotorola

Let me know how it works.

Alex
(0019860)
Alex Neundorf (developer)
2010-03-12 15:17

Best way to apply this patch is probably "git apply IAR-8.patch".
If you need it in a format so you can use "patch -p0" let me know.

Alex
(0019878)
daniil (reporter)
2010-03-15 04:26

Hi

I have deleted one post because it was wrong, I specified parameters incorrectly.
This is output I get it is happen when --cpu is specified, if not it is ok.

dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=iarAvr.cmake .
-- The C compiler identification is unknown
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/bin/iccavr.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/cmake/iartest/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/cmake/iartest/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/cmake/iartest/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe" -y
  --cpu=m1281 -ms -I"/C/Program Files/IAR Systems/Embedded Workbench
  5.0/avr/inc" -o CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj -c
  /C/Projects/cmake/iartest/CMakeFiles/CMakeTmp/testCCompiler.c



     IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
     Copyright 1996-2009 IAR Systems AB.

  Command line error: Unexpected command line arguments:

            -c

  make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj] Error 2

  make[1]: Leaving directory `/c/Projects/cmake/iartest/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:4 (project)


-- Configuring incomplete, errors occurred!
(0019879)
Alex Neundorf (developer)
2010-03-15 05:49

How did you specifiy --mcpu ?
I mean, which variable did you set ?

Alex
(0019880)
daniil (reporter)
2010-03-15 06:02

not --mcpu but --cpu see attached MakefileM which is stand minimum parameters required to compile simple main.c

Also this is my toolchain file. I have to specify a absolute path of linker script because test fails if path is relative.

Can I use target_link_libraries in a toolchain file, If I can how?

# this one is important
SET(CMAKE_SYSTEM_NAME Generic)

include_directories("C:/Program Files/IAR Systems/Embedded Workbench 5.0/avr/inc")

set(CMAKE_C_COMPILER iccavr "-y --cpu=m1281 -ms")
set(CMAKE_CXX_COMPILER iccavr "--eec++")
set(CMAKE_C_LINK_FLAGS "-Fintel-extended -xmsh -H1895 -f \"C:/Projects/cmake/iartest/lnkm1281s.xcl\" -l list.html -s main")

# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Daniil
(0019882)
Alex Neundorf (developer)
2010-03-15 10:42
edited on: 2010-03-15 10:42

Adding "-y --cpu=m1281 -ms" to CMAKE_C_COMPILER is probably not a good idea.
What happens if you add this to CMAKE_C_FLAGS instead ?

I guess the include directory for avr is always <location_of_compiler>/../avr/include and <location_of_compiler>/../arm/include for the ARM compiler ?

Is the -f really necessary or does it already link (even if not correctly for your device) without this ?

Alex

(0019883)
daniil (reporter)
2010-03-15 11:12

It works !!!


It works but only if I add to CMAKE_C_FLAGS in a CMakeLists.txt. But it doesn't work if I add it in a toolchain file so you can see the flags don't appeared in a command line.

<Is the -f really necessary or does it already link (even if not correctly for your device) without this ?>
-f file Extend command line with <file> <.xcl> so I think it is needed.

I guess the include directory for avr is always <location_of_compiler>/../avr/include and <location_of_compiler>/../arm/include for the ARM compiler ?
I think yes. But does it specify by cmake itself? If not I have do it manually.


This is a result.

Scanning dependencies of target iartest
make[2]: Leaving directory `/c/Projects/cmake/iartest'
make -f CMakeFiles/iartest.dir/build.make CMakeFiles/iartest.dir/build
make[2]: Entering directory `/c/Projects/cmake/iartest'
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/cmake/iartest/CMakeF
iles 1
[100%] Building C object CMakeFiles/iartest.dir/main.c.r90
"/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe" /C/Pro
jects/cmake/iartest/main.c -I"/C/Program Files/IAR Systems/Embedded Workbench 5
.0/avr/inc" -o CMakeFiles/iartest.dir/main.c.r90

   IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
   Copyright 1996-2009 IAR Systems AB.

 148 bytes of CODE memory (+ 4 bytes shared)
  14 bytes of DATA memory

Errors: none
Warnings: none
Linking C executable iartest.bin
"/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/xlink.exe" "CMakeFi
les/iartest.dir/main.c.r90" -Fintel-extended -xmsh -H1895 -f "C:/Projects/cmake
/iartest/lnkm1281s.xcl" -l list.html -s main "/C/Program Files/IAR Systems/Emb
edded Workbench 5.3/avr/LIB/DLIB/dlAVR-3s-ec_mul-f.r90" -o iartest.bin

     IAR Universal Linker V4.61L/W32
     Copyright (C) 1987-2009 IAR Systems AB.
Error[e117]: Incompatible runtime models. Module main specifies that '__memory_m
odel' must be '1', but module ?__dbg_break has the value '2'
make[2]: *** [iartest.bin] Error 3
make[2]: Leaving directory `/c/Projects/cmake/iartest'
make[1]: *** [CMakeFiles/iartest.dir/all] Error 2
make[1]: Leaving directory `/c/Projects/cmake/iartest'
make: *** [all] Error 2
(0019892)
Alex Neundorf (developer)
2010-03-16 05:46

Please try the attached IAR-9.patch.
You should now not need the include_directories() command in the toolchain file anymore, this should be done automatically now (in IAR-C.cmake and IAR-CXX.cmake).

Alex
(0019893)
daniil (reporter)
2010-03-16 07:01

There is a missprint in a IAR-C.cmake. I change it myself. So include is appeared. It works !!!

dkasyanov@DKASYANOV2 /c/Projects/cmake/iartest
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=iarAvr.cmake
extension: -.r90--- The C compiler identification is IAR
CMake Error: Error in cmake code at
C:/CMake/Modules/Compiler/IAR-C.cmake:36:
Parse error. Function missing ending ")". Instead found unterminated string wi
th text "${_compilerDir}/inc )
".
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe
CMake Error: Error in cmake code at
C:/CMake/Modules/Compiler/IAR-C.cmake:36:
Parse error. Function missing ending ")". Instead found unterminated string wi
th text "${_compilerDir}/inc )
".
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/bin/iccavr.exe" is not able to compile a simple test program.

  It fails with the following output:





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!


If I put set(CMAKE_C_FLAGS "-y --cpu=m1281 -ms") in a toolchainfile flags don't appear in a output.

[100%] Building C object CMakeFiles/iartest.dir/main.c.r90
"/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe" /C/Pro
jects/cmake/iartest/main.c -I"/C/Program Files/IAR Systems/Embedded Workbench 5
.3/avr/inc" -o CMakeFiles/iartest.dir/main.c.r90

   IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
   Copyright 1996-2009 IAR Systems AB.

 148 bytes of CODE memory (+ 4 bytes shared)
  14 bytes of DATA memory

Errors: none
Warnings: none
Linking C executable iartest.bin
"/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/xlink.exe" "CMakeFi
les/iartest.dir/main.c.r90" -Fintel-extended -xmsh -H1895 -f "C:/Projects/cmake
/iartest/lnkm1281s.xcl" -l list.html -s main "/C/Program Files/IAR Systems/Emb
edded Workbench 5.3/avr/LIB/DLIB/dlAVR-3s-ec_mul-f.r90" -o iartest.bin

     IAR Universal Linker V4.61L/W32
     Copyright (C) 1987-2009 IAR Systems AB.
Error[e117]: Incompatible runtime models. Module main specifies that '__memory_m
odel' must be '1', but module ?__dbg_break has the value '2'
make[2]: *** [iartest.bin] Error 3
make[2]: Leaving directory `/c/Projects/cmake/iartest'
make[1]: *** [CMakeFiles/iartest.dir/all] Error 2
make[1]: Leaving directory `/c/Projects/cmake/iartest'
make: *** [all] Error 2

Daniil
(0019947)
Alex Neundorf (developer)
2010-03-17 17:04

Can you try whether it works if you do
set(CMAKE_C_FLAGS_INIT "-y --cpu=m1281 -ms")
in the toolchain file ?

Alex
(0019950)
daniil (reporter)
2010-03-18 03:06

It works !!!

I tried a bit more complicated project which builds a library it works too.

I think I can try some real project I think it takes more time and if you don't mind I ask you for suggests now and in a future.

1. How can I process an assembler file?
Embedded project usually contains a assembler.

2. Can I restrict a value the variable can be assigned and print what variable what values can be assigned?


Daniil
(0019952)
Alex Neundorf (developer)
2010-03-18 03:36

1. We need to add support for the IAR assembler.

2. No, not really. Well, if it is a cache variable, since 2.8.0 you can do
  set_property(CACHE <your_variable> PROPERTY
               STRINGS "Foo;Bar;Blub" )
and then in cmake-gui these values will be provided in a combobox, instead of a plain lineedit.

Alex
(0019953)
daniil (reporter)
2010-03-18 03:55

I mean cache variable, so it is what I need.

As I told we need support to assembler because most project needed startup assembler code.

I think we can start with arm first.

Daniil
(0019960)
Alex Neundorf (developer)
2010-03-18 16:43

I attached a new IAR-10.patch, this comes with a Compiler/IAR-ASM.cmake file.
Maybe it already works, give it a try.
In your toolchain file you have to set the CMAKE_ASM_COMPILER variable the same way as you do it for the C and C++ compilers.
In your project you will have to do
enable_language(ASM)
After that you should be able to add *.s, *.asm and *.msa files to your targets.

Alex
(0019976)
Alex Neundorf (developer)
2010-03-22 09:07

The documentation said that the avr assembler recognizes *.s90, *.asm and *.msa as valid suffixes, so that's probably the reason why the asm.s is ignored.
If you look in IAR-ASM.cmake you can see this.
Should *.s be added to that file or would the right thing to do be that you rename the file to asm.s90 ?

Alex
(0019977)
daniil (reporter)
2010-03-22 09:24

!!!!!!!!!!!! It works !!!!!!!!!!!!

I deleted my previous post because I thought I didn't read one. :)

So I think I am going to try to build the real project and build workable firmware.

IAR also has IDE, if it is possible to add the IAR project generator to cmake? If it is possible I can also give a help with it.

Daniil
(0019978)
daniil (reporter)
2010-03-22 11:35

Hi,

I started to play with some real project.

First I have to build it using WinAvr (avr-gcc, avr-g++), it is available in linux.

I got several problems.

1. CMAKE_CXX_FLAGS_INIT seems doesn't work. I tried to use CMAKE_CXX_FLAGS_INIT it is the same result.

But there is a strange scenario.
a) I try to configure with CMAKE_CXX_FLAGS_INIT then try to build it compiler options isn't appeard.
b) I substitute CMAKE_CXX_FLAGS_INIT to CMAKE_CXX_FLAGS a rebuild without cache cleaning, or removing files previously generated, in this case flags appears.
But firmware is wrong.

2. The second that library doesn't links use -l option.

I attached the project can you try it yourself or suggest me what is wrong with my toolchain.

Linking CXX static library libi26lib.a
cd /C/Projects/Research/i26/src && /C/CMake/bin/cmake.exe -P CMakeFiles/i26lib.d
ir/cmake_clean_target.cmake
cd /C/Projects/Research/i26/src && /C/CMake/bin/cmake.exe -E cmake_link_script C
MakeFiles/i26lib.dir/link.txt --verbose=0
make[2]: Leaving directory `/c/Projects/Research/i26'
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
[ 94%] Built target i26lib
make -f CMakeFiles/i26.dir/build.make CMakeFiles/i26.dir/depend
make[2]: Entering directory `/c/Projects/Research/i26'
/C/CMake/bin/cmake.exe -E cmake_depends "MSYS Makefiles" /C/Projects/Research/i2
6 /C/Projects/Research/i26 /C/Projects/Research/i26 /C/Projects/Research/i26 /C/
Projects/Research/i26/CMakeFiles/i26.dir/DependInfo.cmake --color=
Dependee "c:/Projects/Research/i26/CMakeFiles/i26.dir/DependInfo.cmake" is newer
 than depender "c:/Projects/Research/i26/CMakeFiles/i26.dir/depend.internal".
Dependee "C:/Projects/Research/i26/CMakeFiles/CMakeDirectoryInformation.cmake" i
s newer than depender "c:/Projects/Research/i26/CMakeFiles/i26.dir/depend.intern
al".
Scanning dependencies of target i26
make[2]: Leaving directory `/c/Projects/Research/i26'
make -f CMakeFiles/i26.dir/build.make CMakeFiles/i26.dir/build
make[2]: Entering directory `/c/Projects/Research/i26'
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 1
[100%] Building CXX object CMakeFiles/i26.dir/main.cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.dir/main.cpp.obj -c /C/Projects/Research/
i26/main.cpp
c:/Projects/Research/i26/main.cpp: In function 'int main()':
c:/Projects/Research/i26/main.cpp:60: warning: unused variable 'write'
c:/Projects/Research/i26/main.cpp:61: warning: unused variable 'read'
Linking CXX executable i26
/C/WinAVR-20090313/bin/avr-g++.exe -g -Os -Wall -ffunction-sections -Wall -mmc
u=atmega2561 -Wl,--gc-sections -Wl,--relax -mmcu=atmega2561 "CMakeFiles/i26.dir
/main.cpp.obj" -o i26 src/libi26lib.a
make[2]: Leaving directory `/c/Projects/Research/i26'
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 1
[100%] Built target i26
make[1]: Leaving directory `/c/Projects/Research/i26'
/C/CMake/bin/cmake.exe -E cmake_progress_start /C/Projects/Research/i26/CMakeFil
es 0

See the log.
(0019979)
Alex Neundorf (developer)
2010-03-22 16:48

Wait, wait.
This is again something quite different, I'd like to "finish" the IAR stuff first.
What's the state ?
What is working, what isn't working, did you already test it on some real project ?

Alex
(0019980)
daniil (reporter)
2010-03-22 17:13

The state is Help me to write the cmake file :-) I decided to compile the files that is in src file to the library and then link it to the main.cpp.

I have a project, see attached, it developed using avr gcc, it requires to port to iar. As I know cmake supports a gcc, the only is needed a correct toolchain for avr-gcc.

I don't know cmake well, I thought if I write cmake project workable for gcc then it is easily to port the code to IAR and I be sure that cmake project is correct and nothing to change in it.

For me CMakes for IAR and Gcc should be the same but different toolchains.
 
Daniil
(0019981)
daniil (reporter)
2010-03-23 06:15

Hi,

I need your suggest. I write the CMakeLists.txt file this is it. It is a very simple. The next my tool chain file. And two outputs first is made by my makefile and the second the makefile generated by cmake.

I actually doesn't see a difference but firmware generated by cmake doesn't work.

Can you suggest me anything....


********************************************************************************

cmake_minimum_required(VERSION 2.8)

project(i26.elf)
enable_language(ASM)

set(CMAKE_CXX_FLAGS "-g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561")
set(CMAKE_CXX_LINK_FLAGS "-Wl,--gc-sections -Wl,--relax -mmcu=atmega2561")

add_definitions(-DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZIGBIT)
include_directories(./include)

set(board_path ./src/board)
set(cpu_path ./src/cpu/atmega1281)

set(sources
    ./src/terminal.cpp
    ${board_path}/meshbean/leddrivers.cpp
    ${board_path}/meshbean/buttondrivers.cpp
    ${board_path}/zigbit/rfdriver.cpp
    ${cpu_path}/clockdriver.cpp
    ${cpu_path}/usartdriver.cpp
    ./src/ptthread.cpp
    ./src/scheduller.cpp
    ./src/signal.cpp
    ./src/timer.cpp
    ./src/led.cpp
    ./src/button.cpp
    ./src/clock.cpp
    ./src/usart.cpp
    ./src/rf231.cpp
    ${cpu_path}/application.cpp
    ${cpu_path}/system.cpp
    ./src/list.cpp
    ./main.cpp)

add_executable(i26.elf ${sources})

********************************************************************************

# this one is important
set(CMAKE_SYSTEM_NAME Generic)

set(CMAKE_C_COMPILER avr-gcc)
set(CMAKE_C_FLAGS_INIT "-g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561")

set(CMAKE_ASM_COMPILER avr-as)

set(CMAKE_CXX_COMPILER avr-g++)
#set(CMAKE_CXX_FLAGS "-g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561")
#set(CMAKE_CXX_LINK_FLAGS "-Wl,--gc-sections -Wl,--relax -mmcu=atmega2561")

# where compiler is
SET(CMAKE_FIND_ROOT_PATH C:\\WinAVR-20090313\\bin )

# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

*******************************************************************************

dkasyanov@DKASYANOV2 /c/Projects/Research/i26
$ make -f makefile1
avr-g++ -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -DMESHBEAN -DATM
EGA1281 -DF_CPU=8000000 -DZIGBIT -I./include -c ./src/terminal.cpp
avr-g++ -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -DMESHBEAN -DATM
EGA1281 -DF_CPU=8000000 -DZIGBIT -I./include -c ./src/board/meshbean/leddrivers.
cpp \
                                ./src/board/meshbean/buttondrivers.cpp \
                                ./src/board/zigbit/rfdriver.cpp \
                                ./src/cpu/atmega1281/clockdriver.cpp \
                                ./src/cpu/atmega1281/usartdriver.cpp
avr-g++ -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -DMESHBEAN -DATM
EGA1281 -DF_CPU=8000000 -DZIGBIT -I./include -c ./src/ptthread.cpp \
                                ./src/scheduller.cpp \
                                ./src/signal.cpp \
                                ./src/timer.cpp \
                                ./src/led.cpp \
                                ./src/button.cpp \
                                ./src/clock.cpp \
                                ./src/usart.cpp \
                                ./src/rf231.cpp \
                         ./src/cpu/atmega1281/application.cpp ./src/cpu/atmega12
81/system.cpp
avr-g++ -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -DMESHBEAN -DATM
EGA1281 -DF_CPU=8000000 -DZIGBIT -I./include -c ./src/list.cpp
avr-g++ -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -DMESHBEAN -DATM
EGA1281 -DF_CPU=8000000 -DZIGBIT -I./include -c main.cpp
main.cpp: In function 'int main()':
main.cpp:60: warning: unused variable 'write'
main.cpp:61: warning: unused variable 'read'
avr-g++ -Wl,--gc-sections -Wl,--relax -mmcu=atmega2561 -o i26.elf *.o
avr-objcopy -O ihex -R .eeprom i26.elf i26.hex
avr-size -t *.o
   text data bss dec hex filename
     66 0 1 67 43 application.o
    176 16 0 192 c0 button.o
    160 0 0 160 a0 buttondrivers.o
    358 12 14 384 180 clock.o
    112 0 3 115 73 clockdriver.o
      0 0 0 0 0 led.o
     64 0 0 64 40 leddrivers.o
    266 0 0 266 10a list.o
    484 74 0 558 22e main.o
     26 0 0 26 1a ptthread.o
    264 0 1 265 109 rf231.o
    156 0 1 157 9d rfdriver.o
    172 0 4 176 b0 scheduller.o
      0 2 1024 1026 402 signal.o
     26 0 1 27 1b system.o
    500 80 0 580 244 terminal.o
     18 0 0 18 12 timer.o
    676 12 0 688 2b0 usart.o
    814 0 2073 2887 b47 usartdriver.o
   4338 196 3122 7656 1de8 (TOTALS)
avr-size -t i26.elf
   text data bss dec hex filename
   2490 88 3121 5699 1643 i26.elf
   2490 88 3121 5699 1643 (TOTALS)
rm -f *.o

*******************************************************************************

dkasyanov@DKASYANOV2 /c/Projects/Research/i26
$ make VERBOSE=0 clean all
make -f CMakeFiles/Makefile2 clean
make[1]: Entering directory `/c/Projects/Research/i26'
make -f CMakeFiles/i26.elf.dir/build.make CMakeFiles/i26.elf.dir/clean
make[2]: Entering directory `/c/Projects/Research/i26'
/C/CMake/bin/cmake.exe -P CMakeFiles/i26.elf.dir/cmake_clean.cmake
make[2]: Leaving directory `/c/Projects/Research/i26'
make[1]: Leaving directory `/c/Projects/Research/i26'
/C/CMake/bin/cmake.exe -H/C/Projects/Research/i26 -B/C/Projects/Research/i26 --c
heck-build-system CMakeFiles/Makefile.cmake 0
/C/CMake/bin/cmake.exe -E cmake_progress_start /C/Projects/Research/i26/CMakeFil
es /C/Projects/Research/i26/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/c/Projects/Research/i26'
make -f CMakeFiles/i26.elf.dir/build.make CMakeFiles/i26.elf.dir/depend
make[2]: Entering directory `/c/Projects/Research/i26'
/C/CMake/bin/cmake.exe -E cmake_depends "MSYS Makefiles" /C/Projects/Research/i2
6 /C/Projects/Research/i26 /C/Projects/Research/i26 /C/Projects/Research/i26 /C/
Projects/Research/i26/CMakeFiles/i26.elf.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/c/Projects/Research/i26'
make -f CMakeFiles/i26.elf.dir/build.make CMakeFiles/i26.elf.dir/build
make[2]: Entering directory `/c/Projects/Research/i26'
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 1
[ 5%] Building CXX object CMakeFiles/i26.elf.dir/src/terminal.cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/terminal.cpp.obj -c /C/Projec
ts/Research/i26/src/terminal.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 2
[ 10%] Building CXX object CMakeFiles/i26.elf.dir/src/board/meshbean/leddrivers.
cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/board/meshbean/leddrivers.cpp
.obj -c /C/Projects/Research/i26/src/board/meshbean/leddrivers.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 3
[ 15%] Building CXX object CMakeFiles/i26.elf.dir/src/board/meshbean/buttondrive
rs.cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/board/meshbean/buttondrivers.
cpp.obj -c /C/Projects/Research/i26/src/board/meshbean/buttondrivers.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 4
[ 21%] Building CXX object CMakeFiles/i26.elf.dir/src/board/zigbit/rfdriver.cpp.
obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/board/zigbit/rfdriver.cpp.obj
 -c /C/Projects/Research/i26/src/board/zigbit/rfdriver.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 5
[ 26%] Building CXX object CMakeFiles/i26.elf.dir/src/cpu/atmega1281/clockdriver
.cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/cpu/atmega1281/clockdriver.cp
p.obj -c /C/Projects/Research/i26/src/cpu/atmega1281/clockdriver.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 6
[ 31%] Building CXX object CMakeFiles/i26.elf.dir/src/cpu/atmega1281/usartdriver
.cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/cpu/atmega1281/usartdriver.cp
p.obj -c /C/Projects/Research/i26/src/cpu/atmega1281/usartdriver.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 7
[ 36%] Building CXX object CMakeFiles/i26.elf.dir/src/ptthread.cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/ptthread.cpp.obj -c /C/Projec
ts/Research/i26/src/ptthread.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 8
[ 42%] Building CXX object CMakeFiles/i26.elf.dir/src/scheduller.cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/scheduller.cpp.obj -c /C/Proj
ects/Research/i26/src/scheduller.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 9
[ 47%] Building CXX object CMakeFiles/i26.elf.dir/src/signal.cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/signal.cpp.obj -c /C/Projects
/Research/i26/src/signal.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 10
[ 52%] Building CXX object CMakeFiles/i26.elf.dir/src/timer.cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/timer.cpp.obj -c /C/Projects/
Research/i26/src/timer.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 11
[ 57%] Building CXX object CMakeFiles/i26.elf.dir/src/led.cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/led.cpp.obj -c /C/Projects/Re
search/i26/src/led.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 12
[ 63%] Building CXX object CMakeFiles/i26.elf.dir/src/button.cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/button.cpp.obj -c /C/Projects
/Research/i26/src/button.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 13
[ 68%] Building CXX object CMakeFiles/i26.elf.dir/src/clock.cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/clock.cpp.obj -c /C/Projects/
Research/i26/src/clock.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 14
[ 73%] Building CXX object CMakeFiles/i26.elf.dir/src/usart.cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/usart.cpp.obj -c /C/Projects/
Research/i26/src/usart.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 15
[ 78%] Building CXX object CMakeFiles/i26.elf.dir/src/rf231.cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/rf231.cpp.obj -c /C/Projects/
Research/i26/src/rf231.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 16
[ 84%] Building CXX object CMakeFiles/i26.elf.dir/src/cpu/atmega1281/application
.cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/cpu/atmega1281/application.cp
p.obj -c /C/Projects/Research/i26/src/cpu/atmega1281/application.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 17
[ 89%] Building CXX object CMakeFiles/i26.elf.dir/src/cpu/atmega1281/system.cpp.
obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/cpu/atmega1281/system.cpp.obj
 -c /C/Projects/Research/i26/src/cpu/atmega1281/system.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 18
[ 94%] Building CXX object CMakeFiles/i26.elf.dir/src/list.cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/src/list.cpp.obj -c /C/Projects/R
esearch/i26/src/list.cpp
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 19
[100%] Building CXX object CMakeFiles/i26.elf.dir/main.cpp.obj
/C/WinAVR-20090313/bin/avr-g++.exe -DMESHBEAN -DATMEGA1281 -DF_CPU=8000000 -DZ
IGBIT -g -Os -Wall -ffunction-sections -Wall -mmcu=atmega2561 -I/C/Projects/Rese
arch/i26/./include -o CMakeFiles/i26.elf.dir/main.cpp.obj -c /C/Projects/Resea
rch/i26/main.cpp
c:/Projects/Research/i26/main.cpp: In function 'int main()':
c:/Projects/Research/i26/main.cpp:60: warning: unused variable 'write'
c:/Projects/Research/i26/main.cpp:61: warning: unused variable 'read'
Linking CXX executable i26.elf
/C/WinAVR-20090313/bin/avr-g++.exe -g -Os -Wall -ffunction-sections -Wall -mmc
u=atmega2561 -Wl,--gc-sections -Wl,--relax -mmcu=atmega2561 "CMakeFiles/i26.elf
.dir/src/terminal.cpp.obj" "CMakeFiles/i26.elf.dir/src/board/meshbean/leddrivers
.cpp.obj" "CMakeFiles/i26.elf.dir/src/board/meshbean/buttondrivers.cpp.obj" "CMa
keFiles/i26.elf.dir/src/board/zigbit/rfdriver.cpp.obj" "CMakeFiles/i26.elf.dir/s
rc/cpu/atmega1281/clockdriver.cpp.obj" "CMakeFiles/i26.elf.dir/src/cpu/atmega128
1/usartdriver.cpp.obj" "CMakeFiles/i26.elf.dir/src/ptthread.cpp.obj" "CMakeFiles
/i26.elf.dir/src/scheduller.cpp.obj" "CMakeFiles/i26.elf.dir/src/signal.cpp.obj"
 "CMakeFiles/i26.elf.dir/src/timer.cpp.obj" "CMakeFiles/i26.elf.dir/src/led.cpp.
obj" "CMakeFiles/i26.elf.dir/src/button.cpp.obj" "CMakeFiles/i26.elf.dir/src/clo
ck.cpp.obj" "CMakeFiles/i26.elf.dir/src/usart.cpp.obj" "CMakeFiles/i26.elf.dir/s
rc/rf231.cpp.obj" "CMakeFiles/i26.elf.dir/src/cpu/atmega1281/application.cpp.obj
" "CMakeFiles/i26.elf.dir/src/cpu/atmega1281/system.cpp.obj" "CMakeFiles/i26.elf
.dir/src/list.cpp.obj" "CMakeFiles/i26.elf.dir/main.cpp.obj" -o i26.elf
make[2]: Leaving directory `/c/Projects/Research/i26'
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/Research/i26/CMakeFi
les 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
[100%] Built target i26.elf
make[1]: Leaving directory `/c/Projects/Research/i26'
/C/CMake/bin/cmake.exe -E cmake_progress_start /C/Projects/Research/i26/CMakeFil
es 0

********************************************************************************
(0019982)
daniil (reporter)
2010-03-23 06:50

I think it is a source problem it is needed to restructure
(0019988)
Alex Neundorf (developer)
2010-03-23 16:31

Hmm, strange. It seems the flags for compiling the files are indeed the same.
Maybe if you don't use -Wl,--relax, maybe then you'll get some more warning messages ?

I'd also try to do the avr-size for the object files generated with the cmake-generated Makefile (they are in the CMakeFiles/ subdirectory) and check whether they are the same or whether they differ, maybe also use objdump to have a closer look at the created files.

I'm not sure whether the order of the object files for linking may matter. Maybe if there are static objects where the order in which they are constructed matters, or if somewhere weak linkage is specified it *might* matter.

Alex
(0019989)
Alex Neundorf (developer)
2010-03-23 16:34

Another hint for setting CMAKE_C_FLAGS and CMAKE_CXX_FLAGS:
during the initial cmake run, cmake checks the CFLAGS and CXXFLAGS environment variables and uses their values to initialize CMAKE_C_FLAGS and CMAKE_CXX_FLAGS.

Alex
(0020000)
daniil (reporter)
2010-03-24 03:13

I think it linking matter because it partly works, partly I mean the firmware is correct but code not. I try to redesign a bit the project.

"Another hint for setting CMAKE_C_FLAGS and CMAKE_CXX_FLAGS:
during the initial cmake run, cmake checks the CFLAGS and CXXFLAGS environment variables and uses their values to initialize CMAKE_C_FLAGS and CMAKE_CXX_FLAGS."

You mean I have to set CFLAGS or CXXFLAGS in my toolchain file? I try to use add_definition to add compilation flags and it is works?

Why CMAKE_CXX_FLAGS_INIT works with IAR but doesn't with gcc?

Daniil
(0020001)
Alex Neundorf (developer)
2010-03-24 04:15

> You mean I have to set CFLAGS or CXXFLAGS in my toolchain file?

No. Before running cmake initially, set the CFLAGS and CXXFLAGS environment variables in the shell. They will be picked up by cmake.

Settings the _INIT variables works for the IAR compiler because the IAR-cmake files don't reset them initially. This is done for the gcc compiler. To be consistent, maybe the IAR cmake files should do this too.

Alex
(0020009)
Alex Neundorf (developer)
2010-03-25 14:10

Any news on this ?

I would suggest to try two things:
- use the linking command from the makefile with the objects from the cmake-generated makefile and see if this works

-use the linking command from the cmake-generated makefile with the objects from the makefile and see if that works.

Alex
(0020013)
daniil (reporter)
2010-03-26 02:52

I have no time these two days. I am going to do that today or on the week end.

Thanks for suggests

Daniil
(0020102)
Alex Neundorf (developer)
2010-04-08 04:10

Any news ?

Alex
(0020103)
daniil (reporter)
2010-04-08 04:33

Hi

Sorry, I have the busiest 3 weeks ever, we prepare the release.

I made a c++ project, tried it in gcc and it works.

So I try compile it using IAR and got the following: It seems flags "-y --cpu=m2561 -ms" are not set. I put them in CMAKE_CXX_FLAGS_INIT.

You can see my avr-iar.cmake toolchain file.

********************************************************************************
[ 16%] Building CXX object src/hal/CMakeFiles/halmeshbean_atmega1281_2561.dir/at
mega1281_2561/meshbean/buttons.cpp.r90
cd /C/Projects/proxima/src/hal && "/C/Program Files/IAR Systems/Embedded Workben
ch 5.3/avr/bin/iccavr.exe" --eec++ /C/Projects/proxima/src/hal/atmega1281_2561/m
eshbean/buttons.cpp -I"/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/
inc" -o CMakeFiles/halmeshbean_atmega1281_2561.dir/atmega1281_2561/meshbean/bu
ttons.cpp.r90

   IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
   Copyright 1996-2009 IAR Systems AB.

  #if defined __ICCAVR__
                       ^
"c:\Projects\proxima\src\hal\atmega1281_2561\meshbean\buttons.cpp",1 Warning[Pa
050]:
          non-native end of line sequence detected (this diagnostic is only
          issued once)

  #error This file, should only be compiled with "--cpu" set
   ^
"c:\Program Files\IAR Systems\Embedded Workbench 5.3\avr\inc\ioavr.h",365 Fatal
 error[Pe035]:
          #error directive: This file, should only be compiled with "--cpu" set
Fatal error detected, aborting.

Errors: 1
Warnings: 1
make[2]: *** [src/hal/CMakeFiles/halmeshbean_atmega1281_2561.dir/atmega1281_2561
/meshbean/buttons.cpp.r90] Error 2
make[2]: Leaving directory `/c/Projects/proxima'
make[1]: *** [src/hal/CMakeFiles/halmeshbean_atmega1281_2561.dir/all] Error 2
make[1]: Leaving directory `/c/Projects/proxima'
make: *** [all] Error 2
********************************************************************************
# this one is important
set(CMAKE_SYSTEM_NAME Generic)

set(CMAKE_C_COMPILER iccavr)
set(CMAKE_C_FLAGS_INIT "-y --cpu=m2561 -ms")
set(CMAKE_ASM_COMPILER aavr)

set(CMAKE_CXX_COMPILER iccavr "--eec++")
set(CMAKE_CXX_FLAGS_INIT "-y --cpu=m2561 -ms")
set(CMAKE_C_LINK_FLAGS "-Fintel-extended -xmsh -H1895 -f \"C:/Projects/cmake/iartest/lnkm1281s.xcl\" -l list.html -s main")

# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

set(TOOLCHAIN_LIBS "C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/LIB/DLIB/dlAVR-3s-ec_mul-f.r90")
(0020124)
Alex Neundorf (developer)
2010-04-10 18:52

Now that git is everywhere, I created a cmake clone for the IAR stuff at http://http://gitorious.org. [^]

Can you please try to get the sources directly from there ?
They are here:
http://gitorious.org/~neundorf/cmake/neundorfs-cmake [^]

So you first have to clone this, and then switch to the branch "IAR-support":
$ git clone ...
$ git checkout IAR-support

Here you can also directly download a tar.gz file of the current state:
http://gitorious.org/~neundorf/cmake/neundorfs-cmake/commits/IAR-support [^]

Alex
(0020129)
Alex Neundorf (developer)
2010-04-11 08:35

CMAKE_C_FLAGS_INIT should work.

CMAKE_C_FLAGS_INIT is handled in Modules/CMakeCInformation.cmake.
I suggest you add some
message(STATUS "C_FLAGS_INTI is ${CMAKE_C_FLAGS_INIT}")
calls in CMakeCInformation.cmake so you can see what's going on.

Alex
(0020132)
daniil (reporter)
2010-04-12 02:16

I have made as you told. I do the C++ project. You can see that
-- C_FLAGS_INIT is -y --cpu=m2561 -ms but they not appears in a command line.

Daniil

dkasyanov@DKASYANOV2 /c/Projects/proxima
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=avr-iar.cmake -DHAL=meshbean_
atmega1281_2561 .
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bi
n/iccavr.exe-
-- CMAKE_CXX_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/
bin/iccavr.exe-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: --
-- Found IAR linker: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin
/xlink.exe
-- Found IAR archiver: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/b
in/xar.exe
-- IAR_TARGET_ARCHITECTURE: AVR
-- CMAKE_C_LINK_FLAGS: --Fintel-extended -xmsh -H1895 -f "C:/Projects/cmake/iart
est/lnkm1281s.xcl" -l list.html -s main-
-- C_FLAGS_INIT is -y --cpu=m2561 -ms
-- Processing Compiler/IAR-CXX.cmake...
-- CMAKE_CXX_LINK_FLAGS: --Fmotorola-
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Projects/proxima

dkasyanov@DKASYANOV2 /c/Projects/proxima
$ make VERBOSE=0
/C/CMake/bin/cmake.exe -H/C/Projects/proxima -B/C/Projects/proxima --check-build
-system CMakeFiles/Makefile.cmake 0
/C/CMake/bin/cmake.exe -E cmake_progress_start /C/Projects/proxima/CMakeFiles /C
/Projects/proxima/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/c/Projects/proxima'
make -f src/hal/CMakeFiles/halmeshbean_atmega1281_2561.dir/build.make src/hal/CM
akeFiles/halmeshbean_atmega1281_2561.dir/depend
make[2]: Entering directory `/c/Projects/proxima'
/C/CMake/bin/cmake.exe -E cmake_depends "MSYS Makefiles" /C/Projects/proxima /C/
Projects/proxima/src/hal /C/Projects/proxima /C/Projects/proxima/src/hal /C/Proj
ects/proxima/src/hal/CMakeFiles/halmeshbean_atmega1281_2561.dir/DependInfo.cmake
 --color=
make[2]: Leaving directory `/c/Projects/proxima'
make -f src/hal/CMakeFiles/halmeshbean_atmega1281_2561.dir/build.make src/hal/CM
akeFiles/halmeshbean_atmega1281_2561.dir/build
make[2]: Entering directory `/c/Projects/proxima'
/C/CMake/bin/cmake.exe -E cmake_progress_report /C/Projects/proxima/CMakeFiles 1

[ 16%] Building CXX object src/hal/CMakeFiles/halmeshbean_atmega1281_2561.dir/at
mega1281_2561/meshbean/buttons.cpp.r90
cd /C/Projects/proxima/src/hal && "/C/Program Files/IAR Systems/Embedded Workben
ch 5.3/avr/bin/iccavr.exe" --eec++ /C/Projects/proxima/src/hal/atmega1281_2561/m
eshbean/buttons.cpp -I"/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/
inc" -o CMakeFiles/halmeshbean_atmega1281_2561.dir/atmega1281_2561/meshbean/bu
ttons.cpp.r90

   IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
   Copyright 1996-2009 IAR Systems AB.

  #if defined __ICCAVR__
                       ^
"c:\Projects\proxima\src\hal\atmega1281_2561\meshbean\buttons.cpp",1 Warning[Pa
050]:
          non-native end of line sequence detected (this diagnostic is only
          issued once)

  #error This file, should only be compiled with "--cpu" set
   ^
"c:\Program Files\IAR Systems\Embedded Workbench 5.3\avr\inc\ioavr.h",365 Fatal
 error[Pe035]:
          #error directive: This file, should only be compiled with "--cpu" set
Fatal error detected, aborting.

Errors: 1
Warnings: 1
make[2]: *** [src/hal/CMakeFiles/halmeshbean_atmega1281_2561.dir/atmega1281_2561
/meshbean/buttons.cpp.r90] Error 2
make[2]: Leaving directory `/c/Projects/proxima'
make[1]: *** [src/hal/CMakeFiles/halmeshbean_atmega1281_2561.dir/all] Error 2
make[1]: Leaving directory `/c/Projects/proxima'
make: *** [all] Error 2

dkasyanov@DKASYANOV2 /c/Projects/proxima
(0020179)
daniil (reporter)
2010-04-14 10:31

Hi

I have encounter with another problem. In a project I have to specify an dlib configuration file and I do it this way see tool_chain_file and I get an the following error

**************TOOLCHAIN******************************************

# this one is important
set(CMAKE_SYSTEM_NAME Generic)

set(CMAKE_C_COMPILER iccavr)
set(CMAKE_C_FLAGS_INIT "-y --cpu=m1281 -ms")
set(CMAKE_ASM_COMPILER aavr)

set(CMAKE_CXX_COMPILER iccavr "--eec++")
set(CMAKE_CXX_FLAGS_INIT "-y --cpu=m1281 -ms --dlib_config "C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/LIB/DLIB/dlAVR-3s-ec_mul-n.h" ")
#set(CMAKE_CXX_FLAGS "--dlib_config C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/LIB/DLIB/dlAVR-3s-ec_mul-n.h\")
set(CMAKE_C_LINK_FLAGS "-Fintel-extended -xmsh -H1895 -f \"C:/Projects/cmake/iartest/lnkm1281s.xcl\" -l list.html -s main")

# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

set(TOOLCHAIN_LIBS "C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/LIB/DLIB/dlAVR-3s-ec_mul-f.r90")

include_directories("C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/inc/dlib")
include_directories("C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/inc/Atmel")


*****************************************************************

dkasyanov@DKASYANOV2 /c/Projects/proxima
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=avr-iar.cmake -DHAL=meshbean_
atmega1281_2561 .
-- The CXX compiler identification is unknown
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bi
n/iccavr.exe-
-- CMAKE_CXX_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/
bin/iccavr.exe-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: -C:/Program Files/IAR Systems/Embedded Workbench 5
.3/avr/bin-
-- Found IAR linker: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin
/xlink.exe
-- Found IAR archiver: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/b
in/xar.exe
-- IAR_TARGET_ARCHITECTURE: AVR
-- CMAKE_C_LINK_FLAGS: --Fintel-extended -xmsh -H1895 -f "C:/Projects/cmake/iart
est/lnkm1281s.xcl" -l list.html -s main-
-- C_FLAGS_INIT is -y --cpu=m1281 -ms
-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.3/avr/bin/iccavr.exe
-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.3/avr/bin/iccavr.exe -- broken
CMake Error at C:/CMake/Modules/CMakeTestCXXCompiler.cmake:45 (MESSAGE):
  The C++ compiler "C:/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/bin/iccavr.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Projects/proxima/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/Projects/proxima/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/proxima/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building CXX object CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.obj

  "/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe"
  --eec++ -y --cpu=m1281 -ms --dlib_config C:/Program Files/IAR
  Systems/Embedded Workbench 5.3/avr/LIB/DLIB/dlAVR-3s-ec_mul-n.h
  -I"/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/inc/dlib"
  -I"/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/inc/Atmel" -o
  CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.obj -c
  /C/Projects/proxima/CMakeFiles/CMakeTmp/testCXXCompiler.cxx



     IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
     Copyright 1996-2009 IAR Systems AB.

  Command line error: Unexpected command line arguments:

            -c

  make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.obj]
  Error 2

  make[1]: Leaving directory `/c/Projects/proxima/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):



-- Configuring incomplete, errors occurred!
(0020189)
daniil (reporter)
2010-04-15 04:07
edited on: 2010-04-15 04:11

Hi

I have compiled the libraries successfully but dlib-config problem still consists. Do I need update cmake?

I have encounter the following problem with linker: it says Option -L must not be defined more than once

[100%] Building CXX object CMakeFiles/sample_basic.elf.dir/main.cpp.r90
"/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe" --eec++
 /C/Projects/proxima/examples/sample_basic/main.cpp -D__ATMEGA1281_2561__ -D__ME
SHBEAN__ -e -y --cpu=m1281 -ms -I"/C/Program Files/IAR Systems/Embedded Workbenc
h 5.3/avr/inc/dlib" -I"/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/i
nc/Atmel" -I"/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/inc" -I/C/P
rojects/proxima/examples/sample_basic/../../include -o CMakeFiles/sample_basic
.elf.dir/main.cpp.r90

   IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
   Copyright 1996-2009 IAR Systems AB.

  /*
    ^
"c:\Projects\proxima\include\system\button.h",1 Warning[Pa050]: non-native
          end of line sequence detected (this diagnostic is only issued once)
Library configuration file is not specified. Use --dlib_config, please see the
compiler reference guide for details.

 272 bytes of CODE memory (+ 1 212 bytes shared)
  18 bytes of DATA memory (+ 30 bytes shared)

Errors: none
Warnings: 1
Linking CXX executable sample_basic.elf.bin
"/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/xlink.exe" "CMakeFi
les/sample_basic.elf.dir/main.cpp.r90" -Fmotorola -L/C/Projects/proxima/examp
les/sample_basic/../../src/hal -L/C/Projects/proxima/examples/sample_basic/../..
/src/system -lhalmeshbean_atmega1281_2561 -lsystem -o sample_basic.elf.bin
Error[e38]: Option -L must not be defined more than once: -Lc:/Projects/proxima/
examples/sample_basic/../../src/system

Fatal! Execution terminated...
make[2]: *** [sample_basic.elf.bin] Error 3
make[2]: Leaving directory `/c/Projects/proxima/examples/sample_basic'
make[1]: *** [CMakeFiles/sample_basic.elf.dir/all] Error 2
make[1]: Leaving directory `/c/Projects/proxima/examples/sample_basic'
make: *** [all] Error 2

(0020192)
daniil (reporter)
2010-04-15 06:55

to the previous coomment

xlink -L and -l option means
-Ldirectory Generate a list on: <dir> <dest> <.lst>
-l file Generate a list on: <file> <.lst>

Daniil
(0020196)
Alex Neundorf (developer)
2010-04-15 16:24

So we're making progress, that's good :-)

What did you do about your CMAKE_CXX_FLAGS_INIT problem to get it working ?

The problem with the --dlib_config was due to the spaces in the path and the quoting I guess ?

Alex
(0020197)
Alex Neundorf (developer)
2010-04-15 16:26

Re: 20192 (the xlink problem):
Please update your cmake to the cmake from gitorious.
Now instead of "-L" "-I" should be used. It wasn't completely clear from the documentation whether "-IdirA -IdirB -IdirC" is possible or whether it has to be "-IdirA;dirB;dirC".
So, please give it a try and we'll see.

Alex
(0020198)
Alex Neundorf (developer)
2010-04-15 16:27

(I think "git pull --rebase" should do the updating, here's a short introduction to git: http://www.cmake.org/Wiki/CMake/Git [^] )

Alex
(0020205)
daniil (reporter)
2010-04-16 01:47

What did you do about your CMAKE_CXX_FLAGS_INIT problem to get it working ?

Actually nothing, I think it just started working. I think the problem was I didn't reconfigured the project.

To reconfigure I delete all generated files manually how can I do it over cmake?

Daniil
(0020209)
daniil (reporter)
2010-04-16 01:53

I don't use git, for me is more convenient to download an archived snapshot. Now snapshot is tar.gz file which is firewalled. So I can't download it on work myself that I have to ask to download it other people or download it at home.

Could you made it to download as *.zip?

It is not a big problem but it'll makes life easier :)

Daniil
(0020212)
daniil (reporter)
2010-04-16 03:40

-I option is ok but -l option problem remains. -l option is used to Generate a list.

In a xlink the full library name should be used. I think cmake have to add lib prefex and *.a extension automatically.

Daniil
(0020245)
Alex Neundorf (developer)
2010-04-18 05:37

Re 20205:
I think in this case you really have to start from an empty build dir.

Re 20209:
The tar.gz is provided by gitorious, I have no idea whether it can also generate a .zip on the fly. I'm afraid it doesn't. I'll have a look.

Re 20212:
I'll have a look. I think if a full filename is required, you have to give it a full filename, cmake can't do this for you.
So you need something like
find_library(SYSTEM_LIBRARY system)
...
target_link_libraries(myprogram ${SYSTEM_LIBRARY} )

Then it should use the full paths.

If it doesn't, could please attach a full small example project which shows the problem ?

Alex
(0020248)
daniil (reporter)
2010-04-19 03:57

Hi, I have compiled and build my simple project both iar and gcc and both firmware works successfully.

But one problem remained, I can't specify dlib_config. If I specify it this way
set(CMAKE_CXX_FLAGS_INIT "--dlib_config \"C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/LIB/DLIB/dlAVR-3s-ec_mul-n.h\" -e -y --cpu=m1281 -ms")

To make it works I specify set(CMAKE_CXX_FLAGS_INIT "--dlib_config dlAVR-3s-ec_mul-n.h -e -y --cpu=m1281 -ms") but I have to put "dlAVR-3s-ec_mul-n.h" into the local directory which is not convenient.

I get the error:
  make[1]: Entering directory `/c/Projects/proxima/CMakeFiles/CMakeTmp'

  /C/CMake/bin/cmake.exe -E cmake_progress_report
  /C/Projects/proxima/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building CXX object CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.r90

  "/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe"
  --eec++ /C/Projects/proxima/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
  --dlib_config
  ;C:/Program;Files/IAR;Systems/Embedded;Workbench;5.3/avr/LIB/DLIB/dlAVR-3s-ec_
mul-n.h"
  -e -y --cpu=m1281 -ms " -I"/C/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/inc/dlib" -I"/C/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/inc/Atmel" -I"/C/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/lib/dlib" -I/inc -o
  CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.r90



     IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR

  Command line error: Copyright 1996-2009 IAR Systems AB.

  Option requires a separate parameter: --dlib_config

  /bin/sh: C:/Program: No such file or directory

  /bin/sh: Files/IAR: No such file or directory

  /bin/sh: Systems/Embedded: No such file or directory

  /bin/sh: Workbench: command not found

  /bin/sh: 5.3/avr/LIB/DLIB/dlAVR-3s-ec_mul-n.h -e -y --cpu=m1281 -ms : No
  such file or directory

  make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.r90]
  Error 127

  make[1]: Leaving directory `/c/Projects/proxima/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2

 
Daniil
(0020250)
daniil (reporter)
2010-04-19 09:21

find_library doesn't work with gcc I got this but OK with IAR

dkasyanov@DKASYANOV2 /c/Projects/proxima/examples/sample_basic
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=../../avr-gcc.cmake -DHAL=mes
hbean_atmega1281_2561 .
extension: -.out--- The C compiler identification is GNU
extension: -.out--- The CXX compiler identification is GNU
-- Check for working C compiler: C:/WinAVR-20090313/bin/avr-gcc.exe
-- Check for working C compiler: C:/WinAVR-20090313/bin/avr-gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
extension: -.bin--- Check for working CXX compiler: C:/WinAVR-20090313/bin/avr-g
++.exe
-- Check for working CXX compiler: C:/WinAVR-20090313/bin/avr-g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
extension: -.bin-CMake Error: The following variables are used in this project,
but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake file
s:
HAL_LIBRARY
    linked by target "sample_basic.elf" in directory C:/Projects/proxima/example
s/sample_basic
SYSTEM_LIBRARY
    linked by target "sample_basic.elf" in directory C:/Projects/proxima/example
s/sample_basic

-- Configuring incomplete, errors occurred!
(0020251)
daniil (reporter)
2010-04-19 09:24

I have also noticed that when configure iar the message appears that ABI info - failed. It doesn't influence anything

ch 5.3/avr/bin/iccavr.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
(0020260)
Alex Neundorf (developer)
2010-04-19 14:13

Re 20251:
That's ok.

Re 20248:
I would suggest you also try to escape the spaces:
set(CMAKE_CXX_FLAGS_INIT "--dlib_config \"C:/Program\ Files/IAR\ Systems/Embedded\ Workbench\ 5.3/avr/LIB/DLIB/dlAVR-3s-ec_mul-n.h\" -e -y --cpu=m1281 -ms")
 
Alex
(0020261)
Alex Neundorf (developer)
2010-04-19 14:22

How are the libraries actually named, i.e. what is the full name of the "system" library ?

Can you please also add
message(STATUS "CMAKE_EXECUTABLE_SUFFIX -${CMAKE_EXECUTABLE_SUFFIX}-")
message(STATUS "CMAKE_SHARED_LIBRARY_SUFFIX -${CMAKE_SHARED_LIBRARY_SUFFIX}-")
message(STATUS "CMAKE_STATIC_LIBRARY_SUFFIX -${CMAKE_STATIC_LIBRARY_SUFFIX}-")
message(STATUS "CMAKE_SHARED_LIBRARY_PREFIX -${CMAKE_SHARED_LIBRARY_PREFIX}-")
message(STATUS "CMAKE_STATIC_LIBRARY_PREFIX -${CMAKE_STATIC_LIBRARY_PREFIX}-")
message(STATUS "CMAKE_C_OUTPUT_EXTENSION -${CMAKE_C_OUTPUT_EXTENSION}-")

to one of your CMakeLists.txt and post the output from cmake both for the IAR compiler and also for gcc ?

Thanks
Alex
(0020270)
daniil (reporter)
2010-04-20 03:33

Re 0020260:
It is not works any, I tried it differently and it doesn't work this is the output

  "/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe"
  --eec++ /C/Projects/proxima/CMakeFiles/CMakeTmp/testCXXCompiler.cxx -Ohz
  --dlib_config
  ;C:/Program;Files/IAR;Systems/Embedded;Workbench;5.3/avr/LIB/DLIB/dlAVR-3s-ec_
mul-n.h"
  -e -y --cpu=m1281 -ms " -I"/C/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/inc/dlib" -I"/C/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/inc/Atmel" -I"/C/Program Files/IAR Systems/Embedded Workbench
  5.3/avr/lib/dlib" -I/inc -o
  CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.r90



     IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
     Copyright 1996-2009 IAR Systems AB.

  Command line error: Option requires a separate parameter: --dlib_config

  /bin/sh: C:/Program: No such file or directory

  /bin/sh: Files/IAR: No such file or directory

  /bin/sh: Systems/Embedded: No such file or directory

  /bin/sh: Workbench: command not found

  /bin/sh: 5.3/avr/LIB/DLIB/dlAVR-3s-ec_mul-n.h -e -y --cpu=m1281 -ms : No
  such file or directory

  make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.r90]
  Error 127

  make[1]: Leaving directory `/c/Projects/proxima/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):



-- Configuring incomplete, errors occurred!
(0020271)
daniil (reporter)
2010-04-20 03:49

Re 0020261
This is a libraries name
libhalmeshbean_atmega1281_2561.a
and
libsystem.a

The thing is strange because when build using IAR it works but it doesn't with avr-g++

This is my CMakeLists.txt that builds the application.

cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0015 NEW)

#
# Cache variable
#
set(HAL CACHE TYPE STRING)
set_property(CACHE HAL PROPERTY
               STRINGS "meshbean_atmega1281_2561;pc" )

#
# Link directories
#
link_directories(../../src/hal ../../src/system)

#
# Target
#
add_executable(sample_basic.elf main.cpp)

#
# Board Selection
#
if (${HAL} STREQUAL meshbean_atmega1281_2561)
    add_definitions(-D__ATMEGA1281_2561__ -D__MESHBEAN__)
    find_library(HAL_LIBRARY halmeshbean_atmega1281_2561 ../../src/hal/atmega1281_2561)
    target_link_libraries(sample_basic.elf ${HAL_LIBRARY})
endif (${HAL} STREQUAL meshbean_atmega1281_2561)

include_directories(../../include)

find_library(SYSTEM_LIBRARY system ../../src/system)
target_link_libraries(sample_basic.elf ${SYSTEM_LIBRARY})
target_link_libraries(sample_basic.elf ${TOOLCHAIN_LIBRARY})


message(STATUS "CMAKE_EXECUTABLE_SUFFIX -${CMAKE_EXECUTABLE_SUFFIX}-")
message(STATUS "CMAKE_SHARED_LIBRARY_SUFFIX -${CMAKE_SHARED_LIBRARY_SUFFIX}-")
message(STATUS "CMAKE_STATIC_LIBRARY_SUFFIX -${CMAKE_STATIC_LIBRARY_SUFFIX}-")
message(STATUS "CMAKE_SHARED_LIBRARY_PREFIX -${CMAKE_SHARED_LIBRARY_PREFIX}-")
message(STATUS "CMAKE_STATIC_LIBRARY_PREFIX -${CMAKE_STATIC_LIBRARY_PREFIX}-")
message(STATUS "CMAKE_C_OUTPUT_EXTENSION -${CMAKE_C_OUTPUT_EXTENSION}-")



Output from IAR

///////////////////////////////////////////////////////////////////////////////

dkasyanov@DKASYANOV2 /c/Projects/proxima/examples/sample_basic
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=../../avr-iar.cmake -DHAL=mes
hbean_atmega1281_2561 .
extension: -.r90--- The C compiler identification is IAR
extension: -.r90--- The CXX compiler identification is IAR
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bi
n/iccavr.exe-
-- CMAKE_CXX_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/
bin/iccavr.exe-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: -C:/Program Files/IAR Systems/Embedded Workbench 5
.3/avr/bin-
-- Found IAR linker: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin
/xlink.exe
-- Found IAR archiver: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/b
in/xar.exe
-- IAR_TARGET_ARCHITECTURE: AVR
-- CMAKE_C_LINK_FLAGS: --Fintel-extended -xmsh -H1895 -f "C:/Projects/cmake/iart
est/lnkm1281s.xcl" -l list.html -s main-
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe
-- Check for working C compiler: C:/Program Files/IAR Systems/Embedded Workbench
 5.3/avr/bin/iccavr.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Processing Compiler/IAR-CXX.cmake...
-- CMAKE_CXX_LINK_FLAGS: --Fintel-extended -xmsh -H1895 -f "C:/Projects/cmake/ia
rtest/lnkm1281s.xcl" -l list.html -s main-
-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.3/avr/bin/iccavr.exe
-- Check for working CXX compiler: C:/Program Files/IAR Systems/Embedded Workben
ch 5.3/avr/bin/iccavr.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- CMAKE_EXECUTABLE_SUFFIX -.bin-
-- CMAKE_SHARED_LIBRARY_SUFFIX -.so-
-- CMAKE_STATIC_LIBRARY_SUFFIX -.a-
-- CMAKE_SHARED_LIBRARY_PREFIX -lib-
-- CMAKE_STATIC_LIBRARY_PREFIX -lib-
-- CMAKE_C_OUTPUT_EXTENSION -.r90-
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Projects/proxima/examples/sample_basic

dkasyanov@DKASYANOV2 /c/Projects/proxima/examples/sample_basic
$ make
Scanning dependencies of target sample_basic.elf
[100%] Building CXX object CMakeFiles/sample_basic.elf.dir/main.cpp.r90

   IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
   Copyright 1996-2009 IAR Systems AB.

 342 bytes of CODE memory (+ 788 bytes shared)
  18 bytes of DATA memory (+ 30 bytes shared)

Errors: none
Warnings: none
Linking CXX executable sample_basic.elf.bin

     IAR Universal Linker V4.61L/W32
     Copyright (C) 1987-2009 IAR Systems AB.

 2 972 bytes of CODE memory (+ 48 range fill )
   647 bytes of DATA memory (+ 16 absolute )

Errors: none
Warnings: none

[100%] Built target sample_basic.elf

dkasyanov@DKASYANOV2 /c/Projects/proxima/examples/sample_basic

////////////////////////////////////////////////////////////////////////////////

This is the output from Gcc
dkasyanov@DKASYANOV2 /c/Projects/proxima/examples/sample_basic
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=../../avr-gcc.cmake -DHAL=mes
hbean_atmega1281_2561 .
extension: -.out--- The C compiler identification is GNU
extension: -.out--- The CXX compiler identification is GNU
-- Check for working C compiler: C:/WinAVR-20090313/bin/avr-gcc.exe
-- Check for working C compiler: C:/WinAVR-20090313/bin/avr-gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
extension: -.bin--- Check for working CXX compiler: C:/WinAVR-20090313/bin/avr-g
++.exe
-- Check for working CXX compiler: C:/WinAVR-20090313/bin/avr-g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
extension: -.bin--- CMAKE_EXECUTABLE_SUFFIX --
-- CMAKE_SHARED_LIBRARY_SUFFIX -.so-
-- CMAKE_STATIC_LIBRARY_SUFFIX -.a-
-- CMAKE_SHARED_LIBRARY_PREFIX -lib-
-- CMAKE_STATIC_LIBRARY_PREFIX -lib-
-- CMAKE_C_OUTPUT_EXTENSION -.obj-
CMake Error: The following variables are used in this project, but they are set
to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake file
s:
HAL_LIBRARY
    linked by target "sample_basic.elf" in directory C:/Projects/proxima/example
s/sample_basic
SYSTEM_LIBRARY
    linked by target "sample_basic.elf" in directory C:/Projects/proxima/example
s/sample_basic

-- Configuring incomplete, errors occurred!

dkasyanov@DKASYANOV2 /c/Projects/proxima/examples/sample_basic
$ make
make: *** No targets specified and no makefile found. Stop.
(0020338)
Alex Neundorf (developer)
2010-04-21 16:42

Please add the following to your CMakeLists.txt:
message(STATUS "HAL_LIBRARY -${HAL_LIBRARY}-")
message(STATUS "CMAKE_PREFIX_PATH -${CMAKE_PREFIX_PATH}-")
message(STATUS "CMAKE_SYSTEM_PREFIX_PATH -${CMAKE_SYSTEM_PREFIX_PATH}-")
message(STATUS "CMAKE_LIBRARY_PATH -${CMAKE_LIBRARY_PATH}-")
message(STATUS "CMAKE_SYSTEM_LIBRARY_PATH -${CMAKE_SYSTEM_LIBRARY_PATH}-")
message(STATUS "CMAKE_FIND_ROOT_PATH -${CMAKE_FIND_ROOT_PATH}-")

and post the output both for the IAR and the gcc compiler.

Alex
(0020342)
daniil (reporter)
2010-04-22 02:27

IAR

dkasyanov@DKASYANOV2 /c/Projects/proxima/examples/sample_basic
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=../../avr-iar.cmake -DHAL=mes
hbean_atmega1281_2561 .
-- Processing Compiler/IAR-C.cmake...
-- Processing Compiler/IAR.cmake...
-- CMAKE_C_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bi
n/iccavr.exe-
-- CMAKE_CXX_COMPILER: -C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/
bin/iccavr.exe-
-- CMAKE_C_COMPILER_ABI: --
-- _CMAKE_TOOLCHAIN_LOCATION: --
-- Found IAR linker: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin
/xlink.exe
-- Found IAR archiver: C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/b
in/xar.exe
-- IAR_TARGET_ARCHITECTURE: AVR
-- CMAKE_C_LINK_FLAGS: --Fintel-extended -xmsh -H1895 -f "C:/Projects/cmake/iart
est/lnkm1281s.xcl" -l list.html -s main-
-- Processing Compiler/IAR-CXX.cmake...
-- CMAKE_CXX_LINK_FLAGS: --Fintel-extended -xmsh -H1895 -f "C:/Projects/cmake/ia
rtest/lnkm1281s.xcl" -l list.html -s main-
-- CMAKE_EXECUTABLE_SUFFIX -.bin-
-- CMAKE_SHARED_LIBRARY_SUFFIX -.so-
-- CMAKE_STATIC_LIBRARY_SUFFIX -.a-
-- CMAKE_SHARED_LIBRARY_PREFIX -lib-
-- CMAKE_STATIC_LIBRARY_PREFIX -lib-
-- CMAKE_C_OUTPUT_EXTENSION -.r90-
-- HAL_LIBRARY -C:/Projects/proxima/src/hal/atmega1281_2561/libhalmeshbean_atmeg
a1281_2561.a-
-- CMAKE_PREFIX_PATH --
-- CMAKE_SYSTEM_PREFIX_PATH --
-- CMAKE_LIBRARY_PATH --
-- CMAKE_SYSTEM_LIBRARY_PATH --
-- CMAKE_FIND_ROOT_PATH --
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Projects/proxima/examples/sample_basic

dkasyanov@DKASYANOV2 /c/Projects/proxima/examples/sample_basic
$ make clean all
[100%] Building CXX object CMakeFiles/sample_basic.elf.dir/main.cpp.r90

   IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
   Copyright 1996-2009 IAR Systems AB.

   820 bytes of CODE memory (+ 1 140 bytes shared)
 1 266 bytes of DATA memory (+ 30 bytes shared)

Errors: none
Warnings: none
Linking CXX executable sample_basic.elf.bin

     IAR Universal Linker V4.61L/W32
     Copyright (C) 1987-2009 IAR Systems AB.

 4 324 bytes of CODE memory (+ 48 range fill )
 1 895 bytes of DATA memory (+ 16 absolute )

Errors: none
Warnings: none

[100%] Built target sample_basic.elf


GCC
dkasyanov@DKASYANOV2 /c/Projects/proxima/examples/sample_basic
$ cmake -G"MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=../../avr-gcc.cmake -DHAL=mes
hbean_atmega1281_2561 .
extension: -.out--- The C compiler identification is GNU
extension: -.out--- The CXX compiler identification is GNU
-- Check for working C compiler: C:/WinAVR-20090313/bin/avr-gcc.exe
-- Check for working C compiler: C:/WinAVR-20090313/bin/avr-gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
extension: -.bin--- Check for working CXX compiler: C:/WinAVR-20090313/bin/avr-g
++.exe
-- Check for working CXX compiler: C:/WinAVR-20090313/bin/avr-g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
extension: -.bin--- CMAKE_EXECUTABLE_SUFFIX --
-- CMAKE_SHARED_LIBRARY_SUFFIX -.so-
-- CMAKE_STATIC_LIBRARY_SUFFIX -.a-
-- CMAKE_SHARED_LIBRARY_PREFIX -lib-
-- CMAKE_STATIC_LIBRARY_PREFIX -lib-
-- CMAKE_C_OUTPUT_EXTENSION -.obj-
-- HAL_LIBRARY -HAL_LIBRARY-NOTFOUND-
-- CMAKE_PREFIX_PATH --
-- CMAKE_SYSTEM_PREFIX_PATH --
-- CMAKE_LIBRARY_PATH --
-- CMAKE_SYSTEM_LIBRARY_PATH --
-- CMAKE_FIND_ROOT_PATH -C:\WinAVR-20090313\bin-
CMake Error: The following variables are used in this project, but they are set
to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake file
s:
HAL_LIBRARY
    linked by target "sample_basic.elf" in directory C:/Projects/proxima/example
s/sample_basic
SYSTEM_LIBRARY
    linked by target "sample_basic.elf" in directory C:/Projects/proxima/example
s/sample_basic

-- Configuring incomplete, errors occurred!

dkasyanov@DKASYANOV2 /c/Projects/proxima/examples/sample_basic
$ make
make: *** No targets specified and no makefile found. Stop.

Daniil
(0020343)
daniil (reporter)
2010-04-22 02:32

It seems that problem is in CMAKE_FIND_ROOT_PATH -C:\WinAVR-20090313\bin-
I set it in toolchain file so I have removed it and it works...

But the problem with --dlib_config remains
(0020346)
daniil (reporter)
2010-04-22 04:34

I have a question relates common cmake files organization.

CMake generates a lot of files that if I need to reconfigure the project with different tool chain file I have to delete all file generated that is annoying.

How can I clean up all generative files automatically? or can I put the generated files into one place to delete them at once?

Daniil
(0020361)
Alex Neundorf (developer)
2010-04-22 15:44

Re 20346: you are building in-source, i.e. you generate the makefiles in the directory where the sources are.
It is much more comfortable to build out-of-source, i.e. create separate directories for building. Then you can create multiple build directories for one source tree, and just delete these build directories when you don't want them anymore:

$ cd src
$ mkdir build-IAR
$ cd build-IAR
$ cmake options ..
$ make
...
$ cd ..
$ mkdir build-gcc
$ cd build-gcc
$ cmake options ..
$ make

Alex
(0020362)
Alex Neundorf (developer)
2010-04-22 15:51

Re 20342:
C:/Projects/proxima/src/hal/atmega1281_2561/libhalmeshbean_atmega1281_2561.a

Hmm, this is a library located in a directory named "src" ?
Where are your other libraries located ? Are they in the same directory or somewhere else ?
Did you build this library yourself, i.e. can you influence how it is created ? Is it built with cmake ?
If so, I would suggest you add install rules to the build of that library, and install it somewhere, to some place like c:/projects/atmega-install/lib/, and the headers to c:/projects/atmega-install/include/. Then they should be found if you set CMAKE_PREFIX_PATH to c:/projects/atmega-install/.

If you can't influence the location, I would suggest you set CMAKE_LIBRAEY_PATh to "C:/Projects/proxima/src/hal/atmega1281_2561/".
Then a
find_library(HAL_LIBRARY halmeshbean_atmega1281_2561)
without extra arguments should do.

With CMAKE_FIND_ROOT_PATH set it was not found because this PATH is prepended to all search dirs, so cmake was looking in a wrong location (C:/WinAVR-20090313/bin/../../src/hal/atmega1281_2561/ probably).

So, if this is working, can you please confirm that building out-of-source is working too ?

If we have that, then the dlib_config is the last remaining issue I think :-)

Alex
(0020372)
daniil (reporter)
2010-04-23 03:45
edited on: 2010-04-23 03:46

All libraries are build with cmake they are mine libraries.
So I have made as you suggest and it works great.

Daniil

(0020404)
Alex Neundorf (developer)
2010-04-26 16:28

So there's only the dlib_config issue left now ?

Alex
(0020439)
Alex Neundorf (developer)
2010-04-27 14:46

I'm relatively sure that the dlib_config issue can be solved with using the right mix of backslashes and double quotes.

set(CMAKE_CXX_FLAGS_INIT "--dlib_config C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/LIB/DLIB/dlAVR-3s-ec_mul-n.h -e -y --cpu=m1281 -ms")

I think to make it work double quotes should appear in the final command around the "C:/...".

Can you try putting \\\" around the path ?
(the first backslash to escape the second, the third to escape the quotes, so \" should survive into the final command).

Alex
(0020504)
Alex Neundorf (developer)
2010-05-01 05:32

Any news ?

Alex
(0020509)
daniil (reporter)
2010-05-02 09:59
edited on: 2010-05-02 10:00

Sorry, I couldn't answer, I am on vacation till Tuesday 4th of May.

Daniil

(0020524)
daniil (reporter)
2010-05-04 03:54

I think problem is --dlib_config C:/../file.h should be specify without quotes. But when I specify the quotes the I get this (More than one source file specified:) see below for details.

 /C/Projects/proxima/build-avr-iar/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
 --diag_suppress=Pa050 -Ohz --dlib_config C:/Program Files/IAR
 Systems/Embedded Workbench 5.3/avr/LIB/DLIB/dlAVR-5s-ec_mul-n.h -e -y
 --cpu=m2561 -ms -DF_CPU=8000000 -I"/C/Program Files/IAR Systems/Embedded
 Workbench 5.3/avr/inc/dlib" -I"/C/Program Files/IAR Systems/Embedded
 Workbench 5.3/avr/inc/Atmel" -I"/C/Program Files/IAR Systems/Embedded
 Workbench 5.3/avr/lib/dlib" -I/inc -o
 CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.r90



    IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
    Copyright 1996-2009 IAR Systems AB.

 Fatal error[Su011]: More than one source file specified:

           c:/Projects/proxima/build-avr-iar/CMakeFiles/CMakeTmp/testCXXCompile

                     .cxx
           Files/IAR
           Systems/Embedded
           Workbench
           5.3/avr/LIB/DLIB/dlAVR-5s-ec_mul-n.h

 Fatal error detected, aborting.

If I use the quotes the error that --dlib_config is wrong.

 Command line error: Option requires a separate parameter: --dlib_config

    Copyright 1996-2009 IAR Systems AB.

 /bin/sh: C:/Program: No such file or directory

 /bin/sh: Files/IAR: No such file or directory

 /bin/sh: Systems/Embedded: No such file or directory

 /bin/sh: Workbench: command not found

Daniil
(0020538)
Alex Neundorf (developer)
2010-05-04 14:27

So you did try exactly the following ?
set(CMAKE_CXX_FLAGS_INIT "--dlib_config \\\"C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/LIB/DLIB/dlAVR-3s-ec_mul-n.h\\\" -e -y --cpu=m1281 -ms")

Alex

P.S. I hope I didn't disturb your vacation :-)
(0020576)
daniil (reporter)
2010-05-05 02:04

Yes I tried that. This is what I get.


[ 7%] Building CXX object src/hal/atmega1281_2561/CMakeFiles/halmeshbean_atmega
1281_2561.dir/meshbean/buttons.cpp.r90
cd /C/Projects/proxima/build-avr-iar/src/hal/atmega1281_2561 && "/C/Program File
s/IAR Systems/Embedded Workbench 5.3/avr/bin/iccavr.exe" --eec++ /C/Projects/pro
xima/src/hal/atmega1281_2561/meshbean/buttons.cpp --diag_suppress=Pa050 -Ohz --
dlib_config \"C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/LIB/DLIB/d
lAVR-5s-ec_mul-n.h\" -e -y --cpu=m2561 -ms -DF_CPU=8000000 -I"/C/Program Files/I
AR Systems/Embedded Workbench 5.3/avr/inc/dlib" -I"/C/Program Files/IAR Systems/
Embedded Workbench 5.3/avr/inc/Atmel" -I"/C/Program Files/IAR Systems/Embedded W
orkbench 5.3/avr/lib/dlib" -I"/C/Program Files/IAR Systems/Embedded Workbench 5.
3/avr/inc" -o CMakeFiles/halmeshbean_atmega1281_2561.dir/meshbean/buttons.cpp.
r90

   IAR C/C++ Compiler V5.30.6.50191/W32 for Atmel AVR
   Copyright 1996-2009 IAR Systems AB.
Fatal error[Su011]: More than one source file specified:
          c:/Projects/proxima/src/hal/atmega1281_2561/meshbean/buttons.cpp
          Files/IAR
          Systems/Embedded
          Workbench
          5.3/avr/LIB/DLIB/dlAVR-5s-ec_mul-n.h"
Fatal error detected, aborting.
make[2]: *** [src/hal/atmega1281_2561/CMakeFiles/halmeshbean_atmega1281_2561.dir
/meshbean/buttons.cpp.r90] Error 2
make[2]: Leaving directory `/c/Projects/proxima/build-avr-iar'
make[1]: *** [src/hal/atmega1281_2561/CMakeFiles/halmeshbean_atmega1281_2561.dir
/all] Error 2
make[1]: Leaving directory `/c/Projects/proxima/build-avr-iar'
make: *** [all] Error 2

Daniil
(0020596)
Alex Neundorf (developer)
2010-05-05 15:33

I'd suggest you first try to manually execute this command from the command line until you found a version which is working.

How does it look in the normal Makefiles ?

Maybe also put double quotes before the spaces ?
set(CMAKE_CXX_FLAGS_INIT "--dlib_config \\\"C:/Program\\ Files/IAR\\ Systems/Embedded\\ Workbench\\ 5.3/avr/LIB/DLIB/dlAVR-3s-ec_mul-n.h\\\" -e -y --cpu=m1281 -ms")

Alex
(0020610)
daniil (reporter)
2010-05-06 02:11

In a make file it should be this way

iccavr --dlib_config "C:/Program Files/IAR Systems/Embedded Workbench5.3/avr"/LIB/DLIB/dlAVR-3s-ec_mul-n.h

I tried this
--dlib_config \"C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr\"/LIB/DLIB/dlAVR-5s-ec_mul-n.h

and get this

  --diag_suppress=Pa050 -Ohz --dlib_config
  ;C:/Program;Files/IAR;Systems/Embedded;Workbench;5.3/avr"/LIB/DLIB/dlAVR-5s-ec
_mul-n.h

Unfortunately, tomorrow is my last day on my job. I start new one 17th of May. So until that day I won't have an access to IAR compiler. I don't know if there will be a IAR on my new job.

If not I try to install trial versions of IAR which enough to test, that compilers doesn't have the time limitation but have code size limitation.

Daniil
(0020615)
Peter Nyström (reporter)
2010-05-06 10:45

If you have any specific questions it might be worth a try to
ask IAR directly ;-)

About the --dlib_config problem.
It is possible to just specify the name of the file and then add the path to the set of include paths.

//Peter
(0020620)
daniil (reporter)
2010-05-06 12:46

It is not an IAR's problem, it is a cmake's one,
this works in our project using make
iccavr --dlib_config "C:/Program Files/IAR Systems/Embedded Workbench5.3/avr"/LIB/DLIB/dlAVR-3s-ec_mul-n.h

I tried this
--dlib_config \"C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr\"/LIB/DLIB/dlAVR-5s-ec_mul-n.h

and and cmake made this (it add ';' symbol instead of space )

  --diag_suppress=Pa050 -Ohz --dlib_config
  ;C:/Program;Files/IAR;Systems/Embedded;Workbench;5.3/avr"/LIB/DLIB/dlAVR-5s-ec
_mul-n.h

Daniil
(0020626)
Alex Neundorf (developer)
2010-05-06 15:04

H Daniil,

it would be really nice if we could get this to a working state after we have put so much work into it. We're on this since three months now.

When you post what you tried, can you please always post the exact set() command you used ?
Otherwise it's very hard for me to help.

If you say you tried
--dlib_config \"C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr\"/LIB/DLIB/dlAVR-5s-ec_mul-n.h

does this mean the set command looked like this ?
set(CMAKE_CXX_FLAGS_INIT --dlib_config \"C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/LIB/DLIB/dlAVR-3s-ec_mul-n.h\" -e -y --cpu=m1281 -ms")

This would be clearly wrong.
CMAKE_CXX_FLAGS_INIT must be one string.
Doing
set(CMAKE_CXX_FLAGS_INIT -foo -bar)
sets CMAKE_CXX_FLAGS_INIT to a list containing the two entries "-foo" and "-bar". When printed as a string this will be "-foo;-bar".

To get it into cmake as one string the whole thing must be enclosed in double quotes:
set(CMAKE_CXX_FLAGS_INIT "-foo -bar")


I guess we already had the following variant ?
set(CMAKE_CXX_FLAGS_INIT "--dlib_config \"C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/LIB/DLIB/dlAVR-3s-ec_mul-n.h\" -e -y --cpu=m1281 -ms")


Alex
(0020638)
daniil (reporter)
2010-05-07 01:48

This is my toolchain file where parameters is specified.
And every set is in one string, no new lines.

# this one is important
set(CMAKE_SYSTEM_NAME Generic)

set(CMAKE_ASM_COMPILER aavr)

set(CMAKE_C_COMPILER iccavr)
set(CMAKE_C_FLAGS_INIT "--diag_suppress=Pa050 -e -y --cpu=m2561 -ms")
set(CMAKE_C_LINK_FLAGS "-Fintel-extended -xmsh -H1895 -f \"C:/Projects/proxima/lnkm2561s.xcl\" -l list.html -s main")

set(CMAKE_CXX_COMPILER iccavr "--eec++")
set(CMAKE_CXX_FLAGS_INIT "--diag_suppress=Pa050 -Ohz --dlib_config \"C:/Program Files/IAR Systems/Embedded Workbench 5.3\"/avr/LIB/DLIB/dlAVR-5s-ec_mul-n.h -e -y --cpu=m2561 -ms -DF_CPU=8000000")
#"\"C:/Program\ Files/IAR\ Systems/Embedded\ Workbench\ 5.3/avr/LIB/DLIB/dlAVR-5s-ec_mul-n.h\"")
set(CMAKE_CXX_LINK_FLAGS "-Fintel-extended -xmsh -H1895 -f \"C:/Projects/proxima/lnkm2561s.xcl\" -l list.html -s main")

set(COMPILER_NAME "iccavr")

# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

set(TOOLCHAIN_LIBRARY "C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/LIB/DLIB/dlAVR-5s-ec_mul-n.r90")

include_directories("C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/inc/dlib")
include_directories("C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/inc/Atmel")
include_directories("C:/Program Files/IAR Systems/Embedded Workbench 5.3/avr/lib/dlib")

Daniil
(0020639)
daniil (reporter)
2010-05-07 06:02

I think we can close the problem --dlib_config as Peter Nyström says we can specify the name of the file and then add the path to the set of include paths.

It tried his suggest and it works good.

I find another inconvenient thing that in a tool chain file a I should specify a full path to the linker script because if I specify it relative path the cmake's test compilation can't find it.

 Linking CXX executable cmTryCompileExec.bin

 "/C/Program Files/IAR Systems/Embedded Workbench 5.3/avr/bin/xlink.exe"
 "CMakeFiles/cmTryCompileExec.dir/testCXXCompiler.cxx.r90" -Fintel-extended
 -xmsh -H1895 -f "lnkm2561s.xcl" -l list.html -s main -o
 cmTryCompileExec.bin

 Error[e12]: Unable to open file 'lnkm2561s.xcl'


Danniil
(0020730)
Alex Neundorf (developer)
2010-05-12 18:07

Is it possible to call the avr assembler so that it just prints its version number and exits ?

And the same for the arm assembler ?

Alex
(0020748)
daniil (reporter)
2010-05-14 23:30

I think yes. I suppose you should use --version flag.

I can't try now.

Regards
Daniil
(0020877)
Alex Neundorf (developer)
2010-05-31 13:57

From Jesper at IAR:

> That's also ok.
> Could you please post the output of the IAR AVR and ARM assemblers when called
> without any arguments here ?
> (or put them into http://public.kitware.com/Bug/view.php?id=10176 [^] )

The first non-empty line is for ARM and Atmel AVR, respectively:

     IAR Assembler V5.41.2.51793/W32 for ARM
     IAR Assembler V5.50.0.50277/W32 for Atmel AVR
(0020886)
Alex Neundorf (developer)
2010-06-01 16:23

And for the compilers, also from Jesper:

> How does that output look like then ?

    IAR ANSI C/C++ Compiler V5.41.2.51793/W32 for ARM
    IAR C/C++ Compiler V5.50.0.50277/W32 for Atmel AVR

> Does it differ between the AVR and ARM compilers ? They seemed to be quite
> different in their command lines etc.

They do differ a bit in their command lines, mostly depending on the
different capabilities. One such difference is that ARM is ELF/Dwarf
based, and the AVR-compiler uses the Ubrof object file format.
(0021414)
Hassan (reporter)
2010-07-16 20:56
edited on: 2010-07-26 02:55

I am trying t o use CMake for building a project with IAR compiler too. I have the same issue (extra -c option). Is there any build for CMake supporting this compiler? If not how can I add this support to my build?

This is a simplified output format of my compiler for a file1.c :

iccarm.exe file1.c
-D USE_STDPERIPH_DRIVER
-D STM32F10X_MD
-D IAR_ARM_CM3
-D USE_STM3210B_EVAL
-D VECT_TAB_FLASH
-lC D:\Src\
-o D:\Src\Obj\
--no_cse --no_unroll --no_inline --no_code_motion --no_tbaa --no_clustering --no_scheduling --debug --endian=little --cpu=Cortex-M3 -e --fpu=None
--dlib_config D:\Program Files\IAR Systems\Embedded Workbench 5.5\arm\INC\DLib_Config_Full.h
-I inc\
-I \..\inc
....
-On
 
   IAR ANSI C/C++ Compiler V5.50.5.51995/W32 for ARM
   Copyright (C) 1999-2010 IAR Systems AB.
  
 540 bytes of CODE memory
  16 bytes of CONST memory
  16 bytes of DATA memory
 
Errors: none
Warnings: none

(0021681)
Hassan (reporter)
2010-08-06 00:17

Hi Alex,

I finally managed to make it working. I am using MSYS Makefile generator. I have few warning as I said but seems they are not very important. We can clean up the IAR solution when you have time.
Next I want to add support for NC30, the compiler from Renesas for M16C micro-controller.

Cheers,
Hassan
(0021695)
Alex Neundorf (developer)
2010-08-08 13:50

This is quite high on my TODO. I'll think I'll get around to do this until end of August.

Alex
(0021737)
Hassan (reporter)
2010-08-12 18:47

Hi Ahmed,
The problem is space (" ") in your command. I had the similar problem when I was passing my DLIB (--dlib_config ${COMPILER_PATH}/arm/inc/DLib_Config_Full.h) file to iccarm. I could not find any way but remove the header file and add it to my include header file list. Although the compiler is warning for not defining --dlib_config file but the file is there.

Moving all files and programs to some folder with no space will fix the problem.

But there should be a better way to handle this issue. These are some work around solutions.

Cheers,
Hassan
(0021738)
Hassan (reporter)
2010-08-12 23:00

Hi Alex,
Could you share all the files you have changed in your build to support IAR? I could not use git and apply the changes. I believe these are the files have been changed:
 - CMakeASMInformation.cmake
 - CMakeCCompilerId.c.in
 - CMakeCXXCompilerId.cpp.in
 - IAR.cmake
 - IAR-ASM.cmake
 - IAR-C.cmake
 - IAR-CXX.cmake

Cheers,
Hassan
(0021748)
AJ (reporter)
2010-08-13 20:28

Hi,

Hassan do you have a makefile for the IAR mfg-sample-app.eww project? If yes, could you please upload it.
(0021749)
Hassan (reporter)
2010-08-13 22:41

We are are not writing Makefile by ourselves here for IAR directly. We are using CMake to make us Makefile.
(0021756)
Alex Neundorf (developer)
2010-08-15 08:40

The next thing I want to do is to recognize the "compiler ID" of the assembler by just calling it and looking at the output.
Once this is in place, I'll add the IAR compiler files.

Alex
(0021758)
Alex Neundorf (developer)
2010-08-15 10:43

Ok, the assembler stuff is now in next.
Next week, once this has been merged into master, I'll continue with the IAR stuff.

Alex
(0021781)
Alex Neundorf (developer)
2010-08-17 16:04

I attached IAR-11.patch, which is a patch against current git master (I think).
If it doesn't apply automatically you should be able to apply it manually.

C, C++ and ASM all should work.
The compiler ID should be recognized as "IAR" for all three.

Please let me know how it works for you.

Alex
(0021788)
David O'Shea (reporter)
2010-08-17 23:57

Hi, I'd like support for the IAR assembler, C and C++ compilers, and linker for the AVR32. I have already developed my own prototype modules and toolchain file that support these on CMake 2.8.2 (they just force the use of the tools without any checks being performed); quite possibly they aren't "right", but they work.

If you are inclined to add this support, is there any information I can provide that would help? For starters, I note that the assembler source files I've seen have extension ".s82", not ".s90" as for the assembler you've looked at above.

Thanks in advance, David
(0021793)
Hassan (reporter)
2010-08-18 01:13
edited on: 2010-08-18 01:25

Hi Alex,

I have updated my CMake by the modified cmake files. I rebuilt the CMake too, although it may not be required, but it seems I have some error during the linking. I attached the ToolChain file I am using for my target for your reference, also added few debugging message to your files.
Please not that for linking I need to provide a linking configuration file (*.icf) to linker, which is passed by --config flag to linker. I also need to provide a DLIB file for compiler which is passed by --dlib_config flag.
I had some problem with space (" ") when passing this one so, I removed the file and add it to my header file list. Compiler will warn about this but it's not a problem. If you have any solution to fix this let me know.
 
Here is the output at cmake-gui:

The C compiler identification is IAR
Processing Compiler/IAR.cmake...
CMAKE_C_COMPILER: -D:/Program Files/IAR Systems/Embedded Workbench 5.5/arm/bin/iccarm.exe-
CMAKE_CXX_COMPILER: --
CMAKE_C_COMPILER_ABI: --
_CMAKE_TOOLCHAIN_LOCATION: -D:/Program Files/IAR Systems/Embedded Workbench 5.5/arm/bin-
Found IAR linker: -D:/Program Files/IAR Systems/Embedded Workbench 5.5/arm/bin/ilinkarm.exe-
Found IAR archiver: -D:/Program Files/IAR Systems/Embedded Workbench 5.5/arm/bin/iarchive.exe-
IAR_TARGET_ARCHITECTURE: -ARM-
IAR_OUTPUT_FORMAT: --
Check for working C compiler: D:/Program Files/IAR Systems/Embedded Workbench 5.5/arm/bin/iccarm.exe
Check for working C compiler: D:/Program Files/IAR Systems/Embedded Workbench 5.5/arm/bin/iccarm.exe -- broken
CMake Error at C:/Program Files/CMake 2.8/source/cmake-master-a3d796b/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "D:/Program Files/IAR Systems/Embedded Workbench
  5.5/arm/bin/iccarm.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: D:/Src/Embedded/KNX/stm32_knx_device/v1.0.0.0/etc/workspace/make/CMakeFiles/CMakeTmp

  

  Run Build Command:D:/Eclipse/MSYS/1.0/bin/make.exe "cmTryCompileExec/fast"

  /usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory
  `/d/Src/Embedded/KNX/stm32_knx_device/v1.0.0.0/etc/workspace/make/CMakeFiles/CMakeTmp'


  "/C/Program Files/CMake 2.8/source/cmake-master-a3d796b/bin/cmake.exe" -E
  cmake_progress_report
  /D/Src/Embedded/KNX/stm32_knx_device/v1.0.0.0/etc/workspace/make/CMakeFiles/CMakeTmp/CMakeFiles
  1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

  "/D/Program Files/IAR Systems/Embedded Workbench 5.5/arm/bin/iccarm.exe"
  /D/Src/Embedded/KNX/stm32_knx_device/v1.0.0.0/etc/workspace/make/CMakeFiles/CMakeTmp/testCCompiler.c
  -DUSE_STDPERIPH_DRIVER -DVECT_TAB_FLASH -DSTM32F10X_MD -DIAR_ARM_CM3
  -DCOMPILE_C -lC
  D:/Src/Embedded/KNX/stm32_knx_device/v1.0.0.0/etc/workspace/make/List/
  --no_cse --no_unroll --no_inline --no_code_motion --no_tbaa --no_clustering
  --no_scheduling --endian=little --cpu=Cortex-M3 -e --fpu=None -I"/D/Program
  Files/IAR Systems/Embedded Workbench 5.5/arm/inc" -o
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

  
     IAR ANSI C/C++ Compiler V5.50.5.51995/W32 for ARM
     Copyright (C) 1999-2010 IAR Systems AB.

   4 bytes of CODE memory
  Errors: none
  Warnings: none

  Linking C executable cmTryCompileExec.elf

  CMAKE_IAR_LINKER-NOTFOUND
  "CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj" --config
  D:/Src/Embedded/KNX/stm32_knx_device/v1.0.0.0/etc/workspace/make/stm32f10x_flash_knx_dynalite_appl.icf
  --redirect _Scanf=_ScanfSmall --map CMAKE_TRY_COMPILE.map --entry
  __iar_program_start -o cmTryCompileExec.elf

  /bin/sh: CMAKE_IAR_LINKER-NOTFOUND: command not found

  make[1]: *** [cmTryCompileExec.elf] Error 127

  make[1]: Leaving directory
  `/d/Src/Embedded/KNX/stm32_knx_device/v1.0.0.0/etc/workspace/make/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:9 (project)

Cheers,
Hassan

(0021795)
Hassan (reporter)
2010-08-18 01:33

How did you force the use of compiler/linker without checking from CMake? Could you share your toolchain file or part of it for my reference?
(0021796)
David O'Shea (reporter)
2010-08-18 01:42

Hi hassan_mj, I used this to force the C/C++ compilers:

>>>
include(CMakeForceCompiler)
[...]
set(CMAKE_SYSTEM_NAME Generic)
[...]
cmake_force_c_compiler("[...]/avr32/bin/iccavr32.exe"
                       "IAR")
cmake_force_cxx_compiler("[...]/avr32/bin/iccavr32.exe"
                       "IAR")
<<<

Note that I have set the compiler identification to "IAR", so CMake loads the Generic-IAR-C.cmake and Generic-IAR-CXX.cmake files from my module path. In these I include a common file which sets up the linker by looking for it in the same directory as the compiler, setting CMAKE_IAR_LINKER, then I use:

>>>
set(CMAKE_LINKER ${CMAKE_IAR_LINKER})

# Note that <FLAGS> cannot be included below as IAR uses separate
# compiler and linker programs with different command-line arguments.
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_LINKER> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
<<<

This is of course not the best way of doing things - the stuff that Alex is developing is a better solution!

Regards, David
(0021809)
AJ (reporter)
2010-08-18 14:49

Hi Hassan,

I am trying to write a makefile for the ewb-em357 (mfg-sample-app.eww project)

I can compile a single .c file but do you know how I can write a pattern rule so that make can compile every .c file associated with the above project. (It should compile all the .c files from the sub directories where they are located) Perhaps you have a ready written makefile for this project or a similar one for the IAR compiler. Could you please share it with me?

Thanks
(0021812)
Hassan (reporter)
2010-08-18 19:26

AJ,
As I said here we do not want to write makefile directly by ourselves, and I'm not expert in writing mafile either. That's why I am using CMAKE. Check some introductories about CMake. Check this link http://www.youtube.com/watch?v=AtmncnggVEw&feature=related [^]
Cheers,
Hassan
(0021814)
Hassan (reporter)
2010-08-18 19:29

Hi Alex,
I guess you (or me) missed few files to update:
 - Generic-IAR-C.cmake
 - Generic-IAR-CXX.cmake
Hassan
(0021850)
Alex Neundorf (developer)
2010-08-19 15:46

No, the Generic-IAR-C/CXX.cmake files shouldn't be necessary. It is all done in Compiler/IAR-(C|CXX).cmake.

From your post:
Here is the output at cmake-gui:
 
 The C compiler identification is IAR
 Processing Compiler/IAR.cmake...

This is good, the compiler is recognized :-)

For your linking errors, you need to create a toolchain file, and in this toolchain file you probably have to set some compiler and linker flags.
The toolchain file should more or less look like the following:

# this one is important
set(CMAKE_SYSTEM_NAME Generic)
 
# Set the compilers:
set(CMAKE_ASM_COMPILER aavr)
set(CMAKE_C_COMPILER iccavr)
set(CMAKE_CXX_COMPILER iccavr "--eec++")


# You may need to set special flags you need for compiling and linking:
# Getting the quoting right may be tricky:
set(CMAKE_C_FLAGS_INIT "--diag_suppress=Pa050 -e -y --cpu=m2561 -ms")
set(CMAKE_C_LINK_FLAGS "-Fintel-extended -xmsh -H1895 -f \"C:/Projects/proxima/lnkm2561s.xcl\" -l list.html -s main")
 
set(CMAKE_CXX_FLAGS_INIT "--diag_suppress=Pa050 -Ohz --dlib_config
          \"C:/Program Files/IAR Systems/Embedded Workbench
5.3\"/avr/LIB/DLIB/dlAVR-5s-ec_mul-n.h -e -y --cpu=m2561 -ms -DF_CPU=8000000")
set(CMAKE_CXX_LINK_FLAGS "-Fintel-extended -xmsh -H1895 -f
    \"C:/Projects/proxima/lnkm2561s.xcl\" -l list.html -s main")
 
# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 

Alex
(0021853)
Hassan (reporter)
2010-08-19 18:46
edited on: 2010-08-19 19:54

I already had the Toolchain file and I had attached it here earlier. The problem is although I have defined the linker program (CMAKE_LINKER, CMAKE_IAR_LINKER are correct as printed in my output) during the linking it's not found and it's named as CMAKE_IAR_LINKER-NOTFOUND! So, something is missing in settings.

I have one assembly file which is not compiled too. It has .s extension and it's in my project list file. Where the assembler program options are set?

Another problem I have is --dlib_config file. Whatever way I define this file, the output will have space " " or ";" which both through me error. For space it will be considered few files and for ";" it's asking for the file. I followed your \" way also and it gives me the same results.

Hassan

(0021856)
AJ (reporter)
2010-08-19 21:48

Hi Hassan,

I also want to learn CMake and want to generate my Makefiles for the IAR projects with Cmake. Can you give me more specific tutorials. I want to use it in Windows will that work? I am having so much trouble writing my own Makefile for an IAR project.
(0021884)
Alex Neundorf (developer)
2010-08-22 17:37

Hassan: does it change anything if you remove the CMAKE_LINKER and CMAKE_AR entries from your toolchain file ?

Alex

P.S. I guess it's clear, please always start from a completely empty build dir while we are trying to get this working
(0021886)
Hassan (reporter)
2010-08-22 19:32

Hi AJ, You need to learn some basics about CMake from the website first. The outcome of this discussion should be able to help you to compile your code using makefile for IAR. In Windows I am using MSYS (MingW) which is one of the Generator in Cmake.
(0021887)
Hassan (reporter)
2010-08-22 19:51

Alex,
I followed David's approach using force commands and everything is working fine, with no error. I attached the toolchain file for your/other reference and checking.

Processing Compiler/IAR.C.cmake ... (It means still is using IAR-C.cmake file)
Processing Compiler/IAR.cmake ... (It means still is using IAR.cmake file)
Configuring done
Generating done

I run make command is MSYS and my project completely compiled and linked but I had one Assembly file with .s extension in my list which is not compiled (all my interrupt vectors). Do you have any idea what can be wrong in my settings? How can I add an assembly file to CMake project?

Cheers,
Hassan
(0021903)
Alex Neundorf (developer)
2010-08-23 15:17

Can you please attach here your complete builddirectory as a zip file for the case with force, where asm failed ?

Can you please also attach the complete build directory as a zip file for the case where you don't have the force in the toolchain file ?

If you don't want to attach it here, you can also send it to me via email (neundorf AT kde DOT org)


Another question: does it behave the same way when you don't use cmake-gui but cmake -DCMAKE_TOOLCHAIN_FILE=path/to/STM32_ToolchainCMake.cmake <srcdir> ?

Alex
(0022119)
Hassan (reporter)
2010-09-07 20:57

Hi David/Alex,

I gave up finding the problem for IAR platform using NOT-FORCING approach. I have two platforms to support (m16c, arm) and few different build for each of them, so I have to define my flags and setting individually anyway. It's ok for me to put most of the setting in my toolcain files. That's why the force mechanism works for me.

My only problem now is assembling. I can compile and link the projects but I don't know how to add the assembling to my projects. I have already added my assembly files to my source file list (*.s34, *.s) and modify the Generic-IAR-C.cmake to support these extension. Is there anything I am missing?

Could you tell me what did you do to add assembling to your project?

Cheers,
Hassan
(0023770)
David Cole (manager)
2010-12-07 15:47

This topic branch is currently in the CMake 'stage' repository:
AddIARSupport | master=0 next=0

...but it is not merged to 'next'.

And in this email thread:
http://public.kitware.com/pipermail/cmake-developers/2010-October/000692.html [^]

...Alex claims the feature is "90%" ready.

So:
Whoever is interested in seeing this bug fixed needs to tell us if the feature is 100% ready or not.

I am not going to allow this change into CMake 'master' until:
- the change is merged to 'next' and proven not to break anything else on all the dashboards
- whoever is interested in this bug speaks up here or on the mailing list and says "yes, it's 100% ready for release"

I personally do not care about this at all. So if it comes down to the wire and nobody else does either, it gets booted off the list for consideration for 2.8.4... Speak up if you care about it.
(0023771)
David Cole (manager)
2010-12-07 15:48

Furthermore, it would be nice if:
- somebody who actually has this toolchain can submit a CMake dashboard and add a test that proves the IAR toolchain is working properly.
(0023772)
Hassan (reporter)
2010-12-07 16:17

I am definitely interested to have a proper IAR support in CMake. By Alex help I could fix few of my problems and my project is working fine by with FORCE mechanism. My project is an ARM based using IAR compiler. I have assembly files and C files and is considered a complex project for embedded devices.

I had another IAR project file as well which I could not make it working at all. That is also using IAR compiler but the MCU is M16C from Renesas. I could not add the assembly file be compiled and added to project. All other are working same as ARM project.

Both projects are Windows based. I am using MSYS for my make file.
I am sure it just need a bit of push from you guys (with a Windows machine) to do a bit of code cleaning and fixing.
(0023776)
David O'Shea (reporter)
2010-12-07 16:52

Hi David,

I might be able to try out this support in the new year, and create a test which submits to the dashboard. I'm afraid I couldn't do it any earlier as I have a working solution already (with forcing of the settings).

Regards,
David
(0023778)
David Cole (manager)
2010-12-07 16:57

Based on David O'Shea's latest note (23776), I am un-setting the Target Version field of the bug. It will probably go into a future CMake release and not 2.8.4 based on this information.

If you get something set up before we start doing release candidates for 2.8.4, let me know, and I'll reconsider. For now, this is pushed to the future.

Thanks,
David Cole
(0028014)
Chris Morgan (reporter)
2011-12-19 16:52

Any updates on this?

I'm working on getting cmake (under Cygwin) on a Windows to integrate with IAR's iccarm compiler and its a pain. I'm not sure if this is specifically due to using Cygwin cmake with IAR for Windows but it did take me a few minutes to figure out how to override CMAKE_C_COMPILE_OBJECT because IAR doesn't support the -c option that gcc does.
(0028172)
Alex Neundorf (developer)
2012-01-04 15:50

No, no updates.
I stopped investing time in this after daniil stated that he doesn't have time for it anymore.
I was not really happy with his progress.

I created a new CMake clone with the IAR patches applied in the AddIARSupport branch on github:
https://github.com/neundorf/CMake/tree/AddIARSupport [^]

Feel free to check how much works, and what is missing.
All information should be contained in this bug report here.

It actually shouldn't be a big problem to get the compiler ID detection work I think.

Alex
(0032647)
Bjørn Forsman (reporter)
2013-03-16 14:07

I tested your AddIARSupport branch from github with the following IAR ARM toolchain file:

    ### BEGIN CMAKE_TOOLCHAIN_FILE
    set(CMAKE_SYSTEM_NAME Generic)

    # Compiler flags needed to compile for this CPU
    set(CPU_FLAGS "--cpu Cortex-M3")

    # note forward slash, double backslash doesn't work
    set(CMAKE_C_COMPILER "C:/Program Files (x86)/IAR Systems/Embedded Workbench 6.5/arm/bin/iccarm.exe" "${CPU_FLAGS} -e")
    set(CMAKE_CXX_COMPILER "C:/Program Files (x86)/IAR Systems/Embedded Workbench 6.5/arm/bin/iccarm.exe" "${CPU_FLAGS} --ec++")
    set(CMAKE_ASM_COMPILER "C:/Program Files (x86)/IAR Systems/Embedded Workbench 6.5/arm/bin/iasmarm.exe")
    # TODO: For some reason, set(CMAKE_ASM_COMPILER "compiler" "flags") doesn't
    # work for the IAR assembler, use CMAKE_ASM_FLAGS instead.
    set(CMAKE_ASM_FLAGS "${CPU_FLAGS}" CACHE STRING "Assembler flags" FORCE)

    set(LINKER_SCRIPT "${CMAKE_SOURCE_DIR}/STM/stm32l1xx_flash.icf")
    set(CMAKE_EXE_LINKER_FLAGS "--config ${LINKER_SCRIPT}" CACHE STRING "Linker flags" FORCE)
    ### END CMAKE_TOOLCHAIN_FILE

It worked just fine (once I got the toolchain file right!). I tested it with NMake and MinGW generators. I'm a bit sad that this feature have been here so long and not become a part of any release. Can this please be merged?

Best regards,
Bjørn Forsman
(0032801)
Alex Neundorf (developer)
2013-04-10 15:51

Will try to get that working for 2.8.12.
(0032803)
Alex Neundorf (developer)
2013-04-10 16:59

There is now the AddIARToolchain2 in the cmake stage repository:
http://cmake.org/gitweb?p=stage/cmake.git [^]

Can you give this a try and let me know whether it works for you ?
It's basically the patches from github cherry-picked into current master...
(0032825)
Bjørn Forsman (reporter)
2013-04-14 16:42

Yes, the AddIARToolchain2 branch works. I used the same toolchain file[1] and IAR compiler; Embedded Workbench 6.5 for ARM. I used the MinGW Makefiles generator.

BTW, today I noticed that the toolchain file does not have access to CMAKE_SOURCE_DIR. So far I have just inlined the toolchain file contents at the very start of the top-level CMakeLists.txt file because it was very convenient (for a proprietary project). I need to tell the linker to use a specific linker script from my source directory and I have no idea how to do this when the toolchain file is stand-alone. I should probably ask about this on the mailing list.

[1] http://public.kitware.com/Bug/view.php?id=10176#c32647 [^]
(0032826)
David Cole (manager)
2013-04-14 18:04

If you have another file you want to reference from your toolchain file, try a technique like this:

    get_filename_component(_self_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)

And then reference the other file using "${_self_dir}" and a possibly relative path. That would require your toolchain file and linker script to be "with each other" or at least, "relatively reference-able," but it should work well without relying on the source directory.

Can you put your linker script with your toolchain file instead of in the source tree?
(0033390)
Alex Neundorf (developer)
2013-06-26 15:54

This is now in git master and should be in cmake 2.8.12.
Please give it a try.
If you find problems, please open separate bug reports here, this is one already more than long enough.

Thanks
Alex


 Issue History
Date Modified Username Field Change
2010-01-22 06:36 daniil New Issue
2010-01-22 09:47 Bill Hoffman Status new => assigned
2010-01-22 09:47 Bill Hoffman Assigned To => Brad King
2010-01-22 10:08 Brad King Assigned To Brad King => Alex Neundorf
2010-01-22 10:09 Brad King Note Added: 0019267
2010-01-22 10:10 Brad King Note Added: 0019268
2010-01-22 10:10 Brad King Note Edited: 0019268
2010-01-22 10:14 Brad King Note Added: 0019269
2010-01-22 10:15 Brad King File Added: IAR C-C++ Development Guide for ARM.pdf
2010-01-24 14:42 Alex Neundorf Note Added: 0019287
2010-01-24 14:47 Alex Neundorf Note Added: 0019288
2010-01-25 02:04 daniil File Added: cmake.rar
2010-01-25 02:09 daniil Note Added: 0019290
2010-01-25 02:12 Alex Neundorf Note Added: 0019291
2010-01-25 02:13 daniil Note Edited: 0019290
2010-01-25 02:17 daniil Note Added: 0019292
2010-01-25 02:20 daniil Note Added: 0019293
2010-01-25 02:54 daniil Note Added: 0019294
2010-01-25 07:32 daniil Note Added: 0019295
2010-01-25 11:53 Alex Neundorf Note Added: 0019297
2010-01-25 12:05 Alex Neundorf Note Added: 0019298
2010-01-25 12:24 Alex Neundorf File Added: IAR.patch
2010-01-25 12:27 Alex Neundorf Note Added: 0019299
2010-01-26 03:14 daniil Note Added: 0019305
2010-01-26 11:47 Alex Neundorf File Added: IAR-C.cmake
2010-01-26 11:48 Alex Neundorf File Added: IAR-CXX.cmake
2010-01-26 11:50 Alex Neundorf Note Added: 0019321
2010-01-27 02:23 daniil Note Added: 0019330
2010-01-27 05:10 Alex Neundorf Note Added: 0019331
2010-01-27 05:38 daniil Note Added: 0019332
2010-01-27 06:20 Alex Neundorf Note Added: 0019333
2010-01-27 06:38 daniil Note Added: 0019334
2010-01-27 12:40 Alex Neundorf Note Added: 0019336
2010-01-27 15:07 Alex Neundorf Note Added: 0019339
2010-01-27 15:41 Alex Neundorf File Added: IAR-with-linker.patch
2010-01-27 15:41 Alex Neundorf Note Added: 0019340
2010-01-27 15:48 Alex Neundorf File Added: IAR-with-linker-2.patch
2010-01-27 15:49 Alex Neundorf Note Added: 0019341
2010-01-28 09:33 daniil Note Added: 0019351
2010-01-28 09:33 daniil File Added: daniil_project.rar
2010-01-28 13:54 Alex Neundorf Note Added: 0019359
2010-01-29 01:46 daniil Note Added: 0019361
2010-01-29 07:41 Alex Neundorf Note Added: 0019363
2010-01-29 07:52 daniil Note Added: 0019365
2010-02-01 06:02 Alex Neundorf File Added: IAR.cmake
2010-02-01 06:03 Alex Neundorf Note Added: 0019375
2010-02-01 06:20 daniil Note Added: 0019376
2010-02-01 06:54 Alex Neundorf Note Added: 0019377
2010-02-01 07:42 daniil Note Added: 0019378
2010-02-01 07:57 Alex Neundorf File Deleted: IAR.cmake
2010-02-01 07:57 Alex Neundorf File Added: IAR.cmake
2010-02-01 08:00 Alex Neundorf Note Added: 0019379
2010-02-01 08:12 daniil Note Added: 0019380
2010-02-01 08:14 Alex Neundorf Note Added: 0019381
2010-02-01 08:15 daniil Note Added: 0019382
2010-02-01 09:06 Alex Neundorf Note Added: 0019385
2010-02-01 09:23 daniil Note Added: 0019386
2010-02-01 09:27 Alex Neundorf File Deleted: IAR.cmake
2010-02-01 09:27 daniil Note Added: 0019387
2010-02-01 09:28 Alex Neundorf File Added: IAR.cmake
2010-02-01 09:29 Alex Neundorf Note Added: 0019388
2010-02-01 09:32 daniil Note Added: 0019389
2010-02-01 09:33 Alex Neundorf Note Added: 0019390
2010-02-01 09:38 daniil Note Added: 0019391
2010-02-01 09:46 Alex Neundorf Note Added: 0019392
2010-02-01 09:50 daniil Note Added: 0019393
2010-02-01 10:16 Alex Neundorf Note Added: 0019396
2010-02-01 10:28 daniil Note Added: 0019397
2010-02-01 10:59 Alex Neundorf Note Added: 0019398
2010-02-02 02:15 daniil Note Added: 0019423
2010-02-02 02:53 daniil File Added: iar_arm_docs.rar
2010-02-02 02:57 daniil File Added: iar_avr_docs.rar
2010-02-02 03:00 daniil File Added: iar_avr32_docs.rar
2010-02-02 03:02 daniil Note Added: 0019425
2010-02-02 14:12 Alex Neundorf Note Added: 0019439
2010-02-03 01:49 daniil Note Added: 0019449
2010-02-03 16:06 Alex Neundorf File Added: IAR-2.patch
2010-02-03 16:08 Alex Neundorf Note Added: 0019453
2010-02-04 03:03 daniil Note Added: 0019454
2010-02-04 16:09 Alex Neundorf Note Added: 0019456
2010-02-05 02:23 daniil Note Added: 0019458
2010-02-05 13:26 Alex Neundorf Note Added: 0019461
2010-02-08 02:31 daniil Note Added: 0019466
2010-02-08 02:33 daniil Note Deleted: 0019466
2010-02-08 02:49 daniil Note Added: 0019467
2010-02-11 13:29 Alex Neundorf File Added: IAR-3.patch
2010-02-11 13:33 Alex Neundorf Note Added: 0019512
2010-02-12 10:11 daniil Note Added: 0019514
2010-02-12 10:14 daniil File Added: cmCTest.i
2010-02-12 12:14 Alex Neundorf Note Added: 0019519
2010-02-15 02:17 daniil Note Added: 0019528
2010-02-15 02:18 daniil File Added: files.rar
2010-02-15 12:43 Alex Neundorf File Added: IAR-4.patch
2010-02-15 12:45 Alex Neundorf Note Added: 0019529
2010-02-16 03:30 daniil Note Added: 0019534
2010-02-16 03:31 daniil File Added: iartest.rar
2010-02-16 13:46 Alex Neundorf File Added: IAR-5.patch
2010-02-16 13:51 Alex Neundorf Note Added: 0019535
2010-02-17 03:04 daniil Note Added: 0019539
2010-02-17 04:35 Alex Neundorf Note Added: 0019540
2010-02-17 05:04 daniil File Added: iarAvr.cmake
2010-02-17 05:05 daniil Note Added: 0019541
2010-02-18 16:27 Alex Neundorf File Added: IAR-6.patch
2010-02-18 16:31 Alex Neundorf Note Added: 0019551
2010-02-19 02:17 daniil Note Added: 0019553
2010-02-19 02:17 daniil File Added: CMakeError.log
2010-02-19 04:38 Alex Neundorf Note Added: 0019554
2010-02-20 06:14 daniil Note Added: 0019556
2010-02-20 06:15 daniil File Added: main.r90
2010-02-21 10:25 Alex Neundorf Note Added: 0019559
2010-02-21 10:30 Alex Neundorf Note Added: 0019560
2010-02-23 13:00 Alex Neundorf Note Added: 0019596
2010-02-23 13:21 Alex Neundorf Note Added: 0019598
2010-02-23 13:21 Alex Neundorf File Added: main.r90.hex
2010-02-24 02:12 daniil Note Added: 0019602
2010-02-24 03:30 daniil File Added: iartest_asm.rar
2010-02-24 03:35 daniil Note Added: 0019603
2010-03-02 02:27 daniil Note Added: 0019681
2010-03-02 17:17 Alex Neundorf File Added: cmHexFileConverter.h
2010-03-02 17:17 Alex Neundorf File Added: cmHexFileConverter.cxx
2010-03-02 17:20 Alex Neundorf Note Added: 0019691
2010-03-04 15:28 Alex Neundorf Note Added: 0019713
2010-03-04 17:31 daniil Note Added: 0019719
2010-03-05 02:37 daniil Note Added: 0019721
2010-03-05 02:38 daniil Note Added: 0019722
2010-03-05 04:39 daniil Note Added: 0019724
2010-03-06 14:26 Alex Neundorf File Deleted: IAR.cmake
2010-03-06 14:27 Alex Neundorf File Deleted: IAR-C.cmake
2010-03-06 14:27 Alex Neundorf File Deleted: IAR-CXX.cmake
2010-03-06 14:27 Alex Neundorf File Added: IAR.cmake
2010-03-06 14:27 Alex Neundorf File Added: IAR-C.cmake
2010-03-06 14:27 Alex Neundorf File Added: IAR-CXX.cmake
2010-03-06 14:29 Alex Neundorf Note Added: 0019743
2010-03-09 03:21 daniil Note Added: 0019772
2010-03-09 03:22 daniil File Added: iarAvr-2.cmake
2010-03-09 03:24 daniil Note Edited: 0019772
2010-03-09 15:12 Alex Neundorf Note Added: 0019780
2010-03-10 01:58 daniil Note Added: 0019795
2010-03-10 02:51 daniil Note Added: 0019796
2010-03-10 16:33 Alex Neundorf File Added: IAR-7.patch
2010-03-10 16:35 Alex Neundorf Note Added: 0019819
2010-03-11 05:32 daniil Note Added: 0019834
2010-03-11 06:57 Alex Neundorf Note Added: 0019835
2010-03-11 07:55 daniil Note Added: 0019836
2010-03-11 07:59 daniil Note Added: 0019837
2010-03-12 14:59 Alex Neundorf File Added: IAR-8.patch
2010-03-12 15:00 Alex Neundorf Note Added: 0019859
2010-03-12 15:17 Alex Neundorf Note Added: 0019860
2010-03-15 03:36 daniil Note Added: 0019877
2010-03-15 03:37 daniil File Added: MakefileM
2010-03-15 03:55 daniil Note Deleted: 0019877
2010-03-15 04:26 daniil Note Added: 0019878
2010-03-15 05:49 Alex Neundorf Note Added: 0019879
2010-03-15 06:02 daniil Note Added: 0019880
2010-03-15 10:42 Alex Neundorf Note Added: 0019882
2010-03-15 10:42 Alex Neundorf Note Edited: 0019882
2010-03-15 11:12 daniil Note Added: 0019883
2010-03-15 18:08 Alex Neundorf File Added: IAR-9.patch
2010-03-16 05:46 Alex Neundorf Note Added: 0019892
2010-03-16 07:01 daniil Note Added: 0019893
2010-03-17 17:04 Alex Neundorf Note Added: 0019947
2010-03-18 03:06 daniil Note Added: 0019950
2010-03-18 03:36 Alex Neundorf Note Added: 0019952
2010-03-18 03:55 daniil Note Added: 0019953
2010-03-18 16:41 Alex Neundorf File Added: IAR-10.patch
2010-03-18 16:43 Alex Neundorf Note Added: 0019960
2010-03-22 08:58 daniil Note Added: 0019975
2010-03-22 09:00 daniil Note Edited: 0019975
2010-03-22 09:07 Alex Neundorf Note Added: 0019976
2010-03-22 09:18 daniil Note Deleted: 0019975
2010-03-22 09:24 daniil Note Added: 0019977
2010-03-22 11:35 daniil Note Added: 0019978
2010-03-22 11:35 daniil File Added: i26.rar
2010-03-22 16:48 Alex Neundorf Note Added: 0019979
2010-03-22 17:13 daniil Note Added: 0019980
2010-03-23 06:15 daniil Note Added: 0019981
2010-03-23 06:50 daniil Note Added: 0019982
2010-03-23 16:31 Alex Neundorf Note Added: 0019988
2010-03-23 16:34 Alex Neundorf Note Added: 0019989
2010-03-24 03:13 daniil Note Added: 0020000
2010-03-24 04:15 Alex Neundorf Note Added: 0020001
2010-03-25 14:10 Alex Neundorf Note Added: 0020009
2010-03-26 02:52 daniil Note Added: 0020013
2010-04-08 04:10 Alex Neundorf Note Added: 0020102
2010-04-08 04:33 daniil Note Added: 0020103
2010-04-10 18:52 Alex Neundorf Note Added: 0020124
2010-04-11 08:35 Alex Neundorf Note Added: 0020129
2010-04-12 02:16 daniil Note Added: 0020132
2010-04-14 10:31 daniil Note Added: 0020179
2010-04-15 04:07 daniil Note Added: 0020189
2010-04-15 04:11 daniil Note Edited: 0020189
2010-04-15 06:55 daniil Note Added: 0020192
2010-04-15 16:24 Alex Neundorf Note Added: 0020196
2010-04-15 16:26 Alex Neundorf Note Added: 0020197
2010-04-15 16:27 Alex Neundorf Note Added: 0020198
2010-04-16 01:47 daniil Note Added: 0020205
2010-04-16 01:53 daniil Note Added: 0020209
2010-04-16 03:40 daniil Note Added: 0020212
2010-04-18 05:37 Alex Neundorf Note Added: 0020245
2010-04-19 03:57 daniil Note Added: 0020248
2010-04-19 09:21 daniil Note Added: 0020250
2010-04-19 09:24 daniil Note Added: 0020251
2010-04-19 14:13 Alex Neundorf Note Added: 0020260
2010-04-19 14:22 Alex Neundorf Note Added: 0020261
2010-04-20 03:33 daniil Note Added: 0020270
2010-04-20 03:49 daniil Note Added: 0020271
2010-04-21 16:42 Alex Neundorf Note Added: 0020338
2010-04-22 02:27 daniil Note Added: 0020342
2010-04-22 02:32 daniil Note Added: 0020343
2010-04-22 04:34 daniil Note Added: 0020346
2010-04-22 15:44 Alex Neundorf Note Added: 0020361
2010-04-22 15:51 Alex Neundorf Note Added: 0020362
2010-04-23 03:45 daniil Note Added: 0020372
2010-04-23 03:46 daniil Note Edited: 0020372
2010-04-26 16:28 Alex Neundorf Note Added: 0020404
2010-04-27 14:46 Alex Neundorf Note Added: 0020439
2010-05-01 05:32 Alex Neundorf Note Added: 0020504
2010-05-02 09:59 daniil Note Added: 0020509
2010-05-02 10:00 daniil Note Edited: 0020509
2010-05-04 03:54 daniil Note Added: 0020524
2010-05-04 14:27 Alex Neundorf Note Added: 0020538
2010-05-05 02:04 daniil Note Added: 0020576
2010-05-05 15:33 Alex Neundorf Note Added: 0020596
2010-05-06 02:11 daniil Note Added: 0020610
2010-05-06 10:45 Peter Nyström Note Added: 0020614
2010-05-06 10:45 Peter Nyström Note Added: 0020615
2010-05-06 12:46 daniil Note Added: 0020620
2010-05-06 15:04 Alex Neundorf Note Added: 0020626
2010-05-07 01:48 daniil Note Added: 0020638
2010-05-07 02:47 Peter Nyström Note Deleted: 0020614
2010-05-07 06:02 daniil Note Added: 0020639
2010-05-12 18:07 Alex Neundorf Note Added: 0020730
2010-05-14 23:30 daniil Note Added: 0020748
2010-05-31 13:57 Alex Neundorf Note Added: 0020877
2010-06-01 16:23 Alex Neundorf Note Added: 0020886
2010-07-16 20:56 Hassan Note Added: 0021414
2010-07-16 20:57 Hassan Note Edited: 0021414
2010-07-26 02:55 Hassan Note Edited: 0021414
2010-08-04 01:55 Hassan Note Added: 0021624
2010-08-04 02:40 Hassan Note Edited: 0021624
2010-08-04 23:22 Hassan Note Added: 0021659
2010-08-04 23:25 Hassan Note Edited: 0021659
2010-08-06 00:17 Hassan Note Added: 0021681
2010-08-08 13:50 Alex Neundorf Note Added: 0021695
2010-08-11 19:25 AJ Note Added: 0021720
2010-08-12 18:47 Hassan Note Added: 0021737
2010-08-12 23:00 Hassan Note Added: 0021738
2010-08-13 11:21 AJ Note Added: 0021746
2010-08-13 11:33 AJ Note Edited: 0021746
2010-08-13 13:51 AJ Note Deleted: 0021720
2010-08-13 13:52 AJ Note Deleted: 0021746
2010-08-13 20:28 AJ Note Added: 0021748
2010-08-13 22:41 Hassan Note Added: 0021749
2010-08-15 08:40 Alex Neundorf Note Added: 0021756
2010-08-15 10:43 Alex Neundorf Note Added: 0021758
2010-08-17 16:03 Alex Neundorf File Added: IAR-11.patch
2010-08-17 16:04 Alex Neundorf Note Added: 0021781
2010-08-17 23:57 David O'Shea Note Added: 0021788
2010-08-18 01:08 Hassan Note Deleted: 0021624
2010-08-18 01:09 Hassan Note Deleted: 0021659
2010-08-18 01:13 Hassan Note Added: 0021793
2010-08-18 01:17 Hassan File Added: STM32_ToochainCmake.txt
2010-08-18 01:25 Hassan Note Edited: 0021793
2010-08-18 01:33 Hassan Note Added: 0021795
2010-08-18 01:42 David O'Shea Note Added: 0021796
2010-08-18 14:49 AJ Note Added: 0021809
2010-08-18 19:26 Hassan Note Added: 0021812
2010-08-18 19:29 Hassan Note Added: 0021814
2010-08-19 15:46 Alex Neundorf Note Added: 0021850
2010-08-19 18:46 Hassan Note Added: 0021853
2010-08-19 18:51 Hassan File Added: STM32_ToochainCmake_1r1.txt
2010-08-19 19:54 Hassan Note Edited: 0021853
2010-08-19 21:48 AJ Note Added: 0021856
2010-08-22 17:37 Alex Neundorf Note Added: 0021884
2010-08-22 19:32 Hassan Note Added: 0021886
2010-08-22 19:51 Hassan Note Added: 0021887
2010-08-22 19:52 Hassan File Added: STM32_ToochainCmake_Force.txt
2010-08-23 15:17 Alex Neundorf Note Added: 0021903
2010-09-07 20:57 Hassan Note Added: 0022119
2010-11-10 13:00 David Cole Target Version => CMake 2.8.4
2010-12-07 15:47 David Cole Note Added: 0023770
2010-12-07 15:48 David Cole Note Added: 0023771
2010-12-07 16:17 Hassan Note Added: 0023772
2010-12-07 16:52 David O'Shea Note Added: 0023776
2010-12-07 16:57 David Cole Note Added: 0023778
2010-12-07 16:57 David Cole Target Version CMake 2.8.4 =>
2011-12-19 16:52 Chris Morgan Note Added: 0028014
2012-01-04 15:50 Alex Neundorf Note Added: 0028172
2012-08-13 14:28 Alex Neundorf Status assigned => backlog
2013-03-16 14:07 Bjørn Forsman Note Added: 0032647
2013-04-10 15:51 Alex Neundorf Note Added: 0032801
2013-04-10 15:51 Alex Neundorf Status backlog => assigned
2013-04-10 16:59 Alex Neundorf Note Added: 0032803
2013-04-14 16:42 Bjørn Forsman Note Added: 0032825
2013-04-14 18:04 David Cole Note Added: 0032826
2013-06-26 15:54 Alex Neundorf Note Added: 0033390
2013-06-26 15:54 Alex Neundorf Status assigned => closed
2013-06-26 15:54 Alex Neundorf Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team