# Building Slicer behind a firewall

**URL:** <https://discourse.slicer.org/t/building-slicer-behind-a-firewall/385>\
**Category:** Development\
**Created:** [May 25, 2017, 4:08pm UTC](https://discourse.slicer.org/t/building-slicer-behind-a-firewall/385 "2017-05-25T16:08:13Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 25, 2017, 4:08pm UTC](https://discourse.slicer.org/t/building-slicer-behind-a-firewall/385/1 "2017-05-25T16:08:13Z")

</div>

Hi,  
I am trying to build Slicer from the source. I have a centos 7.3 VM at home, and instructions things worked out well until the point it ran out of space during the superbuild of ITK.  
Right now I am repeating the tasks on my work computer, and I am getting this error at the git svn rebase step:

URL access forbidden for unknown reason: Unable to connect to a repository at URL ‘[http://svn.slicer.org/Slicer4/trunk](http://svn.slicer.org/Slicer4/trunk)’: Access to ‘[http://svn.slicer.org/Slicer4/trunk](http://svn.slicer.org/Slicer4/trunk)’ forbidden at /usr/share/perl5/vendor\_perl/Git/SVN.pm line 717.

which likely related to the proxy and firewall settings at work (didn’t have the issue at home). Is there an alternative way to do this?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 25, 2017, 4:21pm UTC](https://discourse.slicer.org/t/building-slicer-behind-a-firewall/385/2 "2017-05-25T16:21:14Z")

</div>

You can skip the svn steps - those are only needed for people with commit access to svn. I’ll update the wiki to clarify.

If you do want to contribute fixes to the Slicer source tree you can do it with you a github pull request.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 25, 2017, 6:30pm UTC](https://discourse.slicer.org/t/building-slicer-behind-a-firewall/385/3 "2017-05-25T18:30:46Z")

</div>

Thank Steve.

But now I am stuck with this error, which I think is real.  
[40%] Performing download step (git clone) for 'DCMTK’  
Cloning into ‘DCMTK’…  
fatal: repository ‘[http://git.dcmtk.org/dcmtk/](http://git.dcmtk.org/dcmtk/)’ not found  
Cloning into ‘DCMTK’…  
fatal: repository ‘[http://git.dcmtk.org/dcmtk/](http://git.dcmtk.org/dcmtk/)’ not found  
Cloning into ‘DCMTK’…  
fatal: repository ‘[http://git.dcmtk.org/dcmtk/](http://git.dcmtk.org/dcmtk/)’ not found  
– Had to git clone more than once:  
3 times.  
CMake Error at DCMTK-prefix/tmp/DCMTK-gitclone.cmake:56 (message):  
Failed to clone repository: ‘[http://git.dcmtk.org/dcmtk](http://git.dcmtk.org/dcmtk)’

when I type git clone [http://git.dcmtk.org/dcmtk](http://git.dcmtk.org/dcmtk) on command line I get the same repository not found error.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 25, 2017, 6:56pm UTC](https://discourse.slicer.org/t/building-slicer-behind-a-firewall/385/4 "2017-05-25T18:56:02Z")

</div>

So, it has something with using http instead of git. At home, where there is no proxy, it worked with git protocol.  
At work, where I used the Slicer\_USE\_GIT\_PROTOCOL=OFF, it fails.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 25, 2017, 6:57pm UTC](https://discourse.slicer.org/t/building-slicer-behind-a-firewall/385/5 "2017-05-25T18:57:14Z")

</div>

Yes, I was just about to suggest that. Looks like [git.dcmtk.org](http://git.dcmtk.org) only support git protocol and not http.

I don’t use a proxy so I don’t really have a suggestion on that.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 25, 2017, 10:32pm UTC](https://discourse.slicer.org/t/building-slicer-behind-a-firewall/385/6 "2017-05-25T22:32:54Z")

</div>

There was some error with the DCMTK repository (I had a build failure on my computer because of that, too). It got fixed later. If you still have problems then you may use an unofficial mirror on github, for example: [https://github.com/commontk/DCMTK](https://github.com/commontk/DCMTK)

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [May 25, 2017, 11:45pm UTC](https://discourse.slicer.org/t/building-slicer-behind-a-firewall/385/7 "2017-05-25T23:45:06Z")

</div>

> [@lassoan](#):
>
> If you still have problems then you may use an unofficial mirror on github, for example: [GitHub - commontk/DCMTK: WARNING: This is NOT the official upstream DCMTK git repository.](https://github.com/commontk/DCMTK)

Let us know so that we can update the fork. Currently the authoritative source for DCMTK is [git.dcmtk.org/dcmtk](http://git.dcmtk.org/dcmtk)

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 25, 2017, 11:46pm UTC](https://discourse.slicer.org/t/building-slicer-behind-a-firewall/385/8 "2017-05-25T23:46:28Z")

</div>

Thanks Andras, I will try that. I also asked our network folks to open up the git port on the firewall. You never know, they may agree.

I am toggling the USE\_ANTS to on via the ccmake, but after configuring it goes to back to off. How can I enable ANTs support for Slicer?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 26, 2017, 2:29am UTC](https://discourse.slicer.org/t/building-slicer-behind-a-firewall/385/9 "2017-05-26T02:29:07Z")

</div>

Update Slicer\SuperBuild.cmake: change USE\_ANTS:BOOL=OFF to USE\_ANTS:BOOL=ON.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 26, 2017, 6:36am UTC](https://discourse.slicer.org/t/building-slicer-behind-a-firewall/385/10 "2017-05-26T06:36:19Z")

</div>

That change indeed made ccmake to configure and generate with ANTs on, but when I type make, I get the error  
ANTS\_SOURCE\_DIR=’’ does not exist, and build fails.

From the message it is not clear to me whether it is asking the git repo to clone, or asking for existing local installation of ANTs.

As far as I can tell, SuperBuild.cmake does not contain any entry for ANTs repository.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 26, 2017, 11:28am UTC](https://discourse.slicer.org/t/building-slicer-behind-a-firewall/385/11 "2017-05-26T11:28:28Z")

</div>

Probably you have to download Ants and add a CMake variable ANTS\_SOURCE\_DIR:PATH=…

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 26, 2017, 3:15pm UTC](https://discourse.slicer.org/t/building-slicer-behind-a-firewall/385/12 "2017-05-26T15:15:17Z")

</div>

Thanks Andras.  
I was thinking ANTs would become the part of the superbuild and will be downloaded. But it doesn’t matter as I already have the source.  
I am not familiar with CMake variable syntax.  
Would ANTS\_SOURCE\_DIR:PATH=/some/path  
suffice and do I add this to SuperBuild.cmake?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 26, 2017, 3:29pm UTC](https://discourse.slicer.org/t/building-slicer-behind-a-firewall/385/13 "2017-05-26T15:29:33Z")

</div>

For initial testing, you can add ANTS\_SOURCE\_DIR:PATH=/some/path directly into your SuperBuild.cmake (below USE\_ANTS:BOOL=ON).

An alternative to using Ants through BrainsFit is to use it directly, similarly how I’ve added Elastix (similar ITK-based registration framework). See [https://github.com/lassoan/SlicerElastix](https://github.com/lassoan/SlicerElastix) for details. The advantage of this approach is that you don’t need to modify anything in the Slicer core to make it work.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 26, 2017, 3:51pm UTC](https://discourse.slicer.org/t/building-slicer-behind-a-firewall/385/14 "2017-05-26T15:51:28Z")

</div>

Hi Andras,

I have an ANTs specific workflow that I wanted to test within Slicer. I did exactly what you suggested, and this time I got a different error giving the same message ANTs\_LIBRARY\_DIR. While I can try to enter this to superbuid cmake the same way, am not sure what this should point to, because that’s not a variable I needed to set when I I built ANTs.

Also, on a different note, I tested the scissors tool with limits and works wonderfully. Thank you again!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 26, 2017, 3:59pm UTC](https://discourse.slicer.org/t/building-slicer-behind-a-firewall/385/15 "2017-05-26T15:59:10Z")

</div>

> [@muratmaga](#):
>
> I have an ANTs specific workflow that I wanted to test within Slicer.

In that case the easiest is to just write a Python wrapper around your executable - very similar to the [Elastix Python wrapper](https://github.com/lassoan/SlicerElastix/blob/master/Elastix/Elastix.py). You don’t need to make Slicer build ANTs for you.
