cannot use 'precompiled-header' output with multiple -arch options - xcode4.5

I have an existing project and I tried to compile it with last Xcode version 4.5.2.
When I run it on simulator it works fine, but when I try to run it on iPhone or iPad I got the following error :
clang: error: cannot use 'precompiled-header' output with multiple -arch options
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
Does anyone know what is the problem ?

Related

How to run a shell command before qt build process?

I'm using Oracle Linux 6 which officially has only g++ 4.4.7 compiler. It keeps complaining
cc1plus: error: unrecognized command line option "-std=gnu++11"
I found a way to get around as stated in https://blogs.oracle.com/opal/getting-a-c11-compiler-for-node-4,-5-and-6-on-oracle-linux-6. With this the complier will work in a shell if I run
scl enable devtoolset-3 bash
before the compiler call of g++ xxx .
So how can I setup qt so that it executes the additional command before calling the compiler? Thanks.

Why is Rpy2 not installing in my OSX Sierra terminal?

I have seen a number of different people post this problem (example: Tried to guess R's HOME but no R command in the PATH. OsX 10.6 and Installing rpy2 on Mac OSX 10.8.5), but I have yet to find a viable solution.
I have ensured that I have Python-2.7 installed in my terminal, and since I had recently upgraded by RStudio, I thought that my R was also updated. But everytime I tried to run either:
pip install rpy2
or
easy_install rpy2
I kept getting the same error of Error: Tried to guess R's HOME but no command 'R' in the PATH.
After some googling, I decided to try to download the latest version of R (v 3.4.1), even though I'm very certain it was already updated to begin with. But now I get the following behemoth of an error (I should note that I have condensed it):
In file included from ./rpy/rinterface/_rinterface.c:122:
./rpy/rinterface/sequence.c:2173:1: warning: unused function 'ComplexVectorSexp_AsSexp' [-Wunused-function]
ComplexVectorSexp_AsSexp(PyObject *pyfloat) {
^
11 warnings generated.
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.12-intel-2.7/./rpy/rinterface/_rinterface.o -L/usr/local/lib -Lbuild/temp.macosx-10.12-intel-2.7 -L/usr/local/lib -lpcre -llzma -lbz2 -lz -licucore -lm -liconv -lr_utils -o build/lib.macosx-10.12-intel-2.7/rpy2/rinterface/_rinterface.so -fopenmp -F/Library/Frameworks/R.framework/.. -framework R
clang: error: unsupported option '-fopenmp'
clang: error: unsupported option '-fopenmp'
error: command 'cc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-zT8DaX/rpy2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-bDnbE5-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-zT8DaX/rpy2/
So now I have a completely different error occurring. I thought that upgrading my R would automatically add it to my environmental variable PATH, but now I'm really at a loss at how to deal with this. I have tried to google this new error but I can't seem to find any solutions that are geared towards installing Rpy2 on a Mac OSX with Python-2.7 and R-3.4. Can anybody offer any kind of advice?
ADDENDUM
I have now tried a variety of other approaches, including downloading XCODE, and updating my GCC compiler, (one such approach is delineated in http://cs.millersville.edu/~gzoppetti/InstallingGccMac.html), and I have also tried to reinstall GCC with the command brew reinstall gcc --without-multilib. I have also edited my PATH environmental variables to include R, CC, and have still had no luck.
I have now figured out that rpy2 installation is contingent upon the right kind of compiler being used. The default compiler for Apple is clang, which does not support rpy2's set up process. So, after acquiring the gcc compiler via homebrew, you can then run brew ls gcc to see the file paths of what gcc compilers are present on your computer. I then ran the following commands in the terminal to change the default compiler from clang to the file path gcc-7, then set the proper flags (which I deduced from reading the error messages yielded by the compiler before), and then install rpy2.
export CC=/usr/local/Cellar/gcc/7.2.0/bin/x86_64-apple-darwin16.7.0-gcc-7
export CFLAGS="-W"
pip install rpy2==2.8.6
I should note that I installed rpy2 version 2.8.6 since my scripts are in Python 2.7, and rpy2 2.9.0 is only compatible with Python 3.x. Furthermore, I am aware that this answer might not adequately describe the problem for everyone, so I encourage other users to expand and/or correct this solution.
The error about "no R in the PATH" is exactly about what it says. To reproduce, open a terminal and enter "R": there should not be any such command found. The solution is to have R findable in the PATH.
Now starting with R-3.4 the tools needed to compile R and and R extensions in C have changed, and the requirements are less standard than one might hope for. This can be debated to be an issue with R and OS X, and there is an open issue in the rpy2 tracker about it.
edit: Note that the issue was resolved and a precompiled binary wheel for rpy2-2.9.3 is now available on pypi.
It's possible to do the GCC switch with a single env command:
env CC=/usr/local/Cellar/gcc/7.2.0/bin/gcc-7 pip install rpy2
The reason clang doesn't work with RPy2 is because clang 4.0.0 doesn't include the -fopenmp flag, which is used by R. There's an ongoing open problem thread on the RPy2 Bitbucket about it.

Cannot compile and link AVR program in OS X

I am working on a Mac with Yosemite OS X and I'm trying to compile a program in C that I could then upload onto my Arduino. I am following a tutorial.
I tried going through and reinstalling avr-gcc, but I got the same output. I tried searching for the file crtatmega328p.o on my system, but it is nowhere to be found and the same goes for the directory.
$ avr-gcc -Os -DF_CPU=16000000UL -mmcu=atmega328p -c -o Program.o Program.c
$ avr-gcc -mmcu=atmega328p Program.o -o Program
/usr/local/lib/gcc/avr/5.2.0/../../../../avr/bin/ld: cannot find crtatmega328p.o: No such file or directory
/usr/local/lib/gcc/avr/5.2.0/../../../../avr/bin/ld: cannot find -latmega328p
collect2: error: ld returned 1 exit status
I was just hit by this issue on GNU/Linux last week.
Actually, the compiler works fine. The cause of the issue is a failed linking attempt against avr-libc.
avr-libc-1.8.1 is simply too old to work with GCC 5. Although 1.8.1 is the latest version of avr-libc, but it was released one year ago... The developing version of avr-libc has updated to catch up GCC 5, you could clone the subversion repository:
svn co svn://svn.savannah.nongnu.org/avr-libc/trunk
and compile it by yourself. If you are not familiar about how to compile yourself home-made toolchains from the source code, there are plenty of documentation and tutorial on the web.

native client tutorial can't find libstdc++

I'm new to native client. I'm trying to follow the official tutorial on my newly installed ubuntu 14.
I'm getting the following when running "make serve" under the getting_started folder. I googled, it seems to be related to 32/64 bit. my system is 64bit, but pnacl seems to think it is 32.
Anyway I couldn't find a solution. do you know how?
/media/shi/work/nacl_sdk/pepper_34/toolchain/linux_pnacl/bin/pnacl-clang++ -o hello_tutorial.bc hello_tutorial.cc -O2 -I/media/shi/work/nacl_sdk/pepper_34/include -L/media/shi/work/nacl_sdk/pepper_34/lib/pnacl/Release -lppapi_cpp -lppapi
/media/shi/work/nacl_sdk/pepper_34/toolchain/linux_pnacl/host_x86_32/bin/clang: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
make[1]: * [hello_tutorial.bc] Error 127
make[1]: Leaving directory `/media/shi/work/nacl_sdk/pepper_34/getting_started/part1'
make: * [part1_ALL_TARGET] Error 2
It's probably easiest to install the i386 C/C++ libraries:
sudo apt-get install libc6:i386 libstdc++6:i386
There are 64-bit binaries included in the SDK as well (in toolchain/linux_pnacl/bin64/), but they are not run by default (and I'm not certain of an easy way to make the SDK use them).

Install Rmpi on Centos fails with "can't find -lmpi"

I have mpi running on a cluster. It works fine for executables, as well as C programs; so I am pretty sure it works fine. However, when I am trying to install Rmpi, I get an error.
Architecture:
Centos 6.4
MPICH 3.0.3 (had the same problem with 1.4).
R 2.15
Rmpi 0.6-3
I tried different combinations. Specifically, tried to run install.packages() from inside R, and R CMD INSTALL from command line. I tried sudo, su -, and even install into non-privileged "private" directory (in case setting LD_LIBRARY_PATH screws things up). So, here is an example of what I ran:
export LD_LIBRARY_PATH=/opt/tmp/shared/mpich2-install/lib/
install.packages("Rmpi", configure.args = c("--with-Rmpi-include=/opt/tmp/shared/mpich2-install/include/", "--with-Rmpi-libpath=/opt/tmp/shared/mpich2-install/lib/", "--with-Rmpi-type=OPENMPI", "--with-mpi=/opt/tmp/shared/mpich2-install/"))
In every event I get consistent error:
gcc -m64 -std=gnu99 -shared -L/usr/local/lib64 -o Rmpi.so RegQuery.o Rmpi.o conversion.o internal.o -L/opt/tmp/shared/mpich2-install/lib/ -lmpi -L/usr/lib64/R/lib -lR
/usr/bin/ld: cannot find -lmpi
collect2: ld returned 1 exit status
Note, that if I put mpi-type as MPICH (instead of OPENMPI) I get an error about bad format.
I ran out of ideas... There is a similar post, but my problem seems different. Thanks.
Apparently, this is a known incompatibility between MPICH and Rmpi. I installed Open MPI and everything worked just fine. Maybe, it will help somebody as well...

Resources