Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29280 Discussions

pnetcdf configure error using icx and ifx in OneAPI 2023.1.0

Jervie
Novice
3,177 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!

8 Replies
Ron_Green
Moderator
3,150 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
2,821 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
2,819 Views

I got it!

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

cd PnetCDF
autoreconf -i
0 Kudos
Lumos
Beginner
2,793 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
2,793 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
2,127 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
Lumos
Beginner
1,880 Views

Thank you very much for your reply. But I don't think I used bison. Here is the bison in the system.

$ which bison
/usr/bin/bison

$ bison -V
bison (GNU Bison) 3.0.4
Written by Robert Corbett and Richard Stallman.

Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 What exactly should I do? Thank you very much!

0 Kudos
Lumos
Beginner
1,854 Views

But I used m4 compiled by oneapi. Now switch to the system's default GCC-compiled m4. And upgrade to pnetcdf-1.13.0 without using the autoreconf -i command. Looks like it can be constructed.

0 Kudos
Reply