Looking for mpic++ - boost

I am following these instructions trying to build Boost MPI .lib files, but I encountered one problem: I do not have mpic++.
Looking at the MPI implementation files such as MPICH and Open MPI, I see no mpic++ included at all.
Where can I find mpic++?

MPICH2 uses "mpicxx" as its C++ compiler wrapper name.

What is your distribution or OS?
My Debian / Ubuntu systems have it as a softlink to mpic++.openmpi (which comes from the libopenmpi-dev package). So I use Open MPI; the MPICH2 packages provide the same softlink.

Related

How to cross compile from Mac to Linux?

I wrote a little game using Rust, and I used cargo build --release to compile a release version on Mac.
I tried to share this with my friend who is using Ubuntu, but when he tried to run the binary, he got the following error:
cannot execute binary file: Exec format error
I searched for this but found no answers. Doesn't Rust claim to have "no runtime"? Shouldn't it be able to run anywhere in binary form?
Rust not having a runtime means that it doesn't have a lot of code running as part of the language (for example a garbage collector or bytecode interpreter). It does still need to use operating system primitives (i.e. syscalls), and these are different on MacOS and Linux.
What you want is a cross compiler. If you're using rustup, then installing a cross compiler should be simple:
# Install the toolchain to build Linux x86_64 binaries
rustup target add x86_64-unknown-linux-gnu
Then building is:
cargo build --release --target=x86_64-unknown-linux-gnu
Caveat: I don't have an OS X machine to test this on; please comment or edit to fix this if it works!
Well, it is because Rust has no runtime (unlike e.g. Java's JVM) that you can't just compile code on one OS and expect it to run on a different one; what you are looking for is cross-compilation. I haven't done it in Rust, but from what I can gather you can find relevant information on different cross-compilation Rust strategies on this GitHub repo.

How to set external clang directory as default gcc in macports for subsequent port installations?

I downloaded the clang compiler directly from the prebuilt binary tar provided on the llvm website here. The tar file contains a standard directory hierarchy with bin, include, lib etc. Now I want to configure macports to use this compiler in such a way that when a subsequent port requires clang then this compiler's binary is used. Note that I do not want macports to download and install a separate copy of clang. Is it possible to do so?
DETAILS: The reason why I want to keep the clang installation in a separate place is because I often use scientific code, or other code, like chromium, and I use anaconda. I also have xcode installed and that provides its own version of compilers. Adding macports' compilers to the system makes my system almost unmanageable because it is often very difficult to ensure that the right runtime library and compilation time library are being used.
MacPorts does not support this, and there is also no unsupported way to get this done that I am aware of.
However, C++ software installed through MacPorts should always end up using the libc++ runtime (if you're on a system where it is the default). MacPorts is aware of the C++ runtime its ports use and tries to make sure all its ports use the runtime set as the cxx_stdlib in macports.conf (which defaults to your system's default).

How can I compile C++ code with GCC compiler?

I wrote C++ code in notepad and want to compile with GCC compiler. Is GCC compiler a program? from which site I can download it? I don't have any information about it. What can I do?
You can start by downloading Code::Blocks, its an cross-platform IDE that can be downloaded including MinGW GCC compiler.
http://www.codeblocks.org/
But if You're using Linux you can use just a "gcc" command in the terminal.
GCC is a program. if you have linux its probably installed. to chek just type in the console line gcc. if you get a out put with the syntax - it's installed else - type the command that's suggested. in order to compile something type:
gcc <file name>
it will create a .out file that you could run from the console line.
for more info type:
man gcc
You can also use C-free 5.0 which is small and can use many compilers. Small ide. You just need to make it automatically choose the library and inclue paths.
If you're on Windows you can try one of ports: mingw.
If you're on Linux, you probably have it installed (try gcc --version) or at least available from repository (check your distributions "installer").
There is also a number of (free) IDEs that you can also get and use them instead of notepad. Google for Eclipse/CDT, Netbeans, code::blocks, etc.

Readline for windows - developing on linux

I am developing on linux, but still release binaries for windows.
I recently started using readline though, and that has broken my windows builds. Initially it was unable to find the header files, so I copied them to the mingw includes folder. However I still get problems linking to the library (cannot find -lreadline).
How do I get the readline library so that I can link to it in linux when compiling for windows?
Readline should just work, on Windows, I think, although you'll probably have to compile it yourself and bundle it with your program.
You'll need a replacement for ncurses though: pdcurses should do the job for you. Again, you'll probably have to build it yourself, I think.

Boost Jam Not Producing Thread Library on Windows

I downloaded the latest Boost Jam binary from SourceForge and I'm using the command:
bjam toolset=gcc --build-type=complete stage
I've installed Cygwin along with the GCC compiler. While the command produces a stage/lib directory, I cannot find the thread library that I'm using in Linux. Boost Jam takes a while to run, so there could have been errors along the way. Can anyone guess as to why I don't have the thread library? Is there a specific command I can run in an attempt to only build the thread library? Thanks!
You most definitely need to check for, and provide the error messages. You can also try passing either threadapi=pthread or threadapi=win32 to Boost.Build invocation.
In general, using the GNU/Kernel32.dll operating system, sometimes referred to as Cygwin, is risky business. Will using the native port of gcc, from mingw, be sufficient for you?

Resources