Skip to content

Commit

Permalink
fix glog problem (PaddlePaddle#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesqiao authored Jan 10, 2018
1 parent f7d55bc commit ae821e5
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 16 deletions.
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

0 comments on commit ae821e5

Please sign in to comment.