Skip to content

Remove link errors#4

Open
vimarsh6739 wants to merge 2 commits intowsmoses:mlirfrom
vimarsh6739:mlir
Open

Remove link errors#4
vimarsh6739 wants to merge 2 commits intowsmoses:mlirfrom
vimarsh6739:mlir

Conversation

@vimarsh6739
Copy link

Bazel plugin builds for reactant error out if we include lbm_kernel.cu during link, seems like a duplicate symbol bug in the code itself.

ifeq ($(EMBEDDED_CLANG),no)
ENZYME_LOAD_FLAGS += -fplugin=$(ENZYME_PATH)
REACTANT_PLUGIN_FLAGS += -fplugin-arg-enzyme-raising-plugin-path=$(LIB_RAISE_PATH)
REACTANT_PLUGIN_FLAGS += -fplugin-arg-enzyme-reactant-backend=cuda
Copy link
Owner

Choose a reason for hiding this comment

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

the -mllvm -reactant-backend -mllvm cuda version works on the plugin too.

Separately can you make the backend another makefile option?

Copy link
Author

Choose a reason for hiding this comment

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

Agreed, but for some reason, the bazel-built plugin processes -mllvm options before loading the plugin using -fplugin=/-load , which leads to a unknown option error.

I just switched to using frontend ParseArgs, and this works now.

For CMake built plugins, both ways(frontend parse args/ -mllvm works).

For bazel built plugins, only the frontend parse args work(but libraise is statically linked in)

reactant-clang obviously supports mllvm


clean:
rm -rf $(program) *.o *.re_export
rm -f args.c.re_export lbm lbm.cu.re_export lbm_kernel.cu.re_export main.cc.re_export out.txt parboil_cuda.c.re_export
Copy link
Owner

Choose a reason for hiding this comment

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

why not *.re_export ?

Copy link
Author

Choose a reason for hiding this comment

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

Ah I just pasted my untracked git files, will fix

Copy link
Owner

Choose a reason for hiding this comment

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

I think the existing clean should be correct

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

Successfully merging this pull request may close these issues.

2 participants