marian-nmt / marian

Fast Neural Machine Translation in C++
https://marian-nmt.github.io
Other
1.21k stars 227 forks source link

Compilation errors due to warnings treated as errors #422

Open Sadrahel opened 2 months ago

Sadrahel commented 2 months ago

I encountered several compilation errors while trying to build Marian on my system. The errors seem to stem from warnings being treated as errors by the compiler. System details:

Operating System: Debian CUDA version: 12.5 GCC version: 12.2.0 CMake version: 3.22.0

Steps to reproduce: 1- Clone the Marian repository 2- Create a build directory and navigate into it 3- Configure the build with: cmake .. -DCOMPILE_CUDA=on 4- Compile with: make -j16

Errors encountered: The compilation fails with several errors, mostly related to the use-after-free warning in various parts of the Marian code. Here's an example: /home/guillaume/EDSUtilities/marian/src/common/intrusive_ptr.h:24:23: error: pointer used after 'void operator delete(void*, std::sizet)' [-Werror=use-after-free] 24 | if(x != 0 && --x->references == 0) { \ | ~^~~~~

Attempts to resolve:

1- I tried disabling the specific use-after-free warning by passing -Wno-error=use-after-free to CMake, but other warnings were still treated as errors, causing the compilation to fail. 2- I also tried disabling the treatment of all warnings as errors with -Wno-error, but the compilation still failed.

Additional information:

I am trying to compile Marian to use it for machine translation tasks. I have CUDA and cuDNN properly installed and configured on my system. I have also installed all necessary dependencies for Marian.

Please let me know if you need any further information to diagnose and resolve these compilation issues. I would be happy to provide more details or test any potential fixes. Thank you for your attention to this matter. Best regards