Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code fails to compile master on gitinfo error #19

Closed
cipriangal opened this issue Mar 4, 2017 · 11 comments
Closed

Code fails to compile master on gitinfo error #19

cipriangal opened this issue Mar 4, 2017 · 11 comments
Assignees

Comments

@cipriangal
Copy link
Contributor

Checking out a fresh copy of master and trying to compile for the first time hangs up on:
[ 69%] Building CXX object CMakeFiles/remoll.dir/src/remollRunData.cc.o
/home/ciprian/playtime/remoll/src/remollRunData.cc:2:22: fatal error: gitinfo.hh: No such file or directory
#include "gitinfo.hh"
^
compilation terminated.
make[2]: *** [CMakeFiles/remoll.dir/src/remollRunData.cc.o] Error 1
make[1]: *** [CMakeFiles/remoll.dir/all] Error 2
make: *** [all] Error 2
[ciprian@negoiu build]$ grep gitinfo ../src/*
../src/remollRunData.cc:#include "gitinfo.hh"

My guess this is related to this commit:
8619363#diff-52845aab4628b4fe1c66538ffd1ddb39

@wdconinc
Copy link
Member

wdconinc commented Mar 4, 2017

Run make inside build at least the first time, I think. After that make -C build should work. It's more related to cmake not finding the pullgitinfo python script.

@wdconinc
Copy link
Member

wdconinc commented Mar 4, 2017

Pullgitinfo will create gitinfo.hh in build/include.

@cipriangal
Copy link
Contributor Author

Series of commands to replicate:
git clone https://github.com/JeffersonLab/remoll
cd remoll/;mkdir build;cd build
cmake ../
make

running make produces the error above. running it again gives the same result. What am I missing?

@cipriangal
Copy link
Contributor Author

if I
make gitinfo
and then make the rest it works fine.

I guess a modification to CMakeList to make sure gitinfo gets made first will fix this?

@wdconinc
Copy link
Member

wdconinc commented Mar 5, 2017

What about this patch to CMakeLists.txt? https://gist.github.com/wdconinc/8c288ac15c4b4a460872c23fce496414

I can't reliably reproduce the problem (CMake version, dependency resolution, probably some difference with your setup).

@cipriangal
Copy link
Contributor Author

You should be able to reproduce this on ifarm1401 (cmake 3.5.1). I also see it on my Mac (older cmake) and on a RHEL 7.2 desktop configured by JLab.

The problem seems to be that on the first make it tries to make either remoll or remollout (interestingly the compiler on RHEL GNU 4.8.5 and the one on the ifarm node GNU 5.2.0 try to make remoll and remollout first respectively).

What I found was to make gitinfo a dependency to the other executables/libs:
https://gist.github.com/cipriangal/08d9ccd8003949a883ab721f635d9f69

Your option also seems to do the job. I leave it up to you how you want to handle this. Thanks for looking into it.

@wdconinc
Copy link
Member

wdconinc commented Mar 7, 2017

Still can't reproduce on ifarm1401:

$ cmake --version
cmake version 2.8.11
$ which cmake
/usr/bin/cmake

Which cmake 3.5.1 are you using?

But if add_dependencies works, let's go with that. I can't verify so I don't want to commit it.

Technically gitinfo is not a dependency of of remoll or remollroot, but a dependency of src/remollRunData.cc. That means that even with add_dependency it could order the compiles such that gitinfo is only created after it attempts to compile src/remollRunData.cc. Another solution could be to use set_source_files_properties(src/remollRunData.cc OBJECT_DEPENDS gitinfo) but I couldn't get that to work. By using add_custom_command with an explicit OUTPUT the dependency resolution in cmake should properly resolve the dependency chain by the include of gitinfo.hh in src/remollRunData.cc.

@seamusriordan
Copy link

Did this get resolved? "add_custom_command with an explicit OUTPUT the dependency resolution in cmake should properly resolve the dependency chain by the include of gitinfo.hh in src/remollRunData.cc" sounded promising but does it need to be implemented and tested by someone?

@cipriangal
Copy link
Contributor Author

I'll fix it first thing tomorrow. I tested that either method works (will probably implement Wouter's suggestion).

@wdconinc
Copy link
Member

Yeah, I just ran into this again on the pion branch today. So, that's one system where I CAN reproduce it.

@cipriangal
Copy link
Contributor Author

Implemented @wdconinc's suggestion: 8d9d226

To reproduce it on the ifarm the env was:

Common Environment Version: <2.0> (Wed Oct 6 2016)
Running as ciprian on ifarm1401.jlab.org
OS Release: Linux_CentOS7.2.1511-x86_64-gcc5.2.0
JLAB_ROOT set to: /site/12gev_phys
JLAB_SOFTWARE set to: /site/12gev_phys/2.0/Linux_CentOS7.2.1511-x86_64-gcc5.2.0

CLHEP version: 2.3.3.1
XERCES version: 3.1.3
QTDIR version: 5.6.0
Geant4 version: 4.10.02.p02
ROOT version: 6.08.00
GEMC version: 2.5
JANA version: 0.7.4p2
S Build version: 1.4
EVIO version: 5.1
CCDB version: 1.06
Banks version: 1.3
MLIBRARY version: 1.0

ifarm1401.jlab.org> cmake --version
cmake version 3.5.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
ifarm1401.jlab.org> which cmake
cmake: aliased to /apps/cmake/bin/cmake

Note that indeed I have been using a different installation of cmake than the one mentioned above by @wdconinc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants