Closed corneliusroemer closed 2 months ago
Later, I got some libomp errors:
/Users/corneliusromer/code/iqtree2/simulator/alisimulator.cpp:1755:71: error: use of undeclared identifier 'omp_get_num_threads'
1755 | if ((*it)->node->sequence->num_threads_done_simulation == omp_get_num_threads())
| ^
1 error generated.
gmake[2]: *** [simulator/CMakeFiles/simulator.dir/build.make:76: simulator/CMakeFiles/simulator.dir/alisimulator.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:997: simulator/CMakeFiles/simulator.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2
I fixed them by using this build script with the help of chatgpt:
export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"
export LDFLAGS="-L/opt/homebrew/opt/libomp/lib"
export CMAKE_CXX_FLAGS="-Xpreprocessor -fopenmp -I/opt/homebrew/opt/libomp/include -L/opt/homebrew/opt/libomp/lib -lomp"
export CMAKE_C_FLAGS="-Xpreprocessor -fopenmp -I/opt/homebrew/opt/libomp/include -L/opt/homebrew/opt/libomp/lib -lomp"
cmake .. -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
make -j
I've tried to build iqtree2 v2.3.5 on macOS arm64 14.5.
I'm getting the following error:
This might be because I use a recent SDK, v14.5
When I comment out the following, I don't get the compilation error (workaround):
https://github.com/iqtree/iqtree2/blob/74da454bbd98d6ecb8cb955975a50de59785fbde/utils/timeutil.h#L80-L85