Can not find LLVM library files - include

I have been trying to set up llvm on my linux. I am running fedora. I have tried installing llvm through dnf install llvm and it appears to be installed on my computer. However, in my c++ code any header I try to include from it shows error. I am currently trying to do it manually but if you have any answers I would be grateful if you share it with me. Thanks.

You can use the following commands to find where are the include directory and LLVM libraries in your Linux system. Then they can be included into your compilation command.
llvm-config --includedir
llvm-config --libfiles
I don't use Fedora, but in my Linux Mint 20, these commands return:
/usr/lib/llvm-10/include
/usr/lib/llvm-10/lib/libLLVM-10.so

Related

Run or use GCC without install

Can I use GCC for e.g GCC4.0.3 without installation
In my macOS I have installed Clang xcode , and GCC from Homebrew
In my Linux they are installed as well
But I want to use GCC (Specially older version) besides most updated version
Like NVM that manage Node version and it lets you install many nodejs with different version on your system
I want to use GCC4 specially for science and compiling Old FORTRAN to make my Source codes run and see the results
In new OS both macOS and Linux when you install gcc it will install most updated and that is not useful for old fortran or old codes.
So In my solution i think its better to use gcc without install or even install gcc to custom directory folder and copy the codes in that directory and compile them but not to install as wide system and make incompatibility with default GCC and CLANG on system
Thanks in advance

Replacing old Xcode command line tool with newer Brew version

I'm trying to build a binary from source code which has a dependency on the package" NASM 2.12.02 or later. However, I have an earlier version already installed on my Mac via Xcode:
/usr/local/bin/nasm -v
NASM version 0.98.40 (Apple Computer, Inc. build 11) compiled on May 1 2018
So to (attempt to) rectify this, I used Homebrew to install a much newer version of the package
brew info nasm
nasm: stable 2.13.03 (bottled), HEAD
However, now my PATH is only pointed to the old NASM executable, while the new tool seems to be sitting in Homebrew's Cellar (ie. /usr/local/Cellar/nasm/2.13.03).
Is there a nice way of "switching" between these versions so that the system PATH views only the newer version and disregards the older one? So far I've thought of rm -rf-ing the old version and exporting the new version to my PATH, but that seems very destructive.
Also, I have run the command: brew doctor and have resolved all linker errors, but that has not seemed to help.
Any help would be greatly appreciated!
To fix this, I used the following command:
export PATH=/usr/local/Cellar/nasm/2.13.03/bin:$PATH
This modifies the PATH variable to point to the /usr/local/Cellar/nasm/2.13.03/bin directory and find the nasm executable there before looking in /usr/local/bin.

Cross-compile for Windows under Ubuntu with Cmake

I'm trying to compile xc3sprog xc3sprog for Windows under Ubuntu 16.04. According to its README I do:
cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-mingw32.cmake ..
In a result I have cmake_output.
I've installed libftdi with:
sudo apt install libftdi*
Could you help me?
EDIT:
As stated in comments, now I have a problem with #include <libusb/usb.h> which can't be found when make is eecuted. Where does it look for this file? In Linux host system headers or in mingw32 toolchain headers?
For me it seems that in toolchain, because when compiling Linux version there wasn't such an error (the different thing is that I can't find this libusb/usb.h file anywhere in system files, so I don't know how it work for Linux compilation...).

How to disable Apple's LLVM on mac

I started to learn about Mix IDE and the thing is that, while compiling the Mix IDE, it keeps failing to compile source in the package. So I've done some search and it turns out that I need to use old version llvm. So I installed llvm37 using home-brew and there was no problem while installing it. The only problem is that when I type
clang --version
it keeps returning the following result.
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Therefore, I need to know how to disable the default LLVM and use the one I installed with Homebrew. Any idea?
You have several options:
Modifying PATH
Put Homebrew's binary path before everything else:
export PATH=/usr/local/bin:$PATH
Uninstalling Xcode command line tools
This will remove the command line tools that are delivered along Xcode.
sudo /Developer/Library/uninstall-devtools --mode=all
If you installed the command line tools without Xcode, see this question. Please be aware that Homebrew might depend on some of those tools and may cease to function! I did not test it.
Setting the desired compiler
This is the cleanest solution. Tell the Mix IDE's build system which compiler to use. Since I do not know which build system Mix IDE uses, I cannot tell you how to do that. Some build systems honor the CC, CXX and CPP environment variables, so it may work setting those to the clang binary installed with Homebrew.

Exe's compilation on Solaris 11 env using gcc

I am on Solaris 11 environment and gcc-3.4.6 is installed on it. The problem is that I am not able to compile exe's there, The error is
-sh: gcc: gcc: cannot execute [Invalid argument]
even if I write gcc only it gives the same error. Kindly help.
Unlike in Solaris 10, on Solaris 11 the GCC is not installed by default.
Fear not.
By far the easiest is to use IPS to install it using the commands below (while being root or other superuser):
pkg install pkg://solaris/developer/build/gnu-make
pkg install pkg://solaris/developer/build/make
pkg install pkg://solaris/developer/gcc-45
pkg install pkg://solaris/system/header
pkg install pkg://solaris/developer/build/autoconf
pkg install pkg://solaris/developer/build/automake-110
This will give you all the tools you typically need to build various open source software packages.
Note that some of the packages have a version number in the package name itself, e.g. gcc-45. You may be able to find even later versions in the package repository, for example for Solaris 11.2 Beta you'll find you have a choice of GCC 4.5, 4.7 or 4.8. The same applies to automake which is now also available in v1.11.
(recipe from my posting here)

Resources