0

I am desperated and hope someone might be able to bring some light on this problem: I am trying to install netcdf-fortran in Fedora 35 using Intel compilers. To do so, I first installed ONEAPI from intel in /opt/intel/oneapi. Then, I install https://gmplib.org/download/gmp/gmp-6.2.0.tar.lz

https://www.mpfr.org/mpfr-current/mpfr-4.1.0.tar.gz

https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz

git clone https://gnu.googlesource.com/gcc

git checkout releases/gcc-10

source /opt/intel/oneapi/setvars.sh intel64

export PATH=/opt/intel/oneapi/compiler/2021.4.0/linux/bin:$PATH

export LD_LIBRARY_PATH=/opt/intel/oneapi/compiler/2021.4.0/linu/lib:$LD_LIBRARY_PATH

export PKG_CONFIG_PATH=/opt/intel/oneapi/compiler/2021.4.0/lib/pkgconfig:$PKG_CONFIG_PATH

export C_INCLUDE_PATH=/opt/intel/oneapi/compiler/2021.4.0/linux/include:$C_INCLUDE_PATH export CPLUS_INCLUDE_PATH=/opt/intel/oneapi/compiler/2021.4.0/linux/include:$CPLUS_INCLUDE_PATH

Then exported the utilities directory where I am install all these packages and exported it accordingly. Then, I kept installing:

szip-2.1.1.tar

libjpeg-turbo-2.1.2

gzip-1.11

bzip2-1.0.8

libuuid-1.0.3

brotli

gperf-3.1

gettext-0.21

hdf-4.2.15

hdf5-1.13.0

netcdf-c-4.8.1

and up everything compiles and works fine. Yet, when I tried to install https://downloads.unidata.ucar.edu/netcdf-fortran/4.5.3/netcdf-fortran-4.5.3.tar.gz Then it keeps failing and failing with the error: make[3]: * [Makefile:728: test-suite.log] Error 1

make[2]: * [Makefile:836: check-TESTS] Error 2

make[2]: Leaving directory '/SOME/LOCAL/ADDRESS/netcdf-fortran-4.5.0/nf03_test'

make[1]: * [Makefile:917: check-am] Error 2

make[1]: Leaving directory '/SOME/LOCAL/ADDRESS/netcdf-fortran-4.5.0/nf03_test'

I don't know what the problem is but it is not a problem with the version as even if I install an older version, the error keeps being the same.

I tried to follow the instructions I was finding about how to install these libraries.

Can someone please give me an advice on how to do this?

My configure is as follows: CC=icc FC=ifort F77=ifort CPP="icc -E" ./configure --prefix=$PRFX --with-sysroot=$PRFX --with-pic

I have defined: PRFX=/SOME/LOCAL/ADDRESS/

Thank you in advance,

Bpi
  • 3
  • 1

1 Answers1

0

When you say "... and up everything compiles and works fine." did you mean that you compiled all those packages with ONEAPI? or did you just install those from the depository?

It is much predictable to install netcdf-f when all other dependencies are compiled with a same compiler. Or you should refer to cross-compilation for all required dependencies.

Did you compile hdf5 and netcdf-c (which are one of the basic dependencies for netcdf-fortran) with the ONEAPI? If not, I recommend you doing that first.

I realized that using different compiler than GCC when compiling netcdf-fortran generates an error regarding shared library. You should try compiling it with static library by adding "--disable-shared --enable-static" during the "configuration" stage (for detailed instructions, consult the "Building with static libraries" sections of this link). Make sure you explicitly link the 'include' and 'lib' directories when you are using the netcdf-f library.

Redshoe
  • 125
  • 5
  • Thank you for the answer Redshoe. I did compile everything with ONEAPI except these four: gmp-6.2.0 mpfr-4.1.0 mpc-1.2.1 https://gnu.googlesource.com/gcc-10 These four were needed in order to make any other compilation with ONEAPI. For some reason, some built gcc-10 libraries are needed when compiling with ONEAPI. So I make sure to export the correct path. The rest of the packages are compile 100% with ONEAPI. I have tried the link you offered to the NetCDF webpage. I followed it and still I kept getting error. So, I will try your suggestion --disable-shared --enable-static Thank you – Bpi Dec 31 '21 at 21:27