This document provides detailed installation instructions and configuration options for the Zeoran package.
Zeoran supports two installation systems - CMake and traditional Make:
-
CMake (Recommended):
- Modern, cross-platform build system
- Better dependency management and configuration handling
- Cleaner build output organization
- Preferred for new installations and cross-platform compatibility
- Uses
CMakeLists.txtas its configuration file
-
Traditional Make:
- Simpler approach for basic systems
- May be more familiar to users of older Unix systems
- Might be required in environments where CMake isn't available
- Uses
Makefileas its configuration file
Best Practices:
- For most users and new installations, use the CMake approach
- For high-performance computing (HPC) environments, both methods support static linking
- When creating reproducible workflows, document which build system was used
- Only use one build system at a time (don't mix CMake and Make)
# Build with CMake
mkdir build && cd build
cmake ..
make
# Run the program
# First copy the input file to the current directory
cp ../generate.input .
# Then run the program
./bin/zeoran# Build the project
make
# Run the program directly from build directory
./build/bin/zeoranZeoran now includes an automated preprocessing script that extracts unit cell information and atom positions directly from CIF files, eliminating the need for manual preparation of these files.
# Preprocess a CIF file for use with Zeoran
python preprocess_cif.py path/to/your/file.cif ZEOLITE_NAME
# Example
python preprocess_cif.py zeoran_data/cif_files/Framework_0_initial_1_1_1_P1.cif LTAThis will:
- Extract unit cell information from the CIF file
- Generate the necessary
unit_cell/ZEOLITE_NAME.txtfile - Generate the required
atom_sites/ZEOLITE_NAME.txtfile - Copy the CIF file to the zeoran_data directory
After preprocessing, you can use the zeolite name in your generate.input file as usual.
For convenience, a demo workflow script is provided that demonstrates the complete process:
# Run the demo workflow with a CIF file
./demo_workflow.sh path/to/your/file.cif ZEOLITE_NAME
# Example
./demo_workflow.sh zeoran_data/cif_files/Framework_0_initial_1_1_1_P1.cif LTAThis interactive script will:
- Preprocess the CIF file
- Guide you through choosing an installation method (CMake or traditional Make)
- Help you set up a generate.input file with your chosen algorithm
- Run zeoran with the processed data
This is the recommended approach for new users to quickly get started with zeoran.
If you encounter issues when running zeoran with preprocessed CIF files, consider the following:
-
CIF File Quality: Not all CIF files are suitable for zeoran. The file should:
- Contain silicon (Si) atoms and oxygen (O) atoms
- Have a proper Si:O ratio (typically around 1:2 for zeolites)
- Use fractional coordinates within [0,1]
- Have well-defined unit cell parameters
-
Floating Point Exceptions: These often occur when:
- The connectivity matrix cannot be properly constructed
- The structure doesn't follow expected zeolite topology
- Distance calculations encounter numerical issues
-
Validation: The preprocessing script includes validation steps to help identify potential issues:
python preprocess_cif.py your_file.cif ZEOLITE_NAME
Look for warnings in the output that might indicate problems with the structure.
-
Manual Verification: You can examine the generated files to ensure they match expected formats:
cat zeoran_data/unit_cell/ZEOLITE_NAME.txt head zeoran_data/atom_sites/ZEOLITE_NAME.txt
-
Debug Mode: The demo script includes debug options when crashes occur to help identify the source of problems.
This will:
- Create a
builddirectory in the repository - Build the executable in the correct location
- Copy required data files to the appropriate directory
The program will automatically use the correct data directory.
CMake provides a modern, cross-platform build system with clearer dependency management.
-
Create and navigate to a build directory:
mkdir build && cd build
-
Configure the project:
cmake ..
-
Build the executable:
make
-
Optionally install the software:
make install
The default installation path is determined by your system (typically
/usr/localon Unix systems). To install to a custom location, use:cmake .. -DCMAKE_INSTALL_PREFIX=/your/custom/path make install
The project also supports building with a traditional Makefile.
-
Build the project:
make
-
Optionally install (requires appropriate permissions):
make install
To install to a custom location:
make install PREFIX=/your/custom/path
-
For help with additional Makefile options:
make help
For high-performance computing environments where portability is important:
Using CMake:
# Load necessary modules if using a module system
module load gcc/11.2.0 eigen/3.4.0
mkdir build && cd build
cmake .. -DSTATIC=ON -DEIGEN_PATH=$EIGEN_ROOT/include
makeUsing traditional Make:
# Load necessary modules if using a module system
module load gcc/11.2.0 eigen/3.4.0
make STATIC=1 EIGEN_PATH=$EIGEN_ROOT/include
make install PREFIX=$HOME/.localWhich to choose?
- CMake: Recommended for most users, especially on modern systems or when working across different platforms
- Traditional Make: Suitable for simpler Unix environments or when CMake isn't available
- Both methods will produce the same executable with identical functionality
Two automation scripts are provided for easy installation:
-
CMake-based installation (recommended):
bash install_with_cmake.sh
This script uses CMake for the build process and installs to the
builddirectory by default. It setsEIGEN_PATHto/projects/academic/kaihangs/salmanbi/software/eigen-3.4.0. -
Traditional Make installation:
bash install_traditional_make.sh
This script uses the traditional Makefile, sets
STATIC=1for HPC compatibility, and allows customizingPREFIXandEIGEN_PATHenvironment variables.
CMake offers several configuration options that can be set during the configuration step:
| Option | Description | Default |
|---|---|---|
-DCMAKE_INSTALL_PREFIX=/path |
Installation directory | System default (typically /usr/local) |
-DEIGEN_PATH=/path/to/eigen |
Path to Eigen headers | ${CMAKE_INSTALL_PREFIX}/include/eigen3 |
-DSTATIC=ON/OFF |
Enable static linking of C++ standard library | OFF |
Example with all options:
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local \
-DEIGEN_PATH=/opt/eigen3 \
-DSTATIC=ONThe Makefile supports the following variables:
| Variable | Description | Default |
|---|---|---|
PREFIX=/path |
Installation directory | /usr/local |
EIGEN_PATH=/path |
Path to Eigen headers | /usr/local/include/eigen3 |
STATIC=1 |
Enable static linking of C++ standard library | Not set |
CXX=compiler |
Specify C++ compiler | g++ |
Example with all options:
make EIGEN_PATH=/opt/eigen3 STATIC=1 CXX=clang++
make install PREFIX=$HOME/.local# Custom build directory
make BUILD_DIR=my_buildThis will place all build artifacts in my_build/ instead of build/.
# Use Clang instead of GCC
make CXX=clang++
# Or specify a specific GCC version
make CXX=g++-11# Optimize for performance
make CXXFLAGS="-O3 -march=native"
# Debug build
make CXXFLAGS="-O0 -g -DDEBUG"# Add custom linking flags
make LDFLAGS="-L/path/to/lib -lsomelib"For most users, especially on clusters without admin privileges, installation is not necessary. You can run directly from the build directory. However, if you want to install:
# Build and install to $HOME/.local
make
make install PREFIX=$HOME/.localAdd to your PATH (add to your .bashrc or .profile for persistence):
export PATH=$PATH:$HOME/.local/bin# Install to custom location
make install PREFIX=/path/to/custom/locationAdd to your PATH:
export PATH=$PATH:/path/to/custom/location/binRequires admin privileges:
sudo make installThe program automatically looks for zeolite data files in several locations:
-
First, it checks the
ZEORAN_DATA_DIRenvironment variable:export ZEORAN_DATA_DIR=/path/to/custom/data -
Then it checks for a compiled-in default path (set at build time)
-
Finally, it falls back to:
./zeoran_data(local directory)/usr/local/share/zeoran(standard installation location)
This flexibility makes it easy to use the software with different data sets.
To clean the build directory:
make cleanIf you've installed the program:
# Default uninstall
make uninstall
# Custom location uninstall
make uninstall PREFIX=/path/to/custom/location