This repository was archived by the owner on Nov 17, 2023. It is now read-only.
-
I'm writing a operator extension library for MXNet. Here's the build error:
And here's my build script (with minor censorship): #!/bin/bash
# TODO.refac replace this with cmake when codebase is large enough
MXNET_HOME=/XXX/incubator-mxnet
ANACONDA_HOME=/XXX/anaconda3
CUDA_HOME=/usr/local/cuda
INCLUDE_DIRS="-I$MXNET_HOME/include -I$ANACONDA_HOME/include -I$CUDA_HOME/include"
LIB_DIRS="-L$MXNET_HOME/build"
LIBS="-lmxnet"
NV_CFLAGS='-std=c++14 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_86,code=sm_86' # 1080Ti & 3090 for now
CFLAGS='-std=c++14 -mf16c -mfma -mavx2 -O3'
LFLAGS='--no-undefined'
OUTPUT_NAME='libmxkhaotik.so'
rm -f lib/*.o
for ifile in src/*.cc; do
g++ -c $CFLAGS $INCLUDE_DIRS -o lib/$(basename $ifile).o -fPIC $ifile
done
for ifile in src/*.cu; do
nvcc -dc -c $NV_CFLAGS -Xcompiler "$CFLAGS -fPIC" $INCLUDE_DIRS -o lib/$(basename $ifile).o $ifile
done
nvcc -dlink -shared $NV_CFLAGS -Xlinker "$LFLAGS" $LIB_DIRS -o lib/"$OUTPUT_NAME" lib/*.o $LIBS && rm lib/*.o I did some research and it appears A few snippets from my code can be seen from this gist. |
Beta Was this translation helpful? Give feedback.
Answered by
khaotik
Apr 8, 2021
Replies: 1 comment 1 reply
-
I dug more and found the source of problem. Adding an |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
khaotik
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I dug more and found the source of problem.
Adding an
inline
fixed the problem for me.