Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown OpenMP flags for clang #43

Open
moravveji opened this issue Oct 26, 2020 · 3 comments
Open

Unknown OpenMP flags for clang #43

moravveji opened this issue Oct 26, 2020 · 3 comments

Comments

@moravveji
Copy link

Hey guys

I am trying to build libFLAME on our AMD Naples machines using the AOCC v.2.2.0 compilers (clang, clang++, flang). We run CentOS 7.8 on our compute nodes.

Here is the configure options that I pass:

# CFLAGS are set identical to OpenBLAS
cflags='-O3 -march=native -fopenmp=libiomp5 -mavx2 -fvectorize -mfma -m3dnow -floop-unswitch-aggressive'
fflags='-O3 -march=native -fopenmp=libiomp5 -mavx -frecursive'

./configure --prefix=$dir_install \
            --enable-max-arg-list-hack \
            --enable-static-build \
            --enable-dynamic-build \
            --enable-lapack2flame \
            --disable-external-lapack-for-subproblems \
            --disable-external-lapack-interfaces \
            --enable-multithreading=openmp \
            --enable-supermatrix \
            --enable-vector-intrinsics=sse \
            --enable-cblas-interfaces \
            --with-cc=clang \
            EXTRA_CFLAGS="$cflags" \
            F77=flang \
            FFLAGS="$fflags"

However, I get the following complaint over OpenMP flags:

checking user-requested multithreading model... openmp
checking for (guessing) OpenMP flags for clang... unknown
configure: error: configure doesn't know what flag to give clang in order to enable OpenMP support. Please submit a bug report to the FLAME developers.

I have played with the cflags and fflags variables above, e.g. with/without -fopenmp, or -fopenmp=libomp or -fopenmp=libiomp5; however, all have failed. Seems like the configure is not listening to the EXTRA_CLFAGS argument passed to it.

Do you have any idea how to fix this?

Regards
Ehsan

@moravveji
Copy link
Author

A gentle reminder about this issue.

@dnparikh
Copy link

dnparikh commented Nov 7, 2020

Clang does not support openmp. Use pthreads instead.

@pradeeptrgit
Copy link

Hi,

You can try adding following line in the 'configure' file to include -fopenmp option for clang
clang)
fla_c_openmp_flags='-fopenmp'
;;

            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for (guessing) OpenMP flags for ${CC_VENDOR}" >&5 $as_echo_n "checking for (guessing) OpenMP flags for ${CC_VENDOR}... " >&6; }

            case ${CC_VENDOR} in
                            icc)
                    fla_c_openmp_flags='-qopenmp'
            ;;
                            gcc)
                    fla_c_openmp_flags='-fopenmp'
            ;;
                            clang)
                    fla_c_openmp_flags='-fopenmp'
            ;;
                            pathcc)
                    fla_c_openmp_flags='-mp'
            ;;
                            pgcc)
                    fla_c_openmp_flags='-mp'
            ;;
                            sxcc)
                    fla_c_openmp_flags='-P openmp'
            ;;
                            *xlc*)
                    fla_c_openmp_flags='-qsmp=omp'
            ;;
                            *)
                    fla_c_openmp_flags='unknown'
            ;;
    esac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants