At least, Clang theoretically support that (using the option -target). This should be possible thanks to cross-compilation. I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/includeĮrror message: ld: in '/opt/homebrew/opt/llvm/lib/libunwind.dylib', building for macOS-x86_64 but attempting to link with file built for macOS-arm64Ĭlang-12: error: linker command failed with exit code 1 (use -v to see invocation)įirst of all, running x86 binaries on M1 ARM processors is possible thanks to Rosetta but this is experimental and thus does not always works. L/opt/homebrew/opt/llvm/lib -Wl,-rpath,/opt/homebrew/opt/llvm/lib \ Here is an example of an error that I get using my current setup, even when not linking to an x86 library.Ĭall to compiler: /opt/homebrew/opt/llvm/bin/clang++ -arch x86_64 omp_ex.cpp \ Is it possible to install a version of clang on a MacBook M1 where the OpenMP libraries are built for x86 architectures? However when I try to compile with the -arch x86_64 argument and link to the x86 library I find that clang tries to link my executable to an OpenMP library that is built for the arm64 architecture. I am able compile source code with no x86 dependencies by following the instructions here, using an implementation of clang that is distributed with brew. I would like to compile my code and link my executable to the x86 library using a clang compiler. I have some source code that uses OpenMP. Make: *** Waiting for unfinished jobs.I have a MacBook M1 and have installed a library on my machine that was compiled for an x86 / Intel architecture. Static inline uint32_t htonl(uint32_t hostvar) Ĭompilation aborted for opal_datatype_pack.c (code 2)Ĭompilation aborted for opal_datatype_unpack.c (code 2) /opal/include/opal_config_bottom.h(406): error: expected a ")" Library/Developer/CommandLineTools/usr/bin/make all-amĬC libdatatype_reliable_la-opal_datatype_pack.loĬC libdatatype_reliable_la-opal_datatype_unpack.lo I think that I need to test older version of OpenMPI (e.g. However, I faced another problem during making process. Thus, I copy the CFLAGS./configure -prefix=/usr/local/opt/openmpi/4.1.1 CC=icc CXX=icpc CFLAGS='-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -L/opt/intel/oneapi/compiler/latest/mac/compiler/lib -I/opt/intel/oneapi/compiler/latest/mac/compiler/include -DSTDC_HEADERS' CXXFLAGS='-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -L/opt/intel/oneapi/compiler/latest/mac/compiler/lib -I/opt/intel/oneapi/compiler/latest/mac/compiler/include -DSTDC_HEADERS' Thank you so much Viet.īelow command is that I used in macOS (BigSur 11.6). During configuration, CXXFLAGS are also required. To see if you still get the same error on ptrdiff_t?Īs your suggestion, I did not meet the 'ptrdiff_t' problem. One thing you can try is to go to the directory where conftest.c resides, then run "icc -c -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -L/opt/intel/oneapi/compiler/latest/mac/compiler/lib -I/opt/intel/oneapi/compiler/latest/mac/compiler/include -std=gnu11 -finline-functions -fno-strict-aliasing -restrict conftest.c" Could be that STDC_HEADERS isn't defined in your ENV, which then excluded stddef.h?Ĭonfigure:21860: icc -c -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -L/opt/intel/oneapi/compiler/latest/mac/compiler/lib -I/opt/intel/oneapi/compiler/latest/mac/compiler/include -std=gnu11 -finline-functions -fno-strict-aliasing -restrict conftest.c >&5Ĭonftest.c(175): error: identifier "ptrdiff_t" is undefinedĬompilation aborted for conftest.c (code 2) Ok, the same command line (used for conftest.c) worked on a simple test case.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |