Installing Haxe from Source

66 views
Skip to first unread message

Nicolás Andrés Ortega

unread,
Apr 2, 2014, 6:58:16 PM4/2/14
to haxe...@googlegroups.com
Alright, I've decided to compile HaXe from the source code, and I am a little nervous about it. So, before running/compiling anything, I'd like to ask:

I've downloaded the source for 3.1.2, and I would like to install it. I've done what the instructions tell me (NOTE: I run Debian GNU/Linux 7 [Wheezy]) up to the point where it asks me to run an installhaxe.sh script (http://haxe.org/doc/build/haxe_ubuntu_build). I was wondering where I should run this script, considering I have already downloaded the code. Should I run it inside the haxe-3.1.2 directory with the Makefile, or should I run it outside?

If I didn't give enough details feel free to ask, I seem to do that.

Thanks!

clemos

unread,
Apr 2, 2014, 7:52:21 PM4/2/14
to haxe...@googlegroups.com
Hi Nicolas

I believe this wiki page is pretty outdated.
On ubuntu, given you have installed the dependencies (ocaml, etc), you can just :
make
sudo make install

Best,
Clément



--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

Nicolás Andrés Ortega

unread,
Apr 2, 2014, 7:58:22 PM4/2/14
to haxe...@googlegroups.com
Actually, for the most part it worked (I think, I haven't compiled anything yet, but the command is there), except for the fact that it didn't install haxelib, and that might be a problem. However, I was thinking that if I know what directory HaXe libraries go to, I could just manually download/install them. Is that possible, or should I install haxelib? If haxelib needs to be installed, how?

Nicolás Andrés Ortega

unread,
Apr 2, 2014, 8:30:27 PM4/2/14
to haxe...@googlegroups.com
Alright, the HaXe compiler works, and to fix the haxelib problem I've downloaded haxelib from the binary package and placed it in /usr/local/bin/. I'm not sure if it will work, but I would suppose that it would, considering it's the same version.

Justin L Mills

unread,
Apr 2, 2014, 9:22:13 PM4/2/14
to haxe...@googlegroups.com
Normally you make haxe like this...

git clone https://github.com/HaxeFoundation/haxe.git haxe
cd haxe
git submodule init
git submodule update
make all haxelib
haxelib setup

( If you have make setup on your windows to work ).

I may have missed a step since I tend to use symlinks on a mac and place
it in the correct location myself.

Nicolás Andrés Ortega:

Justin L Mills

unread,
Apr 2, 2014, 9:23:40 PM4/2/14
to haxe...@googlegroups.com
haxelib often varies little between releases so you often don't need to
update it will work with a different build so often you can use an old one.

Nicolás Andrés Ortega:

Justin L Mills

unread,
Apr 2, 2014, 9:25:17 PM4/2/14
to haxe...@googlegroups.com
Oops also need selfupdate

git clone https://github.com/HaxeFoundation/haxe.git haxe
cd haxe
git submodule init
git submodule update
make all haxelib
haxelib setup
haxelib selfupdate

Justin L Mills:

Nicolás Andrés Ortega

unread,
Apr 2, 2014, 9:47:52 PM4/2/14
to haxe...@googlegroups.com
Actually, Everything seems to be working just fine! I didn't even really need to download the source-code, the installhaxe.sh (which I got from the link I posted before) seemed to do it all (relatively). I ran the file, and it installed the haxe compiler. Then I moved the directory with the std libraries (located in haxesrc/bin/) to /usr/lib/haxe/ . Then I downloaded the haxelib binary for the same version of HaXe and put it in /usr/local/bin/ along with the haxe binary I had recently compiled. I just compiled one of my previous projects and it all works out just fine.

Thanks!

Luca

unread,
Apr 3, 2014, 3:13:58 AM4/3/14
to haxe...@googlegroups.com
Nicolás, that script builds an OLD version of Haxe from the old googlecode repository long before Haxe moved to Github.

https://code.google.com/p/haxe/source/list

Note that the most recent change to googlecode repository was more than a year ago.

Left Right

unread,
Apr 3, 2014, 11:06:11 AM4/3/14
to haxe...@googlegroups.com
Since I had to do this few times in the last couple of days, I'll try
to sum it up in least steps:

# apt-get install ocaml camlp4 ocaml-findlib zlib1g-dev git gc-dev \
pcre-dev libgc-dev gcc-multilib g++-multilib

Maybe you will need camlp4-dev. If this is not the name of the package
in Debian, try

$ apt-cache search caml

and see if there's something similar to it. gcc-* packages may be also
called gcc-c++ or something similar. You would need these to compile
C++ code from Haxe, but it's better to have them uprfornt.

$ git clone https://github.com/HaxeFoundation/neko.git
$ cd ./neko && make && sudo make install
$ git clone --recursive https://github.com/HaxeFoundation/haxe.git
$ cd ./haxe && make && make tools && sudo make install
$ haxelib setup
$ haxelib selfupdate

Some important points: you need Neko to run haxelib as well as a bunch
of other utilities.
`tools' target in Makefile of Haxe project builds haxelib

$ export HAXE_LIBRARY_PATH=/usr/lib/haxe/std:.
$ export HAXE_HOME=/usr/lib/haxe

These are the defaults as of now, but you may want to see what is the
prefix in the Haxe Makefile / change it, if you want Haxe installed in
different place. (also save these to your shell profile).

There was one more environment variable... I think NEKOPATH... but I
can't remember what it was for.
Also note that you may need to append the location of neko.so to the
LD_LIBRARY_PATH (so that C++ compiler would know where to find it).
Also remember to update the shared objects database after compiling
Neko (so that ld would know the libraries are actually there):

# updatedb

Best,

Oleg

Nicolás Andrés Ortega

unread,
Apr 3, 2014, 12:20:19 PM4/3/14
to haxe...@googlegroups.com
Yeah, I just realized that I had installed HaXe 3.0.0! I'm not sure how much of a problem this could be, but I don't think it's that bad. Truly, as long as my code compiles just fine, I'm willing to continue using it.

But yes, now it makes sense why the installhaxe.sh did not use the haxe-3.1.2 source code I had downloaded. However, then I don't know why it still directs me there in the README.md file in GitHub.
Reply all
Reply to author
Forward
0 new messages