Mahout 0.13.0 spark-shell examples fails with "no jniViennaCL in java.library.path" - java-native-interface

I'm Trying to make Mahout 0.13.0 works with spark 1.6.3,
I already have spark 1.6.3 and Hadoop 2.7 working.
I download the last build from the homepage mahout_download.
Unpackage on /opt/mahout.
try to execute the example on spark-shell from the web.
Enter on the scala prompt
MASTER=local mahout spark-shell
Execute:
:load /opt/mahout/examples/bin/SparseSparseDrmTimer.mscala
timeSparseDRMMMul(1000,1000,1000,1,.02,1234L)
And I get thw follow error:
18/08/08 15:22:23 ERROR executor.Executor: Exception in task 0.0 in stage 3.0 (TID 3)
java.lang.UnsatisfiedLinkError: no jniViennaCL in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:726)
at org.bytedeco.javacpp.Loader.load(Loader.java:501)
at org.bytedeco.javacpp.Loader.load(Loader.java:434)
at org.apache.mahout.viennacl.opencl.javacpp.Context$.loadLib(Context.scala:63)
at org.apache.mahout.viennacl.opencl.javacpp.Context$.<init>(Context.scala:65)
at org.apache.mahout.viennacl.opencl.javacpp.Context$.<clinit>(Context.scala)
at org.apache.mahout.viennacl.opencl.GPUMMul$.org$apache$mahout$viennacl$opencl$GPUMMul$$gpuSparseRWRW(GPUMMul.scala:282)
at org.apache.mahout.viennacl.opencl.GPUMMul$.org$apache$mahout$viennacl$opencl$GPUMMul$$jvmSparseRWCW(GPUMMul.scala:343)
at org.apache.mahout.viennacl.opencl.GPUMMul$$anonfun$18.apply(GPUMMul.scala:86)
at org.apache.mahout.viennacl.opencl.GPUMMul$$anonfun$18.apply(GPUMMul.scala:86)
at org.apache.mahout.viennacl.opencl.GPUMMul$.apply(GPUMMul.scala:127)
at org.apache.mahout.viennacl.opencl.GPUMMul$.apply(GPUMMul.scala:33)
at org.apache.mahout.math.scalabindings.RLikeMatrixOps.$percent$times$percent(RLikeMatrixOps.scala:37)
at org.apache.mahout.sparkbindings.blas.ABt$.org$apache$mahout$sparkbindings$blas$ABt$$mmulFunc$1(ABt.scala:98)
at org.apache.mahout.sparkbindings.blas.ABt$$anonfun$6.apply(ABt.scala:113)
at org.apache.mahout.sparkbindings.blas.ABt$$anonfun$6.apply(ABt.scala:113)
at org.apache.mahout.sparkbindings.blas.ABt$$anonfun$pairwiseApply$1.apply(ABt.scala:209)
at org.apache.mahout.sparkbindings.blas.ABt$$anonfun$pairwiseApply$1.apply(ABt.scala:209)
at scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
at org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:191)
at org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:64)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:73)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
at org.apache.spark.scheduler.Task.run(Task.scala:89)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:227)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.UnsatisfiedLinkError: /tmp/javacpp106197113868261/libjniViennaCL.so: libOpenCL.so.1: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:709)
... 27 more
After a search for the problem, I install the ViennaCL libraries as is showed on the web.
mkdir ~/tmp
cd ~/tmp && git clone https://github.com/viennacl/viennacl-dev.git
cp -r viennacl/ /usr/local/
cp -r CL/ /usr/local/
Also, I try with copying on the path: /usr/local/include/
But nothing change...

When working with ViennaCL, you must build from source. Please try pulling the mahout 0.13.0 tag and build from source (with the -Pviennacl profile activated).

Related

How to add trix.css when it is removed after pruning?

After pruning with the command "docker system prune -a" nodejs wont build anymore beacuse trix.css is missing. I am assuming this was probably deleted while pruning. How can I resolve this error (see the error below)? Why is it not created again while building the container again since the file is in the docker file.
Required path doesn't exist: /code/bower_components/trix/dist/trix.css trix
[13:57:39] 'vendorcss' errored after 1.63 ms
[13:57:39] Error: Promise rejected without Error
at Domain.onError (/usr/local/lib/node_modules/gulp/node_modules/async-done/index.js:49:15)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
at Domain.emit (events.js:211:7)
at Domain._errorHandler (domain.js:134:21)
at process._fatalException (bootstrap_node.js:375:33)
[13:57:39] 'staging' errored after 41 ms
ERROR: Service 'nodejs' failed to build: The command '/bin/sh -c gulp staging' returned a non-
zero code: 1
Usually I use this command : "sudo docker-compose -f docker-compose-staging.yml build nodejs" when I want to build the container again. I am very new to this and would be greatfull for some help.
For me, this was the case:
The issue exists because trix.css was removed in the latest version. It has nothing to do with docker system prune as far as I understand.
You can compare the two versions here: https://github.com/basecamp/trix/compare/1.3.1...v2.0.0
Basically, in order to fix this issue, you need to do
yarn install
yarn build
inside bower_components. This is suggested in the official updated README of the trix repository: https://github.com/basecamp/trix.
Once done with that, you will have trix.css and trix.umd.min.js files for your perusal.

regarding about export of neptune data

I am trying to export Neptune RDF data using the following tools.
amazon-neptune-tools/neptune-export at master · awslabs/amazon-neptune-tools
https://github.com/awslabs/amazon-neptune-tools/tree/master/neptune-export
But, Error occurs.
Error
[ec2-user#bastin neptune-export]$ sh ./bin/neptune-export.sh export-rdf -e neptestdb-cluster.cluster-xxxxxx.ap-northeast-1.neptune.amazonaws.com -d /home/ec2-user/output
Creating statement files
Completed export-rdf in 1 seconds
An error occurred while exporting from Neptune:
java.lang.RuntimeException: java.lang.NullPointerException
at com.amazonaws.services.neptune.rdf.NeptuneSparqlClient.executeQuery(NeptuneSparqlClient.java:166)
at com.amazonaws.services.neptune.rdf.io.ExportRdfGraphJob.execute(ExportRdfGraphJob.java:31)
at com.amazonaws.services.neptune.ExportRdfGraph.run(ExportRdfGraph.java:55)
at com.amazonaws.services.neptune.NeptuneExportCli.main(NeptuneExportCli.java:54)
Caused by: java.lang.NullPointerException
at com.amazonaws.services.neptune.rdf.io.EnhancedTurtleWriter.handleStatement(EnhancedTurtleWriter.java:42)
at com.amazonaws.services.neptune.rdf.NeptuneSparqlClient$2.handleSolution(NeptuneSparqlClient.java:161)
at org.eclipse.rdf4j.query.resultio.binary.BinaryQueryResultParser.parse(BinaryQueryResultParser.java:192)
at org.eclipse.rdf4j.query.resultio.AbstractTupleQueryResultParser.parseQueryResult(AbstractTupleQueryResultParser.java:48)
at org.eclipse.rdf4j.http.client.SPARQLProtocolSession.getTupleQueryResult(SPARQLProtocolSession.java:693)
at org.eclipse.rdf4j.http.client.SPARQLProtocolSession.sendTupleQuery(SPARQLProtocolSession.java:372)
at org.eclipse.rdf4j.repository.sparql.query.SPARQLTupleQuery.evaluate(SPARQLTupleQuery.java:55)
at com.amazonaws.services.neptune.rdf.NeptuneSparqlClient.executeQuery(NeptuneSparqlClient.java:126)
... 3 more
[ec2-user#bastin neptune-export]$
The procedure is as follows.
Command
1. download tool
git clone https://github.com/awslabs/amazon-neptune-tools.git
2. install mvn for build
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version
3. execute build
cd /home/ec2-user/amazon-neptune-tools/neptune-export
mvn clean install
4. exexute neptune-export.sh
cd /home/ec2-user/amazon-neptune-tools/neptune-export
sh ./bin/neptune-export.sh export-rdf -e https://neptestdb-cluster.cluster-xxxxxxx.ap-northeast-1.neptune.amazonaws.com -d /home/ec2-user/output
If you have any idea, please contact us.
thank you for your cooperation.
Thanks for reporting this. I've identified the problem and will push an update to the repository later today or tomorrow. In the meantime, you can replace line 42 in EnhancedTutleWriter.java with the following:
Resource context = statement.getContext();
if (context != null){
prefixes.parse(context.stringValue(), this);
}

Can't install php imap extension on centos 7

Running command
sudo yum install php56w-imap
gives me the output:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirrors.163.com
* updates: mirrors.163.com
* webtatic: uk.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php56w-imap.x86_64 0:5.6.22-1.w7 will be installed
--> Processing Dependency: libc-client.so.2007()(64bit) for package: php56w-imap-5.6.22-1.w7.x86_64
--> Finished Dependency Resolution
Error: Package: php56w-imap-5.6.22-1.w7.x86_64 (webtatic)
**Requires: libc-client.so.2007()(64bit)**
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
I'm avoiding any compilation, so the --libdir=/usr/lib64 option for compiling php is not what I'm looking for.
Also, I couldn't find any valid download link for this library.
Please help!
I found it:
https://www.rpmfind.net/linux/rpm2html/search.php?query=libc-client.so.2007()(64bit)
What I tried to install is libc-client-devel but it failed for dependency. with this libc-client, everything works well
just install first with command:
yum install php-imap*
I was getting an SE_UID not found error.
I just stumbled on https://centos.pkgs.org/7/ius-x86_64/php72u-imap-7.2.17-1.ius.centos7.x86_64.rpm.html
and then I ran:
yum install php72u-imap
I also created a php file with echo phpinfo() and saw that IMAP now shows up as a separate section in the display.

apktool build apk fails

I am experiencing very annoying problems with the application apktool problem.
I do not understand what i am doing wrong, or what the problem is.
I tried this on debian , and on linux mint. I used different versions of apktool,
resulting in the same error:
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL3630495287059303807.tmp, -I, /home/awesomename/apktool/framework/1.apk, -S, /home/awesomename/out/./res, -M, /home/awesomename/out/./AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(Unknown Source)
at brut.androlib.Androlib.buildResourcesFull(Unknown Source)
at brut.androlib.Androlib.buildResources(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.apktool.Main.cmdBuild(Unknown Source)
at brut.apktool.Main.main(Unknown Source)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL3630495287059303807.tmp, -I, /home/windows/apktool/framework/1.apk, -S, /home/windows/out/./res, -M, /home/windows/out/./AndroidManifest.xml]
at brut.util.OS.exec(Unknown Source)
... 7 more
Caused by: java.io.IOException: Cannot run program "aapt": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
at java.lang.Runtime.exec(Runtime.java:617)
at java.lang.Runtime.exec(Runtime.java:485)
... 8 more
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
... 10 more
It seems it can not use aapt , but i read about apktool.
And it seems that aapt is build inside apktool , why is it not working ?
It seems there's some problem in building the resources while recompiling the apk.
what you can do is, when you decompile your apk use this command
apktool d -f -r apkfilename.apk
here -f is to replace previous decompiled apk's code and -r is to ignore the decompiling of resources.
this would prevent the resources from being decompiled and will simply copy the same resources when you recompile the apk.
In case you've been using v1 and now upgraded to v2, try manually deleting the framework file.
On windows 8 it's normally at C:\Users\YourName\apktool\framework\1.apk.
The file should be regenerated once you try to build something.
My problem was solved by deleting the \framework\1.apk, making a backup on the files I modified, ereasing the dir and decompiling the *.apk again, etc... (on linux, the path is home/[user]/apktool/...). After the update, apktool always loaded the old resource table. N
For me, I solved this problem by first clearing apktool's framework directory by typing in the terminal.
$ apktool empty-framework-dir
Afterwards I uninstalled apktool and related files by typing
$ sudo apt purge apktool
Then i went to https://bitbucket.org/iBotPeaches/apktool/downloads/ to get the latest jar file for apktool(apktool_2.5.0.jar as at the time of writing this).
On first run
$ java -jar apktool_2.5.0.jar b <MyAPP.apk> #Without ><
it works.
since I work with apktool most of the times I needed a situation where I can run apktool from anywhere so I gave the jar file execute permissions by typing
$ sudo chmod +x apktool_2.5.0.jar
Afterwards I moved it /usr/bin/ by typing
$ sudo apktool_2.5.0.jar /usr/bin/
Definitely seems like the aapt PATH problem I had awhile back. Have you added aapt to PATH? If you still have problems, I have made a good apk kit in bash to avoid all these dependency problems. It supports apktool, signapk, zipalign,adb, fastboot, and heimdall. Check it out. All you need is a current java install.
http://forum.xda-developers.com/android/development/toolkit-apk-munky-rench-t3026757/post58747626#post58747626
There isn’t really enough information to give you a definite answer.
How ever you mentioned using different versions but the aapt issue was solved in version 2.4. Dependencies have been reduced to java version 1.8 or greater and the framework.
I use Debian and have the following:
Apktool 2.4
java version 11
Android framework
That’s all it took to get rid of the aapt path error.
The last error I came across was unrelated to aapt but was on the framework so I ran this command
apktool empty-framework-dir
And it solved it.
try to put the dir which include aapt file to your PATH. for example, export PATH=$PATH:./ ./apktool b
try to install ia32-libs and update latest version of apktool. (if possible restart)
apktool requires "ia32-libs" which is not available after Ubuntu 12.04. install ia32-libs
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
Download latest version of apktools.jar - https://bitbucket.org/iBotPeaches/apktool/downloads
apktool complete installation guide - http://ibotpeaches.github.io/Apktool/install/
I just encounter same problem when run apktool d foo.apk(decompiled success) and then apktool b foo(recompile failed with similar error).
The apktool tool above was installed via sudo apt-get install apktool on Kali Linux.
So, the solution was visits apktool's official site, e.g. https://connortumbleson.com/2017/01/23/apktool-v2-2-2-released/ (it's latest version at this time of writing), download it, md5sum it, e.g. md5sum apktool_2.2.2.jar to verify, then rename that apktool_2.2.2.jar to apktool.jar.
Then do java -jar ./apktool.jar b foo to recompile, it success without error (the generated apk located at ./foo/dist/foo.apk).
The main issue is apktool version you need 2.4.0
You must manually install it from ibotpeaches git hub
here some good info
https://www.youtube.com/watch?v=kB6s10Uwpcs
and a automated script for kali
https://github.com/catenatedgoose?tab=repositories
In my mind the problem is how you install apktool...
I had the same problem and I did this and it worked very well:
For installation you first have to remove any installed apktool by the command:
sudo apt purge apktool
Then you'll have to install apktool but in a different way.
To continue save the link bellow as apktool in a directory.
[https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool]
Then open this link below and download the latest apktool.jar file: https://bitbucket.org/iBotPeaches/apktool/downloads/
Then rename the file as apktool.jar
After that give both files the permission by the command:
Sudo chmod -x apktool.jar
And for the saved script:
Sudo chmod -x apktool
At the end copy both files in the directory:
/usr/local/bin
By the command:
Sudo cp apktool.jar /usr/local/bin
And the script file:
Sudo cp apktool /usr/local/bin
After that try running apktoolin the terminal.
The solution is to include your apktool directory into your system PATH.

How to run clojure on Mac OS X?

I'm following the examples from the book 'Programming Clojure', and I'm at page
17 to run (require 'example.introduction).
I have set clojure at ~/bin/clojure as follows
java -server \
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888 -cp ... clojure.lang.Repl
The -cp contains . (current directory). When I try it with clojure, I get the following error message.
Exception in thread "main" java.lang.ExceptionInInitializerError
at clojure.lang.Repl.(Repl.java:23)
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodError: clojure.lang.MultiFn.(Ljava/lang/String;Lclojure/lang/IFn;Ljava/lang/Object;Lclojure/lang/IRef;)V (utils.clj:0)
at clojure.lang.RT.(RT.java:290)
... 1 more
Caused by: java.lang.NoSuchMethodError: clojure.lang.MultiFn.(Ljava/lang/String;Lclojure/lang/IFn;Ljava/lang/Object;Lclojure/lang/IRef;)V (utils.clj:0)
at clojure.lang.Compiler.eval(Compiler.java:4153)
at clojure.lang.Compiler.load(Compiler.java:4470)
at clojure.lang.RT.loadResourceScript(RT.java:327)
at clojure.lang.RT.loadResourceScript(RT.java:316)
at clojure.lang.RT.load(RT.java:406)
at clojure.lang.RT.load(RT.java:376)
at clojure.core$load__4557$fn__4559.invoke(core.clj:3427)
at clojure.core$load__4557.doInvoke(core.clj:3426)
at clojure.lang.RestFn.invoke(RestFn.java:413)
at clojure.core$load_one__4520.invoke(core.clj:3271)
...
at clojure.lang.RT.loadResourceScript(RT.java:327)
at clojure.lang.RT.loadResourceScript(RT.java:312)
at clojure.lang.RT.maybeLoadResourceScript(RT.java:308)
at clojure.lang.RT.doInit(RT.java:430)
at clojure.lang.RT.(RT.java:286)
... 1 more
Caused by: java.lang.NoSuchMethodError: clojure.lang.MultiFn.(Ljava/lang/String;Lclojure/lang/IFn;Ljava/lang/Object;Lclojure/lang/IRef;)V
at clojure.contrib.duck_streams__init.load(Unknown Source)
at clojure.contrib.duck_streams__init.(Unknown Source)
...
at clojure.lang.Compiler.eval(Compiler.java:4142)
... 28 more
I tried to run clojure as follows.
alias clojure='java -jar $JARDIR/clojure.jar '
But it doesn't have the CLASSPATH that I setup in .bashrc correctly, when I run the command as follows.
(println (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader))))
What might be wrong?
The easiest way is to use Stuart Halloway's code that accompanies the book:
Clone Stu's code from GitHub: $ git clone http://github.com/stuarthalloway/programming-clojure.git
cd into the programming-clojure directory that was created: $ cd programming-clojure
Run the repl.sh script in the bin/ directory: $ ./bin/repl.sh (make sure you run it from the repo root, not the bin/ directory, otherwise it won't work).
The script will set up all the necessary paths, including the paths to the examples in the book.
(You can do it manually, of course, but at any rate, you have to download or clone the programming-clojure source code anyway for the examples to work.)