[gmx-developers] OpenMP call in a c++ analysis source file
Jochen Hub
jhub at gwdg.de
Fri Sep 6 23:00:35 CEST 2013
Hi Teemu,
thanks for the help. I'll give it a try.
Cheers,
Jochen
Am 9/6/13 8:18 PM, schrieb Teemu Murtola:
> Hi,
>
>
> On Fri, Sep 6, 2013 at 12:23 PM, Jochen Hub <jhub at gwdg.de
> <mailto: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
>
>
--
---------------------------------------------------
Dr. Jochen Hub
Computational Molecular Biophysics Group
Institute for Microbiology and Genetics
Georg-August-University of Göttingen
Justus-von-Liebig-Weg 11, 37077 Göttingen, Germany.
Phone: +49-551-39-14189
http://cmb.bio.uni-goettingen.de/
---------------------------------------------------
More information about the gromacs.org_gmx-developers
mailing list