Skip to content

Commit

Permalink
Merge pull request #18 from ITISFoundation/pip_install
Browse files Browse the repository at this point in the history
Make pip install of source dir possible
  • Loading branch information
wvangeit authored Sep 4, 2024
2 parents 6923616 + a09dcc0 commit 8374725
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ get-dakota-src:
git submodule update --init packages/pecos && \
git submodule update --init packages/surfpack && \
git apply ../src_patches/dakota-src.patch && \
git apply ../src_patches/boost.patch && \
git apply ../src_patches/dakenv_restart.patch && \
git apply --whitespace=nowarn ../src_patches/adaptsampl_batch.patch && \
find . \( -name \*.cpp -o -name \*.hpp -o -name \*.c -o -name \*.h \) -exec \
Expand Down
10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ issues = "https://github.com/ITISFoundation/itis-dakota/issues"
[build-system]
requires = [
"py-build-cmake",
"cmake",
"auditwheel",
"setuptools",
"setuptools_scm",
"numpy"
"numpy",
"h5py"
]
build-backend = "build_backend.build"
backend-path = "."
Expand All @@ -38,6 +40,10 @@ local_scheme = "no-local-version"
repair-wheel-command = "auditwheel repair -w {dest_dir} {wheel} && ./scripts/fix_wheel.sh {dest_dir}"
build-verbosity = 2

[tool.cibuildwheel.environment]
BOOST_LIBRARYDIR = "/usr/lib64/boost169"
BOOST_INCLUDEDIR = "/usr/include/boost169"

[tool.cibuildwheel.linux]
environment-pass = [
"SCCACHE_GHA_ENABLED",
Expand Down Expand Up @@ -71,5 +77,3 @@ DAKOTA_PYTHON_WRAPPER = "ON"
DAKOTA_PYTHON_DIRECT_INTERFACE = "ON"
BUILD_SHARED_LIBS = "OFF"
CMAKE_POSITION_INDEPENDENT_CODE = "ON"
BOOST_LIBRARYDIR = "/usr/lib64/boost169"
BOOST_INCLUDEDIR = "/usr/include/boost169"
22 changes: 22 additions & 0 deletions src_patches/boost.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index bd008bc..fd0adca 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -877,7 +877,7 @@ list(APPEND EXPORT_TARGETS dakota_src_fortran)
add_library(dakota_src ${Dakota_src})
# When using Boost imported targets, we only link libraries using them,
# then rely on transitive library linking from CMake
-target_link_libraries(dakota_src dakota_src_fortran ${DAKOTA_BOOST_TARGETS})
+target_link_libraries(dakota_src dakota_src_fortran ${Boost_LIBRARIES})
# Dakota should always depend on util (consider removing option in DakotaOptions.cmamke
target_link_libraries(dakota_src dakota_util)
list(APPEND EXPORT_TARGETS dakota_util)
@@ -1052,7 +1052,7 @@ set(Dakota_LIBRARIES ${DAKOTA_LIBS} ${DAKOTA_PKG_LIBS} ${DAKOTA_EXTPROJ_LIBS}

# Libraries that will be on the system
# We add Boost libraries by path/name here for Makefile.export purposes
-set(Dakota_TPL_LIBRARIES ${EXT_TPL_LIBS} ${Boost_LIBRARIES}
+set(Dakota_TPL_LIBRARIES ${EXT_TPL_LIBS}
CACHE INTERNAL "Dakota TPL libraries")

message(STATUS "Dakota_LIBRARIES: ${Dakota_LIBRARIES}")

0 comments on commit 8374725

Please sign in to comment.