Issue when compiling Cython code with OpenMP flag on Windows - gcc

I am trying to compile Cython code with the GCC compiler (which usually works like a charm), and as recommended on the "Using Parallelism" page I add the "-fopenmp" command to my setup file. However, when compiling I get the following error:
gcc.exe: libgomp.spec: No such file or directory
My version of gcc is 4.5.2, which I believe should support OpenMP just fine. I'm working on 64-bit Windows 7.
Any help would be appreciated!

Related

Looking for a mingw-w64 build of gcc that includes mudflap

I'm trying to debug a segfault in some code built with mingw-w64's version of gcc. Since no Windows build of gcc includes the Address Sanitizer, I've been looking for a version prior to 4.9 that would allow me to use Mudflap instead.
(It has to be 4.8 or earlier, since Mudflap was removed from gcc in 4.9 - see https://gcc.gnu.org/wiki/Mudflap_Pointer_Debugging)
I've tried using downloads of 4.8.1 and 4.6.4 from https://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/ - but my builds all fail with cc1plus.exe: fatal error: mf-runtime.h: No such file or directory.
I have tried using the original MinGW as well, but 4.5 as downloaded from
https://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/gcc-4.5.0-1/
just fails silently with error code 1.
Is there any site that still hosts a mingw-w64 build of gcc old enough to include mudflap? Preferably with SEH threads instead of SJLJ. If not, is there anywhere I can download a mingw-w64-compatible set of libraries and headers to install mudflap to work with an existing build?

Has anyone tried to compile OpenBLAS to Webassembly using clang/emcc?

In the OpenBLAS root directory on a linux system, with emcc sdk already loaded by (in the emsdk directory, source ./emsdk_env.sh)
I was trying to use emcc to compile OpenBLAS by
make CC=emcc NOFORTRAN=1 HOSTCC=emcc BINARY=64 libs,
but it complained about cpuid.S.
I understand that it was a assembly file, so instead, I also tried to use clang:
make CC="clang --target=wasm32" NOFORTRAN=1 HOSTCC=clang BINARY=64 libs.
Then I got an error saying:
fatal error: error in backend: 64-bit WebAssembly (wasm64) is not
currently supported.
Does this mean that, one cannot use OpenBLAS to create a .a lib for static linking for Webassembly x64 usage? Has anybody got luck on similar usage? Thanks in advance!
I am using clang version 10.0.0, emcc version 1.39.13, and openBLAS latest code (0.3.9.dev.a).

gfortran can't find OpenMP library (omp_lib.mod) under MinGW

I'm trying to compile a Fortran code that someone has sent me. It compiles fine on my Linux box, now I'm trying to compile it under MinGW on Windows. But when I run the gfortran command to compile and link it, it fails with the following error:
undumag_main_omp.f:8175:9:
use omp_lib
1
Fatal Error: Can't open module file 'omp_lib.mod' for reading at (1): No such file or directory
compilation terminated.
I'm using the -fopenmp switch to use OpenMP.
I've installed MinGW (5.3.0) using the Installation Manager, selecting the mingw32-base and mingw32-gcc-fortran packages. Are there other packages I should install for OpenMP compatibility? Or do I need to compile the omp_lib.mod file myself, and if so how? I can see that I have some libgomp.* files in my MinGW\lib\gcc\mingw32\5.3.0 folder, but there is no omp_lib_mod file anywhere.

Integrating Octave interpreter into program compiled with GCC 4.8.1

I'm trying to integrate Octave interpreter into my rigid body simulator compiled with GCC 4.8.1.
Following steps posted in the official documentation (https://www.gnu.org/software/octave/doc/interpreter/Standalone-Programs.html) allow me to compile, link, and successfully execute the first example. Note, that I can link the executable with both mkoctfile.exe, or g++ when minGW 4.8.1 is added to PATH.
However, the second example showing how to embed the interpreter into my program compiles, links, and then segfaults on execution when GCC 4.8.1 binaries are in PATH. It works, when I use the supplied compiler (in my case it's gcc 4.6.2 shipped with octave 3.6.1 on windows).
Do I need to build octave from source using GCC 4.8.1 in order to successfully link program compiled using that version, or is there any other way to do so?
Using GCC 4.6.2 is not an option for me, as my program uses c++11 features not present in that version.
I just learned that there is a newer Octave version available at http://mxeoctave.osuv.de/ which was compiled with GCC 4.9.2. This version of GCC works for me perfectly and the second example provided in the documentation started to work when compiled with g++ provided with the distribution.

building my own gcc version

My distro (CentOS 6.3) comes with gcc 4.4.6. Since I wanted to try out the Fortran2003 features I decided to compile gcc 4.7.
I followed the steps I found online: compiled separately first gmp, mpc, mpfr, ppl and cloog and the compiled gcc.
I run the configured script as:
configure --prefix=... --with-gmp=... --with-mpfr=... --with-mpc=... --program-suffix=-4.7 --enable-cloog-backend=isl --with-ppl=... --with-cloog=... --disable-multilib
This worked all right and I was able to compile with make & make install.
Now, when trying my new compiler with a simple test program (a hello world kind of thing) I get the error:
gfortran-4.7 -o test test.F90
/home/amcastro/gcc-4.7/output/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/f951: error while loading shared libraries: libcloog-isl.so.1: cannot open shared object file: No such file or directory
So I decide to set LD_LIBRARY_PATH=/home/amcastro/gcc-4.7/output/lib
and then I can compile.
When running I get the error:
./test
./test: error while loading shared libraries: libquadmath.so.0: cannot open shared object file: No such file or directory
So I set LD_LIBRARY_PATH=/home/amcastro/gcc-4.7/output/lib:/home/amcastro/gcc-4.7/output/lib64
and now the program runs normally.
The question is: Why is that my distro version of gcc (4.4.6) does not need me to set LD_LIBRARY_PATH? how does the distro gcc know where to look for these dynamically liked libraries? should I somehow make them to link statically?
I read also that setting LD_LIBRARY_FLAG is not a good idea. Is there another solution?
Thank you in advance
A.

Resources