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.
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:
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.
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:
After building OpenSSL from source, then I set
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:
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:
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.