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

Configure CUCC/CUFLAGS need to be updated for SYCL and HIP #830

Open
ARSanderson opened this issue Feb 3, 2023 · 2 comments · May be fixed by #866
Open

Configure CUCC/CUFLAGS need to be updated for SYCL and HIP #830

ARSanderson opened this issue Feb 3, 2023 · 2 comments · May be fixed by #866

Comments

@ARSanderson
Copy link

ARSanderson commented Feb 3, 2023

I am building Hypre with SCYL and needed to modify the compile flags for when ipcx is used. After looking at the config.status file I found that the CUCC and CUFLAGS are used even though configure help says they are for CUDA

./configure --help

CUCC CUDA compiler command
CUFLAGS CUDA compiler flags

Understandable but a bit confusing. We are having to generalize similar flags/code in our project to accommodate CUDA/HIP/SYCL/KOKKOS.

I should also note that when I used CUFLAGS I was expecting the flags to be concatenated on to what configure setup. That is I wanted to add this: CUFLAGS="-fPIC"

But had to add this: CUFLAGS="-fPIC -O3 -fsycl -fsycl-unnamed-lambda"

Not sure what should have been expected.

@ARSanderson ARSanderson changed the title Configure needs to be updated for SYCL and HIP Configure CUCC/CUFLAGS need to be updated for SYCL and HIP Feb 3, 2023
@waynemitchell
Copy link
Contributor

waynemitchell commented Feb 10, 2023

Yes, we currently abuse CUCC and CUFLAGS as the device code compiler and flags for all the different GPU backends (cuda/hip/sycl). As for appending to rather than overwriting the CUFLAGS, you can use the following configure option:
--with-extra-CUFLAGS='-fPIC'
This is our mechanism for providing flags in addition to the defaults generated by configure. Again this has bad naming... renaming all of these as generic GPU/device names rather than cuda is on our todo list.

@ARSanderson
Copy link
Author

ARSanderson commented Feb 10, 2023

We have the same abuse happening in our code and trying figure out a path forward for CUDA/HIP/SYCP/Kokkos flags.

Thanks for --with-extra vs override that. I missed that and I realize now more.

A suggestion on the configure --help on environment vars. Move the --with-extra compile build flags into their own section right before the environment vars. And add to the message regarding the environment variables.

The result would be (modulo formatting):

Optional Build and Compile flags:
  --with-cxxstandard=val  User specifies c++ starndard in val.
  --with-LD=ARG           Set linker to ARG. The environment variable 'LD'
                          will be overridden.
  --with-LDFLAGS=ARG      User can manually set linker flags. The 'LDFLAGS'
                          environment variable will be overridden.
  --with-extra-CFLAGS=ARG Define extra C compile flag, where ARG is a
                          space-separated list (enclosed in quotes) of
                          directories.
  --with-extra-CXXFLAGS=ARG
                          Define extra C++ compile flag, where ARG is a
                          space-separated list (enclosed in quotes) of
                          directories.
  --with-extra-CUFLAGS=ARG
                          Define extra CUDA compile flag, where ARG is a
                          space-separated list (enclosed in quotes) of
                          directories.
  --with-extra-BUILDFLAGS=ARG
                          Define extra library build flag, where ARG is a
                          space-separated list (enclosed in quotes) of
                          directories.

Some influential environment variables:
 
List of variables ...

Use these variables to OVERRIDE the choices made by 'configure' or to help it to find libraries and programs with
nonstandard names/locations.  To add to the choices made by 'configure' use the '--with-extra-' argument
(e.g. --with-extra-CXXFLAGS=ARG). See above for specific flags.

That might help, though admit I missed the message at the bottom about the override.

@waynemitchell waynemitchell linked a pull request Mar 21, 2023 that will close this issue
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 a pull request may close this issue.

2 participants