Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
XelaleX1 opened this issue Oct 27, 2021 · 1 comment
Open

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

XelaleX1 opened this issue Oct 27, 2021 · 1 comment

Comments

@XelaleX1
Copy link

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?

@zyzhang827
Copy link

zyzhang827 commented Jan 16, 2022

Hello,

Have you solved your problem?

I have the same problem,and I make the following changes to run the make text.x command

// Query for the rate calculator.
const RateCalculator  rc = interactions.rateCalculator();
// CPPUNIT_ASSERT( &rc != NULL );

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

No branches or pull requests

2 participants