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

Linker Problems #75

Open
pluckySquid opened this issue Aug 8, 2023 · 1 comment
Open

Linker Problems #75

pluckySquid opened this issue Aug 8, 2023 · 1 comment

Comments

@pluckySquid
Copy link

Hello authors,

Thanks for helping me solving the problems! I think I have solved most problems and very close to be able to compile it.

Ninja finished 488 / 488 jobs but it seems to have some duplicate linker problems. It seems libifcore.a is a linker for single core and libifcoremt.a is for multiple thread. But they both defined multiple variables that are been used in the fortran code. I have tried to delete one of those two files, but none of that worked. Do you know if which one of them are been used or is there a way to link to only one of them?

Thank you!

Attached are the error message I am saving:
#27 54.83 [483/488] Linking target subprojects/tblite/test/unit/tester
#27 54.83 ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu//libmkl_core.a(mkl_semaphore.o): in function mkl_serv_inspector_suppress': #27 54.83 mkl_semaphore.c:(.text+0xb9): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking #27 55.68 [484/488] Compiling Fortran object libqcxms.a.p/src_cid.f90.o #27 122.0 [485/488] Compiling Fortran object libqcxms.a.p/src_copyc6.f90.o #27 122.1 [486/488] Linking static target libqcxms.a #27 127.2 [487/488] Compiling Fortran object qcxms.p/src_main.F90.o #27 132.1 [488/488] Linking target qcxms #27 132.1 FAILED: qcxms #27 132.1 /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/ifort -o qcxms qcxms.p/src_main.F90.o -Wl,--as-needed -Wl,--no-undefined -static -Wl,--start-group libqcxms.a subprojects/mctc-lib/libmctc-lib.a subprojects/tblite/libtblite.a subprojects/dftd4/libdftd4.a subprojects/multicharge/libmulticharge.a subprojects/s-dftd3/libs-dftd3.a subprojects/toml-f/libtoml-f.a subprojects/rmsd-tool/libmctc-rmsd.a -qopenmp -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -fopenmp -qopenmp -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -fopenmp -qopenmp -qopenmp -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -fopenmp -qopenmp -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -qopenmp -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -fopenmp -qopenmp -qopenmp -lifcore -limf -Wl,--end-group #27 132.1 ld: /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcoremt.a(for_reentrancy.o): in function for_set_reentrancy':
#27 132.1 for_reentrancy.c:(.text+0x0): multiple definition of for_set_reentrancy'; /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcore.a(for_reentrancy.o):for_reentrancy.c:(.text+0x0): first defined here #27 132.1 ld: /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcoremt.a(for_reentrancy.o):(.data+0xf0): multiple definition of for__reentrancy_mode'; /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcore.a(for_reentrancy.o):(.bss+0x0): first defined here
#27 132.1 ld: /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcoremt.a(for_reentrancy.o): in function for__reentrancy_init': #27 132.1 for_reentrancy.c:(.text+0x20): multiple definition of for__reentrancy_init'; /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcore.a(for_reentrancy.o):for_reentrancy.c:(.text+0x20): first defined here
#27 132.1 ld: /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcoremt.a(for_reentrancy.o): in function for__once_private': #27 132.1 for_reentrancy.c:(.text+0x40): multiple definition of for__once_private'; /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcore.a(for_reentrancy.o):for_reentrancy.c:(.text+0x1b0): first defined here
#27 132.1 ld: /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcoremt.a(for_reentrancy.o):(.bss+0x0): multiple definition of for__reentrancy_initialized'; /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcore.a(for_reentrancy.o):(.bss+0x4): first defined here #27 132.1 ld: /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcoremt.a(for_reentrancy.o): in function for__reentrancy_cleanup':
#27 132.1 for_reentrancy.c:(.text+0x320): multiple definition of for__reentrancy_cleanup'; /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcore.a(for_reentrancy.o):for_reentrancy.c:(.text+0x210): first defined here #27 132.1 ld: /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcoremt.a(for_reentrancy.o):(.data+0x0): multiple definition of for__static_threadstor_private'; /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcore.a(for_reentrancy.o):(.data+0x0): first defined here
#27 132.1 ld: /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcoremt.a(for_reentrancy.o): in function for__disable_asynch_deliv_private': #27 132.1 for_reentrancy.c:(.text+0x4f0): multiple definition of for__disable_asynch_deliv_private'; /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcore.a(for_reentrancy.o):for_reentrancy.c:(.text+0x270): first defined here
#27 132.1 ld: /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcoremt.a(for_reentrancy.o): in function for__enable_asynch_deliv_private': #27 132.1 for_reentrancy.c:(.text+0x510): multiple definition of for__enable_asynch_deliv_private'; /opt/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/../../compiler/lib/intel64_lin/libifcore.a(for_reentrancy.o):for_reentrancy.c:(.text+0x290): first defined here
#27 132.1 ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu//libmkl_core.a(mkl_semaphore.o): in function `mkl_serv_inspector_suppress':
#27 132.1 mkl_semaphore.c:(.text+0xb9): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
#27 132.1 ninja: build stopped: subcommand failed.

process "/bin/sh -c cd /QCxMS/QCxMS && ninja -C build;" did not complete successfully: exit code: 1

@gorges97
Copy link
Contributor

Did you try to set the -lifcoremt library explicitly with the command: >meson setup build -Dfortran_link_args="-lifcoremt -static"? This resolved the linker problems for me.

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

No branches or pull requests

2 participants