SeanMcGrath / fadc-tools

Software for parsing/analyzing fADC125-generated root files.
0 stars 0 forks source link

Trying to compile on laptop gives fatal error #6

Open acschick opened 8 years ago

acschick commented 8 years ago

1x-nat-vl932-172-30-193-100:src Andrew$ sudo make Generating ROOT Dictionary file for classes... Warning in cling::IncrementalParser::CheckABICompatibility(): C++ ABI mismatch, compiled with _LIBCPP_VERSION v1101 running with v3700 Done! Compiling shared library... fadc.c:2:10: fatal error: 'argp.h' file not found

include "argp.h"

     ^

1 error generated. make: *\ [libfadc.so] Error 1

I can get argp.h from Matt's computer but on his Windows it's in his usr/include folder. I was wondering where it ought to be for a linux system.

acschick commented 8 years ago

I put argp.h into the fadc src folder and now this is what I get:

1x-nat-vl932-172-30-193-100:src Andrew$ sudo make Password: Compiling shared library... Undefined symbols for architecture x86_64: "_argp_parse", referenced from: _main in fadc-d7dc79.o "_argp_usage", referenced from: parseopt(int, char, argpstate) in fadc-d7dc79.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *\ [libfadc.so] Error 1 1x-nat-vl932-172-30-193-100:src Andrew$ -v -bash: -v: command not found

acschick commented 8 years ago

"Normally this sort of failure happens when compiling your C++ code by invoking the C front-end. The gcc you execute understands and compiles the file as C++, but doesn't link it with the C++ libraries. Example"

SeanMcGrath commented 8 years ago

OK -- argp is the argument parser library that is used to handle arguments passed to fadc. argp.h defines the library's interface, but this error seems to indicate that the actual implementation is not being found by your linker.

I don't think macs come with argp installed by default. In theory I could bundle it into fadc, but I'm not going to bother. Here's what you do:

  1. install vagrant.
  2. Use the Vagrantfile in the repo to start a virtual Ubuntu machine by running vagrant up from the folder containing the Vagrantfile.
  3. Connect to the virtual machine, enabling X forwarding: vagrant ssh -- -X.
  4. Now your terminal is issuing commands to an Ubuntu VM. The fadc-tools folder should be mounted in the home folder of the virtual machine. You can cd into it and the code should compile/install correctly.
  5. Install and run fadc on the virtual machine just like you normally would. You can exit the virtual machine by running exit. To shut down the VM, run vagrant halt.
SeanMcGrath commented 8 years ago

Alternatively, there's a hacky fix for macs here. Your choice

acschick commented 8 years ago

So I just put that in the header file?

I don't understand the language in his post haha.

acschick commented 8 years ago

I get this error in the VM:

vagrant@vagrant-ubuntu-trusty-64:~/fadc-tools/src$ sudo make Compiling shared library... FadcToolsDict.cxx:15:31: fatal error: TDictAttributeMap.h: No such file or directory

include "TDictAttributeMap.h"

SeanMcGrath commented 8 years ago

do make clean then make. I've never seen that error but it's probably an artifact of an incomplete build.