Picon
Picon
Favicon

Re: need two compilation to achieve success


On Mon 01 Jun 0:01 2009 Tyler Roscoe wrote:
> On Sun, May 31, 2009 at 11:56:18PM +0300, eial@... wrote:
> > I've got a strange problem, when I try to compile a clean version of
> > my program it fails without any explanation but if I try to compile
> > again without running clean I compiles fine...
> 
> We need way more information to help you. What platform? What compiler?
> How exactly does it fail? What do you do to "compile a clean version"?
> 
> tyler
> 

I'm running linux with cmake 2.6.4, gcc 4.3,3. if mean that if I run cmake clean, then try to compile it when it
failes. here:
running project clean generates:
cd '/home/dagg/workspace/AgathaHud' && VERBOSE="1" LC_MESSAGES="C" LC_CTYPE="C" /usr/bin/gmake
-j3 'clean'
/usr/bin/gmake -f CMakeFiles/Makefile2 clean
gmake[1]: Entering directory `/home/dagg/workspace/AgathaHud'
/usr/bin/gmake -f src/CMakeFiles/AgathaEngine.dir/build.make src/CMakeFiles/AgathaEngine.dir/clean
gmake[2]: Entering directory `/home/dagg/workspace/AgathaHud'
cd /home/dagg/workspace/AgathaHud/src && /usr/bin/cmake -P CMakeFiles/AgathaEngine.dir/cmake_clean.cmake
/usr/bin/gmake -f src/CMakeFiles/AgathaHud.dir/build.make src/CMakeFiles/AgathaHud.dir/clean
gmake[2]: Entering directory `/home/dagg/workspace/AgathaHud'
cd /home/dagg/workspace/AgathaHud/src && /usr/bin/cmake -P CMakeFiles/AgathaHud.dir/cmake_clean.cmake
gmake[2]: Leaving directory `/home/dagg/workspace/AgathaHud'
<br />
/usr/bin/gmake -f src/CMakeFiles/AgathaThreads.dir/build.make src/CMakeFiles/AgathaThreads.dir/clean
gmake[2]: Entering directory `/home/dagg/workspace/AgathaHud'
(Continue reading)

Tyler Roscoe | 1 Jun 2009 07:18

Re: need two compilation to achieve success

> gmake[2]: *** No rule to make target in/libs/libAgathaUtils.so', needed
> by in/AgathaHud'. Stop.

Looks like your dependencies aren't set up correctly. You probably need
something like:

add_dependencies (AgathaHud AgathaUtils)

The first run does eventually get around to creating libAgahtaUtils.so,
so AgathaHud can find it during the second run.

These problems are often easier to diagnose/find if you don't do
parallel builds (no -j flag to make).

tyler

On Mon, Jun 01, 2009 at 07:27:09AM +0300, eial@... wrote:
> 
> On Mon 01 Jun 0:01 2009 Tyler Roscoe wrote:
> > On Sun, May 31, 2009 at 11:56:18PM +0300, eial@... wrote:
> > > I've got a strange problem, when I try to compile a clean version of
> > > my program it fails without any explanation but if I try to compile
> > > again without running clean I compiles fine...
> > 
> > We need way more information to help you. What platform? What compiler?
> > How exactly does it fail? What do you do to "compile a clean version"?
> > 
> > tyler
> > 
> 
(Continue reading)

Picon
Picon
Favicon

Re: need two compilation to achieve success


On Mon 01 Jun 8:18 2009 Tyler Roscoe wrote:
> > gmake[2]: *** No rule to make target in/libs/libAgathaUtils.so', needed
> > by in/AgathaHud'. Stop.
> 
> Looks like your dependencies aren't set up correctly. You probably need
> something like:
> 
> add_dependencies (AgathaHud AgathaUtils)
> 
> The first run does eventually get around to creating libAgahtaUtils.so,
> so AgathaHud can find it during the second run.
> 
> These problems are often easier to diagnose/find if you don't do
> parallel builds (no -j flag to make).
> 
> tyler
> 
> On Mon, Jun 01, 2009 at 07:27:09AM +0300, eial@... wrote:
> > 
> > On Mon 01 Jun 0:01 2009 Tyler Roscoe wrote:
> > > On Sun, May 31, 2009 at 11:56:18PM +0300, eial@... wrote:
> > > > I've got a strange problem, when I try to compile a clean version of
> > > > my program it fails without any explanation but if I try to compile
> > > > again without running clean I compiles fine...
> > > 
> > > We need way more information to help you. What platform? What compiler?
> > > How exactly does it fail? What do you do to "compile a clean version"?
> > > 
> > > tyler
(Continue reading)

Bill Hoffman | 1 Jun 2009 14:28
Favicon
Gravatar

Re: need two compilation to achieve success

eial@... wrote:
> On Mon 01 Jun 8:18 2009 Tyler Roscoe wrote:

> 
> thanks for the tip, it solved the issue.
> 
> 

I am glad that worked for you but something else is wrong...  How are 
you linking bin/libs/libAgathaUtils.so' to `bin/AgathaHud' ?  You should 
have something like:

target_link_libraries(AgathaHud AgathaUtils)

That should add the dependency for you.   Do you have that?

-Bill
_______________________________________________
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

Gerrick Bivins | 1 Jun 2009 16:02
Favicon

"No such file or directory" error when using cmake/swig

Hello,

I’m trying to use swig & cmake to generate java files for one of my libraries. The problem I’m having is that I’d like to create a jar from

the output file but I don’t know how to create a directory that swig can write to from Cmake. I’ve specified:

 

SET(CMAKE_SWIG_OUTDIR "${PROJECT_BINARY_DIR}/java/src/com/or/vtkormodelreader" )

 

In my cmake file but during compile I receive the following error:

 

Unable to open file E:/work/research/vtkORModelReader/build32/java/src/com/or/vtkormodelreader\vtkORModelReader.java: No such file or directory

3>Project : error PRJ0019: A tool returned an error code from "Swig source"

 

If I manually create the directory structure, it works perfectly, however this isn’t the desired behavior.

 

I thought I could work around this by creating the directory during the build but I can’t find  any commands to do something similar to “mkdir”.

Am I going about this the wrong way?

 

Gerrick

_______________________________________________
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
Brad King | 1 Jun 2009 16:53
Favicon
Gravatar

Re: Using relative paths with INSTALL

Timothy M. Shead wrote:
> Folks:
> 
> On a couple of occasions now I've recommended the use of relative paths 
> with the OSX bundle installer - this to install files within the bundle 
> in "nonstandard" locations.  It would be good to hear from the CMake 
> gurus on whether relative paths are supported or not.  For example:
> 
> INSTALL(FILES foo DESTINATION ../MacOS)
> 
> ... note that this only makes sense within the context of an OSX bundle.

The install() command

   http://www.cmake.org/cmake/help/cmake2.6docs.html#command:install

interprets relative DESTINATION paths with respect to the installation
prefix (CMAKE_INSTALL_PREFIX).  No other interpretation is supported.

Are you seeing special behavior for an App Bundle?  Did you set
the prefix to point inside an otherwise manually created bundle?

-Brad
_______________________________________________
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

Tyler Roscoe | 1 Jun 2009 17:11

Re: "No such file or directory" error when using cmake/swig

On Mon, Jun 01, 2009 at 09:02:31AM -0500, Gerrick Bivins wrote:
> I thought I could work around this by creating the directory during the
> build but I can't find  any commands to do something similar to "mkdir".

Look at cmake -E make_directory.

You can run that as part of your build process with either
execute_process() or, probably better, with an
add_custom_command()/add_custom_target() combo. See the FAQ for details.

tyler
_______________________________________________
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

Dong Tiger | 1 Jun 2009 19:42
Picon

Re: How to guarntee the sequence of build if no target can be used

2009/5/29 Alexander Neundorf <a.neundorf-work-hi6Y0CQ0nG0@public.gmane.org>
On Thursday 28 May 2009, idlecat511-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
> Hi,
>
> This situation is:
>
> foo.h is generated from foo.x. And foo.h is included by bar.h. And then
> bar.h is included by a lot of c files. So actually every c files including
> bar.h depends on foo.h.
> But the file number is so big that I don't want to add dependency for each
> one.
>
> How can I specify foo.x is generated before all the c files being compiled?
> It seems add_custom_target works but it will regenerate foo.h every time
> even the foo.x is not modified.

You should use
add_custom_command(OUTPUT <fullpath>/foo.h
                  ... )

and then list that generated file as a source file for your target:

add_library(blub <fullpath>/foo.h foo.c bar.c ...)
 
I know by this way, if foo.h is changed, blub will be rebuilt. But what I need is foo.h is guaranteed to be up to date before foo.o is built.  I am not sure if this command is relevant to this. Will cmake try to make sure all the src files are up to date before compiling any .c files?


This should make sure that everything is up to date.

The header-file dependency scanning does in general not work for generated
files, you need to list the generated file as source file for the targets
which need it. 
Another problem is that I am trying to avoid adding dependencies for these generated files manually because in my project, there are many generated head files and quite a few .c files including them. I just want to make sure the head files are generated before any .c compilation. ADD_CUSTOM_TARGET can do this but it will regenerate the head files even they are up-to-date.

Alex

_______________________________________________
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
Picon
Picon
Favicon

Re: need two compilation to achieve success


On Mon 01 Jun 15:28 2009 Bill Hoffman wrote:
> eial@... wrote:
> > On Mon 01 Jun 8:18 2009 Tyler Roscoe wrote:
> 
> > 
> > thanks for the tip, it solved the issue.
> > 
> > 
> 
> I am glad that worked for you but something else is wrong...  How are 
> you linking bin/libs/libAgathaUtils.so' to `bin/AgathaHud' ?  You should 
> have something like:
> 
> target_link_libraries(AgathaHud AgathaUtils)
> 
> That should add the dependency for you.   Do you have that?
> 
> -Bill
> 

I have this:
TARGET_LINK_LIBRARIES(AgathaHud ${LIBRARY_OUTPUT_PATH}/libAgathaUtils.so 
                                ${LIBRARY_OUTPUT_PATH}/libAgathaEngine.so
                                ${LIBRARY_OUTPUT_PATH}/libAgathaThreads.so
                                cv
                                PocoXML
                                PocoFoundation
                                AR
                                ARMulti
                                ARvideo)

_______________________________________________
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

Bill Hoffman | 1 Jun 2009 19:56
Favicon
Gravatar

Re: need two compilation to achieve success

eial@... wrote:
> On Mon 01 Jun 15:28 2009 Bill Hoffman wrote:
>> eial@... wrote:
>>> On Mon 01 Jun 8:18 2009 Tyler Roscoe wrote:
>>> thanks for the tip, it solved the issue.
>>>
>>>
>> I am glad that worked for you but something else is wrong...  How are 
>> you linking bin/libs/libAgathaUtils.so' to `bin/AgathaHud' ?  You should 
>> have something like:
>>
>> target_link_libraries(AgathaHud AgathaUtils)
>>
>> That should add the dependency for you.   Do you have that?
>>
>> -Bill
>>
> 
> I have this:
> TARGET_LINK_LIBRARIES(AgathaHud ${LIBRARY_OUTPUT_PATH}/libAgathaUtils.so 
>                                 ${LIBRARY_OUTPUT_PATH}/libAgathaEngine.so
>                                 ${LIBRARY_OUTPUT_PATH}/libAgathaThreads.so
>                                 cv
>                                 PocoXML
>                                 PocoFoundation
>                                 AR
>                                 ARMulti
>                                 ARvideo)
> 
> 

OK, that is not correct.  For targets that CMake builds, you can just 
use the target name.  What you have now will only work on some systems 
and not work if you use OUTPUT_NAME or other properties on those 
libraries.

You want:
target_link_libraries(AgathaHud AgathaUtils AgathaEntine AgathaThreads)

That is assuming that AgathaUtils AgathaEntine AgathaThreads are all 
built in the same project by CMake.

-Bill

_______________________________________________
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


Gmane