gnuplot tikz terminal - gnuplot

How do I enable the tikz terminal in gnuplot on Mac Os X(10.6.8)?
I have latex with working tikz. Now I installed lua from http://www.lua.org/ and Downloaded gnuplot4.4.4, unpacked it, and run
$ ./configure
$ sudo make
$ sudo make install
Now I can set the tikz terminal, but there are still problems
gnuplot> set terminal tikz
Terminal type set to 'tikz'
Options are 'color dashed'
gnuplot> plot sin(x)
\begin{tikzpicture}[gnuplot]
/usr/local/share/gnuplot/4.4/lua/gnuplot-tikz.lua:252: bad argument #7 to 'format' (string expected, got no value)
stack
gnuplot>
I have also tried to install homebrew from https://github.com/mxcl/homebrew/wiki/installation although I did not do the Java Developer Update - is that necessary?
Now 'brew install gnuplot' gives problems with the glib dependency
hpek#melda:~$ brew install glib
/usr/local/Library/Homebrew/global.rb:43: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
/usr/local/bin/brew:74: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
/usr/local/Library/Homebrew/build.rb:7: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
==> Downloading ftp://ftp.gnome.org/pub/gnome/sources/glib/2.28/glib-2.28.8.tar.bz2
File already downloaded in /Users/hpek/Library/Caches/Homebrew
==> Downloading patches
curl: (22) The requested URL returned error: 404
######################################################################## 100.0%
######################################################################## 100.0%
######################################################################## 100.0%
######################################################################## 100.0%
######################################################################## 100.0%
==> Patching
/usr/bin/patch: **** Can't open patch file 001-homebrew.diff : No such file or directory
Error: Failure while executing: /usr/bin/patch -f -p0 -i 001-homebrew.diff
hpek#melda:~$
When I install gnuplot manually, am I suppose to know about and install all these dependencies myself?

The problem is that the 252 (or 254 in my version) of the LUA script is using a format command with less argument than necessary. Adding a "X" as #5 argument (a.k.a. script revision number) solves this.
Here is my new code in the script:
gp.write(string.format("%%%% generated with GNUPLOT %sp%s (%s; terminal rev. %s, script rev. %s)\n%%%% %s\n",
term.gp_version, term.gp_patchlevel,
string.sub(term.lua_term_revision,7,-3),"x",
pgf.REVISION,os.date()))
I guess there is better to do if I knew where to find the script revision number.

Try:
brew update
then try it again. This appears to be fixed now.

Related

Shared libraries installing gnuplot5.2

I am trying installing gnuplot 5.2 on a Xubuntu 16.04 LTS amd64 machine.
Yesterday I successfully completed the task on another machine.
Today I followed the same protocol: installing some libraries for cairo, pango and libgd.
I then typed:
./configure --with-cairo --with-gd
make
make check
sudo make install
The installation failed. First make check did not provide the set of checking images and gnuplot command exit with the following error:
gnuplot: error while loading shared libraries: libwx_gtk2u_core-2.8.so.0: cannot open shared object file: No such file or directory
It tried installing libwx_gtk2u but the repositories install 3.0 version and the error still persists.
However ldd /usr/bin/gnuplot output the following line
libwx_gtk2u_core-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
ldd do not output any line containing libwc_gtk2u_core-2.8
I am assuming some package (libwx2.8?) or some link is missed. Any hint?
Install libwxbase2.8-dev and libwxgtk2.8-dev.

Multixterm - "can't find package Expect"

I am attempting to open multixterm on my desktop machine, but I end up with the error:
usr:~> multixterm
can't find package Expect
while executing
"package require Expect"
(file "/usr/local/bin/multixterm" line 6")
Any help would be appreciated. I've tried running multixterm on my laptop and on a friend's machine, and there is no issue there. Both Expect and multixterm exist in the /usr/local/bin/ directory.
Update: I've also found that neither kibitz nor autoexpect will run. I now assume that there is an issue with where the programs are looking for Expect. Does anyone know how I can verify/check that?
First, run ldd /usr/local/bin/expect to find out where the Expect library (libexpect) is. For example:
% ldd /usr/bin/expect | grep libexpect
libexpect.so.5.45 => /usr/lib/x86_64-linux-gnu/libexpect.so.5.45 (0x00007f230f348000)
%
Then, export the TCLLIBPATH var with the libexpect directory. For example (seems like you're using csh):
% setenv TCLLIBPATH /usr/lib/x86_64-linux-gnu
Then run your multixterm command.
Expect was dropped from ubuntu's default installation,
run once:
conda install -c eumetsat Expect
and things should work again.
In my experience on Ubuntu, libexpect.so obtained through apt cannot be used for package require because the file contains 3 undefined-symbols. (E.g. Debian Bug report logs - #890228)
So I compiled the libexpect.so from its source. To do so, I had to compile 3 sources: Tcl, Tk, and Expect.
After decompressing sources, installing by following:
$ cd /path/to/install
$ mkdir tcl tk expect
$
$ /path/to/download/tcl8.*.*/unix/configure \
--prefix=/path/to/install/tcl
$ make ; make install
$
$ /path/to/download/tk8.*.*/unix/configure \
--with-tcl=/path/to/install/tcl \
--prefix=/path/to/install/tk
$ make ; make install
$
$ /path/to/download/expect5.*.*/configure \
--with-tclconfig=/path/to/install/tcl/lib \
--with-tkconfig=/path/to/install/tk/lib \
--prefix=/path/to/install/expect
$ make ; make install
gave me the file /path/to/install/expect/libexpect5.*.*.so for 64-bit architecture without undefined-symbols.
Here are 2 useful links about compiling:
How to Compile Tcl
[SOLVED] configuration error: Can't find Tcl configuration definition
Finally, in the case TCLLIBPATH does not work, unwarping approach using TclKits with sdx can be remedy. On Ubuntu, I used one for RHEL5 x86_64.

Installing erlang from tar resulting in errors, wondering how to specify folders

I had the inspiration to start messing around with Erlang and I am having problems installing it... I am using Linux Mint 16 (petra). I installed the dependencies, and then downloaded otp_src_17.1.tar.gz and ran 'tar -zxf otp_src_17.1.tar.gz' I then ran ./configure which gave me some errors that made it impossible to run make.
These are the errors I'm getting (actually what I did was I did ./configure > configure.txt to get all the lines it prints as it configures, and it conveniently still printed to the console everything that has errors - neat)
configure: WARNING: No odbc library found skipping odbc
configure: WARNING: "ODBC library - header check failed"
configure: WARNING: "ODBC library - link check failed"
rm: remove write-protected regular file './CONF_INFO'?
configure: WARNING: No GLU headers found, wx will NOT be usable
/home/core/Desktop/otp_src_17.1/lib/wx/./configure: line 5195: wx-config: command not found
/home/core/Desktop/otp_src_17.1/lib/wx/./configure: line 5893: ./CONF_INFO: Permission denied
configure: WARNING:
wxWidgets must be installed on your system.
Please check that wx-config is in path, the directory
where wxWidgets libraries are installed (returned by
'wx-config --libs' or 'wx-config --static --libs' command)
is in LD_LIBRARY_PATH or equivalent variable and
wxWidgets version is 2.8.4 or above.
rm: remove write-protected regular file 'doc/CONF_INFO'?
/home/core/Desktop/otp_src_17.1/erts/configure: line 6466: doc/CONF_INFO: Permission denied
configure: WARNING: No 'xsltproc' command found: the documentation cannot be built
/home/core/Desktop/otp_src_17.1/erts/configure: line 6513: doc/CONF_INFO: Permission denied
configure: WARNING: No 'fop' command found: going to generate placeholder PDF files
configure: error: No curses library functions found
configure: error: /bin/bash '/home/core/Desktop/otp_src_17.1/erts/configure' failed for erts
The thing is - I know that I have the ncurses library, as evidenced by the fact that when I do "sudo apt-get install ncurses-base ncurses-bin" it says:
Reading package lists... Done
Building dependency tree
Reading state information... Done
ncurses-base is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
When I run "locate ncurses" it gives me the following:
/lib/i386-linux-gnu/libncurses.so.5
/lib/i386-linux-gnu/libncurses.so.5.9
/lib/x86_64-linux-gnu/libncurses.so.5
/lib/x86_64-linux-gnu/libncurses.so.5.9
/lib/x86_64-linux-gnu/libncursesw.so.5
/lib/x86_64-linux-gnu/libncursesw.so.5.9
/usr/bin/ncurses5-config
/usr/bin/ncursesw5-config
/usr/lib/vlc/plugins/gui/libncurses_plugin.so
/usr/share/doc/libncurses5
/usr/share/doc/libncursesw5
/usr/share/doc/ncurses-base
/usr/share/doc/ncurses-bin
/usr/share/doc/ncurses-base/changelog.Debian.gz
/usr/share/doc/ncurses-base/copyright
/usr/share/doc/ncurses-bin/FAQ
/usr/share/doc/ncurses-bin/changelog.Debian.gz
/usr/share/doc/ncurses-bin/copyright
/usr/share/lintian/overrides/ncurses-base
/usr/share/man/man1/ncurses5-config.1.gz
/usr/share/man/man1/ncursesw5-config.1.gz
/var/cache/apt/archives/libncurses5_5.9+20130608-1ubuntu1_i386.deb
/var/lib/dpkg/info/libncurses5:amd64.list
/var/lib/dpkg/info/libncurses5:amd64.md5sums
/var/lib/dpkg/info/libncurses5:amd64.postinst
/var/lib/dpkg/info/libncurses5:amd64.postrm
/var/lib/dpkg/info/libncurses5:amd64.shlibs
/var/lib/dpkg/info/libncurses5:amd64.symbols
/var/lib/dpkg/info/libncurses5:i386.list
/var/lib/dpkg/info/libncurses5:i386.md5sums
/var/lib/dpkg/info/libncurses5:i386.postinst
/var/lib/dpkg/info/libncurses5:i386.postrm
/var/lib/dpkg/info/libncurses5:i386.shlibs
/var/lib/dpkg/info/libncurses5:i386.symbols
/var/lib/dpkg/info/libncursesw5:amd64.list
/var/lib/dpkg/info/libncursesw5:amd64.md5sums
/var/lib/dpkg/info/libncursesw5:amd64.postinst
/var/lib/dpkg/info/libncursesw5:amd64.postrm
/var/lib/dpkg/info/libncursesw5:amd64.shlibs
/var/lib/dpkg/info/libncursesw5:amd64.symbols
/var/lib/dpkg/info/ncurses-base.conffiles
/var/lib/dpkg/info/ncurses-base.list
/var/lib/dpkg/info/ncurses-base.md5sums
/var/lib/dpkg/info/ncurses-bin.list
/var/lib/dpkg/info/ncurses-bin.md5sums
I am at a loss as to where to proceed. Thanks for any help
I believe you need to install ncurses-dev
'sudo yum install ncurses-devel.x86_64' prior to running ./configure worked just fine for me. Fedora 21 x64, btw.
After I extracted the tar, the documentation was in '/opt_src_{version}/HOWTO/INSTALL.md. The contents of which states:
Required Utilities
These are the tools you need in order to unpack and build Erlang/OTP.
WARNING: Please have a look at the [Known platform issues][] chapter
before you start.
Unpacking
GNU unzip, or a modern uncompress.
A TAR program that understands the GNU TAR format for long filenames.
Building
GNU make
Compiler -- GNU C Compiler, gcc or the C compiler frontend for LLVM, clang.
Perl 5
GNU m4 -- If HiPE (native code) support is enabled. HiPE can be
disabled using --disable-hipe
ncurses, termcap, or termlib -- The development headers and
libraries are needed, often known as ncurses-devel. Use
--without-termcap to build without any of these libraries. Note that
in this case only the old shell (without any line editing) can be used.
sed -- Stream Editor for basic text transformation.
ncurses just happened to be the only required package I didn't have installed on this development VM. So your mileage may vary.
This was the output of 'locate ncurses' after I installed the ncurses lib:
/usr/lib64/libncurses++.so.5
/usr/lib64/libncurses++.so.5.9
/usr/lib64/libncurses++w.so.5
/usr/lib64/libncurses++w.so.5.9
/usr/lib64/libncurses.so.5
/usr/lib64/libncurses.so.5.9
/usr/lib64/libncursesw.so.5
/usr/lib64/libncursesw.so.5.9
/usr/share/doc/ncurses
/usr/share/doc/ncurses-base
/usr/share/doc/ncurses/ANNOUNCE
/usr/share/doc/ncurses/AUTHORS
/usr/share/doc/ncurses/NEWS.bz2
/usr/share/doc/ncurses/README
/usr/share/doc/ncurses/TO-DO
/usr/share/doc/ncurses-base/README
/usr/share/licenses/ncurses-base
/usr/share/licenses/ncurses-base/COPYING
So I'd say the OP had a corrupt / bad ncurses install. I'm just posting this here because this was the #1 Google result I got when I was too lazy to RTFD.
One alternative is using the option "--without-termcap"
otp_src_18.0/configure file says:
--without-termcap do not use any termcap libraries
(ncurses,curses,termcap,termlib)
./configure --prefix=/home/username/erlang/18.0 --without-termcap
Set your PATH variable as shown below.
export PATH=$PATH=/home/username/erlang/18.0/bin
Not sure about implications though. :)
Hope this helps someone.

Call external script from matlab failed on Ubuntu

I searched many times but didn't get the problem solved. I called an external R script from matlab using system()/unix() and find the shared library is mis-loaded. I know the environment is wrong in matlab. I also tried wrapped the command in xterm or gnome-terminal but didn't make it. How can I load the correct env variables? Is there a way to reset back to the OS's env variables before the call?
>> !export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/
% also tried - !export LD_LIBRARY_PATH=/usr/lib64;
>> unix('Rscript /home/gary/testRF1.R')
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/lib/R/library/stats/libs/stats.so':
/usr/local/MATLAB/R2012a/sys/os/glnxa64/libgfortran.so.3: version `GFORTRAN_1.4' not found (required by /usr/lib/liblapack.so.3gf)
During startup - Warning message:
package ‘stats’ in options("defaultPackages") was not found
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/lib/R/library/stats/libs/stats.so':
/usr/local/MATLAB/R2012a/sys/os/glnxa64/libgfortran.so.3: version `GFORTRAN_1.4' not found (required by /usr/lib/liblapack.so.3gf)
Error: package or namespace load failed for ‘R.matlab’
Execution halted
ans =
1
Distribution: Ubuntu 12.04.3
R info:
platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 3
minor 0.2
year 2013
month 09
day 25
svn rev 63987
language R
version.string R version 3.0.2 (2013-09-25)
nickname Frisbee Sailing
many thanks,
Gary
One solution is to change the libgfortran that you want to use.
Open a terminal and cd to "local_MATLAB"/sys/os/"your_os"/
Check that libgfortran.so.3 is a symbolic link pointing to ligfortran.so.3.0.0 and remove it
otherwise copy libgfortran.so.3 for backup in case anything goes wrong
locate your own libgfortran and make the symbolic link point to it
On my system this would look like :
cd /usr/local/MATLAB/R2012a/sys/os/glnxa64/
rm libgfortran.so.3
ln -s -T /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0 libgfortran.so.3
If you're on UNIX, libgfortran should already be installed, you can find it with:
locate libgfortran
Remember to restart MATLAB so the changes apply
I assume that you can run Rscript from your terminal successfully. If that is the case, then
the solution your problem is that you want to use setenv inside matlab instead of !export. You probably want to look at this question: Start application from Matlab

arm-none-eabi commands will not install correctly

I'm attempting to install a toolchain for assembly code on the raspberry pi. I used the following procedure to install the package files:
$ wget http://www.cl.cam.ac.uk/freshers/raspberrypi/tutorials/os/downloads/arm-none-eabi.tar.bz2
--2012-08-16 18:26:29-- http://www.cl.cam.ac.uk/freshers/raspberrypi/tutorials/os/downloads/arm-none-eabi.tar.bz2
Resolving www.cl.cam.ac.uk (www.cl.cam.ac.uk)... 128.232.0.20, 2001:630:212:267::80:14
Connecting to www.cl.cam.ac.uk (www.cl.cam.ac.uk)|128.232.0.20|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 32108070 (31M) [application/x-bzip2]
Saving to: `arm-none-eabi.tar.bz2'
100%[======================================>] 32,108,070 668K/s in 67s
2012-08-16 18:27:39 (467 KB/s) - `arm-none-eabi.tar.bz2' saved [32108070/32108070]
$ tar xjvf arm-none-eabi.tar.bz2
arm-2008q3/arm-none-eabi/
arm-2008q3/arm-none-eabi/lib/
arm-2008q3/arm-none-eabi/lib/libsupc++.a
arm-2008q3/arm-none-eabi/lib/libcs3arm.a
...
arm-2008q3/share/doc/arm-arm-none-eabi/info/gprof.info
arm-2008q3/share/doc/arm-arm-none-eabi/info/cppinternals.info
arm-2008q3/share/doc/arm-arm-none-eabi/LICENSE.txt
$ export PATH=$PATH:$HOME/arm-2008q3/bin
That appeared to work, the package files are in the correct place.
~/arm-2008q3/bin $ ls
arm-none-eabi-addr2line arm-none-eabi-gcc-4.3.2 arm-none-eabi-objdump
arm-none-eabi-ar arm-none-eabi-gcov arm-none-eabi-ranlib
arm-none-eabi-as arm-none-eabi-gdb arm-none-eabi-readelf
arm-none-eabi-c++ arm-none-eabi-gdbtui arm-none-eabi-run
arm-none-eabi-c++filt arm-none-eabi-gprof arm-none-eabi-size
arm-none-eabi-cpp arm-none-eabi-ld arm-none-eabi-sprite
arm-none-eabi-g++ arm-none-eabi-nm arm-none-eabi-strings
arm-none-eabi-gcc arm-none-eabi-objcopy arm-none-eabi-strip
However, when I go to make, I get the following outcome.
arm-none-eabi-as -I source/ source/main.s -o build/main.o
make: arm-none-eabi-as: Command not found
make: *** [build/main.o] Error 127
Thanks in advance for any help.
export PATH=$PATH:$HOME/arm-2008q3/bin is only valid in the shell it is executed in (and any shells spawned from that shell). So you either use that shell instead of opening a new one to execute make or edit your ~/.bashrc (see Unix: Getting Export PATH to "Stick")
I encountered the same problem and in my case the problem was that I was running a 64-bit operating system and the package to be used is a 32-bit. The fix was to install i32-libs package which allows running 32-bit applications on a 64-bit system.
# apt-get install ia32-libs
You have to direct your compiler to the right path where arm-none-eabi-as is located. You can do so by
export PATH=$PATH:/file_path_goes_here/
When you compile, you should have no problems as the compiler will now know where to look.

Resources