f951 error: unrecognized command line option - compilation

I am on linux and I am compiling the following:
mpif90 -shared source.F90 object1.o object2.o -L/some/path -Qoption,link,-rpath=/some/path -I/some/path -lhdf5 -lhdf5_fortran -fPIC -fpp -DDECDEC_ -DMSMS_ -cxxlib-gcc -o libhdfwrapper.so
and I get
f95: unrecognized option '-Qoption,link,-rpath=/some/path'
f95: unrecognized option '-cxxlib-gcc'
f951: error: unrecognized command line option "-fpp"
can anybody tell me why fpp is not recognized?

-fpp is a flag used by some compilers, notably Solaris Studio. Also -rpath seems to point to Solaris Studio. It seems you are using gfortran or some other compiler, however. Other compilers use -cpp instead. The same holds for the other options.
Also, the part -Qoption,link,-rpath=/some/path is probably not in the right format.
You may want to consult http://www.oracle.com/technetwork/server-storage/solarisstudio/documentation/oss-translate-gfortran-180584.pdf and your compiler's manual.

Related

what are the compiler options for gcc-linaro-aarch64-linux-gnu-4.8-2014.04_linux?

I was using the options:
-O3
-march=armv7-a
-mtune=cortex-a8
-ftree-vectorize
-mfloat-abi=softfp
-fsigned-char
-Wall
-save-temps
for cross compiling for arm-v7 (32 bit) using ArmLinuxToolChain.
What is the equivalent compiler options for gcc-linaro-aarch64-linux-gnu-4.8-2014.04_linux to build for armv8? I tried using those same options with -march=armv8-a
-mtune=cortex-a53 and got:
aarch64-linux-gnu-g++: error: unrecognized command line option '-mfloat-abi=softfp'
The GCC options beginning with -m are machine-dependent options, so the availability of -m* options varies between targets. This is one such case. There is no soft float ABI defined for Aarch64, so GCC does not provide the ARM-specific -mfloat-abi option.
If you simply remove -mfloat-abi=softfp then your problem should be solved.
I would suggest you investigate whether you need -save-temps, which is normally only used for debugging or reporting compiler problems.

GCC Compiler - unrecognized option '-R/usr'

I am attempting to install Cosign on CentOS 6.3 64-bit to work with my employer's central login system.
Their documentation states that I need to set an LDFLAGS directive of:
LDFLAGS="-R/usr -L/usr"
Where /usr is the /PATH/TO/SSL/lib - openSSL is installed and this is the correct path.
However when I then try to ./configure the installation, GCC is throwing an error which I can't work out.
configure:2335: checking for suffix of executables
configure:2342: gcc -o conftest -pthread -R/usr -L/usr conftest.c >&5
gcc: unrecognized option '-R/usr'
I can't find -R as an option in the gcc docs, which has me confused. I'm using gcc version 4.4.6 20120305 (Red Hat 4.4.6-4).
I am not used to seeing options without a space before their argument, but in this case adding a space to make it '-R /usr' just throws the same error.
Earlier in the config.log, I also have this error:
configure:2182: gcc -V >&5
gcc: '-V' option must have argument
Can anyone shed any light?
LDFLAGS should not be fed to gcc "as is", strange as they are like in your output. Probably some bug in the build script.
Try
LDFLAGS="-Wl,-R/usr,-L/usr"
This should compensate the current error by wrapping the flags in the form that gcc expects.

how to pass -m elf_i386 to gcc?

I wrote like this :
gcc -m elf_i386
it says:
gcc: error: elf_i386: No such file or directory
basically I am trying to compile a 32bit program on 64bit system,but error :
/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld:
skipping incompatible /usr/lib/libSDL.so when searching for -lSDL
which I've checked the project built with -m32 and I can see all the *.o file are ELF 32-bit LSB,and the /usr/lib/libSDL.so are ELF 32-bit LSB too...so I might need pass -m elf_i386 to ld right? but I don't use ld directly I just use gcc to compile it.
gcc -m32
is what you want probably. The elf_i386 is passed by gcc to ld (if needed) just as Alan Curry mentioned in the comments.
The "skipping incompatible library" warning is just a warning and if it doesn't come up with "can't find the library", then you can assume it linked to the correct binary (because of the -m32 option).

Compiling C code for 64-bit Matlab on Intel MAC

I need compile a piece of C code to be called from matlab (mex compiling).
I am doing that on an intel mac and, since I am using Matlab's R2010a (7.10.0.499), I'd like to compile the C code into a version for 64-bits.
For whatever reason, just doing mex with the -arch=maci64 option did not seem to work...
As a way around, I am compiling the C code to a mexmaci64 file directly on the command line.
I used the gcc calls made by mex (with the -v option on) as a starting point.
I managed to compile the C code to an object file, but it looks like I am not compiling the C code to the correct architecture.
Does anyone know how to correct the gcc calls below so the C code gets compiled to 64-bits intel macs?
Details are listed below.
As always, any help greatly appreciated...
Keep thirsty, my friends. :p
G
DETAILS:
Here is how I did the compilation and linking:
gcc -c -I/Applications/MATLAB_R2010a.app/extern/include -DMATLAB_MEX_FILE -fno-common -no-cpp-precomp -fexceptions -D MACVERSION -DMX_COMPAT_32 -O3 -DNDEBUG "BoxQP.c"
gcc -O -bundle -Wl,-flat_namespace -undefined suppress -Wl,-exported_symbols_list,/Applications/MATLAB_R2010a.app/extern/lib/maci64/mexFunction.map -o "BoxQP.mexmaci64" BoxQP.o -L/Applications/MATLAB_R2010a.app/bin/maci64 -lmx -lmex -lmat -lstdc++
Here are the warnings I get:
ld warning: in /Applications/MATLAB_R2010a.app/bin/maci64/libmx.dylib, file is not of required architecture
ld warning: in /Applications/MATLAB_R2010a.app/bin/maci64/libmex.dylib, file is not of required architecture
ld warning: in /Applications/MATLAB_R2010a.app/bin/maci64/libmat.dylib, file is not of required architecture
Ignoring the warnings and calling the BoxQP function from matlab results in the following error message:
??? Invalid MEX-file '/Users/gvrocha/Documents/academic/projects/splice/code/matlab/covsel/BoxQP.mexmaci64':
dlopen(/Users/gvrocha/Documents/academic/projects/splice/code/matlab/covsel/BoxQP.mexmaci64, 1): no suitable image found.
Did find: /Users/gvrocha/Documents/academic/projects/splice/code/matlab/covsel/BoxQP.mexmaci64: mach-o, but wrong architecture.
PS: I tried changing the -DMX_COMPAT_32 flag to -DMX_COMPAT_64 but I do get the same warnings and same error...
PPS: I guess it may be relevant to mention that I am using Mac OS X 10.5.8 (the "tropical"/plain-vanilla Leopard, i.e., not the snow Leopard).
PPPS: The same happens with the yprime.c example provided by MATLAB

gcc difference between -pthread and -pthreads?

I have a pthreads program. I have to compile it with gcc -pthread in Linux (-pthreads is unrecognized option) and gcc -pthreads in Sun (-pthread is unrecognized option). Why the difference, since it's the same compiler? However, -lpthread works on both, but I heard this isn't always sufficient.
The Solaris -pthreads and Linux -pthread options do equivalent things. Apparently, gcc-4.x series accepts -pthread for Solaris as well.
You do want the -pthread/-pthreads option while compiling because it adds multithreading support in the preprocessor and the linker.

Resources