ctags error: "ctags: Unknown option: -p" - macos

I've searched for this (exact) error, but I can't find any mention of it on the web.
Basically, I'm trying to install ctags (I've never used it before) on OSX Snow Leopard. Here's what I've done:
I downloaded the latest source package (version 5.8) from here: http://ctags.sourceforge.net/
Per the INSTALL instructions, I've run configure/make/make install. This installs a ctags binary to /usr/local/bin/.
If I cd into /usr/local/bin/ and run ./ctags (with no args), I get this: ctags: Unknown option: -p
Has any one seen this before? I'm obviously not supplying any arguments; if I do, I still get the same error (no matter what the arguments are).
Cheers,
-Lars

I think you should check your ~/.ctags (or any other ctags configuration file listed in ctags -V).
You probably have something like -python-kinds=-i ; ctags interprets that as a single character (-p) option.
In any case, try to run ctags with ctags --options=NONE ; if it fixes the issue, it means that the problem comes from one of your conf files.

Related

MSYS2: pkg-config doesn't resolve/list dependencies of gtk+-3.0

after I successfully set up my gcc/g++ environment under my Linux installation, I decided to do that for my Windows 11 machine as well. For that purpose I decided to use MSYS2. With the help of that handy tool I quickly installed MinGW as well as corresponding libraries.
One library which gives me headache (under Windows) is pkg-config. But before the installation of pkg-config, I installed gtk-3.0 first. I just installed it with the following command:
pacman -S mingw-w64-x86_64-gtk3
After that I installed pkg-config with the following command:
pacman -S mingw-w64-x86_64-pkg-config
After that, I tried to get all include and library flags for gtk3:
pkg-config --cflags gtk+-3.0
However after entering that command, the following error message occurs:
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk+-3.0', required by 'virtual:world', not found
The thing is that this exact command works like a charm under my Linux installation but somehow pkg-config can't find the package in the pkg-config search path. Why is that the case? Is that a known problem within the MSYS2 environment?
I would appreciate every tip I can get from you.
Thank you in advance!
EDIT: It looks like I just had to start the MinGW64 shell and not the one from MSYS2. Within that environment the files can be found and no error will occur. Thanks #HolyBlackCat!
The following answer is outdated, written in italic style and shouldn't be followed.
I just solved it by myself. I found out that I had to copy all .pc files from msys64\mingw64\lib\pkgconfig to the path I get from echoing PKG_CONFIG_PATH:
echo $PKG_CONFIG_PATH
gives me
/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig
So I just copied the files to /usr/lib/pkgconfig - problem solved!
Thank you anyway! :)

Trouble installing OpenCV with Cmake

I am trying to install the openCV library for Python however I am new to CMake and have run into some trouble after having cloned the repository in ~/opencv.
I've made a build directory in it with the mkdir command however once inside it when trying to set CMake options in it.
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local
I get prompted with the following error:
CMake Error: The source directory "/Users/eDen/opencv/build/CMAKE_INSTALL_PREFIX=/usr/local" does not exist.
It seems you aren't making the right directory, some Mac OS X installations doesn't include /usr/local/. You can make the directory using, if it's not already created, with:
sudo mkdir /usr/local/
But you say you want to use OpenCV with Python. I recommend you to obtain an already compiled copy unless you need some advanced features not available in the compiled version, like Qt integration or CUDA programming. But these features are included in the arguments of the cmake command.
Instructions on how to obtain OpenCV from Homebrew repository, this page explains the process. Basically, you install Homebrew, then Python, configure it and install some dependencies.
As Tsyvarev mentioned in the comments, you need to specify the path to source directory (i.e. where the main CMakeLists.txt file exists) at the end of your command. So, supposing you are now in the build directory, the final cmake command would be as follows:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
I have the last argument as .. but still get the error.
In my case, there is a bad whitespace in the above arguments. So the last .. is ignored.

I install gcc5.3.0 on my mac, and I broke it. What should I do to reuse apple-gcc42?

I used rm -rf to delete the gcc5.3.0, but mac continues to use gcc5.3.0.
The wrong message:
g++: error trying to exec 'cc1plus': execvp: No such file or directory
What should I do to reuse apple-gcc42?
Editing comments and responses into an answer.
Where was GCC 5.3.0 installed? Where did it come from? Did you create it or is it from Apple, or one of the auxilliary packagers? Did your recursive remove actually remove anything? Does running xcode-select help? (Use man xcode-select to see what it does; maybe xcode-select --install is useful, but I'm not sure since I've never destroyed my compilation system like that.) Which version of XCode do you have installed? Which version of Mac OS X are you running?
GCC5.3.0 is installed at /usr/local/libexec/gcc/x86_64-apple-darwin15.0.0/5.3.0. I removed the folder gcc. My Mac OS X is 10.11.6 and my Xcode is 7.3.1.
Removing /usr/local/lib/libexec/gcc didn't remove the executables from /usr/local/bin, so when you run g++, the shell is still finding the executable /usr/local/bin/g++, but that is not finding its auxilliary programs because you did manage to remove them. You also haven't cleaned up the headers that were installed under /usr/local/include, etc. Don't use rm -fr; it is crude and only partially effective when you have to uninstall complex suites of software like GCC. You could also use /usr/bin/g++ instead of g++.
So what should I do now?
You need to finish the removal job — remove gcc and g++ from /usr/local/bin at minimum. That should leave you with /usr/bin/gcc and /usr/bin/g++ as the compilers. You might have to run hash -r or start a new terminal window to avoid Bash's caching of the location of the compiler (but you'd get bash: /usr/local/bin/g++ not found or something similar as an error message).
Thank you. This works for me!

Install OpenSSL Support for self-compiled Ruby Installation

I unpacked and compiled Ruby 2.1 and installed several support tools.
But OpenSSL won't install while I have libssl-dev installed.
I get this error when making the openssl support:
make: *** No rule to make target `/thread_native.h', needed by `ossl.o'. Stop.
What to do?
I ran into the same problem. Turns out, the last line of the extconf.rb-generated Makefile reads
ossl.o: $(top_srcdir)/thread_native.h $(top_srcdir)/thread_$(THREAD_MODEL).h
However, top_srcdir isn't defined anywhere in the Makefile.
I figured out where the missing header files were by running
sudo find / -name thread_native.h
which returned (approximately)
~/.rbenv/versions/2.1.0/thread_native.h
There's a line at the top that says something like
topdir = ~/.rbenv/versions/2.1.0/include/ruby-2.1.0
so I just added a line below it pointing to the directory from the find:
top_srcdir = $(topdir)/../..
After all that, I did a make clean in the ext/openssl directory and then make ran without the error.
Why don't you use rvm? It compiles, configures, installs and manages the chosen version of the most popular ruby interpreters for you.
Anyway, try using --with-openssl-dir.

Xlib.h not found when building graphviz on Mac OS X 10.8 (Mountain Lion)

When using homebrew to install graphviz, the script gets to the point of "Making install in tkstubs" and then throws the following fatal error:
In file included from tkStubLib.c:15:
/usr/include/tk.h:78:11: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
I have installed XQuartz as X11 has been dropped in Mountain Lion, but I'm unsure if it is installed correctly. The location of Xlib.h is:
/opt/X11/include/X11/Xlib.h
There are also two symlinks to /opt/X11, they are:
/usr/X11
/usr/X11R6
Does this look like the correct setup to you? I've never dealt with X11 or XQuartz until yesterday.
Cheers.
After installing XQuartz you may add a symlink to your X11 installation folder by just entering
ln -s /opt/X11/include/X11 /usr/local/include/X11
in terminal. That will fix the problem as well without changing any ruby script.
You need to tell the tkstubs build (and possibly other bits in the package as well) to look for headers in /opt/X11/include; this is not on the standard include path.
Usually this is achieved by passing -I/opt/X11/include as an additional compiler flag, the method to do so is however dependent on the build system.
For reasonably modern configure scripts, the best approach is to pass it in the environment variable CPPFLAGS; if the package uses another build system or this doesn't work for another reason, then you need to look at the Makefile in the build directory.
You can enter in your shell before the compile/link (or brew) command:
export CPPFLAGS=-I/opt/X11/include
The export line will tell the compile/linker to look in /opt/X11/include for the X11 include files
Had the same issue and running this command on terminal
xcode-select --install
worked for me. Run this command after installing xQuartz.
If you need this to work in your CMake builds:
if(APPLE)
include_directories(AFTER "/opt/X11/include")
endif()
That worked well for me.
I got it to install by copying the x11 header file directory to the /opt/local/include directory. Probably not the best way to work around it but quick and easy.
I found this thread while trying to compile ffmpeg from source on OS X. I needed --enable-x11grab and the homebrew build does not support this option.
I had XQuartz installed already but I kept getting errors from ./configure: ERROR: Xlib not found. I thought the answers here would solve my problem, but they did not!
So, if anyone is ever in the same boat, my solution was this:
I opened up the generated config.log and found lots of errors referring to various includes and header files, including X11/Xlib.h - this is misleading. At the very bottom of the logfile was the key, pkg-config was complaining about looking for xbc.pc, and requested that it be put on the path. However, the error message that is displayed on the terminal says nothing about pkg-config or xbc!
The solution is to add to your PKG_CONFIG_PATH environment variable. Mine was nonexistent, so I just did export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ (the folder where I found xbc.pc).
I reran configure and everything worked like a charm!
TL;DR: check config.log - don't trust the terminal output!
Since the make file is looking for X11/xlib.h i.e., it is looking for X11 folder in the current directory, one way to solve this problem is to simply copy the /opt/X11/include/X11 directory to the directory that contains make file.

Resources