I'm trying to make my YouCompleteMe work which is a vim auto-completion plugin.
I use
sudo find / -name "libclang.so" -print
to locate my libclang.so. I got result
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
I'm wondering that does that mean there is no libclang.so on my mac?
After that I installed llvm-clang under my ~ directory following these commands:
cd ~/llvm-clang
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
cd ../..
cd llvm/tools/clang/tools
svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
cd ../../../..
cd llvm/projects
svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
cd ../..
mkdir llvm-build
cd llvm-build/
cmake -G "Unix Makefiles" ../llvm
make
Everything worked fine so far.
However, I ran
sudo find / -name "libclang.so" -print
I got the same result.
Anyway, I don't know if this helps to make the question more clear:
$ sudo find / -name "llvm" -print
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
/Library/Frameworks/Mono.framework/Versions/4.2.1/docs/llvm
/Library/Frameworks/Mono.framework/Versions/4.2.1/include/llvm
/Library/Frameworks/Mono.framework/Versions/4.2.1/share/llvm
/Users/yangyy/.vim/bundle/syntastic/syntax_checkers/llvm
/Users/yangyy/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/llvm
/Users/yangyy/llvm-clang/llvm
/Users/yangyy/llvm-clang/llvm/bindings/go/llvm
/Users/yangyy/llvm-clang/llvm/bindings/ocaml/llvm
/Users/yangyy/llvm-clang/llvm/bindings/python/llvm
/Users/yangyy/llvm-clang/llvm/include/llvm
/Users/yangyy/llvm-clang/llvm/tools/clang/tools/extra/clang-tidy/llvm
/Users/yangyy/llvm-clang/llvm/tools/clang/tools/extra/test/clang-tidy/Inputs/Headers/llvm
/Users/yangyy/llvm-clang/llvm-build/cmake/modules/CMakeFiles/Export/lib/cmake/llvm
/Users/yangyy/llvm-clang/llvm-build/include/llvm
/Users/yangyy/llvm-clang/llvm-build/lib/cmake/llvm
/Users/yangyy/llvm-clang/llvm-build/tools/clang/tools/extra/clang-tidy/llvm
/usr/share/file/magic/llvm
Where is the libclang.so?
Why there is no libclang.so after installing clang?
OSX uses .dylib for shared libraries, not .so.
With Xcode installed, I can find it with:
$ find /Applications/Xcode.app -name libclang.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib
Given it's in Xcode's default library directory, you should be able to link it in simply using -lclang if you use the Xcode command line tools.
Related
Is there a way to list the files inside a brew package (already installed) in macOS?
Some equivalent to this command in Ubuntu:
$ dpkg -L nginx
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/nginx
/usr/share/doc/nginx/copyright
/usr/share/doc/nginx/changelog.Debian.gz
brew list -v $FORMULA would list all the installed files.
For example:
$ brew ls -v bee
find /usr/local/Cellar/bee/1.80_1 -not -type d -print
/usr/local/Cellar/bee/1.80_1/INSTALL_RECEIPT.json
/usr/local/Cellar/bee/1.80_1/bin/bee
/usr/local/Cellar/bee/1.80_1/.brew/bee.rb
/usr/local/Cellar/bee/1.80_1/libexec/bin/bee
/usr/local/Cellar/bee/1.80_1/libexec/bin/bee.properties
/usr/local/Cellar/bee/1.80_1/libexec/lib/groovy-cli-commons-2.5.10.jar
/usr/local/Cellar/bee/1.80_1/libexec/lib/bee-1.80.jar
/usr/local/Cellar/bee/1.80_1/libexec/lib/groovy-sql-2.5.10.jar
/usr/local/Cellar/bee/1.80_1/libexec/lib/groovy-2.5.10.jar
/usr/local/Cellar/bee/1.80_1/libexec/lib/commons-cli-1.4.jar
/usr/local/Cellar/bee/1.80_1/libexec/lib/jackson-mapper-lgpl-1.9.13.jar
/usr/local/Cellar/bee/1.80_1/libexec/lib/jackson-core-lgpl-1.9.13.jar
See the man page; ls is just a shorthand for list.
I've setup my windows machine to work with gvim + cscope + ctags as I used to do with my older Linux environment.
Cscope is working but only partially, some of the commands does not work:
:cs find e foo /find a pattern/
:cs find t foo /find a text/
:cs find i foo /find files including this file/
The other ones seems to work fine.
This is the generation tags script that I'm running over a minGW:
rm -f tags
rm -f cscope.*
find . -type f -name *.c ! -path "./bin/*" -o -name *.h ! - path "./bin/*" -o -name SCons* ! -path "./bin/*" >cscope.files
cscope -icscope.files -b -q -k
/c/Users/M0081495/Downloads/ctags58/ctags58/ctags.exe -R -L cscope.files
[SOLVED] Finally I solved the issue installing a native windows cscope.exe executable. So far I was using a cygwin built-in cscope application.
I run this command in my macOS
$ perl ~/Desktop/blif2cnf.pl
and got this error info:
Can't locate getopts.pl in #INC (#INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /Users/Frank/Desktop/blif2cnf.pl line 10.
In my linux 16.04, such problem can be solved by following this answer
Is there a module like libperl4-corelibs-perl in macOS?
I know CPAN, but I don't know which module should I install.
It's Perl4::CoreLibs. In general the Debian package libthis-that-perl corresponds to a module named This::That, although it's up to you to figure out the capitalization :)
I'm not sure how the package manager works with macOS, but a platform-independent way of installing the getopts package.
To answer the question you put as a comment to the answer from #hobbs, the way I searche for a module I need is either through the site that #hobbs linked, https://metacpan.org, or, alternatively, http://search.cpan.org. It was at the second that I found what I needed.
Searching for getopts.pl gave a link to "Perl4::CoreLibs". In the upper-right-hand corner, there was a link that said Perl4-CoreLibs-0.003.tar.gz (though it looks like there is a 0.004 now). I right-clicked and selected "copy link address", which gave me
http://search.cpan.org/CPAN/authors/id/Z/ZE/ZEFRAM/Perl4-CoreLibs-0.004.tar.gz
Whatever your link is, you'll need to untar it and find all the *.pl files in the lib directory into a directory, and either
1) Link to them from the command line, e.g.
perl -I /path/to/where/you/untarred/lib ~/Desktop/blif2cnf.pl
or
2) Add them to your PERLLIB environment variable.
I think that more details will be helpful.
Detailed Instructions
Figure out a directory where you want to download your *.pl files. I used $HOME/new_perl_stuff
cd ~
mkdir new_perl_stuff
cd new_perl_stuff
Now, get the tarball
wget http://search.cpan.org/CPAN/authors/id/Z/ZE/ZEFRAM/Perl4-CoreLibs-0.004.tar.gz
untar it, go into the directory, and make sure lib is there
$ tar -xzf Perl4-CoreLibs-0.004.tar.gz
$ cd Perl4-CoreLibs-0.004
$ ls
You should see lib in the list.
It's possible to add your newly downloaded lib directory (in my case, $HOME/new_perl_stuff/Perl4-CoreLibs-0.004/lib) to the perl search path, but this just makes me worry about another directory that I might delete at some time. I made a new folder in the /usr/lib directory. I decided to name the new directory libperl4-corelibs-perl, since that seemed standard. First, I checked to make sure that there wasn't already a directory with that name.
$ stat /usr/lib/libperl4-corelibs-perl
stat: cannot stat '/usr/lib/libperl4-corelibs-perl': No such file or directory
Then I made the directory.
mkdir /usr/lib/libperl4-corelibs-perl
The next step was copying all the *.pl files into this directory. I hope to explain this next command later. I ran it this way to make sure all of the files I needed were there. From my $HOME/new_perl_stuff/Perl4-CoreLibs-0.004 directory, I ran the following command, which I plan to come back and explain.
find ./lib -type f -name "*.pl" -print0 | xargs -I'{}' -0 \
bash -c 'new_dir=/usr/lib/libperl4-corelibs-perl/; chmod +x {}; \
echo "Moving {}"; mv {} ${new_dir} && echo -e "success\n" || \
echo -e "failure\n"' | tee moving_day.log
Run that one if you want to see that everything got copied successfully. A shorter command that does everything necessary is:
find ./lib -type f -name "*.pl" -print0 | xargs -I'{}' -0 \
bash -c 'new_dir=/usr/lib/libperl4-corelibs-perl/; chmod +x {}; \
mv {} ${new_dir}'
It's not a bad idea to run
ls -lah /usr/lib/libperl4-corelibs-perl
to check that the *.pl files are there.
You can now run
perl -I /usr/lib/libperl4-corelibs-perl ~/Desktop/blif2cnf.pl
but there's an easier way.
Finally, I made it so that this directory will become part of the perl search path every time I use a terminal by adding the following line to my ~/.bashrc
This command adds the path to the PERLLIB environment variable. Different flavors of Linux have different syntax for adding to environment variables, make sure to find out what yours is!
export PERLLIB="/usr/bin/libperl4-corelibs-perl:$PERLLIB"
The commands I ran for this were
$ echo -e "\n\n## allow Perl to use the files in Perl4::CoreLibs" >> $HOME/.bashrc
$ echo -e "export PERLLIB=\"/usr/lib/libperl4_corelibs_perl:$PERLLIB\"" >> $HOME/.bashrc
$ source .bashrc
Now, you can simply run
perl ~/Desktop/blif2cnf.pl
Note: It's probably a good idea to go back and remove unwanted extras:
rm -rf $HOME/new_perl_stuff
I downloaded ruby-install version 0.6.1 and for some reason I get this make error:
*** No rule to make target 'install'. Stop.
What can I do to fix this?
deploy#blah:~$ sudo ls /root/
ruby-install-0.6.1 ruby-install.tar.gz
deploy#blah:~$ sudo make /root/ruby-install-0.6.1/ install
make: Nothing to be done for '/root/ruby-install-0.6.1/'.
make: *** No rule to make target 'install'. Stop.
Update
I went into the directory now:
root#blah:~/ruby-install-0.6.1# sudo make install
for dir in `find bin share -type d`; do mkdir -p /usr/local/$dir; done
for file in `find bin share -type f`; do cp $file /usr/local/$file; done
mkdir -p /usr/local/share/doc/ruby-install-0.6.1
cp -r *.md *.txt /usr/local/share/doc/ruby-install-0.6.1/
Did this work?
You need to cd into the directory, not pass the directory as an argument to make. E.g.
cd ruby-install-0.6.1
sudo make install
I need to copy a few files to another directory. The source structure is as follows
src/foo1.h
src/foo2.h
src/bar/foobar.h
I need to copy these so they end up here
/usr/include/foo/foo1.h
/usr/include/foo/foo2.h
/usr/include/foo/bar/foobar.h
In Linux I use cp -u --parents *.h bar/*.h /usr/include/foo from src, which works great. However, I can't find a suitable replacement in Mac OSX - cp doesn't support parents or an equivalent option, and install supports -d which is supposed to preserve the structure, but gives me the following error: install: foo1.h exists but it's not a directory
I'm stuck. Any ideas?
You could use rsync, e.g.
rsync -a ./src/ /usr/include/foo/ --include \*/ --include \*.h --exclude \*
BTW, you probably don't want to install stuff to /usr/include, as it may well get clobbered by system updates. Consider using e.g. /usr/local/include instead.