Parallel-NetCDF / PnetCDF

Source code repository of PnetCDF library and utilities
https://parallel-netcdf.github.io
Other
80 stars 22 forks source link

configure: error: linking to Fortran libraries from C fails #105

Closed HathewayWill closed 1 year ago

HathewayWill commented 1 year ago

trying to install pnetcdf with the new intel nextgen compilers and these are the errors I get.

checking for Fortran compiler vendor... intel checking base compiler command in MPIF90 wrapper... not found checking for Fortran flag needed to accept fixed-form source... -fixed checking for dummy main to link with Fortran libraries... unknown configure: error: in/home/workhorse/WRF_Intel/Downloads/pnetcdf-1.12.3': configure: error: linking to Fortran libraries from C fails See config.log' for more details config.log configure_pnetcdf.log

wkliao commented 1 year ago

Looks like this is an autoconf issue. Autoconf 2.70 has fixed it. Could you try the PnetCDF master branch using autoconf 2.70?

Please see issue #94

I was able to reproduce the same errors using Intel OneAPI and confirm that using autoconf 2.70 solves the problem. Below is the module loaded in my test.

% module li

Currently Loaded Modules:
  1) intel-oneapi-compilers/2023.0.0   2) intel-oneapi-mpi/2021.5.1

Below is the configure command used to test.

./pnetcdf-1.12.3/configure \
                            MPICC="mpiicc -cc=icx" \
                            MPICXX="mpiicpc -cxx=icpx" \
                            MPIFC="mpiifort -fc=ifx" \
                            MPIF90="mpiifort -fc=ifx" \
                            MPIF77="mpiifort -fc=ifx"
HathewayWill commented 1 year ago

Looks like this is an autoconf issue. Autoconf 2.70 has fixed it. Could you try the PnetCDF master branch using autoconf 2.70?

Please see issue #94

I was able to reproduce the same errors using Intel OneAPI and confirm that using autoconf 2.70 solves the problem. Below is the module loaded in my test.

% module li

Currently Loaded Modules:
  1) intel-oneapi-compilers/2023.0.0   2) intel-oneapi-mpi/2021.5.1

Below is the configure command used to test.

./pnetcdf-1.12.3/configure \
                            MPICC="mpiicc -cc=icx" \
                            MPICXX="mpiicpc -cxx=icpx" \
                            MPIFC="mpiifort -fc=ifx" \
                            MPIF90="mpiifort -fc=ifx" \
                            MPIF77="mpiifort -fc=ifx"

@wkliao

'#############################Install Parallel-netCDF##############################

Make file created with half of available cpu cores

Hard path for MPI added

################################################################################## cd $WRF_FOLDER/Downloads tar -xzvf pnetcdf-1.12.3.tar.gz cd pnetcdf-1.12.3 CC=$MPICC FC=$MPIFC CXX=$MPICXX F90=$MPIF90 F77=$MPIF77 CFLAGS=$CFLAGS ./configure --prefix=$DIR/grib2 --enable-shared --enable-static 2>&1 | tee configure_pnetcdf.log

make -j $CPU_HALF_EVEN 2>&1 | tee make.log make -j $CPU_HALF_EVEN install 2>&1 | tee make.install.log

make check

export PNETCDF=$DIR/grib2'

what am i doing wrong?

wkliao commented 1 year ago

Please run command autoreconf before configure, i.e.

cd pnetcdf-1.12.3
autoreconf
CC=$MPICC FC=$MPIFC CXX=$MPICXX F90=$MPIF90 F77=$MPIF77 CFLAGS=$CFLAGS ./configure --prefix=$DIR/grib2 --enable-shared --enable-static 2>&1 | tee configure_pnetcdf.log
HathewayWill commented 1 year ago

Please run command autoreconf before configure, i.e.

cd pnetcdf-1.12.3
autoreconf
CC=$MPICC FC=$MPIFC CXX=$MPICXX F90=$MPIF90 F77=$MPIF77 CFLAGS=$CFLAGS ./configure --prefix=$DIR/grib2 --enable-shared --enable-static 2>&1 | tee configure_pnetcdf.log

@wkliao what exactly does autoreconf do?

wkliao commented 1 year ago

It regenerates file configure.