Does anyone have installed Frama-C on Mavericks ?
Because i can't install it or do not know how to install it (Gui Version)!
I already installed ocaml on my pc, but for the Gui version i need to install these libraries : Gtk, GtkSourceView, GnomeCanvas and Lablgtk2.
So i saw a previous post and did that :
export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig
sudo port install opam
opam init
Y
eval `opam config env`
sudo port install gtksourceview2 lablgtk2 ocaml-ocamlgraph
opam install frama-c
Im' having a problem in making "make" with frama-c which is :
Ocamlc src/logic/property_status.cmo
File "src/logic/property_status.ml", line 1444, characters 4-2027:
Error: Signature mismatch:
...
Values do not match:
val vertex_attributes :
v ->
[> `Color of int
| `Label of string
| `Shape of [> `Box | `Diamond ]
| `Style of [> `Bold | `Filled ] list
| `Width of float ]
list
is not included in
val vertex_attributes :
V.t -> Graph.Graphviz.DotAttributes.vertex list
File "src/logic/property_status.ml", line 1479, characters 16-33:
Actual declaration
make: *** [src/logic/property_status.cmo] Error 2
How am i able to solve this ?
i've just successfully installed Frama-c neon (with Gui) on maverick, using opam and homebrew.
here's my walkthrough. (Thanks to tips above)
1) Install homebrew
$ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
2) Install opam:
$ brew install opam
$ opam init
(i had to modify .profile instead of .bashrc with f option)
$ eval `opam config env`
3) Install all dependencies
$ brew install gtk+
$ brew install gtksourceview
$ brew install libgnomecanvasmm libgnomecanvas
$ brew install lablgtk
4) Install Frama-c
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
$ opam install frama-c
If you prefer install dependencies with macports, change the PKG_CONFIG_PATH to /opt/X11/lib/pkgconfig as explained here
Hope this help
I have successfully installed frama-c Neon with gui on mavericks using brew to get all the dependencies and using the source code in http://frama-c.com/download.html . If you try to do it using brew, you should install lablgtk from this repository(https://github.com/mht208/homebrew-formal) and only after all the other dependencies so the commands to install with gui would be(in source folder):
brew install ocaml
brew install gtk
brew install gtksourceview
brew install gnomecanvasmm gnomecanvas
brew tap mht208/formal
brew install lmht208/formal/lablgtk -with-gnomecanvas -with-gtksourceview2
./configure
make
You can also install ocamlgraph with opam, and you can compile Zarith and install in your system.
Graph.Graphviz is from OCamlGraph. There seems to be an incompatibility between the two latest versions of each.
You'll have to add version contraints on the frama-c library, or change the Style attribute to have a list of the polymorphic variant set.
EDIT -
you don't need to install ocamlgraph via port, you should install that by opam as well.
Related
I've installed this compiler before in a docker container, but I don't understand why it's missing right now. Command and error:
(iit_synthesis) brando9~ $ opam switch create ocaml-variants.4.07.1+flambda_coq-serapi.8.11.0+0.11.1 ocaml-variants.4.07.1+flambda
[ERROR] No compiler matching `ocaml-variants.4.07.1+flambda' found, use `opam switch list-available' to see what is available, or use `--packages' to
select packages explicitly.
but it's not in the list:
(iit_synthesis) brando9~ $ opam switch list-available
# Listing available compilers from repositories: default
# Name # Version # Synopsis
ocaml-option-32bit 1 Set OCaml to be compiled in 32-bit mode for 64-bit Linux and OS X hosts
ocaml-option-flambda 1 Set OCaml to be compiled with flambda activated
ocaml-option-nnpchecker 1 Set OCaml to be compiled with --enable-naked-pointers-checker
ocaml-option-spacetime 1 Set OCaml to be compiled with spacetime activated
ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled
Opam update fails
Output:
$ opam update --all
<><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><>
Processing 1/1: [default: http]
Processing 1/1: [default: http]
[default] synchronised from https://opam.ocaml.org
[ERROR] Could not update repository "default": "~/anaconda/bin/patch -p1 -i /dfs/scratch0/brando9/.opam/log/patch-99014-0624b6" exited with code 2
I probably should have started with this but I installed opam with "manually" with deb because I don't have sudo. In particular I did this:
# - opam (snap, no sudo)
# ref: https://askubuntu.com/questions/339/how-can-i-install-a-package-without-root-access
apt-get download opam
#apt-get download opam_1.2.2-4_amd64
# manually checked the opam name
#ls | less
mkdir -p ~/.local
dpkg -x opam_1.2.2-4_amd64.deb ~/.local/bin
export PATH="$HOME/.local/bin:$PATH"
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc.user
source ~/.bashrc.user
tr ':' '\n' <<< "$PATH"
opam --version
before that I did try installing opam with conda (which has worked in the past) but it failed. I wonder if that screwed things up :/. Will try to reproduce to post the conda error. But I ran conda install -c conda-forge opam.
related:
How to install a specific version of ocaml compiler with opam
https://discuss.ocaml.org/t/why-doesnt-my-server-show-the-ocaml-compiler-that-i-need/10917
https://www.reddit.com/r/ocaml/comments/zed88p/how_does_one_install_a_specific_ocaml_compiler/
How does one install opam without sudo priveledges on linux/ubuntu?
As the title said I can't install that specific version of g++ in my current ubuntu (20.04).
I have been trying the usual things as: sudo apt install g++- (and displaying all posibilities but there where only versions from 8 to 10). Same happend looking for gcc possibilities.
Also tried this: gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91 (same problem)
And after looking for a while I gave up in my research and ended up here. Hope someone with more wisdom than me can give my a hand with this.
These steps should work:
sudo dpkg --add-architecture i386
sudo apt update
sudo apt upgrade
sudo apt-get install gcc-multilib libstdc++6:i386
wget https://ftp.gnu.org/gnu/gcc/gcc-4.8.5/gcc-4.8.5.tar.bz2 --no-check-certificate
tar xf gcc-4.8.5.tar.bz2
# cd gcc-4.8.5
# ./contrib/download_prerequisites
# cd ..
sed -i -e 's/__attribute__/\/\/__attribute__/g' gcc-4.8.5/gcc/cp/cfns.h
sed -i 's/struct ucontext/ucontext_t/g' gcc-4.8.5/libgcc/config/i386/linux-unwind.h
mkdir xgcc-4.8.5
pushd xgcc-4.8.5
$PWD/../gcc-4.8.5/configure --enable-languages=c,c++ --prefix=/usr --enable-shared --enable-plugin --program-suffix=-4.8.5
make MAKEINFO="makeinfo --force" -j
sudo make install -j
Note that you have to uncomment the .../download_prerequisites on some platform. For me it worked without on Centos 7 or Ubuntu 20 with the mandatory packages installed:
Ubuntu/Debian:
sudo apt install make wget git gcc g++ lhasa libgmp-dev libmpfr-dev libmpc-dev flex bison gettext texinfo ncurses-dev autoconf rsync
Centos:
sudo yum install wget gcc gcc-c++ python git perl-Pod-Simple gperf patch autoconf automake make makedepend bison flex ncurses-devel gmp-devel mpfr-devel libmpc-devel gettext-devel texinfo
Few seconds later (/giggles) gcc-4.8.5 is installed and available.
Notes:
if you don't have the resources to run make -j omit -j or use -j4 (or a different number which is adequate for your system)
your milage may vary and you may need to install further i386 packages
Since I can't comment I will add to #bebbo solution that on an Ubuntu 20.04 I had to add to his steps patching the following patches:
Add an include to signal.h to libsanitizer/asan/asan_linux.cc
https://patchwork.ozlabs.org/project/gcc/patch/6824253.3U2boEivI2#devpool21/
change a line in libsanitizer/tsan/tsan_platform_linux.cc
as shown. line number may not be the one stated in the patch so search for the line that was changed. There is no need to apply the patch to the other files
https://git.pantherx.org/mirror/guix/commit/0b93d04ac537d6413999349ebe7cdcb1e961700e
Adding to kpeace's answer...
sed -i '/#include <pthread.h>/a #include <signal.h>' path_to_gcc4.8.5src/libsanitizer/asan/asan_linux.cc
sed -i 's/__res_state \\*statp = (__res_state\\*)state\\;/struct __res_state \\*statp = (struct __res_state\\*)state\\;/g' path_to_gcc4.8.5src/libsanitizer/tsan/tsan_platform_linux.cc
Just adding a couple of sed lines to patch them inline.
Also, I've been writing some Ruby scripts to install some software (for fun of course.) I've recently successfully compiled gcc-4.8.5 under LinuxMint 20.1 (Ubuntu 20.04 based, compiler is the system gcc: 9.3.0, installed with sudo apt install build-essential) with this script. Also, I've installed all the packages that Bebbo suggested, including gcc-multilib and libstdc++6:i386 before running this script. Check up InstGcc4 class at the bottom of the code.
install_gcc.rb
They might end up to be 'un-installable' state a few months later. But at least gcc-4.8.5 works now.
ps. I've started to compile this old gcc due to CUDA... My hardware is a decade old GeForce 9600/9400 (yeah 2008 MBP) and CUDA 6.5 was the best option for that machine.
pps. Anyway, strange thing is, I had to give out '-std=gnu++11' for CXXFLAGS to avoid errors.
I have a Homebrew cask installed which, when I attempt to uninstall it gives me an error:
$ brew cask uninstall julia
Error: Cask 'julia' definition is invalid: invalid 'depends_on macos' value: ":lion"
This leaves me unable to use brew to remove the files installed by the cask or undo the other changes the cask installation processes made.
How do I manually remove a cask, and reverse the ranges that were made when it was installed?
$ brew cask info julia
julia: 1.1.0
https://julialang.org/
/usr/local/Caskroom/julia/0.5.0 (64B)
From: https://github.com/Homebrew/homebrew-cask/blob/master/Casks/julia.rb
==> Name
Julia
==> Artifacts
Julia-1.1.app (App)
/Applications/Julia-1.1.app/Contents/Resources/julia/bin/julia (Binary)
$ brew cask outdated julia
julia (0.5.0) != 1.1.0
brew cask reinstall julia
==> Satisfying dependencies
==> Downloading https://julialang-s3.julialang.org/bin/mac/x64/1.1/julia-1.1.0-mac64.dmg
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'julia'.
Error: Cask 'julia' definition is invalid: invalid 'depends_on macos' value: ":lion"
I had this problem, and was able to manage it by running the command in the first post at https://github.com/Homebrew/homebrew-cask/issues/58046 -- which is:
/usr/bin/find "$(brew --prefix)/Caskroom/"*'/.metadata' -type f -name '*.rb' -print0 | /usr/bin/xargs -0 /usr/bin/perl -i -pe 's/depends_on macos: \[.*?\]//gsm;s/depends_on macos: .*//g'
According to that post:
This will remove all depends_on macos references of installed casks
(where it doesn’t matter anymore anyway).
Try updating it, cleaning it, then forcing the uninstall.
brew update
brew cleanup
rm -rf /opt/homebrew-cask/Caskroom/julia
You may need to use sudo to get the last one to work
I installed opam with homebrew on Mac OS X 10.10. But I can't install anything using opam. This is an example error output that get when I try to install ocamlfind:
# opam-version 1.2.0
# os darwin
# command ./configure -bindir /Users/roger/.opam/system/bin -sitelib /Users/roger/.opam/system/lib -mandir /Users/roger/.opam/system/man -config /Users/roger/.opam/system/lib/findlib.conf -no-topfind
# path /Users/roger/.opam/system/build/ocamlfind.1.5.5
# compiler system (4.02.1)
# exit-code 1
# env-file /Users/roger/.opam/system/build/ocamlfind.1.5.5/ocamlfind-91360-c61e7b.env
# stdout-file /Users/roger/.opam/system/build/ocamlfind.1.5.5/ocamlfind-91360-c61e7b.out
# stderr-file /Users/roger/.opam/system/build/ocamlfind.1.5.5/ocamlfind-91360-c61e7b.err
### stdout ###
# ...[truncated]
# Configuration for str written to site-lib-src/str/META
# Configuration for threads written to site-lib-src/threads/META
# Configuration for unix written to site-lib-src/unix/META
# Configuration for stdlib written to site-lib-src/stdlib/META
# Configuration for bigarray written to site-lib-src/bigarray/META
# Configuration for camlp4 written to site-lib-src/camlp4/META
# Configuration for ocamlbuild written to site-lib-src/ocamlbuild/META
# Configuration for compiler-libs written to site-lib-src/compiler-libs/META
# Configuration for bytes written to site-lib-src/bytes/META
# Detecting compiler arguments: FAILED (see the file ocargs.log for details)
### stderr ###
# ./configure: line 547: cd: src: No such file or directory
brew install opam
opam init --comp=4.02.1
eval `opam config env`
ocaml
Update:
Sometimes brewed opam can fail with Illegal Instruction, in that case you need to reinstall opam from sources:
brew reinstall --build-from-source opam
Also, you need a working toolchain, i.e., compiler, autotools and other developer tools. You can try to install it using brew, e.g., brew install autotools, etc. Or you can try to install xcode toolchain, including apple command line developer tools.
I had the same problem trying to install mirage, the problem is because the current directory is not in the CDPATH by default on macOS X. The posix /bin/sh will not "cd src" though can "cd ./src". The quick fix is to do the following before running opam (or just put it in your .bash_profile.
export CDPATH=.
opam install WHATEVER
While installing utop via opam on my ArchLinux laptop, I got the following message:
$ opam install utop
The following actions will be performed:
- install camomile.0.8.5 [required by utop]
- install zed.1.3 [required by utop]
- install lambda-term.1.6 [required by utop]
- install utop.1.14
4 to install | 0 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove
Do you want to continue ? [Y/n]
=-=-= Installing camomile.0.8.5 =-=-=
Applying cmxs.patch.
[ERROR] Due to some errors while processing camomile.0.8.5, the following actions will NOT proceed:
- install utop.1.14
- install lambda-term.1.6
- install zed.1.3
===== ERROR while installing camomile.0.8.5 =====
Could not get the source for camomile.0.8.5:
# opam-version 1.1.1
# os linux
Patch file "/home/sinan/.opam/system/build/camomile.0.8.5/cmxs.patch" not found.
'opam install utop' failed.
Trying to install camomile by itself also gives the same error. This seems to be related to commit 672e44e which carried over to the opam repository as cmxs.patch. I am not sure where things break so that opam tries to build without the patch file.
I tried downloading, and putting cmxs.patch in the reported location, but, of course, that directory gets clobbered the next time I try to install via opam.
How should I proceed?
I would have preferred to have been able to fix the underlying problem, but, in the end, downloading the contents of the cmxs.patch file, adding it to the already downloaded ~/.opam/archives/camomile.0.8.5+opam.tar.gz archive, and then issuing
$ opam install camomile
worked.
After that, opam install utop went without a hitch as well.
For your reference, I have:
$ opam --version
1.1.1
$ cat .opam/repo/default/repo
upstream: "https://github.com/ocaml/opam-repository/tree/master/"
browse: "https://opam.ocaml.org/pkg/"