Problems while trying to build LLVM and Clang - build

I tried to build LLVM and Clang but am getting this error :
cp: cp: cp: cannot stat /home/saurabh/Build/clang-build/build/tools/clang/runtime/compiler-rt/clang_linux/asan-i386/libcompiler_rt.a'cannot stat/home/saurabh/Build/clang-build/build/tools/clang/runtime/compiler-rt/clang_linux/ubsan-x86_64/libcompiler_rt.a'cannot stat `/home/saurabh/Build/clang-build/build/tools/clang/runtime/compiler-rt/clang_linux/ubsan-i386/libcompiler_rt.a': No such file or directory
: No such file or directory: No such file or directory
I went through Cannot build LLVM and Clang but it doesn't seem to have any reasons why he had gotten a similar error (hence I am asking it again). I have tried to remove the -Werror flags in compiler-rt/make/ relevant files, since before that, it was stopping on this error :
/home/saurabh/Build/clang-build/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_mutex.cc:53:13: error:
comparison of constant 4294967295 with expression of type 'int' is always
false [-Werror,-Wtautological-constant-out-of-range-compare]
if (z == MutexTypeLeaf) {
~ ^ ~~~~~~~~~~~~~
1 error generated.
I had asked on #llvm and had been suggested that. Any ideas what could be causing this ?
Fwiw, I am on Ubuntu 12.10 64-bit.

You have to follow http://llvm.org/docs/GettingStarted.html#getting-started-quickly-a-summary. Be aware of the software dependencies you have to install. Also, check again if your --prefix=directory is set. If you cannot install Clang over LLVM (after you succeded to install LLVM), you can try install it using apt-get install clang and clang++. Therefore, you can compile your LLVM passes using this clang. For other corresponding packages, like VMkit for Java, you have to install ant and oracle jdk.

My LD_LIBRARY_PATH environment variable wasn't set properly. After I corrected it, this problem went away.

Related

make*** error 126 when trying to compile rstan with Rtools 3.5/Rv3.5.1

I am using R v.3.5.1, R studio v 1.3.1093 with Rtools 3.5 on windows 10.
I know that R tools have been successfully installed and the toolchain has been found, having followed https://github.com/stan-dev/rstan/wiki/Configuring-C---Toolchain-for-Windows and successfully installing:
install.packages("jsonlite",type="source").
However, when I try and install rstan from source using
pkgbuild::with_build_tools(install.packages("rstan", type = "source"))
I get the following error message:
sh: C:/Rtools/mingw_32/bin/: Is a directory
make: *** [C:/PROGRA~1/R/R-35~1.1/etc/i386/Makeconf:215: sparse_extractors.o] Error 126
ERROR: compilation failed for package 'rstan'
* removing 'C:/R/library/rstan'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘rstan’ had non-zero exit status
Currently, my makevars.win file contains the following:
CXX14 = C:/Rtools/mingw_$(WIN)/bin/ g++ -std=c++1y
CXX14FLAGS = -O3 -Wno-unused-variable -Wno-unused-function
Although I have tried various different lines in the makevars file and all still bring up the error 126 message as above.
I can successfully install the binary versions of rstan/rstanarm/brms etc. But when I try and compile a model it fails. When I tried this and realised the binary versions were not working, I uninstalled rstan/rstanarm and brms before trying to install the source versions.
Any help fixing this error and successfully installing rstan would be greatly appreciated!
There is a space before g++ which causes the Makefile to execute the directory (which fails as it is not an executable).
Remove the space.

gcc returns "No such file or directory"

I'm trying to install Mathtex on my Ubuntu 16.04 server for my engineering wiki. It has been a nightmare, just as it was in the past when I tried this.
First, I've installed mathtex via apt-get. That complains of a missing directory. After manually creating those directory it moves on to complain of another. Finally complains of a missing cache directory. I create the cache just like the others and mathtex still complains that the cache directory is missing...
Then I attempt to install via the instructions on the website (http://www.forkosh.com/mathtex.html). In other words, install the dependencies LaTeX and dvipng. Then compile the program using cc (although I use gcc). I've gotten this to work in previous installations of Ubuntu - 12.04 or 14.04 - but can't find those instructions anymore. I was paying for a service until this summer when they went out of business.
Here is the compile line:
cc mathtex.c –DLATEX=\"$(which latex)\" –DDVIPNG=\"$(which dvipng)\" –o mathtex.cgi
Here is the return:
cc: error: –DLATEX="/usr/bin/latex": No such file or directory
cc: error: –DDVIPNG="/usr/bin/dvipng": No such file or directory
cc: error: –o: No such file or directory
I've also tried replacing $(which latex) with $(which pdftex) (/usr/bin/latex is a symbolic link to /usr/bin/pdftex) and /usr/bin/pdftex, /usr/bin/tex, /usr/bin, and /usr/bin/. Same result, the error says there is no such file or directory for all of them.
Googling this error only returns help for people who can't get Ubuntu to recognize gcc as the cc compiler. That's not my issue though.
Did you copy that command from a document? You have the wrong kind of dashes on your options.
Delete the – (en dash) and replace it with -.

Makefile error raspberry-pi 3

I have an issue with Codelite compilation, running on raspbian jessie - these are the (known) steps I have taken to produce it.
First I installed Codelite with apt-get install Codelite, then produced a c++ project.
When running build project I get the error:
/bin/sh -c ' -j 4 -e -f Makefile'
/bin/sh: 1: -j: not found
0 errors, 0 warnings
I note that this error has been found and corrected previously, through running a different version of Codelite from 6.1.1 (that which apt-get installs). I therefore found the updated version of armhf .deb codelite from the rasbian archive with gdebi-gtk. However the updated version (9.1.1) produces the following error (install attempt with the graphical debian):
Error: Dependency is not satisfiable: libclang 1-3.8 (>=3.2)
I do not understand why the package manager cannot update these packages - do they not exist for the pi? I ran the manager as root, so I do not think it is a permissions issue.
EDIT 1:
Thank you for that Fabre. My Enviromental Variables file now looks like this:
CodeLiteDir=/usr/share/codelite
export MAKE=make
I still get the same error however.

autotools syntax error with ax_check_compile_flag

I am using autotools for building my C++ application. In my configure.ac I have the following line:
AX_CHECK_COMPILE_FLAG([-Wall], [CPPFLAGS="$CPPFLAGS -Wall"])
which causes the following error when executing ./configure (after running autoreconf -i):
./configure: line 3825: syntax error near unexpected token `-Wall,'
./configure: line 3825: `AX_CHECK_COMPILE_FLAG(-Wall, CPPFLAGS="$CPPFLAGS -Wall")'
My system: Linux web 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64 GNU/Linux
On my Ubuntu machine it works well, why do I get this error?
autoreconf isn't magic (though I encounter package maintainers who obviously believe this). When you ran autoreconf, it failed to find the AX_CHECK_COMPILE_FLAG macro, and produced a corrupt configure script. Usually that produces an error/diagnostic message at the same time.
'AX_CHECK_COMPILE_FLAG` comes from the autoconf archive project, and Debian has a package which provides this, named autoconf-archive. Likely, you forgot to install it:
sudo apt-get install autoconf-archive

Trying to install OCaml 3.12.1 on Linux with Godi

I'm trying to install OCaml 3.12.1 on 64 bit Linux (Mint Linux which is essentially Ubuntu 11.04). I'm using the latest rocketboost (godi-rocketboost-20110717). I run ./bootstrap and after a while get the following (in bootstrap.log):
4287 ### Building godi-pcre
4288 ===> Cleaning for godi-pcre-6.2.2godi1
4289 => Checksum mismatch for pcre-ocaml-6.2.2.tar.gz.
4290 Make sure the Makefile and checksum file (/home/phil/godi-3.12.1/build/godi/ godi-pcre/distinfo)
4291 are up to date. If you want to override this check, type
4292 "godi_make NO_CHECKSUM=yes [other args]".
4293 Error: Exec error: File /home/phil/godi-3.12.1/build/godi/godi-pcre/./../../ mk/bsd.pkg.mk, line 1689: Command returned with non-zero exit code
4294 Error: Command fails with code 1: godi_console
Is this a package problem with pcre?
And how would I use the suggest "godi_make NO_CHECKSUM=yes [other args]" to fix this?
This has been fixed by the maintainer of the pcre-ocaml library. It should work fine now.