shibatch / sleef

SIMD Library for Evaluating Elementary Functions, vectorized libm and DFT
https://sleef.org
Boost Software License 1.0
635 stars 129 forks source link

Unable to disable optional dependencies #475

Open adamjstewart opened 10 months ago

adamjstewart commented 10 months ago

CMakeLists.txt has the following options:

option(DISABLE_FFTW "Disable testing the DFT library with FFTW" OFF)
option(DISABLE_MPFR "Disable testing with the MPFR library" OFF)
option(DISABLE_SSL "Disable testing with the SSL library" OFF)

However, these options don't actually work. When I select them, I see:

CMake Warning:
  Manually-specified variables were not used by the project:

    DISABLE_FFTW
    DISABLE_MPFR
    DISABLE_SSL

Instead, cmake picks up MPFR installed on my system and links to that:

-- MPFR : /opt/homebrew/lib/libmpfr.dylib
-- MPFR header file in /opt/homebrew/include
blapie commented 10 months ago

Hello! Thanks for reporting.

I was able to reproduce some of it on Mac OS.

For MPFR I agree that it does not clear MPFR unless we start on a fresh build. But starting on an empty build directory with

rm -rf build/*
cmake -S . -B build -GNinja -DDISABLE_MPFR=ON

returns

-- MPFR : 
-- MPFR header file in /usr/local/include

For FFTW3 and OPENMP, I admit that there doesn't seem to be a mechanism to clear LIB_{FFTW3,OPENMP}. Will look into why that is and potentially suggest a fix.

blapie commented 7 months ago

Do you still have this issue? Bare in mind option names have changed, e.g. DISABLE_MPFR became SLEEF_DISABLE_MPFR.

adamjstewart commented 7 months ago

FFTW still seems to be buggy:

CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_POLICY_DEFAULT_CMP0090
    SLEEF_DISABLE_FFTW
blapie commented 7 months ago

In what context is that showing? I cannot reproduce locally.

adamjstewart commented 7 months ago

This is interesting, never seen this one before.

This works fine without warnings: -DSLEEF_DISABLE_FFTW=ON

This results in the above warning: -DSLEEF_DISABLE_FFTW:BOOL=ON