Skip to content

duplicate symbols #19

Description

@chapmanemma

There seems to be a problem compiling with the newest implementation of Xcode and the clang used by Brew.

Compilation flags:

#compiler
#cc = /usr/local/opt/llvm/bin/clang
#cc = gcc
cc = /usr/local/Cellar/llvm/11.0.1/bin/clang
#complilation flags

if FFTW uses openmp:

fftwf = -lfftw3f_omp -lfftw3f
fftwd = -lfftw3_omp -lfftw3

if FFTW used pthreads:

#fftwf = -lfftw3f_threads -lfftw3f
#fftwd = -lfftw3_threads -lfftw3

omp = -fopenmp -D_OMPTHREAD_
#omp = -Xpreprocessor -fopenmp -D_OMPTHREAD_
gsl = -lgsl -lgslcblas -lm
deb = -g

#flags = -std=c99 -Wall -O3 -march=native $(fftwd) $(fftwf) $(omp) $(gsl) -lm
#flags = -L/usr/local/opt/llvm/lib -L/usr/local/opt/fftw/lib -L/usr/local/Cellar/gsl/2.6/lib -std=c99 -Wall -O3 $(omp) $(fftwd) $(fftwf) $(gsl) -I/usr/local/opt/fftw/include -I/usr/local/opt/llvm/include -I/usr/local/Cellar/gsl/2.6/include

flags = -L/usr/local/Cellar/llvm/11.0.1/lib -L/usr/local/opt/fftw/lib -L/usr/local/Cellar/gsl/2.6/lib -std=c99 -Wall -O3 $(omp) $(fftwd) $(fftwf) $(gsl) -I/usr/local/opt/fftw/include -I/usr/local/Cellar/llvm/11.0.1/include -I/usr/local/Cellar/gsl/2.6/include -L/usr/local/Cellar/libomp/11.0.1/lib

This error is duplicated if I use the first cc option and the second flags options i.e. with the system llvm.

Error message:

duplicate symbol '_global_n_index' in:
get_densityfield.o
auxiliary.o
...
duplicate symbol '_global_L0' in:
get_densityfield.o
Input_variables.o
ld: 96 duplicate symbols for architecture x86_64

I think this is a problem with the line #include "Input_variables.h" but just commenting out one of these lines in one of the problem files isn't an option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions