0
votes

I'm trying to manually compile some UVM examples using clang++. UVM-SystemC-1.0 was installed successfully (it apparently also ran these examples as tests). However when I compile these examples using the command

clang++ -I/Users/ahmadmas/Downloads/systemc-2.3.1/include -I/Users/ahmadmas/Downloads/uvm-systemc-1.0-alpha1/include -L/Users/ahmadmas/Downloads/systemc-2.3.1/lib-macosx64 -lsystemc -L/Users/ahmadmas/Downloads/uvm-systemc-1.0-alpha1/lib-macosx64 -uvm hello_world.cpp

I get the following error:

(Huge amount of text)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any ideas what I might be doing wrong?

Thanks

2

2 Answers

1
votes

This is just a comment , as i don't have permission to add comments :( adding it as a answer

-l links the library file - lib. from the paths specified in -L option. The lib file for uvm in lib-macosx64 is libuvm-systemc.dylib => the linker option will be -luvm-systemc

0
votes

Actually I resolved the issue myself.

Everything in the above compilation command is correct, except for the linker.

In systemC, the linker flag is -lsystemc, which would correspond to uvm having -luvm or -uvm. However, it is -luvm-systemc (which creates a bit of a misunderstanding as one has to link systemc twice for uvm to work).