问题
I just followed the instructions here to update my gcc. Now I am trying to install FFTW. So I downloaded the filed here. After I unzip and navigate to that directory I run this:
./configure --enable-mpi --enable-threads --enable-openmp
But I get the following error:
checking for OpenMP flag of C compiler... unknown
configure: error: don't know how to enable OpenMP
I know OpenMP didn't work before I updated GCC, but it does now if I do this:
export PATH=/usr/local/gcc-6.1.0/bin:$PATH
gcc-6.1.0 main.c -o main
So I'm guessing the problem is that when I try to configure FFTW it is using the default gcc, but I need it to use gcc-6.1.0. How can I do this?
回答1:
From the manual, CC
is the environment variable to set the compiler for configure
.
./configure CC=gcc-6.1.0 --enable-mpi --enable-threads --enable-openmp
should set the version of gcc for that configure
. You can also consider changing the symbolic link for gcc.
回答2:
Your method of setting PATH should work if you also set LD_LIBRARY_PATH to the lib or lib64 which was installed along with your new gcc. It should be in the same directory as bin.
来源:https://stackoverflow.com/questions/39542979/configure-error-installing-fftw