Skip to content

Commit

Permalink
update cmakelists for documentations
Browse files Browse the repository at this point in the history
  • Loading branch information
limbo018 committed Jun 12, 2019
1 parent d13e2e8 commit 8822f0e
Show file tree
Hide file tree
Showing 14 changed files with 562 additions and 2,618 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ find_package(ZLIB REQUIRED)
find_package(Boost 1.55.0 REQUIRED COMPONENTS iostreams chrono timer unit_test_framework graph regex)
find_package(Gurobi)
find_package(LpSolve)
find_package(Doxygen)

add_subdirectory(limbo)
add_subdirectory(test)

if (DOXYGEN_FOUND)
add_subdirectory(docs)
endif(DOXYGEN_FOUND)
49 changes: 8 additions & 41 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,57 +90,24 @@ Users need to make sure they are properly installed and the corresponding settin

* In the directory of limbo library, run
~~~~~~~~~~~~~~~~
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=absolute/path/to/your/installation
make
make doc (optional) # generate documentation
make test (optional) # build test programs
make install PREFIX=an_absolute_path
make install
~~~~~~~~~~~~~~~~


The default installation path is the same as building path.
Please do not set PREFIX with a relative path.
After installation, it is strongly recommended to export LIMBO_DIR to the path where Limbo library is installed as an environment variable.

## 2. Customize CXX, CC and FC options

* CXX sets the compiler for C++ and CC sets the compiler for C. FC sets the fortran compiler which is only needed by some third party packages like OpenBLAS.
Some examples are as follows,
~~~~~~~~~~~~~~~~
make CXX=g++ CC=gcc FC=gfortran (default for Linux)
make CXX=clang++ CC=clang FC=gfortran (default for Mac/Darwin)
~~~~~~~~~~~~~~~~


## 3. Customize CXXSTDLIB and CXXSTD options

* CXXSTDLIB is used to control -stdlib=xxx under clang++, and CXXSTD is used to control -std=xxx in most compilers.

Under clang, following combinations are valid,
~~~~~~~~~~~~~~~~
make CXXSTDLIB="-stdlib=libstdc++" CXXSTD="-std=c++98" (default)
make CXXSTDLIB="-stdlib=libc++" CXXSTD="-std=c++98"
make CXXSTDLIB="-stdlib=libc++" CXXSTD="-std=c++11"
~~~~~~~~~~~~~~~~


Under gcc, there is no -stdlib option, so following combinations are valid,
~~~~~~~~~~~~~~~~
make CXXSTD="-std=c++98" (default)
make CXXSTD="-std=c++11"
~~~~~~~~~~~~~~~~


Users must make sure the setting is consistent to dependent libraries during compilation, such as Boost, Lemon, etc.
For example, if Boost is compiled with "clang++ -stdlib=libstdc++ -std=c++98", the same setting should be used for components dependent to Boost.

## 4. Customize OPENBLAS options
## 2. Customize OPENBLAS options

* There is a third party OpenBLAS required by some other third party packages, such as Csdp. OPENBLAS option is used to control whether compiling these packages.

If you do not need these packages, set OPENBLAS=0 (default);
otherwise, set OPENBLAS=1.
If you do not need these packages, set -DOPENBLAS=0 (default);
otherwise, set -DOPENBLAS=1.
The default version of OpenBLAS is not very stable for cross platforms, which often results in compiling errors.
OpenBLAS is integrated as a submodule which fetch source code from remote repository, so it is always up-to-date version.
OpenBLAS is integrated as a submodule which fetch source code from remote repository.
If you already have OpenBLAS in the directory, simply run "git submodule update" to fetch the latest version in the submodule directory.

# FAQ
Expand Down
84 changes: 84 additions & 0 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
file(GLOB SRCS
${CMAKE_CURRENT_SOURCE_DIR}/Readme.md
${CMAKE_CURRENT_SOURCE_DIR}/algorithms/*
${CMAKE_CURRENT_SOURCE_DIR}/bibtex/*
${CMAKE_CURRENT_SOURCE_DIR}/containers/*
${CMAKE_CURRENT_SOURCE_DIR}/geometry/*
${CMAKE_CURRENT_SOURCE_DIR}/makeutils/*
${CMAKE_CURRENT_SOURCE_DIR}/math/*
${CMAKE_CURRENT_SOURCE_DIR}/parsers/*
${CMAKE_CURRENT_SOURCE_DIR}/preprocessor/*
${CMAKE_CURRENT_SOURCE_DIR}/programoptions/*
${CMAKE_CURRENT_SOURCE_DIR}/solvers/*
${CMAKE_CURRENT_SOURCE_DIR}/string/*
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/*
${PROJECT_SOURCE_DIR}/limbo/algorithms/*.h
${PROJECT_SOURCE_DIR}/limbo/algorithms/coloring/*.h
${PROJECT_SOURCE_DIR}/limbo/algorithms/partition/*.h
${PROJECT_SOURCE_DIR}/limbo/algorithms/placement/*.h
${PROJECT_SOURCE_DIR}/test/algorithms/*.cpp
${PROJECT_SOURCE_DIR}/limbo/bibtex/*.py
${PROJECT_SOURCE_DIR}/limbo/containers/*.h
${PROJECT_SOURCE_DIR}/limbo/makeutils/*.mk
${PROJECT_SOURCE_DIR}/limbo/math/*.h
${PROJECT_SOURCE_DIR}/test/parsers/bookshelf/test_bison.cpp
${PROJECT_SOURCE_DIR}/limbo/parsers/bookshelf/bison/BookshelfDataBase.h
${PROJECT_SOURCE_DIR}/limbo/parsers/bookshelf/bison/BookshelfDriver.h
${PROJECT_SOURCE_DIR}/test/parsers/def/test_adapt.cpp
${PROJECT_SOURCE_DIR}/limbo/parsers/def/adapt/DefDataBase.h
${PROJECT_SOURCE_DIR}/limbo/parsers/def/adapt/DefDriver.h
${PROJECT_SOURCE_DIR}/test/parsers/ebeam/test_bison.cpp
${PROJECT_SOURCE_DIR}/limbo/parsers/ebeam/bison/EbeamDataBase.h
${PROJECT_SOURCE_DIR}/limbo/parsers/ebeam/bison/EbeamDriver.h
${PROJECT_SOURCE_DIR}/test/parsers/gdf/test_bison.cpp
${PROJECT_SOURCE_DIR}/limbo/parsers/gdf/bison/GdfDataBase.h
${PROJECT_SOURCE_DIR}/limbo/parsers/gdf/bison/GdfDriver.h
${PROJECT_SOURCE_DIR}/test/parsers/gdsii/*.cpp
${PROJECT_SOURCE_DIR}/limbo/parsers/gdsii/stream/*.h
${PROJECT_SOURCE_DIR}/limbo/parsers/gdsii/gdsdb/*.h
${PROJECT_SOURCE_DIR}/test/parsers/lef/test_adapt.cpp
${PROJECT_SOURCE_DIR}/limbo/parsers/lef/adapt/LefDataBase.h
${PROJECT_SOURCE_DIR}/limbo/parsers/lef/adapt/LefDriver.h
${PROJECT_SOURCE_DIR}/test/parsers/lp/test_bison.cpp
${PROJECT_SOURCE_DIR}/limbo/parsers/lp/bison/LpDataBase.h
${PROJECT_SOURCE_DIR}/limbo/parsers/lp/bison/LpDriver.h
${PROJECT_SOURCE_DIR}/test/parsers/tf/test_spirit.cpp
${PROJECT_SOURCE_DIR}/limbo/parsers/tf/spirit/TfParser.h
${PROJECT_SOURCE_DIR}/limbo/parsers/tf/spirit/ErrorHandler.h
${PROJECT_SOURCE_DIR}/test/parsers/verilog/test_bison.cpp
${PROJECT_SOURCE_DIR}/limbo/parsers/verilog/bison/VerilogDataBase.h
${PROJECT_SOURCE_DIR}/limbo/parsers/verilog/bison/VerilogDriver.h
${PROJECT_SOURCE_DIR}/test/geometry/*.cpp
${PROJECT_SOURCE_DIR}/limbo/geometry/*.h
${PROJECT_SOURCE_DIR}/limbo/geometry/api/*.h
${PROJECT_SOURCE_DIR}/limbo/preprocessor/*.h
${PROJECT_SOURCE_DIR}/test/programoptions/*.cpp
${PROJECT_SOURCE_DIR}/limbo/programoptions/*.h
${PROJECT_SOURCE_DIR}/limbo/solvers/api/*.h
${PROJECT_SOURCE_DIR}/limbo/solvers/lpmcf/*.h
${PROJECT_SOURCE_DIR}/limbo/solvers/*.h
${PROJECT_SOURCE_DIR}/test/solvers/lpmcf/*.cpp
${PROJECT_SOURCE_DIR}/test/solvers/*.cpp
${PROJECT_SOURCE_DIR}/test/string/*.cpp
${PROJECT_SOURCE_DIR}/limbo/string/*.h
)
string(REPLACE ";" " " SRCS "${SRCS}")

file(GLOB CITE_BIB_FILES
${CMAKE_CURRENT_SOURCE_DIR}/ref/Top.bib
${CMAKE_CURRENT_SOURCE_DIR}/ref/*.bib
)
string(REPLACE ";" " " CITE_BIB_FILES "${CITE_BIB_FILES}")

set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)

configure_file(${doxyfile_in} ${doxyfile} @ONLY)

add_custom_target(doc
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM)

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION docs)
Loading

0 comments on commit 8822f0e

Please sign in to comment.