j2objc:how to build libjunit.a for architecture i386 - xcode4

when i linked the libjunit provided by the generated j2objc source code, and i try to build my project, this error is occured:
ld: warning: ignoring file /Users/Niangsou/Documents/Workspace/mastercard/iOS/Mobile_api_Tests/SDKConversion/j2objc/lib/libjunit.a, file was built for archive which is not the architecture being linked (i386): /Users/Niangsou/Documents/Workspace/mastercard/iOS/Mobile_api_Tests/SDKConversion/j2objc/lib/libjunit.a
and Undefined symbols for architecture i386:
"_OBJC_CLASS_$_JunitFrameworkAssert", referenced from
How can I do to resolve this problem?
It seems that the libjunit.a generated is not supported by the arch i386.

j2objc now distributes a libjunit.a that supports the armv7, armv7s, i386, MACOSX architectures.

Related

Installing rpy2 to work with R 3.4.0 on OSX

I would like to use some R packages requiring R version 3.4 and above. I want to access these packages in python (3.6.1) through rpy2 (2.8).
I have R version 3.4 installed, and it is located in /Library/Frameworks/R.framework/Resources However, when I use pip3 install rpy2 to install and use the python 3.6.1 in /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6) as my interpreter, I get the error:
Traceback (most recent call last):
File "/Users/vincentliu/PycharmProjects/magic/rpy2tester.py", line 1, in
from rpy2 import robjects
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/rpy2/robjects/init.py", line 16, in
import rpy2.rinterface as rinterface
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/rpy2/rinterface/init.py", line 92, in
from rpy2.rinterface._rinterface import (baseenv,
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/rpy2/rinterface/_rinterface.cpython-36m-darwin.so, 2): Library not loaded: #rpath/libiconv.2.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/rpy2/rinterface/_rinterface.cpython-36m-darwin.so
Reason: Incompatible library version: _rinterface.cpython-36m-darwin.so requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0
Which first seemed like a problem caused by Anaconda, and so I remove all Anaconda-related files but the problem persists.
I then uninstalled rpy2, reinstalled Anaconda and used conda install rpy2 to install, which also installs R version 3.3.2 through Anaconda. I can then change the interpreter to /anaconda/bin/python and can use rpy2 fine, but I couldn't use the R packages I care about because they need R version 3.4 and higher. Apparently, the oldest version Anaconda can install is 3.3.2, so is there any way I can use rpy2 with R version 3.4?
I can see two general solutions to this problem. One is to install rpy2 through conda and then somehow change its depending R to the 3.4 one in the system. Another solution is to resolve the error
Incompatible library version: _rinterface.cpython-36m-darwin.so requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0
After much struggling, I've found no good result with either.
I uninstalled rpy2 and reinstalled with --verborse. I then found
ld: warning: ignoring file /opt/local/lib/libpcre.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libpcre.dylib
ld: warning: ignoring file /opt/local/lib/liblzma.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/liblzma.dylib
ld: warning: ignoring file /opt/local/lib/libbz2.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libbz2.dylib
ld: warning: ignoring file /opt/local/lib/libz.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libz.dylib
ld: warning: ignoring file /opt/local/lib/libiconv.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libiconv.dylib
ld: warning: ignoring file /opt/local/lib/libicuuc.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libicuuc.dylib
ld: warning: ignoring file /opt/local/lib/libicui18n.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libicui18n.dylib
ld: warning: ignoring file /opt/local/Library/Frameworks/R.framework/R, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/Library/Frameworks/R.framework/R
So I supposed the reason is the architecture incompatibility of the libiconv in opt/local, causing make to fall back onto the outdate libiconv in usr/lib. This is strange because my machine should be running on x86_64 not i386. I then tried export ARCHFLAGS="-arch x86_64" and reinstalled libiconv using port. This resolved the problem.
I had uninstall the version pip installed and install from source python setup.py install on the download https://bitbucket.org/rpy2/rpy2/downloads/. FWIW not using Anaconda at all either.

Compiling QScintilla on Ubuntu Fails

I'm trying to compile Qscintilla 2.9.2 on Ubuntu 16.04 64bit using Qt 5.7 got the following error message:
-L/home/mwambi/Qt5.7.0/5.7/gcc_64/lib -lQt5PrintSupport -L/usr/lib64 -lQt5Widgets -lQt5Gui -lQt5Core -lpthread -lGL
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
Makefile:979: recipe for target 'libqscintilla2.so.12.0.1' failed
make: *** [libqscintilla2.so.12.0.1] Error 1
I do not know what the library GL is and where to find it. How can I solve this?
In my experience, this troubleshooting procedure is enough to solve about 90% of missing library issues during compilation:
"-l[name]" implies there's a "lib[name].so"
Search your system for "lib[name]" (use locate or find).
If you find it on your system, check paths ($LB_LIBRARY_PATH and the build system's -L flags) and verify that the architecture matches (x86+64 vs. i686).
Do a repository search for "lib[name]" (use apt, yum, synaptic, &c.).
Install it if it's missing.
Type "lib[name].so" into google or a dedicated package-search site (like RPMFind or packages.ubuntu.com) and see what package names come up, then search for as in #2-3.
In this case, libGL is an implementation of OpenGL. You can install Mesa or find an alternative implementation (I've only ever used Qt with Mesa). Here's a list of packages that provide libGL; if you already have one of these installed on your system, try fetching the dev versions of whichever ones you already have.

ArrayFire is missing LAPACK - but I have it

I just downloaded the latest release of ArrayFire (3.3.1), and am trying to build it. I'm stuck at cmake . though. I installed a bunch of missing libraries, reran it, and now I get:
-- Could NOT find LAPACK (missing: LAPACK_LIBRARIES)
CMake Warning at src/backend/opencl/CMakeLists.txt:38 (MESSAGE):
LAPACK not found. Functionality will be disabled
and
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
GLEWmxd_LIBRARY
linked by target "afcpu" in directory /home/joeuser/src/arrayfire-full-3.3.1/src/backend/cpu
linked by target "afcuda" in directory /home/joeuser/src/arrayfire-full-3.3.1/src/backend/cuda
linked by target "afopencl" in directory /home/joeuser/src/arrayfire-full-3.3.1/src/backend/opencl
I have installed lapack, and it's at /usr/lib/liblapack.so (that's an alternatives symlink, but it's not broken). Also installed lapacke.
ArrayFire requires the LAPACKE library (On Ubuntu, liblapacke-dev, and the graphics part requires GLEW-MX (on Ubuntu, libglewmx-dev).

tvOS sqlite linking error

I am trying to re-use sqlite related code from my iOS application on tvOS and getting few linking errors as below
Undefined symbols for architecture arm64:
"_sqlite3_enable_load_extension", referenced from:
"_sqlite3_load_extension", referenced from:
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am linking with libsqlite3.
The same code links fine on iOS. Seems like the library is missing some symbols for tvOS. Has anyone encountered this issue?

How do I build a QT console app in 64 bit on Mac OSX?

I need to build my QT console application as 64 bit. i.e. x86_64
My config file looks like this:
CONFIG += qt console debug x86_64
CONFIG -= app_bundle
HEADERS = HelperClass.h
SOURCES = HelperClass.cpp \
main.cpp
The compile goes fine without issue. But, when the build gets to the link step, it complains that I don't have the Qt x86_64 architecture.
Excerpt from build:
ld: warning in /Library/Frameworks/QtGui.framework/QtGui, missing required architecture x86_64 in file
ld: warning in /Library/Frameworks/QtCore.framework/QtCore, missing required architecture x86_64 in file
Undefined symbols:
"QIODevice::getChar(char*)", referenced from:
...
Do I need to download the Qt source and build the required architecture for this to work? My install is from the provided binaries for Mac OSX - Qt 4.5.2 on the QT site. I'm guessing that build does not come with 64bit versions of the libraries. Am I correct?
The QT SDK does NOT include by default the 64 bit libraries in Mac OS X (I think it is strange but it is that way). For compiling my apps in x86_64 I just download the standalone libraries with Cocoa (32/64 bits) and I install them after the SDK is installed.
Everything works like a charm then.
From the Qt for Open Source C++ development on Mac OS X page it appears that the 32 and 64 bit libraries should be included:
Mac binary package using Cocoa for Mac OS X 10.5 (32-bit and 64-bit)
http://get.qtsoftware.com/qt/source/qt-mac-cocoa-opensource-4.5.2.dmg
If you are still having trouble you could try to download the source from the same page:
http://get.qtsoftware.com/qt/source/qt-mac-opensource-src-4.5.2.tar.gz
and configure with:
-arch x86_64
See http://doc.trolltech.com/4.5/developing-on-mac.html#universal-binaries
Note that the link above mentions that if no arch is specified it builds 32bit for the current platform.
You can check the libraries using "file":
$ file /Library/Frameworks/QtGui.framework/QtGui
/Library/Frameworks/QtGui.framework/QtGui: Mach-O universal binary with 4 architectures
/Library/Frameworks/QtGui.framework/QtGui (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64
/Library/Frameworks/QtGui.framework/QtGui (for architecture ppc7400): Mach-O dynamically linked shared library ppc
/Library/Frameworks/QtGui.framework/QtGui (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
/Library/Frameworks/QtGui.framework/QtGui (for architecture i386): Mach-O dynamically linked shared library i386
I see the same "ld warning: ... missing required architecture x86_64 in file" errors, so the error message is misleading.

Resources