commontk / CTK

A set of common support code for medical imaging, surgical navigation, and related purposes.
https://commontk.org
Apache License 2.0
865 stars 492 forks source link

How to disable the git clone of CTK dependencies ? #62

Closed lambdacrash closed 13 years ago

lambdacrash commented 13 years ago

Hi ! I am currently working on a project using CommonTK. I need to manage the entire compilation process including CTK compilation. So, for several reasons, I have to disable the git clone of all CTK dependencies. I want to clone these dependencies only one time (at the first compilation) and disable it for the next compilation.

How can I do this ?

Kind regards, Brice

saschazelzer commented 13 years ago

The clone is already done only once. And since we use specific git tags for most of the external dependencies, repeated builds in the "superbuild" directory will not update the external sources.

If you issue repeated build commands in the CTK-build subdirectory of your CTK build-tree, no updates of external dependencies take place at all.

Or maybe I misunderstood your problem?

finetjul commented 13 years ago

Hi Brice, This is currently the behavior of CTK. The first time CTK is built, it downloads/clone all its dependencies. For the next compilations, it checks if the git tag has changed, if it did, it retrieves/download/clone the new version, otherwise it doesn't do anything and only build CTK internal. Now, you have the option of passing the dependencies to CTK if you already retrieved them outside of CTK. For example, you can do -DVTK_DIR=my/vtk/build/dir when configuring ctk. It won't download VTK and use the one you provide.

lambdacrash commented 13 years ago

@saschazelzer Ok, I never build CTK in its superbuild dir, I compile it from its clone. I tryed your solution and it seems to achieve the expected behavior ! Som just thank you very much !!

@finetjul I keep your solution in mind because it could be helpfull for me to manage the compilation of these dependencies. Thank you !!

Brice.

jcfr commented 13 years ago

Hi,

Thanks for you report :)

Please consider the following remarks:

1) By default, CTK will clone its dependency only if it has not been done or if the git tag associated with a given dependency has been updated.

2) You could configure CTK passing, for example: VTK_DIR, ITK_DIR, Log4Qt_DIR ... and the project won't be checkout or build. See https://github.com/commontk/CTK/blob/master/CMakeExternals/Log4Qt.cmake#L9

3) You could configure CTK passing directlry CTK_SUPERBUILD to OFF. This currently won't work. This is something we will mosy likely during the coming CTK hackfest. See http://www.commontk.org/index.php/CTK-Hackfest-Nov-2011

Could you provide more details regarding your specific issue ?

Thanks Jc

On Wed, Oct 26, 2011 at 11:48 AM, lambdacrash < reply@reply.github.com>wrote:

Hi ! I am currently working on a project using CommonTK. I need to manage the entire compilation process including CTK compilation. So, for several reasons, I have to disable the git clone of all CTK dependencies. I want to clone these dependencies only one time (at the first compilation) and disable it for the next compilation.

How can I do this ?

Kind regards, Brice

Reply to this email directly or view it on GitHub: https://github.com/commontk/CTK/issues/62

+1 919 869 8849

lambdacrash commented 13 years ago

Hi ! @jcfr Thanks for your help. 1: I clone CTK in a 'ctk' directory and I create a 'ctk-superbuild' directory:


CommonTk/ctk/ CommonTk/ctk-superbuild/


2: I use cmake for generating a Makefile for CTK:


cd ctk-superbuild/ cmake ../ctk/


3: I use make (linux) or nmake (windows) for building CTK:


cd ctk-superbuild/ (n)make


4: I create CommonTk/ctk-superbuild/include, CommonTk/ctk-superbuild/bin, CommonTk/ctk-superbuild/lib and move appropriated files into these directories.

So, here is my complet compilation process for CTK. Each time I compile CTK from CommonTk/ctk/ and CTK always retreive all its dependencies using git clone.

What is the best way to build CTK without retrieving all its dependencies when they already exist in ctk-superbuild ?

Thanks,

Brice

lambdacrash commented 13 years ago

I found another way ! I create a tgz of each dependency and in each CMakeExternals/*.cmake, I replace GIT_REPOSITORY by URL=local/path/to/Log4Qt.tgz and GIT_TAG by DOWNLOAD_DIR.

This way is perfect for me because if I decide to update Log4Qt, I just need to create a new tgz and Internet is not required for compilation.

Thanks you for your support !!!

Brice

I consider this issue cloed.

jcfr commented 13 years ago

Hi Brice,

As a follow up to our discussion, it should be possible to build CTK with CTK_SUPERBUILD OFF very soon. A published a topic that is been reviewed. See https://github.com/jcfr/CTK/tree/76-support-non-superbuild-build

Note also that Log4Qt won't be a dependency of CTK anymore. See https://github.com/jcfr/CTK/tree/67-remove-log4qt

Since topic "67-remove-log4qt" depends on "76-support-non-superbuild-build", you could try to build the branch based on topic "67-remove-log4qt" and check if it works for you.

Thanks Jc

On Thu, Oct 27, 2011 at 7:57 AM, lambdacrash < reply@reply.github.com>wrote:

I found another way ! I create a tgz of each dependency and in each CMakeExternals/*.cmake, I replace GIT_REPOSITORY by URL=local/path/to/Log4Qt.tgz and GIT_TAG by DOWNLOAD_DIR.

This way is perfect for me because if I decide to update Log4Qt, I just need to create a new tgz and Internet is not required for compilation.

Thanks you for your support !!!

Brice

I consider this issue cloed.

Reply to this email directly or view it on GitHub: https://github.com/commontk/CTK/issues/62#issuecomment-2542507

+1 919 869 8849