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

ADDA version 1.2 and higher fails to compile #284

Closed
pulmonarycosignerkindness opened this issue Jan 25, 2021 · 5 comments
Closed

ADDA version 1.2 and higher fails to compile #284

pulmonarycosignerkindness opened this issue Jan 25, 2021 · 5 comments
Assignees
Labels
bug Incorrect code behavior comp-Scripts Related to Makefiles, wrappers, developer and testing scripts OS-Linux Related to all Linux/Unix systems pri-Medium Worth assigning to a milestone
Milestone

Comments

@pulmonarycosignerkindness

Describe the bug

I'm trying to compile ADDA v.1.4.0 (with make seq or make mpi, both give the same result), but I get errors saying,

/usr/bin/ld: GenerateB.o:(.bss+0xc8): multiple definition of 'InterTerm_real'; calculator.o:(.bss+0x3a8): first defined here
/usr/bin/ld: GenerateB.o:(.bss+0xb8): multiple definition of 'ReflTerm_real'; calculator.o:(.bss+0x398): first defined here

and so on, which makes the compiler exit with error 1. I have installed FFTW3, and MPICH, I have the fortran, C and C++ compilers, and have tried to manually set the paths, e.g. FFTW3_INC_PATH, but that doesn't work either.

I get the same error for all ADDA versions above 1.1. Version 1.1 succeeds in compiling without any errors.

To reproduce

  1. Unpack the latest archive of ADDA
  2. Enter the src folder and execute make, make seq or make mpi
  3. Wait for error
  4. See error

Expected behavior

The program should compile.

Output

gfortran -c -O3 -ffast-math -funroll-loops -w  ../fort/dtrhre.f
gfortran -c -O3 -ffast-math -funroll-loops -w  ../fort/propaesplibreintadda.f
Linking needs to be redone
echo -n "mpicc -w -lm -lfftw3 -lgfortran" > .ldopts
Building adda_mpi
mpicc -o adda_mpi ADDAmain.o CalculateE.o calculator.o chebyshev.o cmplx.o comm.o crosssec.o GenerateB.o interaction.o io.o iterative.o linalg.o make_particle.o memory.o mt19937ar.o param.o Romberg.o sinint.o somnec.o timing.o vars.o fft.o matvec.o d07hre.o d09hre.o d113re.o d132re.o dadhre.o dchhre.o dcuhre.o dfshre.o dinhre.o drlhre.o dtrhre.o propaesplibreintadda.o   -w -lm -lfftw3 -lgfortran
/usr/bin/ld: GenerateB.o:(.bss+0xc8): multiple definition of `InterTerm_real'; calculator.o:(.bss+0x3a8): first defined here
/usr/bin/ld: GenerateB.o:(.bss+0xb8): multiple definition of `ReflTerm_real'; calculator.o:(.bss+0x398): first defined here
/usr/bin/ld: GenerateB.o:(.bss+0xc0): multiple definition of `ReflTerm_int'; calculator.o:(.bss+0x3a0): first defined here
/usr/bin/ld: GenerateB.o:(.bss+0xd0): multiple definition of `InterTerm_int'; calculator.o:(.bss+0x3b0): first defined here
...
collect2: error: ld returned exit status 1
make[1]: *** [../common.mk:72: adda_mpi] Error 1

Technical information

  • ADDA version: 1.4.0
  • OS: Manjaro Linux
  • Compiler: gcc 10.2.0
  • For MPI version, used MPI implementation: 3.4.2
  • Versions of the libraries that may be related to the bug, such as FFTW3, clFFT, clBLAS: FFTW3 3.3.9.1, MPICH 3.4.2
@myurkin myurkin self-assigned this Jan 25, 2021
@myurkin myurkin added bug Incorrect code behavior comp-Scripts Related to Makefiles, wrappers, developer and testing scripts OS-Linux Related to all Linux/Unix systems pri-Medium Worth assigning to a milestone labels Jan 25, 2021
@myurkin
Copy link
Member

myurkin commented Jan 25, 2021

@pulmonarycosignerkindness , thanks for the detailed report. So far it seems some issue related to the compiler and/or make. So here are a few quick ideas to try:

  1. please specify the version of make: make --version
  2. please try make clean before make seq
  3. please try make seq OPTIONS=DEBUG

@myurkin
Copy link
Member

myurkin commented Jan 25, 2021

And one more test: make seq EXTRA_FLAGS=-fcommon

@pulmonarycosignerkindness
Copy link
Author

Yay, the EXTRA_FLAGS=-fcommon flag solved it! I can now compile both mpi and seq without any issues.

Make version: GNU Make 4.3
make clean before make seq still gives the same error as above.

Here's the output from make seq OPTIONS=DEBUG:

...
gfortran -c -Og -w -g ../fort/dtrhre.f
gfortran -c -Og -w -g ../fort/propaesplibreintadda.f
Linking needs to be redone
echo -n "gcc -lm -lfftw3 -lgfortran" > .ldopts
Building adda
gcc -o adda ADDAmain.o CalculateE.o calculator.o chebyshev.o cmplx.o comm.o crosssec.o GenerateB.o interaction.o io.o iterative.o linalg.o make_particle.o memory.o mt19937ar.o param.o Romberg.o sinint.o somnec.o timing.o vars.o fft.o matvec.o d07hre.o d09hre.o d113re.o d132re.o dadhre.o dchhre.o dcuhre.o dfshre.o dinhre.o drlhre.o dtrhre.o propaesplibreintadda.o   -lm -lfftw3 -lgfortran
/usr/bin/ld: GenerateB.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:26: multiple definition of `InterTerm_real'; calculator.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:26: first defined here
/usr/bin/ld: GenerateB.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:43: multiple definition of `ReflTerm_real'; calculator.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:43: first defined here
/usr/bin/ld: GenerateB.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:38: multiple definition of `ReflTerm_int'; calculator.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:38: first defined here
/usr/bin/ld: GenerateB.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:24: multiple definition of `InterTerm_int'; calculator.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:24: first defined here
/usr/bin/ld: interaction.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:24: multiple definition of `InterTerm_int'; calculator.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:24: first defined here
/usr/bin/ld: interaction.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:26: multiple definition of `InterTerm_real'; calculator.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:26: first defined here
/usr/bin/ld: interaction.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:38: multiple definition of `ReflTerm_int'; calculator.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:38: first defined here
/usr/bin/ld: interaction.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:43: multiple definition of `ReflTerm_real'; calculator.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:43: first defined here
/usr/bin/ld: fft.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../fft.c:82: multiple definition of `Xmatrix'; vars.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../vars.c:146: first defined here
/usr/bin/ld: fft.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:38: multiple definition of `ReflTerm_int'; calculator.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:38: first defined here
/usr/bin/ld: fft.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:24: multiple definition of `InterTerm_int'; calculator.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:24: first defined here
/usr/bin/ld: fft.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:43: multiple definition of `ReflTerm_real'; calculator.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:43: first defined here
/usr/bin/ld: fft.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:26: multiple definition of `InterTerm_real'; calculator.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:26: first defined here
/usr/bin/ld: matvec.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:43: multiple definition of `ReflTerm_real'; calculator.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:43: first defined here
/usr/bin/ld: matvec.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:38: multiple definition of `ReflTerm_int'; calculator.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:38: first defined here
/usr/bin/ld: matvec.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:26: multiple definition of `InterTerm_real'; calculator.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:26: first defined here
/usr/bin/ld: matvec.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:24: multiple definition of `InterTerm_int'; calculator.o:/home/user/Dokument/ADDA/adda-1.4.0/src/seq/../interaction.h:24: first defined here
collect2: error: ld returned exit status 1
make[1]: *** [../common.mk:72: adda] Error 1

@myurkin
Copy link
Member

myurkin commented Jan 26, 2021

This was caused by change of default behavior of gcc since version 10 (now it is -fno-common instead of -fcommon). But this only highlighted subtle inaccuracies in the code. Now it is fixed.

@pulmonarycosignerkindness , please check that make seq works out of the box with the latest source.

@myurkin myurkin added this to the 1.5 milestone Jan 26, 2021
@pulmonarycosignerkindness
Copy link
Author

Ah ok. Yes, it works out of the box now without any errors. Thank you! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect code behavior comp-Scripts Related to Makefiles, wrappers, developer and testing scripts OS-Linux Related to all Linux/Unix systems pri-Medium Worth assigning to a milestone
Projects
None yet
Development

No branches or pull requests

2 participants