Bug #529

SWIG typedef failue on 32-bit machines

Added by Tom Rondeau over 1 year ago. Updated over 1 year ago.

Status:ClosedStart date:03/29/2013
Priority:HighDue date:
Assignee:Tom Rondeau% Done:

0%

Category:build
Target version:release-3.6.4.2
Resolution:fixed

Description

As lately as commit b7a5f16f, GNU Radio does not build on 32-bit machines.

The problem is related to SWIG's handling (or mishandling) of size_t. The vector_map block uses vector<vector<size_t>>> in it's arguments and so tells SWIG about this. SWIG seems to cast this 'unsigned long' on 64-bit machines and 'unsigned int' on 32-bit machines.

In gr_block.i, we use vector<unsigned int> to pass in the processor mask to the set_processor_affinity call. We then must tell SWIG about vector<unsigned int>. On 64-bit machines this works because above is sees size_t as an unsigned long. But on 32-bit machines, SWIG thinks we are redefining the typedef for vector<unsigned int>.

While it may be possible to get these concepts to work together, I cannot figure out how to fix this so that both 32-bit and 64-bit machines compile.

The proposed fix is to use ints instead of unsigned ints in the processor affinity mask's vectors (i.e., vector<int> instead of vector<unsigned int>). This is wrong as these values should be unsigned, but I feel that it is better to do this than change the use of size_t. This, of course, limits us to only being able to address somewhere just over 2 billion processors, which I'm ok with for now. Though the conversion to the processor mask underneath might handle the conversion if negative numbers are used.

History

#1 Updated by Tom Rondeau over 1 year ago

  • Resolution set to fixed

This proposed fix was applied in commit:
8088f125a9a432de321c62b82755a895d5184080

This should do for now.

#2 Updated by Tom Rondeau over 1 year ago

  • Status changed from New to Resolved

#3 Updated by Johnathan Corgan over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF