build: use bundled CLN if available So one can unpack CLN tarball (or clone CLN git repository) and compile both CLN and GiNaC in one pass: git clone git://ginac.de/ginac.git cd ginac git clone git://www.ginac.de/cln.git mkdir build && cd build cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. && make
Use "modern" CMake facilities to manage includes and libs * Use target_link_libraries to specify dependencies (include paths, compiler options, etc) * Export targets and provide `ginac-config.cmake` so the following `CMakeLists.txt` is enough to build a program using GiNaC: cmake_minimum_required(VERSION 3.1) project(foo) find_package(ginac REQUIRED) add_executable(foo foo.cpp) target_link_libraries(foo PRIVATE ginac::ginac) * GiNaC can be included as a (CMake) subproject. One can put GiNaC sources (either from git or a tarball) into a subdirectory (say, `ginac`) and use the following CMakeLists.txt to build everything: cmake_minimum_required(VERSION 3.1) project(foo) add_subdirectory(ginac) add_executable(foo foo.cpp) target_link_libraries(foo PRIVATE ginac::ginac)
build: CMake: made it easier to run tests in parallel As of now `make -jN check` executes test suite sequentially (although it builds test executables in parallel). This takes a bit too long, so it would be nice to run tests in parallel. `ctest -jN` or `make test ARGS=-jN` runs tests concurrently, however it does not build test executables, instead it fails if any test binary is missing. Also `test` target is a bit special and it's impossible to add dependencies to it, see https://gitlab.kitware.com/cmake/cmake/issues/8438 To work around the problem define `test_suite` target which builds the tests suite without running it, so one can both compile and run tests in parallel make -j8 test_suite make test ARGS=-j8
Made it easier to run tests on windows Put executables and DLLs into the `bin` subdirectory so the system can locate GiNaC (and CLN) DLLs without extra configuration.
build: accept both python 3 and python 2 This makes building GiNaC a bit easier for users of "old" distributions where python 3 is not installed by default (Ubuntu 16.04), or even not available (CentOS 7). Scripts themselves work just fine with python 2.7 and python 3.x, so only minor changes to CMakeLists.txt are required (autotools scripts already handle python2/3)
Install ginac-excompiler in $LIBEXECDIR, not in $BINDIR. ...and make the GiNaC library aware of where it is installed. The ginac-excompiler script is only invoked by GiNaC::compile_ex(...) and serves no purpose on its own. In compliance with the FHS, it should be installed in $LIBEXECDIR, not in $BINDIR. This also disburdens distribution packagers from having to provide a manpage (which may be required for all programs in $BINDIR). The location for $LIBEXECDIR defaults to ${prefix}/libexec/. It may be overwritten at configuration time. (Many distributions want to set it to ${prefix}/lib/ginac/.)
[build] Force C++11 compilation when using CMake.
Remove extra cases for missing <stdint.h>. Use <cstdint> unconditionally -- it's been standardized in C++11.
Make compile_ex() work with CMake. Infrastructure fixes to make CMake find libdl and make ginac-excompiler listen to the $CXXFLAGS environment variable.
[build] GiNaC can be built with CMake now. Known issues: * no make dist * no make install-pdf