Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/penn-graphics-research/ziran2019
11 June 2024, 08:44:58 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    No releases to show
  • 31424c6
  • /
  • CMakeLists.txt
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:75ac37bebbf5905a73d230beb47d5965bda38bbb
origin badgedirectory badge Iframe embedding
swh:1:dir:31424c634037dbead0acec4740b3fbda1e4b0a68
origin badgerevision badge
swh:1:rev:35742ac3ab1ae42cf2bbe8761fd7c8e630a638c4
origin badgesnapshot badge
swh:1:snp:597f10704966a63e22a6690fc91719ea5d363ec6
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 35742ac3ab1ae42cf2bbe8761fd7c8e630a638c4 authored by JoshWolper on 28 October 2020, 15:53:00 UTC
Add files via upload
Tip revision: 35742ac
CMakeLists.txt
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)

if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
  message( FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. You may need to remove CMakeCache.txt." )
endif()

project(ZIRAN CXX)
message(STATUS "${CMAKE_BUILD_TYPE} Build")

set(VERSION_MAJOR 0)
set(VERSION_MINOR 1)
set(VERSION_PATCH 0)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake)

set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
set(CMAKE_CXX_STANDARD 17)

set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DEIGEN_INITIALIZE_MATRICES_BY_NAN ")

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  # using regular Clang or AppleClang
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Werror=all -Wextra -Wno-unused-parameter -march=native")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
  # using GCC
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Werror=all -Wextra -Wno-unused-parameter -Wcast-align -Wformat=2 -Winit-self -Wmissing-include-dirs -Woverloaded-virtual -march=native -fno-math-errno")
  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og")
  set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-z,defs")

  # enable link time optimization
  # We need two wrappers in order for LTO to work properly:
  # - gcc-ar: static library archiver
  # - gcc-ranlib: static library indexer
  # Without these wrappers, all sorts of undefined refernce errors
  # occur in gcc-4.9 due to "slim" LTO objects, and possibly
  # earlier versions for various reasons.
  if("${CMAKE_AR}" MATCHES "gcc-ar$")
    # Already using the gcc-ar wrapper.
    set(GCC_WRAPPER_AR "${CMAKE_AR}")
  else()
    # Replace ar with gcc-ar.
    string(REGEX REPLACE "ar$" "gcc-ar" GCC_WRAPPER_AR "${CMAKE_AR}")
  endif()
  if("${CMAKE_RANLIB}" MATCHES "gcc-ranlib$")
    # Already using the gcc-ranlib wrapper.
    set(GCC_WRAPPER_RANLIB "${CMAKE_RANLIB}")
  else()
    # Replace ranlib with gcc-ranlib.
    string(REGEX REPLACE "ranlib$" "gcc-ranlib" GCC_WRAPPER_RANLIB "${CMAKE_RANLIB}")
  endif()

  if(EXISTS "${GCC_WRAPPER_AR}" AND EXISTS "${GCC_WRAPPER_RANLIB}")
    # Found gcc binutils wrappers.
    set(CMAKE_AR "${GCC_WRAPPER_AR}")
    set(CMAKE_RANLIB "${GCC_WRAPPER_RANLIB}")
    set(HAS_BINUTILS_WRAPPERS 1)
  else()
    message(FATAL_ERROR "gcc binutils wrappers not found; cannot enable LTO.")
  endif()

  if(HAS_BINUTILS_WRAPPERS AND CMAKE_BUILD_TYPE MATCHES RELEASE)
    set(ZIRAN_CXXFLAGS_LTO "-flto=8")
    set(ZIRAN_LDFLAGS_LTO "${ZIRAN_CXXFLAGS_LTO} -fuse-linker-plugin")
  endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
  # using Intel C++
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror=all -Wextra -Wno-unused-parameter -march=native -std=c++17")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
  # using Visual Studio C++
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm1024")
  add_definitions(-DNOMINMAX)
endif()


# Add new build types
set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG} --coverage")
set(CMAKE_C_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG} --coverage")
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE "")
set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "")

set(CMAKE_CXX_FLAGS_QUICK "${CMAKE_CXX_FLAGS} -O1")
set(CMAKE_EXE_LINKER_FLAGS_QUICK "")
set(CMAKE_SHARED_LINKER_FLAGS_QUICK "")

if(NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE Release
    CACHE STRING "Choose the type of build : Debug Release RelWithDebInfo MinSizeRel Coverage Quick."
    FORCE)
  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo" "MinSizeRel" "Coverage" "Quick")
endif()

find_program(MEMORYCHECK_COMMAND valgrind)
set(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full --error-exitcode=1 --suppressions=${CMAKE_CURRENT_SOURCE_DIR}/Scripts/valgrind.supp")

# options can be changed with ccmake or cmake-gui called on the build directory
# provided in ubuntu packages with cmake-curses-gui and cmake-qt-gui respectively
option(CREATE_LOCAL_MAKEFILES "Create Makefiles in the source directory to allow building from source" ON)

# add test and a memcheck (valgrind)
function(add_ziran_executable binary)
  add_executable(${binary} ${ARGN})
  set_target_properties(${binary} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

  set_target_properties(${binary} PROPERTIES DEBUG_POSTFIX _debug)
  set_target_properties(${binary} PROPERTIES COVERAGE_POSTFIX _coverage)
  set_target_properties(${binary} PROPERTIES QUICK_POSTFIX _quick)
  set_target_properties(${binary} PROPERTIES RELWITHDEBINFO_POSTFIX _reldeb)
  set_target_properties(${binary} PROPERTIES MINSIZEREL_POSTFIX _min)
  install(TARGETS ${binary} DESTINATION bin)
endfunction(add_ziran_executable)

function(add_ziran_cuda_executable binary)
  cuda_add_executable(${binary} ${ARGN})
  set_target_properties(${binary} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

  set_target_properties(${binary} PROPERTIES DEBUG_POSTFIX _debug)
  set_target_properties(${binary} PROPERTIES COVERAGE_POSTFIX _coverage)
  set_target_properties(${binary} PROPERTIES QUICK_POSTFIX _quick)
  set_target_properties(${binary} PROPERTIES RELWITHDEBINFO_POSTFIX _reldeb)
  set_target_properties(${binary} PROPERTIES MINSIZEREL_POSTFIX _min)
  install(TARGETS ${binary} DESTINATION bin)
endfunction(add_ziran_cuda_executable)

# create plugin
set(ZIRAN_PLUGIN_DIR ${CMAKE_BINARY_DIR}/Plugins)
add_definitions(-DZIRAN_PLUGIN_DIR="${ZIRAN_PLUGIN_DIR}")
file(MAKE_DIRECTORY ${ZIRAN_PLUGIN_DIR})

function(add_ziran_plugin plugin)
  add_library(${plugin} SHARED ${ARGN})
  set_target_properties(${plugin} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${ZIRAN_PLUGIN_DIR})
endfunction(add_ziran_plugin)

enable_testing()

add_subdirectory(Deps)
add_subdirectory(Lib)
add_subdirectory(Projects)
add_subdirectory(Scripts)

# build timer
# set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CMAKE_COMMAND} -E time")

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API