harvard-acc / ALADDIN

A pre-RTL, power-performance model for fixed-function accelerators
Other
170 stars 55 forks source link

Undefined Symbol in full_trace.so #12

Closed yungtrizzle closed 7 years ago

yungtrizzle commented 7 years ago

I've compiled Aladdin and LLVM-Tracer on ubuntu 16.04 and I'm trying to run the example program in the readme. However when the opt command is invoked it returns an error about a undefined symbol.

Error opening '/home/dev2/LLVM-Tracer-master/full-trace/full_trace.so': /home/dev2/LLVM-Tracer-master/full-trace/full_trace.so: undefined symbol: _ZN4llvm8LoopInfo2IDE -load request ignored.

I built llvm from source using the cmake scripts in the tracer repo.

xyzsam commented 7 years ago

I haven't actually ever used the cmake scripts to build and install LLVM from source. I have done it manually - it's not difficult, I only needed to specify the installation prefix, and I've never had any issues. @rgly, can you comment on this?

Are you able to use Docker? I have a Docker image with LLVM 3.4.2 pre-set-up that you can pull and start using right away, and I've verified that LLVM-Tracer works in the container.

yungtrizzle commented 7 years ago

I don't have Docker on my workstation. I was attempting to setup the environment inside a Ubuntu vm since I am on windows 7.

xyzsam commented 7 years ago

At the moment, I only have two suggestions for you:

  1. Build and install LLVM from source manually, rather than through the cmake scripts, and if that works, please report back to us so we can investigate any potential bugs in our cmake files. For what it's worth, I'm using LLVM 3.4.2. Also, make sure you're using a recent gcc to compile LLVM. I used gcc 5.4.0.
  2. Install Docker in your VM and pull the docker image, located here: https://hub.docker.com/r/xyzsam/gem5-aladdin/. Docker is quite easy to install and get up and running in a VM. Then docker run -it --rm --mount source:gem5-aladdin-workspace,target=/workspace xyzsam/gem5-aladdin:latest should start the container.
yungtrizzle commented 7 years ago

I'll try the docker and see what happens

rgly commented 7 years ago

Sorry, I can not reproduce your issue. Since the it is a LLVM related issue, I only tested LLVM-Tracer. Here is what I do:

  1. download ubuntu 16.04 virtualbox image from osboxes.org and open it with Virtualbox 5.0.2
  2. apt upgrade & install cmake git libncurse5-dev zlib1g-dev Here, g++ is 5.4.0 and cmake is 3.5.1
  3. clone LLVM-Tracer
  4. mkdir LLVM-Tracer/build
  5. cmake .. -DLLVM_ROOT=$HOME/lib/llvm-3.4 -DAUTOINSTALL=TRUE
  6. ctest No error reported.

Could you please share your steps so that I can reproduce your issue? I guess you may have multiple versions of g++ on your machine. Because the name mangling scheme is changed from gcc5, program compiled by gcc4 is not compatible with gcc5.

yungtrizzle commented 7 years ago

@rgly I think you missed my point. Compiling LLVM produces no errors neither does the ctest. The error is from attempting to run the example in the README. My vm is a clean install with only one version of gcc(5.4.0) installed from the official repos. I buillt LLVM-Tracer and Aladdin as per build instructions the respective READMEs.

xyzsam commented 7 years ago

Were you able to try the Docker image?

FWIW this past weekend I rebuilt my own LLVM from scratch, using gcc 4.8.1 (on an old RedHat machine), and everything still worked.

On Mon, Nov 20, 2017, 3:11 AM Eshton Robateau notifications@github.com wrote:

@rgly https://github.com/rgly I think you missed my point. Compiling LLVM produces no errors neither does the ctest. The error is from attempting to run the example in the README. My vm is a clean install with only one version of gcc(5.4.0) installed from the official repos. I buillt LLVM-Tracer and Aladdin as per build instructions the respective READMEs.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/ysshao/ALADDIN/issues/12#issuecomment-345620129, or mute the thread https://github.com/notifications/unsubscribe-auth/ABSxXBwThCRWTWz5t3RTKQk5FDvPT_w3ks5s4TQUgaJpZM4Qf1eh .

-- Thanks,

Sam Xi Harvard University Computer Science, Ph.D. Candidate http://www.samxi.org

yungtrizzle commented 7 years ago

I rebuilt LLVM manually yesterday and I just finished rebuilding Aladdin. I think LLVM needs to be built separately. It seems the cmake script for LLVM has a bug somewhere. Closing this issue.