-
Notifications
You must be signed in to change notification settings - Fork 32
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
cudacpp.mk should include make_opts #787
Comments
Thanks Olivier. I found the main problem I was having: adding make_opts was breaking the definition of CUDACPP_MAKEFILE. So this was really a bug. I fixed this as
What really makes the diffrence here is the ':='. Without that, the expression is evaluated when used, so it points corrrectly to cudacpp.mk before including make_opts, but it was then pointing to ../../Source/make_opts after including make_opts. The override is kind of optional, it just ensures that the variable cannot be modified from the outside. Just a reminder that this can be used (and is heavily used elsewhere) to encapsulate the internal environment of a makefile. I will do a few more tests, comparing the build commands with and without make_opts. If there are issues later on, we can always come back iteratively and fix issues as they appear. @oliviermattelaer can you in any case make one or two specific examples of which variables you want to take from make_opts? Just to understand better (and for instance remove some overrides elsewhere if we need to inherit your settings, or add overrides if we do not want to inherit them). Also copying @hageboeck for info. |
Ah, and I added a protection, as make_opts does not exist in standalone (gg_tt.sa) builds
|
…rce exists (e.g it is missing in .sa directories) madgraph5#787
…anall' now fails because make_opts is included madgraph5#787 This boils down to make -f cudacpp.mk cleanall OMPFLAGS= AVX=512y FPTYPE=d HELINL=0 HRDCOD=0 RNDGEN=hasCurand Building in BUILDDIR=. for tag=512y_d_inl0_hrd0_hasCurand (USEBUILDDIR is not set) make USEBUILDDIR=0 clean -f ../../Source/make_opts make[1]: Entering directory '/data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx' make[1]: *** No rule to make target 'clean'. Stop. make[1]: Leaving directory '/data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx'
…w including make_opts causes issues here: the CUDACPP_MAKEFILE variable is corrupted madgraph5#787 make -f cudacpp.mk cleanall CUDACPP_MAKEFILE='cudacpp.mk' CUDACPP_MAKEFILE='../../Source/make_opts' cudacpp.mk:42: *** exit. Stop.
…ue with override, this is irrelevant! madgraph5#787 make -f cudacpp.mk cleanall CUDACPP_MAKEFILE='cudacpp.mk' CUDACPP_MAKEFILE='../../Source/make_opts' cudacpp.mk:42: *** exit. Stop.
…ly once at the beginning and avoid corruption when make_opts is included madgraph5#787 make -f cudacpp.mk cleanall CUDACPP_MAKEFILE='cudacpp.mk' CUDACPP_MAKEFILE='cudacpp.mk' cudacpp.mk:43: *** exit. Stop. However, this is still sensitive to variables coming from outside make -f cudacpp.mk cleanall CUDACPP_MAKEFILE=pippo CUDACPP_MAKEFILE='pippo' CUDACPP_MAKEFILE='pippo' cudacpp.mk:43: *** exit. Stop.
…re that CUDACPP_MAKEFILE is an internal variable that cannot be set externally madgraph5#787 make -f cudacpp.mk cleanall CUDACPP_MAKEFILE='cudacpp.mk' CUDACPP_MAKEFILE='cudacpp.mk' cudacpp.mk:43: *** exit. Stop. This is now insensitive to variables coming from outside make -f cudacpp.mk cleanall CUDACPP_MAKEFILE=pippo CUDACPP_MAKEFILE='cudacpp.mk' CUDACPP_MAKEFILE='cudacpp.mk' cudacpp.mk:43: *** exit. Stop.
…nall' now succeeds after including make_opts madgraph5#787 NB: I also checked that 'make cleanall; make' gives exactly the same output in my environment whether make_opts is included or not
Excellent, perfect andrea, I have made one PR: #788 |
Thanks Olivier! I checked that, after fixing the cudacpp.mk bug, I now get the same 'make cleanall; make' output with and without make_opts included, so that is good for me. I close this. |
Just one point on Mac and gfortran: GNU make assumes FC=f77 if FC is not defined. So indeed in my Linux environment I explicitly export FC=gfortran. But I think this is the correct way |
…anall' now fails because make_opts is included madgraph5#787 (*NB OpenMP is now disabled by default!*) This boils down to make -f cudacpp.mk cleanall OMPFLAGS= AVX=512y FPTYPE=d HELINL=0 HRDCOD=0 RNDGEN=hasCurand Building in BUILDDIR=. for tag=512y_d_inl0_hrd0_hasCurand (USEBUILDDIR is not set) make USEBUILDDIR=0 clean -f ../../Source/make_opts make[1]: Entering directory '/data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx' make[1]: *** No rule to make target 'clean'. Stop. make[1]: Leaving directory '/data/avalassi/GPU2023/madgraph4gpuX/epochX/cudacpp/gg_tt.mad/SubProcesses/P1_gg_ttx'
…w including make_opts causes issues here: the CUDACPP_MAKEFILE variable is corrupted madgraph5#787 make -f cudacpp.mk cleanall CUDACPP_MAKEFILE='cudacpp.mk' CUDACPP_MAKEFILE='../../Source/make_opts' cudacpp.mk:42: *** exit. Stop.
…ue with override, this is irrelevant! madgraph5#787 make -f cudacpp.mk cleanall CUDACPP_MAKEFILE='cudacpp.mk' CUDACPP_MAKEFILE='../../Source/make_opts' cudacpp.mk:42: *** exit. Stop.
…ly once at the beginning and avoid corruption when make_opts is included madgraph5#787 make -f cudacpp.mk cleanall CUDACPP_MAKEFILE='cudacpp.mk' CUDACPP_MAKEFILE='cudacpp.mk' cudacpp.mk:43: *** exit. Stop. However, this is still sensitive to variables coming from outside make -f cudacpp.mk cleanall CUDACPP_MAKEFILE=pippo CUDACPP_MAKEFILE='pippo' CUDACPP_MAKEFILE='pippo' cudacpp.mk:43: *** exit. Stop.
…re that CUDACPP_MAKEFILE is an internal variable that cannot be set externally madgraph5#787 make -f cudacpp.mk cleanall CUDACPP_MAKEFILE='cudacpp.mk' CUDACPP_MAKEFILE='cudacpp.mk' cudacpp.mk:43: *** exit. Stop. This is now insensitive to variables coming from outside make -f cudacpp.mk cleanall CUDACPP_MAKEFILE=pippo CUDACPP_MAKEFILE='cudacpp.mk' CUDACPP_MAKEFILE='cudacpp.mk' cudacpp.mk:43: *** exit. Stop.
…nall' now succeeds after including make_opts madgraph5#787 NB: I also checked that 'make cleanall; make' gives exactly the same output in my environment whether make_opts is included or not
The title says it all.
It is fine for the CI/CD, fine on mac but problematic for @valassi. Sorry Andrea, I assign this to you.
The text was updated successfully, but these errors were encountered: