Reputation: 29
I was trying to run a simple pthread program on x86 SE mode.
Are m5threads the only way to do this?
When I try to compile libpthread
using make
I get the below error:
pthread.c:40:2: error: #error "spinlock routines not available for your arch!\n"
Is there something I am missing? Maybe some missing path variable or some minor modification of the code somewhere. Because I have the files spinlock_x86.h
and tls_defs.h
.
Upvotes: 1
Views: 955
Reputation: 56
No, you don't have to use m5threads if you're simulating x86 on an x86 host. gem5 has support for running code in shared libraries on the host. Thus, you should be able to compile your program with "-lpthread" and simply run it on gem5.
You may need to mess around with the runscript to get things to work. IIRC, you need to have the exact number of CPUs as threads and set the workload to the same binary for each CPU.
Upvotes: 2