Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hydra-image-processor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
hydra-image-processor
Commits
aa4dcfe7
Commit
aa4dcfe7
authored
6 years ago
by
Mark Winter
Browse files
Options
Downloads
Patches
Plain Diff
Linux initial makefile for hydra image processor.
parent
8bdbcbb4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/c/makefile
+101
-0
101 additions, 0 deletions
src/c/makefile
with
101 additions
and
0 deletions
src/c/makefile
0 → 100644
+
101
−
0
View file @
aa4dcfe7
#########################################
# Set these for MATLAB/Python versions
#########################################
MATALAB_DIR
=
/usr/local/MATLAB/R2017b
# NOTE: Currently only builds against python3
PYTHON_VER
=
python3.5
PYTHON3_INC
=
/usr/include/
$(
PYTHON_VER
)
/
NUMPY3_INC
=
/usr/include/
$(
PYTHON_VER
)
/
PYTHON_LIB
=
/usr/lib/
$(
PYTHON_VER
)
/config-3.5m-x86_64-linux-gnu
#########################################
# Default files and include dirs
#########################################
CU_FILES
:=
$(
wildcard Cuda/
*
.cu
)
CUPP_FILES
:=
$(
wildcard Cuda/
*
.cpp
)
MEX_CPP_FILES
:=
$(
wildcard Mex/
*
.cpp
)
PY_CPP_FILES
:=
$(
wildcard Python/
*
.cpp
)
CUDA_OBJ
=
$(
notdir
$(
CU_FILES:.cu
=
.o
))
CUDA_CPP_OBJ
=
$(
notdir
$(
CUPP_FILES:.cpp
=
.o
))
MEX_CPP_OBJ
=
$(
notdir
$(
MEX_CPP_FILES:.cpp
=
.o
))
PY_CPP_OBJ
=
$(
notdir
$(
PY_CPP_FILES:.cpp
=
.o
))
CUDA_INC
=
-I
./Cuda
MEX_INC
=
-I
./WrapCmds
-I
./Mex
-I
$(
MATALAB_DIR
)
/extern/include
PY_INC
=
-I
./WrapCmds
-I
./Python
-I
./Python/py3c
-I
$(
PYTHON3_INC
)
-I
$(
NUMPY3_INC
)
MEX_LIB
=
-L
$(
MATALAB_DIR
)
/bin/glnxa64/libmx.so
-L
$(
MATALAB_DIR
)
/bin/glnxa64/libmex.so
PY_LIB
=
-L
$(
PYTHON_LIB
)
-l
$(
PYTHON_VER
)
#########################################
# Common parameters
#########################################
COMPILE_FLAGS
=
-std
=
c++11
#########################################
# Nvidia nvcc parameters
#########################################
NVCC_PATH
=
nvcc
NVCC_FLAGS
=
$(
COMPILE_FLAGS
)
SMODEL
=
-arch
=
sm_30
NVCC_INC
=
-I
/usr/include
#C_COMPILER = g++
#OMP_LIB = -lgomp
C_COMPILER
=
clang++
OMP_LIB
=
-liomp5
#########################################
# gcc/g++/clang parameters
#########################################
GCC_FLAGS
=
$(
COMPILE_FLAGS
)
-fopenmp
-fPIC
GCC_LIBS
=
$(
OMP_LIB
)
#########################################
# all projects to build
#########################################
all
:
matlab python
@
echo
Finished compiling
python
:
HIP.so
@
echo
Finished compiling python wrappers
matlab
:
Mex.mexa64
@
echo
Fhinished compiling matlab wrappers
#########################################
# link it all together
#########################################
HIP.so
:
$(CUDA_OBJ) $(PY_CPP_OBJ) $(CUDA_CPP_OBJ)
$(
NVCC_PATH
)
$(
GCC_LIBS
)
$(
PY_LIB
)
-shared
$^
-o
HIP.so
$(
SMODEL
)
--linker-options
'--no-undefined'
Mex.mexa64
:
$(CUDA_OBJ) $(MEX_CPP_OBJ) $(CUDA_CPP_OBJ)
$(
NVCC_PATH
)
$(
GCC_LIB
)
$(
MEX_LIB
)
-shared
$^
-o
Mex.mexa64
$(
SMODEL
)
--linker-options
'--no-undefined'
#########################################
# compile the cuda library files
#########################################
%.o
:
Cuda/%.cu
$(
NVCC_PATH
)
$(
NVCC_FLAGS
)
$(
SMODEL
)
--compiler-options
'
$(
GCC_FLAGS
)
'
-c
$<
-o
$@
$(
NVCC_INC
)
-dc
%.o
:
Cuda/%.cpp
$(
C_COMPILER
)
$(
GCC_FLAGS
)
$(
CUDA_INC
)
-c
$<
-o
$@
#########################################
# compile the mex/python wrappers
#########################################
%.o
:
Mex/%.cpp
$(
C_COMPILER
)
$(
GCC_FLAGS
)
$(
MEX_INC
)
-c
$<
-o
$@
%.o
:
Python/%.cpp
$(
C_COMPILER
)
$(
GCC_FLAGS
)
$(
PY_INC
)
-c
$<
-o
$@
#########################################
# files to clean up
#########################################
clean
:
@
echo
Cleaning
rm
-f
*
.o Mex.mexa64 HIP.so
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment