upgrade to mspsim 4.7.3 - msp430

I am working on RPL Routing protocol on contiki os. when i want to run rpl-tsch example i get an error that told me there is not enough space on ROM. by reading enter link description here understand that must upgrade mspsim from 4.6 to 4.7.3. I am using ubuntu 16.04 64-bit on Vmware. these are the steps that i do:
download msp4.7.3 binary from here: https://github.com/pksec/msp430-gcc-4.7.3
extract it on /opt/compilers so the content of /opt/compilers is:
enter image description here
add /opt/compilers/mspgcc-4.7.3/MSP430/bin/ to /etc/enviroment so the content of this file is:
PATH="/opt/compilers/mspgcc-4.7.3/msp430/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
4.add export PATH=$PATH:/opt/compilers/mspgcc-4.7.3/bin to /home/.profile
5.remove msp430 4.6 using this command: sudo apt-get remove gcc-msp430
6.restart virtual machine
7.now the $PATH is:
/opt/compilers/mspgcc-4.7.3/msp430/bin:/home/ubuntu/bin:/home/ubuntu/.local/bin:/opt/compilers/mspgcc-4.7.3/msp430/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
but when type msp430-gcc --version I get this error:
The program 'msp430-gcc' is currently not installed. You can install it by typing:
sudo apt install gcc-msp430

Related

Installing Atom Editor SQLformat on a Mac for Beautify Package

I have the Atom editor installed on my Mac, with the Beautify Package. Works great for HTML,etc, but when I try to Beautify SQL it says that it needs SQLFormat, which is not installed by default. When I follow the github link it shows that SQLFormat is Python, install instructions are downalod zip and 'pip install sqlparse'. Do I need to install Python to load sqlparse? Anyone have some simple instructions on how to load on a mac?
first install sqlparse with pip ( to do this you need to have python)
pip install sqlparse
Once it's installed note down the python version with which its installed. e.g. in my case it was python3.7 / python3
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: sqlparse in ./Library/Python/3.7/lib/python/site-packages (0.4.2)
make sure /usr/local/bin/ is on your PATH variable by running echo $PATH if not add it your PATH variable.
then create a file sqlformat under /usr/local/bin/ (i.e. /usr/local/bin/sqlformat) using any editor of your choice and paste below snippet, make sure to use correct version of python and save the file
#!/bin/bash
FLAGS="$f $p $#"
exec python3 -m sqlparse $FLAGS
finally do change the file permission by
chmod 755 /usr/local/bin/sqlformat

Unable to install spark 2.2 in Cloudera Quickstart VM (5.10)

I have followed the blog (Below mentioned) here and downloaded the parcel and put as per required.
Please let me know if any one has installed and the steps.
(https://www.cloudera.com/documentation/spark2/latest/topics/spark2_installing.html)
/opt/cloudera/csd/SPARK2-2.1.0.cloudera2-1.cdh5.7.0.p0.171658-el5.parcel
But service cloudera-scm-server restart is not executing.
To use Cloudera Express (free), run:
sudo /home/cloudera/cloudera-manager --express
This requires at least 8 GB of RAM and at least 2 virtual CPUs.
SPARK 2.2 Installation Setup on Cloudera VM
Step 1: Download a quickstart_vm from the link:
Prefer a vmware platform as it is easy to use, anyways all the options are viable.
Size is around 5.4gb of the entire tar file. We need to provide the business email id as it won’t accept personal email ids.
Step 2: The virtual environment requires around 8gb of RAM, please allocate sufficient memory to avoid performance glitches.
Step 3: Please open the terminal and switch to root user as:
su root
password: cloudera
Step 4: Cloudera provides java –version 1.7.0_67 which is old and does not match with our needs. To avoid java related exceptions, please install java with the following commands:
(a). Downloading Java:
wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
(b). Switch to /usr/java/ directory with “cd /usr/java/” command.
(c). cp the java download tar file to the /usr/java/ directory.
(d). Untar the directory with “tar –zxvf jdk-8u31-linux-x64.tar.gz”
(e). Open the profile file with the command “vi ~/.bash_profile”
(f). export JAVA_HOME to the new java directory.
“export JAVA_HOME=/usr/java/jdk1.8.0_131”
Save and Exit.
(g). In order to reflect the above change, following command needs to be executed on the shell:
source ~/.bash_profile
Step 5: The Cloudera VM provides spark 1.6 version by default. However, 1.6 API’s are old and do not match with production environments. In that case, we need to download and manually install Spark 2.2.
(a). Switch to /opt/ directory with the command:
“cd /opt/”
(b). Download spark with the command:
wget https://d3kbcqa49mib13.cloudfront.net/spark-2.2.0-bin-hadoop2.7.tgz
(c). Untar the spark tar with the following command:
tar -zxvf spark-2.2.0-bin-hadoop2.7.tgz
(d). We need to define some environment variables as default settings:
Please open a file with the following command:
vi /opt/spark-2.2.0-bin-hadoop2.7/conf/spark-env.sh
Paste the following configurations in the file:
SPARK_MASTER_IP=192.168.50.1
SPARK_EXECUTOR_MEMORY=512m
SPARK_DRIVER_MEMORY=512m
SPARK_WORKER_MEMORY=512m
SPARK_DAEMON_MEMORY=512m
Save and exit
(e). We need to start spark with the following command:
/opt/spark-2.2.0-bin-hadoop2.7/sbin/start-all.sh
Export spark_home :
export SPARK_HOME=/opt/spark-2.2.0-bin-hadoop2.7/
(f). Change the permissions of the directory:
chmod 777 -R /tmp/hive
(g). Try “spark-shell”, it should work.
Please follow below video it has all the necessary step required in order to install Sprak2 in Clouedra VM.
youtubue link - https://www.youtube.com/watch?v=lQxlO3coMxM
Also for for starting Cloudera Express (free) your VM should have at-least 8Gb RAM allocated or if you have default 4GB RAM allocated then you can forcefullly start ysing below command and then follow the above video.
sudo /home/cloudera/cloudera-manager --force --express
Try this command
sudo /home/cloudera/cloudera-manager --express --force
I gave up on this, nothing works well with parcel and non-parcel installation.
As soon as cloudera express is started numerous errors and Java 7 instead of Java 8.
I got a mapr VM install with Spark 2.x. No issues. Works first time.
That works well. This is my advice # 1.
If you want KUDU, then I would install centos and install things oneself. This is advice # 2. OK, you may miss Impala, but if for pure research and development then not so much of an issue.
With following two command my spark2.2 was automatically updated to spark 2.4:
(i) sudo yum update
It might be that your java, home path is screwed, in that case please export the java home path in bash file.
(a) vi ~/.bash_profile
(b)
(c) source ~/.bash_profile
Just download the right version of spark that you need say 'spark-2.2.0-bin-hadoop2.6'
open bashrc_profile through vi editor
vi ~/.bash_profile. Paste the below 2 lines
SPARK_HOME=/home/cloudera/Downloads/spark-2.2.0-bin-hadoop2.6
PATH=$PATH:$HOME/bin:$SPARK_HOME/bin
Save it
Then run the command : source ~/.bash_profile
Now start spark-shell .
Note : Make sure you have JDK 1.8 installed
SnPARK 2.2 Installation Setup on Cloudera VM
Step 1: Download a quickstart_vm from the link:
Prefer a vmware platform as it is easy to use, anyways all the options are viable.
Size is around 5.4gb of the entire tar file. We need to provide the business email id as it won’t accept personal email ids.
Step 2: The virtual environment requires around 8gb of RAM, please allocate sufficient memory to avoid performance glitches.
Step 3: Please open the terminal and switch to root user as:
su root
password: cloudera
Step 4: Cloudera provides java –version 1.7.0_67 which is old and does not match with our needs. To avoid java related exceptions, please install java with the following commands:
(a). Downloading Java:
wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
(b). Switch to /usr/java/ directory with “cd /usr/java/” command.
(c). cp the java download tar file to the /usr/java/ directory.
(d). Untar the directory with “tar –xvzf jdk-8u31-linux-x64.tar.gz”
(e). Open the profile file with the command “vi ~/.bash_profile”
(f). export JAVA_HOME to the new java directory.
“export JAVA_HOME=/usr/java/jdk1.8.0_131”
Save and Exit.
(g). In order to reflect the above change, following command needs to be executed on the shell:
source ~/.bash_profile
Step 5: The Cloudera VM provides spark 1.6 version by default. However, 1.6 API’s are old and do not match with production environments. In that case, we need to download and manually install Spark 2.2.
(a). Switch to /opt/ directory with the command:
“cd /opt/”
(b). Download spark with the command:
wget https://d3kbcqa49mib13.cloudfront.net/spark-2.2.0-bin-hadoop2.7.tgz
(c). Untar the spark tar with the following command:
tar -xvzf spark-2.2.0-bin-hadoop2.7.tgz
(d). We need to define some environment variables as default settings:
Please open a file with the following command:
vi /opt/spark-2.2.0-bin-hadoop2.7/conf/spark-env.sh
Paste the following configurations in the file:
SPARK_MASTER_IP=192.168.50.1
SPARK_EXECUTOR_MEMORY=512m
SPARK_DRIVER_MEMORY=512m
SPARK_WORKER_MEMORY=512m
SPARK_DAEMON_MEMORY=512m
SPARK_LOCAL_IP=127.0.0.1
Save and exit
(e). We need to start spark with the following command:
/opt/spark-2.2.0-bin-hadoop2.7/sbin/start-all.sh
Export spark_home :
export SPARK_HOME=/opt/spark-2.2.0-bin-hadoop2.7/
(f). Change the permissions of the directory:
chmod 777 -R /tmp/hive
(g). Try “spark-shell”, it should work.
Same answeras swapnil shashank with small modification below
SPARK_LOCAL_IP=127.0.0.1
tar -xvzf spark-2.2.0-bin-hadoop2.7.tgz

phpDocumentor - Unable to find the dot command of the GraphViz package

I would like ask some help about my next problem:
I am working on a Symfony2 project. We installed Symfony2 via composer.
Now I would like to generate phpDocument used by phpDocumentor.
A did the following steps:
update composer: sudo php composer.phar self-update
add the following property to Symfony2/compose.json file:
"require-dev": {
"phpdocumentor/phpdocumentor": "2.*#dev"
},
Run composer command
sudo php composer.phar update
Result was success! The installed GraphViz version is: 1.0.2
When I try to generate phpDoc from source code finally I got a message:
Unable to find the dot command of the GraphViz package. Is GraphViz correctly installed and present in your path?
(Document generated as right...)
I tried to found a soulution about this problem but I couldn't.
Is anybody can help me to resolve this problem?
Environment is: Ubuntu release 12.04
Graphviz is a nice software that creates graphs, but PHP software can only provide wrappers that create Graphviz source files that then get parsed and morphed into pictures.
Phpdocumentor comes with it's own wrapper, but you still have to install the Graphviz software package.
On Ubuntu just run
sudo apt-get install graphviz
rerun phpdoc, at the end you will see the line
Execute transformation using writer "Graph"
that's all!
The error says that : GraphViz tool (needed for making charts and graphs in the documentation) is not installed, in that scenario you will have to download the suitable version and configure it ! And if you are sure that it is installed on your system, then you should check whether the command dot is available or not. On windows path environment variable needs to be set which makes the dot command execution to be available from any path. Fixing this may get your things working !
For Windows
Follow the steps below to resolve this error are:
download Windows Packages from https://graphviz.gitlab.io/_pages/Download/Download_windows.html
Just install it
add c:\Program Files\Graphviz*\dot.exe or c:\Program Files (x86)\Graphviz*\dot.exe to your environment variable PATH
run phpdoc
Re-start your machine & run phpdoc (if still shows the same error message)
For windows 7/10 just install https://graphviz.gitlab.io/download/ select the Stable install packages. Then add
C:\Program Files (x86)\Graphviz2.38\bin
to your system environment variables. Make sure to change the version to the one you downloaded.
To check if it works open a new instance of cmd or git bash and run dot. If it says dot is not a valid command then make sure the path to Graphviz bin folder is correct.

Can't open sqlite3 "This script is just a wrapper for sqlite3"

I had a problem with use of arrow keys in sqlite3 on Mac OS 10.6.
I downloaded sqlite-autoconf-3080403.tar.gz. I did
./configure
make
sudo make install
Though the new sqlite3 wasn't configured by my machine and I deleted the old sqlite3 in /usr/bin/sqlite3 and moved the new one.
Then when I did
sqlite3
I got this message:
error: '/usr/bin/.libs/sqlite3' does not exist
This script is just a wrapper for sqlite3.
See the libtool documentation for more information
Then I tried to upgrade sqlite using brew but maybe it was too late by then because I still get the same error msg.
Does anyone know how to fix this?
Thanks in advance!
BTW I can use sqlite3 when I'm in the decompressed sqlite-autoconf folder.
I solved my own question by typing this command into the Terminal:
$ export PATH=/usr/local/Cellar/sqlite:/usr/local/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
I found these articles helpful:
Installed sqlite3 v3.8, but mac terminal still runs old version 3.6 by default
Brew doctor says: "Warning: /usr/local/include isn't writable."
In my clumsy experience, don't ever do:
rm /usr/bin/sqlite3
Instead use brew if you are using Mac OS.

Compiling an OpenCL program using a CL/cl.h file

I have sample "Hello, World!" code from the net and I want to run it on the GPU on my university's server. When I type "gcc main.c," it responds with:
CL/cl.h: No such file or directory
What should I do? How can I have this header file?
Are you using Ubuntu or Debian distro? Then you could use this package to solve the problem with missing header file:
apt-get install opencl-headers
You must install opencl library to solve linking issues using that Debian and Ubuntu package:
apt-get install ocl-icd-libopencl1
You can also use these nonfree libraries: nvidia-libopencl1 (Debian) or nvidia-libopencl1-xx (Ubuntu).
Make sure you have the appropriate toolkit installed.
This depends on what you intend running your code on. If you have an NVidia card then you need to download and install the CUDA-toolkit which also contains the necessary binaries and libraries for opencl.
Are you running Linux? If you believe you already have OpenCL installed it could be that it is found at a different location than the standard /usr/include. Type the following and see what results you get:
find / -iname cl.h 2>/dev/null
On my laptop for example, the header is found at /usr/local/cuda-5.5/include. If its the case were your header file is at a different location you simply have to specify the path during complication
g++ -I/usr/local/cuda-5.5/include main.c -lOpenCL
Alternatively, you can create a symbolic link from the path to /usr/include:
ln -s /usr/local/cuda-5.5/include/CL /usr/include

Resources