diff --git a/Makefile b/Makefile index 60322204b..5f9c730a5 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,8 @@ ifneq ($(HAS_MPI),0) CXX = $(MPI_PATH)/bin/mpic++ endif -SSE_FLAGS = -msse4.1 -mssse3 +#SSE_FLAGS = -msse4.1 -mssse3 +SSE_FLAGS = PROTOC = $(PROTOBUF_PATH)/bin/protoc @@ -107,7 +108,7 @@ INCLUDEPATH+=$(ONNX_REPO_PATH) COMMON_FLAGS:= $(COMMON_FLAGS) -DONNX_NAMESPACE=onnx -DONNX_ML=1 -DHAS_MPI=$(HAS_MPI) -D_POSIX_SOURCE -D_XOPEN_SOURCE=600 -D__USE_XOPEN2K -std=c++14 -DCUDA_NO_HALF -D__CUDA_NO_HALF_OPERATORS__ CPPFLAGS:= CXXFLAGS:= $(SSE_FLAGS) $(CXXFLAGS) -fopenmp -fpermissive -fPIC -Werror -fcheck-new -LIBPATH:= +LIBPATH:=/usr/lib/riscv64-linux-gnu /lib/riscv64-linux-gnu LIBS_LIST:= LDFLAGS:= @@ -199,7 +200,8 @@ endif ifeq ("$(MATHLIB)","openblas") INCLUDEPATH += $(OPENBLAS_PATH)/include LIBPATH += $(OPENBLAS_PATH)/lib - LIBS_LIST += openblas m pthread + # LIBS_LIST += openblas m pthread + LIBS_LIST += blas m pthread lapacke lapack gfortran CPPFLAGS += -DUSE_OPENBLAS endif diff --git a/Source/Common/Include/ssefloat4.h b/Source/Common/Include/ssefloat4.h index 2211775d4..8967c076f 100644 --- a/Source/Common/Include/ssefloat4.h +++ b/Source/Common/Include/ssefloat4.h @@ -11,6 +11,7 @@ #include // for intrinsics #endif #ifdef __unix__ +#define __aarch64__ #if !defined(__aarch64__) #include #else diff --git a/Source/ComputationNetworkLib/SequenceReshapeNodes.h b/Source/ComputationNetworkLib/SequenceReshapeNodes.h index 1b531c0b5..10639da57 100644 --- a/Source/ComputationNetworkLib/SequenceReshapeNodes.h +++ b/Source/ComputationNetworkLib/SequenceReshapeNodes.h @@ -28,8 +28,8 @@ public: : Base(deviceId, name) {} - virtual std::vector GetSequenceLengths() { NOT_IMPLEMENTED; } - virtual MBLayoutPtr DetermineMBLayout() { NOT_IMPLEMENTED; } + virtual std::vector GetSequenceLengths() { NOT_IMPLEMENTED; { static std::vector foo; return foo; }} + virtual MBLayoutPtr DetermineMBLayout() { NOT_IMPLEMENTED; return NULL; } virtual void /*ComputationNodeNonLooping::*/ ForwardPropNonLooping() override { diff --git a/Source/Math/CPUMatrixImpl.h b/Source/Math/CPUMatrixImpl.h index b02324d98..5eb5cc875 100644 --- a/Source/Math/CPUMatrixImpl.h +++ b/Source/Math/CPUMatrixImpl.h @@ -57,8 +57,10 @@ #define HAVE_LAPACK_CONFIG_H #define LAPACK_COMPLEX_STRUCTURE #endif +extern "C" { #include #include +} #endif #define SWAP(a, b) \ @@ -7089,7 +7091,7 @@ int CPUMatrix::SetNumThreads(int numThreads) #ifdef USE_MKL mkl_set_num_threads(numThreads); #elif defined(USE_OPENBLAS) - openblas_set_num_threads(numThreads); + //openblas_set_num_threads(numThreads); #endif #endif return numThreads; diff --git a/Source/Math/CPUSparseMatrix.cpp b/Source/Math/CPUSparseMatrix.cpp index 85e54d6a9..ec5409790 100644 --- a/Source/Math/CPUSparseMatrix.cpp +++ b/Source/Math/CPUSparseMatrix.cpp @@ -34,8 +34,10 @@ #define HAVE_LAPACK_CONFIG_H #define LAPACK_COMPLEX_STRUCTURE #endif +extern "C" { #include #include +} #endif // This is an example of an exported variable diff --git a/Source/Readers/LMSequenceReader/SequenceParser.h b/Source/Readers/LMSequenceReader/SequenceParser.h index c9c7a3093..4dca002f3 100644 --- a/Source/Readers/LMSequenceReader/SequenceParser.h +++ b/Source/Readers/LMSequenceReader/SequenceParser.h @@ -234,8 +234,13 @@ public: m_endTag = m_endSequenceIn; // if we have a file already open, cleanup - if (m_pFile != NULL) - SequenceParser::~SequenceParser(); + if (m_pFile != NULL) { + //SequenceParser::~SequenceParser(); + delete m_stateTable; + delete m_fileBuffer; + if (m_pFile) + fclose(m_pFile); + } errno_t err = _wfopen_s(&m_pFile, fileName, L"rb"); if (err) diff --git a/Source/Readers/LUSequenceReader/LUSequenceParser.h b/Source/Readers/LUSequenceReader/LUSequenceParser.h index 43bc1d7f2..66b284ab0 100644 --- a/Source/Readers/LUSequenceReader/LUSequenceParser.h +++ b/Source/Readers/LUSequenceReader/LUSequenceParser.h @@ -111,8 +111,11 @@ public: m_endTag = m_endSequenceIn; // if we have a file already open, cleanup - if (m_pFile != NULL) - LUSequenceParser::~LUSequenceParser(); + if (m_pFile != NULL) { + //LUSequenceParser::~LUSequenceParser(); + if (m_pFile) + fclose(m_pFile); + } errno_t err = _wfopen_s(&m_pFile, fileName, L"rb"); if (err) diff --git a/Source/Readers/LibSVMBinaryReader/LibSVMBinaryReader.h b/Source/Readers/LibSVMBinaryReader/LibSVMBinaryReader.h index 809d005ca..f000158f5 100644 --- a/Source/Readers/LibSVMBinaryReader/LibSVMBinaryReader.h +++ b/Source/Readers/LibSVMBinaryReader/LibSVMBinaryReader.h @@ -273,7 +273,7 @@ public: template void RenamedMatrices(const ConfigRecordType& readerConfig, std::map& rename); virtual void SetLabelMapping(const std::wstring& /*sectionName*/, const std::map& /*labelMapping*/){NOT_IMPLEMENTED}; - virtual bool GetData(const std::wstring& /*sectionName*/, size_t /*numRecords*/, void* /*data*/, size_t& /*dataBufferSize*/, size_t /*recordStart = 0*/){NOT_IMPLEMENTED}; + virtual bool GetData(const std::wstring& /*sectionName*/, size_t /*numRecords*/, void* /*data*/, size_t& /*dataBufferSize*/, size_t /*recordStart = 0*/){NOT_IMPLEMENTED; return false;}; virtual bool DataEnd(); size_t GetNumParallelSequencesForFixingBPTTMode() diff --git a/Source/Readers/ReaderLib/FileWrapper.h b/Source/Readers/ReaderLib/FileWrapper.h index a249b2838..9622aedf7 100644 --- a/Source/Readers/ReaderLib/FileWrapper.h +++ b/Source/Readers/ReaderLib/FileWrapper.h @@ -169,6 +169,7 @@ public: inline bool WriteOrDie(const T& value) { WriteOrDie(&value, sizeof(value), 1); + return true; } static inline FileWrapper OpenOrDie(const std::wstring& filename, const wchar_t* mode) @@ -218,4 +219,4 @@ private: -} \ No newline at end of file +} diff --git a/Source/Readers/UCIFastReader/UCIParser.cpp b/Source/Readers/UCIFastReader/UCIParser.cpp index 9eb14249b..e7a3591fb 100644 --- a/Source/Readers/UCIFastReader/UCIParser.cpp +++ b/Source/Readers/UCIFastReader/UCIParser.cpp @@ -388,8 +388,13 @@ void UCIParser::ParseInit(LPCWSTR/*TODO: change to C++ type* m_bufferStart = startPosition; // if we have a file already open, cleanup - if (m_pFile != NULL) - UCIParser::~UCIParser(); + if (m_pFile != NULL) { + //UCIParser::~UCIParser(); + delete m_stateTable; + delete m_fileBuffer; + if (m_pFile) + fclose(m_pFile); + } errno_t err = _wfopen_s(&m_pFile, fileName, L"rb"); if (err) diff --git a/Source/Readers/UCIFastReader/UCIParser.h b/Source/Readers/UCIFastReader/UCIParser.h index 17cb40dbe..dda226b4b 100644 --- a/Source/Readers/UCIFastReader/UCIParser.h +++ b/Source/Readers/UCIFastReader/UCIParser.h @@ -33,7 +33,8 @@ enum ParseMode // UCIParser - the parser for the UCI format files // for ultimate speed, this class implements a state machine to read these format files -template +//template +template class UCIParser { private: diff --git a/Tools/devInstall/Linux/install-swig.sh b/Tools/devInstall/Linux/install-swig.sh index 8ae521ea6..7fb01b2dd 100755 --- a/Tools/devInstall/Linux/install-swig.sh +++ b/Tools/devInstall/Linux/install-swig.sh @@ -39,6 +39,7 @@ fi SCRIPT_DIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")" cd "$SCRIPT_DIR" wget -q http://prdownloads.sourceforge.net/swig/$SWIG_PATH.tar.gz -O - | tar xvfz - +cp ~/RISCV-config.guess ./swig-3.0.10/Tools/config/config.guess cd swig-$SWIG_VERSION # Note: we specify --without-alllang to suppress building tests and examples for specific languages. ./configure --prefix=$SWIG_PREFIX --without-alllang diff --git a/configure b/configure index b9a8efc38..dadaa0992 100755 --- a/configure +++ b/configure @@ -82,8 +82,8 @@ have_cudnn=no cudnn_path= cudnn_check=cuda/include/cudnn.h -have_opencv=no -opencv_path= +have_opencv=yes +opencv_path=/opt/opencv opencv_check=include/opencv2/opencv.hpp have_libzip=no @@ -184,7 +184,9 @@ function find_mkl () function find_openblas () { - find_dir "$default_openblas" "$openblas_check" + #find_dir "$default_openblas" "$openblas_check" + echo "/usr/include" + return 0 } function find_boost () @@ -827,13 +829,13 @@ do exit 1 fi else - if test $(check_dir $optarg $openblas_check) = yes - then + #if test $(check_dir $optarg $openblas_check) = yes + #then openblas_path=$optarg - else - echo "Invalid openblas directory $optarg" - exit 1 - fi + #else + # echo "Invalid openblas directory $optarg" + # exit 1 + #fi fi ;; --with-boost*)