Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Errors when compiling tests #40

Closed
ksarma opened this issue May 27, 2016 · 18 comments
Closed

Errors when compiling tests #40

ksarma opened this issue May 27, 2016 · 18 comments

Comments

@ksarma
Copy link

ksarma commented May 27, 2016

Hello,

I'm trying to build SimpleElastix using the SuperBuild, but am running into some problems (compilation errors below). Not sure if the problem is something that I am doing though -- I did enable openCL using the procedure followed by @PertuyF in #4 and had to change the pixel types to unsigned char;char;unsigned short;short;float for 2D, 3D, and 4D in order to make it compile at all with openCL (otherwise the process would crash after eating more than 20G of RAM).

Figured I would post this here in the event it is indeed a bug.

Thanks,
Karthik

/home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/sitkSimpleElastixTests.cxx: In member function ‘virtual void itk::simple::SimpleElastix_ProceduralInterface_Test::TestBody()’:
/home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/sitkSimpleElastixTests.cxx:137:82: error: call of overloaded ‘Elastix(itk::simple::Image&, itk::simple::Image&, const char [12
], bool, bool)’ is ambiguous
EXPECT_NO_THROW( Elastix( fixedImage, movingImage, "translation", false, false ) );
^
/home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/GoogleTest/gtest/gtest.h:7800:44: note: in definition of macro ‘GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_’
if (::testing::internal::AlwaysTrue()) { statement; }
^
/home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/GoogleTest/gtest/gtest.h:18808:3: note: in expansion of macro ‘GTEST_TEST_NO_THROW_’
GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
^
/home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/sitkSimpleElastixTests.cxx:137:3: note: in expansion of macro ‘EXPECT_NO_THROW’
EXPECT_NO_THROW( Elastix( fixedImage, movingImage, "translation", false, false ) );
^
/home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/sitkSimpleElastixTests.cxx:137:82: note: candidates are:
EXPECT_NO_THROW( Elastix( fixedImage, movingImage, "translation", false, false ) );
^
/home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/GoogleTest/gtest/gtest.h:7800:44: note: in definition of macro ‘GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_’
if (::testing::internal::AlwaysTrue()) { statement; }
^
/home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/GoogleTest/gtest/gtest.h:18808:3: note: in expansion of macro ‘GTEST_TEST_NO_THROW_’
GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
^
/home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/sitkSimpleElastixTests.cxx:137:3: note: in expansion of macro ‘EXPECT_NO_THROW’
EXPECT_NO_THROW( Elastix( fixedImage, movingImage, "translation", false, false ) );
^
In file included from /home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/sitkSimpleElastixTests.cxx:3:0:
/home/ksarma/Documents/Utilities/SimpleElastix/Code/Elastix/include/sitkSimpleElastix.h:184:25: note: itk::simple::Image itk::simple::Elastix(const itk::simple::Image&, const itk::simple::Image&, bool, bool, std::string)
SITKCommon_EXPORT Image Elastix( const Image& fixedImage, const Image& movingImage, const bool logToConsole = false, const bool logToFile = false, const std::string outputDirectory = "." );
^
/home/ksarma/Documents/Utilities/SimpleElastix/Code/Elastix/include/sitkSimpleElastix.h:186:25: note: itk::simple::Image itk::simple::Elastix(const itk::simple::Image&, const itk::simple::Image&, std::string, bool, bool, std::string)
SITKCommon_EXPORT Image Elastix( const Image& fixedImage, const Image& movingImage, const std::string defaultParameterMapName, const bool logToConsole = false, const bool logToFile = false, const std::string outputDirectory = "." );
^
In file included from /home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/SimpleITKTestHarness.h:45:0,
from /home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/sitkSimpleElastixTests.cxx:1:
/home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/sitkSimpleElastixTests.cxx:139:81: error: call of overloaded ‘Elastix(itk::simple::Image&, itk::simple::Image&, const char [12], bool, bool)’ is ambiguous
EXPECT_NO_THROW( Elastix( fixedImage, movingImage, "translation", true, false ) );
^
/home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/GoogleTest/gtest/gtest.h:7800:44: note: in definition of macro ‘GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_’
if (::testing::internal::AlwaysTrue()) { statement; }
^
/home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/GoogleTest/gtest/gtest.h:18808:3: note: in expansion of macro ‘GTEST_TEST_NO_THROW_’
GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
^
/home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/sitkSimpleElastixTests.cxx:139:3: note: in expansion of macro ‘EXPECT_NO_THROW’
EXPECT_NO_THROW( Elastix( fixedImage, movingImage, "translation", true, false ) );
^
/home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/sitkSimpleElastixTests.cxx:139:81: note: candidates are:
EXPECT_NO_THROW( Elastix( fixedImage, movingImage, "translation", true, false ) );
^
/home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/GoogleTest/gtest/gtest.h:7800:44: note: in definition of macro ‘GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_’
if (::testing::internal::AlwaysTrue()) { statement; }
^
/home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/GoogleTest/gtest/gtest.h:18808:3: note: in expansion of macro ‘GTEST_TEST_NO_THROW_’
GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
^
/home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/sitkSimpleElastixTests.cxx:139:3: note: in expansion of macro ‘EXPECT_NO_THROW’
EXPECT_NO_THROW( Elastix( fixedImage, movingImage, "translation", true, false ) );
^
In file included from /home/ksarma/Documents/Utilities/SimpleElastix/Testing/Unit/sitkSimpleElastixTests.cxx:3:0:
/home/ksarma/Documents/Utilities/SimpleElastix/Code/Elastix/include/sitkSimpleElastix.h:184:25: note: itk::simple::Image itk::simple::Elastix(const itk::simple::Image&, const itk::simple::Image&, bool, bool, std::string)
SITKCommon_EXPORT Image Elastix( const Image& fixedImage, const Image& movingImage, const bool logToConsole = false, const bool logToFile = false, const std::string outputDirectory = "." );
^
/home/ksarma/Documents/Utilities/SimpleElastix/Code/Elastix/include/sitkSimpleElastix.h:186:25: note: itk::simple::Image itk::simple::Elastix(const itk::simple::Image&, const itk::simple::Image&, std::string, bool, bool, std::string)
SITKCommon_EXPORT Image Elastix( const Image& fixedImage, const Image& movingImage, const std::string defaultParameterMapName, const bool logToConsole = false, const bool logToFile = false, const std::string outputDirectory = "." );
^
Testing/Unit/CMakeFiles/SimpleITKUnitTestDriver0.dir/build.make:422: recipe for target 'Testing/Unit/CMakeFiles/SimpleITKUnitTestDriver0.dir/sitkSimpleElastixTests.cxx.o' failed
make[5]: *** [Testing/Unit/CMakeFiles/SimpleITKUnitTestDriver0.dir/sitkSimpleElastixTests.cxx.o] Error 1
CMakeFiles/Makefile2:2866: recipe for target 'Testing/Unit/CMakeFiles/SimpleITKUnitTestDriver0.dir/all' failed
make[4]: *** [Testing/Unit/CMakeFiles/SimpleITKUnitTestDriver0.dir/all] Error 2
Makefile:146: recipe for target 'all' failed
make[3]: *** [all] Error 2
CMakeFiles/SimpleITK.dir/build.make:113: recipe for target 'SimpleITK-prefix/src/SimpleITK-stamp/SimpleITK-build' failed
make[2]: *** [SimpleITK-prefix/src/SimpleITK-stamp/SimpleITK-build] Error 2
CMakeFiles/Makefile2:132: recipe for target 'CMakeFiles/SimpleITK.dir/all' failed
make[1]: *** [CMakeFiles/SimpleITK.dir/all] Error 2
Makefile:75: recipe for target 'all' failed
make: *** [all] Error 2

@kaspermarstal
Copy link
Member

Hi ksarma, do a git pull and try again. Let me know how it goes!

@kaspermarstal kaspermarstal reopened this May 27, 2016
@ksarma
Copy link
Author

ksarma commented May 27, 2016

Thanks for your help @kaspermarstal !

It compiles now and I am able to run the tests -- unfortunately some of them are failing. Not sure if this is expected or if it is a continuation of the previous issue, so I'll paste them in for your evaluation

99% tests passed, 25 tests failed out of 2137

Total Test time (real) = 1820.68 sec

The following tests FAILED:
1969 - ElastixFilterTest.BSpline3D (Failed)
1970 - ElastixFilterTest.BSpline4D (Failed)
1971 - ElastixFilterTest.BSplineWithFixedMask2D (Failed)
1972 - ElastixFilterTest.DefaultParameterObject2D (Failed)
1973 - ElastixFilterTest.InitialTransformTestEuler2D (SEGFAULT)
1975 - ElastixFilterTest.InverseTransformTestEuler2D (SEGFAULT)
1976 - ElastixFilterTest.SameFixedImageForMultipleRegistrations (Failed)
1977 - ElastixFilterTest.TranslationWithPointSets2D (Failed)
1978 - ElastixFilterTest.UpdateOnDownstreamUpdate (Failed)
1979 - ElastixFilterTest.UpdateOnGetTransformParametersEuler2D (SEGFAULT)
2051 - SimpleElastix.InverseTransform (Failed)
2056 - SimpleElastix.Registration3D (Failed)
2057 - SimpleElastix.Registration4D (Failed)
2060 - SimpleTransformix.ObjectOrientedInterface (Failed)
2061 - SimpleTransformix.ProceduralInterface (Failed)
2062 - SimpleTransformix.Transformation4D (Failed)
2102 - TransformixFilterTest.BSpline4D (Failed)
2103 - TransformixFilterTest.ComputeDeformationField (Failed)
2104 - TransformixFilterTest.ComputeDeterminantOfSpatialJacobian (Failed)
2105 - TransformixFilterTest.ComputeSpatialJacobian (Failed)
2106 - TransformixFilterTest.GetInputImageFromElastixFilter (Failed)
2108 - TransformixFilterTest.SameTransformParameterMapForMultipleTransformations (Failed)
2109 - TransformixFilterTest.TransformPointSet (Failed)
2110 - TransformixFilterTest.UpdateOnDownstreamUpdate (Failed)
2111 - TransformixFilterTest.UpdateOnGetTransformParameterObject (SEGFAULT)
Errors while running CTest
Makefile:116: recipe for target 'test' failed
make: *** [test] Error 8

@kaspermarstal
Copy link
Member

Thank you for the bug report. The tests had not been updated in response to internal code changes. The tests have now been updated. Unfortunately not all of the tests that fails on your system, fails on my system. Can you git pull and rerun the test suite and check if you still see failures?

@ksarma
Copy link
Author

ksarma commented May 30, 2016

Thanks again for your help @kaspermarstal!

Alas, it doesn't seem to build anymore. I did fully delete the build directory and attempt to rebuild from scratch (with my modifications to enable openCL and remove some of the pixel types).

The error output is quite long so I made a log of a make attempt with the error and have attached it.

makelog.txt

@kaspermarstal
Copy link
Member

Sorry a lot of changes happening at the moment. Git pull and try again :)

@ksarma
Copy link
Author

ksarma commented May 30, 2016

Alas, new errors -- I didn't do a clean and build this time, though, which I am doing now. Error log attached

edit: oops, wrong log
makelog.txt

@ksarma
Copy link
Author

ksarma commented May 30, 2016

It now builds, but still have almost all the errors. Could some of them be because I don't have all the pixel types enabled?

99% tests passed, 24 tests failed out of 2137

Total Test time (real) = 1823.06 sec

The following tests FAILED:
1969 - ElastixFilterTest.BSpline3D (Failed)
1970 - ElastixFilterTest.BSpline4D (Failed)
1971 - ElastixFilterTest.BSplineWithFixedMask2D (Failed)
1972 - ElastixFilterTest.DefaultParameterObject2D (Failed)
1973 - ElastixFilterTest.InitialTransformTestEuler2D (SEGFAULT)
1975 - ElastixFilterTest.InverseTransformTestEuler2D (SEGFAULT)
1976 - ElastixFilterTest.SameFixedImageForMultipleRegistrations (Failed)
1977 - ElastixFilterTest.TranslationWithPointSets2D (Failed)
1978 - ElastixFilterTest.UpdateOnDownstreamUpdate (Failed)
1979 - ElastixFilterTest.UpdateOnGetTransformParametersEuler2D (Failed)
2056 - SimpleElastix.Registration3D (Failed)
2057 - SimpleElastix.Registration4D (Failed)
2060 - SimpleTransformix.ObjectOrientedInterface (Failed)
2061 - SimpleTransformix.ProceduralInterface (Failed)
2062 - SimpleTransformix.Transformation4D (Failed)
2102 - TransformixFilterTest.BSpline4D (Failed)
2103 - TransformixFilterTest.ComputeDeformationField (Failed)
2104 - TransformixFilterTest.ComputeDeterminantOfSpatialJacobian (Failed)
2105 - TransformixFilterTest.ComputeSpatialJacobian (Failed)
2106 - TransformixFilterTest.GetInputImageFromElastixFilter (Failed)
2108 - TransformixFilterTest.SameTransformParameterMapForMultipleTransformations (Failed)
2109 - TransformixFilterTest.TransformPointSet (Failed)
2110 - TransformixFilterTest.UpdateOnDownstreamUpdate (Failed)
2111 - TransformixFilterTest.UpdateOnGetTransformParameterObject (Failed)

@ksarma
Copy link
Author

ksarma commented May 31, 2016

Using a different machine without openCL enabled or the pixel types changed (but with -DUSE_KNNGraphAlphaMutualInformationMetric:BOOL=ON rather than OFF which it is stock), I get a different and much smaller set of errors:

99% tests passed, 3 tests failed out of 2137

Total Test time (real) = 3755.63 sec

The following tests FAILED:
566 - Ruby.LevelSetMotionRegistrationFilter (Failed)
1979 - ElastixFilterTest.UpdateOnGetTransformParametersEuler2D (Failed)
2111 - TransformixFilterTest.UpdateOnGetTransformParameterObject (Failed)
Errors while running CTest
make: *** [test] Error 8

@kaspermarstal
Copy link
Member

kaspermarstal commented May 31, 2016

You are absolutely correct, Elastix needs to be compiled with the pixel types used in the tests. As for the remaining tests, can you run

$ ./SimpleITKUnitTestDriver0 --gtest_filter=ElastixFilterTest.UpdateOnGetTransformParametersEuler2D
$ ./SimpleITKUnitTestDriver0 --gtest_filter=TransformixFilterTest.UpdateOnGetTransformParameterObject

in the SimpleITK-build/bin directory and post the output?

@ksarma
Copy link
Author

ksarma commented May 31, 2016

$ ./SimpleITKUnitTestDriver0 --gtest_filter=ElastixFilterTest.UpdateOnGetTransformParametersEuler2D
Note: Google Test filter = ElastixFilterTest.UpdateOnGetTransformParametersEuler2D
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from ElastixFilterTest
[ RUN ] ElastixFilterTest.UpdateOnGetTransformParametersEuler2D
/home/ksarma/Utilities/SimpleElastix/Testing/Unit/sitkElastixFilterTests.cxx:97: Failure
Expected: transformParameters = elastixFilter->GetTransformParameterObject() throws an exception of type itk::ExceptionObject.
Actual: it throws nothing.
[ FAILED ] ElastixFilterTest.UpdateOnGetTransformParametersEuler2D (0 ms)
[----------] 1 test from ElastixFilterTest (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (1 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] ElastixFilterTest.UpdateOnGetTransformParametersEuler2D

1 FAILED TEST

$ ./SimpleITKUnitTestDriver0 --gtest_filter=TransformixFilterTest.UpdateOnGetTransformParameterObject
Note: Google Test filter = TransformixFilterTest.UpdateOnGetTransformParameterObject
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from TransformixFilterTest
[ RUN ] TransformixFilterTest.UpdateOnGetTransformParameterObject
/home/ksarma/Utilities/SimpleElastix/Testing/Unit/sitkTransformixFilterTests.cxx:109: Failure
Expected: transformixFilter->SetTransformParameterObject( elastixFilter->GetTransformParameterObject() ) throws an exception of type itk::ExceptionObject.
Actual: it throws nothing.
[ FAILED ] TransformixFilterTest.UpdateOnGetTransformParameterObject (1 ms)
[----------] 1 test from TransformixFilterTest (1 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (1 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] TransformixFilterTest.UpdateOnGetTransformParameterObject

1 FAILED TEST

@kaspermarstal
Copy link
Member

Ah. Don't worry about these tests, they are concerned with deprecated functionality and have now been removed.

@ksarma
Copy link
Author

ksarma commented Jun 1, 2016

Sounds good. Thanks again for all of your help! FYI, I compiled a vanilla version with only -DUSE_KNNGraphAlphaMutualInformationMetric:BOOL=ON (rather than the default off) on the original machine and confirmed that only those two tests fail.

By the way, is there a reason that that one is default off? Does it not work properly in SimpleElastix?

@ksarma
Copy link
Author

ksarma commented Jun 1, 2016

One last confirmation - was able to compile with openCL enabled and all default pixel types and still only those two tests fail. So, seems likely it was a pixel type issue for the others

(PS: running make -j1 still had a peak memory usage of over 80GB for the build with openCL enabled!)

@kaspermarstal
Copy link
Member

Due some license restrictions, some of the functionality of the KNNGraphAlphaMutualInformationMetric is compiled into a library separate from elastix and transformix. This causes linking issues on some systems, which is why it is OFF by default.

Wow, 80Gb? You must have a mean machine!

@ksarma
Copy link
Author

ksarma commented Jun 5, 2016

Hmm, ok, thanks! Is there something I need to do other than set -DUSE_KNNGraphAlphaMutualInformationMetric:BOOL=ON to get it to build on linux (or is that the platform it doesn't work on?)

I did try just doing that, but I still get a "this component is not installed" error

@kaspermarstal
Copy link
Member

No that should be it. Did you spell it correctly? It should be "KNNGraphAlphaMutualInformation"

@ksarma
Copy link
Author

ksarma commented Jun 7, 2016

Ha, you're right, I had it specified wrong. It now all seems to be working. Thanks again for all of your help (and of course for your effort to make such a useful package!) @kaspermarstal !

@kaspermarstal
Copy link
Member

No problem! Hope you will find it useful 😊

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants