How to pass arguments to linker (Windows)?

I’m trying to compile my project on windows xp 32 bit using MSVC 2010 and CUDA Fortran 11.10:

MSVC 2010 Console:

nvcc -m32 -c -arch sm_13 --cl-version 2008 -o a.obj

PGI Workstation:

$ pgf90 -m32 coursework_2011_cuda_tesla_1dv2.cuf a.obj
./coursework_2011_cuda_tesla_1dv2.exf: warning: unknown section ".nv_fatb" found, executable not
  stripped.  Use the linker's /merge option to merge this section
  with another.  Example: "/"


#include <thrust/device_vector.h>
#include <thrust/device_vector.h>
#include <thrust/sort.h>

extern "C" {
//Sort for integer arrays
void sort_int_wrapper( int *data, int N)
// Wrap raw pointer with a device_ptr
thrust::device_ptr <int> dev_ptr(data);
// Use device_ptr in Thrust sort algorithm
thrust::sort(dev_ptr, dev_ptr+N);

//Sort for float arrays
void sort_float_wrapper( float *data, int N)
thrust::device_ptr <float> dev_ptr(data);
thrust::sort(dev_ptr, dev_ptr+N);

//Sort for double arrays
void sort_double_wrapper( double *data, int N)

thrust::device_ptr <double> dev_ptr(data);
thrust::sort(dev_ptr, dev_ptr+N);

The problem in misunderstanding output by pgf90. I’ve tried -# switch to see exactly where error is forming:

I’m not sure what means this error, because this only happends on MSVC 2010 with pgi workstation 11.10 (I’ve compiled same thing on Windows 7 with MSVC 2008 and all seems okay).
For example, building on Linux with pgi workstation 11.9 gives no warnings.

I guess I need to pass /merge argument to MSVC linker, but didn’t find switch that enable this. Should I execute all above commands by myself and add switch manually?

P.S. tried also next code:

pgf90 -m32 coursework_2011_cuda_tesla_1dv2.cuf a.obj -# -Wl,/

but it didn’t works.

Hi brute11k,

The “-Wl” flag is the correct way to pass options to the linker so “-Wl,/” should have passed this option in. You can check by looking at the verbose output (i.e. -# or -v). For example, your posted verbose output shows a similar “” option which is added by default.

Note that this is only a warning and should not effect the running of your code. The pgstrip utility is used to strip out debugging symbols from your binary and place them in a separate “dwf” file. The only effects by not stripping is a slightly larger binary and you wont be able to debug your code. Note by default very light weight debugging information is added. This can be disabled via the flag “-Mnodwarf”.

  • Mat