0

I am using an NVIDIA Jetson TX2. I am trying to generate an ".so" file using "make" for the DynamixelSDK. But I am getting this Error:

mkdir -p ./.objects/
gcc -O2 -O3 -DLINUX -D_GNU_SOURCE -Wall -c -I../../include/dynamixel_sdk -m64 -fPIC -g -c ../../src/dynamixel_sdk/group_bulk_read.c -o .objects/group_bulk_read.o
gcc: error: unrecognized command line option ‘-m64’
Makefile:114: recipe for target '.objects/group_bulk_read.o' failed
make: *** [.objects/group_bulk_read.o] Error 1

You can access the make file at- https://pastebin.com/zz9MNnqp

Here's a part of the MakeFile :

#---------------------------------------------------------------------
# C COMPILER, COMPILER FLAGS, AND TARGET PROGRAM NAME
#---------------------------------------------------------------------
DIR_DXL     = ../..
DIR_OBJS    = ./.objects

INSTALL_ROOT = /usr/local

MAJ_VERSION = 2
MIN_VERSION = 0
REV_VERSION = 0

TARGET      = libdxl_x64_c.so
TARGET1     = $(TARGET).$(MAJ_VERSION)
TARGET2     = $(TARGET).$(MAJ_VERSION).$(MIN_VERSION)
TARGET3     = $(TARGET).$(MAJ_VERSION).$(MIN_VERSION).$(REV_VERSION)

CHK_DIR_EXISTS = test -d
PRINT       = echo
STRIP       = strip
AR          = ar
ARFLAGS     = cr
LD          = g++
LDFLAGS     = -shared -fPIC $(FORMAT)#-Wl,-soname,dxl
LD_CONFIG   = ldconfig
CP          = cp
CP_ALL      = cp -r
RM          = rm
RM_ALL      = rm -rf
SYMLINK     = ln -s
MKDIR       = mkdir
CC          = gcc
CX          = g++
CCFLAGS     = -O2 -O3 -DLINUX -D_GNU_SOURCE -Wall -c $(INCLUDES) $(FORMAT) -fPIC -g
CXFLAGS     = -O2 -O3 -DLINUX -D_GNU_SOURCE -Wall -c $(INCLUDES) $(FORMAT) -fPIC -g
FORMAT     = -m64
INCLUDES    += -I$(DIR_DXL)/include/dynamixel_sdk
 #---------------------------------------------------------------------

Tried Both the 32 and 64 bit Versions of the MakeFile (for linux).

I don't know hoe to solve this error. Any help would be appreciated.

Eshita Shukla
  • 791
  • 1
  • 8
  • 30

2 Answers2

1

The makefile assumes that the target is the x86-64 architecture. As a first step, you can simply remove the -m64 option from the FORMAT line in order to get further in the build. However, if the project has never been ported to another architecture, there could well be other target dependencies.

Florian Weimer
  • 32,022
  • 3
  • 48
  • 92
0

This error usually arises when the march, that is, the architecture of the target machine is not defined correctly. The -m64 line represents that it is being compiled for a 64bit architecture. If you see the Makefile for 32bit, it would be -m32.

Try changing the makefile such that it reads something like :

...

FORMAT     = -march=armv8-a+crypto -mcpu=cortex-a57+crypto

....

This is march is usually used for Jetson TX2.

Also, for TX2, GCC options to keep in mind are :

  • Use latest GCC toolchain 7.2
  • Use CLANG llvm front end an alternative to GCC
  • -march=armv8.a+crypto+simd, this enables SIMD, crypto and floating point instruction set and may help.