From ab1300291e740c0850521b91fef6a09a8f43276c Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Wed, 14 Sep 2016 18:40:39 +0200 Subject: [PATCH 1/3] compile error --- src/CMakeLists.txt | 15 ++++++++------- src/npz_converter.cpp | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2aa3fdc9..11b36053 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,34 +2,35 @@ include_directories(.) add_library(libcommon OBJECT - exception.cpp cnpy/cnpy.cpp + exception.cpp + #npz_converter.cpp ) cuda_add_executable( marian - test.cu expressions.cu - tensor_operators.cu + test.cu tensor.cu + tensor_operators.cu $ ) cuda_add_executable( train_mnist - train_mnist.cu expressions.cu - tensor_operators.cu + train_mnist.cu tensor.cu + tensor_operators.cu $ ) cuda_add_executable( validate_mnist - validate_mnist.cu expressions.cu - tensor_operators.cu + validate_mnist.cu tensor.cu + tensor_operators.cu $ ) diff --git a/src/npz_converter.cpp b/src/npz_converter.cpp index 1ecbc11c..771ff11c 100644 --- a/src/npz_converter.cpp +++ b/src/npz_converter.cpp @@ -1,4 +1,4 @@ -#include "common/npz_converter.h" +#include "npz_converter.h" From e7ea44c689d39075d50d64c912b910ad4f81c756 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Wed, 14 Sep 2016 19:06:50 +0200 Subject: [PATCH 2/3] compile error --- src/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 11b36053..9d6e8bf4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,7 +4,6 @@ include_directories(.) add_library(libcommon OBJECT cnpy/cnpy.cpp exception.cpp - #npz_converter.cpp ) cuda_add_executable( From 41bab63f70df6e0708fb29c75a1762995a9d4291 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Wed, 14 Sep 2016 19:56:08 +0200 Subject: [PATCH 3/3] cmake. Compiles -j without errors --- src/CMakeLists.txt | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9d6e8bf4..306b15c3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,33 +6,39 @@ add_library(libcommon OBJECT exception.cpp ) +cuda_add_library(common_cuda + expressions.cu + test.cu + tensor.cu + tensor_operators.cu +) + +target_link_libraries(common_cuda) + cuda_add_executable( marian - expressions.cu - test.cu - tensor.cu tensor_operators.cu $ ) +target_link_libraries(marian common_cuda) + cuda_add_executable( train_mnist - expressions.cu train_mnist.cu - tensor.cu - tensor_operators.cu $ ) +target_link_libraries(train_mnist common_cuda) + cuda_add_executable( validate_mnist - expressions.cu validate_mnist.cu - tensor.cu - tensor_operators.cu $ ) +target_link_libraries(validate_mnist common_cuda) + foreach(exec marian train_mnist validate_mnist) target_link_libraries(${exec} ${EXT_LIBS} cuda cudnn) cuda_add_cublas_to_target(${exec})