why graphviz dot can not open a dot file? - graphviz

I am compiling a dot file to a jpg using dot program about graphviz.This is my command:
dot a.dot -o 1.ps
The out put error is:
Error: dot: can't open a.dot
This is my dot file(a.dot) content:
digraph abc{
a;
b;
a -> b;
}
I have tried:
dot -Tjpg -Gdpi=331 a.dot -o a.jpg
dot -Tps a.dot -o a.ps
Why would this happen? How to fix?
OS:Windows 7 X64
dot version: dot - graphviz version 2.38.0 (20140413.2041)

try it
dot -Tpng "a.dot" -o "a.png"

Related

Header file not found while path is included in configure command

Trying to build FFMPeG from source with this configure command
./configure --x86asmexe=/home/mahmood/yasm-1.3.0/bin/yasm --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp \
--extra-cflags=-I"~/cuda-10.1.168/include,~/nv_codec_headers/include/ffnvcodec/" \
--extra-ldflags=-L"~/cuda-10.1.168/lib64/,~/nv_codec_headers/lib/pkgconfig/"
I get this error in config.log which it can not find npp.h. Please note that additional include folders are given to the gcc command and npp.h actually exists in the path I gave.
gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
-D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -I~/cuda-10.1.168/include,~/nv_codec_headers/include/ffnvcodec/ \
-std=c11 -fomit-frame-pointer -fPIC -pthread -c \
-o /tmp/ffconf.dk4hdPMF/test.o /tmp/ffconf.dk4hdPMF/test.c
/tmp/ffconf.dk4hdPMF/test.c:1:10: fatal error: npp.h: No such file or directory
#include <npp.h>
^~~~~~~
And npp.h is here
$ ls -l ~/cuda-10.1.168/include/npp.h
-rw-r--r-- 1 mahmood mahmood 2864 Dec 16 18:24 /home/mahmood/cuda-10.1.168/include/npp.h
How can I fix that?
This is not really a makefile question.
You have two problems. First, you cannot pass multiple paths to the -I option by separating them with commas, like -I<dir1>,<dir2>. You have to use multiple -I options, like -I<dir1> -I<dir2>.
Second, the ~ is a special character expanded by the shell before it invokes the compiler, and the shell will not expand the ~ everywhere in the command line. For example if you run echo foo~bar or even echo foo~/bar the shell will not treat ~ as a reference to your home directory and will not expand it. It's only treated specially if it's the first character in a word. You need to either use the $HOME environment variable or else you need to add a space between the -I and the directory so that the ~ is the first character in the word: -I$HOME/<dir1> -I$HOME/<dir2> or -I ~/<dir1> -I ~/<dir2>.
If you use $HOME remember you need to escape the $ in your make recipe.

Passing g++ compiler flags stored in a variable not working as expected

So I have a file example.cpp which I have to compile with g++.
$ g++ nginx.cpp libuaparser_cpp.a -I ~/Desktop/boost_1_68_0/ -I /usr/local/mysql-connector-c++-8.0.12/include/jdbc/ -L /usr/local/mysql-connector-c++-8.0.12/lib64/ -L ~/Desktop/boost_1_68_0/stage/lib -L /usr/local/lib/ -L /Users/Shray/Desktop/boost_1_68_0/stage/lib/ ~/Desktop/boost_1_68_0/stage/lib/libboost_regex.a -lyaml-cpp -lboost_regex -std=c++11 -lmysqlcppconn
So instead of writing so much, I put the rest of the parameters in a variable in my terminal.
$ myvar="libuaparser_cpp.a -I ~/Desktop/boost_1_68_0/ -I /usr/local/mysql-connector-c++-8.0.12/include/jdbc/ -L /usr/local/mysql-connector-c++-8.0.12/lib64/ -L ~/Desktop/boost_1_68_0/stage/lib -L /usr/local/lib/ -L /Users/Shray/Desktop/boost_1_68_0/stage/lib/ ~/Desktop/boost_1_68_0/stage/lib/libboost_regex.a -lyaml-cpp -lboost_regex -std=c++11 -lmysqlcppconn"
$ g++ nginx.cpp $myvar
But this gives me an error.
clang: error: no such file or directory: '~/Desktop/boost_1_68_0/stage/lib/libboost_regex.a'
Why is this error coming? Since I am just adding the variables value. Any help would be much appreciated.
Don't use variables to store a content that is a list, use arrays! Also ~ doesn't expand under quotes (single or double)
myVarArgs=()
myVarArgs=( libuaparser_cpp.a
-I ~/Desktop/boost_1_68_0/
-I /usr/local/mysql-connector-c++-8.0.12/include/jdbc/
-L /usr/local/mysql-connector-c++-8.0.12/lib64/
-L ~/Desktop/boost_1_68_0/stage/lib
-L /usr/local/lib/
-L /Users/Shray/Desktop/boost_1_68_0/stage/lib/
~/Desktop/boost_1_68_0/stage/lib/libboost_regex.a
-lyaml-cpp
-lboost_regex
-std=c++11
-lmysqlcppconn
)
and run a full-quoted expansion to preserve the args from breaking up on presence of special characters.
g++ nginx.cpp "${myVarArgs[#]}"
Tilde expansion happens before variable expansion, so ~ in a variable isn't expanded to your home directory by the shell. Use the full path.

/usr/bin/ld: cannot find -lglscblas

See the thing is, there is no such thing as a file to link to named glscblas because that's a typo.
Here's an example of the problem when Rstudio calls gcc:
install.packages('devtools')
gcc -std=gnu99 -shared -L/usr/lib/R/lib -L/usr/lib/x86_64-linux-gnu -lgsl -lglscblas -o openssl.so aes.o base64.o bignum.o cert.o compatibility.o diffie.o envelope.o error.o hash.o info.o keygen.o keys.o onload.o openssh.o password.o pem.o pkcs12.o pkcs7.o rand.o rsa.o signing.o ssl.o stream.o write.o -L/usr/lib/x86_64-linux-gnu -L/usr/lib/R/lib -lR
/usr/bin/ld: cannot find -lglscblas
Where could the filename typo be hiding, that is, what file holds the filename that feeds -l parameters to gcc when calling install.packages in Rstudio? Rstudio invokes gcc with some wrong linker parameter that's obviously a typo for gnu scientific library "gslcblas" -- notice the gls / gsl character ordering mixup. It's harming the build anytime I run the command install.packages when it depends on the gnu scientific library, which is a lot of packages. It's crippling my Rstudio system. Installing today's latest Rstudio did not fix it. I can't seem to find the file that has the typo. Can anyone help me find the file containing the typo? thank you so much for helping. The RStudio forums were unresponsive, so I'm here now.
Rstudio server, Ubuntu 16.04, gcc. Additionally:
ga#ga-HP-Z820:~/Downloads$ ld --verbose | grep SEARCH_DIR | tr -s ' ;' \\012
SEARCH_DIR("=/usr/local/lib/x86_64-linux-gnu")
SEARCH_DIR("=/lib/x86_64-linux-gnu")
SEARCH_DIR("=/usr/lib/x86_64-linux-gnu")
SEARCH_DIR("=/usr/local/lib64")
SEARCH_DIR("=/lib64")
SEARCH_DIR("=/usr/lib64")
SEARCH_DIR("=/usr/local/lib")
SEARCH_DIR("=/lib")
SEARCH_DIR("=/usr/lib")
SEARCH_DIR("=/usr/x86_64-linux-gnu/lib64")
SEARCH_DIR("=/usr/x86_64-linux-gnu/lib")
ga#ga-HP-Z820:~/Downloads$ gcc -print-search-dirs | sed '/^lib/b 1;d;:1;s,/[^/.][^/]*/\.\./,/,;t 1;s,:[^=]*=,:;,;s,;,; ,g' | tr \; \\012
libraries:
/usr/lib/nvidia-current/x86_64-linux-gnu/5/:/usr/lib/nvidia-current/x86_64-linux-gnu/:/usr/lib/lib/:./x86_64-linux-gnu/5/:./x86_64-linux-gnu/lib/:/usr/lib/nvidia-current/x86_64-linux-gnu/5/:/usr/lib/nvidia-current/x86_64-linux-gnu/:/usr/lib/lib/:./x86_64-linux-gnu/5/:./x86_64-linux-gnu/lib/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/x86_64-linux-gnu/lib/x86_64-linux-gnu/5/:/usr/x86_64-linux-gnu/lib/x86_64-linux-gnu/:/usr/x86_64-linux-gnu/lib/:/usr/lib/x86_64-linux-gnu/5/:/usr/lib/x86_64-linux-gnu/:/usr/lib/:/lib/x86_64-linux-gnu/5/:/lib/x86_64-linux-gnu/:/lib/:/usr/lib/x86_64-linux-gnu/5/:/usr/lib/x86_64-linux-gnu/:/usr/lib/:/usr/lib/nvidia-current/:./:/usr/lib/nvidia-current/:./:/usr/x86_64-linux-gnu/lib/:/usr/lib/:/lib/:/usr/lib/

gcov cannot open graph file

I'm getting the following error when trying to run gcov as part of my Travis CI build:
$ gcov src/bgrep.c
bgrep.gcno:cannot open graph file
My .travis.yml:
language: c
compiler: gcc
sudo: false
before_script:
- uname -a
- printenv
- gcov --version
script:
- scons coverage=1
- ls -l src/
- test/run_test.py
- ls -l src/
- gcov src/bgrep.c
- ls -l src/
- ls -l
after_success:
- bash <(curl -s https://codecov.io/bash)
I can run the exact sequence of commands (scons, test/run_test.py, gcov src/bgrep.c) on my Fedora machine, and gcov produces grep.gcov as expected.
Travis is using gcov (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3. You can see an example build log here.
What am I (or Travis) doing wrong?
I had the same problem with gcov and travis. It seems that gcov indeed requires that the *.gcda and *.gcno files must be in the same directory as the *.c files. And additionally the -o option must be given which points then to the same directory...
So, I have the source files in folder src/ and the binaries in build/coverage/. First, I tried with 'gcov -o build/coverage/ src/*.c' which did not work. Second attempt was with copying the *.gc* files to src/ and executing 'gcov src/*.c' which also did not work. It finally worked with 'gcov -o src/ src/*.c'.

Where am I going wrong with this topojson makefile?

I have tried the following two instructions in my makefile:
states_topojson.json: states.shp
node_modules/.bin/topojson \
-o $#
states_topojson.json: states.shp
node_modules/.bin/topojson \
-o $#
--projection='width = 960, height = 600, d3.geo.albersUsa() \
.scale(1280) \
.translate([width / 2, height / 2])' \
--simplify=.5 \
--filter=none \
I am able to make other files, so I know topojson is correctly installed with node.
My states.shp file is straight from the Bostock Us-Atlas and was made with:
make shp/us/states-unfiltered.shp
Seen here
When I try and run:
topojson -o output.json states.shp
I get this noise:
Trace: { [Error: ENOENT, open 'states.dbf'] errno: 34, code: 'ENOENT', path: 'states.dbf' }
at output (/usr/local/lib/node_modules/topojson/bin/topojson:259:29)
at notify (/usr/local/lib/node_modules/topojson/node_modules/queue-async/queue.js:45:26)
at /usr/local/lib/node_modules/topojson/node_modules/queue-async/queue.js:35:11
at /usr/local/lib/node_modules/topojson/bin/topojson:236:23
at /usr/local/lib/node_modules/topojson/node_modules/shapefile/index.js:14:23
at /usr/local/lib/node_modules/topojson/node_modules/shapefile/read.js:26:29
at notify (/usr/local/lib/node_modules/topojson/node_modules/queue-async/queue.js:45:26)
at /usr/local/lib/node_modules/topojson/node_modules/queue-async/queue.js:35:11
at /usr/local/lib/node_modules/topojson/node_modules/shapefile/index.js:45:25
at /usr/local/lib/node_modules/topojson/node_modules/shapefile/dbf.js:16:30
Moving the .dbf file to the root folder made the topojson command line work. But the makefile still fails.
This may take a few iterations.
Try this makefile (Make is a tool; a makefile is a file which Make reads, a kind of script):
output.json:
topojson -o output.json states.shp
Tell us whether it works, and we can proceed.

Resources