LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-21-2016, 01:12 PM   #1
dc217863
LQ Newbie
 
Registered: Mar 2016
Posts: 6

Rep: Reputation: Disabled
Exclamation install older version of cmake on cygwin


Hello,

I have cygwin installed on my computer. For the project I am working on, I need to use the CMake 2.8.10.2 version. I am able to download the files for this version from 'http://www.npackd.org/p/org.cmake.CMake/2.8.10.2'. However, I need help to install this version now onto the existing cygwin on my computer.

Note: At present CMake 3.3.2 is installed on the computer (by inputting cmake --version) into cygwin. This version was installed while installing cygwin on the computer.

Please do provide step-by-step instructions as I am a newbie in Cygwin/CMake.

Thanks,
Dhruv
 
Old 03-21-2016, 02:29 PM   #2
kristianonline
LQ Newbie
 
Registered: Mar 2016
Posts: 3

Rep: Reputation: Disabled
Why do you think you need CMake 2.8.10.2 ?

As far as I know, CMake is backwards compatible, so if you have CMake 3.3.2, it is sufficient. You do not have to change anything.
 
Old 03-21-2016, 02:45 PM   #3
dc217863
LQ Newbie
 
Registered: Mar 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
With one look at the errors I was receiving, a colleague was able to suggest that it has to be the wrong version of CMake causing the errors.
 
Old 03-21-2016, 02:47 PM   #4
kristianonline
LQ Newbie
 
Registered: Mar 2016
Posts: 3

Rep: Reputation: Disabled
Can you post the errors ? Maybe the problem is another than the version of CMake or we can fix that error in an easier way?
 
Old 03-21-2016, 03:36 PM   #5
dc217863
LQ Newbie
 
Registered: Mar 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
ok.. let me give it a go

This is the toolchain file used for cross compiling:

Code:
# for cross compiling
SET(CMAKE_SYSTEM_NAME Generic)
# $RANDOM
SET(CMAKE_SYSTEM_VERSION 1)

# ARM compiler
SET(CMAKE_C_COMPILER C:/ARM/bin64/armcc.exe)

# ARM cpp compiler
SET(CMAKE_CXX_COMPILER C:/ARM/bin64/armcc.exe)

SET(CMAKE_AR C:/ARM/bin64/armar.exe)
#SET(CMAKE_C_LINK_EXECUTABLE C:/ARM/bin64/armlink.exe)

# location of the target environment
SET(CMAKE_FIND_ROOT_PATH $ENV{ARMROOT})

# 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)

# target specification
SET(ARCH "-DARM -DSA2_TARGET --cpu=Cortex-A9")
SET(CMAKE_C_FLAGS_INIT "${ARCH}")
SET(CMAKE_CXX_FLAGS_INIT "${CMAKE_C_FLAGS_INIT} --cpp")
Inspite of the presence of the armcc.exe file in the directory being provided to PATH (and being provided to CMAKE_C_COMPILER), cmake always returns the error that "The C compiler identification is unknown" and that it is unable to compile a simple test program.

However, on trying to compile a sample Hello World c file, it compiles without a glitch.

The CMake command I use:

Code:
cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=../Config/Buildsystem/arm-5_102.toolchain -DCMAKE_BUILD_TYPE=Debug ../../../Sources
The path names and locations are all correct and their existence has been verified. The environment variables have also been correctly specified.

Any ideas??
 
Old 03-21-2016, 03:51 PM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,923

Rep: Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319
would be nice to show exactly the commands you executed and the error message(s) you got. I'm not really sure it is really related to the version of cmake.
Using an older version of cmake will force you to downgrade a lot of other packages I think, so anyway that will not be easy.
 
Old 03-21-2016, 05:09 PM   #7
kristianonline
LQ Newbie
 
Registered: Mar 2016
Posts: 3

Rep: Reputation: Disabled
Did you start cmake as an Admin?
 
Old 03-22-2016, 01:16 AM   #8
dc217863
LQ Newbie
 
Registered: Mar 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
@kristianonline: I am starting cygwin as an administrator. Would CMake then also be called in Admin mode? Do I need to check if some particular folder is write protected?

Code:
export PATH=/cygdrive/c/ARM/bin64/:$PATH
export PATH=/cygdrive/c/Python27/:$PATH

“build lib”
cd /cygdrive/c/_sa2/Proj/swbk/Config/Buildsystem/target
cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=../Config/Buildsystem/arm-5_102.toolchain -DCMAKE_BUILD_TYPE=Debug ../../../Sources
I am supposed to "make" as the next step. But I get errors before that.

The error messages/output:

Quote:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /cygdrive/c/ARM/bin64/armcc.exe
-- Check for working C compiler: /cygdrive/c/ARM/bin64/armcc.exe -- broken
CMake Error at /usr/share/cmake-3.3.2/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "/cygdrive/c/ARM/bin64/armcc.exe" is not able to compile a
simple test program.

It fails with the following output:

Change Dir: /cygdrive/c/_sa2/Proj/swbk/Config/Buildsystem/target/CMakeFiles/CMakeTmp



Run Build Command:"/cygdrive/c/ARM/bin64/make.exe" "cmTC_11a77/fast"

C:/ARM/bin64/make -f CMakeFiles/cmTC_11a77.dir/build.make
CMakeFiles/cmTC_11a77.dir/build

make[1]: Entering directory
`C:/_sa2/Proj/swbk/Config/Buildsystem/target/CMakeFiles/CMakeTmp'

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

/cygdrive/c/ARM/bin64/armcc.exe -DARM -DSA2_TARGET --cpu=Cortex-A9 -o
CMakeFiles/cmTC_11a77.dir/testCCompiler.c.obj -c
/cygdrive/c/_sa2/Proj/swbk/Config/Buildsystem/target/CMakeFiles/CMakeTmp/testCCompiler.c


make[1]: Leaving directory
`C:/_sa2/Proj/swbk/Config/Buildsystem/target/CMakeFiles/CMakeTmp'

process_begin: CreateProcess(NULL, /cygdrive/c/ARM/bin64/armcc.exe -DARM
-DSA2_TARGET --cpu=Cortex-A9 -o
CMakeFiles/cmTC_11a77.dir/testCCompiler.c.obj -c
/cygdrive/c/_sa2/Proj/swbk/Config/Buildsystem/target/CMakeFiles/CMakeTmp/testCCompiler.c,
...) failed.

make (e=2): Das System kann die angegebene Datei nicht finden.

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

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





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


-- Configuring incomplete, errors occurred!
See also "/cygdrive/c/_sa2/Proj/swbk/Config/Buildsystem/target/CMakeFiles/CMakeOutput.log".
See also "/cygdrive/c/_sa2/Proj/swbk/Config/Buildsystem/target/CMakeFiles/CMakeError.log".
 
Old 03-22-2016, 01:22 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,923

Rep: Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319
yes, armcc.exe is not a c compiler but a cross-compiler, it won't be able to create native executable inside cygwin.

Please check these links how to set up cmake for cross compiling:
https://cmake.org/Wiki/CMake_Cross_Compiling
http://stackoverflow.com/questions/1...arm-with-cmake
 
Old 03-22-2016, 01:48 AM   #10
dc217863
LQ Newbie
 
Registered: Mar 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Yes, I understand that I will get object files from cmake which I then need to Make to get the final result.

I have made the toolchain file (provided in above comments for reference) according to the first link you provided.
 
Old 03-22-2016, 01:52 AM   #11
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,923

Rep: Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319Reputation: 7319
Quote:
Originally Posted by dc217863 View Post
Yes, I understand that I will get object files from cmake which I then need to Make to get the final result.
I do not really understand it. CMake will create makefiles for you and make will produce object files and binaries (and the final result).

Quote:
Originally Posted by dc217863 View Post
I have made the toolchain file (provided in above comments for reference) according to the first link you provided.
Does it work now?
 
Old 03-22-2016, 01:58 AM   #12
dc217863
LQ Newbie
 
Registered: Mar 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
I do not really understand it. CMake will create makefiles for you and make will produce object files and binaries (and the final result).
Ok. My mistake. You are right.
Quote:
Originally Posted by pan64 View Post
Does it work now?
No. I have not changed anything as yet. I did not understand what is wrong. Could you please have a look at the toolchain file (in above comments) and point me to what is wrong?
 
Old 03-22-2016, 02:43 AM   #13
OregonJim
Member
 
Registered: Feb 2016
Posts: 98

Rep: Reputation: Disabled
Quote:
Originally Posted by dc217863 View Post
# ARM compiler
SET(CMAKE_C_COMPILER C:/ARM/bin64/armcc.exe)

# ARM cpp compiler
SET(CMAKE_CXX_COMPILER C:/ARM/bin64/armcc.exe)

SET(CMAKE_AR C:/ARM/bin64/armar.exe)
#SET(CMAKE_C_LINK_EXECUTABLE C:/ARM/bin64/armlink.exe)
The above lines are incorrect. The Cygwin environment doesn't understand drive designators like "C:". You have to translate them to the Cygwin path equivalent. For example, "C:/ARM/bin64/amcc.exe" becomes "/cygdrive/c/ARM/bin64/armcc.exe".
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Install and use older version of Java while keeping newst version Predatorian Linux - Software 3 06-13-2013 06:49 PM
New install 9.04 (Jaunty) on old computer > no sound - install older version? NewTeacher Ubuntu 3 05-24-2009 12:52 AM
How to install an older version not in the repos? czamora Linux - Server 9 04-13-2008 05:46 PM
What if I need to install an older version of selinux ? hq4ever Fedora 3 04-30-2006 11:38 AM
Install older version of gcc s9902245 Linux - Newbie 1 09-16-2003 03:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration