[Openmp-dev] Math symbols are not found during configuration

Doerfert, Johannes via Openmp-dev openmp-dev at lists.llvm.org
Thu Jul 25 06:05:16 PDT 2019


Thanks for the reproducer, that helped a lot.

So the problem is the host code but during device compilation.
I was earlier confused as host compilation should not be impacted by this and it is not.

I do not have a good workaround other than defining NAN, and other macros such as M_PI,
manually in NVPTX mode. In my system that would look like:

#ifdef __NVPTX__
  #define NAN (0.0f / 0.0f)                                                                                         
#endif

Can you give this a try and tell me if it works for you?


________________________________________
From: Itaru Kitayama <itaru.kitayama at gmail.com>
Sent: Thursday, July 25, 2019 07:34
To: Doerfert, Johannes
Cc: openmp-dev at lists.llvm.org
Subject: Re: [Openmp-dev] Math symbols are not found during configuration

#include <cmath>
#include <iostream>

int main()
{
        std::cout << NAN << std::endl;
};

This gives you a build error when compiled with -fopenmp-targets=nvptx64, but not without it.


More information about the Openmp-dev mailing list