Compiling Open MPI with Free PGI


I’m trying to build Open MPI 1.6.5 with Free PGI (14.3 as I downloaded it). I first tried configuring with:

./configure CC=pgcc CXX=g++ F77=pgfortran FC=pgfortran CFLAGS='-m64' CXXFLAGS='-m64' FCFLAGS='-m64' FFLAGS='-m64' --prefix=/Users/fortran/MPI/openmpi_1.6.5-pgi_14.3-pgcc | & tee configure.pgi14.3.pgcc.log

but that led to:

checking if C and C++ are link compatible... no
* It appears that your C++ compiler is unable to link against object
* files created by your C compiler.  This generally indicates either
* a conflict between the options specified in CFLAGS and CXXFLAGS
* or a problem with the local compiler installation.  More
* information (including exactly what command was given to the
* compilers and what error resulted when the commands were executed) is
* available in the config.log file in this directory.
configure: error: C and C++ compilers are not link compatible.  Can not continue.

Now, as the code I’m ultimately targeting is mainly Fortran, I figured let’s try using just gcc, g++, and pgfortran:

./configure CC=gcc CXX=g++ F77=pgfortran FC=pgfortran CFLAGS='-m64' CXXFLAGS='-m64' FCFLAGS='-m64' FFLAGS='-m64' --prefix=/Users/fortran/MPI/openmpi_1.6.5-pgi_14.3-gcc | & tee configure.pgi14.3.gcc.log

and that works. So, I issue a “make” which runs without Error and then do the always important “make check” and it fails after checking some atomic bits (which pass):

Making check in class
/Applications/  ompi_rb_tree opal_bitmap opal_hash_table opal_list opal_value_array opal_pointer_array
  CC     ompi_rb_tree.o
ompi_rb_tree.c:347:70: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
        ((ompi_test_rb_value_t *) new_value)->registered_mpools[0] = (void *) i;
1 warning generated.
  CCLD   ompi_rb_tree
Undefined symbols for architecture x86_64:
  "_opal_cache_line_size", referenced from:
      _test2 in ompi_rb_tree.o
      _ompi_rb_tree_construct in libmpi.a(ompi_rb_tree.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [ompi_rb_tree] Error 1
make[2]: *** [check-am] Error 2
make[1]: *** [check-recursive] Error 1
make: *** [check-recursive] Error 1

I have no doubt there are flags I probably need to pass to configure to make this “hybrid” work, but does anyone know what they are? The classic “-DpgiFortran” perhaps?

Thanks for any help,

Hi Matt,

I’ve been asking around here on how to do this (I know very little about Macs) with little luck. It looks like we moved to using MPICH3 on Mac because of problems with libtool (which OpenMPI uses). I don’t have details nor know if this is the root of your issues, but could press folks here a bit if you need it.

There is this link to OpenMPI’s faq which may or may not be useful:

  • Mat


After looking around a bit, I moved onto Open MPI 1.7.4 as it seems to have better Darwin support, and it does! I can get it to configure, make, and make check. The problem is when I do a ‘make install’ that it doesn’t work. I’ve written to the Open MPI Users list here:

My guess is there is some flag I’m not correctly passing to pgfortran to get libraries to compile the right way…


Just an update for those wanting one. It looks like the issue might just be a bug with autotools: