Re: [CMake] failing target

2012-03-06 Thread Andrea Crotti

On 03/06/2012 07:23 AM, Michael Hertling wrote:

On 03/05/2012 05:59 PM, Andrea Crotti wrote:

I'm having the following behaviour, and I can't quite understand the
error message:

..
Built target psi.utility_install
..
make[3]: *** No rule to make target `psi.utility_install', needed by
`CMakeFiles/install_all_eggs'.  Stop.
make[2]: *** [CMakeFiles/install_all_eggs.dir/all] Error 2
make[1]: *** [CMakeFiles/unzip_all_eggs.dir/rule] Error 2
make: *** [unzip_all_eggs] Error 2


So first it builds successfully psi.utility_install and then it
complains that there are no rules to make it.
Who is right then and what could cause such a problem?

This is happening on a strange Linux machine, on Windows with MinGW it's
working (strangely)..

Could you boil down your project to a minimal and self-sufficient
example which exhibits this behavior for further investigations?

Regards,

Michael
--



That's quite tricky unfortunately, I hoped that someone saw something 
similar already and

could give me a hint..
Anyway that machine is not a priority at the moment I'll just see later 
when it's more stable.

--

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] failing target

2012-03-06 Thread Michael Hertling
On 03/06/2012 12:21 PM, Andrea Crotti wrote:
 On 03/06/2012 07:23 AM, Michael Hertling wrote:
 On 03/05/2012 05:59 PM, Andrea Crotti wrote:
 I'm having the following behaviour, and I can't quite understand the
 error message:

 ..
 Built target psi.utility_install
 ..
 make[3]: *** No rule to make target `psi.utility_install', needed by
 `CMakeFiles/install_all_eggs'.  Stop.
 make[2]: *** [CMakeFiles/install_all_eggs.dir/all] Error 2
 make[1]: *** [CMakeFiles/unzip_all_eggs.dir/rule] Error 2
 make: *** [unzip_all_eggs] Error 2


 So first it builds successfully psi.utility_install and then it
 complains that there are no rules to make it.
 Who is right then and what could cause such a problem?

 This is happening on a strange Linux machine, on Windows with MinGW it's
 working (strangely)..
 Could you boil down your project to a minimal and self-sufficient
 example which exhibits this behavior for further investigations?

 Regards,

 Michael
 --

 
 That's quite tricky unfortunately, I hoped that someone saw something 
 similar already and
 could give me a hint..
 Anyway that machine is not a priority at the moment I'll just see later 
 when it's more stable.

Could you post the lines which define those targets psi.utility_install
and install_all_eggs, or is this quite tricky, too? Do these lines stem
from the same CMakeLists.txt? IIRC, the no rule to make... needed by
error occurs when there's something wrong with the DEPENDS clause of
ADD_CUSTOM_COMMAND/TARGET().

Regards,

Michael
--

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] failing target

2012-03-06 Thread Andrea Crotti

On 03/06/2012 01:45 PM, Michael Hertling wrote:


Could you post the lines which define those targets psi.utility_install
and install_all_eggs, or is this quite tricky, too? Do these lines stem
from the same CMakeLists.txt? IIRC, the no rule to make... needed by
error occurs when there's something wrong with the DEPENDS clause of
ADD_CUSTOM_COMMAND/TARGET().

Regards,

Michael


Well I think it's something related to the platform, because both on my 
Linux

box and windows it works perfectly.

This is the interesting part anyway:

foreach(egg ${egg_list})
  #TODO: now I need to replace the name with only the last part of the path
  get_filename_component(egg_name ${egg} NAME)
  set(egg_install ${egg_name}_install)
  # generate the list of targets to create more easily dependencies
  list(APPEND egg_install_list ${egg_install})

  add_custom_target(${egg_install}
COMMAND ${PYTHON_EXECUTABLE} setup.py -q bdist_egg -d 
${EGG_BUILD_DIRECTORY}

WORKING_DIRECTORY ${egg}
  )

endforeach()

add_custom_target(install_all_eggs
  DEPENDS ${egg_install_list}
)

#TODO: add this target to the dependencies of run and packing if it works
add_custom_target(unzip_all_eggs
  # unzip the eggs and clean up the zips
  COMMAND ${PYTHON_EXECUTABLE} ${UNZIP_SCRIPT} ${EGG_BUILD_DIRECTORY} 
${EGG_UNZIPPED_DIRECTORY}

  # copy the two run files in the final destination
  COMMAND ${CMAKE_COMMAND} -E copy ${EGG_BUILD_DIRECTORY}/${RUNNER} 
${EGG_UNZIPPED_DIRECTORY}/${RUNNER}
  COMMAND ${CMAKE_COMMAND} -E copy ${EGG_BUILD_DIRECTORY}/${C_RUNNER} 
${EGG_UNZIPPED_DIRECTORY}/${C_RUNNER}


  DEPENDS install_all_eggs
)


sdo the targets are generated at cmake-time reading from a file and then 
there are few more targets that depend on

all of them.

Is there anything wrong in this part?
--

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] failing target

2012-03-06 Thread Michael Hertling
On 03/06/2012 02:47 PM, Andrea Crotti wrote:
 On 03/06/2012 01:45 PM, Michael Hertling wrote:

 Could you post the lines which define those targets psi.utility_install
 and install_all_eggs, or is this quite tricky, too? Do these lines stem
 from the same CMakeLists.txt? IIRC, the no rule to make... needed by
 error occurs when there's something wrong with the DEPENDS clause of
 ADD_CUSTOM_COMMAND/TARGET().

 Regards,

 Michael
 
 Well I think it's something related to the platform, because both on my 
 Linux
 box and windows it works perfectly.
 
 This is the interesting part anyway:
 
 foreach(egg ${egg_list})
#TODO: now I need to replace the name with only the last part of the path
get_filename_component(egg_name ${egg} NAME)
set(egg_install ${egg_name}_install)
# generate the list of targets to create more easily dependencies
list(APPEND egg_install_list ${egg_install})
 
add_custom_target(${egg_install}
  COMMAND ${PYTHON_EXECUTABLE} setup.py -q bdist_egg -d 
 ${EGG_BUILD_DIRECTORY}
  WORKING_DIRECTORY ${egg}
)
 
 endforeach()
 
 add_custom_target(install_all_eggs
DEPENDS ${egg_install_list}
 )
 
 #TODO: add this target to the dependencies of run and packing if it works
 add_custom_target(unzip_all_eggs
# unzip the eggs and clean up the zips
COMMAND ${PYTHON_EXECUTABLE} ${UNZIP_SCRIPT} ${EGG_BUILD_DIRECTORY} 
 ${EGG_UNZIPPED_DIRECTORY}
# copy the two run files in the final destination
COMMAND ${CMAKE_COMMAND} -E copy ${EGG_BUILD_DIRECTORY}/${RUNNER} 
 ${EGG_UNZIPPED_DIRECTORY}/${RUNNER}
COMMAND ${CMAKE_COMMAND} -E copy ${EGG_BUILD_DIRECTORY}/${C_RUNNER} 
 ${EGG_UNZIPPED_DIRECTORY}/${C_RUNNER}
 
DEPENDS install_all_eggs
 )
 
 
 sdo the targets are generated at cmake-time reading from a file and then 
 there are few more targets that depend on
 all of them.
 
 Is there anything wrong in this part?

Yes, the DEPENDS clause of ADD_CUSTOM_TARGET() is only for *file*
dependencies, but you use it for *target* dependencies. According
to the documentation of ADD_CUSTOM_TARGET():

Dependencies listed with the DEPENDS argument may reference files
and outputs of custom commands created with add_custom_command()
in the same directory (CMakeLists.txt file).

Use ADD_DEPENDENCIES to add dependencies to or from other targets.

Regards,

Michael
--

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] failing target

2012-03-06 Thread Andrea Crotti

On 03/06/2012 02:07 PM, Andrea Crotti wrote:



I opened a thread some time ago about this, and I actually thought it
was a bug in the documentation, because then why everything works 
otherwise?


This simple example which I produced

add_custom_target(a
  ${CMAKE_COMMAND} -E echo a
  )

add_custom_target(b
  ${CMAKE_COMMAND} -E echo b
  DEPENDS a
  )


does exactly what would be expected, even if there files a or b don't 
exist.
So I might suppose that this intra-target dependencies work but not 
always,

is that correct?


I tried to substitute the wrong DEPENDS with the add_dependencies and it 
seems to work now.
That doesn't explain why it works on Windows and my other Linux box, but 
well if that's the correct

way to do it I'll stick with that..
--

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] failing target

2012-03-06 Thread David Cole
On Tue, Mar 6, 2012 at 10:24 AM, Andrea Crotti
andrea.crott...@gmail.com wrote:
 On 03/06/2012 02:07 PM, Andrea Crotti wrote:



 I opened a thread some time ago about this, and I actually thought it
 was a bug in the documentation, because then why everything works
 otherwise?

 This simple example which I produced

 add_custom_target(a
  ${CMAKE_COMMAND} -E echo a
  )

 add_custom_target(b
  ${CMAKE_COMMAND} -E echo b
  DEPENDS a
  )


 does exactly what would be expected, even if there files a or b don't
 exist.
 So I might suppose that this intra-target dependencies work but not
 always,
 is that correct?


 I tried to substitute the wrong DEPENDS with the add_dependencies and it
 seems to work now.
 That doesn't explain why it works on Windows and my other Linux box, but
 well if that's the correct
 way to do it I'll stick with that..

 --

 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


The explanation is simple: if you have two targets and they run in
*random* order, then it will be correct 50% of the time... Or
perhaps 100% on one platform and 0% on another. That's likely what you
were seeing when you thought that it worked sometimes.

With the dependencies specified correctly with add_dependencies, you
should now see it work 100% of the time.
--

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] failing target

2012-03-06 Thread Andrea Crotti

On 03/06/2012 03:29 PM, David Cole wrote:

On Tue, Mar 6, 2012 at 10:24 AM, Andrea Crotti


The explanation is simple: if you have two targets and they run in
*random* order, then it will be correct 50% of the time... Or
perhaps 100% on one platform and 0% on another. That's likely what you
were seeing when you thought that it worked sometimes.

With the dependencies specified correctly with add_dependencies, you
should now see it work 100% of the time.


Very good thanks, now I'm satisfied ;)
the problem was appearing in fact when I was trying to run in parallel, 
which explains everything..

--

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] failing target

2012-03-05 Thread Andrea Crotti
I'm having the following behaviour, and I can't quite understand the 
error message:


..
Built target psi.utility_install
..
make[3]: *** No rule to make target `psi.utility_install', needed by 
`CMakeFiles/install_all_eggs'.  Stop.

make[2]: *** [CMakeFiles/install_all_eggs.dir/all] Error 2
make[1]: *** [CMakeFiles/unzip_all_eggs.dir/rule] Error 2
make: *** [unzip_all_eggs] Error 2


So first it builds successfully psi.utility_install and then it 
complains that there are no rules to make it.

Who is right then and what could cause such a problem?

This is happening on a strange Linux machine, on Windows with MinGW it's 
working (strangely)..

--

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] failing target

2012-03-05 Thread Michael Hertling
On 03/05/2012 05:59 PM, Andrea Crotti wrote:
 I'm having the following behaviour, and I can't quite understand the 
 error message:
 
 ..
 Built target psi.utility_install
 ..
 make[3]: *** No rule to make target `psi.utility_install', needed by 
 `CMakeFiles/install_all_eggs'.  Stop.
 make[2]: *** [CMakeFiles/install_all_eggs.dir/all] Error 2
 make[1]: *** [CMakeFiles/unzip_all_eggs.dir/rule] Error 2
 make: *** [unzip_all_eggs] Error 2
 
 
 So first it builds successfully psi.utility_install and then it 
 complains that there are no rules to make it.
 Who is right then and what could cause such a problem?
 
 This is happening on a strange Linux machine, on Windows with MinGW it's 
 working (strangely)..

Could you boil down your project to a minimal and self-sufficient
example which exhibits this behavior for further investigations?

Regards,

Michael
--

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