xsdk-project / xsdk-issues

A repository under which GitHub issues not related to a specific xSDK repo can be filed.
7 stars 0 forks source link

datatransferkit picking up wrong MPI compilers. [with intel compiler build] #253

Open balay opened 8 months ago

balay commented 8 months ago

I'm my attempt to migrate xsdk CI from UTK - I'm seeing that the build just hangs

nice ./bin/spack install -j44 xsdk@1.0.0 %oneapi@2024.0.2 ^openmpi~rsh
<hang in ld>

Trying mpich instead of openmpi:

svcpetsc@petsc-gpu-02:/scratch/svcpetsc/spack.y$` nice ./bin/spack install -j44 xsdk@1.0.0 %oneapi@2024.0.2 ^mpich
<snip>
5 errors found in build log:
     125    -- MPI_EXEC='/usr/bin/mpiexec'
     126    -- The C compiler identification is IntelLLVM 2024.0.2
     127    -- Detecting C compiler ABI info
     128    -- Detecting C compiler ABI info - failed
     129    -- Check for working C compiler: /usr/bin/mpicc
     130    -- Check for working C compiler: /usr/bin/mpicc - broken
  >> 131    CMake Error at /scratch/svcpetsc/spack.y/opt/spack/linux-ubuntu22.04-x86_64/oneapi-2024.0.2/cmake-3.27.9-n7ajyo6zvjk7vrdv2lqfeuveqkitoh6q/share/cmake-3.27/Modules/CMakeTestCCompiler.cmake:67 (message):
     132      The C compiler
     133
     134        "/usr/bin/mpicc"
     135
     136      is not able to compile a simple test program.

Note: this build is supposed to use:

svcpetsc@petsc-gpu-02:/scratch/svcpetsc/spack.y$ ./bin/spack find -p mpich
-- linux-ubuntu22.04-x86_64 / oneapi@2024.0.2 -------------------
mpich@4.1.2  /scratch/svcpetsc/spack.y/opt/spack/linux-ubuntu22.04-x86_64/oneapi-2024.0.2/mpich-4.1.2-fjjspih6vzqigrwuzue2ppd6fwnuiyzg
==> 1 installed package
svcpetsc@petsc-gpu-02:/scratch/svcpetsc/spack.y$ 

spack-build-out.txt

So its picking up the wrong MPI/compilers from /usr/bin

balay commented 8 months ago

setting mpicc etc [similar to trilinos] gets this build going

diff --git a/var/spack/repos/builtin/packages/datatransferkit/package.py b/var/spack/repos/builtin/packages/datatransferkit/package.py
index 7f29a80ddf..137aa3f440 100644
--- a/var/spack/repos/builtin/packages/datatransferkit/package.py
+++ b/var/spack/repos/builtin/packages/datatransferkit/package.py
@@ -3,6 +3,7 @@
 #
 # SPDX-License-Identifier: (Apache-2.0 OR MIT)

+import pathlib
 from spack.package import *

@@ -35,6 +36,7 @@ class Datatransferkit(CMakePackage):
     variant("serial", default=True, description="enable Serial backend (default)")
     variant("shared", default=True, description="enable the build of shared lib")

+    depends_on("mpi")
     depends_on("arborx@1.0:", when="+external-arborx")
     depends_on("boost")
     depends_on("cmake", type="build")
@@ -56,6 +58,10 @@ def cmake_args(self):
             "-DDataTransferKit_ENABLE_EXAMPLES=OFF",
             "-DCMAKE_CXX_EXTENSIONS=OFF",
             "-DCMAKE_CXX_STANDARD=14",
+            "-DCMAKE_C_COMPILER="+spec["mpi"].mpicc,
+            "-DCMAKE_CXX_COMPILER="+spec["mpi"].mpicxx,
+            "-DCMAKE_Fortran_COMPILER="+spec["mpi"].mpifc,
+            "-DMPI_BASE_DIR="+str(pathlib.PurePosixPath(spec["mpi"].prefix)),
         ]

         if "+openmp" in spec:

Is MPI optional or mandatory for DTK?

masterleinad commented 7 months ago

Is MPI optional or mandatory for DTK?

It's required, also see https://github.com/ORNL-CEES/DataTransferKit/blob/master/cmake/Dependencies.cmake.