ibm-messaging / mq-cph

The IBM MQ C Performance Harness
Apache License 2.0
11 stars 6 forks source link

cannot support IBM MQ V9 #4

Closed kelegt closed 2 years ago

kelegt commented 2 years ago

the *.h file in /opt/mqm/inc/ which belong to mqadv_dev924_linux_x86-64.tar.gz didnot define the “MQCNO_VERSION_7” ,but MQCNO_VERSION_6 is include。

[root@localhost mq-cph-master]# find /opt/mqm/inc/ -name "." | xargs grep "MQCNO_VERSION_6" /opt/mqm/inc/cmqc.h: #define MQCNO_VERSION_6 6 /opt/mqm/inc/cmqstrc.h: { 6, "MQCNO_VERSION_6" }, /opt/mqm/inc/cmqstrc.h: { "MQCNO_VERSION_6" , 6 }, [root@localhost mq-cph-master]# find /opt/mqm/inc/ -name "." | xargs grep "MQCNO_VERSION_7" [root@localhost mq-cph-master]# vim src/MQIOpts.cpp

============================================================================== [root@localhost mq-cph-master]# make -j 64 Platform sub-directory: Linux_x86_64 Installation directory: /opt/mq-cph/ Building C++ object: src/MQIOpts.cpp -> Release/Linux_x86_64/MQIOpts.o g++ -c -std=c++0x -o Release/Linux_x86_64/MQIOpts.o src/MQIOpts.cpp -D__STDC_FORMAT_MACROS -DCPH_UNIX -DCPH_LINUX -I/opt/mqm/inc -MMD -MP -O3 -DNDEBUG src/MQIOpts.cpp: 在构造函数‘cph::MQIOpts::MQIOpts(CPH_CONFIG*, bool, bool, bool)’中: src/MQIOpts.cpp:232:24: 错误:‘MQCNO_VERSION_7’在此作用域中尚未声明 protoCNO.Version = MQCNO_VERSION_7; ^ src/MQIOpts.cpp:233:21: 错误:‘MQCNO’没有名为‘ApplName’的成员 strcpy(protoCNO.ApplName,applName); ^ make: *** [Release/Linux_x86_64/MQIOpts.o] 错误 1

pharrishur commented 2 years ago

I've just installed the dev version of V9.2.4 (mqadv_dev924_linux_x86-64.tar.gz) from the download pointed to by https://community.ibm.com/community/user/integration/blogs/ian-harwood1/2021/11/10/mq924ga#down and I can see the correct MQCNO version. V7 has been out for some time. In the output below, I installed V9.2.4 to /opt/mqm2 as there was already another version of MQ on the machine. Do you have multiple versions of MQ installed perhaps? You can see if there is more than one version by executing "dspmqver -i"

grep MQCNO_VERSION /opt/mqm2/inc/cmqstrc.h { 1, "MQCNO_VERSION_1" }, { 2, "MQCNO_VERSION_2" }, { 3, "MQCNO_VERSION_3" }, { 4, "MQCNO_VERSION_4" }, { 5, "MQCNO_VERSION_5" }, { 6, "MQCNO_VERSION_6" }, { 7, "MQCNO_VERSION_7" }, { 8, "MQCNO_VERSION_8" }, { "MQCNO_VERSION_1" , 1 }, { "MQCNO_VERSION_2" , 2 }, { "MQCNO_VERSION_3" , 3 }, { "MQCNO_VERSION_4" , 4 }, { "MQCNO_VERSION_5" , 5 }, { "MQCNO_VERSION_6" , 6 }, { "MQCNO_VERSION_7" , 7 }, { "MQCNO_VERSION_8" , 8 },

cluesch commented 2 years ago

Same issue here with 9.1.0, and mind you this has nothing to do with MQ 9 vs MQ 7, but with the version of the CNO object that you pass to the MQCONNX() call. You can see in the documentation under MQCNO - Connect options, that MQCNO_VERSION_7 is a 9.2.0 feature.

So the proper solution would be to specify 9.2.0 as a minimum client version and possibly check that in either make-file or in the code.

Something like:

#if MQCNO_CURRENT_VERSION < 7
#error "Requires at least MQ version 9.2.0"
#endif

Edit: Minimum version is actually 9.1.2, which also knows about CNO version 7.

pharrishur commented 2 years ago

The original issue was opened against a build problem using the cmqstrc.h shipped with the V9.2.4 version of MQ, hence my previous reply, as that version has the V7 version of the CNO in it. As the last comment mentions, the V7 version of the CNO was introduced in MQ V9.1.2. I'm going to add compiler directives that only use the V7 CNO (and hence support for setting the APPL name), if the header files contain a CNO >= 7. This means the code will compile with earlier version of MQ but not support setting the APPL name in that case. I didn't want to force the user into having V9.1.2 to compile MQ-CPH.