please check the Releases. There are pre-compiled linux (gcc 8.4.0) and windows(gnu8.3.0 & MSVC 19.29.30037.0) versions, respectively.
The CXX standard is set to be 17, which means the gcc version need to be 8 or higher. Additionally, the cmake version needs to be 3.1 or higher.
With these conditions, one can follow these steps:
- Load gcc and cmake modules. For example:
module load compiler/gcc/8.4.0
module load compiler/cmake/3.15.6
- Make sure the compiler works.
which gcc
# /public/software/compiler/gnu/gcc-8.4.0/bin/gcc # The gcc path
export CC=/public/software/compiler/gnu/gcc-8.4.0/bin/gcc
export CXX=/public/software/compiler/gnu/gcc-8.4.0/bin/g++
- Compile with commands as following:
git clone https://github.com/Franklalalala/usenauty
cd usenauty
mkdir build
cd build
cmake .. -G "Unix Makefiles"
make
The easiest way to compile is to setup a Visual Studio IDE, according to CXX 17 standard, the version of VS needs to be 17 or higher.
After that, drag the whole project into the IDE. VS will automatically cmake this project.
Finally, open the .path/to/project/src/cagesearch.cpp
file in IDE, and click build.
The target binary file will present in .path/to/project/bin/
folder.
One needs to prepare a compiler and cmake that meets requirements. See above.
The compile lines are the same as above.
Generally speaking, a binary file that compiled from an advanced compiler may achieve a better performance, especially for computation intensive programs. Therefore, we recommend the compilers that satisfies the CXX 17 standard.
On the other hand, for users who do not have the latest version of compiler, some changes of the CMakeLists.txt
may help:
- For a lower version of compiler, change the line in CMakeLists.txt to:
set(CMAKE_CXX_STANDARD 14)
This will lower the compiler version requirements to CXX 14 standard.
- For a lower version of cmake, change the line in CMakeLists.txt and src/CMakeLists.txt:
cmake_minimum_required(VERSION 3.0)
This will lower the cmake version requirements to 3.0.
Changed some files from source Version 2.7R1 (MAY 19 2019):
- naututil.h:
For msvc use, change
<sys/time.h>
to"times.h"
andtimes.c
with Macro defined for arch choice. - gtools.h:
For msvc use, change
<sys/wait.h>
to"wait.h"
- showg.c:
Add a compiler choice
ASLIB
- New
CMakeLists.txt
instead ofmakefile
. - All
boolean
type code are changed to_Boolean
- Change a Macro in
nauty.h
:FIRSTBITNZ(x)
tomsc_bsr_xx(x)
where callunsigned long p
instead ofunsigned long *p
File and wait.h
is from https://github.com/win32ports
, By MIT License. Some necessary changed is with them.
File times.h
is used for necessary function and types.
Additionally, this project conducted several changes comparing to the original modification in saltball/usenauty (github.com).
-
The step and random mode are created on top of the base mode.
-
Code structures are refactored to enable some suitable API.
-
Several test files in
./cmd_test/
folder.- Mode test and speed test for fullerene systems in
cmd_test/fullerene
- One dimension PBC system in
cmd_test/cabon_nano_tube
- Two dimension PBC system in
cmd_test/graphene_nano_ribbon
- Mode test and speed test for fullerene systems in
-
Bugs fixed for compilation in the Linux platform. (credit to @saltball)
This repo is try to use nauty
for some chemical research and create some new API. It's still on going.
Original License is COPYRIGHT