That sounds about right. What's happening is that OMPI has learned a bunch about the C compiler before it does this C++ link test. In your first case (which is assumedly with gcc), it determines that it needs _GNU_SOURCE set -- or some other test has caused that to be set. Then it uses that with pgc++ and runs into the error you show below.
Is there a reason you want to mix gcc and pgc++? It's usually simpler/better to use a single compiler suite for the whole thing. On Jan 29, 2014, at 10:54 AM, Jiri Kraus <jkr...@nvidia.com> wrote: > Hi, > > I am trying to compile OpenMPI 1.7.3 with pgc++ (14.1) as C++ compiler. > During configure it fails with > > checking if C and C++ are link compatible... no > > The error from config.log is: > > configure:18205: checking if C and C++ are link compatible > configure:18230: pgcc -c -DNDEBUG -fast conftest_c.c > configure:18237: $? = 0 > configure:18268: pgc++ -o conftest -DNDEBUG -fast conftest.cpp conftest_c.o > >&5 > conftest.cpp: > "conftest.cpp", line 21: error: "_GNU_SOURCE" is predefined; attempted > redefinition ignored > #define _GNU_SOURCE 1 > ^ > > "conftest.cpp", line 86: error: "_GNU_SOURCE" is predefined; attempted > redefinition ignored > #define _GNU_SOURCE 1 > ^ > > "conftest.cpp", line 167: warning: statement is unreachable > return 0; > ^ > > 2 errors detected in the compilation of "conftest.cpp". > > When I use pgcpp instead of pgc++ OpenMPI configures and builds. > > I am using > > CXX=pgcpp|pgc++ CC=pgcc FC=pgfortran F77=pgfortran CFLAGS=-fast FCFLAGS=-fast > FFLAGS=-fast CXXFLAGS=-fast ./configure > --with-hwloc=/shared/apps/rhel-6.2/tools/hwloc-1.7.1 --enable-hwloc-pci > --with-cuda --prefix=/home-2/jkraus/local/openmpi-1.7.3/pgi-14.1/cuda-5.5.22 > > to configure OpenMPI. Any Idea what caused the errors with pgc++? > > Thanks > > Jiri > > ----------------------------------------------------------------------------------- > Nvidia GmbH > W?rselen > Amtsgericht Aachen > HRB 8361 > Managing Director: Karen Theresa Burns > > ----------------------------------------------------------------------------------- > This email message is for the sole use of the intended recipient(s) and may > contain > confidential information. Any unauthorized review, use, disclosure or > distribution > is prohibited. If you are not the intended recipient, please contact the > sender by > reply email and destroy all copies of the original message. > ----------------------------------------------------------------------------------- > > _______________________________________________ > users mailing list > us...@open-mpi.org > http://www.open-mpi.org/mailman/listinfo.cgi/users -- Jeff Squyres jsquy...@cisco.com For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/