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

pnetcdf configure error using icx and ifx

Jervie
Novice
644 Views

Hello,

 

I'm installing pnetcdf-1.12.3 using cx 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
See `config.log' for more details

 

Any help?

Thanks!

0 Kudos
3 Replies
Barbara_P_Intel
Moderator
594 Views

What version of CMake are you using? 

Try the latest stable version. That looks like 3.26.4.

 

0 Kudos
Ron_Green
Moderator
578 Views

We recommend a minimum of Cmake 3.24, as it has the modules to recognize the icx and ifx compilers.

Also, you need gcc 9 or greater to get C++ standards support needed for icx.

 

it does look like you have a cmake that is pre- 3.24

 

Also, did you set FC, F90, or F77 to ifx?  Look into 'config.log' to see if "gfortran" appears.  It is the default and has to be overridden.

0 Kudos
Ron_Green
Moderator
571 Views

Also this report from 2020 indicates the "-loopopt=3" could be coming from an old Autoconf version.

To quote Bill from this old article

"Autoconf 2.70 was released today (see https://lists.gnu.org/archive/html/autotools-announce/2020-12/msg00001.html for details).  Updating to autoconf 2.70 fixes the “-loopopt=0” issue described in this discussion."

 

So you need an Cmake 3.24 or greater and autoconf 2.70 or greater.

0 Kudos
Reply