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

NVIDIA Compiler Integration #52

Closed
gha3mi opened this issue Jan 4, 2024 · 10 comments
Closed

NVIDIA Compiler Integration #52

gha3mi opened this issue Jan 4, 2024 · 10 comments

Comments

@gha3mi
Copy link
Contributor

gha3mi commented Jan 4, 2024

Hello

I have added the NVIDIA compiler to setup and updated actions and workflows. Before sending a PR, I would like to inform you here. Please take a look at: https://github.com/gha3mi/setup-fortran

Best regards
Ali

gha3mi added a commit to gha3mi/setup-fortran that referenced this issue Jan 5, 2024
- Added versions from 20.7 to 22.11.
- All Nvidia versions are now accessible.
@jalvesz
Copy link

jalvesz commented Jan 14, 2024

Hi, I'm setting up a workflow depending on setup-fortran and I'm having an issue with nvfortran that seems to be related with the installation https://github.com/jalvesz/fast_math/actions/runs/7521896804/job/20473274032

Run fortran-lang/setup-fortran@v1
Run action_path=$(echo '//home/runner/work/_actions/fortran-lang/setup-fortran/v1' | sed -e 's/\\/\//g' -e 's/://')
+ compiler=nvidia-hpc
++ uname -s
++ tr '[:upper:]' '[:lower:]'
+ platform=linux
+ case $compiler in
+ exit 1
Error: Process completed with exit code 1.

Has anyone seen this kind of issues?
Here my setup file https://github.com/jalvesz/fast_math/blob/main/.github/workflows/ci.yml

@gha3mi
Copy link
Contributor Author

gha3mi commented Jan 14, 2024

Hi,
The nvfortran setup has been recently tested and merged into the main branch, also it is not available in version 1 of setup-fortran. Perhaps before the next release, you can give it a try using fortran-lang/setup-fortran@main or fortran-lang/setup-fortran@master.

@wpbonelli
Copy link
Contributor

We should make a new release soon, it would be good to get #51 in for that though.

@jalvesz
Copy link

jalvesz commented Jan 14, 2024

fortran-lang/setup-fortran@main

Nice!! this worked! thanks

@jalvesz
Copy link

jalvesz commented Jan 15, 2024

Hi,
So with the proposed solution nvfortran was installed, but for some reason, even though the environment vars were set, at compile time it was still looking for gfortran. you can see the log here https://github.com/jalvesz/fast_math/actions/runs/7522194607/job/20473898816
and the error

<ERROR> Compilation failed for object " src_fast_erf.f90.o "
<ERROR> stopping due to failed compilation
STOP 1

gfortran: error: gfortran does not support -E without -cpp
Error: Process completed with exit code 1.

Since I'm using fpm to run the tests, I had to add the compiler explicitly like this:

- run: |
          fpm test --compiler ${{ env.FC }} --flag "${{ join(matrix.toolchain.flags, ' ') }}"

@gha3mi
Copy link
Contributor Author

gha3mi commented Jan 15, 2024

As you mentioned, when using fpm, you need to add --compiler ${{ env.FC }}. However, in your ci.yml, it is not included. Doesn't this solve the problem?

@jalvesz
Copy link

jalvesz commented Jan 15, 2024

I added it in a parallel branch to test because I was polluting the commits in the main branch, here is my latest version https://github.com/jalvesz/fast_math/blob/jalvesz-patch-1/.github/workflows/ci.yml

Just wanted to signal this particularity with fpm... maybe this could be automated by setting also FPM_FC=FC, FPM_CXX=CXX, FPM_CC=CC ?

@gha3mi
Copy link
Contributor Author

gha3mi commented Jan 15, 2024

FPM_FC=FC, FPM_CXX=CXX, FPM_CC=CC

I think it's a good idea to set environment variables for fpm within setup-fortran.

@wpbonelli
Copy link
Contributor

Possibly relevant:

I'm not clear why the PR was closed or if such an option is still planned, maybe there was backchannel discussion @awvwgk can fill in. But setting fpm variables seems reasonable in any case.

@wpbonelli
Copy link
Contributor

Nvidia support was added in #53 and will soon be released with v1.4

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

No branches or pull requests

3 participants