[gmx-developers] OpenMP call in a c++ analysis source file
Teemu Murtola
teemu.murtola at gmail.com
Fri Sep 6 20:18:37 CEST 2013
Hi,
On Fri, Sep 6, 2013 at 12:23 PM, Jochen Hub <jhub at gwdg.de> wrote:
> I have added OpenMP support to g_wham and pushed the change to gerrit. I
> get errors such as:
>
> undefined reference to `gmx_omp_set_num_threads(int)'
>
> or
>
> unresolved external symbol "int __cdecl gmx_omp_get_max_threads(void)"
> (?gmx_omp_get_max_threads@@YAHXZ) referenced in function gmx_wham
>
> The code compiles fine under Mac and linux (without and with OpenMP
> support).
>
Sounds suspicious, given that Jenkins fails to build it in all combinations
that have OpenMP enabled.
However, what is also strange is that I have to protect the
> mx_omp_set_num_threads() and gmx_omp_get_max_threads() with an #ifdef
> GMX_OPENMP - while this is not required in, for instance in gmx_sans.c.
> The only reason I could think of is a C vs. C++ issue.
>
> Can someone give a hint how to proceed?
>
You need to add extern "C" declarations to gmx_omp.h. See other header
files for examples.
Best regards,
Teemu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20130906/b4437fc8/attachment.html>
More information about the gromacs.org_gmx-developers
mailing list