Skip to content

[Request] Test for compiler compatibility with -fopenmp before using SHLIB_OPENMP_CFLAGS #2161

@jimhester

Description

@jimhester

This will allow installation of data.table on systems / compilers that do not support openmp, even if the site Makeconf file defines SHLIB_OPENMP_CFLAGS. This is the case on macOS as of R 3.4.0 with the default clang compiler.

Something like the following should be sufficient, note that ifeq is a GNU make extension, so it will need to be noted in your DESCRIPTION

CXX11=$(shell "${R_HOME}"/bin/R CMD config CXX11)
ifeq ($(shell $(CXX11) -fopenmp -E -xc++ - 2>&1 >/dev/null && echo 'true'), true)
  PKG_CFLAGS=$(SHLIB_OPENMP_CFLAGS)
  PKG_LIBS=$(SHLIB_OPENMP_CFLAGS)
endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions