janestreet / bin_prot

Binary protocol generator
MIT License
73 stars 21 forks source link

unable to compile on FreeBSD due to gcc dependency #6

Closed dch closed 9 years ago

dch commented 10 years ago

Sorry I can't provide a patch for this, from freebsd 10 now uses only clang & therefore make fails. Hope this is enough.

BTW installing gcc48 (and softlinking gcc to gcc48) does work successfully.

output of opam install -v bin_prot.111.03.00 |& > /ramdisk/binprot.err

The following actions will be performed:
 - install bin_prot.111.03.00
1 to install | 0 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove

=-=-= Installing bin_prot.111.03.00 =-=-=
Building bin_prot.111.03.00:
  gmake
  gmake install
ocamlopt.opt -o setup.exe setup.ml || ocamlopt -o setup.exe setup.ml || ocamlc -o setup.exe setup.ml
rm -f setup.cmx setup.cmi setup.o setup.obj setup.cmo
./setup.exe -configure 

Configuration: 
ocamlfind: ........................................... /home/dch/.opam/system/bin/ocamlfind
ocamlc: .............................................. /usr/local/bin/ocamlc.opt
ocamlopt: ............................................ /usr/local/bin/ocamlopt.opt
ocamlbuild: .......................................... /usr/local/bin/ocamlbuild
Package name: ........................................ bin_prot
Package version: ..................................... 111.03.00
os_type: ............................................. Unix
system: .............................................. freebsd
architecture: ........................................ amd64
ccomp_type: .......................................... cc
ocaml_version: ....................................... 4.01.0
standard_library_default: ............................ /usr/local/lib/ocaml
standard_library: .................................... /usr/local/lib/ocaml
standard_runtime: .................................... /usr/local/bin/ocamlrun
bytecomp_c_compiler: ................................. cc -O2 -pipe -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -O2 -pipe -fno-strict-aliasing  -fPIC
native_c_compiler: ................................... cc -O2 -pipe -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -O2 -pipe -fno-strict-aliasing 
model: ............................................... default
ext_obj: ............................................. .o
ext_asm: ............................................. .s
ext_lib: ............................................. .a
ext_dll: ............................................. .so
default_executable_name: ............................. a.out
systhread_supported: ................................. true
Install architecture-independent files dir: .......... /usr/local
Install architecture-dependent files in dir: ......... $prefix
User executables: .................................... $exec_prefix/bin
System admin executables: ............................ $exec_prefix/sbin
Program executables: ................................. $exec_prefix/libexec
Read-only single-machine data: ....................... $prefix/etc
Modifiable architecture-independent data: ............ $prefix/com
Modifiable single-machine data: ...................... $prefix/var
Object code libraries: ............................... $exec_prefix/lib
Read-only arch-independent data root: ................ $prefix/share
Read-only architecture-independent data: ............. $datarootdir
Info documentation: .................................. $datarootdir/info
Locale-dependent data: ............................... $datarootdir/locale
Man documentation: ................................... $datarootdir/man
Documentation root: .................................. $datarootdir/doc/$pkg_name
HTML documentation: .................................. $docdir
DVI documentation: ................................... $docdir
PDF documentation: ................................... $docdir
PS documentation: .................................... $docdir
findlib_version: ..................................... 1.5.3
is_native: ........................................... true
suffix_program: ...................................... 
Remove a file.: ...................................... rm -f
Remove a directory.: ................................. rm -rf
Turn ocaml debug flag on: ............................ true
Turn ocaml profile flag on: .......................... false
Compiler support generation of .cmxs.: ............... true
OCamlbuild additional flags: ......................... 
Create documentations: ............................... true
Compile tests executable and library and run them: ... false
camlp4o: ............................................. /usr/local/bin/camlp4o
pkg_unix: ............................................ /usr/local/lib/ocaml
pkg_bigarray: ........................................ /usr/local/lib/ocaml
pkg_camlp4_quotations: ............................... /usr/local/lib/ocaml/camlp4
pkg_camlp4_extend: ................................... /usr/local/lib/ocaml/camlp4
pkg_type_conv: ....................................... /home/dch/.opam/system/lib/type_conv

./setup.exe -build 
W: Cannot find source file matching module 'bin_prot' in library bin_prot
ocamlfind ocamlopt unix.cmxa -I /usr/local/lib/ocaml/ocamlbuild /usr/local/lib/ocaml/ocamlbuild/ocamlbuildlib.cmxa -linkpkg myocamlbuild.ml /usr/local/lib/ocaml/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
ocamlfind ocamlc -c lib/blit_stubs.c
mv blit_stubs.o lib/blit_stubs.o
/home/dch/.opam/system/bin/ocamlfind ocamlmklib -o lib/bin_prot_stubs lib/blit_stubs.o
ocamlfind ocamldep -package bigarray -package unix -modules lib/binable.ml > lib/binable.ml.depends
ocamlfind ocamldep -pp 'gcc -E -xc -undef -w -DARCH_SIXTYFOUR' -package bigarray -package unix -modules lib/read.mli > lib/read.mli.depends
+ ocamlfind ocamldep -pp 'gcc -E -xc -undef -w -DARCH_SIXTYFOUR' -package bigarray -package unix -modules lib/read.mli > lib/read.mli.depends
gcc: not found
Preprocessing error on file lib/read.mli
Error while running external preprocessor
Command line: gcc -E -xc -undef -w -DARCH_SIXTYFOUR 'lib/read.mli' > /tmp/dch/ocamlpp11fb90

Command exited with code 2.
E: Failure("Command ''/usr/local/bin/ocamlbuild' lib/libbin_prot_stubs.a lib/dllbin_prot_stubs.so lib/bin_prot.cma lib/bin_prot.cmxa lib/bin_prot.a lib/bin_prot.cmxs syntax/pa_bin_prot.cma syntax/pa_bin_prot.cmxa syntax/pa_bin_prot.a syntax/pa_bin_prot.cmxs -use-ocamlfind -tag debug' terminated with error code 10")
gmake: *** [build] Error 1
[ERROR] The compilation of bin_prot.111.03.00 failed.
Removing bin_prot.111.03.00.
  ocamlfind remove bin_prot
ocamlfind: [WARNING] No such directory: /home/dch/.opam/system/lib/bin_prot

===== ERROR while installing bin_prot.111.03.00 =====
# opam-version         1.1.1
# os                   freebsd
# command              gmake
# path                 /usr/home/dch/.opam/system/build/bin_prot.111.03.00
# compiler             system (4.01.0)
# exit-code            2
# env-file             /usr/home/dch/.opam/system/build/bin_prot.111.03.00/bin_prot-50917-ffb3fd.env
# stdout-file          /usr/home/dch/.opam/system/build/bin_prot.111.03.00/bin_prot-50917-ffb3fd.out
# stderr-file          /usr/home/dch/.opam/system/build/bin_prot.111.03.00/bin_prot-50917-ffb3fd.err
### stdout ###
# ...[truncated]
# /home/dch/.opam/system/bin/ocamlfind ocamlmklib -o lib/bin_prot_stubs lib/blit_stubs.o
# ocamlfind ocamldep -package bigarray -package unix -modules lib/binable.ml > lib/binable.ml.depends
# ocamlfind ocamldep -pp 'gcc -E -xc -undef -w -DARCH_SIXTYFOUR' -package bigarray -package unix -modules lib/read.mli > lib/read.mli.depends
# + ocamlfind ocamldep -pp 'gcc -E -xc -undef -w -DARCH_SIXTYFOUR' -package bigarray -package unix -modules lib/read.mli > lib/read.mli.depends
# gcc: not found
# Preprocessing error on file lib/read.mli
# Error while running external preprocessor
# Command line: gcc -E -xc -undef -w -DARCH_SIXTYFOUR 'lib/read.mli' > /tmp/dch/ocamlpp11fb90
# 
# Command exited with code 2.
### stderr ###
# W: Cannot find source file matching module 'bin_prot' in library bin_prot
# E: Failure("Command ''/usr/local/bin/ocamlbuild' lib/libbin_prot_stubs.a lib/dllbin_prot_stubs.so lib/bin_prot.cma lib/bin_prot.cmxa lib/bin_prot.a lib/bin_prot.cmxs syntax/pa_bin_prot.cma syntax/pa_bin_prot.cmxa syntax/pa_bin_prot.a syntax/pa_bin_prot.cmxs -use-ocamlfind -tag debug' terminated with error code 10")
# gmake: *** [build] Error 1

'opam install -v bin_prot.111.03.00' failed.
seliopou commented 10 years ago

I just ran into this as well. It seems that the compiler's hard-coded in myocamlbuild.ml. Should be able to fix this by reading the ccomp_type from the environment.

dch commented 9 years ago

Thanks @seliopou fixes this perfectly! Would love to see this in a new tagged release so it just works via opam again.

ghost commented 9 years ago

Sorry, I forgot this patch. Adding it now

dch commented 9 years ago

@diml are you able to push this to opam? its not obvious to new users that pinning is required. thanks!

ghost commented 9 years ago

I added the fix to the 112.06 series:

ocaml/opam-repository#3522