From 78d72e8670bc8c3f786dc687cb32f249d8f6a59e Mon Sep 17 00:00:00 2001 From: George Dan Miron <44091914+gdmiron@users.noreply.github.com> Date: Thu, 21 Jul 2022 17:01:17 +0200 Subject: [PATCH] Fixes for macos build (#38) * set C++ standard to 17 * link to spdlog Co-authored-by: svetad Co-authored-by: G. Dan Miron --- CMakeLists.txt | 4 ++-- ThermoFun/CMakeLists.txt | 3 +++ azure-pipelines.yml | 2 +- ci/pipelines/install/install-osx.sh | 3 ++- cmake/modules/ThermoFunFindDeps.cmake | 7 +++++++ environment.devenv.yml | 8 ++++---- 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18a3223..26c769b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,8 +53,8 @@ if(NOT CMAKE_BUILD_TYPE) endif() # Set the C++ standard -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD 17) +#set(CMAKE_CXX_STANDARD_REQUIRED ON) # Set the list of compiler flags for MSVC compiler if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC) diff --git a/ThermoFun/CMakeLists.txt b/ThermoFun/CMakeLists.txt index d7833ed..9556f16 100644 --- a/ThermoFun/CMakeLists.txt +++ b/ThermoFun/CMakeLists.txt @@ -32,6 +32,9 @@ if(ChemicalFun_FOUND) target_link_libraries(ThermoFun PUBLIC ChemicalFun::ChemicalFun) endif() +target_link_libraries(ThermoFun PRIVATE spdlog::spdlog) + + if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") #link_directories("/usr/local/lib") else() diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 96f66a5..92a3de8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -19,7 +19,7 @@ jobs: - job: macOS pool: - vmImage: 'macos-12' + vmImage: 'macOS-11' steps: - task: Bash@3 diff --git a/ci/pipelines/install/install-osx.sh b/ci/pipelines/install/install-osx.sh index 75545b4..4d61035 100644 --- a/ci/pipelines/install/install-osx.sh +++ b/ci/pipelines/install/install-osx.sh @@ -25,9 +25,10 @@ cmake \ -DCMAKE_INSTALL_LIBDIR=lib \ .. make install +conda list +python -c "import thermofun" if [ $? -eq 1 ] then echo "The install failed" >&2 exit 1 fi -conda list diff --git a/cmake/modules/ThermoFunFindDeps.cmake b/cmake/modules/ThermoFunFindDeps.cmake index 5af1651..8cfad87 100644 --- a/cmake/modules/ThermoFunFindDeps.cmake +++ b/cmake/modules/ThermoFunFindDeps.cmake @@ -19,3 +19,10 @@ if(NOT ChemicalFun_FOUND) else() message(STATUS "Found ChemicalFun v${ChemicalFun_VERSION}") endif() + +find_package(spdlog REQUIRED) +if(NOT spdlog_FOUND) + message(FATAL_ERROR "spdlog not found") +else() + message(STATUS "Found spdlog v${spdlog_VERSION}") +endif() diff --git a/environment.devenv.yml b/environment.devenv.yml index 8bc6ee0..9085049 100644 --- a/environment.devenv.yml +++ b/environment.devenv.yml @@ -3,16 +3,16 @@ name: thermofun {% set python_version = os.environ.get("PY_VER", "3.7") %} dependencies: - - pip - setuptools=59.7.0 - - gxx_linux-64=7.3.0 # [linux] + - pip + - gxx_linux-64=9.4.0 # [linux] - cmake>=3.13 - ninja - ccache # [unix] - pybind11 - nlohmann_json - - fmt>=8.1.1 - - chemicalfun>=0.1.3 + - spdlog=1.10.0 + - chemicalfun=0.1.4 - python={{ python_version }} - pytest - pip: