Cross compile for TX2 with make file


While I trying to compile my project for TX2 by using makefile at linux console.

While I am trying to change the target architecture from X64 to Arm64 I am facing compilations error:
nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified

while my makefile is:

CXXCU =nvcc aarch64-linux-g++ -O0 -std=c++11 --compile --relocatable-device-code=true -gencode arch=compute_61,code=compute_61

OBJ = (addprefix (OBJDIR)/, (CSOURCES:.c=.o) (CXXSOURCES:.cpp=.o) ( ) CXXFLAGS = (INCLUDEDIRS)

CXX =(CXXCU) #g++ CC =(CXXCU) # gcc

all: $(PROGRAM)

ar rc (PROGRAM).a (OBJ)
ranlib $(PROGRAM).a

(OBJDIR)/%.o: ./%.cpp @mkdir -p (@D)
(CXX) (CXXFLAGS) -c -o @ ^

(OBJDIR)/%.o: ./%.c @mkdir -p (@D)
(CC) (CXXFLAGS) -c -o @ ^

(OBJDIR)/%.o: ./ @mkdir -p (@D)


When I removes the aarch64-linux-g++ argument the compilation is pass.
What I am doing wrong at the makefile that the compilation for the Arm64 is fail.


Hi yehonatanswjf8y,

Not sure what’s the actual issue but for TX2 you should use below compiler options.



I also tried that argument for Tx2.

But when I set the arch=compute_62,code=sm_62 it should compile for arm64??
There is no need to set another flag in order to compile the c code for aarch64?

Please take a look at Or try to use/reference to options in nsight (