flame / blis

BLAS-like Library Instantiation Software Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Configure should stop when requested compiler not found

devinamatthews opened this issue · comments

Currently, if you specify a particular compiler when configuring (using CC=...), configure will blithely go on and find some other compiler to use. For example, on my Mac I have gcc-11 installed so that I can use OpenMP. If I forget and specify CC=gcc-10, the following happens:

[dmatthews@Devin's MacBook Pro release]$~/src/blis/configure -tomp CC=gcc-10 auto
configure: detected Darwin kernel version 20.6.0.
configure: python interpeter search list is: python python3 python2.
configure: using 'python' python interpreter.
configure: found python version 3.7.9 (maj: 3, min: 7, rev: 9).
configure: python 3.7.9 appears to be supported.
configure: C compiler search list is: gcc clang cc.
configure: using 'gcc' C compiler.
configure: C++ compiler search list is: g++ clang++ c++.
configure: using 'g++' C++ compiler (for sandbox only).
configure: found clang version 12.0.5 (maj: 12, min: 0, rev: 5).
configure: checking for blacklisted configurations due to gcc 12.0.5.
configure: checking gcc 12.0.5 against known consequential version ranges.

configure now finds gcc which is actually Apple clang which doesn't understand -fopenmp. configure should abort or at least warn loudly if the compiler specified by CC=... isn't found.

@fgvanzee can you add this? Seems like it should be pretty easy. I don't think it is ever the user's intent to use some other compiler when CC is explicitly defined.

@devinamatthews Sure, I'll work on it.

Question: do we just want to hack this in for CC or adopt some consistent policy for all of the environment variables we support?

    echo " Environment Variables:"
    echo " "
    echo "   CC            Specifies the C compiler to use. "
    echo "   CXX           Specifies the C++ compiler to use (sandbox only)."
    echo "   FC            Specifies the Fortran compiler to use (only to determine --complex-return)."
    echo "   RANLIB        Specifies the ranlib executable to use."
    echo "   AR            Specifies the archiver to use."
    echo "   CFLAGS        Specifies additional compiler flags to use (prepended)."
    echo "   LDFLAGS       Specifies additional linker flags to use (prepended)."
    echo "   LIBPTHREAD    Pthreads library to use."
    echo "   PYTHON        Specifies the python interpreter to use."

For CC/CXX/FC yes, not sure how others are relevant.

I agree that the question doesn't make sense for CFLAGS, LDFLAGS, or LIBPTHREAD.

But my question holds for RANLIB, AR, and PYTHON: if the user specifies a particular tool, but the tool can't be found, should configure use the default (as if the user hadn't specified any preference at all) or complain and exit?

Finally getting around to this today.

@devinamatthews Alright, so in the case of C++ (which isn't strictly necessary to build BLIS) do you think we should follow the same behavior as with CC? That is, if the user sets CXX=abc and abc doesn't work or doesn't exist, should configure bail out?

The easy thing to do would be to follow the same policy, which is where I was leaning. Just wanted to confirm that you saw no reason to make an exception.

I would think so, but since it's not necessary to build libblis maybe it could just warn.

Okay, I'll try using a warning.

Closing. Let's move any further dialogue to #617.