Skip to content

Compiling on Ubuntu 22.04 ( CXX compiler: /usr/bin/clang++ - broken) #6655

Open
@torronen

Description

@torronen

Ubuntu 22.04 / Latest main

I am following the Developer page instructions (https://github.com/dotnet/machinelearning/blob/main/docs/building/unix-instructions.md). However, I get some errors on compiling with c++. As you may guess I mostly work on Windows so it could be just some obvious thing missing.

Could be clang version, but even if I remove it, then
sudo apt-get install clang-3.9

clang --version gives:
Ubuntu clang version 14.0.0-1ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix

  -- Check for working CXX compiler: /usr/bin/clang++
  -- Check for working CXX compiler: /usr/bin/clang++ - broken
  -- Configuring incomplete, errors occurred!
  CMake Error at /usr/local/lib/python3.10/dist-packages/cmake/data/share/cmake-3.26/Modules/CMakeTestCXXCompiler.cmake:60 (message):
    The C++ compiler

      "/usr/bin/clang++"

    is not able to compile a simple test program.

Full

root@Ubuntu-2204-jammy-amd64-base ~/torronen/Kwork.Microsoft.ML2023 # ./build.sh
  Determining projects to restore...
  All projects are up-to-date for restore.
Attempting to install dotnet from public_location.
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
dotnet-install: .NET Core Runtime with version '6.0.9' is already installed.
  Determining projects to restore...
  All projects are up-to-date for restore.
  Determining projects to restore...
  All projects are up-to-date for restore.
  /root/torronen/Kwork.Microsoft.ML2023/src/Native/build.sh --configuration Debug --arch x64  --mkllibpath /root/.nuget/packages/mlnetmkldeps/0.0.0.12/runtimes/linux-x64/native --onedalredistpath /root/.nuget/packages/inteldal.redist.linux-x64/2023.0.0.23046/build/native/daal/latest --onedaldevelpath /root/.nuget/packages/inteldal.devel.win-x64/2023.0.0.23189/build/native/daal/latest --onetbbredistpath /root/.nuget/packages/inteltbb.devel.linux/2021.7.1.15005/runtimes/linux-x64/native
  Building Machine Learning native components from /root/torronen/Kwork.Microsoft.ML2023/src/Native to /root/torronen/Kwork.Microsoft.ML2023/artifacts/obj/Native/x64.Debug
  + cmake /root/torronen/Kwork.Microsoft.ML2023/src/Native -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Debug -DMKL_LIB_PATH=/root/.nuget/packages/mlnetmkldeps/0.0.0.12/runtimes/linux-x64/native -DONEDAL_REDIST_PATH=/root/.nuget/packages/inteldal.redist.linux-x64/2023.0.0.23046/build/native/daal/latest -DONEDAL_DEVEL_PATH=/root/.nuget/packages/inteldal.devel.win-x64/2023.0.0.23189/build/native/daal/latest -DONETBB_REDIST_PATH=/root/.nuget/packages/inteltbb.devel.linux/2021.7.1.15005/runtimes/linux-x64/native -DVERSION_FILE_PATH:STRING=/root/torronen/Kwork.Microsoft.ML2023/src/Native/../../artifacts/obj/version.c -DARCHITECTURE=x64
  -- The CXX compiler identification is Clang 14.0.0
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - failed
  -- Check for working CXX compiler: /usr/bin/clang++
  -- Check for working CXX compiler: /usr/bin/clang++ - broken
  -- Configuring incomplete, errors occurred!
  CMake Error at /usr/local/lib/python3.10/dist-packages/cmake/data/share/cmake-3.26/Modules/CMakeTestCXXCompiler.cmake:60 (message):
    The C++ compiler

      "/usr/bin/clang++"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: /root/torronen/Kwork.Microsoft.ML2023/artifacts/obj/Native/x64.Debug/CMakeFiles/CMakeScratch/TryCompile-PaojQZ

      Run Build Command(s):/usr/local/lib/python3.10/dist-packages/cmake/data/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_819f1/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_819f1.dir/build.make CMakeFiles/cmTC_819f1.dir/build
      gmake[1]: Entering directory '/root/torronen/Kwork.Microsoft.ML2023/artifacts/obj/Native/x64.Debug/CMakeFiles/CMakeScratch/TryCompile-PaojQZ'
      Building CXX object CMakeFiles/cmTC_819f1.dir/testCXXCompiler.cxx.o
      /usr/bin/clang++    -MD -MT CMakeFiles/cmTC_819f1.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_819f1.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_819f1.dir/testCXXCompiler.cxx.o -c /root/torronen/Kwork.Microsoft.ML2023/artifacts/obj/Native/x64.Debug/CMakeFiles/CMakeScratch/TryCompile-PaojQZ/testCXXCompiler.cxx
      Linking CXX executable cmTC_819f1
      /usr/local/lib/python3.10/dist-packages/cmake/data/bin/cmake -E cmake_link_script CMakeFiles/cmTC_819f1.dir/link.txt --verbose=1
      /usr/bin/clang++ -rdynamic CMakeFiles/cmTC_819f1.dir/testCXXCompiler.cxx.o -o cmTC_819f1
      /usr/bin/ld: cannot find -lstdc++: No such file or directory
clang : error : linker command failed with exit code 1 (use -v to see invocation) [/root/torronen/Kwork.Microsoft.ML2023/src/Native/Native.proj]
      gmake[1]: *** [CMakeFiles/cmTC_819f1.dir/build.make:100: cmTC_819f1] Error 1
      gmake[1]: Leaving directory '/root/torronen/Kwork.Microsoft.ML2023/artifacts/obj/Native/x64.Debug/CMakeFiles/CMakeScratch/TryCompile-PaojQZ'
      gmake: *** [Makefile:127: cmTC_819f1/fast] Error 2





    CMake will not be able to correctly generate this project.
  Call Stack (most recent call first):
    CMakeLists.txt:3 (project)


/root/torronen/Kwork.Microsoft.ML2023/src/Native/Native.proj(117,5): error MSB3073: The command ""/root/torronen/Kwork.Microsoft.ML2023/src/Native/build.sh" --configuration Debug --arch x64  --mkllibpath /root/.nuget/packages/mlnetmkldeps/0.0.0.12/runtimes/linux-x64/native --onedalredistpath /root/.nuget/packages/inteldal.redist.linux-x64/2023.0.0.23046/build/native/daal/latest --onedaldevelpath /root/.nuget/packages/inteldal.devel.win-x64/2023.0.0.23189/build/native/daal/latest --onetbbredistpath /root/.nuget/packages/inteltbb.devel.linux/2021.7.1.15005/runtimes/linux-x64/native" exited with code 1.
  Microsoft.ML.InternalCodeAnalyzer -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.InternalCodeAnalyzer/Debug/netstandard2.0/Microsoft.ML.InternalCodeAnalyzer.dll
  Microsoft.ML.AutoML.SourceGenerator -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.AutoML.SourceGenerator/Debug/netstandard2.0/Microsoft.ML.AutoML.SourceGenerator.dll
  Microsoft.ML.SearchSpace -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.SearchSpace/Debug/netstandard2.0/Microsoft.ML.SearchSpace.dll
  RemoteExecutorConsoleApp -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/RemoteExecutorConsoleApp/Debug/net6.0/RemoteExecutorConsoleApp.dll
  Microsoft.ML.Mkl.Redist -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.Mkl.Redist/Debug/netstandard2.0/Microsoft.ML.Mkl.Redist.dll
  Microsoft.ML.CpuMath -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.CpuMath/Debug/netcoreapp3.1/Microsoft.ML.CpuMath.dll
  Microsoft.ML.CpuMath -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.CpuMath/Debug/netstandard2.0/Microsoft.ML.CpuMath.dll
  Microsoft.ML.Tokenizers -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.Tokenizers/Debug/netstandard2.0/Microsoft.ML.Tokenizers.dll
  Microsoft.ML.DataView -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.DataView/Debug/netstandard2.0/Microsoft.ML.DataView.dll
  Microsoft.ML.CpuMath.PerformanceTests -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.CpuMath.PerformanceTests/Debug/net6.0/Microsoft.ML.CpuMath.PerformanceTests.dll
/root/torronen/Kwork.Microsoft.ML2023/Directory.Build.targets(54,3): error MSB3030: Could not copy the file "/root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Native/x64.Debug/libCpuMathNative.so" because it was not found. [/root/torronen/Kwork.Microsoft.ML2023/test/Microsoft.ML.CpuMath.PerformanceTests/Microsoft.ML.CpuMath.PerformanceTests.csproj::TargetFramework=net6.0]
  Microsoft.ML.Tokenizers.Tests -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.Tokenizers.Tests/Debug/net6.0/Microsoft.ML.Tokenizers.Tests.dll
  Microsoft.ML.NugetPackageVersionUpdater -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.NugetPackageVersionUpdater/Debug/net6.0/Microsoft.ML.NugetPackageVersionUpdater.dll
  Microsoft.ML.Core -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.Core/Debug/netstandard2.0/Microsoft.ML.Core.dll
  Microsoft.ML.Maml -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.Maml/Debug/netstandard2.0/Microsoft.ML.Maml.dll
  Microsoft.Data.Analysis -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.Data.Analysis/Debug/netstandard2.0/Microsoft.Data.Analysis.dll
  Microsoft.ML.Data -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.Data/Debug/netstandard2.0/Microsoft.ML.Data.dll
  Microsoft.Data.Analysis.Interactive -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.Data.Analysis.Interactive/Debug/netcoreapp3.1/Microsoft.Data.Analysis.Interactive.dll
  Microsoft.ML.Transforms -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.Transforms/Debug/netstandard2.0/Microsoft.ML.Transforms.dll
  Microsoft.ML.ResultProcessor -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.ResultProcessor/Debug/netstandard2.0/Microsoft.ML.ResultProcessor.dll
  Microsoft.ML.PCA -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.PCA/Debug/netstandard2.0/Microsoft.ML.PCA.dll
  Microsoft.ML.TestFrameworkCommon -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.TestFrameworkCommon/Debug/net6.0/Microsoft.ML.TestFrameworkCommon.dll
  Microsoft.Data.Analysis.Interactive.Tests -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.Data.Analysis.Interactive.Tests/Debug/net6.0/Microsoft.Data.Analysis.Interactive.Tests.dll
  Microsoft.ML.StandardTrainers -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.StandardTrainers/Debug/netstandard2.0/Microsoft.ML.StandardTrainers.dll
  Microsoft.ML.KMeansClustering -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML.KMeansClustering/Debug/netstandard2.0/Microsoft.ML.KMeansClustering.dll
  Microsoft.ML -> /root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Microsoft.ML/Debug/netstandard2.0/Microsoft.ML.dll
/root/torronen/Kwork.Microsoft.ML2023/Directory.Build.targets(54,3): error MSB3030: Could not copy the file "/root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Native/x64.Debug/libLdaNative.so" because it was not found. [/root/torronen/Kwork.Microsoft.ML2023/src/Microsoft.ML/Microsoft.ML.csproj]

Build FAILED.

clang : error : linker command failed with exit code 1 (use -v to see invocation) [/root/torronen/Kwork.Microsoft.ML2023/src/Native/Native.proj]
/root/torronen/Kwork.Microsoft.ML2023/src/Native/Native.proj(117,5): error MSB3073: The command ""/root/torronen/Kwork.Microsoft.ML2023/src/Native/build.sh" --configuration Debug --arch x64  --mkllibpath /root/.nuget/packages/mlnetmkldeps/0.0.0.12/runtimes/linux-x64/native --onedalredistpath /root/.nuget/packages/inteldal.redist.linux-x64/2023.0.0.23046/build/native/daal/latest --onedaldevelpath /root/.nuget/packages/inteldal.devel.win-x64/2023.0.0.23189/build/native/daal/latest --onetbbredistpath /root/.nuget/packages/inteltbb.devel.linux/2021.7.1.15005/runtimes/linux-x64/native" exited with code 1.
/root/torronen/Kwork.Microsoft.ML2023/Directory.Build.targets(54,3): error MSB3030: Could not copy the file "/root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Native/x64.Debug/libCpuMathNative.so" because it was not found. [/root/torronen/Kwork.Microsoft.ML2023/test/Microsoft.ML.CpuMath.PerformanceTests/Microsoft.ML.CpuMath.PerformanceTests.csproj::TargetFramework=net6.0]
/root/torronen/Kwork.Microsoft.ML2023/Directory.Build.targets(54,3): error MSB3030: Could not copy the file "/root/torronen/Kwork.Microsoft.ML2023/artifacts/bin/Native/x64.Debug/libLdaNative.so" because it was not found. [/root/torronen/Kwork.Microsoft.ML2023/src/Microsoft.ML/Microsoft.ML.csproj]
    0 Warning(s)
    4 Error(s)

Time Elapsed 00:00:05.14
Build failed with exit code 1. Check errors above.
root@Ubuntu-2204-jammy-amd64-base ~/torronen/Kwork.Microsoft.ML2023 #

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions