How does one install a new version of Coq when it cannot find the repositories in a new Mac M1 machine? - coq

I got a new machine (mac book m1, not sure if it matters) and I noticed I didn't have Coq:
(base) brandomiranda~ โฏ coqc -v
zsh: command not found: coqc
So I went to the instructions to download coq (https://coq.inria.fr/opam-using.html). Some part of it seems to work:
(base) brandomiranda~ โฏ opam init
eval $(opam env)
<><> Required setup - please read <><><><><><><><><><><><><><><><><><><><><> ๐Ÿซ
In normal operation, opam only alters files within ~/.opam.
However, to best integrate with your system, some environment variables
should be set. If you allow it to, this initialisation step will update
your zsh configuration by adding the following line to ~/.zshrc:
[[ ! -r /Users/brandomiranda/.opam/opam-init/init.zsh ]] || source /Users/brandomiranda/.opam/opam-init/init.zsh > /dev/null 2> /dev/null
Otherwise, every time you want to access your opam installation, you will
need to run:
eval $(opam env)
You can always re-run this setup with 'opam init' later.
Do you want opam to modify ~/.zshrc? [N/y/f]
(default is 'no', use 'f' to choose a different file) y
A hook can be added to opam's init scripts to ensure that the shell remains in sync with the opam environment when they are loaded. Set that up? [y/N] y
User configuration:
Updating ~/.zshrc.
but then when I go get and pin coq opam can't find it:
(base) brandomiranda~ โฏ opam pin add coq 8.15.0
[ERROR] Package coq has no known version 8.15.0 in the repositories
anyone know what is going on? Seems puzzling.
cross: https://coq.discourse.group/t/how-to-install-coq-when-it-says-the-repository-cannot-be-found/1562
https://github.com/coq/platform/issues/219
Getting this issue now:
(base) brandomiranda~ โฏ opam upgrade
[WARNING] Upgrade is not possible because of conflicts or packages that are no longer available:
- Missing dependency:
- ocaml-base-compiler = 4.07.0
unmet availability conditions: '!(os = "macos" & arch = "arm64")'
You may run "opam upgrade --fixup" to let opam fix the current state.
(base) brandomiranda~ โฏ opam upgrade --fixup
[ERROR] It appears that the switch invariant is no longer satisfiable. Either fix the package prerequisites or change the invariant with 'opam switch set-invariant'.
* Missing dependency:
- ocaml-base-compiler = 4.07.0
unmet availability conditions: '!(os = "macos" & arch = "arm64")'
No solution found, exiting
(base) brandomiranda~ โฏ opam remove ocaml-base-compiler
* Missing dependency:
- ocaml-base-compiler = 4.07.0
unmet availability conditions: '!(os = "macos" & arch = "arm64")'
No solution found, exiting
also:
(base) brandomiranda~ โฏ opam info coq
<><> coq: information on all versions <><><><><><><><><><><><><><><><><><><> ๐Ÿซ
name coq
all-versions 8.3 8.4pl1 8.4pl2 8.4pl4 8.4.5 8.4.6~camlp4 8.4.6 8.5.0~camlp4 8.5.0 8.5.1 8.5.2~camlp4 8.5.2 8.5.3 8.6 8.6.1 8.7.0 8.7.1 8.7.1+1 8.7.1+2 8.7.2
8.8.0 8.8.1 8.8.2 8.9.0 8.9.1 8.10.0 8.10.1 8.10.2 8.11.0 8.11.1 8.11.2 8.12.0 8.12.1 8.12.2 8.13.0 8.13.1 8.13.2 8.14.0 8.14.1 8.15.0
<><> Version-specific details <><><><><><><><><><><><><><><><><><><><><><><> ๐Ÿซ
version 8.15.0
repository default
url.src "https://github.com/coq/coq/archive/refs/tags/V8.15.0.tar.gz"
url.checksum "sha256=73466e61f229b23b4daffdd964be72bd7a110963b9d84bd4a86bb05c5dc19ef3"
homepage "https://coq.inria.fr/"
bug-reports "https://github.com/coq/coq/issues"
dev-repo "git+https://github.com/coq/coq.git"
authors "The Coq development team, INRIA, CNRS, and contributors."
maintainer "coqdev#inria.fr"
license "LGPL-2.1-only"
depends "ocaml" {>= "4.05.0"}
"ocamlfind" {build}
"dune" {>= "2.5.1"}
"conf-findutils" {build}
"zarith" {>= "1.10"}
depopts "coq-native"
conflicts "base-nnp" "ocaml-option-nnpchecker"
synopsis Formal proof management system
description The Coq proof assistant provides a formal language to write
mathematical definitions, executable algorithms, and theorems, together
with an environment for semi-interactive development of machine-checked
proofs. Typical applications include the certification of properties of programming
languages (e.g., the CompCert compiler certification project and the
Bedrock verified low-level programming library), the formalization of
mathematics (e.g., the full formalization of the Feit-Thompson theorem
and homotopy type theory) and teaching.
(base) brandomiranda~ โฏ opam switch create NAME 4.07.0
<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><> ๐Ÿซ
Switch invariant: ["ocaml-base-compiler" {= "4.07.0"} | "ocaml-system" {= "4.07.0"}]
[ERROR] Could not determine which packages to install for this switch:
* Missing dependency:
- ocaml-base-compiler = 4.07.0 | ocaml-system = 4.07.0
unmet availability conditions: '!(os = "macos" & arch = "arm64")'
unmet availability conditions: 'sys-ocaml-version = "4.07.0"'
Switch initialisation failed: clean up? ('n' will leave the switch partially installed) [Y/n] Y
seems there was an error:
โˆ— installed eprover.2.6
[ERROR] The compilation of cairo2.0.6.2 failed at "dune build -p cairo2 -j 16".
โˆ— installed ocamlgraph.2.0.0
โˆ— installed zarith.1.12
โˆ— installed coq-coqprime-generator.dev
โˆ— installed ocaml-migrate-parsetree.1.8.0
[ERROR] The compilation of z3.4.8.13 failed at "python3 scripts/mk_make.py --ml".
โˆ— installed menhir.dev
โˆ— installed ppxlib.0.15.0
โˆ— installed ppx_deriving.5.1
โˆ— installed elpi.1.14.1
โฌ‡ retrieved coq-unimath.dev (git+https://github.com/UniMath/UniMath.git#master)
Processing 188/279: [coq: make]
โˆ— installed coq.dev
โˆ— installed coq-dpdgraph.dev
โˆ— installed coq-hammer-tactics.dev
โˆ— installed coq-ext-lib.dev
โˆ— installed coq-aac-tactics.dev
โˆ— installed coq-libhyps.dev
โˆ— installed coq-hammer.dev
โˆ— installed coq-paramcoq.dev
โˆ— installed coq-menhirlib.dev
โˆ— installed coq-simple-io.dev
โˆ— installed coq-bignums.dev
โˆ— installed coq-unicoq.dev
โˆ— installed coq-mathcomp-ssreflect.dev
โˆ— installed coq-hott.dev
โˆ— installed coq-stdpp.dev
โˆ— installed coq-flocq.3.dev
โˆ— installed coq-math-classes.dev
โˆ— installed coq-coquelicot.dev
โˆ— installed coq-coqprime.dev
โˆ— installed coq-equations.dev
โˆ— installed coq-gappa.dev
โˆ— installed coq-mathcomp-bigenough.dev
[ERROR] The compilation of coq-interval.dev failed at "./remake -j16".
โˆ— installed coq-mathcomp-fingroup.dev
โˆ— installed coq-elpi.dev
โˆ— installed coq-mtac2.dev
โˆ— installed coq-mathcomp-finmap.dev
โˆ— installed coq-hierarchy-builder.dev
โˆ— installed coq-reglang.dev
โˆ— installed coq-quickchick.dev
โˆ— installed coq-compcert.dev
โˆ— installed coq-iris.dev
โˆ— installed coq-mathcomp-algebra.dev
โˆ— installed coq-mathcomp-zify.dev
โˆ— installed coq-mathcomp-multinomials.dev
โˆ— installed coq-iris-heap-lang.dev
โˆ— installed coq-mathcomp-solvable.dev
โˆ— installed coq-corn.dev
โˆ— installed coq-mathcomp-field.dev
โˆ— installed coq-mathcomp-real-closed.dev
โˆ— installed coq-coqeal.dev
โˆ— installed coq-mathcomp-character.dev
โˆ— installed coq-mathcomp-analysis.dev
โˆ— installed coq-unimath.dev
โˆ— installed coq-vst.dev
#=== ERROR while compiling z3.4.8.13 ==========================================#
# context 2.1.2 | macos/arm64 | ocaml-base-compiler.4.10.2 | file:///Users/brandomiranda/Downloads/platform-2022.01.0/opam/opam-repository
# path ~/.opam/__coq-platform.2022.01.0~dev/.opam-switch/build/z3.4.8.13
# command ~/.opam/opam-init/hooks/sandbox.sh build python3 scripts/mk_make.py --ml
# exit-code 1
# env-file ~/.opam/log/z3-96628-ab4f2a.env
# output-file ~/.opam/log/z3-96628-ab4f2a.out
### output ###
# [...]
# Copied 'z3types.cpython-39.pyc'
# Copied 'z3core.cpython-39.pyc'
# Testing ocamlc...
# Testing ocamlopt...
# Traceback (most recent call last):
# File "/Users/brandomiranda/.opam/__coq-platform.2022.01.0~dev/.opam-switch/build/z3.4.8.13/scripts/mk_make.py", line 18, in <module>
# mk_bindings(API_files)
# File "/Users/brandomiranda/.opam/__coq-platform.2022.01.0~dev/.opam-switch/build/z3.4.8.13/scripts/mk_util.py", line 3044, in mk_bindings
# check_ml()
# File "/Users/brandomiranda/.opam/__coq-platform.2022.01.0~dev/.opam-switch/build/z3.4.8.13/scripts/mk_util.py", line 450, in check_ml
# raise MKException('Failed testing ocamlopt compiler. Set environment variable OCAMLOPT with the path to the Ocaml native compiler. Note that ocamlopt may require flexlink to be in your path.')
# mk_exception.MKException: 'Failed testing ocamlopt compiler. Set environment variable OCAMLOPT with the path to the Ocaml native compiler. Note that ocamlopt may require flexlink to be in your path.'
#=== ERROR while compiling coq-interval.dev ===================================#
# context 2.1.2 | macos/arm64 | ocaml-base-compiler.4.10.2 | https://coq.inria.fr/opam/extra-dev#2022-02-15 19:00
# path ~/.opam/__coq-platform.2022.01.0~dev/.opam-switch/build/coq-interval.dev
# command ~/.opam/opam-init/hooks/sandbox.sh build ./remake -j16
# exit-code 1
# env-file ~/.opam/log/coq-interval-96628-942e59.env
# output-file ~/.opam/log/coq-interval-96628-942e59.out
### output ###
# [...]
# [deprecated-syntactic-definition,deprecated]
# File "./src/Interval/Transcend.v", line 2077, characters 14-24:
# Warning: Notation plus_assoc is deprecated since 8.16.
# The Arith.Plus file is obsolete. Use Nat.add_assoc instead.
# [deprecated-syntactic-definition,deprecated]
# Finished src/Interval/Transcend.vo
# Finished src/Interval/Float_full.vo
# File "./src/Tactic.v", line 22, characters 0-42:
# Warning:
# New coercion path [real; Finite] : Rbar >-> Rbar is not definitionally an identity function.
# [ambiguous-paths,typechecker]
# Finished src/Tactic.vo
#=== ERROR while compiling cairo2.0.6.2 =======================================#
# context 2.1.2 | macos/arm64 | ocaml-base-compiler.4.10.2 | https://opam.ocaml.org#28fab8d8
# path ~/.opam/__coq-platform.2022.01.0~dev/.opam-switch/build/cairo2.0.6.2
# command ~/.opam/opam-init/hooks/sandbox.sh build dune build -p cairo2 -j 16
# exit-code 1
# env-file ~/.opam/log/cairo2-96628-a005f1.env
# output-file ~/.opam/log/cairo2-96628-a005f1.out
### output ###
# ocamlmklib src/dllcairo_stubs.so,src/libcairo_stubs.a (exit 2)
# (cd _build/default && /Users/brandomiranda/.opam/__coq-platform.2022.01.0~dev/bin/ocamlmklib.opt -g -o src/cairo_stubs src/cairo_stubs.o -L/opt/homebrew/opt/freetype/lib -lfreetype -L/opt/homebrew/Cellar/fontconfig/2.13.1/lib -L/opt/homebrew/opt/freetype/lib -lfontconfig -lfreetype -L/opt/homebrew/Cellar/cairo/1.16.0_5/lib -lcairo)
# ld: in '/usr/local/lib/libpng16.16.dylib', building for macOS-arm64 but attempting to link with file built for macOS-x86_64
# clang: error: linker command failed with exit code 1 (use -v to see invocation)
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><> ๐Ÿซ
โ”Œโ”€ The following actions failed
โ”‚ ฮป build cairo2 0.6.2
โ”‚ ฮป build coq-interval dev
โ”‚ ฮป build z3 4.8.13
โ””โ”€
โ”Œโ”€ The following changes have been performed (the rest was aborted)
โ”‚ โˆ— install camlp5 7.14
โ”‚ โˆ— install conf-adwaita-icon-theme 2
โ”‚ โˆ— install conf-autoconf 0.1
โ”‚ โˆ— install conf-automake 1
โ”‚ โˆ— install conf-cairo 1
โ”‚ โˆ— install conf-findutils 1
โ”‚ โˆ— install conf-g++ 1.0
โ”‚ โˆ— install conf-gcc 1.0
โ”‚ โˆ— install conf-gmp 4
โ”‚ โˆ— install conf-gtk3 18
โ”‚ โˆ— install conf-gtksourceview3 0+2
โ”‚ โˆ— install conf-libtool 1
โ”‚ โˆ— install conf-perl 2
โ”‚ โˆ— install conf-pkg-config 2
โ”‚ โˆ— install conf-python-3 9.0.0
โ”‚ โˆ— install conf-which 1
โ”‚ โˆ— install coq dev
โ”‚ โˆ— install coq-aac-tactics dev
โ”‚ โˆ— install coq-bignums dev
โ”‚ โˆ— install coq-compcert dev
โ”‚ โˆ— install coq-coqeal dev
โ”‚ โˆ— install coq-coqprime dev
โ”‚ โˆ— install coq-coqprime-generator dev
โ”‚ โˆ— install coq-coquelicot dev
โ”‚ โˆ— install coq-corn dev
โ”‚ โˆ— install coq-dpdgraph dev
โ”‚ โˆ— install coq-elpi dev
โ”‚ โˆ— install coq-equations dev
โ”‚ โˆ— install coq-ext-lib dev
โ”‚ โˆ— install coq-flocq 3.dev
โ”‚ โˆ— install coq-gappa dev
โ”‚ โˆ— install coq-hammer dev
โ”‚ โˆ— install coq-hammer-tactics dev
โ”‚ โˆ— install coq-hierarchy-builder dev
โ”‚ โˆ— install coq-hott dev
โ”‚ โˆ— install coq-iris dev
โ”‚ โˆ— install coq-iris-heap-lang dev
โ”‚ โˆ— install coq-libhyps dev
โ”‚ โˆ— install coq-math-classes dev
โ”‚ โˆ— install coq-mathcomp-algebra dev
โ”‚ โˆ— install coq-mathcomp-analysis dev
โ”‚ โˆ— install coq-mathcomp-bigenough dev
โ”‚ โˆ— install coq-mathcomp-character dev
โ”‚ โˆ— install coq-mathcomp-field dev
โ”‚ โˆ— install coq-mathcomp-fingroup dev
โ”‚ โˆ— install coq-mathcomp-finmap dev
โ”‚ โˆ— install coq-mathcomp-multinomials dev
โ”‚ โˆ— install coq-mathcomp-real-closed dev
โ”‚ โˆ— install coq-mathcomp-solvable dev
โ”‚ โˆ— install coq-mathcomp-ssreflect dev
โ”‚ โˆ— install coq-mathcomp-zify dev
โ”‚ โˆ— install coq-menhirlib dev
โ”‚ โˆ— install coq-mtac2 dev
โ”‚ โˆ— install coq-paramcoq dev
โ”‚ โˆ— install coq-quickchick dev
โ”‚ โˆ— install coq-reglang dev
โ”‚ โˆ— install coq-simple-io dev
โ”‚ โˆ— install coq-stdpp dev
โ”‚ โˆ— install coq-unicoq dev
โ”‚ โˆ— install coq-unimath dev
โ”‚ โˆ— install coq-vst dev
โ”‚ โˆ— install cppo 1.6.8
โ”‚ โˆ— install csexp 1.5.1
โ”‚ โˆ— install dune 2.9.3
โ”‚ โˆ— install dune-configurator 2.9.3
โ”‚ โˆ— install elpi 1.14.1
โ”‚ โˆ— install eprover 2.6
โ”‚ โˆ— install gmp-ecm 7.0.3
โ”‚ โˆ— install menhir dev
โ”‚ โˆ— install menhirLib dev
โ”‚ โˆ— install menhirSdk dev
โ”‚ โˆ— install num 1.4
โ”‚ โˆ— install ocaml-compiler-libs v0.12.4
โ”‚ โˆ— install ocaml-migrate-parsetree 1.8.0
โ”‚ โˆ— install ocamlbuild 0.14.1
โ”‚ โˆ— install ocamlfind 1.9.3
โ”‚ โˆ— install ocamlgraph 2.0.0
โ”‚ โˆ— install ppx_derivers 1.2.1
โ”‚ โˆ— install ppx_deriving 5.1
โ”‚ โˆ— install ppxlib 0.15.0
โ”‚ โˆ— install re 1.10.3
โ”‚ โˆ— install result 1.5
โ”‚ โˆ— install seq base
โ”‚ โˆ— install sexplib0 v0.14.0
โ”‚ โˆ— install stdlib-shims 0.3.0
โ”‚ โˆ— install zarith 1.12
โ””โ”€
<><> cairo2.0.6.2 troubleshooting <><><><><><><><><><><><><><><><><><><><><> ๐Ÿซ
=> Try to re-run the install command with PKG_CONFIG_PATH pointing a pkg-config path including libffi, e.g. if you use homebrew you can try
PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig
The former state can be restored with:
/opt/homebrew/bin/opam switch import "/Users/brandomiranda/.opam/__coq-platform.2022.01.0~dev/.opam-switch/backup/state-20220216165905.export"
when running the coq plataform script:
(base) brandomiranda~/Downloads/platform-2022.01.0 โฏ bash coq_platform_make.sh

If you are not an opam / OCaml expert, then you're best bet to install Coq with opam is to rely on the scripts provided by the Coq Platform. See: https://github.com/coq/platform/releases
These interactive scripts will take care of:
creating a new opam switch
installing an appropriate version of the OCaml compiler
installing any external dependencies you need (e.g., if you want CoqIDE)
they can also propose to install a collection of additional Coq packages that can be useful for Coq projects
Finally, relying on this script creates a sound basis that you can later extend if you need more Coq packages that were not included in the Platform.

In case you are confsued what "install with the Coq Platform scripts" means here is a few more details:
Installing Coq
install brew: https://brew.sh/
Follow the Coq Platform scripts for installation: https://coq.inria.fr/opam-using.html or "Installation by compiling from Sources using opam" https://github.com/coq/platform/blob/main/doc/README_macOS.md.
Last time I installed this I downloaded their coq zip file with the instlal script (note check for most recent or version you want e.g. at https://github.com/coq/platform/blob/main/doc/README_macOS.md):
https://github.com/coq/platform/archive/refs/tags/2022.01.0.zip
and ran after cding to the unzipped files location of the above:
bash coq_platform_make.sh
select the version you want (likely something stable! Avoid, beta, dev. At the time of this writing option 7.
you might have to do eval $(opam env).
Check it installed correctly:
coqc -v
output something like:
The Coq Proof Assistant, version 8.16+alpha
compiled with OCaml 4.10.2
if its working
Note, for HPCs
it seems one can do this too:
# - install opam
# brew install opam
# https://stackoverflow.com/questions/72522266/how-does-one-install-opam-with-conda-for-mac-apple-os-x
conda install -c conda-forge opam
opam init
# if doing local env? https://stackoverflow.com/questions/72522412/what-does-eval-opam-env-do-does-it-activate-a-opam-environment
#eval $(opam env)
# - install coq
# local install
#opam switch create . 4.12.1
#eval $(opam env)
#opam repo add coq-released https://coq.inria.fr/opam/released
#opam install coq
# If you want a single global (wrt conda) coq installation (for say your laptop):
opam switch create 4.12.1
opam switch 4.12.1
opam repo add coq-released https://coq.inria.fr/opam/released
opam install coq

Related

Install why3-coq on MacBook Pro

When I try to install why3-coq on my MacBook Pro, I got the following error message
userde-MacBook-Pro:~ user$ opam install why3-coq
[WARNING] Opam package conf-python-3.1.0.0 depends on the following system
package that can no longer be found: python#3
The following actions will be performed:
โ†ป recompile dune 2.9.3 [upstream or system changes]
โ†ป recompile ocamlfind 1.9.3 [upstream or system changes]
โ†ป recompile stdlib-shims 0.3.0 [uses dune]
...
===== โˆ— 2 โ†ป 23 โ†— 1 =====
Do you want to continue? [Y/n] y
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><> ๐Ÿซ
...
โฌ‡ retrieved why3-coq.1.5.1 (cached)
[ERROR] The compilation of dune.2.9.3 failed at "./dune.exe build -p dune
--profile dune-bootstrap -j 7".
Processing 32/102: [ocamlfind: ./configure]
#=== ERROR while compiling dune.2.9.3 =========================================#
# context 2.1.2 | macos/x86_64 | ocaml.4.13.1 | https://opam.ocaml.org#ac449189
# path ~/.opam/default/.opam-switch/build/dune.2.9.3
# command ~/.opam/opam-init/hooks/sandbox.sh build ./dune.exe build -p dune --profile dune-bootstrap -j 7
# signalled -7
# env-file ~/.opam/log/dune-4900-2cb712.env
# output-file ~/.opam/log/dune-4900-2cb712.out
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><> ๐Ÿซ
โ”Œโ”€ The following actions failed
โ”‚ ฮป build dune 2.9.3
โ””โ”€
โ•ถโ”€ No changes have been performed
But when I try to install dune along, it says dune is already installed
userde-MacBook-Pro:~ user$ opam install dune
[WARNING] Opam package conf-python-3.1.0.0 depends on the following system
package that can no longer be found: python#3
[NOTE] Package dune is already installed (current version is 2.9.3).
Does anyone know what is the potential problem and how to solve it?
UPDATE
I tried to go to the path and build manually (when use a new opam switch, it upgrades to dune.3.4.1, but all behaviors remain the same). This give me a killed 9 response.
userde-MacBook-Pro:~ user$ cd ~/.opam/4.14.0/.opam-switch/build/dune.3.4.1
userde-MacBook-Pro:dune.3.4.1 user$ ~/.opam/opam-init/hooks/sandbox.sh build ./dune.exe build dune.install --release --profile dune-bootstrap -j 7
Killed: 9

Upgrade Ionic to latest version

I am trying to upgrade Ionic to the latest version. Looking here, it shows that the latest version is 3.0.0. I also follow this tutorial.
So I do the following:
sudo npm uninstall -g ionic
sudo npm install -g ionic#latest
console:
Richards-MacBook-Pro:theWhoZoo richardmarais$ sudo npm install -g ionic
Password:
/Users/richardmarais/npm-global/bin/ionic -> /Users/richardmarais/npm-global/lib/node_modules/ionic/bin/ionic
/Users/richardmarais/npm-global/lib
โ””โ”€โ”€ ionic#3.0.0
But when I run:
ionic -v
I get:
2.1.18
and:
ionic info
I get:
Your system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 3.1.1
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 1.3.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: macOS Sierra
Node Version: v7.10.0
Xcode version: Xcode 8.3.2 Build version 8E2002
I would expect it to update the Ionic CLI Version: 2.1.18 to 3.0.0. Is that a correct assumption? If so, do you know what I am doing incorrectly?
Thanks
We did big chat. Things which were helpful:
Be sure that you completely delete all previous version with npm uninstall -g ionic or manually from rm -rf /usr/local/lib/node_modules. Don't forget remove symlink too: rm -rf /usr/local/bin/ionic
After completely deletion you should see error: command not found of ionic -v
And now if your npm root -g path is right like /usr/local/lib/node_modules try to install npm install -g ionic#latest. Then you should get correct output of ionic -v
The ionic CLI package has been renamed #ionic/cli
https://twitter.com/ionicframework/status/1223268498362851330
So you should uninstall ionic from your global
npm uninstall -g ionic
and add the new package name.
npm install -g #ionic/cli#latest
In case anyone comes here from google.
I simple run
$ ionic --version
$ 4.2.1
$ sudo npm i -g ionic#latest
$ ionic --version
$ 4.8.0
I would start trying the simple things before.
I just ran...
npm --version
Then, the answer was...
4.6.0
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ โ”‚
โ”‚ Update available 4.6.0 โ†’ 4.12.0 โ”‚
โ”‚ Run npm i -g ionic to update โ”‚
โ”‚ โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
So, I did...
npm i -g ionic to update
After that...
npm --version
6.5.0

The compilation of coq:list-string failed at "ruby pp.rb"

I am following a coq tutorial, which requires a basic coq OPAM library coq:io:system. But I got errors with OPAM. (This is with Ubuntu14.04, coq 8.4pl6 and opam1.2.1)
I googled around and didn't find any solution.
Does anyone know what the problem might be and how to fix this error?
Thanks.
=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
โˆ— installed coq:function-ninjas.1.0.0
โˆ— installed coq:error-handlers.1.0.0
โˆ— installed coq:io.3.0.0
โˆ— installed coq:list-plus.1.1.0
[ERROR] The compilation of coq:list-string failed at "ruby pp.rb".
โˆ— installed ppx_tools.0.99.2
โˆ— installed lwt.2.4.8
โˆ— installed coq:io:system:ocaml.2.2.0
#=== ERROR while installing coq:list-string.2.1.0 =============================#
# opam-version 1.2.1
# os linux
# command ruby pp.rb
# path /home/zhen/.opam/system/build/coq:list-string.2.1.0
# compiler system (4.02.1)
# exit-code 127
# env-file /home/zhen/.opam/system/build/coq:list-string.2.1.0/coq:list-string-2159-326a35.env
# stdout-file /home/zhen/.opam/system/build/coq:list-string.2.1.0/coq:list-string-2159-326a35.out
# stderr-file /home/zhen/.opam/system/build/coq:list-string.2.1.0/coq:list-string-2159-326a35.err
### stdout ###
It turns out that (as the error message suggests), this particular package seems to depend on ruby.
I was able to finish the installation after installing ruby with sudo apt-get install ruby.

"coffee" command fails silently, how to debug?

When using coffee-script this command runs ok on 1 computer but silently fails on another.
coffee --output dir --compile dir
make: *** [js] Error 1
How can I debug? Any flags for verbose output?
npm list -g
/usr/local/lib
โ”œโ”€โ”ฌ coffee-script#1.7.1
โ”‚ โ””โ”€โ”€ mkdirp#0.3.5
โ”œโ”€โ”€ csso#1.2.15
โ””โ”€โ”€ uglify-js#1.3.2
Even coffee --version fails with no output
It was a terrible mix of old Ubuntu's/new packages.
Needed to remove node, nodejs packages.
Install new versions from PPA
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install python-software-properties python g++ make nodejs
Reinstall coffee-script: sudo npm install coffee-script -g
Thanks

"NULL expression encountered" on FTDI's libMPSSE

My question is specific to the library libMPSSE from FTDI to work with USB to serial port (SPI, I2C, etc) adapters on Linux.
When I execute any program linked with the library, the method Init_libMPSSE() is called (without explicit invocation) and throws the following message.
../../Infra/src/ftdi_infra.c:243:Init_libMPSSE(): NULL expression encountered
Has anybody experienced this issue and found a workaround?.
Thanks.
You get this error when libMPSSE can't open the libftd2xx.so shared library. You need to set LD_LIBRARY_PATH to the path where this library was installed. For example if the library is in /usr/local/lib you would run the SPI static example like this:
sudo LD_LIBRARY_PATH=/usr/local/lib ./sample-static.o
A:
Using:
sudo LD_LIBRARY_PATH=/usr/local/lib ./your_application
is only one of the important steps!
Important: not using sudo can result in a failure like described here!
B:
But on Linux make sure that before you execute the command above, you disable the FTDI's VCP drivers that are already included in the Linux kernel. VCP drivers and libftd2xx drivers cant coexist! So, even before you execute the command above, you have to (a) plug in the device and (b) dissable the VCP drivers:
โ”Œโ”€โ”€โ”€โ”
โ”‚ $ โ”‚ ziga > ziga--workstation > Downloads
โ””โ”€โ”ฌโ”€โ”˜ /dev/pts/3
โ””โ”€> sudo rmmod ftdi_sio
โ”Œโ”€โ”€โ”€โ”
โ”‚ $ โ”‚ ziga > ziga--workstation > Downloads
โ””โ”€โ”ฌโ”€โ”˜ /dev/pts/3
โ””โ”€> sudo rmmod usbserial
Now, your application will be able to talk with libftd2xx drivers because VCP drivers will not interfere. So now you can execute the command in A:.
C:
Pay attention that bitness of the libMPSSE (& therefore your application) and libftd2xx have to also be the same! 32-bit or 64 bit!
For Linux, FTDI only provides 32-bit precompiled libMPSSE library here, but they provide 32-bit and 64-bit libftd2xx drivers here. So if you installed 64-bit libftd2xx, you need to compile the 64-bit libMPSSE library yourself! Sources are available here.
If we are on 64-bit system, we download the sources and we will get the compressed file libMPSSE_Source.zip. We extract it:
โ”Œโ”€โ”€โ”€โ”
โ”‚ $ โ”‚ ziga > ziga--workstation > Downloads
โ””โ”€โ”ฌโ”€โ”˜ /dev/pts/4
โ””โ”€> unzip libMPSSE_Source.zip
and we will get a folder libMPSSE__0-6_Source. We move inside and try to build the library!
โ”Œโ”€โ”€โ”€โ”
โ”‚ $ โ”‚ ziga > ziga--workstation > Downloads
โ””โ”€โ”ฌโ”€โ”˜ /dev/pts/4
โ””โ”€> cd ./libMPSSE__0-6_Source/LibMPSSE/
โ”Œโ”€โ”€โ”€โ”
โ”‚ $ โ”‚ ziga > ziga--workstation > LibMPSSE
โ””โ”€โ”ฌโ”€โ”˜ /dev/pts/4
โ””โ”€> cp ../External/Linux/libftd2xx1.1.12/release/ftd2xx.h .
โ”Œโ”€โ”€โ”€โ”
โ”‚ $ โ”‚ ziga > ziga--workstation > LibMPSSE
โ””โ”€โ”ฌโ”€โ”˜ /dev/pts/4
โ””โ”€> cp ../External/Linux/libftd2xx1.1.12/release/WinTypes.h .
โ”Œโ”€โ”€โ”€โ”
โ”‚ $ โ”‚ ziga > ziga--workstation > LibMPSSE
โ””โ”€โ”ฌโ”€โ”˜ /dev/pts/4
โ””โ”€> gcc -Wall -c *.c
ftdi_mid.c: In function โ€˜Mid_CheckMPSSEAvailableโ€™:
ftdi_mid.c:653:2: error: unknown type name โ€˜byteโ€™
653 | byte los = strlen(devList.Description);
| ^~~~
We will see that there is an error but it is fixable. We just open a file ftdi_mid.h and move to the line 653 which we edit like this:
unsigned char los = strlen(devList.Description);
Now we compile .h files to .o files and create an archive i.e. static library libMPSSE.a:
โ”Œโ”€โ”€โ”€โ”
โ”‚ $ โ”‚ ziga > ziga--workstation > LibMPSSE
โ””โ”€โ”ฌโ”€โ”˜ /dev/pts/4
โ””โ”€> gcc -Wall -c *.c
โ”Œโ”€โ”€โ”€โ”
โ”‚ $ โ”‚ ziga > ziga--workstation > LibMPSSE
โ””โ”€โ”ฌโ”€โ”˜ /dev/pts/4
โ””โ”€> ar -cvq libMPSSE.a *.o
a - ftdi_common.o
a - ftdi_i2c.o
a - ftdi_infra.o
a - ftdi_mid.o
a - ftdi_spi.o
We can now also move this 64-bit library in our project's folder and we can use this one, but doing this would demand us to remove or rename the 32-bit libraries that are already there.
D:
To compile my application with 32-bit libraries, I used:
gcc -Wall -Wpedantic -g -gdwarf-2 -m32 -L. -o main.elf main.c -lMPSSE -ldl
Note that I am on Debian 11 and in order to crosscompile with -m32 flag, you need to install the package gcc-multiarch.
But to compile my application with 64-bit libraries, I used:
gcc -Wall -Wpedantic -g -gdwarf-2 -L. -o main.elf main.c -lMPSSE -ldl