Git Product home page Git Product logo

cmssw-config's People

Contributors

ariostas avatar cmsbuild avatar davidlange6 avatar davidlt avatar fwyzard avatar gartung avatar gudrutis avatar jolange avatar ktf avatar smuzaffar avatar tulamor avatar vgvassilev avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cmssw-config's Issues

support linking CUDA device code across different libraries

A first step should be to fix the call to nvcc for linking device code.
The current rule

  $(VERB_ECHO) $(SCRAM_PREFIX_COMPILER_COMMAND) "$(NVCC) $(call AdjustFlags,$1,,CUDA_LDFLAGS CUDA_FLAGS)  $? -o $@" &&\
              ($(SCRAM_PREFIX_COMPILER_COMMAND) $(NVCC) $(call AdjustFlags,$1,,CUDA_LDFLAGS CUDA_FLAGS) $? -o $@) $(endlog_$(1))

should become

  $(VERB_ECHO) $(SCRAM_PREFIX_COMPILER_COMMAND) "$(NVCC) -dlink $(call AdjustFlags,$1,,CUDA_LDFLAGS CUDA_FLAGS) --compiler-options '$(call AdjustCudaHostFlags,$1,CXXFLAGS) $(CXXSHAREDOBJECTFLAGS)' $? -o $@" &&\
              ($(SCRAM_PREFIX_COMPILER_COMMAND) $(NVCC) -dlink $(call AdjustFlags,$1,,CUDA_LDFLAGS CUDA_FLAGS) --compiler-options '$(call AdjustCudaHostFlags,$1,CXXFLAGS) $(CXXSHAREDOBJECTFLAGS)' $? -o $@) $(endlog_$(1))

where we explicitly pass -dlink, and also pass the full set of flags to the host compiler.
This should go together with the changes to the cuda toolfile at cms-sw/cmsdist#4168 .

Then, to avoid some confusion between the existing $(1)_cudaobj variable and $(1)_cudaobjs that I propose to add, I suggest to rename the former to $(1)_cudadlink (short for device link):

-$(1)_cudaobj      := $$($(1)_objdir)/$(1)_scramcuda.$(OBJEXT)
+$(1)_cudadlink    := $$($(1)_objdir)/$(1)_cudadlink.$(OBJEXT)
...
-$(1)_objs         := $$(addprefix $$($(1)_objdir)/, $$(addsuffix .$(OBJEXT),$$($(1)_files))) $$(if $(SYNTAX_ONLY),,$$($(1)_cudaobj))
+$(1)_objs         := $$(addprefix $$($(1)_objdir)/, $$(addsuffix .$(OBJEXT),$$($(1)_files))) $$(if $(SYNTAX_ONLY),,$$($(1)_cudadlink))
...
-ifneq ($(strip $($(1)_cudaobj)),)
-$($(1)_cudaobj): $$(addprefix $($(1)_objdir)/, $(addsuffix .$(OBJEXT), $($(1)_cudafiles)))
+ifneq ($(strip $($(1)_cudadlink)),)
+$($(1)_cudadlink): $$(addprefix $($(1)_objdir)/, $(addsuffix .$(OBJEXT), $($(1)_cudafiles)))

Finally, to support linking CUDA device code across different libraries, for each package with CUDA source files we need to:

  • define a corresponding list of device object files and a static library (I picked the suffix _nv.o because of the ELF sections they are going to have, but feel free to use anything else):

     ifneq ($(strip $$($(1)_cudafiles)),)
     $(1)_cudadlink    := $$($(1)_objdir)/$(1)_cudadlink.$(OBJEXT)
    +$(1)_cudaobjs     := $$(addprefix $$($(1)_objdir)/, $$(addsuffix _nv.$(OBJEXT),$$($(1)_cudafiles)))
     endif
  • copy the ELF sections __nv_relfatbin, __nv_module_id and .nvFatBinSegment to the device object files:

    $($(1)_cudaobjs): %_nv.$(OBJEXT): %.$(OBJEXT)
        objcopy -j '.nv*' -j '__nv*' $^ $@
    
  • link these device object files into a static library:

    lib$(1)_nv.a:
        ar crs ... $($(1)_cudaobjs)
    
  • during the device link step, take into account the full dependencies from the BuildFiles, but use these _nv.a libraries instead of the standard .so libraries.

One question: do we want to keep these _nv.a files in the same place as the .so libraries, or in a separate directory ? They are only used for linking, not at run time.

Versioning of binaries

Hi,

I wanted to know if there is a possibility to have something like the output of git describe --tags available at compile time so as to be able to version executables. This could be achieved via a compile time -D name=definition option.

The use case is for tools which are loosely bound to the actual CMSSW version used, like https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit where we struggle with users using old versions of the tool.

I am not a SCRAM expert, do I do not know if something like this is already in place (for instance for $SCRAM_ARCH or $CMSSW_VERSION) and, if not, where to hook it up.

Support for inverted logic for ALPAKA_BACKENDS

See cms-sw/cmssw#40792 (comment) i.e.

<flags ALPAKA_BACKENDS="cuda rocm"/> works. For longer term, I'm wondering would it be feasible
to add a possibility for an inverted logic, i.e. "all backends except the listed ones"? Although we should
re-think the relation of "platform" concept in DataFormats  (and ESProducers(?) and Services) and 
"backend" concept in EDModules, and the impact of that for the library organization and build
rules anyway, so I'm not if this detail is worth of addressing before the outcome of the
platform-backend thought process.

BuildFile with no sources error warnings

Just like plugins directory , shut the scram warning for test directory.
src//test contains only BuildFile.xml without any sources. Better to remove BuildFile.xml too or do not tag this directory

Allow picking dependency types in 'scram b checkdeps'

git cms-checkdeps allows selecting different kinds of dependencies (header, python, or BuildFile). Right now, scram b checkdeps always checks all of them. Often, I find cases where I want to skip the python dependencies (the python dependency check is very broad and often gives false positives) but keep the others. Could arguments similar to the git version be provided for the scram version?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.