xcode gcc compiler showing argument list too long - xcode

i m trying to complie a .cpp file in Xcode 3.2.6 in Snow Leapord 10.6.8.
I m getting
i686-apple-darwin10-gcc-4.2.1: error trying to exec '/Developer/usr/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/cc1plus': execv: Argument list too long
Command /Developer/usr/bin/gcc-4.2 failed with exit code 1
while compiling using gcc 4.2 and even tried compiling with gcc 4.0
Can someone provide any pointers on how to resolve this?
Thanks in advance.

I'm not working with Mac, but had the same error on Ubuntu. I pass too much of arguments to gcc input. Try to check your gcc parameters.

Related

Error while trying trying to run make command

I am trying to install a program and when I run make or make -f Makefile (following the installation instructions) I get the following output:
g77 -O5 -Wall -c prep_output.f -o prep_output.o
dyld: Symbol not found: ___keymgr_global
Referenced from: /usr/local/bin/g77
Expected in: /usr/lib/libSystem.B.dylib
make: *** [prep_output.o] Abort trap: 6
I am working on a macOS Mojave 10.14.6. Following some other proposed solutions in similar problems, I've already installed Command line tools in my Xcode but that didn't do the trick. Any suggestions please??
Thanks in advance
EDIT:
I got rid of g77 and installed a compatible version of gcc (gcc8) through MacPorts. After running the make command I get the following:
g77 -O5 -Wall -c prep_output.f -o prep_output.o
make: g77: No such file or directory
make: *** [prep_output.o] Error 1
So I guess the program still needs the g77 setup? This is the program btw ([http://www.cfht.hawaii.edu/~arnouts/LEPHARE/install.html]). Is there a way to rely to the gfortran compiler for building the program?
Thanks in advance
P.S. I noticed that when I install g77 I get the following error:
x usr/local/: Can't set user=0/group=0 for usr/local`
`tar: Error exit delayed from previous errors.
However it still installs g77..
The error message indicates that your installation of g77 is broken. This has nothing to do with make or the particular project you're trying to build, except inasmuch as the project is trying to use g77 in the first place. That is a bit surprising, actually, since g77 has been obsolete for years (gfortran is the current GNU Fortran compiler), but I'm uncertain what exactly to expect from XCode in this area.
On the other hand, since the full path to the binary is /usr/local/bin/g77, I'm further inclined to think that you're not using XCode for this at all. Possibly you've dumped a g77 built on some other system into your /usr/local/bin, and it's not compatible with your Mojave system.
Your best bet is probably to
Get rid of your broken g77 installation.
Install Fink or MacPorts, or a similar project.
Install the Fink / MacPorts / whatever package for gfortran (maybe gcc-gfortran or similar in some of those) to get a working Fortran compiler.
Rely on that compiler to build your project.

How to fix error: invalid value 'f95' in '-x f95'?

I'm using Fortran with CodeBlocks IDE, and when I try to build my code I get this error
error: invalid value 'f95' in '-x f95'
and after that there is no executable file. The thing is, when I write in the
terminal
gfortran nameofmyfile.f
I get the correct executable file "a.out".
Question: How can I fix this problem?
Especifications: I have mac OS X 10.8.5, installed xcode, gcc, and gfortran.
Your IDE uses the clang compiler which does not support Fortran.
See also https://answers.launchpad.net/mg5amcnlo/+question/698961 and https://developer.apple.com/forums/thread/70010.

Xcode 6 throws clang error while compiling

I have recently updated my Xcode to version 6.0 (6A313). Now, during the compilation I get the following error:
clang: error: unknown argument: '-wall'
From Clang Compiler User's Manual, I found out that this flag is responsible for enabling all warnings. I have also read many posts on the temporary fix for Apple LLVM Compiler for Xcode 5.1, where users would downgrade all clang errors to warnings with:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future easy_install ExtensionName
However, that does not help me, as there is no such extension as "all". So I am stuck at this point and any suggestions would be appreciated.
Also, I have upgraded to Ruby 2.1.1 (from 2.0.x), but that did not seem to help either.
The argument is -Wall, not -wall.

run using KLEE error

I am new to Klee, so I started to make the tutorials.
If for compilation I use:
llvm-gcc --emit-llvm -c -g get_sign.c and then I try to run using klee get_sign.o I get the error : KLEE: ERROR: error loading program 'get_sign.o': Invalid MODULE_CODE_GLOBALVAR record . The error is defined in the BitcodeReader.cpp file http://llvm.org/docs/doxygen/html/BitcodeReader_8cpp_source.html at line 01594.
clang (that I have used succesfully for my LLVM passes), it appears that is not possible to use it: KLEE: ERROR: error loading program 'get_sign.o': Invalid bitcode signature .
Do you know what I can do?
Also, it would be nice to give Klee inputs compiled with Clang that I already use for my passes, but as the error suggest, it is possible?
Thank you in advance !
The problem is that I installed Klee over LLVM 3.1. In the instructions from http://klee.llvm.org/GetStarted.html it is mentioned that Klee is fully compatible with LLVM 2.9. It is mentioned : "KLEE is currently tested only on Linux x86-32 and x86-64 targets, using LLVM 2.9. KLEE will not work with older LLVM versions (e.g., 2.5), and might not work with newer versions (e.g., 3.0).".
I installed Klee on LLVM 2.9 and it is working perfectly.

Problems building Ada on Mac OS 10.8.2

I have installed GNAT 4.3 from here
And added the following to my .bash_profile:
export PATH=/usr/local/ada-4.3/bin:$PATH
Now I can run gnatmake hello.adb
For the file hello.adb with the following contents:
with Ada.Text_IO;use Ada.Text_IO;
procedure Hello is
begin
Put_Line ("Hello world!");
end Hello;
But I get this error:
gcc -c hello.adb
gcc: error trying to exec 'as': execvp: No such file or directory
gnatmake: "hello.adb" compilation error
I'm guessing there is a problem with my GNAT installation, but I have been unable to find a solution for this problem.
Thanks in advance for any suggestions.
Your approach works on Mac OS X 10.5 and 10.6, but I haven't tried 10.8. Two things to check:
It looks like it can't find the assembler, /usr/bin/as. Verify that you installed the developer tools, as it's an optional install. See also How to use/install gcc on Mac OS X 10.8 / Xcode 4.4.
Use the verbose option of gcc to see more about where it's getting lost.
gcc -c -v hello.adb

Resources