Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28603 Discussions

pnetcdf configure error using icx and ifx in OneAPI 2023.1.0

Jervie
Novice
1,262 Views

Hello,

 

I'm installing pnetcdf-1.12.3 using icx anf ifx in OneAPI 2023.1.0. However, when I configure it, I met the following error:

 

 /bin/ld: cannot find -loopopt=1
icx: error: linker command failed with exit code 1 (use -v to see invocation)
configure:28388: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "PnetCDF"
| #define PACKAGE_TARNAME "pnetcdf"
| #define PACKAGE_VERSION "1.12.3"
| #define PACKAGE_STRING "PnetCDF 1.12.3"
| #define PACKAGE_BUGREPORT "parallel-netcdf@mcs.anl.gov"
| #define PACKAGE_URL "https://parallel-netcdf.github.io"
| #define PACKAGE "pnetcdf"
| #define VERSION "1.12.3"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define ENABLE_CXX 1
| #define ENABLE_FORTRAN 1
| /* end confdefs.h. */
| #define FC_DUMMY_MAIN _main
| #ifdef FC_DUMMY_MAIN
| #ifndef FC_DUMMY_MAIN_EQ_F77
| # ifdef __cplusplus
| extern "C"
| # endif
| int FC_DUMMY_MAIN() { return 1; }
| #endif
| #endif
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:28404: result: unknown
configure:28421: error: in `/opt/pnetcdf-1.12.3':
configure:28423: error: linking to Fortran libraries from C fails

 

Please see the attached `config.log'  file for more details.

I have posted the question here https://community.intel.com/t5/Intel-Fortran-Compiler/pnetcdf-configure-error-using-icx-and-ifx/m-p/1489151#M166469 before. I have no idea why I cannot reply to that one, so I posted a new one here. But I updated to gcc 10.2.0, cmake  3.26.4 and autoconf 2.70 following your suggestions, and the error still happens.

 

Any help?

Thanks!

6 Replies
Ron_Green
Moderator
1,235 Views

How did you set up the env vars to use the oneapi compilers?  I cloned Pnetcdf and got the configure to work without issue.  I did this

 

export MPICC="mpiicc -cc=icx" 
export MPICXX="mpiicpc -cxx=icpx"
export MPIF77="mpiifort -fc=ifx"
export MPIF90="mpiifort -fc=ifx"
./configure --prefix=/cts/tools/library/pnetcdf-1.12.3

 you'll still need to specify the include and library paths for netcdf-c, of course, but this should get you past the configure step.

the github site

 

and I found I needed the autoreconf command shown here.

and of course

./configure --help

 

for all the options you may want to configure as well.  Like the netcdf-c stuff.

 

ron

 

 

 

0 Kudos
Lumos
Beginner
906 Views

Hi

 

I encountered the same problem when compiling pnetcdf1.12.3 with oneapi2024. How did you solve it at last?

 

Best,

Lumos

0 Kudos
Lumos
Beginner
904 Views

I got it!

Before running configure command to build PnetCDF, please run commands below first.

cd PnetCDF
autoreconf -i
0 Kudos
Lumos
Beginner
878 Views

New error encountered while make.


@Lumos wrote:

I got it!

Before running configure command to build PnetCDF, please run commands below first.

cd PnetCDF
autoreconf -i

  CC       attr_getput.lo
attr_getput.c:219:1: error: expected identifier or '('
  219 | <U+0001>
      | ^
attr_getput.c:393:1: error: expected identifier or '('
  393 | <U+0001>
      | ^
attr_getput.c:427:1: error: expected identifier or '('
  427 | <U+0001>
      | ^
attr_getput.c:702:1: error: expected identifier or '('
  702 | <U+0001>
      | ^
4 errors generated.
make[3]: *** [Makefile:539: attr_getput.lo] Error 1
make[3]: Leaving directory '/LIBRARIES/intel2024/pnetcdf-1.12.3/src/dispatchers'
make[2]: *** [Makefile:455: all] Error 2
make[2]: Leaving directory '/LIBRARIES/intel2024/pnetcdf-1.12.3/src/dispatchers'
make[1]: *** [Makefile:482: all-recursive] Error 1
make[1]: Leaving directory '/LIBRARIES/intel2024/pnetcdf-1.12.3/src'
make: *** [Makefile:540: all-recursive] Error 1

Any help would be greatly appreciated.

 

0 Kudos
Lumos
Beginner
878 Views

My flags:

export CC=mpiicx
export CXX=mpiicpx
export FC=mpiifx
export F90=mpiifx
export F77=mpiifx
export CFLAGS="-O2 -fPIC"
export FCFLAGS="-O2 -fPIC"
export CXXFLAGS="-O2 -fPIC"
export CPPFLAGS="-I/LIBRARIES/intel2024/hdf51.14.3/include -I/LIBRARIES/intel2024/szip2.1.1/include -I/LIBRARIES/intel2024/zlib1.3/include"
export LDFLAGS="-L/LIBRARIES/intel2024/hdf51.14.3/lib -lhdf5_hl -lhdf5 -lz -lm -L/LIBRARIES/intel2024/szip2.1.1/lib  -L/LIBRARIES/intel2024/zlib1.3/lib"
./configure --prefix=$DIR/pnetcdf1.12.3 --with-mpi=/Compiler/intel2024/oneapi/mpi/2021.11 --enable-subfiling --enable-shared --enable-large-file-test --enable-null-byte-header-padding --enable-burst-buffering --enable-profiling --enable-relax-coord-bound
0 Kudos
Mikko1
Beginner
212 Views

I found a clue from this github issue: https://github.com/spack/spack/issues/37172

and it seems like the bison compiled by oneAPI will generate garbage output bytes in attr_getput.c

Use bison of gcc version will solve this issue.

0 Kudos
Reply