How to give sumo options with sumo-launchd.py? - veins

I am trying to give --max-depart-delay option with sumo but doesn't proceed. How I can pass options to sumo with sumo-launchd.py ?
I have tried following command
sumo-launchd.py -vv -c sumo --max-depart-delay -1

sumo-launchd.py executes the command given by the -c option. By default this is sumo which is resolved by searching your $PATH variable.
When you execute the given command, python interprets --max-depart-delay as another argument for sumo-launchd.py which does not make sense because it does not exist:
Usage: sumo-launchd.py [options]
sumo-launchd.py: error: no such option: --max-depart-delay
Therefore, you want to indicate that max-depart-delay is an option for the SuMO command to be executed and not for the launch daemon by surrounding it with '' or "":
sumo-launchd.py -vv -c 'sumo --max-depart-delay -1'
sumo-launchd.py -vv -c "sumo --max-depart-delay -1"
Logging to /tmp/sumo-launchd.log
Listening on port 9999

Related

DL4006 warning: Set the SHELL option -o pipefail before RUN with a pipe in it

I have a Dockerfile
FROM strimzi/kafka:0.20.1-kafka-2.6.0
USER root:root
RUN mkdir -p /opt/kafka/plugins/debezium
# Download, unpack, and place the debezium-connector-postgres folder into the /opt/kafka/plugins/debezium directory
RUN curl -s https://repo1.maven.org/maven2/io/debezium/debezium-connector-postgres/1.7.0.Final/debezium-connector-postgres-1.7.0.Final-plugin.tar.gz | tar xvz --transform 's/debezium-connector-postgres/debezium/' --directory /opt/kafka/plugins/
USER 1001
When I use hadolint on it by
hadolint Dockerfile
I got warning
Dockerfile:6 DL4006 warning: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check
I know I have a pipe | in the line started with RUN.
However, I still really don't know how to fix based on this warning.
Oh, just found the solution in the wiki page at https://github.com/hadolint/hadolint/wiki/DL4006
Here is my fixed version:
FROM strimzi/kafka:0.20.1-kafka-2.6.0
USER root:root
RUN mkdir -p /opt/kafka/plugins/debezium
# Download, unpack, and place the debezium-connector-postgres folder into the /opt/kafka/plugins/debezium directory
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl -s https://repo1.maven.org/maven2/io/debezium/debezium-connector-postgres/1.7.0.Final/debezium-connector-postgres-1.7.0.Final-plugin.tar.gz | tar xvz --transform 's/debezium-connector-postgres/debezium/' --directory /opt/kafka/plugins/
USER 1001
The reason adding SHELL ["/bin/bash", "-o", "pipefail", "-c"] is at https://github.com/docker/docker.github.io/blob/master/develop/develop-images/dockerfile_best-practices.md#using-pipes
Below is a copy:
Some RUN commands depend on the ability to pipe the output of one command into another, using the pipe character (|), as in the following example:
RUN wget -O - https://some.site | wc -l > /number
Docker executes these commands using the /bin/sh -c interpreter, which only
evaluates the exit code of the last operation in the pipe to determine success.
In the example above this build step succeeds and produces a new image so long
as the wc -l command succeeds, even if the wget command fails.
If you want the command to fail due to an error at any stage in the pipe,
prepend set -o pipefail && to ensure that an unexpected error prevents the
build from inadvertently succeeding. For example:
RUN set -o pipefail && wget -O - https://some.site | wc -l > /number
Not all shells support the -o pipefail option.
In cases such as the dash shell on
Debian-based images, consider using the exec form of RUN to explicitly
choose a shell that does support the pipefail option. For example:
RUN ["/bin/bash", "-c", "set -o pipefail && wget -O - https://some.site | wc -l > /number"]

Makefile.unix error unrecognized command line option “-std=c++03”

When I run make -f makefile.unix it gives me an error like this:
cc1plus: error: unrecognized command line option "-std=c++03"
Then I tried the following command: make -f makefile.unix CXXFLAGS="-std=c++0x" and still the same error is showing up.
I'm using g++ 4.3.3 because the software requires to do so.
Anyone any idea how to approach this?

ocamlc - compiling ocaml-wasm - Error: /usr/lib/ocaml/bigarray.cma is not a bytecode object file

I'm trying to make install ocaml-wasm 1.
Unfortunately the build is failing with the error-message:
Error: /usr/lib/ocaml/bigarray.cma is not a bytecode object file
Here's a Dockerfile so you may reproduce the error:
FROM base/archlinux
RUN pacman -Sy --noconfirm ocaml ocamlbuild wget unzip make
RUN wget https://github.com/WebAssembly/spec/archive/v1.0.zip
RUN unzip v1.0.zip
CMD cd spec-1.0; make -C interpreter install; bash
You may run it:
docker build -t ocaml-wasm . && docker run --rm -it ocaml-wasm
It should find it to produce the same error as above.
Here's the entire output of the make command:
make: Entering directory '/spec-1.0/interpreter'
ls util/*.ml* syntax/*.ml* binary/*.ml* text/*.ml* valid/*.ml* runtime/*.ml* exec/*.ml* script/*.ml* host/*.ml* main/*.ml* \
| sed 's:\(.*/\)\{0,1\}\(.*\)\.[^\.]*:\2:' \
| grep -v main \
| sort | uniq \
>wasm.mlpack
echo >_tags "true: bin_annot"
echo >>_tags "<{util,syntax,binary,text,valid,runtime,exec,script,host,main}/*.cmx>: for-pack(Wasm)"
ocamlbuild -cflags '-w +a-4-27-42-44-45 -warn-error +a' -I util -I syntax -I binary -I text -I valid -I runtime -I exec -I script -I host -I main -libs bigarray -quiet wasm.cmx
+ /usr/bin/ocamlc.opt -pack bigarray.cma -bin-annot util/lib.cmo binary/utf8.cmo exec/float.cmo exec/f32.cmo exec/f64.cmo exec/numeric_error.cmo exec/int.cmo exec/i32.cmo exec/i64.cmo syntax/types.cmo syntax/values.cmo runtime/memory.cmo util/source.cmo syntax/ast.cmo util/error.cmo binary/encode.cmo exec/i64_convert.cmo syntax/operators.cmo binary/decode.cmo script/script.cmo text/parser.cmo text/lexer.cmo text/parse.cmo util/sexpr.cmo text/arrange.cmo exec/i32_convert.cmo exec/f32_convert.cmo exec/f64_convert.cmo exec/eval_numeric.cmo runtime/func.cmo runtime/global.cmo runtime/table.cmo runtime/instance.cmo exec/eval.cmo host/env.cmo main/flags.cmo script/import.cmo script/js.cmo text/print.cmo valid/valid.cmo script/run.cmo host/spectest.cmo -o wasm.cmo
File "_none_", line 1:
Error: /usr/lib/ocaml/bigarray.cma is not a bytecode object file
Command exited with code 2.
make: *** [Makefile:83: _build/wasm.cmx] Error 10
rm wasm.mlpack _tags
make: Leaving directory '/spec-1.0/interpreter'
How do I get ocaml-wasm to compile?
I've seen 2, but the answer doesn't help me. I've not installed any non-standard binaries. Could the ocaml distribution on arch linux be broken?
I suspect that your ocamlbuild version is 0.13 (see ocamlbuild --version), which is known to have this issue. You should use 0.12 to avoid the problem.
ocamlbuild 0.13 is not package on opam because of this problem (so it's not visible to most users), but I hadn't considered that distribution packagers may decide to package it nonetheless.

Getting "pax archive volume change required" prompt during build configuration

I am trying to build fastjet-3.0.1 on my Ubuntu 14.04 LTS.
On running the following:
./configure --enable-allcxxplugins
I get the following message:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive...
ATTENTION! pax archive volume change required.
Ready for archive volume: 1
Input archive name or "." to quit pax.
Archive name >
I tried looking up what Pax is and what to do with this error, but did not find anything useful. Any help on this will be great
! Thanks.
Thanks to JW Peterson's comment, I could circumvent this problem with a wrapper to pax(1):
~/local/mypax/pax
#!/bin/sh
/usr/bin/pax -O "$#"
This has to come earlier than the underlying pax(1) command in the $PATH environment variable:
export PATH=$HOME/local/mypax:$PATH
I meet the same problem, and I solved it by run "sudo ./configure".

Using a FilteredClassifier with a Bayesian Network in WEKA

I'm running WEKA from the command line to create a Bayesian network model for training, and then using this model to test on a separate data set. The Bayesian network uses the TAN search option with a simple estimator. My command line call for training looks like this:
java -cp weka.jar:mysql-connector-java-5.0.8-bin.jar
weka.classifiers.bayes.BayesNet -d BN_model -p 0 -distribution -t tr2.arff -D
-Q weka.classifiers.bayes.net.search.local.TAN -- -S BAYES
-E weka.classifiers.bayes.net.estimate.SimpleEstimator -- -A 1 > tr_preds
Now, I just realized I need to use a a FilteredClassifier since I want to add instance IDs to my test data. This is where I'm stuck. I run the following:
java -cp weka.jar:mysql-connector-java-5.0.8-bin.jar
weka.classifiers.meta.FilteredClassifier
-F weka.filters.unsupervised.attribute.Remove -R 1
-W weka.classifiers.bayes.BayesNet -d BN_model -p 1 -distribution -t tr2.arff -D
-Q weka.classifiers.bayes.net.search.local.TAN -- -S BAYES
-E weka.classifiers.bayes.net.estimate.SimpleEstimator -- -A 1 > tr_preds
and I get the following error:
Weka exception: Illegal options: -S BAYES
To trouble shoot, I removed all the fancy search options and estimators, and just ran the Bayesian Network classifier with default settings. This worked fine, but it's obviously not what I need. It's clear that I'm having issues constructing this command line statement properly.
Could you please advise what I'm doing wrong? Thanks so much!
Best,
Francisco
The problem is that your command line arguments are in a wrong order. Because -- -S BAYES is the first -- after -W, it thinks this option belongs to weka.classifiers.bayes.BayesNet, which is an illegal option. You forgot the -- after -W ... to specifiy the options of the classifier.
Also, general options like -t tr2.arff -d BN_model -p 1 -distribution were placed somewhere in the middle, it is better to place them after the class you're calling:
java -cp weka.jar:mysql-connector-java-5.0.8-bin.jar
weka.classifiers.meta.FilteredClassifier
-t tr2.arff -d BN_model -p 1 -distribution
-F "weka.filters.unsupervised.attribute.Remove -R 1"
-W weka.classifiers.bayes.BayesNet
-- -D -Q weka.classifiers.bayes.net.search.local.TAN
-- -S BAYES
-E weka.classifiers.bayes.net.estimate.SimpleEstimator
-- -A 1