OpenMP Not compiling on gFortran (MinGW) - fortran

My problem is similar to this (gfortran can't find OpenMP library (omp_lib.mod) using MinGW). However, no one seems to solve this and I am stuck trying to figure this out. And yes I already have libgomp installed which I reinstall and also double check in my C:/MinGW folder. Can someone help me to resolve this? Why can't my gFortran compiler open the module omp_lib? Otherwise, my compiler works fine as long as I don't use OpenMP.
Here is the error shown,
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.

Related

CLBlast library not working on Mingw-w64 with Nvidia GPUs

I am trying to run the example samples/sgemm.cpp from the CLBlast repo on
Windows 10 with a Nvidia graphics card. I have obtained the cl.hpp from the link. The makefile is simply as follows:
a.exe: sgemm.cpp
g++ sgemm.cpp -lopencl -clblast -O0 -g -DCL_TARGET_OPENCL_VERSION=300
I have the Nvidia CUDA toolkit v11.6 installed and the include directory is on the environment variable CPATH so that it is found by g++. Furthermore, the compiler is part of a Mingw-w64 installation on which clblast is installed.
The problem is that the compilation seems to succeed, but as soon as I try executing the a.exe it crashes without any error message. Similarly, attaching gdb does not help either, because the program exits immediatedly and gdb prints
During startup the program exited with code 0xc0000135.
What is the problem?
Update
I have opened an issue on the clblas github. Note that I can compile clinfo from here without problems. A missing library therefore should not be the first thing that comes to my mind.
To answer this, this was not a problem with gdb, a.exe or the CUDA toolkit but rather with the installed library which is build with Visual Studio. The resulting binary seems to be incompatible with g++. Therefore, installing the library from source using g++ fixed this.

Eclipse Cpp g++ command not found (MinGW & CDT Installed)

I am very new in using Eclipse as an IDE and I am facing many problems in configuring it. I may also be asking a few problems that may already be on forum but believe me I've tried almost all that I could have. SO coming towards the problem, I made a simple Hello World program for C++ to test out my config and YES I have installed MinGW and CDT. I have also edited the path environment variable for MinGW, and I chose MinGW GCC as toolchain while creating it and still my simple HELLO WORLD is giving me the error:
/bin/sh: g++: command not found make: *** [src/TEST2.o] Error 127
I have no idea what I have missed in between and it would be very helpful if someone would help me out correctly config my Eclipse :)
PS: I don't know if changing the tool(compiler) in Tool chain editor affects the process but I tried it as well...

how to turn on multi threading BOOST_DISABLE_THREADS

Im trying to use boots 1.67.0 in visual studio on windows to compile the boost thread example but im getting a error that i can not find the issue to. I think the error may be i am missing a #define but im not sure how i can work it out. boost seams to be working fine in till i start using threading. when i downloaded boost i have not run bjam iv just used added the directory to my include and linker setting. Dose any one know how to resolve this ?
the error im getting in VS is:
c:\librarys\boost_1_67_0\boost\config\requires_threads.hpp(29): fatal error C1189: #error: "Threading support unavaliable: it has been explicitly disabled with BOOST_DISABLE_THREADS"
**EDIT 2*
I have now built the library as it was pointed out to me that to use threads in boost i needed to so i opened bjam and ran the following command "bjam -a --build-type=complete threading=multi" but i still get the error. do i need to use pre-compiled headers in my settings?

Problems with quadruple precision Fortran code compiled with 64-bit anaconda mingw

I've been using f2py to "pythonize" some Fortran codes for use on a 64-bit Windows 7 machine. I'm working with 64-bit Anaconda 4.2.0 and using MinGW installed via conda install mingw (the associated folders use the name "x86_64-w64-mingw32"). It was working well until I tried a program with quadruple precision (REAL*16) numbers. I found that the program crashed (libquadmath-0.dll was cited in the ProblemSignature of the Windows-generated crash report).
I tried to identify the simplest case that causes a problem. I ended up coming up with a fairly basic Fortran program that gives a "fatal error" under certain conditions:
PROGRAM MAIN
REAL*8 DL
REAL*16 QL
DL=2.71828
QL=3.14159
C when compiled with -ffpe-trap=overflow with MinGW distribution for 64-bit Anaconda, uncommenting either of the lines below breaks the program ("fatal error" at runtime)
C however, the second line is acceptable if DL is changed to quad precision (REAL*16)
C both lines are acceptable if both DL and QL are double precision (REAL*8)
OPEN (79)
print*, "DL=",DL
print*, "Ready to print QL!"
print*, "QL=",QL
end
As indicated in the comments above, when I compile with the Anaconda MinGW package's gfortran with the compiler option -ffpe-trap=overflow, I get a fatal error. For example, with both lines uncommented (as above), I get:
DL= 2.7182800769805908
Ready to print QL!
A fatal error occurred! Backtrace for this error:
#0 ffffffffffffffff
(See comments in the code for further details about what happens with different variations.)
I have tried with a standard MinGW32 distribution that I have set up on the same computer (compiling and running within msys command line), and there are no issues.
I believe I have confirmed that the libquadmath-0.dll included with the anaconda mingw package is a 64-bit dll. I have not been able to identify any issues with environment variables, and I think I have ruled out the possibility that it is using my standard MinGW32 32-bit dll by temporarily renaming the MinGW32 directory.
Aside from the 32-bit vs. 64-bit difference, I have noticed that my MinGW32 gfortran is based on GCC 4.8.1, whereas the gfortran with the 64-bit Anaconda MinGW package is listed as using GCC "4.7.0 20111220 (experimental)". I'm not sure if that is related to the issue, but I couldn't find anything obvious in the GCC changelog that would account for the issues I'm seeing.
I'd very much appreciate any tips / solutions anyone can provide.
I'd be especially interested if anyone can reproduce this error with another 64-bit MinGW distribution. At the moment, I don't know if it is an issue with GCC/gfortran, MinGW, Anaconda, or something else peculiar to my own setup.

Matlab R2016a Mex file error

I have gcc version 5.3.1 on fedora 23 and I want to run some mex files. Whe I compile the file I get the following warning:
Warning: You are using gcc version '5.3.1-6)'. The version of gcc is not supported. The version currently supported with MEX is '4.7.x'. For a list of currently supported compilers
see: http://www.mathworks.com/support/compilers/current_release.
and when I try to run it I get the following error :
Invalid MEX-file '/home/x/Downloads/MatlabEXR/MatlabEXR/exrread.mexa64': /usr/local/MATLAB/R2016a/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.8' not
found (required by /home/x/Downloads/MatlabEXR/MatlabEXR/exrread.mexa64)
I tried this : How to tell mex to link with the libstdc++.so.6 in /usr/lib instead of the one in the MATLAB directory?
but still I get the same error. Anything in mind what can be the problem?
I had a similar problem regarding libstdc++(I couldn't plot anything). This is the link to my question. matlab on linux can't plot anything(can't load libstdc++.so.6: version `CXXABI_1.3.8' not found)
How I solved the issue is also stated there.
Hope that helps
You error is originated from the fact that your libstdc++ uses a new ABI by default (https://gcc.gnu.org/gcc-5/changes.html). You can't link your MEX files using gcc 5.xx version.