Errors installing igraph on a remote cluster

I am trying to install igraph in my personal account on the Bridges-2 cluster at the Pittsburgh Supercomputer Center (PSC). I have installed a recent version of “cmake” (cmake-3.20.0-linux-x86_64) which calls an Nvidia compiler (-- The C compiler identification is NVHPC 22.1.0
– The CXX compiler identification is NVHPC 22.1.0). When I try to “build” igraph, I get the following:

$ cmake --build .                                                                
Scanning dependencies of target bliss
[  0%] Built target bliss
Scanning dependencies of target cxsparse_vendored
[ 11%] Built target cxsparse_vendored
Scanning dependencies of target glpk_vendored
[ 11%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/misc/mt1.c.o                            
/jet/packages/nvidia/hpc_sdk/Linux_x86_64/22.1/compilers/share/llvm/bin/opt: /tmp/nvcEcBwAUU6r8vu.ll:3890:$6: error: missing required field 'filename'
!11 = !DIFile(directory: "/ocean/projects/<...>/igraph/build/vendor/glpk")                    
                                                                                     ^                    
gmake[2]: *** [vendor/glpk/CMakeFiles/glpk_vendored.dir/build.make:1804: vendor/glpk/CMakeFiles/glpk_vendo$ed.dir/misc/mt1.c.o] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:1810: vendor/glpk/CMakeFiles/glpk_vendored.dir/all] Error 2           
gmake: *** [Makefile:166: all] Error 2

What am I doing wrong? Thanks!

Can you show the exact command you are using to configure and compile igraph? How do you set the compiler?

Ideally, can you post a complete terminal transcript of configuring and building igraph, starting from a clean source directory?

I followed the commands on the igraph.org website (igraph library):
The OS:

$ lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 8.2.2004 (Core) 
Release:        8.2.2004
Codename:       Core

I had to install an updated version of cmake:

wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0-linux-x86_64.sh
/bin/sh cmake-3.20.0-linux-x86_64.sh

The commands and results. Successful things removed are marked with “<…>”:

(PHPC) [build]$ cmake ..
-- Setting build type to 'Release' as none was specified.                                                  
-- Version number: 0.10.4                                                                                  
-- The C compiler identification is NVHPC 22.1.0                                                           
-- The CXX compiler identification is NVHPC 22.1.0                                                         
-- Detecting C compiler ABI info                                                                           
-- Detecting C compiler ABI info - done                                                                    
-- Check for working C compiler: /opt/packages/nvidia/hpc_sdk/Linux_x86_64/22.1/compilers/bin/nvc - skipped
-- Detecting C compile features                                                                            
-- Detecting C compile features - done                                                                     
-- Detecting CXX compiler ABI info                                                                         
-- Detecting CXX compiler ABI info - done                                                                  
-- Check for working CXX compiler: /opt/packages/nvidia/hpc_sdk/Linux_x86_64/22.1/compilers/bin/nvc++ - ski
pped                                                                                                       
-- Detecting CXX compile features                                                                          
-- Detecting CXX compile features - done                                                                   
-- Performing Test COMPILER_SUPPORTS_UNKNOWN_WARNING_OPTION_FLAG                                           
-- Performing Test COMPILER_SUPPORTS_UNKNOWN_WARNING_OPTION_FLAG - Failed                                  
-- Thread-local storage: supported (__thread)                                                              
-- Looking for pthread.h                                                                                   
-- Looking for pthread.h - found                                                                           
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD                                                                 
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success                                                       
-- Found Threads: TRUE
-- Found FLEX: /usr/bin/flex (found version "2.6.1")
-- Found BISON: /usr/bin/bison (found version "3.0.4")
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for strncasecmp
-- Looking for strncasecmp - found
-- Looking for _stricmp
-- Looking for _stricmp - not found
-- Looking for _strnicmp
-- Looking for _strnicmp - not found
-- Looking for strdup
-- Looking for strdup - found
-- Looking for strndup
-- Looking for strndup - found
-- Looking for include file xlocale.h
-- Looking for include file xlocale.h - not found
-- Looking for uselocale
-- Looking for uselocale - found
-- Looking for _configthreadlocale
-- Looking for _configthreadlocale - not found
-- Performing Test HAVE__UMUL128
-- Performing Test HAVE__UMUL128 - Failed
-- Performing Test HAVE___UMULH
-- Performing Test HAVE___UMULH - Failed
-- Looking for C++ include sys/types.h
-- Looking for C++ include sys/types.h - found
-- Looking for C++ include stdint.h
-- Looking for C++ include stdint.h - found
-- Looking for C++ include stddef.h
-- Looking for C++ include stddef.h - found
-- Check size of __uint128_t
-- Check size of __uint128_t - failed
-- Performing Test HAVE_BUILTIN_OVERFLOW
-- Performing Test HAVE_BUILTIN_OVERFLOW - Success
-- Looking for _LIBCPP_VERSION
-- Looking for _LIBCPP_VERSION - not found
-- Looking for __GLIBCXX__
-- Looking for __GLIBCXX__ - found
-- Performing Test HAVE_ENABLE_NEW_DTAGS
-- Performing Test HAVE_ENABLE_NEW_DTAGS - Success
-- Found Python3: /jet/<…>/.conda/envs/PHPC/bin/python3.9 (found version "3.9.13") found components
: Interpreter
--
-- -----[ Build configuration ]----
-- Version:                  0.10.4
-- CMake build type:        Release
-- Library type:             static
-- igraph_integer_t size:   64 bits
--
-- ----------[ Features ]----------
-- GLPK for optimization:       yes
-- Reading GraphML files:       yes
-- Thread-local storage:        yes
-- Link-time optimization:       no
--
-- --------[ Dependencies ]--------
-- ARPACK:                      yes
-- BISON:                       yes
-- BLAS:                        yes
-- FLEX:                        yes
-- GLPK:                   vendored
-- GMP:                         yes
-- LAPACK:                      yes
-- LibXml2:                     yes
-- OpenMP:                      yes
-- PLFIT:                  vendored
--
-- -----------[ Testing ]----------
-- Diff tool:                  diff
-- Sanitizers:                 none
-- Code coverage:                no
-- Verify 'finally' stack:       no
--
-- --------[ Documentation ]-------
-- HTML:                         no
-- PDF:                          no
--
-- igraph configured successfully.
--
-- Configuring done
-- Generating done
-- Build files have been written to: /ocean/…/build
(PHPC) [build]$ cmake --build .
Scanning dependencies of target bliss
[  0%] Building CXX object src/isomorphism/bliss/CMakeFiles/bliss.dir/defs.cc.o
[  3%] Building CXX object src/isomorphism/bliss/CMakeFiles/bliss.dir/graph.cc.o
"/ocean/<…>/igraph-0.10.4/src/isomorphism/bliss/graph.cc", line 1653: warning: loop
is not reachable
        _INTERNAL_ERROR();
        ^

[  3%] Building CXX object src/isomorphism/bliss/CMakeFiles/bliss.dir/heap.cc.o
[  3%] Building CXX object src/isomorphism/bliss/CMakeFiles/bliss.dir/orbit.cc.o
[  3%] Building CXX object src/isomorphism/bliss/CMakeFiles/bliss.dir/partition.cc.o
[  3%] Building CXX object src/isomorphism/bliss/CMakeFiles/bliss.dir/uintseqhash.cc.o
[  3%] Building CXX object src/isomorphism/bliss/CMakeFiles/bliss.dir/utils.cc.o
[  3%] Built target bliss
Scanning dependencies of target cxsparse_vendored
[  3%] Building C object vendor/cs/CMakeFiles/cxsparse_vendored.dir/cs_add.c.o
[  3%] Building C object vendor/cs/CMakeFiles/cxsparse_vendored.dir/cs_amd.c.o
<…>
[ 10%] Building C object vendor/cs/CMakeFiles/cxsparse_vendored.dir/cs_util.c.o
[ 14%] Building C object vendor/cs/CMakeFiles/cxsparse_vendored.dir/cs_utsolve.c.o
[ 14%] Built target cxsparse_vendored
Scanning dependencies of target glpk_vendored
[ 14%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/amd/amd_1.c.o
[ 17%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/amd/amd_2.c.o
<…>
[ 28%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/colamd/colamd.c.o
[ 28%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/bfd.c.o
"/ocean/<…>/igraph-0.10.4/vendor/glpk/draft/bfd.c", line 270: warning: variable "con
d" was declared but never referenced
           double cond;
                  ^

[ 28%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/bfx.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpapi06.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpapi07.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpapi08.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpapi09.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpapi10.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpapi12.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpapi13.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpios01.c.o
"/ocean/<…>/igraph-0.10.4/vendor/glpk/draft/glpios01.c", line 1494: warning: missing
 return statement at end of non-void function "_glp_ios_find_row"
  }
  ^

[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpios02.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpios03.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpios07.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpios09.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpios11.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpios12.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpipm.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpmat.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpscl.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpssx01.c.o
"/ocean/<…>/igraph-0.10.4/vendor/glpk/draft/glpssx01.c", line 787: warning: expressi
on has no effect
                 xassert(("Internal error: basis matrix is singular", 0));
                 ^

[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/glpssx02.c.o
[ 32%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/draft/lux.c.o
<…>
[ 39%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/misc/mc21a.c.o
[ 39%] Building C object vendor/glpk/CMakeFiles/glpk_vendored.dir/misc/mt1.c.o
/jet/packages/nvidia/hpc_sdk/Linux_x86_64/22.1/compilers/share/llvm/bin/opt: /tmp/nvcr1QdZTeR7P4z.ll:3890:9
3: error: missing required field 'filename'
!11 = !DIFile(directory: "/ocean/projects/ibn210001p/mbower/igraph-0.10.4/build/vendor/glpk")
                                                                                            ^
gmake[2]: *** [vendor/glpk/CMakeFiles/glpk_vendored.dir/build.make:1804: vendor/glpk/CMakeFiles/glpk_vendor
ed.dir/misc/mt1.c.o] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:1801: vendor/glpk/CMakeFiles/glpk_vendored.dir/all] Error 2
gmake: *** [Makefile:166: all] Error 2
(PHPC) [build]$

Thank you for your help,
Mark

I do not see anything obviously wrong here, though I do note that you didn’t show how you set up the Nvidia compiler as the default. Did you set environment variables yourself, or is this set up for you?

The practical suggestion I can give is not to use this compiler. Use GCC or Clang.

I did test igraph with the PGI compiler a couple of years ago (NVHPC is the successor of PGI). We gave up on PGI because we hit on serious miscompilation bugs when certain optimization options were enabled. That said, compilation did succeed, even if the resulting program was incorrect.

If you figure out what the problem was, do let us know. Unfortunately I no longer have access to this compiler to test it myself.

But do run the test suite in case the new version of this compiler is still buggy …

That worked! I changed the default compiler:

export CC=/usr/bin/gcc
export CXX=/usr/bin/g++

re-ran everything from scratch and it all compiled without a hitch.

Yes, the default compiler on the system was set (either default or by me, I cannot remember), because I am running MPI+OpenACC programs, of which igraph will eventually be a part. HOPEFULLY, igraph will “play well” with the Nvidia compiler now that it has been installed by “gcc”.

Your experience with the PGI compiler was eye-widening! In the “hybrid” computing world, it is pretty respected, as far as I can tell, but then I’m pretty new to that game. Not to sure about compilers that compile, but produce incorrect code!

Thank you so much for your help!
Mark

I don’t recall which optimization options triggered the bug, it may have been enabling LTO. If you do get it working with NVHPC, just be sure to run the test suite and check if everyhing’s alright. Also, if you do get it working, please let us know what the problem was and how you fixed it.

My understanding is that there should be no issue linking a GCC-compiled library to an NVHPC compiled program for as long as the library has a C API, like igraph does.

Changing the compiler definitely helped me get past my initial problem on the “install” step, but then I encountered the following:

$ cmake --install .
-- Install configuration: "Release"
-- Installing: /home/bm662/igraph/lib64/libigraph.a
-- Up-to-date: /home/bm662/igraph/include/igraph
-- Up-to-date: /home/bm662/igraph/include/igraph/igraph
-- Up-to-date: /home/bm662/igraph/include/igraph/igraph/igraph
-- Up-to-date: /home/bm662/igraph/include/igraph/igraph/igraph/igraph
-- Up-to-date: /home/bm662/igraph/include/igraph/igraph/igraph/igraph/igraph
-- Up-to-date: /home/bm662/igraph/include/igraph/igraph/igraph/igraph/igraph/igraph
-- Up-to-date: /home/bm662/igraph/include/igraph/igraph/igraph/igraph/igraph/igraph/igraph
-- Up-to-date: /home/bm662/igraph/include/igraph/igraph/igraph/igraph/igraph/igraph/igraph/igraph
...

It just kept installing sub-directories!? It did the same thing at two different institutions, so it doesn’t seem like a problem with a particular version of “cmake” or something like that.

That’s strange, I’ve never seen this, even though I installed igraph on many different systems. How did you specify the install location?

Your configuration step should look like this, assuming you are in the build subdirectory of the source directory:

cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/igraph

Note the usage of $HOME. Do not use ~. Does this work for you?

Yes. I used that exact command to set the install directory locally. And, yes, I was in igraph/build in all three computing systems.

The process worked (ironically) on my laptop with cmake version 3.24.2. On the two clusters where I saw the recursion error, the cmake version was 3.20.0 and 3.24.3.

In all three cases, I am starting from igraph-0.10.4.tar.

I do test with most versions of CMake, as my package manager updates it. But not usually with x.y.0 versions. The latest bugfix release of 3.20 is 3.20.6.

If you suspect that it’s related to the CMake version, you can try a newer CMake without administrator access. CMake is quite easy to compile. I usually install it into $HOME/local, then add $HOME/local/bin to my path. The procedure is the same as with igraph, just specify the installation location by setting CMAKE_INSTALL_PREFIX.

However, there’s a chance that the issue is not the CMake version, but some misconfiguration on your HPC system.