Open fspiga opened 5 months ago
Would you please try using the .h, .cpp versions here? https://github.com/rheiland/PhysiCell/tree/dev-constants/core
I had someone from Barcelona Supercomputing Center commenting on this, who even submitted a PR to our PhysiBoSS repo. I ended up telling him the PR should be here and closing it (https://github.com/PhysiBoSS/PhysiBoSS/pull/3), but this was his fix: https://github.com/PhysiBoSS/PhysiBoSS/pull/3/commits/eafaa8c9dce61bc4f6ff8eb6b4f18cd9b2887acc
Hello,
I am trying to build using NVIDIA C++ Compiler
nvc++
version 24.5It complains with the following error(s):
I consulted NVIDIA compiler engineer. It looks like the code is not super portable. The file
core/PhysiCell_constants.h
contains many static data members of type const int, such as:Each of those static data members must have an out-of-class definition in a .cpp file somewhere, so that storage for the static data member exists somewhere:
In some cases the compiler can do constant folding and optimize away references to the static data member, in which case the code can get away without the definition. With
-O3
GNU seems to work. With lower optimisation flags, it may complain too.nvc++
is unable to do the constant folding in this particular situation,It would be best if the code becomes more robust, so that
PhysiCell_constants.cpp
contained definitions for all the static data members of classPhysiCell_constants
. That will make the code able to build in more situations and with more compilers with different optimisation levels.