Convert .c files to mex on macOS

1 view (last 30 days)
Koren Murphy
Koren Murphy on 30 Nov 2020
I am trying to convert 6 files to the appropriate .mex file on a mac. The code has been done for windows and linux but I do not have access to either. I have gotten to elseif ismac and that is it. The last two are complied easily but the first four require the OpenMP - I have downloaded this and it is in the library. Is there any more downloads I need and how would the code look?
if ispc
% windows platform, MSVC compiler
mex COMPFLAGS="$COMPFLAGS /openmp" -largeArrayDims -v count_subsets.cpp
mex COMPFLAGS="$COMPFLAGS /openmp" -largeArrayDims -v is_subset.cpp
mex COMPFLAGS="$COMPFLAGS /openmp" -largeArrayDims -v adjacency_test_pattern_tree_C.cpp
mex COMPFLAGS="$COMPFLAGS /openmp" -largeArrayDims -v prune_candidates_rank_pattern_tree_C.cpp
mex calculate_fraction.c
mex flush_file_cache.cpp
elseif isunix
% unix platform, GCC compiler
mex CXXFLAGS="\$CXXFLAGS -fopenmp" LDFLAGS="\$LDFLAGS -fopenmp" -largeArrayDims -v count_subsets.cpp
mex CXXFLAGS="\$CXXFLAGS -fopenmp" LDFLAGS="\$LDFLAGS -fopenmp" -largeArrayDims -v is_subset.cpp
mex CXXFLAGS="\$CXXFLAGS -mpopcnt -fopenmp" LDFLAGS="\$LDFLAGS -mpopcnt -fopenmp" -largeArrayDims -v prune_candidates_rank_pattern_tree_C.cpp
mex CXXFLAGS="\$CXXFLAGS -fopenmp" LDFLAGS="\$LDFLAGS -fopenmp" -largeArrayDims -v adjacency_test_pattern_tree_C.cpp
mex calculate_fraction.c
mex flush_file_cache.cpp
elseif ismac
% mac platform

Answers (0)

Categories

Find more on Application Deployment in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!