cms-gem-daq-project / xhal

XHAL interface library
0 stars 10 forks source link

WIP: Clean up Makefiles -- Fixes #128 #129

Closed jsturdy closed 5 years ago

jsturdy commented 5 years ago

Description

Makefiles are cleaned up as in the ctp7_modules way, with autodependencies calculated at object build time, objects and sources grouped based on the library they feed into, and common compilation syntax used, except where differences are needed. Could go further, a la ctp7_modules, where the library generation is also a common block, with extras added per library in a rule, but didn't seem necessary at this time.

Types of changes

Motivation and Context

Issue #128 observed by @lmoureaux when adding new sources, this fix should make the syntax more obvious, though the structure of libraries and such may still need to be clarified.

How Has This Been Tested?

Compiled fine, compiled objects not tested.

Probably needs to be hotfixed into feature/templated-rpc-methods (or this branch rebased) as I suspect this was possible blocker for @lmoureaux testing the build of #125.

lmoureaux commented 5 years ago

Going to rebase #125 locally and test

jsturdy commented 5 years ago

And as the example @lmoureaux used:

[xhal]% make xhalarm >& /dev/null
[xhal]% echo $?
0
[xhal]% make xhalcore >& /dev/null
[xhal]% echo $?
0
[xhal]% echo "int test() { return 0; }" > xhalcore/src/common/utils/test.cpp
[xhal]% make xhalarm >& /dev/null
[xhal]% echo $?
0
[xhal]% make xhalcore >& /dev/null
[xhal]% echo $?
0
jsturdy commented 5 years ago

Clean build fails with:

make[1]: Entering directory `/afs/cern.ch/work/l/lmoureau/GEM/test/mf/xhal/xhalcore'
mkdir -p /afs/cern.ch/work/l/lmoureau/GEM/test/mf/xhal/xhalcore/src/linux/x86_64
gcc -O0 -g3 -fno-inline -Wall -pthread -fPIC -std=c++11 -m64 -I/usr/include/python2.7 -I/include -I/afs/cern.ch/work/l/lmoureau/GEM/test/mf/xhal/xhalcore/include -c -MT /afs/cern.ch/work/l/lmoureau/GEM/test/mf/xhal/xhalcore/src/linux/x86_64/XHALDevice.o -MMD -MP -MF /afs/cern.ch/work/l/lmoureau/GEM/test/mf/xhal/xhalcore/src/linux/x86_64/XHALDevice.Td -o /afs/cern.ch/work/l/lmoureau/GEM/test/mf/xhal/xhalcore/src/linux/x86_64/XHALDevice.o /afs/cern.ch/work/l/lmoureau/GEM/test/mf/xhal/xhalcore/src/common/XHALDevice.cpp
In file included from /afs/cern.ch/work/l/lmoureau/GEM/test/mf/xhal/xhalcore/include/xhal/XHALDevice.h:12:0,
                 from /afs/cern.ch/work/l/lmoureau/GEM/test/mf/xhal/xhalcore/src/common/XHALDevice.cpp:1:
/afs/cern.ch/work/l/lmoureau/GEM/test/mf/xhal/xhalcore/include/xhal/utils/XHALXMLParser.h:23:42: fatal error: xercesc/util/PlatformUtils.hpp: No such file or directory
 #include <xercesc/util/PlatformUtils.hpp>
                                          ^
compilation terminated.
make[1]: *** [/afs/cern.ch/work/l/lmoureau/GEM/test/mf/xhal/xhalcore/src/linux/x86_64/XHALDevice.o] Error 1

Hardcoded /opt/xdaq was changed to $(XDAQ_ROOT), in keeping with other packages, don't know if I have a strong preference on keeping it such, motivation would be if building against other XDAQ versions on the same machine...

lmoureaux commented 5 years ago

The SONAMEs aren't set correctly (make 3.82 on gem904daq01):

/usr/bin/ld: SONAME must not be empty string; ignored

No warning is printed for the ARM build.

jsturdy commented 5 years ago

The SONAMEs aren't set correctly (make 3.82 on gem904daq01):

/usr/bin/ld: SONAME must not be empty string; ignored

No warning is printed for the ARM build.

oops, missed this in the output earlier... no warning on arm, but soname was still empty, yikes! Fixed, and config submodule also updated now

jsturdy commented 5 years ago

We need to decide what to do with #125. Since develop tends to evolve slowly, I think we don't need this fix there and we can merge it only into the feature branch.

I'm fine with including this in #125 (especially since I think you noticed this issue when developing for that anyway), and after that, feature/templated-rpc-methods is ready to merge into develop and prepare a preliminary release for developing the templated modules and templated calls against (I think I'd like to at the same time as that hammer out finally the CI and CD, just to have it done with, since it would be the next release cycle) The next "big" development in here would be the treatment of the ancillary run-time components, e.g., cms-gem-daq-project/ctp7_modules#148, but that can be started as a separate feature

lmoureaux commented 5 years ago

Fix cherry-picked in #125, closing.