https://github.com/matrix97317/pig-solver
This is a toy deep-learning computing framework( such as Pytorch,Caffe etc.).
https://github.com/matrix97317/pig-solver
caffe cpp deeplearning deeplearning-framework pytorch tensorflow
Last synced: about 1 month ago
JSON representation
This is a toy deep-learning computing framework( such as Pytorch,Caffe etc.).
- Host: GitHub
- URL: https://github.com/matrix97317/pig-solver
- Owner: matrix97317
- Created: 2021-04-14T06:12:39.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-18T02:33:40.000Z (almost 5 years ago)
- Last Synced: 2025-09-01T19:18:56.077Z (9 months ago)
- Topics: caffe, cpp, deeplearning, deeplearning-framework, pytorch, tensorflow
- Language: C++
- Homepage:
- Size: 385 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Pig Solver
This is a simple deep learning framework, which does not rely on a third-party library. If you need to use efficient numerical calculation, openblas is the only third-party library that needs to be installed.

#### Install OpenBLAS
If you want to speed up running , you need to install OpenBLAS, a third-party dependency.
##### 1. Install OpenBLAS on MacOS
``` bash
brew install openblas
```
##### 2. Install OpenBLAS on Linux
In this part, we take the Linux system of Debian as an example.
``` bash
# 1. Check your gfortran tool.
$ gfortran -v
If prompting command does not exist, you need to install it.
# 2. Install gfortran
$ mkdir your_software_install_path/opt/gfortran/
$ cd your_software_install_path/opt/gfortran/
$ wget https://gfortran.meteodat.ch/download/x86_64/releases/gcc-4.8.5.tar.xz
$ xz -d gcc-4.8.5.tar.xz
$ tar -xvf gcc-4.8.5.tar
vim ~/.bashrc
export LD_LIBRARY_PATH=your_software_install_path/opt/gfortran/gcc-4.8.5/lib64:your_software_install_path/opt/gfortran/gcc-4.8.5/lib:$LD_LIBRARY_PATH
export PATH=your_software_install_path/opt/gfortran/gcc-4.8.5/bin:$PATH
source ~/.bashrc
# 3. Install OpenBLAS
$ git clone https://github.com/xianyi/OpenBLAS.git
$ cd OpenBLAS
$ make FC=gfortran -j 8
$ sudo make PREFIX=your_software_install_path/opt/OpenBLAS install
```
#### Prepare CMakeLists.txt
##### 1. MacOS
``` bash
cmake_minimum_required(VERSION 3.15)
project(pig_solver)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_COMPILER "your_software_install_path/clang++" )
set(CMAKE_C_COMPILER "your_software_install_path/clang")
set(CMAKE_CXX_FLAGS "-fopenmp -mavx -O3")
include_directories("/usr/local/include" "your_software_install_path/llvm/include" "your_software_install_path/opt/OpenBLAS/include")
link_directories("/usr/local/lib"
"your_software_install_path/llvm/lib"
"your_software_install_path/opt/OpenBLAS/lib")
add_executable(main main.cpp)
target_link_libraries(main -lomp -lblas -llapack)
```
##### 2. Linux
``` bash
cmake_minimum_required(VERSION 3.15)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "-fopenmp -mavx -msse -O3")
set(CMAKE_CXX_COMPILER "your_software_install_path/opt/gfortran/gcc-4.8.5/bin/g++" )
set(CMAKE_C_COMPILER "your_software_install_path/opt/gfortran/gcc-4.8.5/bin/gcc")
project(pig_solver)
set(CMAKE_VERBOSE_MAKEFILE ON)
include_directories("/usr/local/include" "your_software_install_path/opt/gfortran/gcc-4.8.5/include" "your_software_install_path/opt/OpenBLAS/include")
link_directories("/usr/local/lib" "your_software_install_path/opt/gfortran/gcc-4.8.5/lib" "your_software_install_path/opt/gfortran/gcc-4.8.5/gcc-4.8.5/lib64" "your_software_install_path/opt/OpenBLAS/lib")
add_executable(main main.cpp)
target_link_libraries(main libopenblas.a)
```