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

netlib-scalpack: add fixing prb with netlib-scalpack linking #34535

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

likask
Copy link
Contributor

@likask likask commented Dec 14, 2022

Fix Fortran MPI linking. The patch is straightforward and adds ${MPI_Fortran_LIBRARIES} to target_link_libraries.

I tested in aarch64, Monterey. However, the error fix should be working for other systems.

(cherry picked from commit af4bb70)
(cherry picked from commit d3f7256)
@spackbot-app
Copy link

spackbot-app bot commented Dec 14, 2022

Hi @likask! I noticed that the following package(s) don't yet have maintainers:

  • netlib-scalapack

Are you interested in adopting any of these package(s)? If so, simply add the following to the package class:

    maintainers = ["likask"]

If not, could you contact the developers of this package and see if they are interested? You can quickly see who has worked on a package with spack blame:

$ spack blame netlib-scalapack

Thank you for your help! Please don't add maintainers without their consent.

You don't have to be a Spack expert or package developer in order to be a "maintainer," it just gives us a list of users willing to review PRs or debug issues relating to this package. A package can have multiple maintainers; just add a list of GitHub handles of anyone who wants to volunteer.

@likask likask changed the title add fixing prb with netlib-scalpack linking netlib-scalpack: add fixing prb with netlib-scalpack linking Dec 16, 2022
@haampie
Copy link
Member

haampie commented Jan 2, 2023

This is not merged because the issue being solved is unclear. Is this a known problem?

@sebastiangrimberg
Copy link
Contributor

sebastiangrimberg commented Jan 17, 2023

@haampie I can reproduce this issue trying to build netlib-scalapack on Intel macOS:

  >> 3594    Undefined symbols for architecture x86_64:
     3595      "_MPI_Abort", referenced from:
     3596          _BI_BlacsAbort in BI_BlacsAbort.c.o
     3597      "_MPI_Allreduce", referenced from:
     3598          _igsum2d_ in igsum2d_.c.o
     3599          _sgsum2d_ in sgsum2d_.c.o
     3600          _dgsum2d_ in dgsum2d_.c.o

     ...

     3822          _cgamx2d_ in cgamx2d_.c.o
     3823          _zgamx2d_ in zgamx2d_.c.o
     3824          _igamn2d_ in igamn2d_.c.o
     3825          _sgamn2d_ in sgamn2d_.c.o
     3826          ...
     3827    ld: symbol(s) not found for architecture x86_64
  >> 3828    collect2: error: ld returned 1 exit status
  >> 3829    make[2]: *** [CMakeFiles/scalapack.dir/build.make:21977: lib/libscalapack.dylib] Error 1
     3830    make[2]: Leaving directory '/private/var/folders/kb/hm0wwwlj5992qk7g135q9c3c9f2h3l/T/sjg/spack-stage/spack-stage-netlib-scalapack-2.2.0-bww2njouro
             4b76rju23svzj6zvmqba5y/spack-build-bww2njo'
  >> 3831    make[1]: *** [CMakeFiles/Makefile2:481: CMakeFiles/scalapack.dir/all] Error 2
     3832    make[1]: Leaving directory '/private/var/folders/kb/hm0wwwlj5992qk7g135q9c3c9f2h3l/T/sjg/spack-stage/spack-stage-netlib-scalapack-2.2.0-bww2njouro
             4b76rju23svzj6zvmqba5y/spack-build-bww2njo'
  >> 3833    make: *** [Makefile:169: all] Error 2

Looks like the MPI dependency is not being linked. This could also be fixed by just using the MPI compiler wrappers in the build I think. This issue in 2.2.0 can probably be traced back to this commit, as 2.1.0 links fine.

See also: Reference-ScaLAPACK/scalapack#67.

@sebastiangrimberg
Copy link
Contributor

sebastiangrimberg commented Jan 30, 2023

This is still an issue, and I think that instead of using this patch we can just edit the recipe to use

env['CC'] = spec['mpi'].mpicc
env['FC'] = spec['mpi'].mpifc

or, add to the CMake options:

-DCMAKE_C_COMPILER=spec['mpi'].mpicc
-DCMAKE_Fortran_COMPILER=spec['mpi'].mpifc

Would either of these be preferable @haampie @likask?

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

Successfully merging this pull request may close these issues.

None yet

3 participants