added additional library dependencies for Caffe2

parent d474fa3c
Pipeline #99579 passed with stages
in 3 minutes and 54 seconds
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<!-- .. SE-Libraries .................................................. --> <!-- .. SE-Libraries .................................................. -->
<CNNArch.version>0.2.7</CNNArch.version> <CNNArch.version>0.2.7</CNNArch.version>
<CNNTrain.version>0.2.5</CNNTrain.version> <CNNTrain.version>0.2.5</CNNTrain.version>
<embedded-montiarc-math-generator>0.0.25-20180812.120330-2</embedded-montiarc-math-generator> <embedded-montiarc-math-generator>0.1.2-SNAPSHOT</embedded-montiarc-math-generator>
<!-- .. Libraries .................................................. --> <!-- .. Libraries .................................................. -->
<guava.version>18.0</guava.version> <guava.version>18.0</guava.version>
......
...@@ -157,6 +157,7 @@ public class CNNArch2Caffe2 implements CNNArchGenerator{ ...@@ -157,6 +157,7 @@ public class CNNArch2Caffe2 implements CNNArchGenerator{
CMakeConfig cMakeConfig = new CMakeConfig(rootModelName); CMakeConfig cMakeConfig = new CMakeConfig(rootModelName);
cMakeConfig.addModuleDependency(new CMakeFindModule("Armadillo", true)); cMakeConfig.addModuleDependency(new CMakeFindModule("Armadillo", true));
cMakeConfig.addModuleDependency(new CMakeFindModule("Caffe2", true)); cMakeConfig.addModuleDependency(new CMakeFindModule("Caffe2", true));
cMakeConfig.addCMakeCommand("set(LIBS ${LIBS} -lprotobuf -lglog -lgflags)");
cMakeConfig.addCMakeCommand("find_package(CUDA)" + "\n" cMakeConfig.addCMakeCommand("find_package(CUDA)" + "\n"
+ "set(INCLUDE_DIRS ${INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS})" + "\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 + "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
......
...@@ -7,14 +7,15 @@ project(alexnet LANGUAGES CXX) ...@@ -7,14 +7,15 @@ project(alexnet LANGUAGES CXX)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# add dependencies # add dependencies
find_package(Caffe2 REQUIRED)
set(INCLUDE_DIRS ${INCLUDE_DIRS} ${Caffe2_INCLUDE_DIRS})
set(LIBS ${LIBS} ${Caffe2_LIBRARIES})
find_package(Armadillo REQUIRED) find_package(Armadillo REQUIRED)
set(INCLUDE_DIRS ${INCLUDE_DIRS} ${Armadillo_INCLUDE_DIRS}) set(INCLUDE_DIRS ${INCLUDE_DIRS} ${Armadillo_INCLUDE_DIRS})
set(LIBS ${LIBS} ${Armadillo_LIBRARIES}) set(LIBS ${LIBS} ${Armadillo_LIBRARIES})
find_package(Caffe2 REQUIRED)
set(INCLUDE_DIRS ${INCLUDE_DIRS} ${Caffe2_INCLUDE_DIRS})
set(LIBS ${LIBS} ${Caffe2_LIBRARIES})
# additional commands # additional commands
set(LIBS ${LIBS} -lprotobuf -lglog -lgflags)
find_package(CUDA) find_package(CUDA)
set(INCLUDE_DIRS ${INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS}) set(INCLUDE_DIRS ${INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS})
set(LIBS ${LIBS} ${CUDA_LIBRARIES} ${CUDA_curand_LIBRARY}) set(LIBS ${LIBS} ${CUDA_LIBRARIES} ${CUDA_curand_LIBRARY})
...@@ -28,7 +29,7 @@ endif() ...@@ -28,7 +29,7 @@ endif()
# create static library # create static library
include_directories(${INCLUDE_DIRS}) include_directories(${INCLUDE_DIRS})
add_library(alexnet alexnet.h) add_library(alexnet alexnet.h)
target_include_directories(alexnet PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(alexnet PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${INCLUDE_DIRS})
target_link_libraries(alexnet PUBLIC ${LIBS}) target_link_libraries(alexnet PUBLIC ${LIBS})
set_target_properties(alexnet PROPERTIES LINKER_LANGUAGE CXX) set_target_properties(alexnet PROPERTIES LINKER_LANGUAGE CXX)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment