After failing with every combination of flags to run the configure script provided with OpenMPI-1.2.5, I did a little Googling for the recurring error message and found this:
Re: Portland Group cpp fails sanity check
Paul Eggert
Wed, 09 Jan 2008 17:04:23 -0800
“Brad Larsen” <[EMAIL PROTECTED]> writes:
configure:4274: /opt/pgi/linux86-64/7.1-1/bin/pgcpp conftest.c
“conftest.c”, line 16: error: identifier “Syntax” is undefined
Syntax error
^
Apparently the Portland group preprocessor refuses to preprocess
input files unless it can also fully parse them as C programs.
This behavior is weird and will break Autoconf-generated scripts.
Try substituting a C preprocessor that is not so all-fired picky:
you can use GCC’s preprocessor for that.
Now admittedly I’m running Mac OS X 10.4.11 on a dual-quadcore machine, with PGI Workstation 7.1-5, so not the same environment as the guy I ran across, but is Eggert correct? Am I doomed to failure anytime I throw the PGI tools at a GNU autoconf-driven build?
(And if anyone can pull off an OpenMPI build on OS X with PGI, I’d love to hear how you did it.)
Please use our latest release. I did it with 7.1-5 release, Openmpi 1.2.5. You might need to adjust some flags(multiply_defined) in opal/tools/wrappers/Makefile and a couple other places.
*** C++ compiler and preprocessor
checking whether we are using the GNU C++ compiler… no
checking whether pgcpp accepts -g… yes
checking dependency style of pgcpp… none
checking how to run the C++ preprocessor… pgcpp -E
checking for the C++ compiler vendor… portland group
checking if C++ compiler works… no
It appears that your C++ compiler is unable to produce working
executables. A simple test application failed to properly
execute. Note that this is likely not a problem with Open MPI,
but a problem with the local compiler installation. More
information (including exactly what command was given to the
compiler and what error resulted when the command was executed) is
available in the config.log file in this directory.
configure: error: Could not run a simple C++ program. Aborting.
I appreciate your help with this very much; my frustration’s running high because this should be a simple step towards doing what I /really/ want to do, and that’s compile my own code.
I’m using 7.1-5. I tried a simple “Hello, world” program in C++ and got the same /usr/bin/ld64 error from the configure script. A little Googling and some trial-and-error revealed that I needed to pass “-tp=p7” through the various *FLAGS options to the configure script. Now it’s breezing through the C tests, the C++ tests, the F77 tests, and I’ve run into a known issue involving OpenMPI, PGI compilers, and the location of modules when -g is used.
I’m making solid progress now and you definitely got me going in that direction. Thanks so much for your help!
Something is not quite right. Is your machine 32-bit only? Or you tried to compile 32-bit? Do you have /opt/pgi/osx86-64/7.1-5/bin directory? If yes, what is in localrc file in that directory. I assume you were admin/root when you installed compilers?
I had an admin do the installation; he put in the 32 and 64 bit versions. The localrc file you referenced is:
OPUS> cat /opt/pgi/osx86-64/7.1-5/bin/localrc
set GCCDIR=/usr/lib/gcc/i686-apple-darwin8/4.0.1;
set GCCINC=/usr/lib/gcc/i686-apple-darwin8/4.0.1/include;
set OEM_INFO=64-bit target on Apple OS/X ;
set LOCALRC=YES;
set LC=$if(-Bstatic,-lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc, -lgcc -lc -lgcc) -lSystem;
export PGI=“/opt/pgi”;
makelocalrc executed by root Tue Mar 4 15:30:10
The machine is running Mac OS 10.4.11, which has a blend of 32-bit and 64-bit code on it. My software, the stuff I need a functioning OpenMPI for, is all 64-bit.
I don’t have anything explicitly set in my environment to parse the “localrc” file – is that something I should have done somewhere?
How do you set your PATH?
Can you post your output of echo $PATH? I am trying to check why you get an error when using 64-bit compiler.
What is output of pgf90 -V or pgcpp -V?
Using -tp=p7 will give you 32-bit compiler.
Please make sure to clean up your configuration(OpenMPI) before reconfigure with 64-bit compilers. If there is any -tp=p7 or -tp=??? (anything) in your configuration/makefile, make sure to remove them.
There is no need to parse localrc. The compiler driver should handle it as long as you set the PATH correctly.
PGI compilers use system linker. There is a problem involving debugging information with a linker (ld64). The problem occurs in Tiger. They have fixed problem in Leopard.
You don’t see an error in 32-bit because there is not an issue with 32-bit linker.
I would recommend to run configuration without -g on Tiger.
pgf90 7.1-5 64-bit target on Apple OS/X
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86-64 OSX 7.1-5
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc. All Rights Reserved.
PGF90-F-0002-Unable to open source input file: nofile.f
PGF90/x86-64 OSX 7.1-5: compilation aborted
OPUS> pgcpp -V nofile.cpp
pgcpp 7.1-5 64-bit target on Apple OS/X
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc. All Rights Reserved.
Edison Design Group C/C++ Front End, version 3.6 (Jan 23 2008 12:37:02)
Copyright 1988-2006 Edison Design Group, Inc.
Catastrophic error: could not open source file “nofile.cpp”
1 catastrophic error detected in the compilation of “nofile.cpp”.
Compilation terminated.
I started with a clean source tree of OpenMPI and the most basic configure:
cd openmpi-1.2.5 && ./configure CC=pgcc CXX=pgcpp F77=pgf77 FC=pgf90
And this failed with:
*** C++ compiler and preprocessor
checking whether we are using the GNU C++ compiler… no
checking whether pgcpp accepts -g… yes
checking dependency style of pgcpp… none
checking how to run the C++ preprocessor… pgcpp -E
checking for the C++ compiler vendor… portland group
checking if C++ compiler works… no
It appears that your C++ compiler is unable to produce working
executables. A simple test application failed to properly
execute. Note that this is likely not a problem with Open MPI,
but a problem with the local compiler installation. More
information (including exactly what command was given to the
compiler and what error resulted when the command was executed) is
available in the config.log file in this directory.
configure: error: Could not run a simple C++ program. Aborting.
In the config.log file the relevant error was:
configure:21643: pgcpp -c -DNDEBUG conftest.cpp >&5
configure:21649: $? = 0
configure:21904: result: portland group
configure:21926: checking if C++ compiler works
configure:22003: pgcpp -o conftest -DNDEBUG conftest.cpp >&5
/usr/bin/ld: fatal error in /usr/bin/ld64
configure:22006: $? = 2
Thank you for all the help with this. I have the luxury of time since this platform port is something I’m doing “for fun” and not because my boss ordered it – so when it works, it works. Thanks again,