Skip to content

Commit

Permalink
handle building from a tarfile gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
mahrud committed Jan 20, 2021
1 parent a3cec3f commit edabb1e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
13 changes: 0 additions & 13 deletions M2/INSTALL-CMake.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,19 +302,6 @@ cmake -DCMAKE_SYSTEM_PREFIX_PATH=`brew --prefix` .
```
</details>

<details>
<summary>Building from the source code tarfile</summary>

When building from a source code tarfile (e.g. downloaded from GitHub, rather than a git clone), you may see an error like this:
```
No download info given for 'build-bdwgc' and its source directory: ...
```
To resolve this, you should download and extract the source tarfiles for each git submodule in the `M2/submodules` directory. Also, you may need to manually turn off submodule updates:
```
cmake -DGIT_SUBMODULE=off .
```
</details>

<details>
<summary><code>/usr/include/c++/10.1.0/bits/unique_ptr.h:594:9: error: no matching function for call to std::__uniq_ptr_data</code> when using GCC 10 or Clang 10</summary>

Expand Down
5 changes: 5 additions & 0 deletions M2/Macaulay2/editors/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ add_custom_command(OUTPUT ${GRAMMAR_FILES}
###############################################################################
## Generating the M2-mode package for Emacs

if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/emacs/make-M2-emacs-help.m2)
message(WARNING "Macaulay2/editors/emacs submodule is missing; skipping M2-emacs target")
return()
endif()

# TODO: only the emacs target is installed in usr-dist by default
set(M2_INSTALL_EMACSDIR
${M2_DIST_PREFIX}/${M2_INSTALL_DATAROOTDIR}/emacs/site-lisp/macaulay2)
Expand Down
2 changes: 1 addition & 1 deletion M2/cmake/build-libraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/../.git")
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_SUBMOD_RESULT)
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")
message(WARNING "git submodule update failed, please checkout submodules manually")
endif()
endif()
endif()
Expand Down
8 changes: 8 additions & 0 deletions M2/cmake/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,15 @@ if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/../.git")
OUTPUT_VARIABLE COMMIT_COUNT)
set(GIT_DESCRIPTION version-${PROJECT_VERSION}-${COMMIT_COUNT}-${GIT_COMMIT})
else()
message(NOTICE "## Not building from a git repository; submodules may need to be manually populated")
set(GIT_DESCRIPTION version-${PROJECT_VERSION} CACHE INTERNAL "state of the repository")
file(GLOB _submodules LIST_DIRECTORIES true ${CMAKE_SOURCE_DIR}/submodules/*)
foreach(_submodule IN LISTS _submodules)
if(IS_DIRECTORY ${_submodule})
# CMake doesn't like empty source directories for ExternalProject_Add
file(TOUCH ${_submodule}/.nogit)
endif()
endforeach()
endif()

message("## Configure Macaulay2
Expand Down

0 comments on commit edabb1e

Please sign in to comment.