cms-gem-daq-project / ctp7_modules

0 stars 13 forks source link

compilation crashes for GE21 systems #180

Closed mexanick closed 4 years ago

mexanick commented 4 years ago

Brief summary of issue

When setting the GEM_VARIANT to ge21 the compilation crashes. For ge11 code compiles

Types of issue

Expected Behavior

Should compile

Current Behavior

make
***
/home/mdalchen/work/cms-gem-daq-project/ctp7_modules/src/amc/sca.cpp: In function ‘void readAllSCAADCSensors(const wisc::RPCMsg*, wisc::RPCMsg*)’:
/home/mdalchen/work/cms-gem-daq-project/ctp7_modules/src/amc/sca.cpp:392:95: error: ‘FULL_OH_MASK’ is not a member of ‘amc’
   const uint32_t ohMask   = request->get_key_exists("ohMask") ? request->get_word("ohMask") : amc::FULL_OH_MASK;
                                                                                               ^
/home/mdalchen/work/cms-gem-daq-project/ctp7_modules/src/amc/sca.cpp:392:95: note: suggested alternative:
In file included from /home/mdalchen/work/cms-gem-daq-project/ctp7_modules/src/amc/sca.cpp:7:0:
/home/mdalchen/work/cms-gem-daq-project/ctp7_modules/include/hw_constants.h:23:28: note:   ‘amc::ge11::FULL_OH_MASK’
         constexpr uint32_t FULL_OH_MASK = 0xfff; ///< Reading of all OptoHybrids are enabled.
                            ^
make[1]: *** [/home/mdalchen/work/cms-gem-daq-project/ctp7_modules/src/linux/arm/amc/sca.o] Error 1
make[1]: Leaving directory `/home/mdalchen/work/cms-gem-daq-project/ctp7_modules'
make: *** [amc] Error 2

Steps to Reproduce (for bugs)

Attempt to compile

Possible Solution (for bugs)

diff --git a/include/hw_constants.h b/include/hw_constants.h
index 0533286..84c3206 100644
--- a/include/hw_constants.h
+++ b/include/hw_constants.h
@@ -27,6 +27,7 @@ namespace amc {
      */
     namespace ge21 {
         constexpr uint32_t OH_PER_AMC = 12;    ///< The number of OptoHybrids per AMC.
+        constexpr uint32_t FULL_OH_MASK = 0xfff; ///< Reading of all OptoHybrids are enabled.
     }

     using namespace GEM_VARIANT;

Context (for feature requests)

Your Environment

jsturdy commented 4 years ago

I've added this fix and one for resolving RPM names between the GE1/1 and GE2/1 builds:

diff --git a/Makefile b/Makefile
index 0d4c0fc..8e16bee 100644
--- a/Makefile
+++ b/Makefile
@@ -193,4 +193,6 @@ clean: cleanrpm
 cleandoc:
        @echo "TO DO"

+BUILD_VERSION:=$(BUILD_VERSION).$(GEM_VARIANT)
+
 -include $(Dependencies)