Skip to content

Commit

Permalink
changed the build system to first make the lcnc original version, aft…
Browse files Browse the repository at this point in the history
…er that the cmake build system overwrites it. This because of several .comp files that halcompiles refuses to compile for now on some pc's.
  • Loading branch information
grotius-cnc committed Nov 9, 2023
1 parent 393484b commit cad3454
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 43 deletions.
96 changes: 54 additions & 42 deletions cmake/build_all
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,63 @@ echo "check dependencies. \n"
sudo apt-get install libeigen3-dev

echo "removing rtapi_app & linuxcnc_module_helper to overwrite. \n"
rm -f ../bin/rtapi_app
rm -f ../bin/linuxcnc_module_helper
cd ../bin
rm -f rtapi_app
rm -f linuxcnc_module_helper
cd ..

#echo "copy python scripts to ~/bin folder. \n"
#cd ..
#cd scripts
#cp -rf * ../bin
#cd ..
#echo "copy python scripts to ~/bin folder. \n"
#cd ..
#cd scripts
#cp -rf * ../bin
#cd ..

echo "run check and set scripts. \n"
cd ..
cd src
./autogen.sh
./configure --enable-non-distributable=yes --with-realtime=uspace
# Use lcnc's original make process for now. The problem is there are .comp files
# that on some pc's will not be installed --install using halcompile. Halcompile fails to find a file.
# To resolve installion problems for now we use the original compilation first, then later on
# we overwrite it with the cmake build system.
# Another problem is that halcompile --preprocess .comp to .c files don't always work correctly.
make -j2
cd ..

echo "Copying header files into the include directory to use with halcompile \n"
cd src/rtapi
cp *.h ../../include
cd ..
cd hal
cp *.h ../../include
cd ..
cd ..
# echo "Copying header files into the include directory to use with halcompile \n"
# cd src/rtapi
# cp *.h ../../include
# cd ..
# cd hal
# cp *.h ../../include
# cd ..
# cd ..

# echo "Building & installing components needed by the axis gui. \nBuilding with halcompile. \n"
# cd scripts
# ./rip-environment halcompile --install ../src/hal/components/ddt.comp
# ./rip-environment halcompile --install ../src/hal/components/hypot.comp
# ./rip-environment halcompile --install ../src/hal/components/sim_spindle.comp
# ./rip-environment halcompile --install ../src/hal/components/limit2.comp
# ./rip-environment halcompile --install ../src/hal/components/lowpass.comp
# ./rip-environment halcompile --install ../src/hal/components/near.comp
# ./rip-environment halcompile --install ../src/hal/components/scale.comp
# ./rip-environment halcompile --install ../src/hal/components/or2.comp
# ./rip-environment halcompile --install ../src/hal/components/comp.comp
# ./rip-environment halcompile --install ../src/hal/components/and2.comp
# ./rip-environment halcompile --install ../src/hal/components/wcomp.comp
# ./rip-environment halcompile --install ../src/hal/components/match8.comp
# ./rip-environment halcompile --install ../src/hal/components/mux2.comp
# ./rip-environment halcompile --install ../src/hal/components/mux4.comp
# ./rip-environment halcompile --install ../src/hal/components/mux8.comp
# ./rip-environment halcompile --install ../src/hal/components/mux16.comp
# ./rip-environment halcompile --install ../src/hal/components/sim_home_switch.comp
# cd ..

echo "Building & installing components needed by the axis gui. \nBuilding with halcompile. \n"
cd scripts
./rip-environment halcompile --install ../src/hal/components/ddt.comp
./rip-environment halcompile --install ../src/hal/components/hypot.comp
./rip-environment halcompile --install ../src/hal/components/sim_spindle.comp
./rip-environment halcompile --install ../src/hal/components/limit2.comp
./rip-environment halcompile --install ../src/hal/components/lowpass.comp
./rip-environment halcompile --install ../src/hal/components/near.comp
./rip-environment halcompile --install ../src/hal/components/scale.comp
./rip-environment halcompile --install ../src/hal/components/or2.comp
./rip-environment halcompile --install ../src/hal/components/comp.comp
./rip-environment halcompile --install ../src/hal/components/and2.comp
./rip-environment halcompile --install ../src/hal/components/wcomp.comp
./rip-environment halcompile --install ../src/hal/components/match8.comp
./rip-environment halcompile --install ../src/hal/components/mux2.comp
./rip-environment halcompile --install ../src/hal/components/mux4.comp
./rip-environment halcompile --install ../src/hal/components/mux8.comp
./rip-environment halcompile --install ../src/hal/components/mux16.comp
./rip-environment halcompile --install ../src/hal/components/sim_home_switch.comp
cd ..

echo "removing rtapi_app & linuxcnc_module_helper to overwrite it with cmake. \n"
rm -f rtapi_app
rm -f linuxcnc_module_helper

echo "Building linuxcnc with cmake. \n"
cd cmake
Expand All @@ -66,9 +78,9 @@ cd ..
echo "current folder:"
echo $PWD
echo "\n"

# Recreate the Sudo Make Setuid command (needed for running real machines)
# This version is from : https://github.com/grotius-cnc/hal-core/blob/main/make
# Recreate the Sudo Make Setuid command (needed for running real machines)
# This version is from : https://github.com/grotius-cnc/hal-core/blob/main/make
echo "Running equivalent of Sudo Make Setuid. \n"
sudo chown 777 -R bin/rtapi_app
sudo chown 777 -R bin/linuxcnc_module_helper
Expand All @@ -79,6 +91,6 @@ echo "Start linuxcnc. \n"
cd scripts
./rip-environment linuxcnc ../configs/sim/axis/axis_mm.ini

# Example to start with custom trajectory planner or use in ini file : [TRAJ]TPMOD=user_tpcomp
# ./rip-environment linuxcnc -t tpmod_scurve ../configs/sim/axis/axis_mm.ini

# Example to start with custom trajectory planner or use in ini file : [TRAJ]TPMOD=user_tpcomp
# ./rip-environment linuxcnc -t tpmod_scurve ../configs/sim/axis/axis_mm.ini
13 changes: 13 additions & 0 deletions cmake/check_build_deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

sudo apt-get install dpkg-dev

echo "Check what dependencies has to be installed. \n"
cd ..
cd debian
./configure uspace
cd ..
dpkg-checkbuilddeps

echo "Now run : $ sudo apt-get install ... to install your deps. \n"

2 changes: 1 addition & 1 deletion cmake/classicladder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ add_executable(${PROJECT_NAME} ${SOURCES})
add_definitions(-DULAPI -DSEQUENTIAL_SUPPORT -DHAL_SUPPORT -DDYNAMIC_PLCSIZE -DRT_SUPPORT -DOLD_TIMERS_MONOS_SUPPORT -DMODBUS_IO_MASTER
-DSEQUENTIAL_SUPPORT -DHAL_SUPPORT -DDYNAMIC_PLCSIZE -DRT_SUPPORT -DOLD_TIMERS_MONOS_SUPPORT -DMODBUS_IO_MASTER
# -DGNOME_PRINT_USE
-DGTK_INTERFACE -DGTK2 -Wno-deprecated-declarations)
-DGTK_INTERFACE -DGTK2 -DGTK3 -Wno-deprecated-declarations)

# Set include paths for libraries to link.
add_library(linuxcnchal SHARED IMPORTED) # or STATIC instead of SHARED
Expand Down
18 changes: 18 additions & 0 deletions cmake/deplist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
virtual machine installed with debian 12.

# Outcomment search from cd, to install new stuff.
sudo nano /etc/apt/sources.list

# For ./autogen to work, we need automake.
sudo apt-get install git cmake automake

sudo apt-get install libudev-dev libmodbus-dev libusb-1.0-0-dev libgpiod-dev libgtk-3-dev libgtk2.0-dev

sudo apt-get install libglib2.0-dev yapps2 intltool libboost-dev python3-dev bwidget
sudo apt-get install libboost-python-dev tklib tcl8.6-dev tk-dev bwidget tclx libreadline-dev libeditreadline-dev
sudo apt-get install python3-tk tclx

git clone https://github.com/grotius-cnc/linuxcnc.git
cd linuxcnc/cmake
./build_all

12 changes: 12 additions & 0 deletions cmake/start_halshow
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

echo "Start halshow. \n"
cd ..
cd scripts
./rip-environment halshow

echo "start linuxcnc server program."
linuxcncsrv
# Start emc server program. /bin/linuxcncsrv


7 changes: 7 additions & 0 deletions cmake/start_lcnc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

echo "Start linuxcnc. \n"
cd ..
cd scripts
./rip-environment linuxcnc ../configs/sim/axis/axis_mm.ini

0 comments on commit cad3454

Please sign in to comment.