diff --git a/Applications/LogisticRegression/src/reader.cpp b/Applications/LogisticRegression/src/reader.cpp index f0d47b6..055d3d6 100644 --- a/Applications/LogisticRegression/src/reader.cpp +++ b/Applications/LogisticRegression/src/reader.cpp @@ -44,7 +44,7 @@ SampleReader::SampleReader( } files_.push_back(files.substr(prev)); - buffer_ = CeateSamples(buffer_size_, row_size, sparse); + buffer_ = CreateSamples(buffer_size_, row_size, sparse); if (init) { diff --git a/Applications/LogisticRegression/src/util/common.h b/Applications/LogisticRegression/src/util/common.h index 4a9ad43..b6d0d9b 100644 --- a/Applications/LogisticRegression/src/util/common.h +++ b/Applications/LogisticRegression/src/util/common.h @@ -46,7 +46,7 @@ inline EleType* MatrixRow(EleType*matrix, int row_id, size_t num_col) { } template -Sample** CeateSamples(int num, size_t size, bool sparse) { +Sample** CreateSamples(int num, size_t size, bool sparse) { Sample**samples = new Sample*[num]; for (int i = 0; i < num; ++i) { samples[i] = new Sample(sparse, size); diff --git a/CMakeLists.txt b/CMakeLists.txt index cfca19c..83fb797 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,12 +13,16 @@ find_package(MPI REQUIRED) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") +# add for sake of errors like 'undefined reference to `hdfsWrite`' if(USE_HDFS) ADD_DEFINITIONS(-DMULTIVERSO_USE_HDFS) SET(JVM_LIB /usr/local/java/default/jre/lib/amd64/server) SET(HDFS_LIB /usr/local/hadoop/lib/native) + SET(HDFS_INCLUDE /usr/local/hadoop/include) LINK_DIRECTORIES(${HDFS_LIB}) LINK_DIRECTORIES(${JVM_LIB}) + include_directories(${HDFS_INCLUDE}) + link_libraries(hdfs) endif(USE_HDFS) if(ENABLE_DCASGD) diff --git a/include/multiverso/io/hdfs_stream.h b/include/multiverso/io/hdfs_stream.h index c8fe4d9..1992601 100644 --- a/include/multiverso/io/hdfs_stream.h +++ b/include/multiverso/io/hdfs_stream.h @@ -8,7 +8,7 @@ * \brief The implement of hdfs io interface. */ -#include "multiverso/util/io.h" +#include "multiverso/io/io.h" #include "hdfs.h" #include diff --git a/src/io/hdfs_stream.cpp b/src/io/hdfs_stream.cpp index 69ba0fe..1c77237 100644 --- a/src/io/hdfs_stream.cpp +++ b/src/io/hdfs_stream.cpp @@ -1,9 +1,14 @@ #ifdef MULTIVERSO_USE_HDFS -#include "multiverso/util/hdfs_stream.h" +#include "multiverso/io/hdfs_stream.h" namespace multiverso { +// add O_BINARY define, for no difference for text/binary in unix* +#ifndef O_BINARY +#define O_BINARY 0 +#endif + HDFSStream::HDFSStream(hdfsFS fs, const URI &uri, FileOpenMode mode) { using namespace std; is_good_ = true;