Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
balay opened this issue Feb 9, 2024 · 2 comments
Open

Comments

@balay
Copy link
Member

balay commented Feb 9, 2024

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

nice ./bin/spack install -j44 [email protected] %[email protected] ^openmpi~rsh
<hang in ld>

Trying mpich instead of openmpi:

svcpetsc@petsc-gpu-02:/scratch/svcpetsc/spack.y$` nice ./bin/spack install -j44 [email protected] %[email protected] ^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 / [email protected] -------------------
[email protected]  /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
Copy link
Member Author

balay commented Feb 9, 2024

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("[email protected]:", 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
Copy link
Member

Is MPI optional or mandatory for DTK?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants