Hi, I am trying to build proverif project with ocaml, but cannot get past this error. Iβve been searching for hours and cannot seem to find a solution . Any idea how?
It sounds like you are mixing two configurations of clang: one for iOS and another for macOS. Did you try to switch to an opam-managed version of OCaml?
Hi, Thank you for the reply. Iβm not so sure what you mean by that. All I did was opam install ocaml to install ocaml. What should I do after?
I guess that this failure happens when you are trying to build a ocaml-base-compiler
switch? Any way this error seems to indicate that you are missing a working C compiler on your system. (It might be useful to copy paste the whole configure output).
Yea I thought so too and I re installed my C compiler yet Iβm still getting the same error :/!
Heres the full log:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by OCaml configure 4.12.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure --prefix=/Users/tty/.opam/4.12.0 -C CC=cc ASPP=cc -c
---------
Platform.
---------
hostname = MacBook-Pro.local
uname -m = x86_64
uname -r = 20.5.0
uname -s = Darwin
uname -v = Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64
/usr/bin/uname -p = i386
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = Mach kernel version:
Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64
Kernel configured for up to 12 processors.
6 processors are physically available.
12 processors are logically available.
Processor type: x86_64h (Intel x86-64h Haswell)
Processors active: 0 1 2 3 4 5 6 7 8 9 10 11
Primary memory available: 32.00 gigabytes
Default processor set: 669 tasks, 3583 threads, 12 processors
Load average: 2.73, Mach factor: 9.26
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /Users/tty/.opam/4.12.0/bin
PATH: /path/to/gcc-4.9.2/bin/
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /Library/TeX/texbin
PATH: /Library/Apple/usr/bin
PATH: /Library/Frameworks/Mono.framework/Versions/Current/Commands
PATH: /Users/tty/Documents/flutter/bin
-----------
Core tests.
-----------
configure:2681: creating cache config.cache
configure:2755: Configuring OCaml version 4.12.0
configure:2949: checking build system type
configure:2963: result: x86_64-apple-darwin20.5.0
configure:2983: checking host system type
configure:2996: result: x86_64-apple-darwin20.5.0
configure:3016: checking target system type
configure:3029: result: x86_64-apple-darwin20.5.0
configure:3386: checking for ld
configure:3402: found /usr/bin/ld
configure:3413: result: ld
configure:3492: checking how to print strings
configure:3519: result: printf
configure:3588: checking for gcc
configure:3615: result: cc
configure:3844: checking for C compiler version
configure:3853: cc --version >&5
Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: x86_64-apple-darwin20.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
configure:3864: $? = 0
configure:3853: cc -v >&5
Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: x86_64-apple-darwin20.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
configure:3864: $? = 0
configure:3853: cc -V >&5
clang: error: argument to β-Vβ is missing (expected 1 value)
clang: error: no input files
configure:3864: $? = 1
configure:3853: cc -qversion >&5
clang: error: unknown argument β-qversionβ; did you mean ββversionβ?
clang: error: no input files
configure:3864: $? = 1
configure:3884: checking whether the C compiler works
configure:3906: cc conftest.c >&5
configure:3910: $? = 0
configure:3958: result: yes
configure:3961: checking for C compiler default output file name
configure:3963: result: a.out
configure:3969: checking for suffix of executables
configure:3976: cc -o conftest conftest.c >&5
configure:3980: $? = 0
configure:4002: result:
configure:4024: checking whether we are cross compiling
configure:4032: cc -o conftest conftest.c >&5
configure:4036: $? = 0
configure:4043: ./conftest
dyld: attempt to run simulator program outside simulator (DYLD_ROOT_PATH not set)
./configure: line 4045: 40215 Abort trap: 6 ./conftest$ac_cv_exeext
configure:4047: $? = 134
configure:4054: error: in /Users/tty/.opam/4.12.0/.opam-switch/build/ocaml-base-compiler.4.12.0': configure:4056: error: cannot run C compiled programs. If you meant to cross compile, use
βhostβ.
See `config.logβ for more details
----------------
Cache variables.
----------------
ac_cv_build=x86_64-apple-darwin20.5.0
ac_cv_env_ASPP_set=set
ac_cv_env_ASPP_value=βcc -cβ
ac_cv_env_AS_set=
ac_cv_env_AS_value=
ac_cv_env_CC_set=set
ac_cv_env_CC_value=cc
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_DEFAULT_STRING_set=
ac_cv_env_DEFAULT_STRING_value=
ac_cv_env_DLLIBS_set=
ac_cv_env_DLLIBS_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LT_SYS_LIBRARY_PATH_set=
ac_cv_env_LT_SYS_LIBRARY_PATH_value=
ac_cv_env_PARTIALLD_set=
ac_cv_env_PARTIALLD_value=
ac_cv_env_WINDOWS_UNICODE_MODE_set=
ac_cv_env_WINDOWS_UNICODE_MODE_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-apple-darwin20.5.0
ac_cv_prog_ac_ct_CC=cc
ac_cv_prog_ac_ct_LD=ld
ac_cv_target=x86_64-apple-darwin20.5.0
-----------------
Output variables.
-----------------
AR=ββ
AS=ββ
ASPP=βcc -cβ
AWK=ββ
CC=βccβ
CFLAGS=ββ
CONFIGURE_ARGS=ββprefix=/Users/tty/.opam/4.12.0 -C CC=cc ASPP=cc -cβ
CPP=ββ
CPPFLAGS=ββ
DEFAULT_STRING=ββ
DEFS=ββ
DEP_CC=ββ
DIRECT_CPP=ββ
DIRECT_LD=ββ
DLLIBS=ββ
DLLTOOL=ββ
DSYMUTIL=ββ
DUMPBIN=ββ
ECHO_C=β\cβ
ECHO_N=ββ
ECHO_T=ββ
EGREP=ββ
EXEEXT=ββ
FGREP=ββ
GREP=ββ
INSTALL_DATA=ββ
INSTALL_PROGRAM=ββ
INSTALL_SCRIPT=ββ
LD=βldβ
LDFLAGS=ββ
LIBOBJS=ββ
LIBS=ββ
LIBTOOL=ββ
LIPO=ββ
LN_S=ββ
LTLIBOBJS=ββ
LT_SYS_LIBRARY_PATH=ββ
MANIFEST_TOOL=ββ
NM=ββ
NMEDIT=ββ
OBJDUMP=ββ
OBJEXT=ββ
OTOOL64=ββ
OTOOL=ββ
PACKAGE_BUGREPORT=βcaml-list@inria.frβ
PACKAGE_NAME=βOCamlβ
PACKAGE_STRING=βOCaml 4.12.0β
PACKAGE_TARNAME=βocamlβ
PACKAGE_URL=βhttp://www.ocaml.orgβ
PACKAGE_VERSION=β4.12.0β
PACKLD=ββ
PARTIALLD=ββ
PATH_SEPARATOR=β:β
PTHREAD_CC=ββ
PTHREAD_CFLAGS=ββ
PTHREAD_LIBS=ββ
RANLIB=ββ
RANLIBCMD=ββ
S=βsβ
SED=β/usr/bin/sedβ
SHELL=β/bin/shβ
SO=βsoβ
STRIP=ββ
SYSTEM_AS=ββ
VERSION=β4.12.0β
WINDOWS_UNICODE_MODE=ββ
ac_ct_AR=ββ
ac_ct_CC=βccβ
ac_ct_DEP_CC=ββ
ac_ct_DUMPBIN=ββ
ac_ct_LD=βldβ
ac_tool_prefix=ββ
afl=ββ
arch64=ββ
arch=βundefined_archβ
as_has_debug_prefix_map=ββ
asm_cfi_supported=ββ
ax_pthread_config=ββ
bindir=β${exec_prefix}/binβ
build=βx86_64-apple-darwin20.5.0β
build_alias=ββ
build_cpu=βx86_64β
build_os=βdarwin20.5.0β
build_vendor=βappleβ
bytecclibs=ββ
cc_has_debug_prefix_map=ββ
ccomptype=βccβ
cmxs=ββ
compute_deps=ββ
datadir=β${datarootdir}β
datarootdir=β${prefix}/shareβ
debug_runtime=ββ
default_safe_string=ββ
docdir=β${datarootdir}/doc/${PACKAGE_TARNAME}β
dvidir=β${docdir}β
endianness=ββ
exec_prefix=βNONEβ
exeext=ββ
extralibs=ββ
flambda=ββ
flambda_invariants=ββ
flat_float_array=ββ
flexdll_chain=ββ
flexlink_flags=ββ
force_safe_string=ββ
fpic=ββ
frame_pointers=ββ
function_sections=ββ
has_monotonic_clock=ββ
host=βx86_64-apple-darwin20.5.0β
host_alias=ββ
host_cpu=βx86_64β
host_os=βdarwin20.5.0β
host_vendor=βappleβ
htmldir=β${docdir}β
iflexdir=ββ
includedir=β${prefix}/includeβ
infodir=β${datarootdir}/infoβ
install_bytecode_programs=ββ
install_source_artifacts=ββ
instrumented_runtime=βfalseβ
libdir=β${exec_prefix}/libβ
libexecdir=β${exec_prefix}/libexecβ
libext=ββ
libraries_man_section=β3β
localedir=β${datarootdir}/localeβ
localstatedir=β${prefix}/varβ
long_shebang=ββ
mandir=β${datarootdir}/manβ
mkexe=β$(CC) $(OC_CFLAGS) $(CFLAGS) $(OC_LDFLAGS)β
mkexedebugflag=β-gβ
mklib=ββ
mkmaindll=ββ
mksharedlib=ββ
mksharedlibrpath=ββ
model=ββ
naked_pointers=ββ
naked_pointers_checker=ββ
natdynlink=ββ
natdynlinkopts=ββ
native_compiler=ββ
nativecclibs=ββ
oc_cflags=ββ
oc_cppflags=ββ
oc_dll_ldflags=ββ
oc_ldflags=ββ
ocamlc_cflags=ββ
ocamlc_cppflags=ββ
ocamldoc=βautoβ
ocamltest=ββ
oldincludedir=β/usr/includeβ
otherlibraries=ββ
outputexe=β-o $(EMPTY)β
outputobj=ββ
pdfdir=β${docdir}β
prefix=β/Users/tty/.opam/4.12.0β
profinfo=βfalseβ
profinfo_width=β0β
program_transform_name=βs,x,x,β
programs_man_section=β1β
psdir=β${docdir}β
pthread_link=ββ
rlwrap=ββ
rpath=ββ
sbindir=β${exec_prefix}/sbinβ
sharedlib_cflags=ββ
sharedstatedir=β${prefix}/comβ
shebangscripts=ββ
stdlib_manpages=ββ
supports_shared_libraries=ββ
sysconfdir=β${prefix}/etcβ
syslib=β-l$(1)β
system=ββ
systhread_support=ββ
target=βx86_64-apple-darwin20.5.0β
target_alias=ββ
target_cpu=βx86_64β
target_os=βdarwin20.5.0β
target_vendor=βappleβ
toolchain=βccβ
unix_or_win32=ββ
unixlib=ββ
windows_unicode=ββ
with_camltex=βtrueβ
with_debugger=ββ
x_includes=βNONEβ
x_libraries=βNONEβ
-----------
confdefs.h.
-----------
/* confdefs.h */
#define PACKAGE_NAME βOCamlβ
#define PACKAGE_TARNAME βocamlβ
#define PACKAGE_VERSION β4.12.0β
#define PACKAGE_STRING βOCaml 4.12.0β
#define PACKAGE_BUGREPORT βcaml-list@inria.frβ
configure: exit 1
It appears youβre trying to build this βmanuallyβ. Have you tried doing it thru opam? That is to say, setting up opam in the completely standard way and then installing proverif with it?
I might also suggest that you might want to figure out how to use docker on macos, to build proverif in the most-standard way β the one that is used for all the CI runs on macos.
The goal of these two things, would be to try to figure out whatβs wrong with the way youβre building proverif2. I donβt know if it builds on macos, but from the opam file, I see no reason why it would not.
Thank you for the reply! so I reinstalled my opam and set it up in the standard way, then I did opam install proverif, but the same original build issue came up Screen Shot 2021-08-19 at 1.46.54 pm|690x495 Of all the solution I found online related to this problem is to change a certain setting in xcode, but I couldnt find any xcode project file to open and changeβ¦
Iβm a UNIX jock, and even though macos is based on UNIX, itβs different-enough that maybe my instincts arenβt useful. Looking at your screenshot, I notice that
- your opam switch is ~/.opam/default
- but youβre using ocaml .o files from /usr/local/lib
I suspect that this means you have another ocaml installation, and itβs on some of your search paths. Can I suggest you uninstall that ocaml? Or at least, make sure that no paths to that installation (not to /usr/local/bin nor /usr/local/lib/ocaml) are in your environment? I really do think the best way is to just uninstall it.
You donβt have to have ocaml installed, to set up opam: there are prebuilt binaries, and Iβve used those successfully on (e.g.) a Chromebook.
Does this make sense?
I followed your suggestion and I tried to reinstall ocaml but it didnβt work, so I uninstalled opam entirely then did opam install proverif again, and now Iβm back to the c compiler issue But my gcc is installed and functional.
OK, that isnβt how Iβve ever installed ocaml with opam. The standard method is:
-
opam init
β this will set up a directory, build a default ocaml switch - then
opam switch create 4.12.0
(or whatever version you want) - then
opam switch 4.12.0
(this switches to that version, in the event that you werenβt already there) - itβll put out a little helpful line
# Run eval $(opam env) to update the current shell environment
and you run that to make sure you environment variables are all OK.
THEN, you should be able to install various opam packages β donβt do proverif first, try some others. Only after you know you have a working opam installation with a working switch, should you try to install proverif.
There are instructions in the opam documentation for what to put in your dot.bashrc β if you have trouble with that, I can give you mine, but really, those instructions should be adequate.
It works now! Thank you so much!
Glad to be of help. I thought I should suggest that you
- try to build OCaml manually yourself (unless you already have)
- try to build proverif manually also
The reason is β¦ well, let me put it this way:
when I started working with Linux, there were really no βinstallersβ. Or at least, not for the hardware I used. So we did a lot manually. Stuff like futzing around with UMSDOS and other craziness. And as installers for (e.g.) Debian arose, I kept on doing it the manual way for a long time. B/c I felt that knowing the details of how my operating system was installed was important to being a systems programmer.
Eventually, after Ubuntu became really prevalent, I stopped. But I think that regularly dipping below the βpretty wrapperβ to understand how software is built, is a useful habit, and a mostly-painfree way of becoming skilled in debugging build-failures and such.
Just a thought.
P.S. I realize that this thread started from your trying to build proverif manually. What I mean now, is that (a) having installed opam+switch properly, the previous error might disappear, and (b) Now you have a correct build you can look at (including build-logs that you can save from the install and inspect) to guide you.