Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation of ctypes 0.15.0 fails on FreeBSD #608

Closed
hannesm opened this issue Jul 24, 2019 · 3 comments · Fixed by #610
Closed

compilation of ctypes 0.15.0 fails on FreeBSD #608

hannesm opened this issue Jul 24, 2019 · 3 comments · Fixed by #610

Comments

@hannesm
Copy link

hannesm commented Jul 24, 2019

log output (using OCaml 4.07.1 and clang 7.0.1):

./src/discover/determine_as_needed_flags.sh >> asneeded.config
ocamlfind  ocamlc -o gen_c_primitives -package str,bytes -linkpkg src/configure/extract_from_c.ml src/configure/gen_c_primitives.ml -I src/configure
./gen_c_primitives > src/ctypes/ctypes_primitives.ml 2> gen_c_primitives.log || (rm src/ctypes/ctypes_primitives.ml && cat gen_c_primitives.log || false)
ocamlfind  ocamlc -o gen_libffi_abi -package str,bytes -linkpkg src/configure/extract_from_c.ml src/configure/gen_libffi_abi.ml -I src/configure
./gen_libffi_abi > src/ctypes-foreign-base/libffi_abi.ml 2> gen_c_primitives.log || (rm src/ctypes-foreign-base/libffi_abi.ml && cat gen_c_primitives.log || false)
cp src/ctypes-foreign-base/dl.ml.unix src/ctypes-foreign-base/dl.ml
cp src/ctypes-foreign-base/dl_stubs.c.unix src/ctypes-foreign-base/dl_stubs.c
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes_ptr.cmo -I _build/src/ctypes  src/ctypes/ctypes_ptr.ml
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes_roots_stubs.cmo -I _build/src/ctypes  src/ctypes/ctypes_roots_stubs.ml
ocamlfind  ocamlopt -bin-annot -c -o _build/src/ctypes/lDouble.cmi -package bigarray -package bytes -package integers    -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers" -I _build/src/ctypes  src/ctypes/lDouble.mli
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/lDouble.cmo -I _build/src/ctypes  src/ctypes/lDouble.ml
File "src/ctypes/lDouble.ml", line 80, characters 0-70:
Warning 3: deprecated: [@@noalloc] should be used instead of "noalloc"
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes_bigarray_stubs.cmo -I _build/src/ctypes  src/ctypes/ctypes_bigarray_stubs.ml
ocamlfind  ocamlopt -bin-annot -c -o _build/src/ctypes/complexL.cmi -package bigarray -package bytes -package integers    -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers" -I _build/src/ctypes  src/ctypes/complexL.mli
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/complexL.cmo -I _build/src/ctypes  src/ctypes/complexL.ml
ocamlfind  ocamlopt -bin-annot -c -o _build/src/ctypes/ctypes_primitive_types.cmi -package bigarray -package bytes -package integers    -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers" -I _build/src/ctypes  src/ctypes/ctypes_primitive_types.mli
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes_primitive_types.cmo -I _build/src/ctypes  src/ctypes/ctypes_primitive_types.ml
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes_primitives.cmo -I _build/src/ctypes  src/ctypes/ctypes_primitives.ml
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes_value_printing_stubs.cmo -I _build/src/ctypes  src/ctypes/ctypes_value_printing_stubs.ml
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes_memory_stubs.cmo -I _build/src/ctypes  src/ctypes/ctypes_memory_stubs.ml
File "src/ctypes/ctypes_memory_stubs.ml", line 50, characters 0-58:
Warning 3: deprecated: [@@noalloc] should be used instead of "noalloc"
ocamlfind  ocamlopt -bin-annot -c -o _build/src/ctypes/ctypes_bigarray.cmi -package bigarray -package bytes -package integers    -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers" -I _build/src/ctypes  src/ctypes/ctypes_bigarray.mli
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes_bigarray.cmo -I _build/src/ctypes  src/ctypes/ctypes_bigarray.ml
ocamlfind  ocamlopt -bin-annot -c -o _build/src/ctypes/ctypes_static.cmi -package bigarray -package bytes -package integers    -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers" -I _build/src/ctypes  src/ctypes/ctypes_static.mli
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes_static.cmo -I _build/src/ctypes  src/ctypes/ctypes_static.ml
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes_std_view_stubs.cmo -I _build/src/ctypes  src/ctypes/ctypes_std_view_stubs.ml
ocamlfind  ocamlopt -bin-annot -c -o _build/src/ctypes/ctypes_structs.cmi -package bigarray -package bytes -package integers    -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers" -I _build/src/ctypes  src/ctypes/ctypes_structs.mli
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes_structs.cmo -I _build/src/ctypes  src/ctypes/ctypes_structs.ml
ocamlfind  ocamlopt -bin-annot -c -o _build/src/ctypes/ctypes_structs_computed.cmi -package bigarray -package bytes -package integers    -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers" -I _build/src/ctypes  src/ctypes/ctypes_structs_computed.mli
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes_structs_computed.cmo -I _build/src/ctypes  src/ctypes/ctypes_structs_computed.ml
ocamlfind  ocamlopt -bin-annot -c -o _build/src/ctypes/ctypes_type_printing.cmi -package bigarray -package bytes -package integers    -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers" -I _build/src/ctypes  src/ctypes/ctypes_type_printing.mli
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes_type_printing.cmo -I _build/src/ctypes  src/ctypes/ctypes_type_printing.ml
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes_memory.cmo -I _build/src/ctypes  src/ctypes/ctypes_memory.ml
ocamlfind  ocamlopt -bin-annot -c -o _build/src/ctypes/ctypes_coerce.cmi -package bigarray -package bytes -package integers    -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers" -I _build/src/ctypes  src/ctypes/ctypes_coerce.mli
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes_coerce.cmo -I _build/src/ctypes  src/ctypes/ctypes_coerce.ml
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes_std_views.cmo -I _build/src/ctypes  src/ctypes/ctypes_std_views.ml
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes_value_printing.cmo -I _build/src/ctypes  src/ctypes/ctypes_value_printing.ml
ocamlfind  ocamlopt -bin-annot -c -o _build/src/ctypes/ctypes_types.cmi -package bigarray -package bytes -package integers    -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers" -I _build/src/ctypes  src/ctypes/ctypes_types.mli
ocamlfind  ocamlopt -bin-annot -c -o _build/src/ctypes/ctypes.cmi -package bigarray -package bytes -package integers    -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers" -I _build/src/ctypes  src/ctypes/ctypes.mli
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/ctypes.cmo -I _build/src/ctypes  src/ctypes/ctypes.ml
ocamlfind  ocamlopt -bin-annot -c -o _build/src/ctypes/cstubs_internals.cmi -package bigarray -package bytes -package integers    -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers" -I _build/src/ctypes  src/ctypes/cstubs_internals.mli
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/cstubs_internals.cmo -I _build/src/ctypes  src/ctypes/cstubs_internals.ml
ocamlfind  ocamlopt -bin-annot -c -o _build/src/ctypes/posixTypes.cmi -package bigarray -package bytes -package integers    -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers" -I _build/src/ctypes  src/ctypes/posixTypes.mli
ocamlfind  ocamlc -package bigarray -package bytes -package integers   -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"   -c -o _build/src/ctypes/posixTypes.cmo -I _build/src/ctypes  src/ctypes/posixTypes.ml
ocamlfind  ocamlc -a -linkall -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers"  -cclib -lctypes_stubs -dllib -lctypes_stubs  -cclib -lintegers_stubs -dllib -lintegers_stubs -package bigarray -package bytes -package integers   -o _build/ctypes.cma _build/src/ctypes/ctypes_ptr.cmo _build/src/ctypes/ctypes_roots_stubs.cmo _build/src/ctypes/lDouble.cmo _build/src/ctypes/ctypes_bigarray_stubs.cmo _build/src/ctypes/complexL.cmo _build/src/ctypes/ctypes_primitive_types.cmo _build/src/ctypes/ctypes_primitives.cmo _build/src/ctypes/ctypes_value_printing_stubs.cmo _build/src/ctypes/ctypes_memory_stubs.cmo _build/src/ctypes/ctypes_bigarray.cmo _build/src/ctypes/ctypes_static.cmo _build/src/ctypes/ctypes_std_view_stubs.cmo _build/src/ctypes/ctypes_structs.cmo _build/src/ctypes/ctypes_structs_computed.cmo _build/src/ctypes/ctypes_type_printing.cmo _build/src/ctypes/ctypes_memory.cmo _build/src/ctypes/ctypes_coerce.cmo _build/src/ctypes/ctypes_std_views.cmo _build/src/ctypes/ctypes_value_printing.cmo _build/src/ctypes/ctypes.cmo _build/src/ctypes/cstubs_internals.cmo _build/src/ctypes/posixTypes.cmo -cclib -Wl,--no-as-needed
cd _build/src/ctypes && ocamlfind  ocamlc -c -package bigarray -package bytes -package integers   -ccopt -fPIC -ccopt -Wall -ccopt -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers" -ccopt -I -ccopt /usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes -ccopt -I -ccopt /usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/tests -o complex_stubs.o -principal -short-paths -g -ccopt "-I/usr/home/hannes/.opam/active/lib/integers" /usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes/complex_stubs.c
In file included from /usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes/complex_stubs.c:11:
/usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes/ctypes_complex_compatibility.h:84:10: warning: implicitly declaring library function 'cexpl' with type '_Complex long double (_Complex long double)' [-Wimplicit-function-declaration]
{ return cexpl(z); }
         ^
/usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes/ctypes_complex_compatibility.h:84:10: note: include the header <complex.h> or explicitly provide a declaration for 'cexpl'
/usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes/ctypes_complex_compatibility.h:126:36: error: redefinition of 'ctypes_compat_cexpl'
static inline long double _Complex ctypes_compat_cexpl(long double _Complex z)
                                   ^
/usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes/ctypes_complex_compatibility.h:83:36: note: previous definition is here
static inline long double _Complex ctypes_compat_cexpl(long double _Complex z)
                                   ^
/usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes/ctypes_complex_compatibility.h:127:3: warning: implicit declaration of function 'caml_failwith' is invalid in C99 [-Wimplicit-function-declaration]
{ caml_failwith("ctypes: cexpl does not exist on current platform"); }
  ^
/usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes/ctypes_complex_compatibility.h:129:36: error: redefinition of 'ctypes_compat_clogl'
static inline long double _Complex ctypes_compat_clogl(long double _Complex z)
                                   ^
/usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes/ctypes_complex_compatibility.h:85:36: note: previous definition is here
static inline long double _Complex ctypes_compat_clogl(long double _Complex z)
                                   ^
/usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes/ctypes_complex_compatibility.h:130:3: warning: implicit declaration of function 'caml_failwith' is invalid in C99 [-Wimplicit-function-declaration]
{ caml_failwith("ctypes: clogl does not exist on current platform"); }
  ^
/usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes/ctypes_complex_compatibility.h:132:36: error: redefinition of 'ctypes_compat_cpowl'
static inline long double _Complex ctypes_compat_cpowl(long double _Complex x, long double _Complex z)
                                   ^
/usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes/ctypes_complex_compatibility.h:87:36: note: previous definition is here
static inline long double _Complex ctypes_compat_cpowl(long double _Complex x, long double _Complex z)
                                   ^
/usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes/ctypes_complex_compatibility.h:133:3: warning: implicit declaration of function 'caml_failwith' is invalid in C99 [-Wimplicit-function-declaration]
{ caml_failwith("ctypes: cpowl does not exist on current platform"); }
  ^
4 warnings and 3 errors generated.
gmake: *** [Makefile.rules:118: _build/src/ctypes/complex_stubs.o] Error 2
@yallop
Copy link
Owner

yallop commented Jul 24, 2019

This is a surprising message:

/usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes/ctypes_complex_compatibility.h:84:10: warning: implicitly declaring library function 'cexpl' with type '_Complex long double (_Complex long double)' [-Wimplicit-function-declaration]
{ return cexpl(z); }
         ^
/usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes/ctypes_complex_compatibility.h:84:10: note: include the header <complex.h> or explicitly provide a declaration for 'cexpl'

because there is already #include <complex.h> a few lines above the offending location.

@yallop
Copy link
Owner

yallop commented Jul 24, 2019

/usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes/ctypes_complex_compatibility.h:127:3: warning: implicit declaration of function 'caml_failwith' is invalid in C99 [-Wimplicit-function-declaration]
{ caml_failwith("ctypes: cexpl does not exist on current platform"); }
  ^
[...]
/usr/home/hannes/.opam/active/.opam-switch/build/ctypes.0.15.0/src/ctypes/ctypes_complex_compatibility.h:133:3: warning: implicit declaration of function 'caml_failwith' is invalid in C99 [-Wimplicit-function-declaration]
{ caml_failwith("ctypes: cpowl does not exist on current platform"); }
  ^

These ones should be fixed by #609.

@yallop
Copy link
Owner

yallop commented Jul 24, 2019

#610 aims to provide a full fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants