Re: [CMake] XCode generator hangs when writing build config.
On 05/01/2012 01:56, David Cole wrote: >> Wow. Nice, quick work. >> > >> > Thanks for the patch. I'll get it applied and pushed to our 'next' >> > branch so this can get into the next release... >> > >> > >> > Thanks, >> > David > Hmmm. I've downloaded the source from SourceForge, but do not > reproduce the problem here simply by running cmake to > configure/generate. You must be setting the flags explicitly somehow? > (By hand, or with a script?) You may need to checkout from sourceforge CVS, the tar ball is not that recent. > Can you tell me exactly how to reproduce the problem so that I can > verify the fix works? You may need to force your compiler to be gcc (clang or llvm) I don't have the latter so I don't know whether they pass or not. You see the logic of setting the compiler flags in EASDIF_SDIF/SDIF/cmModules/SET_COMPILER_FLAGS.cmake here ... IF (GCCVERSIONMAJ EQUAL 4) ADD_BT_COMPILER_FLAGS(RELEASE -finline-limit=5000 --param large-function-insns=5000 --param large-function-growth=500 --param inline-unit-growth=100) So only gcc will trigger the problem As far as I remember i did not have this machinery when I published the last tar ball. Please find attached a minimal example project (source tt.cc and CMakeLists.txt) that trigger the problem. Best Axel > The ExtractFlags method was modified in this commit to remove > conflicting -g flags when multiple -g flags occur... > > http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cb22afc0 > > It's relatively recent and first appeared in 2.8.6 -- I want to make > sure that whatever fix goes in now also honors the intent of that > commit, which fixed http://public.kitware.com/Bug/view.php?id=12377 > > > Thanks, > David > -- Axel Roebel Head of the Analysis/Synthesis Team, IRCAM Phone: ++33-1-4478 4845 | Fax: ++33-1-4478 1540 // string::rfind #include #include using namespace std; int main () { string str ("The sixth sick sheik's sixth sheep's sick."); string key ("sixth"); size_t found; found=str.rfind(key); if (found!=string::npos) str.replace (found,key.length(),"seventh"); cout << str << endl; return 0; } project(tt ) SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "--param large-function-insns=5000 --param large-function-growth=500 --param inline-unit-growth=100") add_executable(tt tt.cc)-- Powered by 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
Re: [CMake] XCode generator hangs when writing build config.
On 4.1.2012. 17:05, David Cole wrote: What project are you running through CMake? Is it available for us to try to reproduce here? I've not heard of anything like this... Actually we've been bitten by this also: ever since 2.8.6 CMake would hang in the generate phase on OS X. However it only happened if/when we included the NT2 library so I wasn't sure whether this was due to a bug in CMake or NT2 CMake project files. It turns out it was the CMake issue Axel identified (we had both -g and -fno-objc-gc options in CMAKE_CXX_FLAGS). Thank you Axel for debugging this yourself so quickly! ;) kind regards, Domagoj Saric www.littleendian.com -- Powered by 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
Re: [CMake] XCode generator hangs when writing build config.
On Wed, Jan 4, 2012 at 1:14 PM, David Cole wrote: > On Wed, Jan 4, 2012 at 12:36 PM, Axel Roebel wrote: >> On 4/1/12 5:05 PM, David Cole wrote: >>> What project are you running through CMake? Is it available for us to >>> try to reproduce here? >> >> It is the SDIF/EASDIF_SDIF project that is on sourceforge. >> http://sourceforge.net/projects/sdif/files/Easdif/ >> >>> I've not heard of anything like this... >> >> Thanks for the feedback. So I took the cmake sources and compiled in >> debug mode to see what is the problem. In my opinion there is a bug in >> >> cmGlobalXCodeGenerator::CreateBuildSettings >> >> in function ExtractFlag(const char* flag, std::string& flags) >> >> In my case I loop endlessly in >> >> std::string gflag = this->ExtractFlag("-g", flags); >> >> while I have these flags >> >> -DGCC_HAS_VISIBILITY -fvisibility=hidden -fstrict-aliasing >> -maccumulate-outgoing-args -DNDEBUG -DNDEBUG -funroll-loops -Wall >> -Wno-switch -Wno-unused-function -finline-limit=5000 --param >> large-function-insns=5000 --param large-function-growth=500 --param >> inline-unit-growth=100 -fPIC >> >> You see the -g is not there but something is found here >> >> inline-unit-growth=100 -fPIC >> >> and as the function is implemented >> it does not handle this case correctly. >> >> I suggest the following fix for the ExtractfFlag function >> that ensures that a flag that is found will never be refound even >> if it is nor removed (see FIX section below). The fix works for me. >> >> std::string cmGlobalXCodeGenerator::ExtractFlag(const char* flag, >> std::string& flags) >> { >> std::string retFlag; >> std::string::size_type pos = flags.rfind(flag); >> bool saved = false; >> >> while(pos != flags.npos) >> { >> if(pos == 0 || flags[pos-1]==' ') >> { >> while(pos < flags.size() && flags[pos] != ' ') >> { >> if(!saved) >> { >> retFlag += flags[pos]; >> } >> flags[pos] = ' '; >> pos++; >> } >> } >> saved = true; >> // FIX IS HERE >> // original version >> // pos = flags.rfind(flag); >> // corrected version >> if(pos) >> pos = flags.rfind(flag, pos-1); >> else >> pos = flags.npos; >> // END OF FIX >> } >> return retFlag; >> } >> >> Cheers >> Axel >> >>> Can you use Activity Monitor to inspect the process and grab a sample >>> showing a call stack of what's happening when it's "hung"? >>> >>> Does CMake have any child processes that run during the configure of >>> this project? (i.e. -- do you call execute_process with anything) >>> >>> What else did you upgrade at the same time? :-) >>> >>> >>> Thx, >>> David >>> >>> >>> >>> On Wed, Jan 4, 2012 at 10:08 AM, Axel Roebel wrote: Hello I just upgraded from 2.8.1 to 2.8.6 to be able to use the recently added generator expressions in add_custom_command. Unfortunately, whenever I try to generate a project for Xcode (Mac OSX 10.6.8, Xcode 3.2.6) the project generator (command line as well as gui) hangs in the last phase when it writes the project files. Is Xcode 3.2.6 no longer supported, or does anybody have an idea what might be the problem? I used cmake that comes from macports repository, but after that failed I tried version 2.8.7 from the cmake download page, but that gave the same result (None). Cheers Axel -- Axel Roebel Head of the Analysis/Synthesis Team, IRCAM Phone: ++33-1-4478 4845 | Fax: ++33-1-4478 1540 -- Powered by 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 >>> >> >> >> -- >> Axel Roebel >> Head of the Analysis/Synthesis Team, IRCAM >> Phone: ++33-1-4478 4845 | Fax: ++33-1-4478 1540 > > Wow. Nice, quick work. > > Thanks for the patch. I'll get it applied and pushed to our 'next' > branch so this can get into the next release... > > > Thanks, > David Hmmm. I've downloaded the source from SourceForge, but do not reproduce the problem here simply by running cmake to configure/generate. You must be setting the flags explicitly somehow? (By hand, or with a script?) Can you tell me exactly how to reproduce the problem so that I can verify the fix works? The ExtractFlags method was modified in this commit to remove conflicting -g flags when multiple -g flags occur... http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cb22afc0 It's relatively recent and first appeared in 2.8.6 -- I want to make sure that whatever fix goes in now also honors the intent of that commit, which fixed http://public.kitware.com/Bug/view.php?id=12377 Thanks, David -- Powered by www.kitware.com Visit other Ki
Re: [CMake] XCode generator hangs when writing build config.
On Wed, Jan 4, 2012 at 12:36 PM, Axel Roebel wrote: > On 4/1/12 5:05 PM, David Cole wrote: >> What project are you running through CMake? Is it available for us to >> try to reproduce here? > > It is the SDIF/EASDIF_SDIF project that is on sourceforge. > http://sourceforge.net/projects/sdif/files/Easdif/ > >> I've not heard of anything like this... > > Thanks for the feedback. So I took the cmake sources and compiled in > debug mode to see what is the problem. In my opinion there is a bug in > > cmGlobalXCodeGenerator::CreateBuildSettings > > in function ExtractFlag(const char* flag, std::string& flags) > > In my case I loop endlessly in > > std::string gflag = this->ExtractFlag("-g", flags); > > while I have these flags > > -DGCC_HAS_VISIBILITY -fvisibility=hidden -fstrict-aliasing > -maccumulate-outgoing-args -DNDEBUG -DNDEBUG -funroll-loops -Wall > -Wno-switch -Wno-unused-function -finline-limit=5000 --param > large-function-insns=5000 --param large-function-growth=500 --param > inline-unit-growth=100 -fPIC > > You see the -g is not there but something is found here > > inline-unit-growth=100 -fPIC > > and as the function is implemented > it does not handle this case correctly. > > I suggest the following fix for the ExtractfFlag function > that ensures that a flag that is found will never be refound even > if it is nor removed (see FIX section below). The fix works for me. > > std::string cmGlobalXCodeGenerator::ExtractFlag(const char* flag, > std::string& flags) > { > std::string retFlag; > std::string::size_type pos = flags.rfind(flag); > bool saved = false; > > while(pos != flags.npos) > { > if(pos == 0 || flags[pos-1]==' ') > { > while(pos < flags.size() && flags[pos] != ' ') > { > if(!saved) > { > retFlag += flags[pos]; > } > flags[pos] = ' '; > pos++; > } > } > saved = true; > // FIX IS HERE > // original version > // pos = flags.rfind(flag); > // corrected version > if(pos) > pos = flags.rfind(flag, pos-1); > else > pos = flags.npos; > // END OF FIX > } > return retFlag; > } > > Cheers > Axel > >> Can you use Activity Monitor to inspect the process and grab a sample >> showing a call stack of what's happening when it's "hung"? >> >> Does CMake have any child processes that run during the configure of >> this project? (i.e. -- do you call execute_process with anything) >> >> What else did you upgrade at the same time? :-) >> >> >> Thx, >> David >> >> >> >> On Wed, Jan 4, 2012 at 10:08 AM, Axel Roebel wrote: >>> Hello >>> >>> I just upgraded from 2.8.1 to 2.8.6 to be able to use the recently added >>> generator expressions in add_custom_command. Unfortunately, whenever I >>> try to generate a project for Xcode (Mac OSX 10.6.8, Xcode 3.2.6) the >>> project generator (command line as well as gui) hangs in the last phase >>> when it writes the project files. Is Xcode 3.2.6 no longer supported, or >>> does anybody have an idea what might be the problem? >>> >>> I used cmake that comes from macports repository, but after that failed >>> I tried version 2.8.7 from the cmake download page, but that gave the >>> same result (None). >>> >>> Cheers >>> Axel >>> >>> -- >>> Axel Roebel >>> Head of the Analysis/Synthesis Team, IRCAM >>> Phone: ++33-1-4478 4845 | Fax: ++33-1-4478 1540 >>> -- >>> >>> Powered by 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 >> > > > -- > Axel Roebel > Head of the Analysis/Synthesis Team, IRCAM > Phone: ++33-1-4478 4845 | Fax: ++33-1-4478 1540 Wow. Nice, quick work. Thanks for the patch. I'll get it applied and pushed to our 'next' branch so this can get into the next release... Thanks, David -- Powered by 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
Re: [CMake] XCode generator hangs when writing build config.
On 4/1/12 5:05 PM, David Cole wrote: > What project are you running through CMake? Is it available for us to > try to reproduce here? It is the SDIF/EASDIF_SDIF project that is on sourceforge. http://sourceforge.net/projects/sdif/files/Easdif/ > I've not heard of anything like this... Thanks for the feedback. So I took the cmake sources and compiled in debug mode to see what is the problem. In my opinion there is a bug in cmGlobalXCodeGenerator::CreateBuildSettings in function ExtractFlag(const char* flag, std::string& flags) In my case I loop endlessly in std::string gflag = this->ExtractFlag("-g", flags); while I have these flags -DGCC_HAS_VISIBILITY -fvisibility=hidden -fstrict-aliasing -maccumulate-outgoing-args -DNDEBUG -DNDEBUG -funroll-loops -Wall -Wno-switch -Wno-unused-function -finline-limit=5000 --param large-function-insns=5000 --param large-function-growth=500 --param inline-unit-growth=100 -fPIC You see the -g is not there but something is found here inline-unit-growth=100 -fPIC and as the function is implemented it does not handle this case correctly. I suggest the following fix for the ExtractfFlag function that ensures that a flag that is found will never be refound even if it is nor removed (see FIX section below). The fix works for me. std::string cmGlobalXCodeGenerator::ExtractFlag(const char* flag, std::string& flags) { std::string retFlag; std::string::size_type pos = flags.rfind(flag); bool saved = false; while(pos != flags.npos) { if(pos == 0 || flags[pos-1]==' ') { while(pos < flags.size() && flags[pos] != ' ') { if(!saved) { retFlag += flags[pos]; } flags[pos] = ' '; pos++; } } saved = true; // FIX IS HERE // original version // pos = flags.rfind(flag); // corrected version if(pos) pos = flags.rfind(flag, pos-1); else pos = flags.npos; // END OF FIX } return retFlag; } Cheers Axel > Can you use Activity Monitor to inspect the process and grab a sample > showing a call stack of what's happening when it's "hung"? > > Does CMake have any child processes that run during the configure of > this project? (i.e. -- do you call execute_process with anything) > > What else did you upgrade at the same time? :-) > > > Thx, > David > > > > On Wed, Jan 4, 2012 at 10:08 AM, Axel Roebel wrote: >> Hello >> >> I just upgraded from 2.8.1 to 2.8.6 to be able to use the recently added >> generator expressions in add_custom_command. Unfortunately, whenever I >> try to generate a project for Xcode (Mac OSX 10.6.8, Xcode 3.2.6) the >> project generator (command line as well as gui) hangs in the last phase >> when it writes the project files. Is Xcode 3.2.6 no longer supported, or >> does anybody have an idea what might be the problem? >> >> I used cmake that comes from macports repository, but after that failed >> I tried version 2.8.7 from the cmake download page, but that gave the >> same result (None). >> >> Cheers >> Axel >> >> -- >> Axel Roebel >> Head of the Analysis/Synthesis Team, IRCAM >> Phone: ++33-1-4478 4845 | Fax: ++33-1-4478 1540 >> -- >> >> Powered by 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 > -- Axel Roebel Head of the Analysis/Synthesis Team, IRCAM Phone: ++33-1-4478 4845 | Fax: ++33-1-4478 1540 -- Powered by 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
Re: [CMake] XCode generator hangs when writing build config.
What project are you running through CMake? Is it available for us to try to reproduce here? I've not heard of anything like this... Can you use Activity Monitor to inspect the process and grab a sample showing a call stack of what's happening when it's "hung"? Does CMake have any child processes that run during the configure of this project? (i.e. -- do you call execute_process with anything) What else did you upgrade at the same time? :-) Thx, David On Wed, Jan 4, 2012 at 10:08 AM, Axel Roebel wrote: > Hello > > I just upgraded from 2.8.1 to 2.8.6 to be able to use the recently added > generator expressions in add_custom_command. Unfortunately, whenever I > try to generate a project for Xcode (Mac OSX 10.6.8, Xcode 3.2.6) the > project generator (command line as well as gui) hangs in the last phase > when it writes the project files. Is Xcode 3.2.6 no longer supported, or > does anybody have an idea what might be the problem? > > I used cmake that comes from macports repository, but after that failed > I tried version 2.8.7 from the cmake download page, but that gave the > same result (None). > > Cheers > Axel > > -- > Axel Roebel > Head of the Analysis/Synthesis Team, IRCAM > Phone: ++33-1-4478 4845 | Fax: ++33-1-4478 1540 > -- > > Powered by 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 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
[CMake] XCode generator hangs when writing build config.
Hello I just upgraded from 2.8.1 to 2.8.6 to be able to use the recently added generator expressions in add_custom_command. Unfortunately, whenever I try to generate a project for Xcode (Mac OSX 10.6.8, Xcode 3.2.6) the project generator (command line as well as gui) hangs in the last phase when it writes the project files. Is Xcode 3.2.6 no longer supported, or does anybody have an idea what might be the problem? I used cmake that comes from macports repository, but after that failed I tried version 2.8.7 from the cmake download page, but that gave the same result (None). Cheers Axel -- Axel Roebel Head of the Analysis/Synthesis Team, IRCAM Phone: ++33-1-4478 4845 | Fax: ++33-1-4478 1540 -- Powered by 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