# issues of compiling v5.8.0 on nersc cori by cc and CC

**URL:** https://discourse.paraview.org/t/issues-of-compiling-v5-8-0-on-nersc-cori-by-cc-and-cc/5278
**Category:** ParaView Support
**Created:** [September 6, 2020, 9:45am UTC](https://discourse.paraview.org/t/issues-of-compiling-v5-8-0-on-nersc-cori-by-cc-and-cc/5278 "2020-09-06T09:45:43Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![zhe](https://discourse.paraview.org/user_avatar/discourse.paraview.org/zhe/32/2196_2.png) [@zhe](https://discourse.paraview.org/u/zhe)
#### Post date: [September 6, 2020, 9:45am UTC](https://discourse.paraview.org/t/issues-of-compiling-v5-8-0-on-nersc-cori-by-cc-and-cc/5278/1 "2020-09-06T09:45:43Z")

</div>

Hello, I got following issues when compiling the v5.8.0 on nersc cori cluster:

```
$ cmake ~/cworkspace/src/ParaView/ -DPARAVIEW_USE_QT=OFF -DPARAVIEW_USE_PYTHON=ON -DPARAVIEW_USE_MPI=ON -DVTK_OPENGL_HAS_OSMESA:BOOL=TRUE -DVTK_USE_X:BOOL=FALSE -DCMAKE_CXX_COMPILER=CC -DCMAKE_C_COMPILER=cc -DMPI_C_COMPILER=cc -DMPI_CXX_COMPILER=CC
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Cray Programming Environment 2.6.2 C
-- Check for working C compiler: /opt/cray/pe/craype/2.6.2/bin/cc
-- Check for working C compiler: /opt/cray/pe/craype/2.6.2/bin/cc -- broken
CMake Error at /global/common/sw/cray/cnl7/haswell/cmake/3.14.4/gcc/8.2.0/2hef55n/share/cmake-3.14/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "/opt/cray/pe/craype/2.6.2/bin/cc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /global/cscratch1/sd/zw241/build_paraview_v580/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/gmake cmTC_4d32f/fast 
    /usr/bin/gmake -f CMakeFiles/cmTC_4d32f.dir/build.make CMakeFiles/cmTC_4d32f.dir/build
    gmake[1]: Entering directory '/global/cscratch1/sd/zw241/build_paraview_v580/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_4d32f.dir/testCCompiler.c.o
    /opt/cray/pe/craype/2.6.2/bin/cc -o CMakeFiles/cmTC_4d32f.dir/testCCompiler.c.o -c /global/cscratch1/sd/zw241/build_paraview_v580/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_4d32f
    /global/common/sw/cray/cnl7/haswell/cmake/3.14.4/gcc/8.2.0/2hef55n/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4d32f.dir/link.txt --verbose=1
    /opt/cray/pe/craype/2.6.2/bin/cc CMakeFiles/cmTC_4d32f.dir/testCCompiler.c.o -o cmTC_4d32f 
    /opt/gcc/8.3.0/snos/lib/gcc/x86_64-suse-linux/8.3.0/crtbegin.o: in function `deregister_tm_clones':
    crtstuff.c:(.text+0x7): relocation truncated to fit: R_X86_64_32S against `.tm_clone_table'
    /opt/gcc/8.3.0/snos/lib/gcc/x86_64-suse-linux/8.3.0/crtbegin.o: in function `register_tm_clones':
    crtstuff.c:(.text+0x38): relocation truncated to fit: R_X86_64_32S against `.tm_clone_table'
    collect2: error: ld returned 1 exit status
    gmake[1]: *** [CMakeFiles/cmTC_4d32f.dir/build.make:87: cmTC_4d32f] Error 1
    gmake[1]: Leaving directory '/global/cscratch1/sd/zw241/build_paraview_v580/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:121: cmTC_4d32f/fast] Error 2
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:32 (project)

-- Configuring incomplete, errors occurred!
See also "/global/cscratch1/sd/zw241/build_paraview_v580/CMakeFiles/CMakeOutput.log".
See also "/global/cscratch1/sd/zw241/build_paraview_v580/CMakeFiles/CMakeError.log".

```

But it is ok to compile when I use following commands:

`cmake ~/cworkspace/src/ParaView/ -DPARAVIEW_USE_QT=OFF -DPARAVIEW_USE_PYTHON=ON -DPARAVIEW_USE_MPI=ON -DVTK_OPENGL_HAS_OSMESA:BOOL=TRUE -DVTK_USE_X:BOOL=FALSE -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DMPI_C_COMPILER=/global/common/software/m3169/cori/openmpi/4.0.2/gnu/bin/mpicc -DMPI_CXX_COMPILER=/global/common/software/m3169/cori/openmpi/4.0.2/gnu/bin/mpicxx`

since I want to use the MPI integrated with the cc and CC instead of the openmpi, do you have some ideas to let the cmake works with the cc and CC?

The cmake version that I use is 3.14.4

Thanks for your help!

---

<div class="post-metadata">

### Author: ![zhe](https://discourse.paraview.org/user_avatar/discourse.paraview.org/zhe/32/2196_2.png) [@zhe](https://discourse.paraview.org/u/zhe)
#### Post date: [September 6, 2020, 10:50am UTC](https://discourse.paraview.org/t/issues-of-compiling-v5-8-0-on-nersc-cori-by-cc-and-cc/5278/2 "2020-09-06T10:50:34Z")

</div>

I am not sure the reason behind this, but it seems that the cmake failed after I load the mesa by spack, for this example, it runs well at the first time and then I load the mesa and delete the CMakeCache, then it failed to compile the paraview

```
$ cmake ~/cworkspace/src/ParaView/ -DPARAVIEW_USE_QT=OFF -DPARAVIEW_USE_PYTHON=ON -DPARAVIEW_USE_MPI=ON -DVTK_OPENGL_HAS_OSMESA:BOOL=TRUE -DVTK_USE_X:BOOL=FALSE -DCMAKE_CXX_COMPILER=CC -DCMAKE_C_COMPILER=cc -DMPI_C_COMPILER=cc -DMPI_CXX_COMPILER=CC
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Cray Programming Environment 2.6.2 C
-- Check for working C compiler: /opt/cray/pe/craype/2.6.2/bin/cc
-- Check for working C compiler: /opt/cray/pe/craype/2.6.2/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Cray Programming Environment 2.6.2 CXX
-- Check for working CXX compiler: /opt/cray/pe/craype/2.6.2/bin/CC
-- Check for working CXX compiler: /opt/cray/pe/craype/2.6.2/bin/CC -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Debug' as none was specified.
-- Performing Test HAVE_GCC_ERROR_RETURN_TYPE
-- Performing Test HAVE_GCC_ERROR_RETURN_TYPE - Success
-- Performing Test Support for 64 bit file systems
-- Performing Test Support for 64 bit file systems - Success
-- Looking for a Fortran compiler
^C
zw241@cori01:/global/cscratch1/sd/zw241/build_paraview_v580$ ls
CMakeCache.txt ExternalData VTKExtensions cmake_install.cmake paraview-config.cmake vtk-config.cmake
CMakeFiles Makefile Web lib64 paraview-modules.json vtk-modules.json
CTestTestfile.cmake Testing Wrapping package.json requirements.txt
DartConfiguration.tcl VTK bin paraview-config-version.cmake vtk-config-version.cmake
zw241@cori01:/global/cscratch1/sd/zw241/build_paraview_v580$ rm CMakeCache.txt
zw241@cori01:/global/cscratch1/sd/zw241/build_paraview_v580$ spack load mesa/qozjngg
zw241@cori01:/global/cscratch1/sd/zw241/build_paraview_v580$ cmake ~/cworkspace/src/ParaView/ -DPARAVIEW_USE_QT=OFF -DPARAVIEW_USE_PYTHON=ON -DPARAVIEW_USE_MPI=ON -DVTK_OPENGL_HAS_OSMESA:BOOL=TRUE -DVTK_USE_X:BOOL=FALSE -DCMAKE_CXX_COMPILER=CC -DCMAKE_C_COMPILER=cc -DMPI_C_COMPILER=cc -DMPI_CXX_COMPILER=CC
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Cray Programming Environment 2.6.2 C
-- Check for working C compiler: /opt/cray/pe/craype/2.6.2/bin/cc
-- Check for working C compiler: /opt/cray/pe/craype/2.6.2/bin/cc -- broken
CMake Error at /global/common/sw/cray/cnl7/haswell/cmake/3.14.4/gcc/8.2.0/2hef55n/share/cmake-3.14/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "/opt/cray/pe/craype/2.6.2/bin/cc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /global/cscratch1/sd/zw241/build_paraview_v580/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/gmake cmTC_2d981/fast 
    /usr/bin/gmake -f CMakeFiles/cmTC_2d981.dir/build.make CMakeFiles/cmTC_2d981.dir/build
    gmake[1]: Entering directory '/global/cscratch1/sd/zw241/build_paraview_v580/CMakeFiles/CMakeTmp'
   ......
```

---

<div class="post-metadata">

### Author: ![zhe](https://discourse.paraview.org/user_avatar/discourse.paraview.org/zhe/32/2196_2.png) [@zhe](https://discourse.paraview.org/u/zhe)
#### Post date: [September 7, 2020, 2:12pm UTC](https://discourse.paraview.org/t/issues-of-compiling-v5-8-0-on-nersc-cori-by-cc-and-cc/5278/3 "2020-09-07T14:12:45Z")

</div>

it looks that the cc find a wrong ld after I load the mesa:

zw241@cori11:~\> which ld  
/global/common/cori/software/altd/2.0/bin/ld  
zw241@cori11:~\>  
zw241@cori11:~\> module load spack  
zw241@cori11:~\>  
zw241@cori11:~\> spack load mesa/qozjngg  
zw241@cori11:~\> which ld  
/global/common/sw/cray/sles15/x86\_64/binutils/2.32/gcc/8.2.0/sl7nxhi/bin/ld

it can be solved after updating the PATH
