Installing Haxe on FreeBSD
Mar. 20th, 2016 08:05 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Notes from installing Haxe on freebsd.
Installation
Installing haxe 3.2.0 from git because the .zip package did not work.
git clone --recursive git://github.com/HaxeFoundation/haxe.git
error
Error caused by ocaml not existing. Solution: pkg install ocaml
make[1]: exec(ocamlopt) failed (No such file or directory)
error
Another missing dependency.
camlp4o: not found File "parser.ml", line 1: Error: Error while running external preprocessor Command line: camlp4o 'parser.ml' > /tmp/ocamlppb3e07a
Solution: sudo pkg install ocaml-camlp4
error
Error caused by /usr/include/sys not being in the include path.
fatal error: 'wait.h' file not found
Setting environment variables did not work. I'm not sure if this is because the compiler isn't gcc or if the shell is not handing off envvars to children.
set C_INCLUDE_PATH=/usr/include/sys/ set CFLAGS="-I /usr/include/sys"
I tweaked the filesystem instead.
/usr/include% sudo ln -s sys/wait.h wait.h
installing neko
error
post-install
% haxelib /usr/local/lib/haxe/std/neko/_std/sys/io/FileInput.hx:60: characters 26-29 : Invalid package : std should be <empty>
caused by a lack of neko. Nothing on the haxe webpage said that neko was still a separate package. Everything implied that it came with haxe now. Such as the existence of lib/neko and nekotools in the source. Neko is downloadable from http://nekovm.org
neko requires libgc-dev, not in packages. link to home page is 404ed. libgc created by Hans Boehm, new page at: http://hboehm.info/gc/index.html configure, make, install, seems fine.
error
nekovm will not build:
vm/alloc.c:45:10: fatal error: 'gc/gc.h' file not found
It is looking in a local path. Workaround:
sudo ln -s /usr/local/include/gc gc
warning
Common warning in macro expansions:
vm/interp.c:892:3: warning: incompatible integer to pointer conversion passing 'int_val' (aka 'long') to parameter of type 'const void *' [-Wint-conversion]
error
Linker crashes.
cc -shared -Wl,-Bsymbolic -pthread -o bin/libneko.so vm/alloc.o vm/builtins.o vm/callback.o vm/interp.o vm/load.o vm/objtable.o vm/others.o vm/hash.o vm/module.o vm/jit_x86.o vm/threads.o -ldl -lgc -lm /usr/bin/ld: cannot find -ldl cc: error: linker command failed with exit code 1 (use -v to see invocation) Makefile:100: recipe for target 'bin/libneko.so' failed-ldl is included in freebsd's libc. removing it from the line.
error
Next error:
/usr/bin/ld: cannot find -lgc
I JUST INSTALLED IT. libgc.a, libgc.la, and libgc.so are in /usr/local/lib
used a hard-coded path to libgc.a
error
/usr/bin/ld: /usr/local/lib/libgc.a(alloc.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libgc.a: could not read symbols: Bad valueused a hard-coded path to libgc.so instead. that worked.
error
ld -L/usr/home/dturover/Downloads/neko-2.0.0/src -L/usr/lib -L/usr/lib/mysql -L/usr/local/lib -L/usr/local/lib/mysql -L/opt/local/lib -L/opt/local/lib/mysql -L/opt/local/lib/mysql5/mysql -o ../../bin/zlib.ndll zlib.o -lz -shared -L../../bin -pthread -lneko ld: unrecognized option '-pthread'
edited Makefile, changed EXTFLAGS from -pthread to -lpthread and reran make
error
Makefile:71: recipe for target 'createbin' failed gmake: [createbin] Error 1 (ignored)
same -pthread error. Ran gmake clean and reran gmake.
error
gcc -O3 -fPIC -c -I../../vm -I/usr/include zlib.c ld -L/usr/home/dturover/Downloads/neko-2.0.0/src -L/usr/lib -L/usr/lib/mysql -L/usr/local/lib -L/usr/local/lib/mysql -L/opt/local/lib -L/opt/local/lib/mysql -L/opt/local/lib/mysql5/mysql -o ../../bin/zlib.ndll zlib.o -lz -shared -L../../bin -pthread -lneko ld: unrecognized option '-pthread'
why?
edited linkoptions in src/tools/install.neko and changed -pthread to -lpthread. That worked.
error
whaat the fuck is this?
ld -L/usr/home/dturover/Downloads/neko-2.0.0/src -L/usr/lib -L/usr/lib/mysql -L/usr/local/lib -L/usr/local/lib/mysql -L/opt/local/lib -L/opt/local/lib/mysql -L/opt/local/lib/mysql5/mysql -o ../../bin/sqlite.ndll sqlite.o -lsqlite3 -shared -L../../bin -lpthread -lneko Compiling mod_neko... The file httpd.h provided when installing Apache 1.3.x was not found Please enter a valid include path to look for it Or 's' to skip this library
skipped the library, but why would it need it?
error
Compiling mod_neko... The file httpd.h provided when installing Apache 1.3.x was not found Please enter a valid include path to look for it Or 's' to skip this library > s Compiling mod_tora... The file httpd.h provided when installing Apache 1.3.x was not found Please enter a valid include path to look for it Or 's' to skip this library > s Compiling mod_tora2... The file httpd.h provided when installing Apache 2.2.x was not found Please enter a valid include path to look for it Or 's' to skip this library > s Compiling mod_neko2... The file httpd.h provided when installing Apache 2.2.x was not found Please enter a valid include path to look for it Or 's' to skip this library > s Compiling ui... The file gtk/gtk.h provided when installing GTK+2.0 was not found Please enter a valid include path to look for it Or 's' to skip this library > s
error
sudo gmake install cp bin/libneko.so /usr/local/lib cp bin/neko bin/nekoc bin/nekotools bin/nekoml bin/nekoml.std /usr/local/bin mkdir /usr/local/lib/neko cp bin/*.ndll /usr/local/lib/neko mkdir /usr/local/include mkdir: /usr/local/include: File exists Makefile:118: recipe for target 'install' failed gmake: [install] Error 1 (ignored) cp vm/neko*.h /usr/local/include
(facepalm)
error
does haxelib work yet? No! Same error. [Note: this may refer to an earlier note that was lost as these notes were revised.]
Invalid package : std should be
My current working directory was still inside the cloned Haxe repo, so there was a folder called "std" in my current directory, containing the standard library, which triggers the error.
lime
installed the lime library through haxelib. it did not install the lime command. From irc, lime is just haxelib run lime
error
could not find the demos. maybe the demos are in a separate package like lime-demos? [it's lime-samples]
"haxelib search lime" is like a fork bomb creating several haxe processes each hogging 100% cpu and 50MB
probably related to a name match with something in the lime directory where I was running haxelib. From another directory it works fine.
error
after installing lime-samples, lime create still cannot find the HelloWorld package. [Edit: it works now]
Copied all of the sample packages to a different working directory.
error
lime-samples/HelloWorld% lime test flash --macro:1: character 0 : You cannot access the flash package while targeting neko (for flash.xml.XMLList)
error
% lime -swf test Error: Multiple targets
commented out the -neko line in the run.hxml file
Error: Multiple targets /usr/local/lib/haxe/lib/lime/2,4,7/tools/RunScript.hx:6: characters 7-18 : You cannot access the sys package while targeting flash (for sys.io.File)
[Note: This was resolved in a later version.]
error
missing command: haxelib run lime setup
the command fork bombs in two places. created a new empty directory to run it in. It fork bombs. Moved the lib directory. It still fork bombs.
#0 0x000000080120abfa in read () from /lib/libc.so.7 #1 0x00000000007b95ce in process_stdout_read () #2 0x0000000000506c05 in camlInterp__fun_7300 () at interp.ml:1851 #3 0x000000000051171f in camlInterp__call_2691 () at interp.ml:3417 #4 0x00000000004f8b14 in camlInterp__fun_8172 () at interp.ml:3040 #5 0x00000000004f9be1 in camlInterp__fun_7840 () at interp.ml:2779 #6 0x00000000004f9217 in camlInterp__fun_7947 () at interp.ml:257 #7 0x00000000004f9ba7 in camlInterp__loop_2748 () at interp.ml:2775 #8 0x00000000004f9be1 in camlInterp__fun_7840 () at interp.ml:2779 #9 0x0000000000511754 in camlInterp__call_2691 () at interp.ml:3416 #10 0x00000000004f6fd8 in camlInterp__fun_8524 () at interp.ml:3312 #11 0x00000000004f9268 in camlInterp__fun_7944 () at interp.ml:2913 #12 0x00000000004f9ba7 in camlInterp__loop_2748 () at interp.ml:2775 #13 0x00000000004f9be1 in camlInterp__fun_7840 () at interp.ml:2779 #14 0x00000000005117cb in camlInterp__call_2691 () at interp.ml:3413 #15 0x00000000004f8208 in camlInterp__fun_8272 () at interp.ml:3195 #16 0x00000000004f7178 in camlInterp__fun_8512 () at interp.ml:3321 #17 0x00000000004f942e in camlInterp__loop_2798 () at interp.ml:2875 #18 0x00000000004f95c1 in camlInterp__fun_7937 () at interp.ml:2889 #19 0x00000000004f9ba7 in camlInterp__loop_2748 () at interp.ml:2775 #20 0x00000000004f9be1 in camlInterp__fun_7840 () at interp.ml:2779 #21 0x00000000004f9217 in camlInterp__fun_7947 () at interp.ml:257 #22 0x00000000004f9ba7 in camlInterp__loop_2748 () at interp.ml:2775 #23 0x00000000004f9be1 in camlInterp__fun_7840 () at interp.ml:2779 #24 0x00000000005117cb in camlInterp__call_2691 () at interp.ml:3413 #25 0x00000000004f221a in camlInterp__fun_7911 () at interp.ml:2868 #26 0x0000000000779301 in camlList__iter_1061 () at list.ml:73 #27 0x00000000004f9673 in camlInterp__fun_7901 () at interp.ml:2868
Makefile changes needed to get ocamlc to take the -g option
- change all "make" to gmake
- change ocamlc to "ocamlc -g" with quotes
still no debugging symbols
error
haxelib selfupdate updated.
Called from lime/system/System.hx line 553 Called from lime/system/System.hx line 304 Called from lime/system/System.hx line 414 Called from lime/system/System.hx line 239 Called from /usr/lib/haxe/std/neko/Lib.hx line 30 Uncaught exception - load.c(237) : Failed to load library : lime.ndll (Shared object "lime.ndll" not found, required by "neko") /usr/local/lib/haxe_lib/lime/2,4,9% find . | grep lime.ndll ./ndll/Mac64/lime.ndll ./ndll/Windows/lime.ndll ./ndll/Linux64/lime.ndll ./ndll/Linux/lime.ndll ./ndll/Mac/lime.ndll
ln -s Linux FreeBSD did not work
something ran load_primitive
loader_loadprim loads load_primitive
from lib.hx
public static function load( lib : String, prim : String, nargs : Int ) : Dynamic { return untyped __dollar__loader.loadprim((lib+"@"+prim).__s,nargs); }
from system.hx 239
return neko.Lib.load (__moduleNames.get (library), method, args);
[Note: I gave up trying to solve the problem, but the devs seem to have fixed it in the interim.]