Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues while compiling Zsim on linux x86-64 #1

Closed
sparsh0mittal opened this issue Apr 29, 2014 · 5 comments
Closed

Issues while compiling Zsim on linux x86-64 #1

sparsh0mittal opened this issue Apr 29, 2014 · 5 comments
Labels

Comments

@sparsh0mittal
Copy link

I get the following 2 errors:
/usr/bin/ld: cannot find -lpthread
build/opt/virt/patchdefs.h:41:1: error: ‘SYS_getcpu’ was not declared in this scope

I tried to search on internet, but could not resolve. Here is the detailed log:

g++ -o build/opt/fftoggle -Wl,-R/home/esm/bin/libconfig/lib --static build/opt/fftoggle.o build/opt/config.o build/opt/galloc.o build/opt/log.o build/opt/pin_cmd.o -L/home/esm/bin/libconfig/lib -lconfig++ -lpthread
/usr/bin/ld: cannot find -lpthread
collect2: error: ld returned 1 exit status
g++ -o build/opt/virt/virt.os -c -fPIC -march=core2 -g -O3 -funroll-loops -g -std=c++0x -Wall -Wno-unknown-pragmas -fomit-frame-pointer -fno-stack-protector -MMD -DBIGARRAY_MULTIPLIER=1 -DUSING_XED -DTARGET_IA32E -DHOST_IA32E -fPIC -DTARGET_LINUX -Werror -DPIN_PATH="/home/esm/PIN/pin-2.10-45467-gcc.3.4.6-ia32_intel64-linux/intel64/bin/pinbin" -DZSIM_PATH="/home/esm/Zsim/zsim/build/opt/libzsim.so" -DMT_SAFE_LOG -I/home/esm/PIN/pin-2.10-45467-gcc.3.4.6-ia32_intel64-linux/extras/xed2-intel64/include -I/home/esm/PIN/pin-2.10-45467-gcc.3.4.6-ia32_intel64-linux/source/include -I/home/esm/PIN/pin-2.10-45467-gcc.3.4.6-ia32_intel64-linux/source/include/gen -I/home/esm/PIN/pin-2.10-45467-gcc.3.4.6-ia32_intel64-linux/extras/components/include -I/home/esm/bin/libconfig/include -Ibuild/opt build/opt/virt/virt.cpp
echo "#define ZSIM_BUILDDATE ""date""\n#define ZSIM_BUILDVERSION ""python misc/gitver.py""" >>build/opt/version.h
scons: *** [build/opt/fftoggle] Error 1
In file included from build/opt/virt/virt.cpp:69:0:
build/opt/virt/patchdefs.h: In function ‘void VirtInit()’:
build/opt/virt/patchdefs.h:41:1: error: ‘SYS_getcpu’ was not declared in this scope
scons: *** [build/opt/virt/virt.os] Error 1
scons: building terminated because of errors.

@hlitz
Copy link

hlitz commented Apr 30, 2014

You have a linker problem here which is unrelated to zsim. You either have not installed libpthread.a or you don't have it in your path or a softlink might be messed up. There should be tons of hits on google. Try locating libpthread first and check that its path is known by the linker.
Check that you are running a recent version of Ubuntu and that you have installed all dependencies, in this case there shouldn't be any problems.
The sys_getcpu problem suggests that you are running an old version of your OS - please see the requirements of zsim and update.

@sparsh0mittal
Copy link
Author

Thanks for the hints.

The version.h file is generated as follows

#define ZSIM_BUILDDATE "Wed Apr 30 14:30:22 EDT 2014"\n#define
ZSIM_BUILDVERSION "master:10:a8c417b:4fc 10+ 4- 563ecf2c"

I think \n should be executed, not printed as such.

Can you please give more hints on SYS_getcpu. I commented that line and it
compiles and runs, but I want to fix that. My computer is
Scientific Linux release 6.5 (Carbon) 2.6.32-358.23.2.el6.x86_64 #1 SMP Wed
Oct 16 11:13:47 CDT 2013 x86_64 x86_64 x86_64 GNU/Linux

The sys_getcpu problem suggests that you are running an old version of your
OS - please see the requirements of zsim and update.

Thanks and Regards
Sparsh Mittal

On Wed, Apr 30, 2014 at 12:58 PM, hlitz notifications@github.com wrote:

You have a linker problem here which is unrelated to zsim. You either have
not installed libpthread.a or you don't have it in your path or a softlink
might be messed up. There should be tons of hits on google. Try locating
libpthread first and check that its path is known by the linker.
Check that you are running a recent version of Ubuntu and that you have
installed all dependencies, in this case there shouldn't be any problems.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-41821359
.

@s5z
Copy link
Owner

s5z commented May 1, 2014

Some old versions of glibc apparently don't define SYS_getcpu, even though it's a valid syscall. Try adding #define SYS_getcpu (168) to the code. No guarantees it'll work though, you should update to a more recent kernel & glibc if possible.

For the \n, try either using /bin/echo or echo -e in SConstruct... you seem to be using an echo that doesn't grok the newline.

@sparsh0mittal
Copy link
Author

Thanks a lot for your reply.

Thanks and Regards
Sparsh Mittal

On Thu, May 1, 2014 at 7:55 PM, Daniel Sanchez notifications@github.comwrote:

Some old versions of glibc apparently don't define SYS_getcpu, even though
it's a valid syscall. Try adding #define SYS_getcpu (168) to the code. No
guarantees it'll work though, you should update to a more recent kernel &
glibc if possible.

For the \n, try either using /bin/echo or echo -e in SConstruct... you
seem to be using an echo that doesn't grok the newline.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-41970280
.

@sparsh0mittal
Copy link
Author

It compiled well with SYS_getcpu definition you told.

Thanks and Regards
Sparsh Mittal

On Fri, May 2, 2014 at 9:16 AM, Sparsh Mittal sparsh0mittal@gmail.comwrote:

Thanks a lot for your reply.

Thanks and Regards
Sparsh Mittal

On Thu, May 1, 2014 at 7:55 PM, Daniel Sanchez notifications@github.comwrote:

Some old versions of glibc apparently don't define SYS_getcpu, even
though it's a valid syscall. Try adding #define SYS_getcpu (168) to the
code. No guarantees it'll work though, you should update to a more recent
kernel & glibc if possible.

For the \n, try either using /bin/echo or echo -e in SConstruct... you
seem to be using an echo that doesn't grok the newline.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-41970280
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants