Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

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

Closed
wants to merge 1 commit into from

Conversation

jsturdy
Copy link
Contributor

@jsturdy jsturdy commented Aug 8, 2019

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.

  • xhalarm and xhalcore Makefiles are simplified for reliable, reproducible builds
  • xhalarm as dependency of xhalcore is moved to dependency of xhalcore.RPM

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

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
Copy link

Going to rebase #125 locally and test

@jsturdy
Copy link
Contributor Author

jsturdy commented Aug 8, 2019

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

Copy link

@lmoureaux lmoureaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@jsturdy
Copy link
Contributor Author

jsturdy commented Aug 8, 2019

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...

xhalcore/Makefile Outdated Show resolved Hide resolved
@lmoureaux
Copy link

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 jsturdy force-pushed the hotfix/simplify-makefiles branch from b0dd45a to a128d8e Compare August 8, 2019 16:10
@jsturdy jsturdy force-pushed the hotfix/simplify-makefiles branch 2 times, most recently from 4cb8a32 to 32b32f3 Compare August 8, 2019 16:17
@jsturdy
Copy link
Contributor Author

jsturdy commented Aug 8, 2019

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

lmoureaux
lmoureaux previously approved these changes Aug 8, 2019
Copy link

@lmoureaux lmoureaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jsturdy
Copy link
Contributor Author

jsturdy commented Aug 8, 2019

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

* `config` submodule updated to pick up `XHAL_ROOT` and default `INSTALL_PATH`
* `xhalarm` and `xhalcore` `Makefile`s are simplified for reliable, reproducible builds
* `xhalarm` as dependency of `xhalcore` is moved to dependency of `xhalcore.RPM`
@jsturdy jsturdy force-pushed the hotfix/simplify-makefiles branch from 127f7aa to a12c07d Compare August 8, 2019 20:05
@jsturdy jsturdy changed the title Clean up Makefiles -- Fixes #128 WIP: Clean up Makefiles -- Fixes #128 Aug 8, 2019
@pr-triage pr-triage bot removed the PR: unreviewed label Aug 8, 2019
@lmoureaux
Copy link

Fix cherry-picked in #125, closing.

@lmoureaux lmoureaux closed this Aug 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants