Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
CNNArch2Caffe2
Commits
0e9d8e54
Commit
0e9d8e54
authored
Dec 24, 2018
by
Carlos Alfredo Yeverino Rodriguez
Browse files
Corrected CMakeLists.txt
parent
9bb5ef81
Pipeline
#94039
failed with stages
in 3 minutes and 50 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/cnnarch/caffe2generator/CNNArch2Caffe2.java
View file @
0e9d8e54
...
...
@@ -156,7 +156,14 @@ public class CNNArch2Caffe2 implements CNNArchGenerator{
CMakeConfig
cMakeConfig
=
new
CMakeConfig
(
rootModelName
);
cMakeConfig
.
addModuleDependency
(
new
CMakeFindModule
(
"Armadillo"
,
true
));
cMakeConfig
.
addCMakeCommand
(
"set(LIBS ${LIBS} mxnet)"
);
cMakeConfig
.
addModuleDependency
(
new
CMakeFindModule
(
"Caffe2"
,
true
));
cMakeConfig
.
addCMakeCommand
(
"find_package(CUDA)"
+
"\n"
+
"set(INCLUDE_DIRS ${INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS})"
+
"\n"
+
"set(LIBS ${LIBS} ${CUDA_LIBRARIES} ${CUDA_curand_LIBRARY})"
+
"\n"
);
//Needed since CUDA cannot be found correctly (including CUDA_curand_LIBRARY) and as optional using CMakeFindModule
cMakeConfig
.
addCMakeCommand
(
"if(CUDA_FOUND)"
+
"\n"
+
" set(LIBS ${LIBS} caffe2 caffe2_gpu)"
+
"\n"
+
"else()"
+
"\n"
+
" set(LIBS ${LIBS} caffe2)"
+
"\n"
+
"endif()"
);
Map
<
String
,
String
>
fileContentMap
=
new
HashMap
<>();
for
(
FileContent
fileContent
:
cMakeConfig
.
generateCMakeFiles
()){
...
...
src/test/resources/target_code/CMakeLists.txt
View file @
0e9d8e54
...
...
@@ -7,12 +7,23 @@ project(alexnet LANGUAGES CXX)
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake
)
# add dependencies
find_package
(
Caffe2 REQUIRED
)
set
(
INCLUDE_DIRS
${
INCLUDE_DIRS
}
${
Caffe2_INCLUDE_DIRS
}
)
set
(
LIBS
${
LIBS
}
${
Caffe2_LIBRARIES
}
)
find_package
(
Armadillo REQUIRED
)
set
(
INCLUDE_DIRS
${
INCLUDE_DIRS
}
${
Armadillo_INCLUDE_DIRS
}
)
set
(
LIBS
${
LIBS
}
${
Armadillo_LIBRARIES
}
)
# additional commands
set
(
LIBS
${
LIBS
}
mxnet
)
find_package
(
CUDA
)
set
(
INCLUDE_DIRS
${
INCLUDE_DIRS
}
${
CUDA_INCLUDE_DIRS
}
)
set
(
LIBS
${
LIBS
}
${
CUDA_LIBRARIES
}
${
CUDA_curand_LIBRARY
}
)
if
(
CUDA_FOUND
)
set
(
LIBS
${
LIBS
}
caffe2 caffe2_gpu
)
else
()
set
(
LIBS
${
LIBS
}
caffe2
)
endif
()
# create static library
include_directories
(
${
INCLUDE_DIRS
}
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment