installing and compiling netcdf-3.6.0-p1 with pgf90 compiler

Hi all,
I’m trying to install and compiling netcdf-3.6.0-p1 with pgf90 compiler in Linux machine
[3dvar@drizzle bin]$ uname -a
Linux drizzle.hupas.howard.edu 2.4.20-28.8 #1 Thu Dec 18 12:53:39 EST 2003 i686 i686 i386 GNU/Linux
But i have a problem at “make install” step which keeps on installing the same ACML everytime n enters a loop/cycle.

Can anyone help me with this,
Peter

Hi Peter,

We have a users guide on compiling NetCDF (http://www.pgroup.com/resources/netcdf/netcdf360_pgi60.htm). Perhaps this may help. If not, can you post a bit more information about the issue. I don’t believe that the ACML library is needed for NetCDF so I don’t quite understand the error.

Thanks,
Mat

Hi,
i’m trying to compile netcdf-3.6.0-p1 with PGI 6.0 compiler.And i was following the instructions at this link:http://www.pgroup.com/resources/netcdf/netcdf360_pgi60.htm
But i got these errors at ./configure step.These errors were in the file config.log
--------------------errors--------------------------------------------------------
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking for top-level source-directory… /tmp/working/netcdf-3.6.0-p1/src
checking for C compiler default output file name… configure: error: C compiler cannot create executables
See `config.log’ for more details.
-------- ##

hostname = drizzle.hupas.howard.edu
uname -m = i686
uname -r = 2.4.20-28.8
uname -s = Linux
uname -v = #1 Thu Dec 18 12:53:39 EST 2003

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /usr/local/lf9562/bin
PATH: /usr/bin/linux86-64/6.0/bin/pgf90
PATH: /home/3dvar/bin
PATH: /bin
PATH: /usr/sbin
PATH: /usr/bin/linux86-64/6.0/bin
PATH: /usr/local/perl
PATH: usr/local/bin
PATH: /sbin
PATH: /usr/bin

\

-----------

Core tests.

-----------

configure:1369: checking build system type
configure:1387: result: i686-pc-linux-gnu
configure:1395: checking host system type
configure:1409: result: i686-pc-linux-gnu
configure:1421: checking for top-level source-directory
configure:1424: result: /tmp/working/netcdf-3.6.0-p1/src
configure:1531: checking for C compiler version
configure:1534: pgcc --version </dev/null >&5
./configure: line 1: /usr/bin/linux86-64/6.0/bin/pgcc: cannot execute binary file
configure:1537: $? = 126
configure:1539: pgcc -v </dev/null >&5
./configure: line 1: /usr/bin/linux86-64/6.0/bin/pgcc: cannot execute binary file
configure:1542: $? = 126
configure:1544: pgcc -V </dev/null >&5
./configure: line 1: /usr/bin/linux86-64/6.0/bin/pgcc: cannot execute binary file
configure:1547: $? = 126
configure:1570: checking for C compiler default output file name
configure:1573: pgcc -02 -Msignextend -V -DNDEBUG -DpgiFortran conftest.c >&5
./configure: line 1: /usr/bin/linux86-64/6.0/bin/pgcc: cannot execute binary file
configure:1576: $? = 126
configure: failed program was:
| /* confdefs.h. /
|
| #define PACKAGE_NAME “netCDF”
| #define PACKAGE_TARNAME “netcdf”
| #define PACKAGE_VERSION “3.6.0”
| #define PACKAGE_STRING “netCDF 3.6.0”
| #define PACKAGE_BUGREPORT “support@unidata.ucar.edu
| /
end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:1615: error: C compiler cannot create executables
See `config.log’ for more details

-------------------END---------------------------------------------------------
Can anyone help me with this,
thanks,
petero

Hi Petero,

For some reason your pgcc won’t execute. Either your installation is corrupt, your don’t have permissions set correctly, or there is a problem with your license.

Can you post the output of the following command. This might give us more information about what’s going on.

ls -l  /usr/bin/linux86-64/6.0/bin/pgcc
 pgcc -V -dryrun x.c

Thanks,
-Mat

Hi Mat,
thanks for reply,
Here is the output of commands you gave me,

[root@drizzle 3dvar]# ls -l /usr/bin/linux86-64/6.0/bin/pgcc
-rwxr-xr-x 1 909 1011 149288 Mar 28 12:54 /usr/bin/linux86-64/6.0/bin/pgcc
[root@drizzle 3dvar]# pgcc -V -dryrun x.c
bash: /usr/bin/linux86-64/6.0/bin/pgcc: cannot execute binary file
[root@drizzle 3dvar]#

thanks,
petero,

Hi Petero,

The 64-bit compilers won’t execute on a 32-bit system. Reset the path to compilers to “/usr/bin/linux86/6.0/bin” and things should work.

  • Mat

Mat,
i still see the following errors in config.log:

  1. checking for C compiler default output file name… configure: error: C compiler cannot create executables.
  2. pgcc-Fatal-unable to find any RC file
  3. configure: failed program was:
    | /* confdefs.h. */

any suggestion?

thanks,
petero

Hi Petero,

Are you able to compile a simple hello world program? What is the output from the dryrun command when you use the 32-bit compilers?

/usr/bin/linux86/6.0/bin/pgcc -V -dryrun x.c

I’m wondering if you have an installation issue. What OS are you using and what does your localrc file have configured? (“cat /usr/bin/linux86/6.0/bin/localrc”).

If your localrc file doesn’t exist or is empty, try reconfiguring the install by changing to the /usr/bin/linux86/6.0/bin directory and running ‘makelocalrc -x /usr/bin/linux86/6.0’.

  • Mat

Yes Mat,
Thanks for your help,
Below are some info about my system,but i still cannot compile it successfully and i have also included those errors below.Also i have a quick question,is it fine to run ./configure several time without doin cleaning?
thanks in advance,

[root@drizzle bin]# uname -a
Linux drizzle.hupas.howard.edu 2.4.20-28.8 #1 Thu Dec 18 12:53:39 EST 2003 i686 i686 i386 GNU/Linux

[root@drizzle bin]# pgcc -V -dryrun x.c
pgcc-Fatal-unable to find any RC file

[root@drizzle bin]# pwd
/usr/bin/linux86/6.0/bin
[root@drizzle bin]# cat localrc
cat: localrc: No such file or directory

[root@drizzle bin]# makelocalrc -x /usr/bin/linux86/6.0
[root@drizzle bin]# cat localrc
set LFC=-lg2c;
set LDSO=/lib/ld-linux.so.2;
set GCCDIR=/usr/lib/gcc-lib/i386-redhat-linux/3.2;
set GCCINC=/usr/lib/gcc-lib/i386-redhat-linux/3.2/include;
set G77DIR=/usr/lib/gcc-lib/i386-redhat-linux/3.2;
set THROW=__THROW=;
set HAMMER=;
set X86_64=;

makelocalrc executed by root Tue May 10 11:48:33

[root@drizzle bin]#

After i compiled again i got these errors:

  1. checking for C compiler default output file name… configure: error: C compiler cannot create executables
  2. ./PGIinstall: No such file or directory
  3. configure: failed program was:
    | /* confdefs.h. */
  4. configure:1615: error: C compiler cannot create executables

Hi Petero,

The “PGIInstall” file gets created when you first install the compilers. I’m wondering if the main problem is that you untar’d the PGI package but forgot to install it?

If so, you’ll need to run “./install” from root directory of the untar’d package. Note that you can not install to the same directory where you’ve untar’d, so I suggest removing you current PGI directory tree, untar the package in a temporary directory, and then run “install”.

  • Mat

Mat,
I removed the pgi tree and install it again as you suggested and run ./configure ,but i still get these errors below in config.log.Also i have included the compilation of my simple hello.c program,localrc configuration and dryrun x.c.

Any suggestions as to what went wrong,
thanks,
petero

  1. checking for C compiler default output file name… configure: error: C compiler cannot create executables
  2. configure:1573: pgcc -02 -Msignextend -V -DNDEBUG -DpgiFortran conftest.c >&5
    pgcc-Warning-Unknown switch: -02
    ./PGIinstall: No such file or directory
  3. configure: failed program was:
    /* confdefs.h. */

-----this is localrc file configuration--------------------
[root@drizzle bin]# cat /usr/pgi/linux86/6.0/bin/localrc
set LFC=-lg2c;
set LDSO=/lib/ld-linux.so.2;
set GCCDIR=/usr/lib/gcc-lib/i386-redhat-linux/3.2;
set GCCINC=/usr/lib/gcc-lib/i386-redhat-linux/3.2/include;
set G77DIR=/usr/lib/gcc-lib/i386-redhat-linux/3.2;
set THROW=__THROW=;
set HAMMER=;
set X86_64=;

makelocalrc executed by root Tue May 10 23:46:49

-------------end of localrc----------------------

------------this is gcc -v hello.c---------------
[root@drizzle 3dvar]# gcc -v hello.c
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs
Configured with: …/configure --prefix=/usr --mandir=/usr/share/man --infodir=/u sr/share/info --enable-shared --enable-threads=posix --disable-checking --host=i 386-redhat-linux --with-system-zlib --enable-cxa_atexit
Thread model: posix
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
/usr/lib/gcc-lib/i386-redhat-linux/3.2/cc1 -lang-c -v -D__GNUC
=3 -D__GNUC_MIN OR__=2 -D__GNUC_PATCHLEVEL__=0 -D__GXX_ABI_VERSION=102 -D__ELF__ -Dunix -D__gnu_ linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__li nux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i386__ hello.c -quiet -dumpbase hello.c -ve rsion -o /tmp/ccK15EEL.s
GNU CPP version 3.2 20020903 (Red Hat Linux 8.0 3.2-7) (cpplib) (i386 Linux/ELF)
GNU C version 3.2 20020903 (Red Hat Linux 8.0 3.2-7) (i386-redhat-linux)
compiled by GNU C version 3.2 20020903 (Red Hat Linux 8.0 3.2-7).
ignoring nonexistent directory “/usr/i386-redhat-linux/include”
#include “…” search starts here:
#include <…> search starts here:
/usr/local/include
/usr/lib/gcc-lib/i386-redhat-linux/3.2/include
/usr/include
End of search list.
as -V -Qy -o /tmp/cco1a1yn.o /tmp/ccK15EEL.s
GNU assembler version 2.13.90.0.2 (i386-redhat-linux) using BFD version 2.13.90. 0.2 20020802
/usr/lib/gcc-lib/i386-redhat-linux/3.2/collect2 --eh-frame-hdr -m elf_i386 -dyn amic-linker /lib/ld-linux.so.2 /usr/lib/gcc-lib/i386-redhat-linux/3.2/…/…/…/c rt1.o /usr/lib/gcc-lib/i386-redhat-linux/3.2/…/…/…/crti.o /usr/lib/gcc-lib/i3 86-redhat-linux/3.2/crtbegin.o -L/usr/lib/gcc-lib/i386-redhat-linux/3.2 -L/usr/l ib/gcc-lib/i386-redhat-linux/3.2/…/…/… /tmp/cco1a1yn.o -lgcc -lgcc_eh -lc -lg cc -lgcc_eh /usr/lib/gcc-lib/i386-redhat-linux/3.2/crtend.o /usr/lib/gcc-lib/i38 6-redhat-linux/3.2/…/…/…/crtn.o
[root@drizzle 3dvar]# gcc hello.c
[root@drizzle 3dvar]#
------------------end of gcc compilation---------------------
-----------------start of dryrun x.c-------------------------
[root@drizzle 3dvar]# cd /usr/pgi/linux86/6.0/bin/
[root@drizzle bin]# pgcc -V -dryrun x.c
Reading rcfile /usr/pgi/linux86/6.0/bin/.pgccrc
Reading rcfile /usr/pgi/linux86/6.0/bin/nativerc
Reading rcfile /usr/pgi/linux86/6.0/bin/fnativerc
Reading rcfile /usr/pgi/linux86/6.0/bin/ccrc
Reading rcfile /usr/pgi/linux86/6.0/bin/x86rc
Reading rcfile /usr/pgi/linux86/6.0/bin/x8632rc
Reading rcfile /usr/pgi/linux86/6.0/bin/lin86rc
Reading rcfile /usr/pgi/linux86/6.0/bin/lin8632rc
Reading rcfile /usr/pgi/linux86/6.0/bin/iparc
Reading rcfile /usr/pgi/linux86/6.0/bin/localrc
Skipping siterc (not found)
Skipping .mypgccrc (not found)

pgcc 6.0-1 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.

/usr/pgi/linux86/6.0/bin/pgc x.c -opt 1 -version -terse 1 -inform warn -x 119 0xa10000 -x 119 0x100000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 119 0x40000000 -x 69 4 -x 19 0x400000 -x 80 0x300 -y 80 0x1000 -x 80 0x40000000 -x 119 0x8000000 -astype 0 -stdinc /usr/pgi/linux86/6.0/include:/usr/local/include:/usr/lib/gcc-lib/i386-redhat-linux/3.2/include:/usr/lib/gcc-lib/i386-redhat-linux/3.2/include:/usr/include -def unix -def __unix -def unix -def linux -def __linux -def linux -def inline= -def i386 -def __i386 -def i386 -def __NO_MATH_INLINES -def linux86 -def __THROW= -predicate ‘#machine(i386) #lint(off) #system(unix) #system(posix) #cpu(i386)’ -asm /tmp/pgccaaaaamlCaC.s

/usr/bin/as /tmp/pgccaaaaamlCaC.s -o /tmp/pgccbaaaamlCaC.o

/usr/bin/ld /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc-lib/i386-redhat-linux/3.2/crtbegin.o -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /tmp/pgccbaaaamlCaC.o -L/usr/pgi/linux86/6.0/lib -L/usr/lib -L/usr/lib/gcc-lib/i386-redhat-linux/3.2 -rpath /usr/pgi/linux86/6.0/lib -lc -lnspgc -lpgc -lm -lgcc -lc -lgcc /usr/lib/gcc-lib/i386-redhat-linux/3.2/crtend.o /usr/lib/crtn.o
Unlinking /tmp/pgccaaaaamlCaC.s
Unlinking /tmp/pgccbaaaamlCaC.o
[root@drizzle bin]#
--------------------------end of dryrun x.c-----------------------------

Hi Petero,

Looks like you’ve got it installed correctly. The error your geting now is because the the flag is “-O2” (the letter ‘O’ as in optimization level 2), not “-02” (the number zero).

  • Mat

hi mat,
It seems everything is okay,but i have one error which say C compiler cannot run C compiled programs.
could you help me with this?
thanks,

Petero.

---------------------here is my config.log file------------------
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking for top-level source-directory… /tmp/working/netcdf-3.6.0-p1/src
checking for C compiler default output file name… b.out
checking whether the C compiler works… configure: error: cannot run C compiled programs.
If you meant to cross compile, use --host'. See config.log’ for more details.

uname -s = Linux
uname -v = #1 Thu Dec 18 12:53:39 EST 2003

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /usr/local/lf9562/bin
PATH: /usr/local/lf9562/bin
PATH: /usr/local/bin
PATH: /bin
PATH: /usr/bin
PATH: /usr/X11R6/bin
PATH: /home/3dvar/bin
PATH: /bin
PATH: /usr/pgi/linux86/6.0/bin
PATH: /usr/bin/perl
PATH: usr/local/bin
PATH: /sbin
PATH: /usr/bin
PATH: /usr/sbin
PATH: /home/3dvar/bin
PATH: /bin
PATH: /usr/sbin
PATH: /usr/pgi/linux86/6.0/bin
PATH: /usr/local/perl
PATH: usr/local/bin
PATH: /sbin
PATH: /usr/bin

\

-----------

Core tests.

-----------

configure:1369: checking build system type
configure:1387: result: i686-pc-linux-gnu
configure:1395: checking host system type
configure:1409: result: i686-pc-linux-gnu
configure:1421: checking for top-level source-directory
configure:1424: result: /tmp/working/netcdf-3.6.0-p1/src
configure:1531: checking for C compiler version
configure:1534: pgcc --version </dev/null >&5
pgcc-Warning-Unknown switch: --version
pgcc-Warning-No files to process
configure:1537: $? = 0
configure:1539: pgcc -v </dev/null >&5
pgcc-Warning-No files to process
configure:1542: $? = 0
configure:1544: pgcc -V </dev/null >&5
pgcc 6.0-1 32-bit target on x86 Linux
configure:1576: $? = 0
configure:1622: result: b.out
configure:1627: checking whether the C compiler works
configure:1633: ./b.out
./configure: line 1: ./b.out: No such file or directory
configure:1636: $? = 127
configure:1645: error: cannot run C compiled programs.
If you meant to cross compile, use --host'. See config.log’ for more details.

Hi Petero,

I posted my reply in your new topic.

  • Mat