CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

Cannot compile under gcc4.8.2

Open yqwangustc opened this issue 9 years ago • 2 comments

Hi,

I am trying to compile the latest version (c1ec03cc0a1e299ed3d80bcd1132ff81f652e32c) under gcc 4.8.2 / cuDNN 5.1 / cuda 8.0. My os is centOS 6.8.

However, I got the following error:

=-----------------------------------------------------------= creating /home/yqw/Work/Code/CNTK/cntk/build/release/.build/Source/Math/GPUDataTransferer.o for Linux with build type release In file included from Source/Math/BlockHandlerSSE.h:6:0, from Source/Math/BlockHandlerSSE.cpp:18: Source/Math/BlockMultiplierMatrixUtil.h: In function ‘ScalarT* Microsoft::MSR::CNTK::CreateAlignedMatrix(int, int, ScalarT, int)’: Source/Math/BlockMultiplierPlatform.h:13:69: error: there are no arguments to ‘aligned_alloc’ that depend on a template parameter, so a declaration of ‘aligned_alloc’ must be available [-Werror=permissive] #define ALIGNED_ALLOC(bytes,alignment) aligned_alloc(alignment,bytes) ^ Source/Math/BlockMultiplierMatrixUtil.h:83:34: note: in expansion of macro ‘ALIGNED_ALLOC’ ScalarT* ret = (ScalarT*)ALIGNED_ALLOC(sizeof(ScalarT) * (m * n), alignment); ^ /usr/local/mpi/bin/mpic++ -c Source/Math/GPUDataTransferer.cpp -o /home/yqw/Work/Code/CNTK/cntk/build/release/.build/Source/Math/GPUDataTransferer.o -DHAS_MPI=1 -D_POSIX_SOURCE -D_XOPEN_SOURCE=600 -D__USE_XOPEN2K -std=c++11 -DUSE_CUDNN -DUSE_MKL -DNDEBUG -DNO_SYNC -msse4.1 -mssse3 -std=c++0x -fopenmp -fpermissive -fPIC -Werror -fcheck-new -Wno-error=literal-suffix -g -O4 -ISource/Common/Include -ISource/CNTKv2LibraryDll -ISource/CNTKv2LibraryDll/API -ISource/CNTKv2LibraryDll/proto -ISource/../Examples/Extensibility/CPP -ISource/Math -ISource/CNTK -ISource/ActionsLib -ISource/ComputationNetworkLib -ISource/SGDLib -ISource/SequenceTrainingLib -ISource/CNTK/BrainScript -ISource/Readers/ReaderLib -ISource/PerformanceProfilerDll -I/usr/local/protobuf-3.1.0/include -I/usr/local/cuda-8.0/include -I/usr/local/cub-1.4.1 -I/usr/local/cuda-8.0/include -I/usr/local/cudnn-5.1/cuda/include -I/home/yqw/usr/local/CNTKCustomMKL/3/include -ITests/EndToEndTests/CNTKv2Library/Common -I/usr/local/boost-1.60.0/include -ISource/Readers/CNTKTextFormatReader -MD -MP -MF /home/yqw/Work/Code/CNTK/cntk/build/release/.build/Source/Math/GPUDataTransferer.d

and

/usr/local/cuda-8.0/bin/nvcc -c Source/Math/GPUSparseMatrix.cu -o /home/yqw/Work/Code/CNTK/cntk/build/release/.build/Source/Math/GPUSparseMatrix.o -DHAS_MPI=1 -D_POSIX_SOURCE -D_XOPEN_SOURCE=600 -D__USE_XOPEN2K -std=c++11 -DUSE_CUDNN -DUSE_MKL -DNDEBUG -DNO_SYNC -m 64 -O3 -g -use_fast_math -gencode arch=compute_30,code="sm_30,compute_30" -gencode arch=compute_35,code="sm_35,compute_35" -gencode arch=compute_50,code="sm_50,compute_50" -ISource/Common/Include -ISource/CNTKv2LibraryDll -ISource/CNTKv2LibraryDll/API -ISource/CNTKv2LibraryDll/proto -ISource/../Examples/Extensibility/CPP -ISource/Math -ISource/CNTK -ISource/ActionsLib -ISource/ComputationNetworkLib -ISource/SGDLib -ISource/SequenceTrainingLib -ISource/CNTK/BrainScript -ISource/Readers/ReaderLib -ISource/PerformanceProfilerDll -I/usr/local/protobuf-3.1.0/include -I/usr/local/cuda-8.0/include -I/usr/local/cub-1.4.1 -I/usr/local/cuda-8.0/include -I/usr/local/cudnn-5.1/cuda/include -I/home/yqw/usr/local/CNTKCustomMKL/3/include -ITests/EndToEndTests/CNTKv2Library/Common -I/usr/local/boost-1.60.0/include -ISource/Readers/CNTKTextFormatReader -Xcompiler "-fPIC -Werror" creating /home/yqw/Work/Code/CNTK/cntk/build/release/.build/Source/Math/GPUTensor.o for Linux with build type release /usr/local/cuda-8.0/bin/nvcc -c Source/Math/GPUTensor.cu -o /home/yqw/Work/Code/CNTK/cntk/build/release/.build/Source/Math/GPUTensor.o -DHAS_MPI=1 -D_POSIX_SOURCE -D_XOPEN_SOURCE=600 -D__USE_XOPEN2K -std=c++11 -DUSE_CUDNN -DUSE_MKL -DNDEBUG -DNO_SYNC -m 64 -O3 -g -use_fast_math -gencode arch=compute_30,code="sm_30,compute_30" -gencode arch=compute_35,code="sm_35,compute_35" -gencode arch=compute_50,code="sm_50,compute_50" -ISource/Common/Include -ISource/CNTKv2LibraryDll -ISource/CNTKv2LibraryDll/API -ISource/CNTKv2LibraryDll/proto -ISource/../Examples/Extensibility/CPP -ISource/Math -ISource/CNTK -ISource/ActionsLib -ISource/ComputationNetworkLib -ISource/SGDLib -ISource/SequenceTrainingLib -ISource/CNTK/BrainScript -ISource/Readers/ReaderLib -ISource/PerformanceProfilerDll -I/usr/local/protobuf-3.1.0/include -I/usr/local/cuda-8.0/include -I/usr/local/cub-1.4.1 -I/usr/local/cuda-8.0/include -I/usr/local/cudnn-5.1/cuda/include -I/home/yqw/usr/local/CNTKCustomMKL/3/include -ITests/EndToEndTests/CNTKv2Library/Common -I/usr/local/boost-1.60.0/include -ISource/Readers/CNTKTextFormatReader -Xcompiler "-fPIC -Werror" Source/Math/ConvolutionEngine.cpp: In member function ‘void Microsoft::MSR::CNTK::LegacyConvolutionEngine::ForwardCore(const typename Microsoft::MSR::CNTK::LegacyConvolutionEngine::Base::Mat&, const typename Microsoft::MSR::CNTK::LegacyConvolutionEngine::Base::Mat&, typename Microsoft::MSR::CNTK::LegacyConvolutionEngine::Base::Mat&, typename Microsoft::MSR::CNTK::LegacyConvolutionEngine::Base::Mat&)’: Source/Math/ConvolutionEngine.cpp:349:44: error: invalid use of qualified-name ‘::ConvolveAndWeightedAdd’ Mat::ConvolveAndWeightedAdd(1, kernel, false, inputSubBatch, false, 0, outputSubBatch, ^ Source/Math/ConvolutionEngine.cpp:365:31: error: invalid use of qualified-name ‘::Multiply’ Mat::Multiply(kernel, false, workspace, false, outputSubBatch); ^ Source/Math/ConvolutionEngine.cpp: In member function ‘void Microsoft::MSR::CNTK::GemmConvolutionEngine::ForwardCore(const typename Microsoft::MSR::CNTK::GemmConvolutionEngine::Base::Mat&, const typename Microsoft::MSR::CNTK::GemmConvolutionEngine::Base::Mat&, typename Microsoft::MSR::CNTK::GemmConvolutionEngine::Base::Mat&, typename Microsoft::MSR::CNTK::GemmConvolutionEngine::Base::Mat&)’: Source/Math/ConvolutionEngine.cpp:651:31: error: invalid use of qualified-name ‘::Multiply’ Mat::Multiply(unrolledInput, true, kern, false, outSlice); ^ Source/Math/ConvolutionEngine.cpp:662:31: error: invalid use of qualified-name ‘::Multiply’ Mat::Multiply(unrolledInput, true, kern, false, outTempSlice); ^ Source/Math/ConvolutionEngine.cpp: In member function ‘void Microsoft::MSR::CNTK::GemmConvolutionEngine::BackwardDataCore(const typename Microsoft::MSR::CNTK::GemmConvolutionEngine::Base::Mat&, const typename Microsoft::MSR::CNTK::GemmConvolutionEngine::Base::Mat&, typename Microsoft::MSR::CNTK::GemmConvolutionEngine::Base::Mat&, bool, typename Microsoft::MSR::CNTK::GemmConvolutionEngine::Base::Mat&)’: Source/Math/ConvolutionEngine.cpp:747:37: error: invalid use of qualified-name ‘::MultiplyAndAdd’ Mat::MultiplyAndAdd(unrolledSrcGrad, true, kern, false, gradSlice); ^ Source/Math/ConvolutionEngine.cpp:760:37: error: invalid use of qualified-name ‘::MultiplyAndAdd’ Mat::MultiplyAndAdd(unrolledSrcGrad, true, kern, false, gradTempSlice); ^ Source/Math/ConvolutionEngine.cpp: In member function ‘void Microsoft::MSR::CNTK::GemmConvolutionEngine::BackwardKernelCore(const typename Microsoft::MSR::CNTK::GemmConvolutionEngine::Base::Mat&, const typename Microsoft::MSR::CNTK::GemmConvolutionEngine::Base::Mat&, typename Microsoft::MSR::CNTK::GemmConvolutionEngine::Base::Mat&, bool, bool, typename Microsoft::MSR::CNTK::GemmConvolutionEngine::Base::Mat&)’: Source/Math/ConvolutionEngine.cpp:839:33: error: invalid use of qualified-name ‘::MultiplyAndAdd’ Mat::MultiplyAndAdd(unrolledInputSlice, true, srcGradSlice, false, kernGrad); ^

Really appreciate any help or advice.

yqwangustc avatar Mar 09 '17 06:03 yqwangustc

A workaround for the first error is apparent to discard -Werror.

A workaround for the second error is to Change Mat::MultiplyAndAdd to Matrix:MultiplyAndAdd in Source/Math/ConvolutionEngine.cpp

yqwangustc avatar Mar 09 '17 07:03 yqwangustc

Seems it is specific to old OS (centOS 6.8). Closed it.

yqwangustc avatar Mar 14 '17 05:03 yqwangustc