From 87e5c7eda6dec25e922b074973519d51e0a8e7e3 Mon Sep 17 00:00:00 2001 From: Steven Atkinson Date: Fri, 8 Aug 2025 10:21:21 -0700 Subject: [PATCH 1/6] Try to fix the build --- CMakeLists.txt | 5 +---- NAM/dsp.cpp | 1 - tools/CMakeLists.txt | 10 +++++----- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ee8df8..38dbb9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,10 +5,7 @@ project(NAM VERSION 0.3.0) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED OFF) -set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++20") + if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") include_directories(SYSTEM /usr/local/include) diff --git a/NAM/dsp.cpp b/NAM/dsp.cpp index b297b09..ec5892b 100644 --- a/NAM/dsp.cpp +++ b/NAM/dsp.cpp @@ -1,5 +1,4 @@ #include // std::max_element -#include #include // pow, tanh, expf #include #include diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 3174c3e..36767e4 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,13 +1,13 @@ file(GLOB_RECURSE NAM_SOURCES ../NAM/*.cpp ../NAM/*.c ../NAM*.h) -set(TOOLS benchmodel) +set(TOOLS loadmodel benchmodel run_tests) add_custom_target(tools ALL DEPENDS ${TOOLS}) -include_directories(tools ..) -include_directories(tools ${NAM_DEPS_PATH}/eigen) -include_directories(tools ${NAM_DEPS_PATH}/nlohmann) +include_directories(..) +include_directories(${NAM_DEPS_PATH}/eigen) +include_directories(${NAM_DEPS_PATH}/nlohmann) add_executable(loadmodel loadmodel.cpp ${NAM_SOURCES}) add_executable(benchmodel benchmodel.cpp ${NAM_SOURCES}) @@ -15,7 +15,7 @@ add_executable(run_tests run_tests.cpp ${NAM_SOURCES}) source_group(NAM ${CMAKE_CURRENT_SOURCE_DIR} FILES ${NAM_SOURCES}) -target_compile_features(${TOOLS} PUBLIC cxx_std_17) +target_compile_features(${TOOLS} PUBLIC cxx_std_20) set_target_properties(${TOOLS} PROPERTIES From dc23e50d2f365f42ad929c7b9f7235c2ef74435c Mon Sep 17 00:00:00 2001 From: Steven Atkinson Date: Fri, 8 Aug 2025 10:42:46 -0700 Subject: [PATCH 2/6] Clean up whitespace --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38dbb9d..000a1fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,8 +5,6 @@ project(NAM VERSION 0.3.0) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") - - if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") include_directories(SYSTEM /usr/local/include) elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux") From a8703ed75da0c9bacec38621acbe36eb3edfc109 Mon Sep 17 00:00:00 2001 From: Steven Atkinson Date: Fri, 8 Aug 2025 10:53:20 -0700 Subject: [PATCH 3/6] Back to C++17, see if this can be made to work. Move forward next. --- CMakeLists.txt | 5 +++++ tools/CMakeLists.txt | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 000a1fc..564d9ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,11 @@ project(NAM VERSION 0.3.0) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED OFF) +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++17") + if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") include_directories(SYSTEM /usr/local/include) elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux") diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 36767e4..ee71722 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,13 +1,14 @@ file(GLOB_RECURSE NAM_SOURCES ../NAM/*.cpp ../NAM/*.c ../NAM*.h) -set(TOOLS loadmodel benchmodel run_tests) +# TODO: add loadmodel and run_tests to TOOLS? +set(TOOLS benchmodel) add_custom_target(tools ALL DEPENDS ${TOOLS}) -include_directories(..) -include_directories(${NAM_DEPS_PATH}/eigen) -include_directories(${NAM_DEPS_PATH}/nlohmann) +include_directories(tools ..) +include_directories(tools ${NAM_DEPS_PATH}/eigen) +include_directories(tools ${NAM_DEPS_PATH}/nlohmann) add_executable(loadmodel loadmodel.cpp ${NAM_SOURCES}) add_executable(benchmodel benchmodel.cpp ${NAM_SOURCES}) @@ -15,7 +16,7 @@ add_executable(run_tests run_tests.cpp ${NAM_SOURCES}) source_group(NAM ${CMAKE_CURRENT_SOURCE_DIR} FILES ${NAM_SOURCES}) -target_compile_features(${TOOLS} PUBLIC cxx_std_20) +target_compile_features(${TOOLS} PUBLIC cxx_std_17) set_target_properties(${TOOLS} PROPERTIES From c0ad914c3a83621ef3a444d99629117246c780f1 Mon Sep 17 00:00:00 2001 From: Steven Atkinson Date: Fri, 8 Aug 2025 10:55:08 -0700 Subject: [PATCH 4/6] Add install dependencies --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b0fd922..7e91240 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,11 @@ jobs: - uses: actions/checkout@v3.3.0 with: submodules: recursive + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential cmake - name: Build Tools working-directory: ${{github.workspace}}/build From aba3b25b0e32ff82c740fdde1a4ddfdd1b4d0cb4 Mon Sep 17 00:00:00 2001 From: Steven Atkinson Date: Fri, 8 Aug 2025 10:59:23 -0700 Subject: [PATCH 5/6] Revert --- .github/workflows/build.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e91240..b0fd922 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,11 +14,6 @@ jobs: - uses: actions/checkout@v3.3.0 with: submodules: recursive - - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y build-essential cmake - name: Build Tools working-directory: ${{github.workspace}}/build From 70fa579a707b83bcef508ea3c7308239657de1d6 Mon Sep 17 00:00:00 2001 From: Steven Atkinson Date: Fri, 8 Aug 2025 11:11:06 -0700 Subject: [PATCH 6/6] Udpate CMakeLists.txt --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 564d9ce..528c1e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,11 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED OFF) set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++17") + +# Use libc++ on macOS, system default on Linux +if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") +endif() if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") include_directories(SYSTEM /usr/local/include)