Does GCC / Clang -framework option work on Linux?

There is a framework concept in the OSX development environment. A structure is a kind of package that contains headers, shared libraries, and other useful materials. The structure can be passed to the compiler, so the compiler includes its headers in the search path and uses its shared libraries to link programs to them.

So, for example, if -framework FrameworkNamegcc or clang is passed to OSX, the compiler searches the directory /System/Library/Frameworksto find the directory FrameworkName.framework. If found, the compiler includes its headers and associates the program with its shared libraries.

So does this super useful feature work on Linux? Gcc or clang recognize parameter -frameworkin Linux? When I type this option on Linux, the compiler does not seem to recognize it, but perhaps this is because I need to set the path to the frameworks directory in front of it. Is there any special trick to make it work on Linux? Or is it definitely not possible on this platform?

+5
source share
3 answers

No, it will not work on Linux. Frames are a feature of (OS X) Mach-O ABI . Theoretically, you could write a kernel module to support Mach-O and provide linker / loader user space tools. It will be a lot of work .

+4
source

FreeBSD, , Linux. - , lib. Lib ELF, mach-o.

, .

  • Cocoa, , , linux. , , GNUStep.

  • Framework, . GNUStep makefile.

+3

, OpenCL , user_buffer:

" OSX , :

gcc -std=c99 -Wall -DUNIX -g -DDEBUG -DAPPLE -arch i386 -o user_buffer user_buffer.c \
-framework OpenCL

Ubuntu Linux 12.04 Intel OpenCL SDK :

gcc -std=c99 -Wall -DUNIX -g -DDEBUG -m64 -o user_buffer user_buffer.c -I . -I /usr/include \
-L/usr/lib64/OpenCL/vendors/intel -lintelocl -ltbb -ltbbmalloc -lcl_logger -ltask_executor

Ubuntu Linux 12.04 AMD APP SDK v2.8 :

gcc -std=c99 -Wall -DUNIX -g -DDEBUG –m64 -o user_buffer user_buffer.c \
-I. –I/opt/AMDAPP/include –L/opt/AMDAPP/lib/x86_64 –lOpenCL

https://www.academia.edu/22200475OpenCL_Parallel_Programming_Development_Cookbook

For the Nvidia OpenCL SDK for Linux for a program called 'vectoradd':

g++ -I ~/NVIDIA_GPU_Computing_SDK/OpenCL/common/inc/ -lOpenCL vectoradd.cpp –o vectoradd

From the Nvidia OpenCL Getting Started Guide, available from https://uloz.to/!nY4NzLAG/nvidia-opencl-examples-cuda-4-2-9-sdk-zip

0
source

All Articles