Skip to content

Compilation Error for make test.x on Ubuntu 18.04 #26

@AlessandroUniSa1

Description

@AlessandroUniSa1

Hi,
I have tried to compile the module on Ubuntu 18.04, using gcc, g++ and mpicxx. All seems to be fine, until I try to run the test.

Indeed, by typing make test.x in the c++/build directory, I get the following error:

/home/xelad/KMCLib-2.0-a1/c++/unittest/test_interactions.cpp:146:25: error: the compiler can assume that the address of 'rc' will never be NULL [-Werror=address] CPPUNIT_ASSERT( &rc != NULL ); ^ /home/xelad/KMCLib-2.0-a1/c++/externals/include/cppunit/TestAssert.h:131:37: note: in definition of macro 'CPPUNIT_ASSERT' ( CPPUNIT_NS::Asserter::failIf( !(condition), \ ^~~~~~~~~ cc1plus: all warnings being treated as errors unittest/CMakeFiles/unittest.dir/build.make:185: recipe for target 'unittest/CMakeFiles/unittest.dir/test_interactions.cpp.o' failed make[3]: *** [unittest/CMakeFiles/unittest.dir/test_interactions.cpp.o] Error 1 make[3]: Leaving directory '/home/xelad/KMCLib-2.0-a1/c++/build' CMakeFiles/Makefile2:233: recipe for target 'unittest/CMakeFiles/unittest.dir/all' failed make[2]: *** [unittest/CMakeFiles/unittest.dir/all] Error 2 make[2]: Leaving directory '/home/xelad/KMCLib-2.0-a1/c++/build' CMakeFiles/Makefile2:208: recipe for target 'unittest/CMakeFiles/test.x.dir/rule' failed make[1]: *** [unittest/CMakeFiles/test.x.dir/rule] Error 2 make[1]: Leaving directory '/home/xelad/KMCLib-2.0-a1/c++/build' Makefile:193: recipe for target 'test.x' failed make: *** [test.x] Error 2

I have read the known issue and I have found that you suggested to comment the line "CPPUNIT_ASSERT( &rc != NULL );"

However, by doing that, I got another error:

/home/xelad/KMCLib-2.0-a1/c++/unittest/test_interactions.cpp:145:28: error: unused variable 'rc' [-Werror=unused-variable] const RateCalculator & rc = interactions.rateCalculator(); ^~ cc1plus: all warnings being treated as errors unittest/CMakeFiles/unittest.dir/build.make:185: recipe for target 'unittest/CMakeFiles/unittest.dir/test_interactions.cpp.o' failed make[3]: *** [unittest/CMakeFiles/unittest.dir/test_interactions.cpp.o] Error 1 make[3]: Leaving directory '/home/xelad/KMCLib-2.0-a1/c++/build' CMakeFiles/Makefile2:233: recipe for target 'unittest/CMakeFiles/unittest.dir/all' failed make[2]: *** [unittest/CMakeFiles/unittest.dir/all] Error 2 make[2]: Leaving directory '/home/xelad/KMCLib-2.0-a1/c++/build' CMakeFiles/Makefile2:208: recipe for target 'unittest/CMakeFiles/test.x.dir/rule' failed make[1]: *** [unittest/CMakeFiles/test.x.dir/rule] Error 2 make[1]: Leaving directory '/home/xelad/KMCLib-2.0-a1/c++/build' Makefile:193: recipe for target 'test.x' failed make: *** [test.x] Error 2

Can you please suggest me how to solve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions