Skip to content

Commit cbe9429

Browse files
committed
fixing MPI and libz deps
1 parent 93f134b commit cbe9429

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ if(DEFINED ENV{IMEXROOT})
2828
else()
2929
set(IMEX_ROOT ${CONDA_PREFIX})
3030
endif()
31-
message("ll ${IMEX_ROOT}")
3231
if(MKLROOT STREQUAL UNSET OR TBBROOT STREQUAL UNSET)
3332
message(FATAL_ERROR "MKLROOT and TBBROOT not set (nor CONDA_PREFIX)")
3433
endif()
3534

35+
set(ZLIB_LIBRARY /usr/lib/x86_64-linux-gnu/libz.a)
3636
# C++ standard
3737
set(CMAKE_CXX_STANDARD 17)
3838
set(CMAKE_C_EXTENSIONS OFF)
@@ -50,9 +50,13 @@ message(STATUS "Expected IMEX sha: \"${EXPECTED_IMEX_SHA}\"")
5050
# Deps
5151
# ===============
5252
# Find dependent packages like IMEX, Python3 and NumPy
53+
find_package(ZLIB)
5354
find_package(Python3 COMPONENTS Interpreter Development.Module NumPy REQUIRED)
5455
find_package(pybind11 CONFIG)
55-
find_package(MPI REQUIRED)
56+
# FindMPI does not work with iMPI conda packages
57+
set(MPI_INCLUDE_PATH $ENV{I_MPI_ROOT}/include)
58+
set(MPI_CXX_LIBRARIES $ENV{I_MPI_ROOT}/lib/libmpi.so $ENV{I_MPI_ROOT}/lib/libmpicxx.so)
59+
# find_package(MPI REQUIRED CXX)
5660
find_package(LLVM REQUIRED CONFIG NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
5761
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
5862
find_package(MLIR REQUIRED CONFIG NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
@@ -182,6 +186,7 @@ target_link_libraries(_sharpy PRIVATE
182186
LLVMX86AsmParser
183187
idtr
184188
tbb
189+
${ZLIB_LIBRARIES}
185190
)
186191
target_link_libraries(idtr PRIVATE
187192
${MPI_CXX_LIBRARIES}

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ def build_cmake(self, ext):
2626
build_temp.mkdir(parents=True, exist_ok=True)
2727
extdir = pathlib.Path(self.get_ext_fullpath(ext.name))
2828
extdir.parent.mkdir(parents=True, exist_ok=True)
29-
3029
# example of cmake args
3130
config = "Debug" # if self.debug else 'RelWithDebInfo' #'Release'
3231
cmake_args = [
33-
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=" + str(extdir.parent.absolute()),
32+
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir.parent.absolute()}",
3433
"-DCMAKE_BUILD_TYPE=" + config,
3534
"-DCMAKE_VERBOSE_MAKEFILE=ON",
3635
"-G=Ninja",

0 commit comments

Comments
 (0)