Where should .emscripten LLVM_ROOT and NODE_JS point to? (Mac OS X) - interpreter

After downloading emscripten via
git clone git://github.com/kripken/emscripten.git
and running
./emcc
a .emscripten file is created in my user root.
==============================================================================
Welcome to Emscripten!
This is the first time any of the Emscripten tools has been run.
A settings file has been copied to ~/.emscripten, at absolute path: /Users/calvin/.emscripten
Please edit that file and change the paths to fit your system. Specifically,
make sure LLVM_ROOT and NODE_JS are correct.
This command will now exit. When you are done editing those paths, re-run it.
==============================================================================
I have llvm installed and nodejs installed via macports. So where should I change LLVM_ROOT and NODE_JS to point to?

running emsdk activate latest (after having run emsdk install latest, which takes a while) gets all of my aliases and such working, I've added it to my bash profile

Are the LLVM / Node.js commands accessible on your path? E.g. does running node or clang work?
If so, you can detect the paths you need from there. For LLVM_ROOT, you want the directory containing the LLVM binaries:
$ dirname `which llvm-config`
/usr/local/bin
For NODE_JS, you want the path to the node binary itself:
$ which node
/usr/local/bin/node
If this fails (because they are not on your path already), then try looking in /opt/local/bin. That's seems like the right place from the MacPorts docs (I don't use MacPorts myself).

Related

Installing / Building the newest version of Inkscape (v 1.2) on Linux Ubuntu 20.04

I am trying to install Inkscape 1.2beta on Linux Ubuntu 20.04. The website currently only offers an AppImage and a source tarball. Since I would like to access the newest features of Inkscape via the command line, I need to build and install the source tarball.
INSTALL.md states that I need all submodules and dependencies before install.
How do I find these dependencies to successfully build and install Inkscape?
This list should satisfy all required dependencies on Linux Ubuntu:
apt install
cmake
imagemagick
libdouble-conversion-dev
libgdl-3-dev
libagg-dev
libpotrace-dev
libboost-all-dev
libsoup2.4-dev
libgc-dev
libwpg-dev
poppler-utils
libpoppler-dev
libpoppler-glib-dev
libpoppler-private-dev
libvisio-dev libvisio-tools
libcdr-dev
libgtkmm-3.0-dev
libgspell-1-dev
libxslt-dev libxslt1-dev
libreadline6-dev
lib2geom-dev
lib2geom-dev is needed to solve error "<ieeefp.h> not found".
For building Inkscape:
Download source tarball for Inkscape v1.2 from inkscape.org and extract
cd <extracted inkscape directory>
mkdir build && cd build
cmake ..
make
make install
If you still get an error during cmake .., please comment below with the names of the missing modules in the error message.
The details on how to build Inkscape (and the dependencies) could be found in the repository itself, or Inkscape website (For completness, the steps are copied from the website here):
To obtain the latest source code, use the following command (downloads into a subdirectory of your current working directory called "inkscape" by default):
git clone --recurse-submodules https://gitlab.com/inkscape/inkscape.git
To update this code later, change into the download folder and use:
git pull --recurse-submodules && git submodule update
By default, git will download every branch and every commit. If you are on a slow machine, have limited disk space, or limited internet bandwidth, you can use shallow clone and single branch clone options to limit the amount of data it will download:
git clone --depth=1 --single-branch --recurse-submodules --shallow-submodule https://gitlab.com/inkscape/inkscape.git
Building Inkscape on Linux
Open a terminal at the root of the folder into which you downloaded the source code in the previous step.
Install build dependencies
Download and run the script to install everything required for compiling Inkscape (check script to see if your distribution is supported):
wget -v https://gitlab.com/inkscape/inkscape-ci-docker/-/raw/master/install_dependencies.sh -O install_dependencies.sh
bash install_dependencies.sh --recommended
Compile
To compile with CMake, do the following:
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/install_dir -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
make -j8
make install
Notes:
Using ccache is optional but speeds up compilation.
The optional -j8 argument to make tells it to run 8 jobs in parallel. Feel free to adjust this to the number of hardware threads (physical cores) available on your computer.
The recommended -DCMAKE_INSTALL_PREFIX argument allows to specify a custom isolated installation location (in the example above install_dir/ inside the build folder). It avoids installation into system locations (where it could conflict with other versions of Inkscape) and allows running multiple versions of Inkscape in parallel. It will still use all the files (including the preferences.xml) that reside in the ~/.config/inkscape directory.
Run
Run it from the build directory:
install_dir/bin/inkscape

configure: error: Qtenv cannot find qmake in omnet++ installation

I'm trying to install omnetpp 5.2.1 on windows 10. But getting an error while doing ./configure command related to QT environment. I tried changing the configure.user file in omnetpp package to change the path of QT but still its not working. Here is the error:
configure:error: Qtenv cannot find qmake--maybe it is not in the path
or has some exotic name (tested names were: qmake qmake-qt5 qmake5)-
disabling Qtenv. You can try setting QT_PATH variable in
configure.user to a valid location.
qt5 might not be installed.
sudo apt install qt5-default worked for me while installing on Ubuntu 20.04.
OMNeT++ comes with all dependencies bundled. As long as you have executed the mingwenv.cmd and running from that shell, qmake should be available in the path (in tools/win64/mingw64/bin). Check if qmake.exe is present there. If not, make sure that ZIP file you have downloaded is intact. Standard windows unzip may fail on certain systems...
run ./configure WITH_QTENV = no

How to provide standard library sources for IntelliJ IDEA's Rust project?

I am using Mac for development. I installed Rust 1.13.0 using brew install rust and the Rust plugin 0.1.0.1385 for IntelliJ IDEA. I created my first test project with cargo and while opening it with IDEA I got the message
No standard library sources found, some code insight will not work
I haven't found any sources installed, nor the Rust sources package in Homebrew.
How do I provide sources for the project and what are the practical implication if I ignore this step?
As commented, the supported approach is to use rustup:
Navigate to https://rustup.rs/ and follow the installation instructions for your platform.
Add the rust-src component by running: rustup component add rust-src
Create a new Rust project in IntelliJ and choose your existing Rust project source. If the folder already contains previous IntelliJ project files, you may have to delete those first before it will let you proceed.
IntelliJ-Rust should automatically configure the standard library sources to point to the sources downloaded by rustup.
As a reference, since the question title is broad, for Fedora 28 I had to:
dnf install cargo rust-src
sudo ln -s /usr/lib/rustlib/src /usr/lib/rustlib/x86_64-unknown-linux-gnu/
then give /usr/lib/rustlib/x86_64-unknown-linux-gnu/src/rust/src as "Standard library"
Full setup:
Issue opened to simplify the process
When not using the rustup installer, one can install the source package and direct the rust plugin to use those:
(Tested with CLion 2020.2.1, rust-1.46.0-x86_64-pc-windows-gnu.msi, rustc-1.46.0-src.tar.gz. Offline Rust installers and source archive from there: https://forge.rust-lang.org/infra/other-installation-methods.html )
Although the preferred way of installing Rust is by using rustup, as pointed out by the other posts, it is not uncommon to use the packages that your distro makes available.
I use, for example, the packages provided by Gentoo and I share the same problem about the not prefilled field for standard libraries.
Nevertheless, you can easily find out where your standard libraries have been installed by typing the following find command:
find /usr/lib* -type d -name "rust" | grep src
or the following if you installed rust in your home
find -type d -name "rust" | grep src
The previous commands will help, unless, of course, in your distro there is a package for the binaries and one for the source and you only installed the binary one.
I know the question is for MacOS but this answer is shown up when searching for it on Linux. Below I will answer for Ubuntu.
The path is /usr/lib/rustlib/src/rust/src for Ubuntu 20.04
The way I did is:
Installed rustc from the repositories, which includes cargo
sudo apt install rustc
Then installed rust source package
sudo apt install rust-src
I used apt-file (can be installed with sudo apt install apt-file) to search for the install path of the sources
sudo apt-file update
apt-file list rust-src
This show the path as /usr/src/rustc-1.41.0/src .
But a ls -la in /usr/lib/rustlib/ will reveal symlinks and /usr/lib/rustlib/src/rust/src points to the previous found directory.
Using the symlink on IntelliJ will survive new rust versions.
For Fedora 32 install Rust using command:
dnf install cargo rust-src
and the path to standard libary source is:
/usr/lib/rustlib/src/rust
I used Ubuntu. I follow these steps:
sudo apt install rust-src
wait for the install, then
dpkg -L rust-src
copy the last line. For me it is the standard library path:
/usr/lib/rustlib/src/rust
For MacOS, you need to put /opt/homebrew/bin/.

CMake missing modules directory

I've installed CMake 2.8.11.2 package from CMake's website for Mac 64-bit. We recently upgraded a project from Qt 4 to Qt 5 and the CMake upgrade is mandatory for CMake to use Qt 5. However, when I type cmake . I get the following error:
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/Applications/CMake 2.8-11.app/Contents/bin
CMake Error: Error executing cmake::LoadCache(). Aborting.
I can confirm, there is no modules directory in the bin folder. I really don't know how to resolve this error, or how to get the modules needed.
Do hash -r to clear the cache, then do cmake --version.
It should work.
I had the same problem after upgrading on Ubuntu.
Removing cmake and the cmake-data package before performing the update solved it for me.
sudo apt-get remove cmake cmake-data
Now perform the update via
sudo -E add-apt-repository -y ppa:george-edison55/cmake-3.x
sudo -E apt-get update
sudo apt-get install cmake
This worked for me :
cd cmake-3.4.3
./bootstrap --prefix=/usr
make
sudo make install
Additionally, you may encounter the same error when running CMake from Cygwin. This may be caused by a PATH variable listing /bin before /usr/bin: in this case CMake is launched as /bin/cmake instead of /usr/bin/cmake, and trying to load modules from //share/cmake-X.Y.Z (which is a UNC path on Windows) instead of /usr/share/cmake-X.Y.Z.
Explicitly export'ing a correct CMAKE_ROOT isn't helpful, and cmake keeps displaying the same misleading message.
The issue can be solved by setting PATH to /usr/bin:/bin:/everything/else in your .bash_profile.
I was able to fix this error on Linux (for other who may be searching for answer on Linux) while trying to upgrade cmake 2.8.11 to 2.8.12 by exporting the CMAKE_ROOT environment variable like so:
export CMAKE_ROOT=/path_to_install/cmake-2.8.12.2-Linux-i386/share/cmake-2.8
The share directory should be on the same level as your bin directory.
I got the same error message upgrading cmake-3.5.1 to cmake-3.7.1 on Ubuntu 16.04.01 LTS. I just updated the repositories with
sudo apt-get update
Then
cmake --version
brought up the correct and upgraded cmake version and the error messages was gone.
In my opinion/case this is a developer "problem". I suspect this occurs mostly to new developers so I go a bit deeper to put it in the right perspective:
To "not mess with" the original system files used for daily work and separate the new compiled and volatile programs in a separate location it is common to not just change but add/mount a complete folder structure similar to the original OS folder structure in a special "development" location.
So more or less a mirrored folder structure of the original one but connected/linked to the original resources.
There for we need to add an environment variable to our user bash profile where we tell the system: "link our development folders to the following direction/dir."
On Arch Linux this is done in a file in ~/.bashrc - that is linked/forwarded in/by the ~/.bash_profile ("~" stands for /home/your user name/) and MacOS/Unix will be similar.
To do that there are 2 ways:
you can open the .bashrc file and add your environment path to the bottom of it
or
you can use "export" to put the environment variables to the right place in your user bash file.
for kde development e.g. you need to add a path at the end of the ~/.bashrc file like so:
# Adding the kdesrc-build directory to the path
export PATH="$HOME/kde/src/kdesrc-build:$PATH"
what basically tells the system: the development is done in the /home/user name/kde/src folder - there are your files. You can choose where you want to locate your development environment.
If you execute cmake it "thinks" your files are in the original OS folder and the "Could not find CMAKE_ROOT" - message will disappear because it finds all your files since properly linked from your development folder structure to your system folder structure.
So basically to solve the problem you could just execute cmake in the right system folder - it just could mess up your system if the program or make files are not proper done so it is pulled to the home folder development folder structure. And you just have to tell that cmake, so it can find all needed files to compile your stuff, including the CMAKE_ROOT.
Another problem could be that cmake isn't properly installed.
On Arch Linux systems that can be made sure by using the "sudo pacman -Syu cmake" command and it copies the files in the right direction and sets the right user variables to get it executed and reinstall cmake if necessary.
Btw, if you are on other systems like Debian make sure to use a Debian apt repository, it can differ from the Ubuntu repository, especially if you compile for the chosen system.
I tried to write a general "beginners in mind" overview to get em a fundamental picture. Executing cmake in the right folder solved that exact problem for me that was asked for.
(Actual that flags works for the actual cmake version from the official arch repository:
1:
cd /home/ivanovic/kde/src/program_name
than:
2:
cmake -S/home/ivanovic/kde/src/program_name -B/home/ivanovic/kde/build/program_name -DCMAKE_INSTALL_PREFIX=/home/ivanovic/kde/usr -DCMAKE_BUILD_TYPE=Debug
Pay attention that between -S and /home/... is no space, same at -B and /home/...
This worked fine for my kde system software builds.
)
If anyone gets the following error:
Modules directory not found in
/usr/share/cmake-3.20
cmake version 3.20.2
Solution which worked for me:
sudo cp -r /share/cmake-3.20 /usr/share/
The above command copies the cmake-3.20 directory from /share to /usr/share
This also happened to me on a fresh install of Ubuntu 21.04 and was fixed by installing it from "snap":
sudo snap install cmake --classic
(and then making sure that /snap/bin is in $PATH)
tl;dr: check the permission of folder /usr/local/share/cmake-x.xx.
I had a similar problem with the cmake that I build from source code. I compile the code with the following command.
./configure
make
sudo make install
and the binary files were placed into /usr/local/bin as expected. But I will encounter the same problem when executing cmake without sudo privilege. This is because the normal user don't have reading permission with folder /usr/local/share/cmake-3.xx.
The error went away when I give myself the permission to read/execute, with the command.
sudo chmod 755 /usr/local/share/cmake-3.xx
(xx will be the specific version that you installed.)

Valgrind: Wrong Version

I downloaded Valgrind 3.7.0 and ran:
./configure
make
make install
However when I run valgrind --version, I get 3.5.0. How is this possible? I am running Mac OS X Lion 10.7. I know I downloaded 3.7.0 because the tar file I downloaded from Valgrind's website name isvalgrind-3.7.0.
What other ways can I check for the version?
By default, valgrind binaries should get installed in /usr/local/bin when you compile from source without providing a --prefix.
(You really just did ./configure && make && make install and had the permissions to install, right?)
See if /usr/local/bin/valgrind exists.
Execute /usr/local/bin/valgrind --version. What is the version?
Execute which valgrind. This should tell you where the valgrind binary is being picked from. Is it the same? My guess is, it is probably not.
Execute echo $PATH to see your path. This gives a : delimited list of directories where bash searches for executables, in the order in which the directories are listed.
My guess is:
There is an existing valgrind installation of the old version, and it shows up in a directory that appears earlier in your $PATH than /usr/local/bin.