How to compile and run a vmmlib test program? - c++

I have successfully installed vmmlib 1.7 using the following steps:
Downloaded the files from https://github.com/VMML/vmmlib/tree/1.7
and followed the steps below:
mkdir vmmlib/build
cd vmmlib/build
cmake ..
make
Now, I'm trying to run a program in the test folder "t3_hosvd_test.cpp" , but I'm not able to run it.
I tried to run the Makefile but got the following error:
svd_test.cpp:13:0:
../include/vmmlib/vmmlib.hpp:33:30: fatal error: vmmlib/version.hpp: No such file or directory
compilation terminated.
: recipe for target 'svd_test.o' failed
make: *** [svd_test.o] Error 1
I also tried to run by giving the following command in the terminal:
g++ t3_hosvd_test.cpp -lapack -lvmmlib
but got an error:
t3_hosvd_test.cpp:2:31: fatal error: vmmlib/t3_hosvd.hpp: No such file or directory
compilation terminated.
Can someone help me compile and run this program on Ubuntu 16.04?

When compiling directly, you need to provide the include path via the -I option.
g++ t3_hosvd_test.cpp -I/usr/local/vmmlib17/include -lapack -lvmmlib
Also ensure that your include path is set to vmmlib/include and not vmmlib/include/vmmlib

Related

How to install C++ lib Duckx?

I want to use this lib DuckX. I followed tutorial,
git clone https://github.com/amiremohamadi/DuckX.git
cd DuckX
mkdir build
cd build
cmake ..
cmake --build .
It went on without any error. However, when I entered sample directory and execute g++ sample1.cpp -lduckx, it got the following error message,
sample1.cpp:1:10: fatal error: duckx.hpp: No such file or directory
#include "duckx.hpp"
^~~~~~~~~~~
compilation terminated.
I wonder how I can successfully use this lib. Could you please tell me what I can do to make the program use this lib. Thanks.

fatal error: openssl/ssl.h: No such file or directory

I'm coming from Python and new to C++ and am trying to test a program which retrieves data via websockets.
I copied this github repository with
git clone https://github.com/tensaix2j/binacpp
I'm trying to run the example so I filled in the api key and secret in:
/binacpp/example/example.cpp
Now from /binacpp/example folder I'm trying
make example
and I'm getting this error:
Making example
g++ -I../lib/libcurl-7.56.0/include -I../lib/jsoncpp-1.8.3/include -I../lib/libwebsockets-2.4.0/include -I../lib/libbinacpp/include \
example.cpp \
-L../lib/libcurl-7.56.0/lib \
-L../lib/libwebsockets-2.4.0/lib \
-L../lib/libbinacpp/lib \
-lcurl -ljsoncpp -lcrypto -lwebsockets -lbinacpp -o example
In file included from ../lib/libbinacpp/include/binacpp_websocket.h:16:0,
from example.cpp:8:
../lib/libwebsockets-2.4.0/include/libwebsockets.h:214:10: fatal error: openssl/ssl.h: No such file or directory
#include <openssl/ssl.h>
^~~~~~~~~~~~~~~
compilation terminated.
Makefile:25: recipe for target 'example' failed
make: *** [example] Error 1
user#ip:/opt/binacpp/example$ ^C
user#ip:/opt/binacpp/example$ ./example.run.sh
./example: error while loading shared libraries: librtmp.so.0: cannot open shared object file: No such file or directory
I'm trying to figure out why I'm getting this error and what to do with it?
1) It says on the readme that the dependencies are
jsoncpp-1.8.3
libcurl-7.56.0
libwebsockets-2.4.0
However these are included in the repository
2) if maybe it is assumed that openssl normally is already installed, how do I know which version to install? And how do I install this, because with Python you can just use pip and everything will be placed in the correct directories for including it in your program.
It looks like that the development package for openssl is not installed:
https://stackoverflow.com/a/3016986/5147260

Q: Not able to install DTW algorithm in DSX's R notebook

I am trying to install DTW package of R in DSX's R notebook.
when running install command:
install.packages("dtw")
gives following error:
"installation of package ‘dtw’ had non-zero exit status” warning.
Additional output from the installation attempt can be found in the log file for your R kernel. In the R notebook, execute
Sys.getenv("LOG_FILE")
to get the name of the log file. Then open a Python notebook and execute
!cat <name-of-the-log-file>
to see the contents of the log file.
After trying to install dtw, my log file showed:
gcc -std=gnu99 -shared -L/usr/local/lib64 -o dtw.so computeCM.o Launching java with spark-submit command /usr/local/src/spark20master/spark/bin/spark-submit sparkr-shell /gpfs/fs01/user/s10d-7f8820dde34dec-4cf890276e2b/notebook/tmp/RtmpofrZnw/backend_portd1c4793df5e
which looks like garbled log output from two processes writing to the same log file. But a bit further down, I find:
gcc: error: Launching: No such file or directory
gcc: error: java: No such file or directory
gcc: error: with: No such file or directory
gcc: error: spark-submit: No such file or directory
gcc: error: command: No such file or directory
gcc: error: sparkr-shell: No such file or directory
gcc: error: /gpfs/fs01/user/s10d-7f8820dde34dec-4cf890276e2b/notebook/tmp/Rtmpkh93V2/backend_porte8853270b27: No such file or directory
make: *** [dtw.so] Error 1
ERROR: compilation failed for package ‘dtw’
So the garbled line was actually executed. I'd say that the installation logic for the dtw package makes some assumptions about the environment which are not satisfied in DSX.
To dig further into the problem, you'll have to debug the dtw installer, or find somebody who can do that for you.

Error building llvm 3.0

I was trying to get llvm 3.0 on my machine, but I get the following errors when I give make -k.
chethan#ubuntu:~/llvm-3.0$ make
make[1]: Entering directory `/home/chethan/llvm-3.0/lib/Support'
llvm[1]: Compiling APFloat.cpp for Release build
In file included from APFloat.cpp:15:
In file included from /home/chethan/llvm-3.0/include/llvm/ADT/APFloat.h:104:
In file included from /home/chethan/llvm-3.0/include/llvm/ADT/APInt.h:18:
In file included from /home/chethan/llvm-3.0/include/llvm/ADT/ArrayRef.h:13:
In file included from /home/chethan/llvm-3.0/include/llvm/ADT/SmallVector.h:17:
/home/chethan/llvm-3.0/include/llvm/Support/type_traits.h:20:10: fatal error: 'utility' file not found
#include <utility>
^
1 error generated.
make[1]: *** [/home/chethan/llvm-3.0/lib/Support/Release/APFloat.o] Error 1
make[1]: Leaving directory `/home/chethan/llvm-3.0/lib/Support'
make: *** [all] Error 1
I follow these steps to build llvm on my machine.
Get the llvm source zip file from llvm download page and unzipped to folder llvm-3.0
cd /home/chethan/llvm-3.0
./configure
make -k
Although in this case, I just gave 'make' so that it stops on first error. I have llvm-gcc 4.2 installed on my machine.
I followed the same steps today morning in my home machine, and llvm-3.0 built successfully! Any idea what might be missing here?
configure with CC=gcc CXX=g++. It looks like the configure script is finding a version of clang that isn't actually set up correctly to compile C++ code.

Compiling Festival on MingW32

I'm trying to compile Festival on MingW32, so I can have a Windows binary. I couldn't find the Windows binary on their site. Anyone have one they can post?
If not, here's what I have so far. I did the ./configure and make for it and have the following message:
$ make
config/config:43: ../speech_tools/config/config: No such file or directory
So, I downloaded the speech_tools tar ball and got. Did the ./configure and make to get:
$ make
config/config:156: config/systems/ix86_unknown.mak: No such file or directory
../config/config:156: ../config/systems/ix86_unknown.mak: No such file or directory
make: *** No rule to make target `../config/systems/ix86_unknown.mak'. Stop.
config/rules/modules.mak:133: config/modincludes.inc: No such file or directory
make --no-print-directory -C ./config MADE_FROM_ABOVE=1 MODINCLUDES=1 INCLUDE_EVERYTHING='' modincludes.inc
../config/config:156: ../config/systems/ix86_unknown.mak: No such file or directory
make[1]: *** No rule to make target `../config/systems/ix86_unknown.mak'. Stop.
make: *** [config/modincludes.inc] Error 2
So, I copied config/systems/ix86_CYGWIN32.mak to ix86_unknown.mak and tried again. Now I get this message:
g++ -c -fno-implicit-templates -O3 -Wall -Wno-non-template-friend -Wno-deprecated -DSUPPORT_EDITLINE -I../include slib.cc
In file included from slib.cc:85:
../include/EST_unix.h:53:25: sys/wait.h: No such file or directory
../include/EST_unix.h:54:29: sys/resource.h: No such file or directory
In file included from ../include/EST_String.h:50,
from ../include/siod.h:17,
from slib.cc:88:
../include/EST_iostream.h:54:26: strstream.h: No such file or directory
In file included from ../include/EST_TList.h:50,
from ../include/EST_string_aux.h:43,
from ../include/siod.h:18,
from slib.cc:88:
Where do I get sys/wait.h, sys/resource.h and strstream.h? I'd rather not have to try this whole bit in Cygwin and carry around those annoying DLL's. Any advice?
Windows binaries are available here
You'll get further with a full cygwin install instead of just mingwin, but I can't promise success.
I run Ubuntu and remember having Festival available in the Synaptics repository, implying I just had to double click the name, and the thing installed itself with all its dependencies.
If all else fails, you might want to run a VM with ubuntu or dual boot.