PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Build FFTW with MPI in windows 7
Goto page Previous  1, 2
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
mkcolg



Joined: 30 Jun 2004
Posts: 5871
Location: The Portland Group Inc.

PostPosted: Thu Nov 29, 2012 10:26 am    Post subject: Reply with quote

Hi Gabe,

Given just this information, my guess is that these are C wrapper routines and the problem has to do with how the symbol names are being decorated. Try searching the source for the definitions of these routines to see how they are declared. CL is a C++ compiler, therefore if the names don't have an Extern "C" around them, they may be getting name mangled. Also, C doesn't append an underscore to symbol names, so you many need to add one.

You can also try using the "pgnm" utilitiy on your libraries and search from these symbol names. It will tell us if they exist and how they are decorated.

i.e. pgnm *.lib | grep "fftw_f77_create_plan"

Hope this helps,
Mat
Back to top
View user's profile
gtarroyo



Joined: 05 Jun 2012
Posts: 10

PostPosted: Fri Nov 30, 2012 3:34 pm    Post subject: Reply with quote

Okay, first these are the exact link errors:
Code:
Compiling Project  ...
Linking...
aim_mod29.obj : error LNK2019: unresolved external symbol fftw_f77_create_plan_ referenced in function aim_compute_inv_gaussian_
aim_mod29.obj : error LNK2019: unresolved external symbol fftw_f77_one_ referenced in function aim_compute_inv_gaussian_
aim_mod29.obj : error LNK2019: unresolved external symbol fftw_f77_destroy_plan_ referenced in function aim_compute_inv_gaussian_
aim_nfield_corr9.obj : error LNK2001: unresolved external symbol fftw_f77_destroy_plan_
aim_mod29.obj : error LNK2019: unresolved external symbol fftwnd_f77_mpi_ referenced in function aim_center_find_
solver_v20timed.obj : error LNK2001: unresolved external symbol fftwnd_f77_mpi_
aim_mod29.obj : error LNK2019: unresolved external symbol fftwnd_f77_mpi_create_plan_ referenced in function aim_pack_propagat_
aim_mod29.obj : error LNK2019: unresolved external symbol fftwnd_f77_mpi_local_sizes_ referenced in function aim_pack_propagat_
aim_nfield_corr9.obj : error LNK2019: unresolved external symbol fftwnd_f77_create_plan_ referenced in function aim_correct_nfield_nfield_correct_
aim_nfield_corr9.obj : error LNK2019: unresolved external symbol fftwnd_f77_one_ referenced in function aim_correct_nfield_nfield_correct_
C:\tfs_root\EM.CUBE\AIM_Windows\mom3D\AIMwin64\AIMwin64\x64\Debug\exe.exe : fatal error LNK1120: 8 unresolved externals
exe build failed.


so I've done as you suggested and the type of output I get is below.

Code:
$ pgnm *.lib | grep "fftwnd_f77_mpi"
00000256 T fftw2x_cdft_DOUBLE.lib;obj\rnd_local_sizes.obj;_rfftwnd_f77_mpi_local_sizes
00000432 T fftw2x_cdft_DOUBLE.lib;obj\rnd_fftw.obj;_rfftwnd_f77_mpi
00000080 T fftw2x_cdft_DOUBLE.lib;obj\rnd_destroy_plan.obj;_rfftwnd_f77_mpi_destroy_plan
00001264 T fftw2x_cdft_DOUBLE.lib;obj\rnd_create_plan.obj;_rfftwnd_f77_mpi_create_plan
00000256 T fftw2x_cdft_DOUBLE.lib;obj\nd_local_sizes.obj;_fftwnd_f77_mpi_local_sizes
00000336 T fftw2x_cdft_DOUBLE.lib;obj\nd_fftw.obj;_fftwnd_f77_mpi
00000080 T fftw2x_cdft_DOUBLE.lib;obj\nd_destroy_plan.obj;_fftwnd_f77_mpi_destroy_plan
00001040 T fftw2x_cdft_DOUBLE.lib;obj\nd_create_plan.obj;_fftwnd_f77_mpi_create_plan

Code:
$ pgnm *.lib | grep "fftw_f77_create_plan"
fftw2xf_double_msvs.lib[obj_double_msvs\rfftw_f77_create_plan.obj];
00000000 t fftw2xf_double_msvs.lib;obj_double_msvs\rfftw_f77_create_plan.obj;.text
00000000 T fftw2xf_double_msvs.lib;obj_double_msvs\rfftw_f77_create_plan.obj;_RFFTW_F77_CREATE_PLAN
fftw2xf_double_msvs.lib[obj_double_msvs\fftw_f77_create_plan.obj];
00000000 t fftw2xf_double_msvs.lib;obj_double_msvs\fftw_f77_create_plan.obj;.text
00000000 T fftw2xf_double_msvs.lib;obj_double_msvs\fftw_f77_create_plan.obj;_FFTW_F77_CREATE_PLAN

So as far as I can tell they are in these libraries. On the MKL website it talks about making sure to run your examples with their include files fftw_f77.i, fftw.h , fftw_mpi.h, rfftw.h, and rfftw_mpi.h. The only one I include is the fftw_f77.i file but it is just a bunch of FFTW constant definitions that I already define in my project. I don't do anything with the others since they are C header files. Should I be using these somehow?
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 5871
Location: The Portland Group Inc.

PostPosted: Tue Dec 04, 2012 11:37 am    Post subject: Reply with quote

Hi Gabe,

Quote:
00000336 T fftw2x_cdft_DOUBLE.lib;obj\nd_fftw.obj;_fftwnd_f77_mpi
It looks like this library is using the "C" calling convention rather than the default Win64. Try adding "-Miface=cref". Granted, you may have issues linking with other libraries if a "C" interface is not available.

Quote:
fftw2xf_double_msvs.lib;obj_double_msvs\fftw_f77_create_plan.obj;_FFTW_F77_CREATE_PLAN
This one looks to also be using the "C" calling convention, but is also preserving case sensitivity. Try compiling with "-Miface=cref -Mupcase" and then change your call to this routine to all upper case letters. Note that "-Mupcase" is a bit tricky since now all out external references must now be upper case.

- Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group