Is there a version of Xamarin.Mac without the Opentk namespace - opentk

On Visual Studio mac the Xamarin.Mac 3.0.0.290 (provided by visual studio) has the OpenTK namespace in it which is causing me headaches! Is there a version of Xamarin.Mac that can replace this that doesn't have this namespace? I'm targeting .Net4.5.

You should explain more clearly what the issues you are having. Every Xamarin.Mac contains the OpenTK namespace, as we use a number of Vector and other types internally.
$ monop -r:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/4.5/Xamarin.Mac.dll | grep OpenTK | wc -l
21
$ monop -r:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/Xamarin.Mac.dll | grep OpenTK | wc -l
21

Related

Has anyone experience in building a static library for the Tensorflow C++ API?

I need to build Tensorflow as a static library to include into a product. As of now it seems that there's only support for building a shared/dynamic library with bazel. My current objective is to build a library for MacOS(darwin-arm64), but I'm also going to build one for x86.
Has anyone solved this before?
I've gotten some things to work thanks to this thread:
https://github.com/tensorflow/rust/pull/351
What I've done is to compile and leave all of the .a and .lo file cache:
bazel build --config=monolithic --macos_minimum_os=11.0 --cpu=darwin_arm64 -j 1 //tensorflow:libtensorflow_cc.so
And then tried to link them together using libtool with using the param generated by bazel to try and get the needed files sorting out unwanted lines and filtering duplicates:
libtool -static -o libtensorflow_arm64_libtool_SO3.a $(cat bazel-bin/tensorflow/libtensorflow_cc.so.*.params | sed -e 's!-Wl,-force_load,!!' | grep -e '\.a$' -e '\.lo$' | sort -t: -u -k1,1)
Some simple things work with this approach but I can for instance run into this following error whilst running my code interfacing the C-API:
F tensorflow/core/framework/allocator_registry.cc:85] No registered CPU AllocatorFactory
Indeed there's no support whatsoever at the moment for building a static library for the Tensorflow C-API. This is due to bazel being the build tool. At the moment of writing bazel doesn't have support for writing static libraries:
https://github.com/bazelbuild/bazel/issues/1920
This has been an issue for quite some time, and this is also the reason why the entire C-API can't be built as a static library at the moment.
But, there's a way around this. You can build Tensorflow lite as a static library with Cmake as can be found here in the Tensorflow git repository:
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite
I also found this thread very helpful:
TensorFlow static C API library - how to link with 10 sub-dependencies?
After building this you will also need to include the Google flatbuffer library in your project(which you of course can include in your static library as well):
https://github.com/google/flatbuffers
TFlite can run most models and works even for my most complex models I've built. So it is the best way to get Tensorflow to work as a static library at the moment. For more information on TFLite see:
https://www.tensorflow.org/lite

How do I use CMake to build the ECCODES package using MinGW?

I'm trying to build some software from ECMWF called ECCODES.
It builds fine on GNU/Linux.
It builds fine on Mac OS X.
It builds fine on Windows/Cygwin.
Unfortunately (Ugh!!), I must use Windows and I can't use Cygwin.
I have to use something like MinGW.
The build instructions use CMake. I am no expert at CMake. The Windows system I am on has:
cygwin64
mingw64
a bare-bones Visual Studio 14
I've tried every incantation and override of the CMake variables/options:
-DCMAKE_C_COMPILER=... \
-DCMAKE_CXX_COMPILER=... \
-DCMAKE_Fortran_COMPILER=... \
-DCMAKE_MAKE_PROGRAM=... \
-G ...
to get ECCODES to build using MinGW, with no luck. I know some will ask, "Why not contact ECMWF?" The short answer is, the response time is very long (months/years). The FAQ page is empty, and you can't post questions on their Jira site (it's locked).
Would it be possible for someone who knows CMake and MinGW well to download the .tar.gz, build ECCODES using MinGW, and tell us how you did it?
http://www.ecmwf.int/
https://software.ecmwf.int/wiki/display/ECC/ecCodes+Home
https://software.ecmwf.int/wiki/download/attachments/45757960/eccodes-0.13.0-Source.tar.gz?api=v2

Qt was built without ICU support, WebKit was disabled. VS2012

I want to compile QT 5.0.1 in Windows 7 x64, but when I configure qt, that I get:
Qt is now configured for building. Just run nmake.
To reconfigure, run nmake confclean and configure.
d:/Libraries/Qt/5.0.1/qtbase/bin/qmake d:/Libraries/Qt/5.0.1/qtsdk.pro
Project MESSAGE: WebKit: Qt was built without ICU support, WebKit disabled.
I compiled ICU 50 in my machine and there are tests for icu, x32 Release and Debug mode failed them, but x64 are fine. I wrote to system variables ICU/bin and ICU/bin64.
So, please tell how to compile Qt with ICU and WebKit.
The below is an example build configuration:
configure \
-prefix C:\Qt\Qt5.0.1 -platform win32-msvc2012 -opensource -c++11 \
-make tools -make libs -qt-sql-sqlite -no-openssl \
-icu \
-I D:\Projects\icu4c-51_1\icu\include \
-L D:\Projects\icu4c-51_1\icu\lib64
To include Webkit, you must enable -icu and add its include and library path to the command options.
The ICU build type must be the same as Qt, that is, x86 or x64.

Use different versions of OpenSSL

i'm working on ubuntu, and i'm developing a C++ library that uses OpenSSL.
So, the PC i use to develop the code has an OpenSSL version of 2010. I create the lib, compile it with a simple test program, and i execute it successfully.
Then, when i test the lib in other PC (which have the latest OpenSSL version - May 2012), i compile the simple test program successfully, but when i execute it they crashes.
I "solved" the problem updating the version of OpenSSL from 2010 to the last , but in future it is possible that this problem can occur again, if someone will use the lib with a recent OpenSSL version.
So, i would like to know if there is a possibility of, for example, create the lib with the OpenSSL necessary files, in order to the code execute regardless of the OpenSSL version of the PC that is compiling the lib with the simple test program.
For creating my lib, i compile my files into .obj files (for example: g++ -c fileA.c -o fileA.o), and then i create a libABC.a file (ar rcs libABC.a filaA.o fileB.o ...).
I only use the "-lssl" compile option to link my library with the rest of the code, for example: g++ simpleCode.o libABC.a -o Test -lssl
Best Regards,
Sérgio
Normally problems like this are solved by giving incompatible versions of the library a different soname (e.g. libssl.0.9.7 vs libssl.1.0.0). If your version of libssl.so doesn't have a versioned soname it is broken.
To check the library's soname, and the soname your program is linked with, execute these commands
ldd /path/to/your/program/Test | grep openssl
objdump --private-headers /usr/lib/libssl.so* | grep SONAME
If your program is linked with libssl.0.9.7 it will simply not start with any other version.

Program "g++ not found in path" in Eclipse Juno CDT in Ubuntu

Eclipse June CDT reports g++ not found in path, how to fix this?
Typically, g++ will be installed when gcc (GNU Compiler Collection) is installed.
First confirm that you have g++ installed.
You can check this by typing the following in a terminal: which g++.
The response ought to be /usr/bin/g++.
If you find g++ installed, in eclipse go to project->properties->C/C++ Build->Discovery Options, under tools GCC C++ Compiler, put the exact path to g++ instead of g++ (if g++ alone does not work).
You will find this link useful:
What is the difference between g++ and gcc?
If you still have problems, do get back with feedback.
I had similar problem and it is solved by
Installing g++ The GNU C++ complier using ubuntu software centre and
Changing in -
Window -> Preferences -> C/C++ -> Build -> Settings -> Discovery -> CDT GCC Build in Complier Settings [Shared]
From: ${COMMAND} -E -P -v -dD "${INPUTS}"
To: /usr/bin/${COMMAND} -E -P -v -dD "${INPUTS}"
I hope it helps. I think if you add it to the project as mentioned in the first answer, you will need to add all the time for new projects. And if you add as I wrote you don't need to add it for new projects.
I have exactly the same problem. I never had problems with eclipse before under linux and now it wont even compile code. I tried to change the name of the g++ and gcc compilers to their exact location in project->properties->c/c++ Build->discovery options etc. nothing helped, I tried to reinstall eclipse and did an initialize, added the path to the variables etc.. Nothing worked so fare. The project I am working on is quiet big and I rather would like eclipse to manage the source and makefile, instead of doing it manually
Linux Mint 15 Eclispe: Version: 3.8.1 (I tried it with the latest version as well ... nothing changed)
g++ --version g++ (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
gcc --version gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
example:
#include // not resolved using namespace std;
int main() {
std::cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
return 0;
}
Well the code above is not what bothers me, as I can fix it by adding the includes of the exact c++ include path, but the code just wont compile. Wired enough eclipse gives me the error:
Description Resource Path Location Type Program "g++" not found in PATH Preferences, C++/Build/Settings/Discovery, [CDT GCC Builtin Compiler Settings] options C/C++ Scanner Discovery Problem
but it appears to me to be possible to compile single files, by opening them and pressing crt+b, but the whole project wont compile.
Fixed the problem this morning:
- got the latest eclipse
- created a new workspace
- created a new project
after a few seconds the very same error disappears
This issue was fixed for me once I deleted eclipse's .metedata folder, called eclipse -initialize from the command line and started eclipse again. HTH
Creating a new Workspace directory on Eclipse startup solved the problem for me.