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

frama-clang failed to install #22

Closed
ainne26 opened this issue Jul 4, 2019 · 11 comments

Comments

Projects
None yet
3 participants
@ainne26
Copy link

commented Jul 4, 2019

Hi,
I'm trying to install the Frama-Clang plugin on windows 10 following the instruction on the website. But the command

./configure

failed to execute and the messages are shown below:

$ ./configure
checking for frama-c-gui... yes
checking for Makefile.config.in... yes
frama_clang... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for camlp4o... yes
checking for clang... clang
checking for clang++... clang++
checking for llvm-config... llvm-config
checking for D:\llvm-project-master\llvm\build\Debug/include/clang... no
configure: WARNING: frama_clang disabled because clang dev headers not found.
configure: frama_clang: no
configure: creating ./config.status
config.status: creating ./Makefile.config
chmod: ./Makefile.config: new permissions are r--rw-r--, not r--r--r--`

I don't know how to solve this problem, any suggestions?

@vprevosto

This comment has been minimized.

Copy link
Member

commented Jul 4, 2019

Have you checked that the directory D:\llvm-project-master\llvm\build\Debug/include/clang indeed exists? If yes, then there's probably an issue in the way the configure script creates the path (notably the mix of \ and / might cause problems at some point).

@ainne26

This comment has been minimized.

Copy link
Author

commented Jul 4, 2019

yes the path exists but the path is D:\llvm-project-master\llvm\build\Debug\lib\clang this one which is different from the above
so what can I do now?

@vprevosto

This comment has been minimized.

Copy link
Member

commented Jul 4, 2019

If you have the possibility to use Windows Subsystem for Linux, I'd suggest to take this route (see also this blog post). Installing Ubuntu 18.04 for WSL will then get you an appropriate base system. Then, after having done the initial configuration (basically the application will ask you with username and password), the following commands should get you a running frama-c with frama-clang:

sudo apt-get update # update package list
sudo apt-get dist-upgrade # ensure everything is up-to-date
sudo apt-get install ocaml-nox m4 make unzip # packages for installing opam
sudo apt-get install clang libclang-dev llvm-dev # packages for installing frama-clang
sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) # opam 2.0 installation
opam init --disable-sandboxing # sandboxing unsupported under WSL
eval $(opam env) # as suggested by opam init
opam install depext # helper package
opam depext frama-c # install all Ubuntu packages needed for Frama-C
opam pin add frama-c 17.1 # frama-clang has yet to be upgraded to 18.0 and 19.0
curl http://frama-c.com/downloads/frama-clang-0.0.6.tar.gz --output frama-clang-0.0.6.tar.gz # get sources
tar xzvf frama-clang-0.0.6.tar.gz # extract archive and launch compilation
cd frama-clang.tar.gz
./configure
make
make install

If installing WSL is not an option, we will need more information on the exact setup you're using (in particular, are you using cygwin or a native Windows shell and how did you install Frama-C and clang/llvm). Notably, the last / in the incriminated path is an issue of the ./configure script itself, but not the first one (before include), which comes readily from llvm-config, thus will possibly be more difficult to fix from within frama-clang

@ainne26

This comment has been minimized.

Copy link
Author

commented Jul 4, 2019

I am using OCaml64 , install frama-c using opam and clang/llvm are installed using cmake and visual studio 2017

@ainne26

This comment has been minimized.

Copy link
Author

commented Jul 5, 2019

I have also tried on ubuntu but

sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) # opam 2.0 installation
opam init --disable-sandboxing # sandboxing unsupported under WSL
eval $(opam env) 
opam pin add frama-c 17.1 # frama-clang has yet to be upgraded to 18.0 and 19.0
curl http://frama-c.com/downloads/frama-clang-0.0.6.tar.gz --output frama-clang-0.0.6.tar.gz # get source

these command include errors or not working

@vprevosto

This comment has been minimized.

Copy link
Member

commented Jul 5, 2019

Sorry if this wasn't clear, but the on each line above, everything that follows the # is in fact a comment (that said, the shell from Ubuntu should take care of that). That said, if you could provide the complete log of the first command that fails[1], it would be easier to understand where the problem lies.

[1] In particular, if the sh <(curl ...) which is supposed to take care of the installation of opam does not succeed, any subsequent command invoking opam will fail

@ainne26

This comment has been minimized.

Copy link
Author

commented Jul 5, 2019

when I run ~$ sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) the following output comes. I do not understand how to resolve it

~$ sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)
`## Using` already downloaded "/tmp/opam-2.0.4-x86_64-linux"`
## Where should it be installed ? [/usr/local/bin] 
Write access to /usr/local/bin required, using 'sudo'.
Command: install -m 755 /tmp/opam-2.0.4-x86_64-linux /usr/local/bin/opam
## opam 2.0.4 installed to /usr/local/bin
## Remember to add /usr/local/bin to your PATH
## Run this script again with '--restore ' to revert.

@maroneze

This comment has been minimized.

Copy link
Member

commented Jul 5, 2019

That output means that opam 2.0.4 (which should work ok) has been installed. Running opam --version should output 2.0.4. Do you get that message? If so, then opam installation is fine, you can proceed from there (opam init --disable-sandboxing, then the rest of the commands).

If there is something wrong, it happens after those lines, so we need more information. The lines you posted do not indicate an error, just that you are installing opam again.

@ainne26

This comment has been minimized.

Copy link
Author

commented Jul 7, 2019

All commands run successfully
but when I check frama-c -plugins then frama-clang is not present there.
when I configiure frama-clang following output comes

~/frama-clang-0.0.6$ ./configure
checking for frama-c-gui... yes
checking for Makefile.config.in... yes
frama_clang... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for camlp4o... yes
checking for clang... clang
checking for clang++... clang++
checking for llvm-config... llvm-config
checking for /usr/lib/llvm-6.0/include/clang... yes
checking LLVM version... 6.0.0: Good
configure: frama_clang: yes
configure: creating ./config.status
config.status: creating ./Makefile.config

when make and make install run following output comes

~/frama-clang-0.0.6$ make
make[1]: Entering directory '/home/ainne/frama-clang-0.0.6'
make[1]: Leaving directory '/home/ainne/frama-clang-0.0.6'
ainne@ainne-virtual-machine:~/frama-clang-0.0.6$ make install
Copying to   /home/ainne/.opam/system/lib/frama-c/plugins
Copying to   /home/ainne/.opam/system/bin
BINDIR is /home/ainne/.opam/system/bin
make[1]: Entering directory '/home/ainne/frama-clang-0.0.6'
Installing   framaCIRGen
make[1]: Leaving directory '/home/ainne/frama-clang-0.0.6'

I do not understand where the problem is .
Please give me suggestions about this.

@vprevosto

This comment has been minimized.

Copy link
Member

commented Jul 8, 2019

the output of make in frama-clang-0.0.6 indeed indicates that a previous compilation was successful (hence that make has nothing left to do). Then, the output of make install looks normal as well. Can you provide the output of frama-c -kernel-msg-key dynlink -plugins ?

@ainne26

This comment has been minimized.

Copy link
Author

commented Jul 8, 2019

Thank You So much Sir for your guidance.
My issue is resolved.

@maroneze maroneze closed this Jul 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.