COSD and SIND in GFortran 6.3 - fortran

Just I have installed gfortran 6.3 in my MacOS.
I'm trying to compile my programs that uses COSD, SIND, etc., but I have an error message from the compiler.
I have try to use the flag -fdec-math in the options of compilation but it doesn't resolve the problem. The compiler gives a message that it is an unknown option.
Also I have tried to use -std=f2008 but I have the same situation.
What should I do?

Related

cc1plus: error: unrecognized command line option "-Wno-implicit-fallthrough" [-Werror]

I am getting this error when I am cross compiling compute library on x86 for arm by using SCons.
Here I am cross compiling this to run a tensorflow model on armnn sdk.
How I can solve this error?
Please give me suggestion.
-Wno-implicit-fallthrough was first added in gcc-7. You are probably using an older version of the compiler, which does not recognize the option.
You have several options:
Use later version of gcc
Remove -Wno-implicit-fallthrough flag from gcc call
Add -Wno-unknown-warning to suppress the warning

unrecognized command line option “-std=c++11”

I am trying to run wiringPi Cpp version with raspberryPi. I downloaded this and tryed to run but I go the error below.
What is the problem here? Did I do something wrong?
Upgrade your GCC. You appear to have GCC 4.6, and the flag you mention was introduced with GCC 4.7.
Run g++ -v on the command line. If the version number is 4.3 through 4.6 replace -std=c++11 with -std=c++0x and see if you get any love. If that still doesn't work, you'll have upgrade the compiler or remove the c++11 features from the library. Seriously recommend the former over the latter.
If the compiler is before version 4.3 definitely upgrade.
edit
I need to read more goodly. skip getting the version number. Try -std=c++0x, then upgrade the compiler if it fails.

Chilitags compilation on Linux

anyone has any experience with Chilitags? I tried to implemented it on my Virtual Linux, I followed all the steps the instructions give, but when I tried to make build it gave this error.
cc1plus: error: unrecgonized command line options `-std=c++11`
Can somebody tell me what this error means. My cmake version is 2.8.7 and gcc version is 4.6.3.
Thanks
GCC version 4.6 is far from the latest version, it's up to 4.9 now.
The problem is that the flag -std=c++11 didn't get into GCC until version 4.7, before that it was -std=c++0x.
You might also want to know that the support for C++11 (or C++0x as it was still called then) was far from complete in GCC 4.6.

Unable to cross-compile to SPARC using clang

So here's the situation: I need to be able to compile binaries from a Linux machine (on Ubuntu, for what it's worth) which are able to run from a SPARC server. The program I'm trying to compile is very simple:
#include <stdio.h>
#include <stdlib.h>
int main() {
printf("Testing the SPARC program...");
return EXIT_SUCCESS;
}
I've tried a number of different compile lines to get it to work, but unfortunately nothing appears to be working.
I tried the traditional:
clang -target sparc blah.c -o blahsparc
But this doesn't work, with a bunch of assembler failures:
/tmp/blah-519e77.s: Assembler messages:
/tmp/blah-519e77.s:7: Error: unknown pseudo-op: '.register'
/tmp/blah-519e77.s:8: Error: unknown pseudo-op: '.register'
/tmp/blah-519e77.s:9: Error: unknown pseudo-op: '.register'
/tmp/blah-519e77.s:10: Error: unknown pseudo-op: '.register'
/tmp/blah-519e77.s:11: Error: no such instruction: 'save %sp,-240,%sp'
/tmp/blah-519e77.s:12: Error: no such instruction: 'st %g0, [%fp+2043]'
...
clang: error: assembler (via gcc) command failed with exit code 1 (use -v to see invocation)
I've tried this also:
clang -cc1 -triple "sparc-unknown-Linux" blah.c -o blahsparc
which complains about the missing headers, so instead of using -cc1, I use -Xclang:
clang -Xclang -triple -Xclang "sparc-unknown-Linux" blah.c -o blahsparc
however, this also fails due to "error: unknown target CPU 'x86-64'".
I'm not sure where to proceed with this. I've tried using crosstool-ng as well with very little success.
As of the 3.4.2 release (June 2014), llvm is missing code necessary to be able to generate object files for sparc targets. Older releases (1.x & 2.x) had support for it, but llvm's framework for emitting object files was less mature back then. When the current framework was rolled out it looks like they didn't migrate all platforms.
The documentation seems to imply that a combination of llvm/gcc is known to work, but I think that table was tabulated based on a much earlier version of llvm when they had a less mature framework for emitting object files.
Support for emitting object files was added to their SVN trunk in revision r198533 (this thread discusses the commit), but as you can see in the 3.4.2 final release, files & changes added in r198533 aren't present.
As an aside, clang currently isn't functional in sparc solaris (not sure about sparc in general). The parser seems to have trouble parsing templates; I get coredumps & the like. I ran across a thread a week or so ago discussing alignment problems in sparc/solaris clang, and this may be one of the reasons clang isn't yet usable on this platform.
If you need a cross compiler for Sparc that runs on an Ubuntu machine, the simplest way I know of is to use Buildroot. Here's a small tutorial on how to obtain a cross compiler and test the generated executables on a Sparc emulator.
LLVM 3.6.2 has some support for sparc now... I was able to build llvm 3.6.2 and clang 3.6.2-r100 on my T2000. I haven't gotten C++ support working but I have built moderately complex C applications like htop.
I did compile LLVM using gcc 5.2 however I lower version should work as well although I'd suggested at least gcc 4.9 and no lower than gcc 4.7.
The LLVM emerge on gentoo crashed during the compile but I was able to resume it by moving to the portage directory with the llvm ebuilds and restarting the build manually:
cd /usr/portage/*/llvm/
ebuild llvm-3.6.2.ebuild merge
I had to override some of the default compiler:
CC="clang -target sparc-unknown-linux-gnu"
CXX="clang++ -target sparc-unknown-linux-gnu"
CFLAGS="-O2 -pipe"
CXXFLAGS="${CFLAGS}"
I don't know if you will be able to use this to build from an x86 machine... though clang is supposed to be able to do that. But worst case you might be able to get this going in qemu-system-sparc64 vm or on some real hardware that you can find cheap on ebay (T5xxx hardware is coming down in price and blades are dirt cheap)
I recently updated to clang 3.8 (which is as yet unreleased) and I was able to compile a c++ application by passing -lstdc++ in addition to the options above. I believe this is the same behavior as gcc when invoked as gcc rather than g++.

How to use std::thread of C++ 11 under Cygwin GCC 4.7.2

I've been trying to compile a multithread hello-world program under Cygwin using the newly introduced C++ 11 std::thread feature without success. I compiled and installed GCC 4.7.2 by myself, and the same code works without any problems under Linux with the same version of GCC. The first error I got was that the compiler did not recognize the -pthread flag. After researching on it for a while I noticed someone said on Cygwin this flag should be -lthread. I made the change and that error was gone, but another series of errors occur telling me thread is not member of std. I wonder if it's caused by the wrong configuration of the compiler during installation, or std::thread is simply not supported under Cygwin?
This looks like you did not compile the program with the appropriate standard library flag. If you want to compile for C++11 you should use:
g++ --std=c++0x -o ...
The --std flag sets the appropriate language compatibility level. If this does not help, please post the error messages you got as a source listing.