damonge / CoLoRe

CoLoRe - Cosmological Lofty Realizations
GNU General Public License v3.0
17 stars 13 forks source link

Building without OMP does not work #2

Closed dkirkby closed 8 years ago

dkirkby commented 8 years ago

With OpenMPI installed and the MPI version of the single-precsion fftw library built (on OS X El Capitan), I cannot build with USE_MPI=yes and USE_OMP=no:

mpicc -Wall -O3 -D_LONGIDS -D_DEBUG -D_HAVE_MPI -D_SPREC -I./src    src/common.o src/cosmo_mad.o src/cosmo.o src/fourier.o src/grid_tools.o src/io.o src/main.c -o CoLoRe    -lgsl -lgslcblas -lfftw3f_mpi -lfftw3f -lcfitsio -lm
Undefined symbols for architecture x86_64:
  "_omp_get_thread_num", referenced from:
      _create_d_and_vr_fields in fourier.o
  "_omp_get_wtime", referenced from:
      _timer in common.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It looks like the linker requires that the OMP library is installed even when USE_OMP=no.

damonge commented 8 years ago

Yep, that's right. This should be fixed now (let me know otherwise).