zsh: command not found: duarouter to create a rou.xml file - sumo

I'm using sumo in macOS. I'm trying to create a duarouter by calling the following command after creating a random trips for a given network:
duarouter -n ~/SUMOTutorials/sumotest.net.xml --route-files ~/SUMOTutorials/sumotest.trips.xml -o ~/SUMOTutorials/sumotest.rou.xml --ignore-errors
However I just get the error:
zsh: command not found: duarouter
I see in sumo directory there is duarouter of kind Unix executable file in sumo/bin and sumo/tests and in I run the above command when I'm in each of those directory but I just get an error.

I found the answer. Because the type is Unix executable file, we have to write the following in the directory where it is:
./duarouter -n ~/SUMOTutorials/sumotest.net.xml --route-files ~/SUMOTutorials/sumotest.trips.xml -o ~/SUMOTutorials/sumotest.rou.xml --ignore-errors.

Related

RISC-V: How to fix "file format not recognized" when disassembling a .img file?

I'm playing with RISC-V.
I have a .img file and I want to disassemble it into a .asm file, so I ran the following command:
> riscv64-unknown-elf-objdump -d xxx.img > xxx.asm
However, I got this issue:
riscv64-unknown-elf-objdump: xxx.img: file format not recognized
How can I fix it? I have no idea what to do with this issue.
If you run:
riscv64-unknown-elf-objdump --help
You'll see a line like:
riscv64-unknown-elf-objdump: supported architectures: riscv riscv:rv64 riscv:rv32
These are the supported architectures that you need to pass as the -m argument. Normally, an ELF file will encode this information so there's no guesswork, but in the case of using a flat file, there's no way for objdump to know how the instructions are supposed to be interpreted. The final command is:
riscv64-unknown-elf-objdump -b binary -m riscv:rv64 -D xxx.bin

Error: no Snakefile found, tried Snakefile, snakefile, workflow/Snakefile, workflow/snakefile

I had this error whenever running my snakefile.smk
Error: no Snakefile found, tried Snakefile, snakefile, workflow/Snakefile, workflow/snakefile.
using ls command shows that the file exists in directory
Miniconda3-4.7.12.1-Linux-x86_64.sh config.yml miniconda3 nano.save.1 snakemake
Miniconda3-4.7.12.1-MacOSX-x86_64.sh download.r nano.save snakefile.smk work
I am using WSL2 ubuntu 20
the snakefile contents
sample = ["GSE6955", "GSE67311"]
rule download:
output:
"~/{sample}.tar"
run:
"~/download.R"
rule extract:
input:
"~/{sample}.tar"
output:
directory("~/{sample}")
shell:
tar xvf {input}`
Does anyone have an idea how to fix this?
Snakemake by default looks for a file called snakefile or Snakefile in the working directory if a specific file is not provided. In your case, your snakefile is called snakefile.smk. To run snakemake with a specific snakefile, you can call it with the -s or --snakefile command line arg.
I recommend you call snakemake with the -h flag to see all the options available when calling snakemake.

Execute program conditionally

I am opening a file from CMake which will be open in a installed tool in my PC from the following command but the tool is not available in the server which throwing an error during the build.kindly help me to skip that part in server.
COMMAND ${Src_File_gen} -f "${CMAKE_SRC_DIR}/Source.xyz" -g -m ${_VARIANT}
You might want to use find_program before calling the tool. Then wrap the calling CMake command in an if condition only executing when the program was found:
find_program(SRC_FILE_GEN <src_file_gen_exe>)
if(${SRC_FILE_GEN})
COMMAND ${SRC_FILE_GEN} -f "${CMAKE_SRC_DIR}/Source.xyz" -g -m ${_VARIANT}
endif()

Command works in shell but not Objective-C or C

I want to run the following shell command in Objective-C
sshfs -C -p 22 user#remote.computer.com ~/local/directory/path
using the command system("sshfs -C -p 22 user#remote.computer.com ~/local/directory/path");
but I get sh: sshfs: command not found in NSLog.
If I copy and paste it into terminal however, it works.
The path used by an GUI application does not include any changes you have made in your shell files in your home directory (e.g. ~/.bashrc)
One way is to use the full path in the system call. (i.e. /Users/username/Projects - ~ are not automatically expanded) In a Cocoa app I would use NSTask to give more control

Mahout seqdirectory not making a new file

I am trying to convert a text file into a sequence file that I can run mahout kmeans on. When I run the seqdirectory utility, I do not get any errors and it says that the program is completed. However, when I look in the output directory, it is empty. I've looked around and can't find any solutions to this. Thoughts?
Here is what I run in the terminal:
hduser#ubuntu:~$ $MAHOUT_HOME/bin/mahout seqdirectory --input Downloads/google/ --output Downloads/sparsefiles/ -c UTF-8
This is the output I get:
12/07/06 06:24:19 INFO driver.MahoutDriver: Program took 1091 ms (Minutes: 0.018183333333333333)
I think it may be producing the output on hdfs. Try checking:
hadoop dfs -ls Downloads/sparsefiles/
Also, to ensure it produces in your local filesystem you can modify the command like:
$MAHOUT_HOME/bin/mahout seqdirectory --input file://<home path>/Downloads/google/ --output file://<home path>/Downloads/sparsefiles/ -c UTF-8