# missing VTKData

**URL:** <https://discourse.vtk.org/t/missing-vtkdata/1945>\
**Category:** Development\
**Created:** [October 18, 2019, 5:09am UTC](https://discourse.vtk.org/t/missing-vtkdata/1945 "2019-10-18T05:09:24Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)\
**Post date:** [October 18, 2019, 5:09am UTC](https://discourse.vtk.org/t/missing-vtkdata/1945/1 "2019-10-18T05:09:24Z")

</div>

Is there an environment variable which needs to be set, so that when the tests are run they find data in  
`./ExternalData/Testing/Data?`  
Or is it set in CMake?

Thanks.

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)\
**Post date:** [October 18, 2019, 5:21am UTC](https://discourse.vtk.org/t/missing-vtkdata/1945/2 "2019-10-18T05:21:19Z")

</div>

Use the Utilities/SetupForDeveloppement.sh scripts, it will set it up for you.

But it should work out of the box when activating testing.

---

<div class="post-metadata">

**Author:** ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)\
**Post date:** [October 18, 2019, 6:42am UTC](https://discourse.vtk.org/t/missing-vtkdata/1945/3 "2019-10-18T06:42:12Z")

</div>

Well I ran the scripts and set up a path for VTK data store, but there are no files in it. What next?

The only noticeable thing it did was to clone some files into  
`VTK-8/ThirdParty/vtkm/vtkvtkm/vtk-m`

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)\
**Post date:** [October 18, 2019, 6:58am UTC](https://discourse.vtk.org/t/missing-vtkdata/1945/4 "2019-10-18T06:58:22Z")

</div>

Did you enabled BUILD\_TESTING ? Did you configured and built VTK ?

---

<div class="post-metadata">

**Author:** ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)\
**Post date:** [October 18, 2019, 6:58am UTC](https://discourse.vtk.org/t/missing-vtkdata/1945/5 "2019-10-18T06:58:50Z")

</div>

Yes to all. I am using Windows 10.

---

<div class="post-metadata">

**Author:** ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)\
**Post date:** [October 18, 2019, 7:23am UTC](https://discourse.vtk.org/t/missing-vtkdata/1945/6 "2019-10-18T07:23:06Z")

</div>

I should say that the data does appear to be in  
`.\ExternalData\Testing\Data`  
but the tests look in  
`../../../../VTKData/Data`

So I’m wondering where this folder information is coming from.

---

<div class="post-metadata">

**Author:** ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)\
**Post date:** [October 18, 2019, 11:28pm UTC](https://discourse.vtk.org/t/missing-vtkdata/1945/7 "2019-10-18T23:28:00Z")

</div>

It seems the problem arises here

```
inline
char* vtkTestUtilities::GetDataRoot(int argc, char* argv[])
{
  return vtkTestUtilities::GetArgOrEnvOrDefault(
    "-D", argc, argv,
    "VTK_DATA_ROOT",
    "../../../../VTKData");
}

inline
char* vtkTestUtilities::ExpandDataFileName(int argc, char* argv[],
                                           const char* fname,
                                           int slash)
{
  return vtkTestUtilities::ExpandFileNameWithArgOrEnvOrDefault(
    "-D", argc, argv,
    "VTK_DATA_ROOT",
    "../../../../VTKData",
    fname,
    slash);
}

```

I either have to pass the data folder as a command line option with -D or setup an environment variable for **VTK\_DATA\_ROOT**. So the most generic solution seems to be setting  
`VTK_DATA_ROOT = "../../../../ExternalData/Testing"`

I don’t see how any of this relates to the cmake **VTK\_DATA\_STORE** variable.

---

<div class="post-metadata">

**Author:** ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)\
**Post date:** [October 21, 2019, 12:02am UTC](https://discourse.vtk.org/t/missing-vtkdata/1945/8 "2019-10-21T00:02:48Z")

</div>

This is further complicated by the issue that, when running the tests inside Visual Studio, the _current working directory_ is not the **root** build folder,  
`C:\build_VTK`  
or the **bin** folder  
`C:\build_VTK\bin\debug`  
but rather the test **project** folder  
`C:\build_VTK\Common\Core\Testing\Cxx`

So it would appear that setting the data and testing directories explicitly using -D and -T options for each test project in Visual Studio via Cmake would be the best option i.e.

> -D …/…/…/…/ExternalData/Testing  
> -T …/…/…/…/Testing/Temporary

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)\
**Post date:** [October 21, 2019, 3:45am UTC](https://discourse.vtk.org/t/missing-vtkdata/1945/9 "2019-10-21T03:45:07Z")

</div>

@ben.boeckel may know more.

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)\
**Post date:** [October 21, 2019, 1:45pm UTC](https://discourse.vtk.org/t/missing-vtkdata/1945/10 "2019-10-21T13:45:27Z")

</div>

This works just fine for any Windows builds I’ve done recently and for our buildbots. Could you show how you configured VTK? Is this from a Git repository or a release tarball?

---

<div class="post-metadata">

**Author:** ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)\
**Post date:** [October 21, 2019, 9:15pm UTC](https://discourse.vtk.org/t/missing-vtkdata/1945/11 "2019-10-21T21:15:19Z")

</div>

I build from my own fork of VTK on gitlab. The master branch on the fork is synchronised with (identical to) Kitware’s master branch. I use cmake-gui for the configuration and it is completely standard.

 ![image](https://discourse.vtk.org/uploads/default/original/1X/39c5975bdcaba126bedb2b6260dd683076148c6d.png)

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)\
**Post date:** [October 22, 2019, 1:28pm UTC](https://discourse.vtk.org/t/missing-vtkdata/1945/12 "2019-10-22T13:28:14Z")

</div>

Data management for testing should Just Work in that case. How are you declaring your tests?

---

<div class="post-metadata">

**Author:** ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)\
**Post date:** [October 26, 2019, 11:55pm UTC](https://discourse.vtk.org/t/missing-vtkdata/1945/13 "2019-10-26T23:55:34Z")

</div>

I just build the RUN\_TESTS project in Visual Studio

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)\
**Post date:** [October 28, 2019, 1:36pm UTC](https://discourse.vtk.org/t/missing-vtkdata/1945/14 "2019-10-28T13:36:04Z")

</div>

Did you at least build the `VTKData` target first or just the relevant test binary?

---

<div class="post-metadata">

**Author:** ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)\
**Post date:** [October 28, 2019, 10:01pm UTC](https://discourse.vtk.org/t/missing-vtkdata/1945/15 "2019-10-28T22:01:22Z")

</div>

Yes. I built the VTKData binary and I have rebuilt it since I updated VTKDataStore. Since I set up the environment variables for VTK\_DATA\_ROOT and VTK\_TEMP\_DIR the tests are all working, but I thought they should just work out of the box. Previously some tests certainly did not.

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)\
**Post date:** [October 29, 2019, 1:11pm UTC](https://discourse.vtk.org/t/missing-vtkdata/1945/16 "2019-10-29T13:11:41Z")

</div>

AFAIK, it does work out-of-the-box. Granted, Visual Studio is not likely widely tested, but I can’t think of a reason off-hand why it’d be different in VS. I’ll try and test this week.

---

<div class="post-metadata">

**Author:** ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)\
**Post date:** [November 7, 2019, 1:40am UTC](https://discourse.vtk.org/t/missing-vtkdata/1945/17 "2019-11-07T01:40:32Z")

</div>

@ben.boeckel  
I’ve tried running existing tests on the command line using the \*CxxTests executable, but anything that is passed data from CMakeLists receives no args in main() and the tests fail. Am I missing a configuration step?

If I cannot get existing tests to run I cannot add a test to [https://gitlab.kitware.com/vtk/vtk/merge\_requests/6122](https://gitlab.kitware.com/vtk/vtk/merge_requests/6122)
