Skip to content

openssl/ssl.h needed on osx el-capitan (latest 10.11.3)/postgres 9.5 #94

Closed

Description

@kkzz8888

Follow the suggestion from issue 63 (tried all branches same issue) - I believe that I could build it with Issue 63 branch with postgres 9.4.5 but unfortunately I upgraded to postgres 9.5 no data for that scenario with postgres 9.4.5.

cd pljava-so
mvn -Dnar.cores=1 -Pwnosign -X clean comple>compiledebuglogs

compiledebugwithpgconfig.zip

Activity

  1. changed the title [-]does not compile with osx el-capitan (latest 10.11.3)/postgres 9.5[/-] [+]openssl/ssl.h missing on osx el-capitan (latest 10.11.3)/postgres 9.5[/+] on Feb 8, 2016
  2. changed the title [-]openssl/ssl.h missing on osx el-capitan (latest 10.11.3)/postgres 9.5[/-] [+]openssl/ssl.h needed on osx el-capitan (latest 10.11.3)/postgres 9.5[/+] on Feb 8, 2016
  3. jcflack commented on Feb 8, 2016

    @jcflack
    Contributor

    Hi,

    There were two things here. First, the -Dwnosign profile seems to have no effect on this platform, as the log file you submitted has very many sign-conversion warnings, which that profile is supposed to suppress. Looking at the gcc command line in the log, the nar-maven-plugin did include the -Wno-sign-conversion option, but put it first on the line, and then all the options turning the warnings back on after it. That is harmless but annoying; of course it makes finding the real problem in the log file difficult, because so many useless sign-conversion warnings are around it. Unfortunately, I don't think that can be easily improved on PL/Java's end; the nar-maven-plugin maintainers could fix it more easily.

    The real problem is on lines 3105 to 3107 of the log file:

    [ERROR] /usr/local/Cellar/postgresql/9.5.0/include/server/libpq/libpq-be.h:25:10: fatal error: 'openssl/ssl.h' file not found
    [ERROR] #include <openssl/ssl.h>
    [ERROR]          ^
    

    The cause seems to be Apple shipping El Capitan without the OpenSSL headers. In that message, suggested resolutions are to build OpenSSL locally, or install it from Homebrew or MacPorts.

    Also annoying, also not fixable here, it just has to be added to the build requirements in the OS X build docs. I will update that page.

    I see Cellar in your PostgreSQL path; does that mean you used Homebrew to install PostgreSQL itself? According to the Braumeister, that should have installed the Homebrew OpenSSL also. Perhaps you can check?

    I saw that you tested many different git branches. That must have been some work. It is probably easiest to test from 1.5.0-BETA1 for the moment, since that's the current candidate for eventual release.

  4. kkzz8888 commented on Feb 8, 2016

    @kkzz8888
    Author

    Thanks! This make sense! Yes I did use Homebrew to install postgres. Now when I tried to update the openssl again. The Mac OS give the following message which is very promising:

    brew install openssl
    ==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2f.el_capitan.b
    ######################################################################## 100.0%
    ==> Pouring openssl-1.0.2f.el_capitan.bottle.tar.gz
    ==> Caveats
    A CA file has been bootstrapped using certificates from the system
    keychain. To add additional certificates, place .pem files in
    /usr/local/etc/openssl/certs

    and run
    /usr/local/opt/openssl/bin/c_rehash

    This formula is keg-only, which means it was not symlinked into /usr/local.

    Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

    Generally there are no consequences of this for you. If you build your
    own software and it requires this formula, you'll need to add to your
    build variables:

    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include
    

    ==> Summary
    🍺 /usr/local/Cellar/openssl/1.0.2f: 466 files, 11.9M

    I have checked the pg_config log, LDFLAGS is already there. How do I add
    -I/usr/local/opt/openssl/include to CPPFLAGS? I will give it a try once I got the answer for that.

  5. jcflack commented on Feb 9, 2016

    @jcflack
    Contributor

    Strange ... when I look at the CPPFLAGS line in your pg_config output, it does not look like the line in the brew formula. That line looks like it would contain the openssl reference. I wonder if there is an updated PostgreSQL bottle?

  6. jcflack commented on Feb 9, 2016

    @jcflack
    Contributor

    That might not help anyway ... for now, you may need to edit pljava-so/pom.xml and find the <c> compiler <includePaths> section and add another <includePath> for the OpenSSL header. :(

  7. kkzz8888 commented on Feb 9, 2016

    @kkzz8888
    Author

    thanks a lot! That made the build successful. Will continue the rest of installation of pljava.

  8. kkzz8888 commented on Feb 9, 2016

    @kkzz8888
    Author

    I know this is a new issue, but I can use some help:

    After setting pljava.libjvm_location and pljava.classpath (in postgresql.conf),

    pljava.libjvm_location='/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/server/libjvm.dylib'
    pljava.classpath='/usr/local/share/postgresql/pljava/pljava-1.5.0-BETA1.jar'

    I am getting this with the famous Mac popup saying the program can only run the old Java 1.6 runtime. I have no java 1.6 running at all, everything is the latest java 1.8.

    load 'libpljava-so-1.5.0-BETA1.bundle';
    server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.
    The connection to the server was lost. Attempting reset: Failed.

  9. jcflack commented on Feb 9, 2016

    @jcflack
    Contributor

    Unfortunately no ideas come to mind about that popup. I have no Mac here to test with, and in earlier testing on OS X, the direct naming of the libjvm.dylib in pljava.libjvm_location eliminated any such issue.

    I am not sure whether this means Apple has changed something to make it worse, or something is peculiar about the setup of your Mac. You might supply a screenshot of the exact popup; this issue is hard to search for because the web is full of various partially related threads about Java on OS X and many of them are probably not relevant here, so it will help to be as specific as possible. But please do start a new issue; this isn't about openssl.

  10. jcflack commented on Feb 9, 2016

    @jcflack
    Contributor

    One thought does occur to me. You mentioned at the top of this report that you had built from a whole bunch of different git branches.

    It may be very helpful if you just erase all of that, make sure none of it is left installed, and do a clean build of exactly the 1.5.0-BETA1 release from exactly here (after adding the one includePath in pljava-so/pom.xml for your openSSL headers of course, but no other change).

    That will not include any of a few changes committed since 1.5.0-BETA1, but that should not cause a problem, and then we will know just what was built.

    In general, there are only two ways you would want to obtain and build the source: if you want to live on the bleeding edge and participate in development, then check out the source from master (unless you are working on a development branch of your own, or collaborating on a different branch with another developer); otherwise, for a stable and repeatable build of the software, it is better to build from the tagged release.

  11. kkzz8888 commented on Feb 9, 2016

    @kkzz8888
    Author

    Thanks, already did clean build on the branch. Here is the screenshot captured.
    2016-02-09 8 31 38

  12. jcflack commented on Feb 9, 2016

    @jcflack
    Contributor

    Please start a new issue, and include the output of

    otool -L /usr/local/lib/postgresql/libpljava-so-1.5.0-BETA1.bundle
    
  13. jcflack commented on Feb 23, 2016

    @jcflack
    Contributor

    Documented in 1.5.0-BETA2.

  14. jcflack commented on Mar 30, 2016

    @jcflack
    Contributor

    Documented in 1.5.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions