This problem did not happen several weeks ago but it happens now.
I am at a large installation with lots of linux workstations administered centrally. The choice of the administratiors is that all workstations have the as-released version of redhat EL 7 , and many newer versions of softare are then selected in the environment from a shared location.
In this particular case, a new version of GNU compiler collection is selected and a new version of CMAKE is selected using ‘module’ system (which alters environment variables and paths to suit)
When I use module cmake/3.12 and module gcc/9 , the relevant results of ‘which’ are:
When I create a fresh build dir for the ITK (release 5.1) and run cmake, it correctly finds the gcc and g++ ; and the library builds correctly.
I have a project, not all that complex , just to implement a few piplelines I found useful. Using exactly the same enviroment (checked now by using the same login window without changing any environment) if I run cmake or ccmake in a fresh build dir for my project, it finds the system gcc and g++ (4.8 ) and of course the project will not build.
I don’t see what feature in the ITK library enables the build system to find the correct compiler, whereas it does not find it in my project. WHat can I add to my CMakeLists to make this work properly? Since it works when I build the library itself, I don’t think that the environment is wrong …?