Skip to content

Commit 86efb97

Browse files
committed
[Build] Update build files and instructions for MacOS
1 parent 0934472 commit 86efb97

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

CMakeLists.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ project(Quartz)
44
SET(CMAKE_BUILD_TYPE "Release")
55

66
# python
7+
set(Python_FIND_VIRTUALENV FIRST)
78
if (MSVC)
89
# Could not find the "Development" component on Windows. Using the following commands
910
# to get Python_INCLUDE_DIRS and Python_LIBRARY_DIRS.
@@ -97,7 +98,7 @@ add_library(quartz_runtime SHARED ${QUARTZ_SRCS})
9798

9899
target_compile_features(quartz_runtime PUBLIC cxx_std_17)
99100

100-
target_link_libraries(quartz_runtime ${QUARTZ_LINK_LIBS})
101+
target_link_libraries(quartz_runtime PUBLIC ${QUARTZ_LINK_LIBS})
101102

102103
target_include_directories(quartz_runtime
103104
PUBLIC ${PROJECT_SOURCE_DIR}/src)
@@ -109,7 +110,7 @@ if (NOT_LINUX)
109110
message("build on macOS, link openmp lib with compiler clang")
110111
include_directories(/usr/local/include)
111112
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -fopenmp")
112-
find_library(OPENMP_LIB libomp.dylib /usr/local/lib)
113+
find_library(OPENMP_LIB libomp.dylib PATHS /usr/local/lib /usr/local/opt/libomp/lib /opt/homebrew/opt/libomp/lib)
113114
target_link_libraries(quartz_runtime LINK_PUBLIC ${OPENMP_LIB})
114115
endif()
115116
else()

INSTALL.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@ Quartz can be built from source code using the following instructions.
66

77
### Prerequisites
88

9-
* `apt install build-essential` (not required for Windows)
10-
* CMAKE 3.16 or higher: `apt install cmake` or https://cmake.org/download/
11-
* conda: https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html
9+
* `apt install build-essential` (Linux/Unix)
10+
* CMAKE 3.16 or higher: `apt install cmake` (Linux/Unix) or `brew install cmake` (MacOS) or https://cmake.org/download/ (Windows)
11+
* conda:
12+
* MacOS:
13+
```
14+
brew install anaconda
15+
/opt/homebrew/anaconda3/bin/conda init zsh # Please use your shell name and the directory you installed Anaconda
16+
```
17+
* Other OS: Follow the instructions on https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html
1218
* Cython 3.0 or higher (We will install it with Python later by `conda`)
19+
* OpenMP (We will install it later by `conda` or Homebrew)
1320

1421
#### Additional Prerequisites for Windows:
1522

@@ -28,6 +35,7 @@ cd quartz
2835
```shell
2936
conda env create --name quartz --file env.yml
3037
conda activate quartz
38+
conda install openmp # on MacOS, please run "brew install libomp" instead
3139
```
3240

3341
3. Build the Quartz runtime library (optional with CLion, see [below](INSTALL.md#clion-integration-optional)). This step differs a little bit between Windows and other OS.

env.yml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ channels:
77
dependencies:
88
- pip
99
- python>=3.11,<3.12
10-
- openmp
1110
- pip:
1211
- cython>=3.0.0
1312
- pybind11>=2.6.2

0 commit comments

Comments
 (0)