Skip to content

request: replace custom openmp switches with cmake's find_package(OpenMP) #58

Description

@psadil

This was suggested during review of : conda-forge/staged-recipes#32756 (comment). I'd expect that use of the cmake tools would also make niimath more portable, such as when working on osx with libomp from a different source than homebrew, as this block seems to require

niimath/src/Makefile

Lines 12 to 19 in 4df3c65

UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
OMPFLAGS= -Xpreprocessor -fopenmp -I/opt/homebrew/opt/libomp/include
OMPLINK= -L/opt/homebrew/opt/libomp/lib -lomp
else
OMPFLAGS= -fopenmp
OMPLINK= -fopenmp
endif

Other places that may be simplified with this change:

if(${CMAKE_C_COMPILER_ID} STREQUAL "AppleClang")
option(OPENMP_XCODE "Build with OpenMP support" OFF)
endif()

if(${CMAKE_C_COMPILER_ID} STREQUAL "AppleClang")
#e.g. cmake -DOPENMP_XCODE=ON ..
# Default ON when allineate is enabled (benefits from parallel coarse search)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions