Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: [OMPI devel] trunk build failure on {Free,Net,Open}BSD
From: Paul Hargrove (phhargrove_at_[hidden])
Date: 2014-01-08 19:52:17

This partial make output shows a build failure of the current trunk tarball
on FreeBSD-9/x86-64:
  CC path.lo
In function 'opal_path_df':
error: 'buf' undeclared (first use in this function)
error: (Each undeclared identifier is reported only once
error: for each function it appears in.)
*** [path.lo] Error code 1

Builds of the trunk on NetBSD and OpenBSD fail in the same way.

The code in opal_path_df() seems not to define the variable "buf" unless
certain defines are present, but then tries to USE the variable
unconditionally. That unconditional use of "buf" is the proximate cause of
the failure.

A very-likely-related observation:
The code in opal/util/path.c seems to expect __BSD to be defined under
*some* circumstance, but it is not defined by any current

$ touch empty.c
$ gcc -dM -E empty.c | grep BSD
#define __FreeBSD_cc_version 900001
#define __VERSION__ "4.2.1 20070831 patched [FreeBSD]"
#define __FreeBSD__ 9

-bash-4.2$ touch empty.c
-bash-4.2$ gcc -dM -E empty.c | grep BSD
#define __NetBSD__ 1

-bash-4.2$ touch empty.c
-bash-4.2$ gcc -dM -E empty.c | grep BSD
#define __OpenBSD__ 1

So, there are TWO issues:

1) opal_path_df() defines the variable "buf" only conditionally but then
uses it UNconditionally.

2) logic which appears to be intended for at least FreeBSD is probably not
reachable in any build.


Paul H. Hargrove                          PHHargrove_at_[hidden]
Future Technologies Group
Computer and Data Sciences Department     Tel: +1-510-495-2352
Lawrence Berkeley National Laboratory     Fax: +1-510-486-6900