Fix bugs in configure that set flags needed for linking C++ compiled code with C and fortran compilers and Fortran code with C and C++ compilers to correctly set variables cxxlibs and flibs NOT LIBS
Fix bugs in configure that set flags needed for linking C++ compiled code with C and fortran compilers and Fortran code with C and C++ compilers to correctly set variables cxxlibs and flibs NOT LIBS
This requires the package checks for packages that use C++ or Fortran code to properly use cxxlibs and flibs and not just hope that LIBS has what they need
This fixes a particular (longstanding) problem
--------------------------------------------------------------------------------------------- Unknown Fortran name mangling: Are you sure the C and Fortran compilers are compatible? Perhaps one is 64 bit and one is 32 bit?
which occurs because of the more specific error:
Executing: /usr/tce/packages/openmpi/openmpi4.1.4-intel-oneapi.2022.2/bin/mpif90 -o /tmp/petsc-wbymhzkb/config.compilers/conftest -DPETSC_HAVE_BROKEN_RECURSIVE_MACRO -DINCLUDED_PETSCFIX_H -DPETSC_SKIP_COMPLEX --gcc-toolchain=/opt/rh/devtoolset-10/root/usr -assume underscore -fp-model strict -g -O2 /tmp/petsc-wbymhzkb/config.compilers/conftest.o /tmp/petsc-wbymhzkb/config.compilers/confc.o -lstdc++ Possible ERROR while running linker: exit code 1 stderr: ld: cannot find -lstdc++
which happened because -lstdc++ was put into LIBS (and thus appeared in the link line for Fortran mangling) when it should have been put into cxxlibs
Commit-type: configure Reported-by: Daniel Taller <taller1@llnl.gov> Thanks-to: Jacob Faibussowitsch <jacob.fai@gmail.com>
show more ...
|