adapter icon indicating copy to clipboard operation
adapter copied to clipboard

Building adapter for LinuxCNC

Open rsbisho2 opened this issue 5 years ago • 3 comments

Hi I am trying to compile the adapter for LinuxCNC. I have a fresh environment installed using their downloadable ISO file.

I was able to clone the repository and attempt to make it. At first, some files were missing, so I found those in /usr/include/linuxcnc/. I created a new directory in the emc folder and copied the included files into it.

cp /usr/include/linuxcnc/* emc2/

I then had to make some changes to the Makefile to account for the new naming, since everything is now named LinuxCNC instead of EMC.

Here is the Makefile after my changes: (note changes made to lines 1 and 3)

CXXFLAGS = -g -I/usr/include/linuxcnc -I../src
LDFLAGS =
LIBS=-llinuxcnc -lnml -llinuxcncini

vpath %.hpp ../src ../include
vpath %.cpp ../src

all: adapter

adapter: emc.o device_datum.o string_buffer.o string_array.o client.o server.o adapter.o emc_adapter.o logger.o service.o
        g++ ${CXXFLAGS} ${LDFLAGS} -o adapter $+ ${LIBS}

device_datum.o: device_datum.cpp device_datum.hpp string_buffer.hpp

string_buffer.o: string_buffer.cpp string_buffer.hpp

client.o: client.cpp client.hpp

server.o: server.cpp server.hpp client.hpp

adapter.o: adapter.cpp adapter.hpp server.hpp client.hpp

emc.o: emc.cpp emc_adapter.hpp adapter.hpp

emc_adapter.o: emc_adapter.cpp emc_adapter.hpp adapter.hpp server.hpp client.hpp

string_array.o: string_array.cpp string_array.hpp

logger.o: logger.cpp logger.hpp

service.o: service.cpp

I was able to get it to compile successfully, but when I attempt to execute ./adapter, I get Segmentation Fault

What am I doing wrong?

rsbisho2 avatar Oct 30 '20 02:10 rsbisho2

@rsbisho2 ant solutions?

Davidzhu001 avatar Nov 25 '20 03:11 Davidzhu001

No solutions. Was never able to get the CPP adapter to work. The Pocket NC python adapter does work for LinuxCNC though.

rsbisho2 avatar Nov 25 '20 04:11 rsbisho2

thanks so much

Davidzhu001 avatar Nov 26 '20 05:11 Davidzhu001