PaStix4CalculiX compilation error

Did anyone encounter the following error when compiling PaStix4CalculiX?

CMake Error at cmake_modules/morse_cmake/modules/find/LibrariesAbsolutePath.cmake:60 (message):
  Dependency of CUDA_LIBRARIES 'Threads::Threads' NOT FOUND
Call Stack (most recent call first):
  cmake_modules/morse_cmake/modules/find/FindPARSEC.cmake:218 (libraries_absolute_path)
  CMakeLists.txt:372 (find_package)

Here’s my make_pastix.sh

#!/bin/bash
if ! [[ -d build ]]; then
    mkdir build
fi
cd build

INSTALLPATH="/usr/lib/pastix_i8"
CUDADIR="/usr/local/cuda-10.2"
PARSECDIR="/usr/local/parsec_i8"
SCOTCHDIR="/usr/local/lib/"
HWLOCDIR="/usr/local/lib/"

cmake \
    -DBLAS_LIBDIR=/opt/intel/mkl/lib/intel64 \
    -DCBLAS_LIBDIR=/opt/intel/mkl/lib/intel64\
    -DLAPACKE_LIBDIR=/opt/intel/mkl/lib/intel64\
    -DCUDA_TOOLKIT_ROOT_DIR=${CUDADIR} \
    -DCMAKE_INSTALL_PREFIX=${INSTALLPATH} \
    -DCMAKE_BUILD_TYPE=Release \
    -DPASTIX_WITH_PARSEC=ON \
    -DPASTIX_WITH_MPI=ON \
    -DSCOTCH_DIR=${SCOTCHDIR} \
    -DHWLOC_DIR=${HWLOCDIR} \
    -DPASTIX_WITH_CUDA=ON \
    -DCUDA_DIR=${CUDADIR} \
    -DPASTIX_ORDERING_SCOTCH=ON \
    -DCMAKE_C_COMPILER=icc \
    -DCMAKE_CXX_COMPILER=icpc \
    -DCMAKE_Fortran_COMPILER=ifort \
    -DCMAKE_C_FLAGS="-qopenmp" \
    -DPASTIX_INT64=ON\
    -DPYTHON_EXECUTABLE=/opt/intel/intelpython3/bin/python3\
    ...

Here’s the full CMake output if it helps

-- The C compiler identification is Intel 19.0.4.20190416
-- The CXX compiler identification is Intel 19.0.4.20190416
-- The Fortran compiler identification is Intel 19.0.4.20190416
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/intel/compilers_and_libraries_2019.4.243/linux/bin/intel64/icc - 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/intel/compilers_and_libraries_2019.4.243/linux/bin/intel64/icpc - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /opt/intel/compilers_and_libraries_2019.4.243/linux/bin/intel64/ifort - skipped
-- Checking whether /opt/intel/compilers_and_libraries_2019.4.243/linux/bin/intel64/ifort supports Fortran 90
-- Checking whether /opt/intel/compilers_and_libraries_2019.4.243/linux/bin/intel64/ifort supports Fortran 90 - yes
-- Found PythonInterp: /opt/intel/intelpython3/bin/python3 (found version "3.6.8")
-- Building for target x86_64
-- Found target X86_64
-- Performing Test C_M32or64
-- Performing Test C_M32or64 - Failed
-- Performing Test HAVE_WALL
-- Performing Test HAVE_WALL - Success
-- Performing Test HAVE_WEXTRA
-- Performing Test HAVE_WEXTRA - Success
-- Performing Test HAVE_WD
-- Performing Test HAVE_WD - Success
-- Performing Test HAVE_G3
-- Performing Test HAVE_G3 - Success
-- Performing Test HAVE_ATOMIC_GCC_32_BUILTINS
-- Performing Test HAVE_ATOMIC_GCC_32_BUILTINS - Success
-- Performing Test HAVE_ATOMIC_GCC_64_BUILTINS
-- Performing Test HAVE_ATOMIC_GCC_64_BUILTINS - Success
-- Performing Test HAVE_ATOMIC_GCC_128_BUILTINS
-- Performing Test HAVE_ATOMIC_GCC_128_BUILTINS - Success
-- Performing Test HAVE_ATOMIC_XLC_32_BUILTINS
-- Performing Test HAVE_ATOMIC_XLC_32_BUILTINS - Failed
-- Performing Test HAVE_ATOMIC_MIPOSPRO_32_BUILTINS
-- Performing Test HAVE_ATOMIC_MIPOSPRO_32_BUILTINS - Failed
-- Performing Test HAVE_ATOMIC_SUN_32
-- Performing Test HAVE_ATOMIC_SUN_32 - Failed
--       support for 32 bits atomics - found
--       support for 64 bits atomics - found
--       support for 128 bits atomics - found
-- Performing Test HAVE_FALLTHROUGH
-- Performing Test HAVE_FALLTHROUGH - Success
-- 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
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Looking for sched_setaffinity
-- Looking for sched_setaffinity - found
-- Performing Test HAVE_TIMESPEC_TV_NSEC
-- Performing Test HAVE_TIMESPEC_TV_NSEC - Success
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for include file stdarg.h
-- Looking for include file stdarg.h - found
-- Performing Test HAVE_VA_COPY
-- Performing Test HAVE_VA_COPY - Success
-- Looking for asprintf
-- Looking for asprintf - found
-- Looking for vasprintf
-- Looking for vasprintf - found
-- Looking for include file getopt.h
-- Looking for include file getopt.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for getopt_long
-- Looking for getopt_long - found
-- Looking for include file errno.h
-- Looking for include file errno.h - found
-- Looking for include file stddef.h
-- Looking for include file stddef.h - found
-- Looking for include file stdbool.h
-- Looking for include file stdbool.h - found
-- Looking for getrusage
-- Looking for getrusage - found
-- Looking for RUSAGE_THREAD
-- Looking for RUSAGE_THREAD - not found
-- Looking for include file limits.h
-- Looking for include file limits.h - found
-- Looking for include file string.h
-- Looking for include file string.h - found
-- Looking for include file libgen.h
-- Looking for include file libgen.h - found
-- Looking for include file complex.h
-- Looking for include file complex.h - found
-- Looking for include file sys/param.h
-- Looking for include file sys/param.h - found
-- Looking for include file sys/types.h
-- Looking for include file sys/types.h - found
-- Looking for include file syslog.h
-- Looking for include file syslog.h - found
-- Add -nofor_main to the Fortran linker.
-- A cache variable, namely CBLAS_DIR, has been set to specify the install directory of CBLAS
-- A cache variable, namely BLAS_DIR, has been set to specify the install directory of BLAS
CMake Warning (dev) at /usr/local/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (BLAS).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/local/share/cmake-3.18/Modules/FindPkgConfig.cmake:59 (find_package_handle_standard_args)
  cmake_modules/morse_cmake/modules/find/FindBLAS.cmake:307 (include)
  cmake_modules/morse_cmake/modules/find/FindCBLAS.cmake:109 (find_package)
  CMakeLists.txt:206 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Found OpenMP_C: -qopenmp (found version "5.0")
-- Found OpenMP_CXX: -qopenmp (found version "5.0")
-- Found OpenMP_Fortran: -qopenmp (found version "5.0")
-- Found OpenMP: TRUE (found version "5.0")
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - found
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - found
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - found
-- Looking for MKL BLAS: found
-- A library with BLAS API found.
-- BLAS_LIBRARIES /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.so;/opt/intel/mkl/lib/intel64/libmkl_sequential.so;/opt/intel/mkl/lib/intel64/libmkl_core.so;/usr/lib/x86_64-linux-gnu/libm.so
-- Looking for cblas_dscal
-- Looking for cblas_dscal - found
-- Looking for cblas_zgemm3m
-- Looking for cblas_zgemm3m - found
-- Looking for cblas: test with blas succeeds
-- Looking for cblas_dscal
-- Looking for cblas_dscal - found
-- Found CBLAS: /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.so;/opt/intel/mkl/lib/intel64/libmkl_sequential.so;/opt/intel/mkl/lib/intel64/libmkl_core.so;/usr/lib/x86_64-linux-gnu/libm.so
-- cblas:
-- A cache variable, namely LAPACKE_DIR, has been set to specify the install directory of LAPACKE
-- A cache variable, namely LAPACK_DIR, has been set to specify the install directory of LAPACK
CMake Warning (dev) at /usr/local/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (BLAS).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/local/share/cmake-3.18/Modules/FindPkgConfig.cmake:59 (find_package_handle_standard_args)
  cmake_modules/morse_cmake/modules/find/FindBLAS.cmake:307 (include)
  cmake_modules/morse_cmake/modules/find/FindLAPACK.cmake:284 (find_package)
  cmake_modules/morse_cmake/modules/find/FindLAPACKE.cmake:119 (find_package)
  CMakeLists.txt:212 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenMP_CXX: -qopenmp (found version "5.0")
-- Found OpenMP_Fortran: -qopenmp (found version "5.0")
-- Looking for MKL BLAS: found
-- A library with BLAS API found.
-- BLAS_LIBRARIES /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.so;/opt/intel/mkl/lib/intel64/libmkl_sequential.so;/opt/intel/mkl/lib/intel64/libmkl_core.so;/usr/lib/x86_64-linux-gnu/libm.so
-- Looking for Fortran CHEEV
-- Looking for Fortran CHEEV - found
-- Looking for LAPACK in BLAS: found
CMake Warning (dev) at /usr/local/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (LAPACK).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/local/share/cmake-3.18/Modules/FindPkgConfig.cmake:59 (find_package_handle_standard_args)
  cmake_modules/morse_cmake/modules/find/FindLAPACK.cmake:358 (include)
  cmake_modules/morse_cmake/modules/find/FindLAPACKE.cmake:119 (find_package)
  CMakeLists.txt:212 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- A library with LAPACK API found.
-- LAPACK_LIBRARIES /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.so;/opt/intel/mkl/lib/intel64/libmkl_sequential.so;/opt/intel/mkl/lib/intel64/libmkl_core.so;/usr/lib/x86_64-linux-gnu/libm.so
-- Looking for LAPACKE_dgeqrf
-- Looking for LAPACKE_dgeqrf - found
-- Looking for LAPACKE_dlascl_work
-- Looking for LAPACKE_dlascl_work - found
-- Looking for lapacke: test with lapack succeeds
-- Looking for LAPACKE_dgeqrf
-- Looking for LAPACKE_dgeqrf - found
-- Looking for LAPACKE_dlascl_work
-- Looking for LAPACKE_dlascl_work - found
-- Found LAPACKE: /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.so;/opt/intel/mkl/lib/intel64/libmkl_sequential.so;/opt/intel/mkl/lib/intel64/libmkl_core.so;/usr/lib/x86_64-linux-gnu/libm.so
-- lapacke:
-- A cache variable, namely HWLOC_DIR, has been set to specify the install directory of HWLOC
CMake Warning (dev) at /usr/local/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (HWLOC).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/local/share/cmake-3.18/Modules/FindPkgConfig.cmake:59 (find_package_handle_standard_args)
  cmake_modules/morse_cmake/modules/find/FindHWLOC.cmake:85 (include)
  CMakeLists.txt:231 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Looking for HWLOC - PkgConfig not used
-- Looking for hwloc_topology_init
-- Looking for hwloc_topology_init - found
-- Found HWLOC: /usr/local/lib/libhwloc.so
-- Performing Test HAVE_HWLOC_PARENT_MEMBER
-- Performing Test HAVE_HWLOC_PARENT_MEMBER - Success
-- Performing Test HAVE_HWLOC_CACHE_ATTR
-- Performing Test HAVE_HWLOC_CACHE_ATTR - Success
-- Performing Test HAVE_HWLOC_OBJ_PU
-- Performing Test HAVE_HWLOC_OBJ_PU - Success
-- Looking for hwloc_bitmap_free in /usr/local/lib/libhwloc.so
-- Looking for hwloc_bitmap_free in /usr/local/lib/libhwloc.so - found
-- Found MPI_C: /opt/intel/compilers_and_libraries_2019.4.243/linux/mpi/intel64/lib/libmpifort.so (found version "3.1")
-- Found MPI_CXX: /opt/intel/compilers_and_libraries_2019.4.243/linux/mpi/intel64/lib/libmpicxx.so (found version "3.1")
-- Found MPI_Fortran: /opt/intel/compilers_and_libraries_2019.4.243/linux/mpi/intel64/lib/libmpifort.so (found version "3.1")
-- Found MPI: TRUE (found version "3.1")
-- Looking for MPI_Type_create_resized
-- Looking for MPI_Type_create_resized - found
CMake Warning (dev) at CMakeLists.txt:269 (find_package):
  Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
  Run "cmake --help-policy CMP0074" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  Environment variable CUDA_ROOT is set to:

    /usr/local/cuda-10.2/

  For compatibility, CMake is ignoring the variable.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found CUDA: /usr/local/cuda-10.2 (found version "10.2")
-- Looking for cuDeviceCanAccessPeer
-- Looking for cuDeviceCanAccessPeer - not found
-- A cache variable, namely PARSEC_DIR, has been set to specify the install directory of PARSEC
-- Looking for PARSEC - Try to detect pthread
-- FOUND pthreads for parsec
-- Looking for PARSEC - Try to detect libm
-- Looking for PARSEC - Try to detect librt
-- Looking for PARSEC - Try to detect libdl
CMake Warning (dev) at /usr/local/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (HWLOC).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/local/share/cmake-3.18/Modules/FindPkgConfig.cmake:59 (find_package_handle_standard_args)
  cmake_modules/morse_cmake/modules/find/FindHWLOC.cmake:85 (include)
  cmake_modules/morse_cmake/modules/find/FindPARSEC.cmake:199 (find_package)
  CMakeLists.txt:372 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Looking for HWLOC - PkgConfig not used
-- Looking for hwloc_topology_init
-- Looking for hwloc_topology_init - found
CMake Error at cmake_modules/morse_cmake/modules/find/LibrariesAbsolutePath.cmake:60 (message):
  Dependency of CUDA_LIBRARIES 'Threads::Threads' NOT FOUND
Call Stack (most recent call first):
  cmake_modules/morse_cmake/modules/find/FindPARSEC.cmake:218 (libraries_absolute_path)
  CMakeLists.txt:372 (find_package)

Any help is appreciated!

You defined the variable

but never used it.
You just forgot to add
-DPARSEC_DIR=${PARSECDIR}
to cmake

Encounter the same Error. PARSECDIR is defined.

    CMake Error at cmake_modules/morse_cmake/modules/find/LibrariesAbsolutePath.cmake:59 (message):
      Dependency of CUDA_LIBRARIES 'Threads::Threads' NOT FOUND
    Call Stack (most recent call first):
      cmake_modules/morse_cmake/modules/find/FindPARSEC.cmake:211 (libraries_absolute_path)
      CMakeLists.txt:365 (find_package)

Here’s my make_pastix.sh

#!/bin/bash
if ! [[ -d build ]]; then
    mkdir build
fi
cd build

INSTALLPATH="~/code/PaStiX/PaStiX4CalculiX"
PARSECDIR="~/code/PaStiX/parsec_i8"

cmake \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=${INSTALLPATH} \
	-DCUDA_DIR=${EBROOTCUDA} \
	-DCUDA_TOOLKIT_ROOT_DIR=${EBROOTCUDA} \
	-DPARSEC_DIR=${PARSECDIR} \
	-DSCOTCH_DIR=${EBROOTSCOTCH} \
	-DHWLOC_DIR=${EBROOTHWLOC} \
	-DPASTIX_ORDERING_SCOTCH=ON \
	-DPASTIX_WITH_PARSEC=ON \
	-DPASTIX_WITH_CUDA=ON \
	-DCMAKE_C_COMPILER=gcc \
	-DCMAKE_CXX_COMPILER=g++ \
	-DCMAKE_Fortran_COMPILER=gfortran \
	-DCMAKE_C_FLAGS="-fopenmp" \
    ..

make -j8
make install

Any update on this?

I have the same problem here. I tried to compile without CUDA, but than I run into parsec compilation problems, because:
/PaStiX/pastix_src/bcsc/bvec.c:25:1: error: unknown type name ‘gpu_device_t’

By removing the ifdef (#include <parsec/devices/cuda/dev_cuda.h> is needed!) definition in:
PaStiX/pastix_src/bcsc/bvec.c
PaStiX/pastix_src/refinement/pastix_task_refine.c
PaStiX/pastix_src/sopalin/pastix_task_solve.c

I recuded the number on compilation errors, however, it still fails in file /PaStiX/pastix_src/bcsc/bvec.c:25 even if <parsec/devices/cuda/dev_cuda.h> is included.

I tried more things, it looks like the:

Dependency of CUDA_LIBRARIES ‘Threads::Threads’ NOT FOUND

has something to do with my centos7 installation. I tried to compile everything on debian buster, the cuda-10.2 libs are the same, but the error does not happen under debian.

Under debian, I experience a strange linking problem, while libhwloc.so is part of PASTIX_LIBS in the Makefile_i8, the compiled cxx binary needs libhwloc.so.15 (verified by ldd). Even if I place libhwloc.so.15 instead of libhwloc.so in PASTIX_LIBS , it is still missing.

Solved:
Adding hwloc and parsec lib path in /etc/ld.so.conf.d solves the linking problem.

Why centos7 still throws:
Dependency of CUDA_LIBRARIES ‘Threads::Threads’ NOT FOUND
is still open :frowning:

Ok, if I disable CUDA Support in pastix (cuda must be installed anyway, if not, you get other compilation errors, with parsec for example) and add -I/usr/local/cuda-10.2/include to -DCMAKE_C_FLAGS, then I am able to compile pastix even on centos7.
Here are my make_* files:

make_hwloc.sh (v2.1.0):
umask 022
./configure --prefix=/opt/calculix/hwloc_i8 --enable-static=yes CC=gcc CXX=g++
make -j2
sudo make install

make_scotch.sh (v.6.0.8)
umask 022
cd src
ln -sf Make.inc/Makefile.inc.x86-64_pc_linux2 Makefile.inc
sed -i ‘/CFLAGS/ s/$/ -DINTSIZE64/’ Makefile.inc

make -j2 scotch
make -j2 esmumps
sudo make prefix=/opt/calculix/scotch_i8 install

make_parsec.sh (git into parsec and checkout tag 6.0.2)
if ! [[ -d build ]]; then
mkdir build
fi
cd build
INSTALLPATH="/opt/calculix/parsec_i8"
umask 022

# fixes
sed -i '/-1 == cpu/i return cpu;' ../parsec/bindthread.c

cmake \
    -DCMAKE_CXX_COMPILER=g++ \
    -DCMAKE_C_COMPILER=gcc \
    -DCMAKE_Fortran_COMPILER=gfortran \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=${INSTALLPATH} \
    -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.2 \
    -DCUDA_DIR=/usr/local/cuda-10.2 \
    -DCUDA_USE_STATIC_CUDA_RUNTIME=ON \
    -DCMAKE_CUDA_HOST_COMPILER=gcc \
    -DPARSEC_GPU_WITH_CUDA=ON \
    -DCMAKE_LIBRARY_PATH=/usr/local/cuda-10.2/lib64/stubs \
    -DHWLOC_DIR=/opt/calculix/hwloc_i8 \
    ..

make -j2
sudo rm -rf ${INSTALLPATH}
sudo make install

make_pastix.sh (checkout PaStiX4Calculix as mentioned in ccx-2.17/src/README)

    #!/bin/bash
    if ! [[ -d build ]]; then
        mkdir build
    fi
    cd build
    cmake   \
    	-DHWLOC_DIR=/opt/calculix/hwloc_i8 \
    	-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.2 \
    	-DCMAKE_INSTALL_PREFIX=/opt/calculix/pastix_i8 \
    	-DCMAKE_BUILD_TYPE=Release \
    	-DPASTIX_WITH_PARSEC=ON \
    	-DPARSEC_DIR=/opt/calculix/parsec_i8 \
    	-DSCOTCH_DIR=/opt/calculix/scotch_i8 \
    	-DPASTIX_WITH_CUDA=ON \
    	-DCUDA_DIR=/usr/local/cuda-10.2 \
    	-DPASTIX_ORDERING_SCOTCH=ON \
    	-DCMAKE_C_COMPILER=gcc \
    	-DCMAKE_CXX_COMPILER=g++ \
    	-DCMAKE_Fortran_COMPILER=gfortran \
    	-DCMAKE_LIBRARY_PATH=/usr/local/cuda-10.2/lib64/stubs \
    	-DCMAKE_C_FLAGS="-fopenmp -I/usr/local/cuda-10.2/include" \
            ..
    make -j2
    sudo make install