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

Compilation error when using Intel compiler #77

Open
7BF794B0 opened this issue Feb 2, 2022 · 6 comments
Open

Compilation error when using Intel compiler #77

7BF794B0 opened this issue Feb 2, 2022 · 6 comments

Comments

@7BF794B0
Copy link

7BF794B0 commented Feb 2, 2022

Hello!
I am trying to compile pnetcdf-1.12.2 using Intel oneAPI Base Toolkit/HPC Toolkit 2022.1 with the following command:

MPICC=$INTEL/oneapi/mpi/latest/bin/mpiicc CFLAGS="-I$INTEL/oneapi/mpi/latest/include -L$INTEL/oneapi/mpi/latest/lib/release -L$INTEL/oneapi/mpi/latest/lib -fPIC -O3 -xsse4.2 -align" MPICXX=$INTEL/oneapi/mpi/latest/bin/mpiicpc CXXFLAGS="-I$INTEL/oneapi/mpi/latest/include -L$INTEL/oneapi/mpi/latest/lib/release -L$INTEL/oneapi/mpi/latest/lib -fPIC -O3 -xsse4.2" MPIF77=$INTEL/oneapi/mpi/latest/bin/mpif77 MPIF90=$INTEL/oneapi/mpi/latest/bin/mpiifort FCFLAGS="-I$INTEL/oneapi/mpi/latest/include -L$INTEL/oneapi/mpi/latest/lib/release -L$INTEL/oneapi/mpi/latest/lib -fPIC -O3 -xsse4.2" ./configure --prefix=$DIR/netcdf --enable-shared

It fails with the following log:

configure: WARNING:
   -----------------------------------------------------------------------
     "/../../intel/oneapi/mpi/latest/bin/mpif77" is not a working MPI Fortran 77 compiler.
     Thus, the Fortran feature is disabled.
   -----------------------------------------------------------------------
configure: creating ./config.lt

How to fix this error?

@wkliao
Copy link
Member

wkliao commented Feb 2, 2022

Please provide file 'config.log' which shows more information about that failure.

@7BF794B0
Copy link
Author

7BF794B0 commented Feb 2, 2022

config.log

@wkliao
Copy link
Member

wkliao commented Feb 2, 2022

I found this line from config.log.

MPICC=/home/**/intel/oneapi/mpi/latest/bin/mpiicc

The env variable INTEL contains an ill formed folder name '**'.
Please fix that and the same for DIR.
Then try the simplified configure command below.

CFLAGS="-O3 -xsse4.2 -align" FCFLAGS="-O3 -xsse4.2" ./configure --prefix=$DIR/netcdf --enable-shared --with-mpi=$INTEL/oneapi/mpi/latest

@7BF794B0
Copy link
Author

7BF794B0 commented Feb 3, 2022

** just hide the username
I made a test. If you separately build MPIH without adding it to $PATH and explicitly specify MPIF77=$DIR/mpich/bin/mpif77 MPIF90=$DIR/mpich/bin/mpif90 then everything will be built successfully.
So the error is most likely related to mpiifort

@wkliao
Copy link
Member

wkliao commented Feb 3, 2022

It is likely. From config.log, I am seeing the 2 lines above the failure message.

/usr/bin/ld: cannot find -lmpifort
/usr/bin/ld: cannot find -lmpi

It indicates a problem of MPI F77 compiler, $INTEL/oneapi/mpi/latest/bin/mpif77
whose path to MPI libraries (LD_FLAGS) may not be set correctly. One way to
verify it is for you to use that compiler to compile a small test program and see
if the same error messages appear.

@wkliao
Copy link
Member

wkliao commented Feb 15, 2024

Hi, @7BF794B0

I am working on the next release which will come out soon.
It will be great if you can give the master branch a try and let me know.

I would suggest to use the following configure command
without setting other environment variables.

git clone https://github.com/Parallel-NetCDF/PnetCDF.git
cd PnetCDF
autoreconf -i
./configure --enable-shared --with-mpi=$INTEL/oneapi/mpi/latest/bin

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

2 participants