Closed SlicerMorph closed 2 years ago
I've seen this type of thing before - try reading
https://stackoverflow.com/questions/1616983/building-r-packages-using-alternate-gcc
I'm not sure what the R-correct thing is to do here but making sure that R and global (or really cmake) evironment definitions of CC, CXX etc are consistent. this might be achievable through global environment variables but you may also need to check other places.
here is an example of a file I used at some point long ago:
cat ~/.R/Makevars
CXX = /usr/local/Cellar/gcc/9.1.0/bin/g++-9
CXXSTD = -std=c++11
CXXFLAGS = -fsanitize=undefined,address -fno-omit-frame-pointer
CXX98 = /usr/local/Cellar/gcc/9.1.0/bin/g++-9
CXX98STD = -std=c++98
CXX11 = /usr/local/Cellar/gcc/9.1.0/bin/g++-9
CXX11STD = -std=c++11
CXX14 = /usr/local/Cellar/gcc/9.1.0/bin/g++-9
CXX14STD = -std=c++14
I will try those when I am at work, but I will counter the argument this happening at the ./configure (bash level), not in R. (I am simply running those ./configure scripts locally in bash to see the output). Are those scripts searching for the CC/GCC variables differently between ITKR and ANTsRCore then? Because those outputs are from the same bash session ITKR/configure detects the correct toolchain but not ANTsRCore/configure
maybe - let us know what you find out.
so cmake and R are consistent .... your system - by definition of the issue - is defining these differently.
* both the R variables and the environment variables should match
so cmake and R are consistent .... your system - by definition of the issue - is defining these differently.
There was no explicit CC variable declared in the bash environment. export CC=/cm/shared/apps/gcc/9.3.0/bin/gcc made the ANTsRCore./configure script detect that, and I am now running the R CMD INSTALL to see if still encounter the undefined symbol error (which I suspect I wont).
However, all I can say that lack of CC variable was not an issue for ITKR in finding the correct toolchain. So it might be worthwhile to make them similar.
I think that's an issue on your end. we can't know ahead of time what CC variables you want. maybe someone else has an idea of what to do but otherwise this is a fix on your end kind of issue.
On Centos 7.2 base compiler toolkit is too old (4.8.5.) We use modules functionality to activate gcc/9.3.0 and R/4.1.1. When I git clone ITKR and ANTsRCore to build the package from source, I can see that the ./configure in ITKR detects the correct build environment provided by the modules functionality, but not the ANTsRCore. As a consequence of not using the identical toolchain, ANTsRCore build, but fails to install with incorrect Symbol error. See truncated output from the same command line session:
How can I fix this?