dabelknap / VMEStream

0 stars 1 forks source link

Difficulty compiling on SLC6 virtual machine #4

Closed dabelknap closed 11 years ago

dabelknap commented 11 years ago

@ekfriis - I am trying to get VMEStream running on the virtual machine, but I don't understand why I am getting this compiler error.

[dbelknap@rctslc6 VMEStream]$ make
gcc -g -Wall -Iinclude -I/afs/cern.ch/user/d/dbelknap/softipbus/include -std=c99 -fPIC   -c -o src/vmestream/VMEStream_PC.o src/vmestream/VMEStream_PC.c
gcc -g -Wall -Iinclude -I/afs/cern.ch/user/d/dbelknap/softipbus/include -std=c99 -fPIC   -c -o /afs/cern.ch/user/d/dbelknap/softipbus/src/circular_buffer.o /afs/cern.ch/user/d/dbelknap/softipbus/src/circular_buffer.c
gcc -g -Wall -Iinclude -I/afs/cern.ch/user/d/dbelknap/softipbus/include -std=c99 -fPIC   -c -o /afs/cern.ch/user/d/dbelknap/softipbus/src/buffer.o /afs/cern.ch/user/d/dbelknap/softipbus/src/buffer.c
ar rcs lib/libvmestream.a src/vmestream/VMEStream_PC.o /afs/cern.ch/user/d/dbelknap/softipbus/src/circular_buffer.o /afs/cern.ch/user/d/dbelknap/softipbus/src/buffer.o
ranlib lib/libvmestream.a
gcc -g -Wall -Iinclude -I/afs/cern.ch/user/d/dbelknap/softipbus/include -std=c99 lib/libvmestream.a -o bin/vme2fd src/vme2fd.c
gcc -g -Wall -Iinclude -I/afs/cern.ch/user/d/dbelknap/softipbus/include -std=c99 lib/libvmestream.a    tests/VMEStream_tests.c   -o tests/VMEStream_tests
/tmp/dbelknap/cctY8hAF.o: In function `test_ram1':
/afs/cern.ch/user/d/dbelknap/VMEStream/tests/VMEStream_tests.c:15: undefined reference to `cbuffer_new'
/afs/cern.ch/user/d/dbelknap/VMEStream/tests/VMEStream_tests.c:16: undefined reference to `cbuffer_new'
/afs/cern.ch/user/d/dbelknap/VMEStream/tests/VMEStream_tests.c:17: undefined reference to `cbuffer_new'
/afs/cern.ch/user/d/dbelknap/VMEStream/tests/VMEStream_tests.c:18: undefined reference to `cbuffer_new'
...

I set the terminal to bash before building. I double-checked my local copy and it works, and the commit hashes of the virtual machine and my local copy are identical.

ekfriis commented 11 years ago

I think you need to include: src/vmestream/VMEStream_PC.o and $SOFTIPBUS/circular_buffer.o in this line:

gcc -g -Wall -Iinclude -I/afs/cern.ch/user/d/dbelknap/softipbus/include -std=c99 lib/libvmestream.a    tests/VMEStream_tests.c   -o tests/VMEStream_tests

otherwise the compiler doesn't know where to find the VMEStream and circular buffer symbols.

dabelknap commented 11 years ago

The symbols in question should be available in lib/libvmestream.a. Do I need to build the library differently?

ekfriis commented 11 years ago

Ah, you are right, I missed that. It looks okay to me. OK, I would see if any of the following gives you clues, from looking at [1]

[1] http://stackoverflow.com/questions/11093600/when-making-a-library-on-unix-is-anything-but-ar-rcs-necessary

dabelknap commented 11 years ago

nm lib/libvmestream.a does show the symbols to be there. It looks like placing lib/libvmestream.a after tests/VMEStream_tests.c did the trick! I'll need to fiddle with the Makefile to use the right ordering.

The only problem I seem to be having now is creating named pipes:

[dbelknap@rctslc6 VMEStream]$ mkfifo test
mkfifo: cannot create fifo `test': Operation not permitted
ekfriis commented 11 years ago

Great. That's strange about the permissions, test does not already exist, does it?

On Wed, Aug 28, 2013 at 7:00 AM, Austin Belknap notifications@github.comwrote:

nm lib/libvmestream.a does show the symbols to be there. It looks like placing lib/libvmestream.a after tests/VMEStream_tests.c did the trick! I'll need to fiddle with the Makefile to use the right ordering.

The only problem I seem to be having now is creating named pipes:

[dbelknap@rctslc6 VMEStream]$ mkfifo test mkfifo: cannot create fifo `test': Operation not permitted

— Reply to this email directly or view it on GitHubhttps://github.com/dabelknap/VMEStream/issues/4#issuecomment-23415975 .

dabelknap commented 11 years ago

No, test doesn't already exist.

ekfriis commented 11 years ago

Ah! Are you on AFS? I don't think you can make a fifo in an AFS directory.

On Wed, Aug 28, 2013 at 7:14 AM, Austin Belknap notifications@github.comwrote:

No, test doesn't already exist.

— Reply to this email directly or view it on GitHubhttps://github.com/dabelknap/VMEStream/issues/4#issuecomment-23417267 .

dabelknap commented 11 years ago

It is in an AFS directory, but I am not executing the command through AFS: I ssh'd into the virtual machine.

ekfriis commented 11 years ago

The general problem is you can't put a FIFO in an AFS directory, since it is a special file. For this same reason, you can only make symlinks, but not hardlinks, on AFS. I think your solution is to mkfifo /tmp/myfifo, and point the test to that.

On Wed, Aug 28, 2013 at 7:40 AM, Austin Belknap notifications@github.comwrote:

It is in an AFS directory, but I am not executing the command through AFS: I ssh'd into the virtual machine.

— Reply to this email directly or view it on GitHubhttps://github.com/dabelknap/VMEStream/issues/4#issuecomment-23419794 .

dabelknap commented 11 years ago

Yep, I can create fifos in tmp just fine. Thanks!