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

[lapack-reference] enable fortran if possible for find blas #14765

Closed

Conversation

xandox
Copy link
Contributor

@xandox xandox commented Nov 25, 2020

Describe the pull request
If Fortran language not enabled FindLAPACK fails on default configuration.

  • What does your PR fix? Fixes #
    FindLAPACK.cmake

  • Which triplets are supported/not supported? Have you updated the CI baseline?
    as previous, no

  • Does your PR follow the maintainer guide?
    yes

@JackBoosY JackBoosY added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label Nov 26, 2020
Copy link
Contributor

@JackBoosY JackBoosY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please bump the port version. See documentation.

@xandox xandox requested a review from JackBoosY November 26, 2020 11:08
@JackBoosY
Copy link
Contributor

openmvg:x64-osx:

/mnt/vcpkg-ci/installed/x64-linux/debug/lib/liblapack.a(dormlq.f.o): In function `dormlq_':
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/dormlq.f:248: undefined reference to `_gfortran_concat_string'
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/dormlq.f:273: undefined reference to `_gfortran_concat_string'
/mnt/vcpkg-ci/installed/x64-linux/debug/lib/liblapack.a(dormqr.f.o): In function `dormqr_':
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/dormqr.f:247: undefined reference to `_gfortran_concat_string'
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/dormqr.f:272: undefined reference to `_gfortran_concat_string'
/mnt/vcpkg-ci/installed/x64-linux/debug/lib/liblapack.a(xerbla.f.o): In function `xerbla_':
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/xerbla.f:90: undefined reference to `_gfortran_st_write'
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/xerbla.f:90: undefined reference to `_gfortran_string_len_trim'
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/xerbla.f:90: undefined reference to `_gfortran_transfer_character_write'
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/xerbla.f:90: undefined reference to `_gfortran_transfer_integer_write'
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/xerbla.f:90: undefined reference to `_gfortran_st_write_done'
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/xerbla.f:92: undefined reference to `_gfortran_stop_string'
collect2: error: ld returned 1 exit status

sophus:x64-osx:

/mnt/vcpkg-ci/installed/x64-linux/debug/lib/liblapack.a(dormlq.f.o): In function `dormlq_':
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/dormlq.f:248: undefined reference to `_gfortran_concat_string'
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/dormlq.f:273: undefined reference to `_gfortran_concat_string'
/mnt/vcpkg-ci/installed/x64-linux/debug/lib/liblapack.a(dormqr.f.o): In function `dormqr_':
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/dormqr.f:247: undefined reference to `_gfortran_concat_string'
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/dormqr.f:272: undefined reference to `_gfortran_concat_string'
/mnt/vcpkg-ci/installed/x64-linux/debug/lib/liblapack.a(xerbla.f.o): In function `xerbla_':
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/xerbla.f:90: undefined reference to `_gfortran_st_write'
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/xerbla.f:90: undefined reference to `_gfortran_string_len_trim'
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/xerbla.f:90: undefined reference to `_gfortran_transfer_character_write'
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/xerbla.f:90: undefined reference to `_gfortran_transfer_integer_write'
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/xerbla.f:90: undefined reference to `_gfortran_st_write_done'
/mnt/vcpkg-ci/buildtrees/lapack-reference/src/v3.8.0-954f10683f.clean/SRC/xerbla.f:92: undefined reference to `_gfortran_stop_string'
collect2: error: ld returned 1 exit status

@xandox
Copy link
Contributor Author

xandox commented Nov 27, 2020

Huh. I will try to find some OSX to check. But now it looks like a problem with building lapack-reference under OSX meanwhile my changes only touch resolving BLAS libraries for lapack port.
@Neumann-A Hi. Git blame said that you are the author of lapack-reference port. May be you can suggest something?

@Neumann-A
Copy link
Contributor

#14804 (comment)

@Neumann-A
Copy link
Contributor

I also don't understand why you are enabling Fortan. The FindLAPACK.cmake module in vcpkg is just a copy of the FindLAPACK.cmake in CMake with minor adjustments.

@xandox
Copy link
Contributor Author

xandox commented Nov 27, 2020

@Neumann-A thank you for your answer.
I am not a big specialist in fortran and lapack. I just get them as dependency for suitsparse.
And there is why I turn on fortran here.
suitsparse depends on lapack. On linux lapack depends on lapack-reference wich is fortran library. It had built somehow then lapack port checks installation and try use FindLAPACK, but in lapack fortran not enabled and FindLAPACK fails. How to enable Fortran for whole vcpkg I can't find.

@Neumann-A
Copy link
Contributor

Even though LAPACK is a Fortran library it can be called from c and linked against without having a Fortran compiler available. So I assume the problem here is a linkage issue in reality? What was the actual error message?

@xandox
Copy link
Contributor Author

xandox commented Nov 27, 2020

@xandox
Copy link
Contributor Author

xandox commented Nov 27, 2020

Yes. You are right. Problem with linkage.
If lapack-reference built as static library, FindLAPACK tries to find cheev functions with libraries liblapack.a, libopenblas.a and -lpthread. But full set of libraries is liblapack.a, libopenblas.a, -lpthread, -lm, -lgfortran.
This PR does not solve main problem, so I close it. And will try to do something with linkage.

@xandox xandox closed this Nov 27, 2020
@Neumann-A
Copy link
Contributor

normally this should be handled by this:

if(NOT LAPACK_LIBRARIES AND NOT WIN32)
check_lapack_libraries(
LAPACK_LIBRARIES
LAPACK
cheev
""
"lapack;m;gfortran"
""
""
""
"${BLAS_LIBRARIES}"
)
endif()

@xandox
Copy link
Contributor Author

xandox commented Nov 27, 2020

Yes, should. but cmake can't find gfortran. Hm.

@xandox xandox deleted the enable_fortran_language_if_possible branch January 12, 2021 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants