Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix glog #81

Merged
merged 2 commits into from
Jan 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ option(ON_RELEASE "RELEASE mode" ON)


include(external/zlib) # download, build, install zlib
include(external/gflags) # download, build, install gflags
include(external/glog) # download, build, install glog
if (NOT ON_RELEASE)
include(external/gflags) # download, build, install gflags
include(external/glog) # download, build, install glog
endif(NOT ON_RELEASE)
include(external/gtest) # download, build, install gtest
include(external/eigen) # download eigen
include(external/pybind11) # download pybind11
Expand All @@ -32,7 +34,7 @@ include(external/python) # find python and set path

if (NOT ON_RELEASE)
message(STATUS "build on debug mode")
add_compile_options(-DVISUALDL_WITH_GLOG)
add_definitions(-DVISUALDL_WITH_GLOG)
endif(NOT ON_RELEASE)

include_directories(${PROJECT_SOURCE_DIR})
Expand Down
11 changes: 8 additions & 3 deletions visualdl/logic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
add_library(im ${PROJECT_SOURCE_DIR}/visualdl/logic/im.cc)
add_library(sdk ${PROJECT_SOURCE_DIR}/visualdl/logic/sdk.cc ${PROJECT_SOURCE_DIR}/visualdl/utils/image.h)
add_dependencies(im storage_proto)
add_dependencies(sdk entry storage storage_proto)
add_dependencies(sdk entry storage storage_proto eigen3)

## pybind
add_library(core SHARED ${PROJECT_SOURCE_DIR}/visualdl/logic/pybind.cc)
add_dependencies(core pybind python im entry tablet storage sdk protobuf glog eigen3)
target_link_libraries(core PRIVATE pybind entry python im tablet storage sdk protobuf glog)
if (NOT ON_RELEASE)
add_dependencies(core pybind python im entry tablet storage sdk protobuf glog eigen3)
target_link_libraries(core PRIVATE pybind entry python im tablet storage sdk protobuf glog)
else()
add_dependencies(core pybind python im entry tablet storage sdk protobuf eigen3)
target_link_libraries(core PRIVATE pybind entry python im tablet storage sdk protobuf)
endif()
set_target_properties(core PROPERTIES PREFIX "" SUFFIX ".so")
2 changes: 1 addition & 1 deletion visualdl/logic/histogram.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef VISUALDL_LOGIC_HISTOGRAM_H
#define VISUALDL_LOGIC_HISTOGRAM_H

#include <glog/logging.h>
#include "visualdl/utils/logging.h"
#include <cstdlib>
#include <limits>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion visualdl/logic/im.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <glog/logging.h>
#include "visualdl/utils/logging.h"
#include <ctime>

#include "visualdl/logic/im.h"
Expand Down
2 changes: 1 addition & 1 deletion visualdl/logic/im.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef VISUALDL_LOGIC_IM_H
#define VISUALDL_LOGIC_IM_H

#include <glog/logging.h>
#include "visualdl/utils/logging.h"
#include <memory>
#include <mutex>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion visualdl/storage/storage.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef VISUALDL_STORAGE_STORAGE_H
#define VISUALDL_STORAGE_STORAGE_H

#include <glog/logging.h>
#include "visualdl/utils/logging.h"
#include <algorithm>
#include <set>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion visualdl/storage/tablet.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef VISUALDL_TABLET_H
#define VISUALDL_TABLET_H

#include <glog/logging.h>
#include "visualdl/utils/logging.h"

#include "visualdl/logic/im.h"
#include "visualdl/storage/record.h"
Expand Down
2 changes: 1 addition & 1 deletion visualdl/utils/concurrency.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef VISUALDL_UTILS_CONCURRENCY_H
#define VISUALDL_UTILS_CONCURRENCY_H

#include <glog/logging.h>
#include "visualdl/utils/logging.h"
#include <chrono>
#include <memory>
#include <thread>
Expand Down
2 changes: 1 addition & 1 deletion visualdl/utils/filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ bool DeSerializeFromFile(T* proto, const std::string& path) {
}

static void TryMkdir(const std::string& dir) {
VLOG(1) << "try to mkdir " << dir;
// VLOG(1) << "try to mkdir " << dir;
struct stat st = {0};
if (stat(dir.c_str(), &st) == -1) {
::mkdir(dir.c_str(), 0700);
Expand Down
2 changes: 1 addition & 1 deletion visualdl/utils/image.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef VISUALDL_UTILS_IMAGE_H
#define VISUALDL_UTILS_IMAGE_H

#include <glog/logging.h>
#include "visualdl/utils/logging.h"
#include <Eigen/Core>
#include <unsupported/Eigen/CXX11/Tensor>

Expand Down
2 changes: 1 addition & 1 deletion visualdl/utils/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <string>

#if defined(VISUALDL_WITH_GLOG)
#include <glog/logging.h>
#include "visualdl/utils/logging.h"
#endif

namespace visualdl {
Expand Down
2 changes: 1 addition & 1 deletion visualdl/utils/test_concurrency.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "visualdl/utils/concurrency.h"

#include <glog/logging.h>
#include "visualdl/utils/logging.h"
#include <gtest/gtest.h>

namespace visualdl {
Expand Down