Hi,
I am trying to install pgi on my mac but compilation always fails with:
C: PGC-S-0040-Illegal use of symbol
or
Fortran: library not found for -lgcc
Installation went ok and Xcode is here hence i am not sure where the problem may come from…
I did the following steps:
-----------------------------------
PGI compiler:
pgcc hello.c
PGC-S-0040-Illegal use of symbol, __BEGIN_DECLS (/usr/include/stdio.h: 164)
PGC-S-0035-Syntax error: Recovery attempted by replacing identifier __BEGIN_DECLS by ‘;’ (/usr/include/stdio.h: 238)
…
-----------------------------------
GNU compiler:
gcc hello.c ; a.out
hello
\
-----------------------------------
cat hello.f90
program hello
implicit none
print *,“hello.f90”
end program hello
-----------------------------------
pgf90 hello.f90
ld: warning: directory not found for option ‘-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64’
ld: warning: directory not found for option ‘-L/usr/lib/gcc/i686-apple-darwin10/4.2.1’
ld: library not found for -lgcc
-----------------------------------
pgf90 hello.f90 -L/usr/local/lib/gcc/x86_64-apple-darwin12.2.0/4.8.0
ld: warning: directory not found for option ‘-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64’
ld: warning: directory not found for option ‘-L/usr/lib/gcc/i686-apple-darwin10/4.2.1’
./a.out
hello
More details:
-----------------------------------
pgcc -V
pgcc 14.4-0 64-bit target on Mac OS X -tp penryn
-----------------------------------
pgcpuid
vendor id : GenuineIntel
model name : Intel(R) Core™2 Duo CPU P7550 @ 2.26GHz
type : -tp penryn-64
-----------------------------------
cksum PGI-Workstation-144.dmg
2993736332 702833821 PGI-Workstation-144.dmg
-----------------------------------
xcode-select --version
xcode-select version 2311.
-----------------------------------
xcode-select --print-path
/Applications/work/Xcode.app/Contents/Developer
-----------------------------------
xcodebuild -version
Xcode 5.1.1 Build version 5B1008
-----------------------------------
pg_config
BINDIR = /usr/bin
DOCDIR = /usr/share/doc/postgresql
HTMLDIR = /usr/share/postgresql
INCLUDEDIR = /usr/include
PKGINCLUDEDIR = /usr/include/postgresql
INCLUDEDIR-SERVER = /usr/include/postgresql/server
LIBDIR = /usr/lib
PKGLIBDIR = /usr/lib/postgresql
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/man
SHAREDIR = /usr/share/postgresql
SYSCONFDIR = /private/etc/postgresql
PGXS = /usr/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = ‘–infodir=/usr/share/info’ ‘–disable-dependency-tracking’ ‘–prefix=/usr’ ‘–sbindir=/usr/libexec’ ‘–sysconfdir=/private/etc’ ‘–mandir=/usr/share/man’ ‘–localstatedir=/private/var/pgsql’ ‘–htmldir=/usr/share/postgresql’ ‘–enable-thread-safety’ ‘–enable-dtrace’ ‘–with-tcl’ ‘–with-perl’ ‘–with-python’ ‘–with-gssapi’ ‘–with-krb5’ ‘–with-pam’ ‘–with-ldap’ ‘–with-bonjour’ ‘–with-openssl’ ‘–with-libxml’ ‘–with-libxslt’ ‘–with-system-tzdata=/usr/share/zoneinfo’ ‘CC=/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc’ ‘CFLAGS=-arch x86_64 -pipe -Os -g -Wall -Wno-deprecated-declarations’ ‘LDFLAGS=-arch x86_64 -pipe -Os -g -Wall -Wno-deprecated-declarations’ ‘LDFLAGS_EX=-mdynamic-no-pic’
CC = /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc
CPPFLAGS = -I/usr/include/libxml2
CFLAGS = -arch x86_64 -pipe -Os -g -Wall -Wno-deprecated-declarations -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv
CFLAGS_SL =
LDFLAGS = -arch x86_64 -pipe -Os -g -Wall -Wno-deprecated-declarations -Wl,-dead_strip_dylibs
LDFLAGS_EX = -mdynamic-no-pic
LDFLAGS_SL =
LIBS = -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lm
VERSION = PostgreSQL 9.1.9
\
-------------
pgf90 -dryrun hello.f90
Reading rcfile /opt/pgi/osx86-64/14.4/bin/.pgf90rc
Reading rcfile /opt/pgi/osx86-64/14.4/bin/nativerc
Reading rcfile /opt/pgi/osx86-64/14.4/bin/fnativerc
Reading rcfile /opt/pgi/osx86-64/14.4/bin/x86rc
Reading rcfile /opt/pgi/osx86-64/14.4/bin/x8664rc
Reading rcfile /opt/pgi/osx86-64/14.4/bin/osxrc
Reading rcfile /opt/pgi/osx86-64/14.4/bin/osx64rc
Reading rcfile /opt/pgi/osx86-64/14.4/bin/iparc
Reading rcfile /opt/pgi/osx86-64/14.4/bin/pgf90rc
Reading rcfile /opt/pgi/osx86-64/14.4/bin/pgftnrc
Reading rcfile /opt/pgi/osx86-64/14.4/bin/acc1rc
Reading rcfile /opt/pgi/osx86-64/14.4/bin/accosx8664rc
Skipping nolocalrc (not found)
Skipping localrc (not found)
Skipping localrc.jgmac (not found)
Skipping siterc (not found)
Skipping siterc.jgmac (not found)
Skipping .mypgirc (not found)
Skipping .mypgf90rc (not found)
Export PGI=/opt/pgi
Export PGIBIN=/opt/pgi/osx86-64/14.4/bin
/opt/pgi/osx86-64/14.4/bin/pgf901 hello.f90 -opt 1 -terse 1 -inform warn -nohpf -nostatic -quad -x 15 2 -x 49 0x400004 -x 51 0x20 -x 57 0x4c -x 58 0x10000 -x 124 0x1000 -x 119 0x1000 -x 59 4 -x 129 0x10 -x 51 0x20 -x 124 0x401 -x 19 0x400000 -tp penryn -x 57 0x7b0000 -x 58 0x78031040 -x 119 0x610400 -x 119 0x1000 -x 59 4 -x 129 0x10 -x 48 4608 -x 49 0x100 -x 120 0x200 -stdinc /opt/pgi/osx86-64/14.4/include:/usr/local/include:/usr/lib/gcc/i686-apple-darwin10/4.2.1/include:/usr/lib/gcc/i686-apple-darwin10/4.2.1/include:/usr/include -def unix -def __unix -def __unix__ -def __LITTLE_ENDIAN__ -def __inline__= -def osx86 -def __osx86 -def __osx86__ -def __APPLE__ -def __LP64__ -def __x86_64__ -def _M_IX86 -def __NO_MATH_INLINES -def __amd64__ -def __PGI_STRPTIME -def __extension__= -def __SSE__ -def __MMX__ -def __SSE2__ -def __SSE3__ -def __SSSE3__ -freeform -vect 48 -y 54 1 -x 70 0x40000000 -modexport hello.cmod -modindex hello.cmdx -output hello.ilm
/opt/pgi/osx86-64/14.4/bin/pgf902 hello.ilm -fn hello.f90 -opt 1 -terse 1 -inform warn -x 119 0x10000010 -x 129 0x80 -x 19 0x400000 -dollar '$' -x 119 0x40610400 -x 119 0x1000 -x 59 4 -x 129 0x10 -x 70 0x8000 -x 122 1 -x 125 0x20000 -x 117 0x1000 -x 120 0x80 -x 122 0x40 -x 123 0x1000 -x 127 21 -tp penryn -y 80 0x40000000 -x 120 0x400 -x 120 0x1000 -y 119 0x40000000 -x 51 0x20 -x 124 0x401 -x 124 0x4000 -y 15 2 -x 57 0x3b0000 -x 58 0x48000000 -x 49 0x100 -x 120 0x200 -astype 1 -x 70 0x40000000 -x 117 0x2000 -x 124 1 -y 189 0x4000000 -asm hello.s
/opt/local/bin/as -arch x86_64 hello.s -o hello.o
/opt/pgi/osx86-64/14.4/bin/pgappend -noerror hello.o -name .IPDINFO hello.cmod -name .IPEINFO hello.cmdx
/opt/local/bin/ld /usr/lib/crt1.o /opt/pgi/osx86-64/14.4/lib/pgimainmx.o /opt/pgi/osx86-64/14.4/lib/f90main.o -L/opt/pgi/osx86-64/14.4/lib -L/usr/lib -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 hello.o -macosx_version_min 10.6.0 -rpath /opt/pgi/osx86-64/14.4/lib -framework Security -framework IOKit -framework CoreFoundation -lpgmp -lpthread -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lc -lnspgc -lpgc -lm -lgcc -lc -lgcc -lSystem
Keeping ./hello.dbg
Thanks for any help, jg.