mtconnect / adapter

MTConnect adapter framework
90 stars 73 forks source link

Building adapter for LinuxCNC #22

Open rsbisho2 opened 3 years ago

rsbisho2 commented 3 years ago

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?

Davidzhu001 commented 3 years ago

@rsbisho2 ant solutions?

rsbisho2 commented 3 years ago

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

Davidzhu001 commented 3 years ago

thanks so much