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

clang-16: error: unsupported option '--sort-common' '--as-needed' #3458

Closed
wreckdump opened this issue Aug 31, 2023 · 4 comments
Closed

clang-16: error: unsupported option '--sort-common' '--as-needed' #3458

wreckdump opened this issue Aug 31, 2023 · 4 comments
Assignees
Labels
Component - Build CMake, Autotools Priority - 3. Low 🔽 Code cleanup, small feature change requests, etc.
Milestone

Comments

@wreckdump
Copy link

Describe the bug
I am getting the following compilartion error during the compile process.

clang-16: error: unsupported option '--sort-common'
clang-16: error: unsupported option '--as-needed'

Expected behavior

I expect the source code to compile without an error. Here is the configuration that I have used

./configure \
    --prefix=/usr \
    --disable-static \
    --enable-parallel \
    --enable-hl \
    --enable-build-mode=production \
    --enable-fortran \
    --enable-tests \
    --with-zlib= \
    --with-szlib= \
    CC=mpicc CXX=mpic++ FC=mpifort CFLAGS="-O3 -march=znver2 -mcmodel=large" CXXFLAGS="-O3 -march=znver2 -mcmodel=large" FCFLAGS="-O3 -march=znver2 -mcmodel=large"
    make -j4

Platform (please complete the following information)

  • HDF5 version : 1.14.2
  • OS and version : Arch Linux 6.4.12-arch1-1
  • Compiler and version : AMD clang version 16.0.3 (CLANG: AOCC_4.1.0-Build#270 2023_07_10)
  • Build system (e.g. CMake, Autotools) and version : GNU Make 4.4.1, autoconf 2.71-4
  • Any configure options you specified : Specified above
  • MPI library and version (parallel HDF5) : OpenMPI 4.1.5 compiled with AMD AOCC 4.1.0

Additional context

I have tried to suppress the --sort-common and --as-needed linking flags by specifiying LDFLAGS = "", but it fails to compile with the following error.

clang-16: error: unknown argument: '-soname'
clang-16: error: no such file or directory: 'libhdf5_fortran.so.310'

With AMD AOCC 4.0.0 it would compile without any flag issues.

@hyoklee hyoklee added this to the 1.14.3 milestone Sep 1, 2023
@hyoklee hyoklee added Component - Build CMake, Autotools Priority - 3. Low 🔽 Code cleanup, small feature change requests, etc. labels Sep 1, 2023
@derobins
Copy link
Member

Why is the linker using unsupported flags? We don't hard-code --as-needed or --sort-common in any of the build files, so it's getting set automatically at configure time. Are you building with a different linker than what's being detected at configure time? Ditto -soname.

I can try building with aocc 4.1, but it'd be helpful if you could configure with --disable-silent-rules, see what your system is using (which ld and ld --version), and peek at config.log to see what configure is using. You might also want to try CMake to see if that builds correctly and what version(s) that is using.

@derobins
Copy link
Member

Also, if you are using Flang instead of gfortran, we don't support that yet.

@derobins derobins assigned derobins and unassigned lrknox Oct 13, 2023
@derobins
Copy link
Member

This is/was a libtool error. The libtool script that is generated at compile time was missing the "-Wl," prefix necessary for linker options, so "-Wl,-soname" gets parsed as -soname, which fails.

As of October 2023, with AOCC 4.1, c/flang works out of the box w/ shared unless you are using an MPI compiler wrapper. We have a hack for that (at least in the Autotools), which will appear shortly.

This issue will be closed when the PR is merged to develop.

@derobins
Copy link
Member

Fixed w/ #3674

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - Build CMake, Autotools Priority - 3. Low 🔽 Code cleanup, small feature change requests, etc.
Projects
None yet
Development

No branches or pull requests

4 participants