Commit ec297ba0 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

updating to get mac wheel build


Signed-off-by: Mccaskey, Alex's avatarAlex McCaskey <mccaskeyaj@ornl.gov>
parent 168a838b
......@@ -109,6 +109,7 @@ ExternalProject_Add(cppmicroservices
# Install Curl For People
set(USE_SYSTEM_CURL ON CACHE BOOL "" FORCE)
set(BUILD_CPR_TESTS OFF CACHE BOOL "" FORCE)
set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
add_subdirectory(tpls/cpr)
include_directories(${CPR_INCLUDE_DIRS})
......@@ -182,7 +183,7 @@ endif()
configure_file("${CMAKE_SOURCE_DIR}/cmake/xacc-config.cmake.in" "${CMAKE_BINARY_DIR}/xacc-config.cmake" @ONLY)
install(FILES "${CMAKE_BINARY_DIR}/xacc-config.cmake" DESTINATION .)
install(FILES "${CMAKE_SOURCE_DIR}/cmake/Modules/tests.cmake" DESTINATION share/xacc/)
install(FILES ${CMAKE_BINARY_DIR}/lib/libcpr.a DESTINATION lib)
install(FILES ${CMAKE_BINARY_DIR}/lib/libcpr.dylib DESTINATION lib)
INSTALL( DIRECTORY "${CMAKE_SOURCE_DIR}/tpls/spdlog" DESTINATION include )
INSTALL( DIRECTORY "${CMAKE_SOURCE_DIR}/tpls/exprtk" DESTINATION include )
INSTALL( DIRECTORY "${CMAKE_SOURCE_DIR}/tpls/eigen" DESTINATION include )
......
......@@ -52,13 +52,8 @@ endif(APPLE)
add_library(pyxacc SHARED xacc-py.cpp)
set_target_properties(pyxacc PROPERTIES PREFIX "")
set(CppUsLib CppMicroServicesd)
find_library(cppus_has_d_suffix CppMicroServicesd)
if (NOT cppus_has_d_suffix)
set(CppUsLib CppMicroServices)
endif()
target_link_libraries(pyxacc ${CppUsLib} xacc xacc-quantum-gate ${Boost_LIBRARIES} cpr curl) #xacc xacc-quantum-gate xacc-quantum-aqc CppMicroServices ${Boost_LIBRARIES} restclient-cpp) #cpprest ${OPENSSL_LIBRARIES})
target_link_libraries(pyxacc CppMicroServices xacc xacc-quantum-gate ${Boost_LIBRARIES} cpr curl)
if(APPLE)
set_target_properties(pyxacc PROPERTIES INSTALL_RPATH "@loader_path/lib")
......
......@@ -51,15 +51,11 @@ usFunctionEmbedResources(TARGET ${LIBRARY_NAME}
manifest.json
)
set(CppUsLib CppMicroServicesd)
link_directories(${CPPUS_LIBRARY_DIR})
find_library(cppus_has_d_suffix CppMicroServicesd)
if (NOT cppus_has_d_suffix)
set(CppUsLib CppMicroServices)
endif()
set(BOOST_ROOT ${CMAKE_INSTALL_PREFIX})
find_package(Boost COMPONENTS system program_options filesystem chrono regex graph REQUIRED)
target_link_libraries(${LIBRARY_NAME} CppMicroServices xacc ${Boost_LIBRARIES}) #${CppUsLib}) #${Boost_LIBRARIES} xacc ${CppUsLib} restclient-cpp) #cpprest ${OPENSSL_LIBRARIES})
target_link_libraries(${LIBRARY_NAME} ${CppUsLib})
#target_link_libraries(${LIBRARY_NAME} ${CppUsLib}) #${Boost_LIBRARIES} ${CppUsLib} xacc restclient-cpp) #cpprest ${OPENSSL_LIBRARIES})
if(APPLE)
set_target_properties(xacc-quantum-aqc PROPERTIES INSTALL_RPATH "@loader_path")
......
......@@ -53,15 +53,11 @@ usFunctionEmbedResources(TARGET ${LIBRARY_NAME}
manifest.json
)
set(CppUsLib CppMicroServicesd)
link_directories(${CPPUS_LIBRARY_DIR})
find_library(cppus_has_d_suffix CppMicroServicesd)
if (NOT cppus_has_d_suffix)
set(CppUsLib CppMicroServices)
endif()
target_link_libraries(${LIBRARY_NAME} ${CppUsLib})
#target_link_libraries(${LIBRARY_NAME} ${CppUsLib}) #${Boost_LIBRARIES} xacc ${CppUsLib} restclient-cpp) #cpprest ${OPENSSL_LIBRARIES})
set(BOOST_ROOT ${CMAKE_INSTALL_PREFIX})
find_package(Boost COMPONENTS system program_options filesystem chrono regex graph REQUIRED)
target_link_libraries(${LIBRARY_NAME} CppMicroServices xacc ${Boost_LIBRARIES}) #${CppUsLib}) #${Boost_LIBRARIES} xacc ${CppUsLib} restclient-cpp) #cpprest ${OPENSSL_LIBRARIES})
if(APPLE)
set_target_properties(xacc-quantum-gate PROPERTIES INSTALL_RPATH "@loader_path")
......
#!/bin/bash
mkdir -p $HOME/xacc-wheelhouse
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
for version in 3.6.4 #2.7.14-ucs2 2.7.14-ucs4 3.3.7 3.4.7 3.5.4 3.6.4
do
pyenv virtualenv $version xacc-$version
pyenv activate xacc-$version
python --version
python -m pip install --upgrade pip
python -m pip install wheel
export libPath=$(python -c "import distutils.util; print(distutils.util.get_platform())")
echo $libPath
git clone --recursive -b mccaskey/cpr_build https://github.com/eclipse/xacc
cd xacc
export ver=`case $version in "3.6.4") echo 3.6 ;; "3.5.4") echo 3.5 ;; "3.5.0") echo 3.5 ;; "3.4.7") echo 3.4 ;; "3.3.7") echo 3.3 ;; "2.7.14") echo 2.7 ;; *) echo "invalid";; esac`
python setup.py build -t tmp_build --executable="/usr/bin/env python"
echo "./xacc" >> build/lib.$libPath-$ver/xacc.pth
install_name_tool -change libcpr.dylib @rpath/libcpr.dylib build/lib.$libPath-$ver/xacc/lib/libxacc.dylib
install_name_tool -change $PWD/tmp_build/lib/libcpr.dylib @rpath/libcpr.dylib build/lib.$libPath-$ver/xacc/pyxacc.so
install_name_tool -change libboost_system.dylib @rpath/libboost_system.dylib build/lib.$libPath-$ver/xacc/lib/libxacc-quantum-gate.dylib
install_name_tool -change libboost_filesystem.dylib @rpath/libboost_filesystem.dylib build/lib.$libPath-$ver/xacc/lib/libxacc-quantum-gate.dylib
install_name_tool -change libboost_program_options.dylib @rpath/libboost_program_options.dylib build/lib.$libPath-$ver/xacc/lib/libxacc-quantum-gate.dylib
install_name_tool -change libboost_regex.dylib @rpath/libboost_regex.dylib build/lib.$libPath-$ver/xacc/lib/libxacc-quantum-gate.dylib
install_name_tool -change libboost_chrono.dylib @rpath/libboost_chrono.dylib build/lib.$libPath-$ver/xacc/lib/libxacc-quantum-gate.dylib
install_name_tool -change libboost_graph.dylib @rpath/libboost_graph.dylib build/lib.$libPath-$ver/xacc/lib/libxacc-quantum-gate.dylib
install_name_tool -change libboost_system.dylib @rpath/libboost_system.dylib build/lib.$libPath-$ver/xacc/lib/libboost_filesystem.dylib
install_name_tool -change libboost_system.dylib @rpath/libboost_system.dylib build/lib.$libPath-$ver/xacc/lib/libboost_chrono.dylib
install_name_tool -change libboost_regex.dylib @rpath/libboost_regex.dylib build/lib.$libPath-$ver/xacc/lib/libboost_graph.dylib
install_name_tool -change libboost_system.dylib @rpath/libboost_system.dylib build/lib.$libPath-$ver/xacc/lib/libxacc-quantum-aqc.dylib
install_name_tool -change libboost_filesystem.dylib @rpath/libboost_filesystem.dylib build/lib.$libPath-$ver/xacc/lib/libxacc-quantum-aqc.dylib
install_name_tool -change libboost_program_options.dylib @rpath/libboost_program_options.dylib build/lib.$libPath-$ver/xacc/lib/libxacc-quantum-aqc.dylib
install_name_tool -change libboost_regex.dylib @rpath/libboost_regex.dylib build/lib.$libPath-$ver/xacc/lib/libxacc-quantum-aqc.dylib
install_name_tool -change libboost_chrono.dylib @rpath/libboost_chrono.dylib build/lib.$libPath-$ver/xacc/lib/libxacc-quantum-aqc.dylib
install_name_tool -change libboost_graph.dylib @rpath/libboost_graph.dylib build/lib.$libPath-$ver/xacc/lib/libxacc-quantum-aqc.dylib
python setup.py bdist_wheel --skip-build
mv dist/*.whl $HOME/xacc-wheelhouse
source deactivate
#rm -rf xacc
done
......@@ -63,12 +63,7 @@ endif()
# Get the test files
file(GLOB test_files utils/tests/*Tester.cpp accelerator/tests/*Tester.cpp)
set(CppUsLib CppMicroServicesd)
find_library(cppus_has_d_suffix CppMicroServicesd)
if (NOT cppus_has_d_suffix)
set(CppUsLib CppMicroServices)
endif()
target_link_libraries(xacc ${CppUsLib})
target_link_libraries(xacc CppMicroServices cpr)
# Add the tests
if(XACC_BUILD_TESTS)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment