[CMake] Compiler Test Failing on Windows 7

Gregory Peele ARA/CFD gpeele at ara.com
Wed Jan 6 16:27:02 EST 2010


Hey all,

See next two posts below discussing Admin issues on Vista and 7 that we had meant to put on the list at large.
As always, I greatly appreciate the responsiveness and helpfulness of the CMake developers and the people on this list.

Gregory Peele, Jr.
Applied Research Associates, Inc.

From: David Cole [mailto:david.cole at kitware.com]
Sent: Wednesday, January 06, 2010 4:19 PM
To: Gregory Peele ARA/CFD
Subject: Re: [CMake] Compiler Test Failing on Windows 7

I had meant to send that last reply to "all" including the list.... do you think I should resend it to the list as well or just let it be?

Sorry for this hassle. I wish there was something that CMake could do to make this easier to diagnose when it does happen...

On Wed, Jan 6, 2010 at 3:06 PM, Gregory Peele ARA/CFD <gpeele at ara.com<mailto:gpeele at ara.com>> wrote:
David,

I completely agree with you, especially as I come from a Linux development background.  I personally use Vista and do not run as Admin, despite Microsoft's recommendation.  Joe is our development team's guinea pig for Windows 7 and it literally does not work for him without running as Admin, for any solution, CMake or no.  So I'm guessing an operation that Visual Studio 2005 performs that was not privileged in Vista was made privileged in Windows 7.  Or some other oddity like that.  It's certainly very unexpected, but other people have reported the same problem on a web search.  That is why I want to find out if someone else has ever successfully done this.

Gregory Peele, Jr.
Applied Research Associates, Inc.

From: David Cole [mailto:david.cole at kitware.com<mailto:david.cole at kitware.com>]
Sent: Wednesday, January 06, 2010 2:58 PM
To: Gregory Peele ARA/CFD

Subject: Re: [CMake] Compiler Test Failing on Windows 7

Child processes of CMake will run with whatever credentials CMake is given. Admin or non-admin.

So if you need VS to run as administrator, then you also need to run CMake as admin.

I personally avoid running anything as admin (including VS 2005 on Vista) unless there is absolutely a reason for me to do so.

Building C++ code with Visual Studio does *not* require admin privileges.

Registering ActiveX controls and perhaps some SQL server-y stuff probably does need VS running with admin privileges.

So it depends on your situation.....

Avoid admin if you can, use it if you must.


HTH,
David


On Wed, Jan 6, 2010 at 2:49 PM, Gregory Peele ARA/CFD <gpeele at ara.com<mailto:gpeele at ara.com>> wrote:
Let's stress that the source and binary directories of this build are readable and writable to Joe's account.  It is NOT a file permission issue for any files in our build tree.  If CMake or Visual Studio generate files outside of our source or binary tree all bets are off of course.

Given that Microsoft heavily recommends running Visual Studio 2005 as Administrator in both Vista and Windows 7 - it nags you each time you launch if you don't - and it also fails for Joe on non-CMake-generated solutions, I suspect the real problem is a bug in Visual Studio 2005 on Windows 7.

Has anyone on this list successfully built projects using Visual Studio 2005 on Windows 7 without marking CMake and Visual Studio to run as Administrator?  Presumably what happens if CMake is not marked to run as Administrator, when it attempts the try-compile stage, it does not honor the "run as Administrator" marking on devenv or vcbuild or whatever process it uses, and then Visual Studio 2005 does naughty things and fails.

Given that we have a workaround we don't need to follow up any further, but if this is a general problem for anyone on Windows 7 there should probably be a bug report on it, right?

Gregory Peele, Jr.
Applied Research Associates, Inc.

From: cmake-bounces at cmake.org<mailto:cmake-bounces at cmake.org> [mailto:cmake-bounces at cmake.org<mailto:cmake-bounces at cmake.org>] On Behalf Of David Cole
Sent: Wednesday, January 06, 2010 10:34 AM
To: Joe L
Cc: cmake at cmake.org<mailto:cmake at cmake.org>; Bill Hoffman

Subject: Re: [CMake] Compiler Test Failing on Windows 7

So it actually *was* a permissions issue after all...

On Wed, Jan 6, 2010 at 8:56 AM, Joe L <superist_joe at yahoo.com<mailto:superist_joe at yahoo.com>> wrote:
Trying to open the solution file (trycompile generated) didn't work by double clicking on it, so I searched about that and found this:
http://www.pluralsight.com/community/blogs/matt/archive/2007/05/21/47446.aspx

this comment is the one that solved that for me:
"It works when you set both
Launcher (C:\Program Files\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe) and IDE(C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe) to run as administrator.
(Right click .exe and select Propertries -> Compatibility, and choose Run as Administrator)

Hope this helps. "

After doing this I thought to set cmake as 'run as admin', and that seemed to get everything to generate as it should.

Thanks,
Joe

________________________________
From: Bill Hoffman <bill.hoffman at kitware.com<mailto:bill.hoffman at kitware.com>>
To: David Cole <david.cole at kitware.com<mailto:david.cole at kitware.com>>
Cc: cmake at cmake.org<mailto:cmake at cmake.org>
Sent: Tue, January 5, 2010 3:01:47 PM

Subject: Re: [CMake] Compiler Test Failing on Windows 7

David Cole wrote:
> On Tue, Jan 5, 2010 at 12:38 PM, Hendrik Sattler <post at hendrik-sattler.de<mailto:post at hendrik-sattler.de> <mailto:post at hendrik-sattler.de<mailto:post at hendrik-sattler.de>>> wrote:
>
>    Am Dienstag 05 Januar 2010 14:09:00 schrieb Joe L:
>      >  C:/Program Files (x86)/CMake
>      >  2.8/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:62
>      >  (CMAKE_DETERMINE_COMPILER_ABI) CMakeLists.txt:3 (PROJECT)
>
>    You might want to avoid instal cmake in a path with spaces.
>    I install software with unix layout to "C:\local"
>
>
> Nonsense. CMake works fine in a directory that has spaces in its name. We wouldn't make the default installation directory on Windows have spaces in it if it did have problems...
>
> There must be something else going on here.
>
>

This has nothing to do with copy file not working.  The copy file is not working because no executable was generated for some reason.  You should look in CMakeError.log and CMakeOutput.log.  If that fails to show anything, then run cmake --debug-trycompile, then go into the CMakeFiles directory and run the build tool by hand and figure out why it is not producing executable files.

-Bill

-- Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoffman at kitware.com<mailto:bill.hoffman at kitware.com>
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573
_______________________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake



_______________________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100106/3ba43547/attachment-0001.htm>


More information about the CMake mailing list