I am trying to install pytorch from source. The reason why I am doing this (instead of just pip install pytorch) is because I need the sm_86 support for my GPU (NVIDIA GTX 3060 Ti) and so I have set the TORCH_CUDA_ARCH_LIST=8.6 variable. I've read that this variable affects only the source installation.
Basically I am following this guide (linux system, using pip instead of conda) but I was not able to understand how to correctly set the CMAKE_PREFIX_PATH variable.
Despite this I tried in any case to install pytorch with the python3 setup.py install command but it returned this error:
CMake Error at cmake/public/cuda.cmake:47 (enable_language):
No CMAKE_CUDA_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CUDACXX" or the CMake cache entry CMAKE_CUDA_COMPILER to the full
path to the compiler, or to the compiler name if it is in the PATH.
Call Stack (most recent call first):
cmake/Dependencies.cmake:43 (include)
CMakeLists.txt:696 (include)
The log file shows this:
Checking whether the CUDA compiler is NVIDIA using "" did not match "nvcc: NVIDIA \(R\) Cuda compiler driver":
Checking whether the CUDA compiler is Clang using "" did not match "(clang version)":
Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed.
Compiler: CMAKE_CUDA_COMPILER-NOTFOUND
Build flags: ;-Xfatbin;-compress-all
Id flags: -v
The output was:
No such file or directory
Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed.
Compiler: CMAKE_CUDA_COMPILER-NOTFOUND
Build flags:
Id flags: -v
The output was:
No such file or directory
Can anybody help me solve this?
Update
Cuda seems to be installed. With apt list --installed|grep cuda this is the output (I am Italian "sconosciuto"=unknown :)
cuda-11-7/sconosciuto,now 11.7.0-1 amd64 [installato, automatico]
cuda-cccl-11-7/sconosciuto,now 11.7.58-1 amd64 [installato, automatico]
cuda-command-line-tools-11-7/sconosciuto,now 11.7.0-1 amd64 [installato, automatico]
cuda-compiler-11-7/sconosciuto,now 11.7.0-1 amd64 [installato, automatico]
cuda-cudart-11-7/sconosciuto,now 11.7.60-1 amd64 [installato, automatico]
cuda-cudart-dev-11-7/sconosciuto,now 11.7.60-1 amd64 [installato, automatico]
cuda-cuobjdump-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-cupti-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-cupti-dev-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-cuxxfilt-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-demo-suite-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-documentation-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-driver-dev-11-7/sconosciuto,now 11.7.60-1 amd64 [installato, automatico]
cuda-drivers-515/sconosciuto,now 515.43.04-1 amd64 [installato, automatico]
cuda-drivers/sconosciuto,now 515.43.04-1 amd64 [installato, automatico]
cuda-gdb-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-libraries-11-7/sconosciuto,now 11.7.0-1 amd64 [installato, automatico]
cuda-libraries-dev-11-7/sconosciuto,now 11.7.0-1 amd64 [installato, automatico]
cuda-memcheck-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-nsight-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-nsight-compute-11-7/sconosciuto,now 11.7.0-1 amd64 [installato, automatico]
cuda-nsight-systems-11-7/sconosciuto,now 11.7.0-1 amd64 [installato, automatico]
cuda-nvcc-11-7/sconosciuto,now 11.7.64-1 amd64 [installato, automatico]
cuda-nvdisasm-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-nvml-dev-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-nvprof-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-nvprune-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-nvrtc-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-nvrtc-dev-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-nvtx-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-nvvp-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-runtime-11-7/sconosciuto,now 11.7.0-1 amd64 [installato, automatico]
cuda-sanitizer-11-7/sconosciuto,now 11.7.50-1 amd64 [installato, automatico]
cuda-toolkit-11-7-config-common/sconosciuto,now 11.7.60-1 all [installato, automatico]
cuda-toolkit-11-7/sconosciuto,now 11.7.0-1 amd64 [installato, automatico]
cuda-toolkit-11-config-common/sconosciuto,now 11.7.60-1 all [installato, automatico]
cuda-toolkit-config-common/sconosciuto,now 11.7.60-1 all [installato, automatico]
cuda-tools-11-7/sconosciuto,now 11.7.0-1 amd64 [installato, automatico]
cuda-visual-tools-11-7/sconosciuto,now 11.7.0-1 amd64 [installato, automatico]
cuda/sconosciuto,now 11.7.0-1 amd64 [installato]
libcuda1/sconosciuto,now 515.43.04-1 amd64 [installato, automatico]
nvidia-cuda-mps/sconosciuto,now 515.43.04-1 amd64 [installato, automatico]
My guess is that the CUDA installation is somehow messed up / invisible - otherwise CMake should have noticed it. You can overcome the issue more "manually" by running CMake like so:
CUDACXX=/usr/local/cuda-11.7/bin/nvcc cmake -S /path/to/source/dir -B /path/to/build/dir
(as you have installed CUDA under /usr/local/cuda-11.7)
A less-likely cause is that CMake doesn't properly recognize the just-released CUDA 11.7, although I doubt it.
Related
I tried to install default-jdk on ubuntu 20 but got connection failed in the middle of the process
sudo apt install default-jdk
Need to get 267 MB of archives.
After this operation, 422 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Ign:1 http://a.docker-registry.ir/ubuntu focal/main amd64 java-common all 0.72
Ign:2 http://a.docker-registry.ir/ubuntu focal-updates/main amd64 openjdk-11-jre-headless amd64 11.0.17+8-1ubuntu2~20.04
Err:3 http://a.docker-registry.ir/ubuntu focal/main amd64 default-jre-headless amd64 2:1.11-72
Connection failed [IP: 5.253.27.159 80]
Ign:4 http://a.docker-registry.ir/ubuntu focal/main amd64 ca-certificates-java all 20190405ubuntu1
Ign:5 http://a.docker-registry.ir/ubuntu focal-updates/main amd64 openjdk-11-jre amd64 11.0.17+8-1ubuntu2~20.04
Err:6 http://a.docker-registry.ir/ubuntu focal/main amd64 default-jre amd64 2:1.11-72
Connection failed [IP: 5.253.27.159 80]
I have tried using VPN but it didn't solve my problem.
Can someone come up with a solution for that?
I would like to install gcc-7 together with g++-7. First I have installed gcc7 successfully. Of course I've done
sudo apt update
Then I'm unable to install g++7:
anton#AntonLinux:/$ sudo apt install g++-7
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libc6-dev : Breaks: libgcc-7-dev (< 7.5.0-6~) but 7.5.0-3ubuntu1~18.04 is to be installed
E: Unable to correct problems, you have held broken packages.
I also tried removing libgcc-7-dev but it didn't help. Currently the following related packages are installed:
anton#AntonLinux:/$ apt list --installed | grep libgcc
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libgcc-10-dev/unstable,now 10.2.0-13 amd64 [installed,automatic]
libgcc-4.8-dev/bionic,now 4.8.5-4ubuntu8 amd64 [installed,automatic]
libgcc-6-dev/bionic-updates,now 6.5.0-2ubuntu1~18.04 amd64 [installed,automatic]
libgcc-s1/unstable,now 10.2.0-13 amd64 [installed,automatic]
libgcc-s1/unstable,now 10.2.0-13 i386 [installed,automatic]
libgcc1/bionic-updates,bionic-security,now 1:8.4.0-1ubuntu1~18.04 amd64 [installed,upgradable to: 1:10.1.0-1]
libgcc1/bionic-updates,bionic-security,now 1:8.4.0-1ubuntu1~18.04 i386 [installed,upgradable to: 1:10.1.0-1]
anton#AntonLinux:/$ apt list --installed | grep libc6
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libc6-dbg/unstable,now 2.31-4 amd64 [installed,automatic]
libc6/unstable,now 2.31-4 amd64 [installed,automatic]
libc6/unstable,now 2.31-4 i386 [installed,automatic]
anton#AntonLinux:/$ apt list --installed | grep gcc
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
gcc-10-base/unstable,now 10.2.0-13 amd64 [installed,automatic]
gcc-10-base/unstable,now 10.2.0-13 i386 [installed,automatic]
gcc-10/unstable,now 10.2.0-13 amd64 [installed,automatic]
gcc-4.8-base/bionic,now 4.8.5-4ubuntu8 amd64 [installed,automatic]
gcc-4.8/bionic,now 4.8.5-4ubuntu8 amd64 [installed]
gcc-6-base/bionic-updates,now 6.5.0-2ubuntu1~18.04 amd64 [installed,automatic]
gcc-6/bionic-updates,now 6.5.0-2ubuntu1~18.04 amd64 [installed,automatic]
gcc-7-base/bionic-updates,bionic-security,now 7.5.0-3ubuntu1~18.04 amd64 [installed,automatic]
gcc-8-base/bionic-updates,bionic-security,now 8.4.0-1ubuntu1~18.04 amd64 [installed,upgradable to: 8.4.0-4]
gcc-8-base/bionic-updates,bionic-security,now 8.4.0-1ubuntu1~18.04 i386 [installed,upgradable to: 8.4.0-4]
gcc/unstable,now 4:10.2.0-1 amd64 [installed,automatic]
libgcc-10-dev/unstable,now 10.2.0-13 amd64 [installed,automatic]
libgcc-4.8-dev/bionic,now 4.8.5-4ubuntu8 amd64 [installed,automatic]
libgcc-6-dev/bionic-updates,now 6.5.0-2ubuntu1~18.04 amd64 [installed,automatic]
libgcc-s1/unstable,now 10.2.0-13 amd64 [installed,automatic]
libgcc-s1/unstable,now 10.2.0-13 i386 [installed,automatic]
libgcc1/bionic-updates,bionic-security,now 1:8.4.0-1ubuntu1~18.04 amd64 [installed,upgradable to: 1:10.1.0-1]
libgcc1/bionic-updates,bionic-security,now 1:8.4.0-1ubuntu1~18.04 i386 [installed,upgradable to: 1:10.1.0-1]
Trying to install vaex package using sudo pip3 install vaex
But getting the following error:
got version from file /tmp/pip-build-4ejf0kw2/llvmlite/llvmlite/_version.py {'version': '0.34.0', 'full': 'c5889c9e98c6b19d5d85ebdd982d64a03931f8e2'}
running build_ext
/usr/bin/python3 /tmp/pip-build-4ejf0kw2/llvmlite/ffi/build.py
LLVM version... Traceback (most recent call last):
File "/tmp/pip-build-4ejf0kw2/llvmlite/ffi/build.py", line 105, in main_posix
out = subprocess.check_output([llvm_config, '--version'])
File "/usr/lib/python3.7/subprocess.py", line 411, in check_output
**kwargs).stdout
File "/usr/lib/python3.7/subprocess.py", line 488, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.7/subprocess.py", line 800, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.7/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'llvm-config': 'llvm-config'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/pip-build-4ejf0kw2/llvmlite/ffi/build.py", line 191, in <module>
main()
File "/tmp/pip-build-4ejf0kw2/llvmlite/ffi/build.py", line 181, in main
main_posix('linux', '.so')
File "/tmp/pip-build-4ejf0kw2/llvmlite/ffi/build.py", line 108, in main_posix
"to the path for llvm-config" % (llvm_config,))
RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config
error: command '/usr/bin/python3' failed with exit status 1
Anybody can guide me how to solve it?
Here is my list of lvvm:
libllvm-10-ocaml-dev/unknown 1:10.0.1~++20200809072545+ef32c611aa2-1~exp1~20200809173142.193 amd64
libllvm-7-ocaml-dev/bionic-updates,now 1:7-3~ubuntu0.18.04.1 amd64 [installed]
libllvm-8-ocaml-dev/bionic-updates,bionic-security 1:8-3~ubuntu18.04.2 amd64
libllvm-9-ocaml-dev/bionic-updates,bionic-security 1:9-2~ubuntu18.04.2 amd64
libllvm10/unknown,now 1:10.0.1~++20200809072545+ef32c611aa2-1~exp1~20200809173142.193 amd64 [installed,automatic]
libllvm3.9/bionic 1:3.9.1-19ubuntu1 amd64
libllvm3.9-dbg/bionic 1:3.9.1-19ubuntu1 amd64
libllvm4.0/bionic 1:4.0.1-10 amd64
libllvm4.0-dbg/bionic 1:4.0.1-10 amd64
libllvm5.0/bionic 1:5.0.1-4 amd64
libllvm5.0-dbg/bionic 1:5.0.1-4 amd64
libllvm6.0/bionic,now 1:6.0-1ubuntu2 amd64 [installed,automatic]
libllvm6.0-dbg/bionic 1:6.0-1ubuntu2 amd64
libllvm7/bionic-updates,now 1:7-3~ubuntu0.18.04.1 amd64 [installed]
libllvm8/bionic-updates,bionic-security 1:8-3~ubuntu18.04.2 amd64
libllvm9/bionic-updates,bionic-security,now 1:9-2~ubuntu18.04.2 amd64 [installed,automatic]
libstd-rust-1.24/bionic 1.24.1+dfsg1+llvm-0ubuntu2 amd64
libstd-rust-1.25/bionic-updates,bionic-security 1.25.0+dfsg1+llvm-0ubuntu1 amd64
libstd-rust-1.28/bionic-updates,bionic-security 1.28.0+dfsg1+llvm-0ubuntu1~18.04.1 amd64
libstd-rust-1.30/bionic-updates,bionic-security 1.30.0+dfsg1+llvm-2ubuntu1~18.04.1 amd64
libstd-rust-1.31/bionic-updates,bionic-security 1.31.0+dfsg1+llvm-2ubuntu1~18.04.1 amd64
libstd-rust-1.32/bionic-updates,bionic-security 1.32.0+dfsg1+llvm-1ubuntu1~18.04.1 amd64
libstd-rust-1.34/bionic-updates,bionic-security 1.34.1+dfsg2+llvm-0ubuntu1~18.04.1 amd64
libstd-rust-1.35/bionic-updates,bionic-security 1.35.0+dfsg0.1+llvm-0ubuntu1~18.04.1 amd64
libstd-rust-1.36/bionic-updates,bionic-security 1.36.0+dfsg1+llvm-2ubuntu1~18.04.1 amd64
libstd-rust-1.37/bionic-updates,bionic-security 1.37.0+dfsg1+llvm-1ubuntu1~18.04.1 amd64
libstd-rust-1.39/bionic-updates,bionic-security 1.39.0+dfsg1+llvm-3ubuntu1~18.04.1 amd64
libstd-rust-1.41/bionic-updates,bionic-security 1.41.0+dfsg1+llvm-0ubuntu1~18.04.1 amd64
libstd-rust-1.43/bionic-updates,bionic-security 1.43.0+dfsg1+llvm-1~exp1ubuntu2~18.04.1 amd64
libstd-rust-dev/bionic-updates,bionic-security 1.43.0+dfsg1+llvm-1~exp1ubuntu2~18.04.1 amd64
libstd-rust-dev-wasm32-cross/bionic-updates,bionic-security 1.41.0+dfsg1+llvm-0ubuntu1~18.04.1 all
llvm/bionic-updates 1:6.0-41~exp5~ubuntu1 amd64
llvm-10/unknown,now 1:10.0.1~++20200809072545+ef32c611aa2-1~exp1~20200809173142.193 amd64 [installed]
llvm-10-dev/unknown,now 1:10.0.1~++20200809072545+ef32c611aa2-1~exp1~20200809173142.193 amd64 [installed]
llvm-10-doc/unknown 1:10.0.1~++20200809072545+ef32c611aa2-1~exp1~20200809173142.193 all
llvm-10-examples/unknown 1:10.0.1~++20200809072545+ef32c611aa2-1~exp1~20200809173142.193 all
llvm-10-runtime/unknown,now 1:10.0.1~++20200809072545+ef32c611aa2-1~exp1~20200809173142.193 amd64 [installed,automatic]
llvm-10-tools/unknown,now 1:10.0.1~++20200809072545+ef32c611aa2-1~exp1~20200809173142.193 amd64 [installed,automatic]
llvm-3.7-doc/bionic 1:3.7.1-5ubuntu3 all
llvm-3.9/bionic 1:3.9.1-19ubuntu1 amd64
llvm-3.9-dev/bionic 1:3.9.1-19ubuntu1 amd64
llvm-3.9-doc/bionic 1:3.9.1-19ubuntu1 all
llvm-3.9-examples/bionic 1:3.9.1-19ubuntu1 all
llvm-3.9-runtime/bionic 1:3.9.1-19ubuntu1 amd64
llvm-3.9-tools/bionic 1:3.9.1-19ubuntu1 amd64
llvm-4.0/bionic 1:4.0.1-10 amd64
llvm-4.0-dev/bionic 1:4.0.1-10 amd64
llvm-4.0-doc/bionic 1:4.0.1-10 all
llvm-4.0-examples/bionic 1:4.0.1-10 all
llvm-4.0-runtime/bionic 1:4.0.1-10 amd64
llvm-4.0-tools/bionic 1:4.0.1-10 amd64
llvm-5.0/bionic 1:5.0.1-4 amd64
llvm-5.0-dev/bionic 1:5.0.1-4 amd64
llvm-5.0-doc/bionic 1:5.0.1-4 all
llvm-5.0-examples/bionic 1:5.0.1-4 all
llvm-5.0-runtime/bionic 1:5.0.1-4 amd64
llvm-5.0-tools/bionic 1:5.0.1-4 amd64
llvm-6.0/bionic 1:6.0-1ubuntu2 amd64
llvm-6.0-dev/bionic 1:6.0-1ubuntu2 amd64
llvm-6.0-doc/bionic 1:6.0-1ubuntu2 all
llvm-6.0-examples/bionic 1:6.0-1ubuntu2 all
llvm-6.0-runtime/bionic 1:6.0-1ubuntu2 amd64
llvm-6.0-tools/bionic 1:6.0-1ubuntu2 amd64
llvm-7/bionic-updates,now 1:7-3~ubuntu0.18.04.1 amd64 [installed]
llvm-7-dev/bionic-updates,now 1:7-3~ubuntu0.18.04.1 amd64 [installed]
llvm-7-doc/bionic-updates,now 1:7-3~ubuntu0.18.04.1 all [installed]
llvm-7-examples/bionic-updates,now 1:7-3~ubuntu0.18.04.1 all [installed]
llvm-7-runtime/bionic-updates,now 1:7-3~ubuntu0.18.04.1 amd64 [installed]
llvm-7-tools/bionic-updates 1:7-3~ubuntu0.18.04.1 amd64
llvm-8/bionic-updates,bionic-security 1:8-3~ubuntu18.04.2 amd64
llvm-8-dev/bionic-updates,bionic-security 1:8-3~ubuntu18.04.2 amd64
llvm-8-doc/bionic-updates,bionic-security 1:8-3~ubuntu18.04.2 all
llvm-8-examples/bionic-updates,bionic-security 1:8-3~ubuntu18.04.2 all
llvm-8-runtime/bionic-updates,bionic-security 1:8-3~ubuntu18.04.2 amd64
llvm-8-tools/bionic-updates,bionic-security 1:8-3~ubuntu18.04.2 amd64
llvm-9/bionic-updates,bionic-security,now 1:9-2~ubuntu18.04.2 amd64 [installed,automatic]
llvm-9-dev/bionic-updates,bionic-security,now 1:9-2~ubuntu18.04.2 amd64 [installed,automatic]
llvm-9-doc/bionic-updates,bionic-security 1:9-2~ubuntu18.04.2 all
llvm-9-examples/bionic-updates,bionic-security 1:9-2~ubuntu18.04.2 all
llvm-9-runtime/bionic-updates,bionic-security,now 1:9-2~ubuntu18.04.2 amd64 [installed,automatic]
llvm-9-tools/bionic-updates,bionic-security,now 1:9-2~ubuntu18.04.2 amd64 [installed,automatic]
llvm-dev/bionic-updates 1:6.0-41~exp5~ubuntu1 amd64
llvm-runtime/bionic-updates 1:6.0-41~exp5~ubuntu1 amd64
llvmlite-doc/bionic 0.19.0-2 all
python-llvmlite/bionic 0.19.0-2 amd64
python3-llvmlite/bionic 0.19.0-2 amd64
rust-doc/bionic-updates,bionic-security 1.43.0+dfsg1+llvm-1~exp1ubuntu2~18.04.1 all
rust-gdb/bionic-updates,bionic-security 1.43.0+dfsg1+llvm-1~exp1ubuntu2~18.04.1 all
rust-lldb/bionic-updates,bionic-security 1.43.0+dfsg1+llvm-1~exp1ubuntu2~18.04.1 all
rust-src/bionic-updates,bionic-security 1.43.0+dfsg1+llvm-1~exp1ubuntu2~18.04.1 all
rustc/bionic-updates,bionic-security 1.43.0+dfsg1+llvm-1~exp1ubuntu2~18.04.1 amd64
The solution was to delete manually the llvm package from dist-packages (all versions), install pip (latest version) not pip3.
Right after this I have installed llvmlite 0.33.0 and numba 0.49.1.
Reinstalled vaex who reinstalled llvmlite 0.34.0 and numba 0.51 and vaex installation successfully finished!
Installed Cevelop 1.11.1
apt-get install g++-9
Get:1 http://archive.ubuntu.com/ubuntu disco/main amd64 cpp-9 amd64 9-20190402-1ubuntu1 [8,861 kB]
Get:2 http://archive.ubuntu.com/ubuntu disco/main amd64 libgcc-9-dev amd64 9-20190402-1ubuntu1 [2,355 kB]
Get:3 http://archive.ubuntu.com/ubuntu disco/main amd64 gcc-9 amd64 9-20190402-1ubuntu1 [9,643 kB]
Get:4 http://archive.ubuntu.com/ubuntu disco/main amd64 libstdc++-9-dev amd64 9-20190402-1ubuntu1 [1,685 kB]
Get:5 http://archive.ubuntu.com/ubuntu disco/universe amd64 g++-9 amd64 9-20190402-1ubuntu1 [10.1 MB]
apt-get install libboost-dev
Get:1 http://archive.ubuntu.com/ubuntu disco/main amd64 libboost1.67-dev amd64 1.67.0-13 [8,362 kB]
Get:2 http://archive.ubuntu.com/ubuntu disco/main amd64 libboost-dev amd64 1.67.0.1 [3,228 B]
Specified boost_system for the linker. This produces an error.
g++-9 -std=c++1z -O0 -g3 -Wall -Wextra -Wconversion -c -fmessage-length=0 -Wno-attributes -fsanitize=undefined -pthread -o aptcp.o ../aptcp.cpp
g++-9 -pthread -o aptcp aptcp.o -ltidy -lboost_system -lssl -lcrypto -lxalan-c -lxalanMsg -lxerces-c
/usr/bin/ld: cannot find -lboost_system
collect2: error: ld returned 1 exit status
sмurf states in his answer:
I would recommend installing package libboost-dev. It will install
whatever is the current version of boost for your system and will put
all files in the proper places.
Per serup's answer my understanding is that 'the library is installed'.
$ /sbin/ldconfig -p | grep boost_system | cut -d\> -f2
/lib/x86_64-linux-gnu/libboost_system.so.1.67.0
So, what is going on here?
The objective is to have a simple repeatable process for installing and using the compiler & libraries, one that builds upon the existing work of the developers & package maintainers. Is there a flaw in my understanding/expectations, in the packaging or the libraries?
The -l option will only find .a or .so library files, it will not find .so.1.67.0 or other.
That could be solved by creating a symbolic link:
ln -sf /your/path/to/libboost_system.so.1.67.0 /your/path/to/libboost_system.so
sudo apt-get install libboost-all-dev
This installed all required symbolic links and static libraries for me on Ubuntu 19.04
I am building a project that requires a number of libraries, for windows I got prebuilt libs from MSYS2, for linux from the ubuntu repos, and now I am porting to android, so I need the same libraries for armhf and arm64. The good news is the ubuntu repos have everything I need, the bad news - I can't figure out how to get them using apt, that is get the libs with the entire dependency trees. It is possible to download individual packages from the web, but it gets kind of arduous to get the entire dependency tree, building the libraries from source - tremendously more so.
I can do sudo apt-get install package:uarch for i386 even though I am on a 64bit host, however when I try arm I get a unable to locate package. So how do I get them?
Note 1: I only need the libraries, I don't need toolchains, the NDK already has those.
Note 2: I did try asking on the ubuntu site, but I didn't get any feedback in like a day, and since the question is strictly about development I decided to try here.
Note 3: The question is not about recommending libraries.
EDIT: After dpkg --add-architecture armhf for update I get:
Hit:1 http://bg.archive.ubuntu.com/ubuntu xenial InRelease
Hit:3 http://bg.archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:2 http://bg.archive.ubuntu.com/ubuntu xenial-updates InRelease [95,7 kB]
Ign:4 http://bg.archive.ubuntu.com/ubuntu xenial/main armhf Packages
Ign:5 http://bg.archive.ubuntu.com/ubuntu xenial/restricted armhf Packages
Ign:6 http://bg.archive.ubuntu.com/ubuntu xenial/universe armhf Packages
Ign:7 http://bg.archive.ubuntu.com/ubuntu xenial/multiverse armhf Packages
Ign:4 http://bg.archive.ubuntu.com/ubuntu xenial/main armhf Packages
Ign:5 http://bg.archive.ubuntu.com/ubuntu xenial/restricted armhf Packages
Ign:6 http://bg.archive.ubuntu.com/ubuntu xenial/universe armhf Packages
Ign:7 http://bg.archive.ubuntu.com/ubuntu xenial/multiverse armhf Packages
Ign:4 http://bg.archive.ubuntu.com/ubuntu xenial/main armhf Packages
Ign:5 http://bg.archive.ubuntu.com/ubuntu xenial/restricted armhf Packages
Ign:6 http://bg.archive.ubuntu.com/ubuntu xenial/universe armhf Packages
Hit:8 http://security.ubuntu.com/ubuntu xenial-security InRelease
Ign:7 http://bg.archive.ubuntu.com/ubuntu xenial/multiverse armhf Packages
Ign:9 http://bg.archive.ubuntu.com/ubuntu xenial-backports/main armhf Packages
Ign:10 http://bg.archive.ubuntu.com/ubuntu xenial-backports/universe armhf Packages
Err:4 http://bg.archive.ubuntu.com/ubuntu xenial/main armhf Packages
404 Not Found [IP: 195.85.215.252 80]
Ign:5 http://bg.archive.ubuntu.com/ubuntu xenial/restricted armhf Packages
Ign:6 http://bg.archive.ubuntu.com/ubuntu xenial/universe armhf Packages
Ign:7 http://bg.archive.ubuntu.com/ubuntu xenial/multiverse armhf Packages
Ign:9 http://bg.archive.ubuntu.com/ubuntu xenial-backports/main armhf Packages
Ign:10 http://bg.archive.ubuntu.com/ubuntu xenial-backports/universe armhf Packages
Ign:9 http://bg.archive.ubuntu.com/ubuntu xenial-backports/main armhf Packages
Ign:10 http://bg.archive.ubuntu.com/ubuntu xenial-backports/universe armhf Packages
Get:11 http://bg.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [383 kB]
Get:12 http://bg.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [378 kB]
Ign:13 http://bg.archive.ubuntu.com/ubuntu xenial-updates/main armhf Packages
Get:14 http://bg.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [323 kB]
Get:15 http://bg.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [320 kB]
Ign:16 http://bg.archive.ubuntu.com/ubuntu xenial-updates/universe armhf Packages
Ign:17 http://bg.archive.ubuntu.com/ubuntu xenial-updates/multiverse armhf Packages
Err:9 http://bg.archive.ubuntu.com/ubuntu xenial-backports/main armhf Packages
404 Not Found [IP: 195.85.215.252 80]
Ign:10 http://bg.archive.ubuntu.com/ubuntu xenial-backports/universe armhf Packages
Ign:13 http://bg.archive.ubuntu.com/ubuntu xenial-updates/main armhf Packages
Ign:16 http://bg.archive.ubuntu.com/ubuntu xenial-updates/universe armhf Packages
Ign:17 http://bg.archive.ubuntu.com/ubuntu xenial-updates/multiverse armhf Packages
Ign:13 http://bg.archive.ubuntu.com/ubuntu xenial-updates/main armhf Packages
Ign:16 http://bg.archive.ubuntu.com/ubuntu xenial-updates/universe armhf Packages
Ign:17 http://bg.archive.ubuntu.com/ubuntu xenial-updates/multiverse armhf Packages
Err:13 http://bg.archive.ubuntu.com/ubuntu xenial-updates/main armhf Packages
404 Not Found [IP: 195.85.215.252 80]
Ign:16 http://bg.archive.ubuntu.com/ubuntu xenial-updates/universe armhf Packages
Ign:17 http://bg.archive.ubuntu.com/ubuntu xenial-updates/multiverse armhf Packages
Ign:18 http://security.ubuntu.com/ubuntu xenial-security/main armhf Packages
Ign:19 http://security.ubuntu.com/ubuntu xenial-security/universe armhf Packages
Ign:18 http://security.ubuntu.com/ubuntu xenial-security/main armhf Packages
Ign:19 http://security.ubuntu.com/ubuntu xenial-security/universe armhf Packages
Ign:18 http://security.ubuntu.com/ubuntu xenial-security/main armhf Packages
Ign:19 http://security.ubuntu.com/ubuntu xenial-security/universe armhf Packages
Err:18 http://security.ubuntu.com/ubuntu xenial-security/main armhf Packages
404 Not Found [IP: 91.189.91.26 80]
Ign:19 http://security.ubuntu.com/ubuntu xenial-security/universe armhf Packages
Fetched 95,7 kB in 1s (59,8 kB/s)
Reading package lists... Done
E: Failed to fetch http://bg.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-armhf/Packages 404 Not Found [IP: 195.85.215.252 80]
E: Failed to fetch http://bg.archive.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-armhf/Packages 404 Not Found [IP: 195.85.215.252 80]
E: Failed to fetch http://bg.archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-armhf/Packages 404 Not Found [IP: 195.85.215.252 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/main/binary-armhf/Packages 404 Not Found [IP: 91.189.91.26 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
Unlike Debian, the Ubuntu archives don't have everything in the right place already, in fact non-x86 packages are kept somewhere else altogether. The first thing to do is edit /etc/apt/sources.lst to add ports.ubuntu.com alongside archive.ubuntu.com/ubuntu for the repositories you want, e.g. for:
deb http://bg.archive.ubuntu.com/ubuntu/ xenial main restricted
the equivalent ports repo is:
deb http://bg.ports.ubuntu.com/ xenial main restricted
With those in place,
dpkg --add-architecture armhf
(repeat as appropriate for additional architectures), then updating as usual, does the trick. I've confirmed this on a fresh install of 16.04.1, but I'm pretty sure the same applies as far back as 12.04 too.
Per the multiarch documentation, you can shut the "ignored" and "not found" errors up by restricting entries to the relevant architectures, i.e.:
deb [arch=i386,amd64] http://archive.ubuntu.com...
deb [arch=armhf] http://ports.ubuntu.com...
For reference, Debian's census report has a convenient summary.