Menu

#1593 STAF 3.4.26 failed to build on Fedora 26

Unix::Linux
open
nobody
None
5
2017-03-09
2017-03-08
Robin Lee
No

STAF 3.4.26 failed to build on Fedora 26:
/builddir/build/BUILD/src/staf/stafproc/STAFFSService.cpp: In member function 'STAFServiceResult STAFFSService::handleGet(const STAFServiceRequest&)':
/builddir/build/BUILD/src/staf/stafproc/STAFFSService.cpp:4454:24: error: aggregate 'EVP_MD_CTX mdctx' has incomplete type and cannot be defined
EVP_MD_CTX mdctx;
^~~~~
/builddir/build/BUILD/src/staf/stafproc/STAFFSService.cpp:4491:38: error: 'EVP_MD_CTX_cleanup' was not declared in this scope
EVP_MD_CTX_cleanup(&mdctx);
^
Refer to the full build log.

1 Attachments

Discussion

  • Sharon Lucas

    Sharon Lucas - 2017-03-08

    Hi, the error is when trying to reference EVP_MD_CTX which is defined in OpenSSL header file openssl/evp.h (in the directory that you assigned to environment variable OPENSSL_ROOT).

    You are setting the following OPENSSL environment variables when building STAF:

    OPENSSL_ROOT=/usr 
    OPENSSL_LIBDIRS=/usr/lib64
    OPENSSL_VERSION=1
    

    It appears your OPENSSL_ROOT directory (/usr) does not contain a include/openssl directory containing header files such as evp.h (which defines EVP_MD_CTX, etc) and this is required as it looks here for the OpenSSL header files. Or you can set OPENSSL_INCLUDEDIRS to the directory on your system that contains a include/openssl directory containing the OpenSSL header files.

    Section "Building OpenSSL" section in the STAF Developer's Guide at http://staf.sourceforge.net/current/stafdg.html#Header_buildOpenSSL talks about how you can build OpenSSL from source on your system if you don't have the OpenSSL header files installed. For example, on my Linux 64-bit STAF build system, I downloaded OpenSSL source code from the OpenSSL website and untarred the OpenSSL tar file (e.g. openssl-1.0.2g.tar.gz) in /opt/dev/autobuild/tools which created directory /opt/dev/autobuild/tools/openssl-1.0.2g. Then I ran the following to build OpenSSL binaries for Linux 64-bit and puts them in /opt/dev/autobuild/tools/openssl-1.0.2g-root which is what I set OPENSSL_ROOT to when building the STAF TCP/IP connection provider.

    cd /opt/dev/autobuild/tools/openssl-1.0.2g
    ./Configure linux-x86_64 --openssldir=/opt/dev/autobuild/tools/openssl-1.0.2g-root threads shared no-zlib no-rc5 no-idea no-ec no-ecdh no-ecdsa no-ssl2 no-ssl3
    make depend
    make
    make test
    make install
    

    Here are the contents of directory /opt/dev/autobuild/tools/openssl-1.0.2g-root on my Linux 64-bit system after successfully building OpenSSL 1.0,2g from source:

    [root@staf4g tools]# pwd
    /opt/dev/autobuild/tools
    [root@staf4g tools]# ls -l openssl-1.0.2g-root
    total 72
    drwxr-xr-x 2 root root  4096 Apr 22  2016 bin
    drwxr-xr-x 2 root root  4096 Apr 22  2016 certs
    drwxr-xr-x 3 root root  4096 Apr 22  2016 include
    drwxr-xr-x 4 root root  4096 Apr 22  2016 lib
    drwxr-xr-x 6 root root  4096 Apr 22  2016 man
    drwxr-xr-x 2 root root  4096 Apr 22  2016 misc
    -rw-r--r-- 1 root root 10835 Apr 22  2016 openssl.cnf
    drwxr-xr-x 2 root root  4096 Apr 22  2016 private
    
    [root@staf4g tools]# cd openssl-1.0.2g-root
    
    [root@staf4g openssl-1.0.2g-root]# ls -l lib
    total 8872
    drwxr-xr-x 2 root root    4096 Apr 22  2016 engines
    -rw-r--r-- 1 root root 3700116 Apr 22  2016 libcrypto.a
    -r-xr-xr-x 1 root root 2084548 Apr 22  2016 libcrypto.so
    -r-xr-xr-x 1 root root 2084548 Apr 22  2016 libcrypto.so.1.0.0
    -rw-r--r-- 1 root root  692794 Apr 22  2016 libssl.a
    lrwxrwxrwx 1 root root      15 Apr 22  2016 libssl.so -> libssl.so.1.0.0
    -r-xr-xr-x 1 root root  454578 Apr 22  2016 libssl.so.1.0.0
    drwxr-xr-x 2 root root    4096 Apr 22  2016 pkgconfig
    
    [root@staf4g openssl-1.0.2g-root]# ls -l include
    total 8
    drwxr-xr-x 2 root root 4096 Apr 22  2016 openssl
    
    [root@staf4g openssl-1.0.2g-root]# ls -l include/openssl
    total 2064
    -rw-r--r-- 1 root root   6146 Apr 22  2016 aes.h
    -rw-r--r-- 1 root root  63142 Apr 22  2016 asn1.h
    ...  <Didn't show the rest of the .h files for brevity>
    -rw-r--r-- 1 root root  16776 Apr 22  2016 err.h
    -rw-r--r-- 1 root root  67798 Apr 22  2016 evp.h
    -rw-r--r-- 1 root root   4535 Apr 22  2016 hmac.h
    -rw-r--r-- 1 root root   8165 Apr 22  2016 krb5_asn.h
    ...  <Didn't show the rest of the .h files for brevity>
    

    After building OpenSSL from source, then I set

    export STAF_USE_SSL=1
    export OPENSSL_ROOT=/opt/dev/autobuild/tools/openssl-1.0.2g-root
    

    before building STAF.

    Or, you could build STAF without OpenSSL support (if you don't need a secure TCP/IP interface and if you don't need to be able to get a checksum via a FS GET ENTRY CHECKSUM request) by setting the following environment variable:

    export STAF_USE_SSL=
    

    Or, instead of building STAF yourself, you could simply download a STAF installer file for Linux 64-bit (e.g. STAF3426-setup-linux-amd64.bin) from http://staf.sourceforge.net/getcurrent.php and use it to install STAF following the instructions in the STAF Installation Guide at http://staf.sourceforge.net/current/STAFInstall.pdf. For example:

    chmod +x STAF3426-setup-linux-amd64.bin
    ./STAF3426-setup-linux-amd64.bin
    
     
  • Robin Lee

    Robin Lee - 2017-03-09

    I figure out the cause is Fedora 26 changed default openssl to version 1.1.0 and the struct EVP_MD_CTX changed to be opaque. And I format an initial patch for this issue.

    I requires PLSTAF for Fedora. But the include makefile for perl does not catch up the Perl version in Fedora. So I have to build STAF by myself. And I am making an rpm package for STAF: https://copr.fedorainfracloud.org/coprs/cheeselee/STAF/ , but still WIP to be as complete as the official installer.

     

Log in to post a comment.

MongoDB Logo MongoDB