Having touble installing SWI-Prolog on Linux - installation

I am following the installation instructions from SWI-Prolog's site. I am on a Linux machine.
First I git-clone the repo and cd into swipl-devel.
Next I run the commands:
git submodule update --init
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX="${install_under}/swipl" -G Ninja ..
ninja
This all goes smoothly.
Next, when I run ctest -j 4 I get back:
98% tests passed, 1 tests failed out of 66
Total Test time (real) = 15.23 sec
The following tests FAILED:
24 - swipl:xsb/nonmt_tests (Failed)
Errors while running CTest
I then become root and run ninja install. Here is what I get back:
[12/13] Install the project...
-- Install configuration: "RelWithDebInfo"
-- Set runtime path of "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/bin/x86_64-linux/swipl" to "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/lib/x86_64-linux"
-- Set runtime path of "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/lib/x86_64-linux/libswipl.so.8.3.6" to "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/lib/x86_64-linux"
-- Set runtime path of "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/bin/x86_64-linux/swipl-ld" to "/home/nick/prolog/swipl-devel/build/install_under: command not found/swipl/lib/swipl/lib/x86_64-linux"
CMake Error at src/cmake_install.cmake:509 (EXECUTE_PROCESS):
EXECUTE_PROCESS given unknown argument "command".
Call Stack (most recent call first):
cmake_install.cmake:70 (include)
FAILED: CMakeFiles/install.util
cd /home/nick/prolog/swipl-devel/build && /usr/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.
I am not sure what I am missing.

There is something really going wrong.
I have never had the swipl:xsb/nonmt_tests tests failing (whatever they are).
Is the shell variable install_under properly set when you run the above?
For example, I always install under a directory like /usr/local/logic/swipl, so here you would have to say
-DCMAKE_INSTALL_PREFIX=/usr/local/logic/swipl
or
export install_under=/usr/local/logic/
in your case (not sure whether the export is needed, it sets an environment variable).

Related

I am trying to build spark, on Mac and the following error occurs

When I run the command
./build/mvn -DskipTests clean package
the following error occurs(though it seems that the java home environment was not set properly)
[WARNING] javac exited with exit code -1
[ERROR] ## Exception when compiling 10 sources to /Users/johnding/spark/common/tags/target/scala-2.12/classes
java.io.IOException: Cannot run program "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/javac" (in directory "/Users/johnding/spark"): error=2, No such file or directory
though it seems that the java home environment was not set properly
Make sure you set JAVA_HOME properly.
Use echo $JAVA_HOME to check.
On Mac you can use jenv to manage your java version.
(Don't forget to restart your terminal application or resource your configuration.)

Getting error while running mediapipe on macOS; Building C++ command-line example apps

I am trying to use mediapipe for a university project and have installed it, even successfully ran the Hello World! in C++ example app but when I am trying to build the C++ command-line example, it is giving me errors.
I ran this:
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu
and the result I got is this:
DEBUG: /private/var/tmp/_bazel_kanzashaikh/c191ae13e9137350b50f6a19ce94bf21/external/rules_foreign_cc/workspace_definitions.bzl:15:10: WARNING: This branch is deprecated and no longer recieving updates. Please update to main or choose a specific commit to pin in your workspace.
INFO: Build option --compilation_mode has changed, discarding analysis cache.
ERROR: Error fetching repository: java.io.IOException: The repository's path is "/usr/local/opt/opencv#3" (absolute: "/usr/local/opt/opencv#3") but this directory does not exist.
ERROR: /Users/kanzashaikh/development/mediapipe/third_party/BUILD:178:6: //third_party:opencv_binary depends on #macos_opencv//:opencv in repository #macos_opencv which failed to fetch. no such package '#macos_opencv//': The repository's path is "/usr/local/opt/opencv#3" (absolute: "/usr/local/opt/opencv#3") but this directory does not exist.
ERROR: Analysis of target '//mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.194s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 237 targets co
nfigured)
How do I solve it?
before building desktop examples, you should setup opencv. also for android examples you should setup android sdk and ndk.
there is a builtin script for setting up opencv and you can execute it.
for setting up opencv:
bash setup_opencv.sh
and for android sdk and ndk:
bash setup_android_sdk_and_ndk.sh
I am assuming you are running a M1 machine, as Homebrew is now installing Intel binaries under /usr/local and ARM ones under /opt/homebrew.
In your case, when building, bazel is looking for opencv#3 package at /usr/local/opt/opencv#3 and immediately throws an error as the package is located at /opt/homebrew/opt/opencv#3.
Thus, you have two choices:
Open WORKSPACE file from your bazel project and modify the path for each package accordingly
Make a symbolic link to /opt/homebrew/opt in /usr/local by running: sudo ln -s /opt/homebrew/opt opt

Failde to compile : ocamlfind: Package `xmlm' not found

I am trying to compile an OCaml .ml file with make command via command line remote machine but it shows me this error:
+ ocamlfind ocamlc -c -package xmlm -package unix -o pms.cmo pms.ml
ocamlfind: Package `xmlm' not found
Command exited with code 2.
Hint: Recursive traversal of subdirectories was not enabled for this build,
as the working directory does not look like an ocamlbuild project (no
'_tags' or 'myocamlbuild.ml' file). If you have modules in subdirectories,
you should add the option "-r" or create an empty '_tags' file.
To enable recursive traversal for some subdirectories only, you can use the
following '_tags' file:
true: -traverse
<dir1> or <dir2>: traverse
Compilation unsuccessful after building 6 targets (5 cached) in 00:00:00.
Makefile:10 : la recette pour la cible « native » a échouée
make: *** [native] Erreur 10
I tried to export the environment with this command:
eval $(/usr/bin/opam config env --root=/path/Ocaml/opam-ocaml-4.04-strech)
But also I had this error :
# opam-version 1.2.2
# os linux
File /p/opas/src/Ocaml/opam-ocaml-4.04-strech/config does not exist
while the config file does exist in the directory
any help Please ?!!
Thank you
To make a package available via opam (assuming that opam is properly installed and configured) you need to:
install the package
activate your opam
To install a package named foo, execute the following command in your shell
opam install foo
To activate your opam installation (which enables the search paths), issue the following command
eval $(opam config env)
or, with modern opam (that is of version 2.x) just eval $(opam env)
Before doing this, you need to properly initialize your opam installation, i.e., to install the compiler (or use the system compiler) and the base packages. This is done via the opam init command that creates an opam-managed subdirectory in your home, e.g., using an (old by today's standards) OCaml version 4.04.0, you can initialize it like this
opam init --comp=4.04.0
once the initialization is finished, do not forget to activate it via eval $(opam config env) and now you can install the package.
Finally, the version of opam that you're using is outdated and long ago deprecated, thus it is not receiving updates and the repositories that this version can understand are frozen and no longer updated. You really need to update your opam to a 2.x version. Please follow the opam installation instructions to get the latest version.

Error while running make command using Fabric 1.0.6 after all the 15 steps

I am installing fabric in a custom path $HOME//gopath/src/github.com/hyperledger/fabric using the make command but after installing all the 15 steps, I am getting the following error
Step 15/15 : LABEL org.hyperledger.fabric.version=1.0.2 org.hyperledger.fabric.base.version=0.3.2
---> Running in ed05a67810db
Removing intermediate container ed05a67810db
---> 99b4b0b28957
Successfully built 99b4b0b28957
Successfully tagged hyperledger/fabric-javaenv:latest
docker tag hyperledger/fabric-javaenv hyperledger/fabric-javaenv:x86_64-1.0.2
build/bin/peer
CGO_CFLAGS=" " GOBIN=/root/gopath/src/github.com/hyperledger/fabric/build/bin go install -tags "" -ldflags "-X github.com/hyperledger/fabric/common/metadata.Version=1.0.2 -X github.com/hyperledger/fabric/common/metadata.BaseVersion=0.3.2 -X github.com/hyperledger/fabric/common/metadata.BaseDockerLabel=org.hyperledger.fabric -X github.com/hyperledger/fabric/common/metadata.DockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.BaseDockerNamespace=hyperledger" github.com/hyperledger/fabric/peer
go build github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11: invalid flag in #cgo LDFLAGS: -Wl,--no-as-needed
Makefile:227: recipe for target 'build/bin/peer' failed
make: *** [build/bin/peer] Error 1
Docker version 17.12.0-ce, build c97c6d6
docker-compose version 1.18.0, build 8dd22a9
go version go1.9.4 linux/amd64
OS : Ubuntu 16.04
I have set the following path also
$ mkdir $HOME/gopath
$ export GOPATH=$HOME/gopath
$ export GOROOT=$HOME/go
$ export PATH=$PATH:$GOROOT/bin
Jira Link: https://jira.hyperledger.org/browse/FAB-2218 which I have already done
It is a known issue in go 1.9.4:
https://github.com/golang/go/issues/23739
While go people are fixing it, you can manually whitelist the flags before starting make:
$ export CGO_LDFLAGS_ALLOW='-Wl,--no-as-needed'
$ make
Alternatively you can just downgrade to go 1.9.3
as far as I know you don't need to build the fabric itself.
You just need to have sources in the gopath, as your chaincode will need this, when you are building your chaincode for the blockchain itself.
In addition you will probably also need to install the fabric-ca for your chaincode to build successfully, if you use the certificate-stuff.
This is sufficient to check if you installed fabric correctly:
cd $GOPATH/src/github.com/hyperledger/fabric
make unit-test
Keep going if this works.
I found this confusing at first as well ;)
I'd assume you switch to golang 1.9.4 or greater hence I belive this actually related to following issue, to solve it you need to update vendor dependencies:
govendor fetch github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11
Next continue to build binaries and run tests.

Invoke MSYS2 Shell from Command Prompt or PowerShell

Starting from Command Prompt or PowerShell (either is fine; I can figure out how to do the other given one), how can I invoke the MSYS2 shell to run a command?
More specific issue
I'm including this information to avoid an XY problem, but I strongly believe this is best solved by the answer to the above (more general) question.
In particular, I'm hoping to write a shell script to update the packages listed in Part III, Step 3 here. So I need something like:
[invoke msys2 bash] -c "pacman -Sy --needed msys2-runtime"
Calling the bash executable directly doesn't work:
C:\>C:\msys64\usr\bin\bash.exe -c "pacman -Sy --needed msys2-runtime"
/usr/bin/bash: pacman: command not found
I assume it's an environment problem. Changing PATH to include the path to MSYS2's bin directory doesn't fix the problem either. When it tries to install a package, bad things happens (nano is just an example):
C:\>bash -c "pacman -Sy --needed --noconfirm nano"
:: Synchronizing package databases...
mingw32 is up to date
mingw64 is up to date
msys is up to date
resolving dependencies...
looking for conflicting packages...
Packages (1) nano-2.3.6-2
Total Installed Size: 1.81 MiB
Net Upgrade Size: 0.17 MiB
:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring [########################################################] 100%
(1/1) checking package integrity [########################################################] 100%
(1/1) loading package files [########################################################] 100%
(1/1) checking for file conflicts [########################################################] 100%
(1/1) checking available disk space [########################################################] 100%
(1/1) upgrading nano [########################################################] 100%
error: command (/usr/bin/bash /usr/bin/bash -c . /tmp/alpm_shqjUE/.INSTALL; post_upgrade 2.3.6-2 2.3.2-1 ) failed to execute correctly
Trying to invoke the batch file (C:\msys64\msys2_shell.bat) opens a new shell in a new window, which leaves me not knowing whether it failed or succeeded.
So how can I get the shell into MSYS2's normal state?
We're working hard to fix our messy update procedure, we want it to be trouble-free.
You can see some examples of how we invoke MSYS2 from a batch file when we create a new installer in:
https://github.com/Alexpux/MSYS2-packages/blob/master/msys2-installer/make-msys2-installer.bat
But as #StevenPenny suggests,
bash -l -c "pacman ..."
is the correct way.

Resources