clangupc / clang-upc

Clang UPC Front-End
https://clangupc.github.io/
Other
16 stars 5 forks source link

Build errors with gcc 10 #105

Open robegan21 opened 2 years ago

robegan21 commented 2 years ago

Posting this in relation to supporting users running HipMer which requires Berkeley UPC to use the Clang UPC2C translator.

3.9.1-1 builds and works fine with gcc 7.5, but fails with some newer versions, I chose 10.3.0 to demonstrate. In both builds there are a ton of warnings, but it actually errors with 10.3.0:

/usr/bin/g++-10 -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -DSTDC_CONSTANT_MACROS -DSTDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/dev/shm/bupc-regan-hipmer-builds/build_clangupc/tools/lli -I/dev/shm/bupc-regan-hipmer-builds/clang-upc-3.9.1-1/tools/lli -I/dev/shm/bupc-regan-hipmer-builds/build_clangupc/include -I/dev/shm/bupc-regan-hipmer-builds/clang-upc-3.9.1-1/include -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -O3 -DNDEBUG -fno-exceptions -fno-rtti -o CMakeFiles/lli.dir/lli.cpp.o -c /dev/shm/bupc-regan-hipmer-builds/clang-upc-3.9.1-1/tools/lli/lli.cpp In file included from /dev/shm/bupc-regan-hipmer-builds/clang-upc-3.9.1-1/include/llvm/CodeGen/LinkAllCodegenComponents.h:20, from /dev/shm/bupc-regan-hipmer-builds/clang-upc-3.9.1-1/tools/lli/lli.cpp:22: /dev/shm/bupc-regan-hipmer-builds/clang-upc-3.9.1-1/include/llvm/CodeGen/SchedulerRegistry.h: In constructor ‘llvm::RegisterScheduler::RegisterScheduler(const char, const char, llvm::RegisterScheduler::FunctionPassCtor)’: /dev/shm/bupc-regan-hipmer-builds/clang-upc-3.9.1-1/include/llvm/CodeGen/SchedulerRegistry.h:42:35: warning: cast between incompatible function types from ‘llvm::RegisterScheduler::FunctionPassCtor’ {aka ‘llvm::ScheduleDAGSDNodes ()(llvm::SelectionDAGISel, llvm::CodeGenOpt::Level)’} to ‘llvm::MachinePassCtor’ {aka ‘void (*)()’} [-Wcast-function-type] 42 : MachinePassRegistryNode(N, D, (MachinePassCtor)C) ^~~~~~ In file included from /dev/shm/bupc-regan-hipmer-builds/clang-upc-3.9.1-1/tools/lli/lli.cpp:30: /dev/shm/bupc-regan-hipmer-builds/clang-upc-3.9.1-1/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h: In member function ‘llvm::Expected<std::vector > llvm::orc::remote::OrcRemoteTargetClient::readMem(char, llvm::JITTargetAddress, uint64_t)’: /dev/shm/bupc-regan-hipmer-builds/clang-upc-3.9.1-1/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h:696:26: error: could not convert ‘((llvm::orc::remote::OrcRemoteTargetClient)this)->callB(Src, Size)’ from ‘Expected<vector<unsigned char,allocator>>’ to ‘Expected<vector<char,allocator>>’ 696 return callB(Src, Size); ~~~~^~~~~
Expected<vector<unsigned char,allocator>>
Ghepardo commented 2 years ago

I too have this problem, and I also need clang-upc for HipMer. The HipMer helper script for this uses the following CMake options:

-DCMAKE_INSTALL_PREFIX:PATH=(install destination) -DLLVM_TARGETS_TO_BUILD:=host -DCMAKE_BUILD_TYPE:=Release

I tried GCC 11.2.0, GCC 9.3.0 and GCC 8.2.0, all with similar results to @robegan21 .

I did a successful build using GCC 7.3.0-2.30 and CMake 3.12.1 (as provided by EasyBuild). There is still "a ton of warnings", but at least it completes.

Is this fork still maintained?

PHHargrove commented 2 years ago

@Ghepardo Our team is currently in the process of completing the paperwork that will enable us to take over maintenance of this project. I don't have a concrete time estimate, but a release that builds with modern versions of GCC and Clang should appear soon after those formalities are completed.