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

Multiple definition error #88

Open
sagitter opened this issue Apr 23, 2023 · 1 comment
Open

Multiple definition error #88

sagitter opened this issue Apr 23, 2023 · 1 comment

Comments

@sagitter
Copy link

Hi all.

I obtaining a linking error when try to compile libsuperlu_fortran in Fedora 38:

[ 98%] Linking Fortran shared library libsuperlu_fortran.so
cd /home/sagitter/rpmbuild/BUILD/superlu-6.0.0/redhat-linux-build/FORTRAN && /usr/bin/cmake -E cmake_link_script CMakeFiles/superlu_fortran.dir/link.txt --verbose=1
/usr/bin/gfortran -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules  -fcommon -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes -shared -Wl,-soname,libsuperlu_fortran.so.6 -o libsuperlu_fortran.so.6.0.0 CMakeFiles/superlu_fortran.dir/c_fortran_dgssv.c.o CMakeFiles/superlu_fortran.dir/hbcode1.F90.o CMakeFiles/superlu_fortran.dir/f_main.F90.o CMakeFiles/superlu_fortran.dir/c_fortran_zgssv.c.o CMakeFiles/superlu_fortran.dir/zhbcode1.F90.o CMakeFiles/superlu_fortran.dir/z_f_main.F90.o  ../SRC/libsuperlu.so.6.0.0 -lflexiblas /usr/lib64/libmetis.so -lm 
/usr/bin/ld: CMakeFiles/superlu_fortran.dir/z_f_main.F90.o (symbol from plugin): in function `main':
(.text+0x0): multiple definition of `main'; CMakeFiles/superlu_fortran.dir/f_main.F90.o (symbol from plugin):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
@gruenich
Copy link
Contributor

gruenich commented Jun 4, 2023

I think it is a bug in the CMake code to build the superlu_fortran library. Two Fortran files containing main functions are part of the library (f_main.F90 and z_f_main.F90), which probably causes the issue.

I revised the CMake code to build superlu_fortan, see #99. I hope this fixes your issue.

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