4

I'm attempting to compile a program using cmake that gives me the following error(s):

CMake Error at /.../3dg.cmake:8 (enable_language):
The CMAKE_CXX_COMPILER:

CC

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.
Call Stack (most recent call first):
CMakeLists.txt:8 (include)

CMake Error at /.../3dg.cmake:8 (enable_language): The CMAKE_C_COMPILER:

cc

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

I am setting both of these variables in my cmake file with:

set(CMAKE_C_COMPILER cc)
set(CMAKE_CXX_COMPILER CC)

Moreover, I can confirm that both of them are in my path and at the correct location.

>>which cc
/opt/cray/pe/craype/2.5.14/bin/cc
>>which CC
/opt/cray/pe/craype/2.5.14/bin/CC

And my path includes this directory!

>>echo $PATH
/opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/bin:/opt/cray/alps/6.6.43-6.0.7.0_26.4__ga796da3.ari/sbin:/opt/cray/job/2.2.3-6.0.7.0_44.1__g6c4e934.ari/bin:/opt/cray/pe/hdf5/1.10.0.3/bin:/opt/cray/pe/craype/2.5.14/bin:/opt/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/usr/common/software/metis/5.1.0/bin:/usr/common/software/darshan/3.1.4/bin:/usr/common/software/altd/2.0/bin:/usr/common/software/bin:/usr/common/mss/bin:/usr/common/nsg/bin:/opt/cray/pe/mpt/7.7.0/gni/bin:/opt/ovis/bin:/opt/ovis/sbin:/usr/syscom/nsg/sbin:/usr/syscom/nsg/bin:/opt/cray/pe/modules/3.2.10.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin:/opt/cray/pe/bin:

The cmake file sees the same path as the terminal. I have confirmed that this error goes away if I change my cmake code to:

set(CMAKE_C_COMPILER /opt/cray/pe/craype/2.5.14/bin/cc)
set(CMAKE_CXX_COMPILER /opt/cray/pe/craype/2.5.14/bin/CC)

But this is not a long term fix as the actual location of cc/CC depends on which modules I am using and the updated version of the compilers.

Does anyone know what is going on, and how to force cmake to recognize that these compilers are located in the correct location? Thanks.

NoseKnowsAll
  • 4,593
  • 2
  • 23
  • 44

1 Answers1

0

Go to download page of glfw and download their source package. Now unzip it and enter into the directory.

Now generate the make file with sudo cmake -G "Unix Makefiles". Now do sudo make and sudo cmake. The install process should be complete. For more info take a look at here

Nafi Shahriyar
  • 123
  • 1
  • 9