# Getting verbose message for cmake

**URL:** https://discourse.cmake.org/t/getting-verbose-message-for-cmake/383
**Category:** Usage
**Created:** [December 14, 2019, 2:16pm UTC](https://discourse.cmake.org/t/getting-verbose-message-for-cmake/383 "2019-12-14T14:16:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mahmoodn](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mahmoodn/32/219_2.png) [@mahmoodn](https://discourse.cmake.org/u/mahmoodn)
#### Post date: [December 14, 2019, 2:16pm UTC](https://discourse.cmake.org/t/getting-verbose-message-for-cmake/383/1 "2019-12-14T14:16:43Z")

</div>

For PyTorch, I get this error

```
-- Could NOT find NCCL (missing: NCCL_INCLUDE_DIR NCCL_LIBRARY)
CMake Warning at third_party/gloo/cmake/Dependencies.cmake:96 (message):
  Not compiling with NCCL support. Suppress this warning with
  -DUSE_NCCL=OFF.
Call Stack (most recent call first):
  third_party/gloo/CMakeLists.txt:56 (include)

```

Part of `third_party/gloo/cmake/Dependencies.cmake` that contains the error is

```
if(USE_CUDA AND USE_NCCL)
  # NCCL_EXTERNAL is set if using the Caffe2 bundled version of NCCL
  if(NCCL_EXTERNAL)
    include_directories(SYSTEM ${NCCL_INCLUDE_DIRS})
    list(APPEND gloo_cuda_DEPENDENCY_LIBS ${NCCL_LIBRARIES} dl rt)
  else()
    find_package(nccl REQUIRED)
    if(NCCL_FOUND)
      include_directories(SYSTEM ${NCCL_INCLUDE_DIRS})
      list(APPEND gloo_cuda_DEPENDENCY_LIBS ${NCCL_LIBRARIES} dl rt)
    else()
      message(WARNING "Not compiling with NCCL support. Suppress this warning with -DUSE_NCCL=OFF.")
      set(USE_NCCL OFF)
    endif()
  endif()
endif()

```

Although, I have set env variables correctly, I would like to get more verbosity when cmake is reading that file. I mean, I want to know what is the value of NCCL\_INCLUDE\_DIRS when cmake is reading that file.

In the terminal, I see nothing wrong.

```
$ echo $NCCL_INCLUDE_DIRS
/opt/nccl-2.4.8/include
$ echo $NCCL_LIBRARIES
/opt/nccl-2.4.8/lib
```

---

<div class="post-metadata">

### Author: ![McMartin](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mcmartin/32/150_2.png) [@McMartin](https://discourse.cmake.org/u/McMartin)
#### Post date: [December 14, 2019, 4:54pm UTC](https://discourse.cmake.org/t/getting-verbose-message-for-cmake/383/2 "2019-12-14T16:54:37Z")

</div>

`NCCL_INCLUDE_DIRS` and `NCCL_LIBRARIES` are result variables of calling `find_package(nccl REQUIRED) `:

> <https://github.com/facebookincubator/gloo/blob/b4feb0e484e344606b810b5971ec8f92d90285e1/cmake/Modules/Findnccl.cmake#L8-L11>

  
They are not inputs, and setting them as environment variables doesn’t change how `Findnccl.cmake` works.

The only environment variable that `Findnccl.cmake` reads is `NCCL_ROOT_DIR`:

> <https://github.com/facebookincubator/gloo/blob/b4feb0e484e344606b810b5971ec8f92d90285e1/cmake/Modules/Findnccl.cmake#L17-L18>

  
So I guess, you should set the environment variable `NCCL_ROOT_DIR` to `/opt/nccl-2.4.8` to get it working.

I hope this helps!
