I'm installing CompCert C compiler as instructed here: https://compcert.org/man/manual002.html.
However I'm stuck at the stage where I "Run the configure script with appropriate options: ./configure [option …] target "
The console output is:
~/compcert/CompCert-3.8$ ./configure -use-external-MenhirLib x86_64-linux
Testing assembler support for CFI directives... yes
Testing linker support for '-no-pie' / '-nopie' option... yes, '-no-pie'
Testing Coq... version 8.11.0 -- good!
Testing OCaml... version 4.08.1 -- good!
Testing OCaml native-code compiler...yes
Testing OCaml .opt compilers... yes
Testing Menhir... version 20200123 -- good!
Error: cannot determine the location of the Menhir API library.
This can be due to an incorrect Menhir package.
Consider using the OPAM package for Menhir.
Testing GNU make... version 4.2.1 (command 'make') -- good!
One or several required tools are missing or too old. Aborting.
I'm running Ubuntu 20.04 LTS.
[Edit: I managed to run the ./configure. However I cannot reproduce the exact method how I did it. Now I'm stuck in a different part.]
Follow-up question:
When running make all I receive the following output:
/compcert/CompCert-3.8$ make all
make proof
make[1]: Entering directory '/home/user/compcert/CompCert-3.8'
COQC Axioms.v
Error: Can't find file ./Axioms.v
make[1]: *** [Makefile:226: Axioms.vo] Error 1
make[1]: Leaving directory '/home/user/compcert/CompCert-3.8'
make: *** [Makefile:155: all] Error 2
I fixed that problem by copying lib/Axiom.v to the root. The make all then complained about another library in lib/ so I moved a bunch of them until I received the following error:
~/compcert/CompCert-3.8$ make all
make proof
make[1]: Entering directory '/home/user/compcert/CompCert-3.8'
COQC Ordered.v
File "./Ordered.v", line 90, characters 16-19:
Error: The reference int was not found in the current environment.
make[1]: *** [Makefile:226: Ordered.vo] Error 1
make[1]: Leaving directory '/home/user/compcert/CompCert-3.8'
make: *** [Makefile:155: all] Error 2
And now I'm stuck once again.
It seems that you have an incorrect version of the menhirLib. See these lines in the configure script in the build system which lead to this error. I think the problem is that you installed a different version of menhirLib, possibly using your package manager.
I suggest you to run the following commands to install the latest menhirLib from the opam:
opam update
opam install menhir menhirLib
This should help.
Related
I'm trying to compile a pmars-0.9.2 game, but stumbled on an error while passing the test, after command make -j4:
make[2]: *** [extractor/CMakeFiles/extractor.dir/backoff_sampler.cc.o] Error 1
CMakeFiles/Makefile2:2561: recipe for target 'extractor/CMakeFiles/extractor.dir/all' failed
make[1]: *** [extractor/CMakeFiles/extractor.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2
Can you tell me which installation drivers are missing to successfully complete the compilation?
To view logs from an unpacked archived use command:
nano /home/user/Desktop/pmars-0.9.2/cdec/BUILDING
To build cdec, you'll need:
boost headers & boost program_options (you may need to install a package
like libboost-dev)
Instructions for building
1) Create a build directory and generate Makefiles using CMake
mkdir my_build
cd my_build
cmake ..
If the cmake command completes successfully, you can proceed. If you have
libraries (such as Boost) installed in nonstandard locations, you may need
to run cmake with special options like -DBOOST_ROOT=/path/to/boost.
2) Build
make -j 2
3) Test
make test
./tests/run-system-tests.pl
Here is aws-iot-device-sdk-embedded-C sample. But when I invoke make command I got error like:
~/environment/aws-iot-device-sdk-embedded-C/samples/linux/subscribe_publish_sample ((6c99912...)) $ make
make -C ../../../external_libs/mbedTLS
make[1]: Entering directory `/home/ec2-user/environment/aws-iot-device-sdk-embedded-C/external_libs/mbedTLS'
make[1]: *** No targets specified and no makefile found. Stop.
make[1]: Leaving directory `/home/ec2-user/environment/aws-iot-device-sdk-embedded-C/external_libs/mbedTLS'
make: *** [all] Error 2
How build and run this sample? (I am not C developer so please provide detailed answer if possible)
The reason is missing mbedTLS library.
Please go to:
/home/ec2-user/environment/aws-iot-device-sdk-embedded-C/external_libs/mbedTLS
and have a look at it's README:
# Copy source code for mbedTLS into this directory
#
# You'll need to download mbedTLS from the official ARMmbed repository and
# place the files here. We recommend that you pick the latest version of 2.16
# LTS release in order to have up-to-date security fixes.
It's been awhile since I've tried to do this, maybe 3 or 4 years already. It was largely trivial then, download the tarball. Open it up, configure, make, and make install.
I do have Xcode installed, and I have the Xcode command line tools as well. Up to date. But when I run make, it complains about "error.h file not found".
Given how Apple has since locked the operating system down, it's not as simple as symlinking a directory for the includes. Or, if it is, I can't figure out where to begin with that.
The project is unavailable with homebrew, or I'd be lazy and do that.
The output is as follows:
omelo:ccd2cue-0.5 john$ sudo make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in po
Making all in src
CC ccd2cue.o
ccd2cue.c:58:10: fatal error: 'error.h' file not found
#include <error.h>
^~~~~~~~~
1 error generated.
make[2]: *** [ccd2cue.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
What do I need to fix in my environment so that this can build?
I'm trying to use CBMC (C Bounded Model Checking: https://www.cprover.org/cbmc/) on open-source C projects from GitHub. For the purpose of this question, let's consider the following project: https://github.com/reubenhwk/radvd
The problem arises when I compile the project with gcc. I'm able to obtain the executable file on which call cbmc like
cbmc radvd
but I obtain the following error message:
CBMC version 5.8 64-bit x86_64 linux
failed to open input file radvd`
The reason should be the fact that I used gcc instead of goto-cc (as explained here: http://www.cprover.org/cprover-manual/goto-cc.html), so might it's unable to recognize the file.
I also tried to use goto-cc as explained in the previous link and in some example like http://www.cprover.org/goto-cc/examples/nanosat.html. However, since they are guided examples it seems to be easy to make cbmc work. When I do the same process with other project, like the linked one (radvd) and use goto-cc instead of gcc I obtain the following message when running make CC=goto-cc command:
make all-am
make[1]: Entering directory '/home/stefano/Documents/github/radvd'
YACC gram.c
updating gram.h
CC libradvd_parser_a-gram.o
/usr/include/stdlib.h:133:1: error: syntax error before 'strtof128'
PARSING ERROR
Makefile:941: recipe for target 'libradvd_parser_a-gram.o' failed
make[1]: *** [libradvd_parser_a-gram.o] Error 1
make[1]: Leaving directory '/home/stefano/Documents/github/radvd'
Makefile:755: recipe for target 'all' failed
make: *** [all] Error 2`
I'm currently using the version 5.8 of cbmc on a virtual Linux machine (Ubuntu 17.10).
Do you have any idea on how make it work?
Thank you
Iam trying to build a cross compiler using this tutorial:
http://wiki.osdev.org/OS_Specific_Toolchain
after succesfully building binutils,all-gcc,newlib
I am getting an error in the last part of make in build-gcc
checking for shl_load... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
Makefile:8970: recipe for target `configure-target-libstdc++-v3' failed
make[1]: *** [configure-target-libstdc++-v3] Error 1
make[1]: Leaving directory `/usr/src/build-gcc'
Makefile:870: recipe for target `all' failed
make: *** [all] Error 2
please help...
I don't know you configure command options. But if you have given --enable-language=c change it to --enable-languages=c. Or may be you are compiling bootstrap with languages c and c++. In which case this error occurs.
I ran into this issue when attempting to build a cross compiler for ARM. Eventually, switched to using crosstool-NG. It is a script that greatly simplifies the process. It worked like a charm for me.