Installing and running emscripten on OSX 10.15 - macos

I recently installed emscripten on my macbook air using homebrew.
But when I try to run it, even if i do a simple emcc --version i get the error llc executable not found at /usr/bin/llc. how can i fix this?

solution: llvm was not installed, so a brew install llvm followed by echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.zshrc solved this problem for me.

Hrm. Seems like adding brew install llvm, I'm still not able to call llvm on my end.
So i just installed brew install emscripten
then I did emcc giving me
Welcome to Emscripten!
This is the first time any of the Emscripten tools has been run.
A settings file has been copied to /usr/local/Cellar/emscripten/1.39.18/libexec/.emscripten, at absolute path: /usr/local/Cellar/emscripten/1.39.18/libexec/.emscripten
It contains our best guesses for the important paths, which are:
LLVM_ROOT = /usr/bin
NODE_JS = /usr/local/bin/node
EMSCRIPTEN_ROOT = /usr/local/Cellar/emscripten/1.39.18/libexec
Please edit the file if any of those are incorrect.
This command will now exit. When you are done editing those paths, re-run it.
Then i did emcc again, giving me BINARYEN_ROOT is set to empty value in /usr/local/Cellar/emscripten/1.39.18/libexec/.emscripten.
How did you set your BINARYEN_ROOT? i'm on the newest macos 10.15.5.

Related

I can't install gcc with Mojave 10.14

I try to install a fortran compiler on my Mojave system thanks to the command
brew install gcc
Unfortunately, I have this error message
The directory that should contain system headers does not exist:
/usr/include
I found out that I had to install the latest update of the Command Line Tools, which I did and update Xcode to 10.1 but the error remains the same.
I tried to update brew but it said
Error: /usr/local must be writable!
and brew doctor said that my version of Xcode is outdated although I just updated to the 10.1 version
So... any help is appreciated.
Thanks everybody
Zhiv
I found very detailed instructions for compiling GCC by "Paul" at https://solarianprogrammer.com/2017/05/21/compiling-gcc-macos/
In particular this step will address your problem:
macOS Mojave changed the location of the system headers, this broke
the GCC 8 build process. In order to build GCC install the required
header files in the old location:
cd /Library/Developer/CommandLineTools/Packages/
open .
Update the permissions using:
sudo chown -R /usr/local/* /usr/local/.git; brew update

Unable to build and install Valgrind on macOS High Sierra

I cannot install Valgrind on macOS High Sierra. It's not available through brew. I've tried with 3.10. After make install, I get this message:
configure: error: Valgrind works on Darwin 10.x, 11.x, 12.x, 13.x and 14.x (Mac OS X 10.6/7/8/9/10)
Homebrew says:
valgrind: This formula either does not compile or function as expected on macOS
versions newer than Sierra due to an upstream incompatibility.
Error: An unsatisfied requirement failed this build.
I had the problem like this.
So, I found the solving. You should install valgrind by this code
brew install --HEAD valgrind
I have created a port of valgrind 3.13.0 to work on macOS High Sierra (10.13.x). You can get it here: https://github.com/padiakalpesh/valgrind_3.13_high_sierra
Once you have obtained the source, run the following commands from inside the source directory:
./configure
make
sudo make install
brew install Valgrind has some compatibility problem when installing on latest macOS but there is a workaround with this problem. You must be getting this error message when you try to install it using brew.
$brew install valgrind
valgrind: This formula either does not compile or function as expected on macOS
versions newer than High Sierra due to an upstream incompatibility.
Error: An unsatisfied requirement failed this build.
-------------------------------------------------------------------SOLUTION--------------------------------------------------------------
Step1: $brew edit valgrind
Step2: Find this line in the file ->(url "https://sourceware.org/git/valgrind.git")
Step3: Replace it with -> (url "git://sourceware.org/git/valgrind.git")
Step4: $brew update
Step5: $brew install --HEAD valgrind
And Done!
Let me know if it still doesn't work.
Thanks!!
I have got this working in July 2018, for reference:
https://gist.github.com/AlessandroMinali/d8316d6cc650c97027433644c2ff31ee
Edit ./configure
- 5468: applellvm-5.1|applellvm-6.*|applellvm-7.*|applellvm-8.*)
+ 5468: applellvm-5.1|applellvm-6.*|applellvm-7.*|applellvm-8.*|applellvm-9.*)
- 5879: 16.*)
+ 5879: 17.*)
Run
./autogen.sh
./configure
make
make install
Create file ~/.valgrind.supp
# false positive for any executable (it seems)
# macOS 10.12.6
# valgrind 3.13.0
{
libtrace initialization false positive
Memcheck:Param
msg->desc.port.name
fun:mach_msg_trap
fun:mach_msg
fun:task_set_special_port
fun:_os_trace_create_debug_control_port
fun:_libtrace_init
}
Create file ~/.valgrindrc
--suppressions=$HOME/.valgrind.supp
Troubleshooting
if can not read suppresion file copy and paste the contents of $HOME
if it complains about clang versions, bump the first edit up
if it complains about Darwin version, bump the second edit up
using the brew install --HEAD valgrind also worked for me, but be sure to know that it will take awhile to pull the HEAD version, and build/install.
However, no other changes were needed.
I build the git head version of Valgrind on macOS fairly regularly. If you have xcode installed then there isn't much more to it than following the instructions here.
I'll update with my build script later.
As an alternative, you might want to consider clang sanitizers. This can be enabled in xcode, or with the -fsanitize=X option (where X is address, undefined, thread, memory and a few others).
Valgrind is a rather touchy piece of software, and requires updates for each major release of macOS.
As of February 2018, there is no released version of Valgrind which supports macOS High Sierra (10.13). You will need to use a development version of Valgrind, or use alternate tools. (Apple's Instruments may have some of the functionality you are looking for.)
MacPorts version started working for me in Sep 2018!
The command, for completeness sake (completes very fast - apparently, prebuilt):
sudo port install valgrind-devel
Version:
$ valgrind --version
valgrind-3.14.0.GIT
The following worked for me using the latest Valgrind release 3.14.0 (9th October 2018) on macOS 10.13.6.
VERSION="3.14.0"
wget -O - http://www.valgrind.org/downloads/valgrind-"$VERSION".tar.bz2 | tar xjf -
cd valgrind-"$VERSION"
# use --prefix=/path/to if you want it installed somewhere in particular
./configure
make
# may need sudo
make install
# test all is working
valgrind ls -l
These instructions are taken from the README inside the Valgrind release tar ball.

how to install libX11 on OSx 10.9?

I am trying to install ROOT (cern.root.ch). When I run ./configure , I get a message that libX11 is missing and must be installed.
I did some research and found that I need to install
) XQuartz (I already have the latest version.)
) Command line tools in Xcode.
I tried installing Command Line Tools from apple's developer website. The installation goes through smoothly but how do I know whether it has been installed? I still get libX11 missing error with root's configure command.
I also tried xcode-select --install and it once went through smoothly and then later again gives error saying this package is no longer maintained - or something of that sort.
I understand I may have multiple installations... But I am still facing the problem of not having libX11 and not being able to install ROOT.
Thanks,
Hershal.
This link and the one referenced in it suggests you use homebrew (brew) to install it
$ ruby <(curl -fsS https://raw.github.com/mxcl/homebrew/go)
$ brew doctor
Remember to add the Homebrew directory to your PATH by adding the directory (found with brew --prefix) to your .bashrc, .zshrc or whatever shell file you’re using (.bashrc is the OS X default). We’ll also add the XQuartz binaries to the PATH in case anything needs them in the future.
export PATH=/usr/local/bin:/opt/X11/bin:$PATH
Start a new Terminal session to pick up the changes.
Now that Homebrew is installed, we can use it to install the required dependencies. Each may take some time as Homebrew generally compiles from source.
$ brew install gfortran # Fortran compiler
$ brew install python # Python interpreter
$ brew install pcre # Regular Expressions library
$ brew install fftw # Fast Fourier Transforms
$ brew install cmake # Cross-platform make
install root
$ brew tap homebrew/science
$ brew install --with-cocoa root
You don't say whether you have installed XCode as well as the commandline tools but I think you will need it

No llvm opt command in Mavericks

I installed Xcode 5.0.1 on Macosx 10.9 Mavericks and the command line tools (I can use gcc/clang on the command line for instance) but the command opt seems to have disappeared.
Was it replaced by something else ?
Apple never shipped 'base' LLVM tools with its within XCode command line tools, only clang. You need to compile the desired revision / release of LLVM by yourself. You can download the pre-built binaries at http://llvm.org/releases/download.html as well.
My strategy (on Mavericks) was to do brew install llvm then symlink:
sudo ln -s /usr/local/Cellar/llvm/3.4/bin/opt /usr/bin/opt
sudo ln -s /usr/local/Cellar/llvm/3.4/bin/llc /usr/bin/llc
I got this to work on High Sierra by installing it via Homebrew.
brew install llvm
Once you're done with that, Homebrew will tell you something like this:
To use the bundled libc++ please add the following LDFLAGS:
LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have this software first in your PATH run:
echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile
For compilers to find this software you may need to set:
LDFLAGS: -L/usr/local/opt/llvm/lib
CPPFLAGS: -I/usr/local/opt/llvm/include
If you need Python to find bindings for this keg-only formula, run:
echo /usr/local/opt/llvm/lib/python2.7/site-packages >> /usr/local/lib/python2.7/site-packages/llvm.pth
Go ahead and run:
echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile
to stick that into your .bashrc / .bash_profile.
I'll add a solution for El Capitan and Sierra since now it shows the error
ln: /usr/bin/opt: Operation not permitted
It's really simple, just go to ~/.bash_source (or the rc file of whatever shell you have) and write alias opt='/usr/local/Cellar/llvm/<llvm_version>/bin/opt'

Installing openCV 2.4.2 on Mac OS X 10.9 (Mavericks)

I'm trying to install openCV 2.4.2 (not the newest version but stable version compatible with newer OS X according to several sources) on Mac OS X 10.9 (Mavericks). I have tried installing from source and using homebrew but neither works. I get the following error when I try installing it:
build Marieke$ make
[ 25%] Building CXX object modules/ts/CMakeFiles/opencv_ts.dir/src/precomp.cpp.o
In file included from /users/Marieke/Downloads/OpenCV-2.4.2/modules/ts/src/precomp.cpp:1:
In file included from /users/Marieke/Downloads/OpenCV-2.4.2/modules/ts/src/precomp.hpp:2:
In file included from /users/Marieke/Downloads/OpenCV-2.4.2/modules/ts/include/opencv2/ts/ts.hpp:40:
/users/Marieke/Downloads/OpenCV-2.4.2/modules/ts/include/opencv2/ts/ts_gtest.h:1657:13: fatal error:
'tr1/tuple' file not found
# include <tr1/tuple> // NOLINT
^
1 error generated.
make[2]: *** [modules/ts/CMakeFiles/opencv_ts.dir/src/precomp.cpp.o] Error 1
make[1]: *** [modules/ts/CMakeFiles/opencv_ts.dir/all] Error 2
make: *** [all] Error 2
I don't know how to solve this and I have tried several things already (I do now have newest versions of Xcode, cmake, ffmpeg, faac, faad, qt, ...) so if anybody can help me, that would be much appreciated, thanks!
Run the following commands assuming you have brew installed.
brew tap homebrew/science
brew install opencv
Use macports. Once you install macports, just run
sudo port install opencv
at the command prompt.
This other stackoverflow question is mostly correct for how to start using the macports version of opencv in Xcode.
Here are some more up-to-date instructions for using the macports version of OpenCV from Xcode 5:
Create a new Xcode project as OS X Application -> Command Line Tool, etc.
Click the target in the upper left
Click the Build Settings tab
Scroll down to (or search for) the Search Paths section
Under User Header Search Paths add /opt/local/include
Click the Build Phases tab
Click Link Binary with Libraries
Choose the required libraries from /opt/local/lib
At least, add libopencv_core.dylib
If you want pre-set command-line arguments, go to Product -> Scheme -> Edit Scheme (⌘<)
Click the Run tab on the left
Click the Arguments tab
Enter arguments into Arguments Passed on Launch
Done!
You can try to install opencv from homebrew, I met the same problem with cmake in my 10.9 and finally I found the solution from Chris Muktar. Here are the steps:
Make sure xcode-select --install Xcode command line tools 5.0.1 are installed.
Install python using brew - brew install python.
pip update
pip install numpy
brew linkapps
Add export PYTHONPATH=/usr/local/Cellar/opencv/2.4.6.1/lib/python2.7/site-packages:$PYTHONPATH to .bash_profile in your home directory
brew install opencv
In the last step I came across the Error: No available formula for opencv. In this case, you should first run the command brew tap homebrew/science.
Good Luck
This may be related to the current issues with Qt on Mavericks.
See: https://github.com/mxcl/homebrew/pull/23793
I'd try installing the current patched homebrew keg for qt, and then installing opencv:
brew update
brew uninstall opencv
brew uninstall qt
brew install -v https://raw.github.com/cliffrowley/homebrew/patched_qt/Library/Formula/qt.rb --HEAD
brew install opencv
Caution to the wind: the qt build took me about an hour to complete
Thanks for the answers!
I ended up with the following solution: I added #define GTEST_USE_OWN_TR1_TUPLE 1 to ts_gtest.h. Probably not the prettiest solution but I don't need gtest for anything else so it works for me.
You could disable ts module in CMakeCache.txt file:
//Include opencv_ts module into the OpenCV build
BUILD_opencv_ts:BOOL=OFF
I mean that there is no reason to modify existing code.
I think you really need to do a configuration and that is it.
I tried your problems and I think steps are as follow:
open terminal in mac
in the terminal, check you have cmake and ccmake. If not, please type "brew install cmake"
go to your downloaded opencv folder, make a new folder by typing "mkdir build", then "cd build"
in this build folder, check you have gcc and g++ installed.
now, doing configuration by type "ccmake .. -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++", type "c" first for configuration then exit by "e" then "g" for generating!
you should be in terminal again now! then please type "make"
type "sudo make install", and now the opencv is installed, check it by type "brew list", and you should see the opencv there
type "brew linkapps"
do a test if you have python, by typing "import cv", and it should be working!

Resources