Trouble with tutorial on getting started with Webassembly - bash

I'm following the guide here for creating a Hello World wasm application (Mac OS). I followed everything to a T, and am sure git and python are in my PATH, and 90% sure cmake is in my path. The installations were long but went fine. When I type the command emcc hello.c -s WASM=1 -o hello.html into my terminal, however, I receive the message -bash: emcc: command not found. Tried to sudo it too.
Not sure what the issue is. I'm obviously extremely green to wasm. Thanks!

The page you linked shows the command needed to add relevant environment variables and directory entries to PATH. On Mac the command would be:
source ./emsdk_env.sh

Related

gfortran: error: libgfortran.spec: No such file or directory

I am attempting to install and run gfortran-8 on macOS with the following makefile. I installed it from http://hpc.sourceforge.net/ (8.3 version). I keep getting this error:
gfortran: error: libgfortran.spec: No such file or directory
I know libhfortran.spec is located in /usr/local/Cellar/gcc#8/8.4.0/lib/gcc/8/libgfortran.spec. I have added it to my etc/paths and my .bash_profile. I have also uninstalled gfortran and reinstalled it. Anyone have a clue on what I might be missing? I am attaching my makefile below.
Makefile:
https://drive.google.com/open?id=1Y_Zo2dSYI32dQpwMtdUy5rWB8avDHXor
Bellhop Macintosh Installation
Note: I know gfortran is now part of gcc but newest at version still only works with older gfotran compilers. If you have Catalina as well, don’t worry this will still work on Mojave as well as on Catalina. I had tested it.
Go to this link.
Download
Install the downloaded gfortran-8.2-Mojave.dmg, this compiler is being used by the at to create binaries for your MacOS.
Go to the path where you extracted at folder. (In Mac you don’t need windows binary, you need to compile using gfotran compiler.)
Execute the following commands in the at folder.
Once you installed. Close all the terminals.
Open new terminal. Do as follows:
In your terminal, type this:
echo $PATH
Above command give you current path in your zsh file, If you have one.
Add bellhop to your zsh file. You can use these commands in terminal:
cd
nano .zsh
Please note that there is no Bellhop in the path right now, so we are going to add that by adding the following line in the .zsh file, Copy and paste below list (change the path accordingly)
export PATH=your_local_macOS_path/at:your_local_macOS_path/at/Bellhop:$PATH$
For me, it was:
export PATH=/Users/jaypatel/Downloads/at:/Users/jaypatel/Downloads/at/Bellhop:$PATH$
Refer the screenshot below for more details.
Once you’re done, press ctrl+X and it will ask you do you want to save your file, type Y and press enter and it will save the path successfully.
And now source ~/.zsh to your terminal using this command :
source ~/.zsh
echo $PATH
This means your acoustic toolbox and bellhop.exe are in path’s now.
And now source ~/.zsh to your terminal using this command : source ~/.zsh
And Voila, Your Bellhop is successfully installed.
Reference :
You can find more details here.

pkg-config package not working on debian virtualbox environement

I am running Debian 8 on a Virtual box environment. The problem I am facing is the use of the pkg-config package when compiling a c++ file.
When I run the first command I get errors but when the I try to compile vision.cpp with the output of the second command it works perfectly as seen below.
I would be grateful if you guys could help me figure this out. And yes, I triple checked I used back-ticks (to the left of the 1 on the macbook pro) just so I don't look like an idiot,
The reason was because I was using fish terminal which uses parenthesis instead of backticks to run subcommands. Another problem is that fish does not separate by spaces but pkg-config does therefore the correct command is:
eval g++ -o code code.cc (pkg-config opencv --cflags --libs)
I used this link as a reference: https://github.com/fish-shell/fish-shell/issues/982

how to use and install SystemC in terminal mac OS X?

how to use and install SystemC in terminal mac OS X?
I tried the Logic poet application, But i use os x 10.10 so it doesn't work.
so i want to know how can i compile and execute SystemC in terminal.
I could't find the detail of SystemC in terminal.
Thank you
The other answer is correct and perfectly fine, however, I thought I'd also answer and provide a little more detail.
Install Apple's "Command Line Tools"
You have two options: install Xcode (a big download), or just the command line tools (a much smaller download). If your goal is simply building SystemC applications at the command line, then I recommend the latter.
Install Apple's "Command Line Tools" by launching Terminal, entering
$ xcode-select --install
then clicking Install. After that, you'll have make, clang and more available at the command line.
Build and install Accellera's SystemC implementation
Download the latest release from the Accellera Downloads page (annoyingly, you'll have to provide a few personal details) and extract the contents of the .zip file.
I like to keep a copy of the SystemC source code available, because it can be useful for debugging or understanding how something works. Therefore, I move the extracted folder (systemc-2.3.1) into ~/Work/Other. That's where I keep source code for third party libraries. However, you can put it wherever you like.
Open Terminal, change into the extracted folder (systemc-2.3.1), and execute:
$ mkdir build
$ cd build
$ export CXX=clang++
$ ../configure --with-arch-suffix=
$ make install
The --with-arch-suffix= option prevents a -macosx64 suffix being add to the lib folder name, allowing your build scripts to be simpler.
After that process, the salient include and lib folders should be available within the systemc-2.3.1 folder.
Configure your build environment
There are many ways you can do this; I have a simple approach that I believe is close to what the SystemC maintainers envisioned. I define two environment variables in my .bash_profile (which is executed for every new Terminal session on OS X):
export CXX="clang++ -fcolor-diagnostics"
export SYSTEMC_HOME=~/Work/Other/systemc-2.3.1
Build a SystemC application
You could use Make, the quintessential build tool, which you get with Apple's "Command Line Tools", or any one of the plethora of other options. I use SCons with SConstruct files that look something like this:
import os
env = Environment(CXX=os.environ["CXX"],
SYSTEMC_HOME=os.environ["SYSTEMC_HOME"],
CPPPATH="$SYSTEMC_HOME/include",
LIBPATH="$SYSTEMC_HOME/lib")
env.Program("main.cpp", LIBS="systemc")
View trace (VCD) files
Scansion is a nice tool for this. GTKWave is another option, but it's a bit clunky.
Ensure you have xcode command line tools installed.
Follow instructions provided in the official repository.
From personal experience.
Compiling SystemC library with clang results in segmentation fault: 11
error every time I include systemc library into my code. To avoid this use gcc instead.
Note that I use gcc-8, installed with homebrew.
$ cd path/to/systemc-2.3.3
$ mkdir objdir
$ cd objdir
$ export CXX=g++-8
$ ../configure
$ make
$ make install
Use $ make check to launch examples compilation and unit tests.
To compile and run hello world example:
$ export SYSTEMC_HOME=path/to/systemc-2.3.3
$ g++-8 hello.cpp -o hello.o -L $SYSTEMC_HOME/lib-macosx64 -I $SYSTEMC_HOME/include/ -l systemc
$ ./hello.o
Tested on macOS 10.13.6; gcc version 8.2.0; systemc-2.3.3
Install
Go here click the first link and fill in your information to get the source code
http://www.accellera.org/downloads/standards/systemc
Then cd to the folder
Then run the following commands
./configure --with-unix-layout
gmake
sudo gmake install
gmake clean
After you do that it should all be saved in your use/local/(lib&include) directories
To Use
In code do this
#include "systemc.h"
I use a single makefile normally. But you could write the following to link the library. Given your cpp file is called main.
g++ -o main main.cpp -I/usr/local/include -L/usr/local/lib -lsystemc

Xlib.h not found when building graphviz on Mac OS X 10.8 (Mountain Lion)

When using homebrew to install graphviz, the script gets to the point of "Making install in tkstubs" and then throws the following fatal error:
In file included from tkStubLib.c:15:
/usr/include/tk.h:78:11: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
I have installed XQuartz as X11 has been dropped in Mountain Lion, but I'm unsure if it is installed correctly. The location of Xlib.h is:
/opt/X11/include/X11/Xlib.h
There are also two symlinks to /opt/X11, they are:
/usr/X11
/usr/X11R6
Does this look like the correct setup to you? I've never dealt with X11 or XQuartz until yesterday.
Cheers.
After installing XQuartz you may add a symlink to your X11 installation folder by just entering
ln -s /opt/X11/include/X11 /usr/local/include/X11
in terminal. That will fix the problem as well without changing any ruby script.
You need to tell the tkstubs build (and possibly other bits in the package as well) to look for headers in /opt/X11/include; this is not on the standard include path.
Usually this is achieved by passing -I/opt/X11/include as an additional compiler flag, the method to do so is however dependent on the build system.
For reasonably modern configure scripts, the best approach is to pass it in the environment variable CPPFLAGS; if the package uses another build system or this doesn't work for another reason, then you need to look at the Makefile in the build directory.
You can enter in your shell before the compile/link (or brew) command:
export CPPFLAGS=-I/opt/X11/include
The export line will tell the compile/linker to look in /opt/X11/include for the X11 include files
Had the same issue and running this command on terminal
xcode-select --install
worked for me. Run this command after installing xQuartz.
If you need this to work in your CMake builds:
if(APPLE)
include_directories(AFTER "/opt/X11/include")
endif()
That worked well for me.
I got it to install by copying the x11 header file directory to the /opt/local/include directory. Probably not the best way to work around it but quick and easy.
I found this thread while trying to compile ffmpeg from source on OS X. I needed --enable-x11grab and the homebrew build does not support this option.
I had XQuartz installed already but I kept getting errors from ./configure: ERROR: Xlib not found. I thought the answers here would solve my problem, but they did not!
So, if anyone is ever in the same boat, my solution was this:
I opened up the generated config.log and found lots of errors referring to various includes and header files, including X11/Xlib.h - this is misleading. At the very bottom of the logfile was the key, pkg-config was complaining about looking for xbc.pc, and requested that it be put on the path. However, the error message that is displayed on the terminal says nothing about pkg-config or xbc!
The solution is to add to your PKG_CONFIG_PATH environment variable. Mine was nonexistent, so I just did export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ (the folder where I found xbc.pc).
I reran configure and everything worked like a charm!
TL;DR: check config.log - don't trust the terminal output!
Since the make file is looking for X11/xlib.h i.e., it is looking for X11 folder in the current directory, one way to solve this problem is to simply copy the /opt/X11/include/X11 directory to the directory that contains make file.

an error in plone theming

I installed Plone 4.1.3 and I am trying to make a theme. I saw this link talk about this issue:
http://www.treebrolly.com/blog/turbo-plone-theming-with-xdv-diazo
and I followed the commands. When I run this command
$ ./bin/instance fg
it says
Error: error opening file /home/hosam/plone413/zinstance/parts/instance/etc/zope.conf: [Errno 2] No such file or directory: '/home/hosam/plone413/zinstance/parts/instance/etc/zope.conf'
For help, use ./bin/instance -h
hosam#hosam-desktop:~/plone413/zinstance$
I noticed that when I run this command
$ ./bin/buildout -c demo.cfg
this directory and its contents are deleted /home/hosam/plone413/zinstance/parts/instance/
and so this error appears to me, Any can help??
When you run :
$ ./bin/buildout -c demo.cfg
the parts folder is supposed to be deleted and rebuilt (that's fine).
The error you are facing says that this command doesn't end correctly. Try to add the -v parameter
$ ./bin/buildout -v -c demo.cfg
so you will have a more verbose output and you can provide here a complete error traceback
Set up your demo.cfg in a different buildout directory. Looking at the blog entry you mentioned, it's meant to standalone, not share the same buildout directory with a zope/plone instance.
You might want to consider using plone.app.theming instead of XDV. The big difference is that plone.app.theming runs inside Plone and doesn't require any separate build. That really simplifies things if you don't need to mix in content from non-Plone sources.

Resources