Skip to content

config/opal_setup_java.m4: Fix #5015. #5160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2018
Merged

config/opal_setup_java.m4: Fix #5015. #5160

merged 1 commit into from
May 9, 2018

Conversation

RandomDSdevel
Copy link
Contributor

Resolves #5001 (comment).

@ompiteam-bot
Copy link

Can one of the admins verify this patch?

@rhc54
Copy link
Contributor

rhc54 commented May 9, 2018

Just glancing at this, and I'm puzzled - as the person who originally added Java support to OMPI, when did somebody change the default to enabling Java bindings?? The requirement for adding this was that it never be enabled by default.

@RandomDSdevel
Copy link
Contributor Author

@rhc54:

     I was wondering that, too, but thought I might best leave figuring that out to somebody else for whom it wasn't 'above their pay grade,' so to speak (this is only my second Open MPI contribution after all.) I'm leave it be for now just to keep the scope of this PR narrow and preserve its initial intent. By all means, though, that's a fair question to ask and answer.

@jsquyres
Copy link
Member

jsquyres commented May 9, 2018

ok to test

AC_MSG_ERROR([Cannot continue])
AC_MSG_WARN([No recognized OS X/macOS JDK directory structure found under $opal_java_dir])
opal_java_found=0
AC_MSG_RESULT([Falling back to other platforms' JDK checks])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch -- this does seem like it was the error (from my original pseudocode in a prior github comment).

I think you can get rid of the AC_MSG_RESULT -- it'll be obvious in the configure output that we're trying other places.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsquyres: Just thought I'd be consistent with there being a message there before (albeit the faulty one,) but I'll change it.

     That PR accidentally changed Open MPI's build configuration infrastruc-
ture's Java toolchain detection logic so that it would, as reported by @bosilca
in #5001 (comment) and tracked down by me in #5001 (comment), abort your entire
in-progress Open MPI build when it failed to find an OS X/macOS JDK instead of
simply falling back to checking for a JDK in locations where it would be found
on other platforms.  _Oops…!_

Signed-off-by: Bryce Glover <[email protected]>
@jsquyres
Copy link
Member

jsquyres commented May 9, 2018

@rhc54 The default is still not to enable Java; we check for Java compilers and whatnot, and then later determine whether to enable the support or not. We could restructure that a bit to not even bother checking for Java if it wasn't requested, if that is desired (I don't think that particular logic has changed in quite a while -- it's in a different area than this particular PR addresses: see 31beff6, back from 2012).

@RandomDSdevel
Copy link
Contributor Author

RandomDSdevel commented May 9, 2018

@jsquyres: I've addressed your review comment and force-pushed with lease.

@jsquyres
Copy link
Member

jsquyres commented May 9, 2018

@RandomDSdevel Thank you! Will merge after CI completes.

@bosilca This fixes your Java issue.

@bosilca
Copy link
Member

bosilca commented May 9, 2018

Magnificent !

@jsquyres jsquyres merged commit 93930a2 into open-mpi:master May 9, 2018
@RandomDSdevel RandomDSdevel deleted the fix-5015 branch May 9, 2018 23:29
@ggouaillardet
Copy link
Contributor

@jsquyres @rhc54 if I read correctly, the default is to check for Java support (e.g. $enable_java != "no") but not build Java bindings (e.g. `$enable_mpi_java != "yes").

Is there a rationale having these two distinct configure command line options ?

@rhc54
Copy link
Contributor

rhc54 commented May 10, 2018

Not that I can see - there is no reason to be checking for Java support if we aren't building the Java bindings. There was a time when we needed them separate because we were supporting non-MPI Java programs (e.g., map-reduce) and ORTE needed to know it could support Java, but that time has passed.

@jsquyres
Copy link
Member

@ggouaillardet Yeah, I noticed that yesterday afternoon, too: the variable we're checking is wrong. But even fixing that, and fixing the condition to be != "yes", you get somewhat misleading configure output:

*** Java compiler
checking OS X/macOS locations... not found
checking Linux locations not found

*** Java MPI bindings
checking if want Java bindings... no

which is not quite accurate, because it's not that the Java compiler isn't found -- it's that we didn't even look if --enable-mpi-java wasn't specified. I meant to do up a PR last night to make this a little better, but didn't get to it.

So just to be clear, currently:

  • We always check for the Java compilers (regardless of whether you specified --enable|disable-mpi-java)
  • We do not build the Java MPI bindings unless you specify --enable-mpi-java

We could change the first one to be a little more intelligent to not even search for the Java compiler unless --enable-mpi-java was specified, but I think to do it Right, we should do a little more than just change that one incorrect if statement that exists today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants