Support #13535
collision between openssl and common crypto
Description
MicroBooNE has the following problem when building on OSX.
[ 10%] Building CXX object uboonecode/uboone/RawData/utils/CMakeFiles/uboone_RawData.dir/LArRawInputDriverUBooNE.cxx.o In file included from /grid/fermiapp/products/larsoft/cetlib/v1_19_01/include/cetlib/sha1.h:13:0, from /grid/fermiapp/products/larsoft/fhiclcpp/v4_00_01/include/fhiclcpp/ParameterSetID.h:10, from /grid/fermiapp/products/larsoft/fhiclcpp/v4_00_01/include/fhiclcpp/ParameterSet.h:14, from /Users/macdev/workspace/uboone-release-build-mac/BUILDTYPE/debug/label1/swarm/label2/OSX-10.10/temp/srcs/uboonecode/uboone/RawData/utils/LArRawInputDriverUBooNE.h:11, from /Users/macdev/workspace/uboone-release-build-mac/BUILDTYPE/debug/label1/swarm/label2/OSX-10.10/temp/srcs/uboonecode/uboone/RawData/utils/LArRawInputDriverUBooNE.cxx:11: /usr/include/openssl/md5.h:108:4: error: conflicting declaration 'typedef struct MD5state_st CC_MD5_CTX' } MD5_CTX; ^ /usr/include/CommonCrypto/CommonDigest.h:122:3: note: previous declaration as 'typedef struct CC_MD5state_st CC_MD5_CTX' } CC_MD5_CTX; ^ In file included from /grid/fermiapp/products/larsoft/root/v6_06_04b/Darwin64bit+14-e10-nu-debug/include/RConfig.h:256:0, from /grid/fermiapp/products/larsoft/root/v6_06_04b/Darwin64bit+14-e10-nu-debug/include/RtypesCore.h:24, from /grid/fermiapp/products/larsoft/root/v6_06_04b/Darwin64bit+14-e10-nu-debug/include/Rtypes.h:24, from /grid/fermiapp/products/larsoft/root/v6_06_04b/Darwin64bit+14-e10-nu-debug/include/TObject.h:31, from /grid/fermiapp/products/larsoft/root/v6_06_04b/Darwin64bit+14-e10-nu-debug/include/TNamed.h:26, from /grid/fermiapp/products/larsoft/root/v6_06_04b/Darwin64bit+14-e10-nu-debug/include/TAxis.h:25, from /grid/fermiapp/products/larsoft/root/v6_06_04b/Darwin64bit+14-e10-nu-debug/include/TH1.h:25, from /grid/fermiapp/products/larsoft/canvas/v1_04_05/include/canvas/Persistency/Common/detail/aggregate.h:27, from /grid/fermiapp/products/larsoft/canvas/v1_04_05/include/canvas/Persistency/Common/Wrapper.h:11, from /grid/fermiapp/products/larsoft/canvas/v1_04_05/include/canvas/Persistency/Common/Assns.h:83, from /grid/fermiapp/products/larsoft/art/v2_02_02/include/art/Framework/Core/ProductRegistryHelper.h:23, from /Users/macdev/workspace/uboone-release-build-mac/BUILDTYPE/debug/label1/swarm/label2/OSX-10.10/temp/srcs/uboonecode/uboone/RawData/utils/LArRawInputDriverUBooNE.h:12, from /Users/macdev/workspace/uboone-release-build-mac/BUILDTYPE/debug/label1/swarm/label2/OSX-10.10/temp/srcs/uboonecode/uboone/RawData/utils/LArRawInputDriverUBooNE.cxx:11: /usr/include/openssl/md5.h:114:58: error: conflicting declaration of C function 'int CC_MD5_Update(CC_MD5_CTX*, const void*, size_t)' int MD5_Update(MD5_CTX *c, const void *data, size_t len) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER; ^ In file included from /grid/fermiapp/products/larsoft/cetlib/v1_19_01/include/cetlib/sha1.h:13:0, from /grid/fermiapp/products/larsoft/fhiclcpp/v4_00_01/include/fhiclcpp/ParameterSetID.h:10, from /grid/fermiapp/products/larsoft/fhiclcpp/v4_00_01/include/fhiclcpp/ParameterSet.h:14, from /Users/macdev/workspace/uboone-release-build-mac/BUILDTYPE/debug/label1/swarm/label2/OSX-10.10/temp/srcs/uboonecode/uboone/RawData/utils/LArRawInputDriverUBooNE.h:11, from /Users/macdev/workspace/uboone-release-build-mac/BUILDTYPE/debug/label1/swarm/label2/OSX-10.10/temp/srcs/uboonecode/uboone/RawData/utils/LArRawInputDriverUBooNE.cxx:11: /usr/include/CommonCrypto/CommonDigest.h:127:12: note: previous declaration 'int CC_MD5_Update(CC_MD5_CTX*, const void*, CC_LONG)' extern int CC_MD5_Update(CC_MD5_CTX *c, const void *data, CC_LONG len) ^ make[2]: *** [uboonecode/uboone/RawData/utils/CMakeFiles/uboone_RawData.dir/LArRawInputDriverUBooNE.cxx.o] Error 1 make[1]: *** [uboonecode/uboone/RawData/utils/CMakeFiles/uboone_RawData.dir/all] Error 2 make: *** [all] Error 2 73.59 real 42.33 user 11.71 sys ------------------------------------ ERROR: Stage build failed.
History
#1 Updated by Lynn Garren over 4 years ago
- Experiment MicroBooNE added
- Experiment deleted (
-)
#2 Updated by Lynn Garren over 4 years ago
I can confirm the problem on my laptop with Xcode 7.2.1
#3 Updated by Kyle Knoepfel over 4 years ago
Lynn, Herb, or whoever can easily build this on your Mac:
Can you produce a .i
file for this LArRawInputDriverUBooNE.cxx
file? To do so:
cd <uboonecode-builddir>/uboonecode/uboone/RawData/utils/ make LArRawInputDriverUBooNE.cxx.i
Please send us the file it produces (it should tell you where it puts it). Something like:
Preprocessing CXX source to CMakeFiles/uboone_RawData.dir/LArRawInputDriverUBooNE.cxx.i
#4 Updated by Lynn Garren over 4 years ago
Done.
#5 Updated by Kyle Knoepfel over 4 years ago
- Category set to Infrastructure
- Status changed from New to Assigned
- Assignee set to Kyle Knoepfel
- SSI Package cetlib added
- SSI Package deleted (
)
#6 Updated by Kyle Knoepfel over 4 years ago
- Status changed from Assigned to Resolved
- % Done changed from 0 to 100
Thank you, Lynn. I have determined why the failure is happening. Line 6 of uboonedaq-datatypes/projects/datatypes/uboone_data_fragment.h
has
#include <openssl/md5.h>
The openssl
library is deprecated for the most recent versions of OSX. The cetlib
library has handled this deprecation by moving to Apple's CommonCrypto
tools for OSX platforms. However, since the uboonedaq_data_fragment
has an explicit header to the openssl
implementation, a conflict is introduced. This issue can be resolved by either moving to the cet::MD5Digest
class which already provides the needed functionality. Or, the following patch should be applied to the uboonedaq_data_fragment.h
header.
diff --git a/projects/datatypes/uboone_data_fragment.h b/projects/datatypes/uboone_data_fragment.h
index 27965d5..252fc66 100644
--- a/projects/datatypes/uboone_data_fragment.h
+++ b/projects/datatypes/uboone_data_fragment.h
@@ -3,7 +3,13 @@
#include <fstream>
#include <vector>
+#if __APPLE__
+#define COMMON_DIGEST_FOR_OPENSSL
+#include <CommonCrypto/CommonDigest.h>
+#undef COMMON_DIGEST_FOR_OPENSSL
+#else
#include <openssl/md5.h>
+#endif
#include <algorithm>
#include <iterator>
#7 Updated by Kyle Knoepfel over 4 years ago
- Tracker changed from Bug to Support
#8 Updated by Kyle Knoepfel over 4 years ago
- Status changed from Resolved to Closed