Install zlib, hdf5 and netcdf with pgf

415 views Asked by At

I am trying to install NetCDF with PGI. However, to do so, I first need to install zlib and when I try to do that, I do:

export C_INCLUDE_PATH=/the/path/to/include/:$C_INCLUDE_PATH

export PATH=/the/path/to/compilers/bin/:$PATH Then I try:

CC=pgcc CXX=pgc++ ./configure --archs="x86_64"

I get the following error:

Building shared library libz.so.1.2.11 with pgcc.
Checking for size_t... No.
Checking for long long... Yes.
Failed to find a pointer-size integer type.
** ./configure aborting.```


The **configure.log** says, among other things:
```pgcc -c -O3 x86_64 ztest212261.c
ztest212261.c:
"/usr/include/stdio.h", line 183: error: attribute "__malloc__" does not take arguments
    __attribute_malloc__ __attr_dealloc_fclose __wur;

Can someone give me a hint on this? Thank you in advance.

1

There are 1 answers

0
Redshoe On

In order to compile netcdf-c and their dependencies, you need to not only link the include path but also lib path. So you need to do something like

export C_INCLUDE_PATH=/the/path/to/include/:$C_INCLUDE_PATH
export LD_LIBRARY_PATH=/the/path/to/lib/:$LD_LIBRARY_PATH
export PATH=/the/path/to/compilers/bin/:$PATH

And for the configuration, you also need to set CFLAGS and such.