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

Solve build issues with ibm xlf #677

Merged
merged 5 commits into from
Jul 5, 2022
Merged

Conversation

friedc
Copy link
Contributor

@friedc friedc commented May 29, 2022

Description

I configure lapack-3.10.1 with the following options:

cmake -H. -Bobjdir -DCMAKE_C_COMPILER=gcc -DCMAKE_Fortran_COMPILER=xlf -DCMAKE_INSTALL_PREFIX=/run_dir/3rd-party -DBUILD_INDEX64=ON -DBUILD_SINGLE=OFF -DBUILD_COMPLEX=OFF -DCBLAS=OFF -DLAPACKE=OFF

cmake then fails with the following message:

-- Detecting Fortran/C Interface
-- Detecting Fortran/C Interface - Failed to compile
-- Verifying Fortran/C Compiler Compatibility
CMake Warning (dev) at /usr/share/cmake-3.16/Modules/FortranCInterface.cmake:309 (message):
  No FortranCInterface mangling known for VerifyFortran
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FortranCInterface/Verify/CMakeLists.txt:16 (FortranCInterface_HEADER)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Verifying Fortran/C Compiler Compatibility - Failed
...
    [100%] Linking C executable VerifyFortranC
    /usr/bin/cmake -E cmake_link_script CMakeFiles/VerifyFortranC.dir/link.txt --verbose=1
    /usr/bin/gcc  -DWeirdNEC -DLAPACK_ILP64 -DHAVE_LAPACK_CONFIG_H -O3 -DNDEBUG   CMakeFiles/VerifyFortranC.dir/main.c.o CMakeFiles/VerifyFortranC.dir/VerifyC.c.o  -o VerifyFortranC   -L/opt/ibm/xlsmp/5.1.1/lib  -L/opt/ibm/xlmass/9.1.1/lib  -L/opt/ibm/xlf/16.1.1/lib  libVerifyFortran.a -lxlf90 -lxlopt -lxlomp_ser -lxl -lxlfmath -ldl -lrt -lpthread -lm 
    /usr/bin/ld: CMakeFiles/VerifyFortranC.dir/main.c.o: in function `main':
    main.c:(.text.startup+0x1c): undefined reference to `VerifyFortran'
...
Call Stack (most recent call first):
  LAPACKE/CMakeLists.txt:4 (FortranCInterface_VERIFY)

Here I have:

# cmake --version
cmake version 3.16.3
...
# gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
...
# xlf -qversion
IBM XL Fortran for Linux, V16.1.1 (Community Edition)
Version: 16.01.0001.0003
...

You will notice that I do not want to build LAPACKE, but it still breaks the build. This is addressed by commit 8d3ae00. I can now get a bit further with the build.

cd objdir && /usr/bin/make VERBOSE=1

yields

[  1%] Building Fortran object BLAS/SRC/CMakeFiles/blas64.dir/xerbla_array.f.o
cd /run_dir/3rd-party/lapack/objdir/BLAS/SRC && /opt/ibm/xlf/16.1.1/bin/xlf   -qthreaded -qhalt=e -qrecur -qnosave -qstrict -fdefault-integer-8 -O   -c /run_dir/3rd-party/lapack/BLAS/SRC/xerbla_array.f -o CMakeFiles/blas64.dir/xerbla_array.f.o
COMMAND LINE  1520-065 (W) The XLF77(PERSISTENT) option stores entities in static storage.  This may affect the thread safety of your code.
"/run_dir/3rd-party/lapack/BLAS/SRC/xerbla_array.f", line 108.16: 1515-009 (E) Null literal string is not permitted.  A single blank is assumed.
** xerbla_array   === End of Compilation 1 ===
1501-511  Compilation failed for file xerbla_array.f.

The failed compilations is addressed by commit 7939cb1. Now the build completes successfully.

Checklist

  • The documentation has been updated.
  • If the PR solves a specific issue, it is set to be closed on merge.

LAPACKE/CMakeLists.txt Show resolved Hide resolved
@weslleyspereira
Copy link
Collaborator

There is a conflict we should solve before merge. It is simple. @friedc, may I just solve it and then merge your branch? Thanks.

@friedc
Copy link
Contributor Author

friedc commented Jul 5, 2022

There is a conflict we should solve before merge. It is simple. @friedc, may I just solve it and then merge your branch? Thanks.

Sorry, I didn't see the merge conflict before. I will try to solve it myself and report back if I am not able to.

Edit: Merge conflict resolved!

@langou langou merged commit 4f97df9 into Reference-LAPACK:master Jul 5, 2022
@julielangou julielangou added this to the LAPACK 3.11.0 milestone Nov 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants