[ET Trac] #2553: Cactus' link command uses CPPFLAGS and CXXFLAGS

Roland Haas trac-noreply at einsteintoolkit.org
Wed Aug 11 17:13:14 CDT 2021

#2553: Cactus' link command uses CPPFLAGS and CXXFLAGS

 Reporter: Roland Haas
   Status: open
  Version: development version
     Type: bug
 Priority: minor
Component: Cactus

Comment (by Roland Haas):

Well making LD be nvcc gives me extra trouble when compiling ExternalLibraries \(same sort of issues that come from having Cactus LIBS mean something different then autoconf’s LIBS\).

Instead I peeked at Formaline and wrote a short ExternallLibraries/CUDA thorn that adapts Cactus' link step based on the documentation by NVIDIA. The thorn is here:  [https://github.com/rhaas80/ExternalLibraries-CUDA.git](https://github.com/rhaas80/ExternalLibraries-CUDA.git) and the trick is to collect all CUDA code in a new library using nvcc \(just as NVIDIA shows\):




# TODO: make this depend on only the thorns that REQUIRE CUDA
# TODO: check if depending on LINKLIST would be enough
        $(CUCC) $(patsubst %,$(CCTK_LIBDIR)/$(LIBNAME_PREFIX)%$(LIBNAME_SUFFIX),$(ALLCACTUSLIBS)) -dlink -o $@
        if test "x$(USE_RANLIB)" = "xyes"; then $(RANLIB) $(RANLIBFLAGS) $@; fi
        @echo $(DIVIDER)

which lets me compile this thornlist:


and run this parfile:

ActiveThorns = CUDA
CUDA::test = yes

I think this should work, though I have not tested it on a system where `-filelist` is actually supported \(given that Linux does not, I assume nothing does anymore\), in which case maybe there are no libthornFOO.a files but only the raw object files.

Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2553/cactus-link-command-uses-cppflags-and
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.einsteintoolkit.org/pipermail/trac/attachments/20210811/b0fea3a8/attachment.html 

More information about the Trac mailing list