Ubuntu: ctags error: “ctags: Unknown option: -p” - ctags

I am trying to create tags using ctags and getting the error
ctags: Unknown option: -p
There is a similar question asked before. But i could not understand that solution. I'm very sorry for posting the same question again.
I am trying to generate tags for C and C++ files.
OS: ubuntu 10.04LTS
ctags version : 5.8 (Exuberant ctags)
$which ctags : /usr/bin/ctags
There is a .ctags conf file in my home directory, but it is empty.
I tried to generate the tags using the below command
ctags -append=yes -R /home/jabez/mycodedir
I am using the "-append" option because i want to append the tags generated from other directories to the same tags file.
Installation procedure i followed:
./configure --disable-etags
make
make install
Please help me how i can fix the problem.

The problem is that you use -append with a single dash, it should be a double dash: --append.
With single dash, the argument is parsed as a series of one-letter arguments: -a -p -p -e -n -d.

Related

Minimap2 for Nanopore cDNA-seq alignment to reference: command not found, why?

I am trying to map Oxford Nanopore cDNA reads to the reference using Minimap2. I am working on a macbook in the unix environment from the terminal. I have my fastq files and my reference genome downloaded, I have downloaded Minimap2 following the tutorial on GitHub with the code:
curl -L https://github.com/lh3/minimap2/releases/download/v2.21/minimap2-2.21_x64-linux.tar.bz2 | tar -jxvf -
And then tried to run Minimap2 with:
minimap2 -ax splice ref.fa nanopore-cdna.fa > aln.sam
But the output is: -bash: minimap2: command not found
So it looks like minimap2 isn't installed, but I can see the folder with Unix executable file called minimap2. How do I install it?
I have very little bioinformatics experience so I apologise if this is very basic...
Thank you!

Building FMINUIT from source for Octave

I'm trying to install a package called fminuit http://www.fis.unipr.it/~giuseppe.allodi/Fminuit/Fminuit_building.html
on ubuntu 18.04 machine using Octave. The installation step "make -f Makefile.f2c_lnx.Octave" gives me the following error
WrapIO_Matlab.c:4:10: fatal error: mex.h: No such file or directory
Any idea how to remedy this,
cheers, Damir
The build instructions provided by FMINUIT ask you to manually adapt the Makefile to your setup. I'm guessing you did one of those steps incorrectly. I'm running Octave 6.0.0 (current development sources) and worked fine:
$ wget http://www.fis.unipr.it/~giuseppe.allodi/Fminuit/fminuit-src.tar.gz
$ tar xzf fminuit-src.tar.gz
$ cd fminuit-2011.05.31/fminuit/
# modify Makefile.f2c_lnx.Octave
$ make -f Makefile.f2c_lnx.Octave
$ make -f Makefile.f2c_lnx.Octave install
The tricky part is knowing what to modify on the Makefile. For my case, these were the lines (you need to know the exact Octave version and where you installed it):
#Octave prefix directory (typically /usr or /usr/local): modify if needed
-PREFIX=/usr
+PREFIX=/usr/local
#major version number
-OCTAVE_MAJOR=2
+OCTAVE_MAJOR=6
#minor-release version number
-OCTAVE_MINOR=9.12
+OCTAVE_MINOR=0.0
OBJS= mnintr_wrkrnd.o intrac.o WrapIO_Matlab.o doflush.o
MINUIT=Minuit_.o
INSTDIR=../bin/linux_$(ARCH)/octave$(OCTAVE_MAJOR)
The fminuit Makefile will "install" inside the fminuit source directory. You may also want to adjust its INSTDIR value. You need to adjust your Octave path to use it:
>> addpath('/wherever/you/build/fmunuit/fminuit-2011.05.31/bin/linux_x86_64/octave6')
>> fminuit # you probably can figure out how to call this function
error: fminuit: Too few input arguments

How to alias a particular cmake command

I'm trying to work around a QtCreator bug (https://bugreports.qt.io/browse/QTCREATORBUG-20972) where QtCreator fails to open a CMake project because it is trying to create a socket file in /tmp/RANDOM_PATH/socket whereas "RANDOM_PATH" does not exist.
I can reproduce the issue manually with:
$ /usr/bin/cmake -E server --pipe=/tmp/not-existing-path/socket
--experimental CMake Error: Internal Error with /tmp/not-existing-path/socket: EACCES
The suggestion given in https://bugreports.qt.io/browse/QTCREATORBUG-18444 is to create an alias of cmake which would report
"serverMode":false
when given the command
cmake -E capabilities
which on my machine (Ubuntu 18.04) outputs:
{"generators":[{"extraGenerators":[],"name":"Watcom WMake","platformSupport":false,"toolsetSupport":false},{"extraGenerators":["CodeBlocks","CodeLite","Sublime Text 2","Kate","Eclipse CDT4","KDevelop3"],"name":"Unix Makefiles","platformSupport":false,"toolsetSupport":false},{"extraGenerators":["CodeBlocks","CodeLite","Sublime Text 2","Kate","Eclipse CDT4"],"name":"Ninja","platformSupport":false,"toolsetSupport":false}],"serverMode":true,"version":{"isDirty":false,"major":3,"minor":10,"patch":2,"string":"3.10.2","suffix":""}}
What's the easiest way to achieve this?
I've tried to add such an alias:
cmake='cmake | sed "s/\"serverMode\":true/\"serverMode\":false/g"'
, but the issue is that the "sed" command needs to be after the arguments given to cmake, and not before.
I see from that bug report:
If you want to run a newer cmake without server-mode, then you will need to write a wrapper around cmake that removes the server-mode support indicator from the output reported by
cmake -E capabilities
That would be something like
cmake() {
if [[ "$*" == "-E capabilities" ]]; then
command cmake "$#" | jq -c 'del(.serverMode)'
else
command cmake "$#"
fi
}
You make have to make that a standalone script rather than a shell function.

ctags error "format error in tags file"

I work on c code base in Linux. I use perforce as source code repository. I had been using ctags and it was working fine. But recently when press ctrl ] in some symbol then I get below error. I removed tags file and recreated the tags file but the problem didn't solve. Any idea on how to resolve this issue?
E431: Format error in tags file "tags"
Before byte 53035586
If you are just using the ctags -R then try specifying the c language in the command like below. I had the same problem and when I specified the c language while generating the tags, the problem got resolved.
ctags -R --languages=C
There may be tags with large names in your repo. If you can live without those included in your ctags file, you can avoid this error and use rest of the ctags.
To avoid the files/folders, use this syntax
**ctags -R -V --exclude=#/path/to/ctags_ignore_file ./ **
ctags_ignore_file has the list of Folders to be excluded. You can use wildcard entries too.
This solved my problem.
TLDR; add export CSCOPE_EDITOR=vim to ~/.bashrc and close your terminal window.
In my case, setting vim as the default editor for cscope fixed the issue:
echo "export CSCOPE_EDITOR=vim" >> ~/.bashrc # Append to .bashrc
source ~/.bashrc # Load .bashrc into the current shell
After this, you may also use the following commands in your project directory for a quick reconfiguration of cscope and ctags:
ctags -R
cscope -R

which ctags shows /usr/local/bin/ctags but when I run ctags it runs /usr/bin/ctags. How is this possible?

Please see output from my terminal session
sharpair:~$ /usr/bin/ctags
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
sharpair:~$ /usr/local/bin/ctags
ctags: No files specified. Try "ctags --help".
sharpair:~$ which ctags
/usr/local/bin/ctags
sharpair:~$ ctags
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
sharpair:~$
Notice when I run ctags without absolute path, the output is the same as if I ran /usr/bin/ctags. However which ctags finds /usr/local/bin/ctags which is the right version I would expect when I run ctags without absolute path.
I have no aliases defined. How do I troubleshoot this? Thanks!
bash has cached the location of ctags.
hash -d ctags
See help hash for details.

Resources