fix gnuplot installation - gnuplot

My gnuplot installation fails because libjpeg cannot not be loaded.
$ gnuplot
dyld: Library not loaded: /usr/local/lib/libjpeg.8.dylib
Referenced from: /usr/local/bin/gnuplot
Reason: image not found
Trace/BPT trap: 5
I work with osx-mavericks + XCode 5.1. Gnuplot was first installed in the past under osx-mountain-lion with homebrew. And under mountain-lion it worked. I tried to reinstall it now under mavericks, but it does not help.
brew reinstall gnuplot --tests
==> Reinstalling gnuplot with --tests
..
==> make
==> make check
Reason: image not found
/bin/sh: line 1: 30700 Trace/BPT trap: 5 PATH=$bdir/../src:$PATH GNUPLOT_DRIVER_DIR=$bdir/../src GNUPLOT_LIB=. gnuplot all.dem < /dev/null
make[2]: *** [check-noninteractive] Error 133
make[1]: *** [check-am] Error 2
make: *** [check-recursive] Error 1
Additional info: brew install libjpeg says "jpeg-8d already installed" but I can't find libjpeg. I only find several versions of libpng.
$ brew install libjpeg
Warning: jpeg-8d already installed
P.S. I am not firm with the console. So I am thankful for even simple console tips that help me debug the problem.

$ brew reinstall jpeg
solved the problem for me. After this I could reinstall gnuplot with
brew reinstall gnuplot --cairo --with-x --tests
I assume other reinstall options will work too.
Seems like bug in the brew recipe for gunplot.
At least I expect a better error message.

Related

Homebrew fails when upgrading VIM

When I run brew upgrade on macOS Sierra, the operation fails. The only thing it's trying to upgrade is vim 8.0.0550. I've tried deleting the tar file and forcing a redownload of the upgrade but that hasn't helped. Here is the stacktrace—I can attach more of the log if necessary:
ld: library not found for -lruby.2.4.0
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [vim] Error 1
make: *** [first] Error 2
Edit: Since posting, a thread on this bug has appeared on github. At time of writing, it's still not 100% clear what the problem is.
Try this:
Run brew doctor. This showed the following entry in the text:
+
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run brew link on these:
ruby
To fix run brew link --overwrite ruby
Now proceed to upgrade vim by running brew upgrade vim
I also recommend to fix other reported unlinked kegs.
Hope this helps. It worked pretty well for me.
I came to this question because I was facing the same problem on my Mac OS Sierra.
I have brew and rvm and the brew vim install was failing with the linker error described in the question above. But, I did not want to switch to rbenv as suggested in the comments. I also was not sure about messing with symlinks as I tend to forget and delete the original files that were being linked :-)
The work around I tried was to temporarily switch to the Mac system Ruby install using the command
rvm use system
Then do the brew upgrade of vim and once the install is complete revert back to the ruby that you want to use with rvm.
This worked for me - YMMV

Installing Torch on Virtual Machine

I'm trying to install Torch on virtual machine which has OS as Ubuntu 14.04 desktop version. I followed the instructions as given in Getting started with Torch. There was no problem in cloning the torch folder from github. In the second step which install dependencies show the following error:
make[1]: *** [libs] Error 1
make[1]: Leaving directory `/tmp/OpenBLAS/kernel'
make: *** [libs] Error 1
Error. OpenBLAS could not be compiled
Please help me to solve the problem.
Ubuntu is missing a gfortran-dev package:
sudo apt-get install gfortran-4.9
Should solve your issue.
Reference

Brew install node --without-npm fails

Following John Papa's post on 'How to use npm global without sudo on OSX' and I am running
brew install node --without-npm
I get this info/error(s):
/usr/local > brew install node --without-npm
==> Downloading https://nodejs.org/dist/v5.10.1/node-v5.10.1.tar.xz
Already downloaded: /Library/Caches/Homebrew/node-5.10.1.tar.xz
==> Downloading https://ssl.icu-project.org/files/icu4c/56.1/icu4c-56_1-src.tgz
Already downloaded: /Library/Caches/Homebrew/node--icu4c-56.1.tgz
==> ./configure --prefix=/usr/local/Cellar/node/5.10.1 --without-npm --with-intl
==> make install
Last 15 lines from /Users/justin/Library/Logs/Homebrew/node/02.make:
#include <limits>
^
In file included from ../deps/gtest/src/gtest-death-test.cc:34:
In file included from ../deps/gtest/include/gtest/gtest-death-test.h:41:
In file included from ../deps/gtest/include/gtest/internal/gtest-death-test-internal.h:40:
In file included from ../deps/gtest/include/gtest/internal/gtest-internal.h:40:
../deps/gtest/include/gtest/internal/gtest-port.h:259:10: fatal error: 'ctype.h' file not found
#include <ctype.h> // for isspace, etc
^
1 error generated.
make[1]: *** [/private/tmp/node20160410-11435-157r8bn/node-v5.10.1/out/Release/obj.target/gtest/deps/gtest/src/gtest-filepath.o] Error 1
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[1]: *** [/private/tmp/node20160410-11435-157r8bn/node-v5.10.1/out/Release/obj.target/gtest/deps/gtest/src/gtest-death-test.o] Error 1
make: *** [node] Error 2
Following Homebrew's troubleshooting instructions, I ran brew update twice and brew doctor -- but still no luck. I'm not familiar with homebrew and haven't messed with this stuff in a while. Any ideas what these errors mean?
It seems you did not install command line developer tools. Before installing Node with Homebrew, try executing this command in your Terminal:
xcode-select --install
If it is installed successfully this message will be shown:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
After the installation, run the brew command again.
The ctype.h file should be somewhere like /usr/include/ctype.h.

fatal error: opencv2/core/core.hpp caffe framework installation

I'm trying to install Caffe framework with this script: https://gist.github.com/jetsonhacks/acf63b993b44e1fb9528 and I'm getting opencv2/core/core.hpp error.
CXX src/caffe/layers/data_layer.cpp
src/caffe/layers/data_layer.cpp:2:33:
fatal error: opencv2/core/core.hpp: No such file or directory
#include <opencv2/core/core.hpp>
^
compilation terminated.
make: *** [.build_release/src/caffe/layers/data_layer.o] Error 1
In the documentation, OpenCV is optional. But that error tells me not.
Does such include have nothing to do with OpenCV installation?
Installing opencv for python is not sufficient.
You also need to do
sudo apt-get install libopencv-dev
I faced the same problem and solved it just by installing OpenCV. You will find other similar errors, unless you have installed all prerequisites.

How to install valgrind properly?

I'm installing valgrind now, until the ‘make install’ command it goes good.
The next command- ‘make regtest’ outputs the next error:
../../depcomp: line 689: exec: g++: not found
make[5]: *** [leak_cpp_interior.o] Error 127
make[5]: Leaving directory `/home/kbubuntu/valgrind-3.9.0/memcheck/tests'
make[4]: *** [check-am] Error 2
make[4]: Leaving directory `/home/kbubuntu/valgrind-3.9.0/memcheck/tests'
make[3]: *** [check-recursive] Error 1
make[3]: Leaving directory `/home/kbubuntu/valgrind-3.9.0/memcheck/tests'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/home/kbubuntu/valgrind-3.9.0/memcheck'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/kbubuntu/valgrind-3.9.0'
make: *** [check] Error 2
How can I solve it?
Thanks.
Short answer: Make from source.
How?
Uninstall the non working valgrind version with root rights (eg. sudo):
apt-get --purge valgrind
or
dpkg --remove valgrind
or
yum remove valgrind
Obtain sources from here.
Identify the latest version (for example 3.17.0)
Download sources : wget https://sourceware.org/pub/valgrind/valgrind-3.17.0.tar.bz2
Decompress archive tar xvf valgrind-3.17.0.tar.bz2
Go to uncompressed archive cd valgrind-3.17.0
Configure ./configure
Compile make
Install make install (with root rights, eg. sudo)
Note: very useful for Raspberry Pi 4 users - Default valgrind installation generate a lot of internal errors. See Valgrind reports hundreds of errors in Hello World program on RaspberryPi 4B
All major linux distributions will include valgrind in their repositories. You can find this on debian derived, apt based systems with:
apt search valgrind
But first just try:
apt install valgrind
It should work, and pull in any dependencies. Remember, if you are not the superuser, you'll need to preface those with sudo.
It's a great tool, have fun.
i think its due to dependency not met.
install g++
by
sudo apt-get install g++
then try again.
error is due to exec is unable to find any package named g++
When trying to install Valgrind in Ubuntu 20.04, you can use apt or snap (notice the version number):
:~/valgrind-3.18.1$ valgrind
Command 'valgrind' not found, but can be installed with:
sudo snap install valgrind # version 3.18.1, or sudo apt install
valgrind # version 1:3.15.0-1ubuntu9.1
Although snap provides the latest version, I preferred to install it natively by compiling the source code following the #g10guang instructions.

Resources