How to install erlang in Ubuntu 12.04?
Solution 1
Here is how. Open a terminal and type
sudo apt-get install erlang erlang-doc
Solution 2
You can find more up-to-date packages here (Ubuntu 12.04 has R14B04, while the latest version is R15B02). Download the appropriate package and run:
sudo dpkg -i esl-erlang_15.b.2-1~ubuntu~precise_amd64.deb
(adjust as appropriate for the 32-bit package)
Solution 3
You will need to make this file executable (chmod u+x
) and run it with sudo
.
apt-get update
# replace libwxgtk2.8-dev with libwxgtk3.0-dev for Ubuntu 16.04
apt-get --fix-missing -y install build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev libwxgtk2.8-dev libglu1-mesa-dev fop xsltproc default-jdk
mkdir -p /src/erlang
cd /src/erlang
wget http://www.erlang.org/download/otp_src_R15B01.tar.gz
tar -xvzf otp_src_R16B01.tar.gz
chmod -R 777 otp_src_R16B01
cd otp_src_R16B01
./configure
make
make install
Solution 4
From the source code, you could do this:
sudo apt-get -y install build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev libwxgtk2.8-dev libglu1-mesa-dev fop xsltproc default-jdk
wget http://www.erlang.org/download/otp_src_R16B01.tar.gz
tar -xvzf otp_src_R16B01.tar.gz
chmod -R 777 otp_src_R16B01
cd otp_src_R16B01
./configure
make
sudo make install
Note: in some commands it will be necessary have root permissions, so it's adviced to use sudo
or su
when it's asked. (as you can see some commands already have sudo
as prefix)
Solution 5
I would advise you install it through the Ubuntu Software Center.
To install erlang from Ubuntu Software Center:
Open the Ubuntu Software Center.
Type
erlang
into the search. Under the 'Concurrent, real-time, distributed functional language' title...Check the Add-on, though optional, for additional features.
Click on 'install' to install it.
Related videos on Youtube
user2825183
Updated on September 18, 2022Comments
-
user2825183 over 1 year
I have a problem I've been trying to solve and I cannot come up with the answer. I have written a function in Matlab which, given two lat/lon points and two bearings, will return the two great circle points of intersection.
However, what I really need is the first great circle point of intersection along the two initial headings. I.e. if two airplanes begin at lat/lon points 1 and 2, with initial bearings of bearing1 and bearing2, which of the two great circle intersection points is the first one they encounter? There are many solutions (using haversine) which will give me the closer of the two points, but I don't actually care about which is closer, I care about which I will encounter first given specific start points and headings. There are many cases where the closer of the two intersections is actually the second intersection encountered.
Now, I realize I could do this with lots of conditional statements for handling the different cases, but I figure there's got to be a way to handle it with regard to the order I take all my cross products (function code given below), but I simply can't come up with the right solution! I should also mention that this function is going to be used in a large computationally intensive model, and so I'm thinking the solution to this problem needs to be rather elegant/speedy. Can anyone help me with this problem?
The following is not my function code (I can't list that here), but it is the pseudo code that my function was based off of:
%Given inputs of lat1,lon1,Bearing1,lat2,lon2,Bearing2: %Calculate arbitrary secondary point along same initial bearing from first %point dAngle = 45; lat3 = asind( sind(lat1)*cosd(dAngle) + cosd(lat1)*sind(dAngle)*cosd(Bearing1)); lon3 = lon1 + atan2( sind(Bearing1)*sind(dAngle)*cosd(lat1), cosd(dAngle)-sind(lat1)*sind(lat3) )*180/pi; lat4 = asind( sind(lat2)*cosd(dAngle) + cosd(lat2)*sind(dAngle)*cosd(Bearing2)); lon4 = lon2 + atan2( sind(Bearing2)*sind(dAngle)*cosd(lat2), cosd(dAngle)-sind(lat2)*sind(lat4) )*180/pi; %% Calculate unit vectors % We now have two points defining each of the two great circles. We need % to calculate unit vectors from the center of the Earth to each of these % points [Uvec1(1),Uvec1(2),Uvec1(3)] = sph2cart(lon1*pi/180,lat1*pi/180,1); [Uvec2(1),Uvec2(2),Uvec2(3)] = sph2cart(lon2*pi/180,lat2*pi/180,1); [Uvec3(1),Uvec3(2),Uvec3(3)] = sph2cart(lon3*pi/180,lat3*pi/180,1); [Uvec4(1),Uvec4(2),Uvec4(3)] = sph2cart(lon4*pi/180,lat4*pi/180,1); %% Cross product %Need to calculate the the "plane normals" for each of the two great %circles N1 = cross(Uvec1,Uvec3); N2 = cross(Uvec2,Uvec4); %% Plane of intersecting line %With two plane normals, the cross prodcut defines their intersecting line L = cross(N1,N2); L = L./norm(L); L2 = -L; L2 = L2./norm(L2); %% Convert normalized intersection line to geodetic coordinates [lonRad,latRad,~]=cart2sph(L(1),L(2),L(3)); lonDeg = lonRad*180/pi; latDeg = latRad*180/pi; [lonRad,latRad,~]=cart2sph(L2(1),L2(2),L2(3)); lonDeg2 = lonRad*180/pi; latDeg2 = latRad*180/pi;
UPDATE: A user on the Mathworks forums pointed this out:
Actually they might each reach a different point. I might have misunderstood the question, but the way you worded it suggests that both trajectories will converge towards the same point, which is not true. If you image the first point being a little after one intersection and the second point being a little after the other intersection, you have a situation were each "plane" will travel towards the intersection that was the closest to the other plane at the beginning.
I didn't think about this. It is actually very possible that each of the planes intersects a different great circle intersection first. Which just made things much more complicated...
-
Hasitha over 10 yearsRefer this link. This will help you to install erlang though you already download the Source Package or not.
-
-
Braiam over 10 yearsIt is unnecesary to set the executable bit to all the files! Also,
make install
will fail if you are not root. -
mojo706 over 10 yearsAlso next time just link to the complete script not copy just part of it
-
user2825183 over 10 yearsHi Floris, Thanks a bunch for your help! I am assuming that the velocity vector is the same as the initial bearing (on either of the two great circles), which will be tangent to the unit sphere, does this make sense? Also, when you refer to p1 and p2 in your solution, are those the points of intersection on the great circles?
-
Floris over 10 yearsYes, if "bearing" is the vector pointing along the surface. "No" if you mean "north by northwest" - which is a more navigational interpretation of bearing. And yes, P1 and P2 are the two points of intersection. There may be a little bit more to the math than I showed ... I am going to draw me a picture.
-
user2825183 over 10 yearsWhen I say bearing I mean precise magnetic heading clockwise from North (47.234 degrees). Even though this isn't represented by a vector, I can easily get it into vector form knowing that it should be tangent to the surface.
-
Floris over 10 yearsOK yes turn it into a vector along the surface. Need to think a bit about what happens at large angles (> 90 degrees) to the first point - will get back to you.
-
Floris over 10 yearsI have updated the answer - after checking the math I found it was a little more complicated than I initially showed.
-
Lourenco about 10 yearsThank you Paulo Oliveira. I didn't understand why they down voting your answer. If some one is installing from the source, the first line (apt-get) is very important. A tip: there is no need the `chmod' line.
-
legoscia about 8 years
chmod 777
is never a good idea, and in this case it's completely unnecessary.