Category : apple-m1

I followed the instructions here: Using x86 libraries and OpenMP on macOS arm64 architecture I am trying to compile simple code: #include <omp.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char* argv[]) { #pragma omp parallel { printf("Hello World… from thread = %dn", omp_get_thread_num()); } } using: /usr/local/opt/llvm/bin/clang++ -arch x86_64 main.cpp but I am getting ..

Read more

I am using Apple M1 MacBook Air. I want to connect MySQL to c++. I’ve tried 2 variants: ‘c++ connector’ installed from official MySQL website(with jdbc.h) and ‘mysql-8.0.26-macos11-arm64’ installed with ‘brew install mysql’. I can include both of them with: #include </usr/local/mysql-connector-c++-8.0.27/include/mysql/jdbc.h> OR #include </usr/local/mysql-8.0.26-macos11-arm64/include/mysql.h> And it successfully compiles. But when I try to write ..

Read more

Macbook Air 2020, m1 chip, macOS 12.1 Monterey. No XCode. Though I have XCode Command Line tools. I’m trying out OpenGL. I installed it: brew install glfw. I wrote this test.cpp: #include <GLFW/glfw3.h> int main(void) { GLFWwindow* window; if (!glfwInit()) return -1; return 0; } In Terminal, I run g++ -I/opt/homebrew/Cellar/glfw/3.3.6/include -o ./test ./test.cpp And ..

Read more

After updating my Mac from intel to m1, I ran into the problem while installing the rcpp and trying helloworld.cpp example. I pretty much followed these instructions. https://thecoatlessprofessor.com/programming/cpp/r-compiler-tools-for-rcpp-on-macos/ with the right gfortran version (https://github.com/fxcoudert/gfortran-for-macOS/releases/tag/12-arm-alpha) what I get is this: Rcpp::sourceCpp(‘/Users/nikitaabalakin/helloworld.cpp’) ^ helloworld.cpp:18:7: error: no member named ‘sourceCpp’ in namespace ‘Rcpp’ Rcpp::sourceCpp(‘/Users/nikitaabalakin/helloworld.cpp’) ~~~~~~^ helloworld.cpp:18:17: warning: multi-character ..

Read more

While compiling with g++/c++/clang/clang++ I always get: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/numeric:151: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:321:9: error: no member named ‘signbit’ in the global namespace using ::signbit; ~~^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:322:9: error: no member named ‘fpclassify’ in the global namespace using ::fpclassify; ~~^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:323:9: error: no member named ‘isfinite’ in the global namespace using ::isfinite; ~~^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:324:9: error: no member ..

Read more