Fatal Error: File 'hdf5.mod' opened at (1) is not a GNU Fortran module file - gfortran

I am using gcc 4.9.2 and trying to use gfortran in order to read and write hdf5 binary files. I am getting the following error:
USE HDF5
1
Fatal Error: File 'hdf5.mod' opened at (1) is not a GNU Fortran module file
I tried removing and reinstalling gfortran but no change. Any suggestion would be appreciated.

The HDF5 library (or at least, the Fortran interface part of it) needs to be compiled with the corresponding Fortran compiler and (major) version that you use for your own code as well.

Related

Lightgbm gpu installation

I am trying to run Lightgbm with gpu on Spyder. For installing the library I tried many commands but most have failed.
I tried "pip install lightgbm --install-option=--gpu" in anaconda prompt and got the
error.
The I followed the https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#build-gpu-version
I installed git, vs 2022, cmake and opencl(Cuda Toolkit)
For boost binaries I copied the boost_1_78_0 file in "C:\Boost".
But the file doesn't contain any "lib64-msvc-14.0"(or similar folder). This is the first problem but it contain libs folder so I gave that path(Hope that's right).
But then I get this error:
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
"CMake Error: The source directory "C:/Users/User Name/LightGBM/build" does not appear to contain CMakeLists.txt"
Any help is appreciated. Thanks

Unable to cross compile iOS programs on linux

I know that someone already asked this question but it isn`t up to date anymore. Most of the links are dead and the commands are not relevant anymore.
I have read these
Compile IOS program from linux commandline
How to cross-compile clang/llvm for iOS?
For example, I have been trying to compile silversearcher-ag for my iPhone 6 (jailbroken). This is the project link https://github.com/ggreer/the_silver_searcher.
I am targeting iOS 12.4.
These are the commands that I`ve tried
./configure CC=/home/growtopiajaw/Desktop/cctools-port-master/usage_examples/ios_toolchain/target/bin/arm-apple-darwin11-clang CXX=/home/growtopiajaw/Desktop/cctools-port-master/usage_examples/ios_toolchain/target/bin/arm-apple-darwin11-clang++ --host=arm-apple-darwin11
make
I am using cctools-port to cross compile the project. My compiled cctools toolchain is located under /home/growtopiajaw/Desktop/cctools-port-master/usage_examples/ios_toolchain/target and below is how the toolchain`s directory structure looks like
This is my configure log: https://del.dog/nugibonury
This is my make log:
CC src/ignore.o
In file included from src/ignore.c:11:
./src/options.h:7:10: fatal error: 'pcre.h' file not found
#include <pcre.h>
^~~~~~~~
1 error generated.
make: *** [Makefile:494: src/ignore.o] Error 1
This is my GitHub repository containing the cross compile toolchain
https://github.com/GrowtopiaJaw/arm-apple-darwin11
Apple does not ship PCRE. You need to get the headers and dylib/tbd files manually.
If you're using checkra1n or unc0ver, then the deb on the APT repo contains headers as well, so you could just use that.
If you plan to package this into an APT/dpkg file, make sure to add pcre as a dependency.

Vim YouCompleteMe clang-completer complains it can not find 'omp.h' file where Eigen (C++ library) calls for it

I am using Vim's YouCompleteMe C semantic completer installed with the --clang-completer flag. It complains that it can not find the 'omp.h' file used in the Eigen/Core library file. Error message is as follows:
In included file: 'omp.h' file not found /usr/include/eigen3/Eigen/Core:247:10: note: error occurred here [pp_file_not_found]
The code compiles and runs perfect, so that's why I know it is not a real issue and something wrong with YouCompleteMe. I have tried using both clang and clangd, it does not matter, same issue.
If I simply remove the -fopenmp from the compile_command.json file, it fixes the issue.
Thanks in advance.
The pre-built clangs from llvm.org don't include openmp. YCM includes a copy of the clang resource dir from the pre-built llvm.org packages, therefore 'omp.h' (which is part of the resource dir) is not found.
If you need to use openmp, then i suggest you set g:ycm_clangd_binary_path to point to a clangd that is installed alongside your llvm toolchain containing openmp.

clang/llvm compile fatal error: 'cstdarg' file not found

Trying to convert a large gcc/makefile project into clang. Got it roughly working for x86, but now I'm trying to get cross compilation working.
The way it currently works is that we use Linaro's 7.1.1 arm compiler alongside its companion sysroot directory for base libraries/headers. I installed clang-6.0 and then the base clang(not sure if that mattered).
I used some commands I found to redirect clang to clang-6.0 and when I execute 'clang -v' and got
clang version 6.0.0-1ubuntu2~16.04.1 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
....
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/9
....
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.5.0
....
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0
Candidate multilib: .;#m64
Selected multilib: .;#m64
It does not find the current compiler we use which is at
/usr/local/gcc-linaro-7.1.1-2017.08-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++(also a directory for *x86_64*)
I only found references to setting --sysroot, but not to a specific compiler. Definitely still lost about the relationship between clang+llvm+other compilers. I even saw somewhere saying I needed to compile llvm before I could use it?
I very roughly made changes in our make files to get the following output, basically all I had to add was '-target arm-linux-gnueabuhf' and reordered the mcpu/mfloat/marm/march so they came after -target in case it mattered
clang --sysroot=/usr/local/sysroot-glibc-linaro-2.25-2017.08-arm-linux-gnueabihf -c -std=c++0x
-g -DDEBUG_ON -target arm-linux-gnueabihf -mcpu=cortex-a7 -mfloat-abi=hard -marm -march=armv7ve
-Wall -fexceptions -fdiagnostics-show-option -Werror .... -I/usr/local/gcc-linaro-7.1.1-2017.08-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include .... and many more
I think the problem probably lies with the change I made which is the actual 'clang' call that replaced
/usr/local/gcc-linaro-7.1.1-2017.08-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ ....
End up with
fatal error: 'cstdarg' file not found
#include <cstdarg>
As said before I can already cross-compile with gcc, so I've already come across issues with std libraries that require 'build-essentials', 'g++-multilibs', etc. So they're already installed.
Looked and really haven't found anything too useful to me, I'm on linux mint 18.3 and the closest things I found were issues people had on mac and windows.
So I came across some posts mentioning setting --gcc-toolchain=/your/choice/of/cross/compiler but they also mention it not working. I discovered that if you combine this with the installation of llvm-6.0-dev(or maybe llvm-6.0-tools, tools installed dev so not 100%) it at least worked for me.
Any compiler clang or gcc needs to know where a header file is defined. The standard headers, standard libraries, c-runtime, and libc are all packaged together for each target e.g., arm64, x86 in a directory called 'sysroot'. When we compile a program we need to pass the path to sysroot for a compiler to know where to look for standard headers during compilation, and where to look for common libraries (libc, libstdc++ etc) during linkage.
Normally when we compile a program for the same machine the compiler uses the standard headers available in '/usr/include' and libraries from '/usr/lib'. When cross-compiling programs we should supply the sysroot as compiler flag. e.g. gcc --sysroot="/path/to/arm64/sysroot/usr" test.cpp. Same for clang. Most often pre-packaged cross compilers come with a script/binary that has 'sysroot' path embedded into it. e.g., aarch64-linux-gnu-gcc (https://packages.ubuntu.com/xenial/devel/gcc-aarch64-linux-gnu).
... the closest things I found were issues people had on mac and windows.
On mac the clang compiler will have the similar configuration as linux. So the details you found there should be totally applicable to yours.
More details on sysroot and cross-compilation:
https://elinux.org/images/1/15/Anatomy_of_Cross-Compilation_Toolchains.pdf

MinGW doesn't recognize the directory opencv

I write a code using opencv library, I used codeblocks ide configuring it to work with opencv (configuring linker settings and search directory and including all the necesary path to enviroment variable) correctly and then the program works fine. The problem is when I try to compile using minGW with g++ 6.3.0 version, it gave me the next error:
ImgSeg.cpp:2:39: fatal error: opencv2/imgproc/imgproc.hpp: No such file or
directory
#include <opencv2/imgproc/imgproc.hpp>
^
compilation terminated.
I try all possible form to put the opencv2 directory in enviroment variable but it has the same error all the time, it's a little frustrating. this is what I have on path in enviroment variable:
C:\opencv_install\lib;
C:\opencv_install\include;
C:\opencv_install\bin;
I'm using windows 7 64 and opencv 2.4.9
GCC does not search PATH when looking for include files.
You will need to tell it where to look by using the -I commandline parameter:
-IC:\opencv_install\include
When linking, you'll also need to tell GCC where to find the libraries you're linking:
-LC:\opencv_install\lib -lopencv_core
In CodeBlocks you'll need to add the former to include directories (not PATH) in the project settings.
Finally I could compile the program but I had to install mingw64 version 4.9.2 from this link. The command that I use to compile was this:
g++ -std=c++11 "name of the program.cpp" -IC:/opencv_install/include -LC:/opencv_install/lib -llibopencv_core249 -llibopencv_highgui249 -llibopencv_imgproc249 -o "name of the exe"
It's important include the -l lib that you used in the program

Resources