Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Update all dependencies and GCC-12 support (#165)
Browse files Browse the repository at this point in the history
* Use newer IMGUI that supports logarithmic float slider

* Include updated IMGUI

* Use RED directly instead of removed ERROR

* Include IMGUI tables for linking

* Update double-conversion, glfw, glm, openvdb, ordered-map dependencies

* Update libfive dependency

* Build for macos

---------

Co-authored-by: lf94 <[email protected]>
  • Loading branch information
lf94 and lf94 authored Feb 1, 2023
1 parent 6b6af24 commit 86788b4
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 381 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: recursive
- run: brew install boost ilmbase openexr tbb@2020 glm libomp eigen libpng
- run: brew install boost ilmbase tbb@2020 glm eigen

- name: Run tests
run: make test
Expand All @@ -43,7 +43,7 @@ jobs:
with:
msystem: MINGW64
update: true
install: "git diffutils mingw-w64-x86_64-clang make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-mesa mingw-w64-x86_64-openexr mingw-w64-x86_64-intel-tbb mingw-w64-x86_64-glm mingw-w64-x86_64-glew mingw-w64-x86_64-dbus patch mingw-w64-x86_64-openvdb mingw-w64-x86_64-ccache mingw-w64-x86_64-libpng mingw-w64-x86_64-eigen3"
install: "git diffutils mingw-w64-x86_64-gcc make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-mesa mingw-w64-x86_64-openexr mingw-w64-x86_64-intel-tbb mingw-w64-x86_64-glm mingw-w64-x86_64-glew mingw-w64-x86_64-dbus patch mingw-w64-x86_64-openvdb mingw-w64-x86_64-ccache mingw-w64-x86_64-libpng mingw-w64-x86_64-eigen3"

- name: ccache cache files
uses: actions/cache@v2
Expand Down Expand Up @@ -86,6 +86,7 @@ jobs:
run: |
sudo apt install clang cmake git-core libboost-all-dev libopenexr-dev libtbb-dev libglm-dev dbus-x11
sudo apt install libxcursor-dev libxinerama-dev libxrandr-dev libgl-dev libxi-dev libpng-dev libeigen3-dev
sudo apt install libfuse2
- name: Build AppImage
run: |
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
url = https://github.com/g-truc/glm.git
[submodule "extern/libfive"]
path = extern/libfive
url = https://github.com/curv3d/libfive
url = https://github.com/libfive/libfive
79 changes: 50 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
cmake_minimum_required(VERSION 3.12)

# Thanks https://stackoverflow.com/a/50313990
# Now how do we make this robust
if (APPLE)
set(CMAKE_C_COMPILER "/usr/local/Cellar/llvm/15.0.7_1/bin/clang")
set(CMAKE_CXX_COMPILER "/usr/local/Cellar/llvm/15.0.7_1/bin/clang++")
set(OPENMP_LIBRARIES "/usr/local/Cellar/llvm/15.0.7_1/lib")
set(OPENMP_INCLUDES "/usr/local/Cellar/llvm/15.0.7_1/include")
endif ()

project(curv)

if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
Expand Down Expand Up @@ -44,12 +54,9 @@ if (APPLE)
# or /opt/homebrew for Apple Silicon (bug #128)
# Also, we now depend on tbb@2020, not tbb, due to openvdb not supporting
# latest version (June 5 2021).
include_directories(SYSTEM
/usr/local/opt/tbb@2020/include /opt/homebrew/opt/tbb@2020/include
/usr/local/include /opt/homebrew/include)
link_directories(
/usr/local/opt/tbb@2020/lib /opt/homebrew/opt/tbb@2020/lib
/usr/local/lib /opt/homebrew/lib)
include_directories(SYSTEM /usr/local/include)
include_directories(/usr/local/opt/tbb@2020/include)
link_directories(/usr/local/opt/tbb@2020/lib)
endif (APPLE)

# Libraries
Expand Down Expand Up @@ -104,14 +111,16 @@ set_property(TARGET glad PROPERTY CXX_STANDARD 17)

# Dear IMGUI library
add_library(imgui
extern/imgui/examples/imgui_impl_glfw.cpp
extern/imgui/examples/imgui_impl_opengl3.cpp
extern/imgui/backends/imgui_impl_glfw.cpp
extern/imgui/backends/imgui_impl_opengl3.cpp
extern/imgui/imgui.cpp
extern/imgui/imgui_demo.cpp
extern/imgui/imgui_draw.cpp
extern/imgui/imgui_tables.cpp
extern/imgui/imgui_widgets.cpp)
target_include_directories(imgui
PUBLIC extern/imgui extern/imgui/examples)
PUBLIC extern/imgui extern/imgui/examples
extern/imgui/backends)
target_link_libraries(imgui PUBLIC glfw glad)
target_compile_definitions(imgui PUBLIC
IMGUI_IMPL_OPENGL_LOADER_GLAD )
Expand Down Expand Up @@ -145,14 +154,6 @@ endif ()
# Boost library (Windows port required 1.72, 1.65 is latest for Ubuntu 18.04)
find_package(Boost 1.65 REQUIRED COMPONENTS iostreams system)

# imdemo, broken in v1.65 of ImGui, need to upgrade to headrev
#add_executable(imdemo
# extern/imgui/examples/example_glfw_opengl3/main.cpp)
#target_include_directories(imdemo
# PUBLIC extern/imgui/examples/example_glfw_opengl3)
#target_link_libraries(imdemo PUBLIC glfw glad imgui ${LibOpenGL})
#set_property(TARGET imdemo PROPERTY CXX_STANDARD 17)

# Libraries End
# ===============================================

Expand Down Expand Up @@ -180,11 +181,6 @@ if (MSYS)
else ()
set(LibDl "dl")
endif ()
if (APPLE)
set(LibOmp "omp")
else ()
set(LibOmp "")
endif ()
if (LEAN_BUILD)
set(FatLibraries "")
else ()
Expand All @@ -194,7 +190,7 @@ set(Libs
libcurv_io libcurv imgui glfw glad ${LibOpenGL} replxx double-conversion
tmc ${FatLibraries}
Boost::iostreams Boost::system
pthread ${LibDl} ${LibOmp})
pthread ${LibDl})

target_link_libraries(curv PUBLIC ${Libs})

Expand All @@ -204,11 +200,36 @@ target_link_libraries(tester PUBLIC gtest pthread libcurv libcurv_io double-conv

set_property(TARGET curv libcurv libcurv_io tester PROPERTY CXX_STANDARD 17)

# Thanks https://stackoverflow.com/a/50313990, and no thanks Apple
if (APPLE)
set(ompflags "-Xpreprocessor -fopenmp")
set(ompflags "")
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(OpenMP_C "${CMAKE_C_COMPILER}")
set(OpenMP_C_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument")
set(OpenMP_C_LIB_NAMES "libomp" "libgomp" "libiomp5")
set(OpenMP_libomp_LIBRARY ${OpenMP_C_LIB_NAMES})
set(OpenMP_libgomp_LIBRARY ${OpenMP_C_LIB_NAMES})
set(OpenMP_libiomp5_LIBRARY ${OpenMP_C_LIB_NAMES})
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(OpenMP_CXX "${CMAKE_CXX_COMPILER}")
set(OpenMP_CXX_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument")
set(OpenMP_CXX_LIB_NAMES "libomp" "libgomp" "libiomp5")
set(OpenMP_libomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
set(OpenMP_libgomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
set(OpenMP_libiomp5_LIBRARY ${OpenMP_CXX_LIB_NAMES})
endif()
if (OPENMP_FOUND)
include_directories("${OPENMP_INCLUDES}")
link_directories("${OPENMP_LIBRARIES}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
# set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif(OPENMP_FOUND)
else ()
set(ompflags "-fopenmp")
set(ompflags ${OpenMP_C_FLAGS})
endif ()

set(gccflags "-Wall -Wno-unused-result ${ompflags}" )
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${gccflags}" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${gccflags}" )
Expand All @@ -234,9 +255,9 @@ endif()
if (NOT DEFINED MSYS)
# On MSYS we use MinGW packages for OpenVDB and GoogleTest.
# Copy or stub definitions from extern/openvdb/CMakeLists.txt
set(OpenVDB_MAJOR_VERSION 8)
set(OpenVDB_MINOR_VERSION 1)
set(OpenVDB_PATCH_VERSION 0)
set(OpenVDB_MAJOR_VERSION 10)
set(OpenVDB_MINOR_VERSION 0)
set(OpenVDB_PATCH_VERSION 1)
set(OpenVDB_ABI ${OpenVDB_MAJOR_VERSION})
set(OPENVDB_ABI_VERSION_NUMBER ${OpenVDB_MAJOR_VERSION})
set(OPENVDB_INSTALL_INCLUDEDIR openvdb_install_includedir)
Expand All @@ -245,7 +266,7 @@ if (NOT DEFINED MSYS)
add_library(TBB::tbb ALIAS dummy)
if (NOT LEAN_BUILD)
add_subdirectory(extern/openvdb/openvdb/openvdb EXCLUDE_FROM_ALL)
set_property(TARGET openvdb_static PROPERTY CXX_STANDARD 14)
set_property(TARGET openvdb_static PROPERTY CXX_STANDARD 17)
endif()
add_subdirectory(extern/googletest/googletest EXCLUDE_FROM_ALL)
endif ()
Expand Down
4 changes: 2 additions & 2 deletions curv/repl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ void color_input(std::string const& context, Replxx::colors_t& colors,

case Token::k_bad_token:
case Token::k_bad_utf8:
col = Color::ERROR;
col = Color::RED;
break;

// numerals
Expand Down Expand Up @@ -323,7 +323,7 @@ void color_input(std::string const& context, Replxx::colors_t& colors,
}
} catch (Exception& e) {
auto tok = e.loc_.front().srcloc_.token();
set_colour(colors, tok, Color::ERROR);
set_colour(colors, tok, Color::RED);
}
}

Expand Down
2 changes: 1 addition & 1 deletion extern/double-conversion
Submodule double-conversion updated 45 files
+68 −0 .github/workflows/ci.yml
+23 −0 .github/workflows/scons.yml
+22 −0 .gitignore
+2 −0 AUTHORS
+7 −3 BUILD
+21 −3 CMakeLists.txt
+55 −0 Changelog
+1 −1 Makefile
+4 −3 README.md
+2 −2 SConstruct
+1 −0 double-conversion/.gitignore
+2 −2 double-conversion/SConscript
+23 −23 double-conversion/bignum-dtoa.cc
+306 −276 double-conversion/bignum.cc
+38 −30 double-conversion/bignum.h
+102 −102 double-conversion/cached-powers.cc
+13 −13 double-conversion/cached-powers.h
+0 −57 double-conversion/diy-fp.cc
+39 −20 double-conversion/diy-fp.h
+2 −544 double-conversion/double-conversion.h
+440 −0 double-conversion/double-to-string.cc
+445 −0 double-conversion/double-to-string.h
+29 −29 double-conversion/fast-dtoa.cc
+12 −12 double-conversion/fixed-dtoa.cc
+64 −19 double-conversion/ieee.h
+105 −425 double-conversion/string-to-double.cc
+238 −0 double-conversion/string-to-double.h
+82 −54 double-conversion/strtod.cc
+19 −0 double-conversion/strtod.h
+110 −59 double-conversion/utils.h
+5 −4 msvc/double-conversion.vcxproj
+11 −8 msvc/double-conversion.vcxproj.filters
+1 −0 msvc/run_tests/run_tests.vcxproj
+3 −0 test/cctest/CMakeLists.txt
+24 −4 test/cctest/cctest.cc
+45 −33 test/cctest/cctest.h
+23 −23 test/cctest/checks.h
+3 −3 test/cctest/test-bignum-dtoa.cc
+25 −19 test/cctest/test-bignum.cc
+627 −21 test/cctest/test-conversions.cc
+31 −6 test/cctest/test-diy-fp.cc
+10 −10 test/cctest/test-dtoa.cc
+30 −5 test/cctest/test-fast-dtoa.cc
+77 −31 test/cctest/test-ieee.cc
+494 −1 test/cctest/test-strtod.cc
2 changes: 1 addition & 1 deletion extern/glfw
Submodule glfw updated 154 files
2 changes: 1 addition & 1 deletion extern/glm
Submodule glm updated 291 files
2 changes: 1 addition & 1 deletion extern/imgui
Submodule imgui updated 227 files
2 changes: 1 addition & 1 deletion extern/libfive
Submodule libfive updated 47 files
+1 −0 .gitignore
+23 −7 CMakeLists.txt
+17 −2 README.md
+1 −1 libfive/CMakeLists.txt
+1 −1 libfive/bind/guile/CMakeLists.txt
+10 −14 libfive/bind/guile/libfive/lib.scm
+2 −2 libfive/bind/guile/libfive/stdlib/csg.scm
+3 −2 libfive/bind/guile/libfive/stdlib/shapes.scm
+2 −2 libfive/bind/guile/libfive/stdlib/text.scm
+2 −2 libfive/bind/guile/libfive/stdlib/transforms.scm
+6 −4 libfive/bind/python/CMakeLists.txt
+1 −1 libfive/bind/python/libfive/shape.py
+2 −2 libfive/bind/python/libfive/stdlib/csg.py
+3 −2 libfive/bind/python/libfive/stdlib/shapes.py
+2 −2 libfive/bind/python/libfive/stdlib/text.py
+2 −2 libfive/bind/python/libfive/stdlib/transforms.py
+16 −0 libfive/include/libfive/render/brep/default_new_delete.hpp
+2 −2 libfive/include/libfive/render/brep/settings.hpp
+1 −0 libfive/include/libfive/tree/data.hpp
+1 −0 libfive/include/libfive/tree/tree.hpp
+5 −1 libfive/src/CMakeLists.txt
+2 −0 libfive/src/eval/eval_array.cpp
+1 −1 libfive/stdlib/CMakeLists.txt
+2 −2 libfive/stdlib/README.md
+19 −13 libfive/stdlib/gen_c.py
+3 −1 libfive/stdlib/gen_py.py
+3 −1 libfive/stdlib/gen_scm.py
+5 −4 libfive/stdlib/libfive_stdlib.h
+4 −2 libfive/stdlib/parse.py
+6 −4 libfive/stdlib/stdlib.cpp
+55 −6 libfive/stdlib/stdlib_impl.cpp
+92 −89 libfive/stdlib/stdlib_impl.hpp
+1 −0 libfive/test/CMakeLists.txt
+7,638 −2,959 libfive/test/catch.hpp
+2 −2 libfive/test/heightmap.cpp
+2 −2 libfive/test/indexes.cpp
+10 −10 libfive/test/mesh.cpp
+5 −5 libfive/test/simplex.cpp
+1 −1 libfive/test/solver.cpp
+31 −13 studio/CMakeLists.txt
+1 −2 studio/include/studio/result.hpp
+8 −3 studio/src/args.cpp
+3 −3 studio/src/documentation.cpp
+2 −2 studio/src/editor.cpp
+4 −0 studio/src/shape.cpp
+2 −2 studio/src/view.cpp
+7 −7 studio/src/window.cpp
2 changes: 1 addition & 1 deletion extern/openvdb
Submodule openvdb updated 761 files
Loading

0 comments on commit 86788b4

Please sign in to comment.