Running lsb_release -s -d on the Jetson TK1 gives me Ubuntu 14.04 LTS
So I tried sudo apt-get install haskell-platform and sudo apt-get install ghc and with both I get an error that it is unable to locate the package. So I enabled the universe repository as I saw on a stackoverflow post for installing the haskell-platform for ubuntu 14.04. I still get the same result.
I see some people mentioning the got the haskell-platform to install on raspberry pis easily and that GHC now has good support for ARM but I don't see a way to get the install running on the Jetson TK1. My next option is to build from source, I don't see source for ARM architecture on the GHC or Haskell platform website.
I know there is also cross compiling, I will start messing with that when I see there is no easier way.
I managed to compile GHC7.8.3 on the Jetson K1 and Adapteva Parallella.
I wrote a blog post about it here which is more verbose, but here's a summarized rundown of what I did:
You will need GHC7.6.3 or earlier to bootstrap the compilation. I ran
sudo apt-get install ghc automake build-essential cabal-install groff
You’ll also need Alex and Happy, sudo apt-get install alex happy.
I also installed them in Cabal, cabal update && cabal install alex happy
I decided to compile with llvm, clang and gold linker, because gcc wouldn’t compile all the way.
sudo apt-get install llvm clang binutils
Edit mk/build.mk. I uncommented the line about quick-llvm compilation
BuildFlavour = quick-llvm.
You'll also need to replace appearances of -H64m with -H32m
perl boot and sudo ./configure --with-clang=/usr/bin/clang --with-ar=/usr/bin/ar
Because there is a linker issue, obtain the following script that will switch between standard ld and gold: https://gist.githubusercontent.com/bgamari/9399430/raw/build-ghc-arm.sh
chmod ugo+rx build-ghc-arm.sh
sudo /build-ghc-arm.sh -j6
sudo make install
Related
I just started an AWS EC2 instance using an Amazon linux instance. I tried installing libel-dev and g++ like sudo yum libel-dev g++ make, but I get:
No package libssl-dev available.
No package g++ available.
So how can I install libel-dev and g++?
Thank you and will be sure to vote up/accept answer!
For libssl equivalent, this one worked sudo yum install openssl-devel -y
For g++, sudo yum install gcc -y
Since you have tagged yum, I'm assuming it the package manager you're using on your OS.
Whenever you install a fresh OS, it's always a good idea to update your package manager, be it apt-get or yum.
Do an update on the same (yum update -y) and if does not, you might have to compile the same from source.
You can learn more about compiling from source here: https://unix.stackexchange.com/questions/173/how-to-compile-and-install-programs-from-source
#Efren's command sudo yum install gcc -y didn't install g++ for me, and why should it?
I was able to get g++ by switching my OS from Amazon Linux 2 to Deep Learning AMI GPU PyTorch 1.12.0 (Amazon Linux 2). It comes pre-installed.
Am looking for installing protobuf 2.5.0 on Arch Linux, so that protoc-2.5.0.so is installed on the OS, so that I can go ahead with building hadoop 2.6.0 from source and make my life easy! :)
BTW, protobuf 2.6.0 does not compile when hadoop is built from source I have tried that as well. Ubuntu 14.04 comes with protoc 2.5.0. I DO NOT want to use Ubuntu.
Please check the screenshot first (there is no protobuf 2.5.0), since the problem lies there.. I guess
am getting the following exception, I am aware that protoc is not installed in arch linux currently.
[ERROR] Failed to execute goal
org.apache.hadoop:hadoop-maven-plugins:2.6.0:protoc (compile-protoc)
on project hadoop-common:
org.apache.maven.plugin.MojoExecutionException: 'protoc --version' did
not return a version -> [Help 1]
Please help me out, since, I have spent 4 hours every day from two days, with no luck.
Compiling Google's protobuf is pretty easy.
I originally found out how to do it on this blog post while compiling hadoop myself.
But here is my version:
$ cd /usr/local/src/
$ wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
$ tar xvf protobuf-2.5.0.tar.gz
$ cd protobuf-2.5.0
$ ./autogen.sh
$ ./configure --prefix=/usr
$ make
$ make install
$ protoc --version
Install protobuf for java
$ cd java
$ mvn install
$ mvn package
You should be good to go.
To enable you to install different versions of protobuf, install stow
then change ./configure --prefix=/usr to ./configure --prefix=/usr/local/stow/protobuf-2.5.0
Then link protobuf into your system with stow:
$ cd /usr/local/stow
$ stow protobuf-2.5.0
Note: stow uses /usr/local/bin by default. Make sure thats in your $PATH
To unlink that version of protobuf,
$ stow -D protobuf-2.5.0
Hope this helped.
I wonder why the above answer got downvoted,even I had to perform few more steps (in addition to the accepted answer by Rudker) to get protobuf 2.5 installed on Ubuntu Xenial.
Leaving the additional steps here for everyone's benefit:
apt-get install autoconf in response to the error : ./autogen.sh: autoreconf: not found for command : ./autogen.sh
apt-get install libtool in response to the error : autoreconf: libtoolize is needed because this package uses Libtool for command : ./autogen.sh
apt install g++ in response to the error : configure: error: C++ preprocessor "/lib/cpp" fails sanity check for command : ./configure --prefix=/usr
An easier but not future proof solution (for future queries) would be to head over to Arch Linux Archives: http://seblu.net/a/archive/packages/p/protobuf/
Uninstall the newer version of protobuf and install the downloaded package via pacman -U protobuf-2.5.x..
Though whenever you upgrade the Arch Linux packages via pacman you'd need to ensure you are doing: sudo pacman -Syu --ignore protobuf
I currently don't have enough reputation to comment, so I add a answer here to update the top voted answer.
Since protobuf move to different repo, the new wget command should be:
wget https://github.com/protocolbuffers/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
And in order to run ./autogen.sh, you may need install these:
sudo yum install libtool automake autoconf
For OSX prerequisites, try SunitaKoppar's answer (I don't know why the down-votes).
Thanks for the steps. Just wanted to add that, to get autogen.sh to work, I had to install the below packages (commands for mac below):
brew install gtk
brew install autoconf
brew install automake
I'm trying to configure powertop-2.5 but when I run ./configure I get a "configure: error: libnl and libnl-genl are required but were not found" error
I've run
sudo apt-get install libtool autoconf libnl-dev ncurses-dev pciutils-dev build-essential -y
as was recommended by these guys but I get the same error.
I ran
sudo apt-get install libnl-genl-3-dev
Which replaced the previous libnl file but I still get the config error.
According to this, powertop has (or had) problems with detecting libnl but I can't figure out how to fix it.
I'm currently running Linux username 3.2.0-4-686-pae #1 SMP Debian 3.2.51-1 i686 GNU/Linux
I see you tried libnl-dev, maybe try libnl-3-dev instead:
sudo apt-get install libnl-3-dev libnl-genl-3-dev
Probably the problem is the lack of the pkg-config application in your system (which is used to find the proper dependencies with the configure script). I just have the same problem in a fresh installed Ubuntu 14.04 system, and after installing the pkg-config package the configure script finalized successfully its work. Then I could compile and install the last version (2.6.1) of powertop.
I "solved" my problem by installing powertop-2.0 instead.
The use of pkg-config made the trick. I was able to install Powertop 2.7.
I am trying to install the gnu arm toolchain for ubuntu. I first downloaded the tar from CodeSourcery. However when I go into the bin folder, I cannot run any of the binaries. I have tried with ./ and without and putting it in the PATH and it keeps telling me "Command not Found" yet the file is there in the folder right in front of me. Then I tried sudo apt-get install gcc-arm-linux-gnueabi except after it says it has installed successfully, I cannot find it with whereis gcc-arm-linux-gnueabi. Can anyone help?
fixed, using:
sudo apt-get install gcc-arm*
Are you compiling on a 64-bit OS? Try:
sudo apt-get install ia32-libs
I had the same problem when trying to compile the Raspberry Pi kernel. I was cross-compiling on Ubuntu 12.04 64-bit and the toolchain requires ia32-libs to work on on a 64-bit system.
See http://hertaville.com/2012/09/28/development-environment-raspberry-pi-cross-compiler/
CodeSourcery convention is to use prefix arm-none-linux-gnueabi- for all executables, not gcc-arm-linux-gnueabi that you mention. So, standard name for CodeSourcery gcc would be arm-none-linux-gnueabi-gcc.
After you have installed CodeSourcery G++, you need to add CodeSourcery directory into your PATH.
Typically, I prefer to install CodeSourcery into directory like /opt/arm-2010q1 or something like that. If you don't know where you have installed it, you can find it using locate arm-none-linux-gnueabi-gcc, however you may need to force to update your locate db using sudo updatedb before locate will work properly.
After you have identified where your CodeSourcery is installed, add it your PATH by editing ~/.bashrc like this:
PATH=/opt/arm-2010q1/bin:$PATH
Also, it is customary and very convenient to define
CROSS_COMPILE=arm-none-linux-gnueabi-
in your .bashrc, because with CROSS_COMPILE defined, most tools will automatically use proper compiler for ARM compilation without you doing anything.
if you are on 64 bit os then you need to install this additional libraries.
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
got the same error when trying to cross compile the raspberry pi kernel on ubunto 14.04.03 64bit under VM. the solution was found here:
-Install packages used for cross compiling on the Ubuntu box.
sudo apt-get install gcc-arm-linux-gnueabi make git-core ncurses-dev
-Download the toolchain
cd ~
git clone https://github.com/raspberrypi/tools
-Add the toolchain to your path
PATH=$PATH:~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian:~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin
notice the x64 version in the path command
I was also facing the same issue and resolved it after installing the following dependency:
sudo apt-get install lib32z1-dev
If you are on a 64bit build of ubuntu or debian (see e.g. 'cat /proc/version') you should simply use the 64bit cross compilers, if you cloned
git clone https://github.com/raspberrypi/tools
then the 64bit tools are in
tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64
use that directory for the gcc-toolchain.
A useful tutorial for compiling that I followed is available here Building and compiling Raspberry PI Kernel (use the -x64 path from above as ${CCPREFIX})
You have installed a toolchain which was compiled for i686 on a box which is running an x86_64 userland.
Use an i686 VM.
Its a bit counter-intuitive. The toolchain is called gcc-arm-linux-gnueabi. To invoke the tools execute the following: arm-linux-gnueabi-xxx
where xxx is gcc or ar or ld, etc
try the following command:
which gcc-arm-linux-gnueabi
Its very likely the command is installed in /usr/bin.
I had to cross compile C code in Ubuntu for ARM. This worked for me:
$ sudo apt install gcc-arm-none-eabi
Later, tested it on the qemu emulator
#Install qemu
sudo apt-get install qemu qemu-user-static qemu-system-arm
#Cross compile "helloworld.c"
$ arm-none-eabi-gcc --specs=rdimon.specs -Wl,--start-group -lgcc -lc -lm -lrdimon -Wl,--end-group helloworld.c -o helloworld
#Run
qemu-arm-static helloworld
I downloaded the Haskell-platform source from here: http://www.haskell.org/platform/linux.html, installed ghc, and did /.configure. However when I do sudo make, I get the following error:
Preprocessing library HUnit-1.2.4.2...
Test/HUnit/Base.hs:1:1:
Could not find module `Prelude'
Perhaps you haven't installed the profiling libraries for package `base'?
Use -v to see a list of the files searched for.
Error:
Building the HUnit-1.2.4.2 package failed
make: *** [build.stamp] Error 2
Does anyone knows how to fix this?
I'm trying to install on Ubuntu 12.04.1 LTS
Instead of trying to install from the sources, simply install the Ubuntu packages, which will be much simpler, with:
$ sudo apt-get install haskell-platform
If you need a local version of the documentation and the profiling libraries, install the additional packages with:
$ sudo apt-get install haskell-platform-doc haskell-platform-prof
Daniel Fisher's comment led me to the solution. You have to install all the profiling libraries for each of the ghc packages you have installed.
Just write
sudo apt-get install ghc*-prof
That's how it worked for me